Miniupnpd v. 1.5 (20110618)
[tomato.git] / release / src / router / miniupnpd / ipfw / ipfwrdr.h
blobcdadbfe220fad573ffd48068c648f0067ec16501
1 /* $Id: ipfwrdr.h,v 1.5 2011/06/04 15:47:18 nanard Exp $ */
2 /*
3 * MiniUPnP project
4 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
5 * (c) 2009 Jardel Weyrich
6 * This software is subject to the conditions detailed
7 * in the LICENCE file provided within the distribution
8 */
10 #ifndef __IPFWRDR_H__
11 #define __IPFWRDR_H__
13 #include "../commonrdr.h"
15 int add_redirect_rule2(
16 const char * ifname, // src interface (external)
17 const char * rhost, // remote host (ip)
18 unsigned short eport, // src port (external)
19 const char * iaddr, // dst address (internal)
20 unsigned short iport, // dst port (internal)
21 int proto,
22 const char * desc,
23 unsigned int timestamp);
25 int add_filter_rule2(
26 const char * ifname,
27 const char * rhost,
28 const char * iaddr,
29 unsigned short eport,
30 unsigned short iport,
31 int proto,
32 const char * desc);
34 #if 0
37 // get_redirect_rule() gets internal IP and port from
38 // interface, external port and protocl
40 int get_redirect_rule(
41 const char * ifname,
42 unsigned short eport,
43 int proto,
44 char * iaddr,
45 int iaddrlen,
46 unsigned short * iport,
47 char * desc,
48 int desclen,
49 u_int64_t * packets,
50 u_int64_t * bytes);
52 int get_redirect_rule_by_index(
53 int index,
54 char * ifname,
55 unsigned short * eport,
56 char * iaddr,
57 int iaddrlen,
58 unsigned short * iport,
59 int * proto,
60 char * desc,
61 int desclen,
62 u_int64_t * packets,
63 u_int64_t * bytes);
65 #endif
68 // delete_redirect_rule()
70 int delete_redirect_rule(const char * ifname, unsigned short eport, int proto);
73 // delete_filter_rule()
75 int delete_filter_rule(const char * ifname, unsigned short eport, int proto);
77 int clear_redirect_rules(void);
79 #endif