Miniupnpd v. 1.5 (20110618)
[tomato.git] / release / src / router / miniupnpd / commonrdr.h
blob5a13d41b56c146af66645c357ae74b8b8d7e0ffb
1 /* $Id: commonrdr.h,v 1.6 2011/06/04 08:58:12 nanard Exp $ */
2 /* MiniUPnP project
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__
10 #include "config.h"
12 /* init and shutdown functions */
13 int
14 init_redirect(void);
16 void
17 shutdown_redirect(void);
19 /* get_redirect_rule() gets internal IP and port from
20 * interface, external port and protocl
22 int
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);
28 int
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 */
39 unsigned short *
40 get_portmappings_in_range(unsigned short startport, unsigned short endport,
41 int proto, unsigned int * number);
43 #endif