00001 #ifndef __IPNETWORKINFORSP_H__ 00002 #define __IPNETWORKINFORSP_H__ 00003 00004 #include <map> 00005 #include <vector> 00006 #include <string> 00007 00008 #include "libepp_nicbr.H" 00009 00010 #include "Response.H" 00011 00012 using std::map; 00013 using std::vector; 00014 using std::string; 00015 00016 LIBEPP_NICBR_NS_BEGIN 00017 00019 class IpNetworkInfoRsp : public Response 00020 { 00021 public: 00023 class Network 00024 { 00025 public: 00027 Network() 00028 { 00029 this->reset(); 00030 } 00031 00033 00036 void set_ipRange(const IpRange &ipRange) 00037 { 00038 _ipRange = ipRange; 00039 } 00040 00042 00045 IpRange get_ipRange() const 00046 { 00047 return _ipRange; 00048 } 00049 00051 00054 void set_roid(const string &roid) 00055 { 00056 _roid = roid; 00057 } 00058 00060 00063 string get_roid() const 00064 { 00065 return _roid; 00066 } 00067 00068 void reset() 00069 { 00070 _ipRange.reset(); 00071 _roid = ""; 00072 } 00073 00074 private: 00076 IpRange _ipRange; 00077 00079 string _roid; 00080 }; 00081 00083 class IpRangeInfo 00084 { 00085 public: 00087 IpRangeInfo() 00088 { 00089 this->reset(); 00090 } 00091 00093 00096 void set_roid(const string &roid) 00097 { 00098 _roid = roid; 00099 } 00100 00102 00105 string get_roid() const 00106 { 00107 return _roid; 00108 } 00109 00111 00114 void set_allocType(const string &allocType) 00115 { 00116 _allocType = allocType; 00117 } 00118 00120 00123 string get_allocType() const 00124 { 00125 return _allocType; 00126 } 00127 00129 00132 void set_organization(const string &organization) 00133 { 00134 _organization = organization; 00135 } 00136 00138 00141 string get_organization() const 00142 { 00143 return _organization; 00144 } 00145 00147 00151 void insert_contact(const string &type, const string &identification) 00152 { 00153 _contacts[type] = identification; 00154 } 00155 00157 00160 map< string, string, less<string> > get_contacts() { return _contacts; } 00161 00163 00167 void set_asn(const int asn) 00168 { 00169 _asn = asn; 00170 } 00171 00173 00176 int get_asn() const 00177 { 00178 return _asn; 00179 } 00180 00182 00185 void insert_reverseDns(const ReverseDns &reverseDns) 00186 { 00187 _reversesDns.push_back(reverseDns); 00188 } 00189 00191 00194 vector<ReverseDns> get_reversesDns() const 00195 { 00196 return _reversesDns; 00197 } 00198 00200 00204 void set_parentNetwork(const Network &network) 00205 { 00206 _parentNetwork = network; 00207 } 00208 00210 00213 Network get_parentNetwork() const 00214 { 00215 return _parentNetwork; 00216 } 00217 00219 00223 void insert_childNetwork(const Network &network) 00224 { 00225 _childNetworks.push_back(network); 00226 } 00227 00229 00233 vector<Network> get_childNetworks() const 00234 { 00235 return _childNetworks; 00236 } 00237 00239 00243 void set_clId(const string &clId) 00244 { 00245 _clId = clId; 00246 } 00247 00249 00252 string get_clId() const 00253 { 00254 return _clId; 00255 } 00256 00258 00262 void set_crId(const string &crId) 00263 { 00264 _crId = crId; 00265 } 00266 00268 00271 string get_crId() const 00272 { 00273 return _crId; 00274 } 00275 00277 00280 void set_crDate(const string crDate) 00281 { 00282 _crDate = crDate; 00283 } 00284 00286 00289 string get_crDate() 00290 { 00291 return _crDate; 00292 } 00293 00295 00299 void set_exDate(const string &exDate) 00300 { 00301 _exDate = exDate; 00302 } 00303 00305 00309 string get_exDate() const 00310 { 00311 return _exDate; 00312 } 00313 00315 00319 void set_upId(const string &upId) 00320 { 00321 _upId = upId; 00322 } 00323 00325 00328 string get_upId() const 00329 { 00330 return _upId; 00331 } 00332 00334 00338 void set_upDate(const string &upDate) 00339 { 00340 _upDate = upDate; 00341 } 00342 00344 00347 string get_upDate() const 00348 { 00349 return _upDate; 00350 } 00351 00353 00356 void set_trDate(const string &trDate) 00357 { 00358 _trDate = trDate; 00359 } 00360 00362 00365 string get_trDate() const 00366 { 00367 return _trDate; 00368 } 00369 00370 void reset() 00371 { 00372 _roid = ""; 00373 _allocType = ""; 00374 _organization = ""; 00375 _contacts.clear(); 00376 _asn = 0; 00377 _reversesDns.clear(); 00378 _parentNetwork.reset(); 00379 _childNetworks.clear(); 00380 _clId = ""; 00381 _crId = ""; 00382 _crDate = ""; 00383 _exDate = ""; 00384 _upId = ""; 00385 _upDate = ""; 00386 _trDate = ""; 00387 } 00388 00389 private: 00391 string _roid; 00392 00394 string _allocType; 00395 00397 string _organization; 00398 00400 map< string, string, less<string> > _contacts; 00401 00403 int _asn; 00404 00406 vector<ReverseDns> _reversesDns; 00407 00409 Network _parentNetwork; 00410 00413 vector<Network> _childNetworks; 00414 00416 string _clId; 00417 00419 string _crId; 00420 00422 string _crDate; 00423 00426 string _exDate; 00427 00429 string _upId; 00430 00432 string _upDate; 00433 00435 string _trDate; 00436 }; 00437 00439 IpNetworkInfoRsp(bool reset = false) : Response(false) 00440 { 00441 if (reset) { 00442 this->reset(); 00443 } 00444 } 00445 00447 00450 void set_ipRange(const IpRange &ipRange) 00451 { 00452 _ipRange = ipRange; 00453 } 00454 00456 00459 IpRange get_ipRange() const 00460 { 00461 return _ipRange; 00462 } 00463 00465 00468 void insert_ipRangeInfo(const IpRangeInfo &ipRangeInfo) 00469 { 00470 _ipRangeInfo.push_back(ipRangeInfo); 00471 } 00472 00474 00477 vector<IpRangeInfo> get_ipRangeInfo() const 00478 { 00479 return _ipRangeInfo; 00480 } 00481 00482 void reset() 00483 { 00484 Response::reset(); 00485 _ipRange.reset(); 00486 _ipRangeInfo.clear(); 00487 } 00488 00489 protected: 00491 IpRange _ipRange; 00492 00494 vector<IpRangeInfo> _ipRangeInfo; 00495 }; 00496 00497 LIBEPP_NICBR_NS_END 00498 #endif // __IPNETWORKINFORSP_H__