2 * Routines for Appletalk packet disassembly (DDP, currently).
4 * $Id: packet-atalk.c,v 1.60 2001/12/10 00:25:26 guy Exp $
6 * Simon Wilkinson <sxw@dcs.ed.ac.uk>
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@ethereal.com>
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #ifdef HAVE_SYS_TYPES_H
32 # include <sys/types.h>
35 #ifdef HAVE_NETINET_IN_H
36 # include <netinet/in.h>
44 #include "atalk-utils.h"
46 static int proto_llap = -1;
47 static int hf_llap_dst = -1;
48 static int hf_llap_src = -1;
49 static int hf_llap_type = -1;
51 static int proto_ddp = -1;
52 static int hf_ddp_hopcount = -1;
53 static int hf_ddp_len = -1;
54 static int hf_ddp_checksum = -1;
55 static int hf_ddp_dst_net = -1;
56 static int hf_ddp_src_net = -1;
57 static int hf_ddp_dst_node = -1;
58 static int hf_ddp_src_node = -1;
59 static int hf_ddp_dst_socket = -1;
60 static int hf_ddp_src_socket = -1;
61 static int hf_ddp_type = -1;
63 static int proto_nbp = -1;
64 static int hf_nbp_op = -1;
65 static int hf_nbp_info = -1;
66 static int hf_nbp_count = -1;
67 static int hf_nbp_tid = -1;
69 static int hf_nbp_node_net = -1;
70 static int hf_nbp_node_port = -1;
71 static int hf_nbp_node_node = -1;
72 static int hf_nbp_node_enum = -1;
73 static int hf_nbp_node_object = -1;
74 static int hf_nbp_node_type = -1;
75 static int hf_nbp_node_zone = -1;
77 static int proto_rtmp = -1;
78 static int hf_rtmp_net = -1;
79 static int hf_rtmp_node_len = -1;
80 static int hf_rtmp_node = -1;
81 static int hf_rtmp_tuple_net = -1;
82 static int hf_rtmp_tuple_range_start = -1;
83 static int hf_rtmp_tuple_range_end = -1;
84 static int hf_rtmp_tuple_dist = -1;
85 static int hf_rtmp_function = -1;
87 static gint ett_nbp = -1;
88 static gint ett_nbp_info = -1;
89 static gint ett_nbp_node = -1;
90 static gint ett_rtmp = -1;
91 static gint ett_rtmp_tuple = -1;
92 static gint ett_ddp = -1;
93 static gint ett_llap = -1;
94 static gint ett_pstring = -1;
96 static dissector_table_t ddp_dissector_table;
98 static dissector_handle_t data_handle;
100 #define DDP_SHORT_HEADER_SIZE 5
103 * P = Padding, H = Hops, L = Len
107 * Assumes the argument is in host byte order.
109 #define ddp_hops(x) ( ( x >> 10) & 0x3C )
110 #define ddp_len(x) ( x & 0x03ff )
111 typedef struct _e_ddp {
112 guint16 hops_len; /* combines pad, hops, and len */
113 guint16 sum,dnet,snet;
119 #define DDP_HEADER_SIZE 13
122 static const value_string op_vals[] = {
123 {DDP_RTMPDATA, "AppleTalk Routing Table response or data" },
124 {DDP_NBP, "AppleTalk Name Binding Protocol packet"},
125 {DDP_ATP, "AppleTalk Transaction Protocol packet"},
126 {DDP_AEP, "AppleTalk Echo Protocol packet"},
127 {DDP_RTMPREQ, "AppleTalk Routing Table request"},
128 {DDP_ZIP, "AppleTalk Zone Information Protocol packet"},
129 {DDP_ADSP, "AppleTalk Data Stream Protocol"},
130 {DDP_EIGRP, "Cisco EIGRP for AppleTalk"},
134 static const value_string rtmp_function_vals[] = {
136 {2, "Route Data Request (split horizon processed)"},
137 {3, "Route Data Request (no split horizon processing)"},
142 #define NBP_FORWARD 4
145 static const value_string nbp_op_vals[] = {
146 {NBP_LOOKUP, "lookup"},
147 {NBP_FORWARD, "forward request"},
148 {NBP_REPLY, "reply"},
153 * XXX - do this with an FT_UINT_STRING?
154 * Unfortunately, you can't extract from an FT_UINT_STRING the string,
155 * which we'd want to do in order to put it into the "Data:" portion.
157 int dissect_pascal_string(tvbuff_t *tvb, int offset, proto_tree *tree,
162 len = tvb_get_guint8(tvb, offset);
172 * XXX - if we could do this inside the protocol tree
173 * code, we could perhaps avoid allocating and freeing
174 * this string buffer.
176 tmp = g_malloc( len+1 );
177 tvb_memcpy(tvb, tmp, offset, len);
179 item = proto_tree_add_string(tree, hf_index, tvb, offset-1, len+1, tmp);
181 subtree = proto_item_add_subtree(item, ett_pstring);
182 proto_tree_add_text(subtree, tvb, offset-1, 1, "Length: %d", len);
183 proto_tree_add_text(subtree, tvb, offset, len, "Data: %s", tmp);
193 dissect_rtmp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
194 proto_tree *rtmp_tree;
198 if (check_col(pinfo->cinfo, COL_PROTOCOL))
199 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTMP");
200 if (check_col(pinfo->cinfo, COL_INFO))
201 col_clear(pinfo->cinfo, COL_INFO);
203 function = tvb_get_guint8(tvb, 0);
205 if (check_col(pinfo->cinfo, COL_INFO))
206 col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
207 val_to_str(function, rtmp_function_vals, "Unknown function (%02)"));
210 ti = proto_tree_add_item(tree, proto_rtmp, tvb, 0, 1, FALSE);
211 rtmp_tree = proto_item_add_subtree(ti, ett_rtmp);
213 proto_tree_add_uint(rtmp_tree, hf_rtmp_function, tvb, 0, 1, function);
218 dissect_rtmp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
219 proto_tree *rtmp_tree;
223 guint8 nodelen,nodelen_bits;
224 guint16 node; /* might be more than 8 bits */
227 if (check_col(pinfo->cinfo, COL_PROTOCOL))
228 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTMP");
229 if (check_col(pinfo->cinfo, COL_INFO))
230 col_clear(pinfo->cinfo, COL_INFO);
232 net = tvb_get_ntohs(tvb, offset);
233 nodelen_bits = tvb_get_guint8(tvb, offset+2);
234 if ( nodelen_bits <= 8 ) {
235 node = tvb_get_guint8(tvb, offset)+1;
238 node = tvb_get_ntohs(tvb, offset);
242 if (check_col(pinfo->cinfo, COL_INFO))
243 col_add_fstr(pinfo->cinfo, COL_INFO, "Net: %u Node Len: %u Node: %u",
244 net, nodelen_bits, node);
247 ti = proto_tree_add_item(tree, proto_rtmp, tvb, offset,
248 tvb_length_remaining(tvb, offset), FALSE);
249 rtmp_tree = proto_item_add_subtree(ti, ett_rtmp);
251 proto_tree_add_uint(rtmp_tree, hf_rtmp_net, tvb, offset, 2, net);
252 proto_tree_add_uint(rtmp_tree, hf_rtmp_node_len, tvb, offset+2, 1,
254 proto_tree_add_uint(rtmp_tree, hf_rtmp_node, tvb, offset+3, nodelen,
256 offset += 3 + nodelen;
259 while (tvb_offset_exists(tvb, offset)) {
260 proto_tree *tuple_item, *tuple_tree;
263 guint16 tuple_range_end;
265 tuple_net = tvb_get_ntohs(tvb, offset);
266 tuple_dist = tvb_get_guint8(tvb, offset+2);
268 if (tuple_dist & 0x80) {
269 tuple_range_end = tvb_get_ntohs(tvb, offset+3);
270 tuple_item = proto_tree_add_text(rtmp_tree, tvb, offset, 6,
271 "Tuple %d: Range Start: %u Dist: %u Range End: %u",
272 i, tuple_net, tuple_dist&0x7F, tuple_range_end);
274 tuple_item = proto_tree_add_text(rtmp_tree, tvb, offset, 3,
275 "Tuple %d: Net: %u Dist: %u",
276 i, tuple_net, tuple_dist);
278 tuple_tree = proto_item_add_subtree(tuple_item, ett_rtmp_tuple);
280 if (tuple_dist & 0x80) {
281 proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_range_start, tvb, offset, 2,
284 proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_net, tvb, offset, 2,
287 proto_tree_add_uint(tuple_tree, hf_rtmp_tuple_dist, tvb, offset+2, 1,
290 if (tuple_dist & 0x80) {
292 * Extended network tuple.
294 proto_tree_add_item(tuple_tree, hf_rtmp_tuple_range_end, tvb, offset+3, 2,
306 dissect_nbp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
307 proto_tree *nbp_tree;
308 proto_tree *nbp_info_tree;
309 proto_item *ti, *info_item;
315 if (check_col(pinfo->cinfo, COL_PROTOCOL))
316 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NBP");
317 if (check_col(pinfo->cinfo, COL_INFO))
318 col_clear(pinfo->cinfo, COL_INFO);
320 info = tvb_get_guint8(tvb, offset);
324 if (check_col(pinfo->cinfo, COL_INFO))
325 col_add_fstr(pinfo->cinfo, COL_INFO, "Op: %s Count: %u",
326 val_to_str(op, nbp_op_vals, "Unknown (0x%01x)"), count);
329 ti = proto_tree_add_item(tree, proto_nbp, tvb, offset,
330 tvb_length_remaining(tvb, offset), FALSE);
331 nbp_tree = proto_item_add_subtree(ti, ett_nbp);
333 info_item = proto_tree_add_uint_format(nbp_tree, hf_nbp_info, tvb, offset, 1,
335 "Info: 0x%01X Operation: %s Count: %u", info,
336 val_to_str(op, nbp_op_vals, "Unknown (0x%01X)"),
338 nbp_info_tree = proto_item_add_subtree(info_item, ett_nbp_info);
339 proto_tree_add_uint(nbp_info_tree, hf_nbp_op, tvb, offset, 1, info);
340 proto_tree_add_uint(nbp_info_tree, hf_nbp_count, tvb, offset, 1, info);
341 proto_tree_add_item(nbp_tree, hf_nbp_tid, tvb, offset+1, 1, FALSE);
344 for (i=0; i<count; i++) {
345 proto_tree *node_item,*node_tree;
346 int soffset = offset;
348 node_item = proto_tree_add_text(nbp_tree, tvb, offset, 4,
350 node_tree = proto_item_add_subtree(node_item, ett_nbp_node);
352 proto_tree_add_item(node_tree, hf_nbp_node_net, tvb, offset, 2, FALSE);
354 proto_tree_add_item(node_tree, hf_nbp_node_node, tvb, offset, 1, FALSE);
356 proto_tree_add_item(node_tree, hf_nbp_node_port, tvb, offset, 1, FALSE);
358 proto_tree_add_item(node_tree, hf_nbp_node_enum, tvb, offset, 1, FALSE);
361 offset = dissect_pascal_string(tvb, offset, node_tree, hf_nbp_node_object);
362 offset = dissect_pascal_string(tvb, offset, node_tree, hf_nbp_node_type);
363 offset = dissect_pascal_string(tvb, offset, node_tree, hf_nbp_node_zone);
365 proto_item_set_len(node_item, offset-soffset);
373 dissect_ddp_short(tvbuff_t *tvb, packet_info *pinfo, guint8 dnode,
374 guint8 snode, proto_tree *tree)
380 proto_tree *ddp_tree = NULL;
382 static struct atalk_ddp_addr src, dst;
385 if (check_col(pinfo->cinfo, COL_PROTOCOL))
386 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DDP");
387 if (check_col(pinfo->cinfo, COL_INFO))
388 col_clear(pinfo->cinfo, COL_INFO);
391 ti = proto_tree_add_item(tree, proto_ddp, tvb, 0, DDP_SHORT_HEADER_SIZE,
393 ddp_tree = proto_item_add_subtree(ti, ett_ddp);
395 len = tvb_get_ntohs(tvb, 0);
397 proto_tree_add_uint(ddp_tree, hf_ddp_len, tvb, 0, 2, len);
398 dport = tvb_get_guint8(tvb, 2);
400 proto_tree_add_uint(ddp_tree, hf_ddp_dst_socket, tvb, 2, 1, dport);
401 sport = tvb_get_guint8(tvb, 3);
403 proto_tree_add_uint(ddp_tree, hf_ddp_src_socket, tvb, 3, 1, sport);
404 type = tvb_get_guint8(tvb, 4);
412 SET_ADDRESS(&pinfo->net_src, AT_ATALK, sizeof src, (guint8 *)&src);
413 SET_ADDRESS(&pinfo->src, AT_ATALK, sizeof src, (guint8 *)&src);
414 SET_ADDRESS(&pinfo->net_dst, AT_ATALK, sizeof dst, (guint8 *)&dst);
415 SET_ADDRESS(&pinfo->dst, AT_ATALK, sizeof dst, (guint8 *)&dst);
417 if (check_col(pinfo->cinfo, COL_INFO)) {
418 col_add_str(pinfo->cinfo, COL_INFO,
419 val_to_str(type, op_vals, "Unknown DDP protocol (%02x)"));
422 proto_tree_add_uint(ddp_tree, hf_ddp_type, tvb, 4, 1, type);
424 new_tvb = tvb_new_subset(tvb, DDP_SHORT_HEADER_SIZE, -1, -1);
426 if (!dissector_try_port(ddp_dissector_table, type, new_tvb, pinfo, tree))
427 call_dissector(data_handle,new_tvb, pinfo, tree);
431 dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
434 proto_tree *ddp_tree;
436 static struct atalk_ddp_addr src, dst;
439 if (check_col(pinfo->cinfo, COL_PROTOCOL))
440 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DDP");
441 if (check_col(pinfo->cinfo, COL_INFO))
442 col_clear(pinfo->cinfo, COL_INFO);
444 tvb_memcpy(tvb, (guint8 *)&ddp, 0, sizeof(e_ddp));
445 ddp.dnet=ntohs(ddp.dnet);
446 ddp.snet=ntohs(ddp.snet);
447 ddp.sum=ntohs(ddp.sum);
448 ddp.hops_len=ntohs(ddp.hops_len);
451 src.node = ddp.snode;
452 src.port = ddp.sport;
454 dst.node = ddp.dnode;
455 dst.port = ddp.dport;
456 SET_ADDRESS(&pinfo->net_src, AT_ATALK, sizeof src, (guint8 *)&src);
457 SET_ADDRESS(&pinfo->src, AT_ATALK, sizeof src, (guint8 *)&src);
458 SET_ADDRESS(&pinfo->net_dst, AT_ATALK, sizeof dst, (guint8 *)&dst);
459 SET_ADDRESS(&pinfo->dst, AT_ATALK, sizeof dst, (guint8 *)&dst);
461 if (check_col(pinfo->cinfo, COL_INFO))
462 col_add_str(pinfo->cinfo, COL_INFO,
463 val_to_str(ddp.type, op_vals, "Unknown DDP protocol (%02x)"));
466 ti = proto_tree_add_item(tree, proto_ddp, tvb, 0, DDP_HEADER_SIZE,
468 ddp_tree = proto_item_add_subtree(ti, ett_ddp);
469 proto_tree_add_uint(ddp_tree, hf_ddp_hopcount, tvb, 0, 1,
470 ddp_hops(ddp.hops_len));
471 proto_tree_add_uint(ddp_tree, hf_ddp_len, tvb, 0, 2,
472 ddp_len(ddp.hops_len));
473 proto_tree_add_uint(ddp_tree, hf_ddp_checksum, tvb, 2, 2,
475 proto_tree_add_uint(ddp_tree, hf_ddp_dst_net, tvb, 4, 2,
477 proto_tree_add_uint(ddp_tree, hf_ddp_src_net, tvb, 6, 2,
479 proto_tree_add_uint(ddp_tree, hf_ddp_dst_node, tvb, 8, 1,
481 proto_tree_add_uint(ddp_tree, hf_ddp_src_node, tvb, 9, 1,
483 proto_tree_add_uint(ddp_tree, hf_ddp_dst_socket, tvb, 10, 1,
485 proto_tree_add_uint(ddp_tree, hf_ddp_src_socket, tvb, 11, 1,
487 proto_tree_add_uint(ddp_tree, hf_ddp_type, tvb, 12, 1,
491 new_tvb = tvb_new_subset(tvb, DDP_HEADER_SIZE, -1, -1);
493 if (!dissector_try_port(ddp_dissector_table, ddp.type, new_tvb, pinfo, tree))
494 call_dissector(data_handle,new_tvb, pinfo, tree);
497 static const value_string llap_type_vals[] = {
501 {0x82, "Acknowledgement"},
508 capture_llap(const u_char *pd, int len, packet_counts *ld)
514 dissect_llap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
519 proto_tree *llap_tree = NULL;
523 if (check_col(pinfo->cinfo, COL_PROTOCOL))
524 col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLAP");
525 if (check_col(pinfo->cinfo, COL_INFO))
526 col_clear(pinfo->cinfo, COL_INFO);
529 ti = proto_tree_add_item(tree, proto_llap, tvb, 0, 3, FALSE);
530 llap_tree = proto_item_add_subtree(ti, ett_llap);
533 dnode = tvb_get_guint8(tvb, 0);
535 proto_tree_add_uint(llap_tree, hf_llap_dst, tvb, 0, 1, dnode);
536 snode = tvb_get_guint8(tvb, 1);
538 proto_tree_add_uint(llap_tree, hf_llap_src, tvb, 1, 1, snode);
539 type = tvb_get_guint8(tvb, 2);
540 if (check_col(pinfo->cinfo, COL_INFO)) {
541 col_add_str(pinfo->cinfo, COL_INFO,
542 val_to_str(type, llap_type_vals, "Unknown LLAP type (%02x)"));
545 proto_tree_add_uint(llap_tree, hf_llap_type, tvb, 2, 1, type);
547 new_tvb = tvb_new_subset(tvb, 3, -1, -1);
549 if (proto_is_protocol_enabled(proto_ddp)) {
550 pinfo->current_proto = "DDP";
554 dissect_ddp_short(new_tvb, pinfo, dnode, snode, tree);
558 dissect_ddp(new_tvb, pinfo, tree);
562 call_dissector(data_handle,new_tvb, pinfo, tree);
566 proto_register_atalk(void)
568 static hf_register_info hf_llap[] = {
570 { "Destination Node", "llap.dst", FT_UINT8, BASE_DEC, NULL, 0x0,
574 { "Source Node", "llap.src", FT_UINT8, BASE_DEC, NULL, 0x0,
578 { "Type", "llap.type", FT_UINT8, BASE_HEX, VALS(llap_type_vals), 0x0,
582 static hf_register_info hf_ddp[] = {
584 { "Hop count", "ddp.hopcount", FT_UINT8, BASE_DEC, NULL, 0x0,
588 { "Datagram length", "ddp.len", FT_UINT16, BASE_DEC, NULL, 0x0,
592 { "Checksum", "ddp.checksum", FT_UINT16, BASE_DEC, NULL, 0x0,
596 { "Destination Net", "ddp.dst.net", FT_UINT16, BASE_DEC, NULL, 0x0,
600 { "Source Net", "ddp.src.net", FT_UINT16, BASE_DEC, NULL, 0x0,
604 { "Destination Node", "ddp.dst.node", FT_UINT8, BASE_DEC, NULL, 0x0,
608 { "Source Node", "ddp.src.node", FT_UINT8, BASE_DEC, NULL, 0x0,
611 { &hf_ddp_dst_socket,
612 { "Destination Socket", "ddp.dst.socket", FT_UINT8, BASE_DEC, NULL, 0x0,
615 { &hf_ddp_src_socket,
616 { "Source Socket", "ddp.src.socket", FT_UINT8, BASE_DEC, NULL, 0x0,
620 { "Protocol type", "ddp.type", FT_UINT8, BASE_DEC, VALS(op_vals), 0x0,
624 static hf_register_info hf_nbp[] = {
626 { "Operation", "nbp.op", FT_UINT8, BASE_DEC,
627 VALS(nbp_op_vals), 0xF0, "Operation", HFILL }},
629 { "Info", "nbp.info", FT_UINT8, BASE_HEX,
630 NULL, 0x0, "Info", HFILL }},
632 { "Count", "nbp.count", FT_UINT8, BASE_DEC,
633 NULL, 0x0F, "Count", HFILL }},
635 { "Network", "nbp.net", FT_UINT16, BASE_DEC,
636 NULL, 0x0, "Network", HFILL }},
638 { "Node", "nbp.node", FT_UINT8, BASE_DEC,
639 NULL, 0x0, "Node", HFILL }},
641 { "Port", "nbp.port", FT_UINT8, BASE_DEC,
642 NULL, 0x0, "Port", HFILL }},
644 { "Enumerator", "nbp.enum", FT_UINT8, BASE_DEC,
645 NULL, 0x0, "Enumerator", HFILL }},
646 { &hf_nbp_node_object,
647 { "Object", "nbp.object", FT_STRING, BASE_DEC,
648 NULL, 0x0, "Object", HFILL }},
650 { "Type", "nbp.type", FT_STRING, BASE_DEC,
651 NULL, 0x0, "Type", HFILL }},
653 { "Zone", "nbp.zone", FT_STRING, BASE_DEC,
654 NULL, 0x0, "Zone", HFILL }},
656 { "Transaction ID", "nbp.tid", FT_UINT8, BASE_DEC,
657 NULL, 0x0, "Transaction ID", HFILL }}
660 static hf_register_info hf_rtmp[] = {
662 { "Net", "rtmp.net", FT_UINT16, BASE_DEC,
663 NULL, 0x0, "Net", HFILL }},
665 { "Node", "nbp.nodeid", FT_UINT8, BASE_DEC,
666 NULL, 0x0, "Node", HFILL }},
668 { "Node Length", "nbp.nodeid.length", FT_UINT8, BASE_DEC,
669 NULL, 0x0, "Node Length", HFILL }},
670 { &hf_rtmp_tuple_net,
671 { "Net", "rtmp.tuple.net", FT_UINT16, BASE_DEC,
672 NULL, 0x0, "Net", HFILL }},
673 { &hf_rtmp_tuple_range_start,
674 { "Range Start", "rtmp.tuple.range_start", FT_UINT16, BASE_DEC,
675 NULL, 0x0, "Range Start", HFILL }},
676 { &hf_rtmp_tuple_range_end,
677 { "Range End", "rtmp.tuple.range_end", FT_UINT16, BASE_DEC,
678 NULL, 0x0, "Range End", HFILL }},
679 { &hf_rtmp_tuple_dist,
680 { "Distance", "rtmp.tuple.dist", FT_UINT16, BASE_DEC,
681 NULL, 0x0, "Distance", HFILL }},
683 { "Function", "rtmp.function", FT_UINT8, BASE_DEC,
684 VALS(rtmp_function_vals), 0x0, "Request Function", HFILL }}
688 static gint *ett[] = {
699 proto_llap = proto_register_protocol("LocalTalk Link Access Protocol", "LLAP", "llap");
700 proto_register_field_array(proto_llap, hf_llap, array_length(hf_llap));
702 proto_ddp = proto_register_protocol("Datagram Delivery Protocol", "DDP", "ddp");
703 proto_register_field_array(proto_ddp, hf_ddp, array_length(hf_ddp));
705 proto_nbp = proto_register_protocol("Name Binding Protocol", "NBP", "nbp");
706 proto_register_field_array(proto_nbp, hf_nbp, array_length(hf_nbp));
708 proto_rtmp = proto_register_protocol("Routing Table Maintenance Protocol",
710 proto_register_field_array(proto_rtmp, hf_rtmp, array_length(hf_rtmp));
712 proto_register_subtree_array(ett, array_length(ett));
714 /* subdissector code */
715 ddp_dissector_table = register_dissector_table("ddp.type", "DDP packet type",
720 proto_reg_handoff_atalk(void)
722 dissector_handle_t ddp_handle, nbp_handle, rtmp_request_handle;
723 dissector_handle_t rtmp_data_handle, llap_handle;
725 ddp_handle = create_dissector_handle(dissect_ddp, proto_ddp);
726 dissector_add("ethertype", ETHERTYPE_ATALK, ddp_handle);
727 dissector_add("chdlctype", ETHERTYPE_ATALK, ddp_handle);
728 dissector_add("ppp.protocol", PPP_AT, ddp_handle);
729 dissector_add("null.type", BSD_AF_APPLETALK, ddp_handle);
731 nbp_handle = create_dissector_handle(dissect_nbp, proto_nbp);
732 dissector_add("ddp.type", DDP_NBP, nbp_handle);
734 rtmp_request_handle = create_dissector_handle(dissect_rtmp_request, proto_rtmp);
735 rtmp_data_handle = create_dissector_handle(dissect_rtmp_data, proto_rtmp);
736 dissector_add("ddp.type", DDP_RTMPREQ, rtmp_request_handle);
737 dissector_add("ddp.type", DDP_RTMPDATA, rtmp_data_handle);
739 llap_handle = create_dissector_handle(dissect_llap, proto_llap);
740 dissector_add("wtap_encap", WTAP_ENCAP_LOCALTALK, llap_handle);
742 data_handle = find_dissector("data");