Project Alice
Loading...
Searching...
No Matches
pcp_socket.c File Reference
#include "default_config.h"
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include "pcp.h"
#include "unp.h"
#include "pcp_utils.h"
#include "pcp_socket.h"
Include dependency graph for pcp_socket.c:

Go to the source code of this file.

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
 

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
Initial value:
={
pcp_socket_create_impl,
pcp_socket_recvfrom_impl,
pcp_socket_sendto_impl,
pcp_socket_close_impl
}

Definition at line 58 of file pcp_socket.c.