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

examples/print_messages.rs:

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

Modules§

err
Error types of someip_parse.
sd_entries
Constants related to sd entries.
sd_flags
Constants related to the flags in the sd header
sd_options
Constants related to sd options.

Structs§

SdHeader
SOMEIP service discovery header
SdHeaderFlags
Flags at the start of a SOMEIP service discovery header.
SomeipHeader
SOMEIP header (including tp header if present).
SomeipMsgSlice
A slice containing an some ip header & payload of that message.
SomeipMsgsIterator
Allows iterating over the someip messages in a udp or tcp payload.
TpBuf
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).
TpBufConfig
Configuration of a TP buffers maximum allowed size and initial allocated buffer size.
TpHeader
Additional header when a packet contains a TP header (transporting large SOME/IP messages).
TpPool
Pool of buffers to reconstruct multiple SOMEIP TP packet streams in parallel (re-uses buffers to minimize allocations).
TpRange
Describing the range of received data in an TP stream.

Enums§

MessageType
Message types of a SOME/IP message.
ReturnCode
Return code contained in a SOME/IP header.
SdEntry
SdEventGroupEntryType
SdOption
SdOptionType
SdServiceEntryType
TransportProtocol
Protocol numbers based on IANA/IETF

Constants§

EVENT_ENTRY_INITIAL_DATA_REQUESTED_FLAG
MIN_SD_HEADER_LENGTH
Length of someip sd header, flags + reserved + entries length + options length excluding entries and options arrays
SOMEIP_HEADER_LENGTH
Length of a someip header.
SOMEIP_HEADER_MESSAGE_TYPE_TP_FLAG
Flag in the message type field marking the package a as tp message (transporting large SOME/IP messages of UDP).
SOMEIP_LEN_OFFSET_TO_PAYLOAD
Offset that must be substracted from the length field to determine the length of the actual payload.
SOMEIP_MAX_PAYLOAD_LEN
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).
SOMEIP_MAX_PAYLOAD_LEN_UDP
The maximum payload size of an SOMEIP UDP message.
SOMEIP_PROTOCOL_VERSION
The currently supported protocol version.
SOMEIP_SD_MESSAGE_ID
Message id of SOMEIP service discovery messages
TP_HEADER_LENGTH
Length of the tp header that follows a someip header if a someip packet has been flaged as tp.
TP_UDP_MAX_SEGMENT_LEN
Maximum allowed TP segment length.
TP_UDP_MAX_SEGMENT_LEN_ALIGNED
Maximum allowed TP aligned segment length.

Type Aliases§

SliceIteratorDeprecated
Deprecated use SomeipMsgsIterator instead.
SomeIpHeaderDeprecated
Deprecated use SomeipHeader instead.
SomeIpHeaderSliceDeprecated
Deprecated use SomeipMsgSlice instead.