For each decoder that has more than one instance of truncation signaling
and prints the same string in each instance make sure that the string is
declared as "static const char tstr[]" right after the initial includes
block. Where necessary, replace fputs(s, stdout) with equivalent
printf("%s", s).
35 files changed:
#include "ieee802_11.h"
#include "ieee802_11_radio.h"
#include "ieee802_11.h"
#include "ieee802_11_radio.h"
+static const char tstr[] = "[|802.11]";
+
/* Radiotap state */
/* This is used to save state when parsing/processing parameters */
struct radiotap_state
/* Radiotap state */
/* This is used to save state when parsing/processing parameters */
struct radiotap_state
caplen = orig_caplen;
/* Remove FCS, if present */
if (length < fcslen) {
caplen = orig_caplen;
/* Remove FCS, if present */
if (length < fcslen) {
return caplen;
}
length -= fcslen;
return caplen;
}
length -= fcslen;
}
if (caplen < IEEE802_11_FC_LEN) {
}
if (caplen < IEEE802_11_FC_LEN) {
case T_MGMT:
if (!mgmt_body_print(fc,
(const struct mgmt_header_t *)(p - hdrlen), p, length)) {
case T_MGMT:
if (!mgmt_body_print(fc,
(const struct mgmt_header_t *)(p - hdrlen), p, length)) {
return hdrlen;
}
break;
case T_CTRL:
if (!ctrl_body_print(fc, p - hdrlen)) {
return hdrlen;
}
break;
case T_CTRL:
if (!ctrl_body_print(fc, p - hdrlen)) {
/* There may be a problem w/ AP not having this bit set */
if (FC_WEP(fc)) {
if (!wep_print(p)) {
/* There may be a problem w/ AP not having this bit set */
if (FC_WEP(fc)) {
if (!wep_print(p)) {
return hdrlen;
}
} else if (llc_print(p, length, caplen, dst, src,
return hdrlen;
}
} else if (llc_print(p, length, caplen, dst, src,
struct radiotap_state state;
if (caplen < sizeof(*hdr)) {
struct radiotap_state state;
if (caplen < sizeof(*hdr)) {
len = EXTRACT_LE_16BITS(&hdr->it_len);
if (caplen < len) {
len = EXTRACT_LE_16BITS(&hdr->it_len);
if (caplen < len) {
return caplen;
}
cpack_init(&cpacker, (u_int8_t *)hdr, len); /* align against header start */
return caplen;
}
cpack_init(&cpacker, (u_int8_t *)hdr, len); /* align against header start */
/* are there more bitmap extensions than bytes in header? */
if (IS_EXTENDED(last_presentp)) {
/* are there more bitmap extensions than bytes in header? */
if (IS_EXTENDED(last_presentp)) {
u_int32_t caphdr_len;
if (caplen < 8) {
u_int32_t caphdr_len;
if (caplen < 8) {
* to be large enough to include even the version
* cookie or capture header length!
*/
* to be large enough to include even the version
* cookie or capture header length!
*/
return caplen;
}
if (caplen < caphdr_len) {
return caplen;
}
if (caplen < caphdr_len) {
u_int32_t msgcode;
if (caplen < 4) {
u_int32_t msgcode;
if (caplen < 4) {
return ieee802_11_avs_radio_print(p, length, caplen);
if (caplen < PRISM_HDR_LEN) {
return ieee802_11_avs_radio_print(p, length, caplen);
if (caplen < PRISM_HDR_LEN) {
#include "extract.h"
#include "addrtoname.h"
#include "extract.h"
#include "addrtoname.h"
-static const char *corrupt_str = "(corrupt)";
-static const char *trunc_str = "[|ahcp]";
+static const char tstr[] = " [|ahcp]";
+static const char cstr[] = "(corrupt)";
#define AHCP_MAGIC_NUMBER 43
#define AHCP_VERSION_1 1
#define AHCP_MAGIC_NUMBER 43
#define AHCP_VERSION_1 1
- printf(": %s", corrupt_str);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
- printf(": %s", corrupt_str);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
- printf(": %s", corrupt_str);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
- printf(": %s", corrupt_str);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
- printf(": %s", corrupt_str);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
- printf(": %s", corrupt_str);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
- printf(" %s", corrupt_str);
TCHECK2(*cp, ep - cp);
return;
trunc:
TCHECK2(*cp, ep - cp);
return;
trunc:
- printf(" %s", trunc_str);
- printf(" %s", corrupt_str);
TCHECK2(*cp, ep - cp);
return;
trunc:
TCHECK2(*cp, ep - cp);
return;
trunc:
- printf(" %s", trunc_str);
- printf(" %s", corrupt_str);
TCHECK2(*cp, ep - cp);
return;
trunc:
TCHECK2(*cp, ep - cp);
return;
trunc:
- printf(" %s", trunc_str);
#include "ethertype.h"
#include "extract.h" /* must come after interface.h */
#include "ethertype.h"
#include "extract.h" /* must come after interface.h */
+static const char tstr[] = "[|ARP]";
+
/*
* Address Resolution Protocol.
*
/*
* Address Resolution Protocol.
*
op = ATMOP(ap);
if (!ND_TTEST2(*aar_tpa(ap), ATMTPROTO_LEN(ap))) {
op = ATMOP(ap);
if (!ND_TTEST2(*aar_tpa(ap), ATMTPROTO_LEN(ap))) {
- ND_PRINT((ndo, "[|ARP]"));
+ ND_PRINT((ndo, "%s", tstr));
ND_DEFAULTPRINT((const u_char *)ap, length);
return;
}
ND_DEFAULTPRINT((const u_char *)ap, length);
return;
}
- ND_PRINT((ndo, "[|ARP]"));
+ ND_PRINT((ndo, "%s", tstr));
}
if (!ND_TTEST2(*ar_tpa(ap), PROTO_LEN(ap))) {
}
if (!ND_TTEST2(*ar_tpa(ap), PROTO_LEN(ap))) {
- ND_PRINT((ndo, "[|ARP]"));
+ ND_PRINT((ndo, "%s", tstr));
ND_DEFAULTPRINT((const u_char *)ap, length);
return;
}
ND_DEFAULTPRINT((const u_char *)ap, length);
return;
}
- ND_PRINT((ndo, "[|ARP]"));
+ ND_PRINT((ndo, "%s", tstr));
#include "extract.h" /* must come after interface.h */
#include "appletalk.h"
#include "extract.h" /* must come after interface.h */
#include "appletalk.h"
+static const char tstr[] = "[|atalk]";
+
static const struct tok type2str[] = {
{ ddpRTMP, "rtmp" },
{ ddpRTMPrequest, "rtmpReq" },
static const struct tok type2str[] = {
{ ddpRTMP, "rtmp" },
{ ddpRTMPrequest, "rtmpReq" },
-static char tstr[] = "[|atalk]";
-
static void atp_print(const struct atATP *, u_int);
static void atp_bitmap_print(u_char);
static void nbp_print(const struct atNBP *, u_int, u_short, u_char, u_char);
static void atp_print(const struct atATP *, u_int);
static void atp_bitmap_print(u_char);
static void nbp_print(const struct atNBP *, u_int, u_short, u_char, u_char);
+static const char tstr[] = "[|atm]";
+
#define OAM_CRC10_MASK 0x3ff
#define OAM_PAYLOAD_LEN 48
#define OAM_FUNCTION_SPECIFIC_LEN 45 /* this excludes crc10 and cell-type/function-type */
#define OAM_CRC10_MASK 0x3ff
#define OAM_PAYLOAD_LEN 48
#define OAM_FUNCTION_SPECIFIC_LEN 45 /* this excludes crc10 and cell-type/function-type */
u_int hdrlen = 0;
if (caplen < 8) {
u_int hdrlen = 0;
if (caplen < 8) {
bpf_u_int32 call_ref;
if (caplen < PROTO_POS) {
bpf_u_int32 call_ref;
if (caplen < PROTO_POS) {
return;
}
if (p[PROTO_POS] == Q2931) {
return;
}
if (p[PROTO_POS] == Q2931) {
*/
printf("Q.2931");
if (caplen < MSG_TYPE_POS) {
*/
printf("Q.2931");
if (caplen < MSG_TYPE_POS) {
#include "interface.h"
#include "extract.h"
#include "interface.h"
#include "extract.h"
+static const char tstr[] = "[|babel]";
+
static void babel_print_v2(const u_char *cp, u_int length);
void
static void babel_print_v2(const u_char *cp, u_int length);
void
txcost = EXTRACT_16BITS(message + 4);
interval = EXTRACT_16BITS(message + 6);
rc = network_address(message[2], message + 8, len - 6, address);
txcost = EXTRACT_16BITS(message + 4);
interval = EXTRACT_16BITS(message + 6);
rc = network_address(message[2], message + 8, len - 6, address);
- if(rc < 0) { printf("[|babel]"); break; }
+ if(rc < 0) { printf("%s", tstr); break; }
printf("%s txcost %u interval %s",
format_address(address), txcost, format_interval(interval));
}
printf("%s txcost %u interval %s",
format_address(address), txcost, format_interval(interval));
}
#include "ether.h"
#include "bootp.h"
#include "ether.h"
#include "bootp.h"
+static const char tstr[] = " [|bootp]";
+
static void rfc1048_print(const u_char *);
static void cmu_print(const u_char *);
static char *client_fqdn_flags(u_int flags);
static void rfc1048_print(const u_char *);
static void cmu_print(const u_char *);
static char *client_fqdn_flags(u_int flags);
-static char tstr[] = " [|bootp]";
-
static const struct tok bootp_flag_values[] = {
{ 0x8000, "Broadcast" },
{ 0, NULL}
static const struct tok bootp_flag_values[] = {
{ 0x8000, "Broadcast" },
{ 0, NULL}
#include "extract.h" /* must come after interface.h */
#include "nlpid.h"
#include "extract.h" /* must come after interface.h */
#include "nlpid.h"
+static const char tstr[] = "[|cdp]";
+
#define CDP_HEADER_LEN 4
static const struct tok cdp_tlv_values[] = {
#define CDP_HEADER_LEN 4
static const struct tok cdp_tlv_values[] = {
const u_char *tptr;
if (caplen < CDP_HEADER_LEN) {
const u_char *tptr;
if (caplen < CDP_HEADER_LEN) {
- (void)printf("[|cdp]");
#endif
#include "ipproto.h"
#endif
#include "ipproto.h"
+static const char tstr[] = "[|dccp]";
+
static const char *dccp_reset_codes[] = {
"unspecified",
"closed",
static const char *dccp_reset_codes[] = {
"unspecified",
"closed",
#include "interface.h"
#include "addrtoname.h"
#include "interface.h"
#include "addrtoname.h"
+static const char tstr[] = "[|decnet]";
+
/* Forwards */
static int print_decnet_ctlmsg(const union routehdr *, u_int, u_int);
static void print_t_info(int);
/* Forwards */
static int print_decnet_ctlmsg(const union routehdr *, u_int, u_int);
static void print_t_info(int);
const u_char *nspp;
if (length < sizeof(struct shorthdr)) {
const u_char *nspp;
if (length < sizeof(struct shorthdr)) {
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
return;
}
TCHECK2(*ap, sizeof(short));
pktlen = EXTRACT_LE_16BITS(ap);
if (pktlen < sizeof(struct shorthdr)) {
return;
}
TCHECK2(*ap, sizeof(short));
pktlen = EXTRACT_LE_16BITS(ap);
if (pktlen < sizeof(struct shorthdr)) {
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
return;
}
if (pktlen > length) {
return;
}
if (pktlen > length) {
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
return;
}
length = pktlen;
return;
}
length = pktlen;
if (vflag)
(void) printf("[pad:%d] ", padlen);
if (length < padlen + 2) {
if (vflag)
(void) printf("[pad:%d] ", padlen);
if (length < padlen + 2) {
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
return;
}
TCHECK2(ap[sizeof(short)], padlen);
return;
}
TCHECK2(ap[sizeof(short)], padlen);
switch (mflags & RMF_MASK) {
case RMF_LONG:
if (length < sizeof(struct longhdr)) {
switch (mflags & RMF_MASK) {
case RMF_LONG:
if (length < sizeof(struct longhdr)) {
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
return;
}
TCHECK(rhp->rh_long);
return;
}
TCHECK(rhp->rh_long);
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
#include "interface.h"
#include "extract.h"
#include "interface.h"
#include "extract.h"
+static const char tstr[] = "[|forces]";
/*
* Per draft-ietf-forces-protocol-22
/*
* Per draft-ietf-forces-protocol-22
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
return sdatailv_print(tdp, rlen, op_msk, indent);
trunc:
return sdatailv_print(tdp, rlen, op_msk, indent);
trunc:
- fputs("[|forces]", stdout);
return fdatatlv_print(dp, tll, op_msk, indent);
trunc:
return fdatatlv_print(dp, tll, op_msk, indent);
trunc:
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
- fputs("[|forces]", stdout);
#include "ip.h"
#include "ethertype.h"
#include "ip.h"
#include "ethertype.h"
+static const char tstr[] = "[|gre]";
+
#define GRE_CP 0x8000 /* checksum present */
#define GRE_RP 0x4000 /* routing present */
#define GRE_KP 0x2000 /* key present */
#define GRE_CP 0x8000 /* checksum present */
#define GRE_RP 0x4000 /* routing present */
#define GRE_KP 0x2000 /* key present */
u_int len = length, vers;
if (len < 2) {
u_int len = length, vers;
if (len < 2) {
return;
}
vers = EXTRACT_16BITS(bp) & GRE_VERS_MASK;
return;
}
vers = EXTRACT_16BITS(bp) & GRE_VERS_MASK;
#define IN_CLASSD(i) (((int32_t)(i) & 0xf0000000) == 0xe0000000)
#endif
#define IN_CLASSD(i) (((int32_t)(i) & 0xf0000000) == 0xe0000000)
#endif
+static const char tstr[] = "[|igmp]";
+
/* (following from ipmulti/mrouted/prune.h) */
/*
/* (following from ipmulti/mrouted/prune.h) */
/*
printf(" with-ttl %d", TR_GETTTL(EXTRACT_32BITS(&tr->tr_rttlqid)));
return;
trunc:
printf(" with-ttl %d", TR_GETTTL(EXTRACT_32BITS(&tr->tr_rttlqid)));
return;
trunc:
- (void)printf("[|igmp]");
printf(" with-ttl %d", TR_GETTTL(EXTRACT_32BITS(&tr->tr_rttlqid)));
return;
trunc:
printf(" with-ttl %d", TR_GETTTL(EXTRACT_32BITS(&tr->tr_rttlqid)));
return;
trunc:
- (void)printf("[|igmp]");
- (void)printf("[|igmp]");
+ (void)printf("%s", tstr);
(void)printf("]");
return;
trunc:
(void)printf("]");
return;
trunc:
- (void)printf("[|igmp]");
+ (void)printf("%s", tstr);
- fputs("[|igmp]", stdout);
+ (void)printf("%s", tstr);
#include "ip.h"
#include "ipproto.h"
#include "ip.h"
#include "ipproto.h"
+static const char tstr[] = "[|ip]";
+
static const struct tok ip_option_values[] = {
{ IPOPT_EOL, "EOL" },
{ IPOPT_NOP, "NOP" },
static const struct tok ip_option_values[] = {
{ IPOPT_EOL, "EOL" },
{ IPOPT_NOP, "NOP" },
printf("IP ");
if ((u_char *)(ipds->ip + 1) > ndo->ndo_snapend) {
printf("IP ");
if ((u_char *)(ipds->ip + 1) > ndo->ndo_snapend) {
return;
}
if (length < sizeof (struct ip)) {
return;
}
if (length < sizeof (struct ip)) {
#include "addrtoname.h"
#include "extract.h"
#include "addrtoname.h"
#include "extract.h"
+static const char tstr[] = " [|kerberos]";
+
static const u_char *c_print(register const u_char *, register const u_char *);
static const u_char *krb4_print_hdr(const u_char *);
static void krb4_print(const u_char *);
static const u_char *c_print(register const u_char *, register const u_char *);
static const u_char *krb4_print_hdr(const u_char *);
static void krb4_print(const u_char *);
u_int8_t type; /* Type+B */
};
u_int8_t type; /* Type+B */
};
-static char tstr[] = " [|kerberos]";
-
static const struct tok type2str[] = {
{ AUTH_MSG_KDC_REQUEST, "KDC_REQUEST" },
{ AUTH_MSG_KDC_REPLY, "KDC_REPLY" },
static const struct tok type2str[] = {
{ AUTH_MSG_KDC_REQUEST, "KDC_REQUEST" },
{ AUTH_MSG_KDC_REPLY, "KDC_REPLY" },
#include "interface.h"
#include "extract.h"
#include "interface.h"
#include "extract.h"
-static char tstr[] = " [|l2tp]";
+static const char tstr[] = " [|l2tp]";
#define L2TP_MSGTYPE_SCCRQ 1 /* Start-Control-Connection-Request */
#define L2TP_MSGTYPE_SCCRP 2 /* Start-Control-Connection-Reply */
#define L2TP_MSGTYPE_SCCRQ 1 /* Start-Control-Connection-Request */
#define L2TP_MSGTYPE_SCCRP 2 /* Start-Control-Connection-Reply */
#include "rpc_auth.h"
#include "rpc_msg.h"
#include "rpc_auth.h"
#include "rpc_msg.h"
+static const char tstr[] = " [|nfs]";
+
static void nfs_printfh(const u_int32_t *, const u_int);
static int xid_map_enter(const struct sunrpc_msg *, const u_char *);
static int xid_map_find(const struct sunrpc_msg *, const u_char *,
static void nfs_printfh(const u_int32_t *, const u_int);
static int xid_map_enter(const struct sunrpc_msg *, const u_char *);
static int xid_map_find(const struct sunrpc_msg *, const u_char *,
- fputs(" [|nfs]", stdout);
- fputs(" [|nfs]", stdout);
- fputs(" [|nfs]", stdout);
- fputs(" [|nfs]", stdout);
- fputs(" [|nfs]", stdout);
#include "ipproto.h"
#include "openflow.h"
#include "ipproto.h"
#include "openflow.h"
+static const char tstr[] = " [|openflow]";
+static const char cstr[] = " (corrupt)";
+
#define OFPT_HELLO 0x00
#define OFPT_ERROR 0x01
#define OFPT_ECHO_REQUEST 0x02
#define OFPT_HELLO 0x00
#define OFPT_ERROR 0x01
#define OFPT_ECHO_REQUEST 0x02
- printf(" [|openflow]");
return of10_data_print(cp, ep, len - 4);
corrupt: /* skip the undersized data */
return of10_data_print(cp, ep, len - 4);
corrupt: /* skip the undersized data */
TCHECK2(*cp, len);
return cp + len;
trunc:
TCHECK2(*cp, len);
return cp + len;
trunc:
- printf(" [|openflow]");
- printf(" [|openflow]");
return cp;
corrupt: /* skip the undersized trailing data */
return cp;
corrupt: /* skip the undersized trailing data */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
return cp;
corrupt: /* skip the rest of queue properties */
return cp;
corrupt: /* skip the rest of queue properties */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
return cp;
corrupt: /* skip the rest of queues */
return cp;
corrupt: /* skip the rest of queues */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
- printf(" [|openflow]");
return cp;
corrupt: /* skip the rest of actions */
return cp;
corrupt: /* skip the rest of actions */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
return of10_phy_ports_print(cp, ep, len - OF_SWITCH_FEATURES_LEN);
trunc:
return of10_phy_ports_print(cp, ep, len - OF_SWITCH_FEATURES_LEN);
trunc:
- printf(" [|openflow]");
return of10_actions_print("\n\t ", cp, ep, len - OF_FLOW_MOD_LEN);
trunc:
return of10_actions_print("\n\t ", cp, ep, len - OF_FLOW_MOD_LEN);
trunc:
- printf(" [|openflow]");
- printf(" [|openflow]");
return cp;
corrupt: /* skip the message body */
return cp;
corrupt: /* skip the message body */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
return cp + DESC_STR_LEN;
corrupt: /* skip the message body */
return cp + DESC_STR_LEN;
corrupt: /* skip the message body */
TCHECK2(*cp, len);
return cp + len;
trunc:
TCHECK2(*cp, len);
return cp + len;
trunc:
- printf(" [|openflow]");
return cp;
corrupt: /* skip the rest of flow statistics entries */
return cp;
corrupt: /* skip the rest of flow statistics entries */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
return cp + 4;
corrupt: /* skip the message body */
return cp + 4;
corrupt: /* skip the message body */
TCHECK2(*cp, len);
return cp + len;
trunc:
TCHECK2(*cp, len);
return cp + len;
trunc:
- printf(" [|openflow]");
return cp;
corrupt: /* skip the undersized trailing data */
return cp;
corrupt: /* skip the undersized trailing data */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
return cp;
corrupt: /* skip the undersized trailing data */
return cp;
corrupt: /* skip the undersized trailing data */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
return cp;
corrupt: /* skip the undersized trailing data */
return cp;
corrupt: /* skip the undersized trailing data */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
- printf(" [|openflow]");
return of10_packet_data_print(cp, ep, len - OF_PACKET_OUT_LEN - actions_len);
corrupt: /* skip the rest of the message body */
return of10_packet_data_print(cp, ep, len - OF_PACKET_OUT_LEN - actions_len);
corrupt: /* skip the rest of the message body */
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
return of10_packet_data_print(cp, ep, len - (OF_PACKET_IN_LEN - 2));
trunc:
return of10_packet_data_print(cp, ep, len - (OF_PACKET_IN_LEN - 2));
trunc:
- printf(" [|openflow]");
- printf(" [|openflow]");
return of10_data_print(cp, ep, len - OF_ERROR_MSG_LEN);
trunc:
return of10_data_print(cp, ep, len - OF_ERROR_MSG_LEN);
trunc:
- printf(" [|openflow]");
goto next_message;
corrupt: /* skip the message body */
goto next_message;
corrupt: /* skip the message body */
next_message:
TCHECK2(*cp0, len0 - OF_HEADER_LEN);
return cp0 + len0 - OF_HEADER_LEN;
trunc:
next_message:
TCHECK2(*cp0, len0 - OF_HEADER_LEN);
return cp0 + len0 - OF_HEADER_LEN;
trunc:
- printf(" [|openflow]");
#include "extract.h"
#include "openflow.h"
#include "extract.h"
#include "openflow.h"
+static const char tstr[] = " [|openflow]";
+static const char cstr[] = " (corrupt)";
+
#define OF_VER_1_0 0x01
static void
#define OF_VER_1_0 0x01
static void
}
corrupt: /* fail current packet */
}
corrupt: /* fail current packet */
TCHECK2(*cp, ep - cp);
return ep;
trunc:
TCHECK2(*cp, ep - cp);
return ep;
trunc:
- printf(" [|openflow]");
+static const char tstr[] = " [|ospf2]";
+
static const struct tok ospf_option_values[] = {
{ OSPF_OPTION_T, "MultiTopology" }, /* draft-ietf-ospf-mt-09 */
{ OSPF_OPTION_E, "External" },
static const struct tok ospf_option_values[] = {
{ OSPF_OPTION_T, "MultiTopology" }, /* draft-ietf-ospf-mt-09 */
{ OSPF_OPTION_E, "External" },
-static char tstr[] = " [|ospf2]";
-
static int ospf_print_lshdr(const struct lsa_hdr *);
static const u_char *ospf_print_lsa(const struct lsa *);
static int ospf_decode_v2(const struct ospfhdr *, const u_char *);
static int ospf_print_lshdr(const struct lsa_hdr *);
static const u_char *ospf_print_lsa(const struct lsa *);
static int ospf_decode_v2(const struct ospfhdr *, const u_char *);
#include "ospf.h"
#include "ospf6.h"
#include "ospf.h"
#include "ospf6.h"
+static const char tstr[] = " [|ospf3]";
+
static const struct tok ospf6_option_values[] = {
{ OSPF6_OPTION_V6, "V6" },
{ OSPF6_OPTION_E, "External" },
static const struct tok ospf6_option_values[] = {
{ OSPF6_OPTION_V6, "V6" },
{ OSPF6_OPTION_E, "External" },
-static char tstr[] = " [|ospf3]";
-
/* Forwards */
static void ospf6_print_ls_type(u_int, const rtrid_t *);
static int ospf6_print_lshdr(const struct lsa6_hdr *);
/* Forwards */
static void ospf6_print_ls_type(u_int, const rtrid_t *);
static int ospf6_print_lshdr(const struct lsa6_hdr *);
#include "interface.h"
#include "addrtoname.h"
#include "interface.h"
#include "addrtoname.h"
+static const char tstr[] = "[|pflog]";
+
static const struct tok pf_reasons[] = {
{ 0, "0(match)" },
{ 1, "1(bad-offset)" },
static const struct tok pf_reasons[] = {
{ 0, "0(match)" },
{ 1, "1(bad-offset)" },
/* check length */
if (caplen < sizeof(u_int8_t)) {
/* check length */
if (caplen < sizeof(u_int8_t)) {
hdrlen = BPF_WORDALIGN(hdr->length);
if (caplen < hdrlen) {
hdrlen = BPF_WORDALIGN(hdr->length);
if (caplen < hdrlen) {
return (hdrlen); /* XXX: true? */
}
return (hdrlen); /* XXX: true? */
}
#include "interface.h"
#include "extract.h"
#include "interface.h"
#include "extract.h"
-static char tstr[] = " [|pptp]";
+static const char tstr[] = " [|pptp]";
#define PPTP_MSG_TYPE_CTRL 1 /* Control Message */
#define PPTP_MSG_TYPE_MGMT 2 /* Management Message (currently not used */
#define PPTP_MSG_TYPE_CTRL 1 /* Control Message */
#define PPTP_MSG_TYPE_MGMT 2 /* Management Message (currently not used */
#include "extract.h"
#include "oui.h"
#include "extract.h"
#include "oui.h"
+static const char tstr[] = " [|radius]";
+
#define TAM_SIZE(x) (sizeof(x)/sizeof(x[0]) )
#define PRINT_HEX(bytes_len, ptr_data) \
#define TAM_SIZE(x) (sizeof(x)/sizeof(x[0]) )
#define PRINT_HEX(bytes_len, ptr_data) \
case TUNNEL_PASS:
if (length < 3)
{
case TUNNEL_PASS:
if (length < 3)
{
return;
}
if (*data && (*data <=0x1F) )
return;
}
if (*data && (*data <=0x1F) )
return;
}
printf("Tag %u",*data);
return;
}
printf("Tag %u",*data);
if (len < MIN_RADIUS_LEN)
{
if (len < MIN_RADIUS_LEN)
{
+static const char tstr[] = "[|rip]";
+
struct rip {
u_int8_t rip_cmd; /* request/response */
u_int8_t rip_vers; /* protocol version # */
struct rip {
u_int8_t rip_cmd; /* request/response */
u_int8_t rip_vers; /* protocol version # */
register u_int i, j;
if (snapend < dat) {
register u_int i, j;
if (snapend < dat) {
return;
}
i = snapend - dat;
if (i > length)
i = length;
if (i < sizeof(*rp)) {
return;
}
i = snapend - dat;
if (i > length)
i = length;
if (i < sizeof(*rp)) {
return;
}
i -= sizeof(*rp);
return;
}
i -= sizeof(*rp);
break;
case RIPCMD_TRACEOFF:
break;
case RIPCMD_TRACEOFF:
#include "slip.h"
#include "slcompress.h"
#include "slip.h"
#include "slcompress.h"
+static const char tstr[] = "[|slip]";
+
static u_int lastlen[2][256];
static u_int lastconn = 255;
static u_int lastlen[2][256];
static u_int lastconn = 255;
register const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
register const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
register const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
register const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
#include "extract.h"
#include "smb.h"
#include "extract.h"
#include "smb.h"
+static const char tstr[] = "[|SMB]";
+
static int request = 0;
static int unicodestr = 0;
static int request = 0;
static int unicodestr = 0;
printf("\n");
return;
trunc:
printf("\n");
return;
trunc:
fflush(stdout);
return;
trunc:
fflush(stdout);
return;
trunc:
printf("SMB-over-TCP packet:(raw data or continuation?)\n");
return;
trunc:
printf("SMB-over-TCP packet:(raw data or continuation?)\n");
return;
trunc:
printf("\n");
return;
trunc:
printf("\n");
return;
trunc:
#undef OPAQUE /* defined in <wingdi.h> */
#undef OPAQUE /* defined in <wingdi.h> */
+static const char tstr[] = "[|snmp]";
+
/*
* Universal ASN.1 types
* (we only care about the tag values for those allowed in the Internet SMI)
/*
* Universal ASN.1 types
* (we only care about the tag values for those allowed in the Internet SMI)
return elem->asnlen + hdr;
trunc:
return elem->asnlen + hdr;
trunc:
- fputs("[|snmp]", stdout);
- fputs("[|snmp]", stdout);
- fputs("[|snmp]", stdout);
#include "interface.h"
#include "extract.h"
#include "interface.h"
#include "extract.h"
+static const char tstr[] = "[|syslog]";
+
/*
* tokenlists and #defines taken from Ethereal - Network traffic analyzer
/*
* tokenlists and #defines taken from Ethereal - Network traffic analyzer
TCHECK2(*(pptr+msg_off), 1);
}
if (*(pptr+msg_off) != '>') {
TCHECK2(*(pptr+msg_off), 1);
}
if (*(pptr+msg_off) != '>') {
return;
}
msg_off++;
} else {
return;
}
msg_off++;
} else {
#include "extract.h"
#include "tftp.h"
#include "extract.h"
#include "tftp.h"
+static const char tstr[] = " [|tftp]";
+
/* op code to string mapping */
static const struct tok op2str[] = {
{ RRQ, "RRQ" }, /* read request */
/* op code to string mapping */
static const struct tok op2str[] = {
{ RRQ, "RRQ" }, /* read request */
register const char *cp;
register const u_char *p;
register int opcode, i;
register const char *cp;
register const u_char *p;
register int opcode, i;
- static char tstr[] = " [|tftp]";
tp = (const struct tftphdr *)bp;
tp = (const struct tftphdr *)bp;
#include "interface.h"
#include "extract.h"
#include "interface.h"
#include "extract.h"
+static const char tstr[] = "[|timed]";
+
static const char *tsptype[TSPTYPENUMBER] =
{ "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
"SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
static const char *tsptype[TSPTYPENUMBER] =
{ "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP",
"SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT",
const u_char *end;
if (endof(tsp->tsp_type) > snapend) {
const u_char *end;
if (endof(tsp->tsp_type) > snapend) {
- fputs("[|timed]", stdout);
return;
}
if (tsp->tsp_type < TSPTYPENUMBER)
return;
}
if (tsp->tsp_type < TSPTYPENUMBER)
printf("(tsp_type %#x)", tsp->tsp_type);
if (endof(tsp->tsp_vers) > snapend) {
printf("(tsp_type %#x)", tsp->tsp_type);
if (endof(tsp->tsp_vers) > snapend) {
- fputs(" [|timed]", stdout);
return;
}
printf(" vers %d", tsp->tsp_vers);
if (endof(tsp->tsp_seq) > snapend) {
return;
}
printf(" vers %d", tsp->tsp_vers);
if (endof(tsp->tsp_seq) > snapend) {
- fputs(" [|timed]", stdout);
return;
}
printf(" seq %d", tsp->tsp_seq);
if (tsp->tsp_type == TSP_LOOP) {
if (endof(tsp->tsp_hopcnt) > snapend) {
return;
}
printf(" seq %d", tsp->tsp_seq);
if (tsp->tsp_type == TSP_LOOP) {
if (endof(tsp->tsp_hopcnt) > snapend) {
- fputs(" [|timed]", stdout);
return;
}
printf(" hopcnt %d", tsp->tsp_hopcnt);
return;
}
printf(" hopcnt %d", tsp->tsp_hopcnt);
tsp->tsp_type == TSP_SETDATE ||
tsp->tsp_type == TSP_SETDATEREQ) {
if (endof(tsp->tsp_time) > snapend) {
tsp->tsp_type == TSP_SETDATE ||
tsp->tsp_type == TSP_SETDATEREQ) {
if (endof(tsp->tsp_time) > snapend) {
- fputs(" [|timed]", stdout);
return;
}
sec = EXTRACT_32BITS(&tsp->tsp_time.tv_sec);
return;
}
sec = EXTRACT_32BITS(&tsp->tsp_time.tv_sec);
end = memchr(tsp->tsp_name, '\0', snapend - (u_char *)tsp->tsp_name);
if (end == NULL)
end = memchr(tsp->tsp_name, '\0', snapend - (u_char *)tsp->tsp_name);
if (end == NULL)
- fputs(" [|timed]", stdout);
else {
fputs(" name ", stdout);
fwrite(tsp->tsp_name, end - (u_char *)tsp->tsp_name, 1, stdout);
else {
fputs(" name ", stdout);
fwrite(tsp->tsp_name, end - (u_char *)tsp->tsp_name, 1, stdout);
#include "ethertype.h"
#include "extract.h" /* must come after interface.h */
#include "ethertype.h"
#include "extract.h" /* must come after interface.h */
+static const char tstr[] = "[|TIPC]";
+
/*
* Transparent Inter-Process Communication (TIPC) protocol.
*
/*
* Transparent Inter-Process Communication (TIPC) protocol.
*
- ND_PRINT((ndo, "[|TIPC]"));
+ ND_PRINT((ndo, "%s", tstr));
- ND_PRINT((ndo, "[|TIPC]"));
+ ND_PRINT((ndo, "%s", tstr));
- ND_PRINT((ndo, "[|TIPC]"));
+ ND_PRINT((ndo, "%s", tstr));
- ND_PRINT((ndo, "[|TIPC]"));
+ ND_PRINT((ndo, "%s", tstr));
#include "ether.h"
#include "token.h"
#include "ether.h"
#include "token.h"
+static const char tstr[] = "[|token-ring]";
+
/* Extract src, dst addresses */
static inline void
extract_token_addrs(const struct token_header *trp, char *fsrc, char *fdst)
/* Extract src, dst addresses */
static inline void
extract_token_addrs(const struct token_header *trp, char *fsrc, char *fdst)
trp = (const struct token_header *)p;
if (caplen < TOKEN_HDRLEN) {
trp = (const struct token_header *)p;
if (caplen < TOKEN_HDRLEN) {
- printf("[|token-ring]");
token_hdr_print(trp, length, ESRC(&ehdr), EDST(&ehdr));
if (caplen < TOKEN_HDRLEN + 2) {
token_hdr_print(trp, length, ESRC(&ehdr), EDST(&ehdr));
if (caplen < TOKEN_HDRLEN + 2) {
- printf("[|token-ring]");
return hdr_len;
}
route_len = RIF_LENGTH(trp);
hdr_len += route_len;
if (caplen < hdr_len) {
return hdr_len;
}
route_len = RIF_LENGTH(trp);
hdr_len += route_len;
if (caplen < hdr_len) {
- printf("[|token-ring]");
return hdr_len;
}
if (vflag) {
return hdr_len;
}
if (vflag) {
#if defined(HAVE_PCAP_USB_H) && defined(DLT_USB_LINUX)
#include <pcap/usb.h>
#if defined(HAVE_PCAP_USB_H) && defined(DLT_USB_LINUX)
#include <pcap/usb.h>
+static const char tstr[] = "[|usb]";
+
/* returns direction: 1=inbound 2=outbound -1=invalid */
static int
get_direction(int transfer_type, int event_type)
/* returns direction: 1=inbound 2=outbound -1=invalid */
static int
get_direction(int transfer_type, int event_type)
usb_linux_48_byte_print(const struct pcap_pkthdr *h, register const u_char *p)
{
if (h->caplen < sizeof(pcap_usb_header)) {
usb_linux_48_byte_print(const struct pcap_pkthdr *h, register const u_char *p)
{
if (h->caplen < sizeof(pcap_usb_header)) {
return(sizeof(pcap_usb_header));
}
return(sizeof(pcap_usb_header));
}
usb_linux_64_byte_print(const struct pcap_pkthdr *h, register const u_char *p)
{
if (h->caplen < sizeof(pcap_usb_header_mmapped)) {
usb_linux_64_byte_print(const struct pcap_pkthdr *h, register const u_char *p)
{
if (h->caplen < sizeof(pcap_usb_header_mmapped)) {
return(sizeof(pcap_usb_header_mmapped));
}
return(sizeof(pcap_usb_header_mmapped));
}
#include "interface.h"
#include "extract.h"
#include "interface.h"
#include "extract.h"
+static const char tstr[] = " [|zmtp1]";
+
/* Maximum number of ZMTP/1.0 frame body bytes (without the flags) to dump in
* hex and ASCII under a single "-v" flag.
*/
/* Maximum number of ZMTP/1.0 frame body bytes (without the flags) to dump in
* hex and ASCII under a single "-v" flag.
*/
return cp + header_len + body_len_declared;
trunc:
return cp + header_len + body_len_declared;
trunc:
return cp + frame_offset;
trunc:
return cp + frame_offset;
trunc: