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

Go to the source code of this file.

Data Structures

struct  VlcbNetSocketList
 
struct  VlcbNetSocketListIter
 

Macros

#define VLCB_NET_SOCK_LIST(name, size)
 

Typedefs

typedef IVlcbNetSocket * VlcbNetSocketHandle
 

Enumerations

enum  VlcbNetSocketProcessErr {
  VLCB_NET_SOCK_PROC_ERR_OK = 0 , VLCB_NET_SOCK_PROC_ERR_RX_BUF_FULL , VLCB_NET_SOCK_PROC_ERR_PAYLOAD_TOO_LARGE , VLCB_NET_SOCK_PROC_ERR_UNKNOWN ,
  VLCB_NET_SOCK_PROC_ERR_COUNT
}
 
enum  VlcbNetSocketDispatchErr { VLCB_NET_SOCK_DISP_ERR_OK = 0 , VLCB_NET_SOCK_DISP_ERR_WOULD_BLOCK , VLCB_NET_SOCK_DISP_ERR_COUNT }
 

Functions

vlcb_error vlcb_net_sock_ProcessErrToStr (VlcbNetSocketProcessErr err)
 
vlcb_error vlcb_net_sock_DispatchErrToStr (VlcbNetSocketDispatchErr err)
 
 _INTERFACE_DECLARE (IVlcbNetSocket, _INTERFACE_METHOD_DECLARE(bool, SupportsProtocol, VlcbNetProtocol protocol);_INTERFACE_METHOD_DECLARE(VlcbNetSocketProcessErr, ProcessPacket, _INTERFACE_SELF_PTR_MUT(IVlcbNetSocket), const VlcbNetPacket *const packet);_INTERFACE_METHOD_DECLARE(VlcbNetSocketDispatchErr, DispatchPacket, _INTERFACE_SELF_PTR_MUT(IVlcbNetSocket), VlcbNetPacket *const packet);)
 
VlcbNetSocketList vlcb_net_sock_list_New (VlcbNetSocketHandle *const buf, size_t size)
 
int vlcb_net_sock_list_Insert (VlcbNetSocketList *const list, VlcbNetSocketHandle sock)
 
VlcbNetSocketListIter vlcb_net_sock_list_GetIterator (const VlcbNetSocketList *const list)
 
void vlcb_net_sock_list_iter_Reset (VlcbNetSocketListIter *const iter)
 
bool vlcb_net_sock_list_iter_HasNext (VlcbNetSocketListIter *const iter)
 
VlcbNetSocketHandle vlcb_net_sock_list_iter_Next (VlcbNetSocketListIter *const iter)
 

Macro Definition Documentation

◆ VLCB_NET_SOCK_LIST

#define VLCB_NET_SOCK_LIST ( name,
size )
Value:
VlcbNetSocketHandle name##_data[size]; \
VlcbNetSocketList name = vlcb_net_sock_list_New(data_##name, size);
VlcbNetSocketList vlcb_net_sock_list_New(VlcbNetSocketHandle *const buf, size_t size)
Definition socket.c:6
IVlcbNetSocket * VlcbNetSocketHandle
Definition socket.h:41

Definition at line 52 of file socket.h.

Typedef Documentation

◆ VlcbNetSocketHandle

typedef IVlcbNetSocket* VlcbNetSocketHandle

Definition at line 41 of file socket.h.

Enumeration Type Documentation

◆ VlcbNetSocketDispatchErr

Enumerator
VLCB_NET_SOCK_DISP_ERR_OK 
VLCB_NET_SOCK_DISP_ERR_WOULD_BLOCK 
VLCB_NET_SOCK_DISP_ERR_COUNT 

Definition at line 21 of file socket.h.

◆ VlcbNetSocketProcessErr

Enumerator
VLCB_NET_SOCK_PROC_ERR_OK 
VLCB_NET_SOCK_PROC_ERR_RX_BUF_FULL 
VLCB_NET_SOCK_PROC_ERR_PAYLOAD_TOO_LARGE 
VLCB_NET_SOCK_PROC_ERR_UNKNOWN 
VLCB_NET_SOCK_PROC_ERR_COUNT 

Definition at line 10 of file socket.h.

Function Documentation

◆ _INTERFACE_DECLARE()

◆ vlcb_net_sock_DispatchErrToStr()

vlcb_error vlcb_net_sock_DispatchErrToStr ( VlcbNetSocketDispatchErr err)

◆ vlcb_net_sock_list_GetIterator()

VlcbNetSocketListIter vlcb_net_sock_list_GetIterator ( const VlcbNetSocketList *const list)

Definition at line 30 of file socket.c.

Here is the caller graph for this function:

◆ vlcb_net_sock_list_Insert()

int vlcb_net_sock_list_Insert ( VlcbNetSocketList *const list,
VlcbNetSocketHandle sock )

Definition at line 17 of file socket.c.

Here is the caller graph for this function:

◆ vlcb_net_sock_list_iter_HasNext()

bool vlcb_net_sock_list_iter_HasNext ( VlcbNetSocketListIter *const iter)

Definition at line 43 of file socket.c.

Here is the caller graph for this function:

◆ vlcb_net_sock_list_iter_Next()

VlcbNetSocketHandle vlcb_net_sock_list_iter_Next ( VlcbNetSocketListIter *const iter)

Definition at line 50 of file socket.c.

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

◆ vlcb_net_sock_list_iter_Reset()

void vlcb_net_sock_list_iter_Reset ( VlcbNetSocketListIter *const iter)

Definition at line 38 of file socket.c.

◆ vlcb_net_sock_list_New()

VlcbNetSocketList vlcb_net_sock_list_New ( VlcbNetSocketHandle *const buf,
size_t size )
inline

Definition at line 6 of file socket.c.

◆ vlcb_net_sock_ProcessErrToStr()

vlcb_error vlcb_net_sock_ProcessErrToStr ( VlcbNetSocketProcessErr err)

Definition at line 56 of file socket.c.

Here is the caller graph for this function: