oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
hal_net.h
1/*
2 * Copyright (C) 2026 Kamil Lulko <kamil.lulko@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 *
6 * This file is part of oveRTOS.
7 */
8
9#ifndef OVE_HAL_NET_H
10#define OVE_HAL_NET_H
11
21#include "ove/types.h"
22#include "ove_config.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#ifdef CONFIG_OVE_NET
29
31int ove_hal_socket_open(ove_socket_t sock, int af, int type);
32
35
37int ove_hal_socket_connect(ove_socket_t sock, const void *addr, uint64_t timeout_ns);
38
40int ove_hal_socket_bind(ove_socket_t sock, const void *addr);
41
43int ove_hal_socket_listen(ove_socket_t sock, int backlog);
44
46int ove_hal_socket_accept(ove_socket_t sock, ove_socket_t client, uint64_t timeout_ns);
47
49int ove_hal_socket_send(ove_socket_t sock, const void *data, size_t len, size_t *sent);
50
52int ove_hal_socket_recv(ove_socket_t sock, void *buf, size_t len, size_t *received,
53 uint64_t timeout_ns);
54
56int ove_hal_socket_sendto(ove_socket_t sock, const void *data, size_t len, size_t *sent,
57 const void *dest);
58
60int ove_hal_socket_recvfrom(ove_socket_t sock, void *buf, size_t len, size_t *received, void *src,
61 uint64_t timeout_ns);
62
64int ove_hal_dns_resolve(const char *hostname, void *addr, uint64_t timeout_ns);
65
68
71
73int ove_hal_netif_up(ove_netif_t netif, const void *cfg);
74
77
78#endif /* CONFIG_OVE_NET */
79
80#ifdef __cplusplus
81}
82#endif
83
86#endif /* OVE_HAL_NET_H */
int ove_hal_netif_up(ove_netif_t netif, const void *cfg)
Backend: bring the network interface up.
void ove_hal_netif_deinit(ove_netif_t netif)
Backend: de-initialise the network interface.
int ove_hal_socket_send(ove_socket_t sock, const void *data, size_t len, size_t *sent)
Backend: send data on a connected socket.
int ove_hal_socket_open(ove_socket_t sock, int af, int type)
Backend: open a socket (called by ove_socket_open).
int ove_hal_socket_accept(ove_socket_t sock, ove_socket_t client, uint64_t timeout_ns)
Backend: accept an incoming connection.
void ove_hal_socket_close(ove_socket_t sock)
Backend: close a socket.
int ove_hal_socket_recv(ove_socket_t sock, void *buf, size_t len, size_t *received, uint64_t timeout_ns)
Backend: receive data from a connected socket.
int ove_hal_socket_bind(ove_socket_t sock, const void *addr)
Backend: bind to a local address.
int ove_hal_netif_init(ove_netif_t netif)
Backend: initialise the network interface.
int ove_hal_socket_sendto(ove_socket_t sock, const void *data, size_t len, size_t *sent, const void *dest)
Backend: send a datagram to a destination.
int ove_hal_socket_listen(ove_socket_t sock, int backlog)
Backend: listen for incoming connections.
int ove_hal_socket_connect(ove_socket_t sock, const void *addr, uint64_t timeout_ns)
Backend: connect to a remote address.
int ove_hal_socket_recvfrom(ove_socket_t sock, void *buf, size_t len, size_t *received, void *src, uint64_t timeout_ns)
Backend: receive a datagram and sender address.
void ove_hal_netif_down(ove_netif_t netif)
Backend: tear down the network interface.
int ove_hal_dns_resolve(const char *hostname, void *addr, uint64_t timeout_ns)
Backend: resolve a hostname to an address.
struct ove_netif * ove_netif_t
Opaque handle for a network interface.
Definition types.h:250
struct ove_socket * ove_socket_t
Opaque handle for a network socket.
Definition types.h:247