Changeset 7f2036aa in rtems


Ignore:
Timestamp:
Mar 2, 2012, 12:01:07 PM (8 years ago)
Author:
Ralf Corsépius <ralf.corsepius@…>
Branches:
4.11, master
Children:
e6a675e
Parents:
396b80e
git-author:
Ralf Corsépius <ralf.corsepius@…> (03/02/12 12:01:07)
git-committer:
Ralf Corsépius <ralf.corsepius@…> (03/02/12 12:03:35)
Message:

2012-03-02 Ralf Corsépius <ralf.corsepius@…>

  • libnetworking/resolv.h: Partial sync with FreeBSD. Add decls for res_send_setqhook, res_send_setrhook.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r396b80e r7f2036aa  
     12012-03-02      Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * libnetworking/resolv.h: Partial sync with FreeBSD.
     4        Add decls for res_send_setqhook, res_send_setrhook.
     5
    162012-03-02      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • cpukit/libnetworking/resolv.h

    r396b80e r7f2036aa  
    1 /*-
    2  * Copyright (c) 1983, 1987, 1989, 1993
    3  *      The Regents of the University of California.  All rights reserved.
    4  *
     1/*
     2 * Copyright (c) 1983, 1987, 1989
     3 *    The Regents of the University of California.  All rights reserved.
     4 * 
    55 * Redistribution and use in source and binary forms, with or without
    66 * modification, are permitted provided that the following conditions
     
    1111 *    notice, this list of conditions and the following disclaimer in the
    1212 *    documentation and/or other materials provided with the distribution.
    13  * 3. All advertising materials mentioning features or use of this software
    14  *    must display the following acknowledgement:
    15  *      This product includes software developed by the University of
    16  *      California, Berkeley and its contributors.
    17  * 4. Neither the name of the University nor the names of its contributors
     13 * 3. Neither the name of the University nor the names of its contributors
    1814 *    may be used to endorse or promote products derived from this software
    1915 *    without specific prior written permission.
     
    3329
    3430/*
    35  * Portions Copyright (c) 1996 by Internet Software Consortium.
     31 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
     32 * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
    3633 *
    3734 * Permission to use, copy, modify, and distribute this software for any
     
    3936 * copyright notice and this permission notice appear in all copies.
    4037 *
    41  * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
    42  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
    43  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
    44  * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
    45  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
    46  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
    47  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
    48  * SOFTWARE.
    49  */
    50 
    51 /*
     38 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
     39 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     40 * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
     41 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     42 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     43 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
     44 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     45 */
     46
     47/*%
    5248 *      @(#)resolv.h    8.1 (Berkeley) 6/2/93
    53  *      From Id: resolv.h,v 8.12 1998/04/28 19:36:46 halley Exp $
    54  *      $Id$
     49 *      $Id: resolv.h,v 1.19.18.4 2008/04/03 23:15:15 marka Exp $
     50 * $FreeBSD: release/9.0.0/include/resolv.h 203964 2010-02-16 19:39:50Z imp $
    5551 */
    5652
     
    6460#include <netinet/in.h> /* struct in_addr */
    6561
    66 /*
     62/*%
    6763 * Revision information.  This is the release date in YYYYMMDD format.
    6864 * It can change every day so the right thing to do with it is use it
     
    7470#define __RES   19960801
    7571
    76 /*
     72/*%
    7773 * This used to be defined in res_query.c, now it's in herror.c.  It was
    7874 * never extern'd by any *.h file before it was placed here.  herror.c is
     
    8379extern int h_errno;
    8480
    85 /*
     81/*%
    8682 * Resolver configuration file.
    8783 * Normally not present, but may contain the address of the
     
    9389#endif
    9490
    95 /*
     91typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
     92        res_sendhookact;
     93
     94typedef res_sendhookact (*res_send_qhook)(struct sockaddr_in * const *ns,
     95                                              const u_char **query,
     96                                              int *querylen,
     97                                              u_char *ans,
     98                                              int anssiz,
     99                                              int *resplen);
     100
     101typedef res_sendhookact (*res_send_rhook)(const struct sockaddr_in *ns,
     102                                              const u_char *query,
     103                                              int querylen,
     104                                              u_char *ans,
     105                                              int anssiz,
     106                                              int *resplen);
     107
     108struct res_sym {
     109        int             number;    /*%< Identifying number, like T_MX */
     110        const char *    name;      /*%< Its symbolic name, like "MX" */
     111        const char *    humanname; /*%< Its fun name, like "mail exchanger" */
     112};
     113
     114/*%
    96115 * Global defines and variables for resolver stub.
    97116 */
    98 #define MAXNS                   3       /* max # name servers we'll track */
    99 #define MAXDFLSRCH              3       /* # default domain levels to try */
    100 #define MAXDNSRCH               6       /* max # domains in search path */
    101 #define LOCALDOMAINPARTS        2       /* min levels in name that is "local" */
    102 
    103 #define RES_TIMEOUT             5       /* min. seconds between retries */
    104 #define MAXRESOLVSORT           10      /* number of net to sort on */
    105 #define RES_MAXNDOTS            15      /* should reflect bit field size */
     117#define MAXNS                   3       /*%< max # name servers we'll track */
     118#define MAXDFLSRCH              3       /*%< # default domain levels to try */
     119#define MAXDNSRCH               6       /*%< max # domains in search path */
     120#define LOCALDOMAINPARTS        2       /*%< min levels in name that is "local" */
     121#define RES_TIMEOUT             5       /*%< min. seconds between retries */
     122#define MAXRESOLVSORT           10      /*%< number of net to sort on */
     123#define RES_MAXNDOTS            15      /*%< should reflect bit field size */
    106124
    107125struct __res_state {
    108         int     retrans;                /* retransmission time interval */
    109         int     retry;                  /* number of times to retransmit */
    110         u_long  options;                /* option flags - see below. */
    111         int     nscount;                /* number of name servers */
     126        int     retrans;                /*%< retransmission time interval */
     127        int     retry;                  /*%< number of times to retransmit */
     128        u_long  options;                /*%< option flags - see below. */
     129        int     nscount;                /*%< number of name servers */
    112130        struct sockaddr_in
    113                 nsaddr_list[MAXNS];     /* address of name server */
    114 #define nsaddr  nsaddr_list[0]          /* for backward compatibility */
    115         u_short id;                     /* current message id */
    116         char    *dnsrch[MAXDNSRCH+1];   /* components of domain to search */
    117         char    defdname[256];          /* default domain (deprecated) */
    118         u_long  pfcode;                 /* RES_PRF_ flags - see below. */
    119         unsigned ndots:4;               /* threshold for initial abs. query */
    120         unsigned nsort:4;               /* number of elements in sort_list[] */
     131                nsaddr_list[MAXNS];     /*%< address of name server */
     132#define nsaddr  nsaddr_list[0]          /*%< for backward compatibility */
     133        u_short id;                     /*%< current message id */
     134        char    *dnsrch[MAXDNSRCH+1];   /*%< components of domain to search */
     135        char    defdname[256];          /*%< default domain (deprecated) */
     136        u_long  pfcode;                 /*%< RES_PRF_ flags - see below. */
     137        unsigned ndots:4;               /*%< threshold for initial abs. query */
     138        unsigned nsort:4;               /*%< number of elements in sort_list[] */
    121139        char    unused[3];
    122140        struct {
     
    127145};
    128146
    129 /*
     147typedef struct __res_state *res_state;
     148
     149/*%
    130150 * Resolver options (keep these in synch with res_debug.c, please)
    131151 */
    132 #define RES_INIT        0x00000001      /* address initialized */
    133 #define RES_DEBUG       0x00000002      /* print debug messages */
    134 #define RES_AAONLY      0x00000004      /* authoritative answers only (!IMPL)*/
    135 #define RES_USEVC       0x00000008      /* use virtual circuit */
    136 #define RES_PRIMARY     0x00000010      /* query primary server only (!IMPL) */
    137 #define RES_IGNTC       0x00000020      /* ignore truncation errors */
    138 #define RES_RECURSE     0x00000040      /* recursion desired */
    139 #define RES_DEFNAMES    0x00000080      /* use default domain name */
    140 #define RES_STAYOPEN    0x00000100      /* Keep TCP socket open */
    141 #define RES_DNSRCH      0x00000200      /* search up local domain tree */
    142 #define RES_INSECURE1   0x00000400      /* type 1 security disabled */
    143 #define RES_INSECURE2   0x00000800      /* type 2 security disabled */
    144 #define RES_NOALIASES   0x00001000      /* shuts off HOSTALIASES feature */
    145 #define RES_USE_INET6   0x00002000      /* use/map IPv6 in gethostbyname() */
    146 #define RES_NOTLDQUERY  0x00004000      /* Don't query TLD names */
    147 
    148 #define RES_DEFAULT     (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
    149 
    150 /*
     152#define RES_INIT        0x00000001      /*%< address initialized */
     153#define RES_DEBUG       0x00000002      /*%< print debug messages */
     154#define RES_AAONLY      0x00000004      /*%< authoritative answers only (!IMPL)*/
     155#define RES_USEVC       0x00000008      /*%< use virtual circuit */
     156#define RES_PRIMARY     0x00000010      /*%< query primary server only (!IMPL) */
     157#define RES_IGNTC       0x00000020      /*%< ignore truncation errors */
     158#define RES_RECURSE     0x00000040      /*%< recursion desired */
     159#define RES_DEFNAMES    0x00000080      /*%< use default domain name */
     160#define RES_STAYOPEN    0x00000100      /*%< Keep TCP socket open */
     161#define RES_DNSRCH      0x00000200      /*%< search up local domain tree */
     162#define RES_INSECURE1   0x00000400      /*%< type 1 security disabled */
     163#define RES_INSECURE2   0x00000800      /*%< type 2 security disabled */
     164#define RES_NOALIASES   0x00001000      /*%< shuts off HOSTALIASES feature */
     165#define RES_USE_INET6   0x00002000      /*%< use/map IPv6 in gethostbyname() */
     166#define RES_NOTLDQUERY  0x00004000      /*%< Don't query TLD names */
     167
     168#define RES_DEFAULT     (RES_RECURSE | RES_DEFNAMES | \
     169                         RES_DNSRCH)
     170
     171/*%
    151172 * Resolver "pfcode" values.  Used by dig.
    152173 */
     
    165186#define RES_PRF_QUERY   0x00001000
    166187#define RES_PRF_REPLY   0x00002000
    167 #define RES_PRF_INIT    0x00004000
     188#define RES_PRF_INIT    0x00004000
    168189/*                      0x00008000      */
    169190
    170 typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
    171         res_sendhookact;
    172 
    173 typedef res_sendhookact (*res_send_qhook)(struct sockaddr_in * const *ns,
    174                                               const u_char **query,
    175                                               int *querylen,
    176                                               u_char *ans,
    177                                               int anssiz,
    178                                               int *resplen);
    179 
    180 typedef res_sendhookact (*res_send_rhook)(const struct sockaddr_in *ns,
    181                                               const u_char *query,
    182                                               int querylen,
    183                                               u_char *ans,
    184                                               int anssiz,
    185                                               int *resplen);
    186 
    187 struct res_sym {
    188         int     number;         /* Identifying number, like T_MX */
    189         char *  name;           /* Its symbolic name, like "MX" */
    190         char *  humanname;      /* Its fun name, like "mail exchanger" */
    191 };
     191#define fp_nquery               __fp_nquery
     192#define fp_query                __fp_query
     193#define hostalias               __hostalias
     194#define p_query                 __p_query
     195#define res_close               __res_close
     196#define res_init                __res_init
     197#define res_isourserver         __res_isourserver
     198#define res_mkquery             __res_mkquery
     199#define res_query               __res_query
     200#define res_querydomain         __res_querydomain
     201#define res_search              __res_search
     202#define res_send                __res_send
     203
     204__BEGIN_DECLS
     205void            fp_nquery(const u_char *, int, FILE *);
     206void            fp_query(const u_char *, FILE *);
     207const char *    hostalias(const char *);
     208void            p_query(const u_char *);
     209void            res_close(void);
     210int             res_init(void);
     211int             res_isourserver(const struct sockaddr_in *);
     212int             res_mkquery(int, const char *, int, int, const u_char *,
     213                                 int, const u_char *, u_char *, int);
     214int             res_query(const char *, int, int, u_char *, int);
     215int             res_querydomain(const char *, const char *, int, int,
     216                                     u_char *, int);
     217int             res_search(const char *, int, int, u_char *, int);
     218int             res_send(const u_char *, int, u_char *, int);
     219__END_DECLS
    192220
    193221extern struct __res_state _res;
     222
     223
    194224extern const struct res_sym __p_class_syms[];
    195225extern const struct res_sym __p_type_syms[];
    196226
    197227/* Private routines shared between libc/net, named, nslookup and others. */
    198 #define res_hnok        __res_hnok
    199 #define res_ownok       __res_ownok
    200 #define res_mailok      __res_mailok
    201 #define res_dnok        __res_dnok
    202 #define sym_ston        __sym_ston
    203 #define sym_ntos        __sym_ntos
    204 #define sym_ntop        __sym_ntop
    205 #define b64_ntop        __b64_ntop
    206 #define b64_pton        __b64_pton
    207 #define loc_ntoa        __loc_ntoa
    208 #define loc_aton        __loc_aton
    209 #define fp_resstat      __fp_resstat
    210 #define p_query         __p_query
    211 #define dn_skipname     __dn_skipname
    212 #define fp_resstat      __fp_resstat
    213 #define fp_query        __fp_query
    214 #define fp_nquery       __fp_nquery
    215 #define hostalias       __hostalias
    216 #define putlong         __putlong
    217 #define putshort        __putshort
    218 #define p_class         __p_class
    219 #define p_time          __p_time
    220 #define p_type          __p_type
    221 #define p_query         __p_query
    222 #define p_cdnname       __p_cdnname
    223 #define p_section       __p_section
    224 #define p_cdname        __p_cdname
    225 #define p_fqnname       __p_fqnname
    226 #define p_fqname        __p_fqname
    227 #define p_option        __p_option
    228 #define p_secstodate    __p_secstodate
    229 #define dn_count_labels __dn_count_labels
    230 #define dn_comp         __dn_comp
    231 #define dn_expand       __dn_expand
    232 #define res_init        __res_init
    233 #define res_randomid    __res_randomid
    234 #define res_query       __res_query
    235 #define res_search      __res_search
    236 #define res_querydomain __res_querydomain
    237 #define res_mkquery     __res_mkquery
    238 #define res_send        __res_send
    239 #define res_isourserver __res_isourserver
    240 #define res_nameinquery __res_nameinquery
    241 #define res_queriesmatch __res_queriesmatch
    242 #define res_close       __res_close
    243 #define res_mkupdate    __res_mkupdate
    244 #define res_mkupdrec    __res_mkupdrec
    245 #define res_freeupdrec  __res_freeupdrec
     228#define b64_ntop                __b64_ntop
     229#define b64_pton                __b64_pton
     230#define dn_comp                 __dn_comp
     231#define dn_count_labels         __dn_count_labels
     232#define dn_expand               __dn_expand
     233#define dn_skipname             __dn_skipname
     234#define fp_resstat              __fp_resstat
     235#define loc_aton                __loc_aton
     236#define loc_ntoa                __loc_ntoa
     237#define p_cdname                __p_cdname
     238#define p_cdnname               __p_cdnname
     239#define fp_resstat              __fp_resstat
     240#define p_class                 __p_class
     241#define p_fqname                __p_fqname
     242#define p_fqnname               __p_fqnname
     243#define p_option                __p_option
     244#define p_secstodate            __p_secstodate
     245#define p_section               __p_section
     246#define p_time                  __p_time
     247#define p_type                  __p_type
     248#define putlong                 __putlong
     249#define putshort                __putshort
     250#define res_dnok                __res_dnok
     251#define res_hnok                __res_hnok
     252#define res_mailok              __res_mailok
     253#define res_nameinquery         __res_nameinquery
     254#define res_ownok               __res_ownok
     255#define res_queriesmatch        __res_queriesmatch
     256#define res_randomid            __res_randomid
     257#define sym_ntop                __sym_ntop
     258#define sym_ntos                __sym_ntos
     259#define sym_ston                __sym_ston
     260#define res_send_setqhook       __res_send_setqhook
     261#define res_send_setrhook       __res_send_setrhook
     262#define res_mkupdate            __res_mkupdate
     263#define res_mkupdrec            __res_mkupdrec
     264#define res_freeupdrec          __res_freeupdrec
    246265
    247266__BEGIN_DECLS
    248 int             res_hnok (const char *);
    249 int             res_ownok (const char *);
    250 int             res_mailok (const char *);
    251 int             res_dnok (const char *);
    252 int             sym_ston (const struct res_sym *, const char *, int *);
    253 const char *    sym_ntos (const struct res_sym *, int, int *);
    254 const char *    sym_ntop (const struct res_sym *, int, int *);
    255 int             b64_ntop (u_char const *, size_t, char *, size_t);
    256 int             b64_pton (char const *, u_char *, size_t);
    257 int             loc_aton (const char *, u_char *);
    258 const char *    loc_ntoa (const u_char *, char *);
    259 int             dn_skipname (const u_char *, const u_char *);
    260 void            fp_resstat (struct __res_state *, FILE *);
    261 void            fp_query (const u_char *, FILE *);
    262 void            fp_nquery (const u_char *, int, FILE *);
    263 const char *    hostalias (const char *);
    264 void            putlong (u_int32_t, u_char *);
    265 void            putshort (u_int16_t, u_char *);
    266 const char *    p_class (int);
    267 const char *    p_time (u_int32_t);
    268 const char *    p_type (int);
    269 void            p_query (const u_char *);
    270 const u_char *  p_cdnname (const u_char *, const u_char *, int, FILE *);
    271 const u_char *  p_cdname (const u_char *, const u_char *, FILE *);
    272 const u_char *  p_fqnname (const u_char *, const u_char *,
    273                                int, char *, int);
    274 const u_char *  p_fqname (const u_char *, const u_char *, FILE *);
    275 const char *    p_option (u_long);
    276 char *          p_secstodate (u_long);
    277 int             dn_count_labels (const char *);
    278 int             dn_comp (const char *, u_char *, int,
    279                              u_char **, u_char **);
    280 int             dn_expand (const u_char *, const u_char *, const u_char *,
    281                                char *, int);
    282 int             res_init (void);
    283 u_int           res_randomid (void);
    284 int             res_query (const char *, int, int, u_char *, int);
    285 int             res_search (const char *, int, int, u_char *, int);
    286 int             res_querydomain (const char *, const char *, int, int,
    287                                      u_char *, int);
    288 int             res_mkquery (int, const char *, int, int, const u_char *,
    289                                  int, const u_char *, u_char *, int);
    290 int             res_send (const u_char *, int, u_char *, int);
    291 int             res_isourserver (const struct sockaddr_in *);
    292 int             res_nameinquery (const char *, int, int,
    293                                      const u_char *, const u_char *);
    294 int             res_queriesmatch (const u_char *, const u_char *,
    295                                       const u_char *, const u_char *);
    296 void            res_close (void);
    297 const char *    p_section (int, int);
     267int             res_hnok(const char *);
     268int             res_ownok(const char *);
     269int             res_mailok(const char *);
     270int             res_dnok(const char *);
     271int             sym_ston(const struct res_sym *, const char *, int *);
     272const char *    sym_ntos(const struct res_sym *, int, int *);
     273const char *    sym_ntop(const struct res_sym *, int, int *);
     274int             b64_ntop(u_char const *, size_t, char *, size_t);
     275int             b64_pton(char const *, u_char *, size_t);
     276int             loc_aton(const char *, u_char *);
     277const char *    loc_ntoa(const u_char *, char *);
     278int             dn_skipname(const u_char *, const u_char *);
     279void            fp_resstat(struct __res_state *, FILE *);
     280void            putlong(u_int32_t, u_char *);
     281void            putshort(u_int16_t, u_char *);
     282const char *    p_class(int);
     283const char *    p_time(u_int32_t);
     284const char *    p_type(int);
     285const u_char *  p_cdnname(const u_char *, const u_char *, int, FILE *);
     286const u_char *  p_cdname(const u_char *, const u_char *, FILE *);
     287const u_char *  p_fqnname(const u_char *, const u_char *, int, char *, int);
     288const u_char *  p_fqname(const u_char *, const u_char *, FILE *);
     289const char *    p_option(u_long);
     290char *          p_secstodate(u_long);
     291int             dn_count_labels(const char *);
     292int             dn_comp(const char *, u_char *, int, u_char **, u_char **);
     293int             dn_expand(const u_char *, const u_char *, const u_char *,
     294                          char *, int);
     295u_int           res_randomid(void);
     296int             res_nameinquery(const char *, int, int, const u_char *,
     297                                const u_char *);
     298int             res_queriesmatch(const u_char *, const u_char *,
     299                                 const u_char *, const u_char *);
     300const char *    p_section(int, int);
     301void            res_send_setqhook(res_send_qhook);
     302void            res_send_setrhook(res_send_rhook);
     303
    298304/* XXX The following depend on the ns_updrec typedef in arpa/nameser.h */
    299305#ifdef _ARPA_NAMESER_H_
Note: See TracChangeset for help on using the changeset viewer.