2018-07-13 12:54:45 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _NFOSF_H
|
|
|
|
#define _NFOSF_H
|
|
|
|
|
2018-07-31 18:25:01 +00:00
|
|
|
#include <uapi/linux/netfilter/nfnetlink_osf.h>
|
2018-05-03 12:05:40 +00:00
|
|
|
|
|
|
|
enum osf_fmatch_states {
|
|
|
|
/* Packet does not match the fingerprint */
|
|
|
|
FMATCH_WRONG = 0,
|
|
|
|
/* Packet matches the fingerprint */
|
|
|
|
FMATCH_OK,
|
|
|
|
/* Options do not match the fingerprint, but header does */
|
|
|
|
FMATCH_OPT_WRONG,
|
|
|
|
};
|
|
|
|
|
2018-07-31 18:25:00 +00:00
|
|
|
extern struct list_head nf_osf_fingers[2];
|
|
|
|
|
2018-05-08 08:05:38 +00:00
|
|
|
struct nf_osf_finger {
|
|
|
|
struct rcu_head rcu_head;
|
|
|
|
struct list_head finger_entry;
|
|
|
|
struct nf_osf_user_finger finger;
|
|
|
|
};
|
|
|
|
|
2019-03-27 10:36:26 +00:00
|
|
|
struct nf_osf_data {
|
|
|
|
const char *genre;
|
|
|
|
const char *version;
|
|
|
|
};
|
|
|
|
|
2018-05-03 12:05:40 +00:00
|
|
|
bool nf_osf_match(const struct sk_buff *skb, u_int8_t family,
|
|
|
|
int hooknum, struct net_device *in, struct net_device *out,
|
|
|
|
const struct nf_osf_info *info, struct net *net,
|
|
|
|
const struct list_head *nf_osf_fingers);
|
2018-07-13 12:54:45 +00:00
|
|
|
|
2019-03-27 10:36:26 +00:00
|
|
|
bool nf_osf_find(const struct sk_buff *skb,
|
|
|
|
const struct list_head *nf_osf_fingers,
|
|
|
|
const int ttl_check, struct nf_osf_data *data);
|
2018-07-13 12:54:45 +00:00
|
|
|
|
|
|
|
#endif /* _NFOSF_H */
|