File diff r23538:8df50944b27a → r23539:bce8329ee42d
src/network/core/address.h
Show inline comments
 
@@ -10,25 +10,25 @@
 
/** @file core/address.h Wrapper for network addresses. */
 

	
 
#ifndef NETWORK_CORE_ADDRESS_H
 
#define NETWORK_CORE_ADDRESS_H
 

	
 
#include "os_abstraction.h"
 
#include "config.h"
 
#include "../../string_func.h"
 
#include "../../core/smallmap_type.hpp"
 

	
 
class NetworkAddress;
 
typedef std::vector<NetworkAddress> NetworkAddressList; ///< Type for a list of addresses.
 
typedef SmallMap<NetworkAddress, SOCKET, 4> SocketList;    ///< Type for a mapping between address and socket.
 
typedef SmallMap<NetworkAddress, SOCKET> SocketList;    ///< Type for a mapping between address and socket.
 

	
 
/**
 
 * Wrapper for (un)resolved network addresses; there's no reason to transform
 
 * a numeric IP to a string and then back again to pass it to functions. It
 
 * furthermore allows easier delaying of the hostname lookup.
 
 */
 
class NetworkAddress {
 
private:
 
	char hostname[NETWORK_HOSTNAME_LENGTH]; ///< The hostname
 
	int address_length;                     ///< The length of the resolved address
 
	sockaddr_storage address;               ///< The resolved address
 
	bool resolved;                          ///< Whether the address has been (tried to be) resolved