27#include "ove_config.h"
40#define OVE_SOCK_STREAM ((ove_sock_type_t)1)
41#define OVE_SOCK_DGRAM ((ove_sock_type_t)2)
43#define OVE_AF_INET ((ove_af_t)2)
44#define OVE_AF_INET6 ((ove_af_t)10)
78#include "ove/storage.h"
91int ove_netif_init(
ove_netif_t *netif, ove_netif_storage_t *storage);
156int ove_socket_open(
ove_socket_t *sock, ove_socket_storage_t *storage,
175 uint32_t timeout_ms);
205 ove_socket_storage_t *client_storage,
206 uint32_t timeout_ms);
217int ove_socket_send(
ove_socket_t sock,
const void *data,
size_t len,
230int ove_socket_recv(
ove_socket_t sock,
void *buf,
size_t len,
231 size_t *received, uint32_t timeout_ms);
243int ove_socket_sendto(
ove_socket_t sock,
const void *data,
size_t len,
257int ove_socket_recvfrom(
ove_socket_t sock,
void *buf,
size_t len,
259 uint32_t timeout_ms);
292 uint32_t timeout_ms);
307 uint8_t c, uint8_t d, uint16_t port);
313#ifndef CONFIG_OVE_NET
314typedef struct { uint8_t _unused; } ove_socket_storage_t;
315typedef struct { uint8_t _unused; } ove_netif_storage_t;
319static inline void ove_netif_deinit(
ove_netif_t netif) { (void)netif; }
321static inline void ove_netif_down(
ove_netif_t netif) { (void)netif; }
324static inline void ove_socket_close(
ove_socket_t sock) { (void)sock; }
328static inline int ove_socket_accept(
ove_socket_t sock,
ove_socket_t *client, ove_socket_storage_t *client_storage, uint32_t timeout_ms) { (void)sock; (void)client; (void)client_storage; (void)timeout_ms;
return OVE_ERR_NOT_SUPPORTED; }
329static inline int ove_socket_send(
ove_socket_t sock,
const void *data,
size_t len,
size_t *sent) { (void)sock; (void)data; (void)len; (void)sent;
return OVE_ERR_NOT_SUPPORTED; }
330static inline int ove_socket_recv(
ove_socket_t sock,
void *buf,
size_t len,
size_t *received, uint32_t timeout_ms) { (void)sock; (void)buf; (void)len; (void)received; (void)timeout_ms;
return OVE_ERR_NOT_SUPPORTED; }
332static inline int ove_socket_recvfrom(
ove_socket_t sock,
void *buf,
size_t len,
size_t *received,
ove_sockaddr_t *src, uint32_t timeout_ms) { (void)sock; (void)buf; (void)len; (void)received; (void)src; (void)timeout_ms;
return OVE_ERR_NOT_SUPPORTED; }
333static inline int ove_dns_resolve(
const char *hostname,
ove_sockaddr_t *addr, uint32_t timeout_ms) { (void)hostname; (void)addr; (void)timeout_ms;
return OVE_ERR_NOT_SUPPORTED; }
334static inline void ove_sockaddr_ipv4(
ove_sockaddr_t *addr, uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint16_t port) { (void)addr; (void)a; (void)b; (void)c; (void)d; (void)port; }
ove_sock_type_t
Socket type.
Definition net.h:46
ove_af_t
Address family.
Definition net.h:52
@ OVE_SOCK_DGRAM
Definition net.h:48
@ OVE_SOCK_STREAM
Definition net.h:47
@ OVE_AF_INET
Definition net.h:53
@ OVE_AF_INET6
Definition net.h:54
#define OVE_ERR_NOT_SUPPORTED
The requested feature is not supported by the active backend.
Definition types.h:38
struct ove_netif * ove_netif_t
Opaque handle for a network interface.
Definition types.h:124
struct ove_socket * ove_socket_t
Opaque handle for a network socket.
Definition types.h:121
Network interface configuration.
Definition net.h:70
ove_sockaddr_t static_ip
Definition net.h:72
ove_sockaddr_t gateway
Definition net.h:73
ove_sockaddr_t dns
Definition net.h:75
int use_dhcp
Definition net.h:71
ove_sockaddr_t netmask
Definition net.h:74
Generic socket address (large enough for IPv4 or IPv6).
Definition net.h:61
ove_af_t family
Definition net.h:62
uint16_t port
Definition net.h:63