This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Is it possible to modify the hf array as the packet is being parsed?

0

So with the custom protocol I'm writing there are a lot of properties that need to be added to the hf array.

I was wondering if it's possible to add items to it as I'm parsing the packet. That is, not every packet will have a header for every single property so I would only add the ones that are present.

asked 14 Feb '11, 15:13

Rodayo's gravatar image

Rodayo
61111115
accept rate: 0%

edited 14 Feb '11, 15:14


One Answer:

0

The short answer: All the needed hf[] entries should be specified in the proto_register function.

Even it might be possible to do late registration, I don't think anything is really gained and your code would definitely be more complex.

answered 14 Feb '11, 22:46

Bill%20Meier's gravatar image

Bill Meier ♦♦
3.2k1850
accept rate: 17%

Actually, I looked at packet-http.c and it looked like that file was doing just what I was proposing. I followed it as a guideline and it seems to have worked without any problems. Thanks anyways =]

(15 Feb '11, 11:11) Rodayo