Wireshark mailing list archives

How to extract a string


From: "Rach, Darshan" <DarshanR () nds com>
Date: Fri, 4 Dec 2009 09:27:54 +0530

Hi,

How to extract a string from packet (of Hex values)?
I know the string length.

[cid:image001.png@01CA74C4.0EF6FC80]

I tried doing the following. But I am still not able to find it.

guint16 loc_name_length =0;

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

/*Location Name*/
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 + 1;

Any help on this would be appreciated.

Regards,
Darshan

________________________________
This message is confidential and intended only for the addressee. If you have received this message in error, please 
immediately notify the postmaster () nds com 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 () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: