Wi-SUN Protocol dissection and IEEE 802.15.4 IE cleanup.

This patch adds dissection for the Wi-SUN Field Area Network standard. Wi-SUN
packets are encoded as a collection of IEEE 802.15.4 information elements. This
required a bit of refactoring in how the IE dissector table is handled so that
external protocols could supply their own dissectors.

While I was working with the IEs, I also added support for the TSCH Timeslot and
Global Time IEs from the IEEE 802.15.4 standard in addition to some general
cleanup.

Change-Id: I2858e4ab577756568e33b86adfe282967899abd5
Reviewed-on: https://code.wireshark.org/review/24331
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Owen Kirby 2017-11-09 18:33:51 -08:00 committed by Anders Broman
parent 499ae4ab57
commit 3f11c2f7c5
6 changed files with 1600 additions and 487 deletions

View File

@ -1748,6 +1748,7 @@ set(DISSECTOR_SRC
packet-wifi-p2p.c
packet-windows-common.c
packet-winsrepl.c
packet-wisun.c
packet-wlccp.c
packet-wol.c
packet-wow.c

View File

@ -1402,6 +1402,7 @@ DISSECTOR_SRC = \
packet-wifi-p2p.c \
packet-windows-common.c \
packet-winsrepl.c \
packet-wisun.c \
packet-wlccp.c \
packet-wol.c \
packet-wow.c \

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,7 @@
/* Dissector tables for the Header IEs and Payload IEs */
#define IEEE802154_HEADER_IE_DTABLE "wpan.header_ie"
#define IEEE802154_PAYLOAD_IE_DTABLE "wpan.payload_ie"
#define IEEE802154_MLME_IE_DTABLE "wpan.mlme_ie"
/* Packet Overhead from MAC header + footer (excluding addressing) */
#define IEEE802154_MAX_FRAME_LEN 127
@ -177,7 +178,6 @@
#define IEEE802154_MLME_PSIE_EB_FLT_ATTR_LEN 0x18
/* Vendor OUIs */
#define IEEE802154_VENDOR_OUI_ZIGBEE 0x4A191B
/* Bit-masks for CC24xx style FCS */
#define IEEE802154_CC24xx_CORRELATION 0x7F00
@ -248,7 +248,7 @@ typedef enum {
#define IEEE802154_HEADER_IE_RCC_CAP 0x27
#define IEEE802154_HEADER_IE_RCCN 0x28
#define IEEE802154_HEADER_IE_GLOBAL_TIME 0x29
/* Assigned to External Organization: 0x2a */
#define IEEE802154_HEADER_IE_WISUN 0x2a
#define IEEE802154_HEADER_IE_DA_IE 0x2b
/* Reserved 0x2c-0x7d */
#define IEEE802154_HEADER_IE_HT1 0x7e
@ -260,7 +260,7 @@ typedef enum {
#define IEEE802154_PAYLOAD_IE_MLME 0x1 /* Media Access Control (MAC) subLayer Management Entity */
#define IEEE802154_PAYLOAD_IE_VENDOR 0x2 /* Vendor Specific */
#define IEEE802154_PAYLOAD_IE_MPX 0x3 /* MPX IE (802.15.9) */
/* Reserved 0x4 */
#define IEEE802154_PAYLOAD_IE_WISUN 0x4 /* Wi-SUN IE */
#define IEEE802154_PAYLOAD_IE_IETF 0x5 /* IETF IE, RFC 8137 */
/* Reserved 0x6-0xe */
#define IEEE802154_PAYLOAD_IE_TERMINATION 0xf
@ -362,6 +362,7 @@ typedef enum {
#define IEEE802159_MPX_ABORT 6
/* IEEE 802.15.9 Table 20 */
#define IEEE802159_MPX_MULTIPLEX_ID_KMP 1
#define IEEE802159_MPX_MULTIPLEX_ID_WISUN 2
/* IEEE 802.15.9 Table 21 */
#define IEEE802159_MPX_KMP_ID_IEEE8021X 1
#define IEEE802159_MPX_KMP_ID_HIP 2
@ -372,6 +373,10 @@ typedef enum {
#define IEEE802159_MPX_KMP_ID_IEEE80211_GKH 7
#define IEEE802159_MPX_KMP_ID_ETSI_TS_102_887_2 8
#define IEEE802159_MPX_KMP_ID_VENDOR_SPECIFIC 255
/* Wi-SUN MPX Sub-ID values. */
#define IEEE802159_MPX_WISUN_SUBID_MHDS 0
#define IEEE802159_MPX_WISUN_SUBID_6LOWPAN 1
#define IEEE802159_MPX_WISUN_SUBID_SECURITY 2
/* Structure containing information regarding all necessary packet fields. */
typedef struct {
@ -480,6 +485,9 @@ void ccm_init_block(gchar *block, gboolean adata, gint M, guint64 addr, guint32
gboolean ccm_ctr_encrypt(const gchar *key, const gchar *iv, gchar *mic, gchar *data, gint length);
gboolean ccm_cbc_mac(const gchar *key, const gchar *iv, const gchar *a, gint a_len, const gchar *m, gint m_len, gchar *mic);
proto_tree *ieee802154_create_hie_tree(tvbuff_t *tvb, proto_tree *tree, int hf, gint ett);
proto_tree *ieee802154_create_pie_tree(tvbuff_t *tvb, proto_tree *tree, int hf, gint ett);
typedef struct {
unsigned char* rx_mic;
guint* rx_mic_length;

File diff suppressed because it is too large Load Diff

View File

@ -87,6 +87,7 @@
#define OUI_APPLE_ATALK 0x080007 /* Appletalk */
#define OUI_HP 0x080009 /* Hewlett-Packard */
#define OUI_HYTEC_GER 0x30B216 /* Hytec Geraetebau GmbH */
#define OUI_ZIGBEE 0x4A191B /* ZigBee Alliance */
#define OUI_WFA 0x506F9A /* Wi-Fi Alliance */
#define OUI_3GPP2 0xCF0002 /* 3GPP2 */