Virtual Hardware  Version 1.3.0 - beta
Simulation Models with Virtual Interfaces for Test Automation

Virtual Socket (VSocket) API. More...

Data Structures

struct  ARM_VSocket_Type
 Structure type to access the VSocket. More...
 
struct  vSocketCreateIO_t
 I/O structure for iotSocketCreate. More...
 
struct  vSocketBindIO_t
 I/O structure for iotSocketBind. More...
 
struct  vSocketListenIO_t
 I/O structure for iotSocketListen. More...
 
struct  vSocketAcceptIO_t
 I/O structure for iotSocketAccept. More...
 
struct  vSocketConnectIO_t
 I/O structure for iotSocketConnect. More...
 
struct  vSocketRecvIO_t
 I/O structure for iotSocketRecv. More...
 
struct  vSocketRecvFromIO_t
 I/O structure for iotSocketRecvFrom. More...
 
struct  vSocketSendIO_t
 I/O structure for iotSocketSend. More...
 
struct  vSocketSendToIO_t
 I/O structure for iotSocketSendTo. More...
 
struct  vSocketGetSockNameIO_t
 I/O structure for iotSocketGetSockName. More...
 
struct  vSocketGetPeerNameIO_t
 I/O structure for iotSocketGetPeerName. More...
 
struct  vSocketGetOptIO_t
 I/O structure for iotSocketGetOpt. More...
 
struct  vSocketSetOptIO_t
 I/O structure for iotSocketSetOpt. More...
 
struct  vSocketCloseIO_t
 I/O structure for iotSocketClose. More...
 
struct  vSocketGetHostByNameIO_t
 I/O structure for iotSocketGetHostByName. More...
 
struct  vSocketCreateIO_t.param
 arguments for iotSocketCreate More...
 
struct  vSocketBindIO_t.param
 arguments for iotSocketBind More...
 
struct  vSocketListenIO_t.param
 arguments for iotSocketListen More...
 
struct  vSocketAcceptIO_t.param
 arguments for iotSocketAccept More...
 
struct  vSocketConnectIO_t.param
 arguments for iotSocketConnect More...
 
struct  vSocketRecvIO_t.param
 arguments for iotSocketRecv More...
 
struct  vSocketRecvFromIO_t.param
 arguments for iotSocketRecvFrom More...
 
struct  vSocketSendIO_t.param
 arguments for iotSocketSend More...
 
struct  vSocketSendToIO_t.param
 arguments for iotSocketSendTo More...
 
struct  vSocketGetSockNameIO_t.param
 arguments for iotSocketGetSockName More...
 
struct  vSocketGetPeerNameIO_t.param
 arguments for iotSocketGetPeerName More...
 
struct  vSocketGetOptIO_t.param
 arguments for iotSocketGetOpt More...
 
struct  vSocketSetOptIO_t.param
 arguments for iotSocketSetOpt More...
 
struct  vSocketCloseIO_t.param
 arguments for iotSocketClose More...
 
struct  vSocketGetHostByNameIO_t.param
 arguments for iotSocketGetHostByName More...
 

Macros

#define ARM_VSOCKET_BASE   (0x4FEE0000UL)
 
#define ARM_VSOCKET   ((ARM_VSocket_Type *)ARM_VSOCKET_BASE)
 

Description

Virtual Socket (VSocket) API.

The VSocket peripheral is accessed using the ARM_VSocket_Type structure that is mapped into the memory of a Cortex-M system, for example:

// Memory mapping of VSocket peripheral
#define ARM_VSOCKET_BASE (0x4FEE0000UL) /*!< VSocket Base Address */
#define ARM_VSOCKET ((ARM_VSocket_Type *)ARM_VSOCKET_BASE) /*!< VSocket struct */

The ARM_VSocket_Type structure is defined in arm_vsocket.h file as follows:

