1 /* $Id: upnppinhole.h,v 1.5 2014/05/15 10:15:05 nanard Exp $ */
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
13 #ifdef ENABLE_UPNPPINHOLE
15 /* functions to be used by WANIPv6_FirewallControl implementation */
18 /* retrieve outbound pinhole timeout */
20 upnp_check_outbound_pinhole(int proto
, int * timeout
);
23 /* add an inbound pinehole
26 * -1 = Pinhole space exhausted
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
);
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
);
51 * 0 .. 65535 = uid of the rule for the index
54 upnp_get_pinhole_uid_by_index(int index
);
56 /* update the lease time */
58 upnp_update_inboundpinhole(unsigned short uid
, unsigned int leasetime
);
60 /* remove the inbound pinhole */
62 upnp_delete_inboundpinhole(unsigned short uid
);
67 upnp_check_pinhole_working(const char * uid
, char * eaddr
, char * iaddr
, unsigned short * eport
, unsigned short * iport
, char * protocol
, int * rulenum_used
);
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 */
74 upnp_clean_expired_pinholes(unsigned int * next_timestamp
);
76 #endif /* ENABLE_UPNPPINHOLE */
78 #endif /* !UPNPPINHOLE_H_INCLUDED */