2022-01-08 19:53:58 +01:00
|
|
|
#ifndef _NET_H
|
|
|
|
#define _NET_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include "error.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initializes the net class
|
|
|
|
*/
|
|
|
|
enum error net_init();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Send and read data to and from the api
|
2023-08-09 17:26:53 +02:00
|
|
|
* Returns the number of bytes sent/read or
|
|
|
|
* a negative value which is the errno */
|
2022-01-08 19:53:58 +01:00
|
|
|
ssize_t net_send(const void *msg, size_t msg_len);
|
|
|
|
ssize_t net_read(void *out_data, size_t read_size);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Frees the net class
|
|
|
|
*/
|
|
|
|
void net_free();
|
|
|
|
|
|
|
|
#endif /* _NET_H */
|