/// Structure type to access the VSocket
typedef struct
{
volatile uint32_t reserved;
volatile vSocketCreateIO_t * vSocketCreateIO;
volatile vSocketBindIO_t * vSocketBindIO;
volatile vSocketListenIO_t * vSocketListenIO;
volatile vSocketAcceptIO_t * vSocketAcceptIO;
volatile vSocketConnectIO_t * vSocketConnectIO;
volatile vSocketRecvIO_t * vSocketRecvIO;
volatile vSocketRecvFromIO_t * vSocketRecvFromIO;
volatile vSocketSendIO_t * vSocketSendIO;
volatile vSocketSendToIO_t * vSocketSendToIO;
volatile vSocketGetSockNameIO_t * vSocketGetSockNameIO;
volatile vSocketGetPeerNameIO_t * vSocketGetPeerNameIO;
volatile vSocketGetOptIO_t * vSocketGetOptIO;
volatile vSocketSetOptIO_t * vSocketSetOptIO;
volatile vSocketCloseIO_t * vSocketCloseIO;
volatile vSocketGetHostByNameIO_t * vSocketGetHostByNameIO;

Data Structure Documentation

◆ ARM_VSocket_Type

struct ARM_VSocket_Type

Structure type to access the VSocket.

The ARM_VSocket_Type structure provides access to the VSocket peripheral registers

Data Fields
volatile uint32_t reserved
volatile vSocketCreateIO_t * vSocketCreateIO

Structure for socket create

volatile vSocketBindIO_t * vSocketBindIO

Structure for socket bind

volatile vSocketListenIO_t * vSocketListenIO

Structure for socket listen

volatile vSocketAcceptIO_t * vSocketAcceptIO

Structure for socket accept

volatile vSocketConnectIO_t * vSocketConnectIO

Structure for socket connect

volatile vSocketRecvIO_t * vSocketRecvIO

Structure for socket receive

volatile vSocketRecvFromIO_t * vSocketRecvFromIO

Structure for socket receive from

volatile vSocketSendIO_t * vSocketSendIO

Structure for socket send

volatile vSocketSendToIO_t * vSocketSendToIO

Structure for socket send to

volatile vSocketGetSockNameIO_t * vSocketGetSockNameIO

Structure for get socket name

volatile vSocketGetPeerNameIO_t * vSocketGetPeerNameIO

Structure for get peer name

volatile vSocketGetOptIO_t * vSocketGetOptIO

Structure for socket get options

volatile vSocketSetOptIO_t * vSocketSetOptIO

Structure for socket set options

volatile vSocketCloseIO_t * vSocketCloseIO

Structure for socket close

volatile vSocketGetHostByNameIO_t * vSocketGetHostByNameIO

Structure for socket get host by name

◆ vSocketCreateIO_t

struct vSocketCreateIO_t

I/O structure for iotSocketCreate.

Data Fields
int32_t ret_val

return value

struct vSocketCreateIO_t.param param arguments for iotSocketCreate

◆ vSocketBindIO_t

struct vSocketBindIO_t

I/O structure for iotSocketBind.

Data Fields
int32_t ret_val

return value

struct vSocketBindIO_t.param param arguments for iotSocketBind

◆ vSocketListenIO_t

struct vSocketListenIO_t

I/O structure for iotSocketListen.

Data Fields
int32_t ret_val

return value

struct vSocketListenIO_t.param param arguments for iotSocketListen

◆ vSocketAcceptIO_t

struct vSocketAcceptIO_t

I/O structure for iotSocketAccept.

Data Fields
int32_t ret_val

return value

struct vSocketAcceptIO_t.param param arguments for iotSocketAccept

◆ vSocketConnectIO_t

struct vSocketConnectIO_t

I/O structure for iotSocketConnect.

Data Fields
int32_t ret_val

return value

struct vSocketConnectIO_t.param param arguments for iotSocketConnect

◆ vSocketRecvIO_t

struct vSocketRecvIO_t

I/O structure for iotSocketRecv.

Data Fields
int32_t ret_val

return value

struct vSocketRecvIO_t.param param arguments for iotSocketRecv

◆ vSocketRecvFromIO_t

struct vSocketRecvFromIO_t

I/O structure for iotSocketRecvFrom.

Data Fields
int32_t ret_val

return value

struct vSocketRecvFromIO_t.param param arguments for iotSocketRecvFrom

◆ vSocketSendIO_t

struct vSocketSendIO_t

I/O structure for iotSocketSend.

Data Fields
int32_t ret_val

return value

struct vSocketSendIO_t.param param arguments for iotSocketSend

◆ vSocketSendToIO_t

struct vSocketSendToIO_t

I/O structure for iotSocketSendTo.

Data Fields
int32_t ret_val

return value

struct vSocketSendToIO_t.param param arguments for iotSocketSendTo

◆ vSocketGetSockNameIO_t

struct vSocketGetSockNameIO_t

I/O structure for iotSocketGetSockName.

Data Fields
int32_t ret_val

return value

struct vSocketGetSockNameIO_t.param param arguments for iotSocketGetSockName

◆ vSocketGetPeerNameIO_t

struct vSocketGetPeerNameIO_t

I/O structure for iotSocketGetPeerName.

Data Fields
int32_t ret_val

return value

struct vSocketGetPeerNameIO_t.param param arguments for iotSocketGetPeerName

◆ vSocketGetOptIO_t

struct vSocketGetOptIO_t

I/O structure for iotSocketGetOpt.

Data Fields
int32_t ret_val

return value

struct vSocketGetOptIO_t.param param arguments for iotSocketGetOpt

◆ vSocketSetOptIO_t

struct vSocketSetOptIO_t

I/O structure for iotSocketSetOpt.

Data Fields
int32_t ret_val

return value

struct vSocketSetOptIO_t.param param arguments for iotSocketSetOpt

◆ vSocketCloseIO_t

struct vSocketCloseIO_t

I/O structure for iotSocketClose.

Data Fields
int32_t ret_val

return value

struct vSocketCloseIO_t.param param arguments for iotSocketClose

◆ vSocketGetHostByNameIO_t

struct vSocketGetHostByNameIO_t

I/O structure for iotSocketGetHostByName.

Data Fields
int32_t ret_val

return value

struct vSocketGetHostByNameIO_t.param param arguments for iotSocketGetHostByName

◆ vSocketCreateIO_t.param

struct vSocketCreateIO_t.param

arguments for iotSocketCreate

Data Fields
int32_t af

address family

int32_t type

socket type

int32_t protocol

socket protocol

◆ vSocketBindIO_t.param

struct vSocketBindIO_t.param

arguments for iotSocketBind

Data Fields
int32_t socket

socket identification number

const uint8_t * ip

pointer to local IP address

uint32_t ip_len

length of 'ip' address in bytes

uint16_t port

local port number

uint16_t padding

◆ vSocketListenIO_t.param

struct vSocketListenIO_t.param

arguments for iotSocketListen

Data Fields
int32_t socket

socket identification number

int32_t backlog

number of connection requests that can be queued

◆ vSocketAcceptIO_t.param

struct vSocketAcceptIO_t.param

arguments for iotSocketAccept

Data Fields
int32_t socket

socket identification number

uint8_t * ip

pointer to buffer where address of connecting socket shall be returned (NULL for none)

uint32_t * ip_len

pointer to length of 'ip' (or NULL if 'ip' is NULL)

uint16_t * port

pointer to buffer where port of connecting socket shall be returned (NULL for none)

◆ vSocketConnectIO_t.param

struct vSocketConnectIO_t.param

arguments for iotSocketConnect

Data Fields
int32_t socket

socket identification number

const uint8_t * ip

pointer to remote IP address

uint32_t ip_len

length of 'ip' address in bytes

uint16_t port

remote port number

uint16_t padding

◆ vSocketRecvIO_t.param

struct vSocketRecvIO_t.param

arguments for iotSocketRecv

Data Fields
int32_t socket

socket identification number

void * buf

pointer to buffer where data should be stored

uint32_t len

length of buffer (in bytes)

◆ vSocketRecvFromIO_t.param

struct vSocketRecvFromIO_t.param

arguments for iotSocketRecvFrom

Data Fields
int32_t socket

socket identification number

void * buf

pointer to buffer where data should be stored

uint32_t len

length of buffer (in bytes)

uint8_t * ip

pointer to buffer where remote source address shall be returned (NULL for none)

uint32_t * ip_len

pointer to length of 'ip' (or NULL if 'ip' is NULL)

uint16_t * port

pointer to buffer where remote source port shall be returned (NULL for none)

◆ vSocketSendIO_t.param

struct vSocketSendIO_t.param

arguments for iotSocketSend

Data Fields
int32_t socket

socket identification number

const void * buf

pointer to buffer containing data to send

uint32_t len

length of data (in bytes)

◆ vSocketSendToIO_t.param

struct vSocketSendToIO_t.param

arguments for iotSocketSendTo

Data Fields
int32_t socket

socket identification number

const void * buf

pointer to buffer containing data to send

uint32_t len

length of data (in bytes)

const uint8_t * ip

pointer to remote destination IP address

uint32_t ip_len

length of 'ip' address in bytes

uint16_t port

remote destination port number

uint16_t padding

◆ vSocketGetSockNameIO_t.param

struct vSocketGetSockNameIO_t.param

arguments for iotSocketGetSockName

Data Fields
int32_t socket

socket identification number

uint8_t * ip

pointer to buffer where local address shall be returned (NULL for none)

uint32_t * ip_len

pointer to length of 'ip' (or NULL if 'ip' is NULL)

uint16_t * port

pointer to buffer where local port shall be returned (NULL for none)

◆ vSocketGetPeerNameIO_t.param

struct vSocketGetPeerNameIO_t.param

arguments for iotSocketGetPeerName

Data Fields
int32_t socket

socket identification number

uint8_t * ip

pointer to buffer where remote address shall be returned (NULL for none)

uint32_t * ip_len

pointer to length of 'ip' (or NULL if 'ip' is NULL)

uint16_t * port

pointer to buffer where remote port shall be returned (NULL for none)

◆ vSocketGetOptIO_t.param

struct vSocketGetOptIO_t.param

arguments for iotSocketGetOpt

Data Fields
int32_t socket

socket identification number

int32_t opt_id

option identifier

void * opt_val

pointer to the buffer that will receive the option value

uint32_t * opt_len

pointer to length of the option value

◆ vSocketSetOptIO_t.param

struct vSocketSetOptIO_t.param

arguments for iotSocketSetOpt

Data Fields
int32_t socket

socket identification number

int32_t opt_id

option identifier

const void * opt_val

pointer to the option value

uint32_t opt_len

length of the option value in bytes

◆ vSocketCloseIO_t.param

struct vSocketCloseIO_t.param

arguments for iotSocketClose

Data Fields
int32_t socket

socket identification number

◆ vSocketGetHostByNameIO_t.param

struct vSocketGetHostByNameIO_t.param

arguments for iotSocketGetHostByName

Data Fields
const char * name

host name

uint32_t len

length of host name

int32_t af

address family

uint8_t * ip

pointer to buffer where resolved IP address shall be returned

uint32_t * ip_len

pointer to length of 'ip'

Macro Definition Documentation

◆ ARM_VSOCKET_BASE

#define ARM_VSOCKET_BASE   (0x4FEE0000UL)

VSocket Base Address

◆ ARM_VSOCKET

#define ARM_VSOCKET   ((ARM_VSocket_Type *)ARM_VSOCKET_BASE)

VSocket struct