Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues about doParsimPacking() and doParsimUnpacking() for TcpOption in TcpHeader_m.h #961

Open
kalsasdf opened this issue Mar 20, 2024 · 1 comment
Assignees
Labels

Comments

@kalsasdf
Copy link

Issue Description:

In the TcpHeader_m.h file, there exists an inconsistency regarding the definition of the doParsimPacking() and doParsimUnpacking() functions for the TcpOption class, which mismatches the way TcpOption is used in the TcpHeader class.

The issue arises from the fact that the doParsimPacking() and doParsimUnpacking() functions expect TcpOption& as parameters, while in the TcpHeader class, TcpOption objects are defined as a two-level pointer, TcpOption * *headerOption = nullptr.

Consequently, when dereferencing in the doParsimArrayPacking() function in TcpHeader_m.cc,
1710916650656

the TcpOption object cannot locate the correct doParsimPacking() and doParsimUnpacking() functions, resulting in the error "Parsim error: No doParsimPacking() function for type inet::tcp::TcpOption *".
1710916696935

We propose an improvement method as illustrated below.
1710916753579 in TcpHeader::parsimPack(omnetpp::cCommBuffer *b)
1710916813693
in TcpHeader::parsimUnpack(omnetpp::cCommBuffer *b)

However, the issue is that TcpHeader_m.cc and TcpHeader_m.h are generated by TcpHeader.msg and would be cleared during make clean. As a result, our modifications will also be wiped out. Moreover, TcpHeader.msg does not directly relate to the doParsimPacking() and doParsimUnpacking() functions, making it impossible for us to amend TcpHeader.msg to generate these functions correctly.

Therefore, we suggest submitting this issue to the official INET for further enhancement.

@kalsasdf
Copy link
Author

Supplementary:
The above method enables the normal packing and unpacking of the TcpOption field. However, further testing revealed that this modification affects the subsequent fields' ability to pack and unpack correctly, like EthernetPadding in SYN. Therefore, we switched to the following approach, which effectively bypasses the inline packing and unpacking functions (doParsimPacking() and doParsimUnpacking()) of TcpOption. Instead, we directly call the parsimPack and parsimUnpack functions within the TcpOption class.

1711866010254
in TcpHeader::parsimPack(omnetpp::cCommBuffer *b)
1711866021708
in TcpHeader::parsimUnpack(omnetpp::cCommBuffer *b)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants