Fix warnings given by '-Wmissing-variable-declarations':
./print-ptp.c:262:13: warning: no previous extern declaration for
non-static variable 'p_porigin_ts' [-Wmissing-variable-declarations]
const char *p_porigin_ts = "preciseOriginTimeStamp";
^
./print-ptp.c:262:7: note: declare 'static' if the variable is not
intended to be used outside of this translation unit
const char *p_porigin_ts = "preciseOriginTimeStamp";
^
./print-ptp.c:263:13: warning: no previous extern declaration for
non-static variable 'p_origin_ts' [-Wmissing-variable-declarations]
const char *p_origin_ts = "originTimeStamp";
^
./print-ptp.c:263:7: note: declare 'static' if the variable is not
intended to be used outside of this translation unit
const char *p_origin_ts = "originTimeStamp";
^
./print-ptp.c:264:13: warning: no previous extern declaration for
non-static variable 'p_recv_ts' [-Wmissing-variable-declarations]
const char *p_recv_ts = "receiveTimeStamp";
^
./print-ptp.c:264:7: note: declare 'static' if the variable is not
intended to be used outside of this translation unit
const char *p_recv_ts = "receiveTimeStamp";
Moreover:
Put a function definition name at the beginning of the line.
ND_PRINT("(%s)", tok2str(ptp_msg_type, "unknown", e)); \
}
ND_PRINT("(%s)", tok2str(ptp_msg_type, "unknown", e)); \
}
-const char *p_porigin_ts = "preciseOriginTimeStamp";
-const char *p_origin_ts = "originTimeStamp";
-const char *p_recv_ts = "receiveTimeStamp";
+static const char *p_porigin_ts = "preciseOriginTimeStamp";
+static const char *p_origin_ts = "originTimeStamp";
+static const char *p_recv_ts = "receiveTimeStamp";
#define PTP_VER_1 0x1
#define PTP_VER_2 0x2
#define PTP_VER_1 0x1
#define PTP_VER_2 0x2
ND_PRINT(" (not implemented)");
}
ND_PRINT(" (not implemented)");
}
-static void ptp_print_2(netdissect_options *ndo, const u_char *bp, u_int length)
+static void
+ptp_print_2(netdissect_options *ndo, const u_char *bp, u_int length)
{
u_int len = length;
uint16_t msg_len, flags, port_id, seq_id;
{
u_int len = length;
uint16_t msg_len, flags, port_id, seq_id;