1 /* $Id: commonrdr.h,v 1.6 2011/06/04 08:58:12 nanard Exp $ */
3 * (c) 2006-2011 Thomas Bernard
4 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
5 * This software is subject to the conditions detailed
6 * in the LICENCE file provided within the distribution */
7 #ifndef __COMMONRDR_H__
8 #define __COMMONRDR_H__
12 /* init and shutdown functions */
17 shutdown_redirect(void);
19 /* get_redirect_rule() gets internal IP and port from
20 * interface, external port and protocl
23 get_redirect_rule(const char * ifname
, unsigned short eport
, int proto
,
24 char * iaddr
, int iaddrlen
, unsigned short * iport
,
25 char * desc
, int desclen
, unsigned int * timestamp
,
26 u_int64_t
* packets
, u_int64_t
* bytes
);
29 get_redirect_rule_by_index(int index
,
30 char * ifname
, unsigned short * eport
,
31 char * iaddr
, int iaddrlen
, unsigned short * iport
,
32 int * proto
, char * desc
, int desclen
,
33 char * rhost
, int rhostlen
,
34 unsigned int * timestamp
,
35 u_int64_t
* packets
, u_int64_t
* bytes
);
37 /* return an (malloc'ed) array of "external" port for which there is
38 * a port mapping. number is the size of the array */
40 get_portmappings_in_range(unsigned short startport
, unsigned short endport
,
41 int proto
, unsigned int * number
);