34#if !defined ssize_t && defined _MSC_VER
39#include <sys/socket.h>
40#include <netinet/in.h>
49#ifdef PCP_SOCKET_IS_VOIDPTR
50#define PCP_SOCKET void *
53#define PCP_SOCKET SOCKET
59#ifdef PCP_EXPERIMENTAL
106 int flags,
struct sockaddr *src_addr, socklen_t *addrlen);
108 int flags,
struct sockaddr *dest_addr, socklen_t addrlen);
120#define ENABLE_AUTODISCOVERY 1
121#define DISABLE_AUTODISCOVERY 0
150 struct sockaddr *dst_addr,
struct sockaddr *ext_addr,
uint8_t protocol,
178#ifdef PCP_FLOW_PRIORITY
187#ifdef PCP_EXPERIMENTAL
195int pcp_flow_set_userid(
pcp_flow_t *f, pcp_userid_option_p userid);
196int pcp_flow_set_deviceid(
pcp_flow_t *f, pcp_deviceid_option_p dev);
197int pcp_flow_set_location(
pcp_flow_t *f, pcp_location_option_p loc);
217 uint8_t jitter_tol,
char *app_name);
int pcp_add_server(pcp_ctx_t *ctx, struct sockaddr *pcp_server, uint8_t pcp_version)
pcp_loglvl_e pcp_log_level
int pcp_eval_flow_state(pcp_flow_t *flow, pcp_fstate_e *fstate)
void(* external_logger)(pcp_loglvl_e, const char *)
void pcp_flow_set_filter_opt(pcp_flow_t *f, struct sockaddr *filter_ip, uint8_t filter_prefix)
pcp_ctx_t * pcp_init(uint8_t autodiscovery, pcp_socket_vt_t *socket_vt)
void * pcp_flow_get_user_data(pcp_flow_t *f)
void pcp_flow_set_user_data(pcp_flow_t *f, void *userdata)
void pcp_set_loggerfn(external_logger ext_log)
pcp_fstate_e pcp_wait(pcp_flow_t *flow, int timeout, int exit_on_partial_res)
void pcp_set_flow_change_cb(pcp_ctx_t *ctx, pcp_flow_change_notify cb_fun, void *cb_arg)
void(* pcp_flow_change_notify)(pcp_flow_t *f, struct sockaddr *src_addr, struct sockaddr *ext_addr, pcp_fstate_e, void *cb_arg)
struct pcp_socket_vt_s pcp_socket_vt_t
void pcp_delete_flow(pcp_flow_t *f)
void pcp_close_flow(pcp_flow_t *f)
void pcp_flow_set_3rd_party_opt(pcp_flow_t *f, struct sockaddr *thirdp_addr)
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)
struct pcp_flow_info pcp_flow_info_t
void pcp_flow_set_prefer_failure_opt(pcp_flow_t *f)
PCP_SOCKET pcp_get_socket(pcp_ctx_t *ctx)
@ pcp_state_short_lifetime_error
@ pcp_state_partial_result
void pcp_flow_set_lifetime(pcp_flow_t *f, uint32_t lifetime)
pcp_flow_info_t * pcp_flow_get_info(pcp_flow_t *f, size_t *info_count)
int pcp_pulse(pcp_ctx_t *ctx, struct timeval *next_timeout)
@ PCP_ERR_SHORT_LIFETIME_ERR
@ PCP_ERR_OPT_ALREADY_PRESENT
void pcp_terminate(pcp_ctx_t *ctx, int close_flows)
struct in6_addr pcp_server_ip
PCP_SOCKET(* sock_create)(int domain, int type, int protocol)
int(* sock_recvfrom)(PCP_SOCKET sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
int(* sock_close)(PCP_SOCKET sockfd)
int(* sock_sendto)(PCP_SOCKET sockfd, const void *buf, size_t len, int flags, struct sockaddr *dest_addr, socklen_t addrlen)