29 #ifndef AsyncComm_ProxyMap_h
30 #define AsyncComm_ProxyMap_h
57 typedef std::unordered_map<String, ProxyAddressInfo>
ProxyMapT;
99 const InetAddr &addr,ProxyMapT &invalidated_map,
199 ProxyMapT &invalidated_mappings);
226 #endif // AsyncComm_ProxyMap_h
std::string String
A String is simply a typedef to std::string.
bool get_mapping(const String &proxy, String &hostname, InetAddr &addr)
Returns proxy map data for proxy.
void get_map(ProxyMapT &map)
Returns the forward map (proxy name to ProxyAddressInfo)
CommBufPtr create_update_message()
Creates a proxy map update message.
String get_proxy(InetAddr &addr)
Returns proxy name for addr.
std::mutex m_mutex
Mutex for serializing concurrent access
Encapsulate an internet address.
std::shared_ptr< CommBuf > CommBufPtr
Smart pointer to CommBuf.
Holds address and hostname associated with a proxy name.
void invalidate_old_mapping(const String &proxy, const InetAddr &addr, ProxyMapT &invalidated_mappings)
Invalidates (removes) mapping, if changed, from forward and reverse maps.
std::unordered_map< String, ProxyAddressInfo > ProxyMapT
Forward mapping hash type from proxy name to ProxyAddressInfo.
SockAddrMap< String > m_reverse_map
Reverse map from IP address to proxy name.
Declarations for SockAddrMap.
void remove_mapping(const String &proxy, ProxyMapT &remove_map)
Removes a mapping.
void update_mappings(String &mappings, ProxyMapT &invalidated_map, ProxyMapT &new_map)
Update mappings from proxy map update message string.
void invalidate(const String &proxy, ProxyMapT &invalidated_mappings)
Invalidates (removes) mapping from forward and reverse maps.
Declarations for CommBuf.
ProxyAddressInfo(const String &h, InetAddr a)
Internet address wrapper classes and utility functions.
ProxyMapT m_forward_map
Forward map from proxy name to ProxyAddressInfo.
void update_mapping(const String &proxy, const String &hostname, const InetAddr &addr, ProxyMapT &invalidated_map, ProxyMapT &new_map)
Updates a proxy name mapping.
A String class based on std::string.
Maps a set of proxy names to their associated IP addresses.