History

netfilter: extract Passive OS fingerprint infrastructure from xt_osf

Add nf_osf_ttl() and nf_osf_match() into nf_osf.c to prepare for nf_tables support.

Fernando Fernandez Mancera committed 8 years ago

Commit bfb15f21 parent 3f9c56a7 files · +359 −289Browse files

Showing the changes to include/linux/netfilter (1 of 7 files). Show all

Unified · Split

include/linux/netfilter/nf_osf.h+27−0
@@ -0,0 +1,27 @@
1+#include <uapi/linux/netfilter/nf_osf.h>
2+
3+/* Initial window size option state machine: multiple of mss, mtu or
4+ * plain numeric value. Can also be made as plain numeric value which
5+ * is not a multiple of specified value.
6+ */
7+enum nf_osf_window_size_options {
8+ OSF_WSS_PLAIN = 0,
9+ OSF_WSS_MSS,
10+ OSF_WSS_MTU,
11+ OSF_WSS_MODULO,
12+ OSF_WSS_MAX,
13+};
14+
15+enum osf_fmatch_states {
16+ /* Packet does not match the fingerprint */
17+ FMATCH_WRONG = 0,
18+ /* Packet matches the fingerprint */
19+ FMATCH_OK,
20+ /* Options do not match the fingerprint, but header does */
21+ FMATCH_OPT_WRONG,
22+};
23+
24+bool nf_osf_match(const struct sk_buff *skb, u_int8_t family,
25+ int hooknum, struct net_device *in, struct net_device *out,
26+ const struct nf_osf_info *info, struct net *net,
27+ const struct list_head *nf_osf_fingers);