Electroneum
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  *
6  * This software is subject to the conditions detailed
7  * in the LICENCE file provided within the distribution.
8  */
9 
10 #ifndef NFTNLRDR_H_INCLUDED
11 #define NFTNLRDR_H_INCLUDED
12 
13 #include "../commonrdr.h"
14 int init_redirect(void);
15 void shutdown_redirect(void);
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 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);
29 
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);
35 
36 int
37 delete_redirect_and_filter_rules(unsigned short eport, int proto);
38 
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);
45 
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
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);
70 
71 unsigned short *
72 get_portmappings_in_range(unsigned short startport, unsigned short endport,
73  int proto, unsigned int * number);
74 
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);
78 
79 /* for debug */
80 int
81 list_redirect_rule(const char * ifname);
82 
83 #endif
84 
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)
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)
unsigned char uint8_t
Definition: stdint.h:124
int list_redirect_rule(const char *ifname)
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)
void shutdown_redirect(void)
int init_redirect(void)
int delete_redirect_and_filter_rules(unsigned short eport, int proto)
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 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)
unsigned short * get_portmappings_in_range(unsigned short startport, unsigned short endport, int proto, unsigned int *number)
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)
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)