vde_autolink: Add missing null entry in getopt_long array.
[vde.git] / vde-2 / src / vde_over_ns / dns.h
blob998f65daf708baa5e8ab14db901a224c7a4500d5
1 /* ----------------------------------------------------------------------------
3 VDE_OVER_NS
4 (C) 2007 Daniele Lacamera
6 Derived from:
7 NSTX -- tunneling network-packets over DNS
9 (C) 2000 by Florian Heinz and Julien Oster
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License version 2, as
13 published by the Free Software Foundation.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 -------------------------------------------------------------------------- */
25 #ifndef _NSTXDNS_H
26 #define _NSTXDNS_H
28 #define DNS_QUERY 0x01
29 #define DNS_RESPONSE 0x02
31 #define DNS_MAXPKT 512
33 struct rr
35 char *data;
36 int len;
37 int link;
39 struct rr *next;
42 struct dnspkt
44 unsigned short id;
45 int type;
46 struct rr *query;
47 struct rr *answer;
50 void dns_setsuffix (char *);
52 struct dnspkt *dns_alloc (void);
53 void dns_free (struct dnspkt *);
55 void dns_setid (struct dnspkt *, unsigned short);
56 void dns_settype (struct dnspkt *, int);
57 int dns_addquery (struct dnspkt *, const char *);
58 int dns_addanswer (struct dnspkt *, const char *, int, int);
60 int dns_getpktsize (const struct dnspkt *);
61 struct dnspkt *dns_extractpkt (const unsigned char *, int);
62 const char *dns_getquerydata (struct dnspkt *);
63 char *dns_getanswerdata (struct dnspkt *, int *);
65 const char *dns_fqdn2data (const char *);
66 const char *dns_data2fqdn (const char *);
68 const unsigned char *txt2data (const unsigned char *, int *);
69 unsigned char *dns_constructpacket (struct dnspkt *, int *);
71 int dns_getfreespace (const struct dnspkt *, int);
73 #endif /* _NSTXDNS_H */