#ifndef OCT_NETWORKING_H #define OCT_NETWORKING_H #include #include #include #define BUFFER_SIZE 1024 #define NUM_BUFFERS 10; #define OCT_DEFAULT_PORT "20000" struct oct_network_ab_entry { int sfd; char addr[NI_MAXHOST]; char port[NI_MAXSERV]; struct oct_network_ab_entry* next; }; int oct_network_node_init(char* port, lua_State* L); int oct_network_node_deinit(); // These are heavily based off of man 3 getaddrinfo, e.g. at // https://www.man7.org/linux/man-pages/man3/getaddrinfo.3.html int oct_network_recv_msg(); int oct_network_send_msg(); int oct_network_recv_msg_lua(lua_State* L); int oct_network_send_msg_lua(lua_State* L); void oct_network_ab_init(); int oct_network_ab_insert(char* addr, char* port); int oct_network_ab_remove(struct oct_network_ab_entry* e); int oct_network_ab_deinit(); #endif