1 /* $Id: upnppinhole.h,v 1.3 2012/09/27 15:47:15 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_6FC_SERVICE
14 /* functions to be used by WANIPv6_FirewallControl implementation */
17 /* retrieve outbound pinhole timeout */
19 upnp_check_outbound_pinhole(int proto
, int * timeout
);
22 /* add an inbound pinehole
25 * -1 = Pinhole space exhausted
28 upnp_add_inboundpinhole(const char * raddr
, unsigned short rport
,
29 const char * iaddr
, unsigned short iport
,
30 int proto
, unsigned int leasetime
, int * uid
);
37 upnp_get_pinhole_info(unsigned short uid
,
38 char * raddr
, int raddrlen
,
39 unsigned short * rport
,
40 char * iaddr
, int iaddrlen
,
41 unsigned short * iport
,
43 unsigned int * leasetime
,
44 unsigned int * packets
);
46 /* update the lease time */
48 upnp_update_inboundpinhole(unsigned short uid
, unsigned int leasetime
);
50 /* remove the inbound pinhole */
52 upnp_delete_inboundpinhole(unsigned short uid
);
57 upnp_check_pinhole_working(const char * uid
, char * eaddr
, char * iaddr
, unsigned short * eport
, unsigned short * iport
, char * protocol
, int * rulenum_used
);
60 /* return the number of expired pinhole removed
61 * write timestamp to next pinhole to exprire to next_timestamp
62 * next_timestamp is left untouched if there is no pinhole lest */
64 upnp_clean_expired_pinholes(unsigned int * next_timestamp
);
66 #endif /* ENABLE_6FC_SERVICE */