Comment # 12
on bug 9120
from Evan Huus
(In reply to comment #11)
> (In reply to comment #10)
> > Ya, I was thinking of adding a stack of proto_id values that is maintained
> > like (or instead of) layer_names even when !tree so that dissectors can do
> > something like
> >
> > if (pinfo->protocols[top] == proto_tcp) do stuff
> > else if (pinfo->protocols[top] == proto_udp) do stuff
>
> The dissector would the need to populate proto_xx I suppose and do
> if (pinfo->protocols[top-1] I suppose as top would point to the current
> dissector.
There is some code to update the layer_names in proto.c that we could adapt to
avoid touching every dissector. You're right on the top-1 bit.
> I was thinking of the struct that may be passed trough:
> >the (relatively new) 'data' parameter to dissector_try_uint_new(), >call_dissector_only(), dissector_try_heuristic() and others.
>
> As it might suffer from the same type of problem.
We have at least two different ways of passing void pointers around
(pinfo->private_data, data parameter to new dissector calls). Giving a general
way to identify the parent protocol would make both of those safer.
You are receiving this mail because:
- You are watching all bug changes.