Open kalsasdf opened 8 months ago
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.
in TcpHeader::parsimPack(omnetpp::cCommBuffer b) in TcpHeader::parsimUnpack(omnetpp::cCommBuffer b)
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,
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 *".
We propose an improvement method as illustrated below. in TcpHeader::parsimPack(omnetpp::cCommBuffer b) 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.