Commit | Line | Data |
---|---|---|
7bcd1bb8 KB |
1 | /*- |
2 | * Copyright (c) 1991 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * %sccs.include.redist.c% | |
6 | * | |
7 | * @(#)iso.h 7.6 (Berkeley) %G% | |
8 | */ | |
9 | ||
72a0a0dc KS |
10 | /*********************************************************** |
11 | Copyright IBM Corporation 1987 | |
12 | ||
13 | All Rights Reserved | |
14 | ||
15 | Permission to use, copy, modify, and distribute this software and its | |
16 | documentation for any purpose and without fee is hereby granted, | |
17 | provided that the above copyright notice appear in all copies and that | |
18 | both that copyright notice and this permission notice appear in | |
19 | supporting documentation, and that the name of IBM not be | |
20 | used in advertising or publicity pertaining to distribution of the | |
21 | software without specific, written prior permission. | |
22 | ||
23 | IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING | |
24 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL | |
25 | IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR | |
26 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, | |
27 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | |
28 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS | |
29 | SOFTWARE. | |
30 | ||
31 | ******************************************************************/ | |
32 | ||
33 | /* | |
34 | * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison | |
35 | */ | |
36 | /* $Header: iso.h,v 4.9 88/09/11 18:06:38 hagens Exp $ */ | |
37 | /* $Source: /usr/argo/sys/netiso/RCS/iso.h,v $ */ | |
38 | ||
39 | #ifndef __ISO__ | |
40 | #define __ISO__ | |
41 | ||
42 | /* | |
43 | * Return true if this is a multicast address | |
44 | * This assumes that the bit transmission is lsb first. This | |
45 | * assumption is valid for 802.3 but not 802.5. There is a | |
46 | * kludge to get around this for 802.5 -- see if_lan.c | |
47 | * where subnetwork header is setup. | |
48 | */ | |
49 | #define IS_MULTICAST(snpa)\ | |
50 | ((snpa)[0] & 0x01) | |
51 | ||
52 | /* | |
53 | * Protocols | |
54 | */ | |
55 | #define ISOPROTO_TP0 25 /* connection oriented transport protocol */ | |
56 | #define ISOPROTO_TP1 26 /* not implemented */ | |
57 | #define ISOPROTO_TP2 27 /* not implemented */ | |
58 | #define ISOPROTO_TP3 28 /* not implemented */ | |
59 | #define ISOPROTO_TP4 29 /* connection oriented transport protocol */ | |
60 | #define ISOPROTO_TP ISOPROTO_TP4 /* tp-4 with negotiation */ | |
61 | #define ISOPROTO_CLTP 30 /* connectionless transport (not yet impl.) */ | |
62 | #define ISOPROTO_CLNP 31 /* connectionless internetworking protocol */ | |
63 | #define ISOPROTO_X25 32 /* cons */ | |
64 | #define ISOPROTO_INACT_NL 33 /* inactive network layer! */ | |
65 | #define ISOPROTO_ESIS 34 /* ES-IS protocol */ | |
d12b96b5 | 66 | #define ISOPROTO_INTRAISIS 35 /* IS-IS protocol */ |
72a0a0dc KS |
67 | |
68 | #define ISOPROTO_RAW 255 /* raw clnp */ | |
69 | #define ISOPROTO_MAX 256 | |
70 | ||
71 | #define ISO_PORT_RESERVED 1024 | |
72 | #define ISO_PORT_USERRESERVED 5000 | |
73 | /* | |
74 | * Port/socket numbers: standard network functions | |
75 | * NOT PRESENTLY USED | |
76 | */ | |
77 | #define ISO_PORT_MAINT 501 | |
78 | #define ISO_PORT_ECHO 507 | |
79 | #define ISO_PORT_DISCARD 509 | |
80 | #define ISO_PORT_SYSTAT 511 | |
81 | #define ISO_PORT_NETSTAT 515 | |
82 | /* | |
83 | * Port/socket numbers: non-standard application functions | |
84 | */ | |
85 | #define ISO_PORT_LOGIN 513 | |
86 | /* | |
87 | * Port/socket numbers: public use | |
88 | */ | |
89 | #define ISO_PORT_PUBLIC 1024 /* high bit set --> public */ | |
90 | ||
91 | /* | |
92 | * Network layer protocol identifiers | |
93 | */ | |
94 | #define ISO8473_CLNP 0x81 | |
95 | #define ISO9542_ESIS 0x82 | |
96 | #define ISO9542X25_ESIS 0x8a | |
d12b96b5 | 97 | #define ISO10589_ISIS 0x83 |
72a0a0dc | 98 | |
44f52ea5 | 99 | |
72a0a0dc KS |
100 | #ifndef IN_CLASSA_NET |
101 | #include "../netinet/in.h" | |
102 | #endif IN_CLASSA_NET | |
103 | ||
72a0a0dc | 104 | |
72a0a0dc | 105 | |
a50e2bc0 | 106 | /* The following looks like a sockaddr |
44f52ea5 | 107 | * to facilitate using tree lookup routines */ |
a50e2bc0 KS |
108 | struct iso_addr { |
109 | u_char isoa_len; /* length (in bytes) */ | |
110 | char isoa_genaddr[20]; /* general opaque address */ | |
111 | }; | |
112 | ||
72a0a0dc | 113 | struct sockaddr_iso { |
a50e2bc0 KS |
114 | u_char siso_len; /* length */ |
115 | u_char siso_family; /* family */ | |
44f52ea5 KS |
116 | u_char siso_plen; /* presentation selector length */ |
117 | u_char siso_slen; /* session selector length */ | |
118 | u_char siso_tlen; /* transport selector length */ | |
72a0a0dc | 119 | struct iso_addr siso_addr; /* network address */ |
44f52ea5 KS |
120 | u_char siso_pad[6]; /* space for gosip v2 sels */ |
121 | /* makes struct 32 bytes long */ | |
72a0a0dc | 122 | }; |
a50e2bc0 | 123 | #define siso_nlen siso_addr.isoa_len |
44f52ea5 KS |
124 | #define siso_data siso_addr.isoa_genaddr |
125 | ||
a50e2bc0 KS |
126 | #define TSEL(s) ((caddr_t)((s)->siso_data + (s)->siso_nlen)) |
127 | ||
128 | #define SAME_ISOADDR(a, b) \ | |
129 | (bcmp((a)->siso_data, (b)->siso_data, (unsigned)(a)->siso_nlen)==0) | |
44f52ea5 KS |
130 | /* |
131 | * The following are specific values for siso->siso_data[0], | |
132 | * otherwise known as the AFI: | |
133 | */ | |
134 | #define AFI_37 0x37 /* bcd of "37" */ | |
135 | #define AFI_OSINET 0x47 /* bcd of "47" */ | |
136 | #define AFI_RFC986 0x47 /* bcd of "47" */ | |
137 | #define AFI_SNA 0x00 /* SubNetwork Address; invalid really...*/ | |
72a0a0dc KS |
138 | |
139 | #ifdef KERNEL | |
140 | ||
141 | extern int iso_netmatch(); | |
142 | extern int iso_hash(); | |
143 | extern int iso_addrmatch(); | |
144 | extern struct iso_ifaddr *iso_iaonnetof(); | |
145 | extern struct domain isodomain; | |
146 | extern struct protosw isosw[]; | |
147 | ||
148 | #else | |
149 | /* user utilities definitions from the iso library */ | |
150 | ||
d5e9d953 DS |
151 | #include <sys/cdefs.h> |
152 | ||
153 | __BEGIN_DECLS | |
154 | struct iso_addr *iso_addr __P((const char *)); | |
155 | char *iso_ntoa __P((const struct iso_addr *)); | |
156 | ||
157 | /* THESE DON'T EXIST YET */ | |
72a0a0dc | 158 | struct hostent *iso_gethostbyname(), *iso_gethostbyaddr(); |
d5e9d953 | 159 | __END_DECLS |
72a0a0dc | 160 | |
d5e9d953 | 161 | #endif /* KERNEL */ |
72a0a0dc | 162 | |
a50e2bc0 | 163 | #define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m)) |
44f52ea5 | 164 | #endif __ISO__ |