3 * Routines for Amateur Packet Radio protocol dissection
4 * Copyright 2005,2006,2007,2008,2009,2010,2012 R.W. Stearn <richard@rns-stearn.demon.co.uk>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
14 * Information on the protocol drawn from:
16 * Inspiration on how to build the dissector drawn from
22 * with the base file built from README.developers.
27 #include <epan/packet.h>
28 #include <epan/ax25_pids.h>
30 void proto_register_flexnet(void);
31 void proto_reg_handoff_flexnet(void);
33 static dissector_handle_t flexnet_handle
;
35 #define FLEXNET_ADRLEN 15
36 #define FLEXNET_CTLLEN 15
37 #define FLEXNET_HDRLEN (FLEXNET_ADRLEN + FLEXNET_ADRLEN + FLEXNET_CTLLEN)
39 static int proto_flexnet
;
40 static int hf_flexnet_dst
;
41 static int hf_flexnet_src
;
42 static int hf_flexnet_ctl
;
44 static int ett_flexnet
;
45 static int ett_flexnet_ctl
;
48 dissect_flexnet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*parent_tree
, void* data _U_
)
52 col_set_str( pinfo
->cinfo
, COL_PROTOCOL
, "Flexnet");
53 col_clear( pinfo
->cinfo
, COL_INFO
);
58 proto_tree
*flexnet_tree
;
61 /* create display subtree for the protocol */
63 ti
= proto_tree_add_protocol_format( parent_tree
, proto_flexnet
, tvb
, 0, FLEXNET_HDRLEN
, "FLEXNET" );
65 flexnet_tree
= proto_item_add_subtree( ti
, ett_flexnet
);
69 proto_tree_add_item( flexnet_tree
, hf_flexnet_dst
, tvb
, offset
, FLEXNET_ADRLEN
, ENC_NA
);
70 offset
+=FLEXNET_ADRLEN
;
72 proto_tree_add_item( flexnet_tree
, hf_flexnet_src
, tvb
, offset
, FLEXNET_ADRLEN
, ENC_NA
);
73 offset
+=FLEXNET_ADRLEN
;
75 proto_tree_add_item( flexnet_tree
, hf_flexnet_ctl
, tvb
, offset
, FLEXNET_CTLLEN
, ENC_NA
);
76 /* offset +=FLEXNET_CTLLEN; */
79 /* Call sub-dissectors here */
81 next_tvb
= tvb_new_subset_remaining(tvb
, FLEXNET_HDRLEN
);
82 call_data_dissector(next_tvb
, pinfo
, parent_tree
);
83 return tvb_captured_length(tvb
);
87 proto_register_flexnet(void)
89 /* Setup list of header fields */
90 static hf_register_info hf
[] = {
92 { "Destination", "flexnet.dst",
93 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
94 "Destination address", HFILL
}
97 { "Source", "flexnet.src",
98 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
99 "Source address", HFILL
}
102 { "Control", "flexnet.ctl",
103 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
108 /* Setup protocol subtree array */
109 static int *ett
[] = {
114 /* Register the protocol name and description */
115 proto_flexnet
= proto_register_protocol("FlexNet", "FLEXNET", "flexnet");
117 /* Required function calls to register the header fields and subtrees used */
118 proto_register_field_array( proto_flexnet
, hf
, array_length( hf
) );
119 proto_register_subtree_array( ett
, array_length( ett
) );
121 flexnet_handle
= register_dissector( "flexnet", dissect_flexnet
, proto_flexnet
);
125 proto_reg_handoff_flexnet(void)
127 dissector_add_uint( "ax25.pid", AX25_P_FLEXNET
, flexnet_handle
);
131 * Editor modelines - https://www.wireshark.org/tools/modelines.html
136 * indent-tabs-mode: t
139 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
140 * :indentSize=8:tabSize=8:noTabs=false: