Parent Directory
|
Revision Log
|
Revision Graph
* just a dir
1 /************************************** 2 * AUTHOR: Federico Tomassini * 3 * Copyright (C) Federico Tomassini * 4 * Contact effetom@gmail.com * 5 *********************************************** 6 ******* BEGIN 3/2006 ******** 7 ************************************************************************* 8 * * 9 * This program is free software; you can redistribute it and/or modify * 10 * it under the terms of the GNU General Public License as published by * 11 * the Free Software Foundation; either version 2 of the License, or * 12 * (at your option) any later version. * 13 * * 14 * This program is distributed in the hope that it will be useful, * 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 17 * GNU General Public License for more details. * 18 * * 19 ************************************************************************/ 20 #ifndef ANDNS_H 21 #define ANDNS_H 22 23 #include <stdio.h> 24 #include <sys/socket.h> 25 #include <netdb.h> 26 #include "dnslib.h" 27 #include "andns/andns_lib.h" 28 #include "inet.h" 29 30 #define ANDNS_TIMEOUT 15 31 32 #define MAXNSSERVERS 3 33 #define DNS_REPLY_TIMEOUT 10 /* seconds */ 34 35 #define DNS_PORT 53 36 #define DNS_PORT_STR "53" 37 38 /* PREFIX TO QUERY THE INET REALM */ 39 #define INET_REALM_PREFIX ".INT" 40 #define NTK_REALM_PREFIX ".NTK" 41 #define PTR_INET_REALM_PREFIX "INT." 42 #define PTR_NTK_REALM_PREFIX "NTK." 43 #define REALM_PREFIX_LEN 4 44 45 #define DNS_PROTO 0 46 #define ANDNS_PROTO 1 47 48 #define NK_DNS 0 49 #define NK_NTK 1 50 #define NK_INET 2 51 #define GET_NK_BIT(msg) (*((msg+3))>>4)&0x03 52 53 #define RCODE_NOERR 0 54 #define RCODE_EINTRPRT 1 55 #define RCODE_ESRVFAIL 2 56 #define RCODE_ENSDMN 3 57 #define RCODE_ENIMPL 4 58 #define RCODE_ERFSD 5 59 60 61 62 /* FUNCTIONS */ 63 64 int store_ns(char *ns); 65 int collect_resolv_conf(char *resolve_conf); 66 void reset_andns_ns(void); 67 int andns_init(int restricted, char *resolv_conf,int family); 68 void andns_close(void); 69 int ns_general_send(char *msg,int msglen,char *answer,int anslen); 70 void dpktacpy(dns_pkt *dst,dns_pkt *src,const char *prefix); 71 dns_pkt* dpktcpy(dns_pkt *src,const char *prefix); 72 char* rm_realm_prefix(char *from,char *dst,int type); 73 dns_pkt* dpktcpy_rm_pref(dns_pkt *src); 74 int andns_gethostbyname(char *hname, inet_prefix *ip); 75 int andns_realm(dns_pkt_qst *dpq,int *prefixed); 76 int is_prefixed(dns_pkt *dp); 77 int dns_forward(dns_pkt *dp,char *msg,int msglen,char* answer); 78 int inet_rslv(dns_pkt *dp,char *msg,int msglen,char *answer); 79 int nk_rslv(andns_pkt *ap,char *msg,int msglen,char *answer); 80 int qtype_a_to_d(andns_pkt *ap); 81 int apqsttodpqst(andns_pkt *ap,dns_pkt **dpsrc); 82 int dpanswtoapansw(dns_pkt *dp,andns_pkt *ap); 83 int nk_forward(andns_pkt *ap,char *msg,int msglen,char *answer); 84 char *andns_rslv(char *msg, int msglen,char *answer, int *answ_len); 85 86 #endif /* ANDNS_H */
| alpt (at) freaknet (dot) org | ViewVC Help |
| Powered by ViewVC 1.1-dev |