Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/netdir.h
+++ new/usr/src/head/netdir.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 +/*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + */
22 25 /* Copyright (c) 1992 Sun Microsystems, Inc. */
23 26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
24 27 /* All Rights Reserved */
25 28
26 -
27 29 /*
28 30 * netdir.h
29 31 *
30 32 * This is the include file that defines various structures and
31 33 * constants used by the netdir routines.
32 34 */
33 35
34 36 #ifndef _NETDIR_H
35 37 #define _NETDIR_H
36 38
37 -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */
38 -
39 39 /*
40 40 * This files uses struct netconfig, and netconfig.h must be included
41 41 * before this to avoid warnings.
42 42 */
43 43
44 44 #include <netconfig.h>
45 45
46 46 #ifdef __cplusplus
47 47 extern "C" {
48 48 #endif
49 49
50 50 struct nd_addrlist {
51 51 int n_cnt; /* number of netbufs */
52 52 struct netbuf *n_addrs; /* the netbufs */
53 53 };
54 54
55 55 struct nd_hostservlist {
56 56 int h_cnt; /* number of nd_hostservs */
57 57 struct nd_hostserv *h_hostservs; /* the entries */
58 58 };
59 59
60 60 struct nd_hostserv {
61 61 char *h_host; /* the host name */
62 62 char *h_serv; /* the service name */
63 63 };
64 64
65 65 struct nd_mergearg {
66 66 char *s_uaddr; /* servers universal address */
67 67 char *c_uaddr; /* clients universal address */
68 68 char *m_uaddr; /* merged universal address */
69 69 };
70 70
71 71 /*
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
72 72 * _nderror is a private variable to the netdir system.
73 73 */
74 74 #ifdef _REENTRANT
75 75 extern int *__nderror();
76 76 #define _nderror (*(__nderror()))
77 77 #else
78 78 extern int _nderror;
79 79 #endif /* _REENTRANT */
80 80
81 81
82 -#ifdef __STDC__
83 -
84 82 int netdir_options(struct netconfig *, int option, int fd, char *par);
85 83 int netdir_getbyname(struct netconfig *, struct nd_hostserv *,
86 84 struct nd_addrlist **);
87 85 int netdir_getbyaddr(struct netconfig *, struct nd_hostservlist **,
88 86 struct netbuf *);
89 87 int __netdir_getbyaddr_nosrv(struct netconfig *, struct nd_hostservlist **,
90 88 struct netbuf *);
91 89 int netdir_mergeaddr(struct netconfig *, char **muaddr, char *uaddr,
92 90 char *ruaddr);
93 91 void netdir_free(void *, int);
94 92 struct netbuf *uaddr2taddr(struct netconfig *, char *);
95 93 char *taddr2uaddr(struct netconfig *, struct netbuf *);
96 94 void netdir_perror(char *);
97 95 char *netdir_sperror();
98 96 struct nd_addrlist *_netdir_getbyname(struct netconfig *, struct nd_hostserv *);
99 97 struct nd_hostservlist *_netdir_getbyaddr(struct netconfig *, struct netbuf *);
100 98 struct netbuf *_uaddr2taddr(struct netconfig *, char *);
101 99 char *_taddr2uaddr(struct netconfig *, struct netbuf *);
102 100 char *_netdir_mergeaddr(struct netconfig *, char *uaddr, char *ruaddr);
103 101
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 102 /*
124 103 * These are all objects that can be freed by netdir_free
125 104 */
126 105 #define ND_HOSTSERV 0
127 106 #define ND_HOSTSERVLIST 1
128 107 #define ND_ADDR 2
129 108 #define ND_ADDRLIST 3
130 109
131 110 /*
132 111 * These are the various errors that can be encountered while attempting
133 112 * to translate names to addresses. Note that none of them (except maybe
134 113 * no memory) are truely fatal unless the ntoa deamon is on its last attempt
135 114 * to translate the name. First four errors are to failitate return values
136 115 * from DNS, that are used by mail and others.
137 116 *
138 117 * Negative errors terminate the search resolution process, positive errors
139 118 * are treated as warnings.
140 119 */
141 120
142 121 #define ND_TRY_AGAIN -5 /* Non-Authoritive Host not found, or */
143 122 /* SERVERFAIL */
144 123 #define ND_NO_RECOVERY -4 /* Non recoverable errors, FORMERR, REFUSED, */
145 124 /* NOTIMP */
146 125 #define ND_NO_DATA -3 /* Valid name, no data record of requested */
147 126 /* type */
148 127 #define ND_NO_ADDRESS ND_NO_DATA /* no address, look for MX record */
149 128 #define ND_BADARG -2 /* Bad arguments passed */
150 129 #define ND_NOMEM -1 /* No virtual memory left */
151 130 #define ND_OK 0 /* Translation successful */
152 131 #define ND_NOHOST 1 /* Hostname was not resolvable */
153 132 #define ND_NOSERV 2 /* Service was unknown */
154 133 #define ND_NOSYM 3 /* Couldn't resolve symbol */
155 134 #define ND_OPEN 4 /* File couldn't be opened */
156 135 #define ND_ACCESS 5 /* File is not accessable */
157 136 #define ND_UKNWN 6 /* Unknown object to be freed */
158 137 #define ND_NOCTRL 7 /* Unknown option passed to netdir_options */
159 138 #define ND_FAILCTRL 8 /* Option failed in netdir_options */
160 139 #define ND_SYSTEM 9 /* Other System error */
161 140
162 141 /*
163 142 * The following netdir_options commands can be given to the fd. These is
164 143 * a way of providing for any transport specific action which the caller
165 144 * may want to initiate on his transport. It is up to the trasport provider
166 145 * to support the netdir_options he wants to support.
167 146 */
168 147
169 148 #define ND_SET_BROADCAST 1 /* Do t_optmgmt to support broadcast */
170 149 #define ND_SET_RESERVEDPORT 2 /* bind it to reserve address */
171 150 #define ND_CHECK_RESERVEDPORT 3 /* check if address is reserved */
172 151 #define ND_MERGEADDR 4 /* Merge universal address */
173 152
174 153 /*
175 154 * The following special case host names are used to give the underlying
176 155 * transport provides a clue as to the intent of the request.
177 156 */
178 157
179 158 #define HOST_SELF "\\1"
180 159 #define HOST_ANY "\\2"
181 160 #define HOST_BROADCAST "\\3"
182 161 #define HOST_SELF_BIND HOST_SELF
183 162 #define HOST_SELF_CONNECT "\\4"
184 163
185 164 #ifdef __cplusplus
186 165 }
187 166 #endif
188 167
189 168 #endif /* _NETDIR_H */
↓ open down ↓ |
57 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX