miniupnpd/pf: catch up test programs

This commit is contained in:
Thomas Bernard 2014-02-28 20:20:51 +01:00
parent 802ad22f4d
commit 56aca98164
2 changed files with 16 additions and 13 deletions

View File

@ -1,7 +1,7 @@
/* $Id: testobsdrdr.c,v 1.24 2012/04/18 19:42:03 nanard Exp $ */ /* $Id: testobsdrdr.c,v 1.26 2014/02/28 18:03:31 nanard Exp $ */
/* MiniUPnP project /* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2012 Thomas Bernard * (c) 2006-2014 Thomas Bernard
* This software is subject to the conditions detailed * This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */ * in the LICENCE file provided within the distribution */
@ -17,6 +17,7 @@
int runtime_flags = 0; int runtime_flags = 0;
const char * tag = 0; const char * tag = 0;
const char * anchor_name = "miniupnpd"; const char * anchor_name = "miniupnpd";
const char * queue = NULL;
void void
list_rules(void); list_rules(void);
@ -90,10 +91,10 @@ main(int arc, char * * argv)
#endif #endif
add_redirect_rule2("ep0", "8.8.8.8", 12123, "192.168.1.125", 1234, add_redirect_rule2("ep0", "8.8.8.8", 12123, "192.168.1.125", 1234,
IPPROTO_UDP, "test description", 0); IPPROTO_UDP, "test description", 0);
#if 0 add_redirect_rule2("em0", NULL, 12123, "127.1.2.3", 1234,
add_redirect_rule2("em0", 12123, "127.1.2.3", 1234, IPPROTO_TCP, "test description tcp", 0);
IPPROTO_TCP, "test description tcp"); add_filter_rule2("em0", NULL, "127.1.2.3", 12123, 1234, IPPROTO_TCP,
#endif "test description tcp");
list_rules(); list_rules();
list_eports_tcp(); list_eports_tcp();

View File

@ -1,7 +1,7 @@
/* $Id: testpfpinhole.c,v 1.10 2012/04/22 23:12:51 nanard Exp $ */ /* $Id: testpfpinhole.c,v 1.11 2014/02/28 16:49:15 nanard Exp $ */
/* MiniUPnP project /* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2012 Thomas Bernard * (c) 2012-2014 Thomas Bernard
* This software is subject to the conditions detailed * This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */ * in the LICENCE file provided within the distribution */
@ -21,6 +21,7 @@ const char * tag = NULL;
const char * anchor_name = "miniupnpd"; const char * anchor_name = "miniupnpd";
const char * queue = NULL; const char * queue = NULL;
#ifdef ENABLE_IPV6
static int print_pinhole(int uid) static int print_pinhole(int uid)
{ {
int r; int r;
@ -32,7 +33,7 @@ static int print_pinhole(int uid)
unsigned int timestamp; unsigned int timestamp;
u_int64_t packets, bytes; u_int64_t packets, bytes;
r = get_pinhole((unsigned short)uid, r = get_pinhole_info((unsigned short)uid,
rem_host, sizeof(rem_host), &rem_port, rem_host, sizeof(rem_host), &rem_port,
int_client, sizeof(int_client), &int_port, int_client, sizeof(int_client), &int_port,
&proto, &timestamp, &proto, &timestamp,
@ -47,6 +48,7 @@ static int print_pinhole(int uid)
} }
return r; return r;
} }
#endif
int main(int argc, char * *argv) int main(int argc, char * *argv)
{ {