epl: Add support for AMNI frame
The "EPSG Draft Standard 302-A: High Availability" introduces the new frame "AMNI". This change adds support to correctly dissect POWERLINK AMNI frames. Change-Id: I9e402423296c4e82a25e897de964629bb695d566 Reviewed-on: https://code.wireshark.org/review/8215 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
parent
360d49d9a4
commit
addf8f6012
|
@ -17,6 +17,9 @@
|
||||||
* Copyright (c) 2013: B&R Industrieelektronik GmbH
|
* Copyright (c) 2013: B&R Industrieelektronik GmbH
|
||||||
* http://www.br-automation.com
|
* http://www.br-automation.com
|
||||||
*
|
*
|
||||||
|
* - Christoph Schlosser <christoph.schlosser[AT]br-automation.com>
|
||||||
|
* - Lukas Emersberger <lukas.emersberger[AT]br-automation.com>
|
||||||
|
* - Josef Baumgartner <josef.baumgartner[AT]br-automation.com>
|
||||||
* - Roland Knall <roland.knall[AT]br-automation.com>
|
* - Roland Knall <roland.knall[AT]br-automation.com>
|
||||||
* - Extended to be similair in handling as to B&R plugin
|
* - Extended to be similair in handling as to B&R plugin
|
||||||
* - Multiple SOD Read/Write dissection
|
* - Multiple SOD Read/Write dissection
|
||||||
|
@ -128,6 +131,7 @@ static const gchar* addr_str_abbr_res = " (res.)";
|
||||||
#define EPL_PRES 0x04
|
#define EPL_PRES 0x04
|
||||||
#define EPL_SOA 0x05
|
#define EPL_SOA 0x05
|
||||||
#define EPL_ASND 0x06
|
#define EPL_ASND 0x06
|
||||||
|
#define EPL_AMNI 0x07
|
||||||
#define EPL_AINV 0x0D
|
#define EPL_AINV 0x0D
|
||||||
|
|
||||||
static const value_string mtyp_vals[] = {
|
static const value_string mtyp_vals[] = {
|
||||||
|
@ -137,6 +141,7 @@ static const value_string mtyp_vals[] = {
|
||||||
{EPL_SOA, "Start of Asynchronous (SoA)" },
|
{EPL_SOA, "Start of Asynchronous (SoA)" },
|
||||||
{EPL_ASND, "Asynchronous Send (ASnd)" },
|
{EPL_ASND, "Asynchronous Send (ASnd)" },
|
||||||
{EPL_AINV, "Asynchronous Invite (AInv)" },
|
{EPL_AINV, "Asynchronous Invite (AInv)" },
|
||||||
|
{EPL_AMNI, "ActiveManagingNodeIndication (AMNI)" },
|
||||||
{0,NULL}
|
{0,NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1205,6 +1210,8 @@ static const gchar* addr_str_res = " (reserved)";
|
||||||
|
|
||||||
static dissector_handle_t data_dissector = NULL;
|
static dissector_handle_t data_dissector = NULL;
|
||||||
|
|
||||||
|
static gint dissect_epl_payload ( proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gint offset, gint len, guint8 msgType );
|
||||||
|
|
||||||
static gint dissect_epl_soc(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gint offset);
|
static gint dissect_epl_soc(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gint offset);
|
||||||
static gint dissect_epl_preq(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gint offset);
|
static gint dissect_epl_preq(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gint offset);
|
||||||
static gint dissect_epl_pres(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, guint8 epl_src, gint offset);
|
static gint dissect_epl_pres(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, guint8 epl_src, gint offset);
|
||||||
|
@ -1662,7 +1669,7 @@ dissect_eplpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean udp
|
||||||
/* Set up structures needed to add the protocol subtree and manage it */
|
/* Set up structures needed to add the protocol subtree and manage it */
|
||||||
proto_item *ti;
|
proto_item *ti;
|
||||||
proto_tree *epl_tree = NULL, *epl_src_item, *epl_dest_item;
|
proto_tree *epl_tree = NULL, *epl_src_item, *epl_dest_item;
|
||||||
gint offset = 0;
|
gint offset = 0, size = 0;
|
||||||
heur_dtbl_entry_t *hdtbl_entry;
|
heur_dtbl_entry_t *hdtbl_entry;
|
||||||
|
|
||||||
if (tvb_reported_length(tvb) < 3)
|
if (tvb_reported_length(tvb) < 3)
|
||||||
|
@ -1751,6 +1758,10 @@ dissect_eplpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean udp
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EPL_AMNI:
|
||||||
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%3d->%3d AMNI ", epl_src, epl_dest);
|
||||||
|
break;
|
||||||
|
|
||||||
default: /* no valid EPL packet */
|
default: /* no valid EPL packet */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1812,6 +1823,14 @@ dissect_eplpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean udp
|
||||||
offset = dissect_epl_ainv(epl_tree, tvb, pinfo, epl_src, offset);
|
offset = dissect_epl_ainv(epl_tree, tvb, pinfo, epl_src, offset);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EPL_AMNI:
|
||||||
|
/* Currently all fields in the AMNI frame are reserved. Therefore
|
||||||
|
* there's nothing to dissect! Everything is given to the heuristic,
|
||||||
|
* which will dissect as data, if no heuristic dissector uses it. */
|
||||||
|
size = tvb_captured_length_remaining(tvb, offset);
|
||||||
|
offset = dissect_epl_payload(epl_tree, tvb, pinfo, offset, size, EPL_AMNI);
|
||||||
|
break;
|
||||||
|
|
||||||
/* Default case can not happen as it is caught by an earlier switch
|
/* Default case can not happen as it is caught by an earlier switch
|
||||||
* statement */
|
* statement */
|
||||||
}
|
}
|
||||||
|
|
1
wka.tmpl
1
wka.tmpl
|
@ -78,6 +78,7 @@
|
||||||
01-11-1E-00-00-02 EPLv2_PRes
|
01-11-1E-00-00-02 EPLv2_PRes
|
||||||
01-11-1E-00-00-03 EPLv2_SoA
|
01-11-1E-00-00-03 EPLv2_SoA
|
||||||
01-11-1E-00-00-04 EPLv2_ASnd
|
01-11-1E-00-00-04 EPLv2_ASnd
|
||||||
|
01-11-1E-00-00-05 EPLv2_AMNI
|
||||||
01-20-25/25 Control-Technology-Inc's-Industrial-Ctrl-Proto.
|
01-20-25/25 Control-Technology-Inc's-Industrial-Ctrl-Proto.
|
||||||
01-80-24-00-00-00 Kalpana-Etherswitch-every-60-seconds
|
01-80-24-00-00-00 Kalpana-Etherswitch-every-60-seconds
|
||||||
01-80-C2-00-00-00/44 Spanning-tree-(for-bridges)
|
01-80-C2-00-00-00/44 Spanning-tree-(for-bridges)
|
||||||
|
|
Loading…
Reference in New Issue