The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
dns_wrapper.h
Go to the documentation of this file.
1 /* This file is part of Netsukuku
2  * (c) Copyright 2005 Andrea Lo Pumo aka AlpT <alpt@freaknet.org>
3  *
4  * This source code is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  *
9  * This source code is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  * Please refer to the GNU Public License for more details.
13  *
14  * You should have received a copy of the GNU Public License along with
15  * this source code; if not, write to:
16  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 
19 #ifndef DNS_WRAPPER_H
20 #define DNS_WRAPPER_H
21 
22 #define DNS_WRAPPER_PORT 53
23 #define MAX_DNS_PKT_SZ 512
24 #define MIN_PKT_SZ 7
25 
26 /* DNS wrapper resolver api */
27 void resolver_process(const char *question, unsigned question_length,
28  char *answer, unsigned *answer_length,
29  int (*callback)(const char *name, uint32_t *ip));
30 
31 /*
32  * dns_exec_pkt_argv is the struct passed to dns_exec_pkt() as argument
33  */
35 {
36  char *rpkt; /* Received dns query pkt */
37  ssize_t rpkt_sz;
38 
39  int sk;
40  struct sockaddr from;
42 };
43 
44 pthread_mutex_t dns_exec_lock;
45 
46 /* * * Functions declarations * * */
47 
48 void *dns_wrapper_thread(void *null);
49 
50 #endif /*DNS_WRAPPER_H*/
int sk
Definition: dns_wrapper.h:39
char * rpkt
Definition: dns_wrapper.h:36
void * dns_wrapper_thread(void *null)
Definition: dns_wrapper.c:170
Definition: dns_wrapper.h:34
struct sockaddr from
Definition: dns_wrapper.h:40
void resolver_process(const char *question, unsigned question_length, char *answer, unsigned *answer_length, int(*callback)(const char *name, uint32_t *ip))
pthread_mutex_t dns_exec_lock
Definition: dns_wrapper.h:44
unsigned int socklen_t
Definition: libip4tc.c:26
socklen_t from_len
Definition: dns_wrapper.h:41
ssize_t rpkt_sz
Definition: dns_wrapper.h:37