Crate someip_parse
source ·Expand description
A Rust library for parsing the SOME/IP network protocol (without payload interpretation).
Usage
Add the following to your Cargo.toml
:
[dependencies]
someip_parse = "0.6.1"
Example
use someip_parse::SomeipMsgsIterator;
//trying parsing some ip messages located in a udp payload
for someip_message in SomeipMsgsIterator::new(&udp_payload) {
match someip_message {
Ok(value) => {
if value.is_someip_sd() {
println!("someip service discovery packet");
} else {
println!("0x{:x} (service id: 0x{:x}, method/event id: 0x{:x})",
value.message_id(),
value.service_id(),
value.event_or_method_id());
}
println!(" with payload {:?}", value.payload())
},
Err(_) => {} //error reading a someip packet (based on size, protocol version value or message type value)
}
}
References
- AUTOSAR Foundation (contains SOMEIP Protocol Specification & SOME/IP Service Discovery Protocol Specification)
- SOME/IP Protocol Specification R22-11
- SOME/IP Service Discovery Protocol Specification R22-11
Modules
- Error types of someip_parse.
- Constants related to sd entries.
- Constants related to the flags in the sd header
- Constants related to sd options.
Structs
- SOMEIP service discovery header
- Flags at the start of a SOMEIP service discovery header.
- SOMEIP header (including tp header if present).
- A slice containing an some ip header & payload of that message.
- Allows iterating over the someip messages in a udp or tcp payload.
- Buffer to reconstruct one SOMEIP TP packet stream without checks that the message id & request id are the same for all packets (this has to be done by the caller).
- Configuration of a TP buffers maximum allowed size and initial allocated buffer size.
- Additional header when a packet contains a TP header (transporting large SOME/IP messages).
- Pool of buffers to reconstruct multiple SOMEIP TP packet streams in parallel (re-uses buffers to minimize allocations).
- Describing the range of received data in an TP stream.
Enums
- Message types of a SOME/IP message.
- Return code contained in a SOME/IP header.
- Protocol numbers based on IANA/IETF
Constants
- Length of someip sd header, flags + reserved + entries length + options length excluding entries and options arrays
- Length of a someip header.
- Flag in the message type field marking the package a as tp message (transporting large SOME/IP messages of UDP).
- Offset that must be substracted from the length field to determine the length of the actual payload.
- Maximum payload length supported by some ip. This is NOT the maximum length that is supported when sending packets over UDP. This constant is based on the limitation of the length field data type (uint32).
- The maximum payload size of an SOMEIP UDP message.
- The currently supported protocol version.
- Message id of SOMEIP service discovery messages
- Length of the tp header that follows a someip header if a someip packet has been flaged as tp.
- Maximum allowed TP segment length.
- Maximum allowed TP aligned segment length.
Type Aliases
- SliceIteratorDeprecatedDeprecated use
SomeipMsgsIterator
instead. - SomeIpHeaderDeprecatedDeprecated use
SomeipHeader
instead. - SomeIpHeaderSliceDeprecatedDeprecated use
SomeipMsgSlice
instead.