]>
The Tcpdump Group git mirrors - tcpdump/blob - print-someip.c
2 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that: (1) source code
4 * distributions retain the above copyright notice and this paragraph
5 * in its entirety, and (2) distributions including binary code include
6 * the above copyright notice and this paragraph in its entirety in
7 * the documentation or other materials provided with the distribution.
8 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
9 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
10 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
11 * FOR A PARTICULAR PURPOSE.
13 * Original code by Francesco Fondelli (francesco dot fondelli, gmail dot com)
20 #include "netdissect-stdinc.h"
21 #include "netdissect.h"
26 * SOMEIP Header (R19-11)
29 * 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
30 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
31 * | Message ID (Service ID/Method ID) |
32 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
34 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
35 * | Request ID (Client ID/Session ID) |
36 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
37 * | Protocol Ver | Interface Ver | Message Type | Return Code |
38 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 struct tok message_type_values
[] = {
45 { 0x01, "REQUEST_NO_RETURN" },
46 { 0x02, "NOTIFICATION" },
49 { 0x20, "TP_REQUEST" },
50 { 0x21, "TP_REQUEST_NO_RETURN" },
51 { 0x22, "TP_NOTIFICATION" },
52 { 0xa0, "TP_RESPONSE" },
57 struct tok return_code_values
[] = {
60 { 0x02, "E_UNKNOWN_SERVICE" },
61 { 0x03, "E_UNKNOWN_METHOD" },
62 { 0x04, "E_NOT_READY" },
63 { 0x05, "E_NOT_REACHABLE" },
64 { 0x06, "E_TIMEOUT" },
65 { 0x07, "E_WRONG_PROTOCOL_VERSION" },
66 { 0x08, "E_WRONG_INTERFACE_VERSION" },
67 { 0x09, "E_MALFORMED_MESSAGE" },
68 { 0x0a, "E_WRONG_MESSAGE_TYPE" },
69 { 0x0b, "E_E2E_REPEATED" },
70 { 0x0c, "E_E2E_WRONG_SEQUENCE" },
72 { 0x0e, "E_E2E_NOT_AVAILABLE" },
73 { 0x0f, "E_E2E_NO_NEW_DATA" },
77 someip_print(netdissect_options
*ndo
, const u_char
*bp
, u_int len
)
81 uint16_t method_or_event_id
;
87 uint8_t protocol_version
;
88 uint8_t interface_version
;
92 ndo
->ndo_protocol
= "someip";
99 message_id
= GET_BE_U_4(bp
);
100 service_id
= message_id
>> 16;
101 event_flag
= (message_id
& 0x00008000) >> 15;
102 method_or_event_id
= message_id
& 0x00007FFF;
105 message_len
= GET_BE_U_4(bp
);
108 request_id
= GET_BE_U_4(bp
);
109 client_id
= request_id
>> 16;
110 session_id
= request_id
& 0x0000FFFF;
113 protocol_version
= GET_U_1(bp
);
116 interface_version
= GET_U_1(bp
);
119 message_type
= GET_U_1(bp
);
122 return_code
= GET_U_1(bp
);
125 ND_PRINT("SOMEIP, service %u, %s %u, len %u, client %u, session %u, "
126 "pver %u, iver %u, msgtype %s, retcode %s\n",
127 service_id
, event_flag
? "event" : "method", method_or_event_id
,
128 message_len
, client_id
, session_id
, protocol_version
,
130 tok2str(message_type_values
, "Unknown", message_type
),
131 tok2str(return_code_values
, "Unknown", return_code
));