2 * Traffic analyzer for Lontalk/EIA-709.1 networks
3 * Daniel Willmann <daniel@totalueberwachung.de>
4 * (c) 2011 Daniel Willmann
6 * Used some code by habibi_khalid <khalidhabibi@gmx.de> and
7 * Honorine_KEMGNE_NGUIFFO <honorinekemgne@yahoo.fr> from
8 * http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4704
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 #include <epan/packet.h>
36 #include <epan/expert.h>
39 static const value_string pdu_fmt_vs
[]=
48 static const value_string addr_fmt_vs
[]=
50 {0x00, "Broadcast (0)"},
51 {0x01, "Multicast (1)"},
52 {0x02, "Unicast (2a)/Multicast (2b)"},
53 {0x03, "Unicast (3)"},
57 static const value_string domain_length_vs
[]=
66 static const value_string tpdu_type_vs
[]=
76 static const value_string spdu_type_vs
[]=
85 static const value_string authpdu_type_vs
[]=
92 static const value_string nm_code_vs
[]=
94 {0x61, "NM_QUERY_ID"},
95 {0x62, "NM_RESPOND_TO_QUERY"},
96 {0x63, "NM_UPDATE_DOMAIN"},
97 {0x64, "NM_LEAVE_DOMAIN"},
98 {0x65, "NM_UPDATE_KEY"},
99 {0x66, "NM_UPDATE_ADDR"},
100 {0x67, "NM_QUERY_ADDR"},
101 {0x68, "NM_QUERY_NV_CNFG"},
102 {0x69, "NM_UPDATE_GROUP_ADDR"},
103 {0x6A, "NM_QUERY_DOMAIN"},
104 {0x6B, "NM_UPDATE_NV_CNFG"},
105 {0x6C, "NM_SET_NODE_MODE"},
106 {0x6D, "NM_READ_MEMORY"},
107 {0x6E, "NM_WRITE_MEMORY"},
108 {0x6F, "NM_CHECKSUM_RECALC"},
110 {0x71, "NM_MEMORY_REFRESH"},
111 {0x72, "NM_QUERY_SNVT"},
112 {0x73, "NM_NV_FETCH"},
113 {0x7F, "NM_MANUAL_SERVICE_REQUEST"},
117 static const value_string nd_code_vs
[]=
119 {0x51, "ND_QUERY_STATUS"},
120 {0x52, "ND_PROXY_COMMAND"},
121 {0x53, "ND_CLEAR_STATUS"},
122 {0x54, "ND_QUERY_XCVR"},
126 void proto_reg_handoff_lon(void);
128 static gint hf_lon_ppdu
= -1;
129 static gint hf_lon_ppdu_prio
= -1;
130 static gint hf_lon_ppdu_alt
= -1;
131 static gint hf_lon_ppdu_deltabl
= -1;
132 static gint hf_lon_npdu
= -1;
133 static gint hf_lon_npdu_version
= -1;
134 static gint hf_lon_npdu_pdu_fmt
= -1;
135 static gint hf_lon_npdu_addr_fmt
= -1;
136 static gint hf_lon_npdu_dom_len
= -1;
137 static gint hf_lon_addr_srcsub
= -1;
138 static gint hf_lon_addr_srcnode
= -1;
139 static gint hf_lon_addr_dstsub
= -1;
140 static gint hf_lon_addr_dstgrp
= -1;
141 static gint hf_lon_addr_dstnode
= -1;
142 static gint hf_lon_addr_grp
= -1;
143 static gint hf_lon_addr_grpmem
= -1;
144 static gint hf_lon_addr_uid
= -1;
145 static gint hf_lon_name
= -1;
146 static gint hf_lon_domain
= -1;
147 static gint hf_lon_tpdu
= -1;
148 static gint hf_lon_auth
= -1;
149 static gint hf_lon_tpdu_tpdu_type
= -1;
150 static gint hf_lon_trans_no
= -1;
151 static gint hf_lon_spdu
= -1;
152 static gint hf_lon_spdu_spdu_type
= -1;
153 static gint hf_lon_mlen
= -1;
154 static gint hf_lon_mlist
= -1;
155 static gint hf_lon_authpdu
= -1;
156 static gint hf_lon_authpdu_fmt
= -1;
157 static gint hf_lon_authpdu_authpdu_type
= -1;
158 static gint hf_lon_nv_dir
= -1;
159 static gint hf_lon_nv_selector
= -1;
160 static gint hf_lon_app_code
= -1;
161 static gint hf_lon_nm_code
= -1;
162 static gint hf_lon_nd_code
= -1;
163 static gint hf_lon_ff_code
= -1;
164 static gint hf_lon_nv
= -1;
165 static gint hf_lon_app
= -1;
166 static gint hf_lon_nm
= -1;
167 static gint hf_lon_nd
= -1;
168 static gint hf_lon_ff
= -1;
169 /* static gint hf_lon_checksum = -1; */
170 static gint proto_lon
= -1;
173 static gint ett_lon
= -1;
174 static gint ett_ppdu
= -1;
175 static gint ett_npdu
= -1;
176 static gint ett_tpdu
= -1;
177 static gint ett_spdu
= -1;
178 static gint ett_authpdu
= -1;
179 static gint ett_apdu
= -1;
180 static gint ett_nv
= -1;
181 static gint ett_app
= -1;
182 static gint ett_nm
= -1;
183 static gint ett_nd
= -1;
184 static gint ett_ff
= -1;
186 static gint ett_address
= -1;
188 static expert_field ei_lon_tpdu_tpdu_type_unknown
= EI_INIT
;
189 static expert_field ei_lon_tpdu_spdu_type_unknown
= EI_INIT
;
190 static expert_field ei_lon_tpdu_authpdu_type_unknown
= EI_INIT
;
191 static expert_field ei_lon_tpdu_apdu_dest_type
= EI_INIT
;
193 static dissector_handle_t data_handle
;
195 static gint
dissect_apdu(proto_tree
*tree
, packet_info
*pinfo
, tvbuff_t
*tvb
,
199 dissect_lon(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
203 gint pdu_fmt
, addr_fmt
, dom_len
, pdutype
, length
;
208 proto_tree
*lon_tree
;
211 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "LON");
212 col_clear(pinfo
->cinfo
, COL_INFO
);
214 npdu
= tvb_get_guint8(tvb
, 0);
215 type
= tvb_get_guint8(tvb
, 1);
216 type
= (type
&0x30)>>4;
217 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
218 "%sDelta_BL: %i Type: %s",
219 npdu
&0x80?"Priority ":"",
221 val_to_str_const(type
, pdu_fmt_vs
, "Unknown"));
223 ti
= proto_tree_add_item(tree
, proto_lon
, tvb
, offset
, -1, ENC_NA
);
224 lon_tree
= proto_item_add_subtree(ti
, ett_lon
);
227 static const gint
*ppdu_fields
[] = {
230 &hf_lon_ppdu_deltabl
,
233 proto_tree_add_bitmask(lon_tree
, tvb
, offset
, hf_lon_ppdu
,
234 ett_ppdu
, ppdu_fields
, ENC_BIG_ENDIAN
);
238 static const gint
*npdu_fields
[] = {
239 &hf_lon_npdu_version
,
240 &hf_lon_npdu_pdu_fmt
,
241 &hf_lon_npdu_addr_fmt
,
242 &hf_lon_npdu_dom_len
,
245 proto_tree_add_bitmask(lon_tree
, tvb
, offset
, hf_lon_npdu
,
246 ett_npdu
, npdu_fields
, ENC_BIG_ENDIAN
);
248 pdu_fmt
= (tvb_get_guint8(tvb
, offset
) >> 4) & 0x03;
249 addr_fmt
= (tvb_get_guint8(tvb
, offset
) >> 2) & 0x03;
250 dom_len
= tvb_get_guint8(tvb
, offset
) & 0x03;
256 case 0: /* Broadcast */
257 pi
= proto_tree_add_text(lon_tree
, tvb
, offset
, 3, "Address type 0 (broadcast)");
258 ti
= proto_item_add_subtree(pi
, ett_address
);
259 proto_tree_add_item(ti
, hf_lon_addr_srcsub
, tvb
, offset
, 1, ENC_NA
);
260 proto_tree_add_item(ti
, hf_lon_addr_srcnode
, tvb
, offset
+1, 1, ENC_NA
);
261 proto_tree_add_item(ti
, hf_lon_addr_dstsub
, tvb
, offset
+2, 1, ENC_NA
);
264 case 1: /* Multicast */
265 pi
= proto_tree_add_text(lon_tree
, tvb
, offset
, 3, "Address type 1 (multicast)");
266 ti
= proto_item_add_subtree(pi
, ett_address
);
267 proto_tree_add_item(ti
, hf_lon_addr_srcsub
, tvb
, offset
, 1, ENC_NA
);
268 proto_tree_add_item(ti
, hf_lon_addr_srcnode
, tvb
, offset
+1, 1, ENC_NA
);
269 proto_tree_add_item(ti
, hf_lon_addr_dstgrp
, tvb
, offset
+2, 1, ENC_NA
);
272 case 2: /* Unicast/Multicast */
273 addr_a
= tvb_get_guint8(tvb
, offset
+1) >> 7;
274 if (addr_a
) { /* Type 2a */
275 pi
= proto_tree_add_text(lon_tree
, tvb
, offset
, 4, "Address type 2a (unicast)");
276 ti
= proto_item_add_subtree(pi
, ett_address
);
277 proto_tree_add_item(ti
, hf_lon_addr_srcsub
, tvb
, offset
, 1, ENC_NA
);
278 proto_tree_add_item(ti
, hf_lon_addr_srcnode
, tvb
, offset
+1, 1, ENC_NA
);
279 proto_tree_add_item(ti
, hf_lon_addr_dstsub
, tvb
, offset
+2, 1, ENC_NA
);
280 proto_tree_add_item(ti
, hf_lon_addr_dstnode
, tvb
, offset
+3, 1, ENC_NA
);
282 } else { /* Type 2b */
283 pi
= proto_tree_add_text(lon_tree
, tvb
, offset
, 6, "Address type 2b (multicast)");
284 ti
= proto_item_add_subtree(pi
, ett_address
);
285 proto_tree_add_item(ti
, hf_lon_addr_srcsub
, tvb
, offset
, 1, ENC_NA
);
286 proto_tree_add_item(ti
, hf_lon_addr_srcnode
, tvb
, offset
+1, 1, ENC_NA
);
287 proto_tree_add_item(ti
, hf_lon_addr_dstgrp
, tvb
, offset
+2, 1, ENC_NA
);
288 proto_tree_add_item(ti
, hf_lon_addr_dstnode
, tvb
, offset
+3, 1, ENC_NA
);
289 proto_tree_add_item(ti
, hf_lon_addr_grp
, tvb
, offset
+4, 1, ENC_NA
);
290 proto_tree_add_item(ti
, hf_lon_addr_grpmem
, tvb
, offset
+5, 1, ENC_NA
);
295 pi
= proto_tree_add_text(lon_tree
, tvb
, offset
, 9, "Address type 3 (UID)");
296 ti
= proto_item_add_subtree(pi
, ett_address
);
297 proto_tree_add_item(ti
, hf_lon_addr_srcsub
, tvb
, offset
, 1, ENC_NA
);
298 proto_tree_add_item(ti
, hf_lon_addr_srcnode
, tvb
, offset
+1, 1, ENC_NA
);
299 proto_tree_add_item(ti
, hf_lon_addr_dstsub
, tvb
, offset
+2, 1, ENC_NA
);
300 proto_tree_add_item(ti
, hf_lon_addr_uid
, tvb
, offset
+3, 6, ENC_NA
);
304 /* END Address part */
308 case 0: /* Domain-wide */
309 proto_tree_add_text(lon_tree
, tvb
, offset
, 0, "Domain wide addressing");
312 proto_tree_add_item(lon_tree
, hf_lon_domain
, tvb
, offset
, 1, ENC_NA
);
316 proto_tree_add_item(lon_tree
, hf_lon_domain
, tvb
, offset
, 3, ENC_NA
);
320 proto_tree_add_item(lon_tree
, hf_lon_domain
, tvb
, offset
, 6, ENC_NA
);
330 static const gint
*tpdu_fields
[] = {
332 &hf_lon_tpdu_tpdu_type
,
336 proto_tree_add_bitmask(lon_tree
, tvb
, offset
, hf_lon_tpdu
,
337 ett_tpdu
, tpdu_fields
, ENC_BIG_ENDIAN
);
339 pdutype
= (tvb_get_guint8(tvb
, offset
)>>4)& 0x07;
344 case 1: /* ACKD and UnACKD_RPT */
345 offset
+= dissect_apdu(lon_tree
, pinfo
, tvb
, offset
);
349 case 4: /* REMINDER */
350 length
= tvb_get_guint8(tvb
, offset
);
351 proto_tree_add_item(lon_tree
, hf_lon_mlen
, tvb
, offset
, 1, ENC_NA
);
353 proto_tree_add_item(lon_tree
, hf_lon_mlist
, tvb
, offset
, length
, ENC_NA
);
356 case 5: /* REM/MSG */
357 length
= tvb_get_guint8(tvb
, offset
);
358 proto_tree_add_item(lon_tree
, hf_lon_mlen
, tvb
, offset
, 1, ENC_NA
);
361 proto_tree_add_item(lon_tree
, hf_lon_mlist
, tvb
, offset
, length
, ENC_NA
);
363 offset
+= dissect_apdu(lon_tree
, pinfo
, tvb
, offset
);
366 expert_add_info_format(pinfo
, lon_tree
, &ei_lon_tpdu_tpdu_type_unknown
, "Unexpected TPDU type %i", pdutype
);
373 static const gint
*spdu_fields
[] = {
375 &hf_lon_spdu_spdu_type
,
379 proto_tree_add_bitmask(lon_tree
, tvb
, offset
, hf_lon_spdu
,
380 ett_spdu
, spdu_fields
, ENC_BIG_ENDIAN
);
381 pdutype
= (tvb_get_guint8(tvb
, offset
)>>4)& 0x07;
385 case 0: /* REQUEST */
386 offset
+= dissect_apdu(lon_tree
, pinfo
, tvb
, offset
);
388 case 2: /* RESPONSE */
389 offset
+= dissect_apdu(lon_tree
, pinfo
, tvb
, offset
);
391 case 4: /* REMINDER */
392 length
= tvb_get_guint8(tvb
, offset
);
393 proto_tree_add_item(lon_tree
, hf_lon_mlen
, tvb
, offset
, 1, ENC_NA
);
395 proto_tree_add_item(lon_tree
, hf_lon_mlist
, tvb
, offset
, length
, ENC_NA
);
398 case 5: /* REM/MSG */
399 length
= tvb_get_guint8(tvb
, offset
);
400 proto_tree_add_item(lon_tree
, hf_lon_mlen
, tvb
, offset
, 1, ENC_NA
);
403 proto_tree_add_item(lon_tree
, hf_lon_mlist
, tvb
, offset
, length
, ENC_NA
);
405 offset
+= dissect_apdu(lon_tree
, pinfo
, tvb
, offset
);
408 expert_add_info_format(pinfo
, lon_tree
, &ei_lon_tpdu_spdu_type_unknown
, "Unexpected SPDU type %i", pdutype
);
413 case 2: /* AuthPDU */
415 static const gint
*authpdu_fields
[] = {
417 &hf_lon_authpdu_authpdu_type
,
421 proto_tree_add_bitmask(lon_tree
, tvb
, offset
, hf_lon_authpdu
,
422 ett_authpdu
, authpdu_fields
, ENC_BIG_ENDIAN
);
424 pdutype
= (tvb_get_guint8(tvb
, offset
)>>4)& 0x03;
428 case 0: /* CHALLENGE */
433 expert_add_info_format(pinfo
, lon_tree
, &ei_lon_tpdu_authpdu_type_unknown
, "Unexpected AuthPDU type %i", pdutype
);
439 offset
+= dissect_apdu(lon_tree
, pinfo
, tvb
, offset
);
448 dissect_apdu(proto_tree
*tree
, packet_info
*pinfo
, tvbuff_t
*tvb
,
452 gint old_offset
= offset
, dest_type
;
454 dest_type
= tvb_get_guint8(tvb
, offset
);
456 if ((dest_type
&0x80) == 0x80) { /* Network variable */
457 static const gint
*nv_fields
[] = {
462 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_lon_nv
,
463 ett_nv
, nv_fields
, ENC_BIG_ENDIAN
);
465 } else if ((dest_type
&0xc0) == 0) { /* Application */
466 static const gint
*app_fields
[] = {
470 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_lon_app
,
471 ett_app
, app_fields
, ENC_BIG_ENDIAN
);
473 } else if ((dest_type
&0xe0) == 0x60) { /* Network Management */
474 static const gint
*nm_fields
[] = {
478 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_lon_nm
,
479 ett_nm
, nm_fields
, ENC_BIG_ENDIAN
);
482 if (dest_type
== 0x7F) {
483 proto_tree_add_item(tree
, hf_lon_addr_uid
, tvb
, offset
, 6, ENC_NA
);
485 proto_tree_add_item(tree
, hf_lon_name
, tvb
, offset
, 8, ENC_NA
);
489 } else if ((dest_type
&0xf0) == 0x50) { /* Network Diagnostic */
490 static const gint
*nd_fields
[] = {
494 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_lon_nd
,
495 ett_nd
, nd_fields
, ENC_BIG_ENDIAN
);
497 } else if ((dest_type
&0xf0) == 0x40) { /* Foreign Frame */
498 static const gint
*ff_fields
[] = {
502 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_lon_ff
,
503 ett_ff
, ff_fields
, ENC_BIG_ENDIAN
);
505 } else { /* Shouldn't get here */
506 expert_add_info_format(pinfo
, tree
, &ei_lon_tpdu_apdu_dest_type
, "Malformed APDU destin&type %i", dest_type
);
509 next_tvb
= tvb_new_subset_remaining(tvb
, offset
);
511 return offset
- old_offset
+ call_dissector(data_handle
, next_tvb
, pinfo
, tree
);
515 proto_register_lon(void)
517 static hf_register_info hf
[] =
521 FT_UINT8
, BASE_HEX
, NULL
, 0,
525 {"Priority", "lon.prio",
526 FT_UINT8
, BASE_DEC
, NULL
, 0x80,
527 "Priority packet", HFILL
}
530 {"Alt path", "lon.alt_path",
531 FT_UINT8
, BASE_DEC
, NULL
, 0x40,
532 "Alternate path", HFILL
}
534 {&hf_lon_ppdu_deltabl
,
535 {"Delta BL", "lon.delta_bl",
536 FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
537 "How many packets to expect from this one", HFILL
}
541 FT_UINT8
, BASE_DEC
, NULL
, 0,
544 {&hf_lon_npdu_version
,
545 {"version", "lon.vers",
546 FT_UINT8
, BASE_HEX
, NULL
, 0xc0,
547 "LON protocol version", HFILL
}
549 {&hf_lon_npdu_pdu_fmt
,
550 {"PDU format", "lon.pdufmt",
551 FT_UINT8
, BASE_HEX
, VALS(pdu_fmt_vs
), 0x30,
554 {&hf_lon_npdu_addr_fmt
,
555 {"Address format", "lon.addrfmt",
556 FT_UINT8
, BASE_HEX
, VALS(addr_fmt_vs
), 0x0c,
559 {&hf_lon_npdu_dom_len
,
560 {"Domain length", "lon.domainlen",
561 FT_UINT8
, BASE_HEX
, VALS(domain_length_vs
), 0x03,
564 {&hf_lon_addr_srcsub
,
565 {"Source subnet", "lon.srcnet",
566 FT_UINT8
, BASE_HEX
, NULL
, 0,
569 {&hf_lon_addr_srcnode
,
570 {"Source node", "lon.srcnode",
571 FT_UINT8
, BASE_HEX
, NULL
, 0x7f,
574 {&hf_lon_addr_dstsub
,
575 {"Destination subnet", "lon.dstnet",
576 FT_UINT8
, BASE_HEX
, NULL
, 0,
579 {&hf_lon_addr_dstgrp
,
580 {"Destination group", "lon.dstgrp",
581 FT_UINT8
, BASE_HEX
, NULL
, 0,
584 {&hf_lon_addr_dstnode
,
585 {"Destination node", "lon.dstnode",
586 FT_UINT8
, BASE_HEX
, NULL
, 0x7f,
591 FT_UINT8
, BASE_HEX
, NULL
, 0,
594 {&hf_lon_addr_grpmem
,
595 {"Group member", "lon.grpmem",
596 FT_UINT8
, BASE_HEX
, NULL
, 0,
600 {"Unique node ID", "lon.uid",
601 FT_BYTES
, BASE_NONE
, NULL
, 0,
605 {"Domain", "lon.domain",
606 FT_BYTES
, BASE_NONE
, NULL
, 0,
611 FT_UINT8
, BASE_HEX
, NULL
, 0,
616 FT_UINT8
, BASE_HEX
, NULL
, 0x80,
619 {&hf_lon_tpdu_tpdu_type
,
620 {"TPDU type", "lon.tpdu_type",
621 FT_UINT8
, BASE_HEX
, VALS(tpdu_type_vs
), 0x70,
625 {"Transaction number", "lon.trans_no",
626 FT_UINT8
, BASE_HEX
, NULL
, 0x0f,
631 FT_UINT8
, BASE_HEX
, NULL
, 0,
634 {&hf_lon_spdu_spdu_type
,
635 {"SPDU type", "lon.spdu_type",
636 FT_UINT8
, BASE_HEX
, VALS(spdu_type_vs
), 0x70,
640 {"Length of M_List", "lon.spdu.mlen",
641 FT_UINT8
, BASE_HEX
, NULL
, 0,
645 {"M_List", "lon.spdu.mlist",
646 FT_UINT8
, BASE_HEX
, NULL
, 0,
650 {"AuthPDU", "lon.authpdu",
651 FT_UINT8
, BASE_HEX
, NULL
, 0,
654 {&hf_lon_authpdu_fmt
,
655 {"FMT (same as AddrFmt)", "lon.authpdu_addrfmt",
656 FT_UINT8
, BASE_HEX
, NULL
, 0xc,
659 {&hf_lon_authpdu_authpdu_type
,
660 {"AuthPDU type", "lon.authpdu_type",
661 FT_UINT8
, BASE_HEX
, VALS(authpdu_type_vs
), 0x2,
665 {"Network Variable", "lon.nv",
666 FT_UINT16
, BASE_HEX
, NULL
, 0,
670 {"NV direction", "lon.nv.dir",
671 FT_UINT16
, BASE_HEX
, NULL
, 0x4000,
674 {&hf_lon_nv_selector
,
675 {"NV selector", "lon.nv.selector",
676 FT_UINT16
, BASE_HEX
, NULL
, 0x3fff,
680 {"Application", "lon.application",
681 FT_UINT8
, BASE_HEX
, NULL
, 0,
686 FT_UINT8
, BASE_HEX
, NULL
, 0x3f,
690 {"Network Management", "lon.nm",
691 FT_UINT8
, BASE_HEX
, NULL
, 0,
696 FT_UINT8
, BASE_HEX
, VALS(nm_code_vs
), 0xff,
700 {"Network Diagnostic", "lon.nd",
701 FT_UINT8
, BASE_HEX
, NULL
, 0,
706 FT_UINT8
, BASE_HEX
, VALS(nd_code_vs
), 0xff,
710 {"Foreign Frame", "lon.ff",
711 FT_UINT8
, BASE_HEX
, NULL
, 0,
716 FT_UINT8
, BASE_HEX
, NULL
, 0x0f,
720 {"Node name", "lon.name",
721 FT_BYTES
, BASE_NONE
, NULL
, 0,
726 {"Checksum", "lon.chksum",
727 FT_BYTES
, BASE_NONE
, NULL
, 0,
750 static ei_register_info ei
[] = {
751 { &ei_lon_tpdu_tpdu_type_unknown
, { "lon.tpdu_type.unknown", PI_PROTOCOL
, PI_WARN
, "Unexpected TPDU type", EXPFILL
}},
752 { &ei_lon_tpdu_spdu_type_unknown
, { "lon.spdu_type.unknown", PI_PROTOCOL
, PI_WARN
, "Unexpected SPDU type", EXPFILL
}},
753 { &ei_lon_tpdu_authpdu_type_unknown
, { "lon.authpdu_type.unknown", PI_PROTOCOL
, PI_WARN
, "Unexpected AuthPDU type", EXPFILL
}},
754 { &ei_lon_tpdu_apdu_dest_type
, { "lon.authpdu_dest_type.unknown", PI_PROTOCOL
, PI_WARN
, "Malformed APDU destin&type", EXPFILL
}},
757 expert_module_t
* expert_lon
;
759 proto_lon
= proto_register_protocol("Local Operating Network",
762 proto_register_field_array (proto_lon
, hf
, array_length (hf
));
763 proto_register_subtree_array (ett
, array_length (ett
));
764 expert_lon
= expert_register_protocol(proto_lon
);
765 expert_register_field_array(expert_lon
, ei
, array_length(ei
));
770 proto_reg_handoff_lon(void)
772 dissector_handle_t lon_handle
;
774 lon_handle
= new_create_dissector_handle(dissect_lon
, proto_lon
);
775 data_handle
= find_dissector("data");
777 dissector_add_uint("cnip.protocol", 0, lon_handle
);