Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / tcpdump / appletalk.h
blob4d550aa4174500072ad540a291d0a530933fe61c
1 /* $NetBSD$ */
3 /*
4 * Copyright (c) 1988, 1989, 1990, 1993, 1994, 1995, 1996
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that: (1) source code distributions
9 * retain the above copyright notice and this paragraph in its entirety, (2)
10 * distributions including binary code include the above copyright notice and
11 * this paragraph in its entirety in the documentation or other materials
12 * provided with the distribution, and (3) all advertising materials mentioning
13 * features or use of this software display the following acknowledgement:
14 * ``This product includes software developed by the University of California,
15 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
16 * the University nor the names of its contributors may be used to endorse
17 * or promote products derived from this software without specific prior
18 * written permission.
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23 * AppleTalk protocol formats (courtesy Bill Croft of Stanford/SUMEX).
25 * @(#) Header: /tcpdump/master/tcpdump/appletalk.h,v 1.16 2004/05/01 09:41:50 hannes Exp (LBL)
28 struct LAP {
29 u_int8_t dst;
30 u_int8_t src;
31 u_int8_t type;
33 #define lapShortDDP 1 /* short DDP type */
34 #define lapDDP 2 /* DDP type */
35 #define lapKLAP 'K' /* Kinetics KLAP type */
37 /* Datagram Delivery Protocol */
39 struct atDDP {
40 u_int16_t length;
41 u_int16_t checksum;
42 u_int16_t dstNet;
43 u_int16_t srcNet;
44 u_int8_t dstNode;
45 u_int8_t srcNode;
46 u_int8_t dstSkt;
47 u_int8_t srcSkt;
48 u_int8_t type;
51 struct atShortDDP {
52 u_int16_t length;
53 u_int8_t dstSkt;
54 u_int8_t srcSkt;
55 u_int8_t type;
58 #define ddpMaxWKS 0x7F
59 #define ddpMaxData 586
60 #define ddpLengthMask 0x3FF
61 #define ddpHopShift 10
62 #define ddpSize 13 /* size of DDP header (avoid struct padding) */
63 #define ddpSSize 5
64 #define ddpWKS 128 /* boundary of DDP well known sockets */
65 #define ddpRTMP 1 /* RTMP type */
66 #define ddpRTMPrequest 5 /* RTMP request type */
67 #define ddpNBP 2 /* NBP type */
68 #define ddpATP 3 /* ATP type */
69 #define ddpECHO 4 /* ECHO type */
70 #define ddpIP 22 /* IP type */
71 #define ddpARP 23 /* ARP type */
72 #define ddpEIGRP 88 /* EIGRP over Appletalk */
73 #define ddpKLAP 0x4b /* Kinetics KLAP type */
76 /* AppleTalk Transaction Protocol */
78 struct atATP {
79 u_int8_t control;
80 u_int8_t bitmap;
81 u_int16_t transID;
82 int32_t userData;
85 #define atpReqCode 0x40
86 #define atpRspCode 0x80
87 #define atpRelCode 0xC0
88 #define atpXO 0x20
89 #define atpEOM 0x10
90 #define atpSTS 0x08
91 #define atpFlagMask 0x3F
92 #define atpControlMask 0xF8
93 #define atpMaxNum 8
94 #define atpMaxData 578
97 /* AppleTalk Echo Protocol */
99 struct atEcho {
100 u_int8_t echoFunction;
101 u_int8_t *echoData;
104 #define echoSkt 4 /* the echoer socket */
105 #define echoSize 1 /* size of echo header */
106 #define echoRequest 1 /* echo request */
107 #define echoReply 2 /* echo request */
110 /* Name Binding Protocol */
112 struct atNBP {
113 u_int8_t control;
114 u_int8_t id;
117 struct atNBPtuple {
118 u_int16_t net;
119 u_int8_t node;
120 u_int8_t skt;
121 u_int8_t enumerator;
124 #define nbpBrRq 0x10
125 #define nbpLkUp 0x20
126 #define nbpLkUpReply 0x30
128 #define nbpNIS 2
129 #define nbpTupleMax 15
131 #define nbpHeaderSize 2
132 #define nbpTupleSize 5
134 #define nbpSkt 2 /* NIS */
137 /* Routing Table Maint. Protocol */
139 #define rtmpSkt 1 /* number of RTMP socket */
140 #define rtmpSize 4 /* minimum size */
141 #define rtmpTupleSize 3
144 /* Zone Information Protocol */
146 struct zipHeader {
147 u_int8_t command;
148 u_int8_t netcount;
151 #define zipHeaderSize 2
152 #define zipQuery 1
153 #define zipReply 2
154 #define zipTakedown 3
155 #define zipBringup 4
156 #define ddpZIP 6
157 #define zipSkt 6
158 #define GetMyZone 7
159 #define GetZoneList 8
162 * UDP port range used for ddp-in-udp encapsulation is 16512-16639
163 * for client sockets (128-255) and 200-327 for server sockets
164 * (0-127). We also try to recognize the pre-April 88 server
165 * socket range of 768-895.
167 #define atalk_port(p) \
168 (((unsigned)((p) - 16512) < 128) || \
169 ((unsigned)((p) - 200) < 128) || \
170 ((unsigned)((p) - 768) < 128))