move definition of release_ticket() to rtickets.h
This commit is contained in:
parent
6e8b02b715
commit
d135bd3f6d
|
@ -69,22 +69,12 @@
|
|||
#include "obsdrdr.h"
|
||||
#include "../upnpglobalvars.h"
|
||||
#include "../getifaddr.h"
|
||||
#include "rtickets.h"
|
||||
|
||||
#ifndef USE_PF
|
||||
#error "USE_PF macro is undefined, check consistency between config.h and Makefile"
|
||||
#else
|
||||
|
||||
#if defined(PF_NEWSTYLE) && defined(DIOCXEND)
|
||||
#define PF_RELEASETICKETS
|
||||
#define release_ticket(device, ticket_num) {\
|
||||
if (ioctl((device), DIOCXEND, &(ticket_num)) < 0) {\
|
||||
syslog(LOG_ERR, "ioctl(dev, DIOCXEND, ...): %m");\
|
||||
}\
|
||||
}
|
||||
#else
|
||||
#define release_ticket(device, ticket_num) (void)(ticket_num)
|
||||
#endif
|
||||
|
||||
/* list to keep timestamps for port mappings having a lease duration */
|
||||
struct timestamp_entry {
|
||||
struct timestamp_entry * next;
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "../upnpglobalvars.h"
|
||||
#include "../macros.h"
|
||||
#include "../upnputils.h"
|
||||
#include "rtickets.h"
|
||||
|
||||
/* the pass rules created by add_pinhole() are as follow :
|
||||
*
|
||||
|
@ -55,17 +56,6 @@ static int next_uid = 1;
|
|||
#define PINEHOLE_LABEL_FORMAT "pinhole-%d ts-%u: %s"
|
||||
#define PINEHOLE_LABEL_FORMAT_SKIPDESC "pinhole-%d ts-%u: %*s"
|
||||
|
||||
#if defined(PF_NEWSTYLE) && defined(DIOCXEND)
|
||||
#define PF_RELEASETICKETS
|
||||
#define release_ticket(device, ticket_num) {\
|
||||
if (ioctl((device), DIOCXEND, &(ticket_num)) < 0) {\
|
||||
syslog(LOG_ERR, "ioctl(dev, DIOCXEND, ...): %m");\
|
||||
}\
|
||||
}
|
||||
#else
|
||||
#define release_ticket(device, ticket_num) (void)(ticket_num)
|
||||
#endif
|
||||
|
||||
int add_pinhole(const char * ifname,
|
||||
const char * rem_host, unsigned short rem_port,
|
||||
const char * int_client, unsigned short int_port,
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
/* $Id: $ */
|
||||
/* MiniUPnP project
|
||||
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
|
||||
* (c) 2023 Thomas Bernard
|
||||
* This software is subject to the conditions detailed
|
||||
* in the LICENCE file provided within the distribution */
|
||||
|
||||
#ifndef RTICKETS_H_INCLUDED
|
||||
#define RTICKETS_H_INCLUDED
|
||||
|
||||
#if defined(PF_NEWSTYLE) && defined(DIOCXEND)
|
||||
#define PF_RELEASETICKETS
|
||||
#define release_ticket(device, ticket_num) {\
|
||||
if (ioctl((device), DIOCXEND, &(ticket_num)) < 0) {\
|
||||
syslog(LOG_ERR, "ioctl(dev, DIOCXEND, ...): %m");\
|
||||
}\
|
||||
}
|
||||
#else
|
||||
#define release_ticket(device, ticket_num) (void)(ticket_num)
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue