scapy.contrib.automotive.someip
- class scapy.contrib.automotive.someip.SD(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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()]
- FLAGSDEF = {'REBOOT': Flag(mask=128, offset=7), 'UNICAST': Flag(mask=64, offset=6)}
- SOMEIP_CLIENT_ID = 0
- SOMEIP_IFACE_VER = 1
- SOMEIP_MINIMUM_SESSION_ID = 1
- SOMEIP_MSGID_EVENTID = 256
- SOMEIP_MSGID_SRVID = 65535
- SOMEIP_MSGID_SUBID = 1
- 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
0
res
0
len_entry_array
None
entry_array
[]
len_option_array
None
option_array
[]
- get_flag(name)
- set_entryArray(entry_list)
- set_flag(name, value)
- set_optionArray(option_list)
- class scapy.contrib.automotive.someip.SDEntry_EventGroup(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
6
index_1
0
index_2
0
n_opt_1
XBitField
(4 bits)0
n_opt_2
XBitField
(4 bits)0
srv_id
0
inst_id
0
major_ver
0
ttl
0
res
XBitField
(12 bits)0
cnt
XBitField
(4 bits)0
eventgroup_id
0
- class scapy.contrib.automotive.someip.SDEntry_Service(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
0
index_1
0
index_2
0
n_opt_1
XBitField
(4 bits)0
n_opt_2
XBitField
(4 bits)0
srv_id
0
inst_id
0
major_ver
0
ttl
0
minor_ver
0
- class scapy.contrib.automotive.someip.SDOption_Config(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
None
type
1
res_hdr
0
cfg_str
b'\x00'
- static make_string(data)
- post_build(pkt, pay)
- class scapy.contrib.automotive.someip.SDOption_IP4_EndPoint(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
9
type
4
res_hdr
0
addr
'0.0.0.0'
res_tail
0
l4_proto
17
port
0
- class scapy.contrib.automotive.someip.SDOption_IP4_Multicast(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
9
type
20
res_hdr
0
addr
'0.0.0.0'
res_tail
0
l4_proto
17
port
0
- class scapy.contrib.automotive.someip.SDOption_IP4_SD_EndPoint(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
9
type
36
res_hdr
0
addr
'0.0.0.0'
res_tail
0
l4_proto
17
port
0
- class scapy.contrib.automotive.someip.SDOption_IP6_EndPoint(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
21
type
6
res_hdr
0
addr
'::'
res_tail
0
l4_proto
17
port
0
- class scapy.contrib.automotive.someip.SDOption_IP6_Multicast(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
21
type
22
res_hdr
0
addr
'::'
res_tail
0
l4_proto
17
port
0
- class scapy.contrib.automotive.someip.SDOption_IP6_SD_EndPoint(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
21
type
38
res_hdr
0
addr
'::'
res_tail
0
l4_proto
17
port
0
- class scapy.contrib.automotive.someip.SDOption_LoadBalance(*args, **kargs)
Bases:
scapy.contrib.automotive.someip._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
5
type
2
res_hdr
0
priority
0
weight
0
- class scapy.contrib.automotive.someip.SOMEIP(*args, **kargs)
Bases:
scapy.packet.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 = 36
- TYPE_TP_NOTIFICATION = 34
- TYPE_TP_REQUEST = 32
- TYPE_TP_REQUEST_NO_RET = 33
- TYPE_TP_RESPONSE = 35
- aliastypes
- answers(other)
- 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 |S| METHOD ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | EVENT ID | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | CLIENT ID |S| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PROTO VER | IFACE VER |M| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RETCODE | OFFSET | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | RES |M| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. SOMEIP
SOMEIP fields srv_id
0
sub_id
BitEnumField
(1 bit)0
method_id
XBitField
(Cond) (15 bits)0
event_id
XBitField
(Cond) (15 bits)0
len
None
client_id
0
session_id
0
proto_ver
1
iface_ver
1
msg_type
0
retcode
0
offset
BitField
(Cond) (28 bits)0
res
BitField
(Cond) (3 bits)0
more_seg
BitField
(Cond) (1 bit)0
- fragment(fragsize=1392)
Fragment SOME/IP-TP
- post_build(pkt, pay)