#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
caplen = orig_caplen;
/* Remove FCS, if present */
if (length < fcslen) {
- printf("[|802.11]");
+ printf("%s", tstr);
return caplen;
}
length -= fcslen;
}
if (caplen < IEEE802_11_FC_LEN) {
- printf("[|802.11]");
+ printf("%s", tstr);
return orig_caplen;
}
if (caplen < hdrlen) {
- printf("[|802.11]");
+ printf("%s", tstr);
return hdrlen;
}
case T_MGMT:
if (!mgmt_body_print(fc,
(const struct mgmt_header_t *)(p - hdrlen), p, length)) {
- printf("[|802.11]");
+ printf("%s", tstr);
return hdrlen;
}
break;
case T_CTRL:
if (!ctrl_body_print(fc, p - hdrlen)) {
- printf("[|802.11]");
+ printf("%s", tstr);
return hdrlen;
}
break;
/* There may be a problem w/ AP not having this bit set */
if (FC_WEP(fc)) {
if (!wep_print(p)) {
- printf("[|802.11]");
+ printf("%s", tstr);
return hdrlen;
}
} else if (llc_print(p, length, caplen, dst, src,
}
if (rc != 0) {
- printf("[|802.11]");
+ printf("%s", tstr);
return rc;
}
struct radiotap_state state;
if (caplen < sizeof(*hdr)) {
- printf("[|802.11]");
+ printf("%s", tstr);
return caplen;
}
len = EXTRACT_LE_16BITS(&hdr->it_len);
if (caplen < len) {
- printf("[|802.11]");
+ printf("%s", tstr);
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)) {
- printf("[|802.11]");
+ printf("%s", tstr);
return caplen;
}
u_int32_t caphdr_len;
if (caplen < 8) {
- printf("[|802.11]");
+ printf("%s", tstr);
return caplen;
}
* to be large enough to include even the version
* cookie or capture header length!
*/
- printf("[|802.11]");
+ printf("%s", tstr);
return caplen;
}
if (caplen < caphdr_len) {
- printf("[|802.11]");
+ printf("%s", tstr);
return caplen;
}
u_int32_t msgcode;
if (caplen < 4) {
- printf("[|802.11]");
+ printf("%s", tstr);
return caplen;
}
return ieee802_11_avs_radio_print(p, length, caplen);
if (caplen < PRISM_HDR_LEN) {
- printf("[|802.11]");
+ printf("%s", tstr);
return caplen;
}
#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
return 0;
corrupt:
- printf(": %s", corrupt_str);
+ printf(": %s", cstr);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
+ printf("%s", tstr);
return -1;
}
return 0;
corrupt:
- printf(": %s", corrupt_str);
+ printf(": %s", cstr);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
+ printf("%s", tstr);
return -1;
}
return 0;
corrupt:
- printf(": %s", corrupt_str);
+ printf(": %s", cstr);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
+ printf("%s", tstr);
return -1;
}
return 0;
corrupt:
- printf(": %s", corrupt_str);
+ printf(": %s", cstr);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
+ printf("%s", tstr);
return -1;
}
return 0;
corrupt:
- printf(": %s", corrupt_str);
+ printf(": %s", cstr);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
+ printf("%s", tstr);
return -1;
}
return 0;
corrupt:
- printf(": %s", corrupt_str);
+ printf(": %s", cstr);
TCHECK2(*cp, ep - cp);
return 0;
trunc:
- printf(" %s", trunc_str);
+ printf("%s", tstr);
return -1;
}
return;
corrupt:
- printf(" %s", corrupt_str);
+ printf(" %s", cstr);
TCHECK2(*cp, ep - cp);
return;
trunc:
- printf(" %s", trunc_str);
+ printf("%s", tstr);
}
static void
return;
corrupt:
- printf(" %s", corrupt_str);
+ printf(" %s", cstr);
TCHECK2(*cp, ep - cp);
return;
trunc:
- printf(" %s", trunc_str);
+ printf("%s", tstr);
}
void
return;
corrupt:
- printf(" %s", corrupt_str);
+ printf(" %s", cstr);
TCHECK2(*cp, ep - cp);
return;
trunc:
- printf(" %s", trunc_str);
+ printf("%s", tstr);
}
#include "ethertype.h"
#include "extract.h" /* must come after interface.h */
+static const char tstr[] = "[|ARP]";
+
/*
* Address Resolution Protocol.
*
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;
}
return;
trunc:
- ND_PRINT((ndo, "[|ARP]"));
+ ND_PRINT((ndo, "%s", tstr));
}
void
}
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;
}
return;
trunc:
- ND_PRINT((ndo, "[|ARP]"));
+ ND_PRINT((ndo, "%s", tstr));
}
/*
#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" },
u_int8_t pdaddr[4];
};
-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);
#include "ether.h"
+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 */
u_int hdrlen = 0;
if (caplen < 8) {
- printf("[|atm]");
+ printf("%s", tstr);
return (caplen);
}
bpf_u_int32 call_ref;
if (caplen < PROTO_POS) {
- printf("[|atm]");
+ printf("%s", tstr);
return;
}
if (p[PROTO_POS] == Q2931) {
*/
printf("Q.2931");
if (caplen < MSG_TYPE_POS) {
- printf(" [|atm]");
+ printf(" %s", tstr);
return;
}
printf(":%s ",
#include "interface.h"
#include "extract.h"
+static const char tstr[] = "[|babel]";
+
static void babel_print_v2(const u_char *cp, u_int length);
void
return;
trunc:
- printf(" [|babel]");
+ printf(" %s", tstr);
return;
}
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));
}
return;
trunc:
- printf(" [|babel]");
+ printf(" %s", tstr);
return;
corrupt:
#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 char tstr[] = " [|bootp]";
-
static const struct tok bootp_flag_values[] = {
{ 0x8000, "Broadcast" },
{ 0, NULL}
#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[] = {
const u_char *tptr;
if (caplen < CDP_HEADER_LEN) {
- (void)printf("[|cdp]");
+ printf("%s", tstr);
return;
}
return;
trunc:
- printf("[|cdp]");
+ printf("%s", tstr);
}
/*
#endif
#include "ipproto.h"
+static const char tstr[] = "[|dccp]";
+
static const char *dccp_reset_codes[] = {
"unspecified",
"closed",
}
return;
trunc:
- printf("[|dccp]");
+ printf("%s", tstr);
trunc2:
return;
}
return optlen;
trunc:
- printf("[|dccp]");
+ printf("%s", tstr);
return 0;
}
#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);
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)) {
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
return;
}
if (pktlen > length) {
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
return;
}
length = pktlen;
if (vflag)
(void) printf("[pad:%d] ", padlen);
if (length < padlen + 2) {
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
return;
}
TCHECK2(ap[sizeof(short)], padlen);
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;
trunc:
- (void)printf("[|decnet]");
+ (void)printf("%s", tstr);
return;
}
#include "interface.h"
#include "extract.h"
+static const char tstr[] = "[|forces]";
/*
* Per draft-ietf-forces-protocol-22
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return sdatailv_print(tdp, rlen, op_msk, indent);
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return fdatatlv_print(dp, tll, op_msk, indent);
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return len;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
}
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return rc;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
return -1;
}
return;
trunc:
- fputs("[|forces]", stdout);
+ printf("%s", tstr);
}
#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 */
u_int len = length, vers;
if (len < 2) {
- printf("[|gre]");
+ printf("%s", tstr);
return;
}
vers = EXTRACT_16BITS(bp) & GRE_VERS_MASK;
return;
trunc:
- printf("[|gre]");
+ printf("%s", tstr);
}
void
return;
trunc:
- printf("[|gre]");
+ printf("%s", tstr);
}
void
#define IN_CLASSD(i) (((int32_t)(i) & 0xf0000000) == 0xe0000000)
#endif
+static const char tstr[] = "[|igmp]";
+
/* (following from ipmulti/mrouted/prune.h) */
/*
printf(" with-ttl %d", TR_GETTTL(EXTRACT_32BITS(&tr->tr_rttlqid)));
return;
trunc:
- (void)printf("[|igmp]");
+ printf("%s", tstr);
return;
}
printf(" with-ttl %d", TR_GETTTL(EXTRACT_32BITS(&tr->tr_rttlqid)));
return;
trunc:
- (void)printf("[|igmp]");
+ printf("%s", tstr);
return;
}
}
return;
trunc:
- (void)printf("[|igmp]");
+ (void)printf("%s", tstr);
return;
}
(void)printf("]");
return;
trunc:
- (void)printf("[|igmp]");
+ (void)printf("%s", tstr);
return;
}
}
return;
trunc:
- fputs("[|igmp]", stdout);
+ (void)printf("%s", tstr);
}
#include "ip.h"
#include "ipproto.h"
+static const char tstr[] = "[|ip]";
+
static const struct tok ip_option_values[] = {
{ IPOPT_EOL, "EOL" },
{ IPOPT_NOP, "NOP" },
return;
trunc:
- printf("[|ip]");
+ printf("%s", tstr);
}
#define IP_RES 0x8000
printf("IP ");
if ((u_char *)(ipds->ip + 1) > ndo->ndo_snapend) {
- printf("[|ip]");
+ printf("%s", tstr);
return;
}
if (length < sizeof (struct ip)) {
#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 *);
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" },
#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 */
#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 *,
trunc:
if (!nfserr)
- fputs(" [|nfs]", stdout);
+ printf("%s", tstr);
}
void
trunc:
if (!nfserr)
- fputs(" [|nfs]", stdout);
+ printf("%s", tstr);
}
/*
trunc:
if (!nfserr)
- fputs(" [|nfs]", stdout);
+ printf("%s", tstr);
}
void
trunc:
if (!nfserr)
- fputs(" [|nfs]", stdout);
+ printf("%s", tstr);
}
/*
}
trunc:
if (!nfserr)
- fputs(" [|nfs]", stdout);
+ printf("%s", tstr);
}
#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
return cp + len;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return of10_data_print(cp, ep, len - 4);
corrupt: /* skip the undersized data */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp, len);
return cp + len;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp + len;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp;
corrupt: /* skip the undersized trailing data */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp;
corrupt: /* skip the rest of queue properties */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp;
corrupt: /* skip the rest of queues */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp + 2;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp;
corrupt: /* skip the rest of actions */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return of10_phy_ports_print(cp, ep, len - OF_SWITCH_FEATURES_LEN);
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return of10_actions_print("\n\t ", cp, ep, len - OF_FLOW_MOD_LEN);
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp + 4;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp;
corrupt: /* skip the message body */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp + DESC_STR_LEN;
corrupt: /* skip the message body */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp, len);
return cp + len;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp;
corrupt: /* skip the rest of flow statistics entries */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp + 4;
corrupt: /* skip the message body */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp, len);
return cp + len;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp;
corrupt: /* skip the undersized trailing data */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp;
corrupt: /* skip the undersized trailing data */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp;
corrupt: /* skip the undersized trailing data */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp0 + len;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return of10_packet_data_print(cp, ep, len - OF_PACKET_OUT_LEN - actions_len);
corrupt: /* skip the rest of the message body */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp0, len0);
return cp0 + len0;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return of10_packet_data_print(cp, ep, len - (OF_PACKET_IN_LEN - 2));
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return cp + 8;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
return of10_data_print(cp, ep, len - OF_ERROR_MSG_LEN);
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
goto next_message;
corrupt: /* skip the message body */
- printf(" (corrupt)");
+ printf("%s", cstr);
next_message:
TCHECK2(*cp0, len0 - OF_HEADER_LEN);
return cp0 + len0 - OF_HEADER_LEN;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
#include "extract.h"
#include "openflow.h"
+static const char tstr[] = " [|openflow]";
+static const char cstr[] = " (corrupt)";
+
#define OF_VER_1_0 0x01
static void
}
corrupt: /* fail current packet */
- printf(" (corrupt)");
+ printf("%s", cstr);
TCHECK2(*cp, ep - cp);
return ep;
trunc:
- printf(" [|openflow]");
+ printf("%s", tstr);
return ep;
}
#include "ip.h"
+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" },
{ 0, NULL }
};
-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 *);
#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" },
{ 0, NULL }
};
-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 *);
#include "interface.h"
#include "addrtoname.h"
+static const char tstr[] = "[|pflog]";
+
static const struct tok pf_reasons[] = {
{ 0, "0(match)" },
{ 1, "1(bad-offset)" },
/* check length */
if (caplen < sizeof(u_int8_t)) {
- printf("[|pflog]");
+ printf("%s", pflog);
return (caplen);
}
hdrlen = BPF_WORDALIGN(hdr->length);
if (caplen < hdrlen) {
- printf("[|pflog]");
+ printf("%s", pflog);
return (hdrlen); /* XXX: true? */
}
return (hdrlen);
trunc:
- printf("[|pflog]");
+ printf("%s", pflog);
return (hdrlen);
}
#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 */
#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) \
case TUNNEL_PASS:
if (length < 3)
{
- printf(" [|radius]");
+ printf("%s", tstr);
return;
}
if (*data && (*data <=0x1F) )
{
if (length < 1)
{
- printf(" [|radius]");
+ printf("%s", tstr);
return;
}
printf("Tag %u",*data);
return;
trunc:
- printf(" [|radius]");
+ printf("%s", tstr);
}
/*
return;
trunc:
- printf(" [|radius]");
+ printf("%s", tstr);
}
return;
trunc:
- printf(" [|radius]");
+ printf("%s", tstr);
}
return;
trunc:
- printf(" [|radius]");
+ printf("%s", tstr);
}
return;
trunc:
- printf(" [|radius]");
+ printf("%s", tstr);
}
return;
trunc:
- printf(" [|radius]");
+ printf("%s", tstr);
}
return;
trunc:
- printf(" [|radius]");
+ printf("%s", tstr);
}
if (len < MIN_RADIUS_LEN)
{
- printf(" [|radius]");
+ printf("%s", tstr);
return;
}
return;
trunc:
- printf(" [|radius]");
+ printf("%s", tstr);
}
#include "af.h"
+static const char tstr[] = "[|rip]";
+
struct rip {
u_int8_t rip_cmd; /* request/response */
u_int8_t rip_vers; /* protocol version # */
register u_int i, j;
if (snapend < dat) {
- printf(" [|rip]");
+ printf(" %s", tstr);
return;
}
i = snapend - dat;
if (i > length)
i = length;
if (i < sizeof(*rp)) {
- printf(" [|rip]");
+ printf(" %s", tstr);
return;
}
i -= sizeof(*rp);
break;
}
if (i)
- printf("[|rip]");
+ printf("%s", tstr);
break;
case RIPCMD_TRACEOFF:
#include "slip.h"
#include "slcompress.h"
+static const char tstr[] = "[|slip]";
+
static u_int lastlen[2][256];
static u_int lastconn = 255;
register const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
- printf("[|slip]");
+ printf("%s", tstr);
return (caplen);
}
register const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
- printf("[|slip]");
+ printf("%s", tstr);
return (caplen);
}
#include "extract.h"
#include "smb.h"
+static const char tstr[] = "[|SMB]";
+
static int request = 0;
static int unicodestr = 0;
}
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
}
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
}
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
}
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
}
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
}
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
}
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
printf("\n");
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
}
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
fflush(stdout);
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
printf("SMB-over-TCP packet:(raw data or continuation?)\n");
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
printf("\n");
return;
trunc:
- printf("[|SMB]");
+ printf("%s", tstr);
return;
}
#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)
return elem->asnlen + hdr;
trunc:
- fputs("[|snmp]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|snmp]", stdout);
+ printf("%s", tstr);
return -1;
}
return 0;
trunc:
- fputs("[|snmp]", stdout);
+ printf("%s", tstr);
return -1;
}
#include "interface.h"
#include "extract.h"
+static const char tstr[] = "[|syslog]";
+
/*
* tokenlists and #defines taken from Ethereal - Network traffic analyzer
TCHECK2(*(pptr+msg_off), 1);
}
if (*(pptr+msg_off) != '>') {
- printf("[|syslog]");
+ printf("%s", tstr);
return;
}
msg_off++;
} else {
- printf("[|syslog]");
+ printf("%s", tstr);
return;
}
return;
trunc:
- printf("[|syslog]");
+ printf("%s", tstr);
}
#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 */
register const char *cp;
register const u_char *p;
register int opcode, i;
- static char tstr[] = " [|tftp]";
tp = (const struct tftphdr *)bp;
#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",
const u_char *end;
if (endof(tsp->tsp_type) > snapend) {
- fputs("[|timed]", stdout);
+ printf("%s", tstr);
return;
}
if (tsp->tsp_type < TSPTYPENUMBER)
printf("(tsp_type %#x)", tsp->tsp_type);
if (endof(tsp->tsp_vers) > snapend) {
- fputs(" [|timed]", stdout);
+ printf(" %s", tstr);
return;
}
printf(" vers %d", tsp->tsp_vers);
if (endof(tsp->tsp_seq) > snapend) {
- fputs(" [|timed]", stdout);
+ printf(" %s", tstr);
return;
}
printf(" seq %d", tsp->tsp_seq);
if (tsp->tsp_type == TSP_LOOP) {
if (endof(tsp->tsp_hopcnt) > snapend) {
- fputs(" [|timed]", stdout);
+ printf(" %s", tstr);
return;
}
printf(" hopcnt %d", tsp->tsp_hopcnt);
tsp->tsp_type == TSP_SETDATE ||
tsp->tsp_type == TSP_SETDATEREQ) {
if (endof(tsp->tsp_time) > snapend) {
- fputs(" [|timed]", stdout);
+ printf(" %s", tstr);
return;
}
sec = EXTRACT_32BITS(&tsp->tsp_time.tv_sec);
end = memchr(tsp->tsp_name, '\0', snapend - (u_char *)tsp->tsp_name);
if (end == NULL)
- fputs(" [|timed]", stdout);
+ printf(" %s", tstr);
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 */
+static const char tstr[] = "[|TIPC]";
+
/*
* Transparent Inter-Process Communication (TIPC) protocol.
*
return;
trunc:
- ND_PRINT((ndo, "[|TIPC]"));
+ ND_PRINT((ndo, "%s", tstr));
}
static void
return;
trunc:
- ND_PRINT((ndo, "[|TIPC]"));
+ ND_PRINT((ndo, "%s", tstr));
}
static void
return;
trunc:
- ND_PRINT((ndo, "[|TIPC]"));
+ ND_PRINT((ndo, "%s", tstr));
}
void
return;
trunc:
- ND_PRINT((ndo, "[|TIPC]"));
+ ND_PRINT((ndo, "%s", tstr));
}
/*
#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)
trp = (const struct token_header *)p;
if (caplen < TOKEN_HDRLEN) {
- printf("[|token-ring]");
+ printf("%s", tstr);
return hdr_len;
}
token_hdr_print(trp, length, ESRC(&ehdr), EDST(&ehdr));
if (caplen < TOKEN_HDRLEN + 2) {
- printf("[|token-ring]");
+ printf("%s", tstr);
return hdr_len;
}
route_len = RIF_LENGTH(trp);
hdr_len += route_len;
if (caplen < hdr_len) {
- printf("[|token-ring]");
+ printf("%s", tstr);
return hdr_len;
}
if (vflag) {
#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)
usb_linux_48_byte_print(const struct pcap_pkthdr *h, register const u_char *p)
{
if (h->caplen < sizeof(pcap_usb_header)) {
- printf("[|usb]");
+ printf("%s", tstr);
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)) {
- printf("[|usb]");
+ printf("%s", tstr);
return(sizeof(pcap_usb_header_mmapped));
}
#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.
*/
return cp + header_len + body_len_declared;
trunc:
- printf(" [|zmtp1]");
+ printf("%s", tstr);
return ep;
}
return cp + frame_offset;
trunc:
- printf(" [|zmtp1]");
+ printf("%s", tstr);
return cp + len;
}