diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2011-02-02 23:21:16 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2011-02-02 23:21:16 +0000 |
commit | 82cbbca3e50e41468de1ecbef43d02d51562bf4e (patch) | |
tree | ada8cfe8dd6609349add52a63e8ee233964316d4 | |
parent | 77333de27890a968c52a93d47547b70eff8a3540 (diff) |
Add and use accessors to get/set per-packet data for LTE MAC.
This will allow plugins to use the dissector.
svn path=/trunk/; revision=35774
-rw-r--r-- | epan/dissectors/packet-catapult-dct2000.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-mac-lte.c | 13 | ||||
-rw-r--r-- | epan/dissectors/packet-mac-lte.h | 6 | ||||
-rw-r--r-- | epan/libwireshark.def | 2 |
4 files changed, 26 insertions, 5 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c index b24583e1df..f7ce3d4ea0 100644 --- a/epan/dissectors/packet-catapult-dct2000.c +++ b/epan/dissectors/packet-catapult-dct2000.c @@ -196,7 +196,6 @@ static guint outhdr_values[MAX_OUTHDR_VALUES]; static gint outhdr_values_found = 0; extern int proto_fp; -extern int proto_mac_lte; extern int proto_rlc_lte; extern int proto_pdcp_lte; @@ -1403,7 +1402,7 @@ static void attach_mac_lte_info(packet_info *pinfo) unsigned int i=0; /* Only need to set info once per session. */ - p_mac_lte_info = p_get_proto_data(pinfo->fd, proto_mac_lte); + p_mac_lte_info = get_mac_lte_proto_data(pinfo); if (p_mac_lte_info != NULL) { return; } @@ -1473,6 +1472,7 @@ static void attach_mac_lte_info(packet_info *pinfo) } } else { + /* Uplink */ p_mac_lte_info->detailed_phy_info.ul_info.present = outhdr_values[i++]; p_mac_lte_info->detailed_phy_info.ul_info.modulation_type = outhdr_values[i++]; p_mac_lte_info->detailed_phy_info.ul_info.tbs_index = outhdr_values[i++]; @@ -1496,7 +1496,7 @@ static void attach_mac_lte_info(packet_info *pinfo) } /* Store info in packet */ - p_add_proto_data(pinfo->fd, proto_mac_lte, p_mac_lte_info); + set_mac_lte_proto_data(pinfo, p_mac_lte_info); } @@ -1663,7 +1663,7 @@ static void check_for_oob_mac_lte_events(packet_info *pinfo, tvbuff_t *tvb, prot /* We have an event */ /* Only need to set info once per session. */ - p_mac_lte_info = p_get_proto_data(pinfo->fd, proto_mac_lte); + p_mac_lte_info = get_mac_lte_proto_data(pinfo); if (p_mac_lte_info == NULL) { /* Allocate & zero struct */ @@ -1695,7 +1695,7 @@ static void check_for_oob_mac_lte_events(packet_info *pinfo, tvbuff_t *tvb, prot p_mac_lte_info->oob_event = oob_event; /* Store info in packet */ - p_add_proto_data(pinfo->fd, proto_mac_lte, p_mac_lte_info); + set_mac_lte_proto_data(pinfo, p_mac_lte_info); } /* Call MAC dissector */ diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c index bc7a27ce75..9045993061 100644 --- a/epan/dissectors/packet-mac-lte.c +++ b/epan/dissectors/packet-mac-lte.c @@ -4084,6 +4084,19 @@ void proto_register_mac_lte(void) register_init_routine(&mac_lte_init_protocol); } + +/* Function to be called from outside this module (e.g. in a plugin) to get per-packet data */ +mac_lte_info *get_mac_lte_proto_data(packet_info *pinfo) +{ + return p_get_proto_data(pinfo->fd, proto_mac_lte); +} + +/* Function to be called from outside this module (e.g. in a plugin) to set per-packet data */ +void set_mac_lte_proto_data(packet_info *pinfo, mac_lte_info *p_mac_lte_info) +{ + p_add_proto_data(pinfo->fd, proto_mac_lte, p_mac_lte_info); +} + void proto_reg_handoff_mac_lte(void) { diff --git a/epan/dissectors/packet-mac-lte.h b/epan/dissectors/packet-mac-lte.h index a3a02d8d87..b342685c3d 100644 --- a/epan/dissectors/packet-mac-lte.h +++ b/epan/dissectors/packet-mac-lte.h @@ -242,3 +242,9 @@ int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction); continues until the end of the frame) */ #define MAC_LTE_PAYLOAD_TAG 0x01 + +/* Functions to be called from outside this module (e.g. in a plugin, where mac_lte_info + isn't available) to get/set per-packet data */ +mac_lte_info *get_mac_lte_proto_data(packet_info *pinfo); +void set_mac_lte_proto_data(packet_info *pinfo, mac_lte_info *p_mac_lte_info); + diff --git a/epan/libwireshark.def b/epan/libwireshark.def index fe7bdabe7f..7354fe9b43 100644 --- a/epan/libwireshark.def +++ b/epan/libwireshark.def @@ -549,6 +549,7 @@ get_host_ipaddr6 get_hostname get_hostname6 get_key_string +get_mac_lte_proto_data get_manuf_name_if_known get_persconffile_path get_persdatafile_dir @@ -932,6 +933,7 @@ set_column_resolved set_column_title set_column_visible set_actual_length +set_mac_lte_proto_data set_profile_name set_tap_dfilter show_exception |