00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00031
00032 #pragma once
00033
00034 #include "../api_network.h"
00035 #include "../../Core/System/sharedptr.h"
00036
00037 class CL_DataBuffer;
00038 class CL_DNSPacket;
00039 class CL_DNSResourceRecord_Impl;
00040
00044 class CL_API_NETWORK CL_DNSResourceRecord
00045 {
00048
00049 public:
00050 CL_DNSResourceRecord();
00051
00055 CL_DNSResourceRecord(const CL_DNSResourceRecord &other);
00056
00057 ~CL_DNSResourceRecord();
00058
00062
00063 public:
00064
00068 CL_String get_name() const;
00069
00073 CL_String get_type() const;
00074
00078 CL_String get_class() const;
00079
00083 int get_ttl() const;
00084
00085 const CL_DNSPacket &get_packet() const;
00086
00090 int get_record_offset() const;
00091
00095 int get_rdata_offset() const;
00096
00100 int get_rdata_length() const;
00101
00105 CL_String get_cname_cname() const;
00106
00110 int get_mx_preference() const;
00111
00115 CL_String get_mx_exchange() const;
00116
00120 CL_String get_ns_nsdname() const;
00121
00125 CL_String get_ptr_ptrdname() const;
00126
00130 CL_String get_soa_mname() const;
00131
00135 CL_String get_soa_rname() const;
00136
00137 unsigned int get_soa_serial() const;
00138
00142 int get_soa_refresh() const;
00143
00147 int get_soa_retry() const;
00148
00152 int get_soa_expire() const;
00153
00154 unsigned int get_soa_minimum() const;
00155
00156 unsigned int get_a_address() const;
00157
00161 CL_String get_a_address_str() const;
00162
00163 unsigned int get_wks_address() const;
00164
00168 CL_String get_wks_address_str() const;
00169
00170 unsigned char get_wks_protocol() const;
00171
00175 CL_DataBuffer get_wks_bit_map() const;
00176
00180
00181 public:
00182 CL_DNSResourceRecord &operator =(const CL_DNSResourceRecord &other);
00183
00188 void set_record(CL_DNSPacket packet, int record_offset);
00189
00195 static int type_to_int(const CL_String &qtype);
00196
00202 static CL_String type_from_int(int qtype);
00203
00209 static CL_String type_description(const CL_String &qtype);
00210
00216 static CL_String type_description(int qtype);
00217
00223 static int class_to_int(const CL_String &qclass);
00224
00230 static CL_String class_from_int(int qclass);
00231
00237 static CL_String class_description(const CL_String &qclass);
00238
00244 static CL_String class_description(int qclass);
00245
00252 static int find_domain_name_end(const CL_DataBuffer &packet, int offset);
00253
00260 static CL_String read_domain_name(const CL_DataBuffer &packet, int offset);
00261
00265
00266 private:
00267 CL_SharedPtr<CL_DNSResourceRecord_Impl> impl;
00269 };
00270