TOR: fix compilation
[tomato.git] / release / src / router / miniupnpd / upnppinhole.h
blob4cd4c53592ddacfc44aca0ebe698226ad4b766ce
1 /* $Id: upnppinhole.h,v 1.6 2016/01/19 10:03:30 nanard Exp $ */
2 /* vim: tabstop=4 shiftwidth=4 noexpandtab
3 * MiniUPnP project
4 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
5 * (c) 2006-2016 Thomas Bernard
6 * This software is subject to the conditions detailed
7 * in the LICENCE file provided within the distribution */
9 #ifndef UPNPPINHOLE_H_INCLUDED
10 #define UPNPPINHOLE_H_INCLUDED
12 #include "config.h"
14 #ifdef ENABLE_UPNPPINHOLE
16 /* functions to be used by WANIPv6_FirewallControl implementation
17 * and PCP (IPv6) */
19 #if 0
20 /* retrieve outbound pinhole timeout */
21 int
22 upnp_check_outbound_pinhole(int proto, int * timeout);
23 #endif
25 /* find an inbound pinhole base on remove host:port / local host:port
26 * return the (positive) uid or a negative value if not found */
27 int
28 upnp_find_inboundpinhole(const char * raddr, unsigned short rport,
29 const char * iaddr, unsigned short iport,
30 int proto,
31 char * desc, int desc_len, unsigned int * leasetime);
34 /* add an inbound pinehole
35 * return value :
36 * 1 = success
37 * -1 = Pinhole space exhausted
38 * .. = error */
39 int
40 upnp_add_inboundpinhole(const char * raddr, unsigned short rport,
41 const char * iaddr, unsigned short iport,
42 int proto, char * desc,
43 unsigned int leasetime, int * uid);
45 /* get from uid
46 * return values :
47 * -1 not found
48 * */
49 int
50 upnp_get_pinhole_info(unsigned short uid,
51 char * raddr, int raddrlen,
52 unsigned short * rport,
53 char * iaddr, int iaddrlen,
54 unsigned short * iport,
55 int * proto, char * desc, int desclen,
56 unsigned int * leasetime,
57 unsigned int * packets);
60 * return values:
61 * -1 = not found
62 * 0 .. 65535 = uid of the rule for the index
64 int
65 upnp_get_pinhole_uid_by_index(int index);
67 /* update the lease time */
68 int
69 upnp_update_inboundpinhole(unsigned short uid, unsigned int leasetime);
71 /* remove the inbound pinhole */
72 int
73 upnp_delete_inboundpinhole(unsigned short uid);
75 /* ... */
76 #if 0
77 int
78 upnp_check_pinhole_working(const char * uid, char * eaddr, char * iaddr, unsigned short * eport, unsigned short * iport, char * protocol, int * rulenum_used);
79 #endif
81 /* return the number of expired pinhole removed
82 * write timestamp to next pinhole to exprire to next_timestamp
83 * next_timestamp is left untouched if there is no pinhole lest */
84 int
85 upnp_clean_expired_pinholes(unsigned int * next_timestamp);
87 #endif /* ENABLE_UPNPPINHOLE */
89 #endif /* !UPNPPINHOLE_H_INCLUDED */