Wireshark-dev: Re: [Wireshark-dev] Dissector bug
From: "Rach, Darshan" <DarshanR@xxxxxxx>
Date: Fri, 8 Jan 2010 18:12:52 +0530

I am still unable to solve this issue.

I get the error immediately after executing this piece of code:

 

reserved = ((tvb_get_guint8(tvb, packet_field_offset) & 0xc0) >> 6);

proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);

 

Line 1490 in the attached packet dissector code file.

 

Your inputs would help me a lot J

 

+Darshan

From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Jan Gerbecks
Sent: Friday, January 08, 2010 4:31 PM
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] Dissector bug

 

Hi,

 

that usually means you forget to either: 

initialize a variable 

or didn't add it to the hf[] or ett[] array.

 

Take a closer look there,

Jan

 

On 08.01.2010, at 07:09, Rach, Darshan wrote:



Hi,

 

I am getting the following error:

[Dissector bug, protocol DASH: proto.c:2457: failed assertion "(guint)hfindex < gpa_hfinfo.len"]

 

My code looks like this:

 

static gint hf_epg_info_bits_len = -1;

 

{&hf_epg_info_bits_len,

{"EPG Info Bits Length","oqtp.epg_info_bits_len",FT_UINT8, BASE_DEC,NULL, 0x0,

"EPG Info Bits Length", HFILL}},

 

epg_info_bits_len = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0xf);

proto_tree_add_uint(sub_tree, hf_epg_info_bits_len, next_tvb, packet_field_offset, 1, epg_info_bits_len);

packet_field_offset += 1;

 

Kindly help.

 

+Darshan

 


This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster@xxxxxxx and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.
To protect the environment please do not print this e-mail unless necessary.

An NDS Group Limited company. www.nds.com
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe

 



This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster@xxxxxxx and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.
To protect the environment please do not print this e-mail unless necessary.

An NDS Group Limited company. www.nds.com
/* packet-dash.c
* 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/reassemble.h>
#include <epan/next_tvb.h>
#include <string.h>

#define PROTO_TAG_DASH	"DASH"
#define DEFAULT_OQTP_UDP_PORT (32773)

/* OQTP Packet Types */
#define OQTP_PACKET_OPCODE_RQ       (1)
#define OQTP_PACKET_OPCODE_BRQ      (2)
#define OQTP_PACKET_OPCODE_DATA     (3)
#define OQTP_PACKET_OPCODE_RESERVED (4)
#define OQTP_PACKET_OPCODE_ERROR    (5)

/* Wireshark ID of the DASH protocol */
static int proto_dash = -1;

/* These are the handles of our subdissectors */
static dissector_handle_t data_handle=NULL;
static dissector_handle_t dash_handle;

