Miniupnpd: update from 1.8 (20140422) to 1.9 (20141209)
[tomato.git] / release / src / router / miniupnpd / upnppinhole.h
blob1989b576ffc8661f70426779856a506ff9db71a3
1 /* $Id: upnppinhole.h,v 1.5 2014/05/15 10:15:05 nanard Exp $ */
2 /* MiniUPnP project
3 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4 * (c) 2006-2012 Thomas Bernard
5 * This software is subject to the conditions detailed
6 * in the LICENCE file provided within the distribution */
8 #ifndef UPNPPINHOLE_H_INCLUDED
9 #define UPNPPINHOLE_H_INCLUDED
11 #include "config.h"
13 #ifdef ENABLE_UPNPPINHOLE
15 /* functions to be used by WANIPv6_FirewallControl implementation */
17 #if 0
18 /* retrieve outbound pinhole timeout */
19 int
20 upnp_check_outbound_pinhole(int proto, int * timeout);
21 #endif
23 /* add an inbound pinehole
24 * return value :
25 * 1 = success
26 * -1 = Pinhole space exhausted
27 * .. = error */
28 int
29 upnp_add_inboundpinhole(const char * raddr, unsigned short rport,
30 const char * iaddr, unsigned short iport,
31 int proto, char * desc,
32 unsigned int leasetime, int * uid);
35 * return values :
36 * -1 not found
37 * */
38 int
39 upnp_get_pinhole_info(unsigned short uid,
40 char * raddr, int raddrlen,
41 unsigned short * rport,
42 char * iaddr, int iaddrlen,
43 unsigned short * iport,
44 int * proto, char * desc, int desclen,
45 unsigned int * leasetime,
46 unsigned int * packets);
49 * return values:
50 * -1 = not found
51 * 0 .. 65535 = uid of the rule for the index
53 int
54 upnp_get_pinhole_uid_by_index(int index);
56 /* update the lease time */
57 int
58 upnp_update_inboundpinhole(unsigned short uid, unsigned int leasetime);
60 /* remove the inbound pinhole */
61 int
62 upnp_delete_inboundpinhole(unsigned short uid);
64 /* ... */
65 #if 0
66 int
67 upnp_check_pinhole_working(const char * uid, char * eaddr, char * iaddr, unsigned short * eport, unsigned short * iport, char * protocol, int * rulenum_used);
68 #endif
70 /* return the number of expired pinhole removed
71 * write timestamp to next pinhole to exprire to next_timestamp
72 * next_timestamp is left untouched if there is no pinhole lest */
73 int
74 upnp_clean_expired_pinholes(unsigned int * next_timestamp);
76 #endif /* ENABLE_UPNPPINHOLE */
78 #endif /* !UPNPPINHOLE_H_INCLUDED */