#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdint.h>
Go to the source code of this file.
|
enum | pcp_errno {
PCP_ERR_SUCCESS =0
, PCP_ERR_MAX_SIZE =-1
, PCP_ERR_OPT_ALREADY_PRESENT =-2
, PCP_ERR_BAD_AFINET =-3
,
PCP_ERR_SEND_FAILED =-4
, PCP_ERR_RECV_FAILED =-5
, PCP_ERR_UNSUP_VERSION =-6
, PCP_ERR_NO_MEM =-7
,
PCP_ERR_BAD_ARGS =-8
, PCP_ERR_UNKNOWN =-9
, PCP_ERR_SHORT_LIFETIME_ERR =-10
, PCP_ERR_TIMEOUT =-11
,
PCP_ERR_NOT_FOUND =-12
, PCP_ERR_WOULDBLOCK =-13
, PCP_ERR_ADDRINUSE =-14
} |
|
enum | pcp_loglvl_e {
PCP_LOGLVL_NONE =0
, PCP_LOGLVL_ERR =1
, PCP_LOGLVL_WARN =2
, PCP_LOGLVL_INFO =3
,
PCP_LOGLVL_PERR =4
, PCP_LOGLVL_DEBUG =5
} |
|
enum | pcp_fstate_e {
pcp_state_processing
, pcp_state_succeeded
, pcp_state_partial_result
, pcp_state_short_lifetime_error
,
pcp_state_failed
} |
|
|
void | pcp_set_loggerfn (external_logger ext_log) |
|
pcp_ctx_t * | pcp_init (uint8_t autodiscovery, pcp_socket_vt_t *socket_vt) |
|
int | pcp_add_server (pcp_ctx_t *ctx, struct sockaddr *pcp_server, uint8_t pcp_version) |
|
void | pcp_terminate (pcp_ctx_t *ctx, int close_flows) |
|
pcp_flow_t * | pcp_new_flow (pcp_ctx_t *ctx, struct sockaddr *src_addr, struct sockaddr *dst_addr, struct sockaddr *ext_addr, uint8_t protocol, uint32_t lifetime, void *userdata) |
|
void | pcp_flow_set_lifetime (pcp_flow_t *f, uint32_t lifetime) |
|
void | pcp_flow_set_user_data (pcp_flow_t *f, void *userdata) |
|
void * | pcp_flow_get_user_data (pcp_flow_t *f) |
|
void | pcp_flow_set_3rd_party_opt (pcp_flow_t *f, struct sockaddr *thirdp_addr) |
|
void | pcp_flow_set_filter_opt (pcp_flow_t *f, struct sockaddr *filter_ip, uint8_t filter_prefix) |
|
void | pcp_flow_set_prefer_failure_opt (pcp_flow_t *f) |
|
void | pcp_close_flow (pcp_flow_t *f) |
|
void | pcp_delete_flow (pcp_flow_t *f) |
|
pcp_flow_info_t * | pcp_flow_get_info (pcp_flow_t *f, size_t *info_count) |
|
void | pcp_set_flow_change_cb (pcp_ctx_t *ctx, pcp_flow_change_notify cb_fun, void *cb_arg) |
|
int | pcp_eval_flow_state (pcp_flow_t *flow, pcp_fstate_e *fstate) |
|
int | pcp_pulse (pcp_ctx_t *ctx, struct timeval *next_timeout) |
|
PCP_SOCKET | pcp_get_socket (pcp_ctx_t *ctx) |
|
pcp_fstate_e | pcp_wait (pcp_flow_t *flow, int timeout, int exit_on_partial_res) |
|
◆ DISABLE_AUTODISCOVERY
#define DISABLE_AUTODISCOVERY 0 |
◆ ENABLE_AUTODISCOVERY
#define ENABLE_AUTODISCOVERY 1 |
◆ PCP_SOCKET
Definition at line 55 of file pcp.h.
◆ external_logger
typedef void(* external_logger) (pcp_loglvl_e, const char *) |
Definition at line 93 of file pcp.h.
◆ pcp_ctx_t
◆ pcp_flow_change_notify
typedef void(* pcp_flow_change_notify) (pcp_flow_t *f, struct sockaddr *src_addr, struct sockaddr *ext_addr, pcp_fstate_e, void *cb_arg) |
◆ pcp_flow_info_t
◆ pcp_flow_t
◆ pcp_socket_vt_t
◆ pcp_errno
Enumerator |
---|
PCP_ERR_SUCCESS | |
PCP_ERR_MAX_SIZE | |
PCP_ERR_OPT_ALREADY_PRESENT | |
PCP_ERR_BAD_AFINET | |
PCP_ERR_SEND_FAILED | |
PCP_ERR_RECV_FAILED | |
PCP_ERR_UNSUP_VERSION | |
PCP_ERR_NO_MEM | |
PCP_ERR_BAD_ARGS | |
PCP_ERR_UNKNOWN | |
PCP_ERR_SHORT_LIFETIME_ERR | |
PCP_ERR_TIMEOUT | |
PCP_ERR_NOT_FOUND | |
PCP_ERR_WOULDBLOCK | |
PCP_ERR_ADDRINUSE | |
Definition at line 65 of file pcp.h.
◆ pcp_fstate_e
Enumerator |
---|
pcp_state_processing | |
pcp_state_succeeded | |
pcp_state_partial_result | |
pcp_state_short_lifetime_error | |
pcp_state_failed | |
Definition at line 231 of file pcp.h.
◆ pcp_loglvl_e
Enumerator |
---|
PCP_LOGLVL_NONE | |
PCP_LOGLVL_ERR | |
PCP_LOGLVL_WARN | |
PCP_LOGLVL_INFO | |
PCP_LOGLVL_PERR | |
PCP_LOGLVL_DEBUG | |
Definition at line 84 of file pcp.h.
◆ pcp_add_server()
int pcp_add_server |
( |
pcp_ctx_t * |
ctx, |
|
|
struct sockaddr * |
pcp_server, |
|
|
uint8_t |
pcp_version |
|
) |
| |
◆ pcp_close_flow()
◆ pcp_delete_flow()
◆ pcp_eval_flow_state()
◆ pcp_flow_get_info()
◆ pcp_flow_get_user_data()
◆ pcp_flow_set_3rd_party_opt()
void pcp_flow_set_3rd_party_opt |
( |
pcp_flow_t * |
f, |
|
|
struct sockaddr * |
thirdp_addr |
|
) |
| |
◆ pcp_flow_set_filter_opt()
void pcp_flow_set_filter_opt |
( |
pcp_flow_t * |
f, |
|
|
struct sockaddr * |
filter_ip, |
|
|
uint8_t |
filter_prefix |
|
) |
| |
◆ pcp_flow_set_lifetime()
◆ pcp_flow_set_prefer_failure_opt()
void pcp_flow_set_prefer_failure_opt |
( |
pcp_flow_t * |
f | ) |
|
◆ pcp_flow_set_user_data()
void pcp_flow_set_user_data |
( |
pcp_flow_t * |
f, |
|
|
void * |
userdata |
|
) |
| |
◆ pcp_get_socket()
◆ pcp_init()
◆ pcp_new_flow()
pcp_flow_t * pcp_new_flow |
( |
pcp_ctx_t * |
ctx, |
|
|
struct sockaddr * |
src_addr, |
|
|
struct sockaddr * |
dst_addr, |
|
|
struct sockaddr * |
ext_addr, |
|
|
uint8_t |
protocol, |
|
|
uint32_t |
lifetime, |
|
|
void * |
userdata |
|
) |
| |
◆ pcp_pulse()
int pcp_pulse |
( |
pcp_ctx_t * |
ctx, |
|
|
struct timeval * |
next_timeout |
|
) |
| |
◆ pcp_set_flow_change_cb()
◆ pcp_set_loggerfn()
◆ pcp_terminate()
void pcp_terminate |
( |
pcp_ctx_t * |
ctx, |
|
|
int |
close_flows |
|
) |
| |
◆ pcp_wait()
◆ pcp_log_level