Electroneum
obsdrdr.h
Go to the documentation of this file.
1 /* $Id: obsdrdr.h,v 1.23 2014/03/06 12:24:33 nanard Exp $ */
2 /* MiniUPnP project
3  * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4  * (c) 2006-2014 Thomas Bernard
5  * This software is subject to the conditions detailed
6  * in the LICENCE file provided within the distribution */
7 
8 #ifndef OBSDRDR_H_INCLUDED
9 #define OBSDRDR_H_INCLUDED
10 
11 #include "../commonrdr.h"
12 
13 /* add_redirect_rule2() uses DIOCCHANGERULE ioctl
14  * proto can take the values IPPROTO_UDP or IPPROTO_TCP
15  */
16 int
17 add_redirect_rule2(const char * ifname,
18  const char * rhost, unsigned short eport,
19  const char * iaddr, unsigned short iport, int proto,
20  const char * desc, unsigned int timestamp);
21 
22 /* add_filter_rule2() uses DIOCCHANGERULE ioctl
23  * proto can take the values IPPROTO_UDP or IPPROTO_TCP
24  */
25 int
26 add_filter_rule2(const char * ifname,
27  const char * rhost, const char * iaddr,
28  unsigned short eport, unsigned short iport,
29  int proto, const char * desc);
30 
31 
32 /* get_redirect_rule() gets internal IP and port from
33  * interface, external port and protocl
34  */
35 #if 0
36 int
37 get_redirect_rule(const char * ifname, unsigned short eport, int proto,
38  char * iaddr, int iaddrlen, unsigned short * iport,
39  char * desc, int desclen,
40  u_int64_t * packets, u_int64_t * bytes);
41 
42 int
44  char * ifname, unsigned short * eport,
45  char * iaddr, int iaddrlen, unsigned short * iport,
46  int * proto, char * desc, int desclen,
47  u_int64_t * packets, u_int64_t * bytes);
48 #endif
49 
50 /* delete_redirect_rule()
51  */
52 int
53 delete_redirect_rule(const char * ifname, unsigned short eport, int proto);
54 
55 /* delete_redirect_and_filter_rules()
56  */
57 int
58 delete_redirect_and_filter_rules(const char * ifname, unsigned short eport,
59  int proto);
60 
61 #ifdef TEST
62 int
64 int
65 clear_filter_rules(void);
66 #endif
67 
68 #endif
69 
70 
int add_filter_rule2(const char *ifname, const char *rhost, const char *iaddr, unsigned short eport, unsigned short iport, int proto, const char *desc)
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)
int clear_redirect_rules(void)
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)
int delete_redirect_rule(const char *ifname, unsigned short eport, int proto)
int delete_redirect_and_filter_rules(const char *ifname, unsigned short eport, int proto)
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)