oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
net.h File Reference
#include "ove/types.h"
#include "ove_config.h"
#include "ove/storage.h"
Include dependency graph for net.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ove_sockaddr_t
 Generic socket address (large enough for IPv4 or IPv6). More...
 
struct  ove_netif_config_t
 Network interface configuration. More...
 

Enumerations

enum  ove_sock_type_t { OVE_SOCK_STREAM = 1 , OVE_SOCK_DGRAM = 2 }
 Socket type. More...
 
enum  ove_af_t { OVE_AF_INET = 2 , OVE_AF_INET6 = 10 }
 Address family. More...
 

Functions

int ove_netif_init (ove_netif_t *netif, ove_netif_storage_t *storage)
 Initialise a network interface from caller-supplied storage.
 
void ove_netif_deinit (ove_netif_t netif)
 De-initialise a network interface.
 
int ove_netif_up (ove_netif_t netif, const ove_netif_config_t *cfg)
 Bring the network interface up.
 
void ove_netif_down (ove_netif_t netif)
 Tear down the network interface.
 
int ove_netif_get_addr (ove_netif_t netif, ove_sockaddr_t *ip, ove_sockaddr_t *gateway, ove_sockaddr_t *netmask)
 Query the current addresses of a network interface.
 
int ove_netif_create (ove_netif_t *netif)
 Heap-allocate and initialise a network interface.
 
void ove_netif_destroy (ove_netif_t netif)
 Destroy a heap-allocated network interface.
 
int ove_socket_open (ove_socket_t *sock, ove_socket_storage_t *storage, ove_af_t af, ove_sock_type_t type)
 Open a socket from caller-supplied storage.
 
void ove_socket_close (ove_socket_t sock)
 Close a socket.
 
int ove_socket_connect (ove_socket_t sock, const ove_sockaddr_t *addr, uint64_t timeout_ns)
 Connect a socket to a remote address.
 
int ove_socket_bind (ove_socket_t sock, const ove_sockaddr_t *addr)
 Bind a socket to a local address.
 
int ove_socket_listen (ove_socket_t sock, int backlog)
 Mark a bound socket as listening for incoming connections.
 
int ove_socket_accept (ove_socket_t sock, ove_socket_t *client, ove_socket_storage_t *client_storage, uint64_t timeout_ns)
 Accept an incoming connection on a listening socket.
 
int ove_socket_send (ove_socket_t sock, const void *data, size_t len, size_t *sent)
 Send data on a connected socket.
 
int ove_socket_recv (ove_socket_t sock, void *buf, size_t len, size_t *received, uint64_t timeout_ns)
 Receive data from a connected socket.
 
int ove_socket_sendto (ove_socket_t sock, const void *data, size_t len, size_t *sent, const ove_sockaddr_t *dest)
 Send a datagram to a specific destination.
 
int ove_socket_recvfrom (ove_socket_t sock, void *buf, size_t len, size_t *received, ove_sockaddr_t *src, uint64_t timeout_ns)
 Receive a datagram and the sender's address.
 
int ove_socket_create (ove_socket_t *sock, ove_af_t af, ove_sock_type_t type)
 Heap-allocate and open a socket.
 
void ove_socket_destroy (ove_socket_t sock)
 Destroy a heap-allocated socket.
 
int ove_dns_resolve (const char *hostname, ove_sockaddr_t *addr, uint64_t timeout_ns)
 Resolve a hostname to an address.
 
void ove_sockaddr_ipv4 (ove_sockaddr_t *addr, uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint16_t port)
 Fill a sockaddr from IPv4 address components.