1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
3 * Copyright (c) 2003+ Evgeniy Polyakov <johnpol@2ka.mxt.ru>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
23 #include <linux/types.h>
25 #include <linux/tcp.h>
27 #define MAXGENRELEN 32
29 #define XT_OSF_GENRE (1<<0)
30 #define XT_OSF_TTL (1<<1)
31 #define XT_OSF_LOG (1<<2)
32 #define XT_OSF_INVERT (1<<3)
34 #define XT_OSF_LOGLEVEL_ALL 0 /* log all matched fingerprints */
35 #define XT_OSF_LOGLEVEL_FIRST 1 /* log only the first matced fingerprint */
36 #define XT_OSF_LOGLEVEL_ALL_KNOWN 2 /* do not log unknown packets */
38 #define XT_OSF_TTL_TRUE 0 /* True ip and fingerprint TTL comparison */
39 #define XT_OSF_TTL_LESS 1 /* Check if ip TTL is less than fingerprint one */
40 #define XT_OSF_TTL_NOCHECK 2 /* Do not compare ip and fingerprint TTL at all */
43 char genre
[MAXGENRELEN
];
51 * Wildcard MSS (kind of).
52 * It is used to implement a state machine for the different wildcard values
53 * of the MSS and window sizes.
61 * This struct represents IANA options
62 * http://www.iana.org/assignments/tcp-parameters
69 struct xt_osf_user_finger
{
76 char genre
[MAXGENRELEN
];
77 char version
[MAXGENRELEN
];
78 char subtype
[MAXGENRELEN
];
80 /* MAX_IPOPTLEN is maximum if all options are NOPs or EOLs */
81 struct xt_osf_opt opt
[MAX_IPOPTLEN
];
85 struct xt_osf_user_finger f
;
90 /* Defines for IANA option kinds */
93 OSFOPT_EOL
= 0, /* End of options */
95 OSFOPT_MSS
, /* Maximum segment size */
96 OSFOPT_WSO
, /* Window scale option */
97 OSFOPT_SACKP
, /* SACK permitted */
98 OSFOPT_SACK
, /* SACK */
101 OSFOPT_TS
, /* Timestamp option */
102 OSFOPT_POCP
, /* Partial Order Connection Permitted */
103 OSFOPT_POSP
, /* Partial Order Service Profile */
105 /* Others are not used in the current OSF */
110 * Initial window size option state machine: multiple of mss, mtu or
111 * plain numeric value. Can also be made as plain numeric value which
112 * is not a multiple of specified value.
114 enum xt_osf_window_size_options
{
123 * Add/remove fingerprint from the kernel.
125 enum xt_osf_msg_types
{
131 enum xt_osf_attr_type
{
137 #endif /* _XT_OSF_H */