/* Function prototypes */
void proto_register_dash();
void proto_reg_handoff_dash();
static void msg_init_protocol();
void dissect_dash(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
/*structure functions*/
void append(struct node **,int);
void del(struct node **,int);
int search(struct node**q,int num);
void display(struct node *q);

static int global_dash_port = DEFAULT_OQTP_UDP_PORT;

static gint hf_oqtp_opcode = -1;
static gint hf_oqtp_msgid = -1;
static gint hf_oqtp_last_packet_flag = -1;
static gint hf_oqtp_response_size = -1;
static gint hf_oqtp_data_packet_block_number = -1;
static gint hf_oqtp_error_code = -1;
static gint hf_oqtp_error_string = -1;
static gint hf_oqtp_root_path = -1;
static gint hf_oqtp_method = -1;
static gint hf_oqtp_reserved = -1;
static gint hf_catalogue_id = -1;
static gint hf_classif_id = -1;
static gint hf_direction = -1;
static gint hf_category_type = -1;
static gint hf_parental_rating = -1;
static gint hf_loc_classif_id = -1;
static gint hf_loc_order_num = -1;
static gint hf_loc_name_length = -1;
static gint hf_loc_name = -1;
static gint hf_request_satisfied = -1;
static gint hf_reserved_for_future_use = -1;
static gint hf_no_extended_pd_syntax = -1;
static gint hf_num_classifications = -1;
static gint hf_order_num = -1;
static gint hf_order_num_2byte = -1;
static gint hf_name_length = -1;
static gint hf_name = -1;
static gint hf_description_length = -1;
static gint hf_description = -1;
static gint hf_private_data_length = -1;
static gint hf_private_data_byte = -1;
static gint hf_private_data_byte_string = -1;
static gint hf_asset_list_string = -1;
static gint hf_x_private_data_length = -1;
static gint hf_x_private_data_byte = -1;
static gint hf_lang = -1;
static gint hf_skip_count = -1;
static gint hf_count = -1;
static gint hf_private_data_len = -1;
static gint hf_reserved_bits = -1;
static gint hf_classification_string = -1;
static gint hf_private_data_string = -1;
static gint hf_classif_key_len = -1;
static gint hf_classif_key = -1;
/*Asset Info*/
static gint hf_sort_order_type = -1;
static gint hf_no_locator_flag = -1;
static gint hf_search_type = -1;
static gint hf_name_len = -1;
static gint hf_credits_classif_id = -1;
static gint hf_given_name_len = -1;
static gint hf_given_name = -1;
static gint hf_family_name_len = -1;
static gint hf_family_name = -1;
static gint hf_reserved = -1;
static gint hf_title_len = -1;
static gint hf_title = -1;
static gint hf_organisation_classif_id = -1;
static gint hf_organisation_name_len = -1;
static gint hf_organisation_name = -1;
static gint hf_keyword_num = -1;
static gint hf_keyword_len = -1;
static gint hf_keyword = -1;
static gint hf_currency_code = -1;
static gint hf_sub = -1;
static gint hf_ippv = -1;
static gint hf_oppv = -1;
static gint hf_asset_types = -1;
static gint hf_group_type = -1;
static gint hf_primary_assets_flag = -1;
static gint hf_loc_asset_name_len = -1;
static gint hf_loc_asset_name = -1;
static gint hf_loc_branding_name_len = -1;
static gint hf_loc_branding_name = -1;
static gint hf_loc_programme_id = -1;
static gint hf_loc_rank = -1;
static gint hf_loc2_programme_id = -1;
static gint hf_asset_num = -1;
static gint hf_programme_id = -1;
static gint hf_duration = -1;
static gint hf_duration_4byte = -1;
static gint hf_price = -1;
static gint hf_telephone_code = -1;
static gint hf_has_media = -1;
static gint hf_is_ippv = -1;
static gint hf_is_oppv = -1;
static gint hf_is_free_of_ca = -1;
static gint hf_is_sub = -1;
static gint hf_asset_type = -1;
static gint hf_group_id = -1;
static gint hf_group_sub_type = -1;
static gint hf_group_num = -1;
static gint hf_max_episode_num = -1;
static gint hf_epg_info_bits_len = -1;
static gint hf_epg_info_bits = -1;
static gint hf_exhibition_date_time = -1;
static gint hf_rank = -1;
static gint hf_rank_text_len = -1;
static gint hf_rank_text = -1;
static gint hf_episode_title_len = -1;
static gint hf_episode_title = -1;
static gint hf_series_info_len = -1;
static gint hf_series_info = -1;
static gint hf_branding_name_len = -1;
static gint hf_branding_name = -1;
/*AssetExtendedInfoEx*/
static gint hf_provider_id_len = -1;
static gint hf_provider_id = -1;
static gint hf_asset_id_len = -1;
static gint hf_asset_id = -1;
static gint hf_is_catchup_tv = -1;
static gint hf_vod_delivery_flag = -1;
static gint hf_pdl_delivery_flag = -1;
static gint hf_dl_delivery_flag = -1;
static gint hf_is_not_presentation_group = -1;
static gint hf_user_nibble_1 = -1;
static gint hf_user_nibble_2 = -1;
static gint hf_reserved_0 = -1;
static gint hf_asset_type_classif_id = -1;
static gint hf_reserved_text_len = -1;
static gint hf_reserved_text = -1;
static gint hf_description_len = -1;
static gint hf_marketing_msg_len = -1;
static gint hf_marketing_msg = -1;
static gint hf_num_of_offers = -1;
static gint hf_last_offer_end_date_time = -1;

/* These are the ids of the subtrees that we may be creating */
static gint ett_oqtp_opcode = -1;
static gint ett_oqtp_msgid = -1;
static gint ett_oqtp_last_packet_flag = -1;
static gint ett_oqtp_response_size = -1;
static gint ett_oqtp_data_packet_block_number = -1;
static gint ett_oqtp_error_code = -1;
static gint ett_oqtp_error_string = -1;
static gint ett_oqtp_root_path = -1;
static gint ett_oqtp_method = -1;
static gint ett_oqtp_reserved = -1;
static gint ett_private_data_byte = -1;
static gint ett_classification_list = -1;
static gint ett_classification_id_list = -1;
static gint ett_epg_info_bits_len = -1;
static gint ett_epg_info_bits = -1;
static gint oqtp_subtree_1 = -1;
static gint private_data_subtree = -1;
static gint classification_subtree = -1;
static gint classification_id_subtree = -1;
static gint subtree_highlevel = -1;

static const value_string packettypenames[] = {
	{ 1, "RQ - Call" },
	{ 2, "BRQ - Burst Call" },
	{ 3, "DATA" },
	{ 4, "RESERVED" },
	{ 5, "ERROR" },
    { 0, NULL }
};

static const value_string methodtypenames[] = {
	{ 1, "RQ - Call" },
	{ 2, "BRQ - Burst Call" },
	{ 3, "DATA" },
	{ 4, "RESERVED" },
	{ 5, "ERROR" },
    { 0, NULL }
};

static const value_string group_type_coding[] = {
	{ 0, "Undefined" },
	{ 1, "Series" },
	{ 2, "Push" },
	{ 3, "Pull" },
	{ 4, "Push VOD" },
	{ 5, "Not Used" },
	{ 6, "PPV" },
    { 7, "Presentation" },
};

static const value_string group_sub_type_coding[] = {
	{ 0, "Undefined / Normal" },
	{ 1, "Sequential closed / Collapsing" },
	{ 2, "Sequential Open" },
	{ 3, "Open" }
};

static const value_string reserved_field_coding[] = {
    { 1, "fragment" },
    { 2, "last_fragment" },
    { 0, NULL }
};

static const value_string primary_assets_flag_coding[] = {
    { 0, "Returns assets within the collapsed/collection/group asset" },
    { 1, "Returns the primary assets " }
};

static const value_string asset_type_coding[] = {
    { 00, "Single Asset" },
    { 01, "Collapsed Asset" },
    { 10, "Collection Asset" },
    { 11, "Group Asset" }
};


static const value_string direction_field_coding[] = {
    { 0, "Forwards" },
    { 1, "Backwards" }
};

static const value_string sub_coding[] = {
    { 0, "No subscription filter" },
    { 1, "Filter for subscription assets"}
};

static const value_string ippv_coding[] = {
    { 0, "No IPPV filter" },
    { 1, "Filter for IPPV assets"}
};

static const value_string oppv_coding[] = {
    { 0, "No OPPV filter" },
    { 1, "Filter for OPPV assets"}
};

static const value_string request_satisfied_coding[] = {
	{ 1, "Request Satisfied"},
	{ 0, "Incomplete Data"}
};

static const value_string no_extended_pd_syntax_coding[] = {
	{ 0, "Media Descriptor Present"},
	{ 1, "Media Descriptor Not Present"}
};


static const range_string category_type_request_coding[] = {
	{0 , 0, "wildcard"},
	{1 , 1, "Genre"},
	{2 , 2, "Content Type"},
	{3 , 3, "Credits"},
	{4 , 4, "Ranking"},
	{5 , 5, "Parental Rating"},
	{6 , 6, "Label"},
	{7 , 7, "A - Z"},
	{8 , 8, "Media"},
	{9 , 9, "Rank"},
	{10, 10,"Editorially Controlled"},
	{11, 11,"Button"},
	{12, 12,"Listing"},
	{13, 13,"Provider Group"},
	{14, 14,"Ask Parent"},/*FIXME: data inbetween is unknown*/
	{50, 99, "Deployment specific"}
};

static const range_string category_type_response_coding[] = {
	{0 , 0, "reserved"},
	{1 , 1, "Genre"},
	{2 , 2, "Content Type"},
	{3 , 3, "Credits"},
	{4 , 4, "Ranking"},
	{5 , 5, "Parental Rating"},
	{6 , 6, "Label"},
	{7 , 7, "A - Z"},
	{8 , 8, "Media"},
	{9 , 9, "Rank"},
	{10, 10,"Editorially Controlled"},
	{11, 11,"Button"},
	{12, 12,"Listing"},
	{13, 13,"Provider Group"},
	{14, 14,"Ask Parent"},/*FIXME: data inbetween is unknown*/
	{50, 99, "Deployment specific"}
};

static const value_string sort_order_type_coding[]={
	{ 00, "A-Z sort by asset lexical"},
	{ 01, "A-Z sort by lexical"},
	{ 10, "Rank order based on the supplied ranking"},
};

static const value_string no_locator_flag_coding[]={
	{ 0, "Use locator data to seed assets"},
	{ 1, "Use search string to locate assets"}
};

static const value_string search_type_coding[]={
	{ 000, "Not Defined"},
	{ 001, "Asset or branding/provider name"},
	{ 010, "Person Data"},
	{ 011, "Character Data"},
	{ 100, "Organisation Data"},
	{ 101, "Keyword Data"}
};

static const value_string asset_types_coding[]={
	{ 000, "All Assets"},
	{ 001, "Single/collapsed Assets"},
	{ 010, "Collection Asset"},
	{ 011, "Group Asset"}
};


static int hf_msg_fragments = -1;
static int hf_msg_fragment = -1;
static int hf_msg_fragment_overlap = -1;
static int hf_msg_fragment_overlap_conflicts = -1;
static int hf_msg_fragment_multiple_tails = -1;
static int hf_msg_fragment_too_long_fragment = -1;
static int hf_msg_fragment_error = -1;
static int hf_msg_reassembled_in = -1;

static gint ett_msg_fragment = -1;
static gint ett_msg_fragments = -1;

static const fragment_items msg_frag_items = {
	/* Fragment subtrees */
	&ett_msg_fragment,
	&ett_msg_fragments,
	/* Fragment fields */
	&hf_msg_fragments,
	&hf_msg_fragment,
	&hf_msg_fragment_overlap,
	&hf_msg_fragment_overlap_conflicts,
	&hf_msg_fragment_multiple_tails,
	&hf_msg_fragment_too_long_fragment,
	&hf_msg_fragment_error,
	/* Reassembled in field */
	&hf_msg_reassembled_in,
	/* Tag */
	"Message fragments"
};

/* private data subtree array */
static gint *private_data_subtree_array[] = {
	&ett_private_data_byte,
	&private_data_subtree,
	/* Fragment subtrees */
	&ett_msg_fragment,
	&ett_msg_fragments,
};

/* private data subtree array */
static gint *subtree_highlevel_array[] = {
	&subtree_highlevel,
	/* Fragment subtrees */
	&ett_msg_fragment,
	&ett_msg_fragments,
};

/* private data subtree array */
static gint *classification_id_subtree_array[] = {
	&ett_classification_id_list ,
	&classification_id_subtree,
	/* Fragment subtrees */
	&ett_msg_fragment,
	&ett_msg_fragments,
};

/* Classification subtree array */
static gint *classification_subtree_array[] = {
	&ett_classification_list,
	&classification_subtree,
	/* Fragment subtrees */
	&ett_msg_fragment,
	&ett_msg_fragments,
};

/* OQTP protocol subtree array */
static gint *oqtp_subtree_array[] = {
	&ett_oqtp_opcode,
	&ett_oqtp_last_packet_flag,
	&ett_oqtp_msgid,
	&ett_oqtp_response_size,
	&ett_oqtp_data_packet_block_number,
	&ett_oqtp_error_code,
	&ett_oqtp_error_string,
	&ett_oqtp_root_path,
	&ett_oqtp_method,
	&ett_oqtp_reserved,
	&ett_epg_info_bits_len,
	&ett_epg_info_bits,
	&oqtp_subtree_1,
	/* Fragment subtrees */
	&ett_msg_fragment,
	&ett_msg_fragments
};

/* OQTP packet fields */
static hf_register_info hf_oqtp[] = {
	{&hf_oqtp_opcode,
	{"Opcode", "oqtp.opcode",FT_UINT16, BASE_DEC,NULL, 0x0,
	 "Packet Type --> 1 - RQ ; 2 - BRQ ; 3 - DATA ; 4 - Reserved ; 5 - ERROR", HFILL}},
	{&hf_oqtp_reserved,
	{"Reserved", "oqtp.reserved",FT_UINT8, BASE_DEC,NULL, 0x0,
	 "Reserved for future use", HFILL}},
	{&hf_oqtp_last_packet_flag,
	{"Last Packet Flag", "oqtp.last_packet_flag",FT_UINT8, BASE_DEC,NULL, 0x0,
	 "Last packet in response group", HFILL}},
	{&hf_oqtp_msgid,
	{"Message ID", "oqtp.msg_id",FT_UINT16, BASE_DEC,NULL, 0x0,
	 "Message ID used to match request & response", HFILL}},
	{&hf_oqtp_response_size,
	{"Response Size", "oqtp.response_size",FT_UINT16, BASE_DEC,NULL, 0x0,
	 "Response Size for response data to use within DATA responses", HFILL}},
	{&hf_oqtp_data_packet_block_number,
	{"Block Number", "oqtp.block_number",FT_UINT16, BASE_DEC,NULL, 0x0,
	 "Block Number", HFILL}},
	{&hf_oqtp_error_code,
	{"Error code", "oqtp.error_code",FT_UINT16, BASE_DEC,NULL, 0x0,
	 "Error code", HFILL}},
	{&hf_oqtp_error_string,
	{"Error String", "oqtp.error_string",FT_STRINGZ, BASE_CUSTOM,NULL, 0x0,
	 "Error String", HFILL}},
	{&hf_oqtp_root_path,
	{"Root Path", "oqtp.root_path",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	 "Root Path", HFILL}},
	{&hf_oqtp_method,
	{"Method", "oqtp.method",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	 "Class & Method", HFILL}},
	{&hf_catalogue_id,
	{"Catalogue ID","oqtp.catalogue_id",FT_UINT16, BASE_DEC,NULL, 0x0,
	 "Catalogue ID", HFILL}},
	{&hf_classif_id,
	{"Classification ID","oqtp.classif_id",FT_UINT16, BASE_DEC,NULL, 0x0,
	 "Classification ID", HFILL}},
	{&hf_direction,
	{"Direction","oqtp.direction",FT_UINT8, BASE_DEC,NULL, 0x0,
	 "Direction", HFILL}},
	{&hf_category_type,
	{"Category Type","oqtp.category_type",FT_UINT8, BASE_DEC,NULL, 0x0,
	 "Category Type", HFILL}},
	{&hf_parental_rating,
	{"Parental Rating","oqtp.parental_rating",FT_UINT8, BASE_DEC,NULL, 0x0,
	 "Parental Rating", HFILL}},
	{&hf_loc_classif_id,
	{"Locator Classification ID","oqtp.loc_classif_id",FT_UINT16, BASE_DEC,NULL, 0x0,
	 "Locator Classification ID", HFILL}},
	{&hf_loc_order_num,
	{"Order Number","oqtp.loc_order_num",FT_UINT8, BASE_DEC,NULL, 0x0,
	 "Order Number", HFILL}},
	{&hf_loc_name_length,
	{"Location Name Length","oqtp.loc_name_length",FT_UINT8, BASE_DEC,NULL, 0x0,
	 "Location Name Length", HFILL}},
	{&hf_loc_name,
	{"Location Name","oqtp.loc_name",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	 "Location Name", HFILL}},
	{&hf_request_satisfied,
	{"Request Satisfied","oqtp.request_satisfied",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Request Satisfied", HFILL}},
	{&hf_reserved_for_future_use,
	{"Reserved For Future Use","oqtp.reserved_for_future_use",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Reserved For Future Use", HFILL}},
	{&hf_no_extended_pd_syntax,
	{"No Extended pd syntax","oqtp.no_extended_pd_syntax",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "No Extended pd syntax", HFILL}},
	{&hf_num_classifications,
	{"Number of classifications","oqtp.num_classifications",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Number of classifications", HFILL}},
	{&hf_order_num,
	{"Order Number","oqtp.order_num",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Order Number", HFILL}},
	{&hf_name_length,
	{"Name Length","oqtp.name_length",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Name Length", HFILL}},
	{&hf_name,
	{"Classification Name","oqtp.name",FT_STRING, BASE_CUSTOM, NULL, 0x0,
	 "Classification Name", HFILL}},
	{&hf_description_length,
	{"Description Length","oqtp.description_length",FT_UINT16, BASE_DEC, NULL, 0x0,
	 "Description Length", HFILL}},
	{&hf_description,
	{"Description","oqtp.description",FT_STRING, BASE_CUSTOM, NULL, 0x0,
	 "Description", HFILL}},
	{&hf_private_data_length,
	{"Private Data Length","oqtp.private_data_length",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Private Data Length", HFILL}},
	{&hf_private_data_byte,
	{"Private Data Byte","oqtp.private_data_byte",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Private Data Byte", HFILL}},
	{&hf_x_private_data_length,
	{"x Private Data Length","oqtp.x_private_data_length",FT_UINT16, BASE_DEC, NULL, 0x0,
	 "x Private Data Length", HFILL}},
	{&hf_x_private_data_byte,
	{"Private Data","oqtp.x_private_data_byte",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Private Data", HFILL}},
	{&hf_lang,
	{"Language Code","oqtp.language_code",FT_STRING, BASE_CUSTOM, NULL, 0x0,
	 "Language Code", HFILL}},
	{&hf_skip_count,
	{"Skip Count","oqtp.skip_count",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Skip Count", HFILL}},
	{&hf_count,
	{"Count","oqtp.count",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Count", HFILL}},
	{&hf_private_data_len,
	{"Private Data Length","oqtp.private_data_len",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Private Data Length", HFILL}},
	{&hf_reserved_bits,
	{"Reserved Bits","oqtp.reserved_bits",FT_UINT8, BASE_DEC, NULL, 0x0,
	 "Reserved Bits", HFILL}},
	{&hf_private_data_byte_string,
	{"Private Data Byte List","oqtp.private_data_byte_list",FT_STRING, BASE_CUSTOM, NULL, 0x0,
	 "Private Data Byte List", HFILL}},
	{&hf_asset_list_string,
	{"Asset List","oqtp.asset_list_string",FT_STRING, BASE_CUSTOM, NULL, 0x0,
	 "Asset List", HFILL}},
	{&hf_classification_string,
	{"Classification List","oqtp.classification_string",FT_STRING, BASE_CUSTOM, NULL, 0x0,
	 "Classification List", HFILL}},
	{&hf_private_data_string,
	{"Private DataList","oqtp.private_data_list",FT_STRING, BASE_CUSTOM, NULL, 0x0,
	 "Private DataList", HFILL}},
	{&hf_classif_key_len,
	{"Classification Key Length","oqtp.classif_key_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Classification Key Length", HFILL}},
	{&hf_classif_key,
	{"Classification Key","oqtp.classif_key",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Classification Key", HFILL}},
	{&hf_sort_order_type,
	{"Sort Order","oqtp.sort_order_type",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Sort Order", HFILL}},
	{&hf_no_locator_flag,
	{"Locator Flag","oqtp.no_locator_flag",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Locator Flag", HFILL}},
	{&hf_search_type,
	{"Search Type","oqtp.search_type",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Search Type", HFILL}},
	{&hf_name_len,
	{"Name Length","oqtp.name_len",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Name Length", HFILL}},
	{&hf_credits_classif_id,
	{"Credits Classification ID","oqtp.credits_classif_id",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Credits Classification ID", HFILL}},
	{&hf_given_name_len,
	{"Given Name Length","oqtp.given_name_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Given Name Length", HFILL}},
	{&hf_given_name,
	{"Given Name","oqtp.given_name",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Given Name", HFILL}},
	{&hf_family_name_len,
	{"Family Name Length","oqtp.family_name_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Family Name Length", HFILL}},
	{&hf_family_name,
	{"Family Name","oqtp.family_name",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Family Name", HFILL}},
	{&hf_reserved,
	{"Reserved","oqtp.reserved",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Reserved", HFILL}},
	{&hf_title_len,
	{"Title Length","oqtp.title_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Title Length", HFILL}},
	{&hf_title,
	{"Title","oqtp.title",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Title", HFILL}},
	{&hf_organisation_classif_id,
	{"Organisation Classification ID","oqtp.organisation_classif_id",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Organisation Classification ID", HFILL}},
	{&hf_organisation_name_len,
	{"Organisation Name Length","oqtp.organisation_name_len",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Organisation Name Length", HFILL}},
	{&hf_organisation_name,
	{"organisation Name","oqtp.organisation_name",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"organisation Name", HFILL}},
	{&hf_keyword_num,
	{"Number Of Keywords","oqtp.keyword_num",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Number Of Keywords", HFILL}},
	{&hf_keyword_len,
	{"Keyword Length","oqtp.keyword_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Keyword Length", HFILL}},
	{&hf_keyword,
	{"keyword","oqtp.keyword",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"keyword", HFILL}},
	{&hf_currency_code,
	{"Currency Code","oqtp.currency_code",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Currency Code", HFILL}},
	{&hf_sub,
	{"Subscription","oqtp.sub",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Subscription", HFILL}},
	{&hf_ippv,
	{"IPPV","oqtp.ippv",FT_UINT8, BASE_DEC,NULL, 0x0,
	"IPPV", HFILL}},
	{&hf_oppv,
	{"OPPV","oqtp.oppv",FT_UINT8, BASE_DEC,NULL, 0x0,
	"OPPV", HFILL}},
	{&hf_asset_types,
	{"Asset Types","oqtp.asset_types",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Asset Types", HFILL}},
	{&hf_group_type,
	{"Group Type","oqtp.group_type",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Group Type", HFILL}},
	{&hf_primary_assets_flag,
	{"Primary Assets Flag","oqtp.primary_assets_flag",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Primary Assets Flag", HFILL}},
	{&hf_loc_asset_name_len,
	{"Location Asset Name Length","oqtp.loc_asset_name_len",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Location Asset Name Length", HFILL}},
	{&hf_loc_asset_name,
	{"Location Asset Name","oqtp.loc_asset_name",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Location Asset Name", HFILL}},
	{&hf_loc_branding_name_len,
	{"Location Branding Name Length","oqtp.loc_branding_name_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Location Branding Name Length", HFILL}},
	{&hf_loc_branding_name,
	{"Location Branding Name","oqtp.loc_branding_name",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Location Branding Name", HFILL}},
	{&hf_loc_programme_id,
	{"Location Programme ID","oqtp.loc_programme_id",FT_UINT32, BASE_DEC,NULL, 0x0,
	"Location Programme ID", HFILL}},
	{&hf_loc_rank,
	{"Location Rank","oqtp.loc_rank",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Location Rank", HFILL}},
	{&hf_loc2_programme_id,
	{"Location2 Programme ID","oqtp.loc2_programme_id",FT_UINT32, BASE_DEC,NULL, 0x0,
	"Location2 Programme ID", HFILL}},
	{&hf_asset_num,
	{"Number of Assets","oqtp.asset_num",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Number of Assets", HFILL}},
	{&hf_programme_id,
	{"Programme ID","oqtp.programme_id",FT_UINT32, BASE_DEC,NULL, 0x0,
	"Programme ID", HFILL}},
	{&hf_duration,
	{"Duration","oqtp.duration",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Duration", HFILL}},
	{&hf_duration_4byte,
	{"Duration","oqtp.duration_4byte",FT_UINT32, BASE_DEC,NULL, 0x0,
	"Duration", HFILL}},
	{&hf_price,
	{"Price","oqtp.price",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Price", HFILL}},
	{&hf_telephone_code,
	{"Telephone Code","oqtp.telephone_code",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Telephone Code", HFILL}},
	{&hf_has_media,
	{"Has Media","oqtp.has_media",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Has Media", HFILL}},
	{&hf_order_num_2byte,
	{"Order Number","oqtp.hf_order_num_2byte",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Order Number", HFILL}},
	{&hf_is_ippv,
	{"Is Asset Purchasable Through IPPV","oqtp.is_ippv",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Is Asset Purchasable Through IPPV", HFILL}},
	{&hf_is_oppv,
	{"Is Asset Purchasable Through OPPV","oqtp.is_oppv",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Is Asset Purchasable Through OPPV", HFILL}},
	{&hf_is_free_of_ca,
	{"Asset Has A Free Offer","oqtp.is_free_of_ca",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Asset Has A Free Offer", HFILL}},
	{&hf_is_sub,
	{"Is Asset Viewable Through Subscription","oqtp.is_sub",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Is Asset Viewable Through Subscription", HFILL}},
	{&hf_asset_type,
	{"Asset Type","oqtp.asset_type",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Asset Type", HFILL}},
	{&hf_is_sub,
	{"Is Asset Viewable Through Subscription","oqtp.is_sub",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Is Asset Viewable Through Subscription", HFILL}},
	{&hf_has_media,
	{"Has Media","oqtp.has_media",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Has Media", HFILL}},
	{&hf_is_ippv,
	{"Is Asset Purchasable Through IPPV","oqtp.is_ippv",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Is Asset Purchasable Through IPPV", HFILL}},
	{&hf_is_oppv,
	{"Is Asset Purchasable Through OPPV","oqtp.is_oppv",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Is Asset Purchasable Through OPPV", HFILL}},
	{&hf_is_free_of_ca,
	{"Assets has free offer","oqtp.is_free_of_ca",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Assets has free offer", HFILL}},
	{&hf_group_id,
	{"Unique Group ID","oqtp.group_id",FT_UINT32, BASE_DEC,NULL, 0x0,
	"Unique Group ID", HFILL}},
	{&hf_group_sub_type,
	{"Group Sub Type","oqtp.group_sub_type",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Group Sub Type", HFILL}},
	{&hf_group_num,
	{"Group Number","oqtp.group_num",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Group Number", HFILL}},
	{&hf_max_episode_num,
	{"Maximum Episode Number","oqtp.max_episode_num",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Maximum Episode Number", HFILL}},
	{&hf_epg_info_bits_len,
	{"EPG Info Bits Length","oqtp.epg_info_bits_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"EPG Info Bits Length", HFILL}},
	{&hf_epg_info_bits,
	{"EPG Info Bits","oqtp.epg_info_bits",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"EPG Info Bits", HFILL}},
	{&hf_exhibition_date_time,
	{"Exhibition Date Time","oqtp.exhibition_date_time",FT_UINT32, BASE_DEC,NULL, 0x0,
	"Exhibition Date Time", HFILL}},
	{&hf_name_len,
	{"Name Length","oqtp.name_len",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Name Length", HFILL}},
	{&hf_name,
	{"Name","oqtp.name",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Name", HFILL}},
	{&hf_branding_name_len,
	{"Branding Name Length","oqtp.branding_name_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Branding Name Length", HFILL}},
	{&hf_branding_name,
	{"Name","oqtp.branding_name",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Name", HFILL}},
	{&hf_rank,
	{"Asset Rank","oqtp.rank",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Asset Rank", HFILL}},
	{&hf_rank_text_len,
	{"Rank Text Length","oqtp.rank_text_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Rank Text Length", HFILL}},
	{&hf_rank_text,
	{"Rank Text","oqtp.rank_text",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Rank Text", HFILL}},
	{&hf_episode_title_len,
	{"Episode Title Length","oqtp.episode_title_len",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Episode Title Length", HFILL}},
	{&hf_episode_title,
	{"Episode Title","oqtp.episode_title",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Episode Title", HFILL}},
	{&hf_series_info_len,
	{"Series Info Length","oqtp.series_info_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Series Info Length", HFILL}},
	{&hf_series_info,
	{"Series Info","oqtp.series_info",FT_STRING, BASE_CUSTOM,NULL, 0x0,
    "Series Info", HFILL}},
    {&hf_provider_id_len,
	{"Provider ID Length","oqtp.provider_id_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Provider ID Length", HFILL}},
	{&hf_provider_id,
	{"Provider ID","oqtp.provider_id",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Provider ID", HFILL}},
	{&hf_asset_id_len,
	{"Asset ID Length","oqtp.asset_id_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Asset ID Length", HFILL}},
	{&hf_asset_id,
	{"Asset ID","oqtp.asset_id",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Asset ID", HFILL}},
	{&hf_is_catchup_tv,
	{"Is Catch up TV","oqtp.is_catchup_tv",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Is Catch up TV", HFILL}},
	{&hf_vod_delivery_flag,
	{"VOD delivery flag","oqtp.vod_delivery_flag",FT_UINT8, BASE_DEC,NULL, 0x0,
	"VOD delivery flag", HFILL}},
	{&hf_pdl_delivery_flag,
	{"PDL delivery flag","oqtp.pdl_delivery_flag",FT_UINT8, BASE_DEC,NULL, 0x0,
	"PDL delivery flag", HFILL}},
	{&hf_dl_delivery_flag,
	{"DL delivery flag","oqtp.dl_delivery_flag",FT_UINT8, BASE_DEC,NULL, 0x0,
	"DL delivery flag", HFILL}},
	{&hf_is_not_presentation_group,
	{"Is Not Presentation Group","oqtp.is_not_presentation_group",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Is Not Presentation Group", HFILL}},
	{&hf_user_nibble_1,
	{"Uuser Nibble 1","oqtp.user_nibble_1",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Uuser Nibble 1", HFILL}},
	{&hf_user_nibble_2,
	{"Uuser Nibble 2","oqtp.user_nibble_2",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Uuser Nibble 2", HFILL}},
	{&hf_reserved_0,
	{"Reserved to 0","oqtp.reserved_0",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Reserved to 0", HFILL}},
	{&hf_asset_type_classif_id,
	{"Asset Type Classification ID","oqtp.asset_type_classif_id",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Asset Type Classification ID", HFILL}},
	{&hf_reserved_text_len,
	{"Reserved Text Length","oqtp.reserved_text_len",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Reserved Text Length", HFILL}},
	{&hf_reserved_text,
	{"Reserved Text","oqtp.reserved_text",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Reserved Text", HFILL}},
	{&hf_episode_title_len,
	{"Episode Title Length","oqtp.episode_title_len",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Episode Title Length", HFILL}},
	{&hf_episode_title,
	{"Episode Title","oqtp.episode_title",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Episode Title", HFILL}},
	{&hf_description_len,
	{"description_len","oqtp.description_len",FT_UINT16, BASE_DEC,NULL, 0x0,
	"description_len", HFILL}},
	{&hf_description,
	{"Description","oqtp.description",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Description", HFILL}},
	{&hf_marketing_msg_len,
	{"Marketing Message Length","oqtp.marketing_msg_len",FT_UINT16, BASE_DEC,NULL, 0x0,
	"Marketing Message Length", HFILL}},
	{&hf_marketing_msg,
	{"Marketing Message","oqtp.marketing_msg",FT_STRING, BASE_CUSTOM,NULL, 0x0,
	"Marketing Message", HFILL}},
	{&hf_num_of_offers,
	{"Number Of Offers","oqtp.num_of_offers",FT_UINT8, BASE_DEC,NULL, 0x0,
	"Number Of Offers", HFILL}},
	{&hf_last_offer_end_date_time,
	{"Last Offer End Date Time","oqtp.last_offer_end_date_time",FT_UINT32, BASE_DEC,NULL, 0x0,
    "Last Offer End Date Time", HFILL}},
	 /*
	 * Short Message fragment reassembly
	 */
	 {&hf_msg_fragments,
	 {"Message fragments", "msg.fragments",
	  FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } },
	 {&hf_msg_fragment,
	 {"Message fragment", "msg.fragment",
	  FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
	 {&hf_msg_fragment_overlap,
	 {"Message fragment overlap", "msg.fragment.overlap",
	  FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
	 {&hf_msg_fragment_overlap_conflicts,
	 {"Message fragment overlapping with conflicting data","msg.fragment.overlap.conflicts",
	  FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
	 {&hf_msg_fragment_multiple_tails,
	 {"Message has multiple tail fragments","msg.fragment.multiple_tails",
	  FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
	 {&hf_msg_fragment_too_long_fragment,
	 {"Message fragment too long", "msg.fragment.too_long_fragment",
	  FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
	 {&hf_msg_fragment_error,
	 {"Message defragmentation error", "msg.fragment.error",
	  FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
	 {&hf_msg_reassembled_in,
	 {"Reassembled in", "msg.reassembled.in",
	  FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }

};

/*structure to handle message Ids to map the response type*/
struct node
{
	int data;
	struct node *link;
};
struct node *classificationList;
struct node *classificationInfo;
struct node *assetInfoGetList;
struct node *assetExtendedInfoEx;
//classificationList = NULL;

/*Hash tables are declared, and these are initialised in the following protocol initialisation routine*/
static GHashTable *msg_fragment_table = NULL;
static GHashTable *msg_reassembled_table = NULL;

static void msg_init_protocol(void)
{
	fragment_table_init(&msg_fragment_table);
	reassembled_table_init(&msg_reassembled_table);
}

/* This is called by Wireshark plugin manager when to allow the plugin initialise its dissector*/
void proto_reg_handoff_dash(void)
{
	static gboolean initialized=FALSE;

	if (!initialized)
	{
		data_handle = find_dissector("data");
		dash_handle = create_dissector_handle(dissect_dash, proto_dash);
		dissector_add("udp.port", global_dash_port, dash_handle);
		initialized=TRUE;
	}
}

/* This function is called by the Wireshark Plugin manager at start-up to allow
the plugin register itself to wireshark*/
void proto_register_dash (void)
{
	/* A header field is something you can search/filter on.
	* We create a structure to register our fields. It consists of an
	* array of hf_register_info structures, each of which are of the format
	* {&(field id), {name, abbrev, type, display, strings, bitmask, blurb, HFILL}}.
	*/

	proto_dash = proto_register_protocol ("DASH Protocol", "DASH", "dash");
	proto_register_field_array (proto_dash, hf_oqtp, array_length (hf_oqtp));
	proto_register_subtree_array (oqtp_subtree_array, array_length (oqtp_subtree_array));
	proto_register_subtree_array (private_data_subtree_array, array_length (private_data_subtree_array));
	proto_register_subtree_array (subtree_highlevel_array, array_length (subtree_highlevel_array));
	proto_register_subtree_array (classification_subtree_array, array_length (classification_subtree_array));
	proto_register_subtree_array (classification_id_subtree_array, array_length (classification_id_subtree_array));
	register_dissector("dash", dissect_dash, proto_dash);
	register_init_routine(msg_init_protocol);
}


static void dissect_dash(tvbuff_t *tvb, packet_info *pkt, proto_tree *tree)
{
	fragment_data *frag_msg = NULL;
    tvbuff_t *new_tvb = NULL;
    tvbuff_t *next_tvb = NULL;

	if (check_col(pkt->cinfo, COL_PROTOCOL))
		col_set_str(pkt->cinfo, COL_PROTOCOL, PROTO_TAG_DASH);

	/* Clear out stuff in the info column */
	if(check_col(pkt->cinfo,COL_INFO)){
		col_clear(pkt->cinfo,COL_INFO);
	}

	if (tree)
	{
		proto_item *trunk_proto_tree = NULL;
		proto_tree *oqtp_tree = NULL;
		proto_tree *sub_tree = NULL;
		proto_tree *sub_tree_parent = NULL;
		proto_tree *sub_tree_child = NULL;
		proto_item *opcode_item=NULL;
		proto_item *direction_item=NULL;
		proto_item *category_type_item=NULL;
		proto_item *request_satisfied_item=NULL;
		proto_item *no_extended_pd_syntax_item=NULL;
		proto_item *trunk_tree_item=NULL;
		proto_item *trunk_tree_item_sub=NULL;
		proto_item *trunk_tree_item_parent=NULL;
		proto_item *generic_item=NULL;
		gboolean    save_fragmented;
		const char* sort_order_type_string;
		const char* search_type_string;
		const char* asset_types_string;
		const char* primary_assets_flag_string;
		const char* asset_type_string;
		int packet_field_offset = 0, block_number = 0, reserved_bits = 0, len = 0;
		gint root_path_start_offset = 0, root_path_end_offset = 0, oqtp_method_end_offset = 0, gl_method = 0;
		guint8 reserved = 0, last_packet_flag = 0, request_satisfied = 0, direction = 0, category_type = 0;
		guint8 reserved_for_future_use = 0, no_extended_pd_syntax = 0, loc_name_length =0, name_length = 0;
		guint8 private_data_len = 0, classif_key_len = 0, loc_branding_name_len = 0;
		guint8 primary_assets_flag = 0, group_type = 0, asset_types = 0, oppv = 0, ippv = 0, sub = 0, keyword_len = 0;
		guint8 keyword_num = 0, title_len = 0, search_type = 0, sort_order_type = 0, no_locator_flag = 0;
		guint8 series_info_len = 0, rank_text_len = 0, branding_name_len = 0, epg_info_bits_len = 0;
		guint8 group_sub_type = 0, asset_type = 0, is_sub = 0, is_free_of_ca = 0, is_oppv = 0;
		guint8 is_ippv = 0, has_media = 0, asset_num = 0, given_name_len = 0, family_name_len = 0;
		guint8 reserved_text_len = 0, user_nibble_2 = 0;
		guint8 user_nibble_1 = 0, is_not_presentation_group = 0, dl_delivery_flag = 0, pdl_delivery_flag = 0;
		guint8 vod_delivery_flag = 0, is_catchup_tv = 0;
		guint provider_id_len = 0, asset_id_len = 0;
		guint16 opcode = 0, msgid = 0, loc_classif_id = 0, private_data_length = 0, loc_asset_name_len = 0;
		guint16 num_classifications = 0, description_length = 0, x_private_data_length = 0;
		guint16 loop_index = 0, index = 0, m = 0, n = 0, s = 0, r = 0, u = 0, t = 0, v = 0, w = 0;
		guint16 organisation_name_len = 0, name_len = 0, episode_title_len = 0, rank = 0, max_episode_num = 0;
		guint16 order_num = 0, reserved_0 = 0, marketing_msg_len = 0;

		/* Adding an item for OQTP in the trunk i.e the main branch which
		   contains protocols like Ethernet, IP, UDP. OQTP is now another sibling
		   here. The trunk_proto_tree contains reference to the main tree.*/
		trunk_proto_tree = proto_tree_add_item(tree, proto_dash, tvb, 0, -1, FALSE);

		/* Create a sub-tree now, which contains the dissected details of the OQTP packets */
		oqtp_tree = proto_item_add_subtree(trunk_proto_tree, oqtp_subtree_1);

		/* Now add the fields as items under the sub-tree */
		opcode_item = proto_tree_add_item(oqtp_tree, hf_oqtp_opcode, tvb, packet_field_offset, 2, FALSE);

		/* Retrieve the OQTP packet opcode */
		opcode = tvb_get_ntohs(tvb, packet_field_offset);
		packet_field_offset += 2;

		/*Display Opcode type next to the number*/
		proto_item_append_text(opcode_item, ", %s", val_to_str(opcode, packettypenames, "Unknown"));

		/*2-lines commented by darshan. Because, Reserved is interpreted in a different way here
		reserved = tvb_get_guint8(tvb, packet_field_offset);
		proto_tree_add_uint(oqtp_tree, hf_oqtp_reserved, tvb, packet_field_offset, 1, ((reserved & 0x80) >> 7));*/

		last_packet_flag = tvb_get_guint8(tvb, packet_field_offset);
		proto_tree_add_uint(oqtp_tree, hf_oqtp_last_packet_flag, tvb, packet_field_offset, 1, ((last_packet_flag & 0x80) >> 7));

		/* Extract the msgid field */
		msgid = ((tvb_get_ntohs(tvb, packet_field_offset)) & 0x7FFF);

		/* Set the OQTP message id */
		proto_tree_add_uint(oqtp_tree, hf_oqtp_msgid, tvb, packet_field_offset, 2, msgid);
		packet_field_offset += 2;

		switch(opcode)
		{
			case OQTP_PACKET_OPCODE_RQ:
			case OQTP_PACKET_OPCODE_BRQ:
				/* Maximum response size that the requestor can handle */
				proto_tree_add_item(oqtp_tree, hf_oqtp_response_size, tvb, packet_field_offset, 2, FALSE);
				packet_field_offset += 2;

				/* Parse to find the root path and display as /VOD/ for example */
				root_path_start_offset = tvb_find_guint8(tvb, packet_field_offset, -1, '/');
				root_path_end_offset = tvb_find_guint8(tvb, root_path_start_offset + 1, -1, '/');

				proto_tree_add_item(oqtp_tree, hf_oqtp_root_path, tvb, root_path_start_offset, ((root_path_end_offset - root_path_start_offset) + 1), FALSE);
				packet_field_offset = root_path_end_offset + 1;

				oqtp_method_end_offset = tvb_find_guint8(tvb, packet_field_offset, -1, '/');
				proto_tree_add_item(oqtp_tree, hf_oqtp_method, tvb, packet_field_offset, (oqtp_method_end_offset - packet_field_offset), FALSE);

				if(tvb_strneql(tvb, packet_field_offset, "CIGL", 4) == 0)
				{
					col_append_str(pkt->cinfo, COL_INFO, "Get Classification List (Request)");

					/*save the messsage ID based on the class type*/
					append(&classificationList,msgid);

					packet_field_offset += 5; //move the offset of method name. For eg AIGL/

					/*CATALOGUE ID*/
					proto_tree_add_item(oqtp_tree, hf_catalogue_id, tvb, packet_field_offset, 2, FALSE);
					packet_field_offset += 2;

					/*CLASSIFICATION ID*/
					proto_tree_add_item(oqtp_tree, hf_classif_id, tvb, packet_field_offset, 2, FALSE);
					packet_field_offset += 2;

					/*DIRECTION*/
					direction = ((tvb_get_guint8(tvb, packet_field_offset) & 0x80) >> 7);
					direction_item = proto_tree_add_uint(oqtp_tree, hf_direction, tvb, packet_field_offset, 1, direction);
					proto_item_append_text(direction_item, " --> %s", val_to_str(direction, direction_field_coding, "Unknown"));

					/*Category Type*/
					category_type = ((tvb_get_guint8(tvb, packet_field_offset)) & 0x7F);
					category_type_item = proto_tree_add_uint(oqtp_tree, hf_category_type, tvb, packet_field_offset, 1, category_type);
					proto_item_append_text(category_type_item, " --> %s", rval_to_str(category_type, category_type_request_coding, "Unknown"));
					packet_field_offset += 1;

					/*Parental Rating*/
					proto_tree_add_item(oqtp_tree, hf_parental_rating, tvb, packet_field_offset, 1, FALSE);
					packet_field_offset += 1;

					/*Locator Classification ID*/
					proto_tree_add_item(oqtp_tree, hf_loc_classif_id, tvb, packet_field_offset, 2, FALSE);
					loc_classif_id = tvb_get_ntohs(tvb, packet_field_offset);
					packet_field_offset += 2;

					if(loc_classif_id != 0)
					{
						/*Order Number*/
						proto_tree_add_item(oqtp_tree, hf_loc_order_num, tvb, packet_field_offset, 1, FALSE);
						packet_field_offset += 1;

						/*Location Name Length*/
						proto_tree_add_item(oqtp_tree, hf_loc_name_length, tvb, packet_field_offset, 1, FALSE);
						loc_name_length = tvb_get_guint8(tvb, packet_field_offset);
						packet_field_offset += 1;

						/*Location Name*/
						if(loc_name_length)
						{
							proto_tree_add_item(oqtp_tree, hf_loc_name, tvb, packet_field_offset, loc_name_length,FALSE);
							packet_field_offset = packet_field_offset + loc_name_length;
						}
						else
						{
							packet_field_offset += 1;
						}
					}

					/*language code*/
					proto_tree_add_item(oqtp_tree, hf_lang, tvb, packet_field_offset, 3, FALSE);
					packet_field_offset += 3;

					/*skip_count*/
					proto_tree_add_item(oqtp_tree, hf_skip_count, tvb, packet_field_offset, 1, FALSE);
					packet_field_offset += 1;

					/*count*/
					proto_tree_add_item(oqtp_tree, hf_count, tvb, packet_field_offset, 1, FALSE);
					packet_field_offset += 1;

					/*Private Data Length*/
					proto_tree_add_item(oqtp_tree, hf_private_data_len, tvb, packet_field_offset, 1, FALSE);
					private_data_len = tvb_get_guint8(tvb, packet_field_offset);
					packet_field_offset += 1;

					/*Build a subtree*/
					trunk_tree_item = proto_tree_add_item(oqtp_tree, hf_private_data_byte_string, tvb, packet_field_offset, 0, FALSE);
					sub_tree = proto_item_add_subtree (trunk_tree_item, private_data_subtree);
					for(index = 0 ; index < private_data_len; ++index)
					{
						/*private_data_byte*/
						proto_tree_add_item(sub_tree, hf_private_data_byte, tvb, packet_field_offset, 1, FALSE);
						packet_field_offset += 1;
					}

					/*if((reserved_bits = (packet_field_offset % 8)) != 0)
					{
						fprintf(stderr,"packet_field_offset: %d\n Reserved bits: %d\n",packet_field_offset,reserved_bits );
						for(index = 0 ; index < reserved_bits; ++index)
						{
							//reserved for future use
							proto_tree_add_item(oqtp_tree, hf_reserved_bits, tvb, packet_field_offset, 1, FALSE);
							packet_field_offset += 1;
						}
					}*/

				}
				else if(tvb_strneql(tvb, packet_field_offset, "CIGI", 4) == 0)
				{
					col_append_str(pkt->cinfo, COL_INFO, "Get Classification Info (Request)");

					/*save the messsage ID based on the class type*/
					append(&classificationInfo,msgid);

					packet_field_offset += 5; //move the offset of method name. For eg CIGI/

					/*Classification Key Length*/
					classif_key_len = tvb_get_guint8(tvb, packet_field_offset);
					proto_tree_add_item(oqtp_tree, hf_classif_key_len, tvb, packet_field_offset,1, FALSE);
					packet_field_offset += 1;

					if(classif_key_len)
					{
						/*Classification Key*/
						proto_tree_add_item(oqtp_tree, hf_classif_key, tvb, packet_field_offset, classif_key_len,FALSE);
						packet_field_offset = packet_field_offset + classif_key_len;
					}

					/*Language Code*/
					proto_tree_add_item(oqtp_tree, hf_lang, tvb, packet_field_offset,3, FALSE);
					packet_field_offset += 3;

					/*Private Data Length*/
					private_data_len = tvb_get_guint8(tvb, packet_field_offset);
					proto_tree_add_item(oqtp_tree, hf_private_data_len, tvb, packet_field_offset,1, FALSE);
					packet_field_offset += 1;

					/*Build a subtree*/
					trunk_tree_item = proto_tree_add_item(oqtp_tree, hf_private_data_byte_string, tvb, packet_field_offset, 0, FALSE);
					sub_tree = proto_item_add_subtree (trunk_tree_item, private_data_subtree);
					for(m = 0; m < private_data_len; m++)
					{
						/*Private Data Byte*/
						proto_tree_add_item(sub_tree, hf_private_data_byte, tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;
					}
				}
				else if(tvb_strneql(tvb, packet_field_offset, "AIGL", 4) == 0)
				{
					col_append_str(pkt->cinfo, COL_INFO, "Get Asset List (Request)");

					/*save the messsage ID based on the class type*/
					append(&assetInfoGetList,msgid);

					packet_field_offset += 5; //move the offset of method name. For eg AIGL

					/*Sort Order*/
					sort_order_type = ((tvb_get_guint8(tvb, packet_field_offset) & 0xc0) >> 6);
					generic_item = proto_tree_add_uint(oqtp_tree, hf_sort_order_type, tvb, packet_field_offset, 1, sort_order_type);
					sort_order_type_string = val_to_str(sort_order_type, sort_order_type_coding, "Unknown");
					proto_item_append_text(generic_item, " --> %s", sort_order_type_string);

					/*Locator Flag*/
					no_locator_flag = ((tvb_get_guint8(tvb, packet_field_offset) & 0x20) >> 5);
					generic_item = proto_tree_add_uint(oqtp_tree, hf_no_locator_flag, tvb, packet_field_offset, 1, no_locator_flag);
					proto_item_append_text(generic_item, " --> %s", val_to_str(no_locator_flag, no_locator_flag_coding, "Unknown"));

					/*Search Type*/
					search_type = ((tvb_get_guint8(tvb, packet_field_offset)) & 0x1f);
					generic_item = proto_tree_add_uint(oqtp_tree, hf_search_type, tvb, packet_field_offset, 1, search_type);
					search_type_string = val_to_str(search_type, search_type_coding, "Unknown");
					proto_item_append_text(generic_item, " --> %s", search_type_string);
					packet_field_offset += 1;

					if(search_type == 1)
					{
						/*Name Length*/
						name_len = tvb_get_ntohs(tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_name_len, tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						if(name_len)
						{
							/*Name*/
							proto_tree_add_item(oqtp_tree, hf_name, tvb, packet_field_offset, name_len,FALSE);
							packet_field_offset = packet_field_offset + name_len;
						}
					}
					else if((search_type == 2) || (search_type == 3))
					{
						/*Credits Classification ID*/
						proto_tree_add_item(oqtp_tree, hf_credits_classif_id, tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						/*Given Name Length*/
						given_name_len = tvb_get_guint8(tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_given_name_len, tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						if(given_name_len)
						{
							/*Given Name*/
							proto_tree_add_item(oqtp_tree, hf_given_name, tvb, packet_field_offset, given_name_len,FALSE);
							packet_field_offset = packet_field_offset + given_name_len;
						}
						/*Family Name Length*/
						family_name_len = tvb_get_guint8(tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_family_name_len, tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						if(family_name_len)
						{
							/*Family Name*/
							proto_tree_add_item(oqtp_tree, hf_family_name, tvb, packet_field_offset, family_name_len,FALSE);
							packet_field_offset = packet_field_offset + family_name_len;
						}

						/*Reserved*/
						reserved = ((tvb_get_guint8(tvb, packet_field_offset) & 0xe0) >> 5);
						proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);

						/*Title Length*/
						title_len = ((tvb_get_guint8(tvb, packet_field_offset)) & 0x1f);
						proto_tree_add_uint(oqtp_tree, hf_title_len, tvb, packet_field_offset, 1, title_len);
						packet_field_offset += 1;

						if(title_len)
						{
							/*Title*/
							proto_tree_add_item(oqtp_tree, hf_title, tvb, packet_field_offset, title_len,FALSE);
							packet_field_offset = packet_field_offset + title_len;
						}
					}
					else if(search_type == 4)
					{
						/*Organisation Classification ID*/
						proto_tree_add_item(oqtp_tree, hf_organisation_classif_id, tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						/*Reserved*/
						reserved = ((tvb_get_ntohs(tvb, packet_field_offset) & 0xfe00) >> 9);
						proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);

						/*Organisation Name Length*/
						organisation_name_len = (tvb_get_ntohs(tvb, packet_field_offset) & 0x1ff);
						proto_tree_add_item(oqtp_tree, hf_organisation_name_len, tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 2;

						if(organisation_name_len)
						{
							/*organisation Name*/
							proto_tree_add_item(oqtp_tree, hf_organisation_name, tvb, packet_field_offset, organisation_name_len,FALSE);
							packet_field_offset = packet_field_offset + organisation_name_len;
						}
					}
					else if(search_type == 5)
					{
						/*Reserved*/
						reserved = ((tvb_get_guint8(tvb, packet_field_offset) & 0xf8) >> 3);
						proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);

						/*Number Of Keywords*/
						keyword_num = ((tvb_get_guint8(tvb, packet_field_offset)) & 0x7);
						proto_tree_add_uint(oqtp_tree, hf_keyword_num, tvb, packet_field_offset, 1, keyword_num);
						packet_field_offset += 1;

						for(r = 0; r< keyword_num;r++)
						{
							/*Reserved*/
							reserved = ((tvb_get_guint8(tvb, packet_field_offset) & 0x80) >> 7);
							proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);

							/*Keyword Length*/
							keyword_len = ((tvb_get_guint8(tvb, packet_field_offset)) & 0x7f);
							proto_tree_add_uint(oqtp_tree, hf_keyword_len, tvb, packet_field_offset, 1, keyword_len);
							packet_field_offset += 1;

							if(keyword_len)
							{
								/*keyword*/
								proto_tree_add_item(oqtp_tree, hf_keyword, tvb, packet_field_offset, keyword_len,FALSE);
								packet_field_offset = packet_field_offset + keyword_len;
							}
						}
					}
					/*Catalogue ID*/
					proto_tree_add_item(oqtp_tree, hf_catalogue_id, tvb, packet_field_offset,2, FALSE);
					packet_field_offset += 2;

					/*Currency Code*/
					proto_tree_add_item(oqtp_tree, hf_currency_code, tvb, packet_field_offset,2, FALSE);
					packet_field_offset += 2;

					/*Parental Rating*/
					proto_tree_add_item(oqtp_tree, hf_parental_rating, tvb, packet_field_offset,1, FALSE);
					packet_field_offset += 1;

					/*Classification ID*/
					proto_tree_add_item(oqtp_tree, hf_classif_id, tvb, packet_field_offset,2, FALSE);
					packet_field_offset += 2;

					/*Direction*/
					direction = ((tvb_get_guint8(tvb, packet_field_offset) & 0x80) >> 7);
					generic_item = proto_tree_add_uint(oqtp_tree, hf_direction, tvb, packet_field_offset, 1, direction);
					proto_item_append_text(generic_item, " --> %s", val_to_str(direction, direction_field_coding, "Unknown"));

					/*Reserved*/
					reserved = ((tvb_get_guint8(tvb, packet_field_offset) & 0x78) >> 3);
					proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);

					/*Subscription*/
					sub = ((tvb_get_guint8(tvb, packet_field_offset) & 0x4) >> 2);
					generic_item = proto_tree_add_uint(oqtp_tree, hf_sub, tvb, packet_field_offset, 1, sub);
					proto_item_append_text(generic_item, " --> %s", val_to_str(sub, sub_coding, "Unknown"));

					/*IPPV*/
					ippv = ((tvb_get_guint8(tvb, packet_field_offset) & 0x2) >> 1);
					generic_item = proto_tree_add_uint(oqtp_tree, hf_ippv, tvb, packet_field_offset, 1, ippv);
					proto_item_append_text(generic_item, " --> %s", val_to_str(ippv, ippv_coding, "Unknown"));

					/*OPPV*/
					oppv = ((tvb_get_guint8(tvb, packet_field_offset)) & 0x1);
					generic_item = proto_tree_add_uint(oqtp_tree, hf_oppv, tvb, packet_field_offset, 1, oppv);
					proto_item_append_text(generic_item, " --> %s", val_to_str(oppv, oppv_coding, "Unknown"));
					packet_field_offset += 1;

					/*Skip Count*/
					proto_tree_add_item(oqtp_tree, hf_skip_count, tvb, packet_field_offset,1, FALSE);
					packet_field_offset += 1;

					/*Reserved*/
					reserved = ((tvb_get_guint8(tvb, packet_field_offset) & 0x80) >> 7);
					proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);

					/*Asset Types*/
					asset_types = ((tvb_get_guint8(tvb, packet_field_offset) & 0x70) >> 4);
					generic_item = proto_tree_add_uint(oqtp_tree, hf_asset_types, tvb, packet_field_offset, 1, asset_types);
					asset_types_string = val_to_str(asset_types, asset_types_coding, "Unknown");
					proto_item_append_text(generic_item, " --> %s", asset_types_string);

					if(asset_types == 3)
					{
						/*Group Type*/
						group_type = (tvb_get_guint8(tvb, packet_field_offset) & 0xf);
						generic_item = proto_tree_add_uint(oqtp_tree, hf_group_type, tvb, packet_field_offset, 1, group_type);
						proto_item_append_text(generic_item, " --> %s", val_to_str(group_type, group_type_coding, "Unknown"));
						packet_field_offset += 1;
					}
					else
					{
						/*Reserved*/
						reserved = ((tvb_get_guint8(tvb, packet_field_offset)) & 0xf);
						proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);
						packet_field_offset += 1;
					}

					/*Language Code*/
					proto_tree_add_item(oqtp_tree, hf_lang, tvb, packet_field_offset,3, FALSE);
					packet_field_offset += 3;

					if(!no_locator_flag)
					{
						/*Primary Assets Flag*/
						primary_assets_flag = ((tvb_get_guint8(tvb, packet_field_offset) & 0x80) >> 7);
						generic_item = proto_tree_add_uint(oqtp_tree, hf_primary_assets_flag, tvb, packet_field_offset, 1, primary_assets_flag);
						primary_assets_flag_string = val_to_str(primary_assets_flag, primary_assets_flag_coding, "Unknown");
						proto_item_append_text(generic_item, " --> %s", primary_assets_flag_string);

						/*Reserved*/
						reserved_for_future_use = ((tvb_get_guint8(tvb, packet_field_offset)) & 0x7f);
						proto_tree_add_uint(oqtp_tree, hf_reserved_for_future_use, tvb, packet_field_offset, 1, reserved_for_future_use);
						packet_field_offset += 1;
					}

					if((sort_order_type != 2) && (primary_assets_flag == 1))
					{
						/*Location Asset Name Length*/
						loc_asset_name_len = tvb_get_ntohs(tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_loc_asset_name_len, tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						if(loc_asset_name_len)
						{
							/*Location Asset Name*/
							proto_tree_add_item(oqtp_tree, hf_loc_asset_name, tvb, packet_field_offset, loc_asset_name_len,FALSE);
							packet_field_offset = packet_field_offset + loc_asset_name_len;
						}

						/*Location Branding Name Length*/
						loc_branding_name_len = tvb_get_guint8(tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_loc_branding_name_len, tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						if(loc_branding_name_len)
						{
							/*Location Branding Name*/
							proto_tree_add_item(oqtp_tree, hf_loc_branding_name, tvb, packet_field_offset, loc_branding_name_len,FALSE);
							packet_field_offset = packet_field_offset + loc_branding_name_len;
						}
					}

					if(sort_order_type != 2)
					{
						/*Location Programme ID*/
						proto_tree_add_item(oqtp_tree, hf_loc_programme_id, tvb, packet_field_offset,4, FALSE);
						packet_field_offset += 4;
					}
					else
					{
						/*Location Rank*/ /*FIXME 1Byte shud have been 2 bytes*/
						proto_tree_add_item(oqtp_tree, hf_loc_rank, tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;
					}

					if((sort_order_type != 2) && (primary_assets_flag == 0))
					{
						/*Location2 Programme ID*/
						proto_tree_add_item(oqtp_tree, hf_loc2_programme_id, tvb, packet_field_offset,4, FALSE);
						packet_field_offset += 4;
					}

					/*Assets Count*/
					proto_tree_add_item(oqtp_tree, hf_count, tvb, packet_field_offset,1, FALSE);
					packet_field_offset += 1;

					/*Private Data Length*/
					private_data_len = tvb_get_guint8(tvb, packet_field_offset);
					proto_tree_add_item(oqtp_tree, hf_private_data_len, tvb, packet_field_offset,1, FALSE);
					packet_field_offset += 1;

					for(s = 0; s < private_data_len;s++)
					{
						/*Private data*/
						proto_tree_add_item(oqtp_tree, hf_private_data_byte, tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;
					}
				}
				else if(tvb_strneql(tvb, packet_field_offset, "AIGT", 4) == 0)
				{
					col_append_str(pkt->cinfo, COL_INFO, "Get Asset Extended Info Ex (Request)");

					/*save the messsage ID based on the class type*/
					append(&assetExtendedInfoEx,msgid);

					packet_field_offset += 5; //move the offset of method name. For eg AIGT

					/*Catalogue ID*/
					proto_tree_add_item(oqtp_tree, hf_catalogue_id, tvb, packet_field_offset,2, FALSE);
					packet_field_offset += 2;

					/*Reserved*/
					reserved = ((tvb_get_guint8(tvb, packet_field_offset) & 0xc0) >> 6);
					proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);

					/*Provider ID Length*/
					provider_id_len = ((tvb_get_guint8(tvb, packet_field_offset)) & 0x3f);
					proto_tree_add_uint(oqtp_tree, hf_provider_id_len, tvb, packet_field_offset, 1, provider_id_len);
					packet_field_offset += 1;

					if(provider_id_len)
					{
						/*Provider ID*/
						proto_tree_add_item(oqtp_tree, hf_provider_id, tvb, packet_field_offset, provider_id_len,FALSE);
						packet_field_offset = packet_field_offset + provider_id_len;
					}

					/*Reserved*/
					reserved = ((tvb_get_guint8(tvb, packet_field_offset) & 0xe0) >> 5);
					proto_tree_add_uint(oqtp_tree, hf_reserved, tvb, packet_field_offset, 1, reserved);

					/*Asset ID Length*/
					asset_id_len = ((tvb_get_guint8(tvb, packet_field_offset)) & 0x1f);
					proto_tree_add_uint(oqtp_tree, hf_asset_id_len, tvb, packet_field_offset, 1, asset_id_len);
					packet_field_offset += 1;

					if(asset_id_len)
					{
						/*Asset ID*/
						proto_tree_add_item(oqtp_tree, hf_asset_id, tvb, packet_field_offset, asset_id_len,FALSE);
						packet_field_offset = packet_field_offset + asset_id_len;
					}

					/*Language Code*/
					proto_tree_add_item(oqtp_tree, hf_lang, tvb, packet_field_offset,3, FALSE);
					packet_field_offset += 3;

					/*Currency Code*/
					proto_tree_add_item(oqtp_tree, hf_currency_code, tvb, packet_field_offset,2, FALSE);
					packet_field_offset += 2;

					/*Private Data Length*/
					private_data_len = tvb_get_guint8(tvb, packet_field_offset);
					proto_tree_add_item(oqtp_tree, hf_private_data_len, tvb, packet_field_offset,1, FALSE);
					packet_field_offset += 1;

					for(v = 0; v < private_data_len;v++)
					{
						/*Private data*/
						proto_tree_add_item(oqtp_tree, hf_private_data_byte, tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;
					}
				}


				break;
			case OQTP_PACKET_OPCODE_DATA:

				/* Extract the data packet block number */
				proto_tree_add_item(oqtp_tree, hf_oqtp_data_packet_block_number, tvb, packet_field_offset, 2, FALSE);
				block_number = tvb_get_ntohs(tvb, packet_field_offset);
				packet_field_offset += 2;

				/*save the fragmented state of this packet, so we can restore it later.*/
				save_fragmented = pkt->fragmented;

				/* Multiple packets in response - last_packet_flag field is the last packet flag */
				if(((block_number == 0) && (last_packet_flag == 0)) ||
				   (block_number > 0))
				{
					/*darshan*/
					pkt->fragmented = TRUE;

					frag_msg = fragment_add_seq_check(tvb, packet_field_offset, pkt,
													  msgid, /* ID for fragments belonging together */
													  msg_fragment_table, /* list of message fragments */
													  msg_reassembled_table, /* list of reassembled messages */
													  block_number, /* fragment sequence number */
													  tvb_length_remaining(tvb, packet_field_offset), /* fragment length - to the end */
													  !last_packet_flag); /* More fragments? */

					new_tvb = process_reassembled_data(tvb, packet_field_offset, pkt,
													   "Reassembled OQTP Message",
													   frag_msg,
													   &msg_frag_items,
													   NULL,
													   oqtp_tree);

					/* Reassembled */
					if (frag_msg)
					{
						col_append_str(pkt->cinfo, COL_INFO, "[MESSAGE REASSEMBLED] ");
					}
					else
					{
						/* Not last packet of reassembled short message */
						col_append_fstr(pkt->cinfo, COL_INFO, "(OQTP fragment %u)", block_number);
					}

					if (new_tvb) /* take it all */
					{
						next_tvb = new_tvb;
					}
					else
					{
						/* We cannot dissect anything yet, as we don't have a reassembled packet */
						next_tvb = NULL;
					}
				}
				else
				{
					next_tvb = tvb_new_subset(tvb, packet_field_offset, -1, -1);
				}
				/*restoring fragmented state*/
				pkt->fragmented = save_fragmented;

				/*******************************************************/
				if (next_tvb == NULL)
				{
					// Just a fragment - put an item into the protocol tree for the fragment data
					proto_tree_add_text(oqtp_tree, tvb, packet_field_offset, -1, "Fragment data");
					len = tvb_get_guint8(tvb, packet_field_offset);
					proto_tree_add_text(oqtp_tree, tvb, packet_field_offset, len,
										"Data: %s",tvb_bytes_to_str(tvb, packet_field_offset, len));
				}
				else
				{
					/* Not a fragment, or fragments were reassembled */

					/*Check if it belongs to getClassification class*/
					display(classificationList);
					if(search(&classificationList,msgid))
					{
						del(&classificationList,msgid);/*delete the entry from the linked list*/

						/*once you get to the point where you dissect the field with the
						"request satisfied" bit, you're dealing with a tvbuff that starts
						with that field, so you have to reset packet_field_offset to 0,
						*AND* you have to fetch fields using next_tvb*/
						packet_field_offset = 0;

						col_append_str(pkt->cinfo, COL_INFO, "Get Classification List (Response)");

						/*Request Satisfied*/
						request_satisfied = ((tvb_get_guint8(tvb, packet_field_offset) & 0x80) >> 7);
						request_satisfied_item = proto_tree_add_uint(oqtp_tree, hf_request_satisfied, next_tvb, packet_field_offset, 1, request_satisfied );
						proto_item_append_text(request_satisfied_item, " --> %s", val_to_str(request_satisfied, request_satisfied_coding, "Unknown"));

						/*Reserved_for_future_use*/
						reserved_for_future_use = ((tvb_get_guint8(next_tvb, packet_field_offset)& 0x7E) >> 1);
						proto_tree_add_uint(oqtp_tree, hf_reserved_for_future_use, next_tvb, packet_field_offset, 1, reserved_for_future_use );

						/*No Extended pd syntax*/
						no_extended_pd_syntax = (tvb_get_guint8(next_tvb, packet_field_offset) & 0x1);
						no_extended_pd_syntax_item = proto_tree_add_uint(oqtp_tree, hf_no_extended_pd_syntax, next_tvb, packet_field_offset, 1, no_extended_pd_syntax );
						proto_item_append_text(no_extended_pd_syntax_item, " --> %s", val_to_str(no_extended_pd_syntax, no_extended_pd_syntax_coding, "Unknown"));
						packet_field_offset += 1;

						/*Number of classifications*/
						proto_tree_add_item(oqtp_tree, hf_num_classifications, next_tvb, packet_field_offset, 1, FALSE);
						num_classifications = tvb_get_guint8(next_tvb, packet_field_offset);
						packet_field_offset += 1;

						/*Build a subtree*/
						trunk_tree_item = proto_tree_add_item(oqtp_tree, hf_classification_string, tvb, packet_field_offset, 0, FALSE);
						sub_tree = proto_item_add_subtree (trunk_tree_item, classification_subtree);

						for(loop_index = 0 ; loop_index < num_classifications ; ++loop_index)
						{
							/*CLASSIFICATION ID*/
							trunk_tree_item_parent = proto_tree_add_item(oqtp_tree, hf_classif_id, tvb, packet_field_offset, 2, FALSE);
							sub_tree_parent = proto_item_add_subtree (trunk_tree_item_parent, classification_id_subtree);
							packet_field_offset += 2;

							/*Category Type*/
							category_type = tvb_get_guint8(tvb, packet_field_offset);
							category_type_item = proto_tree_add_uint(sub_tree_parent, hf_category_type, next_tvb, packet_field_offset, 1, FALSE);
							proto_item_append_text(category_type_item, " --> %s", rval_to_str(category_type, category_type_response_coding, "Unknown"));
							packet_field_offset += 1;

							/*Order Number*/
							proto_tree_add_item(sub_tree_parent, hf_order_num, next_tvb, packet_field_offset, 1, FALSE);
							packet_field_offset += 1;

							/*parental_rating*/
							proto_tree_add_item(sub_tree_parent, hf_parental_rating, next_tvb, packet_field_offset, 1, FALSE);
							packet_field_offset += 1;

							/*Name Length*/
							proto_tree_add_item(sub_tree_parent, hf_name_length, next_tvb, packet_field_offset, 1, FALSE);
							name_length = tvb_get_guint8(next_tvb, packet_field_offset);
							packet_field_offset += 1;

							/*name*/
							if(name_length)
							{
								proto_tree_add_item(sub_tree_parent, hf_name, next_tvb, packet_field_offset, name_length,FALSE);
								packet_field_offset = packet_field_offset + name_length;
							}

							/*Description Length*/
							proto_tree_add_item(sub_tree_parent, hf_description_length, next_tvb, packet_field_offset, 2, FALSE);
							description_length = tvb_get_ntohs(next_tvb, packet_field_offset);
							packet_field_offset += 2;

							/*Description*/
							if(description_length)
							{
								proto_tree_add_item(sub_tree_parent, hf_description, next_tvb, packet_field_offset, description_length, FALSE);
								packet_field_offset = packet_field_offset + description_length;
							}

							/*private_data_length*/
							proto_tree_add_item(sub_tree_parent, hf_private_data_length, next_tvb, packet_field_offset, 1, FALSE);
							private_data_length = tvb_get_guint8(next_tvb, packet_field_offset);
							packet_field_offset += 1;

							/*Build a subtree here*/
							trunk_tree_item_sub = proto_tree_add_item(sub_tree_parent, hf_private_data_byte_string, tvb, packet_field_offset, 0, FALSE);
							sub_tree_child = proto_item_add_subtree (trunk_tree_item_sub, private_data_subtree);

							for(index = 0 ; index < private_data_length ; ++index)
							{
								/*private_data_byte*/
								proto_tree_add_item(sub_tree_child, hf_private_data_byte, next_tvb, packet_field_offset, 1, FALSE);
								packet_field_offset += 1;
							}

							if(!no_extended_pd_syntax)
							{
								/*Private Data Length*/
								proto_tree_add_item(sub_tree_parent, hf_x_private_data_length, next_tvb, packet_field_offset, 2, FALSE);
								x_private_data_length = tvb_get_ntohs(next_tvb, packet_field_offset);
								packet_field_offset += 2;

								/*Build a subtree here*/
								trunk_tree_item_sub = proto_tree_add_item(sub_tree_parent, hf_private_data_string, tvb, packet_field_offset, 0, FALSE);
								sub_tree_child = proto_item_add_subtree (trunk_tree_item_sub, private_data_subtree);

								for(index = 0 ; index < x_private_data_length ; ++index)
								{
									/*x_private_data_byte*/
									proto_tree_add_item(sub_tree_child, hf_x_private_data_byte, next_tvb, packet_field_offset, 1, FALSE);
									packet_field_offset += 1;
								}
							}
						}
					}

					//display(classificationInfo);
					else if(search(&classificationInfo,msgid))
					{
						del(&classificationInfo,msgid);/*delete the entry from the linked list*/
						col_append_str(pkt->cinfo, COL_INFO, "Get Classification Info (Response)");
						packet_field_offset = 0;

						/*Request Satisfied*/
						request_satisfied = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
						proto_tree_add_uint(oqtp_tree, hf_request_satisfied, next_tvb, packet_field_offset, 1, request_satisfied);

						/*Reserved For Future Use*/
						reserved_for_future_use = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x7f);
						proto_tree_add_uint(oqtp_tree, hf_reserved_for_future_use, next_tvb, packet_field_offset, 1, reserved_for_future_use);
						packet_field_offset += 1;

						/*Classification IDentifier*/
						proto_tree_add_item(oqtp_tree, hf_classif_id, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						/*Attribute Category Type*/
						proto_tree_add_item(oqtp_tree, hf_category_type, next_tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						/*Parental Rating*/
						proto_tree_add_item(oqtp_tree, hf_parental_rating, next_tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						/*Name Length*/
						name_length = tvb_get_guint8(next_tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_name_length, next_tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						if(name_length)
						{
							/*Name*/
							proto_tree_add_item(oqtp_tree, hf_name, next_tvb, packet_field_offset, name_length,FALSE);
							packet_field_offset = packet_field_offset + name_length;
						}
						/*Description Length*/
						description_length = tvb_get_ntohs(next_tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_description_length, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						if(description_length)
						{
							/*Description*/
							proto_tree_add_item(oqtp_tree, hf_description, next_tvb, packet_field_offset, description_length,FALSE);
							packet_field_offset = packet_field_offset + description_length;
						}
						/*Private Data Length*/
						private_data_len = tvb_get_guint8(next_tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_private_data_len, next_tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						/*Build a subtree*/
						trunk_tree_item = proto_tree_add_item(oqtp_tree, hf_private_data_byte_string, next_tvb, packet_field_offset, 0, FALSE);
						sub_tree = proto_item_add_subtree (trunk_tree_item, private_data_subtree);
						for(n = 0; n< private_data_len;n++)
						{
							/*Private Data Byte*/
							proto_tree_add_item(sub_tree, hf_private_data_byte, next_tvb, packet_field_offset,1, FALSE);
							packet_field_offset += 1;
						}
					}
					else if(search(&assetInfoGetList,msgid))
					{
						del(&classificationInfo,msgid);/*delete the entry from the linked list*/
						col_append_str(pkt->cinfo, COL_INFO, "Get Asset List (Response)");
						packet_field_offset = 0;

						/*Request Satisfied*/
						request_satisfied = ((tvb_get_guint8(tvb, packet_field_offset) & 0x80) >> 7);
						proto_tree_add_uint(oqtp_tree, hf_request_satisfied, next_tvb, packet_field_offset, 1, request_satisfied);

						/*Reserved For Future Use*/
						reserved_for_future_use = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x7e) >> 1);
						proto_tree_add_uint(oqtp_tree, hf_reserved_for_future_use, next_tvb, packet_field_offset, 1, reserved_for_future_use);

						/*No Extended pd syntax*/
						no_extended_pd_syntax = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x1);
						proto_tree_add_uint(oqtp_tree, hf_no_extended_pd_syntax, next_tvb, packet_field_offset, 1, no_extended_pd_syntax);
						packet_field_offset += 1;

						/*Number of Assets*/
						asset_num = tvb_get_guint8(next_tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_asset_num, next_tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						/*Build a subtree*/
						trunk_tree_item = proto_tree_add_item(oqtp_tree, hf_asset_list_string, next_tvb, packet_field_offset, 0, FALSE);
						sub_tree = proto_item_add_subtree (trunk_tree_item, subtree_highlevel);

						for(t = 0; t< asset_num;t++)
						{
							/*Programme ID*/
							proto_tree_add_item(sub_tree, hf_programme_id, next_tvb, packet_field_offset,4, FALSE);
							packet_field_offset += 4;

							/*Parental Rating*/
							proto_tree_add_item(sub_tree, hf_parental_rating, next_tvb, packet_field_offset,1, FALSE);
							packet_field_offset += 1;

							/*Duration*/
							proto_tree_add_item(sub_tree, hf_duration, next_tvb, packet_field_offset,2, FALSE);
							packet_field_offset += 2;

							/*Price*/
							proto_tree_add_item(sub_tree, hf_price, next_tvb, packet_field_offset,2, FALSE);
							packet_field_offset += 2;

							/*Telephone Code*/
							proto_tree_add_item(sub_tree, hf_telephone_code, next_tvb, packet_field_offset,2, FALSE);
							packet_field_offset += 2;

							/*Has Media*/
							has_media = ((tvb_get_ntohs(next_tvb, packet_field_offset) & 0x4000) >> 15);
							proto_tree_add_uint(sub_tree, hf_has_media, next_tvb, packet_field_offset, 1, has_media);

							/*Order Number*/
							order_num = (tvb_get_ntohs(next_tvb, packet_field_offset) & 0x7fff);
							proto_tree_add_item(sub_tree, hf_order_num_2byte, next_tvb, packet_field_offset,2, order_num);
							packet_field_offset += 2;

							/*Is Asset Purchasable Through IPPV*/
							is_ippv = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
							proto_tree_add_uint(sub_tree, hf_is_ippv, next_tvb, packet_field_offset, 1, is_ippv);

							/*Is Asset Purchasable Through OPPV*/
							is_oppv = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x40) >> 6);
							proto_tree_add_uint(sub_tree, hf_is_oppv, next_tvb, packet_field_offset, 1, is_oppv);

							/*Asset Has A Free Offer*/
							is_free_of_ca = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x20) >> 5);
							proto_tree_add_uint(sub_tree, hf_is_free_of_ca, next_tvb, packet_field_offset, 1, is_free_of_ca);

							/*Is Asset Viewable Through Subscription*/
							is_sub = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x10) >> 4);
							proto_tree_add_uint(sub_tree, hf_is_sub, next_tvb, packet_field_offset, 1, is_sub);

							/*Reserved*/
							reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xc) >> 2);
							proto_tree_add_uint(sub_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

							/*Asset Type*/
							asset_type = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x3);
							generic_item = proto_tree_add_uint(sub_tree, hf_asset_type, next_tvb, packet_field_offset, 1, asset_type);
							asset_type_string = val_to_str(asset_type, asset_type_coding, "Unknown");
							proto_item_append_text(generic_item, " --> %s", asset_type_string);
							packet_field_offset += 1;

							if(asset_type != 0)
							{
								/*Reserved*/
								reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xe0) >> 5);
								proto_tree_add_uint(sub_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

								/*Is Asset Viewable Through Subscription*/
								is_sub = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x10) >> 4);
								proto_tree_add_uint(sub_tree, hf_is_sub, next_tvb, packet_field_offset, 1, is_sub);

								/*Has Media*/
								has_media = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x8) >> 3);
								proto_tree_add_uint(sub_tree, hf_has_media, next_tvb, packet_field_offset, 1, has_media);

								/*Is Asset Purchasable Through IPPV*/
								is_ippv = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x4) >> 2);
								proto_tree_add_uint(sub_tree, hf_is_ippv, next_tvb, packet_field_offset, 1, is_ippv);

								/*Is Asset Purchasable Through OPPV*/
								is_oppv = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x2) >> 1);
								proto_tree_add_uint(sub_tree, hf_is_oppv, next_tvb, packet_field_offset, 1, is_oppv);

								/*Assets has free offer*/
								is_free_of_ca = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x1);
								proto_tree_add_uint(sub_tree, hf_is_free_of_ca, next_tvb, packet_field_offset, 1, is_free_of_ca);
								packet_field_offset += 1;
							}

							if(asset_type == 3)
							{
								/*Unique Group ID*/
								proto_tree_add_item(sub_tree, hf_group_id, next_tvb, packet_field_offset,4, FALSE);
								packet_field_offset += 4;

								/*Group Type*/
								group_type = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xf0) >> 4);
								generic_item = proto_tree_add_uint(sub_tree, hf_group_type, next_tvb, packet_field_offset, 1, group_type);
								proto_item_append_text(generic_item, " --> %s", val_to_str(group_type, group_type_coding, "Unknown"));

								/*Group Sub Type*/
								group_sub_type = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0xf);
								generic_item = proto_tree_add_uint(sub_tree, hf_group_sub_type, next_tvb, packet_field_offset, 1, group_sub_type);
								proto_item_append_text(generic_item, " --> %s", val_to_str(group_sub_type, group_sub_type_coding, "Unknown"));
								packet_field_offset += 1;

								/*Group Number*/
								proto_tree_add_item(sub_tree, hf_group_num, next_tvb, packet_field_offset,2, FALSE);
								packet_field_offset += 2;

								/*Reserved*/
								reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
								proto_tree_add_uint(sub_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

								/*Maximum Episode Number*/
								max_episode_num = (tvb_get_ntohs(next_tvb, packet_field_offset) & 0x7fff);
								proto_tree_add_item(sub_tree, hf_max_episode_num, next_tvb, packet_field_offset,1, max_episode_num);
								packet_field_offset += 2;
							}

							/*Reserved*/
							reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xf0) >> 4);
							proto_tree_add_uint(sub_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

							/*EPG Info Bits Length*/
							epg_info_bits_len = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0xf);
							proto_tree_add_uint(sub_tree, hf_epg_info_bits_len, next_tvb, packet_field_offset, 1, epg_info_bits_len);
							packet_field_offset += 1;

							if(epg_info_bits_len)
							{
								/*EPG Info Bits*/
								proto_tree_add_item(sub_tree, hf_epg_info_bits, next_tvb, packet_field_offset, epg_info_bits_len,FALSE);
								packet_field_offset = packet_field_offset + epg_info_bits_len;
							}

							/*Exhibition Date Time*/
							proto_tree_add_item(sub_tree, hf_exhibition_date_time, next_tvb, packet_field_offset,4, FALSE);
							packet_field_offset += 4;

							/*Name Length*/
							name_len = tvb_get_ntohs(next_tvb, packet_field_offset);
							proto_tree_add_item(sub_tree, hf_name_len, next_tvb, packet_field_offset,2, FALSE);
							packet_field_offset += 2;

							if(name_len)
							{
								/*Name*/
								proto_tree_add_item(sub_tree, hf_name, next_tvb, packet_field_offset, name_len,FALSE);
								packet_field_offset = packet_field_offset + name_len;
							}

							/*Reserved*/
							reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
							proto_tree_add_uint(sub_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

							/*Branding Name Length*/
							branding_name_len = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x7f);
							proto_tree_add_uint(sub_tree, hf_branding_name_len, next_tvb, packet_field_offset, 1, branding_name_len);
							packet_field_offset += 1;

							if(branding_name_len)
							{
								/*Name*/
								proto_tree_add_item(sub_tree, hf_branding_name, next_tvb, packet_field_offset, branding_name_len,FALSE);
								packet_field_offset = packet_field_offset + branding_name_len;
							}

							/*Asset Rank*/
							rank = tvb_get_ntohs(next_tvb, packet_field_offset);
							proto_tree_add_item(sub_tree, hf_rank, next_tvb, packet_field_offset,2, FALSE);
							packet_field_offset += 2;

							if(rank > 0)
							{
								/*Reserved*/
								reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
								proto_tree_add_uint(sub_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

								/*Rank Text Length*/
								rank_text_len = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x7f);
								proto_tree_add_uint(sub_tree, hf_rank_text_len, next_tvb, packet_field_offset, 1, rank_text_len);
								packet_field_offset += 1;

								if(rank_text_len)
								{
									/*Rank Text*/
									proto_tree_add_item(sub_tree, hf_rank_text, next_tvb, packet_field_offset, rank_text_len,FALSE);
									packet_field_offset = packet_field_offset + rank_text_len;
								}
							}

							/*Episode Title Length*/
							episode_title_len = tvb_get_ntohs(next_tvb, packet_field_offset);
							proto_tree_add_item(sub_tree, hf_episode_title_len, next_tvb, packet_field_offset,2, FALSE);
							packet_field_offset += 2;

							if(episode_title_len)
							{
								/*Episode Title*/
								proto_tree_add_item(sub_tree, hf_episode_title, next_tvb, packet_field_offset, episode_title_len,FALSE);
								packet_field_offset = packet_field_offset + episode_title_len;
							}

							/*Reserved*/
							reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
							proto_tree_add_uint(sub_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

							/*Series Info Length*/
							series_info_len = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x7f);
							proto_tree_add_uint(sub_tree, hf_series_info_len, next_tvb, packet_field_offset, 1, series_info_len);
							packet_field_offset += 1;

							if(series_info_len)
							{
								/*Series Info*/
								proto_tree_add_item(sub_tree, hf_series_info, next_tvb, packet_field_offset, series_info_len,FALSE);
								packet_field_offset = packet_field_offset + series_info_len;
							}

							/*Private Data Length*/
							private_data_len = tvb_get_guint8(next_tvb, packet_field_offset);
							proto_tree_add_item(sub_tree, hf_private_data_len, next_tvb, packet_field_offset,1, FALSE);
							packet_field_offset += 1;

							/*Build a subtree here*/
							trunk_tree_item_sub = proto_tree_add_item(sub_tree_parent, hf_private_data_byte_string, next_tvb, packet_field_offset, 0, FALSE);
							sub_tree_child = proto_item_add_subtree (trunk_tree_item_sub, private_data_subtree);

							for(u = 0; u < private_data_len;u++)
							{
								/*Private data*/
								proto_tree_add_item(sub_tree_child, hf_private_data_byte, next_tvb, packet_field_offset,1, FALSE);
								packet_field_offset += 1;
							}
							if(!no_extended_pd_syntax)
							{
								/*Extended Private Data Length*/
								x_private_data_length = tvb_get_ntohs(next_tvb, packet_field_offset);
								proto_tree_add_item(sub_tree, hf_x_private_data_length, next_tvb, packet_field_offset,2, FALSE);
								packet_field_offset += 2;

								for(index = 0; index< x_private_data_length;index++)
								{
									/*Extended Private Data Byte*/
									proto_tree_add_item(sub_tree, hf_x_private_data_byte, next_tvb, packet_field_offset,1, FALSE);
									packet_field_offset += 1;
								}
							}
						}
					}
					else if(search(&assetInfoGetList,msgid))
					{
						del(&assetExtendedInfoEx,msgid);/*delete the entry from the linked list*/
						col_append_str(pkt->cinfo, COL_INFO, "Get Asset Extended Info Ex (Response)");
						packet_field_offset = 0;

						/*Request Satisfied*/
						request_satisfied = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
						proto_tree_add_uint(oqtp_tree, hf_request_satisfied, next_tvb, packet_field_offset, 1, request_satisfied);

						/*Reserved*/
						reserved_for_future_use = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x7e) >> 1);
						proto_tree_add_uint(oqtp_tree, hf_reserved_for_future_use, next_tvb, packet_field_offset, 1, reserved_for_future_use);

						/*No Extended pd syntax*/
						no_extended_pd_syntax = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x1);
						proto_tree_add_uint(oqtp_tree, hf_no_extended_pd_syntax, next_tvb, packet_field_offset, 1, no_extended_pd_syntax);
						packet_field_offset += 1;

						/*Location Programme ID*/
						proto_tree_add_item(oqtp_tree, hf_programme_id, next_tvb, packet_field_offset,4, FALSE);
						packet_field_offset += 4;

						/*Parental Rating*/
						proto_tree_add_item(oqtp_tree, hf_parental_rating, next_tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						/*Is Catch up TV*/
						is_catchup_tv = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
						proto_tree_add_uint(oqtp_tree, hf_is_catchup_tv, next_tvb, packet_field_offset, 1, is_catchup_tv);

						/*VOD delivery flag*/
						vod_delivery_flag = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x40) >> 6);
						proto_tree_add_uint(oqtp_tree, hf_vod_delivery_flag, next_tvb, packet_field_offset, 1, vod_delivery_flag);

						/*PDL delivery flag*/
						pdl_delivery_flag = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x20) >> 5);
						proto_tree_add_uint(oqtp_tree, hf_pdl_delivery_flag, next_tvb, packet_field_offset, 1, pdl_delivery_flag);

						/*DL delivery flag*/
						dl_delivery_flag = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x10) >> 4);
						proto_tree_add_uint(oqtp_tree, hf_dl_delivery_flag, next_tvb, packet_field_offset, 1, dl_delivery_flag);

						/*Reserved For Future Use*/
						reserved_for_future_use = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xe) >> 1);
						proto_tree_add_uint(oqtp_tree, hf_reserved_for_future_use, next_tvb, packet_field_offset, 1, reserved_for_future_use);

						/*Is Not Presentation Group*/
						is_not_presentation_group = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x1);
						proto_tree_add_uint(oqtp_tree, hf_is_not_presentation_group, next_tvb, packet_field_offset, 1, is_not_presentation_group);
						packet_field_offset += 1;

						/*Uuser Nibble 1*/
						user_nibble_1 = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xf0) >> 4);
						proto_tree_add_uint(oqtp_tree, hf_user_nibble_1, next_tvb, packet_field_offset, 1, user_nibble_1);

						/*Uuser Nibble 2*/
						user_nibble_2 = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0xf);
						proto_tree_add_uint(oqtp_tree, hf_user_nibble_2, next_tvb, packet_field_offset, 1, user_nibble_2);
						packet_field_offset += 1;

						/*Price*/
						proto_tree_add_item(oqtp_tree, hf_price, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						/*Telephone Code*/
						proto_tree_add_item(oqtp_tree, hf_telephone_code, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						/*Has Media*/
						has_media = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
						proto_tree_add_uint(oqtp_tree, hf_has_media, next_tvb, packet_field_offset, 1, has_media);

						/*Reserved to 0*/
						reserved_0 = (tvb_get_ntohs(next_tvb, packet_field_offset) & 0x7fff);
						proto_tree_add_item(oqtp_tree, hf_reserved_0, next_tvb, packet_field_offset,1, reserved_0);
						packet_field_offset += 2;

						/*Is Asset Purchasable Through IPPV*/
						is_ippv = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
						proto_tree_add_uint(oqtp_tree, hf_is_ippv, next_tvb, packet_field_offset, 1, is_ippv);

						/*Is Asset Purchasable Through OPPV*/
						is_oppv = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x40) >> 6);
						proto_tree_add_uint(oqtp_tree, hf_is_oppv, next_tvb, packet_field_offset, 1, is_oppv);

						/*Asset Has A Free Offer*/
						is_free_of_ca = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x20) >> 5);
						proto_tree_add_uint(oqtp_tree, hf_is_free_of_ca, next_tvb, packet_field_offset, 1, is_free_of_ca);

						/*Is Asset Viewable Through Subscription*/
						is_sub = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x10) >> 4);
						proto_tree_add_uint(oqtp_tree, hf_is_sub, next_tvb, packet_field_offset, 1, is_sub);

						/*Reserved*/
						reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xc) >> 2);
						proto_tree_add_uint(oqtp_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

						/*Asset Type*/
						asset_type = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x3);
						generic_item = proto_tree_add_uint(oqtp_tree, hf_asset_type, next_tvb, packet_field_offset, 1, asset_type);
						asset_type_string = val_to_str(asset_type, asset_type_coding, "Unknown");
						proto_item_append_text(generic_item, " --> %s", asset_type_string);
						packet_field_offset += 1;

						if(asset_type != 0)
						{
							/*Reserved*/
							reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xe0) >> 5);
							proto_tree_add_uint(oqtp_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

							/*Is Asset Viewable Through Subscription*/
							is_sub = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x10) >> 4);
							proto_tree_add_uint(oqtp_tree, hf_is_sub, next_tvb, packet_field_offset, 1, is_sub);

							/*Has Media*/
							has_media = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x8) >> 3);
							proto_tree_add_uint(oqtp_tree, hf_has_media, next_tvb, packet_field_offset, 1, has_media);

							/*Is Asset Purchasable Through IPPV*/
							is_ippv = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x4) >> 2);
							proto_tree_add_uint(oqtp_tree, hf_is_ippv, next_tvb, packet_field_offset, 1, is_ippv);

							/*Is Asset Purchasable Through OPPV*/
							is_oppv = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x2) >> 1);
							proto_tree_add_uint(oqtp_tree, hf_is_oppv, next_tvb, packet_field_offset, 1, is_oppv);

							/*Assets has free offer*/
							is_free_of_ca = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x1);
							proto_tree_add_uint(oqtp_tree, hf_is_free_of_ca, next_tvb, packet_field_offset, 1, is_free_of_ca);
							packet_field_offset += 1;
						}

						if(asset_type == 3)
						{
							/*Unique Group ID*/
							proto_tree_add_item(oqtp_tree, hf_group_id, next_tvb, packet_field_offset,4, FALSE);
							packet_field_offset += 4;

							/*Group Type*/
							group_type = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xf0) >> 4);
							generic_item = proto_tree_add_uint(oqtp_tree, hf_group_type, next_tvb, packet_field_offset, 1, group_type);
							proto_item_append_text(generic_item, " --> %s", val_to_str(group_type, group_type_coding, "Unknown"));

							/*Group Sub Type*/
							group_sub_type = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0xf);
							generic_item = proto_tree_add_uint(oqtp_tree, hf_group_sub_type, next_tvb, packet_field_offset, 1, group_sub_type);
							proto_item_append_text(generic_item, " --> %s", val_to_str(group_sub_type, group_sub_type_coding, "Unknown"));
							packet_field_offset += 1;

							/*Group Number*/
							proto_tree_add_item(oqtp_tree, hf_group_num, next_tvb, packet_field_offset,2, FALSE);
							packet_field_offset += 2;

							/*Reserved*/
							reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
							proto_tree_add_uint(oqtp_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

							/*Maximum Episode Number*/
							max_episode_num = (tvb_get_ntohs(next_tvb, packet_field_offset) & 0x7fff);
							proto_tree_add_item(sub_tree, hf_max_episode_num, next_tvb, packet_field_offset,1, max_episode_num);
							packet_field_offset += 2;

						}

						/*Asset Type Classification ID*/
						proto_tree_add_item(oqtp_tree, hf_asset_type_classif_id, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						/*Reserved*/
						reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0xf0) >> 4);
						proto_tree_add_uint(oqtp_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

						/*EPG Info Bits Length*/
						epg_info_bits_len = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0xf);
						proto_tree_add_uint(oqtp_tree, hf_epg_info_bits_len, next_tvb, packet_field_offset, 1, epg_info_bits_len);
						packet_field_offset += 1;

						if(epg_info_bits_len)
						{
							/*EPG Info Bits*/
							proto_tree_add_item(oqtp_tree, hf_epg_info_bits, next_tvb, packet_field_offset, epg_info_bits_len,FALSE);
							packet_field_offset = packet_field_offset + epg_info_bits_len;
						}

						/*Exhibition Date Time*/
						proto_tree_add_item(oqtp_tree, hf_exhibition_date_time, next_tvb, packet_field_offset,4, FALSE);
						packet_field_offset += 4;

						/*Name Length*/
						name_len = tvb_get_ntohs(next_tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_name_len, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						if(name_len)
						{
							/*Name*/
							proto_tree_add_item(oqtp_tree, hf_name, next_tvb, packet_field_offset, name_len,FALSE);
							packet_field_offset = packet_field_offset + name_len;
						}

						/*Reserved*/
						reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
						proto_tree_add_uint(oqtp_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

						/*Branding Name Length*/
						branding_name_len = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x7f);
						proto_tree_add_uint(oqtp_tree, hf_branding_name_len, next_tvb, packet_field_offset, 1, branding_name_len);
						packet_field_offset += 1;

						if(branding_name_len)
						{
							/*Name*/
							proto_tree_add_item(oqtp_tree, hf_branding_name, next_tvb, packet_field_offset, branding_name_len,FALSE);
							packet_field_offset = packet_field_offset + branding_name_len;
						}

						/*Reserved to 0*/
						proto_tree_add_item(oqtp_tree, hf_reserved_0, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						if(reserved_0 > 0)
						{
							/*Reserved*/
							reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
							proto_tree_add_uint(oqtp_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

							/*Reserved Text Length*/
							reserved_text_len = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x7f);
							proto_tree_add_uint(oqtp_tree, hf_reserved_text_len, next_tvb, packet_field_offset, 1, reserved_text_len);
							packet_field_offset += 1;

							if(reserved_text_len)
							{
								/*Reserved Text*/
								proto_tree_add_item(oqtp_tree, hf_reserved_text, next_tvb, packet_field_offset, reserved_text_len,FALSE);
								packet_field_offset = packet_field_offset + reserved_text_len;
							}
						}

						/*Episode Title Length*/
						proto_tree_add_item(oqtp_tree, hf_episode_title_len, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						if(episode_title_len)
						{
							/*Episode Title*/
							proto_tree_add_item(oqtp_tree, hf_episode_title, next_tvb, packet_field_offset, episode_title_len,FALSE);
							packet_field_offset = packet_field_offset + episode_title_len;
						}

						/*Reserved*/
						reserved = ((tvb_get_guint8(next_tvb, packet_field_offset) & 0x80) >> 7);
						proto_tree_add_uint(oqtp_tree, hf_reserved, next_tvb, packet_field_offset, 1, reserved);

						/*Series Info Length*/
						series_info_len = ((tvb_get_guint8(next_tvb, packet_field_offset)) & 0x7f);
						proto_tree_add_uint(oqtp_tree, hf_series_info_len, next_tvb, packet_field_offset, 1, series_info_len);
						packet_field_offset += 1;

						if(series_info_len)
						{
							/*Series Information*/
							proto_tree_add_item(oqtp_tree, hf_series_info, next_tvb, packet_field_offset, series_info_len,FALSE);
							packet_field_offset = packet_field_offset + series_info_len;
						}

						/*Duration*/
						proto_tree_add_item(oqtp_tree, hf_duration_4byte, next_tvb, packet_field_offset,4, FALSE);
						packet_field_offset += 4;

						/*description_len*/
						description_length = tvb_get_ntohs(next_tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_description_length, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						if(description_length)
						{
							/*Description*/
							proto_tree_add_item(oqtp_tree, hf_description, next_tvb, packet_field_offset, description_length,FALSE);
							packet_field_offset = packet_field_offset + description_length;
						}

						/*Marketing Message Length*/
						marketing_msg_len = tvb_get_ntohs(next_tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_marketing_msg_len, next_tvb, packet_field_offset, 2, FALSE);
						packet_field_offset += 2;

						if(marketing_msg_len)
						{
							/*Marketing Message*/
							proto_tree_add_item(oqtp_tree, hf_marketing_msg, next_tvb, packet_field_offset, marketing_msg_len,FALSE);
							packet_field_offset = packet_field_offset + marketing_msg_len;
						}

						/*Number Of Offers*/
						proto_tree_add_item(oqtp_tree, hf_num_of_offers, next_tvb, packet_field_offset,1, FALSE);
						packet_field_offset += 1;

						/*Last Offer End Date Time*/
						proto_tree_add_item(oqtp_tree, hf_last_offer_end_date_time, next_tvb, packet_field_offset,4, FALSE);
						packet_field_offset += 4;

						/*Private Data Length*/
						private_data_length = tvb_get_ntohs(next_tvb, packet_field_offset);
						proto_tree_add_item(oqtp_tree, hf_private_data_length, next_tvb, packet_field_offset,2, FALSE);
						packet_field_offset += 2;

						for(w = 0; w < private_data_length;w++)
						{
							/*Private Data Byte*/
							proto_tree_add_item(oqtp_tree, hf_private_data_byte, next_tvb, packet_field_offset,1, FALSE);
							packet_field_offset += 1;
						}

						if(!no_extended_pd_syntax)
						{
							/*Extended Private Data Length*/
							x_private_data_length = tvb_get_ntohs(next_tvb, packet_field_offset);
							proto_tree_add_item(oqtp_tree, hf_x_private_data_length, next_tvb, packet_field_offset,2, FALSE);
							packet_field_offset += 2;

							for(index = 0; index< x_private_data_length;index++)
							{
								/*Extended Private Data Byte*/
								proto_tree_add_item(oqtp_tree, hf_x_private_data_byte, next_tvb, packet_field_offset,1, FALSE);
								packet_field_offset += 1;
							}
						}
					}

				}
				/********************************************************/
				break;
			case OQTP_PACKET_OPCODE_ERROR:
			{
				int error_string_length = 0;
				char *error_string = NULL;

				/* Extract the error code */
				proto_tree_add_item(oqtp_tree, hf_oqtp_error_code, tvb, packet_field_offset, 2, FALSE);
				packet_field_offset += 2;

				/* Get the error string */
				error_string = tvb_get_stringz(tvb, packet_field_offset, &error_string_length);

				/* Display the error string */
				if(error_string)
					proto_tree_add_string(oqtp_tree, hf_oqtp_error_string, tvb, packet_field_offset, error_string_length, (const char *)error_string);
			}
				break;
			default:
				break;
        }

	}
}

/*Structure operations*/
void append(struct node **q,int num)
{
	struct node *temp,*r;
	temp = *q;
	if(*q==NULL)
	{
		temp = (struct node *)malloc(sizeof(struct node));
		temp->data=num;
		temp->link=NULL;
		*q=temp;
	}
	else
	{
		temp = *q;
		while(temp->link !=NULL)
		{
			temp=temp->link;
		}
		r = (struct node *)malloc(sizeof(struct node));
		r->data=num;
		r->link=NULL;
		temp->link=r;
	}
}

void del(struct node**q,int num)
{
	if(*q==NULL)
	{
		fprintf(stderr, "\nDelete failed.List empty...\n");
	}
	else
	{
		struct node *old,*temp;
		int flag=0;
		temp=*q;
		while(temp!=NULL)
		{
			if(temp->data==num)
			{
				if(temp==*q)/* First Node case */
				{
					*q=temp->link;  /* shifted the header node */
					free(temp);
					flag = 1;
					break;
				}
				else
				{
					old->link=temp->link;
					free(temp);
					flag = 1;
					break;
				}
				free(temp);
				flag=1;
			}
			else
			{
				old=temp;
				temp=temp->link;
			}
		}
		if(flag==0)
			fprintf(stderr, "Delete Data Not Found...\n");
	}
}

int search(struct node**q,int num)
{
	if(*q==NULL)
	{
		return 0;
	}
	else
	{
		struct node *temp;
		temp=*q;
		while(temp!=NULL)
		{
			if(temp->data==num)
			{
				return 1;
			}
			temp=temp->link;
		}
	}
	fprintf(stderr, "Search failed\n");
	return 0;
}

void display(struct node *q)
{
	fprintf(stderr, "Data in the list:\n");
	if(q==NULL)
	{
		fprintf(stderr, "\nEmpty Link List.Can't Display The Data");
	}
	while(q!=NULL)
	{
		printf("%d, ",q->data);
		q=q->link;
	}
}