8 #include <unordered_map>
119 uint8_t* m_ShadowData;
122 SomeIpSdOption() : m_DataContainer(nullptr), m_Offset(0), m_ShadowData(nullptr), m_DataLen(0)
126 : m_DataContainer(dataContainer), m_Offset(offset), m_ShadowData(nullptr), m_DataLen(0)
131 SomeIpSdOption(
const SomeIpSdOption&) =
delete;
132 SomeIpSdOption& operator=(
const SomeIpSdOption&) =
delete;
196 #pragma pack(push, 1)
200 uint32_t ipv4Address;
273 #pragma pack(push, 1)
277 uint8_t ipv6Address[16];
358 #pragma pack(push, 1)
405 #pragma pack(push, 1)
414 #if (BYTE_ORDER == LITTLE_ENDIAN)
448 uint32_t minorVersion);
461 uint8_t counter, uint16_t eventGroupID);
600 enum class TypeInternal : uint8_t
603 FindService_Internal = 0x00,
605 OfferService_Internal = 0x01,
607 SubscribeEventgroup_Internal = 0x06,
609 SubscribeEventgroupAck_Internal = 0x07,
615 uint8_t* m_ShadowData;
617 void initStdFields(
EntryType type, uint16_t serviceID, uint16_t instanceID, uint8_t majorVersion, uint32_t TTL);
622 static const uint32_t SOMEIPSD_HDR_ENTRY_MASK_TTL = 0x00FFFFFF;
635 typedef std::vector<EntryPtr> EntriesVec;
637 typedef std::vector<OptionPtr> OptionsVec;
659 SomeIpSdLayer(uint16_t serviceID, uint16_t methodID, uint16_t clientID, uint16_t sessionID,
660 uint8_t interfaceVersion,
MsgType type, uint8_t returnCode, uint8_t flags);
674 return port == 30490;
760 #pragma pack(push, 1)
774 uint32_t m_NumOptions;
776 static bool countOptions(uint32_t& count,
const uint8_t* data);
779 bool addOptionIndex(uint32_t indexEntry, uint32_t indexOffset);
782 static size_t getLenEntries(
const uint8_t* data);
783 size_t getLenEntries()
const;
784 static size_t getLenOptions(
const uint8_t* data);
785 size_t getLenOptions()
const;
786 void setLenEntries(uint32_t length);
787 void setLenOptions(uint32_t length);
Definition: IpAddress.h:32
Definition: IpAddress.h:199
Definition: SomeIpLayer.h:20
MsgType
Definition: SomeIpLayer.h:26
Definition: SomeIpSdLayer.h:294
SomeIpSdConfigurationOption(const std::string &configurationString)
SomeIpSdConfigurationOption(const IDataContainer *dataContainer, size_t offset)
std::string getConfigurationString() const
Definition: SomeIpSdLayer.h:374
EntryType getType() const
Definition: SomeIpSdLayer.h:491
uint16_t getEventgroupId() const
size_t getLength() const
Definition: SomeIpSdLayer.h:500
uint8_t * getDataPtr() const
void setMajorVersion(uint8_t majorVersion)
void setCounter(uint8_t counter)
void setEventgroupId(uint16_t eventgroupID)
uint8_t getMajorVersion() const
uint32_t getNumOptions() const
EntryType
Definition: SomeIpSdLayer.h:382
@ SubscribeEventgroupNack
@ StopSubscribeEventgroup
SomeIpSdEntry(EntryType type, uint16_t serviceID, uint16_t instanceID, uint8_t majorVersion, uint32_t TTL, uint8_t counter, uint16_t eventGroupID)
void setMinorVersion(uint32_t minorVersion)
uint16_t getInstanceId() const
void setInstanceId(uint16_t instanceId)
void setTtl(uint32_t ttl)
uint8_t getCounter() const
void setServiceId(uint16_t serviceId)
SomeIpSdEntry(EntryType type, uint16_t serviceID, uint16_t instanceID, uint8_t majorVersion, uint32_t TTL, uint32_t minorVersion)
uint16_t getServiceId() const
SomeIpSdEntry(const SomeIpSdLayer *pSomeIpSdLayer, size_t offset)
uint32_t getMinorVersion() const
someipsdhdrentry * getSomeIpSdEntryHeader() const
Definition: SomeIpSdLayer.h:140
SomeIpSdIPv4Option(IPv4OptionType type, IPv4Address ipAddress, uint16_t port, SomeIpSdProtocolType l4Protocol)
IPv4Address getIpAddress() const
SomeIpSdIPv4Option(const IDataContainer *dataContainer, size_t offset)
IPv4OptionType
Definition: SomeIpSdLayer.h:148
@ IPv4Multicast
Definition: SomeIpSdLayer.h:152
@ IPv4SdEndpoint
Definition: SomeIpSdLayer.h:154
@ IPv4Endpoint
Definition: SomeIpSdLayer.h:150
SomeIpSdProtocolType getProtocol() const
Definition: SomeIpSdLayer.h:217
IPv6Address getIpAddress() const
SomeIpSdProtocolType getProtocol() const
SomeIpSdIPv6Option(const IDataContainer *dataContainer, size_t offset)
SomeIpSdIPv6Option(IPv6OptionType type, IPv6Address ipAddress, uint16_t port, SomeIpSdProtocolType l4Protocol)
IPv6OptionType
Definition: SomeIpSdLayer.h:225
@ IPv6Multicast
Definition: SomeIpSdLayer.h:229
@ IPv6SdEndpoint
Definition: SomeIpSdLayer.h:231
@ IPv6Endpoint
Definition: SomeIpSdLayer.h:227
Definition: SomeIpSdLayer.h:630
uint32_t addEntry(const SomeIpSdEntry &entry)
const OptionsVec getOptionsFromEntry(uint32_t index) const
std::string toString() const override
bool addOptionTo(uint32_t indexEntry, const SomeIpSdOption &option)
static bool isSomeIpSdPort(uint16_t port)
Definition: SomeIpSdLayer.h:672
SomeIpSdLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
void computeCalculateFields() override
Definition: SomeIpSdLayer.h:748
static bool isDataValid(const uint8_t *data, size_t dataLen)
uint32_t getNumEntries() const
~SomeIpSdLayer() override=default
const OptionsVec getOptions() const
SomeIpSdLayer(uint16_t serviceID, uint16_t methodID, uint16_t clientID, uint16_t sessionID, uint8_t interfaceVersion, MsgType type, uint8_t returnCode, uint8_t flags)
void setFlags(uint8_t flags)
uint32_t getNumOptions() const
const EntriesVec getEntries() const
Definition: SomeIpSdLayer.h:323
SomeIpSdLoadBalancingOption(const IDataContainer *dataContainer, size_t offset)
uint16_t getWeight() const
uint16_t getPriority() const
SomeIpSdLoadBalancingOption(uint16_t priority, uint16_t weight)
Definition: SomeIpSdLayer.h:39
OptionType
Definition: SomeIpSdLayer.h:47
someipsdhdroptionsbase * getSomeIpSdOptionHeader() const
uint8_t * getDataPtr() const
virtual ~SomeIpSdOption()
OptionType getType() const
size_t getLength() const
Definition: SomeIpSdLayer.h:99
The main namespace for the PcapPlusPlus lib.
SomeIpSdProtocolType
Definition: SomeIpSdLayer.h:25
@ SD_UDP
Definition: SomeIpSdLayer.h:29
@ SD_TCP
Definition: SomeIpSdLayer.h:27
Definition: SomeIpLayer.h:65
Definition: SomeIpSdLayer.h:407
uint32_t data
Definition: SomeIpSdLayer.h:434
uint8_t nrOpt2
Definition: SomeIpSdLayer.h:417
uint32_t majorVersion_ttl
Definition: SomeIpSdLayer.h:432
uint8_t type
Definition: SomeIpSdLayer.h:409
uint8_t indexFirstOption
Definition: SomeIpSdLayer.h:411
uint8_t nrOpt1
Definition: SomeIpSdLayer.h:419
uint16_t serviceID
Definition: SomeIpSdLayer.h:428
uint8_t indexSecondOption
Definition: SomeIpSdLayer.h:413
uint16_t instanceID
Definition: SomeIpSdLayer.h:430
Definition: SomeIpSdLayer.h:74
uint8_t reserved
Definition: SomeIpSdLayer.h:80
uint16_t length
Definition: SomeIpSdLayer.h:76
uint8_t type
Definition: SomeIpSdLayer.h:78