Project Alice
Loading...
Searching...
No Matches
pcp_socket.h File Reference
#include "pcp.h"
Include dependency graph for pcp_socket.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PD_SOCKET_STARTUP()
 
#define PD_SOCKET_CLEANUP()
 
#define PCP_SOCKET_ERROR   (-1)
 
#define PCP_INVALID_SOCKET   (-1)
 
#define CLOSE(sockfd)   close(sockfd)
 
#define SA_LEN(addr)   (get_sa_len(addr))
 
#define SET_SA_LEN(s, l)
 

Functions

void pcp_fill_in6_addr (struct in6_addr *dst_ip6, uint16_t *dst_port, struct sockaddr *src)
 
void pcp_fill_sockaddr (struct sockaddr *dst, struct in6_addr *sip, uint16_t sport, int ret_ipv6_mapped_ipv4, uint32_t scope_id)
 
PCP_SOCKET pcp_socket_create (struct pcp_ctx_s *ctx, int domain, int type, int protocol)
 
ssize_t pcp_socket_recvfrom (struct pcp_ctx_s *ctx, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
 
ssize_t pcp_socket_sendto (struct pcp_ctx_s *ctx, const void *buf, size_t len, int flags, struct sockaddr *dest_addr, socklen_t addrlen)
 
int pcp_socket_close (struct pcp_ctx_s *ctx)
 

Variables

pcp_socket_vt_t default_socket_vt
 

Macro Definition Documentation

◆ CLOSE

#define CLOSE (   sockfd)    close(sockfd)

Definition at line 62 of file pcp_socket.h.

◆ PCP_INVALID_SOCKET

#define PCP_INVALID_SOCKET   (-1)

Definition at line 61 of file pcp_socket.h.

◆ PCP_SOCKET_ERROR

#define PCP_SOCKET_ERROR   (-1)

Definition at line 60 of file pcp_socket.h.

◆ PD_SOCKET_CLEANUP

#define PD_SOCKET_CLEANUP ( )

Definition at line 59 of file pcp_socket.h.

◆ PD_SOCKET_STARTUP

#define PD_SOCKET_STARTUP ( )

Definition at line 58 of file pcp_socket.h.

◆ SA_LEN

#define SA_LEN (   addr)    (get_sa_len(addr))

Definition at line 112 of file pcp_socket.h.

◆ SET_SA_LEN

#define SET_SA_LEN (   s,
 
)

Definition at line 119 of file pcp_socket.h.

Function Documentation

◆ pcp_fill_in6_addr()

void pcp_fill_in6_addr ( struct in6_addr *  dst_ip6,
uint16_t *  dst_port,
struct sockaddr *  src 
)

Definition at line 99 of file pcp_socket.c.

Here is the caller graph for this function:

◆ pcp_fill_sockaddr()

void pcp_fill_sockaddr ( struct sockaddr *  dst,
struct in6_addr *  sip,
uint16_t  sport,
int  ret_ipv6_mapped_ipv4,
uint32_t  scope_id 
)

Definition at line 132 of file pcp_socket.c.

◆ pcp_socket_close()

int pcp_socket_close ( struct pcp_ctx_s ctx)

Definition at line 207 of file pcp_socket.c.

Here is the caller graph for this function:

◆ pcp_socket_create()

PCP_SOCKET pcp_socket_create ( struct pcp_ctx_s ctx,
int  domain,
int  type,
int  protocol 
)

Definition at line 181 of file pcp_socket.c.

Here is the caller graph for this function:

◆ pcp_socket_recvfrom()

ssize_t pcp_socket_recvfrom ( struct pcp_ctx_s ctx,
void *  buf,
size_t  len,
int  flags,
struct sockaddr *  src_addr,
socklen_t *  addrlen 
)

Definition at line 189 of file pcp_socket.c.

◆ pcp_socket_sendto()

ssize_t pcp_socket_sendto ( struct pcp_ctx_s ctx,
const void *  buf,
size_t  len,
int  flags,
struct sockaddr *  dest_addr,
socklen_t  addrlen 
)

Definition at line 198 of file pcp_socket.c.

Variable Documentation

◆ default_socket_vt

pcp_socket_vt_t default_socket_vt
extern

Definition at line 58 of file pcp_socket.c.