Monero
Loading...
Searching...
No Matches
ipfrdr.c File Reference
#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 <errno.h>
#include <limits.h>
#include <netdb.h>
#include <stdlib.h>
#include <fcntl.h>
#include <syslog.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "config.h"
#include "netinet/ipl.h"
#include "netinet/ip_compat.h"
#include "netinet/ip_fil.h"
#include "netinet/ip_nat.h"
#include "netinet/ip_state.h"
#include "../macros.h"
#include "../upnpglobalvars.h"
Include dependency graph for ipfrdr.c:

Classes

struct  rdr_desc

Macros

#define ADD_KERNEL
#define _KERNEL
#define KERNEL
#define __P(x)
#define const
#define U_32_T   1

Typedefs

typedef unsigned int u_32_t
typedef int ioctlfunc_t __P((dev_t, ioctlcmd_t, void *))

Functions

static void add_redirect_desc (unsigned short eport, int proto, unsigned int timestamp, const char *desc)
static void del_redirect_desc (unsigned short eport, int proto)
static void get_redirect_desc (unsigned short eport, int proto, char *desc, int desclen, unsigned int *timestamp)
int init_redirect (void)
void shutdown_redirect (void)
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 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)
static int real_delete_redirect_rule (const char *ifname, unsigned short eport, int proto)
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)
unsigned short * get_portmappings_in_range (unsigned short startport, unsigned short endport, int proto, unsigned int *number)
int update_portmapping (const char *ifname, unsigned short eport, int proto, unsigned short iport, const char *desc, unsigned int timestamp)
int update_portmapping_desc_timestamp (const char *ifname, unsigned short eport, int proto, const char *desc, unsigned int timestamp)

Variables

static const char group_name [] = "miniupnpd"
static int dev = -1
static int dev_ipl = -1
static struct rdr_descrdr_desc_list

Macro Definition Documentation

◆ __P

#define __P ( x)
Value:
()

◆ _KERNEL

#define _KERNEL

◆ ADD_KERNEL

#define ADD_KERNEL

◆ const

#define const

◆ KERNEL

#define KERNEL

◆ U_32_T

#define U_32_T   1

Typedef Documentation

◆ __P

typedef int copyfunc_t __P((void *, void *, size_t))

◆ u_32_t

typedef unsigned int u_32_t

Function Documentation

◆ 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_desc()

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

◆ 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_redirect_desc()

void del_redirect_desc ( 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_portmappings_in_range()

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

◆ get_redirect_desc()

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

◆ 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 )

◆ real_delete_redirect_rule()

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

◆ 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

◆ dev

int dev = -1
static

◆ dev_ipl

int dev_ipl = -1
static

◆ group_name

const char group_name[] = "miniupnpd"
static

◆ rdr_desc_list

struct rdr_desc* rdr_desc_list
static