ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] (Help) simulating a packet

From: divya kothapally <kdivyareddy166@xxxxxxxxx>
Date: Wed, 19 Aug 2009 13:21:51 -0700
Hi,
I was trying to simulate a packet in packet-xxx.c. Iam trying to add a string of char representing hex decimal values (exactly as the packet contains) at the end of the packet in packet-xxx.c so that i can check my local enhancements.
Correct me if iam trying to something wrong:
       guchar data[]= "194857";
      guchar *buffer;
      buffer= (guchar *) g_malloc(org_size);
      buffer=data;
       next_tvb= tvb_new_real_data(buffer, org_size, org_size);
         tvb_get_ptr(next_tvb,offset,-1);
       tvb_set_child_real_data_tvbuff(tvb, next_tvb);
      add_new_data_source(info,next_tvb, " piggybacking");
         proto_add_tree_item(tree, hf_xxx, next_tvb,offset,1, FALSE);

--
Best,
Divya Kothapally