Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 1 | This module sets the netfilter mark value associated with a connection. |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 2 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 3 | \fB\-\-set\-xmark\fP \fIvalue\fP[\fB/\fP\fImask\fP] |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 4 | Zero out the bits given by \fImask\fR and XOR \fIvalue\fR into the ctmark. |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 5 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 6 | \fB\-\-save\-mark\fP [\fB\-\-nfmask\fP \fInfmask\fP] [\fB\-\-ctmask\fP \fIctmask\fP] |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 7 | Copy the packet mark (nfmark) to the connection mark (ctmark) using the given |
| 8 | masks. The new nfmark value is determined as follows: |
| 9 | .IP |
| 10 | ctmark = (ctmark & ~ctmask) ^ (nfmark & nfmask) |
| 11 | .IP |
| 12 | i.e. \fIctmask\fR defines what bits to clear and \fInfmask\fR what bits of the |
| 13 | nfmark to XOR into the ctmark. \fIctmask\fR and \fInfmask\fR default to |
| 14 | 0xFFFFFFFF. |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 15 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 16 | \fB\-\-restore\-mark\fP [\fB\-\-nfmask\fP \fInfmask\fP] [\fB\-\-ctmask\fP \fIctmask\fP] |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 17 | Copy the connection mark (ctmark) to the packet mark (nfmark) using the given |
| 18 | masks. The new ctmark value is determined as follows: |
| 19 | .IP |
| 20 | nfmark = (nfmark & ~\fInfmask\fR) ^ (ctmark & \fIctmask\fR); |
| 21 | .IP |
| 22 | i.e. \fInfmask\fR defines what bits to clear and \fIctmask\fR what bits of the |
| 23 | ctmark to XOR into the nfmark. \fIctmask\fR and \fInfmask\fR default to |
| 24 | 0xFFFFFFFF. |
| 25 | .IP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 26 | \fB\-\-restore\-mark\fP is only valid in the \fBmangle\fP table. |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 27 | .PP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 28 | The following mnemonics are available for \fB\-\-set\-xmark\fP: |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 29 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 30 | \fB\-\-and\-mark\fP \fIbits\fP |
| 31 | Binary AND the ctmark with \fIbits\fR. (Mnemonic for \fB\-\-set\-xmark |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 32 | 0/\fR\fIinvbits\fR, where \fIinvbits\fR is the binary negation of \fIbits\fR.) |
| 33 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 34 | \fB\-\-or\-mark\fP \fIbits\fP |
| 35 | Binary OR the ctmark with \fIbits\fR. (Mnemonic for \fB\-\-set\-xmark\fP |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 36 | \fIbits\fR\fB/\fR\fIbits\fR.) |
| 37 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 38 | \fB\-\-xor\-mark\fP \fIbits\fP |
| 39 | Binary XOR the ctmark with \fIbits\fR. (Mnemonic for \fB\-\-set\-xmark\fP |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 40 | \fIbits\fR\fB/0\fR.) |
| 41 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 42 | \fB\-\-set\-mark\fP \fIvalue\fP[\fB/\fP\fImask\fP] |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 43 | Set the connection mark. If a mask is specified then only those bits set in the |
| 44 | mask are modified. |
| 45 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 46 | \fB\-\-save\-mark\fP [\fB\-\-mask\fP \fImask\fP] |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 47 | Copy the nfmark to the ctmark. If a mask is specified, only those bits are |
| 48 | copied. |
| 49 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 50 | \fB\-\-restore\-mark\fP [\fB\-\-mask\fP \fImask\fP] |
Jan Engelhardt | ff06871 | 2008-01-29 13:36:27 +0000 | [diff] [blame] | 51 | Copy the ctmark to the nfmark. If a mask is specified, only those bits are |
| 52 | copied. This is only valid in the \fBmangle\fR table. |