Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 296260 Details for
Bug 435366
Grok wireless mesh packets and clique
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
mesh support
wireshark-0.99.7-mesh.patch (text/plain), 25.34 KB, created by
David Woodhouse
on 2008-02-28 20:52:45 UTC
(
hide
)
Description:
mesh support
Filename:
MIME Type:
Creator:
David Woodhouse
Created:
2008-02-28 20:52:45 UTC
Size:
25.34 KB
patch
obsolete
>Index: epan/oui.h >=================================================================== >--- epan/oui.h (revision 24481) >+++ epan/oui.h (working copy) >@@ -65,6 +65,7 @@ > #define OUI_SIEMENS 0x080006 /* Siemens AG */ > #define OUI_APPLE_ATALK 0x080007 /* Appletalk */ > #define OUI_HP 0x080009 /* Hewlett-Packard */ >+#define OUI_MARVELL 0x005043 /* Marvell Semiconductor */ > > /* > * Defined in packet-llc.c >Index: epan/dissectors/packet-ethertype.c >=================================================================== >--- epan/dissectors/packet-ethertype.c (revision 24481) >+++ epan/dissectors/packet-ethertype.c (working copy) >@@ -44,6 +44,7 @@ > static dissector_table_t ethertype_dissector_table; > > static dissector_handle_t data_handle; >+static dissector_handle_t mesh_header_handle; > > const value_string etype_vals[] = { > {ETHERTYPE_IP, "IP" }, >@@ -190,6 +191,7 @@ > guint length_before; > volatile gboolean dissector_found = FALSE; > const char *saved_proto; >+ guint mesh_header_size; > > /* Add the Ethernet type to the protocol tree */ > if (tree) { >@@ -202,6 +204,16 @@ > > pinfo->ethertype = etype; > >+ /* try to dissect a mesh header */ >+ if (mesh_header_handle == NULL) >+ mesh_header_handle = find_dissector("mesh"); >+ mesh_header_size = call_dissector(mesh_header_handle, next_tvb, pinfo, >+ tree); >+ if (mesh_header_size) >+ next_tvb = tvb_new_subset(tvb, >+ offset_after_etype + mesh_header_size, >+ -1, -1); >+ > /* Remember how much data there is in it. */ > length_before = tvb_reported_length(next_tvb); > >@@ -326,4 +338,5 @@ > proto_reg_handoff_ethertype(void) > { > data_handle = find_dissector("data"); >+ mesh_header_handle = NULL; > } >Index: epan/dissectors/Makefile.common >=================================================================== >--- epan/dissectors/Makefile.common (revision 24481) >+++ epan/dissectors/Makefile.common (working copy) >@@ -527,6 +527,7 @@ > packet-manolito.c \ > packet-mbtcp.c \ > packet-mdshdr.c \ >+ packet-mesh.c \ > packet-media.c \ > packet-megaco.c \ > packet-mgcp.c \ >Index: epan/dissectors/packet-ieee80211.c >=================================================================== >--- epan/dissectors/packet-ieee80211.c (revision 24481) >+++ epan/dissectors/packet-ieee80211.c (working copy) >@@ -374,7 +374,7 @@ > #define DATA_FRAME 0x02 /* Frame type is Data */ > > #define DATA_SHORT_HDR_LEN 24 >-#define DATA_LONG_HDR_LEN 30 >+#define DATA_LONG_HDR_LEN 32 > #define MGT_FRAME_HDR_LEN 24 /* Length of Managment frame-headers */ > > /* >@@ -488,6 +488,11 @@ > #define FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT 0x2E > #define FIELD_HT_INFORMATION 0x2F > #define FIELD_HT_ACTION_CODE 0x30 >+#define FIELD_VENDOR_OUI 0x31 /* Vendor Organization Unique Identifier */ >+#define FIELD_ACTION_TYPE 0x32 /* Vendor specific action type */ >+#define FIELD_MESH_RREQ 0x33 >+#define FIELD_MESH_RREP 0x34 >+#define FIELD_MESH_RERR 0x35 > > /* ************************************************************************* */ > /* Logical field codes (IEEE 802.11 encoding of tags) */ >@@ -546,6 +551,7 @@ > #define RSN_OUI (const guint8 *) "\x00\x0F\xAC" > #define WME_OUI (const guint8 *) "\x00\x50\xF2" > #define PRE_11N_OUI (const guint8 *) "\x00\x90\x4c" /* 802.11n pre 1 oui */ >+#define MRVL_OUI (const guint8 *) "\x00\x50\x43" > > #define PMKID_LEN 16 > >@@ -674,6 +680,14 @@ > #define HT_ACTION_MIMO_COMPRESSED_BEAMFORMING 6 > #define HT_ACTION_ANT_SEL_FEEDBACK 7 > #define HT_ACTION_HT_INFO_EXCHANGE 8 >+ >+#define MRVL_ACTION_MESH_MANAGEMENT 1 >+ >+#define MRVL_MESH_MGMT_ACTION_RREQ 0 >+#define MRVL_MESH_MGMT_ACTION_RREP 1 >+#define MRVL_MESH_MGMT_ACTION_RERR 2 >+#define MRVL_MESH_MGMT_ACTION_PLDM 3 >+ > /*** End: Action Fixed Parameter ***/ > > static int proto_wlan = -1; >@@ -874,6 +888,23 @@ > static int ff_src_mac_addr = -1; /* DLS source MAC addressi */ > static int ff_dls_timeout = -1; /* DLS timeout value */ > >+static int ff_vendor_oui = -1; /* Vendor OUI */ >+static int ff_action_type = -1; /* Action Type */ >+static int ff_mesh_mgt_action_code = -1;/* Mesh Management action code */ >+static int ff_mesh_mgt_length = -1; /* Mesh Management length */ >+static int ff_mesh_mgt_mode = -1; /* Mesh Management mode */ >+static int ff_mesh_mgt_ttl = -1; /* Mesh Management TTL */ >+static int ff_mesh_mgt_dstcount = -1; /* Mesh Management dst count */ >+static int ff_mesh_mgt_hopcount = -1; /* Mesh Management hop count */ >+static int ff_mesh_mgt_rreqid = -1; /* Mesh Management RREQ ID */ >+static int ff_mesh_mgt_sa = -1; /* Mesh Management src addr */ >+static int ff_mesh_mgt_ssn = -1; /* Mesh Management src sequence number */ >+static int ff_mesh_mgt_metric = -1; /* Mesh Management metric */ >+static int ff_mesh_mgt_flags = -1; /* Mesh Management RREQ flags */ >+static int ff_mesh_mgt_da = -1; /* Mesh Management dst addr */ >+static int ff_mesh_mgt_dsn = -1; /* Mesh Management dst sequence number */ >+static int ff_mesh_mgt_lifetime = -1; /* Mesh Management lifetime */ >+ > /*** Begin: Block Ack Action Fixed Field - Dustin Johnson ***/ > static int ff_ba_action = -1; > /*** End: Block Ack Action Fixed Field - Dustin Johnson ***/ >@@ -1356,8 +1387,15 @@ > static int hf_aironet_ie_qos_paramset = -1; > static int hf_aironet_ie_qos_val = -1; > >-/*QBSS - Version 1,2,802.11e*/ >+static int hf_marvell_ie_mesh_type = -1; >+static int hf_marvell_ie_mesh_subtype = -1; >+static int hf_marvell_ie_mesh_version = -1; >+static int hf_marvell_ie_mesh_active_proto_id = -1; >+static int hf_marvell_ie_mesh_active_metric_id = -1; >+static int hf_marvell_ie_mesh_cap = -1; > >+/* QBSS - Version 1,2,802.11e */ >+ > static int hf_qbss2_cal = -1; > static int hf_qbss2_gl = -1; > static int hf_qbss_cu = -1; >@@ -2362,6 +2400,59 @@ > length += 2; > break; > >+ case FIELD_VENDOR_OUI: >+ proto_tree_add_item (tree, ff_vendor_oui, tvb, offset, 3, TRUE); >+ length += 3; >+ break; >+ >+ case FIELD_ACTION_TYPE: >+ proto_tree_add_item (tree, ff_action_type, tvb, offset, 1, TRUE); >+ length += 1; >+ break; >+ >+ case FIELD_MESH_RREQ: >+ proto_tree_add_item (tree, ff_mesh_mgt_action_code, tvb, offset, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_length, tvb, offset + 1, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_mode, tvb, offset + 2, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_hopcount, tvb, offset + 3, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_ttl, tvb, offset + 4, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_rreqid, tvb, offset + 5, 4, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_sa, tvb, offset + 9, 6, FALSE); >+ proto_tree_add_item (tree, ff_mesh_mgt_ssn, tvb, offset + 15, 4, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_lifetime, tvb, offset + 19, 4, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_metric, tvb, offset + 23, 4, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_dstcount, tvb, offset + 27, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_flags, tvb, offset + 28, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_da, tvb, offset + 29, 6, FALSE); >+ proto_tree_add_item (tree, ff_mesh_mgt_dsn, tvb, offset + 35, 4, TRUE); >+ length += 39; >+ break; >+ >+ case FIELD_MESH_RREP: >+ proto_tree_add_item (tree, ff_mesh_mgt_action_code, tvb, offset, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_length, tvb, offset + 1, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_mode, tvb, offset + 2, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_hopcount, tvb, offset + 3, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_ttl, tvb, offset + 4, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_da, tvb, offset + 5, 6, FALSE); >+ proto_tree_add_item (tree, ff_mesh_mgt_dsn, tvb, offset + 11, 4, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_lifetime, tvb, offset + 15, 4, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_metric, tvb, offset + 19, 4, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_sa, tvb, offset + 23, 6, FALSE); >+ proto_tree_add_item (tree, ff_mesh_mgt_ssn, tvb, offset + 29, 4, TRUE); >+ length += 33; >+ break; >+ >+ case FIELD_MESH_RERR: >+ proto_tree_add_item (tree, ff_mesh_mgt_action_code, tvb, offset, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_length, tvb, offset + 1, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_mode, tvb, offset + 2, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_dstcount, tvb, offset + 3, 1, TRUE); >+ proto_tree_add_item (tree, ff_mesh_mgt_da, tvb, offset + 4, 6, FALSE); >+ proto_tree_add_item (tree, ff_mesh_mgt_dsn, tvb, offset + 10, 4, TRUE); >+ length += 14; >+ break; >+ > /*** Begin: DELBA Parameter Set Fixed Field - Dustin Johnson ***/ > case FIELD_DELBA_PARAM_SET: > { >@@ -2903,6 +2994,51 @@ > break; > } > >+ case CAT_VENDOR_SPECIFIC:/* Vendor Specific Category */ >+ switch (tvb_get_guint8(tvb, offset + 4)) >+ { >+ /* defined values */ >+ case MRVL_ACTION_MESH_MANAGEMENT: >+ switch (tvb_get_guint8(tvb, offset + 5)) >+ { /* Action Detail, or Action Code */ >+ case MRVL_MESH_MGMT_ACTION_RREQ: >+ add_fixed_field (action_tree, tvb, offset, >+ FIELD_CATEGORY_CODE); >+ add_fixed_field (action_tree, tvb, offset + 1, >+ FIELD_VENDOR_OUI); >+ add_fixed_field (action_tree, tvb, offset + 4, >+ FIELD_ACTION_TYPE); >+ add_fixed_field (action_tree, tvb, offset + 5, >+ FIELD_MESH_RREQ); >+ length = 44;/* Size of fixed fields */ >+ break; >+ case MRVL_MESH_MGMT_ACTION_RREP: >+ add_fixed_field (action_tree, tvb, offset, >+ FIELD_CATEGORY_CODE); >+ add_fixed_field (action_tree, tvb, offset + 1, >+ FIELD_VENDOR_OUI); >+ add_fixed_field (action_tree, tvb, offset + 4, >+ FIELD_ACTION_TYPE); >+ add_fixed_field (action_tree, tvb, offset + 5, >+ FIELD_MESH_RREP); >+ length = 38;/* Size of fixed fields */ >+ break; >+ case MRVL_MESH_MGMT_ACTION_RERR: >+ add_fixed_field (action_tree, tvb, offset, >+ FIELD_CATEGORY_CODE); >+ add_fixed_field (action_tree, tvb, offset + 1, >+ FIELD_VENDOR_OUI); >+ add_fixed_field (action_tree, tvb, offset + 4, >+ FIELD_ACTION_TYPE); >+ add_fixed_field (action_tree, tvb, offset + 5, >+ FIELD_MESH_RERR); >+ length = 19;/* Size of fixed fields */ >+ break; >+ } >+ break; >+ } >+ break; >+ > case CAT_HT: > { > guint start = 0; >@@ -3224,6 +3360,38 @@ > } > > typedef enum { >+ MARVELL_IE_MESH = 4 >+} marvell_ie_type_t; >+ >+static void >+dissect_vendor_ie_marvell(proto_item * item, proto_tree * ietree, >+ tvbuff_t * tvb, int offset, guint32 tag_len) >+{ >+ guint8 type; >+ int i; >+ gboolean dont_change = FALSE; /* Don't change the IE item text to default */ >+ >+ type = tvb_get_guint8(tvb, offset); >+ proto_tree_add_item (ietree, hf_marvell_ie_mesh_type, tvb, offset, 1, TRUE); >+ offset += 1; >+ >+ switch (type) { >+ case MARVELL_IE_MESH: >+ proto_tree_add_item (ietree, hf_marvell_ie_mesh_subtype, tvb, >+ offset++, 1, TRUE ); >+ proto_tree_add_item (ietree, hf_marvell_ie_mesh_version, tvb, >+ offset++, 1, TRUE ); >+ proto_tree_add_item (ietree, hf_marvell_ie_mesh_active_proto_id, tvb, >+ offset++, 1, TRUE ); >+ proto_tree_add_item (ietree, hf_marvell_ie_mesh_active_metric_id, tvb, >+ offset++, 1, TRUE ); >+ proto_tree_add_item (ietree, hf_marvell_ie_mesh_cap, tvb, >+ offset++, 1, TRUE ); >+ break; >+ } >+} >+ >+typedef enum { > AIRONET_IE_VERSION = 3, > AIRONET_IE_QOS, > AIRONET_IE_QBSS_V2 = 14 >@@ -4625,6 +4793,9 @@ > case PRE11N_OUI: > dissect_vendor_ie_ht(ti, tree, tag_tvb); > break; >+ case OUI_MARVELL: >+ dissect_vendor_ie_marvell(ti, tree, tvb, offset + 5, tag_len - 3); >+ break; > default: > tag_data_ptr = tvb_get_ptr(tag_tvb, 0, 3); > proto_tree_add_bytes_format (tree, tag_oui, tvb, offset + 2, 3, >@@ -7992,6 +8163,29 @@ > {0, NULL} > }; > >+ static const value_string vendor_action_types[] ={ >+ {MRVL_ACTION_MESH_MANAGEMENT, "Mesh Management"}, >+ {0, NULL} >+ }; >+ >+ static const value_string mesh_mgt_action_codes[] ={ >+ {MRVL_MESH_MGMT_ACTION_RREQ, "Route Request"}, >+ {MRVL_MESH_MGMT_ACTION_RREP, "Route Response"}, >+ {MRVL_MESH_MGMT_ACTION_RERR, "Route Error"}, >+ {MRVL_MESH_MGMT_ACTION_PLDM, "Peer Link Down"}, >+ {0, NULL} >+ }; >+ >+ static const value_string mesh_path_selection_codes[] ={ >+ {0x0, "Hybrid Wireless Mesh Protocol"}, >+ {0, NULL} >+ }; >+ >+ static const value_string mesh_metric_codes[] ={ >+ {0x0, "Airtime Link Metric"}, >+ {0, NULL} >+ }; >+ > static const value_string action_codes[] ={ > {SM_ACTION_MEASUREMENT_REQUEST, "Measurement Request"}, > {SM_ACTION_MEASUREMENT_REPORT, "Measurement Report"}, >@@ -9540,11 +9734,78 @@ > FT_UINT16, BASE_DEC, VALS (&category_codes), 0, > "Management action category", HFILL }}, > >+ {&ff_vendor_oui, >+ {"Vendor OUI", "wlan_mgt.fixed.vendor_oui", >+ FT_BYTES, BASE_NONE, NULL, 0, >+ "OUI of vendor specific Mgmt Frame", HFILL }}, >+ > {&ff_action_code, > {"Action code", "wlan_mgt.fixed.action_code", > FT_UINT16, BASE_DEC, VALS (&action_codes), 0, > "Management action code", HFILL }}, > >+ {&ff_action_type, >+ {"Action type", "wlan_mgt.fixed.action_type", >+ FT_UINT16, BASE_DEC, VALS (&vendor_action_types), 0, >+ "Vendor Specific Action Type", HFILL }}, >+ >+ {&ff_mesh_mgt_action_code, >+ {"Mesh action", "wlan_mgt.fixed.mesh_action", >+ FT_UINT16, BASE_HEX, VALS (&mesh_mgt_action_codes), 0, >+ "Mesh action code", HFILL }}, >+ >+ {&ff_mesh_mgt_length, >+ {"Message Length", "wlan_mgt.fixed.length", >+ FT_UINT8, BASE_DEC, NULL, 0, "Message Length", HFILL }}, >+ >+ {&ff_mesh_mgt_mode, >+ {"Message Mode", "wlan_mgt.fixed.mode", >+ FT_UINT8, BASE_HEX, NULL, 0, "Message Mode", HFILL }}, >+ >+ {&ff_mesh_mgt_ttl, >+ {"Message TTL", "wlan_mgt.fixed.ttl", >+ FT_UINT8, BASE_DEC, NULL, 0, "Message TTL", HFILL }}, >+ >+ {&ff_mesh_mgt_dstcount, >+ {"Destination Count", "wlan_mgt.fixed.dstcount", >+ FT_UINT8, BASE_DEC, NULL, 0, "Destination Count", HFILL }}, >+ >+ {&ff_mesh_mgt_hopcount, >+ {"Hop Count", "wlan_mgt.fixed.hopcount", >+ FT_UINT8, BASE_DEC, NULL, 0, "Hop Count", HFILL }}, >+ >+ {&ff_mesh_mgt_rreqid, >+ {"RREQ ID", "wlan_mgt.fixed.rreqid", >+ FT_UINT32, BASE_DEC, NULL, 0, "RREQ ID", HFILL }}, >+ >+ {&ff_mesh_mgt_sa, >+ {"Source Address", "wlan_mgt.fixed.sa", >+ FT_ETHER, BASE_NONE, NULL, 0, "Source MAC address", HFILL }}, >+ >+ {&ff_mesh_mgt_ssn, >+ {"SSN", "wlan_mgt.fixed.ssn", >+ FT_UINT32, BASE_DEC, NULL, 0, "Source Sequence Number", HFILL }}, >+ >+ {&ff_mesh_mgt_metric, >+ {"Metric", "wlan_mgt.fixed.metric", >+ FT_UINT32, BASE_DEC, NULL, 0, "Route Metric", HFILL }}, >+ >+ {&ff_mesh_mgt_flags, >+ {"RREQ Flags", "wlan_mgt.fixed.hopcount", >+ FT_UINT8, BASE_HEX, NULL, 0, "RREQ Flags", HFILL }}, >+ >+ {&ff_mesh_mgt_da, >+ {"Destination Address", "wlan_mgt.fixed.da", >+ FT_ETHER, BASE_NONE, NULL, 0, "Destination MAC address", HFILL }}, >+ >+ {&ff_mesh_mgt_dsn, >+ {"DSN", "wlan_mgt.fixed.dsn", >+ FT_UINT32, BASE_DEC, NULL, 0, "Destination Sequence Number", HFILL }}, >+ >+ {&ff_mesh_mgt_lifetime, >+ {"Lifetime", "wlan_mgt.fixed.lifetime", >+ FT_UINT32, BASE_DEC, NULL, 0, "Route Lifetime", HFILL }}, >+ > {&ff_dialog_token, > {"Dialog token", "wlan_mgt.fixed.dialog_token", > FT_UINT8, BASE_HEX, NULL, 0, "Management action dialog token", HFILL }}, >@@ -10519,6 +10780,30 @@ > FT_STRING, BASE_NONE, NULL, 0, "Alternate Regulatory Classes", HFILL }}, > /*** End: Supported Regulatory Classes Tag - Dustin Johnson ***/ > >+ {&hf_marvell_ie_mesh_type, >+ {"Type", "wlan_mgt.marvell.ie.type", >+ FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }}, >+ >+ {&hf_marvell_ie_mesh_subtype, >+ {"Subtype", "wlan_mgt.marvell.ie.subtype", >+ FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }}, >+ >+ {&hf_marvell_ie_mesh_version, >+ {"Version", "wlan_mgt.marvell.ie.version", >+ FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }}, >+ >+ {&hf_marvell_ie_mesh_active_proto_id, >+ {"Path Selection Protocol", "wlan_mgt.marvell.ie.proto_id", >+ FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0, "", HFILL }}, >+ >+ {&hf_marvell_ie_mesh_active_metric_id, >+ {"Path Selection Metric", "wlan_mgt.marvell.ie.metric_id", >+ FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0, "", HFILL }}, >+ >+ {&hf_marvell_ie_mesh_cap, >+ {"Mesh Capabilities", "wlan_mgt.marvell.ie.cap", >+ FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }}, >+ > {&hf_aironet_ie_type, > {"Aironet IE type", "wlan_mgt.aironet.type", > FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0, "Aironet IE type", HFILL }}, >Index: epan/dissectors/packet-llc.c >=================================================================== >--- epan/dissectors/packet-llc.c (revision 24481) >+++ epan/dissectors/packet-llc.c (working copy) >@@ -209,7 +209,8 @@ > { OUI_CABLE_BPDU, "DOCSIS Spanning Tree" }, /* DOCSIS spanning tree BPDU */ > { OUI_SIEMENS, "Siemens AG" }, > { OUI_APPLE_ATALK, "Apple (AppleTalk)" }, >- { OUI_HP, "Hewlett-Packard" }, >+ { OUI_HP, "Hewlett-Packard" }, >+ { OUI_MARVELL, "Marvell Semiconductor" }, > { 0, NULL } > }; > >@@ -350,6 +351,7 @@ > > case OUI_ENCAP_ETHER: > case OUI_CISCO_90: >+ case OUI_MARVELL: > case OUI_APPLE_ATALK: > /* No, I have no idea why Apple used > one of their own OUIs, rather than >@@ -451,6 +453,7 @@ > proto_tree *llc_tree = NULL; > proto_item *ti = NULL; > int is_snap; >+ int offset = 0; > guint16 control; > int llc_header_len; > guint8 dsap, ssap, format; >@@ -464,27 +467,34 @@ > } > > dsap = tvb_get_guint8(tvb, 0); >+ ssap = tvb_get_guint8(tvb, 1); >+ >+ if (dsap == SAP_NULL && ssap == SAP_NULL) { >+ offset = 2; >+ dsap = tvb_get_guint8(tvb, 2); >+ ssap = tvb_get_guint8(tvb, 3); >+ } >+ > if (tree) { >- ti = proto_tree_add_item(tree, proto_llc, tvb, 0, -1, FALSE); >+ ti = proto_tree_add_item(tree, proto_llc, tvb, offset, -1, FALSE); > llc_tree = proto_item_add_subtree(ti, ett_llc); >- proto_tree_add_uint(llc_tree, hf_llc_dsap, tvb, 0, >+ proto_tree_add_uint(llc_tree, hf_llc_dsap, tvb, offset, > 1, dsap & SAP_MASK); >- proto_tree_add_boolean(llc_tree, hf_llc_dsap_ig, tvb, 0, >+ proto_tree_add_boolean(llc_tree, hf_llc_dsap_ig, tvb, offset, > 1, dsap & DSAP_GI_BIT); > } else > llc_tree = NULL; > >- ssap = tvb_get_guint8(tvb, 1); > if (tree) { >- proto_tree_add_uint(llc_tree, hf_llc_ssap, tvb, 1, >+ proto_tree_add_uint(llc_tree, hf_llc_ssap, tvb, offset + 1, > 1, ssap & SAP_MASK); >- proto_tree_add_boolean(llc_tree, hf_llc_ssap_cr, tvb, 1, >+ proto_tree_add_boolean(llc_tree, hf_llc_ssap_cr, tvb, offset + 1, > 1, ssap & SSAP_CR_BIT); > } else > llc_tree = NULL; > > is_snap = (dsap == SAP_SNAP) && (ssap == SAP_SNAP); >- llc_header_len = 2; /* DSAP + SSAP */ >+ llc_header_len = 2 + offset; /* DSAP + SSAP */ > > /* > * XXX - the page referred to in the comment above about the >@@ -492,7 +502,7 @@ > * uses extended operation, so we don't need to determine > * whether it's basic or extended operation; is that the case? > */ >- control = dissect_xdlc_control(tvb, 2, pinfo, llc_tree, >+ control = dissect_xdlc_control(tvb, offset + 2, pinfo, llc_tree, > hf_llc_ctrl, ett_llc_ctrl, > &llc_cf_items, &llc_cf_items_ext, > NULL, NULL, ssap & SSAP_CR_BIT, TRUE, FALSE); >@@ -504,7 +514,7 @@ > proto_item_set_len(ti, llc_header_len); > > if (is_snap) { >- dissect_snap(tvb, 3, pinfo, tree, llc_tree, control, >+ dissect_snap(tvb, offset + 3, pinfo, tree, llc_tree, control, > hf_llc_oui, hf_llc_type, hf_llc_pid, 2); > } > else { >@@ -539,7 +549,7 @@ > * Non-SNAP XID frame. > * Test for LLC basic format first > */ >- format = tvb_get_guint8(next_tvb, 0); >+ format = tvb_get_guint8(next_tvb, offset); > if (format == 0x81) { > dissect_basicxid(next_tvb, pinfo, tree); > } else { >@@ -594,6 +604,8 @@ > > switch (oui) { > >+ case OUI_MARVELL: >+ pinfo->private_data = (void *) OUI_MARVELL; > case OUI_ENCAP_ETHER: > case OUI_CISCO_90: > case OUI_APPLE_ATALK: >--- /dev/null 2008-02-26 11:10:04.048000000 -0500 >+++ epan/dissectors/packet-mesh.c 2008-02-26 17:21:20.000000000 -0500 >@@ -0,0 +1,147 @@ >+/* packet-mesh-header.c >+ * Routines for Mesh Header dissection >+ * Javier Cardona <javier@cozbyit.com> >+ * Copyright 2007, Marvell Semiconductors Inc. >+ * >+ * $Id$ >+ * >+ * Wireshark - Network traffic analyzer >+ * By Gerald Combs <gerald@wireshark.org> >+ * Copyright 1998 Gerald Combs >+ * >+ * This program is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU General Public License >+ * as published by the Free Software Foundation; either version 2 >+ * of the License, or (at your option) any later version. >+ * >+ * This program is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+ * GNU General Public License for more details. >+ * >+ * You should have received a copy of the GNU General Public License >+ * along with this program; if not, write to the Free Software >+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. >+ */ >+ >+#ifdef HAVE_CONFIG_H >+# include "config.h" >+#endif >+ >+#include <stdio.h> >+#include <stdlib.h> >+#include <string.h> >+ >+#include <glib.h> >+ >+#include <epan/packet.h> >+#include <epan/prefs.h> >+#include <epan/etypes.h> >+#include <epan/oui.h> >+ >+/* Forward declaration we need below */ >+void proto_reg_handoff_mesh(void); >+ >+static dissector_table_t mesh_dissector_table = NULL; >+ >+/* Initialize the protocol and registered fields */ >+static int proto_mesh = -1; >+static int hf_mesh_ttl = -1; >+static int hf_mesh_e2eseq = -1; >+ >+/* Initialize the subtree pointers */ >+static gint ett_mesh = -1; >+ >+/* Code to actually dissect the packets */ >+static int >+dissect_mesh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) >+{ >+ >+ /* Set up structures needed to add the protocol subtree and manage it */ >+ proto_item *ti; >+ proto_tree *mesh_tree; >+ guint8 mesh_ttl; >+ guint16 mesh_e2eseq; >+ >+ /* Mesh frames have Marvell OUI in SNAP header */ >+ if ( (pinfo->ethertype != ETHERTYPE_IP && >+ pinfo->ethertype != ETHERTYPE_ARP) >+ || pinfo->private_data != (void*) OUI_MARVELL) >+ return 0; >+ >+ /* Make entries in Protocol column and Info column on summary display */ >+ if (check_col(pinfo->cinfo, COL_PROTOCOL)) >+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "Mesh"); >+ >+ if (tree) { >+ >+ /* create display subtree for the protocol */ >+ ti = proto_tree_add_item(tree, proto_mesh, tvb, 0, -1, FALSE); >+ >+ mesh_tree = proto_item_add_subtree(ti, ett_mesh); >+ >+ mesh_ttl = tvb_get_guint8(tvb, 2); >+ mesh_e2eseq = tvb_get_ntohs(tvb, 3); >+ >+ /* add an item to the subtree, see section 1.6 for more information */ >+ proto_tree_add_uint(mesh_tree, >+ hf_mesh_ttl, tvb, 2, 1, mesh_ttl); >+ proto_tree_add_uint(mesh_tree, >+ hf_mesh_e2eseq, tvb, 3, 2, mesh_e2eseq); >+ } >+ >+ /* Return the amount of data this dissector was able to dissect */ >+ return 5; >+} >+ >+ >+/* Register the protocol with Wireshark */ >+ >+/* this format is require because a script is used to build the C function >+ that calls all the protocol registration. >+*/ >+ >+void >+proto_register_mesh(void) >+{ >+ module_t *mesh_module; >+ >+ /* Setup list of header fields See Section 1.6.1 for details*/ >+ static hf_register_info hf[] = { >+ { &hf_mesh_ttl, >+ { "Mesh TTL", "mesh.ttl", FT_UINT8, BASE_DEC, >+ NULL, 0x0, "", HFILL }}, >+ >+ { &hf_mesh_e2eseq, >+ { "Mesh End-to-end Seq", "mesh.e2eseq", FT_UINT16, BASE_HEX, >+ NULL, 0x0, "", HFILL }}, >+ }; >+ >+ /* Setup protocol subtree array */ >+ static gint *ett[] = { >+ &ett_mesh >+ }; >+ >+ /* Register the protocol name and description */ >+ proto_mesh = proto_register_protocol("Mesh Header", >+ "Mesh", "mesh"); >+ >+ /* Required function calls to register the header fields and subtrees used */ >+ proto_register_field_array(proto_mesh, hf, array_length(hf)); >+ proto_register_subtree_array(ett, array_length(ett)); >+ >+ /* Register preferences module (See Section 2.6 for more on preferences) */ >+ mesh_module = prefs_register_protocol(proto_mesh, >+ proto_reg_handoff_mesh); >+} >+ >+void >+proto_reg_handoff_mesh(void) >+{ >+ static gboolean inited = FALSE; >+ >+ if (!inited) { >+ new_register_dissector("mesh", dissect_mesh, proto_mesh); >+ inited = TRUE; >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 435366
: 296260 |
296262