forked from osmocom/wireshark
Compare commits
7 Commits
master
...
thomas/dec
Author | SHA1 | Date |
---|---|---|
thomasDOTwtf | c052d13562 | |
thomasDOTwtf | 3c9119baae | |
thomasDOTwtf | 7829684cba | |
Harald Welte | d9a42f5147 | |
Harald Welte | 442f621017 | |
Harald Welte | cb64efe0d1 | |
Harald Welte | 2a22e1f13f |
|
@ -896,6 +896,9 @@ set(DISSECTOR_SRC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/packet-dec-bpdu.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-dec-dnart.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-dect.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-dect-aastra.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-dect-dlc.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-dect-nwk.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-devicenet.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-dhcp.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-dhcp-failover.c
|
||||
|
|
|
@ -0,0 +1,252 @@
|
|||
/* packet-dect_aastra.c
|
||||
*
|
||||
* Dissector for the proprietary protocol of the internal ethernet link
|
||||
* between DECT burst processor and ARM processor in Aastra/Mitel DECT
|
||||
* base stations.
|
||||
*
|
||||
* Copyright 2018 by Harald Welte <laforge@gnumonks.org>
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <epan/packet.h>
|
||||
|
||||
static int proto_dect_aastra = -1;
|
||||
|
||||
static gint hf_aamide_len = -1;
|
||||
static gint hf_xdlc_prim_type = -1;
|
||||
static gint hf_xdlc_mcei = -1;
|
||||
static gint hf_xdlc_info_string = -1;
|
||||
static gint hf_xdlc_pmid = -1;
|
||||
static gint hf_xdlc_subfield = -1;
|
||||
|
||||
static gint ett_aamide = -1;
|
||||
|
||||
static dissector_handle_t data_handle;
|
||||
static dissector_handle_t dlc_handle;
|
||||
|
||||
#define AAMIDE_ETH_T_XDLC 0xA000
|
||||
#define AAMIDE_ETH_T_DOWNLOAD 0xA002
|
||||
#define AAMIDE_ETH_T_VIDEO 0xA003
|
||||
#define AAMIDE_ETH_T_AUDIOLOG 0xA004
|
||||
|
||||
enum aamide_prim_type {
|
||||
AAMIDE_P_MAC_CON_IND = 0x01,
|
||||
AAMIDE_P_MAC_DIS_REQ = 0x02,
|
||||
AAMIDE_P_MAC_DIS_IND = 0x03,
|
||||
AAMIDE_P_LC_DATA_REQ = 0x05,
|
||||
AAMIDE_P_LC_DATA_IND = 0x06,
|
||||
AAMIDE_P_LC_DTR_IND = 0x07,
|
||||
AAMIDE_P_MAC_PAGE_REQ = 0x08,
|
||||
AAMIDE_P_MAC_ENC_KEY_REQ = 0x09,
|
||||
AAMIDE_P_MAC_ENC_EKS_IND = 0x0a,
|
||||
AAMIDE_P_HO_IN_PROGRESS_IND = 0x0b,
|
||||
AAMIDE_P_HO_IN_PROGRESS_RES = 0x0c,
|
||||
AAMIDE_P_HO_FAILED_IND = 0x0d,
|
||||
AAMIDE_P_HO_FAILED_REQ = 0x0e,
|
||||
AAMIDE_P_DLC_RFP_ERROR_IND = 0x14,
|
||||
AAMIDE_P_MAC_CON_EXT_IND = 0x15,
|
||||
AAMIDE_P_HO_IN_PROGRESS_EXT_IND = 0x16,
|
||||
AAMIDE_P_MAC_MOD_REQ = 0x17,
|
||||
AAMIDE_P_MAC_MOD_CNF = 0x18,
|
||||
AAMIDE_P_MAC_MOD_IND = 0x19,
|
||||
AAMIDE_P_MAC_MOD_REJ = 0x1a,
|
||||
AAMIDE_P_MAC_RECORD_AUDIO = 0x1b,
|
||||
AAMIDE_P_MAC_INFO_IND = 0x1c,
|
||||
AAMIDE_P_MAC_GET_DEF_CKEY_IND = 0x1d,
|
||||
AAMIDE_P_MAC_GET_DEF_CKEY_RES = 0x1e,
|
||||
AAMIDE_P_MAC_CLEAR_DEF_CKEY_REQ = 0x1f,
|
||||
AAMIDE_P_MAC_GET_CURR_CKEY_ID_REQ = 0x20,
|
||||
AAMIDE_P_MAC_GET_CURR_CKEY_ID_CNF = 0x21,
|
||||
};
|
||||
|
||||
|
||||
static const value_string xdlc_prim_names[] = {
|
||||
{ AAMIDE_P_MAC_CON_IND, "MAC_CON_IND" },
|
||||
{ AAMIDE_P_MAC_DIS_REQ, "MAC_DIS_REQ" },
|
||||
{ AAMIDE_P_MAC_DIS_IND, "MAC_DIS_IND" },
|
||||
{ AAMIDE_P_LC_DATA_REQ, "LC_DATA_REQ" },
|
||||
{ AAMIDE_P_LC_DATA_IND, "LC_DATA_IND" },
|
||||
{ AAMIDE_P_LC_DTR_IND, "LC_DTR_IND" },
|
||||
{ AAMIDE_P_MAC_PAGE_REQ, "MAC_PAGE_REQ" },
|
||||
{ AAMIDE_P_MAC_ENC_KEY_REQ, "MAC_ENC_KEY_REQ" },
|
||||
{ AAMIDE_P_MAC_ENC_EKS_IND, "MAC_ENC_EKS_IND" },
|
||||
{ AAMIDE_P_HO_IN_PROGRESS_IND, "HO_IN_PROGRRESS_IND" },
|
||||
{ AAMIDE_P_HO_IN_PROGRESS_RES, "HO_IN_PROGRERSS_RES" },
|
||||
{ AAMIDE_P_HO_FAILED_IND, "HO_FAILED_IND" },
|
||||
{ AAMIDE_P_HO_FAILED_REQ, "HO_FAILED_REQ" },
|
||||
{ AAMIDE_P_DLC_RFP_ERROR_IND, "RFP_ERROR_IND" },
|
||||
{ AAMIDE_P_MAC_CON_EXT_IND, "MAC_CON_EXT_IND" },
|
||||
{ AAMIDE_P_HO_IN_PROGRESS_EXT_IND, "HO_IN_PROGRESS_EXT_IND" },
|
||||
{ AAMIDE_P_MAC_MOD_REQ, "MAC_MOD_REQ" },
|
||||
{ AAMIDE_P_MAC_MOD_CNF, "MAC_MOD_CNF" },
|
||||
{ AAMIDE_P_MAC_MOD_IND, "MAC_MOD_IND" },
|
||||
{ AAMIDE_P_MAC_MOD_REQ, "MAC_MOD_REQ" },
|
||||
{ AAMIDE_P_MAC_RECORD_AUDIO, "MAC_RECORD_AUDIO" },
|
||||
{ AAMIDE_P_MAC_INFO_IND, "MAC_INFO_IND" },
|
||||
{ AAMIDE_P_MAC_GET_DEF_CKEY_IND, "MAC_GET_DEF_CKEY_IND" },
|
||||
{ AAMIDE_P_MAC_GET_DEF_CKEY_RES, "MAC_GET_DEF_CKEY_RES" },
|
||||
{ AAMIDE_P_MAC_CLEAR_DEF_CKEY_REQ, "MAC_CLEAR_DEF_CKEY_REQ" },
|
||||
{ AAMIDE_P_MAC_GET_CURR_CKEY_ID_REQ, "MAC_GET_CURR_CKEY_ID_REQ"},
|
||||
{ AAMIDE_P_MAC_GET_CURR_CKEY_ID_CNF, "MAC_GET_CURR_CKEY_ID_CNF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const value_string xdlc_subfield_names[] = {
|
||||
{ 0x00, "B0" },
|
||||
{ 0x10, "B1" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static int dissect_aamide_xdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
||||
{
|
||||
guint16 aamide_len, payload_len;
|
||||
guint8 prim_type, mcei;
|
||||
int offset = 0;
|
||||
tvbuff_t *payload_tvb = NULL;
|
||||
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AA-XDLC");
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
|
||||
aamide_len = tvb_get_guint16(tvb, offset, 2);
|
||||
proto_tree_add_item(tree, hf_aamide_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
offset += 2;
|
||||
|
||||
if (aamide_len < 3)
|
||||
return tvb_captured_length(tvb);
|
||||
|
||||
prim_type = tvb_get_guint8(tvb, offset+3);
|
||||
proto_tree_add_item(tree, hf_xdlc_prim_type, tvb, offset+3, 1, ENC_NA);
|
||||
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
|
||||
val_to_str(prim_type, xdlc_prim_names, "Unknown 0x%02x"));
|
||||
|
||||
switch (prim_type) {
|
||||
case AAMIDE_P_MAC_PAGE_REQ:
|
||||
payload_len = tvb_get_guint8(tvb, offset+4);
|
||||
payload_tvb = tvb_new_subset_length(tvb, offset+5, payload_len);
|
||||
break;
|
||||
case AAMIDE_P_MAC_CON_IND:
|
||||
mcei = tvb_get_guint8(tvb, offset+4);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "MCEI=%02x ", mcei);
|
||||
proto_tree_add_item(tree, hf_xdlc_mcei, tvb, offset+4, 1, ENC_NA);
|
||||
proto_tree_add_item(tree, hf_xdlc_pmid, tvb, offset+6, 2, ENC_BIG_ENDIAN);
|
||||
break;
|
||||
case AAMIDE_P_MAC_INFO_IND:
|
||||
mcei = tvb_get_guint8(tvb, offset+4);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "MCEI=%02x ", mcei);
|
||||
proto_tree_add_item(tree, hf_xdlc_mcei, tvb, offset+4, 1, ENC_NA);
|
||||
/* from offset 9 onwards, there's a null-terminated string */
|
||||
proto_tree_add_item(tree, hf_xdlc_info_string, tvb, offset+9,
|
||||
tvb_captured_length_remaining(tvb, offset+9), ENC_ASCII|ENC_NA);
|
||||
break;
|
||||
case AAMIDE_P_MAC_DIS_REQ:
|
||||
case AAMIDE_P_MAC_DIS_IND:
|
||||
mcei = tvb_get_guint8(tvb, offset+4);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "MCEI=%02x ", mcei);
|
||||
proto_tree_add_item(tree, hf_xdlc_mcei, tvb, offset+4, 1, ENC_NA);
|
||||
break;
|
||||
case AAMIDE_P_LC_DTR_IND:
|
||||
mcei = tvb_get_guint8(tvb, offset+4);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "MCEI=%02x ", mcei);
|
||||
proto_tree_add_item(tree, hf_xdlc_mcei, tvb, offset+4, 1, ENC_NA);
|
||||
proto_tree_add_item(tree, hf_xdlc_subfield, tvb, offset+5, 1, ENC_NA);
|
||||
break;
|
||||
case AAMIDE_P_LC_DATA_REQ:
|
||||
case AAMIDE_P_LC_DATA_IND:
|
||||
mcei = tvb_get_guint8(tvb, offset+4);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "MCEI=%02x ", mcei);
|
||||
proto_tree_add_item(tree, hf_xdlc_mcei, tvb, offset+4, 1, ENC_NA);
|
||||
proto_tree_add_item(tree, hf_xdlc_subfield, tvb, offset+5, 1, ENC_NA);
|
||||
payload_len = tvb_get_guint8(tvb, offset+6);
|
||||
payload_len = tvb_get_guint8(tvb, offset+6);
|
||||
payload_tvb = tvb_new_subset_length(tvb, offset+7, payload_len);
|
||||
if (payload_tvb)
|
||||
call_dissector(dlc_handle, payload_tvb, pinfo, tree);
|
||||
payload_tvb = NULL;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (payload_tvb)
|
||||
call_dissector(data_handle, payload_tvb, pinfo, tree);
|
||||
|
||||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
||||
void proto_register_dect_aastra(void)
|
||||
{
|
||||
|
||||
static hf_register_info hf[] =
|
||||
{
|
||||
{ &hf_aamide_len,
|
||||
{ "Length", "aamide.length", FT_UINT16, BASE_DEC,
|
||||
NULL, 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_xdlc_prim_type,
|
||||
{ "Primitive Type", "aamide.prim", FT_UINT8, BASE_HEX,
|
||||
VALS(xdlc_prim_names), 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_xdlc_mcei,
|
||||
{ "MCEI", "aamide.mcei", FT_UINT8, BASE_HEX,
|
||||
NULL, 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_xdlc_info_string,
|
||||
{ "MAC Info String", "aamide.mac_info_str", FT_STRING, BASE_NONE,
|
||||
NULL, 0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_xdlc_pmid,
|
||||
{ "PMID", "aamide.pmid", FT_UINT16, BASE_HEX,
|
||||
NULL, 0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_xdlc_subfield,
|
||||
{ "Subfield", "aamide.subfield", FT_UINT8, BASE_HEX,
|
||||
VALS(xdlc_subfield_names), 0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
static gint *ett[] = {
|
||||
&ett_aamide,
|
||||
};
|
||||
|
||||
/* Register protocol */
|
||||
proto_dect_aastra = proto_register_protocol("Aastra/Mitel DECT-over-Etehernet XDLC", "DECToE-XDLC", "aamide");
|
||||
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
proto_register_field_array(proto_dect_aastra, hf, array_length(hf));
|
||||
}
|
||||
|
||||
void proto_reg_handoff_dect_aastra(void)
|
||||
{
|
||||
dissector_handle_t xdlc_handle =
|
||||
create_dissector_handle(dissect_aamide_xdlc, proto_dect_aastra);
|
||||
dissector_add_uint("ethertype", AAMIDE_ETH_T_XDLC, xdlc_handle);
|
||||
|
||||
data_handle = find_dissector("data");
|
||||
dlc_handle = find_dissector("dect_dlc");
|
||||
}
|
||||
|
||||
/*
|
||||
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
||||
*
|
||||
* Local variables:
|
||||
* c-basic-offset: 8
|
||||
* tab-width: 8
|
||||
* indent-tabs-mode: t
|
||||
* End:
|
||||
*
|
||||
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
||||
* :indentSize=8:tabSize=8:noTabs=false:
|
||||
*/
|
|
@ -0,0 +1,294 @@
|
|||
/* packet-dect-dlc.c
|
||||
*
|
||||
* Dissector for the DECT (Digital Enhanced Cordless Telecommunications)
|
||||
* DLC protocol layer as described in ETSI EN 300 175-4 V2.7.1 (2017-11)
|
||||
*
|
||||
* DLC is sometimes also called LAPC, which is a derivative of LAPDm (GSM),
|
||||
* which is a derivative of LAPD (ISDN).
|
||||
*
|
||||
* Copyright 2018 by Harald Welte <laforge@gnumonks.org>
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <epan/packet.h>
|
||||
#include <epan/prefs.h>
|
||||
#include <epan/xdlc.h>
|
||||
|
||||
static int proto_dect_dlc = -1;
|
||||
|
||||
static gint hf_dlc_address = -1;
|
||||
static gint hf_dlc_nlf = -1;
|
||||
static gint hf_dlc_lln = -1;
|
||||
static gint hf_dlc_sapi = -1;
|
||||
static gint hf_dlc_cr = -1;
|
||||
|
||||
static int hf_dlc_control = -1;
|
||||
static int hf_dlc_n_r = -1;
|
||||
static int hf_dlc_n_s = -1;
|
||||
static int hf_dlc_p = -1;
|
||||
static int hf_dlc_f = -1;
|
||||
static int hf_dlc_s_ftype = -1;
|
||||
static int hf_dlc_u_modifier_cmd = -1;
|
||||
static int hf_dlc_u_modifier_resp = -1;
|
||||
static int hf_dlc_ftype_i = -1;
|
||||
static int hf_dlc_ftype_s_u = -1;
|
||||
|
||||
static int hf_dlc_length = -1;
|
||||
static int hf_dlc_el = -1;
|
||||
static int hf_dlc_m = -1;
|
||||
static int hf_dlc_len = -1;
|
||||
|
||||
static gint ett_dect_dlc = -1;
|
||||
static gint ett_dect_dlc_address = -1;
|
||||
static gint ett_dect_dlc_control = -1;
|
||||
static gint ett_dect_dlc_length = -1;
|
||||
|
||||
static dissector_handle_t data_handle;
|
||||
|
||||
static dissector_table_t dlc_sapi_dissector_table;
|
||||
|
||||
|
||||
static const xdlc_cf_items dlc_cf_items = {
|
||||
&hf_dlc_n_r,
|
||||
&hf_dlc_n_s,
|
||||
&hf_dlc_p,
|
||||
&hf_dlc_f,
|
||||
&hf_dlc_s_ftype,
|
||||
&hf_dlc_u_modifier_cmd,
|
||||
&hf_dlc_u_modifier_resp,
|
||||
&hf_dlc_ftype_i,
|
||||
&hf_dlc_ftype_s_u
|
||||
};
|
||||
|
||||
static const value_string dlc_sapi_vals[] = {
|
||||
{ 0, "Connection oriented signalling" },
|
||||
{ 3, "Connectionless signalling" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const value_string dlc_lln_vals[] = {
|
||||
{ 0, "U0" },
|
||||
{ 1, "A1" },
|
||||
{ 2, "B2" },
|
||||
{ 3, "B3" },
|
||||
{ 4, "B4" },
|
||||
{ 5, "B5" },
|
||||
{ 6, "B6" },
|
||||
{ 7, "unassigned" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const value_string dlc_m_vals[] = {
|
||||
{ 0, "Last segment" },
|
||||
{ 1, "More segments" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const value_string dlc_el_vals[] = {
|
||||
{ 0, "More octets" },
|
||||
{ 1, "Final octet" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
|
||||
static int dissect_dect_dlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void _U_ *data)
|
||||
{
|
||||
proto_tree *dlc_tree, *addr_tree, *length_tree;
|
||||
proto_item *dlc_ti, *addr_ti, *length_ti;
|
||||
gboolean is_response = FALSE;
|
||||
int available_length;
|
||||
tvbuff_t *payload;
|
||||
guint8 cr, sapi, length, len;
|
||||
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DECT-DLC");
|
||||
|
||||
cr = tvb_get_guint8(tvb, 0) & 0x02;
|
||||
if (pinfo->p2p_dir == P2P_DIR_RECV)
|
||||
is_response = cr ? FALSE : TRUE;
|
||||
else if (pinfo->p2p_dir == P2P_DIR_SENT)
|
||||
is_response = cr ? TRUE : FALSE;
|
||||
|
||||
dlc_ti = proto_tree_add_item(tree, proto_dect_dlc, tvb, 0, 3, ENC_NA);
|
||||
dlc_tree = proto_item_add_subtree(dlc_ti, ett_dect_dlc);
|
||||
|
||||
addr_ti = proto_tree_add_item(dlc_tree, hf_dlc_address, tvb, 0, 1, ENC_NA);
|
||||
addr_tree = proto_item_add_subtree(addr_ti, ett_dect_dlc_address);
|
||||
|
||||
sapi = (tvb_get_guint8(tvb, 0) & 0x0C) >> 2;
|
||||
proto_tree_add_item(addr_tree, hf_dlc_nlf, tvb, 0, 1, ENC_NA);
|
||||
proto_tree_add_item(addr_tree, hf_dlc_lln, tvb, 0, 1, ENC_NA);
|
||||
proto_tree_add_item(addr_tree, hf_dlc_sapi, tvb, 0, 1, ENC_NA);
|
||||
proto_tree_add_item(addr_tree, hf_dlc_cr, tvb, 0, 1, ENC_NA);
|
||||
|
||||
dissect_xdlc_control(tvb, 1, pinfo, dlc_tree, hf_dlc_control,
|
||||
ett_dect_dlc_control, &dlc_cf_items, NULL, NULL, NULL,
|
||||
is_response, FALSE, FALSE);
|
||||
|
||||
length_ti = proto_tree_add_item(dlc_tree, hf_dlc_length, tvb, 2, 1, ENC_NA);
|
||||
length_tree = proto_item_add_subtree(length_ti, ett_dect_dlc_length);
|
||||
length = tvb_get_guint8(tvb, 2);
|
||||
proto_tree_add_uint(length_tree, hf_dlc_len, tvb, 2, 1, length);
|
||||
proto_tree_add_uint(length_tree, hf_dlc_m, tvb, 2, 1, length);
|
||||
proto_tree_add_uint(length_tree, hf_dlc_el, tvb, 2, 1, length);
|
||||
len = length >> 2;
|
||||
|
||||
available_length = tvb_captured_length(tvb) - 3;
|
||||
if (available_length > 0) {
|
||||
payload = tvb_new_subset_length_caplen(tvb, 3, MIN(len, available_length), len);
|
||||
|
||||
/* FIXME: fragment reassembly like in packet-lapdm.c */
|
||||
|
||||
if (!dissector_try_uint(dlc_sapi_dissector_table, sapi, payload, pinfo, tree))
|
||||
call_data_dissector(payload, pinfo, tree);
|
||||
}
|
||||
|
||||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
||||
void proto_register_dect_dlc(void)
|
||||
{
|
||||
static hf_register_info hf[] =
|
||||
{
|
||||
{ &hf_dlc_address,
|
||||
{ "Address Field", "dect_dlc.address_field", FT_UINT8, BASE_HEX,
|
||||
NULL, 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_nlf,
|
||||
{ "NLF", "dect_dlc.nlf", FT_UINT8, BASE_DEC,
|
||||
NULL, 0x80, "New Link Flag", HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_lln,
|
||||
{ "LLN", "dect_dlc.lln", FT_UINT8, BASE_DEC,
|
||||
VALS(dlc_lln_vals), 0x70, "Logical Link Number", HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_sapi,
|
||||
{ "SAPI", "dect_dlc.sapi", FT_UINT8, BASE_DEC,
|
||||
VALS(dlc_sapi_vals), 0x0C, "Service Access Point Identifier", HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_cr,
|
||||
{ "C/R", "dect_dlc.cr", FT_UINT8, BASE_DEC,
|
||||
NULL, 0x02, "Command/Response field bit", HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_control,
|
||||
{ "Control Field", "dect_dlc.control_field", FT_UINT8, BASE_HEX,
|
||||
NULL, 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_n_r,
|
||||
{ "N(R)", "dect_dlc.control.n_r", FT_UINT8, BASE_DEC,
|
||||
NULL, 0xE0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_n_s,
|
||||
{ "N(S)", "dect_dlc.control.n_s", FT_UINT8, BASE_DEC,
|
||||
NULL, 0x0E, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_p,
|
||||
{ "Poll", "dect_dlc.control.p", FT_BOOLEAN, 8,
|
||||
TFS(&tfs_true_false), 0x10, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_f,
|
||||
{ "Final", "dect_dlc.control.f", FT_BOOLEAN, 8,
|
||||
TFS(&tfs_true_false), 0x10, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_s_ftype,
|
||||
{ "Supervisory frame type", "dect_dlc.control.s_ftype", FT_UINT8, BASE_HEX,
|
||||
VALS(stype_vals), XDLC_S_FTYPE_MASK, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_u_modifier_cmd,
|
||||
{ "Command", "dect_dlc.control.u_modifier_cmd", FT_UINT8, BASE_HEX,
|
||||
VALS(modifier_vals_cmd), XDLC_U_MODIFIER_MASK, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_u_modifier_resp,
|
||||
{ "Response", "dect_dlc.control.u_modifier_resp", FT_UINT8, BASE_HEX,
|
||||
VALS(modifier_vals_resp), XDLC_U_MODIFIER_MASK, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_ftype_i,
|
||||
{ "Frame type", "dect_dlc.control.ftype", FT_UINT8, BASE_HEX,
|
||||
VALS(ftype_vals), XDLC_I_MASK, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_ftype_s_u,
|
||||
{ "Frame type", "dect_dlc.control.ftype", FT_UINT8, BASE_HEX,
|
||||
VALS(ftype_vals), XDLC_S_U_MASK, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_length,
|
||||
{ "Length Field", "dect_dlc.length_field", FT_UINT8, BASE_HEX,
|
||||
NULL, 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_el,
|
||||
{ "EL", "dect_dlc.el", FT_UINT8, BASE_DEC,
|
||||
VALS(dlc_el_vals), 0x01, "Length indicator field extension bit", HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_m,
|
||||
{ "M", "dect_dlc.m", FT_UINT8, BASE_DEC,
|
||||
VALS(dlc_m_vals), 0x02, "More data bit", HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_dlc_len,
|
||||
{ "Length", "dect_dlc.length", FT_UINT8, BASE_DEC,
|
||||
NULL, 0xFC, "LEngth indicator", HFILL
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
static gint *ett[] = {
|
||||
&ett_dect_dlc,
|
||||
&ett_dect_dlc_address,
|
||||
&ett_dect_dlc_control,
|
||||
&ett_dect_dlc_length,
|
||||
};
|
||||
|
||||
/* Register protocol */
|
||||
proto_dect_dlc = proto_register_protocol("DECT DLC (LAPC)", "DECT-DLC", "dect_dlc");
|
||||
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
proto_register_field_array(proto_dect_dlc, hf, array_length(hf));
|
||||
|
||||
register_dissector("dect_dlc", dissect_dect_dlc, proto_dect_dlc);
|
||||
|
||||
dlc_sapi_dissector_table = register_dissector_table("dect_dlc.sapi", "DECT DLC SAPI", proto_dect_dlc, FT_UINT8, BASE_DEC);
|
||||
|
||||
data_handle = find_dissector("data");
|
||||
}
|
||||
|
||||
#if 0
|
||||
void proto_reg_handoff_dect_aastra(void)
|
||||
{
|
||||
dissector_handle_t dlc_handle = create_dissector_handle(dissect_aamide_xdlc, proto_dect_dlc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
||||
*
|
||||
* Local variables:
|
||||
* c-basic-offset: 8
|
||||
* tab-width: 8
|
||||
* indent-tabs-mode: t
|
||||
* End:
|
||||
*
|
||||
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
||||
* :indentSize=8:tabSize=8:noTabs=false:
|
||||
*/
|
|
@ -0,0 +1,623 @@
|
|||
/* packet-dect_nwk.c
|
||||
*
|
||||
* Dissector for the DECT (Digital Enhanced Cordless Telecommunications)
|
||||
* NWK protocol layer as described in ETSI EN 300 175-5 V2.7.1 (2017-11)
|
||||
*
|
||||
* Copyright 2018 by Harald Welte <laforge@gnumonks.org>
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <epan/packet.h>
|
||||
|
||||
static int proto_dect_nwk = -1;
|
||||
|
||||
static gint hf_nwk_ti = -1;
|
||||
static gint hf_nwk_pdisc = -1;
|
||||
static gint hf_nwk_msg_type_lce = -1;
|
||||
static gint hf_nwk_msg_type_cc = -1;
|
||||
static gint hf_nwk_msg_type_mm = -1;
|
||||
|
||||
static gint ett_dect_nwk = -1;
|
||||
static gint ett_dect_nwk_ie = -1;
|
||||
|
||||
static gint hf_nwk_ie_var_type = -1;
|
||||
//static gint hf_nwk_ie_fix_single_type = -1;
|
||||
//static gint hf_nwk_ie_fix_double_type = -1;
|
||||
static gint hf_nwk_ie_len = -1;
|
||||
|
||||
static dissector_handle_t dect_nwk_handle;
|
||||
|
||||
/*********************************************************************************
|
||||
* DECT DEFINITIONS
|
||||
*********************************************************************************/
|
||||
|
||||
/* Section 7.2 */
|
||||
enum dect_nwk_proto_disc {
|
||||
DECT_NWK_PDISC_LCE = 0x0,
|
||||
DECT_NWK_PDISC_CC = 0x3,
|
||||
DECT_NWK_PDISC_CISS = 0x4,
|
||||
DECT_NWK_PDISC_MM = 0x5,
|
||||
DECT_NWK_PDISC_CMSS = 0x6,
|
||||
DECT_NWK_PDISC_COMS = 0x7,
|
||||
};
|
||||
|
||||
/* Section 7.4.1 */
|
||||
enum dect_nwk_cc_msg_type {
|
||||
DECT_NWK_CC_ALERTING = 0x01,
|
||||
DECT_NWK_CC_CALL_PROC = 0x02,
|
||||
DECT_NWK_CC_SETUP = 0x05,
|
||||
DECT_NWK_CC_CONNECT = 0x07,
|
||||
DECT_NWK_CC_SETUP_ACK = 0x0d,
|
||||
DECT_NWK_CC_CONNECT_ACK = 0x0f,
|
||||
DECT_NWK_CC_SERVICE_CHANGE = 0x20,
|
||||
DECT_NWK_CC_SERVICE_ACCEPT = 0x21,
|
||||
DECT_NWK_CC_SERVICE_REJECT = 0x23,
|
||||
DECT_NWK_CC_RELEASE = 0x4d,
|
||||
DECT_NWK_CC_RELEASE_COM = 0x5a,
|
||||
DECT_NWK_CC_IWU_INFO = 0x60,
|
||||
DECT_NWK_CC_NOTIFY = 0x6e,
|
||||
DECT_NWK_CC_INFO = 0x7b,
|
||||
};
|
||||
|
||||
/* Section 7.4.2 */
|
||||
enum dect_nwk_ss_msg_type {
|
||||
DECT_NWK_SS_CISS_RELEASE_COM = 0x5a,
|
||||
DECT_NWK_SS_CISS_FACILITY = 0x62,
|
||||
DECT_NWK_SS_CISS_REGISTER = 0x64,
|
||||
|
||||
DECT_NWK_SS_CRSS_HOLD = 0x24,
|
||||
DECT_NWK_SS_CRSS_HOLD_ACK = 0x28,
|
||||
DECT_NWK_SS_CRSS_HOLD_REJ = 0x30,
|
||||
DECT_NWK_SS_CRSS_RETRIEVE = 0x31,
|
||||
DECT_NWK_SS_CRSS_RETRIEVE_ACK = 0x33,
|
||||
DECT_NWK_SS_CRSS_RETRIEVE_REJ = 0x37,
|
||||
#define DECT_NWK_SS_CRSS_FACILITY DECT_NWK_SS_CISS_FACILITY
|
||||
};
|
||||
|
||||
/* Section 7.4.3 */
|
||||
enum dect_nwk_coms_msg_type {
|
||||
DECT_NWK_COMS_SETUP = 0x05,
|
||||
DECT_NWK_COMS_CONNECT = 0x07,
|
||||
DECT_NWK_COMS_NOTIFY = 0x08,
|
||||
DECT_NWK_COMS_RELEASE = 0x4d,
|
||||
DECT_NWK_COMS_RELEASE_COM = 0x5a,
|
||||
DECT_NWK_COMS_INFO = 0x7b,
|
||||
DECT_NWK_COMS_ACK = 0x78,
|
||||
};
|
||||
|
||||
/* Section 7.4.4 */
|
||||
enum dect_nwk_clms_msg_type {
|
||||
DECT_NWK_CLMS_VARIABLE = 0x01,
|
||||
};
|
||||
|
||||
/* Section 7.4.5 */
|
||||
enum dect_nwk_mm_msg_type {
|
||||
DECT_NWK_MM_AUTH_REQ = 0x40,
|
||||
DECT_NWK_MM_AUTH_REPLY = 0x41,
|
||||
DECT_NWK_MM_KEY_ALLOC = 0x42,
|
||||
DECT_NWK_MM_AUTH_REJ = 0x43,
|
||||
DECT_NWK_MM_ACC_RIGHTS_REQ = 0x44,
|
||||
DECT_NWK_MM_ACC_RIGHTS_ACK = 0x45,
|
||||
DECT_NWK_MM_ACC_RIGHTS_REJ = 0x47,
|
||||
DECT_NWK_MM_ACC_RIGHTS_TERM_REQ = 0x48,
|
||||
DECT_NWK_MM_ACC_RIGHTS_TERM_ACK = 0x49,
|
||||
DECT_NWK_MM_ACC_RIGHTS_TERM_REJ = 0x4b,
|
||||
DECT_NWK_MM_CIPH_REQ = 0x4c,
|
||||
DECT_NWK_MM_CIPH_SUGGEST = 0x4e,
|
||||
DECT_NWK_MM_CIPH_REJ = 0x4f,
|
||||
DECT_NWK_MM_INFO_REQ = 0x50,
|
||||
DECT_NWK_MM_INFO_ACK = 0x51,
|
||||
DECT_NWK_MM_INFO_SUGGEST = 0x52,
|
||||
DECT_NWK_MM_INFO_REJ = 0x53,
|
||||
DECT_NWK_MM_LOCATE_REQ = 0x54,
|
||||
DECT_NWK_MM_LOCATE_ACK = 0x55,
|
||||
DECT_NWK_MM_DETACH = 0x56,
|
||||
DECT_NWK_MM_LOCATE_REJ = 0x57,
|
||||
DECT_NWK_MM_ID_REQ = 0x58,
|
||||
DECT_NWK_MM_ID_REPLY = 0x59,
|
||||
DECT_NWK_MM_IWU = 0x5b,
|
||||
DECT_NWK_MM_TID_ASSIGN = 0x5c,
|
||||
DECT_NWK_MM_TID_ASSIGN_ACK = 0x5d,
|
||||
DECT_NWK_MM_TID_ASSIGN_REJ = 0x5f,
|
||||
DECT_NWK_MM_NOTIFY = 0x6e,
|
||||
};
|
||||
|
||||
/* Section 7.4.6 */
|
||||
enum dect_nwk_lce_msg_type {
|
||||
DECT_NWK_LCE_PAGE_RESP = 0x71,
|
||||
DECT_NWK_LCE_PAGE_REJ = 0x72,
|
||||
};
|
||||
|
||||
/* Section 7.6.1 */
|
||||
enum dect_nwk_info_fix_single_type {
|
||||
DECT_NWK_INFO_FIX_SHIFT = 0x90,
|
||||
DECT_NWK_INFO_FIX_SEND_COMPLETE = 0xa1,
|
||||
DECT_NWK_INFO_FIX_DELIMITER_REQ = 0xa2,
|
||||
DECT_NWK_INFO_FIX_USE_TPUI = 0xa3,
|
||||
DECT_NWK_INFO_FIX_REPEAT_IND = 0xd0,
|
||||
DECT_NWK_DOUBLE_OCTET_ELEMENT = 0xe0,
|
||||
};
|
||||
|
||||
enum dect_nwk_info_fix_double_type {
|
||||
DECT_NWK_INFO_FIX_BASIC_SVC = 0xe0,
|
||||
DECT_NWK_INFO_FIX_REL_REASON = 0xe2,
|
||||
DECT_NWK_INFO_FIX_SIGNAL = 0xe4,
|
||||
DECT_NWK_INFO_FIX_TIMER_RESTART = 0xe5,
|
||||
DECT_NWK_INFO_FIX_TEST_HOOK_C = 0xe6,
|
||||
DECT_NWK_INFO_FIX_SINGLE_DISP = 0xe8,
|
||||
DECT_NWK_INFO_FIX_SINGLE_KEYPAD = 0xe9,
|
||||
DECT_NWK_INFO_FIX_RESERVED = 0xef,
|
||||
};
|
||||
|
||||
/* Section 7.7.1 */
|
||||
enum dect_nwk_info_var_type {
|
||||
DECT_NWK_INFO_VAR_INFO_TYPE = 0x01,
|
||||
DECT_NWK_INFO_VAR_IDENTITY_TYPE = 0x02,
|
||||
DECT_NWK_INFO_VAR_PORTABLE_ID = 0x05,
|
||||
DECT_NWK_INFO_VAR_FIXED_ID = 0x06,
|
||||
DECT_NWK_INFO_VAR_LOC_AREA = 0x07,
|
||||
DECT_NWK_INFO_VAR_NWK_ID = 0x08,
|
||||
DECT_NWK_INFO_VAR_AUTH_TYPE = 0x0a,
|
||||
DECT_NWK_INFO_VAR_ALLOC_TYPE = 0x0b,
|
||||
DECT_NWK_INFO_VAR_RAND = 0x0c,
|
||||
DECT_NWK_INFO_VAR_RES = 0x0d,
|
||||
DECT_NWK_INFO_VAR_RS = 0x0e,
|
||||
DECT_NWK_INFO_VAR_IWU_ATTR = 0x12,
|
||||
DECT_NWK_INFO_VAR_CALL_ATTR = 0x13,
|
||||
DECT_NWK_INFO_VAR_SVC_CHANGE = 0x16,
|
||||
DECT_NWK_INFO_VAR_CON_ATTR = 0x17,
|
||||
DECT_NWK_INFO_VAR_CIPH_INFO = 0x19,
|
||||
DECT_NWK_INFO_VAR_CALL_ID = 0x1a,
|
||||
DECT_NWK_INFO_VAR_CON_ID = 0x1b,
|
||||
DECT_NWK_INFO_VAR_FACILITY = 0x1c,
|
||||
DECT_NWK_INFO_VAR_PROGRESS_IND = 0x1e,
|
||||
DECT_NWK_INFO_VAR_MMS_GEN_HEAD = 0x20,
|
||||
DECT_NWK_INFO_VAR_MMS_OBJ_HEAD = 0x21,
|
||||
DECT_NWK_INFO_VAR_MMS_EXT_HEAD = 0x22,
|
||||
DECT_NWK_INFO_VAR_TIME_DATE = 0x23,
|
||||
DECT_NWK_INFO_VAR_MULTI_DISP = 0x28,
|
||||
DECT_NWK_INFO_VAR_MULTI_KEYPAD = 0x2c,
|
||||
DECT_NWK_INFO_VAR_FEATURE_ACT = 0x38,
|
||||
DECT_NWK_INFO_VAR_FEATURE_IND = 0x39,
|
||||
DECT_NWK_INFO_VAR_NET_PARAM = 0x41,
|
||||
DECT_NWK_INFO_VAR_EXT_HO_IND = 0x42,
|
||||
DECT_NWK_INFO_VAR_ZAP_FIELD = 0x52,
|
||||
DECT_NWK_INFO_VAR_SVC_CLASS = 0x54,
|
||||
DECT_NWK_INFO_VAR_KEY = 0x56,
|
||||
DECT_NWK_INFO_VAR_REJECT_REASON = 0x60,
|
||||
DECT_NWK_INFO_VAR_SETUP_CAP = 0x62,
|
||||
DECT_NWK_INFO_VAR_TERM_CAP = 0x63,
|
||||
DECT_NWK_INFO_VAR_E2E_COMP = 0x64,
|
||||
DECT_NWK_INFO_VAR_RATE_PARAM = 0x65,
|
||||
DECT_NWK_INFO_VAR_TRANS_DELAY = 0x66,
|
||||
DECT_NWK_INFO_VAR_WINDOW_SIZE = 0x67,
|
||||
DECT_NWK_INFO_VAR_CALLING_NR = 0x6c,
|
||||
DECT_NWK_INFO_VAR_CALLING_NAME = 0x6d,
|
||||
DECT_NWK_INFO_VAR_CALLED_NR = 0x70,
|
||||
DECT_NWK_INFO_VAR_CALLED_SUBA = 0x71,
|
||||
DECT_NWK_INFO_VAR_DURATION = 0x72,
|
||||
DECT_NWK_INFO_VAR_CALLED_NAME = 0x73,
|
||||
DECT_NWK_INFO_VAR_SEGMENT_INFO = 0x75,
|
||||
DECT_NWK_INFO_VAR_ALPHANUM = 0x76,
|
||||
DECT_NWK_INFO_VAR_IWU2IWU = 0x77,
|
||||
DECT_NWK_INFO_VAR_MODEL_ID = 0x78,
|
||||
DECT_NWK_INFO_VAR_IWU_PACKET = 0x7a,
|
||||
DECT_NWK_INFO_VAR_ESC_PROP = 0x7b,
|
||||
DECT_NWK_INFO_VAR_CODEC_LIST = 0x7c,
|
||||
DECT_NWK_INFO_VAR_EVENTS_NOTI = 0x7d,
|
||||
DECT_NWK_INFO_VAR_CALL_INFO = 0x7e,
|
||||
DECT_NWK_INFO_VAR_ESC_EXTENSION = 0x7f
|
||||
};
|
||||
|
||||
/* Section 7.7.2 */
|
||||
enum dect_nwk_info_alloc_type {
|
||||
DECT_NWK_INFO_ALLOC_AUTH_ALG_DSAA = 0x01,
|
||||
DECT_NWK_INFO_ALLOC_AUTH_ALG_DSAA2 = 0x02
|
||||
};
|
||||
|
||||
/* Section 7.7.4 */
|
||||
enum dect_nwk_info_auth_type {
|
||||
DECT_NWK_INFO_AUTH_AUTH_ALG_DSAA = 0x01,
|
||||
DECT_NWK_INFO_AUTH_AUTH_ALG_DSAA2 = 0x02,
|
||||
DECT_NWK_INFO_AUTH_AUTH_ALG_GSM = 0x40,
|
||||
DECT_NWK_INFO_AUTH_AUTH_ALG_UMTS = 0x20,
|
||||
DECT_NWK_INFO_AUTH_AUTH_ESC_PROP_ALG = 0x7f
|
||||
};
|
||||
|
||||
/* Section 7.7.7 and 7.7.9 */
|
||||
enum dect_nwk_info_num_plan_type {
|
||||
DECT_NWK_INFO_NUM_PLAN_UNKNOWN = 0x0,
|
||||
DECT_NWK_INFO_NUM_PLAN_ISDN = 0x1,
|
||||
DECT_NWK_INFO_NUM_PLAN_DATA_X121 = 0x3,
|
||||
DECT_NWK_INFO_NUM_PLAN_TCPIP_ADDR = 0x7,
|
||||
DECT_NWK_INFO_NUM_PLAN_NATIONAL = 0x8,
|
||||
DECT_NWK_INFO_NUM_PLAN_PRIVATE = 0x9,
|
||||
DECT_NWK_INFO_NUM_PLAN_SIP = 0xa,
|
||||
DECT_NWK_INFO_NUM_PLAN_INTERNET = 0xb,
|
||||
DECT_NWK_INFO_NUM_PLAN_LAN_MAC = 0xc,
|
||||
DECT_NWK_INFO_NUM_PLAN_ITUT_X400 = 0xd,
|
||||
DECT_NWK_INFO_NUM_PLAN_PROFILE_SVC = 0xe,
|
||||
DECT_NWK_INFO_NUM_PLAN_RESERVED = 0xf
|
||||
};
|
||||
|
||||
/* Section 7.7.13 */
|
||||
enum dect_nwk_info_time_limits_type {
|
||||
DECT_NWK_INFO_TIME_LIMITS_ERASE = 0x0,
|
||||
DECT_NWK_INFO_TIME_LIMITS_DEFINED1 = 0x1,
|
||||
DECT_NWK_INFO_TIME_LIMITS_DEFINED2 = 0x2,
|
||||
DECT_NWK_INFO_TIME_LIMITS_STANDARD = 0x4,
|
||||
DECT_NWK_INFO_TIME_LIMITS_INFINITE = 0xf
|
||||
};
|
||||
|
||||
/* Section 7.7.19 */
|
||||
enum dect_nwk_info_id_group_coding_type {
|
||||
DECT_NWK_INFO_ID_GROUP_CODING_PORTABLE = 0x0,
|
||||
DECT_NWK_INFO_ID_GROUP_CODING_NETWORK = 0x1,
|
||||
DECT_NWK_INFO_ID_GROUP_CODING_FIXED = 0x4,
|
||||
DECT_NWK_INFO_ID_GROUP_CODING_APP = 0x8,
|
||||
DECT_NWK_INFO_ID_GROUP_CODING_PROP = 0xf
|
||||
};
|
||||
|
||||
/*********************************************************************************
|
||||
* DECT VALUE STRINGS
|
||||
*********************************************************************************/
|
||||
|
||||
/* Section 7.2 */
|
||||
static const value_string nwk_pdisc_vals[] = {
|
||||
{ DECT_NWK_PDISC_LCE, "Link Control Entity (LCE)" },
|
||||
{ DECT_NWK_PDISC_CC, "Call Control (CC)" },
|
||||
{ DECT_NWK_PDISC_CISS, "Call Independent Supplementary Services (CISS)" },
|
||||
{ DECT_NWK_PDISC_MM, "Mobility Management (MM)" },
|
||||
{ DECT_NWK_PDISC_CMSS, "ConnectionLess Message Service (CMSS)" },
|
||||
{ DECT_NWK_PDISC_COMS, "Connection Oriented Message Service (COMS)" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/* Section 7.4.1 */
|
||||
static const value_string nwk_cc_msgt_vals[] = {
|
||||
{ DECT_NWK_CC_ALERTING, "CC-ALERTING" },
|
||||
{ DECT_NWK_CC_CALL_PROC, "CC-CALL-PROC" },
|
||||
{ DECT_NWK_CC_SETUP, "CC-SETUP" },
|
||||
{ DECT_NWK_CC_CONNECT, "CC-CONNECT" },
|
||||
{ DECT_NWK_CC_SETUP_ACK, "CC-SETUP-ACK" },
|
||||
{ DECT_NWK_CC_CONNECT_ACK, "CC-CONNECT-ACK" },
|
||||
{ DECT_NWK_CC_SERVICE_CHANGE, "CC-SERVICE-CHANGE" },
|
||||
{ DECT_NWK_CC_SERVICE_ACCEPT, "CC-SERVICE-ACCEPT" },
|
||||
{ DECT_NWK_CC_SERVICE_REJECT, "CC-SERVICE-REJECT" },
|
||||
{ DECT_NWK_CC_RELEASE, "CC-RELEASE" },
|
||||
{ DECT_NWK_CC_RELEASE_COM, "CC-RELEASE-COM" },
|
||||
{ DECT_NWK_CC_IWU_INFO, "CC-IWU-INFO" },
|
||||
{ DECT_NWK_CC_NOTIFY, "CC-NOTIFY" },
|
||||
{ DECT_NWK_CC_INFO, "CC-INFO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/* Section 7.4.5 */
|
||||
static const value_string nwk_mm_msgt_vals[] = {
|
||||
{ DECT_NWK_MM_AUTH_REQ, "MM-AUTH-REQ" },
|
||||
{ DECT_NWK_MM_AUTH_REPLY, "MM-AUTH-REPLY" },
|
||||
{ DECT_NWK_MM_KEY_ALLOC, "MM-KEY-ALLOC"},
|
||||
{ DECT_NWK_MM_AUTH_REJ, "MM-AUTH-REJECT"},
|
||||
{ DECT_NWK_MM_ACC_RIGHTS_REQ, "MM-ACC-RIGHTS-REQ"},
|
||||
{ DECT_NWK_MM_ACC_RIGHTS_ACK, "MM-ACC-RIGHTS-ACK"},
|
||||
{ DECT_NWK_MM_ACC_RIGHTS_REJ, "MM-ACC-RIGHTS-REJ"},
|
||||
{ DECT_NWK_MM_ACC_RIGHTS_TERM_REQ, "MM-ACC-RIGHTS-TERM-REQ"},
|
||||
{ DECT_NWK_MM_ACC_RIGHTS_TERM_ACK, "MM-ACC-RIGHTS-TERM-ACK"},
|
||||
{ DECT_NWK_MM_ACC_RIGHTS_TERM_REJ, "MM-ACC-RIGHTS-TERM-REJ"},
|
||||
{ DECT_NWK_MM_CIPH_REQ, "MM-CIPH-REQ"},
|
||||
{ DECT_NWK_MM_CIPH_SUGGEST, "MM-CIPH-SUGGEST"},
|
||||
{ DECT_NWK_MM_CIPH_REJ, "MM-CIPH-REJ"},
|
||||
{ DECT_NWK_MM_INFO_REQ, "MM-INFO-REQ"},
|
||||
{ DECT_NWK_MM_INFO_ACK, "MM-INFO-ACK"},
|
||||
{ DECT_NWK_MM_INFO_SUGGEST, "MM-INFO-SUGGEST"},
|
||||
{ DECT_NWK_MM_INFO_REJ, "MM-INFO-REJ"},
|
||||
{ DECT_NWK_MM_LOCATE_REQ, "MM-LOCATE-REQ"},
|
||||
{ DECT_NWK_MM_LOCATE_ACK, "MM-LOCATE-ACK"},
|
||||
{ DECT_NWK_MM_DETACH, "MM-DETACH"},
|
||||
{ DECT_NWK_MM_LOCATE_REJ, "MM-LOCATE-REJ"},
|
||||
{ DECT_NWK_MM_ID_REQ, "MM-ID-REQ"},
|
||||
{ DECT_NWK_MM_ID_REPLY, "MM-ID-REPLY"},
|
||||
{ DECT_NWK_MM_IWU, "MM-IWU"},
|
||||
{ DECT_NWK_MM_TID_ASSIGN, "MM-TID-ASSIGN"},
|
||||
{ DECT_NWK_MM_TID_ASSIGN_ACK, "MM-TID-ASSIGN-ACK"},
|
||||
{ DECT_NWK_MM_TID_ASSIGN_REJ, "MM-TID-ASSIGN-REJ"},
|
||||
{ DECT_NWK_MM_NOTIFY, "MM-NOTIFY"},
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/* Section 7.4.6 */
|
||||
static const value_string nwk_lce_msgt_vals[] = {
|
||||
{ DECT_NWK_LCE_PAGE_RESP, "LCE-PAGE-RESPONSE" },
|
||||
{ DECT_NWK_LCE_PAGE_REJ, "LCE-PAGE-REJECT" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/* Section 7.7.1 */
|
||||
static const value_string nwk_info_var_vals[] = {
|
||||
{ DECT_NWK_INFO_VAR_INFO_TYPE , "Info Type"},
|
||||
{ DECT_NWK_INFO_VAR_IDENTITY_TYPE , "Identity Type"},
|
||||
{ DECT_NWK_INFO_VAR_PORTABLE_ID , "Portable Identity"},
|
||||
{ DECT_NWK_INFO_VAR_FIXED_ID , "Fixed Identity"},
|
||||
{ DECT_NWK_INFO_VAR_LOC_AREA , "Location area"},
|
||||
{ DECT_NWK_INFO_VAR_NWK_ID , "NWK assigned Identity"},
|
||||
{ DECT_NWK_INFO_VAR_AUTH_TYPE , "AUTH-Type"},
|
||||
{ DECT_NWK_INFO_VAR_ALLOC_TYPE , "Allocation Type"},
|
||||
{ DECT_NWK_INFO_VAR_RAND , "RAND"},
|
||||
{ DECT_NWK_INFO_VAR_RES , "RES"},
|
||||
{ DECT_NWK_INFO_VAR_RS , "RS"},
|
||||
{ DECT_NWK_INFO_VAR_IWU_ATTR , "IWU attributes"},
|
||||
{ DECT_NWK_INFO_VAR_CALL_ATTR , "Call attributes"},
|
||||
{ DECT_NWK_INFO_VAR_SVC_CHANGE , "Service change info"},
|
||||
{ DECT_NWK_INFO_VAR_CON_ATTR , "Connection attributes"},
|
||||
{ DECT_NWK_INFO_VAR_CIPH_INFO , "Cipher Info"},
|
||||
{ DECT_NWK_INFO_VAR_CALL_ID , "Call identity"},
|
||||
{ DECT_NWK_INFO_VAR_CON_ID , "Connection identity"},
|
||||
{ DECT_NWK_INFO_VAR_FACILITY , "Facility"},
|
||||
{ DECT_NWK_INFO_VAR_PROGRESS_IND , "Progress Indicator"},
|
||||
{ DECT_NWK_INFO_VAR_MMS_GEN_HEAD , "MMS Generic Header"},
|
||||
{ DECT_NWK_INFO_VAR_MMS_OBJ_HEAD , "Object Header"},
|
||||
{ DECT_NWK_INFO_VAR_MMS_EXT_HEAD , "Extended Header"},
|
||||
{ DECT_NWK_INFO_VAR_TIME_DATE , "Time-Date"},
|
||||
{ DECT_NWK_INFO_VAR_MULTI_DISP , "Multi Display"},
|
||||
{ DECT_NWK_INFO_VAR_MULTI_KEYPAD , "Multi-Keypad"},
|
||||
{ DECT_NWK_INFO_VAR_FEATURE_ACT , "Feature Activate"},
|
||||
{ DECT_NWK_INFO_VAR_FEATURE_IND , "Feature Indicate"},
|
||||
{ DECT_NWK_INFO_VAR_NET_PARAM , "Network parameter"},
|
||||
{ DECT_NWK_INFO_VAR_EXT_HO_IND , "Ext h/o indicator"},
|
||||
{ DECT_NWK_INFO_VAR_ZAP_FIELD , "ZAP field"},
|
||||
{ DECT_NWK_INFO_VAR_SVC_CLASS , "Serice Class"},
|
||||
{ DECT_NWK_INFO_VAR_KEY , "Key"},
|
||||
{ DECT_NWK_INFO_VAR_REJECT_REASON , "Reject Reason"},
|
||||
{ DECT_NWK_INFO_VAR_SETUP_CAP , "Setup capability"},
|
||||
{ DECT_NWK_INFO_VAR_TERM_CAP , "Terminal capability"},
|
||||
{ DECT_NWK_INFO_VAR_E2E_COMP , "End-to-End compatibility"},
|
||||
{ DECT_NWK_INFO_VAR_RATE_PARAM , "Rate parameters"},
|
||||
{ DECT_NWK_INFO_VAR_TRANS_DELAY , "Transit Delay"},
|
||||
{ DECT_NWK_INFO_VAR_WINDOW_SIZE , "Window size"},
|
||||
{ DECT_NWK_INFO_VAR_CALLING_NR , "Calling Party Number"},
|
||||
{ DECT_NWK_INFO_VAR_CALLING_NAME , "Calling Party Name"},
|
||||
{ DECT_NWK_INFO_VAR_CALLED_NR , "Called Paty Number"},
|
||||
{ DECT_NWK_INFO_VAR_CALLED_SUBA , "Called Party Subaddr"},
|
||||
{ DECT_NWK_INFO_VAR_DURATION , "Duration"},
|
||||
{ DECT_NWK_INFO_VAR_CALLED_NAME , "Called Party Name"},
|
||||
{ DECT_NWK_INFO_VAR_SEGMENT_INFO , "Segmented Info"},
|
||||
{ DECT_NWK_INFO_VAR_ALPHANUM , "Alphanumeric"},
|
||||
{ DECT_NWK_INFO_VAR_IWU2IWU , "IWU-to-IWU"},
|
||||
{ DECT_NWK_INFO_VAR_MODEL_ID , "Model identifier"},
|
||||
{ DECT_NWK_INFO_VAR_IWU_PACKET , "IWU-PACKET"},
|
||||
{ DECT_NWK_INFO_VAR_ESC_PROP , "Escape to proprietary"},
|
||||
{ DECT_NWK_INFO_VAR_CODEC_LIST , "Codec List"},
|
||||
{ DECT_NWK_INFO_VAR_EVENTS_NOTI , "Events notification"},
|
||||
{ DECT_NWK_INFO_VAR_CALL_INFO , "Call information"},
|
||||
{ DECT_NWK_INFO_VAR_ESC_EXTENSION , "Escape for extension"},
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
/* TOOD: value_string for other protocols */
|
||||
|
||||
|
||||
/*********************************************************************************
|
||||
* DECT dissector code
|
||||
*********************************************************************************/
|
||||
|
||||
static int dissect_dect_nwk_ie(tvbuff_t *tvb, guint offset, packet_info _U_ *pinfo, proto_tree *tree, void _U_ *data)
|
||||
{
|
||||
guint8 ie_type;
|
||||
guint8 ie_len;
|
||||
guint8 type_offset;
|
||||
guint len;
|
||||
proto_item *ie_ti;
|
||||
proto_tree *ie_tree;
|
||||
|
||||
len = tvb_reported_length(tvb);
|
||||
type_offset = offset;
|
||||
ie_type = tvb_get_guint8(tvb, offset);
|
||||
offset++;
|
||||
|
||||
if ((ie_type & 0xf0) == 0xe0)
|
||||
{
|
||||
/* double octet ie */
|
||||
offset++;
|
||||
}
|
||||
else if (ie_type & 0x80)
|
||||
{
|
||||
/* single octet ie */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* variable length ie */
|
||||
ie_len = tvb_get_guint8(tvb, offset);
|
||||
ie_ti = proto_tree_add_item(tree, hf_nwk_ie_var_type, tvb, type_offset, 1, ENC_NA);
|
||||
ie_tree = proto_item_add_subtree(ie_ti, ett_dect_nwk_ie);
|
||||
proto_tree_add_item(ie_tree, hf_nwk_ie_len, tvb, offset, 1, ENC_NA);
|
||||
offset++;
|
||||
offset += ie_len;
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
static int dissect_dect_nwk_lce(tvbuff_t *tvb, guint8 msg_type, guint offset, packet_info *pinfo, proto_tree *tree, void _U_ *data)
|
||||
{
|
||||
guint len;
|
||||
|
||||
proto_tree_add_item(tree, hf_nwk_msg_type_lce, tvb, offset, 1, ENC_NA);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
|
||||
val_to_str(msg_type, nwk_lce_msgt_vals, "Unknown 0x%02x"));
|
||||
offset++;
|
||||
len = tvb_reported_length(tvb);
|
||||
|
||||
while (offset < len)
|
||||
{
|
||||
offset = dissect_dect_nwk_ie(tvb, offset, pinfo, tree, data);
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
static int dissect_dect_nwk_cc(tvbuff_t *tvb, guint8 msg_type, guint offset, packet_info *pinfo, proto_tree *tree, void _U_ *data)
|
||||
{
|
||||
guint len;
|
||||
|
||||
proto_tree_add_item(tree, hf_nwk_msg_type_cc, tvb, offset, 1, ENC_NA);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
|
||||
val_to_str(msg_type, nwk_cc_msgt_vals, "Unknown 0x%02x"));
|
||||
offset++;
|
||||
len = tvb_reported_length(tvb);
|
||||
|
||||
while (offset < len)
|
||||
{
|
||||
offset = dissect_dect_nwk_ie(tvb, offset, pinfo, tree, data);
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
static int dissect_dect_nwk_mm(tvbuff_t *tvb, guint8 msg_type, guint offset, packet_info *pinfo, proto_tree *tree, void _U_ *data)
|
||||
{
|
||||
guint len;
|
||||
|
||||
proto_tree_add_item(tree, hf_nwk_msg_type_mm, tvb, offset, 1, ENC_NA);
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
|
||||
val_to_str(msg_type, nwk_mm_msgt_vals, "Unknown 0x%02x"));
|
||||
offset++;
|
||||
len = tvb_reported_length(tvb);
|
||||
|
||||
while (offset < len)
|
||||
{
|
||||
offset = dissect_dect_nwk_ie(tvb, offset, pinfo, tree, data);
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
static int dissect_dect_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
||||
{
|
||||
proto_tree *nwk_tree;
|
||||
proto_item *nwk_ti;
|
||||
guint8 pdisc, msg_type;
|
||||
guint len;
|
||||
guint offset = 0;
|
||||
guint available_length;
|
||||
|
||||
len = tvb_reported_length(tvb);
|
||||
|
||||
col_append_str(pinfo->cinfo, COL_INFO, "(NWK) ");
|
||||
|
||||
nwk_ti = proto_tree_add_item(tree, proto_dect_nwk, tvb, 0, len, ENC_NA);
|
||||
nwk_tree = proto_item_add_subtree(nwk_ti, ett_dect_nwk);
|
||||
|
||||
proto_tree_add_item(nwk_tree, hf_nwk_ti, tvb, 0, 1, ENC_NA);
|
||||
proto_tree_add_item(nwk_tree, hf_nwk_pdisc, tvb, 0, 1, ENC_NA);
|
||||
pdisc = tvb_get_guint8(tvb, 0) & 0x0F;
|
||||
msg_type = tvb_get_guint8(tvb, 1);
|
||||
|
||||
switch (pdisc) {
|
||||
case DECT_NWK_PDISC_LCE:
|
||||
offset = dissect_dect_nwk_lce(tvb, msg_type, 1, pinfo, nwk_tree, data);
|
||||
break;
|
||||
case DECT_NWK_PDISC_CC:
|
||||
offset = dissect_dect_nwk_cc(tvb, msg_type, 1, pinfo, nwk_tree, data);
|
||||
break;
|
||||
case DECT_NWK_PDISC_MM:
|
||||
offset = dissect_dect_nwk_mm(tvb, msg_type, 1, pinfo, nwk_tree, data);
|
||||
break;
|
||||
case DECT_NWK_PDISC_CISS:
|
||||
case DECT_NWK_PDISC_CMSS:
|
||||
case DECT_NWK_PDISC_COMS:
|
||||
/* FIXME */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* whatever was not dissected: Use generic data dissector */
|
||||
available_length = tvb_captured_length(tvb) - offset;
|
||||
if (available_length) {
|
||||
tvbuff_t *payload = tvb_new_subset_length_caplen(tvb, offset, MIN(len-offset, available_length), len);
|
||||
call_data_dissector(payload, pinfo, tree);
|
||||
}
|
||||
return tvb_captured_length(tvb);
|
||||
}
|
||||
|
||||
void proto_register_dect_nwk(void)
|
||||
{
|
||||
static hf_register_info hf[] =
|
||||
{
|
||||
{ &hf_nwk_ti,
|
||||
{ "Transaction Identifier", "dect_nwk.ti", FT_UINT8, BASE_HEX,
|
||||
NULL, 0xF0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_nwk_pdisc,
|
||||
{ "Proticol Discriminator", "dect_nwk.pdisc", FT_UINT8, BASE_HEX,
|
||||
VALS(nwk_pdisc_vals), 0x0F, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_nwk_msg_type_cc,
|
||||
{ "Message Type", "dect_nwk.msg_type", FT_UINT8, BASE_HEX,
|
||||
VALS(nwk_cc_msgt_vals), 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_nwk_msg_type_mm,
|
||||
{ "Message Type", "dect_nwk.msg_type", FT_UINT8, BASE_HEX,
|
||||
VALS(nwk_mm_msgt_vals), 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_nwk_msg_type_lce,
|
||||
{ "Message Type", "dect_nwk.msg_type", FT_UINT8, BASE_HEX,
|
||||
VALS(nwk_lce_msgt_vals), 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_nwk_ie_var_type,
|
||||
{ "Information Element", "dect_nwk.ie_type", FT_UINT8, BASE_HEX,
|
||||
VALS(nwk_info_var_vals), 0x0, NULL, HFILL
|
||||
}
|
||||
},
|
||||
{ &hf_nwk_ie_len,
|
||||
{ "IE Length", "dect_nwk.ie_len", FT_UINT8, BASE_DEC,
|
||||
NULL, 0x0, NULL, HFILL
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static gint *ett[] = {
|
||||
&ett_dect_nwk,
|
||||
&ett_dect_nwk_ie,
|
||||
};
|
||||
|
||||
/* Register protocol */
|
||||
proto_dect_nwk = proto_register_protocol("DECT NWK", "DECT-NWK", "dect_nwk");
|
||||
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
proto_register_field_array(proto_dect_nwk, hf, array_length(hf));
|
||||
|
||||
dect_nwk_handle = register_dissector("dect_nwk", dissect_dect_nwk, proto_dect_nwk);
|
||||
}
|
||||
|
||||
void proto_reg_handoff_dect_nwk(void)
|
||||
{
|
||||
dissector_add_uint("dect_dlc.sapi", 0, dect_nwk_handle);
|
||||
dissector_add_uint("dect_dlc.sapi", 3, dect_nwk_handle);
|
||||
}
|
||||
|
||||
/*
|
||||
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
||||
*
|
||||
* Local variables:
|
||||
* c-basic-offset: 8
|
||||
* tab-width: 8
|
||||
* indent-tabs-mode: t
|
||||
* End:
|
||||
*
|
||||
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
||||
* :indentSize=8:tabSize=8:noTabs=false:
|
||||
*/
|
Loading…
Reference in New Issue