Go to the documentation of this file.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
00052 ~CL_DNSResourceRecord();
00053
00057
00058 public:
00059
00063 CL_String get_name() const;
00064
00068 CL_String get_type() const;
00069
00073 CL_String get_class() const;
00074
00078 int get_ttl() const;
00079
00080 const CL_DNSPacket &get_packet() const;
00081
00085 int get_record_offset() const;
00086
00090 int get_rdata_offset() const;
00091
00095 int get_rdata_length() const;
00096
00100 CL_String get_cname_cname() const;
00101
00105 int get_mx_preference() const;
00106
00110 CL_String get_mx_exchange() const;
00111
00115 CL_String get_ns_nsdname() const;
00116
00120 CL_String get_ptr_ptrdname() const;
00121
00125 CL_String get_soa_mname() const;
00126
00130 CL_String get_soa_rname() const;
00131
00132 unsigned int get_soa_serial() const;
00133
00137 int get_soa_refresh() const;
00138
00142 int get_soa_retry() const;
00143
00147 int get_soa_expire() const;
00148
00149 unsigned int get_soa_minimum() const;
00150
00151 unsigned int get_a_address() const;
00152
00156 CL_String get_a_address_str() const;
00157
00158 unsigned int get_wks_address() const;
00159
00163 CL_String get_wks_address_str() const;
00164
00165 unsigned char get_wks_protocol() const;
00166
00170 CL_DataBuffer get_wks_bit_map() const;
00171
00175
00176 public:
00177
00182 void set_record(CL_DNSPacket packet, int record_offset);
00183
00189 static int type_to_int(const CL_String &qtype);
00190
00196 static CL_String type_from_int(int qtype);
00197
00203 static CL_String type_description(const CL_String &qtype);
00204
00210 static CL_String type_description(int qtype);
00211
00217 static int class_to_int(const CL_String &qclass);
00218
00224 static CL_String class_from_int(int qclass);
00225
00231 static CL_String class_description(const CL_String &qclass);
00232
00238 static CL_String class_description(int qclass);
00239
00246 static int find_domain_name_end(const CL_DataBuffer &packet, int offset);
00247
00254 static CL_String read_domain_name(const CL_DataBuffer &packet, int offset);
00255
00259
00260 private:
00261 CL_SharedPtr<CL_DNSResourceRecord_Impl> impl;
00263 };
00264