Anjay Lite
Loading...
Searching...
No Matches
anj_net_wrapper.h File Reference

Thin dispatch layer for network backends. More...

Go to the source code of this file.

Functions

static int anj_net_create_ctx (anj_net_binding_type_t type, anj_net_ctx_t **ctx, const anj_net_config_t *config)
 
static int anj_net_connect (anj_net_binding_type_t type, anj_net_ctx_t *ctx, const char *hostname, const char *port)
 
static int anj_net_send (anj_net_binding_type_t type, anj_net_ctx_t *ctx, size_t *bytes_sent, const uint8_t *buf, size_t length)
 
static int anj_net_recv (anj_net_binding_type_t type, anj_net_ctx_t *ctx, size_t *bytes_received, uint8_t *buf, size_t length)
 
static int anj_net_close (anj_net_binding_type_t type, anj_net_ctx_t *ctx)
 
static int anj_net_shutdown (anj_net_binding_type_t type, anj_net_ctx_t *ctx)
 
static int anj_net_cleanup_ctx (anj_net_binding_type_t type, anj_net_ctx_t **ctx)
 
static int anj_net_get_inner_mtu (anj_net_binding_type_t type, anj_net_ctx_t *ctx, int32_t *out_value)
 
static int anj_net_get_state (anj_net_binding_type_t type, anj_net_ctx_t *ctx, anj_net_socket_state_t *out_value)
 
static int anj_net_queue_mode_rx_off (anj_net_binding_type_t type, anj_net_ctx_t *ctx)
 

Detailed Description

Thin dispatch layer for network backends.

This header provides inline wrappers that route generic anj_net_api.h calls (create, connect, send, recv, etc.) to the selected transport backend:

  • UDP
  • TCP
  • DTLS
  • TLS
  • Non-IP bindings

Which backends are compiled in is controlled via ANJ_NET_WITH_* macros. Each wrapper chooses the appropriate implementation or returns ANJ_NET_ENOTSUP if not available.

This lets the core code call a uniform API, while integrators can enable/disable specific transports at build time.

Function Documentation

◆ anj_net_cleanup_ctx()

static int anj_net_cleanup_ctx ( anj_net_binding_type_t  type,
anj_net_ctx_t **  ctx 
)
inlinestatic

◆ anj_net_close()

static int anj_net_close ( anj_net_binding_type_t  type,
anj_net_ctx_t ctx 
)
inlinestatic
See also
anj_net_close_t

◆ anj_net_connect()

static int anj_net_connect ( anj_net_binding_type_t  type,
anj_net_ctx_t ctx,
const char *  hostname,
const char *  port 
)
inlinestatic

◆ anj_net_create_ctx()

static int anj_net_create_ctx ( anj_net_binding_type_t  type,
anj_net_ctx_t **  ctx,
const anj_net_config_t config 
)
inlinestatic

◆ anj_net_get_inner_mtu()

static int anj_net_get_inner_mtu ( anj_net_binding_type_t  type,
anj_net_ctx_t ctx,
int32_t *  out_value 
)
inlinestatic

◆ anj_net_get_state()

static int anj_net_get_state ( anj_net_binding_type_t  type,
anj_net_ctx_t ctx,
anj_net_socket_state_t out_value 
)
inlinestatic

◆ anj_net_queue_mode_rx_off()

static int anj_net_queue_mode_rx_off ( anj_net_binding_type_t  type,
anj_net_ctx_t ctx 
)
inlinestatic

◆ anj_net_recv()

static int anj_net_recv ( anj_net_binding_type_t  type,
anj_net_ctx_t ctx,
size_t *  bytes_received,
uint8_t *  buf,
size_t  length 
)
inlinestatic
See also
anj_net_recv_t

◆ anj_net_send()

static int anj_net_send ( anj_net_binding_type_t  type,
anj_net_ctx_t ctx,
size_t *  bytes_sent,
const uint8_t *  buf,
size_t  length 
)
inlinestatic
See also
anj_net_send_t

◆ anj_net_shutdown()

static int anj_net_shutdown ( anj_net_binding_type_t  type,
anj_net_ctx_t ctx 
)
inlinestatic