add update_pinhole() prototype, use #ifdef ENABLE_6FC_SERVICE

This commit is contained in:
Thomas Bernard 2012-04-24 00:45:45 +02:00
parent d27f35ccde
commit 12825443b1
2 changed files with 18 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $Id: pfpinhole.c,v 1.15 2012/04/22 23:36:41 nanard Exp $ */
/* $Id: pfpinhole.c,v 1.16 2012/04/23 22:17:34 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2012 Thomas Bernard
@ -39,7 +39,7 @@
* with the label "pinhole-$uid ts-$timestamp"
*/
#ifdef ENABLE_IPV6
#ifdef ENABLE_6FC_SERVICE
/* /dev/pf when opened */
extern int dev;
@ -272,6 +272,16 @@ int get_pinhole(unsigned short uid,
return -2;
}
int update_pinhole(unsigned short uid, unsigned int timestamp)
{
/* TODO :
* As it is not possible to change rule label, we should :
* 1 - delete
* 2 - Add new
* the stats of the rule will then be reset :( */
return -42; /* not implemented */
}
/* return the number of rules removed
* or a negative integer in case of error */
int clean_pinhole_list(unsigned int * next_timestamp)

View File

@ -1,4 +1,4 @@
/* $Id: pfpinhole.h,v 1.7 2012/04/22 23:08:51 nanard Exp $ */
/* $Id: pfpinhole.h,v 1.8 2012/04/23 22:17:34 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2012 Thomas Bernard
@ -8,6 +8,7 @@
#ifndef __PFPINHOLE_H__
#define __PFPINHOLE_H__
#ifdef ENABLE_6FC_SERVICE
int add_pinhole(const char * ifname,
const char * rem_host, unsigned short rem_port,
const char * int_client, unsigned short int_port,
@ -21,7 +22,11 @@ int get_pinhole(unsigned short uid,
int * proto, unsigned int * timestamp,
u_int64_t * packets, u_int64_t * bytes);
int update_pinhole(unsigned short uid, unsigned int timestamp);
int clean_pinhole_list(unsigned int * next_timestamp);
#endif
#endif