Ignore:
Timestamp:
May 19, 2003, 4:41:00 AM (22 years ago)
Author:
bird
Message:

#434: Initial tcpip header merges.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/resolv.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r182 r183  
    11/* Modified for EMX by hv 1994,1996
     2 * Modified for gcc by bird 2003
    23 *
    34 * Copyright (c) 1983, 1987, 1989 The Regents of the University of California.
     
    3334 *
    3435 *      from: @(#)resolv.h      5.15 (Berkeley) 4/3/91
    35  *      resolv.h,v 1.1 2003/04/16 15:53:07 bird Exp
     36 *      resolv.h,v 1.2 2003/05/19 02:41:00 bird Exp
    3637 */
    3738
     
    3940#define _RESOLV_H_
    4041
     42
    4143#if defined (__cplusplus)
    4244extern "C" {
    4345#endif
    4446
    45 #pragma pack(4)
     47/* toolkit includes a bunch of headers */
     48#ifndef TCPV40HDRS
     49#include <sys/param.h>
     50#include <types.h>
     51#include <sys/cdefs.h>
     52#include <stdio.h>
     53
     54
     55/*
     56 * Revision information.  This is the release date in YYYYMMDD format.
     57 * It can change every day so the right thing to do with it is use it
     58 * in preprocessor commands such as "#if (__RES > 19931104)".  Do not
     59 * compare for equality; rather, use it to determine whether your resolver
     60 * is new enough to contain a certain feature.
     61 */
     62
     63#define __RES   19960801
    4664
    4765/*
     
    5270
    5371#ifndef _PATH_RESCONF
    54 #define _PATH_RESCONF        "/tcpip/etc/resolv.conf"
    55 #endif
     72#define _PATH_RESCONF        "/mptn/etc/resolv.conf"
     73#endif
     74#endif /* TCPV40HDRS */
    5675
    5776/*
     
    6079#define MAXNS                   3       /* max # name servers we'll track */
    6180#define MAXDFLSRCH              3       /* # default domain levels to try */
     81#define LOCALDOMAINPARTS        2       /* min levels in name that is "local" */
     82#define RES_TIMEOUT             4       /* min. seconds between retries */
     83#ifdef TCPV40HDRS
     84#define MAXDNSRCH               3       /* max # domains in search path */
     85#else
    6286#define MAXDNSRCH               6       /* max # domains in search path */
    63 #define LOCALDOMAINPARTS        2       /* min levels in name that is "local" */
    64 #define MAXDNSLUS               4       /* max # of host lookup types */
    65 
    66 #define RES_TIMEOUT             5       /* min. seconds between retries */
     87#define MAXRESOLVSORT           10      /* number of net to sort on */
     88#define RES_MAXNDOTS            15      /* should reflect bit field size */
     89#endif
     90
     91
     92#ifdef TCPV40HDRS
    6793
    6894#pragma pack(4)
     
    77103        char    defdname[MAXDNAME];     /* default domain */
    78104        char    *dnsrch[MAXDNSRCH+1];   /* components of domain to search */
    79 /*      char    lookups[MAXDNSLUS];*/   /* not in OS/2 */
    80105};
    81 #pragma pack(1)
     106#pragma pack()
     107
     108#else
     109
     110#pragma pack(4)
     111struct __res_state {
     112        int     retrans;                /* retransmition time interval */
     113        int     retry;                  /* number of times to retransmit */
     114        u_long  options;                /* option flags - see below. */
     115        int     nscount;                /* number of name servers */
     116        struct sockaddr_in
     117                nsaddr_list[MAXNS];     /* address of name server */
     118#define nsaddr  nsaddr_list[0]          /* for backward compatibility */
     119        u_short id;                     /* current message id */
     120        char    defdname[256];          /* default domain (deprecated) */
     121        char    *dnsrch[MAXDNSRCH+1];   /* components of domain to search */
     122        u_long  pfcode;                 /* RES_PRF_ flags - see below. */
     123        unsigned ndots:4;               /* threshold for initial abs. query */
     124        unsigned nsort:4;               /* number of elements in sort_list[] */
     125        char    unused[3];
     126        struct {
     127                struct in_addr  addr;
     128                u_int32_t       mask;
     129        } sort_list[MAXRESOLVSORT];
     130        char    pad[72];                /* on an i386 this means 512b total */
     131};
     132#pragma pack()
     133
     134#endif
    82135
    83136/*
     
    94147#define RES_STAYOPEN    0x0100          /* Keep TCP socket open */
    95148#define RES_DNSRCH      0x0200          /* search up local domain tree */
     149#ifndef TCPV40HDRS
     150#define RES_INSECURE1   0x00000400      /* type 1 security disabled */
     151#define RES_INSECURE2   0x00000800      /* type 2 security disabled */
     152#define RES_NOALIASES   0x00001000      /* shuts off HOSTALIASES feature */
     153#define RES_USE_INET6   0x00002000      /* use/map IPv6 in gethostbyname() */
     154#endif
    96155
    97156#define RES_DEFAULT     (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
    98157
     158
     159
     160#ifdef TCPV40HDRS
     161
    99162extern  struct state _res;
    100163
     164#else
     165
     166/*
     167 * Resolver "pfcode" values.  Used by dig.
     168 */
     169#define RES_PRF_STATS   0x00000001
     170/*                      0x00000002      */
     171#define RES_PRF_CLASS   0x00000004
     172#define RES_PRF_CMD     0x00000008
     173#define RES_PRF_QUES    0x00000010
     174#define RES_PRF_ANS     0x00000020
     175#define RES_PRF_AUTH    0x00000040
     176#define RES_PRF_ADD     0x00000080
     177#define RES_PRF_HEAD1   0x00000100
     178#define RES_PRF_HEAD2   0x00000200
     179#define RES_PRF_TTLID   0x00000400
     180#define RES_PRF_HEADX   0x00000800
     181#define RES_PRF_QUERY   0x00001000
     182#define RES_PRF_REPLY   0x00002000
     183#define RES_PRF_INIT    0x00004000
     184/*                      0x00008000      */
     185
     186/* hooks are still experimental as of 4.9.2 */
     187typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
     188        res_sendhookact;
     189
     190typedef res_sendhookact (* _System res_send_qhook)(struct sockaddr_in * const *ns,
     191                                              const u_char **query,
     192                                              int *querylen,
     193                                              u_char *ans,
     194                                              int anssiz,
     195                                              int *resplen);
     196
     197typedef res_sendhookact (* _System res_send_rhook)(const struct sockaddr_in *ns,
     198                                              const u_char *query,
     199                                              int querylen,
     200                                              u_char *ans,
     201                                              int anssiz,
     202                                              int *resplen);
     203
     204#pragma pack(4)
     205struct res_sym {
     206        int     number;         /* Identifying number, like T_MX */
     207        char *  name;           /* Its symbolic name, like "MX" */
     208        char *  humanname;      /* Its fun name, like "mail exchanger" */
     209};
     210#pragma pack()
     211
     212extern struct __res_state   _ress[2];
     213extern const struct res_sym __p_class_syms[];
     214extern const struct res_sym __p_type_syms[];
     215#define _res (_ress[0])
     216
    101217/* Private routines shared between libc/net, named, nslookup and others. */
    102 int     dn_skipname (__const__ u_char *, __const__ u_char *);
    103 void    putlong (u_long, u_char *);
    104 void    putshort (u_short, u_char *);
    105 
    106 /* public routines */
    107 int     dn_comp(__const__ u_char *, u_char *, int, u_char **, u_char **);
    108 int     dn_expand(__const__ u_char *, __const__ u_char *, __const__ u_char *,
    109                         u_char *, int);
    110 int     res_init(void);
    111 int     res_mkquery(int, __const__ char *, int, int, __const__ char *, int,
    112                         __const__ struct rrec *, char *, int);
    113 int     res_send(__const__ char *, int, char *, int);
     218#define res_hnok        __res_hnok
     219#define res_ownok       __res_ownok
     220#define res_mailok      __res_mailok
     221#define res_dnok        __res_dnok
     222#define sym_ston        __sym_ston
     223#define sym_ntos        __sym_ntos
     224#define sym_ntop        __sym_ntop
     225#define b64_ntop        __b64_ntop
     226#define b64_pton        __b64_pton
     227#define loc_ntoa        __loc_ntoa
     228#define loc_aton        __loc_aton
     229#define dn_skipname     __dn_skipname
     230#define fp_resstat      __fp_resstat
     231#define fp_query        __fp_query
     232#define fp_nquery       __fp_nquery
     233#define hostalias       __hostalias
     234#define putlong         __putlong
     235#define putshort        __putshort
     236#define p_class         __p_class
     237#define p_time          __p_time
     238#define p_type          __p_type
     239#define p_query         __p_query
     240#define p_cdnname       __p_cdnname
     241#define p_cdname        __p_cdname
     242#define p_fqnname       __p_fqnname
     243#define p_fqname        __p_fqname
     244#define p_rr            __p_rr
     245#define p_option        __p_option
     246#define p_secstodate    __p_secstodate
     247#define dn_count_labels __dn_count_labels
     248#define dn_comp         __dn_comp
     249#define dn_expand       __dn_expand
     250#define res_init        __res_init
     251#define res_randomid    __res_randomid
     252#define res_query       __res_query
     253#define res_search      __res_search
     254#define res_querydomain __res_querydomain
     255#define res_mkquery     __res_mkquery
     256#define res_send        __res_send
     257#define res_isourserver __res_isourserver
     258#define res_nameinquery __res_nameinquery
     259#define res_queriesmatch __res_queriesmatch
     260#define res_close       __res_close
     261
     262int             _System res_hnok(const char *);
     263int             _System res_ownok(const char *);
     264int             _System res_mailok(const char *);
     265int             _System res_dnok(const char *);
     266int             _System sym_ston(const struct res_sym *, char *, int *);
     267const char *    _System sym_ntos(const struct res_sym *, int, int *);
     268const char *    _System sym_ntop(const struct res_sym *, int, int *);
     269int             _System b64_ntop(u_char const *, size_t, char *, size_t);
     270int             _System b64_pton(char const *, u_char *, size_t);
     271int             _System loc_aton(const char *, u_char *);
     272const char *    _System loc_ntoa(const u_char *, char *);
     273int             _System dn_skipname(const u_char *, const u_char *);
     274void            _System fp_resstat(struct __res_state *, int);
     275void            _System fp_query(const u_char *, int);
     276void            _System fp_nquery(const u_char *, int, int);
     277const char *    _System hostalias(const char *);
     278void            _System putlong(u_int32_t, u_char *);
     279void            _System putshort(u_int16_t, u_char *);
     280const char *    _System p_class(int);
     281const char *    _System p_time(u_int32_t);
     282const char *    _System p_type(int);
     283void            _System p_query(const u_char *);
     284const u_char *  _System p_cdnname(const u_char *, const u_char *, int, int);
     285const u_char *  _System p_cdname(const u_char *, const u_char *, int);
     286const u_char *  _System p_fqnname(const u_char *cp, const u_char *msg,
     287                                             int, char *, int);
     288const u_char *  _System p_fqname(const u_char *, const u_char *, int);
     289const u_char *  _System p_rr(const u_char *, const u_char *, int);
     290const char *    _System p_option(u_long option);
     291char *          _System p_secstodate(u_long);
     292int             _System dn_count_labels(char *);
     293int             _System dn_comp(const char *, u_char *, int,
     294                                u_char **, u_char **);
     295int             _System dn_expand(const u_char *, const u_char *, const u_char *,
     296                                  char *, int);
     297int             _System res_init(void);
     298u_int           _System res_randomid(void);
     299int             _System res_query(const char *, int, int, u_char *, int);
     300int             _System res_search(const char *, int, int, u_char *, int);
     301int             _System res_querydomain(const char *, const char *, int, int, u_char *, int);
     302int             _System res_mkquery(int, const char *, int, int, const u_char *, int,
     303                                    const u_char *, u_char *, int);
     304int             _System res_send(const u_char *, int, u_char *, int);
     305int             _System res_isourserver(const struct sockaddr_in *);
     306int             _System res_nameinquery(const char *, int, int,
     307                                        const u_char *, const u_char *);
     308int             _System res_queriesmatch(const u_char *, const u_char *,
     309                                         const u_char *, const u_char *);
     310void            _System res_close(void);
     311int             _System dn_find(u_char *exp_dn, u_char *msg,
     312                               u_char **dnptrs, u_char **lastdnptr);
     313#endif /* !TCPV40HDRS */
     314
    114315
    115316#if defined (__cplusplus)
Note: See TracChangeset for help on using the changeset viewer.