1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _NFOSF_H
3#define _NFOSF_H
4
5#include <uapi/linux/netfilter/nfnetlink_osf.h>
6
7enum osf_fmatch_states {
8	/* Packet does not match the fingerprint */
9	FMATCH_WRONG = 0,
10	/* Packet matches the fingerprint */
11	FMATCH_OK,
12	/* Options do not match the fingerprint, but header does */
13	FMATCH_OPT_WRONG,
14};
15
16extern struct list_head nf_osf_fingers[2];
17
18struct nf_osf_finger {
19	struct rcu_head			rcu_head;
20	struct list_head		finger_entry;
21	struct nf_osf_user_finger	finger;
22};
23
24struct nf_osf_data {
25	const char *genre;
26	const char *version;
27};
28
29bool nf_osf_match(const struct sk_buff *skb, u_int8_t family,
30		  int hooknum, struct net_device *in, struct net_device *out,
31		  const struct nf_osf_info *info, struct net *net,
32		  const struct list_head *nf_osf_fingers);
33
34bool nf_osf_find(const struct sk_buff *skb,
35		 const struct list_head *nf_osf_fingers,
36		 const int ttl_check, struct nf_osf_data *data);
37
38#endif /* _NFOSF_H */
39