Commit | Line | Data |
---|---|---|
2596a09e WJ |
1 | /* isoaddrs.h - ISODE addressing */ |
2 | ||
3 | /* | |
4 | * $Header: /f/osi/h/RCS/isoaddrs.h,v 7.8 91/02/22 09:24:44 mrose Interim $ | |
5 | * | |
6 | * | |
7 | * $Log: isoaddrs.h,v $ | |
8 | * Revision 7.8 91/02/22 09:24:44 mrose | |
9 | * Interim 6.8 | |
10 | * | |
11 | * Revision 7.7 90/12/11 10:54:02 mrose | |
12 | * lock-and-load | |
13 | * | |
14 | * Revision 7.6 90/10/29 18:38:09 mrose | |
15 | * updates | |
16 | * | |
17 | * Revision 7.5 90/10/15 18:20:37 mrose | |
18 | * unused | |
19 | * | |
20 | * Revision 7.4 90/07/09 14:37:47 mrose | |
21 | * sync | |
22 | * | |
23 | * Revision 7.3 90/05/08 08:54:34 mrose | |
24 | * touch-up | |
25 | * | |
26 | * Revision 7.2 90/03/15 11:17:58 mrose | |
27 | * quipu-sync | |
28 | * | |
29 | * Revision 7.1 89/11/30 23:54:02 mrose | |
30 | * pa2str | |
31 | * | |
32 | * Revision 7.0 89/11/23 21:55:46 mrose | |
33 | * Release 6.0 | |
34 | * | |
35 | */ | |
36 | ||
37 | /* | |
38 | * NOTICE | |
39 | * | |
40 | * Acquisition, use, and distribution of this module and related | |
41 | * materials are subject to the restrictions of a license agreement. | |
42 | * Consult the Preface in the User's Manual for the full terms of | |
43 | * this agreement. | |
44 | * | |
45 | */ | |
46 | ||
47 | ||
48 | #ifndef _ISOADDRS_ | |
49 | #define _ISOADDRS_ | |
50 | ||
51 | #ifndef _MANIFEST_ | |
52 | #include "manifest.h" | |
53 | #endif | |
54 | #ifndef _GENERAL_ | |
55 | #include "general.h" | |
56 | #endif | |
57 | ||
58 | /* \f */ | |
59 | ||
60 | #ifdef NULLPE | |
61 | typedef struct AEInfo { /* "real" directory services! */ | |
62 | PE aei_ap_title; | |
63 | PE aei_ae_qualifier; | |
64 | ||
65 | int aei_ap_id; | |
66 | int aei_ae_id; | |
67 | ||
68 | int aei_flags; | |
69 | #define AEI_NULL 0x00 | |
70 | #define AEI_AP_ID 0x01 | |
71 | #define AEI_AE_ID 0x02 | |
72 | } AEInfo, *AEI; | |
73 | #define NULLAEI ((AEI) 0) | |
74 | #define AEIFREE(aei) { \ | |
75 | if ((aei) -> aei_ap_title) \ | |
76 | pe_free ((aei) -> aei_ap_title), \ | |
77 | (aei) -> aei_ap_title = NULLPE; \ | |
78 | if ((aei) -> aei_ae_qualifier) \ | |
79 | pe_free ((aei) -> aei_ae_qualifier), \ | |
80 | (aei) -> aei_ae_qualifier = NULLPE; \ | |
81 | } | |
82 | ||
83 | #define str2aei(d,q) _str2aei ((d), (q), NULLCP, 0, NULLCP, NULLCP) | |
84 | #define str2aeinfo(string,context,interactive,userdn,passwd) \ | |
85 | _str2aei ((string), NULLCP, (context), (interactive), (userdn), \ | |
86 | (passwd)) | |
87 | AEI _str2aei (); | |
88 | ||
89 | char *sprintaei (); | |
90 | #endif | |
91 | ||
92 | /* \f */ | |
93 | ||
94 | struct NSAPaddr { /* this structure shouldn't have holes in it */ | |
95 | long na_stack; /* TS-stack */ | |
96 | #define NA_NSAP 0 /* native COTS */ | |
97 | #define NA_TCP 1 /* RFC1006/TCP */ | |
98 | #define NA_X25 2 /* TP0/X.25 */ | |
99 | #define NA_BRG 3 /* TP0-bridge */ | |
100 | ||
101 | long na_community; /* internal community # */ | |
102 | #define SUBNET_REALNS (-1) /* hard-wired */ | |
103 | #define SUBNET_INT_X25 1 | |
104 | /* (unused) | |
105 | #define SUBNET_JANET 2 | |
106 | */ | |
107 | #define SUBNET_INTERNET 3 | |
108 | #define SUBNET_DYNAMIC 100 /* dynamic start here... */ | |
109 | ||
110 | union { | |
111 | struct na_nsap { /* real network service */ | |
112 | #define NASIZE 64 /* 20 ought to do it */ | |
113 | char na_nsap_address[NASIZE]; | |
114 | char na_nsap_addrlen; | |
115 | } un_na_nsap; | |
116 | ||
117 | struct na_tcp { /* emulation via RFC1006 */ | |
118 | #define NSAP_DOMAINLEN 63 | |
119 | char na_tcp_domain[NSAP_DOMAINLEN + 1]; | |
120 | ||
121 | u_short na_tcp_port; /* non-standard TCP port */ | |
122 | u_short na_tcp_tset; /* transport set */ | |
123 | #define NA_TSET_TCP 0x0001 /* .. TCP */ | |
124 | #define NA_TSET_UDP 0x0002 /* .. UDP */ | |
125 | } un_na_tcp; | |
126 | ||
127 | struct na_x25 { /* X.25 (assume single subnet) */ | |
128 | #define NSAP_DTELEN 36 | |
129 | char na_x25_dte[NSAP_DTELEN + 1]; /* Numeric DTE + Link */ | |
130 | char na_x25_dtelen; /* number of digits used */ | |
131 | ||
132 | /* Conventionally, the PID sits at the first head bytes of user data and so | |
133 | * should probably not be mentioned specially. A macro might do it, if | |
134 | * necessary. | |
135 | */ | |
136 | ||
137 | #define NPSIZE 4 | |
138 | char na_x25_pid[NPSIZE]; /* X.25 protocol id */ | |
139 | char na_x25_pidlen; /* .. */ | |
140 | ||
141 | #define CUDFSIZE 16 | |
142 | char na_x25_cudf[CUDFSIZE];/* call user data field */ | |
143 | char na_x25_cudflen; /* .. */ | |
144 | /* | |
145 | * X25 Facilities field. | |
146 | */ | |
147 | #define FACSIZE 6 | |
148 | char na_x25_fac[FACSIZE]; /* X.25 facilities */ | |
149 | char na_x25_faclen; /* .. */ | |
150 | } un_na_x25; | |
151 | } na_un; | |
152 | #define na_address na_un.un_na_nsap.na_nsap_address | |
153 | #define na_addrlen na_un.un_na_nsap.na_nsap_addrlen | |
154 | ||
155 | #define na_domain na_un.un_na_tcp.na_tcp_domain | |
156 | #define na_port na_un.un_na_tcp.na_tcp_port | |
157 | #define na_tset na_un.un_na_tcp.na_tcp_tset | |
158 | ||
159 | #define na_dte na_un.un_na_x25.na_x25_dte | |
160 | #define na_dtelen na_un.un_na_x25.na_x25_dtelen | |
161 | #define na_pid na_un.un_na_x25.na_x25_pid | |
162 | #define na_pidlen na_un.un_na_x25.na_x25_pidlen | |
163 | #define na_cudf na_un.un_na_x25.na_x25_cudf | |
164 | #define na_cudflen na_un.un_na_x25.na_x25_cudflen | |
165 | #define na_fac na_un.un_na_x25.na_x25_fac | |
166 | #define na_faclen na_un.un_na_x25.na_x25_faclen | |
167 | ||
168 | /* for backwards compatibility... these two will be removed after ISODE 7.0 */ | |
169 | #define na_type na_stack | |
170 | #define na_subnet na_community | |
171 | }; | |
172 | #define NULLNA ((struct NSAPaddr *) 0) | |
173 | ||
174 | ||
175 | struct TSAPaddr { | |
176 | #define NTADDR 8 /* according to NIST OIW */ | |
177 | struct NSAPaddr ta_addrs[NTADDR]; /* choice of network addresses */ | |
178 | int ta_naddr; | |
179 | ||
180 | #define TSSIZE 64 | |
181 | int ta_selectlen; | |
182 | ||
183 | union { /* TSAP selector */ | |
184 | char ta_un_selector[TSSIZE]; | |
185 | ||
186 | u_short ta_un_port; | |
187 | } un_ta; | |
188 | #define ta_selector un_ta.ta_un_selector | |
189 | #define ta_port un_ta.ta_un_port | |
190 | }; | |
191 | #define NULLTA ((struct TSAPaddr *) 0) | |
192 | ||
193 | ||
194 | struct SSAPaddr { | |
195 | struct TSAPaddr sa_addr; /* transport address */ | |
196 | ||
197 | #define SSSIZE 64 | |
198 | int sa_selectlen; | |
199 | ||
200 | union { /* SSAP selector */ | |
201 | char sa_un_selector[SSSIZE]; | |
202 | ||
203 | u_short sa_un_port; | |
204 | } un_sa; | |
205 | #define sa_selector un_sa.sa_un_selector | |
206 | #define sa_port un_sa.sa_un_port | |
207 | }; | |
208 | #define NULLSA ((struct SSAPaddr *) 0) | |
209 | ||
210 | ||
211 | struct PSAPaddr { | |
212 | struct SSAPaddr pa_addr; /* session address */ | |
213 | ||
214 | #define PSSIZE 64 | |
215 | int pa_selectlen; | |
216 | ||
217 | union { /* PSAP selector */ | |
218 | char pa_un_selector[PSSIZE]; | |
219 | ||
220 | u_short pa_un_port; | |
221 | } un_pa; | |
222 | #define pa_selector un_pa.pa_un_selector | |
223 | #define pa_port un_pa.pa_un_port | |
224 | }; | |
225 | #define NULLPA ((struct PSAPaddr *) 0) | |
226 | ||
227 | struct PSAPaddr *aei2addr (); /* application entity title to PSAPaddr */ | |
228 | ||
229 | /* \f */ | |
230 | ||
231 | #ifdef NULLPE | |
232 | char *alias2name (); | |
233 | ||
234 | extern PE (*acsap_lookup) (); | |
235 | #endif | |
236 | ||
237 | ||
238 | #ifdef NULLOID | |
239 | struct isoentity { /* for stub directory service */ | |
240 | OIDentifier ie_identifier; | |
241 | char *ie_descriptor; | |
242 | ||
243 | struct PSAPaddr ie_addr; | |
244 | }; | |
245 | ||
246 | int setisoentity (), endisoentity (); | |
247 | ||
248 | struct isoentity *getisoentity (); | |
249 | ||
250 | AEI oid2aei (); | |
251 | #endif | |
252 | ||
253 | ||
254 | /* old-style */ | |
255 | struct PSAPaddr *is2paddr (); /* service entry to PSAPaddr */ | |
256 | struct SSAPaddr *is2saddr (); /* service entry to SSAPaddr */ | |
257 | struct TSAPaddr *is2taddr (); /* service entry to TSAPaddr */ | |
258 | ||
259 | /* \f */ | |
260 | ||
261 | struct PSAPaddr *str2paddr (); /* string encoding to PSAPaddr */ | |
262 | struct SSAPaddr *str2saddr (); /* string encoding to SSAPaddr */ | |
263 | struct TSAPaddr *str2taddr (); /* string encoding to TSAPaddr */ | |
264 | ||
265 | #define paddr2str(pa,na) _paddr2str ((pa), (na), 0) | |
266 | ||
267 | char *_paddr2str (); /* PSAPaddr to string encoding */ | |
268 | char *saddr2str (); /* SSAPaddr to string encoding */ | |
269 | char *taddr2str (); /* TSAPaddr to string encoding */ | |
270 | ||
271 | struct NSAPaddr *na2norm (); /* normalize NSAPaddr */ | |
272 | ||
273 | char *na2str (); /* pretty-print NSAPaddr */ | |
274 | char *pa2str (); /* pretty-print PSAPaddr */ | |
275 | ||
276 | /* \f */ | |
277 | ||
278 | int isodeserver (); /* generic server dispatch */ | |
279 | ||
280 | int iserver_init (); /* phase 1 */ | |
281 | int iserver_wait (); /* phase 2 */ | |
282 | fd_set iserver_mask (); /* linkage */ | |
283 | ||
284 | /* \f */ | |
285 | ||
286 | /* all of this really should be in "isoqos.h" ... */ | |
287 | ||
288 | struct QOStype { | |
289 | /* transport QOS */ | |
290 | int qos_reliability; /* "reliability" element */ | |
291 | #define HIGH_QUALITY 0 | |
292 | #define LOW_QUALITY 1 | |
293 | ||
294 | /* session QOS */ | |
295 | int qos_sversion; /* session version required */ | |
296 | int qos_extended; /* extended control */ | |
297 | int qos_maxtime; /* for SPM response during S-CONNECT */ | |
298 | }; | |
299 | #define NULLQOS ((struct QOStype *) 0) | |
300 | ||
301 | #endif |