Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: [Wireshark-dev] Getting bytes from fvalue_t

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Gauthier Brion <gauthier.brion@xxxxxxxxx>
Date: Sun, 3 May 2009 16:20:14 +0200

Hi all,

I need to get bytes representing the fvalue_t data. So, I need to be
able to know if the field value of fvalue_t is representing a pointer
or the real data
Examples :
  if the type is FT_ETHER, the field value is representing a pointer
to a data (more exactly a GByteArray)
  if the type is FT_UINT8, the field value is directly representing a uint8

Is this should work every times? (It works for those two examples)

	if (cfile.finfo_selected->value.ftype->get_value) {
		ptr = cfile.finfo_selected->value.ftype->get_value(&cfile.finfo_selected->value);
	}
	else {
		ptr = &cfile.finfo_selected->value.value;
	}

Is there a better way to do it?
Thanks :-)

  • Prev by Date: [Wireshark-dev] buildbot failure in Wireshark (development) on OSX-10.5-ppc
  • Next by Date: [Wireshark-dev] buildbot failure in Wireshark (development) on Windows-XP-x86
  • Previous by thread: [Wireshark-dev] buildbot failure in Wireshark (development) on OSX-10.5-ppc
  • Next by thread: [Wireshark-dev] buildbot failure in Wireshark (development) on Windows-XP-x86
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation