VLCB SDK
An opinionated SDK for VLCB protocol
Loading...
Searching...
No Matches
datagram.h File Reference
#include "../packet/datagram.h"
#include "../socket.h"
#include "../storage/packet_buf.h"
#include "vlcb/platform/interface.h"
#include <stdint.h>
Include dependency graph for socket/datagram.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  VlcbNetSocketDatagram
 

Macros

#define VLCB_NET_SOCK_DGRAM_BUF(name, size)
 

Typedefs

typedef uint8_t VlcbNetSockDgramFlushMode
 

Enumerations

enum  VlcbNetSocketDgramSendErr { VLCB_NET_SOCK_DGRAM_SEND_ERR_OK = 0 , VLCB_NET_SOCK_DGRAM_SEND_ERR_BUF_FULL , VLCB_NET_SOKC_DGRAM_SEND_ERR_COUNT }
 
enum  VlcbNetSocketDgramRecvErr { VLCB_NET_SOCK_DGRAM_RECV_ERR_OK = 0 , VLCB_NET_SOCK_DGRAM_RECV_ERR_WOULD_BLOCK , VLCB_NET_SOKC_DGRAM_RECV_ERR_COUNT }
 
enum  VlcbNetSockDgramFlushMode { VLCB_NET_SOCK_DGRAM_FLUSH_BOTH , VLCB_NET_SOCK_DGRAM_FLUSH_TX , VLCB_NET_SOCK_DGRAM_FLUSH_RX }
 

Functions

VlcbNetSocketDatagram vlcb_net_sock_dgram_New (VlcbPacketBuf *const rxBuf, VlcbPacketBuf *const txBuf)
 
vlcb_error vlcb_net_sock_dgram_SendErrToStr (VlcbNetSocketDgramSendErr err)
 
VlcbNetSocketDgramSendErr vlcb_net_sock_dgram_Send (VlcbNetSocketDatagram *const sock, const VlcbNetPacketDatagram *const packet)
 
VlcbNetSocketDgramRecvErr vlcb_net_sock_dgram_Recv (VlcbNetSocketDatagram *const sock, VlcbNetPacketDatagram *const packet)
 
static IVlcbNetSocket *const vlcb_net_sock_dgram_Upcast (VlcbNetSocketDatagram *const sock)
 
void vlcb_net_sock_dgram_Flush (VlcbNetSocketDatagram *const sock, const VlcbNetSockDgramFlushMode mode)
 

Macro Definition Documentation

◆ VLCB_NET_SOCK_DGRAM_BUF

#define VLCB_NET_SOCK_DGRAM_BUF ( name,
size )
Value:
uint8_t \
name##_data[sizeof(VlcbPacketBuf) + sizeof(VlcbPacketDatagram) * size]; \
vlcb_net_packetbuf_Init(name##_data, size, sizeof(VlcbPacketDatagram)); \
VlcbPacketBuf *const name = (VlcbPacketBuf *const)name##_data;

Definition at line 9 of file socket/datagram.h.

Typedef Documentation

◆ VlcbNetSockDgramFlushMode

typedef uint8_t VlcbNetSockDgramFlushMode

Definition at line 50 of file socket/datagram.h.

Enumeration Type Documentation

◆ VlcbNetSockDgramFlushMode

Enumerator
VLCB_NET_SOCK_DGRAM_FLUSH_BOTH 
VLCB_NET_SOCK_DGRAM_FLUSH_TX 
VLCB_NET_SOCK_DGRAM_FLUSH_RX 

Definition at line 51 of file socket/datagram.h.

◆ VlcbNetSocketDgramRecvErr

Enumerator
VLCB_NET_SOCK_DGRAM_RECV_ERR_OK 
VLCB_NET_SOCK_DGRAM_RECV_ERR_WOULD_BLOCK 
VLCB_NET_SOKC_DGRAM_RECV_ERR_COUNT 

Definition at line 31 of file socket/datagram.h.

◆ VlcbNetSocketDgramSendErr

Enumerator
VLCB_NET_SOCK_DGRAM_SEND_ERR_OK 
VLCB_NET_SOCK_DGRAM_SEND_ERR_BUF_FULL 
VLCB_NET_SOKC_DGRAM_SEND_ERR_COUNT 

Definition at line 24 of file socket/datagram.h.

Function Documentation

◆ vlcb_net_sock_dgram_Flush()

void vlcb_net_sock_dgram_Flush ( VlcbNetSocketDatagram *const sock,
const VlcbNetSockDgramFlushMode mode )

Definition at line 103 of file socket/datagram.c.

Here is the call graph for this function:

◆ vlcb_net_sock_dgram_New()

VlcbNetSocketDatagram vlcb_net_sock_dgram_New ( VlcbPacketBuf *const rxBuf,
VlcbPacketBuf *const txBuf )

Definition at line 73 of file socket/datagram.c.

◆ vlcb_net_sock_dgram_Recv()

VlcbNetSocketDgramRecvErr vlcb_net_sock_dgram_Recv ( VlcbNetSocketDatagram *const sock,
VlcbNetPacketDatagram *const packet )

Definition at line 93 of file socket/datagram.c.

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

◆ vlcb_net_sock_dgram_Send()

VlcbNetSocketDgramSendErr vlcb_net_sock_dgram_Send ( VlcbNetSocketDatagram *const sock,
const VlcbNetPacketDatagram *const packet )

Definition at line 81 of file socket/datagram.c.

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

◆ vlcb_net_sock_dgram_SendErrToStr()

vlcb_error vlcb_net_sock_dgram_SendErrToStr ( VlcbNetSocketDgramSendErr err)
Here is the caller graph for this function:

◆ vlcb_net_sock_dgram_Upcast()

static IVlcbNetSocket *const vlcb_net_sock_dgram_Upcast ( VlcbNetSocketDatagram *const sock)
inlinestatic

Definition at line 46 of file socket/datagram.h.