Provides network functionality.
More...
|
| void | ouster_net_addr_set_ip4 (ouster_net_addr_t *addr, char const *ip) |
| | Set a IPv4 address. More...
|
| |
| void | ouster_net_addr_set_port (ouster_net_addr_t *addr, int port) |
| | Set a port. More...
|
| |
| int | ouster_net_sendto (int sock, char *buf, int size, int flags, ouster_net_addr_t *addr) |
| | Send data from a socket to a network address. More...
|
| |
|
int | ouster_net_create (ouster_net_sock_desc_t *desc) |
| |
|
int64_t | ouster_net_read (int sock, char *buf, int len) |
| |
|
uint64_t | ouster_net_select (int socks[], int n, const int timeout_sec, const int timeout_usec) |
| |
|
int32_t | ouster_net_get_port (int sock) |
| |
Provides network functionality.
◆ OUSTER_NET_ADDRSTRLEN
| #define OUSTER_NET_ADDRSTRLEN 46 |
◆ OUSTER_NET_FLAGS_BIND
| #define OUSTER_NET_FLAGS_BIND 0x0100 |
◆ OUSTER_NET_FLAGS_CONNECT
| #define OUSTER_NET_FLAGS_CONNECT 0x0200 |
◆ OUSTER_NET_FLAGS_IPV4
| #define OUSTER_NET_FLAGS_IPV4 0x0008 |
◆ OUSTER_NET_FLAGS_IPV6
| #define OUSTER_NET_FLAGS_IPV6 0x0010 |
◆ OUSTER_NET_FLAGS_IPV6ONLY
| #define OUSTER_NET_FLAGS_IPV6ONLY 0x0004 |
◆ OUSTER_NET_FLAGS_NONBLOCK
| #define OUSTER_NET_FLAGS_NONBLOCK 0x0001 |
◆ OUSTER_NET_FLAGS_REUSE
| #define OUSTER_NET_FLAGS_REUSE 0x0002 |
◆ OUSTER_NET_FLAGS_TCP
| #define OUSTER_NET_FLAGS_TCP 0x0040 |
◆ OUSTER_NET_FLAGS_UDP
| #define OUSTER_NET_FLAGS_UDP 0x0020 |
◆ OUSTER_NET_UDP_MAX_SIZE
| #define OUSTER_NET_UDP_MAX_SIZE 65535 |
◆ ouster_net_addr_set_ip4()
Set a IPv4 address.
- Parameters
-
| addr | The address |
| ip | The IPv4 address |
◆ ouster_net_addr_set_port()
Set a port.
- Parameters
-
| addr | The address |
| ip | The port |
◆ ouster_net_sendto()
| int ouster_net_sendto |
( |
int |
sock, |
|
|
char * |
buf, |
|
|
int |
size, |
|
|
int |
flags, |
|
|
ouster_net_addr_t * |
addr |
|
) |
| |
Send data from a socket to a network address.
- Parameters
-
| sock | The source socket filedescriptor |
| buf | Data to send |
| size | Data size to send |
| flags | |
| addr | Destinationnetwork address |
- Returns
- Returns the number sent, or -1 for errors.