1 /** 2 * This program is free software; you can redistribute it and/or modify 3 * it under the terms of the GNU General Public License as published by 4 * the Free Software Foundation; either version 2 of the License, or 5 * (at your option) any later version. 6 * 7 * net/types.h 8 * (c) 2007-2008 Murat Deligonul 9 */ 10 11 #ifndef __NET_TYPES_H 12 # define __NET_TYPES_H 13 14 #include <utility> 15 #include <string> 16 #include <netinet/in.h> 17 18 namespace net { 19 20 #ifdef HAVE_GETADDRINFO 21 # ifdef INET6_ADDRSTRLEN 22 # define _MAX_ADDRLEN (INET6_ADDRSTRLEN+1) 23 # else 24 # define _MAX_ADDRLEN (47) 25 # endif 26 #else 27 # define _MAX_ADDRLEN (16) 28 #endif 29 30 const size_t MAX_ADDRSTRLEN = _MAX_ADDRLEN; 31 32 typedef std::pair<std::string, unsigned short> ap_pair; 33 34 #undef _MAX_ADDRLEN 35 } 36 #endif 37