Print this page
remove support for non-ANSI compilation


   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */



  22 /*      Copyright (c) 1992 Sun Microsystems, Inc.       */
  23 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  24 /*        All Rights Reserved   */
  25 
  26 
  27 /*
  28  * netdir.h
  29  *
  30  * This is the include file that defines various structures and
  31  * constants used by the netdir routines.
  32  */
  33 
  34 #ifndef _NETDIR_H
  35 #define _NETDIR_H
  36 
  37 #pragma ident   "%Z%%M% %I%     %E% SMI"        /* SVr4.0 1.5   */
  38 
  39 /*
  40  * This files uses struct netconfig, and netconfig.h must be included
  41  * before this to avoid warnings.
  42  */
  43 
  44 #include <netconfig.h>
  45 
  46 #ifdef  __cplusplus
  47 extern "C" {
  48 #endif
  49 
  50 struct nd_addrlist {
  51         int             n_cnt;          /* number of netbufs */
  52         struct netbuf   *n_addrs;       /* the netbufs */
  53 };
  54 
  55 struct nd_hostservlist {
  56         int                     h_cnt;          /* number of nd_hostservs */
  57         struct nd_hostserv      *h_hostservs;   /* the entries */
  58 };


  62         char            *h_serv;        /* the service name */
  63 };
  64 
  65 struct nd_mergearg {
  66         char            *s_uaddr;       /* servers universal address */
  67         char            *c_uaddr;       /* clients universal address */
  68         char            *m_uaddr;       /* merged universal address */
  69 };
  70 
  71 /*
  72  * _nderror is a private variable to the netdir system.
  73  */
  74 #ifdef _REENTRANT
  75 extern int      *__nderror();
  76 #define _nderror        (*(__nderror()))
  77 #else
  78 extern int _nderror;
  79 #endif  /* _REENTRANT */
  80 
  81 
  82 #ifdef __STDC__
  83 
  84 int netdir_options(struct netconfig *, int option, int fd, char *par);
  85 int netdir_getbyname(struct netconfig *, struct nd_hostserv *,
  86     struct nd_addrlist **);
  87 int netdir_getbyaddr(struct netconfig *, struct nd_hostservlist **,
  88     struct netbuf *);
  89 int __netdir_getbyaddr_nosrv(struct netconfig *, struct nd_hostservlist **,
  90     struct netbuf *);
  91 int netdir_mergeaddr(struct netconfig *, char **muaddr, char *uaddr,
  92     char *ruaddr);
  93 void netdir_free(void *, int);
  94 struct netbuf *uaddr2taddr(struct netconfig *, char *);
  95 char *taddr2uaddr(struct netconfig *, struct netbuf *);
  96 void netdir_perror(char *);
  97 char *netdir_sperror();
  98 struct nd_addrlist *_netdir_getbyname(struct netconfig *, struct nd_hostserv *);
  99 struct nd_hostservlist *_netdir_getbyaddr(struct netconfig *, struct netbuf *);
 100 struct netbuf *_uaddr2taddr(struct netconfig *, char *);
 101 char *_taddr2uaddr(struct netconfig *, struct netbuf *);
 102 char *_netdir_mergeaddr(struct netconfig *, char *uaddr, char *ruaddr);
 103 
 104 #else   /* __STDC__ */
 105 
 106 int netdir_options();
 107 int netdir_getbyname();
 108 int netdir_getbyaddr();
 109 int netdir_mergeaddr();
 110 void netdir_free();
 111 struct netbuf *uaddr2taddr();
 112 void netdir_perror();
 113 char *netdir_sperror();
 114 char *taddr2uaddr();
 115 struct nd_addrlist *_netdir_getbyname();
 116 struct nd_hostservlist *_netdir_getbyaddr();
 117 char *_netdir_mergeaddr();
 118 struct netbuf *_uaddr2taddr();
 119 char *_taddr2uaddr();
 120 
 121 #endif  /* __STDC__ */
 122 
 123 /*
 124  * These are all objects that can be freed by netdir_free
 125  */
 126 #define ND_HOSTSERV     0
 127 #define ND_HOSTSERVLIST 1
 128 #define ND_ADDR         2
 129 #define ND_ADDRLIST     3
 130 
 131 /*
 132  * These are the various errors that can be encountered while attempting
 133  * to translate names to addresses. Note that none of them (except maybe
 134  * no memory) are truely fatal unless the ntoa deamon is on its last attempt
 135  * to translate the name. First four errors are to failitate return values
 136  * from DNS, that are used by mail and others.
 137  *
 138  * Negative errors terminate the search resolution process, positive errors
 139  * are treated as warnings.
 140  */
 141 
 142 #define ND_TRY_AGAIN    -5      /* Non-Authoritive Host not found, or */




   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24  */
  25 /*      Copyright (c) 1992 Sun Microsystems, Inc.       */
  26 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  27 /*        All Rights Reserved   */
  28 

  29 /*
  30  * netdir.h
  31  *
  32  * This is the include file that defines various structures and
  33  * constants used by the netdir routines.
  34  */
  35 
  36 #ifndef _NETDIR_H
  37 #define _NETDIR_H
  38 


  39 /*
  40  * This files uses struct netconfig, and netconfig.h must be included
  41  * before this to avoid warnings.
  42  */
  43 
  44 #include <netconfig.h>
  45 
  46 #ifdef  __cplusplus
  47 extern "C" {
  48 #endif
  49 
  50 struct nd_addrlist {
  51         int             n_cnt;          /* number of netbufs */
  52         struct netbuf   *n_addrs;       /* the netbufs */
  53 };
  54 
  55 struct nd_hostservlist {
  56         int                     h_cnt;          /* number of nd_hostservs */
  57         struct nd_hostserv      *h_hostservs;   /* the entries */
  58 };


  62         char            *h_serv;        /* the service name */
  63 };
  64 
  65 struct nd_mergearg {
  66         char            *s_uaddr;       /* servers universal address */
  67         char            *c_uaddr;       /* clients universal address */
  68         char            *m_uaddr;       /* merged universal address */
  69 };
  70 
  71 /*
  72  * _nderror is a private variable to the netdir system.
  73  */
  74 #ifdef _REENTRANT
  75 extern int      *__nderror();
  76 #define _nderror        (*(__nderror()))
  77 #else
  78 extern int _nderror;
  79 #endif  /* _REENTRANT */
  80 
  81 


  82 int netdir_options(struct netconfig *, int option, int fd, char *par);
  83 int netdir_getbyname(struct netconfig *, struct nd_hostserv *,
  84     struct nd_addrlist **);
  85 int netdir_getbyaddr(struct netconfig *, struct nd_hostservlist **,
  86     struct netbuf *);
  87 int __netdir_getbyaddr_nosrv(struct netconfig *, struct nd_hostservlist **,
  88     struct netbuf *);
  89 int netdir_mergeaddr(struct netconfig *, char **muaddr, char *uaddr,
  90     char *ruaddr);
  91 void netdir_free(void *, int);
  92 struct netbuf *uaddr2taddr(struct netconfig *, char *);
  93 char *taddr2uaddr(struct netconfig *, struct netbuf *);
  94 void netdir_perror(char *);
  95 char *netdir_sperror();
  96 struct nd_addrlist *_netdir_getbyname(struct netconfig *, struct nd_hostserv *);
  97 struct nd_hostservlist *_netdir_getbyaddr(struct netconfig *, struct netbuf *);
  98 struct netbuf *_uaddr2taddr(struct netconfig *, char *);
  99 char *_taddr2uaddr(struct netconfig *, struct netbuf *);
 100 char *_netdir_mergeaddr(struct netconfig *, char *uaddr, char *ruaddr);
 101 



















 102 /*
 103  * These are all objects that can be freed by netdir_free
 104  */
 105 #define ND_HOSTSERV     0
 106 #define ND_HOSTSERVLIST 1
 107 #define ND_ADDR         2
 108 #define ND_ADDRLIST     3
 109 
 110 /*
 111  * These are the various errors that can be encountered while attempting
 112  * to translate names to addresses. Note that none of them (except maybe
 113  * no memory) are truely fatal unless the ntoa deamon is on its last attempt
 114  * to translate the name. First four errors are to failitate return values
 115  * from DNS, that are used by mail and others.
 116  *
 117  * Negative errors terminate the search resolution process, positive errors
 118  * are treated as warnings.
 119  */
 120 
 121 #define ND_TRY_AGAIN    -5      /* Non-Authoritive Host not found, or */