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
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.
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]
23 * Copyright (c) 2001 by Sun Microsystems, Inc.
24 * All rights reserved.
31 #pragma ident "%Z%%M% %I% %E% SMI"
38 * There is a lot of alignment problems in AppleTalk packets.
39 * This is the reason some of the headers use uint8_t arrays instead of the
56 uint16_t ddp_dest_net
;
60 uint8_t ddp_dest_sock
;
65 #define ddp_pad(x) ((x)->ddp_hop_len & 0xc0)
66 #define ddp_hop(x) (((x)->ddp_hop_len >> 2) & 0xf)
67 #define ddp_len(x) ((((x)->ddp_hop_len & 0x3) << 8) + (x)->ddp_len_lo)
69 #define DDPHDR_SIZE 13
71 #define DDP_TYPE_RTMPRQ 5
72 #define DDP_TYPE_RTMPRESP 1
73 #define DDP_TYPE_NBP 2
74 #define DDP_TYPE_ATP 3
75 #define DDP_TYPE_AEP 4
76 #define DDP_TYPE_ZIP 6
77 #define DDP_TYPE_ADSP 7
88 uint8_t ddphdr
[DDPHDR_SIZE
];
95 #define NBP_LKUP_REPLY 3
102 uint8_t ddphdr
[DDPHDR_SIZE
];
109 #define ZIP_GET_NET_INFO 5
110 #define ZIP_GET_NET_INFO_REPLY 6
112 #define ZIP_EXT_REPLY 8
114 #define ZIP_ATP_GETMYZONE 7
115 #define ZIP_ATP_GETZONELIST 8
116 #define ZIP_ATP_GETLOCALZONES 9
118 #define ZIP_FLG_ONEZ 0x20
119 #define ZIP_FLG_USEBRC 0x40
120 #define ZIP_FLG_ZINV 0x80
126 uint8_t ddphdr
[DDPHDR_SIZE
];
133 #define ATPHDR_SIZE 8
135 #define atp_fun(x) (((x) >> 6) & 0x3)
136 #define atp_tmo(x) ((x) & 0x7)
141 #define ATP_FLG_STS 0x08
142 #define ATP_FLG_EOM 0x10
143 #define ATP_FLG_XO 0x20
146 #define NODE_ID_BROADCAST 0xff
149 uint8_t ddphdr
[DDPHDR_SIZE
];
150 uint8_t ad_connid
[2]; /* short */
151 uint8_t ad_fbseq
[4]; /* long */
152 uint8_t ad_nrseq
[4]; /* long */
153 uint8_t ad_rcvwin
[2]; /* short */
158 #define AD_ACKREQ 0x40
161 #define AD_CTRL_MASK 0x0f
163 #define AD_CREQ 0x81 /* Open Conn Request */
164 #define AD_CACK 0x82 /* Open Conn Ack */
165 #define AD_CREQ_ACK 0x83 /* Open Conn Req+Ack */
166 #define AD_CDENY 0x84 /* Open Conn Denial */
168 struct ddp_adsp_att
{
169 struct ddp_adsphdr ad
;
170 uint8_t ad_att_code
[2]; /* short */
173 struct ddp_adsp_open
{
174 struct ddp_adsphdr ad
;
175 uint8_t ad_version
[2]; /* short */
176 uint8_t ad_dconnid
[2]; /* short */
177 uint8_t ad_attseq
[4]; /* long */
181 #define RTMP_RDR_SH 2 /* Route Data Request, split horizon */
182 #define RTMP_RDR_NSH 3 /* Route Data Request, no split horizon */
184 #define RTMP_DIST_MASK 0x1f
185 #define RTMP_EXTEND 0x80
186 #define RTMP_FILLER 0x82
189 uint16_t get_short(uint8_t *);
190 uint32_t get_long(uint8_t *);
192 extern void interpret_aarp(int, char *, int);
193 extern void interpret_at(int, struct ddp_hdr
*, int);
194 extern void interpret_nbp(int, struct nbp_hdr
*, int);
195 extern void interpret_rtmp(int, struct ddp_hdr
*, int);
196 extern void interpret_aecho(int, struct ddp_hdr
*, int);
197 extern void interpret_atp(int, struct ddp_hdr
*, int);
198 extern void interpret_adsp(int, struct ddp_adsphdr
*, int);
199 extern void interpret_ddp_zip(int, struct zip_hdr
*, int);
200 extern void interpret_atp_zip(int, struct atp_hdr
*, int);