Blame extensions/libxt_time.man

Packit 7b22a4
This matches if the packet arrival time/date is within a given range. All
Packit 7b22a4
options are optional, but are ANDed when specified. All times are interpreted
Packit 7b22a4
as UTC by default.
Packit 7b22a4
.TP
Packit 7b22a4
\fB\-\-datestart\fP \fIYYYY\fP[\fB\-\fP\fIMM\fP[\fB\-\fP\fIDD\fP[\fBT\fP\fIhh\fP[\fB:\fP\fImm\fP[\fB:\fP\fIss\fP]]]]]
Packit 7b22a4
.TP
Packit 7b22a4
\fB\-\-datestop\fP \fIYYYY\fP[\fB\-\fP\fIMM\fP[\fB\-\fP\fIDD\fP[\fBT\fP\fIhh\fP[\fB:\fP\fImm\fP[\fB:\fP\fIss\fP]]]]]
Packit 7b22a4
Only match during the given time, which must be in ISO 8601 "T" notation.
Packit 7b22a4
The possible time range is 1970-01-01T00:00:00 to 2038-01-19T04:17:07.
Packit 7b22a4
.IP
Packit 7b22a4
If \-\-datestart or \-\-datestop are not specified, it will default to 1970-01-01
Packit 7b22a4
and 2038-01-19, respectively.
Packit 7b22a4
.TP
Packit 7b22a4
\fB\-\-timestart\fP \fIhh\fP\fB:\fP\fImm\fP[\fB:\fP\fIss\fP]
Packit 7b22a4
.TP
Packit 7b22a4
\fB\-\-timestop\fP \fIhh\fP\fB:\fP\fImm\fP[\fB:\fP\fIss\fP]
Packit 7b22a4
Only match during the given daytime. The possible time range is 00:00:00 to
Packit 7b22a4
23:59:59. Leading zeroes are allowed (e.g. "06:03") and correctly interpreted
Packit 7b22a4
as base-10.
Packit 7b22a4
.TP
Packit 7b22a4
[\fB!\fP] \fB\-\-monthdays\fP \fIday\fP[\fB,\fP\fIday\fP...]
Packit 7b22a4
Only match on the given days of the month. Possible values are \fB1\fP
Packit 7b22a4
to \fB31\fP. Note that specifying \fB31\fP will of course not match
Packit 7b22a4
on months which do not have a 31st day; the same goes for 28- or 29-day
Packit 7b22a4
February.
Packit 7b22a4
.TP
Packit 7b22a4
[\fB!\fP] \fB\-\-weekdays\fP \fIday\fP[\fB,\fP\fIday\fP...]
Packit 7b22a4
Only match on the given weekdays. Possible values are \fBMon\fP, \fBTue\fP,
Packit 7b22a4
\fBWed\fP, \fBThu\fP, \fBFri\fP, \fBSat\fP, \fBSun\fP, or values from \fB1\fP
Packit 7b22a4
to \fB7\fP, respectively. You may also use two-character variants (\fBMo\fP,
Packit 7b22a4
\fBTu\fP, etc.).
Packit 7b22a4
.TP
Packit 7b22a4
\fB\-\-contiguous\fP
Packit 7b22a4
When \fB\-\-timestop\fP is smaller than \fB\-\-timestart\fP value, match
Packit 7b22a4
this as a single time period instead distinct intervals.  See EXAMPLES.
Packit 7b22a4
.TP
Packit 7b22a4
\fB\-\-kerneltz\fP
Packit 7b22a4
Use the kernel timezone instead of UTC to determine whether a packet meets the
Packit 7b22a4
time regulations.
Packit 7b22a4
.PP
Packit 7b22a4
About kernel timezones: Linux keeps the system time in UTC, and always does so.
Packit 7b22a4
On boot, system time is initialized from a referential time source. Where this
Packit 7b22a4
time source has no timezone information, such as the x86 CMOS RTC, UTC will be
Packit 7b22a4
assumed. If the time source is however not in UTC, userspace should provide the
Packit 7b22a4
correct system time and timezone to the kernel once it has the information.
Packit 7b22a4
.PP
Packit 7b22a4
Local time is a feature on top of the (timezone independent) system time. Each
Packit 7b22a4
process has its own idea of local time, specified via the TZ environment
Packit 7b22a4
variable. The kernel also has its own timezone offset variable. The TZ
Packit 7b22a4
userspace environment variable specifies how the UTC-based system time is
Packit 7b22a4
displayed, e.g. when you run date(1), or what you see on your desktop clock.
Packit 7b22a4
The TZ string may resolve to different offsets at different dates, which is
Packit 7b22a4
what enables the automatic time-jumping in userspace. when DST changes. The
Packit 7b22a4
kernel's timezone offset variable is used when it has to convert between
Packit 7b22a4
non-UTC sources, such as FAT filesystems, to UTC (since the latter is what the
Packit 7b22a4
rest of the system uses).
Packit 7b22a4
.PP
Packit 7b22a4
The caveat with the kernel timezone is that Linux distributions may ignore to
Packit 7b22a4
set the kernel timezone, and instead only set the system time. Even if a
Packit 7b22a4
particular distribution does set the timezone at boot, it is usually does not
Packit 7b22a4
keep the kernel timezone offset - which is what changes on DST - up to date.
Packit 7b22a4
ntpd will not touch the kernel timezone, so running it will not resolve the
Packit 7b22a4
issue. As such, one may encounter a timezone that is always +0000, or one that
Packit 7b22a4
is wrong half of the time of the year. As such, \fBusing \-\-kerneltz is highly
Packit 7b22a4
discouraged.\fP
Packit 7b22a4
.PP
Packit 7b22a4
EXAMPLES. To match on weekends, use:
Packit 7b22a4
.IP
Packit 7b22a4
\-m time \-\-weekdays Sa,Su
Packit 7b22a4
.PP
Packit 7b22a4
Or, to match (once) on a national holiday block:
Packit 7b22a4
.IP
Packit 7b22a4
\-m time \-\-datestart 2007\-12\-24 \-\-datestop 2007\-12\-27
Packit 7b22a4
.PP
Packit 7b22a4
Since the stop time is actually inclusive, you would need the following stop
Packit 7b22a4
time to not match the first second of the new day:
Packit 7b22a4
.IP
Packit 7b22a4
\-m time \-\-datestart 2007\-01\-01T17:00 \-\-datestop 2007\-01\-01T23:59:59
Packit 7b22a4
.PP
Packit 7b22a4
During lunch hour:
Packit 7b22a4
.IP
Packit 7b22a4
\-m time \-\-timestart 12:30 \-\-timestop 13:30
Packit 7b22a4
.PP
Packit 7b22a4
The fourth Friday in the month:
Packit 7b22a4
.IP
Packit 7b22a4
\-m time \-\-weekdays Fr \-\-monthdays 22,23,24,25,26,27,28
Packit 7b22a4
.PP
Packit 7b22a4
(Note that this exploits a certain mathematical property. It is not possible to
Packit 7b22a4
say "fourth Thursday OR fourth Friday" in one rule. It is possible with
Packit 7b22a4
multiple rules, though.)
Packit 7b22a4
.PP
Packit 7b22a4
Matching across days might not do what is expected.  For instance,
Packit 7b22a4
.IP
Packit 7b22a4
\-m time \-\-weekdays Mo \-\-timestart 23:00  \-\-timestop 01:00
Packit 7b22a4
Will match Monday, for one hour from midnight to 1 a.m., and then
Packit 7b22a4
again for another hour from 23:00 onwards.  If this is unwanted, e.g. if you
Packit 7b22a4
would like 'match for two hours from Montay 23:00 onwards' you need to also specify
Packit 7b22a4
the \-\-contiguous option in the example above.