It didn't work out-of-the box because my MSVC (v16 from Visual C
Express 2010) isn't a C99 compiler; you cannot have code ahead of
declarations.
void
calm_fast_print(netdissect_options *ndo, const u_char *eth, const u_char *bp, u_int length)
{
- printf("CALM FAST src:%s; ", etheraddr_string(eth+6));
-
int srcNwref = bp[0];
int dstNwref = bp[1];
length -= 2;
bp += 2;
+ printf("CALM FAST src:%s; ", etheraddr_string(eth+6));
printf("SrcNwref:%d; ", srcNwref);
printf("DstNwref:%d; ", dstNwref);
static void
print_btp_body(const u_char *bp, u_int length)
{
+ int version;
+ int msg_type;
+ const char *msg_type_str;
+
if (length <= 2) {
return;
}
// Assuming ItsDpuHeader
- int version = bp[0];
- int msg_type = bp[1];
- const char *msg_type_str = tok2str(msg_type_values, "unknown (%u)", msg_type);
+ version = bp[0];
+ msg_type = bp[1];
+ msg_type_str = tok2str(msg_type_values, "unknown (%u)", msg_type);
printf("; ItsPduHeader v:%d t:%d-%s", version, msg_type, msg_type_str);
}