Monero
obsdrdr.h
Go to the documentation of this file.
1 /* $Id: obsdrdr.h,v 1.25 2020/05/29 21:48:57 nanard Exp $ */
2 /* vim: tabstop=4 shiftwidth=4 noexpandtab
3  * MiniUPnP project
4  * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
5  * (c) 2006-2020 Thomas Bernard
6  * This software is subject to the conditions detailed
7  * in the LICENCE file provided within the distribution */
8 
9 #ifndef OBSDRDR_H_INCLUDED
10 #define OBSDRDR_H_INCLUDED
11 
12 #include "../commonrdr.h"
13 
14 /* add_redirect_rule2() uses DIOCCHANGERULE ioctl
15  * proto can take the values IPPROTO_UDP or IPPROTO_TCP
16  */
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);
22 
23 /* add_filter_rule2() uses DIOCCHANGERULE ioctl
24  * proto can take the values IPPROTO_UDP or IPPROTO_TCP
25  */
26 int
27 add_filter_rule2(const char * ifname,
28  const char * rhost, const char * iaddr,
29  unsigned short eport, unsigned short iport,
30  int proto, const char * desc);
31 
32 
33 /* get_redirect_rule() gets internal IP and port from
34  * interface, external port and protocl
35  */
36 #if 0
37 int
38 get_redirect_rule(const char * ifname, unsigned short eport, int proto,
39  char * iaddr, int iaddrlen, unsigned short * iport,
40  char * desc, int desclen,
41  u_int64_t * packets, u_int64_t * bytes);
42 
43 int
45  char * ifname, unsigned short * eport,
46  char * iaddr, int iaddrlen, unsigned short * iport,
47  int * proto, char * desc, int desclen,
48  u_int64_t * packets, u_int64_t * bytes);
49 #endif
50 
51 /* delete_redirect_rule()
52  */
53 int
54 delete_redirect_rule(const char * ifname, unsigned short eport, int proto);
55 
56 /* delete_redirect_and_filter_rules()
57  */
58 int
59 delete_redirect_and_filter_rules(const char * ifname, unsigned short eport,
60  int proto);
61 
62 int
63 delete_filter_rule(const char * ifname, unsigned short port, int proto);
64 
65 #ifdef TEST
66 int
68 int
69 clear_filter_rules(void);
70 int
71 clear_nat_rules(void);
72 #endif
73 
74 #endif
75 
76 
static const char * ifname
Definition: testipfwrdr.c:17
string proto
Definition: pymoduletest.py:71
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
int get_redirect_rule(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: ipfrdr.c:323
int clear_redirect_rules(void)
desc
Definition: pymoduletest.py:79
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
int delete_redirect_rule(const char *ifname, unsigned short eport, int proto)
Definition: ipfrdr.c:552
int delete_filter_rule(const char *ifname, unsigned short port, int proto)
Definition: ipfrdr.c:654
boost::endian::big_uint16_t port
Definition: socks.cpp:61
int delete_redirect_and_filter_rules(const char *ifname, unsigned short eport, int proto)
eport
Definition: testupnpigd.py:58
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