scapy.contrib.automotive.someip

class scapy.contrib.automotive.someip.SD(_pkt, /, *, flags=<Flag 0 ()>, res=0, len_entry_array=None, entry_array=[], len_option_array=None, option_array=[])[source]

Bases: _SDPacketBase

SD Packet

NOTEwhen adding ‘entries’ or ‘options’, do not use list.append()

method but create a new list

e.g.p = SD()

p.option_array = [SDOption_Config(),SDOption_IP6_EndPoint()]

SOMEIP_CLIENT_ID = 0
SOMEIP_IFACE_VER = 1
SOMEIP_MINIMUM_SESSION_ID = 1
SOMEIP_MSGID_SRVID = 65535
SOMEIP_MSGID_SUBID = 33024
SOMEIP_MSG_TYPE = 2
SOMEIP_PROTO_VER = 1
SOMEIP_RETCODE = 0
aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     FLAGS     |                      RES                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |                LEN ENTRY ARRAY                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |          ENTRY ARRAY          |LEN OPTION ARRA|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                               |  OPTION ARRAY |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |
+-+-+-+-+-+-+-+-+

                             Fig. SD                              
SD fields

flags

FlagsField

<Flag 0 ()>

res

X3BytesField

0

len_entry_array

FieldLenField

None

entry_array

PacketListField

[]

len_option_array

FieldLenField

None

option_array

PacketListField

[]

