Electroneum
miniupnpc-libevent.h File Reference
#include <event2/event.h>
#include "declspec.h"
#include "upnpreplyparse.h"
Include dependency graph for miniupnpc-libevent.h:

Go to the source code of this file.

Classes

struct  upnpc_device
 
struct  upnpc
 

Macros

#define MINIUPNPC_LIBEVENT_API_VERSION   1
 
#define UPNPC_OK   0
 
#define UPNPC_ERR_INVALID_ARGS   (-1)
 
#define UPNPC_ERR_SOCKET_FAILED   (-2)
 
#define UPNPC_ERR_BIND_FAILED   (-3)
 
#define UPNPC_ERR_REQ_IN_PROGRESS   (-4)
 
#define UPNPC_ERR_NO_DEVICE_FOUND   (-100)
 
#define UPNPC_ERR_ROOT_DESC_ERROR   (-101)
 
#define UPNPC_ERR_NOT_IGD   (-102)
 
#define UPNPC_ERR_NOT_CONNECTED   (-103)
 
#define UPNPC_DEVICE_SOAP_REQ   (0x0001)
 
#define UPNPC_DEVICE_GETSTATUS   (0x0002)
 
#define UPNPC_DEVICE_CONNECTED   (0x4000)
 
#define UPNPC_DEVICE_READY   (0x8000)
 

Typedefs

typedef struct upnpc_device upnpc_device_t
 
typedef struct upnpc upnpc_t
 
typedef void(* upnpc_callback_fn) (int, upnpc_t *, upnpc_device_t *, void *)
 

Functions

int upnpc_init (upnpc_t *p, struct event_base *base, const char *multicastif, upnpc_callback_fn ready_cb, upnpc_callback_fn soap_cb, void *cb_data)
 
int upnpc_set_local_address (upnpc_t *p, const char *address, uint16_t port)
 
int upnpc_start (upnpc_t *p)
 
int upnpc_finalize (upnpc_t *p)
 
int upnpc_get_external_ip_address (upnpc_device_t *p)
 
int upnpc_get_link_layer_max_rate (upnpc_device_t *p)
 
int upnpc_add_port_mapping (upnpc_device_t *p, const char *remote_host, unsigned short ext_port, unsigned short int_port, const char *int_client, const char *proto, const char *description, unsigned int lease_duration)
 
int upnpc_delete_port_mapping (upnpc_device_t *p, const char *remote_host, unsigned short ext_port, const char *proto)
 
int upnpc_get_status_info (upnpc_device_t *p)
 

Macro Definition Documentation

◆ MINIUPNPC_LIBEVENT_API_VERSION

#define MINIUPNPC_LIBEVENT_API_VERSION   1

Definition at line 29 of file miniupnpc-libevent.h.

◆ UPNPC_DEVICE_CONNECTED

#define UPNPC_DEVICE_CONNECTED   (0x4000)

Definition at line 45 of file miniupnpc-libevent.h.

◆ UPNPC_DEVICE_GETSTATUS

#define UPNPC_DEVICE_GETSTATUS   (0x0002)

Definition at line 44 of file miniupnpc-libevent.h.

◆ UPNPC_DEVICE_READY

#define UPNPC_DEVICE_READY   (0x8000)

Definition at line 46 of file miniupnpc-libevent.h.

◆ UPNPC_DEVICE_SOAP_REQ

#define UPNPC_DEVICE_SOAP_REQ   (0x0001)

Definition at line 43 of file miniupnpc-libevent.h.

◆ UPNPC_ERR_BIND_FAILED

#define UPNPC_ERR_BIND_FAILED   (-3)

Definition at line 34 of file miniupnpc-libevent.h.

◆ UPNPC_ERR_INVALID_ARGS

#define UPNPC_ERR_INVALID_ARGS   (-1)

Definition at line 32 of file miniupnpc-libevent.h.

◆ UPNPC_ERR_NO_DEVICE_FOUND

#define UPNPC_ERR_NO_DEVICE_FOUND   (-100)

Definition at line 37 of file miniupnpc-libevent.h.

◆ UPNPC_ERR_NOT_CONNECTED

#define UPNPC_ERR_NOT_CONNECTED   (-103)

Definition at line 40 of file miniupnpc-libevent.h.

◆ UPNPC_ERR_NOT_IGD

#define UPNPC_ERR_NOT_IGD   (-102)

Definition at line 39 of file miniupnpc-libevent.h.

◆ UPNPC_ERR_REQ_IN_PROGRESS

#define UPNPC_ERR_REQ_IN_PROGRESS   (-4)

Definition at line 35 of file miniupnpc-libevent.h.

◆ UPNPC_ERR_ROOT_DESC_ERROR

#define UPNPC_ERR_ROOT_DESC_ERROR   (-101)

Definition at line 38 of file miniupnpc-libevent.h.

◆ UPNPC_ERR_SOCKET_FAILED

#define UPNPC_ERR_SOCKET_FAILED   (-2)

Definition at line 33 of file miniupnpc-libevent.h.

◆ UPNPC_OK

#define UPNPC_OK   0

Definition at line 31 of file miniupnpc-libevent.h.

Typedef Documentation

◆ upnpc_callback_fn

typedef void(* upnpc_callback_fn) (int, upnpc_t *, upnpc_device_t *, void *)

Definition at line 51 of file miniupnpc-libevent.h.

◆ upnpc_device_t

typedef struct upnpc_device upnpc_device_t

Definition at line 48 of file miniupnpc-libevent.h.

◆ upnpc_t

typedef struct upnpc upnpc_t

Definition at line 49 of file miniupnpc-libevent.h.

Function Documentation

◆ upnpc_add_port_mapping()

int upnpc_add_port_mapping ( upnpc_device_t p,
const char *  remote_host,
unsigned short  ext_port,
unsigned short  int_port,
const char *  int_client,
const char *  proto,
const char *  description,
unsigned int  lease_duration 
)

◆ upnpc_delete_port_mapping()

int upnpc_delete_port_mapping ( upnpc_device_t p,
const char *  remote_host,
unsigned short  ext_port,
const char *  proto 
)

◆ upnpc_finalize()

int upnpc_finalize ( upnpc_t p)

◆ upnpc_get_external_ip_address()

int upnpc_get_external_ip_address ( upnpc_device_t p)

◆ upnpc_get_link_layer_max_rate()

int upnpc_get_link_layer_max_rate ( upnpc_device_t p)

◆ upnpc_get_status_info()

int upnpc_get_status_info ( upnpc_device_t p)

◆ upnpc_init()

int upnpc_init ( upnpc_t p,
struct event_base *  base,
const char *  multicastif,
upnpc_callback_fn  ready_cb,
upnpc_callback_fn  soap_cb,
void *  cb_data 
)

◆ upnpc_set_local_address()

int upnpc_set_local_address ( upnpc_t p,
const char *  address,
uint16_t  port 
)

◆ upnpc_start()

int upnpc_start ( upnpc_t p)