home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
internet
/
netlite
/
NET
/
h
/
DOMAIN
< prev
next >
Wrap
Text File
|
1993-04-13
|
2KB
|
81 lines
struct domain_request
{
int16 socket; /* Socket for replies */
int16 id; /* ID of domain request */
struct timer domain_t; /* Structur for timeouts */
int server; /* Number of server */
int tries; /* Number of tries at server */
int16 class; /* CLASS */
int16 type; /* TYPE */
void *user; /* User data, if any */
int (*function)(); /* Function to call with result */
int (*error)(); /* Function to call with error */
char *host; /* Name of host */
char *arg1; /* Optional arguments */
char *arg2;
};
#define NULLDOMREQ (struct domain_request *)0
#define MAX_SERVERS 5
extern int32 domain_servers[];
extern int domain_count;
#define TYPE_A 1
#define TYPE_NS 2
#define TYPE_MD 3
#define TYPE_MF 4
#define TYPE_CNAME 5
#define TYPE_SOA 6
#define TYPE_MB 7
#define TYPE_MG 8
#define TYPE_MR 9
#define TYPE_NULL 10
#define TYPE_WKS 11
#define TYPE_PTR 12
#define TYPE_HINFO 13
#define TYPE_MINFO 14
#define TYPE_MX 15
#define TYPE_TXT 16
#define MAX_TYPE 17
#define CLASS_IN 1
#define CLASS_CH 3
#define CLASS_HS 4
#define QR_QUERY 0x00
#define QR_RESPONSE 0x80
#define OPCODE_QUERY (0x00 << 3)
#define OPCODE_IQUERY (0x01 << 3)
#define OPCODE_STATUS (0x02 << 3)
#define AA 0x04
#define TC 0x02
#define RD 0x01
#define RA 0x80
#define RCODE_OK 0
#define RCODE_FORMAT 1
#define RCODE_SERVER 2
#define RCODE_NAME 3
#define RCODE_NOTIMPL 4
#define RCODE_REFUSED 5
struct domain_stat
{
int packets_in[MAX_TYPE];
int packets_out[MAX_TYPE];
int invalid_id;
int timeouts;
};
extern struct domain_stat domain_stat;
/* In DOMAIN */
void domain_parms(void);
int dodomain(int, char **);
void resolve_a(char *, char *, char *, void *, int (*)(), int (*)());
void resolve_mx(char *, void *, int (*)(), int (*)());