Merge tag 'drm-intel-next-fixes-2018-08-16-1' of git://anongit.freedesktop.org/drm...
[sfrench/cifs-2.6.git] / include / uapi / linux / netfilter / nf_osf.h
1 #ifndef _NF_OSF_H
2 #define _NF_OSF_H
3
4 #include <linux/types.h>
5
6 #define MAXGENRELEN     32
7
8 #define NF_OSF_GENRE    (1 << 0)
9 #define NF_OSF_TTL      (1 << 1)
10 #define NF_OSF_LOG      (1 << 2)
11 #define NF_OSF_INVERT   (1 << 3)
12
13 #define NF_OSF_LOGLEVEL_ALL             0       /* log all matched fingerprints */
14 #define NF_OSF_LOGLEVEL_FIRST           1       /* log only the first matced fingerprint */
15 #define NF_OSF_LOGLEVEL_ALL_KNOWN       2       /* do not log unknown packets */
16
17 #define NF_OSF_TTL_TRUE                 0       /* True ip and fingerprint TTL comparison */
18
19 /* Do not compare ip and fingerprint TTL at all */
20 #define NF_OSF_TTL_NOCHECK              2
21
22 /* Wildcard MSS (kind of).
23  * It is used to implement a state machine for the different wildcard values
24  * of the MSS and window sizes.
25  */
26 struct nf_osf_wc {
27         __u32   wc;
28         __u32   val;
29 };
30
31 /* This struct represents IANA options
32  * http://www.iana.org/assignments/tcp-parameters
33  */
34 struct nf_osf_opt {
35         __u16                   kind, length;
36         struct nf_osf_wc        wc;
37 };
38
39 struct nf_osf_info {
40         char    genre[MAXGENRELEN];
41         __u32   len;
42         __u32   flags;
43         __u32   loglevel;
44         __u32   ttl;
45 };
46
47 struct nf_osf_user_finger {
48         struct nf_osf_wc        wss;
49
50         __u8    ttl, df;
51         __u16   ss, mss;
52         __u16   opt_num;
53
54         char    genre[MAXGENRELEN];
55         char    version[MAXGENRELEN];
56         char    subtype[MAXGENRELEN];
57
58         /* MAX_IPOPTLEN is maximum if all options are NOPs or EOLs */
59         struct nf_osf_opt       opt[MAX_IPOPTLEN];
60 };
61
62 struct nf_osf_nlmsg {
63         struct nf_osf_user_finger       f;
64         struct iphdr                    ip;
65         struct tcphdr                   tcp;
66 };
67
68 /* Defines for IANA option kinds */
69 enum iana_options {
70         OSFOPT_EOL = 0,         /* End of options */
71         OSFOPT_NOP,             /* NOP */
72         OSFOPT_MSS,             /* Maximum segment size */
73         OSFOPT_WSO,             /* Window scale option */
74         OSFOPT_SACKP,           /* SACK permitted */
75         OSFOPT_SACK,            /* SACK */
76         OSFOPT_ECHO,
77         OSFOPT_ECHOREPLY,
78         OSFOPT_TS,              /* Timestamp option */
79         OSFOPT_POCP,            /* Partial Order Connection Permitted */
80         OSFOPT_POSP,            /* Partial Order Service Profile */
81
82         /* Others are not used in the current OSF */
83         OSFOPT_EMPTY = 255,
84 };
85
86 #endif /* _NF_OSF_H */