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() const 00161 { 00162 return _contacts; 00163 } 00164 00166 00170 void set_asn(const int asn) 00171 { 00172 _asn = asn; 00173 } 00174 00176 00179 int get_asn() const 00180 { 00181 return _asn; 00182 } 00183 00185 00188 void insert_reverseDns(const ReverseDns &reverseDns) 00189 { 00190 _reversesDns.push_back(reverseDns); 00191 } 00192 00194 00197 vector<ReverseDns> get_reversesDns() const 00198 { 00199 return _reversesDns; 00200 } 00201 00203 00207 void set_parentNetwork(const Network &network) 00208 { 00209 _parentNetwork = network; 00210 } 00211 00213 00216 Network get_parentNetwork() const 00217 { 00218 return _parentNetwork; 00219 } 00220 00222 00226 void insert_childNetwork(const Network &network) 00227 { 00228 _childNetworks.push_back(network); 00229 } 00230 00232 00236 vector<Network> get_childNetworks() const 00237 { 00238 return _childNetworks; 00239 } 00240 00242 00246 void set_clId(const string& clId) 00247 { 00248 _clId = clId; 00249 } 00250 00252 00255 string get_clId() const 00256 { 00257 return _clId; 00258 } 00259 00261 00265 void set_crId(const string& crId) 00266 { 00267 _crId = crId; 00268 } 00269 00271 00274 string get_crId() const 00275 { 00276 return _crId; 00277 } 00278 00280 00283 void set_crDate(const string& crDate) 00284 { 00285 _crDate = crDate; 00286 } 00287 00289 00292 string get_crDate() const 00293 { 00294 return _crDate; 00295 } 00296 00298 00302 void set_exDate(const string &exDate) 00303 { 00304 _exDate = exDate; 00305 } 00306 00308 00312 string get_exDate() const 00313 { 00314 return _exDate; 00315 } 00316 00318 00322 void set_upId(const string &upId) 00323 { 00324 _upId = upId; 00325 } 00326 00328 00331 string get_upId() const 00332 { 00333 return _upId; 00334 } 00335 00337 00341 void set_upDate(const string &upDate) 00342 { 00343 _upDate = upDate; 00344 } 00345 00347 00350 string get_upDate() const 00351 { 00352 return _upDate; 00353 } 00354 00356 00359 void set_trDate(const string &trDate) 00360 { 00361 _trDate = trDate; 00362 } 00363 00365 00368 string get_trDate() const 00369 { 00370 return _trDate; 00371 } 00372 00373 void reset() 00374 { 00375 _roid = ""; 00376 _allocType = ""; 00377 _organization = ""; 00378 _contacts.clear(); 00379 _asn = 0; 00380 _reversesDns.clear(); 00381 _parentNetwork.reset(); 00382 _childNetworks.clear(); 00383 _clId = ""; 00384 _crId = ""; 00385 _crDate = ""; 00386 _exDate = ""; 00387 _upId = ""; 00388 _upDate = ""; 00389 _trDate = ""; 00390 } 00391 00392 private: 00394 string _roid; 00395 00397 string _allocType; 00398 00400 string _organization; 00401 00403 map< string, string, less<string> > _contacts; 00404 00406 int _asn; 00407 00409 vector<ReverseDns> _reversesDns; 00410 00412 Network _parentNetwork; 00413 00416 vector<Network> _childNetworks; 00417 00419 string _clId; 00420 00422 string _crId; 00423 00425 string _crDate; 00426 00429 string _exDate; 00430 00432 string _upId; 00433 00435 string _upDate; 00436 00438 string _trDate; 00439 }; 00440 00442 IpNetworkInfoRsp(bool reset = false) : Response(false) 00443 { 00444 if (reset) { 00445 this->reset(); 00446 } 00447 } 00448 00450 00453 void set_ipRange(const IpRange &ipRange) 00454 { 00455 _ipRange = ipRange; 00456 } 00457 00459 00462 IpRange get_ipRange() const 00463 { 00464 return _ipRange; 00465 } 00466 00468 00471 void insert_ipRangeInfo(const IpRangeInfo &ipRangeInfo) 00472 { 00473 _ipRangeInfo.push_back(ipRangeInfo); 00474 } 00475 00477 00480 vector<IpRangeInfo> get_ipRangeInfo() const 00481 { 00482 return _ipRangeInfo; 00483 } 00484 00485 void reset() 00486 { 00487 Response::reset(); 00488 _ipRange.reset(); 00489 _ipRangeInfo.clear(); 00490 } 00491 00492 protected: 00494 IpRange _ipRange; 00495 00497 vector<IpRangeInfo> _ipRangeInfo; 00498 }; 00499 00500 LIBEPP_NICBR_NS_END 00501 #endif // __IPNETWORKINFORSP_H__