Monero
nftnlrdr.h
Go to the documentation of this file.
1 /*
2  * MiniUPnP project
3  * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4  * (c) 2015 Tomofumi Hayashi
5  * (c) 2019 Paul Chambers
6  *
7  * This software is subject to the conditions detailed
8  * in the LICENCE file provided within the distribution.
9  */
10 
11 #ifndef NFTNLRDR_H_INCLUDED
12 #define NFTNLRDR_H_INCLUDED
13 
14 #include "../commonrdr.h"
15 
16 int init_redirect(void);
17 void shutdown_redirect(void);
18 
19 int
20 add_redirect_rule2(const char * ifname,
21  const char * rhost, unsigned short eport,
22  const char * iaddr, unsigned short iport, int proto,
23  const char * desc, unsigned int timestamp);
24 
25 int
26 add_peer_redirect_rule2(const char * ifname,
27  const char * rhost, unsigned short rport,
28  const char * eaddr, unsigned short eport,
29  const char * iaddr, unsigned short iport, int proto,
30  const char * desc, unsigned int timestamp);
31 
32 int
33 add_filter_rule2(const char * ifname,
34  const char * rhost, const char * iaddr,
35  unsigned short eport, unsigned short iport,
36  int proto, const char * desc);
37 
38 int
39 delete_redirect_and_filter_rules(unsigned short eport, int proto);
40 
41 int
42 delete_filter_rule(const char * ifname, unsigned short port, int proto);
43 
44 int
45 add_peer_dscp_rule2(const char * ifname,
46  const char * rhost, unsigned short rport,
47  unsigned char dscp,
48  const char * iaddr, unsigned short iport, int proto,
49  const char * desc, unsigned int timestamp);
50 
51 int
52 get_peer_rule_by_index(int index,
53  char * ifname, unsigned short * eport,
54  char * iaddr, int iaddrlen, unsigned short * iport,
55  int * proto, char * desc, int desclen,
56  char * rhost, int rhostlen, unsigned short * rport,
57  unsigned int * timestamp,
58  u_int64_t * packets, u_int64_t * bytes);
59 int
60 get_nat_redirect_rule(const char * nat_chain_name, const char * ifname,
61  unsigned short eport, int proto,
62  char * iaddr, int iaddrlen, unsigned short * iport,
63  char * desc, int desclen,
64  char * rhost, int rhostlen,
65  unsigned int * timestamp,
66  u_int64_t * packets, u_int64_t * bytes);
67 int
69  char * ifname, unsigned short * eport,
70  char * iaddr, int iaddrlen, unsigned short * iport,
71  int * proto, char * desc, int desclen,
72  char * rhost, int rhostlen,
73  unsigned int * timestamp,
74  u_int64_t * packets, u_int64_t * bytes);
75 
76 unsigned short *
77 get_portmappings_in_range(unsigned short startport, unsigned short endport,
78  int proto, unsigned int * number);
79 
80 /* in nfct_get.c */
81 int get_nat_ext_addr(struct sockaddr* src, struct sockaddr *dst, uint8_t proto,
82  struct sockaddr* ret_ext);
83 
84 #endif
int get_peer_rule_by_index(int index, char *ifname, unsigned short *eport, char *iaddr, int iaddrlen, unsigned short *iport, int *proto, char *desc, int desclen, char *rhost, int rhostlen, unsigned short *rport, unsigned int *timestamp, u_int64_t *packets, u_int64_t *bytes)
Definition: iptcrdr.c:529
static const char * ifname
Definition: testipfwrdr.c:17
int add_peer_dscp_rule2(const char *ifname, const char *rhost, unsigned short rport, unsigned char dscp, const char *iaddr, unsigned short iport, int proto, const char *desc, unsigned int timestamp)
Definition: iptcrdr.c:303
string proto
Definition: pymoduletest.py:71
unsigned char uint8_t
Definition: stdint.h:124
desc
Definition: pymoduletest.py:79
int add_peer_redirect_rule2(const char *ifname, const char *rhost, unsigned short rport, const char *eaddr, unsigned short eport, const char *iaddr, unsigned short iport, int proto, const char *desc, unsigned int timestamp)
Definition: iptcrdr.c:287
void shutdown_redirect(void)
Definition: ipfrdr.c:215
int delete_filter_rule(const char *ifname, unsigned short port, int proto)
Definition: ipfrdr.c:654
int init_redirect(void)
Definition: ipfrdr.c:199
int delete_redirect_and_filter_rules(unsigned short eport, int proto)
Definition: iptcrdr.c:732
int add_filter_rule2(const char *ifname, const char *rhost, const char *iaddr, unsigned short eport, unsigned short iport, int proto, const char *desc)
Definition: ipfrdr.c:564
boost::endian::big_uint16_t port
Definition: socks.cpp:61
int add_redirect_rule2(const char *ifname, const char *rhost, unsigned short eport, const char *iaddr, unsigned short iport, int proto, const char *desc, unsigned int timestamp)
Definition: ipfrdr.c:230
unsigned short * get_portmappings_in_range(unsigned short startport, unsigned short endport, int proto, unsigned int *number)
Definition: ipfrdr.c:729
int get_nat_ext_addr(struct sockaddr *src, struct sockaddr *dst, uint8_t proto, struct sockaddr *ret_ext)
int get_redirect_rule_by_index(int index, char *ifname, unsigned short *eport, char *iaddr, int iaddrlen, unsigned short *iport, int *proto, char *desc, int desclen, char *rhost, int rhostlen, unsigned int *timestamp, u_int64_t *packets, u_int64_t *bytes)
Definition: ipfrdr.c:403
eport
Definition: testupnpigd.py:58
int get_nat_redirect_rule(const char *nat_chain_name, const char *ifname, unsigned short eport, int proto, char *iaddr, int iaddrlen, unsigned short *iport, char *desc, int desclen, char *rhost, int rhostlen, unsigned int *timestamp, u_int64_t *packets, u_int64_t *bytes)
Definition: iptcrdr.c:352