Repository navigation
Expand file tree
/
Copy pathipfwrdr.h
More file actions
79 lines (67 loc) · 1.63 KB
/
Copy pathipfwrdr.h
File metadata and controls
79 lines (67 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* $Id: ipfwrdr.h,v 1.6 2012/02/11 13:10:57 nanard Exp $ */
/*
* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2009 Jardel Weyrich
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution
*/
#ifndef IPFWRDR_H_INCLUDED
#define IPFWRDR_H_INCLUDED
#include "../commonrdr.h"
int add_redirect_rule2(
const char * ifname, /* src interface (external) */
const char * rhost, /* remote host (ip) */
unsigned short eport, /* src port (external) */
const char * iaddr, /* dst address (internal) */
unsigned short iport, /* dst port (internal) */
int proto,
const char * desc,
unsigned int timestamp);
int add_filter_rule2(
const char * ifname,
const char * rhost,
const char * iaddr,
unsigned short eport,
unsigned short iport,
int proto,
const char * desc);
#if 0
/*
* get_redirect_rule() gets internal IP and port from
* interface, external port and protocl
*/
int get_redirect_rule(
const char * ifname,
unsigned short eport,
int proto,
char * iaddr,
int iaddrlen,
unsigned short * iport,
char * desc,
int desclen,
u_int64_t * packets,
u_int64_t * bytes);
int get_redirect_rule_by_index(
int index,
char * ifname,
unsigned short * eport,
char * iaddr,
int iaddrlen,
unsigned short * iport,
int * proto,
char * desc,
int desclen,
u_int64_t * packets,
u_int64_t * bytes);
#endif
/*
* delete_redirect_rule()
*/
int delete_redirect_rule(const char * ifname, unsigned short eport, int proto);
/*
* delete_filter_rule()
*/
int delete_filter_rule(const char * ifname, unsigned short eport, int proto);
int clear_redirect_rules(void);
#endif