1 /* 2 * Copyright (c) 2014 Brian Swetland 3 * 4 * Use of this source code is governed by a MIT-style 5 * license that can be found in the LICENSE file or at 6 * https://opensource.org/licenses/MIT 7 */ 8 #pragma once 9 10 #include <sys/types.h> 11 #include <sys/socket.h> 12 #include <netinet/in.h> 13 #include <arpa/inet.h> 14 #include <netdb.h> 15 16 int udp_listen(in_addr_t addr, unsigned port, int shared); 17 int udp_connect(in_addr_t addr, unsigned port); 18 19 int tcp_listen(in_addr_t addr, unsigned port); 20 int tcp_connect(in_addr_t addr, unsigned port); 21 22 in_addr_t lookup_hostname(const char *hostname); 23