summaryrefslogtreecommitdiffstats
path: root/include/internal/deprecated.h
blob: fe6f89074d4474804b53a31932a2214eee5ab919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * WARNING: Do *NOT* ever include this file, only for internal use!
 */
#ifndef _NFCT_DEPRECATED_H_
#define _NFCT_DEPRECATED_H_

typedef int (*nfct_handler)(struct nfct_handle *cth, struct nlmsghdr *nlh,
			    void *arg);

/* some systems have old libc's */
#include <netinet/in.h>
#ifndef IPPROTO_SCTP
#define IPPROTO_SCTP	132
#endif

#include "internal/linux_list.h"

/* extensions */
struct nfct_proto {
	struct list_head head;
	
	char 		*name;
	u_int8_t 	protonum;
	char		*version;
	
	void (*parse_proto)(struct nfattr **, struct nfct_tuple *);
	void (*parse_protoinfo)(struct nfattr **, struct nfct_conntrack *);
	void (*build_tuple_proto)(struct nfnlhdr *, int, struct nfct_tuple *);
	void (*build_protoinfo)(struct nfnlhdr *, int, struct nfct_conntrack *);
	int (*print_protoinfo)(char *, union nfct_protoinfo *);
	int (*print_proto)(char *, struct nfct_tuple *);
	int (*compare)(struct nfct_conntrack *, struct nfct_conntrack *,
		       unsigned int);
};

extern void nfct_register_proto(struct nfct_proto *h);

struct nfct_l3proto {
	struct list_head head;
	
	char 		*name;
	u_int16_t 	protonum;
	char		*version;
	
	void (*parse_proto)(struct nfattr **, struct nfct_tuple *);
	void (*build_tuple_proto)(struct nfnlhdr *, int, struct nfct_tuple *);
	int (*print_proto)(char *, struct nfct_tuple *);
	int (*compare)(struct nfct_conntrack *, struct nfct_conntrack *,
		       unsigned int);
};

extern void nfct_register_l3proto(struct nfct_l3proto *h);

/* backward compatibility of the deprecated API */
extern struct nfct_l3proto ipv4;
extern struct nfct_l3proto ipv6;

extern struct nfct_proto tcp;
extern struct nfct_proto udp;
extern struct nfct_proto sctp;
extern struct nfct_proto icmp;

extern void deprecated_backward_support();

#endif