scapy.contrib.automotive.someip¶
-
class
scapy.contrib.automotive.someip.SD(*args, **kargs)¶ Bases:
scapy.contrib.automotive.someip._SDPacketBaseSD 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. SDSD fields¶ flags
0res
0len_entry_array
Noneentry_array
[]len_option_array
Noneoption_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_EventGroupSDEntry_EventGroup fields¶ type
6index_1
0index_2
0n_opt_1
XBitField(4 bits)0n_opt_2
XBitField(4 bits)0srv_id
0inst_id
0major_ver
0ttl
0res
XBitField(12 bits)0cnt
XBitField(4 bits)0eventgroup_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_ServiceSDEntry_Service fields¶ type
0index_1
0index_2
0n_opt_1
XBitField(4 bits)0n_opt_2
XBitField(4 bits)0srv_id
0inst_id
0major_ver
0ttl
0minor_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_ConfigSDOption_Config fields¶ len
Nonetype
1res_hdr
0cfg_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_EndPointSDOption_IP4_EndPoint fields¶ len
9type
4res_hdr
0addr
'0.0.0.0'res_tail
0l4_proto
17port
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_MulticastSDOption_IP4_Multicast fields¶ len
9type
20res_hdr
0addr
'0.0.0.0'res_tail
0l4_proto
17port
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_EndPointSDOption_IP4_SD_EndPoint fields¶ len
9type
36res_hdr
0addr
'0.0.0.0'res_tail
0l4_proto
17port
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_EndPointSDOption_IP6_EndPoint fields¶ len
21type
6res_hdr
0addr
'::'res_tail
0l4_proto
17port
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_MulticastSDOption_IP6_Multicast fields¶ len
21type
22res_hdr
0addr
'::'res_tail
0l4_proto
17port
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_EndPointSDOption_IP6_SD_EndPoint fields¶ len
21type
38res_hdr
0addr
'::'res_tail
0l4_proto
17port
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_LoadBalanceSDOption_LoadBalance fields¶ len
5type
2res_hdr
0priority
0weight
0
-
-
class
scapy.contrib.automotive.someip.SOMEIP(*args, **kargs)¶ Bases:
scapy.packet.PacketSOME/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. SOMEIPSOMEIP fields¶ srv_id
0sub_id
BitEnumField(1 bit)0method_id
XBitField(Cond) (15 bits)0event_id
XBitField(Cond) (15 bits)0len
Noneclient_id
0session_id
0proto_ver
1iface_ver
1msg_type
0retcode
0offset
BitField(Cond) (28 bits)0res
BitField(Cond) (3 bits)0more_seg
BitField(Cond) (1 bit)0
-
fragment(fragsize=1392)¶ Fragment SOME/IP-TP
-
post_build(pkt, pay)¶
-