Wireshark-dev: [Wireshark-dev] Re: [exported_pdu] p2p_dir and link_dir
Hi Mauro,
9 sept. 2025 14:43:13 Mauro Levra via Wireshark-dev <wireshark-dev@xxxxxxxxxxxxx>:
> Hi all,
>
> I am storing 3GPP messages in exported_pdu format (e.g., plain NAS messages, 5G NR signalling...), and I am looking for a way to store the direction of the packet: uplink or downlink. I know that for some packet the direction is known from the protocol, but for other it is not and I would like to have it saved in the exported_pdu header.
>
> In the exported_pdu format, I see there is a tag EXP_PDU_TAG_P2P_DIRECTION that sets the *p2p_dir* field of the packet. Looking at the comments in *packet_info.h* I can see that both *p2p_dir* and *link_dir* exist, and I am not sure about the difference and whether we need to add a tag for link_dir in the exported_pdu format.
Both the NAS EPS and NAS 5GS dissectors are using the link_dir variable to know the direction (P2P_DIR_UL or P2P_DIR_DL). But they do have heuristics to figure out the direction if unknown when possible. Do you have an example where the heuristics fail? We might be able to improve them.
>
> Can you please help me understand this difference?
> I can create a MR to add a new tag for link_dir if that is the right approach.
We can definitely add it if it is useful to someone, but you might already be able to get the right decoding out of the box. Or maybe you have a use case I did not think about that really requires it.
Best regards,
Pascal.