Please wait until the page is fully downloaded and then press the "Expand" button or the blue line numbers.

0094000 /*
0094001  * Copyright (c) 1983, 1987, 1989 The Regents of the University of California.
0094002  * All rights reserved.
0094003  *
0094004  * Redistribution and use in source and binary forms are permitted
0094005  * provided that: (1) source distributions retain this entire copyright
0094006  * notice and comment, and (2) distributions including binaries display
0094007  * the following acknowledgement: ``This product includes software
0094008  * developed by the University of California, Berkeley and its contributors''
0094009  * in the documentation or other materials provided with the distribution
0094010  * and in all advertising materials mentioning features or use of this
0094011  * software. Neither the name of the University nor the names of its
0094012  * contributors may be used to endorse or promote products derived
0094013  * from this software without specific prior written permission.
0094014  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
0094015  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
0094016  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
0094017  *
0094018  *       @(#)resolv.h       5.10 (Berkeley) 6/1/90
0094019  */
0094020 #ifndef _NET__GEN__RESOLV_H
0094021 #define _NET__GEN__RESOLV_H
0094022 
0094023 /*
0094024  * Resolver configuration file.
0094025  * Normally not present, but may contain the address of the
0094026  * inital name server(s) to query and the domain search list.
0094027  */
0094028 
0094029 #ifndef _PATH_RESCONF
0094030 #define _PATH_RESCONF "/etc/resolv.conf"
0094031 #endif
0094032 
0094033 /*
0094034  * Global defines and variables for resolver stub.
0094035  */
0094036 #define       MAXNS              3              /* max # name servers we'll track */
0094037 #define       MAXDFLSRCH       3              /* # default domain levels to try */
0094038 #define       MAXDNSRCH       6              /* max # domains in search path */
0094039 #define       LOCALDOMAINPARTS 2              /* min levels in name that is "local" */
0094040 
0094041 #define       RES_TIMEOUT       5              /* min. seconds between retries */
0094042 
0094043 #define NAMESERVER_PORT       53
0094044 
0094045 struct state {
0094046          int       retrans;               /* retransmition time interval */
0094047          int       retry;                     /* number of times to retransmit */
0094048          long       options;              /* option flags - see below. */
0094049          int       nscount;              /* number of name servers */
0094050          ipaddr_t nsaddr_list[MAXNS];       /* address of name server */
0094051 #define       nsaddr       nsaddr_list[0]              /* for backward compatibility */
0094052          u16_t       nsport_list[MAXNS];       /* port of name server */
0094053          u16_t       id;                     /* current packet id */
0094054          char       defdname[MAXDNAME];       /* default domain */
0094055          char       *dnsrch[MAXDNSRCH+1];       /* components of domain to search */
0094056 };
0094057 
0094058 /*
0094059  * Resolver options
0094060  */
0094061 #define RES_INIT       0x0001              /* address initialized */
0094062 #define RES_DEBUG       0x0002              /* print debug messages */
0094063 #define RES_AAONLY       0x0004              /* authoritative answers only */
0094064 #define RES_USEVC       0x0008              /* use virtual circuit */
0094065 #define RES_PRIMARY       0x0010              /* query primary server only */
0094066 #define RES_IGNTC       0x0020              /* ignore trucation errors */
0094067 #define RES_RECURSE       0x0040              /* recursion desired */
0094068 #define RES_DEFNAMES       0x0080              /* use default domain name */
0094069 #define RES_STAYOPEN       0x0100              /* Keep TCP socket open */
0094070 #define RES_DNSRCH       0x0200              /* search up local domain tree */
0094071 
0094072 #define RES_DEFAULT       (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH )
0094073 
0094074 extern struct state _res;
0094075 
0094076 struct rrec;
0094077 
0094078 int res_init _ARGS(( void ));
0094079 int res_mkquery _ARGS(( int op, const char *dname, int class, int type,
0094080          const char *data, int datalen, const struct rrec *newrr,
0094081          char *buf, int buflen ));
0094082 int res_query _ARGS(( char *name, int class, int type, u8_t *answer,
0094083          int anslen ));
0094084 int res_querydomain _ARGS(( char *name, char *domain, int class, int type,
0094085          u8_t *answer, int anslen ));
0094086 int res_search _ARGS(( char *name, int class, int type, u8_t *answer,
0094087          int anslen ));
0094088 int res_send _ARGS(( const char *buf, int buflen, char *answer, int anslen ));
0094089 void _res_close _ARGS(( void ));
0094090 
0094091 int dn_comp _ARGS(( const u8_t *exp_dn, u8_t *comp_dn, int length,
0094092          u8_t **dnptrs, u8_t **lastdnptr ));
0094093 int dn_expand _ARGS(( const u8_t *msg, const u8_t *eomorig,
0094094          const u8_t *comp_dn, u8_t *exp_dn, int length ));
0094095 int dn_skipname _ARGS(( const u8_t *comp_dn, const u8_t *eom ));
0094096 
0094097 char *__hostalias _ARGS(( const char *name ));
0094098 
0094099 u16_t _getshort _ARGS(( const u8_t *msgp ));
0094100 u32_t _getlong _ARGS(( const u8_t *msgp ));
0094101 void __putshort _ARGS(( U16_t s, u8_t *msgp ));
0094102 void __putlong _ARGS(( u32_t l, u8_t *msgp ));
0094103 
0094104 void p_query _ARGS(( char *msg ));
0094105 
0094106 #endif /* _NET__GEN__RESOLV_H */