Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

clib/DNS.C File Reference

#include <mem.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "tcpip.h"
#include "dns.h"

Go to the source code of this file.

Data Structures

struct  dn_rr_struct

Defines

#define DNS_PORT   53
#define BUFSIZE   600
#define RRBUF   200
#define DN_TYPE_A   1
#define DN_TYPE_NS   2
#define DN_TYPE_CNAME   5
#define DN_TYPE_MX   15
#define DN_CLASS_IN   1

Typedefs

typedef dn_rr_struct dn_rr

Functions

int dn_uncompress (char *dest, int len, char *packet, char *name)
int dn_unpackrr (dn_rr *rr, char *packet, char *message)
int packdomain (char *dest, const char *src)
int gethostbyname (const char *dnsServerIP, const char *domainName, unsigned long *ttl, unsigned long *IP, char *dest)

Variables

unsigned int ident


Define Documentation

#define BUFSIZE   600
 

Definition at line 50 of file DNS.C.

Referenced by gethostbyname().

#define DN_CLASS_IN   1
 

Definition at line 69 of file DNS.C.

Referenced by dn_unpackrr(), and gethostbyname().

#define DN_TYPE_A   1
 

Definition at line 63 of file DNS.C.

Referenced by dn_unpackrr(), and gethostbyname().

#define DN_TYPE_CNAME   5
 

Definition at line 65 of file DNS.C.

Referenced by dn_unpackrr(), and gethostbyname().

#define DN_TYPE_MX   15
 

Definition at line 66 of file DNS.C.

Referenced by dn_unpackrr().

#define DN_TYPE_NS   2
 

Definition at line 64 of file DNS.C.

Referenced by dn_unpackrr().

#define DNS_PORT   53
 

Definition at line 45 of file DNS.C.

Referenced by gethostbyname().

#define RRBUF   200
 

Definition at line 52 of file DNS.C.

Referenced by dn_unpackrr().


Typedef Documentation

typedef struct dn_rr_struct dn_rr
 


Function Documentation

int dn_uncompress char *    dest,
int    len,
char *    packet,
char *    name
 

Definition at line 120 of file DNS.C.

int dn_unpackrr dn_rr   rr,
char *    packet,
char *    message
 

Definition at line 167 of file DNS.C.

References DN_CLASS_IN, DN_TYPE_A, DN_TYPE_CNAME, DN_TYPE_MX, DN_TYPE_NS, dn_uncompress(), RRBUF, dn_rr_struct::rrclass, dn_rr_struct::rrname, dn_rr_struct::rrrdata, dn_rr_struct::rrttl, and dn_rr_struct::rrtype.

int gethostbyname const char *    dnsServerIP,
const char *    domainName,
unsigned long *    ttl,
unsigned long *    IP,
char *    dest
 

Definition at line 258 of file DNS.C.

References AF_INET, API_ERROR, api_sleep(), BUFSIZE, closesocket(), DN_CLASS_IN, DN_TYPE_A, DN_TYPE_CNAME, dn_unpackrr(), DNS_PORT, htons(), ident, inet_addr(), InetToAscii(), MSG_BLOCKING, MSG_TIMEOUT, opensocket(), packdomain(), recvfrom(), dn_rr_struct::rrclass, dn_rr_struct::rrname, dn_rr_struct::rrrdata, dn_rr_struct::rrttl, dn_rr_struct::rrtype, in_addr::s_addr, sendto(), sockaddr_in::sin_addr, sockaddr_in::sin_family, sockaddr_in::sin_port, and SOCK_DGRAM.

int packdomain char *    dest,
const char *    src
[static]
 

Definition at line 221 of file DNS.C.

References src.


Variable Documentation

unsigned int ident [static]
 

Definition at line 48 of file DNS.C.

Referenced by gethostbyname().


Generated on Sun Aug 4 21:47:31 2002 for k/os mp3v2 by doxygen1.2.16