1#ifndef _NF_OSF_H
2#define _NF_OSF_H
3
4#include <linux/types.h>
5#include <linux/ip.h>
6#include <linux/tcp.h>
7
8#define MAXGENRELEN 32
9
10#define NF_OSF_GENRE (1 << 0)
11#define NF_OSF_TTL (1 << 1)
12#define NF_OSF_LOG (1 << 2)
13#define NF_OSF_INVERT (1 << 3)
14
15#define NF_OSF_LOGLEVEL_ALL 0
16#define NF_OSF_LOGLEVEL_FIRST 1
17#define NF_OSF_LOGLEVEL_ALL_KNOWN 2
18
19#define NF_OSF_TTL_TRUE 0
20
21
22#define NF_OSF_TTL_LESS 1
23
24
25#define NF_OSF_TTL_NOCHECK 2
26
27#define NF_OSF_FLAGMASK (NF_OSF_GENRE | NF_OSF_TTL | \
28 NF_OSF_LOG | NF_OSF_INVERT)
29
30
31
32
33struct nf_osf_wc {
34 __u32 wc;
35 __u32 val;
36};
37
38
39
40
41struct nf_osf_opt {
42 __u16 kind, length;
43 struct nf_osf_wc wc;
44};
45
46struct nf_osf_info {
47 char genre[MAXGENRELEN];
48 __u32 len;
49 __u32 flags;
50 __u32 loglevel;
51 __u32 ttl;
52};
53
54struct nf_osf_user_finger {
55 struct nf_osf_wc wss;
56
57 __u8 ttl, df;
58 __u16 ss, mss;
59 __u16 opt_num;
60
61 char genre[MAXGENRELEN];
62 char version[MAXGENRELEN];
63 char subtype[MAXGENRELEN];
64
65
66 struct nf_osf_opt opt[MAX_IPOPTLEN];
67};
68
69struct nf_osf_nlmsg {
70 struct nf_osf_user_finger f;
71 struct iphdr ip;
72 struct tcphdr tcp;
73};
74
75
76enum iana_options {
77 OSFOPT_EOL = 0,
78 OSFOPT_NOP,
79 OSFOPT_MSS,
80 OSFOPT_WSO,
81 OSFOPT_SACKP,
82 OSFOPT_SACK,
83 OSFOPT_ECHO,
84 OSFOPT_ECHOREPLY,
85 OSFOPT_TS,
86 OSFOPT_POCP,
87 OSFOPT_POSP,
88
89
90 OSFOPT_EMPTY = 255,
91};
92
93
94
95
96
97enum nf_osf_window_size_options {
98 OSF_WSS_PLAIN = 0,
99 OSF_WSS_MSS,
100 OSF_WSS_MTU,
101 OSF_WSS_MODULO,
102 OSF_WSS_MAX,
103};
104
105enum nf_osf_attr_type {
106 OSF_ATTR_UNSPEC,
107 OSF_ATTR_FINGER,
108 OSF_ATTR_MAX,
109};
110
111
112
113
114enum nf_osf_msg_types {
115 OSF_MSG_ADD,
116 OSF_MSG_REMOVE,
117 OSF_MSG_MAX,
118};
119
120#endif
121