set_entryArray(entry_list)[source]
set_optionArray(option_list)[source]
class scapy.contrib.automotive.someip.SDEntry_EventGroup(_pkt, /, *, type=6, index_1=0, index_2=0, n_opt_1=0, n_opt_2=0, srv_id=0, inst_id=0, major_ver=0, ttl=0, res=0, cnt=0, eventgroup_id=0)[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |    INDEX 1    |    INDEX 2    |N OPT 1|N OPT 2|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             SRV ID            |            INST ID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   MAJOR VER   |                      TTL                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |          RES          |  CNT  | EVENTGROUP ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |
+-+-+-+-+-+-+-+-+

                     Fig. SDEntry_EventGroup                      
SDEntry_EventGroup fields

type

XByteEnumField

6

index_1

XByteField

0

index_2

XByteField

0

n_opt_1

XBitField (4 bits)

0

n_opt_2

XBitField (4 bits)

0

srv_id

XShortField

0

inst_id

XShortField

0

major_ver

XByteField

0

ttl

X3BytesField

0

res

XBitField (12 bits)

0

cnt

XBitField (4 bits)

0

eventgroup_id

XShortField

0

class scapy.contrib.automotive.someip.SDEntry_Service(_pkt, /, *, type=0, index_1=0, index_2=0, n_opt_1=0, n_opt_2=0, srv_id=0, inst_id=0, major_ver=0, ttl=0, minor_ver=0)[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |    INDEX 1    |    INDEX 2    |N OPT 1|N OPT 2|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             SRV ID            |            INST ID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   MAJOR VER   |                      TTL                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |                   MINOR VER                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |
+-+-+-+-+-+-+-+-+

                       Fig. SDEntry_Service                       
SDEntry_Service fields

type

XByteEnumField

0

index_1

XByteField

0

index_2

XByteField

0

n_opt_1

XBitField (4 bits)

0

n_opt_2

XBitField (4 bits)

0

srv_id

XShortField

0

inst_id

XShortField

0

major_ver

XByteField

0

ttl

X3BytesField

0

minor_ver

XIntField

0

class scapy.contrib.automotive.someip.SDOption_Config(_pkt, /, *, len=None, type=1, res_hdr=0, cfg_str=b'\x00')[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |      TYPE     |    RES HDR    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            CFG STR            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Fig. SDOption_Config                       
SDOption_Config fields

len

ShortField

None

type

XByteEnumField

1

res_hdr

XByteField

0

cfg_str

StrLenField

b'\x00'

static make_string(data)[source]
post_build(pkt, pay)[source]
class scapy.contrib.automotive.someip.SDOption_IP4_EndPoint(_pkt, /, *, len=9, type=4, res_hdr=0, addr='0.0.0.0', res_tail=0, l4_proto=17, port=0)[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |      TYPE     |    RES HDR    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              ADDR                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    RES TAIL   |    L4 PROTO   |              PORT             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Fig. SDOption_IP4_EndPoint                    
SDOption_IP4_EndPoint fields

len

ShortField

9

type

XByteEnumField

4

res_hdr

XByteField

0

addr

IPField

'0.0.0.0'

res_tail

XByteField

0

l4_proto

ByteEnumField

17

port

ShortField

0

class scapy.contrib.automotive.someip.SDOption_IP4_Multicast(_pkt, /, *, len=9, type=20, res_hdr=0, addr='0.0.0.0', res_tail=0, l4_proto=17, port=0)[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |      TYPE     |    RES HDR    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              ADDR                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    RES TAIL   |    L4 PROTO   |              PORT             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. SDOption_IP4_Multicast                    
SDOption_IP4_Multicast fields

len

ShortField

9

type

XByteEnumField

20

res_hdr

XByteField

0

addr

IPField

'0.0.0.0'

res_tail

XByteField

0

l4_proto

ByteEnumField

17

port

ShortField

0

class scapy.contrib.automotive.someip.SDOption_IP4_SD_EndPoint(_pkt, /, *, len=9, type=36, res_hdr=0, addr='0.0.0.0', res_tail=0, l4_proto=17, port=0)[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |      TYPE     |    RES HDR    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              ADDR                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    RES TAIL   |    L4 PROTO   |              PORT             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Fig. SDOption_IP4_SD_EndPoint                   
SDOption_IP4_SD_EndPoint fields

len

ShortField

9

type

XByteEnumField

36

res_hdr

XByteField

0

addr

IPField

'0.0.0.0'

res_tail

XByteField

0

l4_proto

ByteEnumField

17

port

ShortField

0

class scapy.contrib.automotive.someip.SDOption_IP6_EndPoint(_pkt, /, *, len=21, type=6, res_hdr=0, addr='::', res_tail=0, l4_proto=17, port=0)[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |      TYPE     |    RES HDR    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              ADDR                             |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    RES TAIL   |    L4 PROTO   |              PORT             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Fig. SDOption_IP6_EndPoint                    
SDOption_IP6_EndPoint fields

len

ShortField

21

type

XByteEnumField

6

res_hdr

XByteField

0

addr

IP6Field

'::'

res_tail

XByteField

0

l4_proto

ByteEnumField

17

port

ShortField

0

class scapy.contrib.automotive.someip.SDOption_IP6_Multicast(_pkt, /, *, len=21, type=22, res_hdr=0, addr='::', res_tail=0, l4_proto=17, port=0)[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |      TYPE     |    RES HDR    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              ADDR                             |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    RES TAIL   |    L4 PROTO   |              PORT             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. SDOption_IP6_Multicast                    
SDOption_IP6_Multicast fields

len

ShortField

21

type

XByteEnumField

22

res_hdr

XByteField

0

addr

IP6Field

'::'

res_tail

XByteField

0

l4_proto

ByteEnumField

17

port

ShortField

0

class scapy.contrib.automotive.someip.SDOption_IP6_SD_EndPoint(_pkt, /, *, len=21, type=38, res_hdr=0, addr='::', res_tail=0, l4_proto=17, port=0)[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |      TYPE     |    RES HDR    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              ADDR                             |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    RES TAIL   |    L4 PROTO   |              PORT             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Fig. SDOption_IP6_SD_EndPoint                   
SDOption_IP6_SD_EndPoint fields

len

ShortField

21

type

XByteEnumField

38

res_hdr

XByteField

0

addr

IP6Field

'::'

res_tail

XByteField

0

l4_proto

ByteEnumField

17

port

ShortField

0

class scapy.contrib.automotive.someip.SDOption_LoadBalance(_pkt, /, *, len=5, type=2, res_hdr=0, priority=0, weight=0)[source]

Bases: _SDPacketBase

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |      TYPE     |    RES HDR    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            PRIORITY           |             WEIGHT            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Fig. SDOption_LoadBalance                     
SDOption_LoadBalance fields

len

ShortField

5

type

XByteEnumField

2

res_hdr

XByteField

0

priority

ShortField

0

weight

ShortField

0

class scapy.contrib.automotive.someip.SOMEIP(_pkt, /, *, srv_id=0, sub_id=None, len=None, client_id=0, session_id=0, proto_ver=1, iface_ver=1, msg_type=0, retcode=0, offset=0, res=0, more_seg=0, data=[<Raw  |>])[source]

Bases: Packet

SOME/IP Packet.

INTERFACE_VERSION = 1
LEN_OFFSET = 8
LEN_OFFSET_TP = 12
PROTOCOL_VERSION = 1
RET_E_MALFORMED_MSG = 9
RET_E_NOT_OK = 1
RET_E_NOT_REACHABLE = 5
RET_E_NOT_READY = 4
RET_E_OK = 0
RET_E_TIMEOUT = 6
RET_E_UNKNOWN_METHOD = 3
RET_E_UNKNOWN_SERVICE = 2
RET_E_WRONG_INTERFACE_V = 8
RET_E_WRONG_MESSAGE_TYPE = 10
RET_E_WRONG_PROTOCOL_V = 7
TYPE_ERROR = 129
TYPE_ERROR_ACK = 193
TYPE_NOTIFICATION = 2
TYPE_NOTIFICATION_ACK = 66
TYPE_REQUEST = 0
TYPE_REQUEST_ACK = 64
TYPE_REQUEST_NORET_ACK = 65
TYPE_REQUEST_NO_RET = 1
TYPE_RESPONSE = 128
TYPE_RESPONSE_ACK = 192
TYPE_TP_ERROR = 161
TYPE_TP_NOTIFICATION = 34
TYPE_TP_REQUEST = 32
TYPE_TP_REQUEST_NO_RET = 33
TYPE_TP_RESPONSE = 160
aliastypes
answers(other)[source]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             SRV ID            |             SUB ID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              LEN                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           CLIENT ID           |           SESSION ID          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   PROTO VER   |   IFACE VER   |    MSG TYPE   |    RETCODE    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         OFFSET                        | RES |M|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              DATA             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                           Fig. SOMEIP                            
SOMEIP fields

srv_id

XShortField

0

sub_id

MultipleTypeField (XShortField, XShortField, XShortField)

0

len

IntField

None

client_id

XShortField

0

session_id

XShortField

0

proto_ver

XByteField

1

iface_ver

XByteField

1

msg_type

ByteEnumField

0

retcode

ByteEnumField

0

offset

BitScalingField (Cond) (28 bits)

0

res

BitField (Cond) (3 bits)

0

more_seg

BitField (Cond) (1 bit)

0

data

PacketListField (Cond)

[<Raw  |>]

fragment(fragsize=1392)[source]

Fragment SOME/IP-TP

static get_payload_cls_by_srv_id(pkt, lst, cur, remain)[source]
payload_cls_by_srv_id = {}
payload_guess

Possible sublayers: SD

post_build(pkt, pay)[source]