libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
net.h
Go to the documentation of this file.
1
9#ifndef LIBCLOD_NET_H
10#define LIBCLOD_NET_H
11
12#include <clod/lib.h>
13#include <clod/stream.h>
14
15typedef struct clod_socker clod_socket;
16
18#define clod_ipv4(a, b, c, d) ((char[16]){0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, a, b, c, d})
19
37 clod_stream stream;
39 unsigned char local_addr[16];
41 unsigned short local_port;
43 unsigned char remote_addr[16];
45 unsigned short remote_port;
46};
47
54CLOD_API CLOD_NONNULL(1)
55int clod_udp(clod_socket *socket, int flags);
56
64CLOD_API CLOD_NONNULL(1)
65int clod_tcp_client(clod_socket *socket, int flags);
66
73CLOD_API CLOD_NONNULL(1)
74int clod_tcp_server(clod_socket *socket, int flags);
75
76#endif
int clod_tcp_server(clod_socket *socket, int flags)
int clod_tcp_client(clod_socket *socket, int flags)
int clod_udp(clod_socket *socket, int flags)
unsigned char remote_addr[16]
Remote IP address.
Definition net.h:43
unsigned short remote_port
Remote port number.
Definition net.h:45
unsigned short local_port
Local port number.
Definition net.h:41
unsigned char local_addr[16]
Local IP address.
Definition net.h:39