Skip to content

Commit

Permalink
Correct endianness handling for imported data to ensure consistent in…
Browse files Browse the repository at this point in the history
…terpretation across systems.
  • Loading branch information
raissi-oussema committed Dec 9, 2024
1 parent 7aee737 commit 7966b06
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
27 changes: 0 additions & 27 deletions Packet++/header/DoIpEnumToString.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,31 +223,4 @@ namespace pcpp
{ DoIpSyncStatus::VIN_AND_OR_GID_ARE_NOT_SINCHRONIZED, "VIN and/or GID are not synchronized" },
{ DoIpSyncStatus::NON_INITIALIZED, "NULL" }
};

/**
* @brief Mapping of DoIP Payload Types to their corresponding payload lengths.
*
* This unordered map associates each `DoIpPayloadType` enum value with a specific max payload length.
* It provides the needed length for each payload type, ensuring proper handling of message sizes
* when building DoIP messages.
inline static const std::unordered_map<DoIpPayloadTypes, int> DoIpMapPayloadTypeToPayloadLength{
{ DoIpPayloadTypes::GENERIC_HEADER_NEG_ACK, 1 },
{ DoIpPayloadTypes::VEHICLE_IDENTIFICATION_REQUEST, 0 },
{ DoIpPayloadTypes::VEHICLE_IDENTIFICATION_REQUEST_WITH_EID, 6 },
{ DoIpPayloadTypes::VEHICLE_IDENTIFICATION_REQUEST_WITH_VIN, 17 },
{ DoIpPayloadTypes::ANNOUNCEMENT_MESSAGE, 40 },
{ DoIpPayloadTypes::ROUTING_ACTIVATION_REQUEST, 11 },
{ DoIpPayloadTypes::ROUTING_ACTIVATION_RESPONSE, 9 },
{ DoIpPayloadTypes::ALIVE_CHECK_REQUEST, 0 },
{ DoIpPayloadTypes::ALIVE_CHECK_RESPONSE, 2 },
{ DoIpPayloadTypes::ENTITY_STATUS_REQUEST, 0 },
{ DoIpPayloadTypes::ENTITY_STATUS_RESPONSE, 7 },
{ DoIpPayloadTypes::DIAGNOSTIC_POWER_MODE_REQUEST, 0 },
{ DoIpPayloadTypes::DIAGNOSTIC_POWER_MODE_RESPONSE, 1 },
{ DoIpPayloadTypes::DIAGNOSTIC_MESSAGE_TYPE, 1452 },
{ DoIpPayloadTypes::DIAGNOSTIC_MESSAGE_POS_ACK, 5 },
{ DoIpPayloadTypes::DIAGNOSTIC_MESSAGE_NEG_ACK, 4 }
}; */

} // namespace pcpp
1 change: 1 addition & 0 deletions Packet++/header/DoIpLayerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <vector>
#include <memory>
#include <array>
#include "EndianPortable.h"
#include "Logger.h"
#include "GeneralUtils.h"
#include "DoIpEnumToString.h"
Expand Down

0 comments on commit 7966b06

Please sign in to comment.