erroneously checked in
[codemux.git] / codns.h
1 #ifndef _CODNS_H_
2 #define _CODNS_H_
3 #include "ports.h"
4
5 /* query info - fixed part */
6 typedef struct LocalQueryInfo {
7   int lqi_size;                 /* length of the name string */
8   int lqi_id;                   /* query id */
9   int lqi_cache;                /* not being used now */
10 } LocalQueryInfo;
11
12 /* query info + name 
13    query structure expected from a client */
14 #define MAX_QUERY_NAME 256
15 #define SIG_SPLIT_TRANSACTION 0 /* signature for split-transaction */
16 typedef struct LocalQuery {
17   int  lq_zero;                 /* always set to SIG_SPLIT_TRANSACTION(=0) */
18   LocalQueryInfo lq_info;       /* query info */
19   char lq_name[MAX_QUERY_NAME]; /* name */
20 } LocalQuery;
21
22 /* query result from CoDNS 
23    we set MAX_ANSWERS for easy implementation.
24    if lq.address[i].s_addr == 0, that means it returned i-1 valid anwers. */
25 #define MAX_ANSWERS 8         
26 typedef struct LocalQueryResult {
27   int lq_id;                               /* query id */
28   int lq_ttl;                              /* TTL of the record */
29   struct in_addr lq_address[MAX_ANSWERS];  /* IP addresses for the query */
30 } LocalQueryResult;
31
32 /*----------------------------------------------------------------------*/
33
34 /* temporary section : from here to the end
35    used for defining variables or constants for testing */
36
37 /* for testing in HBTWGET */
38 #define HBTWGET_CODNS_ID (-3)
39
40 #endif // _CODNS_H_
41
42