Project Alice
Loading...
Searching...
No Matches
pcp_api.c File Reference
#include "default_config.h"
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <sys/select.h>
#include <time.h>
#include <sys/types.h>
#include <unistd.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include "pcp.h"
#include "net/pcp_socket.h"
#include "pcp_client_db.h"
#include "pcp_logger.h"
#include "pcp_event_handler.h"
#include "pcp_utils.h"
#include "pcp_server_discovery.h"
#include "net/findsaddr.h"
Include dependency graph for pcp_api.c:

Go to the source code of this file.

Classes

struct  caasi_data
 

Functions

PCP_SOCKET pcp_get_socket (pcp_ctx_t *ctx)
 
int pcp_add_server (pcp_ctx_t *ctx, struct sockaddr *pcp_server, uint8_t pcp_version)
 
pcp_ctx_tpcp_init (uint8_t autodiscovery, pcp_socket_vt_t *socket_vt)
 
int pcp_eval_flow_state (pcp_flow_t *flow, pcp_fstate_e *fstate)
 
pcp_fstate_e pcp_wait (pcp_flow_t *flow, int timeout, int exit_on_partial_res)
 
pcp_flow_tpcp_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_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)
 
void pcp_terminate (pcp_ctx_t *ctx, int close_flows)
 
pcp_flow_info_tpcp_flow_get_info (pcp_flow_t *f, size_t *info_count)
 
void pcp_flow_set_user_data (pcp_flow_t *f, void *userdata)
 
void * pcp_flow_get_user_data (pcp_flow_t *f)
 

Function Documentation

◆ pcp_add_server()

int pcp_add_server ( pcp_ctx_t ctx,
struct sockaddr *  pcp_server,
uint8_t  pcp_version 
)

Definition at line 72 of file pcp_api.c.

Here is the call graph for this function:

◆ pcp_close_flow()

void pcp_close_flow ( pcp_flow_t f)

Definition at line 626 of file pcp_api.c.

Here is the call graph for this function:

◆ pcp_delete_flow()

void pcp_delete_flow ( pcp_flow_t f)

Definition at line 639 of file pcp_api.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcp_eval_flow_state()

int pcp_eval_flow_state ( pcp_flow_t flow,
pcp_fstate_e fstate 
)

Definition at line 136 of file pcp_api.c.

Here is the caller graph for this function:

◆ pcp_flow_get_info()

pcp_flow_info_t * pcp_flow_get_info ( pcp_flow_t f,
size_t *  info_count 
)

Definition at line 669 of file pcp_api.c.

◆ pcp_flow_get_user_data()

void * pcp_flow_get_user_data ( pcp_flow_t f)

Definition at line 745 of file pcp_api.c.

◆ pcp_flow_set_3rd_party_opt()

void pcp_flow_set_3rd_party_opt ( pcp_flow_t f,
struct sockaddr *  thirdp_addr 
)

Definition at line 500 of file pcp_api.c.

Here is the call graph for this function:

◆ pcp_flow_set_filter_opt()

void pcp_flow_set_filter_opt ( pcp_flow_t f,
struct sockaddr *  filter_ip,
uint8_t  filter_prefix 
)

Definition at line 511 of file pcp_api.c.

Here is the call graph for this function:

◆ pcp_flow_set_lifetime()

void pcp_flow_set_lifetime ( pcp_flow_t f,
uint32_t  lifetime 
)

Definition at line 489 of file pcp_api.c.

Here is the call graph for this function:

◆ pcp_flow_set_prefer_failure_opt()

void pcp_flow_set_prefer_failure_opt ( pcp_flow_t f)

Definition at line 526 of file pcp_api.c.

Here is the call graph for this function:

◆ pcp_flow_set_user_data()

void pcp_flow_set_user_data ( pcp_flow_t f,
void *  userdata 
)

Definition at line 735 of file pcp_api.c.

◆ pcp_get_socket()

PCP_SOCKET pcp_get_socket ( pcp_ctx_t ctx)

Definition at line 66 of file pcp_api.c.

Here is the caller graph for this function:

◆ pcp_init()

pcp_ctx_t * pcp_init ( uint8_t  autodiscovery,
pcp_socket_vt_t socket_vt 
)

Definition at line 93 of file pcp_api.c.

Here is the call graph for this function:
Here is the caller graph for this function:

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

Definition at line 389 of file pcp_api.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcp_terminate()

void pcp_terminate ( pcp_ctx_t ctx,
int  close_flows 
)

Definition at line 662 of file pcp_api.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcp_wait()

pcp_fstate_e pcp_wait ( pcp_flow_t flow,
int  timeout,
int  exit_on_partial_res 
)

Definition at line 187 of file pcp_api.c.

Here is the call graph for this function:
Here is the caller graph for this function: