00001  00002  00003  00004  00005  00006  00007  00008  00009  00010  00011  00012  00013  00014  00015  00016  00017  00018  00019  00020 00021 
#ifndef __POSLIB_LEXFN_H 00022 
#define __POSLIB_LEXFN_H 00023 
 00030 
#include "types.h" 00031 
#include "socket.h" 00032 
#include "sysstl.h" 00033 
#include "dnsdefs.h" 00034 00044 
bool txt_to_bool(
const char *buff); 00045 00055 
int txt_to_negint(
const char *buff); 00056 00066 
int txt_to_int(
const char *buff); 00067 00079 
int txt_to_ip(
char ip[4], 
const char *buff, 
bool do_portion = 
false); 00080 
00086 #define sz_iprange 8 00087 
 00095 
void txt_to_iprange(
char *iprange, 
const char *val); 00096 00106 
bool iprange_matches(
char *iprange, 
char *ip); 00107 00120 
int txt_to_ipv6(
char ipv6[16], 
const char *buff, 
bool do_portion = 
false); 00121 00122 
00128 #define sz_ip6range 32 00129 
 00137 
void txt_to_ip6range(
char *iprange, 
const char *val); 00138 00148 
bool ip6range_matches(
char *iprange, 
char *ip); 00149 
00155 #define sz_addrrange 33 00156 
 00164 
void txt_to_addrrange(
char *iprange, 
const char *val); 00165 00175 
bool addrrange_matches(
char *iprange, 
_addr *a); 00176 
00180 class addrrange { 
public: 
char range[
sz_addrrange]; }; 00181 00191 
bool in_addrrange_list(
stl_list(
addrrange) &lst, _addr *a); 00192 00193 
#ifdef HAVE_SLIST 00194 
 00203 
bool in_addrrange_list(
stl_slist(
addrrange) &lst, _addr *a); 00204 
#endif 00205 
 00216 
bool in_addr_list(
stl_list(_addr) &lst, _addr *a, 
bool match_port = 
false); 00217 00218 
#ifdef HAVE_SLIST 00219 
 00229 
bool in_addr_list(
stl_slist(_addr) &lst, _addr *a, 
bool match_port = 
false); 00230 
#endif 00231 
 00240 
void txt_to_email(
char *target, 
const char *src, 
const _domain origin = NULL); 00241 00250 
void txt_to_dname(
char *target, 
const char *src, 
const _domain origin = NULL); 00251 00266 
void txt_to_addr(_addr *ret, 
const char *addr, 
int default_port = DNS_PORT, 
bool is_client = 
true); 00267 00277 
void txt_to_loc(
char *res, 
char *&src); 00278 00279 stl_string 
str_type(
u_int16 type); 00280 stl_string 
str_qtype(u_int16 qtype); 00281 stl_string 
str_class(u_int16 ctype); 00282 stl_string 
str_qclass(u_int16 qctype); 00283 stl_string 
str_opcode(u_int16 opcode); 00284 stl_string 
str_rcode(
int rcode); 00285 stl_string 
str_ttl(uint32_t ttl); 00286 stl_string 
str_loc(
char *rr); 00288 
#endif