Monero
Loading...
Searching...
No Matches
obsdrdr.h
Go to the documentation of this file.
1/* $Id: obsdrdr.h,v 1.25 2020/05/29 21:48:57 nanard Exp $ */
2/* vim: tabstop=4 shiftwidth=4 noexpandtab
3 * MiniUPnP project
4 * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
5 * (c) 2006-2020 Thomas Bernard
6 * This software is subject to the conditions detailed
7 * in the LICENCE file provided within the distribution */
8
9#ifndef OBSDRDR_H_INCLUDED
10#define OBSDRDR_H_INCLUDED
11
12#include "../commonrdr.h"
13
14/* add_redirect_rule2() uses DIOCCHANGERULE ioctl
15 * proto can take the values IPPROTO_UDP or IPPROTO_TCP
16 */
17int
18add_redirect_rule2(const char * ifname,
19 const char * rhost, unsigned short eport,
20 const char * iaddr, unsigned short iport, int proto,
21 const char * desc, unsigned int timestamp);
22
23/* add_filter_rule2() uses DIOCCHANGERULE ioctl
24 * proto can take the values IPPROTO_UDP or IPPROTO_TCP
25 */
26int
27add_filter_rule2(const char * ifname,
28 const char * rhost, const char * iaddr,
29 unsigned short eport, unsigned short iport,
30 int proto, const char * desc);
31
32
33/* get_redirect_rule() gets internal IP and port from
34 * interface, external port and protocl
35 */
36#if 0
37int
38get_redirect_rule(const char * ifname, unsigned short eport, int proto,
39 char * iaddr, int iaddrlen, unsigned short * iport,
40 char * desc, int desclen,
41 u_int64_t * packets, u_int64_t * bytes);
42
43int
45 char * ifname, unsigned short * eport,
46 char * iaddr, int iaddrlen, unsigned short * iport,
47 int * proto, char * desc, int desclen,
48 u_int64_t * packets, u_int64_t * bytes);
49#endif
50
51/* delete_redirect_rule()
52 */
53int
54delete_redirect_rule(const char * ifname, unsigned short eport, int proto);
55
56/* delete_redirect_and_filter_rules()
57 */
58int
59delete_redirect_and_filter_rules(const char * ifname, unsigned short eport,
60 int proto);
61
62int
63delete_filter_rule(const char * ifname, unsigned short port, int proto);
64
65#ifdef TEST
66int
68int
69clear_filter_rules(void);
70int
71clear_nat_rules(void);
72#endif
73
74#endif
75
76
int get_redirect_rule(const char *ifname, unsigned short eport, int proto, char *iaddr, int iaddrlen, unsigned short *iport, char *desc, int desclen, char *rhost, int rhostlen, unsigned int *timestamp, u_int64_t *packets, u_int64_t *bytes)
Definition ipfrdr.c:323
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, char *rhost, int rhostlen, unsigned int *timestamp, u_int64_t *packets, u_int64_t *bytes)
Definition ipfrdr.c:403
int clear_redirect_rules(void)
int add_filter_rule2(const char *ifname, const char *rhost, const char *iaddr, unsigned short eport, unsigned short iport, int proto, const char *desc)
Definition ipfrdr.c:564
int delete_filter_rule(const char *ifname, unsigned short port, int proto)
Definition ipfrdr.c:654
int add_redirect_rule2(const char *ifname, const char *rhost, unsigned short eport, const char *iaddr, unsigned short iport, int proto, const char *desc, unsigned int timestamp)
Definition ipfrdr.c:230
int delete_redirect_and_filter_rules(const char *ifname, unsigned short eport, int proto)
int delete_redirect_rule(const char *ifname, unsigned short eport, int proto)
Definition ipfrdr.c:552
static const char * ifname
Definition testipfwrdr.c:17