miniupnp/miniupnpd/ipfw/ipfwrdr.h

80 lines
1.6 KiB
C
Raw Normal View History

/* $Id: ipfwrdr.h,v 1.6 2012/02/11 13:10:57 nanard Exp $ */
2011-09-28 19:13:20 +00:00
/*
* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2009 Jardel Weyrich
2011-09-28 19:13:20 +00:00
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution
*/
#ifndef IPFWRDR_H_INCLUDED
#define IPFWRDR_H_INCLUDED
2011-09-28 19:13:20 +00:00
#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) */
2011-09-28 19:13:20 +00:00
int proto,
const char * desc,
unsigned int timestamp);
int add_filter_rule2(
const char * ifname,
const char * rhost,
2011-09-28 19:13:20 +00:00
const char * iaddr,
unsigned short eport,
2011-09-28 19:13:20 +00:00
unsigned short iport,
int proto,
2011-09-28 19:13:20 +00:00
const char * desc);
#if 0
/*
* get_redirect_rule() gets internal IP and port from
* interface, external port and protocl
*/
2011-09-28 19:13:20 +00:00
int get_redirect_rule(
const char * ifname,
unsigned short eport,
int proto,
char * iaddr,
int iaddrlen,
2011-09-28 19:13:20 +00:00
unsigned short * iport,
char * desc,
2011-09-28 19:13:20 +00:00
int desclen,
u_int64_t * packets,
u_int64_t * bytes);
int get_redirect_rule_by_index(
int index,
char * ifname,
2011-09-28 19:13:20 +00:00
unsigned short * eport,
char * iaddr,
int iaddrlen,
2011-09-28 19:13:20 +00:00
unsigned short * iport,
int * proto,
char * desc,
2011-09-28 19:13:20 +00:00
int desclen,
u_int64_t * packets,
2011-09-28 19:13:20 +00:00
u_int64_t * bytes);
#endif
/*
* delete_redirect_rule()
*/
2011-09-28 19:13:20 +00:00
int delete_redirect_rule(const char * ifname, unsigned short eport, int proto);
/*
* delete_filter_rule()
*/
2011-09-28 19:13:20 +00:00
int delete_filter_rule(const char * ifname, unsigned short eport, int proto);
int clear_redirect_rules(void);
#endif