Miniupnpd: update to 1.9 (20150430)
[tomato.git] / release / src / router / miniupnpd / netfilter_nft / nftnlrdr.h
blob1acf4b33562869457859004ca90f7d722cf0857a
1 /*
2 * MiniUPnP project
3 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4 * (c) 2015 Tomofumi Hayashi
5 *
6 * This software is subject to the conditions detailed
7 * in the LICENCE file provided within the distribution.
8 */
10 #ifndef NFTNLRDR_H_INCLUDED
11 #define NFTNLRDR_H_INCLUDED
13 #include "../commonrdr.h"
14 int init_redirect(void);
15 void shutdown_redirect(void);
17 int
18 add_redirect_rule2(const char * ifname,
19 const char * rhost, unsigned short eport,
20 const char * iaddr, unsigned short iport, int proto,
21 const char * desc, unsigned int timestamp);
23 int
24 add_peer_redirect_rule2(const char * ifname,
25 const char * rhost, unsigned short rport,
26 const char * eaddr, unsigned short eport,
27 const char * iaddr, unsigned short iport, int proto,
28 const char * desc, unsigned int timestamp);
30 int
31 add_filter_rule2(const char * ifname,
32 const char * rhost, const char * iaddr,
33 unsigned short eport, unsigned short iport,
34 int proto, const char * desc);
36 int
37 delete_redirect_and_filter_rules(unsigned short eport, int proto);
39 int
40 add_peer_dscp_rule2(const char * ifname,
41 const char * rhost, unsigned short rport,
42 unsigned char dscp,
43 const char * iaddr, unsigned short iport, int proto,
44 const char * desc, unsigned int timestamp);
46 int
47 get_peer_rule_by_index(int index,
48 char * ifname, unsigned short * eport,
49 char * iaddr, int iaddrlen, unsigned short * iport,
50 int * proto, char * desc, int desclen,
51 char * rhost, int rhostlen, unsigned short * rport,
52 unsigned int * timestamp,
53 u_int64_t * packets, u_int64_t * bytes);
54 int
55 get_nat_redirect_rule(const char * nat_chain_name, const char * ifname,
56 unsigned short eport, int proto,
57 char * iaddr, int iaddrlen, unsigned short * iport,
58 char * desc, int desclen,
59 char * rhost, int rhostlen,
60 unsigned int * timestamp,
61 u_int64_t * packets, u_int64_t * bytes);
62 int
63 get_redirect_rule_by_index(int index,
64 char * ifname, unsigned short * eport,
65 char * iaddr, int iaddrlen, unsigned short * iport,
66 int * proto, char * desc, int desclen,
67 char * rhost, int rhostlen,
68 unsigned int * timestamp,
69 u_int64_t * packets, u_int64_t * bytes);
71 unsigned short *
72 get_portmappings_in_range(unsigned short startport, unsigned short endport,
73 int proto, unsigned int * number);
75 /* in nfct_get.c */
76 int get_nat_ext_addr(struct sockaddr* src, struct sockaddr *dst, uint8_t proto,
77 struct sockaddr* ret_ext);
79 /* for debug */
80 int
81 list_redirect_rule(const char * ifname);
83 #endif