// -*- mode: C++; tab-width: 8; -*- // vi:ts=8 sw=4 noexpandtab autoindent /** * netprotectaddr.h - Store an IPv4 or IPv6 protects table address and compare it with match strings. * Differs from NetIPAddr by: * - allows partial addresses (not enough IPv4 octets) * - allows prefix of "proxy-" and "*" * NB: The only wildcard handled here is a leading "*" (meaning either proxy or non-proxy); * all other wildcards (and non-leading "*"s) are handled by the pattern-matching text code, * which is currently in MapTable::Match(). * * Copyright 2012 Perforce Software. All rights reserved. * * This file is part of Perforce - the FAST SCM System. */ class NetProtectAddr { public: enum ProtAddrType { PROT_ADDR_V4, PROT_ADDR_V6, PROT_ADDR_TEXT, // text, maybe with wildcards PROT_ADDR_ANY // just plain "*" }; enum ProxyType { PROXY_NONE, PROXY_SET, PROXY_OPT }; NetProtectAddr(); NetProtectAddr(const StrPtr &addr); NetProtectAddr(const NetProtectAddr &rhs); const NetProtectAddr & operator=(const NetProtectAddr &rhs); bool operator==(const NetProtectAddr &rhs) const; bool operator!=(const NetProtectAddr &rhs) const; ~NetProtectAddr(); void Parse(); bool Match(const NetProtectAddr &rhs) const; bool Match(const StrPtr &addr) const; // debugging support static const char *ProxyName(ProxyType t); static const char *TypeName(ProtAddrType t); const char *ProxyName() const; const char *TypeName() const; void ToString(StrBuf &buf) const; private: ProxyType m_proxy; // prefixed by "proxy-"? StrBuf m_addr; // the text of the host address itself int m_prefixlen; // network prefix length ProtAddrType m_type; // IPv4, IPv6, or text (wildcard) NetIPAddr m_nipa; // binary representation of the host address };
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 18760 | rlranft |
Populate -o //guest/perforce_software/p4/... //guest/rlranft/p4/.... |
||
//guest/perforce_software/p4/2015-1/net/netprotectaddr.h | |||||
#1 | 15903 | Matt Attaway | Everything should be happy now between the Workshop and the depot paths | ||
//guest/perforce_software/p4/2015_1/net/netprotectaddr.h | |||||
#1 | 15901 | Matt Attaway | Clean up code to fit modern Workshop naming standards | ||
//guest/perforce_software/p4/2015.1/net/netprotectaddr.h | |||||
#1 | 12190 | Matt Attaway | Initial drop of 2015.1 p4/p4api source |