- Timestamp:
- Sep 16, 2013 6:56:38 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 88966
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/DHCP/Config.h
r48465 r48483 119 119 class ANDClientMatchCriteria: ClientMatchCriteria 120 120 { 121 public: 122 ANDClientMatchCriteria(ClientMatchCriteria *left, ClientMatchCriteria *right) 123 { 124 m_left = left; 125 m_right = right; 126 } 127 128 virtual bool check(const Client& client) const 129 { 130 return (m_left->check(client) && m_right->check(client)); 131 } 132 private: 121 133 ClientMatchCriteria* m_left; 122 134 ClientMatchCriteria* m_right; 123 ANDClientMatchCriteria(ClientMatchCriteria *left, ClientMatchCriteria *right) 124 { 125 m_left = left; 126 m_right = right; 127 } 128 135 136 }; 137 138 139 class AnyClientMatchCriteria: public ClientMatchCriteria 140 { 141 public: 129 142 virtual bool check(const Client& client) const 130 143 { 131 return (m_left->check(client) && m_right->check(client)); 132 } 133 }; 134 135 136 class AnyClientMatchCriteria: public ClientMatchCriteria 137 { 144 return true; 145 } 146 }; 147 148 149 class MACClientMatchCriteria: public ClientMatchCriteria 150 { 151 public: 152 MACClientMatchCriteria(const RTMAC& mac):m_mac(mac){} 153 138 154 virtual bool check(const Client& client) const 139 155 { 140 return true;141 }142 };143 144 145 class MACClientMatchCriteria: public ClientMatchCriteria146 {147 148 public:149 MACClientMatchCriteria(const RTMAC& mac):m_mac(mac){}150 151 virtual bool check(const Client& client) const152 {153 156 return (client == m_mac); 154 157 } 155 158 private: 156 159 RTMAC m_mac; 157 160 }; … … 198 201 virtual int match(Client& client, BaseConfigEntity **cfg); 199 202 virtual uint32_t expirationPeriod() const = 0; 200 protected: 203 204 protected: 201 205 const ClientMatchCriteria *m_criteria; 202 206 int m_MatchLevel; … … 220 224 class ConfigEntity: public BaseConfigEntity 221 225 { 222 public: 223 226 public: 224 227 /* range */ 225 228 /* match conditions */ … … 236 239 } 237 240 238 std::string m_name;239 const BaseConfigEntity *m_parentCfg;240 241 virtual uint32_t expirationPeriod() const 241 242 { … … 247 248 248 249 /* XXX: private:*/ 250 std::string m_name; 251 const BaseConfigEntity *m_parentCfg; 249 252 uint32_t m_u32ExpirationPeriod; 250 253 }; … … 256 259 class NetworkConfigEntity:public ConfigEntity 257 260 { 258 261 public: 259 262 /* Address Pool matching with network declaration */ 260 263 NetworkConfigEntity(std::string name, … … 306 309 class HostConfigEntity: public NetworkConfigEntity 307 310 { 308 309 public: 311 public: 310 312 HostConfigEntity(const RTNETADDRIPV4& addr, 311 313 std::string name, … … 328 330 class RootConfigEntity: public NetworkConfigEntity 329 331 { 330 332 public: 331 333 RootConfigEntity(std::string name, uint32_t expirationPeriod); 332 334 virtual ~RootConfigEntity(){}; … … 343 345 class SharedNetworkConfigEntity: public NetworkEntity 344 346 { 345 347 public: 346 348 SharedNetworkConfigEntity(){} 347 349 int match(const Client& client) const { return m_criteria.match(client)? 3 : 0;} … … 354 356 355 357 std::vector<NetworkConfigEntity> Networks; 356 357 358 }; 358 359 #endif … … 360 361 class ConfigurationManager 361 362 { 362 363 public: 363 364 static ConfigurationManager* getConfigurationManager(); 364 365 static int extractRequestList(PCRTNETBOOTP pDhcpMsg, size_t cbDhcpMsg, RawOption& rawOpt); … … 430 431 class NetworkManager 431 432 { 432 433 public: 433 434 static NetworkManager *getNetworkManager(); 434 435 … … 450 451 PINTNETBUF m_pIfBuf; 451 452 452 private: 453 private: 454 NetworkManager(){} 455 virtual ~NetworkManager(){} 456 453 457 int prepareReplyPacket4Client(Client *client, uint32_t u32Xid); 454 458 int doReply(Client *client); … … 464 468 RTNETADDRIPV4 m_OurNetmask; 465 469 RTMAC m_OurMac; 466 467 NetworkManager(){}468 virtual ~NetworkManager(){}469 470 }; 470 471
Note:
See TracChangeset
for help on using the changeset viewer.