Skip to content

handling of capture agent id #2

@fborot

Description

@fborot

I just implemented the HEP3 protocol in C# and I found an inconsistency when using these 2 tools ("hepipe" and "captagent6") to send data to Homer; the "capture_agent_id" is treated as a payload type of "uint16" instead of "uint32" as per the protocol definition.
The only 2 chunk_types that I see treated as payload type "uint32" are the 2 timestamps (secs and usecs)

The function used to treat the "capture_agent_id" is "htons" instead of "htonl". You use "htonl" for the 2 timestamps as expected.

I checked the 2 PDF detailing the HEP3 protocol that are here :
https://github.com/sipcapture/HEP/tree/master/docs

I thought that maybe the Protocol definition changed and the pdf was not uploaded but the PCAP captures taken when sending packets to the Homer server using both tools (captagent6 and hepipe) use 4 bytes for that chunk_type, so it is still a "uint32" payload type.

That creates the problem on the server side of not identifying properly the agentid when writing the record to the tables.
In my case, I was using agent_i.d = 2001 which translate to "0x D1 07 00 00" in my Intel pc, (little endian) and when applying the "htonl" is was "0x 00 00 07 D1", and it was identified on the Homer server as agent_id = 0.
When looking at how the data was sent using the 2 tools (hepipe and captagent6) using the same value (2001) the bytes were: "0x07 D1 00 00", which is not what results from converting it to network byte order (big endian) using "htonl"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions