Monero
Loading...
Searching...
No Matches
ipfwrdr.c File Reference
#include "config.h"
#include "../macros.h"
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/syslog.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <arpa/inet.h>
#include <sys/queue.h>
#include <errno.h>
#include <limits.h>
#include <netdb.h>
#include <stdlib.h>
#include <fcntl.h>
#include <syslog.h>
#include <stddef.h>
#include <stdio.h>
#include <strings.h>
#include <string.h>
#include <unistd.h>
#include <netinet/ip_fw.h>
#include "ipfwaux.h"
#include "ipfwrdr.h"
#include "../upnpglobalvars.h"
Include dependency graph for ipfwrdr.c:

Classes

struct  mapping_desc_time

Macros

#define ADD_KERNEL
#define _KERNEL
#define KERNEL

Functions

int init_redirect (void)
void shutdown_redirect (void)
static void add_desc_time (unsigned short eport, int proto, const char *desc, unsigned int timestamp)
static void del_desc_time (unsigned short eport, int proto)
static void get_desc_time (unsigned short eport, int proto, char *desc, int desclen, unsigned int *timestamp)
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)
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)
int delete_redirect_rule (const char *ifname, unsigned short eport, int proto)
int add_filter_rule2 (const char *ifname, const char *rhost, const char *iaddr, unsigned short eport, unsigned short iport, int proto, const char *desc)
int delete_filter_rule (const char *ifname, unsigned short eport, int proto)
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)
unsigned short * get_portmappings_in_range (unsigned short startport, unsigned short endport, int proto, unsigned int *number)
int update_portmapping_desc_timestamp (const char *ifname, unsigned short eport, int proto, const char *desc, unsigned int timestamp)
int update_portmapping (const char *ifname, unsigned short eport, int proto, unsigned short iport, const char *desc, unsigned int timestamp)

Variables

static struct mapping_desc_timemappings_list = NULL

Macro Definition Documentation

◆ _KERNEL

#define _KERNEL

◆ ADD_KERNEL

#define ADD_KERNEL

◆ KERNEL

#define KERNEL

Function Documentation

◆ add_desc_time()

void add_desc_time ( unsigned short eport,
int proto,
const char * desc,
unsigned int timestamp )
static

◆ add_filter_rule2()

int add_filter_rule2 ( const char * ifname,
const char * rhost,
const char * iaddr,
unsigned short eport,
unsigned short iport,
int proto,
const char * desc )

◆ add_redirect_rule2()

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 )

◆ del_desc_time()

void del_desc_time ( unsigned short eport,
int proto )
static

◆ delete_filter_rule()

int delete_filter_rule ( const char * ifname,
unsigned short eport,
int proto )

◆ delete_redirect_rule()

int delete_redirect_rule ( const char * ifname,
unsigned short eport,
int proto )

◆ get_desc_time()

void get_desc_time ( unsigned short eport,
int proto,
char * desc,
int desclen,
unsigned int * timestamp )
static

◆ get_portmappings_in_range()

unsigned short * get_portmappings_in_range ( unsigned short startport,
unsigned short endport,
int proto,
unsigned int * number )

◆ get_redirect_rule()

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 )

◆ get_redirect_rule_by_index()

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 )

◆ init_redirect()

int init_redirect ( void )

◆ shutdown_redirect()

void shutdown_redirect ( void )

◆ update_portmapping()

int update_portmapping ( const char * ifname,
unsigned short eport,
int proto,
unsigned short iport,
const char * desc,
unsigned int timestamp )

◆ update_portmapping_desc_timestamp()

int update_portmapping_desc_timestamp ( const char * ifname,
unsigned short eport,
int proto,
const char * desc,
unsigned int timestamp )

Variable Documentation

◆ mappings_list

struct mapping_desc_time* mappings_list = NULL
static