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

Wireshark-dev: Re: [Wireshark-dev] hf_http_response_code in packet-http.c

From: "Sultan, Hassan" <sultah@xxxxxxxxxx>
Date: Thu, 13 Jul 2017 17:25:08 +0000

> -----Original Message-----
> From: Wireshark-dev [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf
> Of Erik de Jong
> Sent: Wednesday, July 12, 2017 10:12 PM
> To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
> Subject: Re: [Wireshark-dev] hf_http_response_code in packet-http.c
> 
> 
> 
> On Thu, Jul 13, 2017 at 1:12 AM, Sultan, Hassan via Wireshark-dev <wireshark-
> dev@xxxxxxxxxxxxx <mailto:wireshark-dev@xxxxxxxxxxxxx> > wrote:
> 
> 
> 	Hi,
> 
> 
> 
> 	I am starting to learn the Wireshark code base, and one thing puzzles
> me…
> 
> 
> 
> 	Why is hf_http_response_code defined as a FT_UINT16 with BASE_DEC
> rather than an FT_STRING ?
> 
> 
> 
> 	It’s a text field… not an integer.
> 
> 
> Presenting it as a number allows for filtering like:
> http.response.code > 200
> 
> Which would not be possible when presented as a string.

Thanks for the info, but in that case would it not be more appropriate to have the normal field as an FT_STRING and add a generated field as FT_UINT16 ? My understanding of generated fields is that this is their purpose : represent data that doesn't exactly correspond to the packet data.
We could still keep the field named as is today (hence ensuring all existing filters still work), but simply make it a generated field, and add an FT_STRING to represent the actual data as it is in the packet.

Thoughts ?


> 
> 
> 
> 
> 
> 
> 
> 	Anyone can enlighten me ? For the beginner that I am this looks like a
> bug, even though the display properly represent the http response code. Happy
> to send a patch if that’s case, just want to check first…
> 
> 
> 
> 	Regards,
> 
> 
> 
> 	Hassan Sultan
> 
> 
> 	__________________________________________________________
> _________________
> 	Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx
> <mailto:wireshark-dev@xxxxxxxxxxxxx> >
> 	Archives:    https://www.wireshark.org/lists/wireshark-dev
> <https://www.wireshark.org/lists/wireshark-dev>
> 	Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-
> dev <https://www.wireshark.org/mailman/options/wireshark-dev>
> 	             mailto:wireshark-dev-request@xxxxxxxxxxxxx <mailto:wireshark-
> dev-request@xxxxxxxxxxxxx> ?subject=unsubscribe
> 
>