Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

poslib/rr.h

Go to the documentation of this file.

  
00001 /* 00002 Posadis - A DNS Server 00003 Resource Records 00004 Meilof Veeningen <> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef __POSLIB_RR_H 00022 #define __POSLIB_RR_H 00023 00024 #include "dnsmessage.h" 00025 00040 enum _rr_flags { 00041 R_NONE = 0, 00042 R_ASP = 1, 00044 R_COMPRESS = 2, 00046 R_ASPCOMPRESS = 3, 00048 }; 00049 00057 struct rr_type { 00064 char name[9]; 00065 00072 u_int16 type; 00073 00092 char properties[9]; 00093 00101 _rr_flags flags; 00102 }; 00103 00111 extern const int n_rr_types; 00112 00122 extern const rr_type rr_types[]; 00123 00124 /* low-level RR information */ 00125 00135 rr_type *rrtype_getinfo(u_int16 type); 00136 00145 rr_type *rrtype_getinfo(const char *name); 00146 00155 char *rrtype_getname(u_int16 type); 00156 00166 uint16_t qtype_getcode(const char *name); 00167 00179 bool answers_qtype(uint16_t rrtype, uint16_t qtype); 00180 00190 bool is_common_rr(uint16_t rrtype); 00191 00205 void rr_read(u_int16 RRTYPE, char*& RDATA, uint16_t &RDLEN, message_buff &buff, int ix, int len); 00206 00218 void rr_write(u_int16 RRTYPE, char *RDATA, uint16_t RDLEN, stl_string &dnsmessage, stl_slist(dom_compr_info) &comprinfo); 00219 00231 stl_string rr_tostring(u_int16 RRTYPE, const char *RDATA, int RDLENGTH); 00232 00251 stl_string rr_fromstring(u_int16 RRTYPE, const char *data, _domain origin = ""); 00252 00271 stl_string rr_fromstring(u_int16 RRTYPE, const char *data, domainname origin); 00272 00286 _domain rr_getbindomain(const char *RDATA, u_int16 RRTYPE, int ix = 0); 00287 00293 domainname rr_getdomain(const char *RDATA, u_int16 RRTYPE, int ix = 0); 00294 00300 char *rr_getbinmail(const char *RDATA, u_int16 RRTYPE, int ix = 0); 00301 00307 domainname rr_getmail(const char *RDATA, u_int16 RRTYPE, int ix = 0); 00308 00314 u_int16 rr_getshort(const char *RDATA, u_int16 RRTYPE, int ix = 0); 00315 00321 u_int32 rr_getlong(const char *RDATA, u_int16 RRTYPE, int ix = 0); 00322 00328 char *rr_getip4(const char *RDATA, u_int16 RRTYPE, int ix = 0); 00329 00335 char *rr_getip6(const char *RDATA, u_int16 RRTYPE, int ix = 0); 00336 00350 stl_string read_entry(char*& data); 00351 00380 void read_line(char *buff, FILE *f, int *linenum = NULL, int *linenum2 = NULL, 00381 int buffsz = 1024); 00382 00383 #endif /* __POSLIB_RR_H */ 00384

  
Generated on Fri Dec 24 19:55:14 2004 for Poslib by doxygen 1.3.7