X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/246ca110d152b6483fd8c1c176a570858307f76b..5ef0bcb5edd748de9d9af13c40da0395dfdd94e8:/print-someip.c diff --git a/print-someip.c b/print-someip.c index 5da3851b..9eb63713 100644 --- a/print-someip.c +++ b/print-someip.c @@ -13,8 +13,10 @@ * Original code by Francesco Fondelli (francesco dot fondelli, gmail dot com) */ +/* \summary: Autosar SOME/IP Protocol printer */ + #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif #include "netdissect-stdinc.h" @@ -31,16 +33,16 @@ * | Message ID (Service ID/Method ID) | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Length | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Request ID (Client ID/Session ID) | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Protocol Ver | Interface Ver | Message Type | Return Code | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Payload | - * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ -struct tok message_type_values[] = { +static const struct tok message_type_values[] = { { 0x00, "REQUEST" }, { 0x01, "REQUEST_NO_RETURN" }, { 0x02, "NOTIFICATION" }, @@ -54,7 +56,7 @@ struct tok message_type_values[] = { { 0, NULL } }; -struct tok return_code_values[] = { +static const struct tok return_code_values[] = { { 0x00, "E_OK" }, { 0x01, "E_NOT_OK" }, { 0x02, "E_UNKNOWN_SERVICE" }, @@ -71,10 +73,11 @@ struct tok return_code_values[] = { { 0x0d, "E_E2E" }, { 0x0e, "E_E2E_NOT_AVAILABLE" }, { 0x0f, "E_E2E_NO_NEW_DATA" }, + { 0, NULL } }; void -someip_print(netdissect_options *ndo, const u_char *bp, u_int len) +someip_print(netdissect_options *ndo, const u_char *bp, const u_int len) { uint32_t message_id; uint16_t service_id;