Crate someip_parse[][src]

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.4.0"

Example

examples/print_messages.rs:

use someip_parse::SliceIterator;
 
//trying parsing some ip messages located in a udp payload
for someip_message in SliceIterator::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)
    }
}

Todo

  • Example how to serialize someip packets
  • SOMEIP Service Discovery Message Parsing

References

Structs

Allows iterating over the someip messages in a udp or tcp payload.

SOMEIP header (including tp header if present).

A slice containing an some ip header & payload of that message.

Additional header when a packet contains a TP header (transporting large SOME/IP messages).

Enums

Message types of a SOME/IP message.

Errors that can occur when reading someip headers.

Return code contained in a SOME/IP header.

Range errors in fields of the someip & tp header struct. These can occur when serializing or modifying an error.

Errors that can occur when serializing a someip & tp header.

Constants

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 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.