diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-01-07 11:47:30 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-01-07 13:36:41 +0100 |
commit | e2982e7f6f0b624a773ec5a58885ee80fab46d34 (patch) | |
tree | 52c8e511ccaff8ef09dc3337b213273865522162 | |
parent | 8ab5c3a4e75a3ce8da691cd6ca6a9945082827af (diff) | |
download | tcpdump-e2982e7f6f0b624a773ec5a58885ee80fab46d34.tar.gz |
Update ND_PRINT() as a variadic macro
-rw-r--r-- | CONTRIBUTING | 4 | ||||
-rw-r--r-- | netdissect.h | 2 | ||||
-rw-r--r-- | print-802_11.c | 442 | ||||
-rw-r--r-- | print-802_15_4.c | 42 | ||||
-rw-r--r-- | print-ah.c | 12 | ||||
-rw-r--r-- | print-ahcp.c | 78 | ||||
-rw-r--r-- | print-aodv.c | 86 | ||||
-rw-r--r-- | print-aoe.c | 90 | ||||
-rw-r--r-- | print-ap1394.c | 14 | ||||
-rw-r--r-- | print-arcnet.c | 32 | ||||
-rw-r--r-- | print-arp.c | 110 | ||||
-rw-r--r-- | print-ascii.c | 24 | ||||
-rw-r--r-- | print-atalk.c | 166 | ||||
-rw-r--r-- | print-atm.c | 70 | ||||
-rw-r--r-- | print-babel.c | 170 | ||||
-rw-r--r-- | print-beep.c | 16 | ||||
-rw-r--r-- | print-bfd.c | 82 | ||||
-rw-r--r-- | print-bgp.c | 496 | ||||
-rw-r--r-- | print-bootp.c | 214 | ||||
-rw-r--r-- | print-bt.c | 4 | ||||
-rw-r--r-- | print-calm-fast.c | 12 | ||||
-rw-r--r-- | print-carp.c | 16 | ||||
-rw-r--r-- | print-cdp.c | 92 | ||||
-rw-r--r-- | print-cfm.c | 152 | ||||
-rw-r--r-- | print-chdlc.c | 28 | ||||
-rw-r--r-- | print-cip.c | 4 | ||||
-rw-r--r-- | print-cnfp.c | 110 | ||||
-rw-r--r-- | print-dccp.c | 180 | ||||
-rw-r--r-- | print-decnet.c | 227 | ||||
-rw-r--r-- | print-dhcp6.c | 252 | ||||
-rw-r--r-- | print-domain.c | 156 | ||||
-rw-r--r-- | print-dtp.c | 18 | ||||
-rw-r--r-- | print-dvmrp.c | 78 | ||||
-rw-r--r-- | print-eap.c | 50 | ||||
-rw-r--r-- | print-egp.c | 86 | ||||
-rw-r--r-- | print-eigrp.c | 128 | ||||
-rw-r--r-- | print-enc.c | 10 | ||||
-rw-r--r-- | print-esp.c | 10 | ||||
-rw-r--r-- | print-ether.c | 40 | ||||
-rw-r--r-- | print-fddi.c | 36 | ||||
-rw-r--r-- | print-forces.c | 311 | ||||
-rw-r--r-- | print-fr.c | 124 | ||||
-rw-r--r-- | print-frag6.c | 12 | ||||
-rw-r--r-- | print-geneve.c | 46 | ||||
-rw-r--r-- | print-geonet.c | 30 | ||||
-rw-r--r-- | print-gre.c | 88 | ||||
-rw-r--r-- | print-hncp.c | 186 | ||||
-rw-r--r-- | print-hsrp.c | 30 | ||||
-rw-r--r-- | print-icmp.c | 30 | ||||
-rw-r--r-- | print-icmp6.c | 464 | ||||
-rw-r--r-- | print-igmp.c | 108 | ||||
-rw-r--r-- | print-igrp.c | 26 | ||||
-rw-r--r-- | print-ip.c | 138 | ||||
-rw-r--r-- | print-ip6.c | 34 | ||||
-rw-r--r-- | print-ip6opts.c | 54 | ||||
-rw-r--r-- | print-ipcomp.c | 4 | ||||
-rw-r--r-- | print-ipfc.c | 4 | ||||
-rw-r--r-- | print-ipnet.c | 18 | ||||
-rw-r--r-- | print-ipx.c | 64 | ||||
-rw-r--r-- | print-isakmp.c | 510 | ||||
-rw-r--r-- | print-isoclns.c | 768 | ||||
-rw-r--r-- | print-juniper.c | 100 | ||||
-rw-r--r-- | print-krb.c | 44 | ||||
-rw-r--r-- | print-l2tp.c | 194 | ||||
-rw-r--r-- | print-lane.c | 8 | ||||
-rw-r--r-- | print-ldp.c | 116 | ||||
-rw-r--r-- | print-lisp.c | 62 | ||||
-rw-r--r-- | print-llc.c | 72 | ||||
-rw-r--r-- | print-lldp.c | 390 | ||||
-rw-r--r-- | print-lmp.c | 350 | ||||
-rw-r--r-- | print-loopback.c | 24 | ||||
-rw-r--r-- | print-lspping.c | 156 | ||||
-rw-r--r-- | print-lwapp.c | 42 | ||||
-rw-r--r-- | print-lwres.c | 102 | ||||
-rw-r--r-- | print-m3ua.c | 24 | ||||
-rw-r--r-- | print-medsa.c | 56 | ||||
-rw-r--r-- | print-mobile.c | 16 | ||||
-rw-r--r-- | print-mobility.c | 78 | ||||
-rw-r--r-- | print-mpcp.c | 40 | ||||
-rw-r--r-- | print-mpls.c | 20 | ||||
-rw-r--r-- | print-mptcp.c | 72 | ||||
-rw-r--r-- | print-msdp.c | 28 | ||||
-rw-r--r-- | print-msnlb.c | 10 | ||||
-rw-r--r-- | print-nflog.c | 22 | ||||
-rw-r--r-- | print-nfs.c | 280 | ||||
-rw-r--r-- | print-nsh.c | 34 | ||||
-rw-r--r-- | print-ntp.c | 106 | ||||
-rw-r--r-- | print-null.c | 12 | ||||
-rw-r--r-- | print-olsr.c | 82 | ||||
-rw-r--r-- | print-openflow-1.0.c | 434 | ||||
-rw-r--r-- | print-openflow.c | 10 | ||||
-rw-r--r-- | print-ospf.c | 330 | ||||
-rw-r--r-- | print-ospf6.c | 152 | ||||
-rw-r--r-- | print-otv.c | 10 | ||||
-rw-r--r-- | print-pflog.c | 16 | ||||
-rw-r--r-- | print-pgm.c | 228 | ||||
-rw-r--r-- | print-pim.c | 274 | ||||
-rw-r--r-- | print-pktap.c | 16 | ||||
-rw-r--r-- | print-ppi.c | 14 | ||||
-rw-r--r-- | print-ppp.c | 354 | ||||
-rw-r--r-- | print-pppoe.c | 32 | ||||
-rw-r--r-- | print-pptp.c | 162 | ||||
-rw-r--r-- | print-radius.c | 180 | ||||
-rw-r--r-- | print-raw.c | 2 | ||||
-rw-r--r-- | print-resp.c | 16 | ||||
-rw-r--r-- | print-rip.c | 62 | ||||
-rw-r--r-- | print-ripng.c | 30 | ||||
-rw-r--r-- | print-rpki-rtr.c | 38 | ||||
-rw-r--r-- | print-rrcp.c | 30 | ||||
-rw-r--r-- | print-rsvp.c | 410 | ||||
-rw-r--r-- | print-rt6.c | 28 | ||||
-rw-r--r-- | print-rx.c | 636 | ||||
-rw-r--r-- | print-sctp.c | 112 | ||||
-rw-r--r-- | print-sflow.c | 118 | ||||
-rw-r--r-- | print-sl.c | 42 | ||||
-rw-r--r-- | print-sll.c | 30 | ||||
-rw-r--r-- | print-slow.c | 114 | ||||
-rw-r--r-- | print-smb.c | 186 | ||||
-rw-r--r-- | print-snmp.c | 284 | ||||
-rw-r--r-- | print-stp.c | 96 | ||||
-rw-r--r-- | print-sunatm.c | 4 | ||||
-rw-r--r-- | print-sunrpc.c | 22 | ||||
-rw-r--r-- | print-symantec.c | 14 | ||||
-rw-r--r-- | print-syslog.c | 14 | ||||
-rw-r--r-- | print-tcp.c | 174 | ||||
-rw-r--r-- | print-telnet.c | 38 | ||||
-rw-r--r-- | print-tftp.c | 30 | ||||
-rw-r--r-- | print-timed.c | 20 | ||||
-rw-r--r-- | print-tipc.c | 36 | ||||
-rw-r--r-- | print-token.c | 28 | ||||
-rw-r--r-- | print-udld.c | 22 | ||||
-rw-r--r-- | print-udp.c | 126 | ||||
-rw-r--r-- | print-usb.c | 28 | ||||
-rw-r--r-- | print-vjc.c | 18 | ||||
-rw-r--r-- | print-vqp.c | 22 | ||||
-rw-r--r-- | print-vrrp.c | 36 | ||||
-rw-r--r-- | print-vtp.c | 60 | ||||
-rw-r--r-- | print-vxlan-gpe.c | 14 | ||||
-rw-r--r-- | print-vxlan.c | 8 | ||||
-rw-r--r-- | print-wb.c | 86 | ||||
-rw-r--r-- | print-zephyr.c | 62 | ||||
-rw-r--r-- | print-zeromq.c | 38 | ||||
-rw-r--r-- | print.c | 4 | ||||
-rw-r--r-- | signature.c | 2 | ||||
-rw-r--r-- | smbutil.c | 90 | ||||
-rw-r--r-- | util-print.c | 74 |
146 files changed, 7462 insertions, 7482 deletions
diff --git a/CONTRIBUTING b/CONTRIBUTING index 8ba41f9a..b2e3cc00 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING @@ -118,7 +118,7 @@ d) The printer may receive incomplete packet in the buffer, truncated at any For ND_TCHECK_LEN: Define : static const char tstr[] = " [|protocol]"; Define a label: trunc - Print with: ND_PRINT((ndo, "%s", tstr)); + Print with: ND_PRINT("%s", tstr); You can test the code via: sudo ./tcpdump -s snaplen [-v][v][...] -i lo # in a terminal sudo tcpreplay -i lo sample.pcap # in another terminal @@ -128,7 +128,7 @@ e) Do invalid packet checks in code: Think that your code can receive in input not only a valid packet but any arbitrary random sequence of octets (packet - built malformed originally by the sender or by a fuzz tester, - became corrupted in transit). - Print with: ND_PRINT((ndo, "%s", istr)); /* to print " (invalid)" */ + Print with: ND_PRINT("%s", istr); /* to print " (invalid)" */ f) Use 'struct tok' for indexed strings and print them with tok2str() or bittok2str() (for flags). diff --git a/netdissect.h b/netdissect.h index d6800a50..e809e04a 100644 --- a/netdissect.h +++ b/netdissect.h @@ -346,7 +346,7 @@ struct netdissect_options { /* Bail out if "*(p)" was not captured */ #define ND_TCHECK_SIZE(p) ND_TCHECK_LEN(p, sizeof(*(p))) -#define ND_PRINT(STUFF) (ndo->ndo_printf)STUFF +#define ND_PRINT(...) (ndo->ndo_printf)(ndo, __VA_ARGS__) #define ND_DEFAULTPRINT(ap, length) (*ndo->ndo_default_print)(ndo, ap, length) extern void ts_print(netdissect_options *, const struct timeval *); diff --git a/print-802_11.c b/print-802_11.c index 354be1a4..daeb0c90 100644 --- a/print-802_11.c +++ b/print-802_11.c @@ -401,13 +401,13 @@ struct meshcntl_t { #define PRINT_SSID(p) \ if (p.ssid_present) { \ - ND_PRINT((ndo, " (")); \ + ND_PRINT(" ("); \ fn_print(ndo, p.ssid.ssid, NULL); \ - ND_PRINT((ndo, ")")); \ + ND_PRINT(")"); \ } #define PRINT_RATE(_sep, _r, _suf) \ - ND_PRINT((ndo, "%s%2.1f%s", _sep, (.5 * ((_r) & 0x7f)), _suf)) + ND_PRINT("%s%2.1f%s", _sep, (.5 * ((_r) & 0x7f)), _suf) #define PRINT_RATES(p) \ if (p.rates_present) { \ int z; \ @@ -418,14 +418,14 @@ struct meshcntl_t { sep = " "; \ } \ if (p.rates.length != 0) \ - ND_PRINT((ndo, " Mbit]")); \ + ND_PRINT(" Mbit]"); \ } #define PRINT_DS_CHANNEL(p) \ if (p.ds_present) \ - ND_PRINT((ndo, " CH: %u", p.ds.channel)); \ - ND_PRINT((ndo, "%s", \ - CAPABILITY_PRIVACY(p.capability_info) ? ", PRIVACY" : "")); + ND_PRINT(" CH: %u", p.ds.channel); \ + ND_PRINT("%s", \ + CAPABILITY_PRIVACY(p.capability_info) ? ", PRIVACY" : ""); #define MAX_MCS_INDEX 76 @@ -988,8 +988,8 @@ wep_print(netdissect_options *ndo, return 0; iv = EXTRACT_LE_U_4(p); - ND_PRINT((ndo, " IV:%3x Pad %x KeyID %x", IV_IV(iv), IV_PAD(iv), - IV_KEYID(iv))); + ND_PRINT(" IV:%3x Pad %x KeyID %x", IV_IV(iv), IV_PAD(iv), + IV_KEYID(iv)); return 1; } @@ -1194,8 +1194,8 @@ parse_elements(netdissect_options *ndo, break; default: #if 0 - ND_PRINT((ndo, "(1) unhandled element_id (%u) ", - EXTRACT_U_1(p + offset))); + ND_PRINT("(1) unhandled element_id (%u) ", + EXTRACT_U_1(p + offset)); #endif offset += 2 + elementlen; length -= 2 + elementlen; @@ -1240,8 +1240,8 @@ handle_beacon(netdissect_options *ndo, PRINT_SSID(pbody); PRINT_RATES(pbody); - ND_PRINT((ndo, " %s", - CAPABILITY_ESS(pbody.capability_info) ? "ESS" : "IBSS")); + ND_PRINT(" %s", + CAPABILITY_ESS(pbody.capability_info) ? "ESS" : "IBSS"); PRINT_DS_CHANNEL(pbody); return ret; @@ -1302,11 +1302,11 @@ handle_assoc_response(netdissect_options *ndo, ret = parse_elements(ndo, &pbody, p, offset, length); - ND_PRINT((ndo, " AID(%x) :%s: %s", ((uint16_t)(pbody.aid << 2 )) >> 2 , + ND_PRINT(" AID(%x) :%s: %s", ((uint16_t)(pbody.aid << 2 )) >> 2 , CAPABILITY_PRIVACY(pbody.capability_info) ? " PRIVACY " : "", (pbody.status_code < NUM_STATUSES ? status_text[pbody.status_code] - : "n/a"))); + : "n/a")); return ret; } @@ -1339,7 +1339,7 @@ handle_reassoc_request(netdissect_options *ndo, ret = parse_elements(ndo, &pbody, p, offset, length); PRINT_SSID(pbody); - ND_PRINT((ndo, " AP : %s", etheraddr_string(ndo, pbody.ap ))); + ND_PRINT(" AP : %s", etheraddr_string(ndo, pbody.ap )); return ret; } @@ -1425,10 +1425,10 @@ handle_disassoc(netdissect_options *ndo, return 0; pbody.reason_code = EXTRACT_LE_U_2(p); - ND_PRINT((ndo, ": %s", + ND_PRINT(": %s", (pbody.reason_code < NUM_REASONS) ? reason_text[pbody.reason_code] - : "Reserved")); + : "Reserved"); return 1; } @@ -1462,7 +1462,7 @@ handle_auth(netdissect_options *ndo, if ((pbody.auth_alg == 1) && ((pbody.auth_trans_seq_num == 2) || (pbody.auth_trans_seq_num == 3))) { - ND_PRINT((ndo, " (%s)-%x [Challenge Text] %s", + ND_PRINT(" (%s)-%x [Challenge Text] %s", (pbody.auth_alg < NUM_AUTH_ALGS) ? auth_alg_text[pbody.auth_alg] : "Reserved", @@ -1470,10 +1470,10 @@ handle_auth(netdissect_options *ndo, ((pbody.auth_trans_seq_num % 2) ? ((pbody.status_code < NUM_STATUSES) ? status_text[pbody.status_code] - : "n/a") : ""))); + : "n/a") : "")); return ret; } - ND_PRINT((ndo, " (%s)-%x: %s", + ND_PRINT(" (%s)-%x: %s", (pbody.auth_alg < NUM_AUTH_ALGS) ? auth_alg_text[pbody.auth_alg] : "Reserved", @@ -1482,7 +1482,7 @@ handle_auth(netdissect_options *ndo, ? ((pbody.status_code < NUM_STATUSES) ? status_text[pbody.status_code] : "n/a") - : "")); + : ""); return ret; } @@ -1507,70 +1507,62 @@ handle_deauth(netdissect_options *ndo, : "Reserved"; if (ndo->ndo_eflag) { - ND_PRINT((ndo, ": %s", reason)); + ND_PRINT(": %s", reason); } else { - ND_PRINT((ndo, " (%s): %s", etheraddr_string(ndo, src), reason)); + ND_PRINT(" (%s): %s", etheraddr_string(ndo, src), reason); } return 1; } #define PRINT_HT_ACTION(v) (\ - (v) == 0 ? ND_PRINT((ndo, "TxChWidth")) : \ - (v) == 1 ? ND_PRINT((ndo, "MIMOPwrSave")) : \ - ND_PRINT((ndo, "Act#%u", (v))) \ -) + (v) == 0 ? ND_PRINT("TxChWidth"): \ + (v) == 1 ? ND_PRINT("MIMOPwrSave"): \ + ND_PRINT("Act#%u", (v))) #define PRINT_BA_ACTION(v) (\ - (v) == 0 ? ND_PRINT((ndo, "ADDBA Request")) : \ - (v) == 1 ? ND_PRINT((ndo, "ADDBA Response")) : \ - (v) == 2 ? ND_PRINT((ndo, "DELBA")) : \ - ND_PRINT((ndo, "Act#%u", (v))) \ -) + (v) == 0 ? ND_PRINT("ADDBA Request"): \ + (v) == 1 ? ND_PRINT("ADDBA Response"): \ + (v) == 2 ? ND_PRINT("DELBA"): \ + ND_PRINT("Act#%u", (v))) #define PRINT_MESHLINK_ACTION(v) (\ - (v) == 0 ? ND_PRINT((ndo, "Request")) : \ - (v) == 1 ? ND_PRINT((ndo, "Report")) : \ - ND_PRINT((ndo, "Act#%u", (v))) \ -) + (v) == 0 ? ND_PRINT("Request"): \ + (v) == 1 ? ND_PRINT("Report"): \ + ND_PRINT("Act#%u", (v))) #define PRINT_MESHPEERING_ACTION(v) (\ - (v) == 0 ? ND_PRINT((ndo, "Open")) : \ - (v) == 1 ? ND_PRINT((ndo, "Confirm")) : \ - (v) == 2 ? ND_PRINT((ndo, "Close")) : \ - ND_PRINT((ndo, "Act#%u", (v))) \ -) + (v) == 0 ? ND_PRINT("Open"): \ + (v) == 1 ? ND_PRINT("Confirm"): \ + (v) == 2 ? ND_PRINT("Close"): \ + ND_PRINT("Act#%u", (v))) #define PRINT_MESHPATH_ACTION(v) (\ - (v) == 0 ? ND_PRINT((ndo, "Request")) : \ - (v) == 1 ? ND_PRINT((ndo, "Report")) : \ - (v) == 2 ? ND_PRINT((ndo, "Error")) : \ - (v) == 3 ? ND_PRINT((ndo, "RootAnnouncement")) : \ - ND_PRINT((ndo, "Act#%u", (v))) \ -) + (v) == 0 ? ND_PRINT("Request"): \ + (v) == 1 ? ND_PRINT("Report"): \ + (v) == 2 ? ND_PRINT("Error"): \ + (v) == 3 ? ND_PRINT("RootAnnouncement"): \ + ND_PRINT("Act#%u", (v))) #define PRINT_MESH_ACTION(v) (\ - (v) == 0 ? ND_PRINT((ndo, "MeshLink")) : \ - (v) == 1 ? ND_PRINT((ndo, "HWMP")) : \ - (v) == 2 ? ND_PRINT((ndo, "Gate Announcement")) : \ - (v) == 3 ? ND_PRINT((ndo, "Congestion Control")) : \ - (v) == 4 ? ND_PRINT((ndo, "MCCA Setup Request")) : \ - (v) == 5 ? ND_PRINT((ndo, "MCCA Setup Reply")) : \ - (v) == 6 ? ND_PRINT((ndo, "MCCA Advertisement Request")) : \ - (v) == 7 ? ND_PRINT((ndo, "MCCA Advertisement")) : \ - (v) == 8 ? ND_PRINT((ndo, "MCCA Teardown")) : \ - (v) == 9 ? ND_PRINT((ndo, "TBTT Adjustment Request")) : \ - (v) == 10 ? ND_PRINT((ndo, "TBTT Adjustment Response")) : \ - ND_PRINT((ndo, "Act#%u", (v))) \ -) + (v) == 0 ? ND_PRINT("MeshLink"): \ + (v) == 1 ? ND_PRINT("HWMP"): \ + (v) == 2 ? ND_PRINT("Gate Announcement"): \ + (v) == 3 ? ND_PRINT("Congestion Control"): \ + (v) == 4 ? ND_PRINT("MCCA Setup Request"): \ + (v) == 5 ? ND_PRINT("MCCA Setup Reply"): \ + (v) == 6 ? ND_PRINT("MCCA Advertisement Request"): \ + (v) == 7 ? ND_PRINT("MCCA Advertisement"): \ + (v) == 8 ? ND_PRINT("MCCA Teardown"): \ + (v) == 9 ? ND_PRINT("TBTT Adjustment Request"): \ + (v) == 10 ? ND_PRINT("TBTT Adjustment Response"): \ + ND_PRINT("Act#%u", (v))) #define PRINT_MULTIHOP_ACTION(v) (\ - (v) == 0 ? ND_PRINT((ndo, "Proxy Update")) : \ - (v) == 1 ? ND_PRINT((ndo, "Proxy Update Confirmation")) : \ - ND_PRINT((ndo, "Act#%u", (v))) \ -) + (v) == 0 ? ND_PRINT("Proxy Update"): \ + (v) == 1 ? ND_PRINT("Proxy Update Confirmation"): \ + ND_PRINT("Act#%u", (v))) #define PRINT_SELFPROT_ACTION(v) (\ - (v) == 1 ? ND_PRINT((ndo, "Peering Open")) : \ - (v) == 2 ? ND_PRINT((ndo, "Peering Confirm")) : \ - (v) == 3 ? ND_PRINT((ndo, "Peering Close")) : \ - (v) == 4 ? ND_PRINT((ndo, "Group Key Inform")) : \ - (v) == 5 ? ND_PRINT((ndo, "Group Key Acknowledge")) : \ - ND_PRINT((ndo, "Act#%u", (v))) \ -) + (v) == 1 ? ND_PRINT("Peering Open"): \ + (v) == 2 ? ND_PRINT("Peering Confirm"): \ + (v) == 3 ? ND_PRINT("Peering Close"): \ + (v) == 4 ? ND_PRINT("Group Key Inform"): \ + (v) == 5 ? ND_PRINT("Group Key Acknowledge"): \ + ND_PRINT("Act#%u", (v))) static int handle_action(netdissect_options *ndo, @@ -1581,26 +1573,26 @@ handle_action(netdissect_options *ndo, if (length < 2) return 0; if (ndo->ndo_eflag) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); } else { - ND_PRINT((ndo, " (%s): ", etheraddr_string(ndo, src))); + ND_PRINT(" (%s): ", etheraddr_string(ndo, src)); } switch (EXTRACT_U_1(p)) { - case 0: ND_PRINT((ndo, "Spectrum Management Act#%u", EXTRACT_U_1(p + 1))); break; - case 1: ND_PRINT((ndo, "QoS Act#%u", EXTRACT_U_1(p + 1))); break; - case 2: ND_PRINT((ndo, "DLS Act#%u", EXTRACT_U_1(p + 1))); break; - case 3: ND_PRINT((ndo, "BA ")); PRINT_BA_ACTION(EXTRACT_U_1(p + 1)); break; - case 7: ND_PRINT((ndo, "HT ")); PRINT_HT_ACTION(EXTRACT_U_1(p + 1)); break; - case 13: ND_PRINT((ndo, "MeshAction ")); PRINT_MESH_ACTION(EXTRACT_U_1(p + 1)); break; + case 0: ND_PRINT("Spectrum Management Act#%u", EXTRACT_U_1(p + 1)); break; + case 1: ND_PRINT("QoS Act#%u", EXTRACT_U_1(p + 1)); break; + case 2: ND_PRINT("DLS Act#%u", EXTRACT_U_1(p + 1)); break; + case 3: ND_PRINT("BA "); PRINT_BA_ACTION(EXTRACT_U_1(p + 1)); break; + case 7: ND_PRINT("HT "); PRINT_HT_ACTION(EXTRACT_U_1(p + 1)); break; + case 13: ND_PRINT("MeshAction "); PRINT_MESH_ACTION(EXTRACT_U_1(p + 1)); break; case 14: - ND_PRINT((ndo, "MultiohopAction ")); + ND_PRINT("MultiohopAction "); PRINT_MULTIHOP_ACTION(EXTRACT_U_1(p + 1)); break; case 15: - ND_PRINT((ndo, "SelfprotectAction ")); + ND_PRINT("SelfprotectAction "); PRINT_SELFPROT_ACTION(EXTRACT_U_1(p + 1)); break; - case 127: ND_PRINT((ndo, "Vendor Act#%u", EXTRACT_U_1(p + 1))); break; + case 127: ND_PRINT("Vendor Act#%u", EXTRACT_U_1(p + 1)); break; default: - ND_PRINT((ndo, "Reserved(%u) Act#%u", EXTRACT_U_1(p), EXTRACT_U_1(p + 1))); + ND_PRINT("Reserved(%u) Act#%u", EXTRACT_U_1(p), EXTRACT_U_1(p + 1)); break; } return 1; @@ -1616,7 +1608,7 @@ static int mgmt_body_print(netdissect_options *ndo, uint16_t fc, const uint8_t *src, const u_char *p, u_int length) { - ND_PRINT((ndo, "%s", tok2str(st_str, "Unhandled Management subtype(%x)", FC_SUBTYPE(fc)))); + ND_PRINT("%s", tok2str(st_str, "Unhandled Management subtype(%x)", FC_SUBTYPE(fc))); /* There may be a problem w/ AP not having this bit set */ if (FC_PROTECTED(fc)) @@ -1660,7 +1652,7 @@ static int ctrl_body_print(netdissect_options *ndo, uint16_t fc, const u_char *p) { - ND_PRINT((ndo, "%s", tok2str(ctrl_str, "Unknown Ctrl Subtype", FC_SUBTYPE(fc)))); + ND_PRINT("%s", tok2str(ctrl_str, "Unknown Ctrl Subtype", FC_SUBTYPE(fc))); switch (FC_SUBTYPE(fc)) { case CTRL_CONTROL_WRAPPER: /* XXX - requires special handling */ @@ -1669,59 +1661,59 @@ ctrl_body_print(netdissect_options *ndo, if (!ND_TTEST_LEN(p, CTRL_BAR_HDRLEN)) return 0; if (!ndo->ndo_eflag) - ND_PRINT((ndo, " RA:%s TA:%s CTL(%x) SEQ(%u) ", + ND_PRINT(" RA:%s TA:%s CTL(%x) SEQ(%u) ", etheraddr_string(ndo, ((const struct ctrl_bar_hdr_t *)p)->ra), etheraddr_string(ndo, ((const struct ctrl_bar_hdr_t *)p)->ta), EXTRACT_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->ctl), - EXTRACT_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->seq))); + EXTRACT_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->seq)); break; case CTRL_BA: if (!ND_TTEST_LEN(p, CTRL_BA_HDRLEN)) return 0; if (!ndo->ndo_eflag) - ND_PRINT((ndo, " RA:%s ", - etheraddr_string(ndo, ((const struct ctrl_ba_hdr_t *)p)->ra))); + ND_PRINT(" RA:%s ", + etheraddr_string(ndo, ((const struct ctrl_ba_hdr_t *)p)->ra)); break; case CTRL_PS_POLL: if (!ND_TTEST_LEN(p, CTRL_PS_POLL_HDRLEN)) return 0; - ND_PRINT((ndo, " AID(%x)", - EXTRACT_LE_U_2(((const struct ctrl_ps_poll_hdr_t *)p)->aid))); + ND_PRINT(" AID(%x)", + EXTRACT_LE_U_2(((const struct ctrl_ps_poll_hdr_t *)p)->aid)); break; case CTRL_RTS: if (!ND_TTEST_LEN(p, CTRL_RTS_HDRLEN)) return 0; if (!ndo->ndo_eflag) - ND_PRINT((ndo, " TA:%s ", - etheraddr_string(ndo, ((const struct ctrl_rts_hdr_t *)p)->ta))); + ND_PRINT(" TA:%s ", + etheraddr_string(ndo, ((const struct ctrl_rts_hdr_t *)p)->ta)); break; case CTRL_CTS: if (!ND_TTEST_LEN(p, CTRL_CTS_HDRLEN)) return 0; if (!ndo->ndo_eflag) - ND_PRINT((ndo, " RA:%s ", - etheraddr_string(ndo, ((const struct ctrl_cts_hdr_t *)p)->ra))); + ND_PRINT(" RA:%s ", + etheraddr_string(ndo, ((const struct ctrl_cts_hdr_t *)p)->ra)); break; case CTRL_ACK: if (!ND_TTEST_LEN(p, CTRL_ACK_HDRLEN)) return 0; if (!ndo->ndo_eflag) - ND_PRINT((ndo, " RA:%s ", - etheraddr_string(ndo, ((const struct ctrl_ack_hdr_t *)p)->ra))); + ND_PRINT(" RA:%s ", + etheraddr_string(ndo, ((const struct ctrl_ack_hdr_t *)p)->ra)); break; case CTRL_CF_END: if (!ND_TTEST_LEN(p, CTRL_END_HDRLEN)) return 0; if (!ndo->ndo_eflag) - ND_PRINT((ndo, " RA:%s ", - etheraddr_string(ndo, ((const struct ctrl_end_hdr_t *)p)->ra))); + ND_PRINT(" RA:%s ", + etheraddr_string(ndo, ((const struct ctrl_end_hdr_t *)p)->ra)); break; case CTRL_END_ACK: if (!ND_TTEST_LEN(p, CTRL_END_ACK_HDRLEN)) return 0; if (!ndo->ndo_eflag) - ND_PRINT((ndo, " RA:%s ", - etheraddr_string(ndo, ((const struct ctrl_end_ack_hdr_t *)p)->ra))); + ND_PRINT(" RA:%s ", + etheraddr_string(ndo, ((const struct ctrl_end_ack_hdr_t *)p)->ra)); break; } return 1; @@ -1799,19 +1791,19 @@ data_header_print(netdissect_options *ndo, uint16_t fc, const u_char *p) if (DATA_FRAME_IS_CF_ACK(subtype) || DATA_FRAME_IS_CF_POLL(subtype) || DATA_FRAME_IS_QOS(subtype)) { - ND_PRINT((ndo, "CF ")); + ND_PRINT("CF "); if (DATA_FRAME_IS_CF_ACK(subtype)) { if (DATA_FRAME_IS_CF_POLL(subtype)) - ND_PRINT((ndo, "Ack/Poll")); + ND_PRINT("Ack/Poll"); else - ND_PRINT((ndo, "Ack")); + ND_PRINT("Ack"); } else { if (DATA_FRAME_IS_CF_POLL(subtype)) - ND_PRINT((ndo, "Poll")); + ND_PRINT("Poll"); } if (DATA_FRAME_IS_QOS(subtype)) - ND_PRINT((ndo, "+QoS")); - ND_PRINT((ndo, " ")); + ND_PRINT("+QoS"); + ND_PRINT(" "); } #define ADDR1 (p + 4) @@ -1820,21 +1812,21 @@ data_header_print(netdissect_options *ndo, uint16_t fc, const u_char *p) #define ADDR4 (p + 24) if (!FC_TO_DS(fc) && !FC_FROM_DS(fc)) { - ND_PRINT((ndo, "DA:%s SA:%s BSSID:%s ", + ND_PRINT("DA:%s SA:%s BSSID:%s ", etheraddr_string(ndo, ADDR1), etheraddr_string(ndo, ADDR2), - etheraddr_string(ndo, ADDR3))); + etheraddr_string(ndo, ADDR3)); } else if (!FC_TO_DS(fc) && FC_FROM_DS(fc)) { - ND_PRINT((ndo, "DA:%s BSSID:%s SA:%s ", + ND_PRINT("DA:%s BSSID:%s SA:%s ", etheraddr_string(ndo, ADDR1), etheraddr_string(ndo, ADDR2), - etheraddr_string(ndo, ADDR3))); + etheraddr_string(ndo, ADDR3)); } else if (FC_TO_DS(fc) && !FC_FROM_DS(fc)) { - ND_PRINT((ndo, "BSSID:%s SA:%s DA:%s ", + ND_PRINT("BSSID:%s SA:%s DA:%s ", etheraddr_string(ndo, ADDR1), etheraddr_string(ndo, ADDR2), - etheraddr_string(ndo, ADDR3))); + etheraddr_string(ndo, ADDR3)); } else if (FC_TO_DS(fc) && FC_FROM_DS(fc)) { - ND_PRINT((ndo, "RA:%s TA:%s DA:%s SA:%s ", + ND_PRINT("RA:%s TA:%s DA:%s SA:%s ", etheraddr_string(ndo, ADDR1), etheraddr_string(ndo, ADDR2), - etheraddr_string(ndo, ADDR3), etheraddr_string(ndo, ADDR4))); + etheraddr_string(ndo, ADDR3), etheraddr_string(ndo, ADDR4)); } #undef ADDR1 @@ -1848,9 +1840,9 @@ mgmt_header_print(netdissect_options *ndo, const u_char *p) { const struct mgmt_header_t *hp = (const struct mgmt_header_t *) p; - ND_PRINT((ndo, "BSSID:%s DA:%s SA:%s ", + ND_PRINT("BSSID:%s DA:%s SA:%s ", etheraddr_string(ndo, (hp)->bssid), etheraddr_string(ndo, (hp)->da), - etheraddr_string(ndo, (hp)->sa))); + etheraddr_string(ndo, (hp)->sa)); } static void @@ -1858,43 +1850,43 @@ ctrl_header_print(netdissect_options *ndo, uint16_t fc, const u_char *p) { switch (FC_SUBTYPE(fc)) { case CTRL_BAR: - ND_PRINT((ndo, " RA:%s TA:%s CTL(%x) SEQ(%u) ", + ND_PRINT(" RA:%s TA:%s CTL(%x) SEQ(%u) ", etheraddr_string(ndo, ((const struct ctrl_bar_hdr_t *)p)->ra), etheraddr_string(ndo, ((const struct ctrl_bar_hdr_t *)p)->ta), EXTRACT_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->ctl), - EXTRACT_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->seq))); + EXTRACT_LE_U_2(((const struct ctrl_bar_hdr_t *)p)->seq)); break; case CTRL_BA: - ND_PRINT((ndo, "RA:%s ", - etheraddr_string(ndo, ((const struct ctrl_ba_hdr_t *)p)->ra))); + ND_PRINT("RA:%s ", + etheraddr_string(ndo, ((const struct ctrl_ba_hdr_t *)p)->ra)); break; case CTRL_PS_POLL: - ND_PRINT((ndo, "BSSID:%s TA:%s ", + ND_PRINT("BSSID:%s TA:%s ", etheraddr_string(ndo, ((const struct ctrl_ps_poll_hdr_t *)p)->bssid), - etheraddr_string(ndo, ((const struct ctrl_ps_poll_hdr_t *)p)->ta))); + etheraddr_string(ndo, ((const struct ctrl_ps_poll_hdr_t *)p)->ta)); break; case CTRL_RTS: - ND_PRINT((ndo, "RA:%s TA:%s ", + ND_PRINT("RA:%s TA:%s ", etheraddr_string(ndo, ((const struct ctrl_rts_hdr_t *)p)->ra), - etheraddr_string(ndo, ((const struct ctrl_rts_hdr_t *)p)->ta))); + etheraddr_string(ndo, ((const struct ctrl_rts_hdr_t *)p)->ta)); break; case CTRL_CTS: - ND_PRINT((ndo, "RA:%s ", - etheraddr_string(ndo, ((const struct ctrl_cts_hdr_t *)p)->ra))); + ND_PRINT("RA:%s ", + etheraddr_string(ndo, ((const struct ctrl_cts_hdr_t *)p)->ra)); break; case CTRL_ACK: - ND_PRINT((ndo, "RA:%s ", - etheraddr_string(ndo, ((const struct ctrl_ack_hdr_t *)p)->ra))); + ND_PRINT("RA:%s ", + etheraddr_string(ndo, ((const struct ctrl_ack_hdr_t *)p)->ra)); break; case CTRL_CF_END: - ND_PRINT((ndo, "RA:%s BSSID:%s ", + ND_PRINT("RA:%s BSSID:%s ", etheraddr_string(ndo, ((const struct ctrl_end_hdr_t *)p)->ra), - etheraddr_string(ndo, ((const struct ctrl_end_hdr_t *)p)->bssid))); + etheraddr_string(ndo, ((const struct ctrl_end_hdr_t *)p)->bssid)); break; case CTRL_END_ACK: - ND_PRINT((ndo, "RA:%s BSSID:%s ", + ND_PRINT("RA:%s BSSID:%s ", etheraddr_string(ndo, ((const struct ctrl_end_ack_hdr_t *)p)->ra), - etheraddr_string(ndo, ((const struct ctrl_end_ack_hdr_t *)p)->bssid))); + etheraddr_string(ndo, ((const struct ctrl_end_ack_hdr_t *)p)->bssid)); break; default: /* We shouldn't get here - we should already have quit */ @@ -1932,7 +1924,7 @@ extract_header_length(netdissect_options *ndo, case CTRL_END_ACK: return CTRL_END_ACK_HDRLEN; default: - ND_PRINT((ndo, "unknown 802.11 ctrl frame subtype (%u)", FC_SUBTYPE(fc))); + ND_PRINT("unknown 802.11 ctrl frame subtype (%u)", FC_SUBTYPE(fc)); return 0; } case T_DATA: @@ -1941,7 +1933,7 @@ extract_header_length(netdissect_options *ndo, len += 2; return len; default: - ND_PRINT((ndo, "unknown 802.11 frame type (%u)", FC_TYPE(fc))); + ND_PRINT("unknown 802.11 frame type (%u)", FC_TYPE(fc)); return 0; } } @@ -1962,35 +1954,35 @@ ieee_802_11_hdr_print(netdissect_options *ndo, { if (ndo->ndo_vflag) { if (FC_MORE_DATA(fc)) - ND_PRINT((ndo, "More Data ")); + ND_PRINT("More Data "); if (FC_MORE_FLAG(fc)) - ND_PRINT((ndo, "More Fragments ")); + ND_PRINT("More Fragments "); if (FC_POWER_MGMT(fc)) - ND_PRINT((ndo, "Pwr Mgmt ")); + ND_PRINT("Pwr Mgmt "); if (FC_RETRY(fc)) - ND_PRINT((ndo, "Retry ")); + ND_PRINT("Retry "); if (FC_ORDER(fc)) - ND_PRINT((ndo, "Strictly Ordered ")); + ND_PRINT("Strictly Ordered "); if (FC_PROTECTED(fc)) - ND_PRINT((ndo, "Protected ")); + ND_PRINT("Protected "); if (FC_TYPE(fc) != T_CTRL || FC_SUBTYPE(fc) != CTRL_PS_POLL) - ND_PRINT((ndo, "%uus ", - EXTRACT_LE_U_2(((const struct mgmt_header_t *)p)->duration))); + ND_PRINT("%uus ", + EXTRACT_LE_U_2(((const struct mgmt_header_t *)p)->duration)); } if (meshdrlen != 0) { const struct meshcntl_t *mc = (const struct meshcntl_t *)(p + hdrlen - meshdrlen); u_int ae = EXTRACT_U_1(mc->flags) & 3; - ND_PRINT((ndo, "MeshData (AE %u TTL %u seq %u", ae, - EXTRACT_U_1(mc->ttl), EXTRACT_LE_U_4(mc->seq))); + ND_PRINT("MeshData (AE %u TTL %u seq %u", ae, + EXTRACT_U_1(mc->ttl), EXTRACT_LE_U_4(mc->seq)); if (ae > 0) - ND_PRINT((ndo, " A4:%s", etheraddr_string(ndo, mc->addr4))); + ND_PRINT(" A4:%s", etheraddr_string(ndo, mc->addr4)); if (ae > 1) - ND_PRINT((ndo, " A5:%s", etheraddr_string(ndo, mc->addr5))); + ND_PRINT(" A5:%s", etheraddr_string(ndo, mc->addr5)); if (ae > 2) - ND_PRINT((ndo, " A6:%s", etheraddr_string(ndo, mc->addr6))); - ND_PRINT((ndo, ") ")); + ND_PRINT(" A6:%s", etheraddr_string(ndo, mc->addr6)); + ND_PRINT(") "); } switch (FC_TYPE(fc)) { @@ -2027,7 +2019,7 @@ ieee802_11_print(netdissect_options *ndo, caplen = orig_caplen; /* Remove FCS, if present */ if (length < fcslen) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return caplen; } length -= fcslen; @@ -2039,7 +2031,7 @@ ieee802_11_print(netdissect_options *ndo, } if (caplen < IEEE802_11_FC_LEN) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return orig_caplen; } @@ -2059,7 +2051,7 @@ ieee802_11_print(netdissect_options *ndo, meshdrlen = 0; if (caplen < hdrlen) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return hdrlen; } @@ -2079,13 +2071,13 @@ ieee802_11_print(netdissect_options *ndo, case T_MGMT: get_mgmt_src_dst_mac(p - hdrlen, &src.addr, &dst.addr); if (!mgmt_body_print(ndo, fc, src.addr, p, length)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return hdrlen; } break; case T_CTRL: if (!ctrl_body_print(ndo, fc, p - hdrlen)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return hdrlen; } break; @@ -2094,9 +2086,9 @@ ieee802_11_print(netdissect_options *ndo, return hdrlen; /* no-data frame */ /* There may be a problem w/ AP not having this bit set */ if (FC_PROTECTED(fc)) { - ND_PRINT((ndo, "Data")); + ND_PRINT("Data"); if (!wep_print(ndo, p)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return hdrlen; } } else { @@ -2506,46 +2498,46 @@ static void print_chaninfo(netdissect_options *ndo, uint16_t freq, int flags, int presentflags) { - ND_PRINT((ndo, "%u MHz", freq)); + ND_PRINT("%u MHz", freq); if (presentflags & (1 << IEEE80211_RADIOTAP_MCS)) { /* * We have the MCS field, so this is 11n, regardless * of what the channel flags say. */ - ND_PRINT((ndo, " 11n")); + ND_PRINT(" 11n"); } else { if (IS_CHAN_FHSS(flags)) - ND_PRINT((ndo, " FHSS")); + ND_PRINT(" FHSS"); if (IS_CHAN_A(flags)) { if (flags & IEEE80211_CHAN_HALF) - ND_PRINT((ndo, " 11a/10Mhz")); + ND_PRINT(" 11a/10Mhz"); else if (flags & IEEE80211_CHAN_QUARTER) - ND_PRINT((ndo, " 11a/5Mhz")); + ND_PRINT(" 11a/5Mhz"); else - ND_PRINT((ndo, " 11a")); + ND_PRINT(" 11a"); } if (IS_CHAN_ANYG(flags)) { if (flags & IEEE80211_CHAN_HALF) - ND_PRINT((ndo, " 11g/10Mhz")); + ND_PRINT(" 11g/10Mhz"); else if (flags & IEEE80211_CHAN_QUARTER) - ND_PRINT((ndo, " 11g/5Mhz")); + ND_PRINT(" 11g/5Mhz"); else - ND_PRINT((ndo, " 11g")); + ND_PRINT(" 11g"); } else if (IS_CHAN_B(flags)) - ND_PRINT((ndo, " 11b")); + ND_PRINT(" 11b"); if (flags & IEEE80211_CHAN_TURBO) - ND_PRINT((ndo, " Turbo")); + ND_PRINT(" Turbo"); } /* * These apply to 11n. */ if (flags & IEEE80211_CHAN_HT20) - ND_PRINT((ndo, " ht/20")); + ND_PRINT(" ht/20"); else if (flags & IEEE80211_CHAN_HT40D) - ND_PRINT((ndo, " ht/40-")); + ND_PRINT(" ht/40-"); else if (flags & IEEE80211_CHAN_HT40U) - ND_PRINT((ndo, " ht/40+")); - ND_PRINT((ndo, " ")); + ND_PRINT(" ht/40+"); + ND_PRINT(" "); } static int @@ -2564,7 +2556,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_uint64(s, &tsft); if (rc != 0) goto trunc; - ND_PRINT((ndo, "%" PRIu64 "us tsft ", tsft)); + ND_PRINT("%" PRIu64 "us tsft ", tsft); break; } @@ -2576,15 +2568,15 @@ print_radiotap_field(netdissect_options *ndo, goto trunc; *flagsp = flagsval; if (flagsval & IEEE80211_RADIOTAP_F_CFP) - ND_PRINT((ndo, "cfp ")); + ND_PRINT("cfp "); if (flagsval & IEEE80211_RADIOTAP_F_SHORTPRE) - ND_PRINT((ndo, "short preamble ")); + ND_PRINT("short preamble "); if (flagsval & IEEE80211_RADIOTAP_F_WEP) - ND_PRINT((ndo, "wep ")); + ND_PRINT("wep "); if (flagsval & IEEE80211_RADIOTAP_F_FRAG) - ND_PRINT((ndo, "fragmented ")); + ND_PRINT("fragmented "); if (flagsval & IEEE80211_RADIOTAP_F_BADFCS) - ND_PRINT((ndo, "bad-fcs ")); + ND_PRINT("bad-fcs "); break; } @@ -2632,9 +2624,9 @@ print_radiotap_field(netdissect_options *ndo, * information from Flags, at least on * FreeBSD? */ - ND_PRINT((ndo, "MCS %u ", rate & 0x7f)); + ND_PRINT("MCS %u ", rate & 0x7f); } else - ND_PRINT((ndo, "%2.1f Mb/s ", .5 * rate)); + ND_PRINT("%2.1f Mb/s ", .5 * rate); break; } @@ -2668,7 +2660,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_uint8(s, &hoppat); if (rc != 0) goto trunc; - ND_PRINT((ndo, "fhset %u fhpat %u ", hopset, hoppat)); + ND_PRINT("fhset %u fhpat %u ", hopset, hoppat); break; } @@ -2678,7 +2670,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_int8(s, &dbm_antsignal); if (rc != 0) goto trunc; - ND_PRINT((ndo, "%ddBm signal ", dbm_antsignal)); + ND_PRINT("%ddBm signal ", dbm_antsignal); break; } @@ -2688,7 +2680,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_int8(s, &dbm_antnoise); if (rc != 0) goto trunc; - ND_PRINT((ndo, "%ddBm noise ", dbm_antnoise)); + ND_PRINT("%ddBm noise ", dbm_antnoise); break; } @@ -2698,7 +2690,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_uint16(s, &lock_quality); if (rc != 0) goto trunc; - ND_PRINT((ndo, "%u sq ", lock_quality)); + ND_PRINT("%u sq ", lock_quality); break; } @@ -2708,7 +2700,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_int16(s, &tx_attenuation); if (rc != 0) goto trunc; - ND_PRINT((ndo, "%d tx power ", -tx_attenuation)); + ND_PRINT("%d tx power ", -tx_attenuation); break; } @@ -2718,7 +2710,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_int8(s, &db_tx_attenuation); if (rc != 0) goto trunc; - ND_PRINT((ndo, "%ddB tx attenuation ", -db_tx_attenuation)); + ND_PRINT("%ddB tx attenuation ", -db_tx_attenuation); break; } @@ -2728,7 +2720,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_int8(s, &dbm_tx_power); if (rc != 0) goto trunc; - ND_PRINT((ndo, "%ddBm tx power ", dbm_tx_power)); + ND_PRINT("%ddBm tx power ", dbm_tx_power); break; } @@ -2738,7 +2730,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_uint8(s, &antenna); if (rc != 0) goto trunc; - ND_PRINT((ndo, "antenna %u ", antenna)); + ND_PRINT("antenna %u ", antenna); break; } @@ -2748,7 +2740,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_uint8(s, &db_antsignal); if (rc != 0) goto trunc; - ND_PRINT((ndo, "%udB signal ", db_antsignal)); + ND_PRINT("%udB signal ", db_antsignal); break; } @@ -2758,7 +2750,7 @@ print_radiotap_field(netdissect_options *ndo, rc = cpack_uint8(s, &db_antnoise); if (rc != 0) goto trunc; - ND_PRINT((ndo, "%udB noise ", db_antnoise)); + ND_PRINT("%udB noise ", db_antnoise); break; } @@ -2853,37 +2845,37 @@ print_radiotap_field(netdissect_options *ndo, * We have the rate. * Print it. */ - ND_PRINT((ndo, "%.1f Mb/s MCS %u ", htrate, mcs_index)); + ND_PRINT("%.1f Mb/s MCS %u ", htrate, mcs_index); } else { /* * We at least have the MCS index. * Print it. */ - ND_PRINT((ndo, "MCS %u ", mcs_index)); + ND_PRINT("MCS %u ", mcs_index); } } if (known & IEEE80211_RADIOTAP_MCS_BANDWIDTH_KNOWN) { - ND_PRINT((ndo, "%s ", - ht_bandwidth[flags & IEEE80211_RADIOTAP_MCS_BANDWIDTH_MASK])); + ND_PRINT("%s ", + ht_bandwidth[flags & IEEE80211_RADIOTAP_MCS_BANDWIDTH_MASK]); } if (known & IEEE80211_RADIOTAP_MCS_GUARD_INTERVAL_KNOWN) { - ND_PRINT((ndo, "%s GI ", + ND_PRINT("%s GI ", (flags & IEEE80211_RADIOTAP_MCS_SHORT_GI) ? - "short" : "long")); + "short" : "long"); } if (known & IEEE80211_RADIOTAP_MCS_HT_FORMAT_KNOWN) { - ND_PRINT((ndo, "%s ", + ND_PRINT("%s ", (flags & IEEE80211_RADIOTAP_MCS_HT_GREENFIELD) ? - "greenfield" : "mixed")); + "greenfield" : "mixed"); } if (known & IEEE80211_RADIOTAP_MCS_FEC_TYPE_KNOWN) { - ND_PRINT((ndo, "%s FEC ", + ND_PRINT("%s FEC ", (flags & IEEE80211_RADIOTAP_MCS_FEC_LDPC) ? - "LDPC" : "BCC")); + "LDPC" : "BCC"); } if (known & IEEE80211_RADIOTAP_MCS_STBC_KNOWN) { - ND_PRINT((ndo, "RX-STBC%u ", - (flags & IEEE80211_RADIOTAP_MCS_STBC_MASK) >> IEEE80211_RADIOTAP_MCS_STBC_SHIFT)); + ND_PRINT("RX-STBC%u ", + (flags & IEEE80211_RADIOTAP_MCS_STBC_MASK) >> IEEE80211_RADIOTAP_MCS_STBC_SHIFT); } break; } @@ -2984,19 +2976,19 @@ print_radiotap_field(netdissect_options *ndo, if (nss == 0) continue; - ND_PRINT((ndo, "User %u MCS %u ", i, mcs)); - ND_PRINT((ndo, "%s FEC ", + ND_PRINT("User %u MCS %u ", i, mcs); + ND_PRINT("%s FEC ", (coding & (IEEE80211_RADIOTAP_CODING_LDPC_USERn << i)) ? - "LDPC" : "BCC")); + "LDPC" : "BCC"); } if (known & IEEE80211_RADIOTAP_VHT_BANDWIDTH_KNOWN) { - ND_PRINT((ndo, "%s ", - vht_bandwidth[bandwidth & IEEE80211_RADIOTAP_VHT_BANDWIDTH_MASK])); + ND_PRINT("%s ", + vht_bandwidth[bandwidth & IEEE80211_RADIOTAP_VHT_BANDWIDTH_MASK]); } if (known & IEEE80211_RADIOTAP_VHT_GUARD_INTERVAL_KNOWN) { - ND_PRINT((ndo, "%s GI ", + ND_PRINT("%s GI ", (flags & IEEE80211_RADIOTAP_VHT_SHORT_GI) ? - "short" : "long")); + "short" : "long"); } break; } @@ -3006,14 +2998,14 @@ print_radiotap_field(netdissect_options *ndo, * size we do not know, so we cannot * proceed. Just print the bit number. */ - ND_PRINT((ndo, "[bit %u] ", bit)); + ND_PRINT("[bit %u] ", bit); return -1; } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return rc; } @@ -3089,7 +3081,7 @@ ieee802_11_radio_print(netdissect_options *ndo, u_int fcslen; if (caplen < sizeof(*hdr)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return caplen; } @@ -3101,7 +3093,7 @@ ieee802_11_radio_print(netdissect_options *ndo, * If we don't have the entire radiotap header, just give up. */ if (caplen < len) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return caplen; } cpack_init(&cpacker, (const uint8_t *)hdr, len); /* align against header start */ @@ -3114,7 +3106,7 @@ ieee802_11_radio_print(netdissect_options *ndo, /* are there more bitmap extensions than bytes in header? */ if ((const u_char*)(last_presentp + 1) > p + len) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return caplen; } @@ -3210,27 +3202,27 @@ ieee802_11_radio_print(netdissect_options *ndo, bit0 = 0; vendor_namespace = 1; if ((cpack_align_and_reserve(&cpacker, 2)) == NULL) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; } if (cpack_uint8(&cpacker, &vendor_oui[0]) != 0) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; } if (cpack_uint8(&cpacker, &vendor_oui[1]) != 0) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; } if (cpack_uint8(&cpacker, &vendor_oui[2]) != 0) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; } if (cpack_uint8(&cpacker, &vendor_subnamespace) != 0) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; } if (cpack_uint16(&cpacker, &skip_length) != 0) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; } break; @@ -3266,7 +3258,7 @@ ieee802_11_avs_radio_print(netdissect_options *ndo, uint32_t caphdr_len; if (caplen < 8) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return caplen; } @@ -3277,12 +3269,12 @@ ieee802_11_avs_radio_print(netdissect_options *ndo, * to be large enough to include even the version * cookie or capture header length! */ - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return caplen; } if (caplen < caphdr_len) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return caplen; } @@ -3318,7 +3310,7 @@ prism_if_print(netdissect_options *ndo, uint32_t msgcode; if (caplen < 4) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return caplen; } @@ -3328,7 +3320,7 @@ prism_if_print(netdissect_options *ndo, return ieee802_11_avs_radio_print(ndo, p, length, caplen); if (caplen < PRISM_HDR_LEN) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return caplen; } diff --git a/print-802_15_4.c b/print-802_15_4.c index 8db4a213..1b08a7db 100644 --- a/print-802_15_4.c +++ b/print-802_15_4.c @@ -72,7 +72,7 @@ ieee802_15_4_if_print(netdissect_options *ndo, uint16_t panid = 0; if (caplen < 3) { - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return caplen; } hdrlen = 3; @@ -83,9 +83,9 @@ ieee802_15_4_if_print(netdissect_options *ndo, p += 3; caplen -= 3; - ND_PRINT((ndo,"IEEE 802.15.4 %s packet ", ftypes[FC_FRAME_TYPE(fc)])); + ND_PRINT("IEEE 802.15.4 %s packet ", ftypes[FC_FRAME_TYPE(fc)]); if (ndo->ndo_vflag) - ND_PRINT((ndo,"seq %02x ", seq)); + ND_PRINT("seq %02x ", seq); /* * Destination address and PAN ID, if present. @@ -98,19 +98,19 @@ ieee802_15_4_if_print(netdissect_options *ndo, * the source and destination addresses be present, * but the destination address is missing. */ - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return hdrlen; } if (ndo->ndo_vflag) - ND_PRINT((ndo,"none ")); + ND_PRINT("none "); break; case FC_ADDRESSING_MODE_RESERVED: if (ndo->ndo_vflag) - ND_PRINT((ndo,"reserved destination addressing mode")); + ND_PRINT("reserved destination addressing mode"); return hdrlen; case FC_ADDRESSING_MODE_SHORT: if (caplen < 2) { - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return hdrlen; } panid = EXTRACT_LE_U_2(p); @@ -118,18 +118,18 @@ ieee802_15_4_if_print(netdissect_options *ndo, caplen -= 2; hdrlen += 2; if (caplen < 2) { - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return hdrlen; } if (ndo->ndo_vflag) - ND_PRINT((ndo,"%04x:%04x ", panid, EXTRACT_LE_U_2(p))); + ND_PRINT("%04x:%04x ", panid, EXTRACT_LE_U_2(p)); p += 2; caplen -= 2; hdrlen += 2; break; case FC_ADDRESSING_MODE_LONG: if (caplen < 2) { - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return hdrlen; } panid = EXTRACT_LE_U_2(p); @@ -137,18 +137,18 @@ ieee802_15_4_if_print(netdissect_options *ndo, caplen -= 2; hdrlen += 2; if (caplen < 8) { - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return hdrlen; } if (ndo->ndo_vflag) - ND_PRINT((ndo,"%04x:%s ", panid, le64addr_string(ndo, p))); + ND_PRINT("%04x:%s ", panid, le64addr_string(ndo, p)); p += 8; caplen -= 8; hdrlen += 8; break; } if (ndo->ndo_vflag) - ND_PRINT((ndo,"< ")); + ND_PRINT("< "); /* * Source address and PAN ID, if present. @@ -156,11 +156,11 @@ ieee802_15_4_if_print(netdissect_options *ndo, switch (FC_SRC_ADDRESSING_MODE(fc)) { case FC_ADDRESSING_MODE_NONE: if (ndo->ndo_vflag) - ND_PRINT((ndo,"none ")); + ND_PRINT("none "); break; case FC_ADDRESSING_MODE_RESERVED: if (ndo->ndo_vflag) - ND_PRINT((ndo,"reserved source addressing mode")); + ND_PRINT("reserved source addressing mode"); return 0; case FC_ADDRESSING_MODE_SHORT: if (!(fc & FC_PAN_ID_COMPRESSION)) { @@ -170,7 +170,7 @@ ieee802_15_4_if_print(netdissect_options *ndo, * PAN ID, fetched above.) */ if (caplen < 2) { - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return hdrlen; } panid = EXTRACT_LE_U_2(p); @@ -179,11 +179,11 @@ ieee802_15_4_if_print(netdissect_options *ndo, hdrlen += 2; } if (caplen < 2) { - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return hdrlen; } if (ndo->ndo_vflag) - ND_PRINT((ndo,"%04x:%04x ", panid, EXTRACT_LE_U_2(p))); + ND_PRINT("%04x:%04x ", panid, EXTRACT_LE_U_2(p)); p += 2; caplen -= 2; hdrlen += 2; @@ -196,7 +196,7 @@ ieee802_15_4_if_print(netdissect_options *ndo, * PAN ID, fetched above.) */ if (caplen < 2) { - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return hdrlen; } panid = EXTRACT_LE_U_2(p); @@ -205,11 +205,11 @@ ieee802_15_4_if_print(netdissect_options *ndo, hdrlen += 2; } if (caplen < 8) { - ND_PRINT((ndo, "[|802.15.4]")); + ND_PRINT("[|802.15.4]"); return hdrlen; } if (ndo->ndo_vflag) - ND_PRINT((ndo,"%04x:%s ", panid, le64addr_string(ndo, p))); + ND_PRINT("%04x:%s ", panid, le64addr_string(ndo, p)); p += 8; caplen -= 8; hdrlen += 8; @@ -46,19 +46,19 @@ ah_print(netdissect_options *ndo, const u_char *bp) sumlen = EXTRACT_U_1(ah->ah_len) << 2; - ND_PRINT((ndo, "AH(spi=0x%08x", EXTRACT_BE_U_4(ah->ah_spi))); + ND_PRINT("AH(spi=0x%08x", EXTRACT_BE_U_4(ah->ah_spi)); if (ndo->ndo_vflag) - ND_PRINT((ndo, ",sumlen=%d", sumlen)); + ND_PRINT(",sumlen=%d", sumlen); ND_TCHECK_4(ah + 1); - ND_PRINT((ndo, ",seq=0x%x", EXTRACT_BE_U_4(ah + 1))); + ND_PRINT(",seq=0x%x", EXTRACT_BE_U_4(ah + 1)); if (!ND_TTEST_LEN(bp, sizeof(struct ah) + sumlen)) { - ND_PRINT((ndo, "[truncated]):")); + ND_PRINT("[truncated]):"); return -1; } - ND_PRINT((ndo, "): ")); + ND_PRINT("): "); return sizeof(struct ah) + sumlen; trunc: - ND_PRINT((ndo, "[|AH]")); + ND_PRINT("[|AH]"); return -1; } diff --git a/print-ahcp.c b/print-ahcp.c index 8d784c14..bd214be4 100644 --- a/print-ahcp.c +++ b/print-ahcp.c @@ -109,19 +109,19 @@ ahcp_time_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) ND_TCHECK_4(cp); t = EXTRACT_BE_U_4(cp); if (NULL == (tm = gmtime(&t))) - ND_PRINT((ndo, ": gmtime() error")); + ND_PRINT(": gmtime() error"); else if (0 == strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm)) - ND_PRINT((ndo, ": strftime() error")); + ND_PRINT(": strftime() error"); else - ND_PRINT((ndo, ": %s UTC", buf)); + ND_PRINT(": %s UTC", buf); return 0; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -131,15 +131,15 @@ ahcp_seconds_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) if (cp + 4 != ep) goto invalid; ND_TCHECK_4(cp); - ND_PRINT((ndo, ": %us", EXTRACT_BE_U_4(cp))); + ND_PRINT(": %us", EXTRACT_BE_U_4(cp)); return 0; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -152,18 +152,18 @@ ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha if (cp + 16 > ep) goto invalid; ND_TCHECK_16(cp); - ND_PRINT((ndo, "%s%s", sep, ip6addr_string(ndo, cp))); + ND_PRINT("%s%s", sep, ip6addr_string(ndo, cp)); cp += 16; sep = ", "; } return 0; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -176,18 +176,18 @@ ahcp_ipv4_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha if (cp + 4 > ep) goto invalid; ND_TCHECK_4(cp); - ND_PRINT((ndo, "%s%s", sep, ipaddr_string(ndo, cp))); + ND_PRINT("%s%s", sep, ipaddr_string(ndo, cp)); cp += 4; sep = ", "; } return 0; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -200,18 +200,18 @@ ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char if (cp + 17 > ep) goto invalid; ND_TCHECK_LEN(cp, 17); - ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(ndo, cp), EXTRACT_U_1(cp + 16))); + ND_PRINT("%s%s/%u", sep, ip6addr_string(ndo, cp), EXTRACT_U_1(cp + 16)); cp += 17; sep = ", "; } return 0; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -224,18 +224,18 @@ ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char if (cp + 5 > ep) goto invalid; ND_TCHECK_5(cp); - ND_PRINT((ndo, "%s%s/%u", sep, ipaddr_string(ndo, cp), EXTRACT_U_1(cp + 4))); + ND_PRINT("%s%s/%u", sep, ipaddr_string(ndo, cp), EXTRACT_U_1(cp + 4)); cp += 5; sep = ", "; } return 0; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -268,7 +268,7 @@ ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) ND_TCHECK_1(cp); option_no = EXTRACT_U_1(cp); cp += 1; - ND_PRINT((ndo, "\n\t %s", tok2str(ahcp1_opt_str, "Unknown-%u", option_no))); + ND_PRINT("\n\t %s", tok2str(ahcp1_opt_str, "Unknown-%u", option_no)); if (option_no == AHCP1_OPT_PAD || option_no == AHCP1_OPT_MANDATORY) continue; /* Length */ @@ -284,7 +284,7 @@ ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) if (data_decoders[option_no](ndo, cp, cp + option_len) < 0) break; /* truncated and already marked up */ } else { - ND_PRINT((ndo, " (Length %u)", option_len)); + ND_PRINT(" (Length %u)", option_len); ND_TCHECK_LEN(cp, option_len); } cp += option_len; @@ -292,11 +292,11 @@ ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -321,10 +321,10 @@ ahcp1_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) cp += 2; if (ndo->ndo_vflag) { - ND_PRINT((ndo, "\n\t%s", tok2str(ahcp1_msg_str, "Unknown-%u", type))); + ND_PRINT("\n\t%s", tok2str(ahcp1_msg_str, "Unknown-%u", type)); if (mbz != 0) - ND_PRINT((ndo, ", MBZ %u", mbz)); - ND_PRINT((ndo, ", Length %u", body_len)); + ND_PRINT(", MBZ %u", mbz); + ND_PRINT(", Length %u", body_len); } if (cp + body_len > ep) goto invalid; @@ -337,11 +337,11 @@ ahcp1_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -350,7 +350,7 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len) const u_char *ep = cp + len; uint8_t version; - ND_PRINT((ndo, "AHCP")); + ND_PRINT("AHCP"); if (len < 2) goto invalid; /* Magic */ @@ -364,7 +364,7 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len) cp += 1; switch (version) { case AHCP_VERSION_1: { - ND_PRINT((ndo, " Version 1")); + ND_PRINT(" Version 1"); if (len < AHCP1_HEADER_FIX_LEN) goto invalid; if (!ndo->ndo_vflag) { @@ -373,23 +373,23 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len) } else { /* Hopcount */ ND_TCHECK_1(cp); - ND_PRINT((ndo, "\n\tHopcount %u", EXTRACT_U_1(cp))); + ND_PRINT("\n\tHopcount %u", EXTRACT_U_1(cp)); cp += 1; /* Original Hopcount */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", Original Hopcount %u", EXTRACT_U_1(cp))); + ND_PRINT(", Original Hopcount %u", EXTRACT_U_1(cp)); cp += 1; /* Nonce */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", Nonce 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT(", Nonce 0x%08x", EXTRACT_BE_U_4(cp)); cp += 4; /* Source Id */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", Source Id %s", linkaddr_string(ndo, cp, 0, 8))); + ND_PRINT(", Source Id %s", linkaddr_string(ndo, cp, 0, 8)); cp += 8; /* Destination Id */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", Destination Id %s", linkaddr_string(ndo, cp, 0, 8))); + ND_PRINT(", Destination Id %s", linkaddr_string(ndo, cp, 0, 8)); cp += 8; } /* Body */ @@ -397,15 +397,15 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len) break; } default: - ND_PRINT((ndo, " Version %u (unknown)", version)); + ND_PRINT(" Version %u (unknown)", version); break; } return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-aodv.c b/print-aodv.c index 60a295dc..7665e6ef 100644 --- a/print-aodv.c +++ b/print-aodv.c @@ -188,21 +188,21 @@ aodv_extension(netdissect_options *ndo, if (length < sizeof(struct aodv_hello)) goto trunc; if (EXTRACT_U_1(ep->length) < 4) { - ND_PRINT((ndo, "\n\text HELLO - bad length %u", EXTRACT_U_1(ep->length))); + ND_PRINT("\n\text HELLO - bad length %u", EXTRACT_U_1(ep->length)); break; } - ND_PRINT((ndo, "\n\text HELLO %u ms", - EXTRACT_BE_U_4(ah->interval))); + ND_PRINT("\n\text HELLO %u ms", + EXTRACT_BE_U_4(ah->interval)); break; default: - ND_PRINT((ndo, "\n\text %u %u", EXTRACT_U_1(ep->type), EXTRACT_U_1(ep->length))); + ND_PRINT("\n\text %u %u", EXTRACT_U_1(ep->type), EXTRACT_U_1(ep->length)); break; } return; trunc: - ND_PRINT((ndo, " [|hello]")); + ND_PRINT(" [|hello]"); } static void @@ -214,7 +214,7 @@ aodv_rreq(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_SIZE(ap); if (length < sizeof(*ap)) goto trunc; - ND_PRINT((ndo, " rreq %u %s%s%s%s%shops %u id 0x%08x\n" + ND_PRINT(" rreq %u %s%s%s%s%shops %u id 0x%08x\n" "\tdst %s seq %u src %s seq %u", length, EXTRACT_U_1(ap->rreq_type) & RREQ_JOIN ? "[J]" : "", EXTRACT_U_1(ap->rreq_type) & RREQ_REPAIR ? "[R]" : "", @@ -226,14 +226,14 @@ aodv_rreq(netdissect_options *ndo, const u_char *dat, u_int length) ipaddr_string(ndo, &ap->rreq_da), EXTRACT_BE_U_4(ap->rreq_ds), ipaddr_string(ndo, &ap->rreq_oa), - EXTRACT_BE_U_4(ap->rreq_os))); + EXTRACT_BE_U_4(ap->rreq_os)); i = length - sizeof(*ap); if (i >= sizeof(struct aodv_ext)) aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i); return; trunc: - ND_PRINT((ndo, " [|rreq")); + ND_PRINT(" [|rreq"); } static void @@ -245,7 +245,7 @@ aodv_rrep(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_SIZE(ap); if (length < sizeof(*ap)) goto trunc; - ND_PRINT((ndo, " rrep %u %s%sprefix %u hops %u\n" + ND_PRINT(" rrep %u %s%sprefix %u hops %u\n" "\tdst %s dseq %u src %s %u ms", length, EXTRACT_U_1(ap->rrep_type) & RREP_REPAIR ? "[R]" : "", EXTRACT_U_1(ap->rrep_type) & RREP_ACK ? "[A] " : " ", @@ -254,14 +254,14 @@ aodv_rrep(netdissect_options *ndo, const u_char *dat, u_int length) ipaddr_string(ndo, &ap->rrep_da), EXTRACT_BE_U_4(ap->rrep_ds), ipaddr_string(ndo, &ap->rrep_oa), - EXTRACT_BE_U_4(ap->rrep_life))); + EXTRACT_BE_U_4(ap->rrep_life)); i = length - sizeof(*ap); if (i >= sizeof(struct aodv_ext)) aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i); return; trunc: - ND_PRINT((ndo, " [|rreq")); + ND_PRINT(" [|rreq"); } static void @@ -274,24 +274,24 @@ aodv_rerr(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_SIZE(ap); if (length < sizeof(*ap)) goto trunc; - ND_PRINT((ndo, " rerr %s [items %u] [%u]:", + ND_PRINT(" rerr %s [items %u] [%u]:", EXTRACT_U_1(ap->rerr_flags) & RERR_NODELETE ? "[D]" : "", - EXTRACT_U_1(ap->rerr_dc), length)); + EXTRACT_U_1(ap->rerr_dc), length); dp = (const struct rerr_unreach *)(dat + sizeof(*ap)); i = length - sizeof(*ap); for (dc = EXTRACT_U_1(ap->rerr_dc); dc != 0; dc--) { ND_TCHECK_SIZE(dp); if (i < sizeof(*dp)) goto trunc; - ND_PRINT((ndo, " {%s}(%u)", ipaddr_string(ndo, &dp->u_da), - EXTRACT_BE_U_4(dp->u_ds))); + ND_PRINT(" {%s}(%u)", ipaddr_string(ndo, &dp->u_da), + EXTRACT_BE_U_4(dp->u_ds)); dp++; i -= sizeof(*dp); } return; trunc: - ND_PRINT((ndo, "[|rerr]")); + ND_PRINT("[|rerr]"); } static void @@ -303,7 +303,7 @@ aodv_v6_rreq(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_SIZE(ap); if (length < sizeof(*ap)) goto trunc; - ND_PRINT((ndo, " v6 rreq %u %s%s%s%s%shops %u id 0x%08x\n" + ND_PRINT(" v6 rreq %u %s%s%s%s%shops %u id 0x%08x\n" "\tdst %s seq %u src %s seq %u", length, EXTRACT_U_1(ap->rreq_type) & RREQ_JOIN ? "[J]" : "", EXTRACT_U_1(ap->rreq_type) & RREQ_REPAIR ? "[R]" : "", @@ -315,14 +315,14 @@ aodv_v6_rreq(netdissect_options *ndo, const u_char *dat, u_int length) ip6addr_string(ndo, &ap->rreq_da), EXTRACT_BE_U_4(ap->rreq_ds), ip6addr_string(ndo, &ap->rreq_oa), - EXTRACT_BE_U_4(ap->rreq_os))); + EXTRACT_BE_U_4(ap->rreq_os)); i = length - sizeof(*ap); if (i >= sizeof(struct aodv_ext)) aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i); return; trunc: - ND_PRINT((ndo, " [|rreq")); + ND_PRINT(" [|rreq"); } static void @@ -334,7 +334,7 @@ aodv_v6_rrep(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_SIZE(ap); if (length < sizeof(*ap)) goto trunc; - ND_PRINT((ndo, " rrep %u %s%sprefix %u hops %u\n" + ND_PRINT(" rrep %u %s%sprefix %u hops %u\n" "\tdst %s dseq %u src %s %u ms", length, EXTRACT_U_1(ap->rrep_type) & RREP_REPAIR ? "[R]" : "", EXTRACT_U_1(ap->rrep_type) & RREP_ACK ? "[A] " : " ", @@ -343,14 +343,14 @@ aodv_v6_rrep(netdissect_options *ndo, const u_char *dat, u_int length) ip6addr_string(ndo, &ap->rrep_da), EXTRACT_BE_U_4(ap->rrep_ds), ip6addr_string(ndo, &ap->rrep_oa), - EXTRACT_BE_U_4(ap->rrep_life))); + EXTRACT_BE_U_4(ap->rrep_life)); i = length - sizeof(*ap); if (i >= sizeof(struct aodv_ext)) aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i); return; trunc: - ND_PRINT((ndo, " [|rreq")); + ND_PRINT(" [|rreq"); } static void @@ -363,24 +363,24 @@ aodv_v6_rerr(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_SIZE(ap); if (length < sizeof(*ap)) goto trunc; - ND_PRINT((ndo, " rerr %s [items %u] [%u]:", + ND_PRINT(" rerr %s [items %u] [%u]:", EXTRACT_U_1(ap->rerr_flags) & RERR_NODELETE ? "[D]" : "", - EXTRACT_U_1(ap->rerr_dc), length)); + EXTRACT_U_1(ap->rerr_dc), length); dp6 = (const struct rerr_unreach6 *)(const void *)(ap + 1); i = length - sizeof(*ap); for (dc = EXTRACT_U_1(ap->rerr_dc); dc != 0; dc--) { ND_TCHECK_SIZE(dp6); if (i < sizeof(*dp6)) goto trunc; - ND_PRINT((ndo, " {%s}(%u)", ip6addr_string(ndo, &dp6->u_da), - EXTRACT_BE_U_4(dp6->u_ds))); + ND_PRINT(" {%s}(%u)", ip6addr_string(ndo, &dp6->u_da), + EXTRACT_BE_U_4(dp6->u_ds)); dp6++; i -= sizeof(*dp6); } return; trunc: - ND_PRINT((ndo, "[|rerr]")); + ND_PRINT("[|rerr]"); } static void @@ -392,7 +392,7 @@ aodv_v6_draft_01_rreq(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_SIZE(ap); if (length < sizeof(*ap)) goto trunc; - ND_PRINT((ndo, " rreq %u %s%s%s%s%shops %u id 0x%08x\n" + ND_PRINT(" rreq %u %s%s%s%s%shops %u id 0x%08x\n" "\tdst %s seq %u src %s seq %u", length, EXTRACT_U_1(ap->rreq_type) & RREQ_JOIN ? "[J]" : "", EXTRACT_U_1(ap->rreq_type) & RREQ_REPAIR ? "[R]" : "", @@ -404,14 +404,14 @@ aodv_v6_draft_01_rreq(netdissect_options *ndo, const u_char *dat, u_int length) ip6addr_string(ndo, &ap->rreq_da), EXTRACT_BE_U_4(ap->rreq_ds), ip6addr_string(ndo, &ap->rreq_oa), - EXTRACT_BE_U_4(ap->rreq_os))); + EXTRACT_BE_U_4(ap->rreq_os)); i = length - sizeof(*ap); if (i >= sizeof(struct aodv_ext)) aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i); return; trunc: - ND_PRINT((ndo, " [|rreq")); + ND_PRINT(" [|rreq"); } static void @@ -423,7 +423,7 @@ aodv_v6_draft_01_rrep(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_SIZE(ap); if (length < sizeof(*ap)) goto trunc; - ND_PRINT((ndo, " rrep %u %s%sprefix %u hops %u\n" + ND_PRINT(" rrep %u %s%sprefix %u hops %u\n" "\tdst %s dseq %u src %s %u ms", length, EXTRACT_U_1(ap->rrep_type) & RREP_REPAIR ? "[R]" : "", EXTRACT_U_1(ap->rrep_type) & RREP_ACK ? "[A] " : " ", @@ -432,14 +432,14 @@ aodv_v6_draft_01_rrep(netdissect_options *ndo, const u_char *dat, u_int length) ip6addr_string(ndo, &ap->rrep_da), EXTRACT_BE_U_4(ap->rrep_ds), ip6addr_string(ndo, &ap->rrep_oa), - EXTRACT_BE_U_4(ap->rrep_life))); + EXTRACT_BE_U_4(ap->rrep_life)); i = length - sizeof(*ap); if (i >= sizeof(struct aodv_ext)) aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i); return; trunc: - ND_PRINT((ndo, " [|rreq")); + ND_PRINT(" [|rreq"); } static void @@ -452,24 +452,24 @@ aodv_v6_draft_01_rerr(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_SIZE(ap); if (length < sizeof(*ap)) goto trunc; - ND_PRINT((ndo, " rerr %s [items %u] [%u]:", + ND_PRINT(" rerr %s [items %u] [%u]:", EXTRACT_U_1(ap->rerr_flags) & RERR_NODELETE ? "[D]" : "", - EXTRACT_U_1(ap->rerr_dc), length)); + EXTRACT_U_1(ap->rerr_dc), length); dp6 = (const struct rerr_unreach6_draft_01 *)(const void *)(ap + 1); i = length - sizeof(*ap); for (dc = EXTRACT_U_1(ap->rerr_dc); dc != 0; dc--) { ND_TCHECK_SIZE(dp6); if (i < sizeof(*dp6)) goto trunc; - ND_PRINT((ndo, " {%s}(%u)", ip6addr_string(ndo, &dp6->u_da), - EXTRACT_BE_U_4(dp6->u_ds))); + ND_PRINT(" {%s}(%u)", ip6addr_string(ndo, &dp6->u_da), + EXTRACT_BE_U_4(dp6->u_ds)); dp6++; i -= sizeof(*dp6); } return; trunc: - ND_PRINT((ndo, "[|rerr]")); + ND_PRINT("[|rerr]"); } void @@ -484,7 +484,7 @@ aodv_print(netdissect_options *ndo, */ ND_TCHECK_1(dat); msg_type = EXTRACT_U_1(dat); - ND_PRINT((ndo, " aodv")); + ND_PRINT(" aodv"); switch (msg_type) { @@ -510,7 +510,7 @@ aodv_print(netdissect_options *ndo, break; case AODV_RREP_ACK: - ND_PRINT((ndo, " rrep-ack %u", length)); + ND_PRINT(" rrep-ack %u", length); break; case AODV_V6_DRAFT_01_RREQ: @@ -526,14 +526,14 @@ aodv_print(netdissect_options *ndo, break; case AODV_V6_DRAFT_01_RREP_ACK: - ND_PRINT((ndo, " rrep-ack %u", length)); + ND_PRINT(" rrep-ack %u", length); break; default: - ND_PRINT((ndo, " type %u %u", msg_type, length)); + ND_PRINT(" type %u %u", msg_type, length); } return; trunc: - ND_PRINT((ndo, " [|aodv]")); + ND_PRINT(" [|aodv]"); } diff --git a/print-aoe.c b/print-aoe.c index d821ec68..7e06044f 100644 --- a/print-aoe.c +++ b/print-aoe.c @@ -148,58 +148,58 @@ aoev1_issue_print(netdissect_options *ndo, goto invalid; /* AFlags */ ND_TCHECK_1(cp); - ND_PRINT((ndo, "\n\tAFlags: [%s]", bittok2str(aoev1_aflag_str, "none", EXTRACT_U_1(cp)))); + ND_PRINT("\n\tAFlags: [%s]", bittok2str(aoev1_aflag_str, "none", EXTRACT_U_1(cp))); cp += 1; /* Err/Feature */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", Err/Feature: %u", EXTRACT_U_1(cp))); + ND_PRINT(", Err/Feature: %u", EXTRACT_U_1(cp)); cp += 1; /* Sector Count (not correlated with the length) */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", Sector Count: %u", EXTRACT_U_1(cp))); + ND_PRINT(", Sector Count: %u", EXTRACT_U_1(cp)); cp += 1; /* Cmd/Status */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", Cmd/Status: %u", EXTRACT_U_1(cp))); + ND_PRINT(", Cmd/Status: %u", EXTRACT_U_1(cp)); cp += 1; /* lba0 */ ND_TCHECK_1(cp); - ND_PRINT((ndo, "\n\tlba0: %u", EXTRACT_U_1(cp))); + ND_PRINT("\n\tlba0: %u", EXTRACT_U_1(cp)); cp += 1; /* lba1 */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", lba1: %u", EXTRACT_U_1(cp))); + ND_PRINT(", lba1: %u", EXTRACT_U_1(cp)); cp += 1; /* lba2 */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", lba2: %u", EXTRACT_U_1(cp))); + ND_PRINT(", lba2: %u", EXTRACT_U_1(cp)); cp += 1; /* lba3 */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", lba3: %u", EXTRACT_U_1(cp))); + ND_PRINT(", lba3: %u", EXTRACT_U_1(cp)); cp += 1; /* lba4 */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", lba4: %u", EXTRACT_U_1(cp))); + ND_PRINT(", lba4: %u", EXTRACT_U_1(cp)); cp += 1; /* lba5 */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", lba5: %u", EXTRACT_U_1(cp))); + ND_PRINT(", lba5: %u", EXTRACT_U_1(cp)); cp += 1; /* Reserved */ ND_TCHECK_2(cp); cp += 2; /* Data */ if (len > AOEV1_ISSUE_ARG_LEN) - ND_PRINT((ndo, "\n\tData: %u bytes", len - AOEV1_ISSUE_ARG_LEN)); + ND_PRINT("\n\tData: %u bytes", len - AOEV1_ISSUE_ARG_LEN); return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -213,20 +213,20 @@ aoev1_query_print(netdissect_options *ndo, goto invalid; /* Buffer Count */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\tBuffer Count: %u", EXTRACT_BE_U_2(cp))); + ND_PRINT("\n\tBuffer Count: %u", EXTRACT_BE_U_2(cp)); cp += 2; /* Firmware Version */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", Firmware Version: %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", Firmware Version: %u", EXTRACT_BE_U_2(cp)); cp += 2; /* Sector Count */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", Sector Count: %u", EXTRACT_U_1(cp))); + ND_PRINT(", Sector Count: %u", EXTRACT_U_1(cp)); cp += 1; /* AoE/CCmd */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", AoE: %u, CCmd: %s", (EXTRACT_U_1(cp) & 0xF0) >> 4, - tok2str(aoev1_ccmd_str, "Unknown (0x02x)", EXTRACT_U_1(cp) & 0x0F))); + ND_PRINT(", AoE: %u, CCmd: %s", (EXTRACT_U_1(cp) & 0xF0) >> 4, + tok2str(aoev1_ccmd_str, "Unknown (0x02x)", EXTRACT_U_1(cp) & 0x0F)); cp += 1; /* Config String Length */ ND_TCHECK_2(cp); @@ -237,18 +237,18 @@ aoev1_query_print(netdissect_options *ndo, /* Config String */ ND_TCHECK_LEN(cp, cslen); if (cslen) { - ND_PRINT((ndo, "\n\tConfig String (length %u): ", cslen)); + ND_PRINT("\n\tConfig String (length %u): ", cslen); if (fn_printn(ndo, cp, cslen, ndo->ndo_snapend)) goto trunc; } return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -265,17 +265,17 @@ aoev1_mac_print(netdissect_options *ndo, cp += 1; /* MCmd */ ND_TCHECK_1(cp); - ND_PRINT((ndo, "\n\tMCmd: %s", tok2str(aoev1_mcmd_str, "Unknown (0x%02x)", EXTRACT_U_1(cp)))); + ND_PRINT("\n\tMCmd: %s", tok2str(aoev1_mcmd_str, "Unknown (0x%02x)", EXTRACT_U_1(cp))); cp += 1; /* MError */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", MError: %s", tok2str(aoev1_merror_str, "Unknown (0x%02x)", EXTRACT_U_1(cp)))); + ND_PRINT(", MError: %s", tok2str(aoev1_merror_str, "Unknown (0x%02x)", EXTRACT_U_1(cp))); cp += 1; /* Dir Count */ ND_TCHECK_1(cp); dircount = EXTRACT_U_1(cp); cp += 1; - ND_PRINT((ndo, ", Dir Count: %u", dircount)); + ND_PRINT(", Dir Count: %u", dircount); if (AOEV1_MAC_ARG_LEN + dircount * 8 > len) goto invalid; /* directives */ @@ -285,21 +285,21 @@ aoev1_mac_print(netdissect_options *ndo, cp += 1; /* DCmd */ ND_TCHECK_1(cp); - ND_PRINT((ndo, "\n\t DCmd: %s", tok2str(aoev1_dcmd_str, "Unknown (0x%02x)", EXTRACT_U_1(cp)))); + ND_PRINT("\n\t DCmd: %s", tok2str(aoev1_dcmd_str, "Unknown (0x%02x)", EXTRACT_U_1(cp))); cp += 1; /* Ethernet Address */ ND_TCHECK_LEN(cp, MAC_ADDR_LEN); - ND_PRINT((ndo, ", Ethernet Address: %s", etheraddr_string(ndo, cp))); + ND_PRINT(", Ethernet Address: %s", etheraddr_string(ndo, cp)); cp += MAC_ADDR_LEN; } return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -313,28 +313,28 @@ aoev1_reserve_print(netdissect_options *ndo, goto invalid; /* RCmd */ ND_TCHECK_1(cp); - ND_PRINT((ndo, "\n\tRCmd: %s", tok2str(aoev1_rcmd_str, "Unknown (0x%02x)", EXTRACT_U_1(cp)))); + ND_PRINT("\n\tRCmd: %s", tok2str(aoev1_rcmd_str, "Unknown (0x%02x)", EXTRACT_U_1(cp))); cp += 1; /* NMacs (correlated with the length) */ ND_TCHECK_1(cp); nmacs = EXTRACT_U_1(cp); cp += 1; - ND_PRINT((ndo, ", NMacs: %u", nmacs)); + ND_PRINT(", NMacs: %u", nmacs); if (AOEV1_RESERVE_ARG_LEN + nmacs * MAC_ADDR_LEN != len) goto invalid; /* addresses */ for (i = 0; i < nmacs; i++) { - ND_PRINT((ndo, "\n\tEthernet Address %u: %s", i, etheraddr_string(ndo, cp))); + ND_PRINT("\n\tEthernet Address %u: %s", i, etheraddr_string(ndo, cp)); cp += MAC_ADDR_LEN; } return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* cp points to the Ver/Flags octet */ @@ -350,31 +350,31 @@ aoev1_print(netdissect_options *ndo, goto invalid; /* Flags */ flags = EXTRACT_U_1(cp) & 0x0F; - ND_PRINT((ndo, ", Flags: [%s]", bittok2str(aoev1_flag_str, "none", flags))); + ND_PRINT(", Flags: [%s]", bittok2str(aoev1_flag_str, "none", flags)); cp += 1; if (! ndo->ndo_vflag) return; /* Error */ ND_TCHECK_1(cp); if (flags & AOEV1_FLAG_E) - ND_PRINT((ndo, "\n\tError: %s", tok2str(aoev1_errcode_str, "Invalid (%u)", EXTRACT_U_1(cp)))); + ND_PRINT("\n\tError: %s", tok2str(aoev1_errcode_str, "Invalid (%u)", EXTRACT_U_1(cp))); cp += 1; /* Major */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\tMajor: 0x%04x", EXTRACT_BE_U_2(cp))); + ND_PRINT("\n\tMajor: 0x%04x", EXTRACT_BE_U_2(cp)); cp += 2; /* Minor */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", Minor: 0x%02x", EXTRACT_U_1(cp))); + ND_PRINT(", Minor: 0x%02x", EXTRACT_U_1(cp)); cp += 1; /* Command */ ND_TCHECK_1(cp); command = EXTRACT_U_1(cp); cp += 1; - ND_PRINT((ndo, ", Command: %s", tok2str(cmdcode_str, "Unknown (0x%02x)", command))); + ND_PRINT(", Command: %s", tok2str(cmdcode_str, "Unknown (0x%02x)", command)); /* Tag */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", Tag: 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT(", Tag: 0x%08x", EXTRACT_BE_U_4(cp)); cp += 4; /* Arg */ cmd_decoder = @@ -388,11 +388,11 @@ aoev1_print(netdissect_options *ndo, return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -402,7 +402,7 @@ aoe_print(netdissect_options *ndo, const u_char *ep = cp + len; uint8_t ver; - ND_PRINT((ndo, "AoE length %u", len)); + ND_PRINT("AoE length %u", len); if (len < 1) goto invalid; @@ -410,7 +410,7 @@ aoe_print(netdissect_options *ndo, ND_TCHECK_1(cp); ver = (EXTRACT_U_1(cp) & 0xF0) >> 4; /* Don't advance cp yet: low order 4 bits are version-specific. */ - ND_PRINT((ndo, ", Ver %u", ver)); + ND_PRINT(", Ver %u", ver); switch (ver) { case AOE_V1: @@ -420,10 +420,10 @@ aoe_print(netdissect_options *ndo, return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-ap1394.c b/print-ap1394.c index e3ddcc04..655ce7ca 100644 --- a/print-ap1394.c +++ b/print-ap1394.c @@ -63,20 +63,20 @@ ap1394_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) fp = (const struct firewire_header *)bp; - ND_PRINT((ndo, "%s > %s", + ND_PRINT("%s > %s", fwaddr_string(ndo, fp->firewire_shost), - fwaddr_string(ndo, fp->firewire_dhost))); + fwaddr_string(ndo, fp->firewire_dhost)); firewire_type = EXTRACT_BE_U_2(fp->firewire_type); if (!ndo->ndo_qflag) { - ND_PRINT((ndo, ", ethertype %s (0x%04x)", + ND_PRINT(", ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", firewire_type), - firewire_type)); + firewire_type); } else { - ND_PRINT((ndo, ", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", firewire_type))); + ND_PRINT(", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", firewire_type)); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } /* @@ -95,7 +95,7 @@ ap1394_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch struct lladdr_info src, dst; if (caplen < FIREWIRE_HDRLEN) { - ND_PRINT((ndo, "[|ap1394]")); + ND_PRINT("[|ap1394]"); return FIREWIRE_HDRLEN; } diff --git a/print-arcnet.c b/print-arcnet.c index 4dccf4a9..89c20a89 100644 --- a/print-arcnet.c +++ b/print-arcnet.c @@ -130,47 +130,47 @@ arcnet_print(netdissect_options *ndo, const u_char *bp, u_int length, int phds, if (ndo->ndo_qflag) { - ND_PRINT((ndo, "%02x %02x %u: ", + ND_PRINT("%02x %02x %u: ", EXTRACT_U_1(ap->arc_shost), EXTRACT_U_1(ap->arc_dhost), - length)); + length); return; } arctypename = tok2str(arctypemap, "%02x", EXTRACT_U_1(ap->arc_type)); if (!phds) { - ND_PRINT((ndo, "%02x %02x %s %d: ", + ND_PRINT("%02x %02x %s %d: ", EXTRACT_U_1(ap->arc_shost), EXTRACT_U_1(ap->arc_dhost), arctypename, - length)); + length); return; } if (flag == 0) { - ND_PRINT((ndo, "%02x %02x %s seqid %04x %d: ", + ND_PRINT("%02x %02x %s seqid %04x %d: ", EXTRACT_U_1(ap->arc_shost), EXTRACT_U_1(ap->arc_dhost), arctypename, seqid, - length)); + length); return; } if (flag & 1) - ND_PRINT((ndo, "%02x %02x %s seqid %04x " + ND_PRINT("%02x %02x %s seqid %04x " "(first of %d fragments) %d: ", EXTRACT_U_1(ap->arc_shost), EXTRACT_U_1(ap->arc_dhost), arctypename, seqid, - (flag + 3) / 2, length)); + (flag + 3) / 2, length); else - ND_PRINT((ndo, "%02x %02x %s seqid %04x " + ND_PRINT("%02x %02x %s seqid %04x " "(fragment %d) %d: ", EXTRACT_U_1(ap->arc_shost), EXTRACT_U_1(ap->arc_dhost), arctypename, seqid, - flag/2 + 1, length)); + flag/2 + 1, length); } /* @@ -191,7 +191,7 @@ arcnet_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch u_char arc_type; if (caplen < ARC_HDRLEN || length < ARC_HDRLEN) { - ND_PRINT((ndo, "[|arcnet]")); + ND_PRINT("[|arcnet]"); return (caplen); } @@ -213,7 +213,7 @@ arcnet_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch if (phds) { if (caplen < ARC_HDRNEWLEN || length < ARC_HDRNEWLEN) { arcnet_print(ndo, p, length, 0, 0, 0); - ND_PRINT((ndo, "[|phds]")); + ND_PRINT("[|phds]"); return (caplen); } @@ -221,7 +221,7 @@ arcnet_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch if (flag == 0xff) { if (caplen < ARC_HDRNEWLEN_EXC || length < ARC_HDRNEWLEN_EXC) { arcnet_print(ndo, p, length, 0, 0, 0); - ND_PRINT((ndo, "[|phds extended]")); + ND_PRINT("[|phds extended]"); return (caplen); } flag = EXTRACT_U_1(ap->arc_flag2); @@ -278,7 +278,7 @@ arcnet_linux_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, cons u_char arc_type; if (caplen < ARC_LINUX_HDRLEN || length < ARC_LINUX_HDRLEN) { - ND_PRINT((ndo, "[|arcnet]")); + ND_PRINT("[|arcnet]"); return (caplen); } @@ -289,7 +289,7 @@ arcnet_linux_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, cons default: archdrlen = ARC_LINUX_HDRNEWLEN; if (caplen < ARC_LINUX_HDRNEWLEN || length < ARC_LINUX_HDRNEWLEN) { - ND_PRINT((ndo, "[|arcnet]")); + ND_PRINT("[|arcnet]"); return (caplen); } break; @@ -347,7 +347,7 @@ arcnet_encap_print(netdissect_options *ndo, u_char arctype, const u_char *p, case ARCTYPE_ATALK: /* XXX was this ever used? */ if (ndo->ndo_vflag) - ND_PRINT((ndo, "et1 ")); + ND_PRINT("et1 "); atalk_print(ndo, p, length); return (1); diff --git a/print-arp.c b/print-arp.c index df53106e..897317dc 100644 --- a/print-arp.c +++ b/print-arp.c @@ -193,11 +193,11 @@ tpaddr_print_ip(netdissect_options *ndo, const struct arp_pkthdr *ap, u_short pro) { if (pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) - ND_PRINT((ndo, "<wrong proto type>")); + ND_PRINT("<wrong proto type>"); else if (PROTO_LEN(ap) != 4) - ND_PRINT((ndo, "<wrong len>")); + ND_PRINT("<wrong len>"); else - ND_PRINT((ndo, "%s", ipaddr_string(ndo, TPA(ap)))); + ND_PRINT("%s", ipaddr_string(ndo, TPA(ap))); } static void @@ -205,11 +205,11 @@ spaddr_print_ip(netdissect_options *ndo, const struct arp_pkthdr *ap, u_short pro) { if (pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) - ND_PRINT((ndo, "<wrong proto type>")); + ND_PRINT("<wrong proto type>"); else if (PROTO_LEN(ap) != 4) - ND_PRINT((ndo, "<wrong len>")); + ND_PRINT("<wrong len>"); else - ND_PRINT((ndo, "%s", ipaddr_string(ndo, SPA(ap)))); + ND_PRINT("%s", ipaddr_string(ndo, SPA(ap))); } static void @@ -218,12 +218,12 @@ atmarp_addr_print(netdissect_options *ndo, u_int srca_len) { if (ha_len == 0) - ND_PRINT((ndo, "<No address>")); + ND_PRINT("<No address>"); else { - ND_PRINT((ndo, "%s", linkaddr_string(ndo, ha, LINKADDR_ATM, ha_len))); + ND_PRINT("%s", linkaddr_string(ndo, ha, LINKADDR_ATM, ha_len)); if (srca_len != 0) - ND_PRINT((ndo, ",%s", - linkaddr_string(ndo, srca, LINKADDR_ATM, srca_len))); + ND_PRINT(",%s", + linkaddr_string(ndo, srca, LINKADDR_ATM, srca_len)); } } @@ -232,11 +232,11 @@ atmarp_tpaddr_print(netdissect_options *ndo, const struct atmarp_pkthdr *ap, u_short pro) { if (pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) - ND_PRINT((ndo, "<wrong proto type>")); + ND_PRINT("<wrong proto type>"); else if (ATMTPROTO_LEN(ap) != 4) - ND_PRINT((ndo, "<wrong tplen>")); + ND_PRINT("<wrong tplen>"); else - ND_PRINT((ndo, "%s", ipaddr_string(ndo, ATMTPA(ap)))); + ND_PRINT("%s", ipaddr_string(ndo, ATMTPA(ap))); } static void @@ -244,11 +244,11 @@ atmarp_spaddr_print(netdissect_options *ndo, const struct atmarp_pkthdr *ap, u_short pro) { if (pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) - ND_PRINT((ndo, "<wrong proto type>")); + ND_PRINT("<wrong proto type>"); else if (ATMSPROTO_LEN(ap) != 4) - ND_PRINT((ndo, "<wrong splen>")); + ND_PRINT("<wrong splen>"); else - ND_PRINT((ndo, "%s", ipaddr_string(ndo, ATMSPA(ap)))); + ND_PRINT("%s", ipaddr_string(ndo, ATMSPA(ap))); } static void @@ -266,24 +266,24 @@ atmarp_print(netdissect_options *ndo, op = ATMOP(ap); if (!ND_TTEST_LEN(aar_tpa(ap), ATMTPROTO_LEN(ap))) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); ND_DEFAULTPRINT((const u_char *)ap, length); return; } if (!ndo->ndo_eflag) { - ND_PRINT((ndo, "ARP, ")); + ND_PRINT("ARP, "); } if ((pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) || ATMSPROTO_LEN(ap) != 4 || ATMTPROTO_LEN(ap) != 4 || ndo->ndo_vflag) { - ND_PRINT((ndo, "%s, %s (len %u/%u)", + ND_PRINT("%s, %s (len %u/%u)", tok2str(arphrd_values, "Unknown Hardware (%u)", hrd), tok2str(ethertype_values, "Unknown Protocol (0x%04x)", pro), ATMSPROTO_LEN(ap), - ATMTPROTO_LEN(ap))); + ATMTPROTO_LEN(ap)); /* don't know know about the address formats */ if (!ndo->ndo_vflag) { @@ -292,37 +292,37 @@ atmarp_print(netdissect_options *ndo, } /* print operation */ - ND_PRINT((ndo, "%s%s ", + ND_PRINT("%s%s ", ndo->ndo_vflag ? ", " : "", - tok2str(arpop_values, "Unknown (%u)", op))); + tok2str(arpop_values, "Unknown (%u)", op)); switch (op) { case ARPOP_REQUEST: - ND_PRINT((ndo, "who-has ")); + ND_PRINT("who-has "); atmarp_tpaddr_print(ndo, ap, pro); if (ATMTHRD_LEN(ap) != 0) { - ND_PRINT((ndo, " (")); + ND_PRINT(" ("); atmarp_addr_print(ndo, ATMTHA(ap), ATMTHRD_LEN(ap), ATMTSA(ap), ATMTSLN(ap)); - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } - ND_PRINT((ndo, " tell ")); + ND_PRINT(" tell "); atmarp_spaddr_print(ndo, ap, pro); break; case ARPOP_REPLY: atmarp_spaddr_print(ndo, ap, pro); - ND_PRINT((ndo, " is-at ")); + ND_PRINT(" is-at "); atmarp_addr_print(ndo, ATMSHA(ap), ATMSHRD_LEN(ap), ATMSSA(ap), ATMSSLN(ap)); break; case ARPOP_INVREQUEST: - ND_PRINT((ndo, "who-is ")); + ND_PRINT("who-is "); atmarp_addr_print(ndo, ATMTHA(ap), ATMTHRD_LEN(ap), ATMTSA(ap), ATMTSLN(ap)); - ND_PRINT((ndo, " tell ")); + ND_PRINT(" tell "); atmarp_addr_print(ndo, ATMSHA(ap), ATMSHRD_LEN(ap), ATMSSA(ap), ATMSSLN(ap)); break; @@ -330,12 +330,12 @@ atmarp_print(netdissect_options *ndo, case ARPOP_INVREPLY: atmarp_addr_print(ndo, ATMSHA(ap), ATMSHRD_LEN(ap), ATMSSA(ap), ATMSSLN(ap)); - ND_PRINT((ndo, "at ")); + ND_PRINT("at "); atmarp_spaddr_print(ndo, ap, pro); break; case ARPOP_NAK: - ND_PRINT((ndo, "for ")); + ND_PRINT("for "); atmarp_spaddr_print(ndo, ap, pro); break; @@ -345,11 +345,11 @@ atmarp_print(netdissect_options *ndo, } out: - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT(", length %u", length); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -385,13 +385,13 @@ arp_print(netdissect_options *ndo, } if (!ND_TTEST_LEN(TPA(ap), PROTO_LEN(ap))) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); ND_DEFAULTPRINT((const u_char *)ap, length); return; } if (!ndo->ndo_eflag) { - ND_PRINT((ndo, "ARP, ")); + ND_PRINT("ARP, "); } /* print hardware type/len and proto type/len */ @@ -399,11 +399,11 @@ arp_print(netdissect_options *ndo, PROTO_LEN(ap) != 4 || HRD_LEN(ap) == 0 || ndo->ndo_vflag) { - ND_PRINT((ndo, "%s (len %u), %s (len %u)", + ND_PRINT("%s (len %u), %s (len %u)", tok2str(arphrd_values, "Unknown Hardware (%u)", hrd), HRD_LEN(ap), tok2str(ethertype_values, "Unknown Protocol (0x%04x)", pro), - PROTO_LEN(ap))); + PROTO_LEN(ap)); /* don't know know about the address formats */ if (!ndo->ndo_vflag) { @@ -412,49 +412,49 @@ arp_print(netdissect_options *ndo, } /* print operation */ - ND_PRINT((ndo, "%s%s ", + ND_PRINT("%s%s ", ndo->ndo_vflag ? ", " : "", - tok2str(arpop_values, "Unknown (%u)", op))); + tok2str(arpop_values, "Unknown (%u)", op)); switch (op) { case ARPOP_REQUEST: - ND_PRINT((ndo, "who-has ")); + ND_PRINT("who-has "); tpaddr_print_ip(ndo, ap, pro); if (isnonzero((const u_char *)THA(ap), HRD_LEN(ap))) - ND_PRINT((ndo, " (%s)", - linkaddr_string(ndo, THA(ap), linkaddr, HRD_LEN(ap)))); - ND_PRINT((ndo, " tell ")); + ND_PRINT(" (%s)", + linkaddr_string(ndo, THA(ap), linkaddr, HRD_LEN(ap))); + ND_PRINT(" tell "); spaddr_print_ip(ndo, ap, pro); break; case ARPOP_REPLY: spaddr_print_ip(ndo, ap, pro); - ND_PRINT((ndo, " is-at %s", - linkaddr_string(ndo, SHA(ap), linkaddr, HRD_LEN(ap)))); + ND_PRINT(" is-at %s", + linkaddr_string(ndo, SHA(ap), linkaddr, HRD_LEN(ap))); break; case ARPOP_REVREQUEST: - ND_PRINT((ndo, "who-is %s tell %s", + ND_PRINT("who-is %s tell %s", linkaddr_string(ndo, THA(ap), linkaddr, HRD_LEN(ap)), - linkaddr_string(ndo, SHA(ap), linkaddr, HRD_LEN(ap)))); + linkaddr_string(ndo, SHA(ap), linkaddr, HRD_LEN(ap))); break; case ARPOP_REVREPLY: - ND_PRINT((ndo, "%s at ", - linkaddr_string(ndo, THA(ap), linkaddr, HRD_LEN(ap)))); + ND_PRINT("%s at ", + linkaddr_string(ndo, THA(ap), linkaddr, HRD_LEN(ap))); tpaddr_print_ip(ndo, ap, pro); break; case ARPOP_INVREQUEST: - ND_PRINT((ndo, "who-is %s tell %s", + ND_PRINT("who-is %s tell %s", linkaddr_string(ndo, THA(ap), linkaddr, HRD_LEN(ap)), - linkaddr_string(ndo, SHA(ap), linkaddr, HRD_LEN(ap)))); + linkaddr_string(ndo, SHA(ap), linkaddr, HRD_LEN(ap))); break; case ARPOP_INVREPLY: - ND_PRINT((ndo,"%s at ", - linkaddr_string(ndo, SHA(ap), linkaddr, HRD_LEN(ap)))); + ND_PRINT("%s at ", + linkaddr_string(ndo, SHA(ap), linkaddr, HRD_LEN(ap))); spaddr_print_ip(ndo, ap, pro); break; @@ -464,11 +464,11 @@ arp_print(netdissect_options *ndo, } out: - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT(", length %u", length); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* diff --git a/print-ascii.c b/print-ascii.c index 14e50bd5..27ecc2e2 100644 --- a/print-ascii.c +++ b/print-ascii.c @@ -65,7 +65,7 @@ ascii_print(netdissect_options *ndo, caplength = (ndo->ndo_snapend >= cp) ? ndo->ndo_snapend - cp : 0; if (length > caplength) length = caplength; - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); while (length > 0) { s = EXTRACT_U_1(cp); cp++; @@ -81,13 +81,13 @@ ascii_print(netdissect_options *ndo, * In the middle of a line, just print a '.'. */ if (length > 1 && EXTRACT_U_1(cp) != '\n') - ND_PRINT((ndo, ".")); + ND_PRINT("."); } else { if (!ND_ISGRAPH(s) && (s != '\t' && s != ' ' && s != '\n')) - ND_PRINT((ndo, ".")); + ND_PRINT("."); else - ND_PRINT((ndo, "%c", s)); + ND_PRINT("%c", s); } } } @@ -120,9 +120,9 @@ hex_and_ascii_print_with_offset(netdissect_options *ndo, const char *ident, i++; if (i >= HEXDUMP_SHORTS_PER_LINE) { *hsp = *asp = '\0'; - ND_PRINT((ndo, "%s0x%04x: %-*s %s", + ND_PRINT("%s0x%04x: %-*s %s", ident, oset, HEXDUMP_HEXSTUFF_PER_LINE, - hexstuff, asciistuff)); + hexstuff, asciistuff); i = 0; hsp = hexstuff; asp = asciistuff; oset += HEXDUMP_BYTES_PER_LINE; } @@ -137,9 +137,9 @@ hex_and_ascii_print_with_offset(netdissect_options *ndo, const char *ident, } if (i > 0) { *hsp = *asp = '\0'; - ND_PRINT((ndo, "%s0x%04x: %-*s %s", + ND_PRINT("%s0x%04x: %-*s %s", ident, oset, HEXDUMP_HEXSTUFF_PER_LINE, - hexstuff, asciistuff)); + hexstuff, asciistuff); } } @@ -169,16 +169,16 @@ hex_print_with_offset(netdissect_options *ndo, i = 0; while (--nshorts >= 0) { if ((i++ % 8) == 0) { - ND_PRINT((ndo,"%s0x%04x: ", ident, oset)); + ND_PRINT("%s0x%04x: ", ident, oset); oset += HEXDUMP_BYTES_PER_LINE; } s = *cp++; - ND_PRINT((ndo," %02x%02x", s, *cp++)); + ND_PRINT(" %02x%02x", s, *cp++); } if (length & 1) { if ((i % 8) == 0) - ND_PRINT((ndo,"%s0x%04x: ", ident, oset)); - ND_PRINT((ndo," %02x", *cp)); + ND_PRINT("%s0x%04x: ", ident, oset); + ND_PRINT(" %02x", *cp); } } diff --git a/print-atalk.c b/print-atalk.c index 5993a858..4f346f25 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -101,11 +101,11 @@ llap_print(netdissect_options *ndo, u_int hdrlen; if (length < sizeof(*lp)) { - ND_PRINT((ndo, " [|llap %u]", length)); + ND_PRINT(" [|llap %u]", length); return (length); } if (!ND_TTEST_LEN(bp, sizeof(*lp))) { - ND_PRINT((ndo, " [|llap]")); + ND_PRINT(" [|llap]"); return (0); /* cut short by the snapshot length */ } lp = (const struct LAP *)bp; @@ -116,18 +116,18 @@ llap_print(netdissect_options *ndo, case lapShortDDP: if (length < ddpSSize) { - ND_PRINT((ndo, " [|sddp %u]", length)); + ND_PRINT(" [|sddp %u]", length); return (length); } if (!ND_TTEST_LEN(bp, ddpSSize)) { - ND_PRINT((ndo, " [|sddp]")); + ND_PRINT(" [|sddp]"); return (0); /* cut short by the snapshot length */ } sdp = (const struct atShortDDP *)bp; - ND_PRINT((ndo, "%s.%s", - ataddr_string(ndo, 0, EXTRACT_U_1(lp->src)), ddpskt_string(ndo, EXTRACT_U_1(sdp->srcSkt)))); - ND_PRINT((ndo, " > %s.%s:", - ataddr_string(ndo, 0, EXTRACT_U_1(lp->dst)), ddpskt_string(ndo, EXTRACT_U_1(sdp->dstSkt)))); + ND_PRINT("%s.%s", + ataddr_string(ndo, 0, EXTRACT_U_1(lp->src)), ddpskt_string(ndo, EXTRACT_U_1(sdp->srcSkt))); + ND_PRINT(" > %s.%s:", + ataddr_string(ndo, 0, EXTRACT_U_1(lp->dst)), ddpskt_string(ndo, EXTRACT_U_1(sdp->dstSkt))); bp += ddpSSize; length -= ddpSSize; hdrlen += ddpSSize; @@ -136,20 +136,20 @@ llap_print(netdissect_options *ndo, case lapDDP: if (length < ddpSize) { - ND_PRINT((ndo, " [|ddp %u]", length)); + ND_PRINT(" [|ddp %u]", length); return (length); } if (!ND_TTEST_LEN(bp, ddpSize)) { - ND_PRINT((ndo, " [|ddp]")); + ND_PRINT(" [|ddp]"); return (0); /* cut short by the snapshot length */ } dp = (const struct atDDP *)bp; snet = EXTRACT_BE_U_2(dp->srcNet); - ND_PRINT((ndo, "%s.%s", ataddr_string(ndo, snet, EXTRACT_U_1(dp->srcNode)), - ddpskt_string(ndo, EXTRACT_U_1(dp->srcSkt)))); - ND_PRINT((ndo, " > %s.%s:", + ND_PRINT("%s.%s", ataddr_string(ndo, snet, EXTRACT_U_1(dp->srcNode)), + ddpskt_string(ndo, EXTRACT_U_1(dp->srcSkt))); + ND_PRINT(" > %s.%s:", ataddr_string(ndo, EXTRACT_BE_U_2(dp->dstNet), EXTRACT_U_1(dp->dstNode)), - ddpskt_string(ndo, EXTRACT_U_1(dp->dstSkt)))); + ddpskt_string(ndo, EXTRACT_U_1(dp->dstSkt))); bp += ddpSize; length -= ddpSize; hdrlen += ddpSize; @@ -163,8 +163,8 @@ llap_print(netdissect_options *ndo, #endif default: - ND_PRINT((ndo, "%u > %u at-lap#%u %u", - EXTRACT_U_1(lp->src), EXTRACT_U_1(lp->dst), EXTRACT_U_1(lp->type), length)); + ND_PRINT("%u > %u at-lap#%u %u", + EXTRACT_U_1(lp->src), EXTRACT_U_1(lp->dst), EXTRACT_U_1(lp->type), length); break; } return (hdrlen); @@ -183,23 +183,23 @@ atalk_print(netdissect_options *ndo, u_short snet; if(!ndo->ndo_eflag) - ND_PRINT((ndo, "AT ")); + ND_PRINT("AT "); if (length < ddpSize) { - ND_PRINT((ndo, " [|ddp %u]", length)); + ND_PRINT(" [|ddp %u]", length); return; } if (!ND_TTEST_LEN(bp, ddpSize)) { - ND_PRINT((ndo, " [|ddp]")); + ND_PRINT(" [|ddp]"); return; } dp = (const struct atDDP *)bp; snet = EXTRACT_BE_U_2(dp->srcNet); - ND_PRINT((ndo, "%s.%s", ataddr_string(ndo, snet, EXTRACT_U_1(dp->srcNode)), - ddpskt_string(ndo, EXTRACT_U_1(dp->srcSkt)))); - ND_PRINT((ndo, " > %s.%s: ", + ND_PRINT("%s.%s", ataddr_string(ndo, snet, EXTRACT_U_1(dp->srcNode)), + ddpskt_string(ndo, EXTRACT_U_1(dp->srcSkt))); + ND_PRINT(" > %s.%s: ", ataddr_string(ndo, EXTRACT_BE_U_2(dp->dstNet), EXTRACT_U_1(dp->dstNode)), - ddpskt_string(ndo, EXTRACT_U_1(dp->dstSkt)))); + ddpskt_string(ndo, EXTRACT_U_1(dp->dstSkt))); bp += ddpSize; length -= ddpSize; ddp_print(ndo, bp, length, EXTRACT_U_1(dp->type), snet, EXTRACT_U_1(dp->srcNode), EXTRACT_U_1(dp->srcSkt)); @@ -214,15 +214,15 @@ aarp_print(netdissect_options *ndo, #define AT(member) ataddr_string(ndo, (ap->member[1]<<8)|ap->member[2],ap->member[3]) - ND_PRINT((ndo, "aarp ")); + ND_PRINT("aarp "); ap = (const struct aarp *)bp; if (!ND_TTEST_SIZE(ap)) { /* Just bail if we don't have the whole chunk. */ - ND_PRINT((ndo, " [|aarp]")); + ND_PRINT(" [|aarp]"); return; } if (length < sizeof(*ap)) { - ND_PRINT((ndo, " [|aarp %u]", length)); + ND_PRINT(" [|aarp %u]", length); return; } if (EXTRACT_BE_U_2(ap->htype) == 1 && @@ -231,20 +231,20 @@ aarp_print(netdissect_options *ndo, switch (EXTRACT_BE_U_2(ap->op)) { case 1: /* request */ - ND_PRINT((ndo, "who-has %s tell %s", AT(pdaddr), AT(psaddr))); + ND_PRINT("who-has %s tell %s", AT(pdaddr), AT(psaddr)); return; case 2: /* response */ - ND_PRINT((ndo, "reply %s is-at %s", AT(psaddr), etheraddr_string(ndo, ap->hsaddr))); + ND_PRINT("reply %s is-at %s", AT(psaddr), etheraddr_string(ndo, ap->hsaddr)); return; case 3: /* probe (oy!) */ - ND_PRINT((ndo, "probe %s tell %s", AT(pdaddr), AT(psaddr))); + ND_PRINT("probe %s tell %s", AT(pdaddr), AT(psaddr)); return; } - ND_PRINT((ndo, "len %u op %u htype %u ptype %#x halen %u palen %u", + ND_PRINT("len %u op %u htype %u ptype %#x halen %u palen %u", length, EXTRACT_BE_U_2(ap->op), EXTRACT_BE_U_2(ap->htype), - EXTRACT_BE_U_2(ap->ptype), EXTRACT_U_1(ap->halen), EXTRACT_U_1(ap->palen))); + EXTRACT_BE_U_2(ap->ptype), EXTRACT_U_1(ap->halen), EXTRACT_U_1(ap->palen)); } /* @@ -271,7 +271,7 @@ ddp_print(netdissect_options *ndo, break; default: - ND_PRINT((ndo, " at-%s %d", tok2str(type2str, NULL, t), length)); + ND_PRINT(" at-%s %d", tok2str(type2str, NULL, t), length); break; } } @@ -285,11 +285,11 @@ atp_print(netdissect_options *ndo, if ((const u_char *)(ap + 1) > ndo->ndo_snapend) { /* Just bail if we don't have the whole chunk. */ - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } if (length < sizeof(*ap)) { - ND_PRINT((ndo, " [|atp %u]", length)); + ND_PRINT(" [|atp %u]", length); return; } length -= sizeof(*ap); @@ -297,80 +297,80 @@ atp_print(netdissect_options *ndo, switch (control & 0xc0) { case atpReqCode: - ND_PRINT((ndo, " atp-req%s %u", + ND_PRINT(" atp-req%s %u", control & atpXO? " " : "*", - EXTRACT_BE_U_2(ap->transID))); + EXTRACT_BE_U_2(ap->transID)); atp_bitmap_print(ndo, EXTRACT_U_1(ap->bitmap)); if (length != 0) - ND_PRINT((ndo, " [len=%u]", length)); + ND_PRINT(" [len=%u]", length); switch (control & (atpEOM|atpSTS)) { case atpEOM: - ND_PRINT((ndo, " [EOM]")); + ND_PRINT(" [EOM]"); break; case atpSTS: - ND_PRINT((ndo, " [STS]")); + ND_PRINT(" [STS]"); break; case atpEOM|atpSTS: - ND_PRINT((ndo, " [EOM,STS]")); + ND_PRINT(" [EOM,STS]"); break; } break; case atpRspCode: - ND_PRINT((ndo, " atp-resp%s%d:%u (%u)", + ND_PRINT(" atp-resp%s%d:%u (%u)", control & atpEOM? "*" : " ", - EXTRACT_BE_U_2(ap->transID), EXTRACT_U_1(ap->bitmap), length)); + EXTRACT_BE_U_2(ap->transID), EXTRACT_U_1(ap->bitmap), length); switch (control & (atpXO|atpSTS)) { case atpXO: - ND_PRINT((ndo, " [XO]")); + ND_PRINT(" [XO]"); break; case atpSTS: - ND_PRINT((ndo, " [STS]")); + ND_PRINT(" [STS]"); break; case atpXO|atpSTS: - ND_PRINT((ndo, " [XO,STS]")); + ND_PRINT(" [XO,STS]"); break; } break; case atpRelCode: - ND_PRINT((ndo, " atp-rel %u", EXTRACT_BE_U_2(ap->transID))); + ND_PRINT(" atp-rel %u", EXTRACT_BE_U_2(ap->transID)); atp_bitmap_print(ndo, EXTRACT_U_1(ap->bitmap)); /* length should be zero */ if (length) - ND_PRINT((ndo, " [len=%u]", length)); + ND_PRINT(" [len=%u]", length); /* there shouldn't be any control flags */ if (control & (atpXO|atpEOM|atpSTS)) { char c = '['; if (control & atpXO) { - ND_PRINT((ndo, "%cXO", c)); + ND_PRINT("%cXO", c); c = ','; } if (control & atpEOM) { - ND_PRINT((ndo, "%cEOM", c)); + ND_PRINT("%cEOM", c); c = ','; } if (control & atpSTS) { - ND_PRINT((ndo, "%cSTS", c)); + ND_PRINT("%cSTS", c); } - ND_PRINT((ndo, "]")); + ND_PRINT("]"); } break; default: - ND_PRINT((ndo, " atp-0x%x %d (%u)", control, - EXTRACT_BE_U_2(ap->transID), length)); + ND_PRINT(" atp-0x%x %d (%u)", control, + EXTRACT_BE_U_2(ap->transID), length); break; } data = EXTRACT_BE_U_4(ap->userData); if (data != 0) - ND_PRINT((ndo, " 0x%x", data)); + ND_PRINT(" 0x%x", data); } static void @@ -388,19 +388,19 @@ atp_bitmap_print(netdissect_options *ndo, char c = '<'; for (i = 0; bm; ++i) { if (bm & 1) { - ND_PRINT((ndo, "%c%d", c, i)); + ND_PRINT("%c%d", c, i); c = ','; } bm >>= 1; } - ND_PRINT((ndo, ">")); + ND_PRINT(">"); } else { for (i = 0; bm; ++i) bm >>= 1; if (i > 1) - ND_PRINT((ndo, "<0-%d>", i - 1)); + ND_PRINT("<0-%d>", i - 1); else - ND_PRINT((ndo, "<0>")); + ND_PRINT("<0>"); } } @@ -416,20 +416,20 @@ nbp_print(netdissect_options *ndo, const u_char *ep; if (length < nbpHeaderSize) { - ND_PRINT((ndo, " truncated-nbp %u", length)); + ND_PRINT(" truncated-nbp %u", length); return; } length -= nbpHeaderSize; if (length < 8) { /* must be room for at least one tuple */ - ND_PRINT((ndo, " truncated-nbp %u", length + nbpHeaderSize)); + ND_PRINT(" truncated-nbp %u", length + nbpHeaderSize); return; } /* ep points to end of available data */ ep = ndo->ndo_snapend; if ((const u_char *)tp > ep) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } control = EXTRACT_U_1(np->control); @@ -437,9 +437,9 @@ nbp_print(netdissect_options *ndo, case nbpBrRq: case nbpLkUp: - ND_PRINT((ndo, i == nbpLkUp? " nbp-lkup %u:":" nbp-brRq %u:", EXTRACT_U_1(np->id))); + ND_PRINT(i == nbpLkUp? " nbp-lkup %u:":" nbp-brRq %u:", EXTRACT_U_1(np->id)); if ((const u_char *)(tp + 1) > ep) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } (void)nbp_name_print(ndo, tp, ep); @@ -449,20 +449,20 @@ nbp_print(netdissect_options *ndo, * address and the enumerator should be zero. */ if ((control & 0xf) != 1) - ND_PRINT((ndo, " [ntup=%u]", control & 0xf)); + ND_PRINT(" [ntup=%u]", control & 0xf); if (EXTRACT_U_1(tp->enumerator)) - ND_PRINT((ndo, " [enum=%u]", EXTRACT_U_1(tp->enumerator))); + ND_PRINT(" [enum=%u]", EXTRACT_U_1(tp->enumerator)); if (EXTRACT_BE_U_2(tp->net) != snet || EXTRACT_U_1(tp->node) != snode || EXTRACT_U_1(tp->skt) != skt) - ND_PRINT((ndo, " [addr=%s.%d]", + ND_PRINT(" [addr=%s.%d]", ataddr_string(ndo, EXTRACT_BE_U_2(tp->net), EXTRACT_U_1(tp->node)), - EXTRACT_U_1(tp->skt))); + EXTRACT_U_1(tp->skt)); break; case nbpLkUpReply: - ND_PRINT((ndo, " nbp-reply %u:", EXTRACT_U_1(np->id))); + ND_PRINT(" nbp-reply %u:", EXTRACT_U_1(np->id)); /* print each of the tuples in the reply */ for (i = control & 0xf; --i >= 0 && tp; ) @@ -470,7 +470,7 @@ nbp_print(netdissect_options *ndo, break; default: - ND_PRINT((ndo, " nbp-0x%x %u (%u)", control, EXTRACT_U_1(np->id), length)); + ND_PRINT(" nbp-0x%x %u (%u)", control, EXTRACT_U_1(np->id), length); break; } } @@ -483,7 +483,7 @@ print_cstring(netdissect_options *ndo, u_int length; if (cp >= (const char *)ep) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (0); } length = EXTRACT_U_1(cp); @@ -491,15 +491,15 @@ print_cstring(netdissect_options *ndo, /* Spec says string can be at most 32 bytes long */ if (length > 32) { - ND_PRINT((ndo, "[len=%u]", length)); + ND_PRINT("[len=%u]", length); return (0); } while (length != 0) { if (cp >= (const char *)ep) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (0); } - ND_PRINT((ndo, "%c", EXTRACT_U_1(cp))); + ND_PRINT("%c", EXTRACT_U_1(cp)); cp++; length--; } @@ -514,24 +514,24 @@ nbp_tuple_print(netdissect_options *ndo, const struct atNBPtuple *tpn; if ((const u_char *)(tp + 1) > ep) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return 0; } tpn = nbp_name_print(ndo, tp, ep); /* if the enumerator isn't 1, print it */ if (EXTRACT_U_1(tp->enumerator) != 1) - ND_PRINT((ndo, "(%u)", EXTRACT_U_1(tp->enumerator))); + ND_PRINT("(%u)", EXTRACT_U_1(tp->enumerator)); /* if the socket doesn't match the src socket, print it */ if (EXTRACT_U_1(tp->skt) != skt) - ND_PRINT((ndo, " %u", EXTRACT_U_1(tp->skt))); + ND_PRINT(" %u", EXTRACT_U_1(tp->skt)); /* if the address doesn't match the src address, it's an anomaly */ if (EXTRACT_BE_U_2(tp->net) != snet || EXTRACT_U_1(tp->node) != snode) - ND_PRINT((ndo, " [addr=%s]", - ataddr_string(ndo, EXTRACT_BE_U_2(tp->net), EXTRACT_U_1(tp->node)))); + ND_PRINT(" [addr=%s]", + ataddr_string(ndo, EXTRACT_BE_U_2(tp->net), EXTRACT_U_1(tp->node))); return (tpn); } @@ -542,18 +542,18 @@ nbp_name_print(netdissect_options *ndo, { const char *cp = (const char *)tp + nbpTupleSize; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* Object */ - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); if ((cp = print_cstring(ndo, cp, ep)) != NULL) { /* Type */ - ND_PRINT((ndo, ":")); + ND_PRINT(":"); if ((cp = print_cstring(ndo, cp, ep)) != NULL) { /* Zone */ - ND_PRINT((ndo, "@")); + ND_PRINT("@"); if ((cp = print_cstring(ndo, cp, ep)) != NULL) - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); } } return ((const struct atNBPtuple *)cp); diff --git a/print-atm.c b/print-atm.c index 3a828df1..d93fec65 100644 --- a/print-atm.c +++ b/print-atm.c @@ -254,14 +254,14 @@ atm_if_print(netdissect_options *ndo, u_int hdrlen = 0; if (caplen < 1 || length < 1) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (caplen); } /* Cisco Style NLPID ? */ if (EXTRACT_U_1(p) == LLC_UI) { if (ndo->ndo_eflag) - ND_PRINT((ndo, "CNLPID ")); + ND_PRINT("CNLPID "); isoclns_print(ndo, p + 1, length - 1); return hdrlen; } @@ -271,7 +271,7 @@ atm_if_print(netdissect_options *ndo, * control field. */ if (caplen < 3 || length < 3) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (caplen); } @@ -303,15 +303,15 @@ atm_if_print(netdissect_options *ndo, * new DLT_IEEE802_6 value if we added it? */ if (caplen < 20 || length < 20) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (caplen); } if (ndo->ndo_eflag) - ND_PRINT((ndo, "%08x%08x %08x%08x ", + ND_PRINT("%08x%08x %08x%08x ", EXTRACT_BE_U_4(p), EXTRACT_BE_U_4(p + 4), EXTRACT_BE_U_4(p + 8), - EXTRACT_BE_U_4(p + 12))); + EXTRACT_BE_U_4(p + 12)); p += 20; length -= 20; caplen -= 20; @@ -355,10 +355,10 @@ sig_print(netdissect_options *ndo, * protocol:Q.2931 for User to Network Interface * (UNI 3.1) signalling */ - ND_PRINT((ndo, "Q.2931")); + ND_PRINT("Q.2931"); ND_TCHECK_1(p + MSG_TYPE_POS); - ND_PRINT((ndo, ":%s ", - tok2str(msgtype2str, "msgtype#%d", EXTRACT_U_1(p + MSG_TYPE_POS)))); + ND_PRINT(":%s ", + tok2str(msgtype2str, "msgtype#%d", EXTRACT_U_1(p + MSG_TYPE_POS))); /* * The call reference comes before the message type, @@ -367,15 +367,15 @@ sig_print(netdissect_options *ndo, * the call reference. */ call_ref = EXTRACT_BE_U_3(p + CALL_REF_POS); - ND_PRINT((ndo, "CALL_REF:0x%06x", call_ref)); + ND_PRINT("CALL_REF:0x%06x", call_ref); } else { /* SSCOP with some unknown protocol atop it */ - ND_PRINT((ndo, "SSCOP, proto %d ", EXTRACT_U_1(p + PROTO_POS))); + ND_PRINT("SSCOP, proto %d ", EXTRACT_U_1(p + PROTO_POS)); } return; trunc: - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); } /* @@ -387,7 +387,7 @@ atm_print(netdissect_options *ndo, u_int caplen) { if (ndo->ndo_eflag) - ND_PRINT((ndo, "VPI:%u VCI:%u ", vpi, vci)); + ND_PRINT("VPI:%u VCI:%u ", vpi, vci); if (vpi == 0) { switch (vci) { @@ -397,7 +397,7 @@ atm_print(netdissect_options *ndo, return; case VCI_BCC: - ND_PRINT((ndo, "broadcast sig: ")); + ND_PRINT("broadcast sig: "); return; case VCI_OAMF4SC: /* fall through */ @@ -406,11 +406,11 @@ atm_print(netdissect_options *ndo, return; case VCI_METAC: - ND_PRINT((ndo, "meta: ")); + ND_PRINT("meta: "); return; case VCI_ILMIC: - ND_PRINT((ndo, "ilmi: ")); + ND_PRINT("ilmi: "); snmp_print(ndo, p, length); return; } @@ -470,26 +470,26 @@ oam_print (netdissect_options *ndo, payload = (cell_header>>1)&0x7; clp = cell_header&0x1; - ND_PRINT((ndo, "%s, vpi %u, vci %u, payload [ %s ], clp %u, length %u", + ND_PRINT("%s, vpi %u, vci %u, payload [ %s ], clp %u, length %u", tok2str(oam_f_values, "OAM F5", vci), vpi, vci, tok2str(atm_pty_values, "Unknown", payload), - clp, length)); + clp, length); if (!ndo->ndo_vflag) { return; } - ND_PRINT((ndo, "\n\tcell-type %s (%u)", + ND_PRINT("\n\tcell-type %s (%u)", tok2str(oam_celltype_values, "unknown", cell_type), - cell_type)); + cell_type); if (oam_functype_values[cell_type] == NULL) - ND_PRINT((ndo, ", func-type unknown (%u)", func_type)); + ND_PRINT(", func-type unknown (%u)", func_type); else - ND_PRINT((ndo, ", func-type %s (%u)", + ND_PRINT(", func-type %s (%u)", tok2str(oam_functype_values[cell_type],"none",func_type), - func_type)); + func_type); p += ATM_HDR_LEN_NOHEC + hec; @@ -497,21 +497,21 @@ oam_print (netdissect_options *ndo, case (OAM_CELLTYPE_FM << 4 | OAM_FM_FUNCTYPE_LOOPBACK): oam_ptr.oam_fm_loopback = (const struct oam_fm_loopback_t *)(p + OAM_CELLTYPE_FUNCTYPE_LEN); ND_TCHECK_SIZE(oam_ptr.oam_fm_loopback); - ND_PRINT((ndo, "\n\tLoopback-Indicator %s, Correlation-Tag 0x%08x", + ND_PRINT("\n\tLoopback-Indicator %s, Correlation-Tag 0x%08x", tok2str(oam_fm_loopback_indicator_values, "Unknown", EXTRACT_U_1(oam_ptr.oam_fm_loopback->loopback_indicator) & OAM_FM_LOOPBACK_INDICATOR_MASK), - EXTRACT_BE_U_4(oam_ptr.oam_fm_loopback->correlation_tag))); - ND_PRINT((ndo, "\n\tLocation-ID ")); + EXTRACT_BE_U_4(oam_ptr.oam_fm_loopback->correlation_tag)); + ND_PRINT("\n\tLocation-ID "); for (idx = 0; idx < sizeof(oam_ptr.oam_fm_loopback->loopback_id); idx++) { if (idx % 2) { - ND_PRINT((ndo, "%04x ", EXTRACT_BE_U_2(&oam_ptr.oam_fm_loopback->loopback_id[idx]))); + ND_PRINT("%04x ", EXTRACT_BE_U_2(&oam_ptr.oam_fm_loopback->loopback_id[idx])); } } - ND_PRINT((ndo, "\n\tSource-ID ")); + ND_PRINT("\n\tSource-ID "); for (idx = 0; idx < sizeof(oam_ptr.oam_fm_loopback->source_id); idx++) { if (idx % 2) { - ND_PRINT((ndo, "%04x ", EXTRACT_BE_U_2(&oam_ptr.oam_fm_loopback->source_id[idx]))); + ND_PRINT("%04x ", EXTRACT_BE_U_2(&oam_ptr.oam_fm_loopback->source_id[idx])); } } break; @@ -520,11 +520,11 @@ oam_print (netdissect_options *ndo, case (OAM_CELLTYPE_FM << 4 | OAM_FM_FUNCTYPE_RDI): oam_ptr.oam_fm_ais_rdi = (const struct oam_fm_ais_rdi_t *)(p + OAM_CELLTYPE_FUNCTYPE_LEN); ND_TCHECK_SIZE(oam_ptr.oam_fm_ais_rdi); - ND_PRINT((ndo, "\n\tFailure-type 0x%02x", EXTRACT_U_1(oam_ptr.oam_fm_ais_rdi->failure_type))); - ND_PRINT((ndo, "\n\tLocation-ID ")); + ND_PRINT("\n\tFailure-type 0x%02x", EXTRACT_U_1(oam_ptr.oam_fm_ais_rdi->failure_type)); + ND_PRINT("\n\tLocation-ID "); for (idx = 0; idx < sizeof(oam_ptr.oam_fm_ais_rdi->failure_location); idx++) { if (idx % 2) { - ND_PRINT((ndo, "%04x ", EXTRACT_BE_U_2(&oam_ptr.oam_fm_ais_rdi->failure_location[idx]))); + ND_PRINT("%04x ", EXTRACT_BE_U_2(&oam_ptr.oam_fm_ais_rdi->failure_location[idx])); } } break; @@ -543,13 +543,13 @@ oam_print (netdissect_options *ndo, & OAM_CRC10_MASK; cksum_shouldbe = verify_crc10_cksum(0, p, OAM_PAYLOAD_LEN); - ND_PRINT((ndo, "\n\tcksum 0x%03x (%scorrect)", + ND_PRINT("\n\tcksum 0x%03x (%scorrect)", cksum, - cksum_shouldbe == 0 ? "" : "in")); + cksum_shouldbe == 0 ? "" : "in"); return; trunc: - ND_PRINT((ndo, "[|oam]")); + ND_PRINT("[|oam]"); return; } diff --git a/print-babel.c b/print-babel.c index 3f0166d1..1549432a 100644 --- a/print-babel.c +++ b/print-babel.c @@ -49,15 +49,15 @@ void babel_print(netdissect_options *ndo, const u_char *cp, u_int length) { - ND_PRINT((ndo, "babel")); + ND_PRINT("babel"); ND_TCHECK_4(cp); if(EXTRACT_U_1(cp) != 42) { - ND_PRINT((ndo, " invalid header")); + ND_PRINT(" invalid header"); return; } else { - ND_PRINT((ndo, " %d", EXTRACT_U_1(cp + 1))); + ND_PRINT(" %d", EXTRACT_U_1(cp + 1)); } switch(EXTRACT_U_1(cp + 1)) { @@ -65,14 +65,14 @@ babel_print(netdissect_options *ndo, babel_print_v2(ndo, cp, length); break; default: - ND_PRINT((ndo, " unknown version")); + ND_PRINT(" unknown version"); break; } return; trunc: - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); return; } @@ -279,7 +279,7 @@ subtlvs_print(netdissect_options *ndo, subtype = EXTRACT_U_1(cp); cp++; if(subtype == MESSAGE_SUB_PAD1) { - ND_PRINT((ndo, " sub-pad1")); + ND_PRINT(" sub-pad1"); continue; } if(cp == ep) @@ -291,52 +291,52 @@ subtlvs_print(netdissect_options *ndo, switch(subtype) { case MESSAGE_SUB_PADN: - ND_PRINT((ndo, " sub-padn")); + ND_PRINT(" sub-padn"); cp += sublen; break; case MESSAGE_SUB_DIVERSITY: - ND_PRINT((ndo, " sub-diversity")); + ND_PRINT(" sub-diversity"); if (sublen == 0) { - ND_PRINT((ndo, " empty")); + ND_PRINT(" empty"); break; } sep = " "; while(sublen--) { - ND_PRINT((ndo, "%s%s", sep, tok2str(diversity_str, "%u", EXTRACT_U_1(cp)))); + ND_PRINT("%s%s", sep, tok2str(diversity_str, "%u", EXTRACT_U_1(cp))); cp++; sep = "-"; } if(tlv_type != MESSAGE_UPDATE && tlv_type != MESSAGE_UPDATE_SRC_SPECIFIC) - ND_PRINT((ndo, " (bogus)")); + ND_PRINT(" (bogus)"); break; case MESSAGE_SUB_TIMESTAMP: - ND_PRINT((ndo, " sub-timestamp")); + ND_PRINT(" sub-timestamp"); if(tlv_type == MESSAGE_HELLO) { if(sublen < 4) goto invalid; t1 = EXTRACT_BE_U_4(cp); - ND_PRINT((ndo, " %s", format_timestamp(t1))); + ND_PRINT(" %s", format_timestamp(t1)); } else if(tlv_type == MESSAGE_IHU) { if(sublen < 8) goto invalid; t1 = EXTRACT_BE_U_4(cp); - ND_PRINT((ndo, " %s", format_timestamp(t1))); + ND_PRINT(" %s", format_timestamp(t1)); t2 = EXTRACT_BE_U_4(cp + 4); - ND_PRINT((ndo, "|%s", format_timestamp(t2))); + ND_PRINT("|%s", format_timestamp(t2)); } else - ND_PRINT((ndo, " (bogus)")); + ND_PRINT(" (bogus)"); cp += sublen; break; default: - ND_PRINT((ndo, " sub-unknown-0x%02x", subtype)); + ND_PRINT(" sub-unknown-0x%02x", subtype); cp += sublen; } /* switch */ } /* while */ return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); } #define ICHECK(i, l) \ @@ -356,7 +356,7 @@ babel_print_v2(netdissect_options *ndo, if (length < 4) goto invalid; bodylen = EXTRACT_BE_U_2(cp + 2); - ND_PRINT((ndo, " (%u)", bodylen)); + ND_PRINT(" (%u)", bodylen); /* Process the TLVs in the body */ i = 0; @@ -368,7 +368,7 @@ babel_print_v2(netdissect_options *ndo, ND_TCHECK_1(message); if((type = EXTRACT_U_1(message)) == MESSAGE_PAD1) { - ND_PRINT((ndo, ndo->ndo_vflag ? "\n\tPad 1" : " pad1")); + ND_PRINT(ndo->ndo_vflag ? "\n\tPad 1" : " pad1"); i += 1; continue; } @@ -383,22 +383,22 @@ babel_print_v2(netdissect_options *ndo, switch(type) { case MESSAGE_PADN: { if (!ndo->ndo_vflag) - ND_PRINT((ndo, " padN")); + ND_PRINT(" padN"); else - ND_PRINT((ndo, "\n\tPad %d", len + 2)); + ND_PRINT("\n\tPad %d", len + 2); } break; case MESSAGE_ACK_REQ: { u_short nonce, interval; if (!ndo->ndo_vflag) - ND_PRINT((ndo, " ack-req")); + ND_PRINT(" ack-req"); else { - ND_PRINT((ndo, "\n\tAcknowledgment Request ")); + ND_PRINT("\n\tAcknowledgment Request "); if(len < 6) goto invalid; nonce = EXTRACT_BE_U_2(message + 4); interval = EXTRACT_BE_U_2(message + 6); - ND_PRINT((ndo, "%04x %s", nonce, format_interval(interval))); + ND_PRINT("%04x %s", nonce, format_interval(interval)); } } break; @@ -406,12 +406,12 @@ babel_print_v2(netdissect_options *ndo, case MESSAGE_ACK: { u_short nonce; if (!ndo->ndo_vflag) - ND_PRINT((ndo, " ack")); + ND_PRINT(" ack"); else { - ND_PRINT((ndo, "\n\tAcknowledgment ")); + ND_PRINT("\n\tAcknowledgment "); if(len < 2) goto invalid; nonce = EXTRACT_BE_U_2(message + 2); - ND_PRINT((ndo, "%04x", nonce)); + ND_PRINT("%04x", nonce); } } break; @@ -419,13 +419,13 @@ babel_print_v2(netdissect_options *ndo, case MESSAGE_HELLO: { u_short seqno, interval; if (!ndo->ndo_vflag) - ND_PRINT((ndo, " hello")); + ND_PRINT(" hello"); else { - ND_PRINT((ndo, "\n\tHello ")); + ND_PRINT("\n\tHello "); if(len < 6) goto invalid; seqno = EXTRACT_BE_U_2(message + 4); interval = EXTRACT_BE_U_2(message + 6); - ND_PRINT((ndo, "seqno %u interval %s", seqno, format_interval(interval))); + ND_PRINT("seqno %u interval %s", seqno, format_interval(interval)); /* Extra data. */ if(len > 6) subtlvs_print(ndo, message + 8, message + 2 + len, type); @@ -436,19 +436,19 @@ babel_print_v2(netdissect_options *ndo, case MESSAGE_IHU: { unsigned short txcost, interval; if (!ndo->ndo_vflag) - ND_PRINT((ndo, " ihu")); + ND_PRINT(" ihu"); else { u_char address[16]; int rc; - ND_PRINT((ndo, "\n\tIHU ")); + ND_PRINT("\n\tIHU "); if(len < 6) goto invalid; txcost = EXTRACT_BE_U_2(message + 4); interval = EXTRACT_BE_U_2(message + 6); rc = network_address(EXTRACT_U_1(message + 2), message + 8, len - 6, address); - if(rc < 0) { ND_PRINT((ndo, "%s", tstr)); break; } - ND_PRINT((ndo, "%s txcost %u interval %s", - format_address(ndo, address), txcost, format_interval(interval))); + if(rc < 0) { ND_PRINT("%s", tstr); break; } + ND_PRINT("%s txcost %u interval %s", + format_address(ndo, address), txcost, format_interval(interval)); /* Extra data. */ if((u_int)rc < len - 6) subtlvs_print(ndo, message + 8 + rc, message + 2 + len, @@ -459,47 +459,47 @@ babel_print_v2(netdissect_options *ndo, case MESSAGE_ROUTER_ID: { if (!ndo->ndo_vflag) - ND_PRINT((ndo, " router-id")); + ND_PRINT(" router-id"); else { - ND_PRINT((ndo, "\n\tRouter Id")); + ND_PRINT("\n\tRouter Id"); if(len < 10) goto invalid; - ND_PRINT((ndo, " %s", format_id(message + 4))); + ND_PRINT(" %s", format_id(message + 4)); } } break; case MESSAGE_NH: { if (!ndo->ndo_vflag) - ND_PRINT((ndo, " nh")); + ND_PRINT(" nh"); else { int rc; u_char nh[16]; - ND_PRINT((ndo, "\n\tNext Hop")); + ND_PRINT("\n\tNext Hop"); if(len < 2) goto invalid; rc = network_address(EXTRACT_U_1(message + 2), message + 4, len - 2, nh); if(rc < 0) goto invalid; - ND_PRINT((ndo, " %s", format_address(ndo, nh))); + ND_PRINT(" %s", format_address(ndo, nh)); } } break; case MESSAGE_UPDATE: { if (!ndo->ndo_vflag) { - ND_PRINT((ndo, " update")); + ND_PRINT(" update"); if(len < 1) - ND_PRINT((ndo, "/truncated")); + ND_PRINT("/truncated"); else - ND_PRINT((ndo, "%s%s%s", + ND_PRINT("%s%s%s", (EXTRACT_U_1(message + 3) & 0x80) ? "/prefix": "", (EXTRACT_U_1(message + 3) & 0x40) ? "/id" : "", - (EXTRACT_U_1(message + 3) & 0x3f) ? "/unknown" : "")); + (EXTRACT_U_1(message + 3) & 0x3f) ? "/unknown" : ""); } else { u_short interval, seqno, metric; u_char plen; int rc; u_char prefix[16]; - ND_PRINT((ndo, "\n\tUpdate")); + ND_PRINT("\n\tUpdate"); if(len < 10) goto invalid; plen = EXTRACT_U_1(message + 4) + (EXTRACT_U_1(message + 2) == 1 ? 96 : 0); rc = network_prefix(EXTRACT_U_1(message + 2), @@ -512,12 +512,12 @@ babel_print_v2(netdissect_options *ndo, interval = EXTRACT_BE_U_2(message + 6); seqno = EXTRACT_BE_U_2(message + 8); metric = EXTRACT_BE_U_2(message + 10); - ND_PRINT((ndo, "%s%s%s %s metric %u seqno %u interval %s", + ND_PRINT("%s%s%s %s metric %u seqno %u interval %s", (EXTRACT_U_1(message + 3) & 0x80) ? "/prefix": "", (EXTRACT_U_1(message + 3) & 0x40) ? "/id" : "", (EXTRACT_U_1(message + 3) & 0x3f) ? "/unknown" : "", format_prefix(ndo, prefix, plen), - metric, seqno, format_interval_update(interval))); + metric, seqno, format_interval_update(interval)); if(EXTRACT_U_1(message + 3) & 0x80) { if(EXTRACT_U_1(message + 2) == 1) memcpy(v4_prefix, prefix, 16); @@ -533,31 +533,31 @@ babel_print_v2(netdissect_options *ndo, case MESSAGE_REQUEST: { if (!ndo->ndo_vflag) - ND_PRINT((ndo, " request")); + ND_PRINT(" request"); else { int rc; u_char prefix[16], plen; - ND_PRINT((ndo, "\n\tRequest ")); + ND_PRINT("\n\tRequest "); if(len < 2) goto invalid; plen = EXTRACT_U_1(message + 3) + (EXTRACT_U_1(message + 2) == 1 ? 96 : 0); rc = network_prefix(EXTRACT_U_1(message + 2), EXTRACT_U_1(message + 3), 0, message + 4, NULL, len - 2, prefix); if(rc < 0) goto invalid; - ND_PRINT((ndo, "for %s", - EXTRACT_U_1(message + 2) == 0 ? "any" : format_prefix(ndo, prefix, plen))); + ND_PRINT("for %s", + EXTRACT_U_1(message + 2) == 0 ? "any" : format_prefix(ndo, prefix, plen)); } } break; case MESSAGE_MH_REQUEST : { if (!ndo->ndo_vflag) - ND_PRINT((ndo, " mh-request")); + ND_PRINT(" mh-request"); else { int rc; u_short seqno; u_char prefix[16], plen; - ND_PRINT((ndo, "\n\tMH-Request ")); + ND_PRINT("\n\tMH-Request "); if(len < 14) goto invalid; seqno = EXTRACT_BE_U_2(message + 4); rc = network_prefix(EXTRACT_U_1(message + 2), @@ -565,46 +565,46 @@ babel_print_v2(netdissect_options *ndo, message + 16, NULL, len - 14, prefix); if(rc < 0) goto invalid; plen = EXTRACT_U_1(message + 3) + (EXTRACT_U_1(message + 2) == 1 ? 96 : 0); - ND_PRINT((ndo, "(%u hops) for %s seqno %u id %s", + ND_PRINT("(%u hops) for %s seqno %u id %s", EXTRACT_U_1(message + 6), format_prefix(ndo, prefix, plen), - seqno, format_id(message + 8))); + seqno, format_id(message + 8)); } } break; case MESSAGE_TSPC : if (!ndo->ndo_vflag) - ND_PRINT((ndo, " tspc")); + ND_PRINT(" tspc"); else { - ND_PRINT((ndo, "\n\tTS/PC ")); + ND_PRINT("\n\tTS/PC "); if(len < 6) goto invalid; - ND_PRINT((ndo, "timestamp %u packetcounter %u", EXTRACT_BE_U_4(message + 4), - EXTRACT_BE_U_2(message + 2))); + ND_PRINT("timestamp %u packetcounter %u", EXTRACT_BE_U_4(message + 4), + EXTRACT_BE_U_2(message + 2)); } break; case MESSAGE_HMAC : { if (!ndo->ndo_vflag) - ND_PRINT((ndo, " hmac")); + ND_PRINT(" hmac"); else { unsigned j; - ND_PRINT((ndo, "\n\tHMAC ")); + ND_PRINT("\n\tHMAC "); if(len < 18) goto invalid; - ND_PRINT((ndo, "key-id %u digest-%u ", EXTRACT_BE_U_2(message + 2), len - 2)); + ND_PRINT("key-id %u digest-%u ", EXTRACT_BE_U_2(message + 2), len - 2); for (j = 0; j < len - 2; j++) - ND_PRINT((ndo, "%02X", EXTRACT_U_1(message + j + 4))); + ND_PRINT("%02X", EXTRACT_U_1(message + j + 4)); } } break; case MESSAGE_UPDATE_SRC_SPECIFIC : { if(!ndo->ndo_vflag) { - ND_PRINT((ndo, " ss-update")); + ND_PRINT(" ss-update"); } else { u_char prefix[16], src_prefix[16]; u_short interval, seqno, metric; u_char ae, plen, src_plen, omitted; int rc; int parsed_len = 10; - ND_PRINT((ndo, "\n\tSS-Update")); + ND_PRINT("\n\tSS-Update"); if(len < 10) goto invalid; ae = EXTRACT_U_1(message + 2); src_plen = EXTRACT_U_1(message + 3); @@ -627,10 +627,10 @@ babel_print_v2(netdissect_options *ndo, src_plen += 96; parsed_len += rc; - ND_PRINT((ndo, " %s from", format_prefix(ndo, prefix, plen))); - ND_PRINT((ndo, " %s metric %u seqno %u interval %s", + ND_PRINT(" %s from", format_prefix(ndo, prefix, plen)); + ND_PRINT(" %s metric %u seqno %u interval %s", format_prefix(ndo, src_prefix, src_plen), - metric, seqno, format_interval_update(interval))); + metric, seqno, format_interval_update(interval)); /* extra data? */ if((u_int)parsed_len < len) subtlvs_print(ndo, message + 2 + parsed_len, @@ -641,11 +641,11 @@ babel_print_v2(netdissect_options *ndo, case MESSAGE_REQUEST_SRC_SPECIFIC : { if(!ndo->ndo_vflag) - ND_PRINT((ndo, " ss-request")); + ND_PRINT(" ss-request"); else { int rc, parsed_len = 3; u_char ae, plen, src_plen, prefix[16], src_prefix[16]; - ND_PRINT((ndo, "\n\tSS-Request ")); + ND_PRINT("\n\tSS-Request "); if(len < 3) goto invalid; ae = EXTRACT_U_1(message + 2); plen = EXTRACT_U_1(message + 3); @@ -663,10 +663,10 @@ babel_print_v2(netdissect_options *ndo, src_plen += 96; parsed_len += rc; if(ae == 0) { - ND_PRINT((ndo, "for any")); + ND_PRINT("for any"); } else { - ND_PRINT((ndo, "for (%s, ", format_prefix(ndo, prefix, plen))); - ND_PRINT((ndo, "%s)", format_prefix(ndo, src_prefix, src_plen))); + ND_PRINT("for (%s, ", format_prefix(ndo, prefix, plen)); + ND_PRINT("%s)", format_prefix(ndo, src_prefix, src_plen)); } } } @@ -674,13 +674,13 @@ babel_print_v2(netdissect_options *ndo, case MESSAGE_MH_REQUEST_SRC_SPECIFIC : { if(!ndo->ndo_vflag) - ND_PRINT((ndo, " ss-mh-request")); + ND_PRINT(" ss-mh-request"); else { int rc, parsed_len = 14; u_short seqno; u_char ae, plen, src_plen, prefix[16], src_prefix[16], hopc; const u_char *router_id = NULL; - ND_PRINT((ndo, "\n\tSS-MH-Request ")); + ND_PRINT("\n\tSS-MH-Request "); if(len < 14) goto invalid; ae = EXTRACT_U_1(message + 2); plen = EXTRACT_U_1(message + 3); @@ -699,30 +699,30 @@ babel_print_v2(netdissect_options *ndo, if(rc < 0) goto invalid; if(ae == 1) src_plen += 96; - ND_PRINT((ndo, "(%u hops) for (%s, ", - hopc, format_prefix(ndo, prefix, plen))); - ND_PRINT((ndo, "%s) seqno %u id %s", + ND_PRINT("(%u hops) for (%s, ", + hopc, format_prefix(ndo, prefix, plen)); + ND_PRINT("%s) seqno %u id %s", format_prefix(ndo, src_prefix, src_plen), - seqno, format_id(router_id))); + seqno, format_id(router_id)); } } break; default: if (!ndo->ndo_vflag) - ND_PRINT((ndo, " unknown")); + ND_PRINT(" unknown"); else - ND_PRINT((ndo, "\n\tUnknown message type %d", type)); + ND_PRINT("\n\tUnknown message type %d", type); } i += len + 2; } return; trunc: - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); return; } diff --git a/print-beep.c b/print-beep.c index 2be7a7b6..0dfd27a3 100644 --- a/print-beep.c +++ b/print-beep.c @@ -50,19 +50,19 @@ beep_print(netdissect_options *ndo, const u_char *bp, u_int length) { if (l_strnstart(ndo, "MSG", 4, (const char *)bp, length)) /* A REQuest */ - ND_PRINT((ndo, " BEEP MSG")); + ND_PRINT(" BEEP MSG"); else if (l_strnstart(ndo, "RPY ", 4, (const char *)bp, length)) - ND_PRINT((ndo, " BEEP RPY")); + ND_PRINT(" BEEP RPY"); else if (l_strnstart(ndo, "ERR ", 4, (const char *)bp, length)) - ND_PRINT((ndo, " BEEP ERR")); + ND_PRINT(" BEEP ERR"); else if (l_strnstart(ndo, "ANS ", 4, (const char *)bp, length)) - ND_PRINT((ndo, " BEEP ANS")); + ND_PRINT(" BEEP ANS"); else if (l_strnstart(ndo, "NUL ", 4, (const char *)bp, length)) - ND_PRINT((ndo, " BEEP NUL")); + ND_PRINT(" BEEP NUL"); else if (l_strnstart(ndo, "SEQ ", 4, (const char *)bp, length)) - ND_PRINT((ndo, " BEEP SEQ")); + ND_PRINT(" BEEP SEQ"); else if (l_strnstart(ndo, "END", 4, (const char *)bp, length)) - ND_PRINT((ndo, " BEEP END")); + ND_PRINT(" BEEP END"); else - ND_PRINT((ndo, " BEEP (payload or undecoded)")); + ND_PRINT(" BEEP (payload or undecoded)"); } diff --git a/print-bfd.c b/print-bfd.c index a8e74212..6f614ff6 100644 --- a/print-bfd.c +++ b/print-bfd.c @@ -189,11 +189,11 @@ auth_print(netdissect_options *ndo, const u_char *pptr) ND_TCHECK_SIZE(bfd_auth_header); auth_type = EXTRACT_U_1(bfd_auth_header->auth_type); auth_len = EXTRACT_U_1(bfd_auth_header->auth_len); - ND_PRINT((ndo, "\n\tAuthentication: %s (%u), length: %u", + ND_PRINT("\n\tAuthentication: %s (%u), length: %u", tok2str(bfd_v1_authentication_values,"Unknown",auth_type), - auth_type, auth_len)); + auth_type, auth_len); pptr += 2; - ND_PRINT((ndo, "\n\t Auth Key ID: %u", EXTRACT_U_1(pptr))); + ND_PRINT("\n\t Auth Key ID: %u", EXTRACT_U_1(pptr)); switch(auth_type) { case AUTH_PASSWORD: @@ -210,12 +210,12 @@ auth_print(netdissect_options *ndo, const u_char *pptr) */ if (auth_len < AUTH_PASSWORD_FIELD_MIN_LEN || auth_len > AUTH_PASSWORD_FIELD_MAX_LEN) { - ND_PRINT((ndo, "[invalid length %u]", - auth_len)); + ND_PRINT("[invalid length %u]", + auth_len); break; } pptr++; - ND_PRINT((ndo, ", Password: ")); + ND_PRINT(", Password: "); /* the length is equal to the password length plus three */ if (fn_printn(ndo, pptr, auth_len - 3, ndo->ndo_snapend)) @@ -239,18 +239,18 @@ auth_print(netdissect_options *ndo, const u_char *pptr) * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ if (auth_len != AUTH_MD5_FIELD_LEN) { - ND_PRINT((ndo, "[invalid length %u]", - auth_len)); + ND_PRINT("[invalid length %u]", + auth_len); break; } pptr += 2; ND_TCHECK_4(pptr); - ND_PRINT((ndo, ", Sequence Number: 0x%08x", EXTRACT_BE_U_4(pptr))); + ND_PRINT(", Sequence Number: 0x%08x", EXTRACT_BE_U_4(pptr)); pptr += 4; ND_TCHECK_LEN(pptr, AUTH_MD5_HASH_LEN); - ND_PRINT((ndo, "\n\t Digest: ")); + ND_PRINT("\n\t Digest: "); for(i = 0; i < AUTH_MD5_HASH_LEN; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(pptr + i))); + ND_PRINT("%02x", EXTRACT_U_1(pptr + i)); break; case AUTH_SHA1: case AUTH_MET_SHA1: @@ -270,18 +270,18 @@ auth_print(netdissect_options *ndo, const u_char *pptr) * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ if (auth_len != AUTH_SHA1_FIELD_LEN) { - ND_PRINT((ndo, "[invalid length %u]", - auth_len)); + ND_PRINT("[invalid length %u]", + auth_len); break; } pptr += 2; ND_TCHECK_4(pptr); - ND_PRINT((ndo, ", Sequence Number: 0x%08x", EXTRACT_BE_U_4(pptr))); + ND_PRINT(", Sequence Number: 0x%08x", EXTRACT_BE_U_4(pptr)); pptr += 4; ND_TCHECK_LEN(pptr, AUTH_SHA1_HASH_LEN); - ND_PRINT((ndo, "\n\t Hash: ")); + ND_PRINT("\n\t Hash: "); for(i = 0; i < AUTH_SHA1_HASH_LEN; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(pptr + i))); + ND_PRINT("%02x", EXTRACT_U_1(pptr + i)); break; } return 0; @@ -315,68 +315,68 @@ bfd_print(netdissect_options *ndo, const u_char *pptr, case (BFD_CONTROL_PORT << 8): if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "BFDv%u, %s, Flags: [%s], length: %u", + ND_PRINT("BFDv%u, %s, Flags: [%s], length: %u", version, tok2str(bfd_port_values, "unknown (%u)", port), bittok2str(bfd_v0_flag_values, "none", flags), - len)); + len); return; } - ND_PRINT((ndo, "BFDv%u, length: %u\n\t%s, Flags: [%s], Diagnostic: %s (0x%02x)", + ND_PRINT("BFDv%u, length: %u\n\t%s, Flags: [%s], Diagnostic: %s (0x%02x)", version, len, tok2str(bfd_port_values, "unknown (%u)", port), bittok2str(bfd_v0_flag_values, "none", flags), tok2str(bfd_diag_values,"unknown",BFD_EXTRACT_DIAG(version_diag)), - BFD_EXTRACT_DIAG(version_diag))); + BFD_EXTRACT_DIAG(version_diag)); - ND_PRINT((ndo, "\n\tDetection Timer Multiplier: %u (%u ms Detection time), BFD Length: %u", + ND_PRINT("\n\tDetection Timer Multiplier: %u (%u ms Detection time), BFD Length: %u", EXTRACT_U_1(bfd_header->detect_time_multiplier), EXTRACT_U_1(bfd_header->detect_time_multiplier) * EXTRACT_BE_U_4(bfd_header->desired_min_tx_interval)/1000, - EXTRACT_U_1(bfd_header->length))); + EXTRACT_U_1(bfd_header->length)); - ND_PRINT((ndo, "\n\tMy Discriminator: 0x%08x", EXTRACT_BE_U_4(bfd_header->my_discriminator))); - ND_PRINT((ndo, ", Your Discriminator: 0x%08x", EXTRACT_BE_U_4(bfd_header->your_discriminator))); - ND_PRINT((ndo, "\n\t Desired min Tx Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->desired_min_tx_interval)/1000)); - ND_PRINT((ndo, "\n\t Required min Rx Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->required_min_rx_interval)/1000)); - ND_PRINT((ndo, "\n\t Required min Echo Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->required_min_echo_interval)/1000)); + ND_PRINT("\n\tMy Discriminator: 0x%08x", EXTRACT_BE_U_4(bfd_header->my_discriminator)); + ND_PRINT(", Your Discriminator: 0x%08x", EXTRACT_BE_U_4(bfd_header->your_discriminator)); + ND_PRINT("\n\t Desired min Tx Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->desired_min_tx_interval)/1000); + ND_PRINT("\n\t Required min Rx Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->required_min_rx_interval)/1000); + ND_PRINT("\n\t Required min Echo Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->required_min_echo_interval)/1000); break; /* BFDv1 */ case (BFD_CONTROL_PORT << 8 | 1): if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "BFDv%u, %s, State %s, Flags: [%s], length: %u", + ND_PRINT("BFDv%u, %s, State %s, Flags: [%s], length: %u", version, tok2str(bfd_port_values, "unknown (%u)", port), tok2str(bfd_v1_state_values, "unknown (%u)", (flags & 0xc0) >> 6), bittok2str(bfd_v1_flag_values, "none", flags & 0x3f), - len)); + len); return; } - ND_PRINT((ndo, "BFDv%u, length: %u\n\t%s, State %s, Flags: [%s], Diagnostic: %s (0x%02x)", + ND_PRINT("BFDv%u, length: %u\n\t%s, State %s, Flags: [%s], Diagnostic: %s (0x%02x)", version, len, tok2str(bfd_port_values, "unknown (%u)", port), tok2str(bfd_v1_state_values, "unknown (%u)", (flags & 0xc0) >> 6), bittok2str(bfd_v1_flag_values, "none", flags & 0x3f), tok2str(bfd_diag_values,"unknown",BFD_EXTRACT_DIAG(version_diag)), - BFD_EXTRACT_DIAG(version_diag))); + BFD_EXTRACT_DIAG(version_diag)); - ND_PRINT((ndo, "\n\tDetection Timer Multiplier: %u (%u ms Detection time), BFD Length: %u", + ND_PRINT("\n\tDetection Timer Multiplier: %u (%u ms Detection time), BFD Length: %u", EXTRACT_U_1(bfd_header->detect_time_multiplier), EXTRACT_U_1(bfd_header->detect_time_multiplier) * EXTRACT_BE_U_4(bfd_header->desired_min_tx_interval)/1000, - EXTRACT_U_1(bfd_header->length))); + EXTRACT_U_1(bfd_header->length)); - ND_PRINT((ndo, "\n\tMy Discriminator: 0x%08x", EXTRACT_BE_U_4(bfd_header->my_discriminator))); - ND_PRINT((ndo, ", Your Discriminator: 0x%08x", EXTRACT_BE_U_4(bfd_header->your_discriminator))); - ND_PRINT((ndo, "\n\t Desired min Tx Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->desired_min_tx_interval)/1000)); - ND_PRINT((ndo, "\n\t Required min Rx Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->required_min_rx_interval)/1000)); - ND_PRINT((ndo, "\n\t Required min Echo Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->required_min_echo_interval)/1000)); + ND_PRINT("\n\tMy Discriminator: 0x%08x", EXTRACT_BE_U_4(bfd_header->my_discriminator)); + ND_PRINT(", Your Discriminator: 0x%08x", EXTRACT_BE_U_4(bfd_header->your_discriminator)); + ND_PRINT("\n\t Desired min Tx Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->desired_min_tx_interval)/1000); + ND_PRINT("\n\t Required min Rx Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->required_min_rx_interval)/1000); + ND_PRINT("\n\t Required min Echo Interval: %4u ms", EXTRACT_BE_U_4(bfd_header->required_min_echo_interval)/1000); if (flags & BFD_FLAG_AUTH) { if (auth_print(ndo, pptr)) @@ -390,9 +390,9 @@ bfd_print(netdissect_options *ndo, const u_char *pptr, case (BFD_ECHO_PORT << 8 | 1): default: - ND_PRINT((ndo, "BFD, %s, length: %u", + ND_PRINT("BFD, %s, length: %u", tok2str(bfd_port_values, "unknown (%u)", port), - len)); + len); if (ndo->ndo_vflag >= 1) { if(!print_unknown_data(ndo, pptr,"\n\t",len)) return; @@ -402,7 +402,7 @@ bfd_print(netdissect_options *ndo, const u_char *pptr, return; trunc: - ND_PRINT((ndo, "[|BFD]")); + ND_PRINT("[|BFD]"); } /* * Local Variables: diff --git a/print-bgp.c b/print-bgp.c index 18b64cb0..79f617f4 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -1481,12 +1481,12 @@ bgp_attr_print(netdissect_options *ndo, switch (atype) { case BGPTYPE_ORIGIN: if (len != 1) - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); else { ND_TCHECK_1(tptr); - ND_PRINT((ndo, "%s", tok2str(bgp_origin_values, + ND_PRINT("%s", tok2str(bgp_origin_values, "Unknown Origin Typecode", - EXTRACT_U_1(tptr)))); + EXTRACT_U_1(tptr))); } break; @@ -1496,11 +1496,11 @@ bgp_attr_print(netdissect_options *ndo, case BGPTYPE_AS4_PATH: case BGPTYPE_AS_PATH: if (len % 2) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); break; } if (!len) { - ND_PRINT((ndo, "empty")); + ND_PRINT("empty"); break; } @@ -1516,44 +1516,44 @@ bgp_attr_print(netdissect_options *ndo, while (tptr < pptr + len) { ND_TCHECK_1(tptr); - ND_PRINT((ndo, "%s", tok2str(bgp_as_path_segment_open_values, - "?", EXTRACT_U_1(tptr)))); + ND_PRINT("%s", tok2str(bgp_as_path_segment_open_values, + "?", EXTRACT_U_1(tptr))); ND_TCHECK_1(tptr + 1); for (i = 0; i < EXTRACT_U_1(tptr + 1) * as_size; i += as_size) { ND_TCHECK_LEN(tptr + 2 + i, as_size); - ND_PRINT((ndo, "%s ", + ND_PRINT("%s ", as_printf(ndo, astostr, sizeof(astostr), as_size == 2 ? EXTRACT_BE_U_2(tptr + i + 2) : - EXTRACT_BE_U_4(tptr + i + 2)))); + EXTRACT_BE_U_4(tptr + i + 2))); } ND_TCHECK_1(tptr); - ND_PRINT((ndo, "%s", tok2str(bgp_as_path_segment_close_values, - "?", EXTRACT_U_1(tptr)))); + ND_PRINT("%s", tok2str(bgp_as_path_segment_close_values, + "?", EXTRACT_U_1(tptr))); ND_TCHECK_1(tptr + 1); tptr += 2 + EXTRACT_U_1(tptr + 1) * as_size; } break; case BGPTYPE_NEXT_HOP: if (len != 4) - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); else { ND_TCHECK_4(tptr); - ND_PRINT((ndo, "%s", ipaddr_string(ndo, tptr))); + ND_PRINT("%s", ipaddr_string(ndo, tptr)); } break; case BGPTYPE_MULTI_EXIT_DISC: case BGPTYPE_LOCAL_PREF: if (len != 4) - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); else { ND_TCHECK_4(tptr); - ND_PRINT((ndo, "%u", EXTRACT_BE_U_4(tptr))); + ND_PRINT("%u", EXTRACT_BE_U_4(tptr)); } break; case BGPTYPE_ATOMIC_AGGREGATE: if (len != 0) - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); break; case BGPTYPE_AGGREGATOR: @@ -1562,33 +1562,33 @@ bgp_attr_print(netdissect_options *ndo, * the length of this PA can be either 6 bytes or 8 bytes. */ if (len != 6 && len != 8) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); break; } ND_TCHECK_LEN(tptr, len); if (len == 6) { - ND_PRINT((ndo, " AS #%s, origin %s", + ND_PRINT(" AS #%s, origin %s", as_printf(ndo, astostr, sizeof(astostr), EXTRACT_BE_U_2(tptr)), - ipaddr_string(ndo, tptr + 2))); + ipaddr_string(ndo, tptr + 2)); } else { - ND_PRINT((ndo, " AS #%s, origin %s", + ND_PRINT(" AS #%s, origin %s", as_printf(ndo, astostr, sizeof(astostr), - EXTRACT_BE_U_4(tptr)), ipaddr_string(ndo, tptr + 4))); + EXTRACT_BE_U_4(tptr)), ipaddr_string(ndo, tptr + 4)); } break; case BGPTYPE_AGGREGATOR4: if (len != 8) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); break; } ND_TCHECK_8(tptr); - ND_PRINT((ndo, " AS #%s, origin %s", + ND_PRINT(" AS #%s, origin %s", as_printf(ndo, astostr, sizeof(astostr), EXTRACT_BE_U_4(tptr)), - ipaddr_string(ndo, tptr + 4))); + ipaddr_string(ndo, tptr + 4)); break; case BGPTYPE_COMMUNITIES: if (len % 4) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); break; } while (tlen != 0) { @@ -1599,19 +1599,19 @@ bgp_attr_print(netdissect_options *ndo, comm = EXTRACT_BE_U_4(tptr); switch (comm) { case BGP_COMMUNITY_NO_EXPORT: - ND_PRINT((ndo, " NO_EXPORT")); + ND_PRINT(" NO_EXPORT"); break; case BGP_COMMUNITY_NO_ADVERT: - ND_PRINT((ndo, " NO_ADVERTISE")); + ND_PRINT(" NO_ADVERTISE"); break; case BGP_COMMUNITY_NO_EXPORT_SUBCONFED: - ND_PRINT((ndo, " NO_EXPORT_SUBCONFED")); + ND_PRINT(" NO_EXPORT_SUBCONFED"); break; default: - ND_PRINT((ndo, "%u:%u%s", + ND_PRINT("%u:%u%s", (comm >> 16) & 0xffff, comm & 0xffff, - (tlen>4) ? ", " : "")); + (tlen>4) ? ", " : ""); break; } tlen -=4; @@ -1620,24 +1620,24 @@ bgp_attr_print(netdissect_options *ndo, break; case BGPTYPE_ORIGINATOR_ID: if (len != 4) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); break; } ND_TCHECK_4(tptr); - ND_PRINT((ndo, "%s",ipaddr_string(ndo, tptr))); + ND_PRINT("%s",ipaddr_string(ndo, tptr)); break; case BGPTYPE_CLUSTER_LIST: if (len % 4) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); break; } while (tlen != 0) { ND_TCHECK_4(tptr); if (tlen < 4) goto trunc; - ND_PRINT((ndo, "%s%s", + ND_PRINT("%s%s", ipaddr_string(ndo, tptr), - (tlen>4) ? ", " : "")); + (tlen>4) ? ", " : ""); tlen -=4; tptr +=4; } @@ -1647,12 +1647,12 @@ bgp_attr_print(netdissect_options *ndo, af = EXTRACT_BE_U_2(tptr); safi = EXTRACT_U_1(tptr + 2); - ND_PRINT((ndo, "\n\t AFI: %s (%u), %sSAFI: %s (%u)", + ND_PRINT("\n\t AFI: %s (%u), %sSAFI: %s (%u)", tok2str(af_values, "Unknown AFI", af), af, (safi>128) ? "vendor specific " : "", /* 128 is meanwhile wellknown */ tok2str(bgp_safi_values, "Unknown SAFI", safi), - safi)); + safi); switch(af<<8 | safi) { case (AFNUM_INET<<8 | SAFNUM_UNICAST): @@ -1685,7 +1685,7 @@ bgp_attr_print(netdissect_options *ndo, break; default: ND_TCHECK_LEN(tptr, tlen); - ND_PRINT((ndo, "\n\t no AFI %u / SAFI %u decoder", af, safi)); + ND_PRINT("\n\t no AFI %u / SAFI %u decoder", af, safi); if (ndo->ndo_vflag <= 1) print_unknown_data(ndo, tptr, "\n\t ", tlen); goto done; @@ -1701,10 +1701,10 @@ bgp_attr_print(netdissect_options *ndo, if (tlen) { u_int nnh = 0; - ND_PRINT((ndo, "\n\t nexthop: ")); + ND_PRINT("\n\t nexthop: "); while (tlen != 0) { if (nnh++ > 0) { - ND_PRINT((ndo, ", " )); + ND_PRINT(", " ); } switch(af<<8 | safi) { case (AFNUM_INET<<8 | SAFNUM_UNICAST): @@ -1715,11 +1715,11 @@ bgp_attr_print(netdissect_options *ndo, case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN): case (AFNUM_INET<<8 | SAFNUM_MDT): if (tlen < sizeof(struct in_addr)) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); tlen = 0; } else { ND_TCHECK_LEN(tptr, sizeof(struct in_addr)); - ND_PRINT((ndo, "%s",ipaddr_string(ndo, tptr))); + ND_PRINT("%s",ipaddr_string(ndo, tptr)); tlen -= sizeof(struct in_addr); tptr += sizeof(struct in_addr); } @@ -1728,14 +1728,14 @@ bgp_attr_print(netdissect_options *ndo, case (AFNUM_INET<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_INET<<8 | SAFNUM_VPNUNIMULTICAST): if (tlen < sizeof(struct in_addr)+BGP_VPN_RD_LEN) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); tlen = 0; } else { ND_TCHECK_LEN(tptr, sizeof(struct in_addr) + BGP_VPN_RD_LEN); - ND_PRINT((ndo, "RD: %s, %s", + ND_PRINT("RD: %s, %s", bgp_vpn_rd_print(ndo, tptr), - ipaddr_string(ndo, tptr+BGP_VPN_RD_LEN))); + ipaddr_string(ndo, tptr+BGP_VPN_RD_LEN)); tlen -= (sizeof(struct in_addr)+BGP_VPN_RD_LEN); tptr += (sizeof(struct in_addr)+BGP_VPN_RD_LEN); } @@ -1745,11 +1745,11 @@ bgp_attr_print(netdissect_options *ndo, case (AFNUM_INET6<<8 | SAFNUM_UNIMULTICAST): case (AFNUM_INET6<<8 | SAFNUM_LABUNICAST): if (tlen < sizeof(struct in6_addr)) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); tlen = 0; } else { ND_TCHECK_LEN(tptr, sizeof(struct in6_addr)); - ND_PRINT((ndo, "%s", ip6addr_string(ndo, tptr))); + ND_PRINT("%s", ip6addr_string(ndo, tptr)); tlen -= sizeof(struct in6_addr); tptr += sizeof(struct in6_addr); } @@ -1758,14 +1758,14 @@ bgp_attr_print(netdissect_options *ndo, case (AFNUM_INET6<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_INET6<<8 | SAFNUM_VPNUNIMULTICAST): if (tlen < sizeof(struct in6_addr)+BGP_VPN_RD_LEN) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); tlen = 0; } else { ND_TCHECK_LEN(tptr, sizeof(struct in6_addr) + BGP_VPN_RD_LEN); - ND_PRINT((ndo, "RD: %s, %s", + ND_PRINT("RD: %s, %s", bgp_vpn_rd_print(ndo, tptr), - ip6addr_string(ndo, tptr+BGP_VPN_RD_LEN))); + ip6addr_string(ndo, tptr+BGP_VPN_RD_LEN)); tlen -= (sizeof(struct in6_addr)+BGP_VPN_RD_LEN); tptr += (sizeof(struct in6_addr)+BGP_VPN_RD_LEN); } @@ -1775,11 +1775,11 @@ bgp_attr_print(netdissect_options *ndo, case (AFNUM_L2VPN<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_L2VPN<<8 | SAFNUM_VPNUNIMULTICAST): if (tlen < sizeof(struct in_addr)) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); tlen = 0; } else { ND_TCHECK_LEN(tptr, sizeof(struct in_addr)); - ND_PRINT((ndo, "%s", ipaddr_string(ndo, tptr))); + ND_PRINT("%s", ipaddr_string(ndo, tptr)); tlen -= (sizeof(struct in_addr)); tptr += (sizeof(struct in_addr)); } @@ -1788,7 +1788,7 @@ bgp_attr_print(netdissect_options *ndo, case (AFNUM_NSAP<<8 | SAFNUM_MULTICAST): case (AFNUM_NSAP<<8 | SAFNUM_UNIMULTICAST): ND_TCHECK_LEN(tptr, tlen); - ND_PRINT((ndo, "%s", isonsap_string(ndo, tptr, tlen))); + ND_PRINT("%s", isonsap_string(ndo, tptr, tlen)); tptr += tlen; tlen = 0; break; @@ -1797,26 +1797,26 @@ bgp_attr_print(netdissect_options *ndo, case (AFNUM_NSAP<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_NSAP<<8 | SAFNUM_VPNUNIMULTICAST): if (tlen < BGP_VPN_RD_LEN+1) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); tlen = 0; } else { ND_TCHECK_LEN(tptr, tlen); - ND_PRINT((ndo, "RD: %s, %s", + ND_PRINT("RD: %s, %s", bgp_vpn_rd_print(ndo, tptr), - isonsap_string(ndo, tptr+BGP_VPN_RD_LEN,tlen-BGP_VPN_RD_LEN))); + isonsap_string(ndo, tptr+BGP_VPN_RD_LEN,tlen-BGP_VPN_RD_LEN)); /* rfc986 mapped IPv4 address ? */ if (EXTRACT_BE_U_4(tptr + BGP_VPN_RD_LEN) == 0x47000601) - ND_PRINT((ndo, " = %s", ipaddr_string(ndo, tptr+BGP_VPN_RD_LEN+4))); + ND_PRINT(" = %s", ipaddr_string(ndo, tptr+BGP_VPN_RD_LEN+4)); /* rfc1888 mapped IPv6 address ? */ else if (EXTRACT_BE_U_3(tptr + BGP_VPN_RD_LEN) == 0x350000) - ND_PRINT((ndo, " = %s", ip6addr_string(ndo, tptr+BGP_VPN_RD_LEN+3))); + ND_PRINT(" = %s", ip6addr_string(ndo, tptr+BGP_VPN_RD_LEN+3)); tptr += tlen; tlen = 0; } break; default: ND_TCHECK_LEN(tptr, tlen); - ND_PRINT((ndo, "no AFI %u/SAFI %u decoder", af, safi)); + ND_PRINT("no AFI %u/SAFI %u decoder", af, safi); if (ndo->ndo_vflag <= 1) print_unknown_data(ndo, tptr, "\n\t ", tlen); tptr += tlen; @@ -1826,7 +1826,7 @@ bgp_attr_print(netdissect_options *ndo, } } } - ND_PRINT((ndo, ", nh-length: %u", nhlen)); + ND_PRINT(", nh-length: %u", nhlen); tptr += tlen; ND_TCHECK_1(tptr); @@ -1834,14 +1834,14 @@ bgp_attr_print(netdissect_options *ndo, tptr++; if (snpa) { - ND_PRINT((ndo, "\n\t %u SNPA", snpa)); + ND_PRINT("\n\t %u SNPA", snpa); for (/*nothing*/; snpa != 0; snpa--) { ND_TCHECK_1(tptr); - ND_PRINT((ndo, "\n\t %u bytes", EXTRACT_U_1(tptr))); + ND_PRINT("\n\t %u bytes", EXTRACT_U_1(tptr)); tptr += EXTRACT_U_1(tptr) + 1; } } else { - ND_PRINT((ndo, ", no SNPA")); + ND_PRINT(", no SNPA"); } add_path4 = check_add_path(ndo, tptr, (len-(tptr - pptr)), 32); @@ -1858,67 +1858,67 @@ bgp_attr_print(netdissect_options *ndo, } advance = decode_prefix4(ndo, tptr, len, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else if (advance == -3) break; /* bytes left, but not enough */ else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); if (add_path4) { - ND_PRINT((ndo, " Path Id: %u", path_id)); + ND_PRINT(" Path Id: %u", path_id); } break; case (AFNUM_INET<<8 | SAFNUM_LABUNICAST): advance = decode_labeled_prefix4(ndo, tptr, len, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else if (advance == -3) break; /* bytes left, but not enough */ else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET<<8 | SAFNUM_VPNUNICAST): case (AFNUM_INET<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_INET<<8 | SAFNUM_VPNUNIMULTICAST): advance = decode_labeled_vpn_prefix4(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET<<8 | SAFNUM_RT_ROUTING_INFO): advance = decode_rt_routing_info(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN): /* fall through */ case (AFNUM_INET6<<8 | SAFNUM_MULTICAST_VPN): advance = decode_multicast_vpn(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET<<8 | SAFNUM_MDT): advance = decode_mdt_vpn_nlri(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET6<<8 | SAFNUM_UNICAST): case (AFNUM_INET6<<8 | SAFNUM_MULTICAST): @@ -1929,38 +1929,38 @@ bgp_attr_print(netdissect_options *ndo, } advance = decode_prefix6(ndo, tptr, len, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else if (advance == -3) break; /* bytes left, but not enough */ else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); if (add_path6) { - ND_PRINT((ndo, " Path Id: %u", path_id)); + ND_PRINT(" Path Id: %u", path_id); } break; case (AFNUM_INET6<<8 | SAFNUM_LABUNICAST): advance = decode_labeled_prefix6(ndo, tptr, len, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else if (advance == -3) break; /* bytes left, but not enough */ else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET6<<8 | SAFNUM_VPNUNICAST): case (AFNUM_INET6<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_INET6<<8 | SAFNUM_VPNUNIMULTICAST): advance = decode_labeled_vpn_prefix6(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_VPLS<<8 | SAFNUM_VPLS): case (AFNUM_L2VPN<<8 | SAFNUM_VPNUNICAST): @@ -1968,37 +1968,37 @@ bgp_attr_print(netdissect_options *ndo, case (AFNUM_L2VPN<<8 | SAFNUM_VPNUNIMULTICAST): advance = decode_labeled_vpn_l2(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal length)")); + ND_PRINT("\n\t (illegal length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_NSAP<<8 | SAFNUM_UNICAST): case (AFNUM_NSAP<<8 | SAFNUM_MULTICAST): case (AFNUM_NSAP<<8 | SAFNUM_UNIMULTICAST): advance = decode_clnp_prefix(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_NSAP<<8 | SAFNUM_VPNUNICAST): case (AFNUM_NSAP<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_NSAP<<8 | SAFNUM_VPNUNIMULTICAST): advance = decode_labeled_vpn_clnp_prefix(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; default: ND_TCHECK_LEN(tptr, tlen); - ND_PRINT((ndo, "\n\t no AFI %u / SAFI %u decoder", af, safi)); + ND_PRINT("\n\t no AFI %u / SAFI %u decoder", af, safi); if (ndo->ndo_vflag <= 1) print_unknown_data(ndo, tptr, "\n\t ", tlen); advance = 0; @@ -2017,15 +2017,15 @@ bgp_attr_print(netdissect_options *ndo, af = EXTRACT_BE_U_2(tptr); safi = EXTRACT_U_1(tptr + 2); - ND_PRINT((ndo, "\n\t AFI: %s (%u), %sSAFI: %s (%u)", + ND_PRINT("\n\t AFI: %s (%u), %sSAFI: %s (%u)", tok2str(af_values, "Unknown AFI", af), af, (safi>128) ? "vendor specific " : "", /* 128 is meanwhile wellknown */ tok2str(bgp_safi_values, "Unknown SAFI", safi), - safi)); + safi); if (len == BGP_MP_NLRI_MINSIZE) - ND_PRINT((ndo, "\n\t End-of-Rib Marker (empty NLRI)")); + ND_PRINT("\n\t End-of-Rib Marker (empty NLRI)"); tptr += 3; @@ -2043,38 +2043,38 @@ bgp_attr_print(netdissect_options *ndo, } advance = decode_prefix4(ndo, tptr, len, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else if (advance == -3) break; /* bytes left, but not enough */ else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); if (add_path4) { - ND_PRINT((ndo, " Path Id: %u", path_id)); + ND_PRINT(" Path Id: %u", path_id); } break; case (AFNUM_INET<<8 | SAFNUM_LABUNICAST): advance = decode_labeled_prefix4(ndo, tptr, len, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else if (advance == -3) break; /* bytes left, but not enough */ else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET<<8 | SAFNUM_VPNUNICAST): case (AFNUM_INET<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_INET<<8 | SAFNUM_VPNUNIMULTICAST): advance = decode_labeled_vpn_prefix4(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET6<<8 | SAFNUM_UNICAST): case (AFNUM_INET6<<8 | SAFNUM_MULTICAST): @@ -2085,38 +2085,38 @@ bgp_attr_print(netdissect_options *ndo, } advance = decode_prefix6(ndo, tptr, len, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else if (advance == -3) break; /* bytes left, but not enough */ else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); if (add_path6) { - ND_PRINT((ndo, " Path Id: %u", path_id)); + ND_PRINT(" Path Id: %u", path_id); } break; case (AFNUM_INET6<<8 | SAFNUM_LABUNICAST): advance = decode_labeled_prefix6(ndo, tptr, len, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else if (advance == -3) break; /* bytes left, but not enough */ else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET6<<8 | SAFNUM_VPNUNICAST): case (AFNUM_INET6<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_INET6<<8 | SAFNUM_VPNUNIMULTICAST): advance = decode_labeled_vpn_prefix6(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_VPLS<<8 | SAFNUM_VPLS): case (AFNUM_L2VPN<<8 | SAFNUM_VPNUNICAST): @@ -2124,56 +2124,56 @@ bgp_attr_print(netdissect_options *ndo, case (AFNUM_L2VPN<<8 | SAFNUM_VPNUNIMULTICAST): advance = decode_labeled_vpn_l2(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal length)")); + ND_PRINT("\n\t (illegal length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_NSAP<<8 | SAFNUM_UNICAST): case (AFNUM_NSAP<<8 | SAFNUM_MULTICAST): case (AFNUM_NSAP<<8 | SAFNUM_UNIMULTICAST): advance = decode_clnp_prefix(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_NSAP<<8 | SAFNUM_VPNUNICAST): case (AFNUM_NSAP<<8 | SAFNUM_VPNMULTICAST): case (AFNUM_NSAP<<8 | SAFNUM_VPNUNIMULTICAST): advance = decode_labeled_vpn_clnp_prefix(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET<<8 | SAFNUM_MDT): advance = decode_mdt_vpn_nlri(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN): /* fall through */ case (AFNUM_INET6<<8 | SAFNUM_MULTICAST_VPN): advance = decode_multicast_vpn(ndo, tptr, buf, sizeof(buf)); if (advance == -1) - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); else if (advance == -2) goto trunc; else - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); break; default: ND_TCHECK_LEN(tptr - 3, tlen); - ND_PRINT((ndo, "no AFI %u / SAFI %u decoder", af, safi)); + ND_PRINT("no AFI %u / SAFI %u decoder", af, safi); if (ndo->ndo_vflag <= 1) print_unknown_data(ndo, tptr-3, "\n\t ", tlen); advance = 0; @@ -2187,7 +2187,7 @@ bgp_attr_print(netdissect_options *ndo, break; case BGPTYPE_EXTD_COMMUNITIES: if (len % 8) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); break; } while (tlen != 0) { @@ -2198,12 +2198,12 @@ bgp_attr_print(netdissect_options *ndo, goto trunc; extd_comm=EXTRACT_BE_U_2(tptr); - ND_PRINT((ndo, "\n\t %s (0x%04x), Flags [%s]", + ND_PRINT("\n\t %s (0x%04x), Flags [%s]", tok2str(bgp_extd_comm_subtype_values, "unknown extd community typecode", extd_comm), extd_comm, - bittok2str(bgp_extd_comm_flag_values, "none", extd_comm))); + bittok2str(bgp_extd_comm_flag_values, "none", extd_comm)); ND_TCHECK_6(tptr + 2); if (tlen < 8) @@ -2212,29 +2212,29 @@ bgp_attr_print(netdissect_options *ndo, case BGP_EXT_COM_RT_0: case BGP_EXT_COM_RO_0: case BGP_EXT_COM_L2VPN_RT_0: - ND_PRINT((ndo, ": %u:%u (= %s)", + ND_PRINT(": %u:%u (= %s)", EXTRACT_BE_U_2(tptr + 2), EXTRACT_BE_U_4(tptr + 4), - ipaddr_string(ndo, tptr+4))); + ipaddr_string(ndo, tptr+4)); break; case BGP_EXT_COM_RT_1: case BGP_EXT_COM_RO_1: case BGP_EXT_COM_L2VPN_RT_1: case BGP_EXT_COM_VRF_RT_IMP: - ND_PRINT((ndo, ": %s:%u", + ND_PRINT(": %s:%u", ipaddr_string(ndo, tptr+2), - EXTRACT_BE_U_2(tptr + 6))); + EXTRACT_BE_U_2(tptr + 6)); break; case BGP_EXT_COM_RT_2: case BGP_EXT_COM_RO_2: - ND_PRINT((ndo, ": %s:%u", + ND_PRINT(": %s:%u", as_printf(ndo, astostr, sizeof(astostr), - EXTRACT_BE_U_4(tptr + 2)), EXTRACT_BE_U_2(tptr + 6))); + EXTRACT_BE_U_4(tptr + 2)), EXTRACT_BE_U_2(tptr + 6)); break; case BGP_EXT_COM_LINKBAND: bw.i = EXTRACT_BE_U_4(tptr + 2); - ND_PRINT((ndo, ": bandwidth: %.3f Mbps", - bw.f*8/1000000)); + ND_PRINT(": bandwidth: %.3f Mbps", + bw.f*8/1000000); break; case BGP_EXT_COM_VPN_ORIGIN: case BGP_EXT_COM_VPN_ORIGIN2: @@ -2242,28 +2242,28 @@ bgp_attr_print(netdissect_options *ndo, case BGP_EXT_COM_VPN_ORIGIN4: case BGP_EXT_COM_OSPF_RID: case BGP_EXT_COM_OSPF_RID2: - ND_PRINT((ndo, "%s", ipaddr_string(ndo, tptr+2))); + ND_PRINT("%s", ipaddr_string(ndo, tptr+2)); break; case BGP_EXT_COM_OSPF_RTYPE: case BGP_EXT_COM_OSPF_RTYPE2: - ND_PRINT((ndo, ": area:%s, router-type:%s, metric-type:%s%s", + ND_PRINT(": area:%s, router-type:%s, metric-type:%s%s", ipaddr_string(ndo, tptr+2), tok2str(bgp_extd_comm_ospf_rtype_values, "unknown (0x%02x)", EXTRACT_U_1((tptr + 6))), (EXTRACT_U_1(tptr + 7) & BGP_OSPF_RTYPE_METRIC_TYPE) ? "E2" : "", - ((EXTRACT_U_1(tptr + 6) == BGP_OSPF_RTYPE_EXT) || (EXTRACT_U_1(tptr + 6) == BGP_OSPF_RTYPE_NSSA)) ? "E1" : "")); + ((EXTRACT_U_1(tptr + 6) == BGP_OSPF_RTYPE_EXT) || (EXTRACT_U_1(tptr + 6) == BGP_OSPF_RTYPE_NSSA)) ? "E1" : ""); break; case BGP_EXT_COM_L2INFO: - ND_PRINT((ndo, ": %s Control Flags [0x%02x]:MTU %u", + ND_PRINT(": %s Control Flags [0x%02x]:MTU %u", tok2str(l2vpn_encaps_values, "unknown encaps", EXTRACT_U_1((tptr + 2))), EXTRACT_U_1((tptr + 3)), - EXTRACT_BE_U_2(tptr + 4))); + EXTRACT_BE_U_2(tptr + 4)); break; case BGP_EXT_COM_SOURCE_AS: - ND_PRINT((ndo, ": AS %u", EXTRACT_BE_U_2(tptr + 2))); + ND_PRINT(": AS %u", EXTRACT_BE_U_2(tptr + 2)); break; default: ND_TCHECK_8(tptr); @@ -2284,11 +2284,11 @@ bgp_attr_print(netdissect_options *ndo, tunnel_type = EXTRACT_U_1(tptr + 1); tlen = len; - ND_PRINT((ndo, "\n\t Tunnel-type %s (%u), Flags [%s], MPLS Label %u", + ND_PRINT("\n\t Tunnel-type %s (%u), Flags [%s], MPLS Label %u", tok2str(bgp_pmsi_tunnel_values, "Unknown", tunnel_type), tunnel_type, bittok2str(bgp_pmsi_flag_values, "none", flags), - EXTRACT_BE_U_3(tptr + 2)>>4)); + EXTRACT_BE_U_3(tptr + 2)>>4); tptr +=5; tlen -= 5; @@ -2297,34 +2297,34 @@ bgp_attr_print(netdissect_options *ndo, case BGP_PMSI_TUNNEL_PIM_SM: /* fall through */ case BGP_PMSI_TUNNEL_PIM_BIDIR: ND_TCHECK_8(tptr); - ND_PRINT((ndo, "\n\t Sender %s, P-Group %s", + ND_PRINT("\n\t Sender %s, P-Group %s", ipaddr_string(ndo, tptr), - ipaddr_string(ndo, tptr+4))); + ipaddr_string(ndo, tptr+4)); break; case BGP_PMSI_TUNNEL_PIM_SSM: ND_TCHECK_8(tptr); - ND_PRINT((ndo, "\n\t Root-Node %s, P-Group %s", + ND_PRINT("\n\t Root-Node %s, P-Group %s", ipaddr_string(ndo, tptr), - ipaddr_string(ndo, tptr+4))); + ipaddr_string(ndo, tptr+4)); break; case BGP_PMSI_TUNNEL_INGRESS: ND_TCHECK_4(tptr); - ND_PRINT((ndo, "\n\t Tunnel-Endpoint %s", - ipaddr_string(ndo, tptr))); + ND_PRINT("\n\t Tunnel-Endpoint %s", + ipaddr_string(ndo, tptr)); break; case BGP_PMSI_TUNNEL_LDP_P2MP: /* fall through */ case BGP_PMSI_TUNNEL_LDP_MP2MP: ND_TCHECK_8(tptr); - ND_PRINT((ndo, "\n\t Root-Node %s, LSP-ID 0x%08x", + ND_PRINT("\n\t Root-Node %s, LSP-ID 0x%08x", ipaddr_string(ndo, tptr), - EXTRACT_BE_U_4(tptr + 4))); + EXTRACT_BE_U_4(tptr + 4)); break; case BGP_PMSI_TUNNEL_RSVP_P2MP: ND_TCHECK_8(tptr); - ND_PRINT((ndo, "\n\t Extended-Tunnel-ID %s, P2MP-ID 0x%08x", + ND_PRINT("\n\t Extended-Tunnel-ID %s, P2MP-ID 0x%08x", ipaddr_string(ndo, tptr), - EXTRACT_BE_U_4(tptr + 4))); + EXTRACT_BE_U_4(tptr + 4)); break; default: if (ndo->ndo_vflag <= 1) { @@ -2349,9 +2349,9 @@ bgp_attr_print(netdissect_options *ndo, tptr += 3; tlen -= 3; - ND_PRINT((ndo, "\n\t %s TLV (%u), length %u", + ND_PRINT("\n\t %s TLV (%u), length %u", tok2str(bgp_aigp_values, "Unknown", type), - type, length)); + type, length); if (length < 3) goto trunc; @@ -2367,8 +2367,8 @@ bgp_attr_print(netdissect_options *ndo, case BGP_AIGP_TLV: if (length < 8) goto trunc; - ND_PRINT((ndo, ", metric %" PRIu64, - EXTRACT_BE_U_8(tptr))); + ND_PRINT(", metric %" PRIu64, + EXTRACT_BE_U_8(tptr)); break; default: @@ -2386,8 +2386,8 @@ bgp_attr_print(netdissect_options *ndo, ND_TCHECK_4(tptr); if (len < 4) goto trunc; - ND_PRINT((ndo, "\n\t Origin AS: %s", - as_printf(ndo, astostr, sizeof(astostr), EXTRACT_BE_U_4(tptr)))); + ND_PRINT("\n\t Origin AS: %s", + as_printf(ndo, astostr, sizeof(astostr), EXTRACT_BE_U_4(tptr))); tptr += 4; len -= 4; @@ -2409,21 +2409,21 @@ bgp_attr_print(netdissect_options *ndo, tptr += alenlen; len -= alenlen; - ND_PRINT((ndo, "\n\t %s (%u), length: %u", + ND_PRINT("\n\t %s (%u), length: %u", tok2str(bgp_attr_values, "Unknown Attribute", atype), atype, - alen)); + alen); if (aflags) { - ND_PRINT((ndo, ", Flags [%s%s%s%s", + ND_PRINT(", Flags [%s%s%s%s", aflags & 0x80 ? "O" : "", aflags & 0x40 ? "T" : "", aflags & 0x20 ? "P" : "", - aflags & 0x10 ? "E" : "")); + aflags & 0x10 ? "E" : ""); if (aflags & 0xf) - ND_PRINT((ndo, "+%x", aflags & 0xf)); - ND_PRINT((ndo, "]: ")); + ND_PRINT("+%x", aflags & 0xf); + ND_PRINT("]: "); } /* FIXME check for recursion */ if (!bgp_attr_print(ndo, atype, tptr, alen)) @@ -2435,17 +2435,17 @@ bgp_attr_print(netdissect_options *ndo, case BGPTYPE_LARGE_COMMUNITY: if (len == 0 || len % 12) { - ND_PRINT((ndo, "invalid len")); + ND_PRINT("invalid len"); break; } - ND_PRINT((ndo, "\n\t ")); + ND_PRINT("\n\t "); while (len != 0) { ND_TCHECK_LEN(tptr, 12); - ND_PRINT((ndo, "%u:%u:%u%s", + ND_PRINT("%u:%u:%u%s", EXTRACT_BE_U_4(tptr), EXTRACT_BE_U_4(tptr + 4), EXTRACT_BE_U_4(tptr + 8), - (len > 12) ? ", " : "")); + (len > 12) ? ", " : ""); tptr += 12; /* * len will always be a multiple of 12, as per the above, @@ -2456,7 +2456,7 @@ bgp_attr_print(netdissect_options *ndo, break; default: ND_TCHECK_LEN(pptr, len); - ND_PRINT((ndo, "\n\t no Attribute %u decoder", atype)); /* we have no decoder for the attribute */ + ND_PRINT("\n\t no Attribute %u decoder", atype); /* we have no decoder for the attribute */ if (ndo->ndo_vflag <= 1) print_unknown_data(ndo, pptr, "\n\t ", len); break; @@ -2483,34 +2483,34 @@ bgp_capabilities_print(netdissect_options *ndo, cap_type=EXTRACT_U_1(opt + i); cap_len=EXTRACT_U_1(opt + i + 1); tcap_len=cap_len; - ND_PRINT((ndo, "\n\t %s (%u), length: %u", + ND_PRINT("\n\t %s (%u), length: %u", tok2str(bgp_capcode_values, "Unknown", cap_type), cap_type, - cap_len)); + cap_len); ND_TCHECK_LEN(opt + 2 + i, cap_len); switch (cap_type) { case BGP_CAPCODE_MP: - ND_PRINT((ndo, "\n\t\tAFI %s (%u), SAFI %s (%u)", + ND_PRINT("\n\t\tAFI %s (%u), SAFI %s (%u)", tok2str(af_values, "Unknown", EXTRACT_BE_U_2(opt + i + 2)), EXTRACT_BE_U_2(opt + i + 2), tok2str(bgp_safi_values, "Unknown", EXTRACT_U_1(opt + i + 5)), - EXTRACT_U_1(opt + i + 5))); + EXTRACT_U_1(opt + i + 5)); break; case BGP_CAPCODE_RESTART: - ND_PRINT((ndo, "\n\t\tRestart Flags: [%s], Restart Time %us", + ND_PRINT("\n\t\tRestart Flags: [%s], Restart Time %us", ((EXTRACT_U_1(opt + i + 2))&0x80) ? "R" : "none", - EXTRACT_BE_U_2(opt + i + 2)&0xfff)); + EXTRACT_BE_U_2(opt + i + 2)&0xfff); tcap_len-=2; cap_offset=4; while(tcap_len>=4) { - ND_PRINT((ndo, "\n\t\t AFI %s (%u), SAFI %s (%u), Forwarding state preserved: %s", + ND_PRINT("\n\t\t AFI %s (%u), SAFI %s (%u), Forwarding state preserved: %s", tok2str(af_values,"Unknown", EXTRACT_BE_U_2(opt + i + cap_offset)), EXTRACT_BE_U_2(opt + i + cap_offset), tok2str(bgp_safi_values,"Unknown", EXTRACT_U_1(opt + i + cap_offset + 2)), EXTRACT_U_1(opt + (i + cap_offset + 2)), - ((EXTRACT_U_1(opt + (i + cap_offset + 3)))&0x80) ? "yes" : "no" )); + ((EXTRACT_U_1(opt + (i + cap_offset + 3)))&0x80) ? "yes" : "no" ); tcap_len -= 4; cap_offset += 4; } @@ -2524,36 +2524,36 @@ bgp_capabilities_print(netdissect_options *ndo, * Extract the 4 byte AS number encoded. */ if (cap_len == 4) { - ND_PRINT((ndo, "\n\t\t 4 Byte AS %s", + ND_PRINT("\n\t\t 4 Byte AS %s", as_printf(ndo, astostr, sizeof(astostr), - EXTRACT_BE_U_4(opt + i + 2)))); + EXTRACT_BE_U_4(opt + i + 2))); } break; case BGP_CAPCODE_ADD_PATH: cap_offset=2; if (tcap_len == 0) { - ND_PRINT((ndo, " (bogus)")); /* length */ + ND_PRINT(" (bogus)"); /* length */ break; } while (tcap_len != 0) { if (tcap_len < 4) { - ND_PRINT((ndo, "\n\t\t(invalid)")); + ND_PRINT("\n\t\t(invalid)"); break; } - ND_PRINT((ndo, "\n\t\tAFI %s (%u), SAFI %s (%u), Send/Receive: %s", + ND_PRINT("\n\t\tAFI %s (%u), SAFI %s (%u), Send/Receive: %s", tok2str(af_values,"Unknown",EXTRACT_BE_U_2(opt + i + cap_offset)), EXTRACT_BE_U_2(opt + i + cap_offset), tok2str(bgp_safi_values,"Unknown",EXTRACT_U_1(opt + i + cap_offset + 2)), EXTRACT_U_1(opt + (i + cap_offset + 2)), tok2str(bgp_add_path_recvsend,"Bogus (0x%02x)",EXTRACT_U_1(opt + i + cap_offset + 3)) - )); + ); tcap_len -= 4; cap_offset += 4; } break; default: - ND_PRINT((ndo, "\n\t\tno decoder for Capability %u", - cap_type)); + ND_PRINT("\n\t\tno decoder for Capability %u", + cap_type); if (ndo->ndo_vflag <= 1) print_unknown_data(ndo, opt + i + 2, "\n\t\t", cap_len); @@ -2567,7 +2567,7 @@ bgp_capabilities_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|BGP]")); + ND_PRINT("[|BGP]"); } static void @@ -2586,15 +2586,15 @@ bgp_open_print(netdissect_options *ndo, bgp_open_header = (const struct bgp_open *)dat; - ND_PRINT((ndo, "\n\t Version %u, ", - EXTRACT_U_1(bgp_open_header->bgpo_version))); - ND_PRINT((ndo, "my AS %s, ", - as_printf(ndo, astostr, sizeof(astostr), EXTRACT_BE_U_2(bgp_open_header->bgpo_myas)))); - ND_PRINT((ndo, "Holdtime %us, ", - EXTRACT_BE_U_2(bgp_open_header->bgpo_holdtime))); - ND_PRINT((ndo, "ID %s", ipaddr_string(ndo, &bgp_open_header->bgpo_id))); + ND_PRINT("\n\t Version %u, ", + EXTRACT_U_1(bgp_open_header->bgpo_version)); + ND_PRINT("my AS %s, ", + as_printf(ndo, astostr, sizeof(astostr), EXTRACT_BE_U_2(bgp_open_header->bgpo_myas))); + ND_PRINT("Holdtime %us, ", + EXTRACT_BE_U_2(bgp_open_header->bgpo_holdtime)); + ND_PRINT("ID %s", ipaddr_string(ndo, &bgp_open_header->bgpo_id)); optslen = EXTRACT_U_1(bgp_open_header->bgpo_optlen); - ND_PRINT((ndo, "\n\t Optional parameters, length: %u", optslen)); + ND_PRINT("\n\t Optional parameters, length: %u", optslen); opt = dat + BGP_OPEN_SIZE; length -= BGP_OPEN_SIZE; @@ -2610,15 +2610,15 @@ bgp_open_print(netdissect_options *ndo, opt_type = EXTRACT_U_1(bgpopt->bgpopt_type); opt_len = EXTRACT_U_1(bgpopt->bgpopt_len); if (BGP_OPT_SIZE + i + opt_len > optslen) { - ND_PRINT((ndo, "\n\t Option %u, length: %u, goes past the end of the options", - opt_type, opt_len)); + ND_PRINT("\n\t Option %u, length: %u, goes past the end of the options", + opt_type, opt_len); break; } - ND_PRINT((ndo, "\n\t Option %s (%u), length: %u", + ND_PRINT("\n\t Option %s (%u), length: %u", tok2str(bgp_opt_values,"Unknown",opt_type), opt_type, - opt_len)); + opt_len); /* now let's decode the options we know*/ switch(opt_type) { @@ -2630,15 +2630,15 @@ bgp_open_print(netdissect_options *ndo, case BGP_OPT_AUTH: default: - ND_PRINT((ndo, "\n\t no decoder for option %u", - opt_type)); + ND_PRINT("\n\t no decoder for option %u", + opt_type); break; } i += BGP_OPT_SIZE + opt_len; } return; trunc: - ND_PRINT((ndo, "[|BGP]")); + ND_PRINT("[|BGP]"); } static void @@ -2676,7 +2676,7 @@ bgp_update_print(netdissect_options *ndo, ND_TCHECK_LEN(p, withdrawn_routes_len); if (length < withdrawn_routes_len) goto trunc; - ND_PRINT((ndo, "\n\t Withdrawn routes:")); + ND_PRINT("\n\t Withdrawn routes:"); add_path = check_add_path(ndo, p, withdrawn_routes_len, 32); while (withdrawn_routes_len != 0) { if (add_path) { @@ -2692,16 +2692,16 @@ bgp_update_print(netdissect_options *ndo, } wpfx = decode_prefix4(ndo, p, withdrawn_routes_len, buf, sizeof(buf)); if (wpfx == -1) { - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); break; } else if (wpfx == -2) goto trunc; else if (wpfx == -3) goto trunc; /* bytes left, but not enough */ else { - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); if (add_path) { - ND_PRINT((ndo, " Path Id: %u", path_id)); + ND_PRINT(" Path Id: %u", path_id); } p += wpfx; length -= wpfx; @@ -2722,7 +2722,7 @@ bgp_update_print(netdissect_options *ndo, if (withdrawn_routes_len == 0 && len == 0 && length == 0) { /* No withdrawn routes, no path attributes, no NLRI */ - ND_PRINT((ndo, "\n\t End-of-Rib Marker (empty NLRI)")); + ND_PRINT("\n\t End-of-Rib Marker (empty NLRI)"); return; } @@ -2752,20 +2752,20 @@ bgp_update_print(netdissect_options *ndo, len -= alenlen; length -= alenlen; - ND_PRINT((ndo, "\n\t %s (%u), length: %u", + ND_PRINT("\n\t %s (%u), length: %u", tok2str(bgp_attr_values, "Unknown Attribute", atype), atype, - alen)); + alen); if (aflags) { - ND_PRINT((ndo, ", Flags [%s%s%s%s", + ND_PRINT(", Flags [%s%s%s%s", aflags & 0x80 ? "O" : "", aflags & 0x40 ? "T" : "", aflags & 0x20 ? "P" : "", - aflags & 0x10 ? "E" : "")); + aflags & 0x10 ? "E" : ""); if (aflags & 0xf) - ND_PRINT((ndo, "+%x", aflags & 0xf)); - ND_PRINT((ndo, "]: ")); + ND_PRINT("+%x", aflags & 0xf); + ND_PRINT("]: "); } if (len < alen) goto trunc; @@ -2781,7 +2781,7 @@ bgp_update_print(netdissect_options *ndo, if (length) { add_path = check_add_path(ndo, p, length, 32); - ND_PRINT((ndo, "\n\t Updated routes:")); + ND_PRINT("\n\t Updated routes:"); while (length != 0) { if (add_path) { path_id = EXTRACT_BE_U_4(p); @@ -2790,16 +2790,16 @@ bgp_update_print(netdissect_options *ndo, } i = decode_prefix4(ndo, p, length, buf, sizeof(buf)); if (i == -1) { - ND_PRINT((ndo, "\n\t (illegal prefix length)")); + ND_PRINT("\n\t (illegal prefix length)"); break; } else if (i == -2) goto trunc; else if (i == -3) goto trunc; /* bytes left, but not enough */ else { - ND_PRINT((ndo, "\n\t %s", buf)); + ND_PRINT("\n\t %s", buf); if (add_path) { - ND_PRINT((ndo, " Path Id: %u", path_id)); + ND_PRINT(" Path Id: %u", path_id); } p += i; length -= i; @@ -2808,7 +2808,7 @@ bgp_update_print(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "[|BGP]")); + ND_PRINT("[|BGP]"); } static void @@ -2829,48 +2829,48 @@ bgp_notification_print(netdissect_options *ndo, bgpn_major = EXTRACT_U_1(bgp_notification_header->bgpn_major); bgpn_minor = EXTRACT_U_1(bgp_notification_header->bgpn_minor); - ND_PRINT((ndo, ", %s (%u)", + ND_PRINT(", %s (%u)", tok2str(bgp_notify_major_values, "Unknown Error", bgpn_major), - bgpn_major)); + bgpn_major); switch (bgpn_major) { case BGP_NOTIFY_MAJOR_MSG: - ND_PRINT((ndo, ", subcode %s (%u)", + ND_PRINT(", subcode %s (%u)", tok2str(bgp_notify_minor_msg_values, "Unknown", bgpn_minor), - bgpn_minor)); + bgpn_minor); break; case BGP_NOTIFY_MAJOR_OPEN: - ND_PRINT((ndo, ", subcode %s (%u)", + ND_PRINT(", subcode %s (%u)", tok2str(bgp_notify_minor_open_values, "Unknown", bgpn_minor), - bgpn_minor)); + bgpn_minor); break; case BGP_NOTIFY_MAJOR_UPDATE: - ND_PRINT((ndo, ", subcode %s (%u)", + ND_PRINT(", subcode %s (%u)", tok2str(bgp_notify_minor_update_values, "Unknown", bgpn_minor), - bgpn_minor)); + bgpn_minor); break; case BGP_NOTIFY_MAJOR_FSM: - ND_PRINT((ndo, " subcode %s (%u)", + ND_PRINT(" subcode %s (%u)", tok2str(bgp_notify_minor_fsm_values, "Unknown", bgpn_minor), - bgpn_minor)); + bgpn_minor); break; case BGP_NOTIFY_MAJOR_CAP: - ND_PRINT((ndo, " subcode %s (%u)", + ND_PRINT(" subcode %s (%u)", tok2str(bgp_notify_minor_cap_values, "Unknown", bgpn_minor), - bgpn_minor)); + bgpn_minor); break; case BGP_NOTIFY_MAJOR_CEASE: - ND_PRINT((ndo, ", subcode %s (%u)", + ND_PRINT(", subcode %s (%u)", tok2str(bgp_notify_minor_cease_values, "Unknown", bgpn_minor), - bgpn_minor)); + bgpn_minor); /* draft-ietf-idr-cease-subcode-02 mentions optionally 7 bytes * for the maxprefix subtype, which may contain AFI, SAFI and MAXPREFIXES @@ -2878,12 +2878,12 @@ bgp_notification_print(netdissect_options *ndo, if(bgpn_minor == BGP_NOTIFY_MINOR_CEASE_MAXPRFX && length >= BGP_NOTIFICATION_SIZE + 7) { tptr = dat + BGP_NOTIFICATION_SIZE; ND_TCHECK_7(tptr); - ND_PRINT((ndo, ", AFI %s (%u), SAFI %s (%u), Max Prefixes: %u", + ND_PRINT(", AFI %s (%u), SAFI %s (%u), Max Prefixes: %u", tok2str(af_values, "Unknown", EXTRACT_BE_U_2(tptr)), EXTRACT_BE_U_2(tptr), tok2str(bgp_safi_values, "Unknown", EXTRACT_U_1((tptr + 2))), EXTRACT_U_1((tptr + 2)), - EXTRACT_BE_U_4(tptr + 3))); + EXTRACT_BE_U_4(tptr + 3)); } /* * draft-ietf-idr-shutdown describes a method to send a communication @@ -2899,23 +2899,23 @@ bgp_notification_print(netdissect_options *ndo, /* garbage, hexdump it all */ if (shutdown_comm_length > BGP_NOTIFY_MINOR_CEASE_ADMIN_SHUTDOWN_LEN || shutdown_comm_length > length - (BGP_NOTIFICATION_SIZE + 1)) { - ND_PRINT((ndo, ", invalid Shutdown Communication length")); + ND_PRINT(", invalid Shutdown Communication length"); } else if (shutdown_comm_length == 0) { - ND_PRINT((ndo, ", empty Shutdown Communication")); + ND_PRINT(", empty Shutdown Communication"); remainder_offset += 1; } /* a proper shutdown communication */ else { ND_TCHECK_LEN(tptr + 1, shutdown_comm_length); - ND_PRINT((ndo, ", Shutdown Communication (length: %u): \"", shutdown_comm_length)); + ND_PRINT(", Shutdown Communication (length: %u): \"", shutdown_comm_length); (void)fn_printn(ndo, tptr+1, shutdown_comm_length, NULL); - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); remainder_offset += shutdown_comm_length + 1; } /* if there is trailing data, hexdump it */ if(length - (remainder_offset + BGP_NOTIFICATION_SIZE) > 0) { - ND_PRINT((ndo, ", Data: (length: %u)", length - (remainder_offset + BGP_NOTIFICATION_SIZE))); + ND_PRINT(", Data: (length: %u)", length - (remainder_offset + BGP_NOTIFICATION_SIZE)); hex_print(ndo, "\n\t\t", tptr + remainder_offset, length - (remainder_offset + BGP_NOTIFICATION_SIZE)); } } @@ -2926,7 +2926,7 @@ bgp_notification_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|BGP]")); + ND_PRINT("[|BGP]"); } static void @@ -2943,13 +2943,13 @@ bgp_route_refresh_print(netdissect_options *ndo, bgp_route_refresh_header = (const struct bgp_route_refresh *)pptr; - ND_PRINT((ndo, "\n\t AFI %s (%u), SAFI %s (%u)", + ND_PRINT("\n\t AFI %s (%u), SAFI %s (%u)", tok2str(af_values,"Unknown", EXTRACT_BE_U_2(bgp_route_refresh_header->afi)), EXTRACT_BE_U_2(bgp_route_refresh_header->afi), tok2str(bgp_safi_values,"Unknown", EXTRACT_U_1(bgp_route_refresh_header->safi)), - EXTRACT_U_1(bgp_route_refresh_header->safi))); + EXTRACT_U_1(bgp_route_refresh_header->safi)); if (ndo->ndo_vflag > 1) { ND_TCHECK_LEN(pptr, len); @@ -2958,7 +2958,7 @@ bgp_route_refresh_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|BGP]")); + ND_PRINT("[|BGP]"); } static int @@ -2972,10 +2972,10 @@ bgp_pdu_print(netdissect_options *ndo, bgp_header = (const struct bgp *)dat; bgp_type = EXTRACT_U_1(bgp_header->bgp_type); - ND_PRINT((ndo, "\n\t%s Message (%u), length: %u", + ND_PRINT("\n\t%s Message (%u), length: %u", tok2str(bgp_msg_values, "Unknown", bgp_type), bgp_type, - length)); + length); switch (bgp_type) { case BGP_OPEN: @@ -2995,13 +2995,13 @@ bgp_pdu_print(netdissect_options *ndo, default: /* we have no decoder for the BGP message */ ND_TCHECK_LEN(dat, length); - ND_PRINT((ndo, "\n\t no Message %u decoder", bgp_type)); + ND_PRINT("\n\t no Message %u decoder", bgp_type); print_unknown_data(ndo, dat, "\n\t ", length); break; } return 1; trunc: - ND_PRINT((ndo, "[|BGP]")); + ND_PRINT("[|BGP]"); return 0; } @@ -3023,7 +3023,7 @@ bgp_print(netdissect_options *ndo, if (ndo->ndo_snapend < dat + length) ep = ndo->ndo_snapend; - ND_PRINT((ndo, ": BGP")); + ND_PRINT(": BGP"); if (ndo->ndo_vflag < 1) /* lets be less chatty */ return; @@ -3050,12 +3050,12 @@ bgp_print(netdissect_options *ndo, bgp_header = (const struct bgp *)p; if (start != p) - ND_PRINT((ndo, " [|BGP]")); + ND_PRINT(" [|BGP]"); hlen = EXTRACT_BE_U_2(bgp_header->bgp_len); if (hlen < BGP_SIZE) { - ND_PRINT((ndo, "\n[|BGP Bogus header length %u < %u]", hlen, - BGP_SIZE)); + ND_PRINT("\n[|BGP Bogus header length %u < %u]", hlen, + BGP_SIZE); break; } @@ -3065,10 +3065,10 @@ bgp_print(netdissect_options *ndo, p += hlen; start = p; } else { - ND_PRINT((ndo, "\n[|BGP %s]", + ND_PRINT("\n[|BGP %s]", tok2str(bgp_msg_values, "Unknown Message Type", - EXTRACT_U_1(bgp_header->bgp_type)))); + EXTRACT_U_1(bgp_header->bgp_type))); break; } } @@ -3076,7 +3076,7 @@ bgp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " [|BGP]")); + ND_PRINT(" [|BGP]"); } /* diff --git a/print-bootp.c b/print-bootp.c index ba6449bd..5568cd7c 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -291,18 +291,18 @@ bootp_print(netdissect_options *ndo, bp = (const struct bootp *)cp; ND_TCHECK(bp->bp_op); bp_op = EXTRACT_U_1(bp->bp_op); - ND_PRINT((ndo, "BOOTP/DHCP, %s", - tok2str(bootp_op_values, "unknown (0x%02x)", bp_op))); + ND_PRINT("BOOTP/DHCP, %s", + tok2str(bootp_op_values, "unknown (0x%02x)", bp_op)); ND_TCHECK(bp->bp_hlen); bp_htype = EXTRACT_U_1(bp->bp_htype); bp_hlen = EXTRACT_U_1(bp->bp_hlen); if (bp_htype == 1 && bp_hlen == 6 && bp_op == BOOTPREQUEST) { ND_TCHECK_LEN(bp->bp_chaddr, 6); - ND_PRINT((ndo, " from %s", etheraddr_string(ndo, bp->bp_chaddr))); + ND_PRINT(" from %s", etheraddr_string(ndo, bp->bp_chaddr)); } - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT(", length %u", length); if (!ndo->ndo_vflag) return; @@ -311,73 +311,73 @@ bootp_print(netdissect_options *ndo, /* The usual hardware address type is 1 (10Mb Ethernet) */ if (bp_htype != 1) - ND_PRINT((ndo, ", htype %d", bp_htype)); + ND_PRINT(", htype %d", bp_htype); /* The usual length for 10Mb Ethernet address is 6 bytes */ if (bp_htype != 1 || bp_hlen != 6) - ND_PRINT((ndo, ", hlen %d", bp_hlen)); + ND_PRINT(", hlen %d", bp_hlen); /* Only print interesting fields */ if (EXTRACT_U_1(bp->bp_hops)) - ND_PRINT((ndo, ", hops %d", EXTRACT_U_1(bp->bp_hops))); + ND_PRINT(", hops %d", EXTRACT_U_1(bp->bp_hops)); if (EXTRACT_BE_U_4(bp->bp_xid)) - ND_PRINT((ndo, ", xid 0x%x", EXTRACT_BE_U_4(bp->bp_xid))); + ND_PRINT(", xid 0x%x", EXTRACT_BE_U_4(bp->bp_xid)); if (EXTRACT_BE_U_2(bp->bp_secs)) - ND_PRINT((ndo, ", secs %d", EXTRACT_BE_U_2(bp->bp_secs))); + ND_PRINT(", secs %d", EXTRACT_BE_U_2(bp->bp_secs)); ND_TCHECK(bp->bp_flags); - ND_PRINT((ndo, ", Flags [%s]", - bittok2str(bootp_flag_values, "none", EXTRACT_BE_U_2(bp->bp_flags)))); + ND_PRINT(", Flags [%s]", + bittok2str(bootp_flag_values, "none", EXTRACT_BE_U_2(bp->bp_flags))); if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, " (0x%04x)", EXTRACT_BE_U_2(bp->bp_flags))); + ND_PRINT(" (0x%04x)", EXTRACT_BE_U_2(bp->bp_flags)); /* Client's ip address */ ND_TCHECK(bp->bp_ciaddr); if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_ciaddr.s_addr)) - ND_PRINT((ndo, "\n\t Client-IP %s", ipaddr_string(ndo, &bp->bp_ciaddr))); + ND_PRINT("\n\t Client-IP %s", ipaddr_string(ndo, &bp->bp_ciaddr)); /* 'your' ip address (bootp client) */ ND_TCHECK(bp->bp_yiaddr); if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_yiaddr.s_addr)) - ND_PRINT((ndo, "\n\t Your-IP %s", ipaddr_string(ndo, &bp->bp_yiaddr))); + ND_PRINT("\n\t Your-IP %s", ipaddr_string(ndo, &bp->bp_yiaddr)); /* Server's ip address */ ND_TCHECK(bp->bp_siaddr); if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_siaddr.s_addr)) - ND_PRINT((ndo, "\n\t Server-IP %s", ipaddr_string(ndo, &bp->bp_siaddr))); + ND_PRINT("\n\t Server-IP %s", ipaddr_string(ndo, &bp->bp_siaddr)); /* Gateway's ip address */ ND_TCHECK(bp->bp_giaddr); if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_giaddr.s_addr)) - ND_PRINT((ndo, "\n\t Gateway-IP %s", ipaddr_string(ndo, &bp->bp_giaddr))); + ND_PRINT("\n\t Gateway-IP %s", ipaddr_string(ndo, &bp->bp_giaddr)); /* Client's Ethernet address */ if (bp_htype == 1 && bp_hlen == 6) { ND_TCHECK_LEN(bp->bp_chaddr, 6); - ND_PRINT((ndo, "\n\t Client-Ethernet-Address %s", etheraddr_string(ndo, bp->bp_chaddr))); + ND_PRINT("\n\t Client-Ethernet-Address %s", etheraddr_string(ndo, bp->bp_chaddr)); } ND_TCHECK_1(bp->bp_sname); /* check first char only */ if (EXTRACT_U_1(bp->bp_sname)) { - ND_PRINT((ndo, "\n\t sname \"")); + ND_PRINT("\n\t sname \""); if (fn_printztn(ndo, bp->bp_sname, (u_int)sizeof bp->bp_sname, ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); - ND_PRINT((ndo, "%s", tstr + 1)); + ND_PRINT("\""); + ND_PRINT("%s", tstr + 1); return; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); } ND_TCHECK_1(bp->bp_file); /* check first char only */ if (EXTRACT_U_1(bp->bp_file)) { - ND_PRINT((ndo, "\n\t file \"")); + ND_PRINT("\n\t file \""); if (fn_printztn(ndo, bp->bp_file, (u_int)sizeof bp->bp_file, ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); - ND_PRINT((ndo, "%s", tstr + 1)); + ND_PRINT("\""); + ND_PRINT("%s", tstr + 1); return; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); } /* Decode the vendor buffer */ @@ -393,12 +393,12 @@ bootp_print(netdissect_options *ndo, ul = EXTRACT_BE_U_4(bp->bp_vend); if (ul != 0) - ND_PRINT((ndo, "\n\t Vendor-#0x%x", ul)); + ND_PRINT("\n\t Vendor-#0x%x", ul); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* @@ -607,10 +607,10 @@ rfc1048_print(netdissect_options *ndo, uint16_t us; uint8_t uc, subopt, suboptlen; - ND_PRINT((ndo, "\n\t Vendor-rfc1048 Extensions")); + ND_PRINT("\n\t Vendor-rfc1048 Extensions"); /* Step over magic cookie */ - ND_PRINT((ndo, "\n\t Magic Cookie 0x%08x", EXTRACT_BE_U_4(bp))); + ND_PRINT("\n\t Magic Cookie 0x%08x", EXTRACT_BE_U_4(bp)); bp += sizeof(int32_t); /* Loop while we there is a tag left in the buffer */ @@ -642,8 +642,8 @@ rfc1048_print(netdissect_options *ndo, bp++; } - ND_PRINT((ndo, "\n\t %s Option %u, length %u%s", cp, tag, len, - len > 0 ? ": " : "")); + ND_PRINT("\n\t %s Option %u, length %u%s", cp, tag, len, + len > 0 ? ": " : ""); if (tag == TAG_PAD && ndo->ndo_vflag > 2) { u_int ntag = 1; @@ -653,18 +653,18 @@ rfc1048_print(netdissect_options *ndo, ntag++; } if (ntag > 1) - ND_PRINT((ndo, ", occurs %u", ntag)); + ND_PRINT(", occurs %u", ntag); } if (!ND_TTEST_LEN(bp, len)) { - ND_PRINT((ndo, "[|rfc1048 %u]", len)); + ND_PRINT("[|rfc1048 %u]", len); return; } if (tag == TAG_DHCP_MESSAGE && len == 1) { uc = EXTRACT_U_1(bp); bp++; - ND_PRINT((ndo, "%s", tok2str(dhcp_msg_values, "Unknown (%u)", uc))); + ND_PRINT("%s", tok2str(dhcp_msg_values, "Unknown (%u)", uc)); continue; } @@ -675,10 +675,10 @@ rfc1048_print(netdissect_options *ndo, bp++; cp = tok2str(tag2str, "?Option %u", uc); if (idx % 4 == 0) - ND_PRINT((ndo, "\n\t ")); + ND_PRINT("\n\t "); else - ND_PRINT((ndo, ", ")); - ND_PRINT((ndo, "%s", cp + 1)); + ND_PRINT(", "); + ND_PRINT("%s", cp + 1); idx++; } continue; @@ -692,8 +692,8 @@ rfc1048_print(netdissect_options *ndo, bp += 2; cp = tok2str(xtag2str, "?xT%u", us); if (!first) - ND_PRINT((ndo, "+")); - ND_PRINT((ndo, "%s", cp + 1)); + ND_PRINT("+"); + ND_PRINT("%s", cp + 1); first = 0; } continue; @@ -714,12 +714,12 @@ rfc1048_print(netdissect_options *ndo, case 'a': /* ASCII strings */ - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); if (fn_printn(ndo, bp, len, ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); goto trunc; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); bp += len; len = 0; break; @@ -730,15 +730,15 @@ rfc1048_print(netdissect_options *ndo, /* ip addresses/32-bit words */ while (len >= sizeof(ul)) { if (!first) - ND_PRINT((ndo, ",")); + ND_PRINT(","); ul = EXTRACT_BE_U_4(bp); if (c == 'i') { ul = htonl(ul); - ND_PRINT((ndo, "%s", ipaddr_string(ndo, &ul))); + ND_PRINT("%s", ipaddr_string(ndo, &ul)); } else if (c == 'L') - ND_PRINT((ndo, "%d", ul)); + ND_PRINT("%d", ul); else - ND_PRINT((ndo, "%u", ul)); + ND_PRINT("%u", ul); bp += sizeof(ul); len -= sizeof(ul); first = 0; @@ -749,12 +749,12 @@ rfc1048_print(netdissect_options *ndo, /* IP address pairs */ while (len >= 2*sizeof(ul)) { if (!first) - ND_PRINT((ndo, ",")); + ND_PRINT(","); memcpy((char *)&ul, (const char *)bp, sizeof(ul)); - ND_PRINT((ndo, "(%s:", ipaddr_string(ndo, &ul))); + ND_PRINT("(%s:", ipaddr_string(ndo, &ul)); bp += sizeof(ul); memcpy((char *)&ul, (const char *)bp, sizeof(ul)); - ND_PRINT((ndo, "%s)", ipaddr_string(ndo, &ul))); + ND_PRINT("%s)", ipaddr_string(ndo, &ul)); bp += sizeof(ul); len -= 2*sizeof(ul); first = 0; @@ -765,9 +765,9 @@ rfc1048_print(netdissect_options *ndo, /* shorts */ while (len >= sizeof(us)) { if (!first) - ND_PRINT((ndo, ",")); + ND_PRINT(","); us = EXTRACT_BE_U_2(bp); - ND_PRINT((ndo, "%u", us)); + ND_PRINT("%u", us); bp += sizeof(us); len -= sizeof(us); first = 0; @@ -779,17 +779,17 @@ rfc1048_print(netdissect_options *ndo, while (len > 0) { uint8_t bool_value; if (!first) - ND_PRINT((ndo, ",")); + ND_PRINT(","); bool_value = EXTRACT_U_1(bp); switch (bool_value) { case 0: - ND_PRINT((ndo, "N")); + ND_PRINT("N"); break; case 1: - ND_PRINT((ndo, "Y")); + ND_PRINT("Y"); break; default: - ND_PRINT((ndo, "%u?", bool_value)); + ND_PRINT("%u?", bool_value); break; } ++bp; @@ -805,12 +805,12 @@ rfc1048_print(netdissect_options *ndo, while (len > 0) { uint8_t byte_value; if (!first) - ND_PRINT((ndo, c == 'x' ? ":" : ".")); + ND_PRINT(c == 'x' ? ":" : "."); byte_value = EXTRACT_U_1(bp); if (c == 'x') - ND_PRINT((ndo, "%02x", byte_value)); + ND_PRINT("%02x", byte_value); else - ND_PRINT((ndo, "%u", byte_value)); + ND_PRINT("%u", byte_value); ++bp; --len; first = 0; @@ -824,47 +824,47 @@ rfc1048_print(netdissect_options *ndo, case TAG_NETBIOS_NODE: /* this option should be at least 1 byte long */ if (len < 1) { - ND_PRINT((ndo, "ERROR: length < 1 bytes")); + ND_PRINT("ERROR: length < 1 bytes"); break; } tag = EXTRACT_U_1(bp); ++bp; --len; - ND_PRINT((ndo, "%s", tok2str(nbo2str, NULL, tag))); + ND_PRINT("%s", tok2str(nbo2str, NULL, tag)); break; case TAG_OPT_OVERLOAD: /* this option should be at least 1 byte long */ if (len < 1) { - ND_PRINT((ndo, "ERROR: length < 1 bytes")); + ND_PRINT("ERROR: length < 1 bytes"); break; } tag = EXTRACT_U_1(bp); ++bp; --len; - ND_PRINT((ndo, "%s", tok2str(oo2str, NULL, tag))); + ND_PRINT("%s", tok2str(oo2str, NULL, tag)); break; case TAG_CLIENT_FQDN: /* this option should be at least 3 bytes long */ if (len < 3) { - ND_PRINT((ndo, "ERROR: length < 3 bytes")); + ND_PRINT("ERROR: length < 3 bytes"); bp += len; len = 0; break; } if (EXTRACT_U_1(bp)) - ND_PRINT((ndo, "[%s] ", client_fqdn_flags(EXTRACT_U_1(bp)))); + ND_PRINT("[%s] ", client_fqdn_flags(EXTRACT_U_1(bp))); bp++; if (EXTRACT_U_1(bp) || EXTRACT_U_1(bp + 1)) - ND_PRINT((ndo, "%u/%u ", EXTRACT_U_1(bp), EXTRACT_U_1(bp + 1))); + ND_PRINT("%u/%u ", EXTRACT_U_1(bp), EXTRACT_U_1(bp + 1)); bp += 2; - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); if (fn_printn(ndo, bp, len - 3, ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); goto trunc; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); bp += len - 3; len = 0; break; @@ -875,28 +875,28 @@ rfc1048_print(netdissect_options *ndo, /* this option should be at least 1 byte long */ if (len < 1) { - ND_PRINT((ndo, "ERROR: length < 1 bytes")); + ND_PRINT("ERROR: length < 1 bytes"); break; } type = EXTRACT_U_1(bp); bp++; len--; if (type == 0) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); if (fn_printn(ndo, bp, len, ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); goto trunc; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); bp += len; len = 0; break; } else { - ND_PRINT((ndo, "%s ", tok2str(arp2str, "hardware-type %u,", type))); + ND_PRINT("%s ", tok2str(arp2str, "hardware-type %u,", type)); while (len > 0) { if (!first) - ND_PRINT((ndo, ":")); - ND_PRINT((ndo, "%02x", EXTRACT_U_1(bp))); + ND_PRINT(":"); + ND_PRINT("%02x", EXTRACT_U_1(bp)); ++bp; --len; first = 0; @@ -912,18 +912,18 @@ rfc1048_print(netdissect_options *ndo, bp += 2; len -= 2; if (suboptlen > len) { - ND_PRINT((ndo, "\n\t %s SubOption %u, length %u: length goes past end of option", + ND_PRINT("\n\t %s SubOption %u, length %u: length goes past end of option", tok2str(agent_suboption_values, "Unknown", subopt), subopt, - suboptlen)); + suboptlen); bp += len; len = 0; break; } - ND_PRINT((ndo, "\n\t %s SubOption %u, length %u: ", + ND_PRINT("\n\t %s SubOption %u, length %u: ", tok2str(agent_suboption_values, "Unknown", subopt), subopt, - suboptlen)); + suboptlen); switch (subopt) { case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */ @@ -949,20 +949,20 @@ rfc1048_print(netdissect_options *ndo, /* this option should be at least 5 bytes long */ if (len < 5) { - ND_PRINT((ndo, "ERROR: length < 5 bytes")); + ND_PRINT("ERROR: length < 5 bytes"); bp += len; len = 0; break; } while (len > 0) { if (!first) - ND_PRINT((ndo, ",")); + ND_PRINT(","); mask_width = EXTRACT_U_1(bp); bp++; len--; /* mask_width <= 32 */ if (mask_width > 32) { - ND_PRINT((ndo, "[ERROR: Mask width (%d) > 32]", mask_width)); + ND_PRINT("[ERROR: Mask width (%d) > 32]", mask_width); bp += len; len = 0; break; @@ -970,27 +970,27 @@ rfc1048_print(netdissect_options *ndo, significant_octets = (mask_width + 7) / 8; /* significant octets + router(4) */ if (len < significant_octets + 4) { - ND_PRINT((ndo, "[ERROR: Remaining length (%u) < %u bytes]", len, significant_octets + 4)); + ND_PRINT("[ERROR: Remaining length (%u) < %u bytes]", len, significant_octets + 4); bp += len; len = 0; break; } - ND_PRINT((ndo, "(")); + ND_PRINT("("); if (mask_width == 0) - ND_PRINT((ndo, "default")); + ND_PRINT("default"); else { for (i = 0; i < significant_octets ; i++) { if (i > 0) - ND_PRINT((ndo, ".")); - ND_PRINT((ndo, "%d", EXTRACT_U_1(bp))); + ND_PRINT("."); + ND_PRINT("%d", EXTRACT_U_1(bp)); bp++; } for (i = significant_octets ; i < 4 ; i++) - ND_PRINT((ndo, ".0")); - ND_PRINT((ndo, "/%d", mask_width)); + ND_PRINT(".0"); + ND_PRINT("/%d", mask_width); } memcpy((char *)&ul, (const char *)bp, sizeof(ul)); - ND_PRINT((ndo, ":%s)", ipaddr_string(ndo, &ul))); + ND_PRINT(":%s)", ipaddr_string(ndo, &ul)); bp += sizeof(ul); len -= (significant_octets + 4); first = 0; @@ -1004,7 +1004,7 @@ rfc1048_print(netdissect_options *ndo, first = 1; if (len < 2) { - ND_PRINT((ndo, "ERROR: length < 2 bytes")); + ND_PRINT("ERROR: length < 2 bytes"); bp += len; len = 0; break; @@ -1013,27 +1013,27 @@ rfc1048_print(netdissect_options *ndo, suboptlen = EXTRACT_U_1(bp); bp++; len--; - ND_PRINT((ndo, "\n\t ")); - ND_PRINT((ndo, "instance#%u: ", suboptnumber)); + ND_PRINT("\n\t "); + ND_PRINT("instance#%u: ", suboptnumber); if (suboptlen == 0) { - ND_PRINT((ndo, "ERROR: suboption length must be non-zero")); + ND_PRINT("ERROR: suboption length must be non-zero"); bp += len; len = 0; break; } if (len < suboptlen) { - ND_PRINT((ndo, "ERROR: invalid option")); + ND_PRINT("ERROR: invalid option"); bp += len; len = 0; break; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); if (fn_printn(ndo, bp, suboptlen, ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); goto trunc; } - ND_PRINT((ndo, "\"")); - ND_PRINT((ndo, ", length %d", suboptlen)); + ND_PRINT("\""); + ND_PRINT(", length %d", suboptlen); suboptnumber++; len -= suboptlen; bp += suboptlen; @@ -1042,8 +1042,8 @@ rfc1048_print(netdissect_options *ndo, } default: - ND_PRINT((ndo, "[unknown special tag %u, size %u]", - tag, len)); + ND_PRINT("[unknown special tag %u, size %u]", + tag, len); bp += len; len = 0; break; @@ -1052,18 +1052,18 @@ rfc1048_print(netdissect_options *ndo, } /* Data left over? */ if (len) { - ND_PRINT((ndo, "\n\t trailing data length %u", len)); + ND_PRINT("\n\t trailing data length %u", len); bp += len; } } return; trunc: - ND_PRINT((ndo, "|[rfc1048]")); + ND_PRINT("|[rfc1048]"); } #define PRINTCMUADDR(m, s) { ND_TCHECK(cmu->m); \ if (cmu->m.s_addr != 0) \ - ND_PRINT((ndo, " %s:%s", s, ipaddr_string(ndo, &cmu->m.s_addr))); } + ND_PRINT(" %s:%s", s, ipaddr_string(ndo, &cmu->m.s_addr)); } static void cmu_print(netdissect_options *ndo, @@ -1072,14 +1072,14 @@ cmu_print(netdissect_options *ndo, const struct cmu_vend *cmu; uint8_t v_flags; - ND_PRINT((ndo, " vend-cmu")); + ND_PRINT(" vend-cmu"); cmu = (const struct cmu_vend *)bp; /* Only print if there are unknown bits */ ND_TCHECK(cmu->v_flags); v_flags = EXTRACT_U_1(cmu->v_flags); if ((v_flags & ~(VF_SMASK)) != 0) - ND_PRINT((ndo, " F:0x%x", v_flags)); + ND_PRINT(" F:0x%x", v_flags); PRINTCMUADDR(v_dgate, "DG"); PRINTCMUADDR(v_smask, v_flags & VF_SMASK ? "SM" : "SM*"); PRINTCMUADDR(v_dns1, "NS1"); @@ -1091,7 +1091,7 @@ cmu_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } #undef PRINTCMUADDR @@ -46,14 +46,14 @@ bt_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char * const pcap_bluetooth_h4_header* hdr = (const pcap_bluetooth_h4_header*)p; if (caplen < BT_HDRLEN) { - ND_PRINT((ndo, "[|bt]")); + ND_PRINT("[|bt]"); return (BT_HDRLEN); } caplen -= BT_HDRLEN; length -= BT_HDRLEN; p += BT_HDRLEN; if (ndo->ndo_eflag) - ND_PRINT((ndo, "hci length %d, direction %s, ", length, (EXTRACT_BE_U_4(&hdr->direction)&0x1)?"in":"out")); + ND_PRINT("hci length %d, direction %s, ", length, (EXTRACT_BE_U_4(&hdr->direction)&0x1)?"in":"out"); if (!ndo->ndo_suppress_default_print) ND_DEFAULTPRINT(p, caplen); diff --git a/print-calm-fast.c b/print-calm-fast.c index 6fa91a8f..7198f27f 100644 --- a/print-calm-fast.c +++ b/print-calm-fast.c @@ -51,19 +51,19 @@ calm_fast_print(netdissect_options *ndo, const u_char *bp, u_int length, const s length -= 2; bp += 2; - ND_PRINT((ndo, "CALM FAST")); + ND_PRINT("CALM FAST"); if (src != NULL) - ND_PRINT((ndo, " src:%s", (src->addr_string)(ndo, src->addr))); - ND_PRINT((ndo, "; ")); - ND_PRINT((ndo, "SrcNwref:%d; ", srcNwref)); - ND_PRINT((ndo, "DstNwref:%d; ", dstNwref)); + ND_PRINT(" src:%s", (src->addr_string)(ndo, src->addr)); + ND_PRINT("; "); + ND_PRINT("SrcNwref:%d; ", srcNwref); + ND_PRINT("DstNwref:%d; ", dstNwref); if (ndo->ndo_vflag) ND_DEFAULTPRINT(bp, length); return; trunc: - ND_PRINT((ndo, "[|calm fast]")); + ND_PRINT("[|calm fast]"); return; } diff --git a/print-carp.c b/print-carp.c index 807e977f..c7d62ce0 100644 --- a/print-carp.c +++ b/print-carp.c @@ -58,26 +58,26 @@ carp_print(netdissect_options *ndo, const u_char *bp, u_int len, int ttl) type_s = "advertise"; else type_s = "unknown"; - ND_PRINT((ndo, "CARPv%d-%s %d: ", version, type_s, len)); + ND_PRINT("CARPv%d-%s %d: ", version, type_s, len); if (ttl != 255) - ND_PRINT((ndo, "[ttl=%d!] ", ttl)); + ND_PRINT("[ttl=%d!] ", ttl); if (version != 2 || type != 1) return; ND_TCHECK_1(bp + 2); ND_TCHECK_1(bp + 5); - ND_PRINT((ndo, "vhid=%d advbase=%d advskew=%d authlen=%d ", - EXTRACT_U_1(bp + 1), EXTRACT_U_1(bp + 5), EXTRACT_U_1(bp + 2), EXTRACT_U_1(bp + 3))); + ND_PRINT("vhid=%d advbase=%d advskew=%d authlen=%d ", + EXTRACT_U_1(bp + 1), EXTRACT_U_1(bp + 5), EXTRACT_U_1(bp + 2), EXTRACT_U_1(bp + 3)); if (ndo->ndo_vflag) { struct cksum_vec vec[1]; vec[0].ptr = (const uint8_t *)bp; vec[0].len = len; if (ND_TTEST_LEN(bp, len) && in_cksum(vec, 1)) - ND_PRINT((ndo, " (bad carp cksum %x!)", - EXTRACT_BE_U_2(bp + 6))); + ND_PRINT(" (bad carp cksum %x!)", + EXTRACT_BE_U_2(bp + 6)); } - ND_PRINT((ndo, "counter=%" PRIu64, EXTRACT_BE_U_8(bp + 8))); + ND_PRINT("counter=%" PRIu64, EXTRACT_BE_U_8(bp + 8)); return; trunc: - ND_PRINT((ndo, "[|carp]")); + ND_PRINT("[|carp]"); } diff --git a/print-cdp.c b/print-cdp.c index bf826265..d07a62fb 100644 --- a/print-cdp.c +++ b/print-cdp.c @@ -98,17 +98,17 @@ cdp_print(netdissect_options *ndo, const u_char *tptr; if (caplen < CDP_HEADER_LEN) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } tptr = pptr; /* temporary pointer */ ND_TCHECK_LEN(tptr, CDP_HEADER_LEN); - ND_PRINT((ndo, "CDPv%u, ttl: %us", EXTRACT_U_1((tptr + CDP_HEADER_VERSION_OFFSET)), - EXTRACT_U_1(tptr + CDP_HEADER_TTL_OFFSET))); + ND_PRINT("CDPv%u, ttl: %us", EXTRACT_U_1((tptr + CDP_HEADER_VERSION_OFFSET)), + EXTRACT_U_1(tptr + CDP_HEADER_TTL_OFFSET)); if (ndo->ndo_vflag) - ND_PRINT((ndo, ", checksum: 0x%04x (unverified), length %u", EXTRACT_BE_U_2(tptr + CDP_HEADER_CHECKSUM_OFFSET), length)); + ND_PRINT(", checksum: 0x%04x (unverified), length %u", EXTRACT_BE_U_2(tptr + CDP_HEADER_CHECKSUM_OFFSET), length); tptr += CDP_HEADER_LEN; while (tptr < (pptr+length)) { @@ -117,15 +117,15 @@ cdp_print(netdissect_options *ndo, len = EXTRACT_BE_U_2(tptr + CDP_TLV_LEN_OFFSET); /* object length includes the 4 bytes header length */ if (len < CDP_TLV_HEADER_LEN) { if (ndo->ndo_vflag) - ND_PRINT((ndo, "\n\t%s (0x%02x), TLV length: %u byte%s (too short)", + ND_PRINT("\n\t%s (0x%02x), TLV length: %u byte%s (too short)", tok2str(cdp_tlv_values,"unknown field type", type), type, len, - PLURAL_SUFFIX(len))); /* plural */ + PLURAL_SUFFIX(len)); /* plural */ else - ND_PRINT((ndo, ", %s TLV length %u too short", + ND_PRINT(", %s TLV length %u too short", tok2str(cdp_tlv_values,"unknown field type", type), - len)); + len); break; } tptr += CDP_TLV_HEADER_LEN; @@ -136,52 +136,52 @@ cdp_print(netdissect_options *ndo, if (ndo->ndo_vflag || type == 1) { /* in non-verbose mode just print Device-ID */ if (ndo->ndo_vflag) - ND_PRINT((ndo, "\n\t%s (0x%02x), value length: %u byte%s: ", + ND_PRINT("\n\t%s (0x%02x), value length: %u byte%s: ", tok2str(cdp_tlv_values,"unknown field type", type), type, len, - PLURAL_SUFFIX(len))); /* plural */ + PLURAL_SUFFIX(len)); /* plural */ switch (type) { case 0x01: /* Device-ID */ if (!ndo->ndo_vflag) - ND_PRINT((ndo, ", Device-ID ")); - ND_PRINT((ndo, "'")); + ND_PRINT(", Device-ID "); + ND_PRINT("'"); (void)fn_printn(ndo, tptr, len, NULL); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); break; case 0x02: /* Address */ if (cdp_print_addr(ndo, tptr, len) < 0) goto trunc; break; case 0x03: /* Port-ID */ - ND_PRINT((ndo, "'")); + ND_PRINT("'"); (void)fn_printn(ndo, tptr, len, NULL); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); break; case 0x04: /* Capabilities */ if (len < 4) goto trunc; - ND_PRINT((ndo, "(0x%08x): %s", + ND_PRINT("(0x%08x): %s", EXTRACT_BE_U_4(tptr), - bittok2str(cdp_capability_values, "none", EXTRACT_BE_U_4(tptr)))); + bittok2str(cdp_capability_values, "none", EXTRACT_BE_U_4(tptr))); break; case 0x05: /* Version */ - ND_PRINT((ndo, "\n\t ")); + ND_PRINT("\n\t "); for (i=0;i<len;i++) { j = EXTRACT_U_1(tptr + i); if (j == '\n') /* lets rework the version string to get a nice indentation */ - ND_PRINT((ndo, "\n\t ")); + ND_PRINT("\n\t "); else fn_print_char(ndo, j); } break; case 0x06: /* Platform */ - ND_PRINT((ndo, "'")); + ND_PRINT("'"); (void)fn_printn(ndo, tptr, len, NULL); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); break; case 0x07: /* Prefixes */ if (cdp_print_prefixes(ndo, tptr, len) < 0) @@ -190,19 +190,19 @@ cdp_print(netdissect_options *ndo, case 0x08: /* Protocol Hello Option - not documented */ break; case 0x09: /* VTP Mgmt Domain - CDPv2 */ - ND_PRINT((ndo, "'")); + ND_PRINT("'"); (void)fn_printn(ndo, tptr, len, NULL); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); break; case 0x0a: /* Native VLAN ID - CDPv2 */ if (len < 2) goto trunc; - ND_PRINT((ndo, "%d", EXTRACT_BE_U_2(tptr))); + ND_PRINT("%d", EXTRACT_BE_U_2(tptr)); break; case 0x0b: /* Duplex - CDPv2 */ if (len < 1) goto trunc; - ND_PRINT((ndo, "%s", EXTRACT_U_1(tptr) ? "full": "half")); + ND_PRINT("%s", EXTRACT_U_1(tptr) ? "full": "half"); break; /* http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cata/186/2_12_m/english/release/notes/186rn21m.html @@ -211,30 +211,30 @@ cdp_print(netdissect_options *ndo, case 0x0e: /* ATA-186 VoIP VLAN request - incomplete doc. */ if (len < 3) goto trunc; - ND_PRINT((ndo, "app %d, vlan %d", EXTRACT_U_1((tptr)), EXTRACT_BE_U_2(tptr + 1))); + ND_PRINT("app %d, vlan %d", EXTRACT_U_1((tptr)), EXTRACT_BE_U_2(tptr + 1)); break; case 0x10: /* ATA-186 VoIP VLAN assignment - incomplete doc. */ - ND_PRINT((ndo, "%1.2fW", cdp_get_number(tptr, len) / 1000.0)); + ND_PRINT("%1.2fW", cdp_get_number(tptr, len) / 1000.0); break; case 0x11: /* MTU - not documented */ if (len < 4) goto trunc; - ND_PRINT((ndo, "%u bytes", EXTRACT_BE_U_4(tptr))); + ND_PRINT("%u bytes", EXTRACT_BE_U_4(tptr)); break; case 0x12: /* AVVID trust bitmap - not documented */ if (len < 1) goto trunc; - ND_PRINT((ndo, "0x%02x", EXTRACT_U_1(tptr))); + ND_PRINT("0x%02x", EXTRACT_U_1(tptr)); break; case 0x13: /* AVVID untrusted port CoS - not documented */ if (len < 1) goto trunc; - ND_PRINT((ndo, "0x%02x", EXTRACT_U_1(tptr))); + ND_PRINT("0x%02x", EXTRACT_U_1(tptr)); break; case 0x14: /* System Name - not documented */ - ND_PRINT((ndo, "'")); + ND_PRINT("'"); (void)fn_printn(ndo, tptr, len, NULL); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); break; case 0x16: /* System Object ID - not documented */ if (cdp_print_addr(ndo, tptr, len) < 0) @@ -243,9 +243,9 @@ cdp_print(netdissect_options *ndo, case 0x17: /* Physical Location - not documented */ if (len < 1) goto trunc; - ND_PRINT((ndo, "0x%02x", EXTRACT_U_1(tptr))); + ND_PRINT("0x%02x", EXTRACT_U_1(tptr)); if (len > 1) { - ND_PRINT((ndo, "/")); + ND_PRINT("/"); (void)fn_printn(ndo, tptr + 1, len - 1, NULL); } break; @@ -257,11 +257,11 @@ cdp_print(netdissect_options *ndo, tptr = tptr+len; } if (ndo->ndo_vflag < 1) - ND_PRINT((ndo, ", length %u", caplen)); + ND_PRINT(", length %u", caplen); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* @@ -316,7 +316,7 @@ cdp_print_addr(netdissect_options *ndo, ND_TCHECK_4(p); if (p + 4 > endp) goto trunc; - ND_PRINT((ndo, "IPv4 (%u) %s", num, ipaddr_string(ndo, p))); + ND_PRINT("IPv4 (%u) %s", num, ipaddr_string(ndo, p)); p += 4; } else if (pt == PT_IEEE_802_2 && pl == 8 && @@ -332,7 +332,7 @@ cdp_print_addr(netdissect_options *ndo, if (p + al > endp) goto trunc; - ND_PRINT((ndo, "IPv6 (%u) %s", num, ip6addr_string(ndo, p))); + ND_PRINT("IPv6 (%u) %s", num, ip6addr_string(ndo, p)); p += al; } else { @@ -342,27 +342,27 @@ cdp_print_addr(netdissect_options *ndo, ND_TCHECK_LEN(p, pl); if (p + pl > endp) goto trunc; - ND_PRINT((ndo, "pt=0x%02x, pl=%d, pb=", EXTRACT_U_1((p - 2)), pl)); + ND_PRINT("pt=0x%02x, pl=%d, pb=", EXTRACT_U_1((p - 2)), pl); while (pl-- > 0) { - ND_PRINT((ndo, " %02x", EXTRACT_U_1(p))); + ND_PRINT(" %02x", EXTRACT_U_1(p)); p++; } ND_TCHECK_2(p); if (p + 2 > endp) goto trunc; - ND_PRINT((ndo, ", al=%d, a=", al)); + ND_PRINT(", al=%d, a=", al); p += 2; ND_TCHECK_LEN(p, al); if (p + al > endp) goto trunc; while (al-- > 0) { - ND_PRINT((ndo, " %02x", EXTRACT_U_1(p))); + ND_PRINT(" %02x", EXTRACT_U_1(p)); p++; } } num--; if (num) - ND_PRINT((ndo, " ")); + ND_PRINT(" "); } return 0; @@ -379,12 +379,12 @@ cdp_print_prefixes(netdissect_options *ndo, if (l % 5) goto trunc; - ND_PRINT((ndo, " IPv4 Prefixes (%d):", l / 5)); + ND_PRINT(" IPv4 Prefixes (%d):", l / 5); while (l > 0) { - ND_PRINT((ndo, " %u.%u.%u.%u/%u", + ND_PRINT(" %u.%u.%u.%u/%u", EXTRACT_U_1(p), EXTRACT_U_1(p + 1), EXTRACT_U_1(p + 2), - EXTRACT_U_1(p + 3), EXTRACT_U_1(p + 4))); + EXTRACT_U_1(p + 3), EXTRACT_U_1(p + 4)); l -= 5; p += 5; } diff --git a/print-cfm.c b/print-cfm.c index 40565af8..dfd7d2c7 100644 --- a/print-cfm.c +++ b/print-cfm.c @@ -227,14 +227,14 @@ cfm_network_addr_print(netdissect_options *ndo, * is only one octet. */ if (length < 1) { - ND_PRINT((ndo, "\n\t Network Address Type (invalid, no data")); + ND_PRINT("\n\t Network Address Type (invalid, no data"); return hexdump; } /* The calling function must make any due ND_TCHECK calls. */ network_addr_type = EXTRACT_U_1(tptr); - ND_PRINT((ndo, "\n\t Network Address Type %s (%u)", + ND_PRINT("\n\t Network Address Type %s (%u)", tok2str(af_values, "Unknown", network_addr_type), - network_addr_type)); + network_addr_type); /* * Resolve the passed in Address. @@ -242,20 +242,20 @@ cfm_network_addr_print(netdissect_options *ndo, switch(network_addr_type) { case AFNUM_INET: if (length != 1 + 4) { - ND_PRINT((ndo, "(invalid IPv4 address length %u)", length - 1)); + ND_PRINT("(invalid IPv4 address length %u)", length - 1); hexdump = TRUE; break; } - ND_PRINT((ndo, ", %s", ipaddr_string(ndo, tptr + 1))); + ND_PRINT(", %s", ipaddr_string(ndo, tptr + 1)); break; case AFNUM_INET6: if (length != 1 + 16) { - ND_PRINT((ndo, "(invalid IPv6 address length %u)", length - 1)); + ND_PRINT("(invalid IPv6 address length %u)", length - 1); hexdump = TRUE; break; } - ND_PRINT((ndo, ", %s", ip6addr_string(ndo, tptr + 1))); + ND_PRINT(", %s", ip6addr_string(ndo, tptr + 1)); break; default: @@ -301,17 +301,17 @@ cfm_print(netdissect_options *ndo, */ mdlevel_version = EXTRACT_U_1(cfm_common_header->mdlevel_version); if (CFM_EXTRACT_VERSION(mdlevel_version) != CFM_VERSION) { - ND_PRINT((ndo, "CFMv%u not supported, length %u", - CFM_EXTRACT_VERSION(mdlevel_version), length)); + ND_PRINT("CFMv%u not supported, length %u", + CFM_EXTRACT_VERSION(mdlevel_version), length); return; } opcode = EXTRACT_U_1(cfm_common_header->opcode); - ND_PRINT((ndo, "CFMv%u %s, MD Level %u, length %u", + ND_PRINT("CFMv%u %s, MD Level %u, length %u", CFM_EXTRACT_VERSION(mdlevel_version), tok2str(cfm_opcode_values, "unknown (%u)", opcode), CFM_EXTRACT_MD_LEVEL(mdlevel_version), - length)); + length); /* * In non-verbose mode just print the opcode and md-level. @@ -322,7 +322,7 @@ cfm_print(netdissect_options *ndo, flags = EXTRACT_U_1(cfm_common_header->flags); first_tlv_offset = EXTRACT_U_1(cfm_common_header->first_tlv_offset); - ND_PRINT((ndo, "\n\tFirst TLV offset %u", first_tlv_offset)); + ND_PRINT("\n\tFirst TLV offset %u", first_tlv_offset); tptr += sizeof(struct cfm_common_header_t); tlen = length - sizeof(struct cfm_common_header_t); @@ -331,7 +331,7 @@ cfm_print(netdissect_options *ndo, * Sanity check the first TLV offset. */ if (first_tlv_offset > tlen) { - ND_PRINT((ndo, " (too large, must be <= %u)", tlen)); + ND_PRINT(" (too large, must be <= %u)", tlen); return; } @@ -339,8 +339,8 @@ cfm_print(netdissect_options *ndo, case CFM_OPCODE_CCM: msg_ptr.cfm_ccm = (const struct cfm_ccm_t *)tptr; if (first_tlv_offset < sizeof(*msg_ptr.cfm_ccm)) { - ND_PRINT((ndo, " (too small 1, must be >= %lu)", - (unsigned long) sizeof(*msg_ptr.cfm_ccm))); + ND_PRINT(" (too small 1, must be >= %lu)", + (unsigned long) sizeof(*msg_ptr.cfm_ccm)); return; } if (tlen < sizeof(*msg_ptr.cfm_ccm)) @@ -348,25 +348,25 @@ cfm_print(netdissect_options *ndo, ND_TCHECK_SIZE(msg_ptr.cfm_ccm); ccm_interval = CFM_EXTRACT_CCM_INTERVAL(flags); - ND_PRINT((ndo, ", Flags [CCM Interval %u%s]", + ND_PRINT(", Flags [CCM Interval %u%s]", ccm_interval, flags & CFM_CCM_RDI_FLAG ? - ", RDI" : "")); + ", RDI" : ""); /* * Resolve the CCM interval field. */ if (ccm_interval) { - ND_PRINT((ndo, "\n\t CCM Interval %.3fs" + ND_PRINT("\n\t CCM Interval %.3fs" ", min CCM Lifetime %.3fs, max CCM Lifetime %.3fs", ccm_interval_base[ccm_interval], ccm_interval_base[ccm_interval] * CCM_INTERVAL_MIN_MULTIPLIER, - ccm_interval_base[ccm_interval] * CCM_INTERVAL_MAX_MULTIPLIER)); + ccm_interval_base[ccm_interval] * CCM_INTERVAL_MAX_MULTIPLIER); } - ND_PRINT((ndo, "\n\t Sequence Number 0x%08x, MA-End-Point-ID 0x%04x", + ND_PRINT("\n\t Sequence Number 0x%08x, MA-End-Point-ID 0x%04x", EXTRACT_BE_U_4(msg_ptr.cfm_ccm->sequence), - EXTRACT_BE_U_2(msg_ptr.cfm_ccm->ma_epi))); + EXTRACT_BE_U_2(msg_ptr.cfm_ccm->ma_epi)); namesp = msg_ptr.cfm_ccm->names; names_data_remaining = sizeof(msg_ptr.cfm_ccm->names); @@ -381,23 +381,23 @@ cfm_print(netdissect_options *ndo, md_namelength = EXTRACT_U_1(namesp); namesp++; names_data_remaining--; /* We know this is !=0 */ - ND_PRINT((ndo, "\n\t MD Name Format %s (%u), MD Name length %u", + ND_PRINT("\n\t MD Name Format %s (%u), MD Name length %u", tok2str(cfm_md_nameformat_values, "Unknown", md_nameformat), md_nameformat, - md_namelength)); + md_namelength); /* * -3 for the MA short name format and length and one byte * of MA short name. */ if (md_namelength > names_data_remaining - 3) { - ND_PRINT((ndo, " (too large, must be <= %u)", names_data_remaining - 2)); + ND_PRINT(" (too large, must be <= %u)", names_data_remaining - 2); return; } md_name = namesp; - ND_PRINT((ndo, "\n\t MD Name: ")); + ND_PRINT("\n\t MD Name: "); switch (md_nameformat) { case CFM_CCM_MD_FORMAT_DNS: case CFM_CCM_MD_FORMAT_CHAR: @@ -406,10 +406,10 @@ cfm_print(netdissect_options *ndo, case CFM_CCM_MD_FORMAT_MAC: if (md_namelength == 6) { - ND_PRINT((ndo, "\n\t MAC %s", etheraddr_string(ndo, - md_name))); + ND_PRINT("\n\t MAC %s", etheraddr_string(ndo, + md_name)); } else { - ND_PRINT((ndo, "\n\t MAC (length invalid)")); + ND_PRINT("\n\t MAC (length invalid)"); } break; @@ -422,10 +422,10 @@ cfm_print(netdissect_options *ndo, namesp += md_namelength; names_data_remaining -= md_namelength; } else { - ND_PRINT((ndo, "\n\t MD Name Format %s (%u)", + ND_PRINT("\n\t MD Name Format %s (%u)", tok2str(cfm_md_nameformat_values, "Unknown", md_nameformat), - md_nameformat)); + md_nameformat); } @@ -438,19 +438,19 @@ cfm_print(netdissect_options *ndo, ma_namelength = EXTRACT_U_1(namesp); namesp++; names_data_remaining--; /* We know this is != 0 */ - ND_PRINT((ndo, "\n\t MA Name-Format %s (%u), MA name length %u", + ND_PRINT("\n\t MA Name-Format %s (%u), MA name length %u", tok2str(cfm_ma_nameformat_values, "Unknown", ma_nameformat), ma_nameformat, - ma_namelength)); + ma_namelength); if (ma_namelength > names_data_remaining) { - ND_PRINT((ndo, " (too large, must be <= %u)", names_data_remaining)); + ND_PRINT(" (too large, must be <= %u)", names_data_remaining); return; } ma_name = namesp; - ND_PRINT((ndo, "\n\t MA Name: ")); + ND_PRINT("\n\t MA Name: "); switch (ma_nameformat) { case CFM_CCM_MA_FORMAT_CHAR: safeputs(ndo, ma_name, ma_namelength); @@ -469,49 +469,49 @@ cfm_print(netdissect_options *ndo, case CFM_OPCODE_LTM: msg_ptr.cfm_ltm = (const struct cfm_ltm_t *)tptr; if (first_tlv_offset < sizeof(*msg_ptr.cfm_ltm)) { - ND_PRINT((ndo, " (too small 4, must be >= %lu)", - (unsigned long) sizeof(*msg_ptr.cfm_ltm))); + ND_PRINT(" (too small 4, must be >= %lu)", + (unsigned long) sizeof(*msg_ptr.cfm_ltm)); return; } if (tlen < sizeof(*msg_ptr.cfm_ltm)) goto tooshort; ND_TCHECK_SIZE(msg_ptr.cfm_ltm); - ND_PRINT((ndo, ", Flags [%s]", - bittok2str(cfm_ltm_flag_values, "none", flags))); + ND_PRINT(", Flags [%s]", + bittok2str(cfm_ltm_flag_values, "none", flags)); - ND_PRINT((ndo, "\n\t Transaction-ID 0x%08x, ttl %u", + ND_PRINT("\n\t Transaction-ID 0x%08x, ttl %u", EXTRACT_BE_U_4(msg_ptr.cfm_ltm->transaction_id), - EXTRACT_U_1(msg_ptr.cfm_ltm->ttl))); + EXTRACT_U_1(msg_ptr.cfm_ltm->ttl)); - ND_PRINT((ndo, "\n\t Original-MAC %s, Target-MAC %s", + ND_PRINT("\n\t Original-MAC %s, Target-MAC %s", etheraddr_string(ndo, msg_ptr.cfm_ltm->original_mac), - etheraddr_string(ndo, msg_ptr.cfm_ltm->target_mac))); + etheraddr_string(ndo, msg_ptr.cfm_ltm->target_mac)); break; case CFM_OPCODE_LTR: msg_ptr.cfm_ltr = (const struct cfm_ltr_t *)tptr; if (first_tlv_offset < sizeof(*msg_ptr.cfm_ltr)) { - ND_PRINT((ndo, " (too small 5, must be >= %lu)", - (unsigned long) sizeof(*msg_ptr.cfm_ltr))); + ND_PRINT(" (too small 5, must be >= %lu)", + (unsigned long) sizeof(*msg_ptr.cfm_ltr)); return; } if (tlen < sizeof(*msg_ptr.cfm_ltr)) goto tooshort; ND_TCHECK_SIZE(msg_ptr.cfm_ltr); - ND_PRINT((ndo, ", Flags [%s]", - bittok2str(cfm_ltr_flag_values, "none", flags))); + ND_PRINT(", Flags [%s]", + bittok2str(cfm_ltr_flag_values, "none", flags)); - ND_PRINT((ndo, "\n\t Transaction-ID 0x%08x, ttl %u", + ND_PRINT("\n\t Transaction-ID 0x%08x, ttl %u", EXTRACT_BE_U_4(msg_ptr.cfm_ltr->transaction_id), - EXTRACT_U_1(msg_ptr.cfm_ltr->ttl))); + EXTRACT_U_1(msg_ptr.cfm_ltr->ttl)); - ND_PRINT((ndo, "\n\t Replay-Action %s (%u)", + ND_PRINT("\n\t Replay-Action %s (%u)", tok2str(cfm_ltr_replay_action_values, "Unknown", EXTRACT_U_1(msg_ptr.cfm_ltr->replay_action)), - EXTRACT_U_1(msg_ptr.cfm_ltr->replay_action))); + EXTRACT_U_1(msg_ptr.cfm_ltr->replay_action)); break; /* @@ -536,9 +536,9 @@ cfm_print(netdissect_options *ndo, ND_TCHECK_1(cfm_tlv_header->type); cfm_tlv_type = EXTRACT_U_1(cfm_tlv_header->type); - ND_PRINT((ndo, "\n\t%s TLV (0x%02x)", + ND_PRINT("\n\t%s TLV (0x%02x)", tok2str(cfm_tlv_values, "Unknown", cfm_tlv_type), - cfm_tlv_type)); + cfm_tlv_type); if (cfm_tlv_type == CFM_TLV_END) { /* Length is "Not present if the Type field is 0." */ @@ -551,7 +551,7 @@ cfm_print(netdissect_options *ndo, ND_TCHECK_LEN(tptr, sizeof(struct cfm_tlv_header_t)); cfm_tlv_len=EXTRACT_BE_U_2(cfm_tlv_header->length); - ND_PRINT((ndo, ", length %u", cfm_tlv_len)); + ND_PRINT(", length %u", cfm_tlv_len); tptr += sizeof(struct cfm_tlv_header_t); tlen -= sizeof(struct cfm_tlv_header_t); @@ -566,33 +566,33 @@ cfm_print(netdissect_options *ndo, switch(cfm_tlv_type) { case CFM_TLV_PORT_STATUS: if (cfm_tlv_len < 1) { - ND_PRINT((ndo, " (too short, must be >= 1)")); + ND_PRINT(" (too short, must be >= 1)"); return; } - ND_PRINT((ndo, ", Status: %s (%u)", + ND_PRINT(", Status: %s (%u)", tok2str(cfm_tlv_port_status_values, "Unknown", EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr))); + EXTRACT_U_1(tptr)); break; case CFM_TLV_INTERFACE_STATUS: if (cfm_tlv_len < 1) { - ND_PRINT((ndo, " (too short, must be >= 1)")); + ND_PRINT(" (too short, must be >= 1)"); return; } - ND_PRINT((ndo, ", Status: %s (%u)", + ND_PRINT(", Status: %s (%u)", tok2str(cfm_tlv_interface_status_values, "Unknown", EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr))); + EXTRACT_U_1(tptr)); break; case CFM_TLV_PRIVATE: if (cfm_tlv_len < 4) { - ND_PRINT((ndo, " (too short, must be >= 4)")); + ND_PRINT(" (too short, must be >= 4)"); return; } - ND_PRINT((ndo, ", Vendor: %s (%u), Sub-Type %u", + ND_PRINT(", Vendor: %s (%u), Sub-Type %u", tok2str(oui_values,"Unknown", EXTRACT_BE_U_3(tptr)), EXTRACT_BE_U_3(tptr), - EXTRACT_U_1(tptr + 3))); + EXTRACT_U_1(tptr + 3)); hexdump = TRUE; break; @@ -602,7 +602,7 @@ cfm_print(netdissect_options *ndo, u_int mgmt_addr_length; if (cfm_tlv_len < 1) { - ND_PRINT((ndo, " (too short, must be >= 1)")); + ND_PRINT(" (too short, must be >= 1)"); goto next_tlv; } @@ -622,20 +622,20 @@ cfm_print(netdissect_options *ndo, * IEEE 802.1AB-2016 Section 8.5.2.2: chassis ID subtype */ if (cfm_tlv_len < 1) { - ND_PRINT((ndo, "\n\t (TLV too short)")); + ND_PRINT("\n\t (TLV too short)"); goto next_tlv; } chassis_id_type = EXTRACT_U_1(tptr); cfm_tlv_len--; - ND_PRINT((ndo, "\n\t Chassis-ID Type %s (%u), Chassis-ID length %u", + ND_PRINT("\n\t Chassis-ID Type %s (%u), Chassis-ID length %u", tok2str(cfm_tlv_senderid_chassisid_values, "Unknown", chassis_id_type), chassis_id_type, - chassis_id_length)); + chassis_id_length); if (cfm_tlv_len < chassis_id_length) { - ND_PRINT((ndo, "\n\t (TLV too short)")); + ND_PRINT("\n\t (TLV too short)"); goto next_tlv; } @@ -643,11 +643,11 @@ cfm_print(netdissect_options *ndo, switch (chassis_id_type) { case CFM_CHASSIS_ID_MAC_ADDRESS: if (chassis_id_length != MAC_ADDR_LEN) { - ND_PRINT((ndo, " (invalid MAC address length)")); + ND_PRINT(" (invalid MAC address length)"); hexdump = TRUE; break; } - ND_PRINT((ndo, "\n\t MAC %s", etheraddr_string(ndo, tptr + 1))); + ND_PRINT("\n\t MAC %s", etheraddr_string(ndo, tptr + 1)); break; case CFM_CHASSIS_ID_NETWORK_ADDRESS: @@ -688,11 +688,11 @@ cfm_print(netdissect_options *ndo, tptr++; tlen--; cfm_tlv_len--; - ND_PRINT((ndo, "\n\t Management Address Domain Length %u", mgmt_addr_length)); + ND_PRINT("\n\t Management Address Domain Length %u", mgmt_addr_length); if (mgmt_addr_length) { /* IEEE 802.1Q-2014 Section 21.5.3.5: Management Address Domain */ if (cfm_tlv_len < mgmt_addr_length) { - ND_PRINT((ndo, "\n\t (TLV too short)")); + ND_PRINT("\n\t (TLV too short)"); goto next_tlv; } cfm_tlv_len -= mgmt_addr_length; @@ -708,7 +708,7 @@ cfm_print(netdissect_options *ndo, * This field is present if Management Address Domain Length is not 0. */ if (cfm_tlv_len < 1) { - ND_PRINT((ndo, " (Management Address Length is missing)")); + ND_PRINT(" (Management Address Length is missing)"); hexdump = TRUE; break; } @@ -718,11 +718,11 @@ cfm_print(netdissect_options *ndo, tptr++; tlen--; cfm_tlv_len--; - ND_PRINT((ndo, "\n\t Management Address Length %u", mgmt_addr_length)); + ND_PRINT("\n\t Management Address Length %u", mgmt_addr_length); if (mgmt_addr_length) { /* IEEE 802.1Q-2014 Section 21.5.3.7: Management Address */ if (cfm_tlv_len < mgmt_addr_length) { - ND_PRINT((ndo, "\n\t (TLV too short)")); + ND_PRINT("\n\t (TLV too short)"); return; } cfm_tlv_len -= mgmt_addr_length; @@ -760,9 +760,9 @@ next_tlv: return; tooshort: - ND_PRINT((ndo, "\n\t\t packet is too short")); + ND_PRINT("\n\t\t packet is too short"); return; trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); } diff --git a/print-chdlc.c b/print-chdlc.c index 0d5085f3..f05d7bd6 100644 --- a/print-chdlc.c +++ b/print-chdlc.c @@ -61,11 +61,11 @@ chdlc_print(netdissect_options *ndo, const u_char *p, u_int length) ND_TCHECK_LEN(p, CHDLC_HDRLEN); proto = EXTRACT_BE_U_2(p + 2); if (ndo->ndo_eflag) { - ND_PRINT((ndo, "%s, ethertype %s (0x%04x), length %u: ", + ND_PRINT("%s, ethertype %s (0x%04x), length %u: ", tok2str(chdlc_cast_values, "0x%02x", EXTRACT_U_1(p)), tok2str(ethertype_values, "Unknown", proto), proto, - length)); + length); } length -= CHDLC_HDRLEN; @@ -104,14 +104,14 @@ chdlc_print(netdissect_options *ndo, const u_char *p, u_int length) break; default: if (!ndo->ndo_eflag) - ND_PRINT((ndo, "unknown CHDLC protocol (0x%04x)", proto)); + ND_PRINT("unknown CHDLC protocol (0x%04x)", proto); break; } return (CHDLC_HDRLEN); trunc: - ND_PRINT((ndo, "[|chdlc]")); + ND_PRINT("[|chdlc]"); return ndo->ndo_snapend - bp; } @@ -145,7 +145,7 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length) const struct cisco_slarp *slarp; u_int sec,min,hrs,days; - ND_PRINT((ndo, "SLARP (length: %u), ",length)); + ND_PRINT("SLARP (length: %u), ",length); if (length < SLARP_MIN_LEN) goto trunc; @@ -153,7 +153,7 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length) ND_TCHECK_LEN(slarp, SLARP_MIN_LEN); switch (EXTRACT_BE_U_4(slarp->code)) { case SLARP_REQUEST: - ND_PRINT((ndo, "request")); + ND_PRINT("request"); /* * At least according to William "Chops" Westfield's * message in @@ -165,15 +165,15 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length) */ break; case SLARP_REPLY: - ND_PRINT((ndo, "reply %s/%s", + ND_PRINT("reply %s/%s", ipaddr_string(ndo, &slarp->un.addr.addr), - ipaddr_string(ndo, &slarp->un.addr.mask))); + ipaddr_string(ndo, &slarp->un.addr.mask)); break; case SLARP_KEEPALIVE: - ND_PRINT((ndo, "keepalive: mineseen=0x%08x, yourseen=0x%08x, reliability=0x%04x", + ND_PRINT("keepalive: mineseen=0x%08x, yourseen=0x%08x, reliability=0x%04x", EXTRACT_BE_U_4(slarp->un.keep.myseq), EXTRACT_BE_U_4(slarp->un.keep.yourseq), - EXTRACT_BE_U_2(slarp->un.keep.rel))); + EXTRACT_BE_U_2(slarp->un.keep.rel)); if (length >= SLARP_MAX_LEN) { /* uptime-stamp is optional */ cp += SLARP_MIN_LEN; @@ -182,24 +182,24 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length) min = sec / 60; sec -= min * 60; hrs = min / 60; min -= hrs * 60; days = hrs / 24; hrs -= days * 24; - ND_PRINT((ndo, ", link uptime=%ud%uh%um%us",days,hrs,min,sec)); + ND_PRINT(", link uptime=%ud%uh%um%us",days,hrs,min,sec); } break; default: - ND_PRINT((ndo, "0x%02x unknown", EXTRACT_BE_U_4(slarp->code))); + ND_PRINT("0x%02x unknown", EXTRACT_BE_U_4(slarp->code)); if (ndo->ndo_vflag <= 1) print_unknown_data(ndo,cp+4,"\n\t",length-4); break; } if (SLARP_MAX_LEN < length && ndo->ndo_vflag) - ND_PRINT((ndo, ", (trailing junk: %u bytes)", length - SLARP_MAX_LEN)); + ND_PRINT(", (trailing junk: %u bytes)", length - SLARP_MAX_LEN); if (ndo->ndo_vflag > 1) print_unknown_data(ndo,cp+4,"\n\t",length-4); return; trunc: - ND_PRINT((ndo, "[|slarp]")); + ND_PRINT("[|slarp]"); } diff --git a/print-cip.c b/print-cip.c index a123b69f..678d4e99 100644 --- a/print-cip.c +++ b/print-cip.c @@ -47,7 +47,7 @@ cip_print(netdissect_options *ndo, u_int length) /* * There is no MAC-layer header, so just print the length. */ - ND_PRINT((ndo, "%u: ", length)); + ND_PRINT("%u: ", length); } /* @@ -74,7 +74,7 @@ cip_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char cip_print(ndo, length); if (cmplen == 0) { - ND_PRINT((ndo, "[|cip]")); + ND_PRINT("[|cip]"); return 0; } if (memcmp(rfcllc, p, cmplen) == 0) { diff --git a/print-cnfp.c b/print-cnfp.c index f0d381ac..84de1294 100644 --- a/print-cnfp.c +++ b/print-cnfp.c @@ -180,14 +180,14 @@ cnfp_v1_print(netdissect_options *ndo, const u_char *cp) t = EXTRACT_BE_U_4(nh->utc_sec); #endif - ND_PRINT((ndo, "NetFlow v%x, %u.%03u uptime, %u.%09u, ", ver, + ND_PRINT("NetFlow v%x, %u.%03u uptime, %u.%09u, ", ver, EXTRACT_BE_U_4(nh->msys_uptime)/1000, EXTRACT_BE_U_4(nh->msys_uptime)%1000, - EXTRACT_BE_U_4(nh->utc_sec), EXTRACT_BE_U_4(nh->utc_nsec))); + EXTRACT_BE_U_4(nh->utc_sec), EXTRACT_BE_U_4(nh->utc_nsec)); nr = (const struct nfrec_v1 *)&nh[1]; - ND_PRINT((ndo, "%2u recs", nrecs)); + ND_PRINT("%2u recs", nrecs); for (; nrecs != 0; nr++, nrecs--) { char buf[20]; @@ -197,51 +197,51 @@ cnfp_v1_print(netdissect_options *ndo, const u_char *cp) * Make sure we have the entire record. */ ND_TCHECK_SIZE(nr); - ND_PRINT((ndo, "\n started %u.%03u, last %u.%03u", + ND_PRINT("\n started %u.%03u, last %u.%03u", EXTRACT_BE_U_4(nr->start_time)/1000, EXTRACT_BE_U_4(nr->start_time)%1000, EXTRACT_BE_U_4(nr->last_time)/1000, - EXTRACT_BE_U_4(nr->last_time)%1000)); + EXTRACT_BE_U_4(nr->last_time)%1000); asbuf[0] = buf[0] = '\0'; - ND_PRINT((ndo, "\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf, - EXTRACT_BE_U_2(nr->srcport))); + ND_PRINT("\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf, + EXTRACT_BE_U_2(nr->srcport)); - ND_PRINT((ndo, "> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf, - EXTRACT_BE_U_2(nr->dstport))); + ND_PRINT("> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf, + EXTRACT_BE_U_2(nr->dstport)); - ND_PRINT((ndo, ">> %s\n ", intoa(nr->nhop_ina.s_addr))); + ND_PRINT(">> %s\n ", intoa(nr->nhop_ina.s_addr)); proto = EXTRACT_U_1(nr->proto); if (!ndo->ndo_nflag && (p_name = netdb_protoname(proto)) != NULL) - ND_PRINT((ndo, "%s ", p_name)); + ND_PRINT("%s ", p_name); else - ND_PRINT((ndo, "%u ", proto)); + ND_PRINT("%u ", proto); /* tcp flags for tcp only */ if (proto == IPPROTO_TCP) { u_int flags; flags = EXTRACT_U_1(nr->tcp_flags); - ND_PRINT((ndo, "%s%s%s%s%s%s%s", + ND_PRINT("%s%s%s%s%s%s%s", flags & TH_FIN ? "F" : "", flags & TH_SYN ? "S" : "", flags & TH_RST ? "R" : "", flags & TH_PUSH ? "P" : "", flags & TH_ACK ? "A" : "", flags & TH_URG ? "U" : "", - flags ? " " : "")); + flags ? " " : ""); } buf[0]='\0'; - ND_PRINT((ndo, "tos %u, %u (%u octets) %s", + ND_PRINT("tos %u, %u (%u octets) %s", EXTRACT_U_1(nr->tos), EXTRACT_BE_U_4(nr->packets), - EXTRACT_BE_U_4(nr->octets), buf)); + EXTRACT_BE_U_4(nr->octets), buf); } return; trunc: - ND_PRINT((ndo, "[|cnfp]")); + ND_PRINT("[|cnfp]"); return; } @@ -271,15 +271,15 @@ cnfp_v5_print(netdissect_options *ndo, const u_char *cp) t = EXTRACT_BE_U_4(nh->utc_sec); #endif - ND_PRINT((ndo, "NetFlow v%x, %u.%03u uptime, %u.%09u, ", ver, + ND_PRINT("NetFlow v%x, %u.%03u uptime, %u.%09u, ", ver, EXTRACT_BE_U_4(nh->msys_uptime)/1000, EXTRACT_BE_U_4(nh->msys_uptime)%1000, - EXTRACT_BE_U_4(nh->utc_sec), EXTRACT_BE_U_4(nh->utc_nsec))); + EXTRACT_BE_U_4(nh->utc_sec), EXTRACT_BE_U_4(nh->utc_nsec)); - ND_PRINT((ndo, "#%u, ", EXTRACT_BE_U_4(nh->sequence))); + ND_PRINT("#%u, ", EXTRACT_BE_U_4(nh->sequence)); nr = (const struct nfrec_v5 *)&nh[1]; - ND_PRINT((ndo, "%2u recs", nrecs)); + ND_PRINT("%2u recs", nrecs); for (; nrecs != 0; nr++, nrecs--) { char buf[20]; @@ -289,57 +289,57 @@ cnfp_v5_print(netdissect_options *ndo, const u_char *cp) * Make sure we have the entire record. */ ND_TCHECK_SIZE(nr); - ND_PRINT((ndo, "\n started %u.%03u, last %u.%03u", + ND_PRINT("\n started %u.%03u, last %u.%03u", EXTRACT_BE_U_4(nr->start_time)/1000, EXTRACT_BE_U_4(nr->start_time)%1000, EXTRACT_BE_U_4(nr->last_time)/1000, - EXTRACT_BE_U_4(nr->last_time)%1000)); + EXTRACT_BE_U_4(nr->last_time)%1000); asbuf[0] = buf[0] = '\0'; snprintf(buf, sizeof(buf), "/%u", EXTRACT_U_1(nr->src_mask)); snprintf(asbuf, sizeof(asbuf), ":%u", EXTRACT_BE_U_2(nr->src_as)); - ND_PRINT((ndo, "\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf, - EXTRACT_BE_U_2(nr->srcport))); + ND_PRINT("\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf, + EXTRACT_BE_U_2(nr->srcport)); snprintf(buf, sizeof(buf), "/%u", EXTRACT_U_1(nr->dst_mask)); snprintf(asbuf, sizeof(asbuf), ":%u", EXTRACT_BE_U_2(nr->dst_as)); - ND_PRINT((ndo, "> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf, - EXTRACT_BE_U_2(nr->dstport))); + ND_PRINT("> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf, + EXTRACT_BE_U_2(nr->dstport)); - ND_PRINT((ndo, ">> %s\n ", intoa(nr->nhop_ina.s_addr))); + ND_PRINT(">> %s\n ", intoa(nr->nhop_ina.s_addr)); proto = EXTRACT_U_1(nr->proto); if (!ndo->ndo_nflag && (p_name = netdb_protoname(proto)) != NULL) - ND_PRINT((ndo, "%s ", p_name)); + ND_PRINT("%s ", p_name); else - ND_PRINT((ndo, "%u ", proto)); + ND_PRINT("%u ", proto); /* tcp flags for tcp only */ if (proto == IPPROTO_TCP) { u_int flags; flags = EXTRACT_U_1(nr->tcp_flags); - ND_PRINT((ndo, "%s%s%s%s%s%s%s", + ND_PRINT("%s%s%s%s%s%s%s", flags & TH_FIN ? "F" : "", flags & TH_SYN ? "S" : "", flags & TH_RST ? "R" : "", flags & TH_PUSH ? "P" : "", flags & TH_ACK ? "A" : "", flags & TH_URG ? "U" : "", - flags ? " " : "")); + flags ? " " : ""); } buf[0]='\0'; - ND_PRINT((ndo, "tos %u, %u (%u octets) %s", + ND_PRINT("tos %u, %u (%u octets) %s", EXTRACT_U_1(nr->tos), EXTRACT_BE_U_4(nr->packets), - EXTRACT_BE_U_4(nr->octets), buf)); + EXTRACT_BE_U_4(nr->octets), buf); } return; trunc: - ND_PRINT((ndo, "[|cnfp]")); + ND_PRINT("[|cnfp]"); return; } @@ -369,15 +369,15 @@ cnfp_v6_print(netdissect_options *ndo, const u_char *cp) t = EXTRACT_BE_U_4(nh->utc_sec); #endif - ND_PRINT((ndo, "NetFlow v%x, %u.%03u uptime, %u.%09u, ", ver, + ND_PRINT("NetFlow v%x, %u.%03u uptime, %u.%09u, ", ver, EXTRACT_BE_U_4(nh->msys_uptime)/1000, EXTRACT_BE_U_4(nh->msys_uptime)%1000, - EXTRACT_BE_U_4(nh->utc_sec), EXTRACT_BE_U_4(nh->utc_nsec))); + EXTRACT_BE_U_4(nh->utc_sec), EXTRACT_BE_U_4(nh->utc_nsec)); - ND_PRINT((ndo, "#%u, ", EXTRACT_BE_U_4(nh->sequence))); + ND_PRINT("#%u, ", EXTRACT_BE_U_4(nh->sequence)); nr = (const struct nfrec_v6 *)&nh[1]; - ND_PRINT((ndo, "%2u recs", nrecs)); + ND_PRINT("%2u recs", nrecs); for (; nrecs != 0; nr++, nrecs--) { char buf[20]; @@ -387,60 +387,60 @@ cnfp_v6_print(netdissect_options *ndo, const u_char *cp) * Make sure we have the entire record. */ ND_TCHECK_SIZE(nr); - ND_PRINT((ndo, "\n started %u.%03u, last %u.%03u", + ND_PRINT("\n started %u.%03u, last %u.%03u", EXTRACT_BE_U_4(nr->start_time)/1000, EXTRACT_BE_U_4(nr->start_time)%1000, EXTRACT_BE_U_4(nr->last_time)/1000, - EXTRACT_BE_U_4(nr->last_time)%1000)); + EXTRACT_BE_U_4(nr->last_time)%1000); asbuf[0] = buf[0] = '\0'; snprintf(buf, sizeof(buf), "/%u", EXTRACT_U_1(nr->src_mask)); snprintf(asbuf, sizeof(asbuf), ":%u", EXTRACT_BE_U_2(nr->src_as)); - ND_PRINT((ndo, "\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf, - EXTRACT_BE_U_2(nr->srcport))); + ND_PRINT("\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf, + EXTRACT_BE_U_2(nr->srcport)); snprintf(buf, sizeof(buf), "/%u", EXTRACT_U_1(nr->dst_mask)); snprintf(asbuf, sizeof(asbuf), ":%u", EXTRACT_BE_U_2(nr->dst_as)); - ND_PRINT((ndo, "> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf, - EXTRACT_BE_U_2(nr->dstport))); + ND_PRINT("> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf, + EXTRACT_BE_U_2(nr->dstport)); - ND_PRINT((ndo, ">> %s\n ", intoa(nr->nhop_ina.s_addr))); + ND_PRINT(">> %s\n ", intoa(nr->nhop_ina.s_addr)); proto = EXTRACT_U_1(nr->proto); if (!ndo->ndo_nflag && (p_name = netdb_protoname(proto)) != NULL) - ND_PRINT((ndo, "%s ", p_name)); + ND_PRINT("%s ", p_name); else - ND_PRINT((ndo, "%u ", proto)); + ND_PRINT("%u ", proto); /* tcp flags for tcp only */ if (proto == IPPROTO_TCP) { u_int flags; flags = EXTRACT_U_1(nr->tcp_flags); - ND_PRINT((ndo, "%s%s%s%s%s%s%s", + ND_PRINT("%s%s%s%s%s%s%s", flags & TH_FIN ? "F" : "", flags & TH_SYN ? "S" : "", flags & TH_RST ? "R" : "", flags & TH_PUSH ? "P" : "", flags & TH_ACK ? "A" : "", flags & TH_URG ? "U" : "", - flags ? " " : "")); + flags ? " " : ""); } buf[0]='\0'; snprintf(buf, sizeof(buf), "(%u<>%u encaps)", (EXTRACT_BE_U_2(nr->flags) >> 8) & 0xff, (EXTRACT_BE_U_2(nr->flags)) & 0xff); - ND_PRINT((ndo, "tos %u, %u (%u octets) %s", + ND_PRINT("tos %u, %u (%u octets) %s", EXTRACT_U_1(nr->tos), EXTRACT_BE_U_4(nr->packets), - EXTRACT_BE_U_4(nr->octets), buf)); + EXTRACT_BE_U_4(nr->octets), buf); } return; trunc: - ND_PRINT((ndo, "[|cnfp]")); + ND_PRINT("[|cnfp]"); return; } @@ -469,12 +469,12 @@ cnfp_print(netdissect_options *ndo, const u_char *cp) break; default: - ND_PRINT((ndo, "NetFlow v%x", ver)); + ND_PRINT("NetFlow v%x", ver); break; } return; trunc: - ND_PRINT((ndo, "[|cnfp]")); + ND_PRINT("[|cnfp]"); return; } diff --git a/print-dccp.c b/print-dccp.c index 58a01904..5e548bf4 100644 --- a/print-dccp.c +++ b/print-dccp.c @@ -256,7 +256,7 @@ static void dccp_print_ack_no(netdissect_options *ndo, const u_char *bp) ackno = EXTRACT_BE_U_3(ackp + 1); } - ND_PRINT((ndo, "(ack=%" PRIu64 ") ", ackno)); + ND_PRINT("(ack=%" PRIu64 ") ", ackno); trunc: return; } @@ -293,20 +293,20 @@ dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, /* make sure we have enough data to look at the X bit */ cp = (const u_char *)(dh + 1); if (cp > ndo->ndo_snapend) { - ND_PRINT((ndo, "[Invalid packet|dccp]")); + ND_PRINT("[Invalid packet|dccp]"); return; } if (len < sizeof(struct dccp_hdr)) { - ND_PRINT((ndo, "truncated-dccp - %u bytes missing!", - len - (u_int)sizeof(struct dccp_hdr))); + ND_PRINT("truncated-dccp - %u bytes missing!", + len - (u_int)sizeof(struct dccp_hdr)); return; } /* get the length of the generic header */ fixed_hdrlen = dccp_basic_hdr_len(dh); if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-dccp - %u bytes missing!", - len - fixed_hdrlen)); + ND_PRINT("truncated-dccp - %u bytes missing!", + len - fixed_hdrlen); return; } ND_TCHECK_LEN(dh, fixed_hdrlen); @@ -316,29 +316,29 @@ dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, hlen = EXTRACT_U_1(dh->dccph_doff) * 4; if (ip6) { - ND_PRINT((ndo, "%s.%d > %s.%d: ", + ND_PRINT("%s.%d > %s.%d: ", ip6addr_string(ndo, &ip6->ip6_src), sport, - ip6addr_string(ndo, &ip6->ip6_dst), dport)); + ip6addr_string(ndo, &ip6->ip6_dst), dport); } else { - ND_PRINT((ndo, "%s.%d > %s.%d: ", + ND_PRINT("%s.%d > %s.%d: ", ipaddr_string(ndo, &ip->ip_src), sport, - ipaddr_string(ndo, &ip->ip_dst), dport)); + ipaddr_string(ndo, &ip->ip_dst), dport); } - ND_PRINT((ndo, "DCCP")); + ND_PRINT("DCCP"); if (ndo->ndo_qflag) { - ND_PRINT((ndo, " %d", len - hlen)); + ND_PRINT(" %d", len - hlen); if (hlen > len) { - ND_PRINT((ndo, " [bad hdr length %u - too long, > %u]", - hlen, len)); + ND_PRINT(" [bad hdr length %u - too long, > %u]", + hlen, len); } return; } /* other variables in generic header */ if (ndo->ndo_vflag) { - ND_PRINT((ndo, " (CCVal %d, CsCov %d, ", DCCPH_CCVAL(dh), DCCPH_CSCOV(dh))); + ND_PRINT(" (CCVal %d, CsCov %d, ", DCCPH_CCVAL(dh), DCCPH_CSCOV(dh)); } /* checksum calculation */ @@ -346,20 +346,20 @@ dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, uint16_t sum = 0, dccp_sum; dccp_sum = EXTRACT_BE_U_2(dh->dccph_checksum); - ND_PRINT((ndo, "cksum 0x%04x ", dccp_sum)); + ND_PRINT("cksum 0x%04x ", dccp_sum); if (IP_V(ip) == 4) sum = dccp_cksum(ndo, ip, dh, len); else if (IP_V(ip) == 6) sum = dccp6_cksum(ndo, ip6, dh, len); if (sum != 0) - ND_PRINT((ndo, "(incorrect -> 0x%04x)",in_cksum_shouldbe(dccp_sum, sum))); + ND_PRINT("(incorrect -> 0x%04x)",in_cksum_shouldbe(dccp_sum, sum)); else - ND_PRINT((ndo, "(correct)")); + ND_PRINT("(correct)"); } if (ndo->ndo_vflag) - ND_PRINT((ndo, ")")); - ND_PRINT((ndo, " ")); + ND_PRINT(")"); + ND_PRINT(" "); dccph_type = DCCPH_TYPE(dh); switch (dccph_type) { @@ -368,15 +368,15 @@ dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, (const struct dccp_hdr_request *)(bp + fixed_hdrlen); fixed_hdrlen += 4; if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-%s - %u bytes missing!", + ND_PRINT("truncated-%s - %u bytes missing!", tok2str(dccp_pkt_type_str, "", dccph_type), - len - fixed_hdrlen)); + len - fixed_hdrlen); return; } ND_TCHECK_SIZE(dhr); - ND_PRINT((ndo, "%s (service=%d) ", + ND_PRINT("%s (service=%d) ", tok2str(dccp_pkt_type_str, "", dccph_type), - EXTRACT_BE_U_4(dhr->dccph_req_service))); + EXTRACT_BE_U_4(dhr->dccph_req_service)); break; } case DCCP_PKT_RESPONSE: { @@ -384,100 +384,100 @@ dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, (const struct dccp_hdr_response *)(bp + fixed_hdrlen); fixed_hdrlen += 12; if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-%s - %u bytes missing!", + ND_PRINT("truncated-%s - %u bytes missing!", tok2str(dccp_pkt_type_str, "", dccph_type), - len - fixed_hdrlen)); + len - fixed_hdrlen); return; } ND_TCHECK_SIZE(dhr); - ND_PRINT((ndo, "%s (service=%d) ", + ND_PRINT("%s (service=%d) ", tok2str(dccp_pkt_type_str, "", dccph_type), - EXTRACT_BE_U_4(dhr->dccph_resp_service))); + EXTRACT_BE_U_4(dhr->dccph_resp_service)); break; } case DCCP_PKT_DATA: - ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); + ND_PRINT("%s ", tok2str(dccp_pkt_type_str, "", dccph_type)); break; case DCCP_PKT_ACK: { fixed_hdrlen += 8; if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-%s - %u bytes missing!", + ND_PRINT("truncated-%s - %u bytes missing!", tok2str(dccp_pkt_type_str, "", dccph_type), - len - fixed_hdrlen)); + len - fixed_hdrlen); return; } - ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); + ND_PRINT("%s ", tok2str(dccp_pkt_type_str, "", dccph_type)); break; } case DCCP_PKT_DATAACK: { fixed_hdrlen += 8; if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-%s - %u bytes missing!", + ND_PRINT("truncated-%s - %u bytes missing!", tok2str(dccp_pkt_type_str, "", dccph_type), - len - fixed_hdrlen)); + len - fixed_hdrlen); return; } - ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); + ND_PRINT("%s ", tok2str(dccp_pkt_type_str, "", dccph_type)); break; } case DCCP_PKT_CLOSEREQ: fixed_hdrlen += 8; if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-%s - %u bytes missing!", + ND_PRINT("truncated-%s - %u bytes missing!", tok2str(dccp_pkt_type_str, "", dccph_type), - len - fixed_hdrlen)); + len - fixed_hdrlen); return; } - ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); + ND_PRINT("%s ", tok2str(dccp_pkt_type_str, "", dccph_type)); break; case DCCP_PKT_CLOSE: fixed_hdrlen += 8; if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-%s - %u bytes missing!", + ND_PRINT("truncated-%s - %u bytes missing!", tok2str(dccp_pkt_type_str, "", dccph_type), - len - fixed_hdrlen)); + len - fixed_hdrlen); return; } - ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); + ND_PRINT("%s ", tok2str(dccp_pkt_type_str, "", dccph_type)); break; case DCCP_PKT_RESET: { const struct dccp_hdr_reset *dhr = (const struct dccp_hdr_reset *)(bp + fixed_hdrlen); fixed_hdrlen += 12; if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-%s - %u bytes missing!", + ND_PRINT("truncated-%s - %u bytes missing!", tok2str(dccp_pkt_type_str, "", dccph_type), - len - fixed_hdrlen)); + len - fixed_hdrlen); return; } ND_TCHECK_SIZE(dhr); - ND_PRINT((ndo, "%s (code=%s) ", + ND_PRINT("%s (code=%s) ", tok2str(dccp_pkt_type_str, "", dccph_type), - dccp_reset_code(EXTRACT_U_1(dhr->dccph_reset_code)))); + dccp_reset_code(EXTRACT_U_1(dhr->dccph_reset_code))); break; } case DCCP_PKT_SYNC: fixed_hdrlen += 8; if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-%s - %u bytes missing!", + ND_PRINT("truncated-%s - %u bytes missing!", tok2str(dccp_pkt_type_str, "", dccph_type), - len - fixed_hdrlen)); + len - fixed_hdrlen); return; } - ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); + ND_PRINT("%s ", tok2str(dccp_pkt_type_str, "", dccph_type)); break; case DCCP_PKT_SYNCACK: fixed_hdrlen += 8; if (len < fixed_hdrlen) { - ND_PRINT((ndo, "truncated-%s - %u bytes missing!", + ND_PRINT("truncated-%s - %u bytes missing!", tok2str(dccp_pkt_type_str, "", dccph_type), - len - fixed_hdrlen)); + len - fixed_hdrlen); return; } - ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "", dccph_type))); + ND_PRINT("%s ", tok2str(dccp_pkt_type_str, "", dccph_type)); break; default: - ND_PRINT((ndo, "%s ", tok2str(dccp_pkt_type_str, "unknown-type-%u", dccph_type))); + ND_PRINT("%s ", tok2str(dccp_pkt_type_str, "unknown-type-%u", dccph_type)); break; } @@ -488,13 +488,13 @@ dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, if (ndo->ndo_vflag < 2) return; - ND_PRINT((ndo, "seq %" PRIu64, dccp_seqno(bp))); + ND_PRINT("seq %" PRIu64, dccp_seqno(bp)); /* process options */ if (hlen > fixed_hdrlen){ u_int optlen; cp = bp + fixed_hdrlen; - ND_PRINT((ndo, " <")); + ND_PRINT(" <"); hlen -= fixed_hdrlen; while(1){ @@ -505,13 +505,13 @@ dccp_print(netdissect_options *ndo, const u_char *bp, const u_char *data2, break; hlen -= optlen; cp += optlen; - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); } - ND_PRINT((ndo, ">")); + ND_PRINT(">"); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } @@ -546,10 +546,10 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in optlen = EXTRACT_U_1(option + 1); if (optlen < 2) { if (EXTRACT_U_1(option) >= 128) - ND_PRINT((ndo, "CCID option %u optlen too short", EXTRACT_U_1(option))); + ND_PRINT("CCID option %u optlen too short", EXTRACT_U_1(option)); else - ND_PRINT((ndo, "%s optlen too short", - tok2str(dccp_option_values, "Option %u", EXTRACT_U_1(option)))); + ND_PRINT("%s optlen too short", + tok2str(dccp_option_values, "Option %u", EXTRACT_U_1(option))); return 0; } } else @@ -557,101 +557,101 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in if (hlen < optlen) { if (EXTRACT_U_1(option) >= 128) - ND_PRINT((ndo, "CCID option %u optlen goes past header length", - EXTRACT_U_1(option))); + ND_PRINT("CCID option %u optlen goes past header length", + EXTRACT_U_1(option)); else - ND_PRINT((ndo, "%s optlen goes past header length", - tok2str(dccp_option_values, "Option %u", EXTRACT_U_1(option)))); + ND_PRINT("%s optlen goes past header length", + tok2str(dccp_option_values, "Option %u", EXTRACT_U_1(option))); return 0; } ND_TCHECK_LEN(option, optlen); if (EXTRACT_U_1(option) >= 128) { - ND_PRINT((ndo, "CCID option %d", EXTRACT_U_1(option))); + ND_PRINT("CCID option %d", EXTRACT_U_1(option)); switch (optlen) { case 4: - ND_PRINT((ndo, " %u", EXTRACT_BE_U_2(option + 2))); + ND_PRINT(" %u", EXTRACT_BE_U_2(option + 2)); break; case 6: - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(option + 2))); + ND_PRINT(" %u", EXTRACT_BE_U_4(option + 2)); break; default: break; } } else { - ND_PRINT((ndo, "%s", tok2str(dccp_option_values, "Option %u", EXTRACT_U_1(option)))); + ND_PRINT("%s", tok2str(dccp_option_values, "Option %u", EXTRACT_U_1(option))); switch (EXTRACT_U_1(option)) { case 32: case 33: case 34: case 35: if (optlen < 3) { - ND_PRINT((ndo, " optlen too short")); + ND_PRINT(" optlen too short"); return optlen; } if (EXTRACT_U_1(option + 2) < 10){ - ND_PRINT((ndo, " %s", dccp_feature_nums[EXTRACT_U_1(option + 2)])); + ND_PRINT(" %s", dccp_feature_nums[EXTRACT_U_1(option + 2)]); for (i = 0; i < optlen - 3; i++) - ND_PRINT((ndo, " %d", EXTRACT_U_1(option + 3 + i))); + ND_PRINT(" %d", EXTRACT_U_1(option + 3 + i)); } break; case 36: if (optlen > 2) { - ND_PRINT((ndo, " 0x")); + ND_PRINT(" 0x"); for (i = 0; i < optlen - 2; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i))); + ND_PRINT("%02x", EXTRACT_U_1(option + 2 + i)); } break; case 37: for (i = 0; i < optlen - 2; i++) - ND_PRINT((ndo, " %d", EXTRACT_U_1(option + 2 + i))); + ND_PRINT(" %d", EXTRACT_U_1(option + 2 + i)); break; case 38: if (optlen > 2) { - ND_PRINT((ndo, " 0x")); + ND_PRINT(" 0x"); for (i = 0; i < optlen - 2; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i))); + ND_PRINT("%02x", EXTRACT_U_1(option + 2 + i)); } break; case 39: if (optlen > 2) { - ND_PRINT((ndo, " 0x")); + ND_PRINT(" 0x"); for (i = 0; i < optlen - 2; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i))); + ND_PRINT("%02x", EXTRACT_U_1(option + 2 + i)); } break; case 40: if (optlen > 2) { - ND_PRINT((ndo, " 0x")); + ND_PRINT(" 0x"); for (i = 0; i < optlen - 2; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i))); + ND_PRINT("%02x", EXTRACT_U_1(option + 2 + i)); } break; case 41: if (optlen == 4) - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(option + 2))); + ND_PRINT(" %u", EXTRACT_BE_U_4(option + 2)); else - ND_PRINT((ndo, " optlen != 4")); + ND_PRINT(" optlen != 4"); break; case 42: if (optlen == 4) - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(option + 2))); + ND_PRINT(" %u", EXTRACT_BE_U_4(option + 2)); else - ND_PRINT((ndo, " optlen != 4")); + ND_PRINT(" optlen != 4"); break; case 43: if (optlen == 6) - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(option + 2))); + ND_PRINT(" %u", EXTRACT_BE_U_4(option + 2)); else if (optlen == 4) - ND_PRINT((ndo, " %u", EXTRACT_BE_U_2(option + 2))); + ND_PRINT(" %u", EXTRACT_BE_U_2(option + 2)); else - ND_PRINT((ndo, " optlen != 4 or 6")); + ND_PRINT(" optlen != 4 or 6"); break; case 44: if (optlen > 2) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); for (i = 0; i < optlen - 2; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(option + 2 + i))); + ND_PRINT("%02x", EXTRACT_U_1(option + 2 + i)); } break; } @@ -659,6 +659,6 @@ static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_in return optlen; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return 0; } diff --git a/print-decnet.c b/print-decnet.c index b1f538cb..d264373f 100644 --- a/print-decnet.c +++ b/print-decnet.c @@ -511,18 +511,18 @@ decnet_print(netdissect_options *ndo, const u_char *nspp; if (length < sizeof(struct shorthdr)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } ND_TCHECK_LEN(ap, sizeof(short)); pktlen = EXTRACT_LE_U_2(ap); if (pktlen < sizeof(struct shorthdr)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } if (pktlen > length) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } length = pktlen; @@ -535,9 +535,9 @@ decnet_print(netdissect_options *ndo, /* pad bytes of some sort in front of message */ u_int padlen = mflags & RMF_PADMASK; if (ndo->ndo_vflag) - ND_PRINT((ndo, "[pad:%u] ", padlen)); + ND_PRINT("[pad:%u] ", padlen); if (length < padlen + 2) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } ND_TCHECK_LEN(ap + sizeof(short), padlen); @@ -550,7 +550,7 @@ decnet_print(netdissect_options *ndo, } if (mflags & RMF_FVER) { - ND_PRINT((ndo, "future-version-decnet")); + ND_PRINT("future-version-decnet"); ND_DEFAULTPRINT(ap, min(length, caplen)); return; } @@ -565,7 +565,7 @@ decnet_print(netdissect_options *ndo, switch (mflags & RMF_MASK) { case RMF_LONG: if (length < sizeof(struct longhdr)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } ND_TCHECK(rhp->rh_long); @@ -586,21 +586,21 @@ decnet_print(netdissect_options *ndo, nsplen = length - sizeof(struct shorthdr); break; default: - ND_PRINT((ndo, "unknown message flags under mask")); + ND_PRINT("unknown message flags under mask"); ND_DEFAULTPRINT((const u_char *)ap, min(length, caplen)); return; } - ND_PRINT((ndo, "%s > %s %u ", - dnaddr_string(ndo, src), dnaddr_string(ndo, dst), pktlen)); + ND_PRINT("%s > %s %u ", + dnaddr_string(ndo, src), dnaddr_string(ndo, dst), pktlen); if (ndo->ndo_vflag) { if (mflags & RMF_RQR) - ND_PRINT((ndo, "RQR ")); + ND_PRINT("RQR "); if (mflags & RMF_RTS) - ND_PRINT((ndo, "RTS ")); + ND_PRINT("RTS "); if (mflags & RMF_IE) - ND_PRINT((ndo, "IE ")); - ND_PRINT((ndo, "%u hops ", hops)); + ND_PRINT("IE "); + ND_PRINT("%u hops ", hops); } if (!print_nsp(ndo, nspp, nsplen)) @@ -608,7 +608,7 @@ decnet_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } @@ -628,7 +628,7 @@ print_decnet_ctlmsg(netdissect_options *ndo, switch (mflags & RMF_CTLMASK) { case RMF_INIT: - ND_PRINT((ndo, "init ")); + ND_PRINT("init "); if (length < sizeof(struct initmsg)) goto trunc; ND_TCHECK(cmp->cm_init); @@ -640,54 +640,53 @@ print_decnet_ctlmsg(netdissect_options *ndo, ueco = EXTRACT_U_1(cmp->cm_init.in_ueco); hello = EXTRACT_LE_U_2(cmp->cm_init.in_hello); print_t_info(ndo, info); - ND_PRINT((ndo, - "src %sblksize %u vers %u eco %u ueco %u hello %u", + ND_PRINT("src %sblksize %u vers %u eco %u ueco %u hello %u", dnaddr_string(ndo, src), blksize, vers, eco, ueco, - hello)); + hello); ret = 1; break; case RMF_VER: - ND_PRINT((ndo, "verification ")); + ND_PRINT("verification "); if (length < sizeof(struct verifmsg)) goto trunc; ND_TCHECK(cmp->cm_ver); src = EXTRACT_LE_U_2(cmp->cm_ver.ve_src); other = EXTRACT_U_1(cmp->cm_ver.ve_fcnval); - ND_PRINT((ndo, "src %s fcnval %o", dnaddr_string(ndo, src), other)); + ND_PRINT("src %s fcnval %o", dnaddr_string(ndo, src), other); ret = 1; break; case RMF_TEST: - ND_PRINT((ndo, "test ")); + ND_PRINT("test "); if (length < sizeof(struct testmsg)) goto trunc; ND_TCHECK(cmp->cm_test); src = EXTRACT_LE_U_2(cmp->cm_test.te_src); other = EXTRACT_U_1(cmp->cm_test.te_data); - ND_PRINT((ndo, "src %s data %o", dnaddr_string(ndo, src), other)); + ND_PRINT("src %s data %o", dnaddr_string(ndo, src), other); ret = 1; break; case RMF_L1ROUT: - ND_PRINT((ndo, "lev-1-routing ")); + ND_PRINT("lev-1-routing "); if (length < sizeof(struct l1rout)) goto trunc; ND_TCHECK(cmp->cm_l1rou); src = EXTRACT_LE_U_2(cmp->cm_l1rou.r1_src); - ND_PRINT((ndo, "src %s ", dnaddr_string(ndo, src))); + ND_PRINT("src %s ", dnaddr_string(ndo, src)); ret = print_l1_routes(ndo, &(rhpx[sizeof(struct l1rout)]), length - sizeof(struct l1rout)); break; case RMF_L2ROUT: - ND_PRINT((ndo, "lev-2-routing ")); + ND_PRINT("lev-2-routing "); if (length < sizeof(struct l2rout)) goto trunc; ND_TCHECK(cmp->cm_l2rout); src = EXTRACT_LE_U_2(cmp->cm_l2rout.r2_src); - ND_PRINT((ndo, "src %s ", dnaddr_string(ndo, src))); + ND_PRINT("src %s ", dnaddr_string(ndo, src)); ret = print_l2_routes(ndo, &(rhpx[sizeof(struct l2rout)]), length - sizeof(struct l2rout)); break; case RMF_RHELLO: - ND_PRINT((ndo, "router-hello ")); + ND_PRINT("router-hello "); if (length < sizeof(struct rhellomsg)) goto trunc; ND_TCHECK(cmp->cm_rhello); @@ -702,15 +701,14 @@ print_decnet_ctlmsg(netdissect_options *ndo, priority = EXTRACT_U_1(cmp->cm_rhello.rh_priority); hello = EXTRACT_LE_U_2(cmp->cm_rhello.rh_hello); print_i_info(ndo, info); - ND_PRINT((ndo, - "vers %u eco %u ueco %u src %s blksize %u pri %u hello %u", + ND_PRINT("vers %u eco %u ueco %u src %s blksize %u pri %u hello %u", vers, eco, ueco, dnaddr_string(ndo, src), - blksize, priority, hello)); + blksize, priority, hello); ret = print_elist(&(rhpx[sizeof(struct rhellomsg)]), length - sizeof(struct rhellomsg)); break; case RMF_EHELLO: - ND_PRINT((ndo, "endnode-hello ")); + ND_PRINT("endnode-hello "); if (length < sizeof(struct ehellomsg)) goto trunc; ND_TCHECK(cmp->cm_ehello); @@ -729,15 +727,14 @@ print_decnet_ctlmsg(netdissect_options *ndo, hello = EXTRACT_LE_U_2(cmp->cm_ehello.eh_hello); other = EXTRACT_U_1(cmp->cm_ehello.eh_data); print_i_info(ndo, info); - ND_PRINT((ndo, - "vers %u eco %u ueco %u src %s blksize %u rtr %s hello %u data %o", + ND_PRINT("vers %u eco %u ueco %u src %s blksize %u rtr %s hello %u data %o", vers, eco, ueco, dnaddr_string(ndo, src), - blksize, dnaddr_string(ndo, dst), hello, other)); + blksize, dnaddr_string(ndo, dst), hello, other); ret = 1; break; default: - ND_PRINT((ndo, "unknown control message")); + ND_PRINT("unknown control message"); ND_DEFAULTPRINT((const u_char *)rhp, min(length, caplen)); ret = 1; break; @@ -754,15 +751,15 @@ print_t_info(netdissect_options *ndo, { u_int ntype = info & 3; switch (ntype) { - case 0: ND_PRINT((ndo, "reserved-ntype? ")); break; - case TI_L2ROUT: ND_PRINT((ndo, "l2rout ")); break; - case TI_L1ROUT: ND_PRINT((ndo, "l1rout ")); break; - case TI_ENDNODE: ND_PRINT((ndo, "endnode ")); break; + case 0: ND_PRINT("reserved-ntype? "); break; + case TI_L2ROUT: ND_PRINT("l2rout "); break; + case TI_L1ROUT: ND_PRINT("l1rout "); break; + case TI_ENDNODE: ND_PRINT("endnode "); break; } if (info & TI_VERIF) - ND_PRINT((ndo, "verif ")); + ND_PRINT("verif "); if (info & TI_BLOCK) - ND_PRINT((ndo, "blo ")); + ND_PRINT("blo "); } static int @@ -787,8 +784,8 @@ print_l1_routes(netdissect_options *ndo, info = EXTRACT_LE_U_2(rp); rp += sizeof(short); len -= sizeof(short); - ND_PRINT((ndo, "{ids %u-%u cost %u hops %u} ", id, id + count, - RI_COST(info), RI_HOPS(info))); + ND_PRINT("{ids %u-%u cost %u hops %u} ", id, id + count, + RI_COST(info), RI_HOPS(info)); } return (1); @@ -818,8 +815,8 @@ print_l2_routes(netdissect_options *ndo, info = EXTRACT_LE_U_2(rp); rp += sizeof(short); len -= sizeof(short); - ND_PRINT((ndo, "{areas %u-%u cost %u hops %u} ", area, area + count, - RI_COST(info), RI_HOPS(info))); + ND_PRINT("{areas %u-%u cost %u hops %u} ", area, area + count, + RI_COST(info), RI_HOPS(info)); } return (1); @@ -833,17 +830,17 @@ print_i_info(netdissect_options *ndo, { u_int ntype = info & II_TYPEMASK; switch (ntype) { - case 0: ND_PRINT((ndo, "reserved-ntype? ")); break; - case II_L2ROUT: ND_PRINT((ndo, "l2rout ")); break; - case II_L1ROUT: ND_PRINT((ndo, "l1rout ")); break; - case II_ENDNODE: ND_PRINT((ndo, "endnode ")); break; + case 0: ND_PRINT("reserved-ntype? "); break; + case II_L2ROUT: ND_PRINT("l2rout "); break; + case II_L1ROUT: ND_PRINT("l1rout "); break; + case II_ENDNODE: ND_PRINT("endnode "); break; } if (info & II_VERIF) - ND_PRINT((ndo, "verif ")); + ND_PRINT("verif "); if (info & II_NOMCAST) - ND_PRINT((ndo, "nomcast ")); + ND_PRINT("nomcast "); if (info & II_BLOCK) - ND_PRINT((ndo, "blo ")); + ND_PRINT("blo "); } static int @@ -874,7 +871,7 @@ print_nsp(netdissect_options *ndo, case MFS_MOM: case MFS_EOM: case MFS_BOM+MFS_EOM: - ND_PRINT((ndo, "data %u>%u ", src, dst)); + ND_PRINT("data %u>%u ", src, dst); { const struct seghdr *shp = (const struct seghdr *)nspp; u_int ack; @@ -886,9 +883,9 @@ print_nsp(netdissect_options *ndo, ack = EXTRACT_LE_U_2(shp->sh_seq[0]); if (ack & SGQ_ACK) { /* acknum field */ if ((ack & SGQ_NAK) == SGQ_NAK) - ND_PRINT((ndo, "nak %u ", ack & SGQ_MASK)); + ND_PRINT("nak %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "ack %u ", ack & SGQ_MASK)); + ND_PRINT("ack %u ", ack & SGQ_MASK); data_off += sizeof(short); if (nsplen < data_off) goto trunc; @@ -896,9 +893,9 @@ print_nsp(netdissect_options *ndo, ack = EXTRACT_LE_U_2(shp->sh_seq[1]); if (ack & SGQ_OACK) { /* ackoth field */ if ((ack & SGQ_ONAK) == SGQ_ONAK) - ND_PRINT((ndo, "onak %u ", ack & SGQ_MASK)); + ND_PRINT("onak %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "oack %u ", ack & SGQ_MASK)); + ND_PRINT("oack %u ", ack & SGQ_MASK); data_off += sizeof(short); if (nsplen < data_off) goto trunc; @@ -906,11 +903,11 @@ print_nsp(netdissect_options *ndo, ack = EXTRACT_LE_U_2(shp->sh_seq[2]); } } - ND_PRINT((ndo, "seg %u ", ack & SGQ_MASK)); + ND_PRINT("seg %u ", ack & SGQ_MASK); } break; case MFS_ILS+MFS_INT: - ND_PRINT((ndo, "intr ")); + ND_PRINT("intr "); { const struct seghdr *shp = (const struct seghdr *)nspp; u_int ack; @@ -922,9 +919,9 @@ print_nsp(netdissect_options *ndo, ack = EXTRACT_LE_U_2(shp->sh_seq[0]); if (ack & SGQ_ACK) { /* acknum field */ if ((ack & SGQ_NAK) == SGQ_NAK) - ND_PRINT((ndo, "nak %u ", ack & SGQ_MASK)); + ND_PRINT("nak %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "ack %u ", ack & SGQ_MASK)); + ND_PRINT("ack %u ", ack & SGQ_MASK); data_off += sizeof(short); if (nsplen < data_off) goto trunc; @@ -932,9 +929,9 @@ print_nsp(netdissect_options *ndo, ack = EXTRACT_LE_U_2(shp->sh_seq[1]); if (ack & SGQ_OACK) { /* ackdat field */ if ((ack & SGQ_ONAK) == SGQ_ONAK) - ND_PRINT((ndo, "nakdat %u ", ack & SGQ_MASK)); + ND_PRINT("nakdat %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "ackdat %u ", ack & SGQ_MASK)); + ND_PRINT("ackdat %u ", ack & SGQ_MASK); data_off += sizeof(short); if (nsplen < data_off) goto trunc; @@ -942,11 +939,11 @@ print_nsp(netdissect_options *ndo, ack = EXTRACT_LE_U_2(shp->sh_seq[2]); } } - ND_PRINT((ndo, "seg %u ", ack & SGQ_MASK)); + ND_PRINT("seg %u ", ack & SGQ_MASK); } break; case MFS_ILS: - ND_PRINT((ndo, "link-service %u>%u ", src, dst)); + ND_PRINT("link-service %u>%u ", src, dst); { const struct seghdr *shp = (const struct seghdr *)nspp; const struct lsmsg *lsmp = @@ -960,59 +957,59 @@ print_nsp(netdissect_options *ndo, ack = EXTRACT_LE_U_2(shp->sh_seq[0]); if (ack & SGQ_ACK) { /* acknum field */ if ((ack & SGQ_NAK) == SGQ_NAK) - ND_PRINT((ndo, "nak %u ", ack & SGQ_MASK)); + ND_PRINT("nak %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "ack %u ", ack & SGQ_MASK)); + ND_PRINT("ack %u ", ack & SGQ_MASK); ND_TCHECK(shp->sh_seq[1]); ack = EXTRACT_LE_U_2(shp->sh_seq[1]); if (ack & SGQ_OACK) { /* ackdat field */ if ((ack & SGQ_ONAK) == SGQ_ONAK) - ND_PRINT((ndo, "nakdat %u ", ack & SGQ_MASK)); + ND_PRINT("nakdat %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "ackdat %u ", ack & SGQ_MASK)); + ND_PRINT("ackdat %u ", ack & SGQ_MASK); ND_TCHECK(shp->sh_seq[2]); ack = EXTRACT_LE_U_2(shp->sh_seq[2]); } } - ND_PRINT((ndo, "seg %u ", ack & SGQ_MASK)); + ND_PRINT("seg %u ", ack & SGQ_MASK); ND_TCHECK_SIZE(lsmp); lsflags = EXTRACT_U_1(lsmp->ls_lsflags); fcval = EXTRACT_U_1(lsmp->ls_fcval); switch (lsflags & LSI_MASK) { case LSI_DATA: - ND_PRINT((ndo, "dat seg count %u ", fcval)); + ND_PRINT("dat seg count %u ", fcval); switch (lsflags & LSM_MASK) { case LSM_NOCHANGE: break; case LSM_DONOTSEND: - ND_PRINT((ndo, "donotsend-data ")); + ND_PRINT("donotsend-data "); break; case LSM_SEND: - ND_PRINT((ndo, "send-data ")); + ND_PRINT("send-data "); break; default: - ND_PRINT((ndo, "reserved-fcmod? %x", lsflags)); + ND_PRINT("reserved-fcmod? %x", lsflags); break; } break; case LSI_INTR: - ND_PRINT((ndo, "intr req count %u ", fcval)); + ND_PRINT("intr req count %u ", fcval); break; default: - ND_PRINT((ndo, "reserved-fcval-int? %x", lsflags)); + ND_PRINT("reserved-fcval-int? %x", lsflags); break; } } break; default: - ND_PRINT((ndo, "reserved-subtype? %x %u > %u", flags, src, dst)); + ND_PRINT("reserved-subtype? %x %u > %u", flags, src, dst); break; } break; case MFT_ACK: switch (flags & NSP_SUBMASK) { case MFS_DACK: - ND_PRINT((ndo, "data-ack %u>%u ", src, dst)); + ND_PRINT("data-ack %u>%u ", src, dst); { const struct ackmsg *amp = (const struct ackmsg *)nspp; u_int ack; @@ -1023,21 +1020,21 @@ print_nsp(netdissect_options *ndo, ack = EXTRACT_LE_U_2(amp->ak_acknum[0]); if (ack & SGQ_ACK) { /* acknum field */ if ((ack & SGQ_NAK) == SGQ_NAK) - ND_PRINT((ndo, "nak %u ", ack & SGQ_MASK)); + ND_PRINT("nak %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "ack %u ", ack & SGQ_MASK)); + ND_PRINT("ack %u ", ack & SGQ_MASK); ack = EXTRACT_LE_U_2(amp->ak_acknum[1]); if (ack & SGQ_OACK) { /* ackoth field */ if ((ack & SGQ_ONAK) == SGQ_ONAK) - ND_PRINT((ndo, "onak %u ", ack & SGQ_MASK)); + ND_PRINT("onak %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "oack %u ", ack & SGQ_MASK)); + ND_PRINT("oack %u ", ack & SGQ_MASK); } } } break; case MFS_IACK: - ND_PRINT((ndo, "ils-ack %u>%u ", src, dst)); + ND_PRINT("ils-ack %u>%u ", src, dst); { const struct ackmsg *amp = (const struct ackmsg *)nspp; u_int ack; @@ -1048,25 +1045,25 @@ print_nsp(netdissect_options *ndo, ack = EXTRACT_LE_U_2(amp->ak_acknum[0]); if (ack & SGQ_ACK) { /* acknum field */ if ((ack & SGQ_NAK) == SGQ_NAK) - ND_PRINT((ndo, "nak %u ", ack & SGQ_MASK)); + ND_PRINT("nak %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "ack %u ", ack & SGQ_MASK)); + ND_PRINT("ack %u ", ack & SGQ_MASK); ND_TCHECK(amp->ak_acknum[1]); ack = EXTRACT_LE_U_2(amp->ak_acknum[1]); if (ack & SGQ_OACK) { /* ackdat field */ if ((ack & SGQ_ONAK) == SGQ_ONAK) - ND_PRINT((ndo, "nakdat %u ", ack & SGQ_MASK)); + ND_PRINT("nakdat %u ", ack & SGQ_MASK); else - ND_PRINT((ndo, "ackdat %u ", ack & SGQ_MASK)); + ND_PRINT("ackdat %u ", ack & SGQ_MASK); } } } break; case MFS_CACK: - ND_PRINT((ndo, "conn-ack %u", dst)); + ND_PRINT("conn-ack %u", dst); break; default: - ND_PRINT((ndo, "reserved-acktype? %x %u > %u", flags, src, dst)); + ND_PRINT("reserved-acktype? %x %u > %u", flags, src, dst); break; } break; @@ -1075,10 +1072,10 @@ print_nsp(netdissect_options *ndo, case MFS_CI: case MFS_RCI: if ((flags & NSP_SUBMASK) == MFS_CI) - ND_PRINT((ndo, "conn-initiate ")); + ND_PRINT("conn-initiate "); else - ND_PRINT((ndo, "retrans-conn-initiate ")); - ND_PRINT((ndo, "%u>%u ", src, dst)); + ND_PRINT("retrans-conn-initiate "); + ND_PRINT("%u>%u ", src, dst); { const struct cimsg *cimp = (const struct cimsg *)nspp; u_int services, info, segsize; @@ -1094,31 +1091,31 @@ print_nsp(netdissect_options *ndo, case COS_NONE: break; case COS_SEGMENT: - ND_PRINT((ndo, "seg ")); + ND_PRINT("seg "); break; case COS_MESSAGE: - ND_PRINT((ndo, "msg ")); + ND_PRINT("msg "); break; } switch (info & COI_MASK) { case COI_32: - ND_PRINT((ndo, "ver 3.2 ")); + ND_PRINT("ver 3.2 "); break; case COI_31: - ND_PRINT((ndo, "ver 3.1 ")); + ND_PRINT("ver 3.1 "); break; case COI_40: - ND_PRINT((ndo, "ver 4.0 ")); + ND_PRINT("ver 4.0 "); break; case COI_41: - ND_PRINT((ndo, "ver 4.1 ")); + ND_PRINT("ver 4.1 "); break; } - ND_PRINT((ndo, "segsize %u ", segsize)); + ND_PRINT("segsize %u ", segsize); } break; case MFS_CC: - ND_PRINT((ndo, "conn-confirm %u>%u ", src, dst)); + ND_PRINT("conn-confirm %u>%u ", src, dst); { const struct ccmsg *ccmp = (const struct ccmsg *)nspp; u_int services, info; @@ -1136,34 +1133,34 @@ print_nsp(netdissect_options *ndo, case COS_NONE: break; case COS_SEGMENT: - ND_PRINT((ndo, "seg ")); + ND_PRINT("seg "); break; case COS_MESSAGE: - ND_PRINT((ndo, "msg ")); + ND_PRINT("msg "); break; } switch (info & COI_MASK) { case COI_32: - ND_PRINT((ndo, "ver 3.2 ")); + ND_PRINT("ver 3.2 "); break; case COI_31: - ND_PRINT((ndo, "ver 3.1 ")); + ND_PRINT("ver 3.1 "); break; case COI_40: - ND_PRINT((ndo, "ver 4.0 ")); + ND_PRINT("ver 4.0 "); break; case COI_41: - ND_PRINT((ndo, "ver 4.1 ")); + ND_PRINT("ver 4.1 "); break; } - ND_PRINT((ndo, "segsize %u ", segsize)); + ND_PRINT("segsize %u ", segsize); if (optlen) { - ND_PRINT((ndo, "optlen %u ", optlen)); + ND_PRINT("optlen %u ", optlen); } } break; case MFS_DI: - ND_PRINT((ndo, "disconn-initiate %u>%u ", src, dst)); + ND_PRINT("disconn-initiate %u>%u ", src, dst); { const struct dimsg *dimp = (const struct dimsg *)nspp; u_int reason; @@ -1177,12 +1174,12 @@ print_nsp(netdissect_options *ndo, print_reason(ndo, reason); if (optlen) { - ND_PRINT((ndo, "optlen %u ", optlen)); + ND_PRINT("optlen %u ", optlen); } } break; case MFS_DC: - ND_PRINT((ndo, "disconn-confirm %u>%u ", src, dst)); + ND_PRINT("disconn-confirm %u>%u ", src, dst); { const struct dcmsg *dcmp = (const struct dcmsg *)nspp; u_int reason; @@ -1194,12 +1191,12 @@ print_nsp(netdissect_options *ndo, } break; default: - ND_PRINT((ndo, "reserved-ctltype? %x %u > %u", flags, src, dst)); + ND_PRINT("reserved-ctltype? %x %u > %u", flags, src, dst); break; } break; default: - ND_PRINT((ndo, "reserved-type? %x %u > %u", flags, src, dst)); + ND_PRINT("reserved-type? %x %u > %u", flags, src, dst); break; } return (1); @@ -1238,7 +1235,7 @@ static void print_reason(netdissect_options *ndo, u_int reason) { - ND_PRINT((ndo, "%s ", tok2str(reason2str, "reason-%u", reason))); + ND_PRINT("%s ", tok2str(reason2str, "reason-%u", reason)); } const char * diff --git a/print-dhcp6.c b/print-dhcp6.c index f36e25ed..5e8585c0 100644 --- a/print-dhcp6.c +++ b/print-dhcp6.c @@ -307,130 +307,130 @@ dhcp6opt_print(netdissect_options *ndo, if (ep < cp + sizeof(*dh6o) + optlen) goto trunc; opttype = EXTRACT_BE_U_2(&dh6o->dh6opt_type); - ND_PRINT((ndo, " (%s", tok2str(dh6opt_str, "opt_%u", opttype))); + ND_PRINT(" (%s", tok2str(dh6opt_str, "opt_%u", opttype)); ND_TCHECK_LEN(cp + sizeof(*dh6o), optlen); switch (opttype) { case DH6OPT_CLIENTID: case DH6OPT_SERVERID: if (optlen < 2) { /*(*/ - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); switch (EXTRACT_BE_U_2(tp)) { case 1: if (optlen >= 2 + 6) { - ND_PRINT((ndo, " hwaddr/time type %u time %u ", + ND_PRINT(" hwaddr/time type %u time %u ", EXTRACT_BE_U_2(tp + 2), - EXTRACT_BE_U_4(tp + 4))); + EXTRACT_BE_U_4(tp + 4)); for (i = 8; i < optlen; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i))); + ND_PRINT("%02x", EXTRACT_U_1(tp + i)); /*(*/ - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } else { /*(*/ - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); } break; case 2: if (optlen >= 2 + 8) { - ND_PRINT((ndo, " vid ")); + ND_PRINT(" vid "); for (i = 2; i < 2 + 8; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i))); + ND_PRINT("%02x", EXTRACT_U_1(tp + i)); /*(*/ - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } else { /*(*/ - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); } break; case 3: if (optlen >= 2 + 2) { - ND_PRINT((ndo, " hwaddr type %u ", - EXTRACT_BE_U_2(tp + 2))); + ND_PRINT(" hwaddr type %u ", + EXTRACT_BE_U_2(tp + 2)); for (i = 4; i < optlen; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i))); + ND_PRINT("%02x", EXTRACT_U_1(tp + i)); /*(*/ - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } else { /*(*/ - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); } break; default: - ND_PRINT((ndo, " type %d)", EXTRACT_BE_U_2(tp))); + ND_PRINT(" type %d)", EXTRACT_BE_U_2(tp)); break; } break; case DH6OPT_IA_ADDR: if (optlen < 24) { /*(*/ - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " %s", ip6addr_string(ndo, tp))); - ND_PRINT((ndo, " pltime:%u vltime:%u", + ND_PRINT(" %s", ip6addr_string(ndo, tp)); + ND_PRINT(" pltime:%u vltime:%u", EXTRACT_BE_U_4(tp + 16), - EXTRACT_BE_U_4(tp + 20))); + EXTRACT_BE_U_4(tp + 20)); if (optlen > 24) { /* there are sub-options */ dhcp6opt_print(ndo, tp + 24, tp + optlen); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_ORO: case DH6OPT_ERO: if (optlen % 2) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); for (i = 0; i < optlen; i += 2) { - ND_PRINT((ndo, " %s", - tok2str(dh6opt_str, "opt_%u", EXTRACT_BE_U_2(tp + i)))); + ND_PRINT(" %s", + tok2str(dh6opt_str, "opt_%u", EXTRACT_BE_U_2(tp + i))); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_PREFERENCE: if (optlen != 1) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " %d)", EXTRACT_U_1(tp))); + ND_PRINT(" %d)", EXTRACT_U_1(tp)); break; case DH6OPT_ELAPSED_TIME: if (optlen != 2) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " %d)", EXTRACT_BE_U_2(tp))); + ND_PRINT(" %d)", EXTRACT_BE_U_2(tp)); break; case DH6OPT_RELAY_MSG: - ND_PRINT((ndo, " (")); + ND_PRINT(" ("); tp = (const u_char *)(dh6o + 1); dhcp6_print(ndo, tp, optlen); - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_AUTH: if (optlen < 11) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); auth_proto = EXTRACT_U_1(tp); switch (auth_proto) { case DH6OPT_AUTHPROTO_DELAYED: - ND_PRINT((ndo, " proto: delayed")); + ND_PRINT(" proto: delayed"); break; case DH6OPT_AUTHPROTO_RECONFIG: - ND_PRINT((ndo, " proto: reconfigure")); + ND_PRINT(" proto: reconfigure"); break; default: - ND_PRINT((ndo, " proto: %d", auth_proto)); + ND_PRINT(" proto: %d", auth_proto); break; } tp++; @@ -438,26 +438,26 @@ dhcp6opt_print(netdissect_options *ndo, switch (auth_alg) { case DH6OPT_AUTHALG_HMACMD5: /* XXX: may depend on the protocol */ - ND_PRINT((ndo, ", alg: HMAC-MD5")); + ND_PRINT(", alg: HMAC-MD5"); break; default: - ND_PRINT((ndo, ", alg: %d", auth_alg)); + ND_PRINT(", alg: %d", auth_alg); break; } tp++; auth_rdm = EXTRACT_U_1(tp); switch (auth_rdm) { case DH6OPT_AUTHRDM_MONOCOUNTER: - ND_PRINT((ndo, ", RDM: mono")); + ND_PRINT(", RDM: mono"); break; default: - ND_PRINT((ndo, ", RDM: %d", auth_rdm)); + ND_PRINT(", RDM: %d", auth_rdm); break; } tp++; - ND_PRINT((ndo, ", RD:")); + ND_PRINT(", RD:"); for (i = 0; i < 4; i++, tp += 2) - ND_PRINT((ndo, " %04x", EXTRACT_BE_U_2(tp))); + ND_PRINT(" %04x", EXTRACT_BE_U_2(tp)); /* protocol dependent part */ authinfolen = optlen - 11; @@ -466,51 +466,51 @@ dhcp6opt_print(netdissect_options *ndo, if (authinfolen == 0) break; if (authinfolen < 20) { - ND_PRINT((ndo, " ??")); + ND_PRINT(" ??"); break; } authrealmlen = authinfolen - 20; if (authrealmlen > 0) { - ND_PRINT((ndo, ", realm: ")); + ND_PRINT(", realm: "); } for (i = 0; i < authrealmlen; i++, tp++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp))); - ND_PRINT((ndo, ", key ID: %08x", EXTRACT_BE_U_4(tp))); + ND_PRINT("%02x", EXTRACT_U_1(tp)); + ND_PRINT(", key ID: %08x", EXTRACT_BE_U_4(tp)); tp += 4; - ND_PRINT((ndo, ", HMAC-MD5:")); + ND_PRINT(", HMAC-MD5:"); for (i = 0; i < 4; i++, tp+= 4) - ND_PRINT((ndo, " %08x", EXTRACT_BE_U_4(tp))); + ND_PRINT(" %08x", EXTRACT_BE_U_4(tp)); break; case DH6OPT_AUTHPROTO_RECONFIG: if (authinfolen != 17) { - ND_PRINT((ndo, " ??")); + ND_PRINT(" ??"); break; } switch (EXTRACT_U_1(tp)) { case DH6OPT_AUTHRECONFIG_KEY: - ND_PRINT((ndo, " reconfig-key")); + ND_PRINT(" reconfig-key"); break; case DH6OPT_AUTHRECONFIG_HMACMD5: - ND_PRINT((ndo, " type: HMAC-MD5")); + ND_PRINT(" type: HMAC-MD5"); break; default: - ND_PRINT((ndo, " type: ??")); + ND_PRINT(" type: ??"); break; } tp++; - ND_PRINT((ndo, " value:")); + ND_PRINT(" value:"); for (i = 0; i < 4; i++, tp+= 4) - ND_PRINT((ndo, " %08x", EXTRACT_BE_U_4(tp))); + ND_PRINT(" %08x", EXTRACT_BE_U_4(tp)); break; default: - ND_PRINT((ndo, " ??")); + ND_PRINT(" ??"); break; } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_RAPID_COMMIT: /* nothing todo */ - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_INTERFACE_ID: case DH6OPT_SUBSCRIBER_ID: @@ -519,32 +519,32 @@ dhcp6opt_print(netdissect_options *ndo, * at most 10 characters. */ tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); for (i = 0; i < optlen && i < 10; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i))); - ND_PRINT((ndo, "...)")); + ND_PRINT("%02x", EXTRACT_U_1(tp + i)); + ND_PRINT("...)"); break; case DH6OPT_RECONF_MSG: if (optlen != 1) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); dh6_reconf_type = EXTRACT_U_1(tp); switch (dh6_reconf_type) { case DH6_RENEW: - ND_PRINT((ndo, " for renew)")); + ND_PRINT(" for renew)"); break; case DH6_INFORM_REQ: - ND_PRINT((ndo, " for inf-req)")); + ND_PRINT(" for inf-req)"); break; default: - ND_PRINT((ndo, " for ?\?\?(%02x))", dh6_reconf_type)); + ND_PRINT(" for ?\?\?(%02x))", dh6_reconf_type); break; } break; case DH6OPT_RECONF_ACCEPT: /* nothing todo */ - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_SIP_SERVER_A: case DH6OPT_DNS_SERVERS: @@ -555,125 +555,125 @@ dhcp6opt_print(netdissect_options *ndo, case DH6OPT_PANA_AGENT: case DH6OPT_LQ_CLIENT_LINK: if (optlen % 16) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); for (i = 0; i < optlen; i += 16) - ND_PRINT((ndo, " %s", ip6addr_string(ndo, tp + i))); - ND_PRINT((ndo, ")")); + ND_PRINT(" %s", ip6addr_string(ndo, tp + i)); + ND_PRINT(")"); break; case DH6OPT_SIP_SERVER_D: case DH6OPT_DOMAIN_LIST: tp = (const u_char *)(dh6o + 1); while (tp < cp + sizeof(*dh6o) + optlen) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if ((tp = ns_nprint(ndo, tp, cp + sizeof(*dh6o) + optlen)) == NULL) goto trunc; } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_STATUS_CODE: if (optlen < 2) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " %s)", dhcp6stcode(EXTRACT_BE_U_2(tp)))); + ND_PRINT(" %s)", dhcp6stcode(EXTRACT_BE_U_2(tp))); break; case DH6OPT_IA_NA: case DH6OPT_IA_PD: if (optlen < 12) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " IAID:%u T1:%u T2:%u", + ND_PRINT(" IAID:%u T1:%u T2:%u", EXTRACT_BE_U_4(tp), EXTRACT_BE_U_4(tp + 4), - EXTRACT_BE_U_4(tp + 8))); + EXTRACT_BE_U_4(tp + 8)); if (optlen > 12) { /* there are sub-options */ dhcp6opt_print(ndo, tp + 12, tp + optlen); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_IA_TA: if (optlen < 4) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " IAID:%u", EXTRACT_BE_U_4(tp))); + ND_PRINT(" IAID:%u", EXTRACT_BE_U_4(tp)); if (optlen > 4) { /* there are sub-options */ dhcp6opt_print(ndo, tp + 4, tp + optlen); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_IA_PD_PREFIX: if (optlen < 25) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " %s/%d", ip6addr_string(ndo, tp + 9), EXTRACT_U_1(tp + 8))); - ND_PRINT((ndo, " pltime:%u vltime:%u", + ND_PRINT(" %s/%d", ip6addr_string(ndo, tp + 9), EXTRACT_U_1(tp + 8)); + ND_PRINT(" pltime:%u vltime:%u", EXTRACT_BE_U_4(tp), - EXTRACT_BE_U_4(tp + 4))); + EXTRACT_BE_U_4(tp + 4)); if (optlen > 25) { /* there are sub-options */ dhcp6opt_print(ndo, tp + 25, tp + optlen); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_LIFETIME: case DH6OPT_CLT_TIME: if (optlen != 4) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " %d)", EXTRACT_BE_U_4(tp))); + ND_PRINT(" %d)", EXTRACT_BE_U_4(tp)); break; case DH6OPT_REMOTE_ID: if (optlen < 4) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " %d ", EXTRACT_BE_U_4(tp))); + ND_PRINT(" %d ", EXTRACT_BE_U_4(tp)); /* * Print hex dump first 10 characters. */ for (i = 4; i < optlen && i < 14; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i))); - ND_PRINT((ndo, "...)")); + ND_PRINT("%02x", EXTRACT_U_1(tp + i)); + ND_PRINT("...)"); break; case DH6OPT_LQ_QUERY: if (optlen < 17) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); dh6_lq_query_type = EXTRACT_U_1(tp); switch (dh6_lq_query_type) { case 1: - ND_PRINT((ndo, " by-address")); + ND_PRINT(" by-address"); break; case 2: - ND_PRINT((ndo, " by-clientID")); + ND_PRINT(" by-clientID"); break; default: - ND_PRINT((ndo, " type_%u", dh6_lq_query_type)); + ND_PRINT(" type_%u", dh6_lq_query_type); break; } - ND_PRINT((ndo, " %s", ip6addr_string(ndo, tp + 1))); + ND_PRINT(" %s", ip6addr_string(ndo, tp + 1)); if (optlen > 17) { /* there are query-options */ dhcp6opt_print(ndo, tp + 17, tp + optlen); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_CLIENT_DATA: tp = (const u_char *)(dh6o + 1); @@ -681,25 +681,25 @@ dhcp6opt_print(netdissect_options *ndo, /* there are encapsulated options */ dhcp6opt_print(ndo, tp, tp + optlen); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_LQ_RELAY_DATA: if (optlen < 16) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, " %s ", ip6addr_string(ndo, tp))); + ND_PRINT(" %s ", ip6addr_string(ndo, tp)); /* * Print hex dump first 10 characters. */ for (i = 16; i < optlen && i < 26; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(tp + i))); - ND_PRINT((ndo, "...)")); + ND_PRINT("%02x", EXTRACT_U_1(tp + i)); + ND_PRINT("...)"); break; case DH6OPT_NTP_SERVER: if (optlen < 4) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); @@ -710,37 +710,37 @@ dhcp6opt_print(netdissect_options *ndo, tp += 2; if (tp + subopt_len > cp + sizeof(*dh6o) + optlen) goto trunc; - ND_PRINT((ndo, " subopt:%d", subopt_code)); + ND_PRINT(" subopt:%d", subopt_code); switch (subopt_code) { case DH6OPT_NTP_SUBOPTION_SRV_ADDR: case DH6OPT_NTP_SUBOPTION_MC_ADDR: if (subopt_len != 16) { - ND_PRINT((ndo, " ?")); + ND_PRINT(" ?"); break; } - ND_PRINT((ndo, " %s", ip6addr_string(ndo, tp))); + ND_PRINT(" %s", ip6addr_string(ndo, tp)); break; case DH6OPT_NTP_SUBOPTION_SRV_FQDN: - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (ns_nprint(ndo, tp, tp + subopt_len) == NULL) goto trunc; break; default: - ND_PRINT((ndo, " ?")); + ND_PRINT(" ?"); break; } tp += subopt_len; } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_AFTR_NAME: if (optlen < 3) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); remain_len = optlen; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* Encoding is described in section 3.1 of RFC 1035 */ while (remain_len && EXTRACT_U_1(tp)) { label_len = EXTRACT_U_1(tp); @@ -749,29 +749,29 @@ dhcp6opt_print(netdissect_options *ndo, (void)fn_printn(ndo, tp, label_len, NULL); tp += label_len; remain_len -= (label_len + 1); - if(EXTRACT_U_1(tp)) ND_PRINT((ndo, ".")); + if(EXTRACT_U_1(tp)) ND_PRINT("."); } else { - ND_PRINT((ndo, " ?")); + ND_PRINT(" ?"); break; } } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case DH6OPT_NEW_POSIX_TIMEZONE: /* all three of these options */ case DH6OPT_NEW_TZDB_TIMEZONE: /* are encoded similarly */ case DH6OPT_MUDURL: /* although GMT might not work */ if (optlen < 5) { - ND_PRINT((ndo, " ?)")); + ND_PRINT(" ?)"); break; } tp = (const u_char *)(dh6o + 1); - ND_PRINT((ndo, "=")); + ND_PRINT("="); (void)fn_printn(ndo, tp, (u_int)optlen, NULL); - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; default: - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; } @@ -780,7 +780,7 @@ dhcp6opt_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|dhcp6ext]")); + ND_PRINT("[|dhcp6ext]"); } /* @@ -797,7 +797,7 @@ dhcp6_print(netdissect_options *ndo, const u_char *extp; const char *name; - ND_PRINT((ndo, "dhcp6")); + ND_PRINT("dhcp6"); ep = (const u_char *)ndo->ndo_snapend; if (cp + length < ep) @@ -810,15 +810,15 @@ dhcp6_print(netdissect_options *ndo, name = tok2str(dh6_msgtype_str, "msgtype-%u", msgtype); if (!ndo->ndo_vflag) { - ND_PRINT((ndo, " %s", name)); + ND_PRINT(" %s", name); return; } /* XXX relay agent messages have to be handled differently */ - ND_PRINT((ndo, " %s (", name)); /*)*/ + ND_PRINT(" %s (", name); /*)*/ if (msgtype != DH6_RELAY_FORW && msgtype != DH6_RELAY_REPLY) { - ND_PRINT((ndo, "xid=%x", EXTRACT_BE_U_4(dh6->dh6_xid) & DH6_XIDMASK)); + ND_PRINT("xid=%x", EXTRACT_BE_U_4(dh6->dh6_xid) & DH6_XIDMASK); extp = (const u_char *)(dh6 + 1); dhcp6opt_print(ndo, extp, ep); } else { /* relay messages */ @@ -827,17 +827,17 @@ dhcp6_print(netdissect_options *ndo, ND_TCHECK(dh6relay->dh6relay_peeraddr); memcpy(&addr6, &dh6relay->dh6relay_linkaddr, sizeof (addr6)); - ND_PRINT((ndo, "linkaddr=%s", ip6addr_string(ndo, &addr6))); + ND_PRINT("linkaddr=%s", ip6addr_string(ndo, &addr6)); memcpy(&addr6, &dh6relay->dh6relay_peeraddr, sizeof (addr6)); - ND_PRINT((ndo, " peeraddr=%s", ip6addr_string(ndo, &addr6))); + ND_PRINT(" peeraddr=%s", ip6addr_string(ndo, &addr6)); dhcp6opt_print(ndo, (const u_char *)(dh6relay + 1), ep); } /*(*/ - ND_PRINT((ndo, ")")); + ND_PRINT(")"); return; trunc: - ND_PRINT((ndo, "[|dhcp6]")); + ND_PRINT("[|dhcp6]"); } diff --git a/print-domain.c b/print-domain.c index 541d9003..6c61e819 100644 --- a/print-domain.c +++ b/print-domain.c @@ -102,26 +102,26 @@ blabel_print(netdissect_options *ndo, lim = cp + 1 + slen; /* print the bit string as a hex string */ - ND_PRINT((ndo, "\\[x")); + ND_PRINT("\\[x"); for (bitp = cp + 1, b = bitlen; bitp < lim && b > 7; b -= 8, bitp++) { ND_TCHECK_1(bitp); - ND_PRINT((ndo, "%02x", EXTRACT_U_1(bitp))); + ND_PRINT("%02x", EXTRACT_U_1(bitp)); } if (b > 4) { ND_TCHECK_1(bitp); tc = EXTRACT_U_1(bitp); bitp++; - ND_PRINT((ndo, "%02x", tc & (0xff << (8 - b)))); + ND_PRINT("%02x", tc & (0xff << (8 - b))); } else if (b > 0) { ND_TCHECK_1(bitp); tc = EXTRACT_U_1(bitp); bitp++; - ND_PRINT((ndo, "%1x", ((tc >> 4) & 0x0f) & (0x0f << (4 - b)))); + ND_PRINT("%1x", ((tc >> 4) & 0x0f) & (0x0f << (4 - b))); } - ND_PRINT((ndo, "/%d]", bitlen)); + ND_PRINT("/%d]", bitlen); return lim; trunc: - ND_PRINT((ndo, ".../%d]", bitlen)); + ND_PRINT(".../%d]", bitlen); return NULL; } @@ -137,7 +137,7 @@ labellen(netdissect_options *ndo, if ((i & INDIR_MASK) == EDNS0_MASK) { int bitlen, elt; if ((elt = (i & ~INDIR_MASK)) != EDNS0_ELT_BITLABEL) { - ND_PRINT((ndo, "<ELT %d>", elt)); + ND_PRINT("<ELT %d>", elt); return(-1); } if (!ND_TTEST_1(cp + 1)) @@ -192,7 +192,7 @@ ns_nprint(netdissect_options *ndo, * the packet). */ if (offset >= max_offset) { - ND_PRINT((ndo, "<BAD PTR>")); + ND_PRINT("<BAD PTR>"); return(NULL); } max_offset = offset; @@ -214,7 +214,7 @@ ns_nprint(netdissect_options *ndo, break; default: /* unknown ELT */ - ND_PRINT((ndo, "<ELT %d>", elt)); + ND_PRINT("<ELT %d>", elt); return(NULL); } } else { @@ -223,7 +223,7 @@ ns_nprint(netdissect_options *ndo, } cp += l; - ND_PRINT((ndo, ".")); + ND_PRINT("."); if ((l = labellen(ndo, cp)) == (u_int)-1) return(NULL); if (!ND_TTEST_1(cp)) @@ -234,7 +234,7 @@ ns_nprint(netdissect_options *ndo, rp += l + 1; } else - ND_PRINT((ndo, ".")); + ND_PRINT("."); return (rp); } @@ -348,7 +348,7 @@ ns_qprint(netdissect_options *ndo, /* print the qtype */ i = EXTRACT_BE_U_2(cp); cp += 2; - ND_PRINT((ndo, " %s", tok2str(ns_type2str, "Type%d", i))); + ND_PRINT(" %s", tok2str(ns_type2str, "Type%d", i)); /* print the qclass (if it's not IN) */ i = EXTRACT_BE_U_2(cp); cp += 2; @@ -357,12 +357,12 @@ ns_qprint(netdissect_options *ndo, else class = i; if (class != C_IN) - ND_PRINT((ndo, " %s", tok2str(ns_class2str, "(Class %d)", class))); + ND_PRINT(" %s", tok2str(ns_class2str, "(Class %d)", class)); if (is_mdns) { - ND_PRINT((ndo, i & C_QU ? " (QU)" : " (QM)")); + ND_PRINT(i & C_QU ? " (QU)" : " (QM)"); } - ND_PRINT((ndo, "? ")); + ND_PRINT("? "); cp = ns_nprint(ndo, np, bp); return(cp ? cp + 4 : NULL); } @@ -377,7 +377,7 @@ ns_rprint(netdissect_options *ndo, const u_char *rp; if (ndo->ndo_vflag) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if ((cp = ns_nprint(ndo, cp, bp)) == NULL) return NULL; } else @@ -397,10 +397,10 @@ ns_rprint(netdissect_options *ndo, else class = i; if (class != C_IN && typ != T_OPT) - ND_PRINT((ndo, " %s", tok2str(ns_class2str, "(Class %d)", class))); + ND_PRINT(" %s", tok2str(ns_class2str, "(Class %d)", class)); if (is_mdns) { if (i & C_CACHE_FLUSH) - ND_PRINT((ndo, " (Cache flush)")); + ND_PRINT(" (Cache flush)"); } if (typ == T_OPT) { @@ -411,9 +411,9 @@ ns_rprint(netdissect_options *ndo, cp += 2; } else if (ndo->ndo_vflag > 2) { /* print ttl */ - ND_PRINT((ndo, " [")); + ND_PRINT(" ["); unsigned_relts_print(ndo, EXTRACT_BE_U_4(cp)); - ND_PRINT((ndo, "]")); + ND_PRINT("]"); cp += 4; } else { /* ignore ttl */ @@ -425,7 +425,7 @@ ns_rprint(netdissect_options *ndo, rp = cp + len; - ND_PRINT((ndo, " %s", tok2str(ns_type2str, "Type%d", typ))); + ND_PRINT(" %s", tok2str(ns_type2str, "Type%d", typ)); if (rp > ndo->ndo_snapend) return(NULL); @@ -433,7 +433,7 @@ ns_rprint(netdissect_options *ndo, case T_A: if (!ND_TTEST_LEN(cp, sizeof(struct in_addr))) return(NULL); - ND_PRINT((ndo, " %s", intoa(htonl(EXTRACT_BE_U_4(cp))))); + ND_PRINT(" %s", intoa(htonl(EXTRACT_BE_U_4(cp)))); break; case T_NS: @@ -442,7 +442,7 @@ ns_rprint(netdissect_options *ndo, #ifdef T_DNAME case T_DNAME: #endif - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (ns_nprint(ndo, cp, bp) == NULL) return(NULL); break; @@ -450,52 +450,52 @@ ns_rprint(netdissect_options *ndo, case T_SOA: if (!ndo->ndo_vflag) break; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if ((cp = ns_nprint(ndo, cp, bp)) == NULL) return(NULL); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if ((cp = ns_nprint(ndo, cp, bp)) == NULL) return(NULL); if (!ND_TTEST_LEN(cp, 5 * 4)) return(NULL); - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(" %u", EXTRACT_BE_U_4(cp)); cp += 4; - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(" %u", EXTRACT_BE_U_4(cp)); cp += 4; - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(" %u", EXTRACT_BE_U_4(cp)); cp += 4; - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(" %u", EXTRACT_BE_U_4(cp)); cp += 4; - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(" %u", EXTRACT_BE_U_4(cp)); cp += 4; break; case T_MX: - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (!ND_TTEST_2(cp)) return(NULL); if (ns_nprint(ndo, cp + 2, bp) == NULL) return(NULL); - ND_PRINT((ndo, " %d", EXTRACT_BE_U_2(cp))); + ND_PRINT(" %d", EXTRACT_BE_U_2(cp)); break; case T_TXT: while (cp < rp) { - ND_PRINT((ndo, " \"")); + ND_PRINT(" \""); cp = ns_cprint(ndo, cp); if (cp == NULL) return(NULL); - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); } break; case T_SRV: - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (!ND_TTEST_6(cp)) return(NULL); if (ns_nprint(ndo, cp + 6, bp) == NULL) return(NULL); - ND_PRINT((ndo, ":%d %d %d", EXTRACT_BE_U_2(cp + 4), - EXTRACT_BE_U_2(cp), EXTRACT_BE_U_2(cp + 2))); + ND_PRINT(":%d %d %d", EXTRACT_BE_U_2(cp + 4), + EXTRACT_BE_U_2(cp), EXTRACT_BE_U_2(cp + 2)); break; case T_AAAA: @@ -504,8 +504,8 @@ ns_rprint(netdissect_options *ndo, if (!ND_TTEST_LEN(cp, sizeof(struct in6_addr))) return(NULL); - ND_PRINT((ndo, " %s", - addrtostr6(cp, ntop_buf, sizeof(ntop_buf)))); + ND_PRINT(" %s", + addrtostr6(cp, ntop_buf, sizeof(ntop_buf))); break; } @@ -521,18 +521,18 @@ ns_rprint(netdissect_options *ndo, pbit = EXTRACT_U_1(cp); pbyte = (pbit & ~7) / 8; if (pbit > 128) { - ND_PRINT((ndo, " %u(bad plen)", pbit)); + ND_PRINT(" %u(bad plen)", pbit); break; } else if (pbit < 128) { if (!ND_TTEST_LEN(cp + 1, sizeof(a) - pbyte)) return(NULL); memset(&a, 0, sizeof(a)); memcpy(&a.s6_addr[pbyte], cp + 1, sizeof(a) - pbyte); - ND_PRINT((ndo, " %u %s", pbit, - addrtostr6(&a, ntop_buf, sizeof(ntop_buf)))); + ND_PRINT(" %u %s", pbit, + addrtostr6(&a, ntop_buf, sizeof(ntop_buf))); } if (pbit > 0) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (ns_nprint(ndo, cp + 1 + sizeof(a) - pbyte, bp) == NULL) return(NULL); } @@ -540,9 +540,9 @@ ns_rprint(netdissect_options *ndo, } case T_OPT: - ND_PRINT((ndo, " UDPsize=%u", class)); + ND_PRINT(" UDPsize=%u", class); if (opt_flags & 0x8000) - ND_PRINT((ndo, " DO")); + ND_PRINT(" DO"); break; case T_UNSPECA: /* One long string */ @@ -558,29 +558,29 @@ ns_rprint(netdissect_options *ndo, return(NULL); if (!ndo->ndo_vflag) break; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if ((cp = ns_nprint(ndo, cp, bp)) == NULL) return(NULL); cp += 6; if (!ND_TTEST_2(cp)) return(NULL); - ND_PRINT((ndo, " fudge=%u", EXTRACT_BE_U_2(cp))); + ND_PRINT(" fudge=%u", EXTRACT_BE_U_2(cp)); cp += 2; if (!ND_TTEST_2(cp)) return(NULL); - ND_PRINT((ndo, " maclen=%u", EXTRACT_BE_U_2(cp))); + ND_PRINT(" maclen=%u", EXTRACT_BE_U_2(cp)); cp += 2 + EXTRACT_BE_U_2(cp); if (!ND_TTEST_2(cp)) return(NULL); - ND_PRINT((ndo, " origid=%u", EXTRACT_BE_U_2(cp))); + ND_PRINT(" origid=%u", EXTRACT_BE_U_2(cp)); cp += 2; if (!ND_TTEST_2(cp)) return(NULL); - ND_PRINT((ndo, " error=%u", EXTRACT_BE_U_2(cp))); + ND_PRINT(" error=%u", EXTRACT_BE_U_2(cp)); cp += 2; if (!ND_TTEST_2(cp)) return(NULL); - ND_PRINT((ndo, " otherlen=%u", EXTRACT_BE_U_2(cp))); + ND_PRINT(" otherlen=%u", EXTRACT_BE_U_2(cp)); cp += 2; } } @@ -609,24 +609,24 @@ domain_print(netdissect_options *ndo, if (DNS_QR(flags)) { /* this is a response */ - ND_PRINT((ndo, "%d%s%s%s%s%s%s", + ND_PRINT("%d%s%s%s%s%s%s", EXTRACT_BE_U_2(np->id), ns_ops[DNS_OPCODE(flags)], ns_resp[DNS_RCODE(flags)], DNS_AA(flags)? "*" : "", DNS_RA(flags)? "" : "-", DNS_TC(flags)? "|" : "", - DNS_AD(flags)? "$" : "")); + DNS_AD(flags)? "$" : ""); if (qdcount != 1) - ND_PRINT((ndo, " [%uq]", qdcount)); + ND_PRINT(" [%uq]", qdcount); /* Print QUESTION section on -vv */ cp = (const u_char *)(np + 1); for (i = 0; i < qdcount; i++) { if (i != 0) - ND_PRINT((ndo, ",")); + ND_PRINT(","); if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, " q:")); + ND_PRINT(" q:"); if ((cp = ns_qprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; } else { @@ -635,13 +635,13 @@ domain_print(netdissect_options *ndo, cp += 4; /* skip QTYPE and QCLASS */ } } - ND_PRINT((ndo, " %u/%u/%u", ancount, nscount, arcount)); + ND_PRINT(" %u/%u/%u", ancount, nscount, arcount); if (ancount) { if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; ancount--; while (cp < ndo->ndo_snapend && ancount) { - ND_PRINT((ndo, ",")); + ND_PRINT(","); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; ancount--; @@ -652,12 +652,12 @@ domain_print(netdissect_options *ndo, /* Print NS and AR sections on -vv */ if (ndo->ndo_vflag > 1) { if (cp < ndo->ndo_snapend && nscount) { - ND_PRINT((ndo, " ns:")); + ND_PRINT(" ns:"); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; nscount--; while (cp < ndo->ndo_snapend && nscount) { - ND_PRINT((ndo, ",")); + ND_PRINT(","); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; nscount--; @@ -666,12 +666,12 @@ domain_print(netdissect_options *ndo, if (nscount) goto trunc; if (cp < ndo->ndo_snapend && arcount) { - ND_PRINT((ndo, " ar:")); + ND_PRINT(" ar:"); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; arcount--; while (cp < ndo->ndo_snapend && arcount) { - ND_PRINT((ndo, ",")); + ND_PRINT(","); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; arcount--; @@ -683,31 +683,31 @@ domain_print(netdissect_options *ndo, } else { /* this is a request */ - ND_PRINT((ndo, "%d%s%s%s", EXTRACT_BE_U_2(np->id), ns_ops[DNS_OPCODE(flags)], + ND_PRINT("%d%s%s%s", EXTRACT_BE_U_2(np->id), ns_ops[DNS_OPCODE(flags)], DNS_RD(flags) ? "+" : "", - DNS_CD(flags) ? "%" : "")); + DNS_CD(flags) ? "%" : ""); /* any weirdness? */ b2 = EXTRACT_BE_U_2(((const u_short *)np) + 1); if (b2 & 0x6cf) - ND_PRINT((ndo, " [b2&3=0x%x]", b2)); + ND_PRINT(" [b2&3=0x%x]", b2); if (DNS_OPCODE(flags) == IQUERY) { if (qdcount) - ND_PRINT((ndo, " [%uq]", qdcount)); + ND_PRINT(" [%uq]", qdcount); if (ancount != 1) - ND_PRINT((ndo, " [%ua]", ancount)); + ND_PRINT(" [%ua]", ancount); } else { if (ancount) - ND_PRINT((ndo, " [%ua]", ancount)); + ND_PRINT(" [%ua]", ancount); if (qdcount != 1) - ND_PRINT((ndo, " [%uq]", qdcount)); + ND_PRINT(" [%uq]", qdcount); } if (nscount) - ND_PRINT((ndo, " [%un]", nscount)); + ND_PRINT(" [%un]", nscount); if (arcount) - ND_PRINT((ndo, " [%uau]", arcount)); + ND_PRINT(" [%uau]", arcount); cp = (const u_char *)(np + 1); if (qdcount) { @@ -734,7 +734,7 @@ domain_print(netdissect_options *ndo, goto trunc; ancount--; while (cp < ndo->ndo_snapend && ancount) { - ND_PRINT((ndo, ",")); + ND_PRINT(","); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; ancount--; @@ -743,12 +743,12 @@ domain_print(netdissect_options *ndo, if (ancount) goto trunc; if (cp < ndo->ndo_snapend && nscount) { - ND_PRINT((ndo, " ns:")); + ND_PRINT(" ns:"); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; nscount--; while (cp < ndo->ndo_snapend && nscount) { - ND_PRINT((ndo, ",")); + ND_PRINT(","); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; nscount--; @@ -757,12 +757,12 @@ domain_print(netdissect_options *ndo, if (nscount > 0) goto trunc; if (cp < ndo->ndo_snapend && arcount) { - ND_PRINT((ndo, " ar:")); + ND_PRINT(" ar:"); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; arcount--; while (cp < ndo->ndo_snapend && arcount) { - ND_PRINT((ndo, ",")); + ND_PRINT(","); if ((cp = ns_rprint(ndo, cp, bp, is_mdns)) == NULL) goto trunc; arcount--; @@ -772,9 +772,9 @@ domain_print(netdissect_options *ndo, goto trunc; } } - ND_PRINT((ndo, " (%d)", length)); + ND_PRINT(" (%d)", length); return; trunc: - ND_PRINT((ndo, "[|domain]")); + ND_PRINT("[|domain]"); } diff --git a/print-dtp.c b/print-dtp.c index bf1242e0..46e9d2ed 100644 --- a/print-dtp.c +++ b/print-dtp.c @@ -56,9 +56,9 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) ND_TCHECK_LEN(tptr, DTP_HEADER_LEN); - ND_PRINT((ndo, "DTPv%u, length %u", + ND_PRINT("DTPv%u, length %u", EXTRACT_U_1(tptr), - length)); + length); /* * In non-verbose mode, just print version. @@ -77,9 +77,9 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) /* XXX: should not be but sometimes it is, see the test captures */ if (type == 0) return; - ND_PRINT((ndo, "\n\t%s (0x%04x) TLV, length %u", + ND_PRINT("\n\t%s (0x%04x) TLV, length %u", tok2str(dtp_tlv_values, "Unknown", type), - type, len)); + type, len); /* infinite loop check */ if (len < 4) @@ -88,7 +88,7 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) switch (type) { case DTP_DOMAIN_TLV: - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); fn_printzp(ndo, tptr+4, len-4, pptr+length); break; @@ -96,13 +96,13 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) case DTP_DTP_TYPE_TLV: if (len < 5) goto invalid; - ND_PRINT((ndo, ", 0x%x", EXTRACT_U_1(tptr + 4))); + ND_PRINT(", 0x%x", EXTRACT_U_1(tptr + 4)); break; case DTP_NEIGHBOR_TLV: if (len < 10) goto invalid; - ND_PRINT((ndo, ", %s", etheraddr_string(ndo, tptr+4))); + ND_PRINT(", %s", etheraddr_string(ndo, tptr+4)); break; default: @@ -114,10 +114,10 @@ dtp_print (netdissect_options *ndo, const u_char *pptr, u_int length) return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* diff --git a/print-dvmrp.c b/print-dvmrp.c index 91daec83..20c5ec36 100644 --- a/print-dvmrp.c +++ b/print-dvmrp.c @@ -87,7 +87,7 @@ dvmrp_print(netdissect_options *ndo, switch (type) { case DVMRP_PROBE: - ND_PRINT((ndo, " Probe")); + ND_PRINT(" Probe"); if (ndo->ndo_vflag) { if (print_probe(ndo, bp, ep, len) < 0) goto trunc; @@ -95,7 +95,7 @@ dvmrp_print(netdissect_options *ndo, break; case DVMRP_REPORT: - ND_PRINT((ndo, " Report")); + ND_PRINT(" Report"); if (ndo->ndo_vflag > 1) { if (print_report(ndo, bp, ep, len) < 0) goto trunc; @@ -103,21 +103,21 @@ dvmrp_print(netdissect_options *ndo, break; case DVMRP_ASK_NEIGHBORS: - ND_PRINT((ndo, " Ask-neighbors(old)")); + ND_PRINT(" Ask-neighbors(old)"); break; case DVMRP_NEIGHBORS: - ND_PRINT((ndo, " Neighbors(old)")); + ND_PRINT(" Neighbors(old)"); if (print_neighbors(ndo, bp, ep, len) < 0) goto trunc; break; case DVMRP_ASK_NEIGHBORS2: - ND_PRINT((ndo, " Ask-neighbors2")); + ND_PRINT(" Ask-neighbors2"); break; case DVMRP_NEIGHBORS2: - ND_PRINT((ndo, " Neighbors2")); + ND_PRINT(" Neighbors2"); /* * extract version from IGMP group address field */ @@ -132,31 +132,31 @@ dvmrp_print(netdissect_options *ndo, break; case DVMRP_PRUNE: - ND_PRINT((ndo, " Prune")); + ND_PRINT(" Prune"); if (print_prune(ndo, bp) < 0) goto trunc; break; case DVMRP_GRAFT: - ND_PRINT((ndo, " Graft")); + ND_PRINT(" Graft"); if (print_graft(ndo, bp) < 0) goto trunc; break; case DVMRP_GRAFT_ACK: - ND_PRINT((ndo, " Graft-ACK")); + ND_PRINT(" Graft-ACK"); if (print_graft_ack(ndo, bp) < 0) goto trunc; break; default: - ND_PRINT((ndo, " [type %d]", type)); + ND_PRINT(" [type %d]", type); break; } return; trunc: - ND_PRINT((ndo, "[|dvmrp]")); + ND_PRINT("[|dvmrp]"); return; } @@ -171,7 +171,7 @@ print_report(netdissect_options *ndo, while (len > 0) { if (len < 3) { - ND_PRINT((ndo, " [|]")); + ND_PRINT(" [|]"); return (0); } ND_TCHECK_3(bp); @@ -185,16 +185,16 @@ print_report(netdissect_options *ndo, if (EXTRACT_U_1(bp + 2)) width = 4; - ND_PRINT((ndo, "\n\tMask %s", intoa(htonl(mask)))); + ND_PRINT("\n\tMask %s", intoa(htonl(mask))); bp += 3; len -= 3; do { if (bp + width + 1 > ep) { - ND_PRINT((ndo, " [|]")); + ND_PRINT(" [|]"); return (0); } if (len < width + 1) { - ND_PRINT((ndo, "\n\t [Truncated Report]")); + ND_PRINT("\n\t [Truncated Report]"); return (0); } origin = 0; @@ -211,8 +211,8 @@ print_report(netdissect_options *ndo, bp++; done = metric & 0x80; metric &= 0x7f; - ND_PRINT((ndo, "\n\t %s metric %d", intoa(htonl(origin)), - metric)); + ND_PRINT("\n\t %s metric %d", intoa(htonl(origin)), + metric); len -= width + 1; } while (!done); } @@ -231,21 +231,21 @@ print_probe(netdissect_options *ndo, ND_TCHECK_4(bp); if ((len < 4) || ((bp + 4) > ep)) { /* { (ctags) */ - ND_PRINT((ndo, " [|}")); + ND_PRINT(" [|}"); return (0); } genid = (EXTRACT_U_1(bp) << 24) | (EXTRACT_U_1(bp + 1) << 16) | (EXTRACT_U_1(bp + 2) << 8) | EXTRACT_U_1(bp + 3); bp += 4; len -= 4; - ND_PRINT((ndo, ndo->ndo_vflag > 1 ? "\n\t" : " ")); - ND_PRINT((ndo, "genid %u", genid)); + ND_PRINT(ndo->ndo_vflag > 1 ? "\n\t" : " "); + ND_PRINT("genid %u", genid); if (ndo->ndo_vflag < 2) return (0); while ((len > 0) && (bp < ep)) { ND_TCHECK_4(bp); - ND_PRINT((ndo, "\n\tneighbor %s", ipaddr_string(ndo, bp))); + ND_PRINT("\n\tneighbor %s", ipaddr_string(ndo, bp)); bp += 4; len -= 4; } return (0); @@ -276,9 +276,9 @@ print_neighbors(netdissect_options *ndo, len -= 7; while (--ncount >= 0) { ND_TCHECK_4(bp); - ND_PRINT((ndo, " [%s ->", ipaddr_string(ndo, laddr))); - ND_PRINT((ndo, " %s, (%d/%d)]", - ipaddr_string(ndo, bp), metric, thresh)); + ND_PRINT(" [%s ->", ipaddr_string(ndo, laddr)); + ND_PRINT(" %s, (%d/%d)]", + ipaddr_string(ndo, bp), metric, thresh); bp += 4; len -= 4; } @@ -298,7 +298,7 @@ print_neighbors2(netdissect_options *ndo, u_char metric, thresh, flags; int ncount; - ND_PRINT((ndo, " (v %u.%u):", major_version, minor_version)); + ND_PRINT(" (v %u.%u):", major_version, minor_version); while (len > 0 && bp < ep) { ND_TCHECK_8(bp); @@ -314,25 +314,25 @@ print_neighbors2(netdissect_options *ndo, bp++; len -= 8; while (--ncount >= 0 && (len >= 4) && (bp + 4) <= ep) { - ND_PRINT((ndo, " [%s -> ", ipaddr_string(ndo, laddr))); - ND_PRINT((ndo, "%s (%d/%d", ipaddr_string(ndo, bp), - metric, thresh)); + ND_PRINT(" [%s -> ", ipaddr_string(ndo, laddr)); + ND_PRINT("%s (%d/%d", ipaddr_string(ndo, bp), + metric, thresh); if (flags & DVMRP_NF_TUNNEL) - ND_PRINT((ndo, "/tunnel")); + ND_PRINT("/tunnel"); if (flags & DVMRP_NF_SRCRT) - ND_PRINT((ndo, "/srcrt")); + ND_PRINT("/srcrt"); if (flags & DVMRP_NF_QUERIER) - ND_PRINT((ndo, "/querier")); + ND_PRINT("/querier"); if (flags & DVMRP_NF_DISABLED) - ND_PRINT((ndo, "/disabled")); + ND_PRINT("/disabled"); if (flags & DVMRP_NF_DOWN) - ND_PRINT((ndo, "/down")); - ND_PRINT((ndo, ")]")); + ND_PRINT("/down"); + ND_PRINT(")]"); bp += 4; len -= 4; } if (ncount != -1) { - ND_PRINT((ndo, " [|]")); + ND_PRINT(" [|]"); return (0); } } @@ -346,9 +346,9 @@ print_prune(netdissect_options *ndo, const u_char *bp) { ND_TCHECK_LEN(bp, 12); - ND_PRINT((ndo, " src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4))); + ND_PRINT(" src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4)); bp += 8; - ND_PRINT((ndo, " timer ")); + ND_PRINT(" timer "); unsigned_relts_print(ndo, EXTRACT_BE_U_4(bp)); return (0); trunc: @@ -360,7 +360,7 @@ print_graft(netdissect_options *ndo, const u_char *bp) { ND_TCHECK_8(bp); - ND_PRINT((ndo, " src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4))); + ND_PRINT(" src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4)); return (0); trunc: return (-1); @@ -371,7 +371,7 @@ print_graft_ack(netdissect_options *ndo, const u_char *bp) { ND_TCHECK_8(bp); - ND_PRINT((ndo, " src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4))); + ND_PRINT(" src %s grp %s", ipaddr_string(ndo, bp), ipaddr_string(ndo, bp + 4)); return (0); trunc: return (-1); diff --git a/print-eap.c b/print-eap.c index e72e5900..55b04de8 100644 --- a/print-eap.c +++ b/print-eap.c @@ -164,19 +164,19 @@ eap_print(netdissect_options *ndo, /* in non-verbose mode just lets print the basic info */ if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "%s (%u) v%u, len %u", + ND_PRINT("%s (%u) v%u, len %u", tok2str(eap_frame_type_values, "unknown", eap_type), eap_type, EXTRACT_U_1(eap->version), - EXTRACT_BE_U_2(eap->length))); + EXTRACT_BE_U_2(eap->length)); return; } - ND_PRINT((ndo, "%s (%u) v%u, len %u", + ND_PRINT("%s (%u) v%u, len %u", tok2str(eap_frame_type_values, "unknown", eap_type), eap_type, EXTRACT_U_1(eap->version), - EXTRACT_BE_U_2(eap->length))); + EXTRACT_BE_U_2(eap->length)); tptr += sizeof(struct eap_frame_t); tlen -= sizeof(struct eap_frame_t); @@ -187,32 +187,32 @@ eap_print(netdissect_options *ndo, type = EXTRACT_U_1(tptr); ND_TCHECK_2(tptr + 2); len = EXTRACT_BE_U_2(tptr + 2); - ND_PRINT((ndo, ", %s (%u), id %u, len %u", + ND_PRINT(", %s (%u), id %u, len %u", tok2str(eap_code_values, "unknown", type), type, EXTRACT_U_1((tptr + 1)), - len)); + len); ND_TCHECK_LEN(tptr, len); if (type <= 2) { /* For EAP_REQUEST and EAP_RESPONSE only */ ND_TCHECK_1(tptr + 4); subtype = EXTRACT_U_1(tptr + 4); - ND_PRINT((ndo, "\n\t\t Type %s (%u)", + ND_PRINT("\n\t\t Type %s (%u)", tok2str(eap_type_values, "unknown", subtype), - subtype)); + subtype); switch (subtype) { case EAP_TYPE_IDENTITY: if (len - 5 > 0) { - ND_PRINT((ndo, ", Identity: ")); + ND_PRINT(", Identity: "); safeputs(ndo, tptr + 5, len - 5); } break; case EAP_TYPE_NOTIFICATION: if (len - 5 > 0) { - ND_PRINT((ndo, ", Notification: ")); + ND_PRINT(", Notification: "); safeputs(ndo, tptr + 5, len - 5); } break; @@ -227,9 +227,9 @@ eap_print(netdissect_options *ndo, */ while (count < len) { ND_TCHECK_1(tptr + count); - ND_PRINT((ndo, " %s (%u),", + ND_PRINT(" %s (%u),", tok2str(eap_type_values, "unknown", EXTRACT_U_1((tptr + count))), - EXTRACT_U_1(tptr + count))); + EXTRACT_U_1(tptr + count)); count++; } break; @@ -238,29 +238,29 @@ eap_print(netdissect_options *ndo, case EAP_TYPE_TLS: ND_TCHECK_1(tptr + 5); if (subtype == EAP_TYPE_TTLS) - ND_PRINT((ndo, " TTLSv%u", - EAP_TTLS_VERSION(EXTRACT_U_1((tptr + 5))))); - ND_PRINT((ndo, " flags [%s] 0x%02x,", + ND_PRINT(" TTLSv%u", + EAP_TTLS_VERSION(EXTRACT_U_1((tptr + 5)))); + ND_PRINT(" flags [%s] 0x%02x,", bittok2str(eap_tls_flags_values, "none", EXTRACT_U_1((tptr + 5))), - EXTRACT_U_1(tptr + 5))); + EXTRACT_U_1(tptr + 5)); if (EAP_TLS_EXTRACT_BIT_L(EXTRACT_U_1(tptr + 5))) { ND_TCHECK_4(tptr + 6); - ND_PRINT((ndo, " len %u", EXTRACT_BE_U_4(tptr + 6))); + ND_PRINT(" len %u", EXTRACT_BE_U_4(tptr + 6)); } break; case EAP_TYPE_FAST: ND_TCHECK_1(tptr + 5); - ND_PRINT((ndo, " FASTv%u", - EAP_TTLS_VERSION(EXTRACT_U_1((tptr + 5))))); - ND_PRINT((ndo, " flags [%s] 0x%02x,", + ND_PRINT(" FASTv%u", + EAP_TTLS_VERSION(EXTRACT_U_1((tptr + 5)))); + ND_PRINT(" flags [%s] 0x%02x,", bittok2str(eap_tls_flags_values, "none", EXTRACT_U_1((tptr + 5))), - EXTRACT_U_1(tptr + 5))); + EXTRACT_U_1(tptr + 5)); if (EAP_TLS_EXTRACT_BIT_L(EXTRACT_U_1(tptr + 5))) { ND_TCHECK_4(tptr + 6); - ND_PRINT((ndo, " len %u", EXTRACT_BE_U_4(tptr + 6))); + ND_PRINT(" len %u", EXTRACT_BE_U_4(tptr + 6)); } /* FIXME - TLV attributes follow */ @@ -269,9 +269,9 @@ eap_print(netdissect_options *ndo, case EAP_TYPE_AKA: case EAP_TYPE_SIM: ND_TCHECK_1(tptr + 5); - ND_PRINT((ndo, " subtype [%s] 0x%02x,", + ND_PRINT(" subtype [%s] 0x%02x,", tok2str(eap_aka_subtype_values, "unknown", EXTRACT_U_1((tptr + 5))), - EXTRACT_U_1(tptr + 5))); + EXTRACT_U_1(tptr + 5)); /* FIXME - TLV attributes follow */ break; @@ -295,7 +295,7 @@ eap_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "\n\t[|EAP]")); + ND_PRINT("\n\t[|EAP]"); } /* diff --git a/print-egp.c b/print-egp.c index b35a3ec4..50d04dc4 100644 --- a/print-egp.c +++ b/print-egp.c @@ -192,17 +192,17 @@ egpnrprint(netdissect_options *ndo, distances = EXTRACT_U_1(cp); cp++; length--; - ND_PRINT((ndo, " %s %s ", + ND_PRINT(" %s %s ", gateways < intgw ? "int" : "ext", - ipaddr_string(ndo, &addr))); + ipaddr_string(ndo, &addr)); comma = ""; - ND_PRINT((ndo, "(")); + ND_PRINT("("); while (distances != 0) { if (length < 2) goto trunc; ND_TCHECK_2(cp); - ND_PRINT((ndo, "%sd%u:", comma, EXTRACT_U_1(cp))); + ND_PRINT("%sd%u:", comma, EXTRACT_U_1(cp)); cp++; comma = ", "; networks = EXTRACT_U_1(cp); @@ -233,16 +233,16 @@ egpnrprint(netdissect_options *ndo, cp++; length -= 2; } - ND_PRINT((ndo, " %s", ipaddr_string(ndo, &addr))); + ND_PRINT(" %s", ipaddr_string(ndo, &addr)); networks--; } distances--; } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } return; trunc: - ND_PRINT((ndo, "[|]")); + ND_PRINT("[|]"); } void @@ -257,25 +257,25 @@ egp_print(netdissect_options *ndo, egp = (const struct egp_packet *)bp; if (length < sizeof(*egp) || !ND_TTEST_SIZE(egp)) { - ND_PRINT((ndo, "[|egp]")); + ND_PRINT("[|egp]"); return; } version = EXTRACT_U_1(egp->egp_version); if (!ndo->ndo_vflag) { - ND_PRINT((ndo, "EGPv%u, AS %u, seq %u, length %u", + ND_PRINT("EGPv%u, AS %u, seq %u, length %u", version, EXTRACT_BE_U_2(egp->egp_as), EXTRACT_BE_U_2(egp->egp_sequence), - length)); + length); return; } else - ND_PRINT((ndo, "EGPv%u, length %u", + ND_PRINT("EGPv%u, length %u", version, - length)); + length); if (version != EGP_VERSION) { - ND_PRINT((ndo, "[version %u]", version)); + ND_PRINT("[version %u]", version); return; } @@ -285,31 +285,31 @@ egp_print(netdissect_options *ndo, switch (type) { case EGPT_ACQUIRE: - ND_PRINT((ndo, " acquire")); + ND_PRINT(" acquire"); switch (code) { case EGPC_REQUEST: case EGPC_CONFIRM: - ND_PRINT((ndo, " %s", egp_acquire_codes[code])); + ND_PRINT(" %s", egp_acquire_codes[code]); switch (status) { case EGPS_UNSPEC: case EGPS_ACTIVE: case EGPS_PASSIVE: - ND_PRINT((ndo, " %s", egp_acquire_status[status])); + ND_PRINT(" %s", egp_acquire_status[status]); break; default: - ND_PRINT((ndo, " [status %u]", status)); + ND_PRINT(" [status %u]", status); break; } - ND_PRINT((ndo, " hello:%u poll:%u", + ND_PRINT(" hello:%u poll:%u", EXTRACT_BE_U_2(egp->egp_hello), - EXTRACT_BE_U_2(egp->egp_poll))); + EXTRACT_BE_U_2(egp->egp_poll)); break; case EGPC_REFUSE: case EGPC_CEASE: case EGPC_CEASEACK: - ND_PRINT((ndo, " %s", egp_acquire_codes[code])); + ND_PRINT(" %s", egp_acquire_codes[code]); switch (status ) { case EGPS_UNSPEC: case EGPS_NORES: @@ -317,17 +317,17 @@ egp_print(netdissect_options *ndo, case EGPS_GODOWN: case EGPS_PARAM: case EGPS_PROTO: - ND_PRINT((ndo, " %s", egp_acquire_status[status])); + ND_PRINT(" %s", egp_acquire_status[status]); break; default: - ND_PRINT((ndo, "[status %u]", status)); + ND_PRINT("[status %u]", status); break; } break; default: - ND_PRINT((ndo, "[code %u]", code)); + ND_PRINT("[code %u]", code); break; } break; @@ -337,61 +337,61 @@ egp_print(netdissect_options *ndo, case EGPC_HELLO: case EGPC_HEARDU: - ND_PRINT((ndo, " %s", egp_reach_codes[code])); + ND_PRINT(" %s", egp_reach_codes[code]); if (status <= EGPS_DOWN) - ND_PRINT((ndo, " state:%s", egp_status_updown[status])); + ND_PRINT(" state:%s", egp_status_updown[status]); else - ND_PRINT((ndo, " [status %u]", status)); + ND_PRINT(" [status %u]", status); break; default: - ND_PRINT((ndo, "[reach code %u]", code)); + ND_PRINT("[reach code %u]", code); break; } break; case EGPT_POLL: - ND_PRINT((ndo, " poll")); + ND_PRINT(" poll"); if (status <= EGPS_DOWN) - ND_PRINT((ndo, " state:%s", egp_status_updown[status])); + ND_PRINT(" state:%s", egp_status_updown[status]); else - ND_PRINT((ndo, " [status %u]", status)); - ND_PRINT((ndo, " net:%s", ipaddr_string(ndo, &egp->egp_sourcenet))); + ND_PRINT(" [status %u]", status); + ND_PRINT(" net:%s", ipaddr_string(ndo, &egp->egp_sourcenet)); break; case EGPT_UPDATE: - ND_PRINT((ndo, " update")); + ND_PRINT(" update"); if (status & EGPS_UNSOL) { status &= ~EGPS_UNSOL; - ND_PRINT((ndo, " unsolicited")); + ND_PRINT(" unsolicited"); } if (status <= EGPS_DOWN) - ND_PRINT((ndo, " state:%s", egp_status_updown[status])); + ND_PRINT(" state:%s", egp_status_updown[status]); else - ND_PRINT((ndo, " [status %u]", status)); - ND_PRINT((ndo, " %s int %u ext %u", + ND_PRINT(" [status %u]", status); + ND_PRINT(" %s int %u ext %u", ipaddr_string(ndo, &egp->egp_sourcenet), EXTRACT_U_1(egp->egp_intgw), - EXTRACT_U_1(egp->egp_extgw))); + EXTRACT_U_1(egp->egp_extgw)); if (ndo->ndo_vflag) egpnrprint(ndo, egp, length); break; case EGPT_ERROR: - ND_PRINT((ndo, " error")); + ND_PRINT(" error"); if (status <= EGPS_DOWN) - ND_PRINT((ndo, " state:%s", egp_status_updown[status])); + ND_PRINT(" state:%s", egp_status_updown[status]); else - ND_PRINT((ndo, " [status %u]", status)); + ND_PRINT(" [status %u]", status); if (EXTRACT_BE_U_2(egp->egp_reason) <= EGPR_UVERSION) - ND_PRINT((ndo, " %s", egp_reasons[EXTRACT_BE_U_2(egp->egp_reason)])); + ND_PRINT(" %s", egp_reasons[EXTRACT_BE_U_2(egp->egp_reason)]); else - ND_PRINT((ndo, " [reason %u]", EXTRACT_BE_U_2(egp->egp_reason))); + ND_PRINT(" [reason %u]", EXTRACT_BE_U_2(egp->egp_reason)); break; default: - ND_PRINT((ndo, "[type %u]", type)); + ND_PRINT("[type %u]", type); break; } } diff --git a/print-eigrp.c b/print-eigrp.c index 92c649b2..72e6efcb 100644 --- a/print-eigrp.c +++ b/print-eigrp.c @@ -234,30 +234,30 @@ eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len) * Sanity checking of the header. */ if (EXTRACT_U_1(eigrp_com_header->version) != EIGRP_VERSION) { - ND_PRINT((ndo, "EIGRP version %u packet not supported",EXTRACT_U_1(eigrp_com_header->version))); + ND_PRINT("EIGRP version %u packet not supported",EXTRACT_U_1(eigrp_com_header->version)); return; } /* in non-verbose mode just lets print the basic Message Type*/ if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "EIGRP %s, length: %u", + ND_PRINT("EIGRP %s, length: %u", tok2str(eigrp_opcode_values, "unknown (%u)",EXTRACT_U_1(eigrp_com_header->opcode)), - len)); + len); return; } /* ok they seem to want to know everything - lets fully decode it */ if (len < sizeof(struct eigrp_common_header)) { - ND_PRINT((ndo, "EIGRP %s, length: %u (too short, < %u)", + ND_PRINT("EIGRP %s, length: %u (too short, < %u)", tok2str(eigrp_opcode_values, "unknown (%u)",EXTRACT_U_1(eigrp_com_header->opcode)), - len, (u_int) sizeof(struct eigrp_common_header))); + len, (u_int) sizeof(struct eigrp_common_header)); return; } tlen=len-sizeof(struct eigrp_common_header); /* FIXME print other header info */ - ND_PRINT((ndo, "\n\tEIGRP v%u, opcode: %s (%u), chksum: 0x%04x, Flags: [%s]\n\tseq: 0x%08x, ack: 0x%08x, AS: %u, length: %u", + ND_PRINT("\n\tEIGRP v%u, opcode: %s (%u), chksum: 0x%04x, Flags: [%s]\n\tseq: 0x%08x, ack: 0x%08x, AS: %u, length: %u", EXTRACT_U_1(eigrp_com_header->version), tok2str(eigrp_opcode_values, "unknown, type: %u",EXTRACT_U_1(eigrp_com_header->opcode)), EXTRACT_U_1(eigrp_com_header->opcode), @@ -268,7 +268,7 @@ eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len) EXTRACT_BE_U_4(eigrp_com_header->seq), EXTRACT_BE_U_4(eigrp_com_header->ack), EXTRACT_BE_U_4(eigrp_com_header->asn), - tlen)); + tlen); tptr+=sizeof(struct eigrp_common_header); @@ -287,16 +287,16 @@ eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len) return; } - ND_PRINT((ndo, "\n\t %s TLV (0x%04x), length: %u", + ND_PRINT("\n\t %s TLV (0x%04x), length: %u", tok2str(eigrp_tlv_values, "Unknown", eigrp_tlv_type), eigrp_tlv_type, - eigrp_tlv_len)); + eigrp_tlv_len); if (eigrp_tlv_len < sizeof(struct eigrp_tlv_header)) { - ND_PRINT((ndo, " (too short, < %u)", - (u_int) sizeof(struct eigrp_tlv_header))); + ND_PRINT(" (too short, < %u)", + (u_int) sizeof(struct eigrp_tlv_header)); break; } tlv_tptr=tptr+sizeof(struct eigrp_tlv_header); @@ -310,187 +310,187 @@ eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len) case EIGRP_TLV_GENERAL_PARM: tlv_ptr.eigrp_tlv_general_parm = (const struct eigrp_tlv_general_parm_t *)tlv_tptr; if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_general_parm)) { - ND_PRINT((ndo, " (too short, < %u)", - (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_general_parm)))); + ND_PRINT(" (too short, < %u)", + (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_general_parm))); break; } - ND_PRINT((ndo, "\n\t holdtime: %us, k1 %u, k2 %u, k3 %u, k4 %u, k5 %u", + ND_PRINT("\n\t holdtime: %us, k1 %u, k2 %u, k3 %u, k4 %u, k5 %u", EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_general_parm->holdtime), EXTRACT_U_1(tlv_ptr.eigrp_tlv_general_parm->k1), EXTRACT_U_1(tlv_ptr.eigrp_tlv_general_parm->k2), EXTRACT_U_1(tlv_ptr.eigrp_tlv_general_parm->k3), EXTRACT_U_1(tlv_ptr.eigrp_tlv_general_parm->k4), - EXTRACT_U_1(tlv_ptr.eigrp_tlv_general_parm->k5))); + EXTRACT_U_1(tlv_ptr.eigrp_tlv_general_parm->k5)); break; case EIGRP_TLV_SW_VERSION: tlv_ptr.eigrp_tlv_sw_version = (const struct eigrp_tlv_sw_version_t *)tlv_tptr; if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_sw_version)) { - ND_PRINT((ndo, " (too short, < %u)", - (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_sw_version)))); + ND_PRINT(" (too short, < %u)", + (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_sw_version))); break; } - ND_PRINT((ndo, "\n\t IOS version: %u.%u, EIGRP version %u.%u", + ND_PRINT("\n\t IOS version: %u.%u, EIGRP version %u.%u", EXTRACT_U_1(tlv_ptr.eigrp_tlv_sw_version->ios_major), EXTRACT_U_1(tlv_ptr.eigrp_tlv_sw_version->ios_minor), EXTRACT_U_1(tlv_ptr.eigrp_tlv_sw_version->eigrp_major), - EXTRACT_U_1(tlv_ptr.eigrp_tlv_sw_version->eigrp_minor))); + EXTRACT_U_1(tlv_ptr.eigrp_tlv_sw_version->eigrp_minor)); break; case EIGRP_TLV_IP_INT: tlv_ptr.eigrp_tlv_ip_int = (const struct eigrp_tlv_ip_int_t *)tlv_tptr; if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_ip_int)) { - ND_PRINT((ndo, " (too short, < %u)", - (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_ip_int)))); + ND_PRINT(" (too short, < %u)", + (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_ip_int))); break; } bit_length = EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_int->plen); if (bit_length > 32) { - ND_PRINT((ndo, "\n\t illegal prefix length %u",bit_length)); + ND_PRINT("\n\t illegal prefix length %u",bit_length); break; } byte_length = (bit_length + 7) / 8; /* variable length encoding */ memset(prefix, 0, 4); memcpy(prefix, tlv_ptr.eigrp_tlv_ip_int->destination, byte_length); - ND_PRINT((ndo, "\n\t IPv4 prefix: %15s/%u, nexthop: ", + ND_PRINT("\n\t IPv4 prefix: %15s/%u, nexthop: ", ipaddr_string(ndo, prefix), - bit_length)); + bit_length); if (EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_int->nexthop) == 0) - ND_PRINT((ndo, "self")); + ND_PRINT("self"); else - ND_PRINT((ndo, "%s",ipaddr_string(ndo, &tlv_ptr.eigrp_tlv_ip_int->nexthop))); + ND_PRINT("%s",ipaddr_string(ndo, &tlv_ptr.eigrp_tlv_ip_int->nexthop)); - ND_PRINT((ndo, "\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u", + ND_PRINT("\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u", (EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_int->delay)/100), EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_int->bandwidth), EXTRACT_BE_U_3(tlv_ptr.eigrp_tlv_ip_int->mtu), EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_int->hopcount), EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_int->reliability), - EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_int->load))); + EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_int->load)); break; case EIGRP_TLV_IP_EXT: tlv_ptr.eigrp_tlv_ip_ext = (const struct eigrp_tlv_ip_ext_t *)tlv_tptr; if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_ip_ext)) { - ND_PRINT((ndo, " (too short, < %u)", - (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_ip_ext)))); + ND_PRINT(" (too short, < %u)", + (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_ip_ext))); break; } bit_length = EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_ext->plen); if (bit_length > 32) { - ND_PRINT((ndo, "\n\t illegal prefix length %u",bit_length)); + ND_PRINT("\n\t illegal prefix length %u",bit_length); break; } byte_length = (bit_length + 7) / 8; /* variable length encoding */ memset(prefix, 0, 4); memcpy(prefix, tlv_ptr.eigrp_tlv_ip_ext->destination, byte_length); - ND_PRINT((ndo, "\n\t IPv4 prefix: %15s/%u, nexthop: ", + ND_PRINT("\n\t IPv4 prefix: %15s/%u, nexthop: ", ipaddr_string(ndo, prefix), - bit_length)); + bit_length); if (EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->nexthop) == 0) - ND_PRINT((ndo, "self")); + ND_PRINT("self"); else - ND_PRINT((ndo, "%s",ipaddr_string(ndo, &tlv_ptr.eigrp_tlv_ip_ext->nexthop))); + ND_PRINT("%s",ipaddr_string(ndo, &tlv_ptr.eigrp_tlv_ip_ext->nexthop)); - ND_PRINT((ndo, "\n\t origin-router %s, origin-as %u, origin-proto %s, flags [0x%02x], tag 0x%08x, metric %u", + ND_PRINT("\n\t origin-router %s, origin-as %u, origin-proto %s, flags [0x%02x], tag 0x%08x, metric %u", ipaddr_string(ndo, &tlv_ptr.eigrp_tlv_ip_ext->origin_router), EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->origin_as), tok2str(eigrp_ext_proto_id_values,"unknown",EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_ext->proto_id)), EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_ext->flags), EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->tag), - EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->metric))); + EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->metric)); - ND_PRINT((ndo, "\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u", + ND_PRINT("\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u", (EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->delay)/100), EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->bandwidth), EXTRACT_BE_U_3(tlv_ptr.eigrp_tlv_ip_ext->mtu), EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_ext->hopcount), EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_ext->reliability), - EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_ext->load))); + EXTRACT_U_1(tlv_ptr.eigrp_tlv_ip_ext->load)); break; case EIGRP_TLV_AT_CABLE_SETUP: tlv_ptr.eigrp_tlv_at_cable_setup = (const struct eigrp_tlv_at_cable_setup_t *)tlv_tptr; if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_at_cable_setup)) { - ND_PRINT((ndo, " (too short, < %u)", - (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_at_cable_setup)))); + ND_PRINT(" (too short, < %u)", + (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_at_cable_setup))); break; } - ND_PRINT((ndo, "\n\t Cable-range: %u-%u, Router-ID %u", + ND_PRINT("\n\t Cable-range: %u-%u, Router-ID %u", EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_cable_setup->cable_start), EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_cable_setup->cable_end), - EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_cable_setup->router_id))); + EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_cable_setup->router_id)); break; case EIGRP_TLV_AT_INT: tlv_ptr.eigrp_tlv_at_int = (const struct eigrp_tlv_at_int_t *)tlv_tptr; if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_at_int)) { - ND_PRINT((ndo, " (too short, < %u)", - (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_at_int)))); + ND_PRINT(" (too short, < %u)", + (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_at_int))); break; } - ND_PRINT((ndo, "\n\t Cable-Range: %u-%u, nexthop: ", + ND_PRINT("\n\t Cable-Range: %u-%u, nexthop: ", EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_int->cable_start), - EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_int->cable_end))); + EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_int->cable_end)); if (EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_int->nexthop) == 0) - ND_PRINT((ndo, "self")); + ND_PRINT("self"); else - ND_PRINT((ndo, "%u.%u", + ND_PRINT("%u.%u", EXTRACT_BE_U_2(&tlv_ptr.eigrp_tlv_at_int->nexthop[0]), - EXTRACT_BE_U_2(&tlv_ptr.eigrp_tlv_at_int->nexthop[2]))); + EXTRACT_BE_U_2(&tlv_ptr.eigrp_tlv_at_int->nexthop[2])); - ND_PRINT((ndo, "\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u", + ND_PRINT("\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u", (EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_int->delay)/100), EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_int->bandwidth), EXTRACT_BE_U_3(tlv_ptr.eigrp_tlv_at_int->mtu), EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_int->hopcount), EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_int->reliability), - EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_int->load))); + EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_int->load)); break; case EIGRP_TLV_AT_EXT: tlv_ptr.eigrp_tlv_at_ext = (const struct eigrp_tlv_at_ext_t *)tlv_tptr; if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_at_ext)) { - ND_PRINT((ndo, " (too short, < %u)", - (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_at_ext)))); + ND_PRINT(" (too short, < %u)", + (u_int) (sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_at_ext))); break; } - ND_PRINT((ndo, "\n\t Cable-Range: %u-%u, nexthop: ", + ND_PRINT("\n\t Cable-Range: %u-%u, nexthop: ", EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_ext->cable_start), - EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_ext->cable_end))); + EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_ext->cable_end)); if (EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->nexthop) == 0) - ND_PRINT((ndo, "self")); + ND_PRINT("self"); else - ND_PRINT((ndo, "%u.%u", + ND_PRINT("%u.%u", EXTRACT_BE_U_2(&tlv_ptr.eigrp_tlv_at_ext->nexthop[0]), - EXTRACT_BE_U_2(&tlv_ptr.eigrp_tlv_at_ext->nexthop[2]))); + EXTRACT_BE_U_2(&tlv_ptr.eigrp_tlv_at_ext->nexthop[2])); - ND_PRINT((ndo, "\n\t origin-router %u, origin-as %u, origin-proto %s, flags [0x%02x], tag 0x%08x, metric %u", + ND_PRINT("\n\t origin-router %u, origin-as %u, origin-proto %s, flags [0x%02x], tag 0x%08x, metric %u", EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->origin_router), EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->origin_as), tok2str(eigrp_ext_proto_id_values,"unknown",EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_ext->proto_id)), EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_ext->flags), EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->tag), - EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_ext->metric))); + EXTRACT_BE_U_2(tlv_ptr.eigrp_tlv_at_ext->metric)); - ND_PRINT((ndo, "\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u", + ND_PRINT("\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u", (EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->delay)/100), EXTRACT_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->bandwidth), EXTRACT_BE_U_3(tlv_ptr.eigrp_tlv_at_ext->mtu), EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_ext->hopcount), EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_ext->reliability), - EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_ext->load))); + EXTRACT_U_1(tlv_ptr.eigrp_tlv_at_ext->load)); break; /* @@ -519,5 +519,5 @@ eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len) } return; trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); } diff --git a/print-enc.c b/print-enc.c index db965efb..bdeff22d 100644 --- a/print-enc.c +++ b/print-enc.c @@ -82,7 +82,7 @@ struct enchdr { #define ENC_PRINT_TYPE(wh, xf, nam) \ if ((wh) & (xf)) { \ - ND_PRINT((ndo, "%s%s", nam, (wh) == (xf) ? "): " : ",")); \ + ND_PRINT("%s%s", nam, (wh) == (xf) ? "): " : ","); \ (wh) &= ~(xf); \ } @@ -104,7 +104,7 @@ enc_if_print(netdissect_options *ndo, const struct enchdr *hdr; if (caplen < ENC_HDRLEN) { - ND_PRINT((ndo, "[|enc]")); + ND_PRINT("[|enc]"); goto out; } @@ -135,13 +135,13 @@ enc_if_print(netdissect_options *ndo, } if (flags == 0) - ND_PRINT((ndo, "(unprotected): ")); + ND_PRINT("(unprotected): "); else - ND_PRINT((ndo, "(")); + ND_PRINT("("); ENC_PRINT_TYPE(flags, M_AUTH, "authentic"); ENC_PRINT_TYPE(flags, M_CONF, "confidential"); /* ENC_PRINT_TYPE(flags, M_TUNNEL, "tunnel"); */ - ND_PRINT((ndo, "SPI 0x%08x: ", EXTRACT_BE_U_4(hdr->spi))); + ND_PRINT("SPI 0x%08x: ", EXTRACT_BE_U_4(hdr->spi)); length -= ENC_HDRLEN; caplen -= ENC_HDRLEN; diff --git a/print-esp.c b/print-esp.c index 4de04c4a..7013a0c5 100644 --- a/print-esp.c +++ b/print-esp.c @@ -681,12 +681,12 @@ esp_print(netdissect_options *ndo, ep = ndo->ndo_snapend; if ((const u_char *)(esp + 1) >= ep) { - ND_PRINT((ndo, "[|ESP]")); + ND_PRINT("[|ESP]"); goto fail; } - ND_PRINT((ndo, "ESP(spi=0x%08x", EXTRACT_BE_U_4(esp->esp_spi))); - ND_PRINT((ndo, ",seq=0x%x)", EXTRACT_BE_U_4(esp->esp_seq))); - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT("ESP(spi=0x%08x", EXTRACT_BE_U_4(esp->esp_spi)); + ND_PRINT(",seq=0x%x)", EXTRACT_BE_U_4(esp->esp_seq)); + ND_PRINT(", length %u", length); #ifndef HAVE_LIBCRYPTO goto fail; @@ -817,7 +817,7 @@ esp_print(netdissect_options *ndo, if (nhdr) *nhdr = EXTRACT_U_1(ep - 1); - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); return advance; #endif diff --git a/print-ether.c b/print-ether.c index 7143830f..c1f6fdba 100644 --- a/print-ether.c +++ b/print-ether.c @@ -113,28 +113,28 @@ ether_hdr_print(netdissect_options *ndo, ep = (const struct ether_header *)bp; - ND_PRINT((ndo, "%s > %s", + ND_PRINT("%s > %s", etheraddr_string(ndo, ep->ether_shost), - etheraddr_string(ndo, ep->ether_dhost))); + etheraddr_string(ndo, ep->ether_dhost)); length_type = EXTRACT_BE_U_2(ep->ether_length_type); if (!ndo->ndo_qflag) { if (length_type <= MAX_ETHERNET_LENGTH_VAL) { - ND_PRINT((ndo, ", 802.3")); + ND_PRINT(", 802.3"); length = length_type; } else - ND_PRINT((ndo, ", ethertype %s (0x%04x)", + ND_PRINT(", ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", length_type), - length_type)); + length_type); } else { if (length_type <= MAX_ETHERNET_LENGTH_VAL) { - ND_PRINT((ndo, ", 802.3")); + ND_PRINT(", 802.3"); length = length_type; } else - ND_PRINT((ndo, ", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", length_type))); + ND_PRINT(", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", length_type)); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } /* @@ -158,11 +158,11 @@ ether_print(netdissect_options *ndo, struct lladdr_info src, dst; if (caplen < ETHER_HDRLEN) { - ND_PRINT((ndo, "[|ether]")); + ND_PRINT("[|ether]"); return (caplen); } if (length < ETHER_HDRLEN) { - ND_PRINT((ndo, "[|ether]")); + ND_PRINT("[|ether]"); return (length); } @@ -208,22 +208,22 @@ recurse: * the enclosed type field. */ if (caplen < 4) { - ND_PRINT((ndo, "[|vlan]")); + ND_PRINT("[|vlan]"); return (hdrlen + caplen); } if (length < 4) { - ND_PRINT((ndo, "[|vlan]")); + ND_PRINT("[|vlan]"); return (hdrlen + length); } if (ndo->ndo_eflag) { uint16_t tag = EXTRACT_BE_U_2(p); - ND_PRINT((ndo, "%s, ", ieee8021q_tci_string(tag))); + ND_PRINT("%s, ", ieee8021q_tci_string(tag)); } length_type = EXTRACT_BE_U_2(p + 2); if (ndo->ndo_eflag && length_type > MAX_ETHERNET_LENGTH_VAL) - ND_PRINT((ndo, "ethertype %s, ", tok2str(ethertype_values,"0x%04x", length_type))); + ND_PRINT("ethertype %s, ", tok2str(ethertype_values,"0x%04x", length_type)); p += 4; length -= 4; caplen -= 4; @@ -294,7 +294,7 @@ netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, * Fail if we don't have enough data for the Hilscher pseudo-header. */ if (h->len < 4 || h->caplen < 4) { - ND_PRINT((ndo, "[|netanalyzer]")); + ND_PRINT("[|netanalyzer]"); return (h->caplen); } @@ -322,7 +322,7 @@ netanalyzer_transparent_if_print(netdissect_options *ndo, * preamble, and SOF. */ if (h->len < 12 || h->caplen < 12) { - ND_PRINT((ndo, "[|netanalyzer-transparent]")); + ND_PRINT("[|netanalyzer-transparent]"); return (h->caplen); } @@ -364,7 +364,7 @@ ethertype_print(netdissect_options *ndo, case ETHERTYPE_ATALK: if (ndo->ndo_vflag) - ND_PRINT((ndo, "et1 ")); + ND_PRINT("et1 "); atalk_print(ndo, p, length); return (1); @@ -373,13 +373,13 @@ ethertype_print(netdissect_options *ndo, return (1); case ETHERTYPE_IPX: - ND_PRINT((ndo, "(NOV-ETHII) ")); + ND_PRINT("(NOV-ETHII) "); ipx_print(ndo, p, length); return (1); case ETHERTYPE_ISO: if (length == 0 || caplen == 0) { - ND_PRINT((ndo, " [|osi]")); + ND_PRINT(" [|osi]"); return (1); } isoclns_print(ndo, p + 1, length - 1); @@ -402,7 +402,7 @@ ethertype_print(netdissect_options *ndo, case ETHERTYPE_PPP: if (length) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); ppp_print(ndo, p, length); } return (1); diff --git a/print-fddi.c b/print-fddi.c index 0b85034a..825866fb 100644 --- a/print-fddi.c +++ b/print-fddi.c @@ -164,62 +164,62 @@ print_fddi_fc(netdissect_options *ndo, u_char fc) switch (fc) { case FDDIFC_VOID: /* Void frame */ - ND_PRINT((ndo, "void ")); + ND_PRINT("void "); break; case FDDIFC_NRT: /* Nonrestricted token */ - ND_PRINT((ndo, "nrt ")); + ND_PRINT("nrt "); break; case FDDIFC_RT: /* Restricted token */ - ND_PRINT((ndo, "rt ")); + ND_PRINT("rt "); break; case FDDIFC_SMT_INFO: /* SMT Info */ - ND_PRINT((ndo, "info ")); + ND_PRINT("info "); break; case FDDIFC_SMT_NSA: /* SMT Next station adrs */ - ND_PRINT((ndo, "nsa ")); + ND_PRINT("nsa "); break; case FDDIFC_MAC_BEACON: /* MAC Beacon frame */ - ND_PRINT((ndo, "beacon ")); + ND_PRINT("beacon "); break; case FDDIFC_MAC_CLAIM: /* MAC Claim frame */ - ND_PRINT((ndo, "claim ")); + ND_PRINT("claim "); break; default: switch (fc & FDDIFC_CLFF) { case FDDIFC_MAC: - ND_PRINT((ndo, "mac%1x ", fc & FDDIFC_ZZZZ)); + ND_PRINT("mac%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_SMT: - ND_PRINT((ndo, "smt%1x ", fc & FDDIFC_ZZZZ)); + ND_PRINT("smt%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_LLC_ASYNC: - ND_PRINT((ndo, "async%1x ", fc & FDDIFC_ZZZZ)); + ND_PRINT("async%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_LLC_SYNC: - ND_PRINT((ndo, "sync%1x ", fc & FDDIFC_ZZZZ)); + ND_PRINT("sync%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_IMP_ASYNC: - ND_PRINT((ndo, "imp_async%1x ", fc & FDDIFC_ZZZZ)); + ND_PRINT("imp_async%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_IMP_SYNC: - ND_PRINT((ndo, "imp_sync%1x ", fc & FDDIFC_ZZZZ)); + ND_PRINT("imp_sync%1x ", fc & FDDIFC_ZZZZ); break; default: - ND_PRINT((ndo, "%02x ", fc)); + ND_PRINT("%02x ", fc); break; } } @@ -262,15 +262,15 @@ fddi_hdr_print(netdissect_options *ndo, if (!ndo->ndo_qflag) print_fddi_fc(ndo, EXTRACT_U_1(fddip->fddi_fc)); - ND_PRINT((ndo, "%s > %s, length %u: ", + ND_PRINT("%s > %s, length %u: ", srcname, dstname, - length)); + length); } static inline void fddi_smt_print(netdissect_options *ndo, const u_char *p _U_, u_int length _U_) { - ND_PRINT((ndo, "<SMT printer not yet implemented>")); + ND_PRINT("<SMT printer not yet implemented>"); } u_int @@ -283,7 +283,7 @@ fddi_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen) int llc_hdrlen; if (caplen < FDDI_HDRLEN) { - ND_PRINT((ndo, "[|fddi]")); + ND_PRINT("[|fddi]"); return (caplen); } diff --git a/print-forces.c b/print-forces.c index 60d0643e..020d5ac2 100644 --- a/print-forces.c +++ b/print-forces.c @@ -527,12 +527,12 @@ chk_op_type(netdissect_options *ndo, if (type != F_TLV_PDAT) { if (msk & B_KEYIN) { if (type != F_TLV_KEYI) { - ND_PRINT((ndo, "Based on flags expected KEYINFO TLV!\n")); + ND_PRINT("Based on flags expected KEYINFO TLV!\n"); } } else { if (!(msk & omsk)) { - ND_PRINT((ndo, "Illegal DATA encoding for type 0x%x programmed %x got %x \n", - type, omsk, msk)); + ND_PRINT("Illegal DATA encoding for type 0x%x programmed %x got %x \n", + type, omsk, msk); } } } @@ -656,26 +656,26 @@ prestlv_print(netdissect_options *ndo, */ dlen = len - TLV_HDRL; if (dlen != RESLEN) { - ND_PRINT((ndo, "illegal RESULT-TLV: %d bytes!\n", dlen)); + ND_PRINT("illegal RESULT-TLV: %d bytes!\n", dlen); return -1; } ND_TCHECK_SIZE(r); result = EXTRACT_U_1(r->result); if (result >= 0x18 && result <= 0xFE) { - ND_PRINT((ndo, "illegal reserved result code: 0x%x!\n", result)); + ND_PRINT("illegal reserved result code: 0x%x!\n", result); return -1; } if (ndo->ndo_vflag >= 3) { char *ib = indent_pr(indent, 0); - ND_PRINT((ndo, "%s Result: %s (code 0x%x)\n", ib, - tok2str(ForCES_errs, NULL, result), result)); + ND_PRINT("%s Result: %s (code 0x%x)\n", ib, + tok2str(ForCES_errs, NULL, result), result); } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -697,20 +697,20 @@ fdatatlv_print(netdissect_options *ndo, ND_TCHECK_SIZE(tlv); type = EXTRACT_BE_U_2(&tlv->type); if (type != F_TLV_FULD) { - ND_PRINT((ndo, "Error: expecting FULLDATA!\n")); + ND_PRINT("Error: expecting FULLDATA!\n"); return -1; } if (ndo->ndo_vflag >= 3) { char *ib = indent_pr(indent + 2, 1); - ND_PRINT((ndo, "%s[", ib + 1)); + ND_PRINT("%s[", ib + 1); hex_print_with_offset(ndo, ib, tdp, rlen, 0); - ND_PRINT((ndo, "\n%s]\n", ib + 1)); + ND_PRINT("\n%s]\n", ib + 1); } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -724,29 +724,29 @@ sdatailv_print(netdissect_options *ndo, int invilv; if (len < ILV_HDRL) { - ND_PRINT((ndo, "Error: BAD SPARSEDATA-TLV!\n")); + ND_PRINT("Error: BAD SPARSEDATA-TLV!\n"); return -1; } rlen = len; indent += 1; while (rlen != 0) { #if 0 - ND_PRINT((ndo, "Jamal - outstanding length <%d>\n", rlen)); + ND_PRINT("Jamal - outstanding length <%d>\n", rlen); #endif char *ib = indent_pr(indent, 1); const u_char *tdp = (const u_char *) ILV_DATA(ilv); ND_TCHECK_SIZE(ilv); invilv = ilv_valid(ilv, rlen); if (invilv) { - ND_PRINT((ndo, "%s[", ib + 1)); + ND_PRINT("%s[", ib + 1); hex_print_with_offset(ndo, ib, tdp, rlen, 0); - ND_PRINT((ndo, "\n%s]\n", ib + 1)); + ND_PRINT("\n%s]\n", ib + 1); return -1; } if (ndo->ndo_vflag >= 3) { int ilvl = EXTRACT_BE_U_4(&ilv->length); - ND_PRINT((ndo, "\n%s ILV: type %x length %d\n", ib + 1, - EXTRACT_BE_U_4(&ilv->type), ilvl)); + ND_PRINT("\n%s ILV: type %x length %d\n", ib + 1, + EXTRACT_BE_U_4(&ilv->type), ilvl); hex_print_with_offset(ndo, "\t\t[", tdp, ilvl-ILV_HDRL, 0); } @@ -756,7 +756,7 @@ sdatailv_print(netdissect_options *ndo, return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -778,14 +778,14 @@ sdatatlv_print(netdissect_options *ndo, ND_TCHECK_SIZE(tlv); type = EXTRACT_BE_U_2(&tlv->type); if (type != F_TLV_SPAD) { - ND_PRINT((ndo, "Error: expecting SPARSEDATA!\n")); + ND_PRINT("Error: expecting SPARSEDATA!\n"); return -1; } return sdatailv_print(ndo, tdp, rlen, op_msk, indent); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -805,15 +805,15 @@ pkeyitlv_print(netdissect_options *ndo, ND_TCHECK_1(tdp); id = EXTRACT_BE_U_4(tdp); - ND_PRINT((ndo, "%sKeyinfo: Key 0x%x\n", ib, id)); + ND_PRINT("%sKeyinfo: Key 0x%x\n", ib, id); ND_TCHECK_SIZE(kdtlv); type = EXTRACT_BE_U_2(&kdtlv->type); invtlv = tlv_valid(kdtlv, len); if (invtlv) { - ND_PRINT((ndo, "%s TLV type 0x%x len %d\n", + ND_PRINT("%s TLV type 0x%x len %d\n", tok2str(ForCES_TLV_err, NULL, invtlv), type, - EXTRACT_BE_U_2(&kdtlv->length))); + EXTRACT_BE_U_2(&kdtlv->length)); return -1; } /* @@ -826,7 +826,7 @@ pkeyitlv_print(netdissect_options *ndo, return fdatatlv_print(ndo, dp, tll, op_msk, indent); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -842,7 +842,7 @@ pdatacnt_print(netdissect_options *ndo, char *ib = indent_pr(indent, 0); if ((op_msk & B_APPND) && ndo->ndo_vflag >= 3) { - ND_PRINT((ndo, "%sTABLE APPEND\n", ib)); + ND_PRINT("%sTABLE APPEND\n", ib); } for (i = 0; i < IDcnt; i++) { ND_TCHECK_4(pptr); @@ -850,7 +850,7 @@ pdatacnt_print(netdissect_options *ndo, goto trunc; id = EXTRACT_BE_U_4(pptr); if (ndo->ndo_vflag >= 3) - ND_PRINT((ndo, "%sID#%02u: %d\n", ib, i + 1, id)); + ND_PRINT("%sID#%02u: %d\n", ib, i + 1, id); len -= 4; pptr += 4; } @@ -860,8 +860,8 @@ pdatacnt_print(netdissect_options *ndo, uint32_t starti, endi; if (len < PTH_DESC_SIZE) { - ND_PRINT((ndo, "pathlength %d with key/range too short %d\n", - len, PTH_DESC_SIZE)); + ND_PRINT("pathlength %d with key/range too short %d\n", + len, PTH_DESC_SIZE); return -1; } @@ -877,7 +877,7 @@ pdatacnt_print(netdissect_options *ndo, len -= 4; if (ndo->ndo_vflag >= 3) - ND_PRINT((ndo, "%sTable range: [%d,%d]\n", ib, starti, endi)); + ND_PRINT("%sTable range: [%d,%d]\n", ib, starti, endi); } if (op_msk & B_KEYIN) { @@ -885,8 +885,8 @@ pdatacnt_print(netdissect_options *ndo, uint16_t tll; if (len < PTH_DESC_SIZE) { - ND_PRINT((ndo, "pathlength %d with key/range too short %d\n", - len, PTH_DESC_SIZE)); + ND_PRINT("pathlength %d with key/range too short %d\n", + len, PTH_DESC_SIZE); return -1; } @@ -900,13 +900,13 @@ pdatacnt_print(netdissect_options *ndo, /* skip key content */ tll = EXTRACT_BE_U_2(&keytlv->length); if (tll < TLV_HDRL) { - ND_PRINT((ndo, "key content length %u < %u\n", - tll, TLV_HDRL)); + ND_PRINT("key content length %u < %u\n", + tll, TLV_HDRL); return -1; } tll -= TLV_HDRL; if (len < tll) { - ND_PRINT((ndo, "key content too short\n")); + ND_PRINT("key content too short\n"); return -1; } pptr += tll; @@ -927,9 +927,9 @@ pdatacnt_print(netdissect_options *ndo, type = EXTRACT_BE_U_2(&pdtlv->type); invtlv = tlv_valid(pdtlv, len); if (invtlv) { - ND_PRINT((ndo, "%s Outstanding bytes %d for TLV type 0x%x TLV len %d\n", + ND_PRINT("%s Outstanding bytes %d for TLV type 0x%x TLV len %d\n", tok2str(ForCES_TLV_err, NULL, invtlv), len, type, - EXTRACT_BE_U_2(&pdtlv->length))); + EXTRACT_BE_U_2(&pdtlv->length)); goto pd_err; } /* @@ -941,9 +941,8 @@ pdatacnt_print(netdissect_options *ndo, aln = F_ALN_LEN(EXTRACT_BE_U_2(&pdtlv->length)); if (aln > EXTRACT_BE_U_2(&pdtlv->length)) { if (aln > len) { - ND_PRINT((ndo, - "Invalid padded pathdata TLV type 0x%x len %d missing %d pad bytes\n", - type, EXTRACT_BE_U_2(&pdtlv->length), aln - len)); + ND_PRINT("Invalid padded pathdata TLV type 0x%x len %d missing %d pad bytes\n", + type, EXTRACT_BE_U_2(&pdtlv->length), aln - len); } else { pad = aln - EXTRACT_BE_U_2(&pdtlv->length); } @@ -953,11 +952,11 @@ pdatacnt_print(netdissect_options *ndo, if (ndo->ndo_vflag >= 3 && ops->v != F_TLV_PDAT) { if (pad) - ND_PRINT((ndo, "%s %s (Length %d DataLen %d pad %d Bytes)\n", - ib, ops->s, EXTRACT_BE_U_2(&pdtlv->length), tll, pad)); + ND_PRINT("%s %s (Length %d DataLen %d pad %d Bytes)\n", + ib, ops->s, EXTRACT_BE_U_2(&pdtlv->length), tll, pad); else - ND_PRINT((ndo, "%s %s (Length %d DataLen %d Bytes)\n", - ib, ops->s, EXTRACT_BE_U_2(&pdtlv->length), tll)); + ND_PRINT("%s %s (Length %d DataLen %d Bytes)\n", + ib, ops->s, EXTRACT_BE_U_2(&pdtlv->length), tll); } chk_op_type(ndo, type, op_msk, ops->op_msk); @@ -968,13 +967,13 @@ pdatacnt_print(netdissect_options *ndo, return -1; len -= (TLV_HDRL + pad + tll); } else { - ND_PRINT((ndo, "Invalid path data content type 0x%x len %d\n", - type, EXTRACT_BE_U_2(&pdtlv->length))); + ND_PRINT("Invalid path data content type 0x%x len %d\n", + type, EXTRACT_BE_U_2(&pdtlv->length)); pd_err: if (EXTRACT_BE_U_2(&pdtlv->length)) { hex_print_with_offset(ndo, "Bad Data val\n\t [", pptr, len, 0); - ND_PRINT((ndo, "]\n")); + ND_PRINT("]\n"); return -1; } @@ -983,7 +982,7 @@ pd_err: return len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1002,8 +1001,8 @@ pdata_print(netdissect_options *ndo, if (len < sizeof(struct pathdata_h)) goto trunc; if (ndo->ndo_vflag >= 3) { - ND_PRINT((ndo, "\n%sPathdata: Flags 0x%x ID count %d\n", - ib, EXTRACT_BE_U_2(&pdh->pflags), EXTRACT_BE_U_2(&pdh->pIDcnt))); + ND_PRINT("\n%sPathdata: Flags 0x%x ID count %d\n", + ib, EXTRACT_BE_U_2(&pdh->pflags), EXTRACT_BE_U_2(&pdh->pIDcnt)); } if (EXTRACT_BE_U_2(&pdh->pflags) & F_SELKEY) { @@ -1024,15 +1023,15 @@ pdata_print(netdissect_options *ndo, idcnt = EXTRACT_BE_U_2(&pdh->pIDcnt); minsize = idcnt * 4; if (len < minsize) { - ND_PRINT((ndo, "\t\t\ttruncated IDs expected %uB got %uB\n", minsize, - len)); + ND_PRINT("\t\t\ttruncated IDs expected %uB got %uB\n", minsize, + len); hex_print_with_offset(ndo, "\t\t\tID Data[", pptr, len, 0); - ND_PRINT((ndo, "]\n")); + ND_PRINT("]\n"); return -1; } if ((op_msk & B_TRNG) && (op_msk & B_KEYIN)) { - ND_PRINT((ndo, "\t\t\tIllegal to have both Table ranges and keys\n")); + ND_PRINT("\t\t\tIllegal to have both Table ranges and keys\n"); return -1; } @@ -1047,7 +1046,7 @@ pdata_print(netdissect_options *ndo, return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1066,8 +1065,8 @@ genoptlv_print(netdissect_options *ndo, type = EXTRACT_BE_U_2(&pdtlv->type); tll = EXTRACT_BE_U_2(&pdtlv->length) - TLV_HDRL; invtlv = tlv_valid(pdtlv, len); - ND_PRINT((ndo, "genoptlvprint - %s TLV type 0x%x len %d\n", - tok2str(ForCES_TLV, NULL, type), type, EXTRACT_BE_U_2(&pdtlv->length))); + ND_PRINT("genoptlvprint - %s TLV type 0x%x len %d\n", + tok2str(ForCES_TLV, NULL, type), type, EXTRACT_BE_U_2(&pdtlv->length)); if (!invtlv) { /* * At this point, tlv_valid() has ensured that the TLV @@ -1076,24 +1075,24 @@ genoptlv_print(netdissect_options *ndo, */ const u_char *dp = (const u_char *) TLV_DATA(pdtlv); if (!ttlv_valid(type)) { - ND_PRINT((ndo, "%s TLV type 0x%x len %d\n", + ND_PRINT("%s TLV type 0x%x len %d\n", tok2str(ForCES_TLV_err, NULL, invtlv), type, - EXTRACT_BE_U_2(&pdtlv->length))); + EXTRACT_BE_U_2(&pdtlv->length)); return -1; } if (ndo->ndo_vflag >= 3) - ND_PRINT((ndo, "%s%s, length %d (data length %d Bytes)", + ND_PRINT("%s%s, length %d (data length %d Bytes)", ib, tok2str(ForCES_TLV, NULL, type), - EXTRACT_BE_U_2(&pdtlv->length), tll)); + EXTRACT_BE_U_2(&pdtlv->length), tll); return pdata_print(ndo, dp, tll, op_msk, indent + 1); } else { - ND_PRINT((ndo, "\t\t\tInvalid ForCES TLV type=%x", type)); + ND_PRINT("\t\t\tInvalid ForCES TLV type=%x", type); return -1; } trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1127,10 +1126,10 @@ recpdoptlv_print(netdissect_options *ndo, tll = EXTRACT_BE_U_2(&pdtlv->length) - TLV_HDRL; if (ndo->ndo_vflag >= 3) - ND_PRINT((ndo, "%s%s, length %d (data encapsulated %d Bytes)", + ND_PRINT("%s%s, length %d (data encapsulated %d Bytes)", ib, tok2str(ForCES_TLV, NULL, type), EXTRACT_BE_U_2(&pdtlv->length), - EXTRACT_BE_U_2(&pdtlv->length) - TLV_HDRL)); + EXTRACT_BE_U_2(&pdtlv->length) - TLV_HDRL); if (pdata_print(ndo, dp, tll, op_msk, indent + 1) == -1) return -1; @@ -1138,16 +1137,15 @@ recpdoptlv_print(netdissect_options *ndo, } if (len) { - ND_PRINT((ndo, - "\n\t\tMessy PATHDATA TLV header, type (0x%x)\n\t\texcess of %d Bytes ", - EXTRACT_BE_U_2(&pdtlv->type), len - EXTRACT_BE_U_2(&pdtlv->length))); + ND_PRINT("\n\t\tMessy PATHDATA TLV header, type (0x%x)\n\t\texcess of %d Bytes ", + EXTRACT_BE_U_2(&pdtlv->type), len - EXTRACT_BE_U_2(&pdtlv->length)); return -1; } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1159,9 +1157,9 @@ invoptlv_print(netdissect_options *ndo, char *ib = indent_pr(indent, 1); if (ndo->ndo_vflag >= 3) { - ND_PRINT((ndo, "%sData[", ib + 1)); + ND_PRINT("%sData[", ib + 1); hex_print_with_offset(ndo, ib, pptr, len, 0); - ND_PRINT((ndo, "%s]\n", ib)); + ND_PRINT("%s]\n", ib); } return -1; } @@ -1186,15 +1184,15 @@ otlv_print(netdissect_options *ndo, tll = EXTRACT_BE_U_2(&otlv->length) - TLV_HDRL; ops = get_forces_optlv_h(type); if (ndo->ndo_vflag >= 3) { - ND_PRINT((ndo, "%sOper TLV %s(0x%x) length %d\n", ib, ops->s, type, - EXTRACT_BE_U_2(&otlv->length))); + ND_PRINT("%sOper TLV %s(0x%x) length %d\n", ib, ops->s, type, + EXTRACT_BE_U_2(&otlv->length)); } /* rest of ops must at least have 12B {pathinfo} */ if (tll < OP_MIN_SIZ) { - ND_PRINT((ndo, "\t\tOper TLV %s(0x%x) length %d\n", ops->s, type, - EXTRACT_BE_U_2(&otlv->length))); - ND_PRINT((ndo, "\t\tTruncated data size %d minimum required %d\n", tll, - OP_MIN_SIZ)); + ND_PRINT("\t\tOper TLV %s(0x%x) length %d\n", ops->s, type, + EXTRACT_BE_U_2(&otlv->length)); + ND_PRINT("\t\tTruncated data size %d minimum required %d\n", tll, + OP_MIN_SIZ); return invoptlv_print(ndo, dp, tll, ops->op_msk, indent); } @@ -1206,7 +1204,7 @@ otlv_print(netdissect_options *ndo, return rc; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1227,44 +1225,44 @@ asttlv_print(netdissect_options *ndo, */ dlen = len - TLV_HDRL; if (dlen != ASTDLN) { - ND_PRINT((ndo, "illegal ASTresult-TLV: %d bytes!\n", dlen)); + ND_PRINT("illegal ASTresult-TLV: %d bytes!\n", dlen); return -1; } ND_TCHECK_4(pptr); rescode = EXTRACT_BE_U_4(pptr); if (rescode > ASTMCD) { - ND_PRINT((ndo, "illegal ASTresult result code: %d!\n", rescode)); + ND_PRINT("illegal ASTresult result code: %d!\n", rescode); return -1; } if (ndo->ndo_vflag >= 3) { - ND_PRINT((ndo, "Teardown reason:\n%s", ib)); + ND_PRINT("Teardown reason:\n%s", ib); switch (rescode) { case 0: - ND_PRINT((ndo, "Normal Teardown")); + ND_PRINT("Normal Teardown"); break; case 1: - ND_PRINT((ndo, "Loss of Heartbeats")); + ND_PRINT("Loss of Heartbeats"); break; case 2: - ND_PRINT((ndo, "Out of bandwidth")); + ND_PRINT("Out of bandwidth"); break; case 3: - ND_PRINT((ndo, "Out of Memory")); + ND_PRINT("Out of Memory"); break; case 4: - ND_PRINT((ndo, "Application Crash")); + ND_PRINT("Application Crash"); break; default: - ND_PRINT((ndo, "Unknown Teardown reason")); + ND_PRINT("Unknown Teardown reason"); break; } - ND_PRINT((ndo, "(%x)\n%s", rescode, ib)); + ND_PRINT("(%x)\n%s", rescode, ib); } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1285,39 +1283,39 @@ asrtlv_print(netdissect_options *ndo, */ dlen = len - TLV_HDRL; if (dlen != ASRDLN) { /* id, instance, oper tlv */ - ND_PRINT((ndo, "illegal ASRresult-TLV: %d bytes!\n", dlen)); + ND_PRINT("illegal ASRresult-TLV: %d bytes!\n", dlen); return -1; } ND_TCHECK_4(pptr); rescode = EXTRACT_BE_U_4(pptr); if (rescode > ASRMCD) { - ND_PRINT((ndo, "illegal ASRresult result code: %d!\n", rescode)); + ND_PRINT("illegal ASRresult result code: %d!\n", rescode); return -1; } if (ndo->ndo_vflag >= 3) { - ND_PRINT((ndo, "\n%s", ib)); + ND_PRINT("\n%s", ib); switch (rescode) { case 0: - ND_PRINT((ndo, "Success ")); + ND_PRINT("Success "); break; case 1: - ND_PRINT((ndo, "FE ID invalid ")); + ND_PRINT("FE ID invalid "); break; case 2: - ND_PRINT((ndo, "permission denied ")); + ND_PRINT("permission denied "); break; default: - ND_PRINT((ndo, "Unknown ")); + ND_PRINT("Unknown "); break; } - ND_PRINT((ndo, "(%x)\n%s", rescode, ib)); + ND_PRINT("(%x)\n%s", rescode, ib); } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1333,7 +1331,7 @@ gentltlv_print(netdissect_options *ndo, u_int dlen = len - TLV_HDRL; if (dlen < 4) { /* at least 32 bits must exist */ - ND_PRINT((ndo, "truncated TLV: %d bytes missing! ", 4 - dlen)); + ND_PRINT("truncated TLV: %d bytes missing! ", 4 - dlen); return -1; } return 0; @@ -1357,16 +1355,16 @@ print_metailv(netdissect_options *ndo, */ rlen = EXTRACT_BE_U_4(&ilv->length) - ILV_HDRL; ND_TCHECK_SIZE(ilv); - ND_PRINT((ndo, "%sMetaID 0x%x length %d\n", ib, EXTRACT_BE_U_4(&ilv->type), - EXTRACT_BE_U_4(&ilv->length))); + ND_PRINT("%sMetaID 0x%x length %d\n", ib, EXTRACT_BE_U_4(&ilv->type), + EXTRACT_BE_U_4(&ilv->length)); if (ndo->ndo_vflag >= 3) { hex_print_with_offset(ndo, "\t\t[", ILV_DATA(ilv), rlen, 0); - ND_PRINT((ndo, " ]\n")); + ND_PRINT(" ]\n"); } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1387,7 +1385,7 @@ print_metatlv(netdissect_options *ndo, */ dlen = len - TLV_HDRL; rlen = dlen; - ND_PRINT((ndo, "\n%s METADATA length %d \n", ib, rlen)); + ND_PRINT("\n%s METADATA length %d \n", ib, rlen); while (rlen != 0) { ND_TCHECK_SIZE(ilv); invilv = ilv_valid(ilv, rlen); @@ -1407,7 +1405,7 @@ print_metatlv(netdissect_options *ndo, return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1423,12 +1421,12 @@ print_reddata(netdissect_options *ndo, dlen = len - TLV_HDRL; rlen = dlen; - ND_PRINT((ndo, "\n%s Redirect Data length %d \n", ib, rlen)); + ND_PRINT("\n%s Redirect Data length %d \n", ib, rlen); if (ndo->ndo_vflag >= 3) { - ND_PRINT((ndo, "\t\t[")); + ND_PRINT("\t\t["); hex_print_with_offset(ndo, "\n\t\t", pptr, rlen, 0); - ND_PRINT((ndo, "\n\t\t]")); + ND_PRINT("\n\t\t]"); } return 0; @@ -1450,8 +1448,8 @@ redirect_print(netdissect_options *ndo, */ dlen = len - TLV_HDRL; if (dlen <= RD_MIN) { - ND_PRINT((ndo, "\n\t\ttruncated Redirect TLV: %d bytes missing! ", - RD_MIN - dlen)); + ND_PRINT("\n\t\ttruncated Redirect TLV: %d bytes missing! ", + RD_MIN - dlen); return -1; } @@ -1461,7 +1459,7 @@ redirect_print(netdissect_options *ndo, ND_TCHECK_SIZE(tlv); invtlv = tlv_valid(tlv, rlen); if (invtlv) { - ND_PRINT((ndo, "Bad Redirect data\n")); + ND_PRINT("Bad Redirect data\n"); break; } @@ -1479,26 +1477,25 @@ redirect_print(netdissect_options *ndo, EXTRACT_BE_U_2(&tlv->length), 0, indent); } else { - ND_PRINT((ndo, "Unknown REDIRECT TLV 0x%x len %d\n", + ND_PRINT("Unknown REDIRECT TLV 0x%x len %d\n", EXTRACT_BE_U_2(&tlv->type), - EXTRACT_BE_U_2(&tlv->length))); + EXTRACT_BE_U_2(&tlv->length)); } tlv = GO_NXT_TLV(tlv, rlen); } if (rlen) { - ND_PRINT((ndo, - "\n\t\tMessy Redirect TLV header, type (0x%x)\n\t\texcess of %d Bytes ", + ND_PRINT("\n\t\tMessy Redirect TLV header, type (0x%x)\n\t\texcess of %d Bytes ", EXTRACT_BE_U_2(&tlv->type), - rlen - EXTRACT_BE_U_2(&tlv->length))); + rlen - EXTRACT_BE_U_2(&tlv->length)); return -1; } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1523,8 +1520,8 @@ lfbselect_print(netdissect_options *ndo, */ dlen = len - TLV_HDRL; if (dlen <= OP_MIN) { /* id, instance, oper tlv header .. */ - ND_PRINT((ndo, "\n\t\ttruncated lfb selector: %d bytes missing! ", - OP_MIN - dlen)); + ND_PRINT("\n\t\ttruncated lfb selector: %d bytes missing! ", + OP_MIN - dlen); return -1; } @@ -1537,10 +1534,10 @@ lfbselect_print(netdissect_options *ndo, lfbs = (const struct forces_lfbsh *)pptr; ND_TCHECK_SIZE(lfbs); if (ndo->ndo_vflag >= 3) { - ND_PRINT((ndo, "\n%s%s(Classid %x) instance %x\n", + ND_PRINT("\n%s%s(Classid %x) instance %x\n", ib, tok2str(ForCES_LFBs, NULL, EXTRACT_BE_U_4(&lfbs->class)), EXTRACT_BE_U_4(&lfbs->class), - EXTRACT_BE_U_4(&lfbs->instance))); + EXTRACT_BE_U_4(&lfbs->instance)); } otlv = (const struct forces_tlv *)(lfbs + 1); @@ -1561,26 +1558,24 @@ lfbselect_print(netdissect_options *ndo, otlv_print(ndo, otlv, 0, indent); } else { if (ndo->ndo_vflag < 3) - ND_PRINT((ndo, "\n")); - ND_PRINT((ndo, - "\t\tINValid oper-TLV type 0x%x length %d for this ForCES message\n", - EXTRACT_BE_U_2(&otlv->type), EXTRACT_BE_U_2(&otlv->length))); + ND_PRINT("\n"); + ND_PRINT("\t\tINValid oper-TLV type 0x%x length %d for this ForCES message\n", + EXTRACT_BE_U_2(&otlv->type), EXTRACT_BE_U_2(&otlv->length)); invoptlv_print(ndo, (const u_char *)otlv, rlen, 0, indent); } otlv = GO_NXT_TLV(otlv, rlen); } if (rlen) { - ND_PRINT((ndo, - "\n\t\tMessy oper TLV header, type (0x%x)\n\t\texcess of %d Bytes ", - EXTRACT_BE_U_2(&otlv->type), rlen - EXTRACT_BE_U_2(&otlv->length))); + ND_PRINT("\n\t\tMessy oper TLV header, type (0x%x)\n\t\texcess of %d Bytes ", + EXTRACT_BE_U_2(&otlv->type), rlen - EXTRACT_BE_U_2(&otlv->length)); return -1; } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1603,14 +1598,14 @@ forces_type_print(netdissect_options *ndo, if (rlen > TLV_HLN) { if (tops->flags & ZERO_TTLV) { - ND_PRINT((ndo, "<0x%x>Illegal Top level TLV!\n", tops->flags)); + ND_PRINT("<0x%x>Illegal Top level TLV!\n", tops->flags); return -1; } } else { if (tops->flags & ZERO_MORE_TTLV) return 0; if (tops->flags & ONE_MORE_TTLV) { - ND_PRINT((ndo, "\tTop level TLV Data missing!\n")); + ND_PRINT("\tTop level TLV Data missing!\n"); return -1; } } @@ -1636,16 +1631,16 @@ forces_type_print(netdissect_options *ndo, * go past the end of the packet). */ if (!ttlv_valid(EXTRACT_BE_U_2(&tltlv->type))) { - ND_PRINT((ndo, "\n\tInvalid ForCES Top TLV type=0x%x", - EXTRACT_BE_U_2(&tltlv->type))); + ND_PRINT("\n\tInvalid ForCES Top TLV type=0x%x", + EXTRACT_BE_U_2(&tltlv->type)); return -1; } if (ndo->ndo_vflag >= 3) - ND_PRINT((ndo, "\t%s, length %d (data length %d Bytes)", + ND_PRINT("\t%s, length %d (data length %d Bytes)", tok2str(ForCES_TLV, NULL, EXTRACT_BE_U_2(&tltlv->type)), EXTRACT_BE_U_2(&tltlv->length), - EXTRACT_BE_U_2(&tltlv->length) - TLV_HDRL)); + EXTRACT_BE_U_2(&tltlv->length) - TLV_HDRL); rc = tops->print(ndo, (const u_char *) TLV_DATA(tltlv), EXTRACT_BE_U_2(&tltlv->length), @@ -1663,15 +1658,15 @@ forces_type_print(netdissect_options *ndo, * short, and didn't have *enough* TLVs in it? */ if (rlen) { - ND_PRINT((ndo, "\tMess TopTLV header: min %u, total %d advertised %d ", - TLV_HDRL, rlen, EXTRACT_BE_U_2(&tltlv->length))); + ND_PRINT("\tMess TopTLV header: min %u, total %d advertised %d ", + TLV_HDRL, rlen, EXTRACT_BE_U_2(&tltlv->length)); return -1; } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1690,7 +1685,7 @@ forces_print(netdissect_options *ndo, ND_TCHECK_SIZE(fhdr); tom = EXTRACT_U_1(fhdr->fm_tom); if (!tom_valid(tom)) { - ND_PRINT((ndo, "Invalid ForCES message type %d\n", tom)); + ND_PRINT("Invalid ForCES message type %d\n", tom); goto error; } @@ -1698,33 +1693,30 @@ forces_print(netdissect_options *ndo, tops = get_forces_tom(tom); if (tops->v == TOM_RSVD) { - ND_PRINT((ndo, "\n\tUnknown ForCES message type=0x%x", tom)); + ND_PRINT("\n\tUnknown ForCES message type=0x%x", tom); goto error; } - ND_PRINT((ndo, "\n\tForCES %s ", tops->s)); + ND_PRINT("\n\tForCES %s ", tops->s); if (!ForCES_HLN_VALID(mlen, len)) { - ND_PRINT((ndo, - "Illegal ForCES pkt len - min %u, total recvd %d, advertised %d ", - ForCES_HDRL, len, ForCES_BLN(fhdr))); + ND_PRINT("Illegal ForCES pkt len - min %u, total recvd %d, advertised %d ", + ForCES_HDRL, len, ForCES_BLN(fhdr)); goto error; } ND_TCHECK_4(pptr + 20); flg_raw = EXTRACT_BE_U_4(pptr + 20); if (ndo->ndo_vflag >= 1) { - ND_PRINT((ndo, "\n\tForCES Version %d len %uB flags 0x%08x ", - ForCES_V(fhdr), mlen, flg_raw)); - ND_PRINT((ndo, - "\n\tSrcID 0x%x(%s) DstID 0x%x(%s) Correlator 0x%" PRIx64, + ND_PRINT("\n\tForCES Version %d len %uB flags 0x%08x ", + ForCES_V(fhdr), mlen, flg_raw); + ND_PRINT("\n\tSrcID 0x%x(%s) DstID 0x%x(%s) Correlator 0x%" PRIx64, ForCES_SID(fhdr), ForCES_node(ForCES_SID(fhdr)), ForCES_DID(fhdr), ForCES_node(ForCES_DID(fhdr)), - EXTRACT_BE_U_8(fhdr->fm_cor))); + EXTRACT_BE_U_8(fhdr->fm_cor)); } if (ndo->ndo_vflag >= 2) { - ND_PRINT((ndo, - "\n\tForCES flags:\n\t %s(0x%x), prio=%d, %s(0x%x),\n\t %s(0x%x), %s(0x%x)\n", + ND_PRINT("\n\tForCES flags:\n\t %s(0x%x), prio=%d, %s(0x%x),\n\t %s(0x%x), %s(0x%x)\n", tok2str(ForCES_ACKs, "ACKUnknown", ForCES_ACK(fhdr)), ForCES_ACK(fhdr), ForCES_PRI(fhdr), @@ -1733,29 +1725,28 @@ forces_print(netdissect_options *ndo, tok2str(ForCES_ATs, "ATUnknown", ForCES_AT(fhdr)), ForCES_AT(fhdr), tok2str(ForCES_TPs, "TPUnknown", ForCES_TP(fhdr)), - ForCES_TP(fhdr))); - ND_PRINT((ndo, - "\t Extra flags: rsv(b5-7) 0x%x rsv(b13-31) 0x%x\n", - ForCES_RS1(fhdr), ForCES_RS2(fhdr))); + ForCES_TP(fhdr)); + ND_PRINT("\t Extra flags: rsv(b5-7) 0x%x rsv(b13-31) 0x%x\n", + ForCES_RS1(fhdr), ForCES_RS2(fhdr)); } rc = forces_type_print(ndo, pptr, fhdr, mlen, tops); if (rc < 0) { error: hex_print_with_offset(ndo, "\n\t[", pptr, len, 0); - ND_PRINT((ndo, "\n\t]")); + ND_PRINT("\n\t]"); return; } if (ndo->ndo_vflag >= 4) { - ND_PRINT((ndo, "\n\t Raw ForCES message\n\t [")); + ND_PRINT("\n\t Raw ForCES message\n\t ["); hex_print_with_offset(ndo, "\n\t ", pptr, len, 0); - ND_PRINT((ndo, "\n\t ]")); + ND_PRINT("\n\t ]"); } - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* * Local Variables: @@ -190,26 +190,26 @@ fr_hdr_print(netdissect_options *ndo, int length, u_int addr_len, u_int dlci, uint32_t flags, uint16_t nlpid) { if (ndo->ndo_qflag) { - ND_PRINT((ndo, "Q.922, DLCI %u, length %u: ", + ND_PRINT("Q.922, DLCI %u, length %u: ", dlci, - length)); + length); } else { if (nlpid <= 0xff) /* if its smaller than 256 then its a NLPID */ - ND_PRINT((ndo, "Q.922, hdr-len %u, DLCI %u, Flags [%s], NLPID %s (0x%02x), length %u: ", + ND_PRINT("Q.922, hdr-len %u, DLCI %u, Flags [%s], NLPID %s (0x%02x), length %u: ", addr_len, dlci, bittok2str(fr_header_flag_values, "none", flags), tok2str(nlpid_values,"unknown", nlpid), nlpid, - length)); + length); else /* must be an ethertype */ - ND_PRINT((ndo, "Q.922, hdr-len %u, DLCI %u, Flags [%s], cisco-ethertype %s (0x%04x), length %u: ", + ND_PRINT("Q.922, hdr-len %u, DLCI %u, Flags [%s], cisco-ethertype %s (0x%04x), length %u: ", addr_len, dlci, bittok2str(fr_header_flag_values, "none", flags), tok2str(ethertype_values, "unknown", nlpid), nlpid, - length)); + length); } } @@ -227,7 +227,7 @@ fr_if_print(netdissect_options *ndo, else return length; trunc: - ND_PRINT((ndo, "[|fr]")); + ND_PRINT("[|fr]"); return caplen; } @@ -247,7 +247,7 @@ fr_print(netdissect_options *ndo, if (ret == -1) goto trunc; if (ret == 0) { - ND_PRINT((ndo, "Q.922, invalid address")); + ND_PRINT("Q.922, invalid address"); return 0; } @@ -263,7 +263,7 @@ fr_print(netdissect_options *ndo, */ if (!ND_TTEST_2(p + addr_len) || length < addr_len + 2) { /* no Ethertype */ - ND_PRINT((ndo, "UI %02x! ", EXTRACT_U_1(p + addr_len))); + ND_PRINT("UI %02x! ", EXTRACT_U_1(p + addr_len)); } else { extracted_ethertype = EXTRACT_BE_U_2(p + addr_len); @@ -277,7 +277,7 @@ fr_print(netdissect_options *ndo, ndo->ndo_snapend-p-addr_len-ETHERTYPE_LEN, NULL, NULL) == 0) /* ether_type not known, probably it wasn't one */ - ND_PRINT((ndo, "UI %02x! ", EXTRACT_U_1(p + addr_len))); + ND_PRINT("UI %02x! ", EXTRACT_U_1(p + addr_len)); else return addr_len + 2; } @@ -293,7 +293,7 @@ fr_print(netdissect_options *ndo, * A pad byte should only be used with 3-byte Q.922. */ if (addr_len != 3) - ND_PRINT((ndo, "Pad! ")); + ND_PRINT("Pad! "); hdr_len = addr_len + 1 /* UI */ + 1 /* pad */ + 1 /* NLPID */; } else { /* @@ -301,7 +301,7 @@ fr_print(netdissect_options *ndo, * A pad byte should be used with 3-byte Q.922. */ if (addr_len == 3) - ND_PRINT((ndo, "No pad! ")); + ND_PRINT("No pad! "); hdr_len = addr_len + 1 /* UI */ + 1 /* NLPID */; } @@ -364,7 +364,7 @@ fr_print(netdissect_options *ndo, return hdr_len; trunc: - ND_PRINT((ndo, "[|fr]")); + ND_PRINT("[|fr]"); return 0; } @@ -383,7 +383,7 @@ mfr_if_print(netdissect_options *ndo, else return length; trunc: - ND_PRINT((ndo, "[|mfr]")); + ND_PRINT("[|mfr]"); return caplen; } @@ -457,10 +457,10 @@ mfr_print(netdissect_options *ndo, ND_TCHECK_4(p); /* minimum frame header length */ if ((EXTRACT_U_1(p) & MFR_BEC_MASK) == MFR_CTRL_FRAME && EXTRACT_U_1(p + 1) == 0) { - ND_PRINT((ndo, "FRF.16 Control, Flags [%s], %s, length %u", + ND_PRINT("FRF.16 Control, Flags [%s], %s, length %u", bittok2str(frf_flag_values,"none",(EXTRACT_U_1(p) & MFR_BEC_MASK)), tok2str(mfr_ctrl_msg_values,"Unknown Message (0x%02x)",EXTRACT_U_1(p + 2)), - length)); + length); tptr = p + 3; tlen = length -3; hdr_len = 3; @@ -473,10 +473,10 @@ mfr_print(netdissect_options *ndo, ie_type=EXTRACT_U_1(tptr); ie_len=EXTRACT_U_1(tptr + 1); - ND_PRINT((ndo, "\n\tIE %s (%u), length %u: ", + ND_PRINT("\n\tIE %s (%u), length %u: ", tok2str(mfr_ctrl_ie_values,"Unknown",ie_type), ie_type, - ie_len)); + ie_len); /* infinite loop check */ if (ie_type == 0 || ie_len <= sizeof(struct ie_tlv_header_t)) @@ -491,7 +491,7 @@ mfr_print(netdissect_options *ndo, switch (ie_type) { case MFR_CTRL_IE_MAGIC_NUM: - ND_PRINT((ndo, "0x%08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT("0x%08x", EXTRACT_BE_U_4(tptr)); break; case MFR_CTRL_IE_BUNDLE_ID: /* same message format */ @@ -554,24 +554,24 @@ mfr_print(netdissect_options *ndo, /* whole packet or first fragment ? */ if ((EXTRACT_U_1(p) & MFR_BEC_MASK) == MFR_FRAG_FRAME || (EXTRACT_U_1(p) & MFR_BEC_MASK) == MFR_B_BIT) { - ND_PRINT((ndo, "FRF.16 Frag, seq %u, Flags [%s], ", + ND_PRINT("FRF.16 Frag, seq %u, Flags [%s], ", sequence_num, - bittok2str(frf_flag_values,"none",(EXTRACT_U_1(p) & MFR_BEC_MASK)))); + bittok2str(frf_flag_values,"none",(EXTRACT_U_1(p) & MFR_BEC_MASK))); hdr_len = 2; fr_print(ndo, p+hdr_len,length-hdr_len); return hdr_len; } /* must be a middle or the last fragment */ - ND_PRINT((ndo, "FRF.16 Frag, seq %u, Flags [%s]", + ND_PRINT("FRF.16 Frag, seq %u, Flags [%s]", sequence_num, - bittok2str(frf_flag_values,"none",(EXTRACT_U_1(p) & MFR_BEC_MASK)))); + bittok2str(frf_flag_values,"none",(EXTRACT_U_1(p) & MFR_BEC_MASK))); print_unknown_data(ndo, p, "\n\t", length); return hdr_len; trunc: - ND_PRINT((ndo, "[|mfr]")); + ND_PRINT("[|mfr]"); return length; } @@ -605,11 +605,11 @@ frf15_print(netdissect_options *ndo, flags = EXTRACT_U_1(p)&MFR_BEC_MASK; sequence_num = (EXTRACT_U_1(p)&0x1e)<<7 | EXTRACT_U_1(p + 1); - ND_PRINT((ndo, "FRF.15, seq 0x%03x, Flags [%s],%s Fragmentation, length %u", + ND_PRINT("FRF.15, seq 0x%03x, Flags [%s],%s Fragmentation, length %u", sequence_num, bittok2str(frf_flag_values,"none",flags), EXTRACT_U_1(p)&FR_FRF15_FRAGTYPE ? "Interface" : "End-to-End", - length)); + length); /* TODO: * depending on all permutations of the B, E and C bit @@ -622,7 +622,7 @@ frf15_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|frf.15]")); + ND_PRINT("[|frf.15]"); } /* @@ -798,12 +798,12 @@ q933_print(netdissect_options *ndo, u_int non_locking_shift; u_int unshift_codeset; - ND_PRINT((ndo, "%s", ndo->ndo_eflag ? "" : "Q.933")); + ND_PRINT("%s", ndo->ndo_eflag ? "" : "Q.933"); if (length == 0 || !ND_TTEST_1(p)) { if (!ndo->ndo_eflag) - ND_PRINT((ndo, ", ")); - ND_PRINT((ndo, "length %u", length)); + ND_PRINT(", "); + ND_PRINT("length %u", length); goto trunc; } @@ -821,8 +821,8 @@ q933_print(netdissect_options *ndo, for (i = 0; i < call_ref_length; i++) { if (length == 0 || !ND_TTEST_1(p)) { if (!ndo->ndo_eflag) - ND_PRINT((ndo, ", ")); - ND_PRINT((ndo, "length %u", olen)); + ND_PRINT(", "); + ND_PRINT("length %u", olen); goto trunc; } call_ref[i] = EXTRACT_U_1(p); @@ -835,8 +835,8 @@ q933_print(netdissect_options *ndo, */ if (length == 0 || !ND_TTEST_1(p)) { if (!ndo->ndo_eflag) - ND_PRINT((ndo, ", ")); - ND_PRINT((ndo, "length %u", olen)); + ND_PRINT(", "); + ND_PRINT("length %u", olen); goto trunc; } msgtype = EXTRACT_U_1(p); @@ -851,8 +851,8 @@ q933_print(netdissect_options *ndo, if (length != 0) { if (!ND_TTEST_1(p)) { if (!ndo->ndo_eflag) - ND_PRINT((ndo, ", ")); - ND_PRINT((ndo, "length %u", olen)); + ND_PRINT(", "); + ND_PRINT("length %u", olen); goto trunc; } iecode = EXTRACT_U_1(p); @@ -901,8 +901,8 @@ q933_print(netdissect_options *ndo, /* printing out header part */ if (!ndo->ndo_eflag) - ND_PRINT((ndo, ", ")); - ND_PRINT((ndo, "%s, codeset %u", is_ansi ? "ANSI" : "CCITT", codeset)); + ND_PRINT(", "); + ND_PRINT("%s, codeset %u", is_ansi ? "ANSI" : "CCITT", codeset); if (call_ref_length != 0) { ND_TCHECK_1(p); @@ -910,21 +910,21 @@ q933_print(netdissect_options *ndo, /* * Not a dummy call reference. */ - ND_PRINT((ndo, ", Call Ref: 0x")); + ND_PRINT(", Call Ref: 0x"); for (i = 0; i < call_ref_length; i++) - ND_PRINT((ndo, "%02x", call_ref[i])); + ND_PRINT("%02x", call_ref[i]); } } if (ndo->ndo_vflag) { - ND_PRINT((ndo, ", %s (0x%02x), length %u", + ND_PRINT(", %s (0x%02x), length %u", tok2str(fr_q933_msg_values, "unknown message", msgtype), msgtype, - olen)); + olen); } else { - ND_PRINT((ndo, ", %s", + ND_PRINT(", %s", tok2str(fr_q933_msg_values, - "unknown message 0x%02x", msgtype))); + "unknown message 0x%02x", msgtype)); } /* Loop through the rest of the IEs */ @@ -952,7 +952,7 @@ q933_print(netdissect_options *ndo, */ if (!ND_TTEST_1(p)) { if (!ndo->ndo_vflag) { - ND_PRINT((ndo, ", length %u", olen)); + ND_PRINT(", length %u", olen); } goto trunc; } @@ -995,7 +995,7 @@ q933_print(netdissect_options *ndo, */ if (length == 0 || !ND_TTEST_1(p)) { if (!ndo->ndo_vflag) { - ND_PRINT((ndo, ", length %u", olen)); + ND_PRINT(", length %u", olen); } goto trunc; } @@ -1007,11 +1007,11 @@ q933_print(netdissect_options *ndo, * however some IEs (DLCI Status, Link Verify) * are also interesting in non-verbose mode */ if (ndo->ndo_vflag) { - ND_PRINT((ndo, "\n\t%s IE (0x%02x), length %u: ", + ND_PRINT("\n\t%s IE (0x%02x), length %u: ", tok2str(fr_q933_ie_codesets[codeset], "unknown", iecode), iecode, - ielength)); + ielength); } /* sanity checks */ @@ -1020,7 +1020,7 @@ q933_print(netdissect_options *ndo, } if (length < ielength || !ND_TTEST_LEN(p, ielength)) { if (!ndo->ndo_vflag) { - ND_PRINT((ndo, ", length %u", olen)); + ND_PRINT(", length %u", olen); } goto trunc; } @@ -1054,12 +1054,12 @@ q933_print(netdissect_options *ndo, } } if (!ndo->ndo_vflag) { - ND_PRINT((ndo, ", length %u", olen)); + ND_PRINT(", length %u", olen); } return; trunc: - ND_PRINT((ndo, "[|q.933]")); + ND_PRINT("[|q.933]"); } static int @@ -1074,15 +1074,15 @@ fr_q933_print_ie_codeset_0_5(netdissect_options *ndo, u_int iecode, case FR_LMI_CCITT_REPORT_TYPE_IE: if (ielength < 1) { if (!ndo->ndo_vflag) { - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); } - ND_PRINT((ndo, "Invalid REPORT TYPE IE")); + ND_PRINT("Invalid REPORT TYPE IE"); return 1; } if (ndo->ndo_vflag) { - ND_PRINT((ndo, "%s (%u)", + ND_PRINT("%s (%u)", tok2str(fr_lmi_report_type_ie_values,"unknown",EXTRACT_U_1(p)), - EXTRACT_U_1(p))); + EXTRACT_U_1(p)); } return 1; @@ -1090,19 +1090,19 @@ fr_q933_print_ie_codeset_0_5(netdissect_options *ndo, u_int iecode, case FR_LMI_CCITT_LINK_VERIFY_IE: case FR_LMI_ANSI_LINK_VERIFY_IE_91: if (!ndo->ndo_vflag) { - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); } if (ielength < 2) { - ND_PRINT((ndo, "Invalid LINK VERIFY IE")); + ND_PRINT("Invalid LINK VERIFY IE"); return 1; } - ND_PRINT((ndo, "TX Seq: %3d, RX Seq: %3d", EXTRACT_U_1(p), EXTRACT_U_1(p + 1))); + ND_PRINT("TX Seq: %3d, RX Seq: %3d", EXTRACT_U_1(p), EXTRACT_U_1(p + 1)); return 1; case FR_LMI_ANSI_PVC_STATUS_IE: /* fall through */ case FR_LMI_CCITT_PVC_STATUS_IE: if (!ndo->ndo_vflag) { - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); } /* now parse the DLCI information element. */ if ((ielength < 3) || @@ -1115,7 +1115,7 @@ fr_q933_print_ie_codeset_0_5(netdissect_options *ndo, u_int iecode, !(EXTRACT_U_1(p + 3) & 0x80))) || (ielength > 5) || !(EXTRACT_U_1(p + ielength - 1) & 0x80)) { - ND_PRINT((ndo, "Invalid DLCI in PVC STATUS IE")); + ND_PRINT("Invalid DLCI in PVC STATUS IE"); return 1; } @@ -1127,9 +1127,9 @@ fr_q933_print_ie_codeset_0_5(netdissect_options *ndo, u_int iecode, dlci = (dlci << 13) | (EXTRACT_U_1(p + 2) & 0x7F) | ((EXTRACT_U_1(p + 3) & 0x7E) >> 1); } - ND_PRINT((ndo, "DLCI %u: status %s%s", dlci, + ND_PRINT("DLCI %u: status %s%s", dlci, EXTRACT_U_1(p + ielength - 1) & 0x8 ? "New, " : "", - EXTRACT_U_1(p + ielength - 1) & 0x2 ? "Active" : "Inactive")); + EXTRACT_U_1(p + ielength - 1) & 0x2 ? "Active" : "Inactive"); return 1; } diff --git a/print-frag6.c b/print-frag6.c index cecef613..460f841f 100644 --- a/print-frag6.c +++ b/print-frag6.c @@ -44,16 +44,16 @@ frag6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2) ND_TCHECK_SIZE(dp); if (ndo->ndo_vflag) { - ND_PRINT((ndo, "frag (0x%08x:%d|%ld)", + ND_PRINT("frag (0x%08x:%d|%ld)", EXTRACT_BE_U_4(&dp->ip6f_ident), EXTRACT_BE_U_2(&dp->ip6f_offlg) & IP6F_OFF_MASK, sizeof(struct ip6_hdr) + EXTRACT_BE_U_2(&ip6->ip6_plen) - - (long)(bp - bp2) - sizeof(struct ip6_frag))); + (long)(bp - bp2) - sizeof(struct ip6_frag)); } else { - ND_PRINT((ndo, "frag (%d|%ld)", + ND_PRINT("frag (%d|%ld)", EXTRACT_BE_U_2(&dp->ip6f_offlg) & IP6F_OFF_MASK, sizeof(struct ip6_hdr) + EXTRACT_BE_U_2(&ip6->ip6_plen) - - (long)(bp - bp2) - sizeof(struct ip6_frag))); + (long)(bp - bp2) - sizeof(struct ip6_frag)); } /* it is meaningless to decode non-first fragment */ @@ -61,10 +61,10 @@ frag6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2) return -1; else { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); return sizeof(struct ip6_frag); } trunc: - ND_PRINT((ndo, "[|frag]")); + ND_PRINT("[|frag]"); return -1; } diff --git a/print-geneve.c b/print-geneve.c index 724e9f02..0deafd31 100644 --- a/print-geneve.c +++ b/print-geneve.c @@ -109,19 +109,19 @@ geneve_opts_print(netdissect_options *ndo, const u_char *bp, u_int len) uint8_t opt_type; uint8_t opt_len; - ND_PRINT((ndo, "%s", sep)); + ND_PRINT("%s", sep); sep = ", "; opt_class = EXTRACT_BE_U_2(bp); opt_type = EXTRACT_U_1(bp + 2); opt_len = 4 + ((EXTRACT_U_1(bp + 3) & OPT_LEN_MASK) * 4); - ND_PRINT((ndo, "class %s (0x%x) type 0x%x%s len %u", + ND_PRINT("class %s (0x%x) type 0x%x%s len %u", format_opt_class(opt_class), opt_class, opt_type, - opt_type & OPT_TYPE_CRITICAL ? "(C)" : "", opt_len)); + opt_type & OPT_TYPE_CRITICAL ? "(C)" : "", opt_len); if (opt_len > len) { - ND_PRINT((ndo, " [bad length]")); + ND_PRINT(" [bad length]"); return; } @@ -129,10 +129,10 @@ geneve_opts_print(netdissect_options *ndo, const u_char *bp, u_int len) const uint32_t *data = (const uint32_t *)(bp + 4); int i; - ND_PRINT((ndo, " data")); + ND_PRINT(" data"); for (i = 4; i < opt_len; i += 4) { - ND_PRINT((ndo, " %08x", EXTRACT_BE_U_4(data))); + ND_PRINT(" %08x", EXTRACT_BE_U_4(data)); data++; } } @@ -153,7 +153,7 @@ geneve_print(netdissect_options *ndo, const u_char *bp, u_int len) uint8_t reserved; u_int opts_len; - ND_PRINT((ndo, "Geneve")); + ND_PRINT("Geneve"); ND_TCHECK_8(bp); @@ -163,7 +163,7 @@ geneve_print(netdissect_options *ndo, const u_char *bp, u_int len) version = ver_opt >> VER_SHIFT; if (version != 0) { - ND_PRINT((ndo, " ERROR: unknown-version %u", version)); + ND_PRINT(" ERROR: unknown-version %u", version); return; } @@ -183,55 +183,55 @@ geneve_print(netdissect_options *ndo, const u_char *bp, u_int len) bp += 1; len -= 1; - ND_PRINT((ndo, ", Flags [%s]", - bittok2str_nosep(geneve_flag_values, "none", flags))); - ND_PRINT((ndo, ", vni 0x%x", vni)); + ND_PRINT(", Flags [%s]", + bittok2str_nosep(geneve_flag_values, "none", flags)); + ND_PRINT(", vni 0x%x", vni); if (reserved) - ND_PRINT((ndo, ", rsvd 0x%x", reserved)); + ND_PRINT(", rsvd 0x%x", reserved); if (ndo->ndo_eflag) - ND_PRINT((ndo, ", proto %s (0x%04x)", - tok2str(ethertype_values, "unknown", prot), prot)); + ND_PRINT(", proto %s (0x%04x)", + tok2str(ethertype_values, "unknown", prot), prot); opts_len = (ver_opt & HDR_OPTS_LEN_MASK) * 4; if (len < opts_len) { - ND_PRINT((ndo, " truncated-geneve - %u bytes missing", - opts_len - len)); + ND_PRINT(" truncated-geneve - %u bytes missing", + opts_len - len); return; } ND_TCHECK_LEN(bp, opts_len); if (opts_len > 0) { - ND_PRINT((ndo, ", options [")); + ND_PRINT(", options ["); if (ndo->ndo_vflag) geneve_opts_print(ndo, bp, opts_len); else - ND_PRINT((ndo, "%u bytes", opts_len)); + ND_PRINT("%u bytes", opts_len); - ND_PRINT((ndo, "]")); + ND_PRINT("]"); } bp += opts_len; len -= opts_len; if (ndo->ndo_vflag < 1) - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); else - ND_PRINT((ndo, "\n\t")); + ND_PRINT("\n\t"); if (ethertype_print(ndo, prot, bp, len, ndo->ndo_snapend - bp, NULL, NULL) == 0) { if (prot == ETHERTYPE_TEB) ether_print(ndo, bp, len, ndo->ndo_snapend - bp, NULL, NULL); else - ND_PRINT((ndo, "geneve-proto-0x%x", prot)); + ND_PRINT("geneve-proto-0x%x", prot); } return; trunc: - ND_PRINT((ndo, " [|geneve]")); + ND_PRINT(" [|geneve]"); } diff --git a/print-geonet.c b/print-geonet.c index 488969ef..321ce226 100644 --- a/print-geonet.c +++ b/print-geonet.c @@ -68,7 +68,7 @@ print_btp_body(netdissect_options *ndo, msg_type = EXTRACT_U_1(bp + 1); msg_type_str = tok2str(msg_type_values, "unknown (%u)", msg_type); - ND_PRINT((ndo, "; ItsPduHeader v:%d t:%d-%s", version, msg_type, msg_type_str)); + ND_PRINT("; ItsPduHeader v:%d t:%d-%s", version, msg_type, msg_type_str); } static void @@ -77,7 +77,7 @@ print_btp(netdissect_options *ndo, { uint16_t dest = EXTRACT_BE_U_2(bp + 0); uint16_t src = EXTRACT_BE_U_2(bp + 2); - ND_PRINT((ndo, "; BTP Dst:%u Src:%u", dest, src)); + ND_PRINT("; BTP Dst:%u Src:%u", dest, src); } static int @@ -88,14 +88,14 @@ print_long_pos_vector(netdissect_options *ndo, if (!ND_TTEST_LEN(bp, GEONET_ADDR_LEN)) return (-1); - ND_PRINT((ndo, "GN_ADDR:%s ", linkaddr_string (ndo, bp, 0, GEONET_ADDR_LEN))); + ND_PRINT("GN_ADDR:%s ", linkaddr_string (ndo, bp, 0, GEONET_ADDR_LEN)); if (!ND_TTEST_8(bp + 12)) return (-1); lat = EXTRACT_BE_U_4(bp + 12); - ND_PRINT((ndo, "lat:%d ", lat)); + ND_PRINT("lat:%d ", lat); lon = EXTRACT_BE_U_4(bp + 16); - ND_PRINT((ndo, "lon:%d", lon)); + ND_PRINT("lon:%d", lon); return (0); } @@ -118,10 +118,10 @@ geonet_print(netdissect_options *ndo, const u_char *bp, u_int length, const char *hdr_type_txt = "Unknown"; int hdr_size = -1; - ND_PRINT((ndo, "GeoNet ")); + ND_PRINT("GeoNet "); if (src != NULL) - ND_PRINT((ndo, "src:%s", (src->addr_string)(ndo, src->addr))); - ND_PRINT((ndo, "; ")); + ND_PRINT("src:%s", (src->addr_string)(ndo, src->addr)); + ND_PRINT("; "); /* Process Common Header */ if (length < 36) @@ -170,11 +170,11 @@ geonet_print(netdissect_options *ndo, const u_char *bp, u_int length, break; } - ND_PRINT((ndo, "v:%d ", version)); - ND_PRINT((ndo, "NH:%d-%s ", next_hdr, next_hdr_txt)); - ND_PRINT((ndo, "HT:%d-%d-%s ", hdr_type, hdr_subtype, hdr_type_txt)); - ND_PRINT((ndo, "HopLim:%d ", hop_limit)); - ND_PRINT((ndo, "Payload:%d ", payload_length)); + ND_PRINT("v:%d ", version); + ND_PRINT("NH:%d-%s ", next_hdr, next_hdr_txt); + ND_PRINT("HT:%d-%d-%s ", hdr_type, hdr_subtype, hdr_type_txt); + ND_PRINT("HopLim:%d ", hop_limit); + ND_PRINT("Payload:%d ", payload_length); if (print_long_pos_vector(ndo, bp + 8) == -1) goto trunc; @@ -269,12 +269,12 @@ geonet_print(netdissect_options *ndo, const u_char *bp, u_int length, return; invalid: - ND_PRINT((ndo, " Malformed (small) ")); + ND_PRINT(" Malformed (small) "); /* XXX - print the remaining data as hex? */ return; trunc: - ND_PRINT((ndo, "[|geonet]")); + ND_PRINT("[|geonet]"); } diff --git a/print-gre.c b/print-gre.c index 672ed956..06744cf6 100644 --- a/print-gre.c +++ b/print-gre.c @@ -93,7 +93,7 @@ gre_print(netdissect_options *ndo, const u_char *bp, u_int length) if (len < 2) goto trunc; vers = EXTRACT_BE_U_2(bp) & GRE_VERS_MASK; - ND_PRINT((ndo, "GREv%u",vers)); + ND_PRINT("GREv%u",vers); switch(vers) { case 0: @@ -103,13 +103,13 @@ gre_print(netdissect_options *ndo, const u_char *bp, u_int length) gre_print_1(ndo, bp, len); break; default: - ND_PRINT((ndo, " ERROR: unknown-version")); + ND_PRINT(" ERROR: unknown-version"); break; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } @@ -122,8 +122,8 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) /* 16 bits ND_TCHECKed in gre_print() */ flags = EXTRACT_BE_U_2(bp); if (ndo->ndo_vflag) - ND_PRINT((ndo, ", Flags [%s]", - bittok2str(gre_flag_values,"none",flags))); + ND_PRINT(", Flags [%s]", + bittok2str(gre_flag_values,"none",flags)); len -= 2; bp += 2; @@ -140,14 +140,14 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) if (len < 2) goto trunc; if (ndo->ndo_vflag) - ND_PRINT((ndo, ", sum 0x%x", EXTRACT_BE_U_2(bp))); + ND_PRINT(", sum 0x%x", EXTRACT_BE_U_2(bp)); bp += 2; len -= 2; ND_TCHECK_2(bp); if (len < 2) goto trunc; - ND_PRINT((ndo, ", off 0x%x", EXTRACT_BE_U_2(bp))); + ND_PRINT(", off 0x%x", EXTRACT_BE_U_2(bp)); bp += 2; len -= 2; } @@ -156,7 +156,7 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) ND_TCHECK_4(bp); if (len < 4) goto trunc; - ND_PRINT((ndo, ", key=0x%x", EXTRACT_BE_U_4(bp))); + ND_PRINT(", key=0x%x", EXTRACT_BE_U_4(bp)); bp += 4; len -= 4; } @@ -165,7 +165,7 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) ND_TCHECK_4(bp); if (len < 4) goto trunc; - ND_PRINT((ndo, ", seq %u", EXTRACT_BE_U_4(bp))); + ND_PRINT(", seq %u", EXTRACT_BE_U_4(bp)); bp += 4; len -= 4; } @@ -199,16 +199,16 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) } if (ndo->ndo_eflag) - ND_PRINT((ndo, ", proto %s (0x%04x)", + ND_PRINT(", proto %s (0x%04x)", tok2str(ethertype_values,"unknown",prot), - prot)); + prot); - ND_PRINT((ndo, ", length %u",length)); + ND_PRINT(", length %u",length); if (ndo->ndo_vflag < 1) - ND_PRINT((ndo, ": ")); /* put in a colon as protocol demarc */ + ND_PRINT(": "); /* put in a colon as protocol demarc */ else - ND_PRINT((ndo, "\n\t")); /* if verbose go multiline */ + ND_PRINT("\n\t"); /* if verbose go multiline */ switch (prot) { case ETHERTYPE_IP: @@ -233,12 +233,12 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) ether_print(ndo, bp, len, ndo->ndo_snapend - bp, NULL, NULL); break; default: - ND_PRINT((ndo, "gre-proto-0x%x", prot)); + ND_PRINT("gre-proto-0x%x", prot); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -253,8 +253,8 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length) bp += 2; if (ndo->ndo_vflag) - ND_PRINT((ndo, ", Flags [%s]", - bittok2str(gre_flag_values,"none",flags))); + ND_PRINT(", Flags [%s]", + bittok2str(gre_flag_values,"none",flags)); ND_TCHECK_2(bp); if (len < 2) @@ -271,7 +271,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length) if (len < 4) goto trunc; k = EXTRACT_BE_U_4(bp); - ND_PRINT((ndo, ", call %d", k & 0xffff)); + ND_PRINT(", call %d", k & 0xffff); len -= 4; bp += 4; } @@ -280,7 +280,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length) ND_TCHECK_4(bp); if (len < 4) goto trunc; - ND_PRINT((ndo, ", seq %u", EXTRACT_BE_U_4(bp))); + ND_PRINT(", seq %u", EXTRACT_BE_U_4(bp)); bp += 4; len -= 4; } @@ -289,41 +289,41 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length) ND_TCHECK_4(bp); if (len < 4) goto trunc; - ND_PRINT((ndo, ", ack %u", EXTRACT_BE_U_4(bp))); + ND_PRINT(", ack %u", EXTRACT_BE_U_4(bp)); bp += 4; len -= 4; } if ((flags & GRE_SP) == 0) - ND_PRINT((ndo, ", no-payload")); + ND_PRINT(", no-payload"); if (ndo->ndo_eflag) - ND_PRINT((ndo, ", proto %s (0x%04x)", + ND_PRINT(", proto %s (0x%04x)", tok2str(ethertype_values,"unknown",prot), - prot)); + prot); - ND_PRINT((ndo, ", length %u",length)); + ND_PRINT(", length %u",length); if ((flags & GRE_SP) == 0) return; if (ndo->ndo_vflag < 1) - ND_PRINT((ndo, ": ")); /* put in a colon as protocol demarc */ + ND_PRINT(": "); /* put in a colon as protocol demarc */ else - ND_PRINT((ndo, "\n\t")); /* if verbose go multiline */ + ND_PRINT("\n\t"); /* if verbose go multiline */ switch (prot) { case ETHERTYPE_PPP: ppp_print(ndo, bp, len); break; default: - ND_PRINT((ndo, "gre-proto-0x%x", prot)); + ND_PRINT("gre-proto-0x%x", prot); break; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static int @@ -334,17 +334,17 @@ gre_sre_print(netdissect_options *ndo, uint16_t af, uint8_t sreoff, switch (af) { case GRESRE_IP: - ND_PRINT((ndo, ", (rtaf=ip")); + ND_PRINT(", (rtaf=ip"); ret = gre_sre_ip_print(ndo, sreoff, srelen, bp, len); - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case GRESRE_ASN: - ND_PRINT((ndo, ", (rtaf=asn")); + ND_PRINT(", (rtaf=asn"); ret = gre_sre_asn_print(ndo, sreoff, srelen, bp, len); - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; default: - ND_PRINT((ndo, ", (rtaf=0x%x)", af)); + ND_PRINT(", (rtaf=0x%x)", af); ret = 1; } return (ret); @@ -358,15 +358,15 @@ gre_sre_ip_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen, char buf[INET_ADDRSTRLEN]; if (sreoff & 3) { - ND_PRINT((ndo, ", badoffset=%u", sreoff)); + ND_PRINT(", badoffset=%u", sreoff); return (1); } if (srelen & 3) { - ND_PRINT((ndo, ", badlength=%u", srelen)); + ND_PRINT(", badlength=%u", srelen); return (1); } if (sreoff >= srelen) { - ND_PRINT((ndo, ", badoff/len=%u/%u", sreoff, srelen)); + ND_PRINT(", badoff/len=%u/%u", sreoff, srelen); return (1); } @@ -377,8 +377,8 @@ gre_sre_ip_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen, return (0); addrtostr(bp, buf, sizeof(buf)); - ND_PRINT((ndo, " %s%s", - ((bp - up) == sreoff) ? "*" : "", buf)); + ND_PRINT(" %s%s", + ((bp - up) == sreoff) ? "*" : "", buf); bp += 4; len -= 4; @@ -394,15 +394,15 @@ gre_sre_asn_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen, const u_char *up = bp; if (sreoff & 1) { - ND_PRINT((ndo, ", badoffset=%u", sreoff)); + ND_PRINT(", badoffset=%u", sreoff); return (1); } if (srelen & 1) { - ND_PRINT((ndo, ", badlength=%u", srelen)); + ND_PRINT(", badlength=%u", srelen); return (1); } if (sreoff >= srelen) { - ND_PRINT((ndo, ", badoff/len=%u/%u", sreoff, srelen)); + ND_PRINT(", badoff/len=%u/%u", sreoff, srelen); return (1); } @@ -412,9 +412,9 @@ gre_sre_asn_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen, if (len < 2) return (0); - ND_PRINT((ndo, " %s%x", + ND_PRINT(" %s%x", ((bp - up) == sreoff) ? "*" : "", - EXTRACT_BE_U_2(bp))); + EXTRACT_BE_U_2(bp)); bp += 2; len -= 2; diff --git a/print-hncp.c b/print-hncp.c index 00ab04d1..3a56538b 100644 --- a/print-hncp.c +++ b/print-hncp.c @@ -49,7 +49,7 @@ void hncp_print(netdissect_options *ndo, const u_char *cp, u_int length) { - ND_PRINT((ndo, "hncp (%d)", length)); + ND_PRINT("hncp (%d)", length); hncp_print_rec(ndo, cp, length, 1); } @@ -232,7 +232,7 @@ print_prefix(netdissect_options *ndo, const u_char *prefix, u_int max_length) plenbytes = decode_prefix6(ndo, prefix, max_length, buf, sizeof(buf)); } - ND_PRINT((ndo, "%s", buf)); + ND_PRINT("%s", buf); return plenbytes; } @@ -258,7 +258,7 @@ print_dns_label(netdissect_options *ndo, length += lab_length; } if (print) - ND_PRINT((ndo, "[|DNS]")); + ND_PRINT("[|DNS]"); return -1; } @@ -279,12 +279,12 @@ dhcpv4_print(netdissect_options *ndo, optlen = EXTRACT_U_1(tlv + 1); value = tlv + 2; - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); for (t = indent; t > 0; t--) - ND_PRINT((ndo, "\t")); + ND_PRINT("\t"); - ND_PRINT((ndo, "%s", tok2str(dh4opt_str, "Unknown", type))); - ND_PRINT((ndo," (%u)", optlen + 2 )); + ND_PRINT("%s", tok2str(dh4opt_str, "Unknown", type)); + ND_PRINT(" (%u)", optlen + 2 ); if (i + 2 + optlen > length) return -1; @@ -295,13 +295,13 @@ dhcpv4_print(netdissect_options *ndo, return -1; } for (t = 0; t < optlen; t += 4) - ND_PRINT((ndo, " %s", ipaddr_string(ndo, value + t))); + ND_PRINT(" %s", ipaddr_string(ndo, value + t)); } break; case DH4OPT_DOMAIN_SEARCH: { const u_char *tp = value; while (tp < value + optlen) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if ((tp = ns_nprint(ndo, tp, value + optlen)) == NULL) return -1; } @@ -331,12 +331,12 @@ dhcpv6_print(netdissect_options *ndo, optlen = EXTRACT_BE_U_2(tlv + 2); value = tlv + 4; - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); for (t = indent; t > 0; t--) - ND_PRINT((ndo, "\t")); + ND_PRINT("\t"); - ND_PRINT((ndo, "%s", tok2str(dh6opt_str, "Unknown", type))); - ND_PRINT((ndo," (%u)", optlen + 4 )); + ND_PRINT("%s", tok2str(dh6opt_str, "Unknown", type)); + ND_PRINT(" (%u)", optlen + 4 ); if (i + 4 + optlen > length) return -1; @@ -344,17 +344,17 @@ dhcpv6_print(netdissect_options *ndo, case DH6OPT_DNS_SERVERS: case DH6OPT_SNTP_SERVERS: { if (optlen % 16 != 0) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); return -1; } for (t = 0; t < optlen; t += 16) - ND_PRINT((ndo, " %s", ip6addr_string(ndo, value + t))); + ND_PRINT(" %s", ip6addr_string(ndo, value + t)); } break; case DH6OPT_DOMAIN_LIST: { const u_char *tp = value; while (tp < value + optlen) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if ((tp = ns_nprint(ndo, tp, value + optlen)) == NULL) return -1; } @@ -383,18 +383,18 @@ print_type_in_line(netdissect_options *ndo, *first_one = 0; if (indent > 1) { u_int t; - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); for (t = indent; t > 0; t--) - ND_PRINT((ndo, "\t")); + ND_PRINT("\t"); } else { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); } } else { - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); } - ND_PRINT((ndo, "%s", tok2str(type_values, "Easter Egg", type))); + ND_PRINT("%s", tok2str(type_values, "Easter Egg", type)); if (count > 1) - ND_PRINT((ndo, " (x%d)", count)); + ND_PRINT(" (x%d)", count); } } @@ -419,9 +419,9 @@ hncp_print_rec(netdissect_options *ndo, tlv = cp + i; if (!in_line) { - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); for (t = indent; t > 0; t--) - ND_PRINT((ndo, "\t")); + ND_PRINT("\t"); } ND_TCHECK_4(tlv); @@ -469,27 +469,27 @@ hncp_print_rec(netdissect_options *ndo, goto skip_multiline; } - ND_PRINT((ndo,"%s", tok2str(type_values, "Easter Egg (42)", type_mask) )); + ND_PRINT("%s", tok2str(type_values, "Easter Egg (42)", type_mask) ); if (type_mask > 0xffff) - ND_PRINT((ndo,": type=%u", type )); - ND_PRINT((ndo," (%u)", bodylen + 4 )); + ND_PRINT(": type=%u", type ); + ND_PRINT(" (%u)", bodylen + 4 ); switch (type_mask) { case DNCP_REQUEST_NETWORK_STATE: { if (bodylen != 0) - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); } break; case DNCP_REQUEST_NODE_STATE: { const char *node_identifier; if (bodylen != 4) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } node_identifier = format_nid(value); - ND_PRINT((ndo, " NID: %s", node_identifier)); + ND_PRINT(" NID: %s", node_identifier); } break; @@ -497,26 +497,26 @@ hncp_print_rec(netdissect_options *ndo, const char *node_identifier; uint32_t endpoint_identifier; if (bodylen != 8) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } node_identifier = format_nid(value); endpoint_identifier = EXTRACT_BE_U_4(value + 4); - ND_PRINT((ndo, " NID: %s EPID: %08x", + ND_PRINT(" NID: %s EPID: %08x", node_identifier, endpoint_identifier - )); + ); } break; case DNCP_NETWORK_STATE: { uint64_t hash; if (bodylen != 8) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } hash = EXTRACT_BE_U_8(value); - ND_PRINT((ndo, " hash: %016" PRIx64, hash)); + ND_PRINT(" hash: %016" PRIx64, hash); } break; @@ -525,19 +525,19 @@ hncp_print_rec(netdissect_options *ndo, uint32_t sequence_number; uint64_t hash; if (bodylen < 20) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } node_identifier = format_nid(value); sequence_number = EXTRACT_BE_U_4(value + 4); interval = format_interval(EXTRACT_BE_U_4(value + 8)); hash = EXTRACT_BE_U_8(value + 12); - ND_PRINT((ndo, " NID: %s seqno: %u %s hash: %016" PRIx64, + ND_PRINT(" NID: %s seqno: %u %s hash: %016" PRIx64, node_identifier, sequence_number, interval, hash - )); + ); hncp_print_rec(ndo, value+20, bodylen-20, indent+1); } break; @@ -546,17 +546,17 @@ hncp_print_rec(netdissect_options *ndo, const char *peer_node_identifier; uint32_t peer_endpoint_identifier, endpoint_identifier; if (bodylen != 12) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } peer_node_identifier = format_nid(value); peer_endpoint_identifier = EXTRACT_BE_U_4(value + 4); endpoint_identifier = EXTRACT_BE_U_4(value + 8); - ND_PRINT((ndo, " Peer-NID: %s Peer-EPID: %08x Local-EPID: %08x", + ND_PRINT(" Peer-NID: %s Peer-EPID: %08x Local-EPID: %08x", peer_node_identifier, peer_endpoint_identifier, endpoint_identifier - )); + ); } break; @@ -564,26 +564,26 @@ hncp_print_rec(netdissect_options *ndo, uint32_t endpoint_identifier; const char *interval; if (bodylen < 8) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } endpoint_identifier = EXTRACT_BE_U_4(value); interval = format_interval(EXTRACT_BE_U_4(value + 4)); - ND_PRINT((ndo, " EPID: %08x Interval: %s", + ND_PRINT(" EPID: %08x Interval: %s", endpoint_identifier, interval - )); + ); } break; case DNCP_TRUST_VERDICT: { if (bodylen <= 36) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } - ND_PRINT((ndo, " Verdict: %u Fingerprint: %s Common Name: ", + ND_PRINT(" Verdict: %u Fingerprint: %s Common Name: ", EXTRACT_U_1(value), - format_256(value + 4))); + format_256(value + 4)); safeputs(ndo, value + 36, bodylen - 36); } break; @@ -592,7 +592,7 @@ hncp_print_rec(netdissect_options *ndo, uint16_t capabilities; uint8_t M, P, H, L; if (bodylen < 5) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } capabilities = EXTRACT_BE_U_2(value + 2); @@ -600,9 +600,9 @@ hncp_print_rec(netdissect_options *ndo, P = (uint8_t)((capabilities >> 8) & 0xf); H = (uint8_t)((capabilities >> 4) & 0xf); L = (uint8_t)(capabilities & 0xf); - ND_PRINT((ndo, " M: %u P: %u H: %u L: %u User-agent: ", + ND_PRINT(" M: %u P: %u H: %u L: %u User-agent: ", M, P, H, L - )); + ); safeputs(ndo, value + 4, bodylen - 4); } break; @@ -616,16 +616,16 @@ hncp_print_rec(netdissect_options *ndo, case HNCP_DELEGATED_PREFIX: { int l; if (bodylen < 9 || bodylen < 9 + (EXTRACT_U_1(value + 8) + 7) / 8) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } - ND_PRINT((ndo, " VLSO: %s PLSO: %s Prefix: ", + ND_PRINT(" VLSO: %s PLSO: %s Prefix: ", format_interval(EXTRACT_BE_U_4(value)), format_interval(EXTRACT_BE_U_4(value + 4)) - )); + ); l = print_prefix(ndo, value + 8, bodylen - 8); if (l == -1) { - ND_PRINT((ndo, "(length is invalid)")); + ND_PRINT("(length is invalid)"); break; } if (l < 0) { @@ -638,7 +638,7 @@ hncp_print_rec(netdissect_options *ndo, * IPv6", or -3, meaning "the prefix runs past * the end of the TLV". */ - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } l += 8 + (-l & 3); @@ -652,22 +652,22 @@ hncp_print_rec(netdissect_options *ndo, uint8_t policy; int l; if (bodylen < 1) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } policy = EXTRACT_U_1(value); - ND_PRINT((ndo, " type: ")); + ND_PRINT(" type: "); if (policy == 0) { if (bodylen != 1) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } - ND_PRINT((ndo, "Internet connectivity")); + ND_PRINT("Internet connectivity"); } else if (policy >= 1 && policy <= 128) { - ND_PRINT((ndo, "Dest-Prefix: ")); + ND_PRINT("Dest-Prefix: "); l = print_prefix(ndo, value, bodylen); if (l == -1) { - ND_PRINT((ndo, "(length is invalid)")); + ND_PRINT("(length is invalid)"); break; } if (l < 0) { @@ -680,30 +680,30 @@ hncp_print_rec(netdissect_options *ndo, * IPv6", or -3, meaning "the prefix runs past * the end of the TLV". */ - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } } else if (policy == 129) { - ND_PRINT((ndo, "DNS domain: ")); + ND_PRINT("DNS domain: "); print_dns_label(ndo, value+1, bodylen-1, 1); } else if (policy == 130) { - ND_PRINT((ndo, "Opaque UTF-8: ")); + ND_PRINT("Opaque UTF-8: "); safeputs(ndo, value + 1, bodylen - 1); } else if (policy == 131) { if (bodylen != 1) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } - ND_PRINT((ndo, "Restrictive assignment")); + ND_PRINT("Restrictive assignment"); } else if (policy >= 132) { - ND_PRINT((ndo, "Unknown (%u)", policy)); /* Reserved for future additions */ + ND_PRINT("Unknown (%u)", policy); /* Reserved for future additions */ } } break; case HNCP_DHCPV4_DATA: { if (bodylen == 0) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } if (dhcpv4_print(ndo, value, bodylen, indent+1) != 0) @@ -713,11 +713,11 @@ hncp_print_rec(netdissect_options *ndo, case HNCP_DHCPV6_DATA: { if (bodylen == 0) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } if (dhcpv6_print(ndo, value, bodylen, indent+1) != 0) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } } @@ -727,17 +727,17 @@ hncp_print_rec(netdissect_options *ndo, uint8_t prty; int l; if (bodylen < 6 || bodylen < 6 + (EXTRACT_U_1(value + 5) + 7) / 8) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } prty = EXTRACT_U_1(value + 4) & 0xf; - ND_PRINT((ndo, " EPID: %08x Prty: %u", + ND_PRINT(" EPID: %08x Prty: %u", EXTRACT_BE_U_4(value), prty - )); - ND_PRINT((ndo, " Prefix: ")); + ); + ND_PRINT(" Prefix: "); if ((l = print_prefix(ndo, value + 5, bodylen - 5)) < 0) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } l += 5; @@ -752,15 +752,15 @@ hncp_print_rec(netdissect_options *ndo, uint32_t endpoint_identifier; const char *ip_address; if (bodylen < 20) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } endpoint_identifier = EXTRACT_BE_U_4(value); ip_address = format_ip6addr(ndo, value + 4); - ND_PRINT((ndo, " EPID: %08x IP Address: %s", + ND_PRINT(" EPID: %08x IP Address: %s", endpoint_identifier, ip_address - )); + ); hncp_print_rec(ndo, value + 20, bodylen - 20, indent+1); } @@ -770,19 +770,19 @@ hncp_print_rec(netdissect_options *ndo, const char *ip_address; int len; if (bodylen < 17) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } ip_address = format_ip6addr(ndo, value); - ND_PRINT((ndo, " IP-Address: %s %c%c%c ", + ND_PRINT(" IP-Address: %s %c%c%c ", ip_address, (EXTRACT_U_1(value + 16) & 4) ? 'l' : '-', (EXTRACT_U_1(value + 16) & 2) ? 'b' : '-', (EXTRACT_U_1(value + 16) & 1) ? 's' : '-' - )); + ); len = print_dns_label(ndo, value+17, bodylen-17, 1); if (len < 0) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } len += 17; @@ -794,10 +794,10 @@ hncp_print_rec(netdissect_options *ndo, case HNCP_DOMAIN_NAME: { if (bodylen == 0) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } - ND_PRINT((ndo, " Domain: ")); + ND_PRINT(" Domain: "); print_dns_label(ndo, value, bodylen, 1); } break; @@ -805,23 +805,23 @@ hncp_print_rec(netdissect_options *ndo, case HNCP_NODE_NAME: { u_int l; if (bodylen < 17) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } l = EXTRACT_U_1(value + 16); if (bodylen < 17 + l) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } - ND_PRINT((ndo, " IP-Address: %s Name: ", + ND_PRINT(" IP-Address: %s Name: ", format_ip6addr(ndo, value) - )); + ); if (l < 64) { safeputchar(ndo, '"'); safeputs(ndo, value + 17, l); safeputchar(ndo, '"'); } else { - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); } l += 17; l += -l & 3; @@ -832,10 +832,10 @@ hncp_print_rec(netdissect_options *ndo, case HNCP_MANAGED_PSK: { if (bodylen < 32) { - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); break; } - ND_PRINT((ndo, " PSK: %s", format_256(value))); + ND_PRINT(" PSK: %s", format_256(value)); hncp_print_rec(ndo, value + 32, bodylen - 32, indent+1); } break; @@ -856,10 +856,10 @@ hncp_print_rec(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", "[|hncp]")); + ND_PRINT("%s", "[|hncp]"); return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); return; } diff --git a/print-hsrp.c b/print-hsrp.c index ad97a2be..7674ec71 100644 --- a/print-hsrp.c +++ b/print-hsrp.c @@ -101,38 +101,38 @@ hsrp_print(netdissect_options *ndo, const uint8_t *bp, u_int len) ND_TCHECK(hp->hsrp_version); version = EXTRACT_U_1(hp->hsrp_version); - ND_PRINT((ndo, "HSRPv%u", version)); + ND_PRINT("HSRPv%u", version); if (version != 0) return; ND_TCHECK(hp->hsrp_op_code); - ND_PRINT((ndo, "-")); - ND_PRINT((ndo, "%s ", tok2strary(op_code_str, "unknown (%u)", EXTRACT_U_1(hp->hsrp_op_code)))); - ND_PRINT((ndo, "%u: ", len)); + ND_PRINT("-"); + ND_PRINT("%s ", tok2strary(op_code_str, "unknown (%u)", EXTRACT_U_1(hp->hsrp_op_code))); + ND_PRINT("%u: ", len); ND_TCHECK(hp->hsrp_state); - ND_PRINT((ndo, "state=%s ", tok2str(states, "Unknown (%u)", EXTRACT_U_1(hp->hsrp_state)))); + ND_PRINT("state=%s ", tok2str(states, "Unknown (%u)", EXTRACT_U_1(hp->hsrp_state))); ND_TCHECK(hp->hsrp_group); - ND_PRINT((ndo, "group=%u ", EXTRACT_U_1(hp->hsrp_group))); + ND_PRINT("group=%u ", EXTRACT_U_1(hp->hsrp_group)); ND_TCHECK(hp->hsrp_reserved); if (EXTRACT_U_1(hp->hsrp_reserved) != 0) { - ND_PRINT((ndo, "[reserved=%u!] ", EXTRACT_U_1(hp->hsrp_reserved))); + ND_PRINT("[reserved=%u!] ", EXTRACT_U_1(hp->hsrp_reserved)); } ND_TCHECK(hp->hsrp_virtaddr); - ND_PRINT((ndo, "addr=%s", ipaddr_string(ndo, &hp->hsrp_virtaddr))); + ND_PRINT("addr=%s", ipaddr_string(ndo, &hp->hsrp_virtaddr)); if (ndo->ndo_vflag) { - ND_PRINT((ndo, " hellotime=")); + ND_PRINT(" hellotime="); unsigned_relts_print(ndo, EXTRACT_U_1(hp->hsrp_hellotime)); - ND_PRINT((ndo, " holdtime=")); + ND_PRINT(" holdtime="); unsigned_relts_print(ndo, EXTRACT_U_1(hp->hsrp_holdtime)); - ND_PRINT((ndo, " priority=%u", EXTRACT_U_1(hp->hsrp_priority))); - ND_PRINT((ndo, " auth=\"")); + ND_PRINT(" priority=%u", EXTRACT_U_1(hp->hsrp_priority)); + ND_PRINT(" auth=\""); if (fn_printn(ndo, hp->hsrp_authdata, sizeof(hp->hsrp_authdata), ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); goto trunc; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); } return; trunc: - ND_PRINT((ndo, "[|hsrp]")); + ND_PRINT("[|hsrp]"); } diff --git a/print-icmp.c b/print-icmp.c index 63d823f0..e52f2710 100644 --- a/print-icmp.c +++ b/print-icmp.c @@ -560,7 +560,7 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * str = tok2str(icmp2str, "type-#%d", icmp_type); break; } - ND_PRINT((ndo, "ICMP %s, length %u", str, plen)); + ND_PRINT("ICMP %s, length %u", str, plen); if (ndo->ndo_vflag && !fragmented) { /* don't attempt checksumming if this is a frag */ if (ND_TTEST_LEN(bp, plen)) { uint16_t sum; @@ -570,9 +570,9 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * sum = in_cksum(vec, 1); if (sum != 0) { uint16_t icmp_sum = EXTRACT_BE_U_2(dp->icmp_cksum); - ND_PRINT((ndo, " (wrong icmp cksum %x (->%x)!)", + ND_PRINT(" (wrong icmp cksum %x (->%x)!)", icmp_sum, - in_cksum_shouldbe(icmp_sum, sum))); + in_cksum_shouldbe(icmp_sum, sum)); } } } @@ -583,7 +583,7 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * */ if (ndo->ndo_vflag >= 1 && ICMP_ERRTYPE(icmp_type)) { bp += 8; - ND_PRINT((ndo, "\n\t")); + ND_PRINT("\n\t"); ip = (const struct ip *)bp; snapend_save = ndo->ndo_snapend; ND_TCHECK_2(ip->ip_len); @@ -613,15 +613,15 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * } } - ND_PRINT((ndo, "\n\tMPLS extension v%u", - ICMP_MPLS_EXT_EXTRACT_VERSION(*(ext_dp->icmp_ext_version_res)))); + ND_PRINT("\n\tMPLS extension v%u", + ICMP_MPLS_EXT_EXTRACT_VERSION(*(ext_dp->icmp_ext_version_res))); /* * Sanity checking of the header. */ if (ICMP_MPLS_EXT_EXTRACT_VERSION(*(ext_dp->icmp_ext_version_res)) != ICMP_MPLS_EXT_VERSION) { - ND_PRINT((ndo, " packet not supported")); + ND_PRINT(" packet not supported"); return; } @@ -629,10 +629,10 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * if (ND_TTEST_LEN(ext_dp->icmp_ext_version_res, hlen)) { vec[0].ptr = (const uint8_t *)(const void *)&ext_dp->icmp_ext_version_res; vec[0].len = hlen; - ND_PRINT((ndo, ", checksum 0x%04x (%scorrect), length %u", + ND_PRINT(", checksum 0x%04x (%scorrect), length %u", EXTRACT_BE_U_2(ext_dp->icmp_ext_checksum), in_cksum(vec, 1) ? "in" : "", - hlen)); + hlen); } hlen -= 4; /* subtract common header size */ @@ -647,11 +647,11 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * obj_ctype = EXTRACT_U_1(icmp_mpls_ext_object_header->ctype); obj_tptr += sizeof(struct icmp_mpls_ext_object_header_t); - ND_PRINT((ndo, "\n\t %s Object (%u), Class-Type: %u, length %u", + ND_PRINT("\n\t %s Object (%u), Class-Type: %u, length %u", tok2str(icmp_mpls_ext_obj_values,"unknown",obj_class_num), obj_class_num, obj_ctype, - obj_tlen)); + obj_tlen); hlen-=sizeof(struct icmp_mpls_ext_object_header_t); /* length field includes tlv header */ @@ -668,10 +668,10 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * case 1: ND_TCHECK_4(obj_tptr); raw_label = EXTRACT_BE_U_4(obj_tptr); - ND_PRINT((ndo, "\n\t label %u, exp %u", MPLS_LABEL(raw_label), MPLS_EXP(raw_label))); + ND_PRINT("\n\t label %u, exp %u", MPLS_LABEL(raw_label), MPLS_EXP(raw_label)); if (MPLS_STACK(raw_label)) - ND_PRINT((ndo, ", [S]")); - ND_PRINT((ndo, ", ttl %u", MPLS_TTL(raw_label))); + ND_PRINT(", [S]"); + ND_PRINT(", ttl %u", MPLS_TTL(raw_label)); break; default: print_unknown_data(ndo, obj_tptr, "\n\t ", obj_tlen); @@ -696,7 +696,7 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char * return; trunc: - ND_PRINT((ndo, "[|icmp]")); + ND_PRINT("[|icmp]"); } /* * Local Variables: diff --git a/print-icmp6.c b/print-icmp6.c index a0db5bbc..0633372f 100644 --- a/print-icmp6.c +++ b/print-icmp6.c @@ -769,8 +769,8 @@ print_lladdr(netdissect_options *ndo, const uint8_t *p, size_t l) ep = p + l; while (l > 0 && q < ep) { if (q > p) - ND_PRINT((ndo,":")); - ND_PRINT((ndo,"%02x", EXTRACT_U_1(q))); + ND_PRINT(":"); + ND_PRINT("%02x", EXTRACT_U_1(q)); q++; l--; } @@ -817,14 +817,14 @@ rpl_printopts(netdissect_options *ndo, const uint8_t *opts, u_int length) dio_type = EXTRACT_U_1(opt->rpl_dio_type); if (dio_type == RPL_OPT_PAD1) { optlen = 1; - ND_PRINT((ndo, " opt:pad1")); + ND_PRINT(" opt:pad1"); } else { if (length < RPL_GENOPTION_LEN) goto trunc; optlen = EXTRACT_U_1(opt->rpl_dio_len)+RPL_GENOPTION_LEN; - ND_PRINT((ndo, " opt:%s len:%u ", + ND_PRINT(" opt:%s len:%u ", tok2str(rpl_subopt_values, "subopt:%u", dio_type), - optlen)); + optlen); ND_TCHECK_LEN(opt, optlen); if (length < optlen) goto trunc; @@ -840,7 +840,7 @@ rpl_printopts(netdissect_options *ndo, const uint8_t *opts, u_int length) } return; trunc: - ND_PRINT((ndo," [|truncated]")); + ND_PRINT(" [|truncated]"); return; } @@ -854,14 +854,14 @@ rpl_dio_print(netdissect_options *ndo, ND_TCHECK_SIZE(dio); dagid_str = ip6addr_string (ndo, dio->rpl_dagid); - ND_PRINT((ndo, " [dagid:%s,seq:%u,instance:%u,rank:%u,%smop:%s,prf:%u]", + ND_PRINT(" [dagid:%s,seq:%u,instance:%u,rank:%u,%smop:%s,prf:%u]", dagid_str, EXTRACT_U_1(dio->rpl_dtsn), EXTRACT_U_1(dio->rpl_instanceid), EXTRACT_BE_U_2(dio->rpl_dagrank), RPL_DIO_GROUNDED(EXTRACT_U_1(dio->rpl_mopprf)) ? "grounded,":"", tok2str(rpl_mop_values, "mop%u", RPL_DIO_MOP(EXTRACT_U_1(dio->rpl_mopprf))), - RPL_DIO_PRF(EXTRACT_U_1(dio->rpl_mopprf)))); + RPL_DIO_PRF(EXTRACT_U_1(dio->rpl_mopprf))); if(ndo->ndo_vflag > 1) { rpl_printopts(ndo, bp + sizeof(struct nd_rpl_dio), @@ -869,7 +869,7 @@ rpl_dio_print(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo," [|truncated]")); + ND_PRINT(" [|truncated]"); return; } @@ -897,13 +897,13 @@ rpl_dao_print(netdissect_options *ndo, length -= DAGID_LEN; } - ND_PRINT((ndo, " [dagid:%s,seq:%u,instance:%u%s%s,%02x]", + ND_PRINT(" [dagid:%s,seq:%u,instance:%u%s%s,%02x]", dagid_str, EXTRACT_U_1(dao->rpl_daoseq), EXTRACT_U_1(dao->rpl_instanceid), RPL_DAO_K(rpl_flags) ? ",acK":"", RPL_DAO_D(rpl_flags) ? ",Dagid":"", - rpl_flags)); + rpl_flags); if(ndo->ndo_vflag > 1) { rpl_printopts(ndo, bp, length); @@ -911,11 +911,11 @@ rpl_dao_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo," [|truncated]")); + ND_PRINT(" [|truncated]"); return; tooshort: - ND_PRINT((ndo," [|length too short]")); + ND_PRINT(" [|length too short]"); return; } @@ -941,11 +941,11 @@ rpl_daoack_print(netdissect_options *ndo, length -= DAGID_LEN; } - ND_PRINT((ndo, " [dagid:%s,seq:%u,instance:%u,status:%u]", + ND_PRINT(" [dagid:%s,seq:%u,instance:%u,status:%u]", dagid_str, EXTRACT_U_1(daoack->rpl_daoseq), EXTRACT_U_1(daoack->rpl_instanceid), - EXTRACT_U_1(daoack->rpl_status))); + EXTRACT_U_1(daoack->rpl_status)); /* no officially defined options for DAOACK, but print any we find */ if(ndo->ndo_vflag > 1) { @@ -954,11 +954,11 @@ rpl_daoack_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo," [|dao-truncated]")); + ND_PRINT(" [|dao-truncated]"); return; tooshort: - ND_PRINT((ndo," [|dao-length too short]")); + ND_PRINT(" [|dao-length too short]"); return; } @@ -971,49 +971,49 @@ rpl_print(netdissect_options *ndo, int basecode= icmp6_code & 0x7f; if(secured) { - ND_PRINT((ndo, ", (SEC) [worktodo]")); + ND_PRINT(", (SEC) [worktodo]"); /* XXX * the next header pointer needs to move forward to * skip the secure part. */ return; } else { - ND_PRINT((ndo, ", (CLR)")); + ND_PRINT(", (CLR)"); } switch(basecode) { case ND_RPL_DAG_IS: - ND_PRINT((ndo, "DODAG Information Solicitation")); + ND_PRINT("DODAG Information Solicitation"); if(ndo->ndo_vflag) { } break; case ND_RPL_DAG_IO: - ND_PRINT((ndo, "DODAG Information Object")); + ND_PRINT("DODAG Information Object"); if(ndo->ndo_vflag) { rpl_dio_print(ndo, bp, length); } break; case ND_RPL_DAO: - ND_PRINT((ndo, "Destination Advertisement Object")); + ND_PRINT("Destination Advertisement Object"); if(ndo->ndo_vflag) { rpl_dao_print(ndo, bp, length); } break; case ND_RPL_DAO_ACK: - ND_PRINT((ndo, "Destination Advertisement Object Ack")); + ND_PRINT("Destination Advertisement Object Ack"); if(ndo->ndo_vflag) { rpl_daoack_print(ndo, bp, length); } break; default: - ND_PRINT((ndo, "RPL message, unknown code %u",icmp6_code)); + ND_PRINT("RPL message, unknown code %u",icmp6_code); break; } return; #if 0 trunc: - ND_PRINT((ndo," [|truncated]")); + ND_PRINT(" [|truncated]"); return; #endif @@ -1047,17 +1047,17 @@ icmp6_print(netdissect_options *ndo, udp_sum = EXTRACT_BE_U_2(dp->icmp6_cksum); sum = icmp6_cksum(ndo, ip, dp, length); if (sum != 0) - ND_PRINT((ndo,"[bad icmp6 cksum 0x%04x -> 0x%04x!] ", + ND_PRINT("[bad icmp6 cksum 0x%04x -> 0x%04x!] ", udp_sum, - in_cksum_shouldbe(udp_sum, sum))); + in_cksum_shouldbe(udp_sum, sum)); else - ND_PRINT((ndo,"[icmp6 sum ok] ")); + ND_PRINT("[icmp6 sum ok] "); } } ND_TCHECK_1(dp->icmp6_type); icmp6_type = EXTRACT_U_1(dp->icmp6_type); - ND_PRINT((ndo,"ICMP6, %s", tok2str(icmp6_type_values,"unknown icmp6 type (%u)",icmp6_type))); + ND_PRINT("ICMP6, %s", tok2str(icmp6_type_values,"unknown icmp6 type (%u)",icmp6_type)); /* display cosmetics: print the packet length for printer that use the vflag now */ if (ndo->ndo_vflag && (icmp6_type == ND_ROUTER_SOLICIT || @@ -1067,7 +1067,7 @@ icmp6_print(netdissect_options *ndo, icmp6_type == ND_REDIRECT || icmp6_type == ICMP6_HADISCOV_REPLY || icmp6_type == ICMP6_MOBILEPREFIX_ADVERT )) - ND_PRINT((ndo,", length %u", length)); + ND_PRINT(", length %u", length); ND_TCHECK_1(dp->icmp6_code); icmp6_code = EXTRACT_U_1(dp->icmp6_code); @@ -1075,18 +1075,18 @@ icmp6_print(netdissect_options *ndo, switch (icmp6_type) { case ICMP6_DST_UNREACH: ND_TCHECK(oip->ip6_dst); - ND_PRINT((ndo,", %s", tok2str(icmp6_dst_unreach_code_values,"unknown unreach code (%u)",icmp6_code))); + ND_PRINT(", %s", tok2str(icmp6_dst_unreach_code_values,"unknown unreach code (%u)",icmp6_code)); switch (icmp6_code) { case ICMP6_DST_UNREACH_NOROUTE: /* fall through */ case ICMP6_DST_UNREACH_ADMIN: case ICMP6_DST_UNREACH_ADDR: - ND_PRINT((ndo," %s",ip6addr_string(ndo, &oip->ip6_dst))); + ND_PRINT(" %s",ip6addr_string(ndo, &oip->ip6_dst)); break; case ICMP6_DST_UNREACH_BEYONDSCOPE: - ND_PRINT((ndo," %s, source address %s", + ND_PRINT(" %s, source address %s", ip6addr_string(ndo, &oip->ip6_dst), - ip6addr_string(ndo, &oip->ip6_src))); + ip6addr_string(ndo, &oip->ip6_src)); break; case ICMP6_DST_UNREACH_NOPORT: if ((ouh = get_upperlayer(ndo, (const u_char *)oip, &prot)) @@ -1096,19 +1096,19 @@ icmp6_print(netdissect_options *ndo, dport = EXTRACT_BE_U_2(ouh->uh_dport); switch (prot) { case IPPROTO_TCP: - ND_PRINT((ndo,", %s tcp port %s", + ND_PRINT(", %s tcp port %s", ip6addr_string(ndo, &oip->ip6_dst), - tcpport_string(ndo, dport))); + tcpport_string(ndo, dport)); break; case IPPROTO_UDP: - ND_PRINT((ndo,", %s udp port %s", + ND_PRINT(", %s udp port %s", ip6addr_string(ndo, &oip->ip6_dst), - udpport_string(ndo, dport))); + udpport_string(ndo, dport)); break; default: - ND_PRINT((ndo,", %s protocol %u port %u unreachable", + ND_PRINT(", %s protocol %u port %u unreachable", ip6addr_string(ndo, &oip->ip6_dst), - prot, dport)); + prot, dport); break; } break; @@ -1122,20 +1122,20 @@ icmp6_print(netdissect_options *ndo, break; case ICMP6_PACKET_TOO_BIG: ND_TCHECK_4(dp->icmp6_mtu); - ND_PRINT((ndo,", mtu %u", EXTRACT_BE_U_4(dp->icmp6_mtu))); + ND_PRINT(", mtu %u", EXTRACT_BE_U_4(dp->icmp6_mtu)); break; case ICMP6_TIME_EXCEEDED: ND_TCHECK(oip->ip6_dst); switch (icmp6_code) { case ICMP6_TIME_EXCEED_TRANSIT: - ND_PRINT((ndo," for %s", - ip6addr_string(ndo, &oip->ip6_dst))); + ND_PRINT(" for %s", + ip6addr_string(ndo, &oip->ip6_dst)); break; case ICMP6_TIME_EXCEED_REASSEMBLY: - ND_PRINT((ndo," (reassembly)")); + ND_PRINT(" (reassembly)"); break; default: - ND_PRINT((ndo,", unknown code (%u)", icmp6_code)); + ND_PRINT(", unknown code (%u)", icmp6_code); break; } break; @@ -1143,33 +1143,33 @@ icmp6_print(netdissect_options *ndo, ND_TCHECK(oip->ip6_dst); switch (icmp6_code) { case ICMP6_PARAMPROB_HEADER: - ND_PRINT((ndo,", erroneous - octet %u", EXTRACT_BE_U_4(dp->icmp6_pptr))); + ND_PRINT(", erroneous - octet %u", EXTRACT_BE_U_4(dp->icmp6_pptr)); break; case ICMP6_PARAMPROB_NEXTHEADER: - ND_PRINT((ndo,", next header - octet %u", EXTRACT_BE_U_4(dp->icmp6_pptr))); + ND_PRINT(", next header - octet %u", EXTRACT_BE_U_4(dp->icmp6_pptr)); break; case ICMP6_PARAMPROB_OPTION: - ND_PRINT((ndo,", option - octet %u", EXTRACT_BE_U_4(dp->icmp6_pptr))); + ND_PRINT(", option - octet %u", EXTRACT_BE_U_4(dp->icmp6_pptr)); break; default: - ND_PRINT((ndo,", code-#%u", - icmp6_code)); + ND_PRINT(", code-#%u", + icmp6_code); break; } break; case ICMP6_ECHO_REQUEST: case ICMP6_ECHO_REPLY: ND_TCHECK_2(dp->icmp6_seq); - ND_PRINT((ndo,", seq %u", EXTRACT_BE_U_2(dp->icmp6_seq))); + ND_PRINT(", seq %u", EXTRACT_BE_U_2(dp->icmp6_seq)); break; case ICMP6_MEMBERSHIP_QUERY: if (length == MLD_MINLEN) { mld6_print(ndo, (const u_char *)dp); } else if (length >= MLDV2_MINLEN) { - ND_PRINT((ndo," v2")); + ND_PRINT(" v2"); mldv2_query_print(ndo, (const u_char *)dp, length); } else { - ND_PRINT((ndo," unknown-version (len %u) ", length)); + ND_PRINT(" unknown-version (len %u) ", length); } break; case ICMP6_MEMBERSHIP_REPORT: @@ -1192,14 +1192,14 @@ icmp6_print(netdissect_options *ndo, p = (const struct nd_router_advert *)dp; ND_TCHECK(p->nd_ra_retransmit); - ND_PRINT((ndo,"\n\thop limit %u, Flags [%s]" + ND_PRINT("\n\thop limit %u, Flags [%s]" ", pref %s, router lifetime %us, reachable time %us, retrans time %us", EXTRACT_U_1(p->nd_ra_curhoplimit), bittok2str(icmp6_opt_ra_flag_values,"none",EXTRACT_U_1(p->nd_ra_flags_reserved)), get_rtpref(EXTRACT_U_1(p->nd_ra_flags_reserved)), EXTRACT_BE_U_2(p->nd_ra_router_lifetime), EXTRACT_BE_U_4(p->nd_ra_reachable), - EXTRACT_BE_U_4(p->nd_ra_retransmit))); + EXTRACT_BE_U_4(p->nd_ra_retransmit)); icmp6_opt_print(ndo, (const u_char *)dp + RTADVLEN, length - RTADVLEN); @@ -1210,7 +1210,7 @@ icmp6_print(netdissect_options *ndo, const struct nd_neighbor_solicit *p; p = (const struct nd_neighbor_solicit *)dp; ND_TCHECK(p->nd_ns_target); - ND_PRINT((ndo,", who has %s", ip6addr_string(ndo, &p->nd_ns_target))); + ND_PRINT(", who has %s", ip6addr_string(ndo, &p->nd_ns_target)); if (ndo->ndo_vflag) { #define NDSOLLEN 24 icmp6_opt_print(ndo, (const u_char *)dp + NDSOLLEN, @@ -1224,13 +1224,13 @@ icmp6_print(netdissect_options *ndo, p = (const struct nd_neighbor_advert *)dp; ND_TCHECK(p->nd_na_target); - ND_PRINT((ndo,", tgt is %s", - ip6addr_string(ndo, &p->nd_na_target))); + ND_PRINT(", tgt is %s", + ip6addr_string(ndo, &p->nd_na_target)); if (ndo->ndo_vflag) { - ND_PRINT((ndo,", Flags [%s]", + ND_PRINT(", Flags [%s]", bittok2str(icmp6_nd_na_flag_values, "none", - EXTRACT_BE_U_4(p->nd_na_flags_reserved)))); + EXTRACT_BE_U_4(p->nd_na_flags_reserved))); #define NDADVLEN 24 icmp6_opt_print(ndo, (const u_char *)dp + NDADVLEN, length - NDADVLEN); @@ -1241,10 +1241,10 @@ icmp6_print(netdissect_options *ndo, case ND_REDIRECT: #define RDR(i) ((const struct nd_redirect *)(i)) ND_TCHECK(RDR(dp)->nd_rd_dst); - ND_PRINT((ndo,", %s", ip6addr_string(ndo, &RDR(dp)->nd_rd_dst))); + ND_PRINT(", %s", ip6addr_string(ndo, &RDR(dp)->nd_rd_dst)); ND_TCHECK(RDR(dp)->nd_rd_target); - ND_PRINT((ndo," to %s", - ip6addr_string(ndo, &RDR(dp)->nd_rd_target))); + ND_PRINT(" to %s", + ip6addr_string(ndo, &RDR(dp)->nd_rd_target)); #define REDIRECTLEN 40 if (ndo->ndo_vflag) { icmp6_opt_print(ndo, (const u_char *)dp + REDIRECTLEN, @@ -1269,7 +1269,7 @@ icmp6_print(netdissect_options *ndo, case ICMP6_MOBILEPREFIX_SOLICIT: /* fall through */ case ICMP6_HADISCOV_REQUEST: ND_TCHECK(dp->icmp6_data16[0]); - ND_PRINT((ndo,", id 0x%04x", EXTRACT_BE_U_2(&dp->icmp6_data16[0]))); + ND_PRINT(", id 0x%04x", EXTRACT_BE_U_2(&dp->icmp6_data16[0])); break; case ICMP6_HADISCOV_REPLY: if (ndo->ndo_vflag) { @@ -1277,12 +1277,12 @@ icmp6_print(netdissect_options *ndo, const u_char *cp; ND_TCHECK(dp->icmp6_data16[0]); - ND_PRINT((ndo,", id 0x%04x", EXTRACT_BE_U_2(&dp->icmp6_data16[0]))); + ND_PRINT(", id 0x%04x", EXTRACT_BE_U_2(&dp->icmp6_data16[0])); cp = (const u_char *)dp + length; in6 = (const struct in6_addr *)(dp + 1); for (; (const u_char *)in6 < cp; in6++) { ND_TCHECK_SIZE(in6); - ND_PRINT((ndo,", %s", ip6addr_string(ndo, in6))); + ND_PRINT(", %s", ip6addr_string(ndo, in6)); } } break; @@ -1291,15 +1291,15 @@ icmp6_print(netdissect_options *ndo, uint16_t flags; ND_TCHECK_2(dp->icmp6_data16[0]); - ND_PRINT((ndo,", id 0x%04x", EXTRACT_BE_U_2(dp->icmp6_data16[0]))); + ND_PRINT(", id 0x%04x", EXTRACT_BE_U_2(dp->icmp6_data16[0])); ND_TCHECK_2(dp->icmp6_data16[1]); flags = EXTRACT_BE_U_2(dp->icmp6_data16[1]); if (flags & 0xc000) - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (flags & 0x8000) - ND_PRINT((ndo,"M")); + ND_PRINT("M"); if (flags & 0x4000) - ND_PRINT((ndo,"O")); + ND_PRINT("O"); #define MPADVLEN 8 icmp6_opt_print(ndo, (const u_char *)dp + MPADVLEN, length - MPADVLEN); @@ -1310,16 +1310,16 @@ icmp6_print(netdissect_options *ndo, rpl_print(ndo, icmp6_code, dp->icmp6_data, length-sizeof(struct icmp6_hdr)+4); break; default: - ND_PRINT((ndo,", length %u", length)); + ND_PRINT(", length %u", length); if (ndo->ndo_vflag <= 1) print_unknown_data(ndo, bp,"\n\t", length); return; } if (!ndo->ndo_vflag) - ND_PRINT((ndo,", length %u", length)); + ND_PRINT(", length %u", length); return; trunc: - ND_PRINT((ndo, "[|icmp6]")); + ND_PRINT("[|icmp6]"); } static const struct udphdr * @@ -1433,11 +1433,11 @@ icmp6_opt_print(netdissect_options *ndo, const u_char *bp, int resid) if (cp + (opt_len << 3) > ep) goto trunc; - ND_PRINT((ndo,"\n\t %s option (%u), length %u (%u): ", + ND_PRINT("\n\t %s option (%u), length %u (%u): ", tok2str(icmp6_opt_values, "unknown", opt_type), opt_type, opt_len << 3, - opt_len)); + opt_len); switch (opt_type) { case ND_OPT_SOURCE_LINKADDR: @@ -1451,13 +1451,13 @@ icmp6_opt_print(netdissect_options *ndo, const u_char *bp, int resid) case ND_OPT_PREFIX_INFORMATION: opp = (const struct nd_opt_prefix_info *)op; ND_TCHECK(opp->nd_opt_pi_prefix); - ND_PRINT((ndo,"%s/%u%s, Flags [%s], valid time %s", + ND_PRINT("%s/%u%s, Flags [%s], valid time %s", ip6addr_string(ndo, &opp->nd_opt_pi_prefix), EXTRACT_U_1(opp->nd_opt_pi_prefix_len), (opt_len != 4) ? "badlen" : "", bittok2str(icmp6_opt_pi_flag_values, "none", EXTRACT_U_1(opp->nd_opt_pi_flags_reserved)), - get_lifetime(EXTRACT_BE_U_4(opp->nd_opt_pi_valid_time)))); - ND_PRINT((ndo,", pref. time %s", get_lifetime(EXTRACT_BE_U_4(opp->nd_opt_pi_preferred_time)))); + get_lifetime(EXTRACT_BE_U_4(opp->nd_opt_pi_valid_time))); + ND_PRINT(", pref. time %s", get_lifetime(EXTRACT_BE_U_4(opp->nd_opt_pi_preferred_time))); break; case ND_OPT_REDIRECTED_HEADER: print_unknown_data(ndo, bp,"\n\t ",opt_len<<3); @@ -1466,29 +1466,29 @@ icmp6_opt_print(netdissect_options *ndo, const u_char *bp, int resid) case ND_OPT_MTU: opm = (const struct nd_opt_mtu *)op; ND_TCHECK(opm->nd_opt_mtu_mtu); - ND_PRINT((ndo," %u%s", + ND_PRINT(" %u%s", EXTRACT_BE_U_4(opm->nd_opt_mtu_mtu), - (opt_len != 1) ? "bad option length" : "" )); + (opt_len != 1) ? "bad option length" : "" ); break; case ND_OPT_RDNSS: oprd = (const struct nd_opt_rdnss *)op; l = (opt_len - 1) / 2; - ND_PRINT((ndo," lifetime %us,", - EXTRACT_BE_U_4(oprd->nd_opt_rdnss_lifetime))); + ND_PRINT(" lifetime %us,", + EXTRACT_BE_U_4(oprd->nd_opt_rdnss_lifetime)); for (i = 0; i < l; i++) { ND_TCHECK(oprd->nd_opt_rdnss_addr[i]); - ND_PRINT((ndo," addr: %s", - ip6addr_string(ndo, &oprd->nd_opt_rdnss_addr[i]))); + ND_PRINT(" addr: %s", + ip6addr_string(ndo, &oprd->nd_opt_rdnss_addr[i])); } break; case ND_OPT_DNSSL: opds = (const struct nd_opt_dnssl *)op; - ND_PRINT((ndo," lifetime %us, domain(s):", - EXTRACT_BE_U_4(opds->nd_opt_dnssl_lifetime))); + ND_PRINT(" lifetime %us, domain(s):", + EXTRACT_BE_U_4(opds->nd_opt_dnssl_lifetime)); domp = cp + 8; /* domain names, variable-sized, RFC1035-encoded */ while (domp < cp + (opt_len << 3) && EXTRACT_U_1(domp) != '\0') { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if ((domp = ns_nprint (ndo, domp, bp)) == NULL) goto trunc; } @@ -1496,14 +1496,14 @@ icmp6_opt_print(netdissect_options *ndo, const u_char *bp, int resid) case ND_OPT_ADVINTERVAL: opa = (const struct nd_opt_advinterval *)op; ND_TCHECK(opa->nd_opt_adv_interval); - ND_PRINT((ndo," %ums", EXTRACT_BE_U_4(opa->nd_opt_adv_interval))); + ND_PRINT(" %ums", EXTRACT_BE_U_4(opa->nd_opt_adv_interval)); break; case ND_OPT_HOMEAGENT_INFO: oph = (const struct nd_opt_homeagent_info *)op; ND_TCHECK(oph->nd_opt_hai_lifetime); - ND_PRINT((ndo," preference %u, lifetime %u", + ND_PRINT(" preference %u, lifetime %u", EXTRACT_BE_U_2(oph->nd_opt_hai_preference), - EXTRACT_BE_U_2(oph->nd_opt_hai_lifetime))); + EXTRACT_BE_U_2(oph->nd_opt_hai_lifetime)); break; case ND_OPT_ROUTE_INFO: opri = (const struct nd_opt_route_info *)op; @@ -1524,11 +1524,11 @@ icmp6_opt_print(netdissect_options *ndo, const u_char *bp, int resid) default: goto trunc; } - ND_PRINT((ndo," %s/%u", ip6addr_string(ndo, &in6), - EXTRACT_U_1(opri->nd_opt_rti_prefixlen))); - ND_PRINT((ndo,", pref=%s", get_rtpref(EXTRACT_U_1(opri->nd_opt_rti_flags)))); - ND_PRINT((ndo,", lifetime=%s", - get_lifetime(EXTRACT_BE_U_4(opri->nd_opt_rti_lifetime)))); + ND_PRINT(" %s/%u", ip6addr_string(ndo, &in6), + EXTRACT_U_1(opri->nd_opt_rti_prefixlen)); + ND_PRINT(", pref=%s", get_rtpref(EXTRACT_U_1(opri->nd_opt_rti_flags))); + ND_PRINT(", lifetime=%s", + get_lifetime(EXTRACT_BE_U_4(opri->nd_opt_rti_lifetime))); break; default: if (ndo->ndo_vflag <= 1) { @@ -1547,7 +1547,7 @@ icmp6_opt_print(netdissect_options *ndo, const u_char *bp, int resid) return; trunc: - ND_PRINT((ndo, "[ndp opt]")); + ND_PRINT("[ndp opt]"); return; #undef ECHECK } @@ -1564,8 +1564,8 @@ mld6_print(netdissect_options *ndo, const u_char *bp) if ((const u_char *)mp + sizeof(*mp) > ep) return; - ND_PRINT((ndo,"max resp delay: %d ", EXTRACT_BE_U_2(mp->mld6_maxdelay))); - ND_PRINT((ndo,"addr: %s", ip6addr_string(ndo, &mp->mld6_addr))); + ND_PRINT("max resp delay: %d ", EXTRACT_BE_U_2(mp->mld6_maxdelay)); + ND_PRINT("addr: %s", ip6addr_string(ndo, &mp->mld6_addr)); } static void @@ -1577,52 +1577,52 @@ mldv2_report_print(netdissect_options *ndo, const u_char *bp, u_int len) /* Minimum len is 8 */ if (len < 8) { - ND_PRINT((ndo," [invalid len %u]", len)); + ND_PRINT(" [invalid len %u]", len); return; } ND_TCHECK(icp->icmp6_data16[1]); ngroups = EXTRACT_BE_U_2(&icp->icmp6_data16[1]); - ND_PRINT((ndo,", %u group record(s)", ngroups)); + ND_PRINT(", %u group record(s)", ngroups); if (ndo->ndo_vflag > 0) { /* Print the group records */ group = 8; for (i = 0; i < ngroups; i++) { /* type(1) + auxlen(1) + numsrc(2) + grp(16) */ if (len < group + 20) { - ND_PRINT((ndo," [invalid number of groups]")); + ND_PRINT(" [invalid number of groups]"); return; } ND_TCHECK_LEN(bp + 4 + group, sizeof(struct in6_addr)); - ND_PRINT((ndo," [gaddr %s", ip6addr_string(ndo, bp + group + 4))); - ND_PRINT((ndo," %s", tok2str(mldv2report2str, " [v2-report-#%u]", - EXTRACT_U_1(bp + group)))); + ND_PRINT(" [gaddr %s", ip6addr_string(ndo, bp + group + 4)); + ND_PRINT(" %s", tok2str(mldv2report2str, " [v2-report-#%u]", + EXTRACT_U_1(bp + group))); nsrcs = EXTRACT_BE_U_2(bp + group + 2); /* Check the number of sources and print them */ if (len < group + 20 + (nsrcs * sizeof(struct in6_addr))) { - ND_PRINT((ndo," [invalid number of sources %u]", nsrcs)); + ND_PRINT(" [invalid number of sources %u]", nsrcs); return; } if (ndo->ndo_vflag == 1) - ND_PRINT((ndo,", %u source(s)", nsrcs)); + ND_PRINT(", %u source(s)", nsrcs); else { /* Print the sources */ - ND_PRINT((ndo," {")); + ND_PRINT(" {"); for (j = 0; j < nsrcs; j++) { ND_TCHECK_LEN(bp + group + 20 + (j * sizeof(struct in6_addr)), sizeof(struct in6_addr)); - ND_PRINT((ndo," %s", ip6addr_string(ndo, bp + group + 20 + (j * sizeof(struct in6_addr))))); + ND_PRINT(" %s", ip6addr_string(ndo, bp + group + 20 + (j * sizeof(struct in6_addr)))); } - ND_PRINT((ndo," }")); + ND_PRINT(" }"); } /* Next group record */ group += 20 + nsrcs * sizeof(struct in6_addr); - ND_PRINT((ndo,"]")); + ND_PRINT("]"); } } return; trunc: - ND_PRINT((ndo,"[|icmp6]")); + ND_PRINT("[|icmp6]"); return; } @@ -1637,7 +1637,7 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len) /* Minimum len is 28 */ if (len < 28) { - ND_PRINT((ndo," [invalid len %u]", len)); + ND_PRINT(" [invalid len %u]", len); return; } ND_TCHECK(icp->icmp6_data16[0]); @@ -1648,18 +1648,18 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len) mrt = ((mrc & 0x0fff) | 0x1000) << (((mrc & 0x7000) >> 12) + 3); } if (ndo->ndo_vflag) { - ND_PRINT((ndo," [max resp delay=%u]", mrt)); + ND_PRINT(" [max resp delay=%u]", mrt); } ND_TCHECK_LEN(bp + 8, sizeof(struct in6_addr)); - ND_PRINT((ndo," [gaddr %s", ip6addr_string(ndo, bp + 8))); + ND_PRINT(" [gaddr %s", ip6addr_string(ndo, bp + 8)); if (ndo->ndo_vflag) { ND_TCHECK_1(bp + 25); if (EXTRACT_U_1(bp + 24) & 0x08) { - ND_PRINT((ndo," sflag")); + ND_PRINT(" sflag"); } if (EXTRACT_U_1(bp + 24) & 0x07) { - ND_PRINT((ndo," robustness=%u", EXTRACT_U_1(bp + 24) & 0x07)); + ND_PRINT(" robustness=%u", EXTRACT_U_1(bp + 24) & 0x07); } if (EXTRACT_U_1(bp + 25) < 128) { qqi = EXTRACT_U_1(bp + 25); @@ -1667,29 +1667,29 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len) qqi = ((EXTRACT_U_1(bp + 25) & 0x0f) | 0x10) << (((EXTRACT_U_1(bp + 25) & 0x70) >> 4) + 3); } - ND_PRINT((ndo," qqi=%u", qqi)); + ND_PRINT(" qqi=%u", qqi); } ND_TCHECK_2(bp + 26); nsrcs = EXTRACT_BE_U_2(bp + 26); if (nsrcs > 0) { if (len < 28 + nsrcs * sizeof(struct in6_addr)) - ND_PRINT((ndo," [invalid number of sources]")); + ND_PRINT(" [invalid number of sources]"); else if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo," {")); + ND_PRINT(" {"); for (i = 0; i < nsrcs; i++) { ND_TCHECK_LEN(bp + 28 + (i * sizeof(struct in6_addr)), sizeof(struct in6_addr)); - ND_PRINT((ndo," %s", ip6addr_string(ndo, bp + 28 + (i * sizeof(struct in6_addr))))); + ND_PRINT(" %s", ip6addr_string(ndo, bp + 28 + (i * sizeof(struct in6_addr)))); } - ND_PRINT((ndo," }")); + ND_PRINT(" }"); } else - ND_PRINT((ndo,", %u source(s)", nsrcs)); + ND_PRINT(", %u source(s)", nsrcs); } - ND_PRINT((ndo,"]")); + ND_PRINT("]"); return; trunc: - ND_PRINT((ndo,"[|icmp6]")); + ND_PRINT("[|icmp6]"); return; } @@ -1699,13 +1699,13 @@ dnsname_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) int i; /* DNS name decoding - no decompression */ - ND_PRINT((ndo,", \"")); + ND_PRINT(", \""); while (cp < ep) { i = EXTRACT_U_1(cp); cp++; if (i) { if (i > ep - cp) { - ND_PRINT((ndo,"???")); + ND_PRINT("???"); break; } while (i-- && cp < ep) { @@ -1713,21 +1713,21 @@ dnsname_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) cp++; } if (cp + 1 < ep && EXTRACT_U_1(cp)) - ND_PRINT((ndo,".")); + ND_PRINT("."); } else { if (cp == ep) { /* FQDN */ - ND_PRINT((ndo,".")); + ND_PRINT("."); } else if (cp + 1 == ep && EXTRACT_U_1(cp) == '\0') { /* truncated */ } else { /* invalid */ - ND_PRINT((ndo,"???")); + ND_PRINT("???"); } break; } } - ND_PRINT((ndo,"\"")); + ND_PRINT("\""); } static void @@ -1749,43 +1749,43 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp, case ICMP6_NI_QUERY: if (siz == sizeof(*dp) + 4) { /* KAME who-are-you */ - ND_PRINT((ndo," who-are-you request")); + ND_PRINT(" who-are-you request"); break; } - ND_PRINT((ndo," node information query")); + ND_PRINT(" node information query"); ND_TCHECK_LEN(dp, sizeof(*ni6)); ni6 = (const struct icmp6_nodeinfo *)dp; - ND_PRINT((ndo," (")); /*)*/ + ND_PRINT(" ("); /*)*/ switch (EXTRACT_BE_U_2(ni6->ni_qtype)) { case NI_QTYPE_NOOP: - ND_PRINT((ndo,"noop")); + ND_PRINT("noop"); break; case NI_QTYPE_SUPTYPES: - ND_PRINT((ndo,"supported qtypes")); + ND_PRINT("supported qtypes"); i = EXTRACT_BE_U_2(ni6->ni_flags); if (i) - ND_PRINT((ndo," [%s]", (i & 0x01) ? "C" : "")); + ND_PRINT(" [%s]", (i & 0x01) ? "C" : ""); break; case NI_QTYPE_FQDN: - ND_PRINT((ndo,"DNS name")); + ND_PRINT("DNS name"); break; case NI_QTYPE_NODEADDR: - ND_PRINT((ndo,"node addresses")); + ND_PRINT("node addresses"); i = EXTRACT_BE_U_2(ni6->ni_flags); if (!i) break; /* NI_NODEADDR_FLAG_TRUNCATE undefined for query */ - ND_PRINT((ndo," [%s%s%s%s%s%s]", + ND_PRINT(" [%s%s%s%s%s%s]", (i & NI_NODEADDR_FLAG_ANYCAST) ? "a" : "", (i & NI_NODEADDR_FLAG_GLOBAL) ? "G" : "", (i & NI_NODEADDR_FLAG_SITELOCAL) ? "S" : "", (i & NI_NODEADDR_FLAG_LINKLOCAL) ? "L" : "", (i & NI_NODEADDR_FLAG_COMPAT) ? "C" : "", - (i & NI_NODEADDR_FLAG_ALL) ? "A" : "")); + (i & NI_NODEADDR_FLAG_ALL) ? "A" : ""); break; default: - ND_PRINT((ndo,"unknown")); + ND_PRINT("unknown"); break; } @@ -1793,18 +1793,18 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp, EXTRACT_BE_U_2(ni6->ni_qtype) == NI_QTYPE_SUPTYPES) { if (siz != sizeof(*ni6)) if (ndo->ndo_vflag) - ND_PRINT((ndo,", invalid len")); + ND_PRINT(", invalid len"); /*(*/ - ND_PRINT((ndo,")")); + ND_PRINT(")"); break; } /* XXX backward compat, icmp-name-lookup-03 */ if (siz == sizeof(*ni6)) { - ND_PRINT((ndo,", 03 draft")); + ND_PRINT(", 03 draft"); /*(*/ - ND_PRINT((ndo,")")); + ND_PRINT(")"); break; } @@ -1814,26 +1814,26 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp, break; if (siz != sizeof(*ni6) + sizeof(struct in6_addr)) { if (ndo->ndo_vflag) - ND_PRINT((ndo,", invalid subject len")); + ND_PRINT(", invalid subject len"); break; } - ND_PRINT((ndo,", subject=%s", - ip6addr_string(ndo, ni6 + 1))); + ND_PRINT(", subject=%s", + ip6addr_string(ndo, ni6 + 1)); break; case ICMP6_NI_SUBJ_FQDN: - ND_PRINT((ndo,", subject=DNS name")); + ND_PRINT(", subject=DNS name"); cp = (const u_char *)(ni6 + 1); if (EXTRACT_U_1(cp) == ep - cp - 1) { /* icmp-name-lookup-03, pascal string */ if (ndo->ndo_vflag) - ND_PRINT((ndo,", 03 draft")); + ND_PRINT(", 03 draft"); cp++; - ND_PRINT((ndo,", \"")); + ND_PRINT(", \""); while (cp < ep) { safeputchar(ndo, EXTRACT_U_1(cp)); cp++; } - ND_PRINT((ndo,"\"")); + ND_PRINT("\""); } else dnsname_print(ndo, cp, ep); break; @@ -1842,24 +1842,24 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp, break; if (siz != sizeof(*ni6) + sizeof(struct in_addr)) { if (ndo->ndo_vflag) - ND_PRINT((ndo,", invalid subject len")); + ND_PRINT(", invalid subject len"); break; } - ND_PRINT((ndo,", subject=%s", - ipaddr_string(ndo, ni6 + 1))); + ND_PRINT(", subject=%s", + ipaddr_string(ndo, ni6 + 1)); break; default: - ND_PRINT((ndo,", unknown subject")); + ND_PRINT(", unknown subject"); break; } /*(*/ - ND_PRINT((ndo,")")); + ND_PRINT(")"); break; case ICMP6_NI_REPLY: if (icmp6len > siz) { - ND_PRINT((ndo,"[|icmp6: node information reply]")); + ND_PRINT("[|icmp6: node information reply]"); break; } @@ -1867,116 +1867,116 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp, ND_TCHECK_LEN(dp, sizeof(*ni6)); ni6 = (const struct icmp6_nodeinfo *)dp; - ND_PRINT((ndo," node information reply")); - ND_PRINT((ndo," (")); /*)*/ + ND_PRINT(" node information reply"); + ND_PRINT(" ("); /*)*/ switch (EXTRACT_U_1(ni6->ni_code)) { case ICMP6_NI_SUCCESS: if (ndo->ndo_vflag) { - ND_PRINT((ndo,"success")); + ND_PRINT("success"); needcomma++; } break; case ICMP6_NI_REFUSED: - ND_PRINT((ndo,"refused")); + ND_PRINT("refused"); needcomma++; if (siz != sizeof(*ni6)) if (ndo->ndo_vflag) - ND_PRINT((ndo,", invalid length")); + ND_PRINT(", invalid length"); break; case ICMP6_NI_UNKNOWN: - ND_PRINT((ndo,"unknown")); + ND_PRINT("unknown"); needcomma++; if (siz != sizeof(*ni6)) if (ndo->ndo_vflag) - ND_PRINT((ndo,", invalid length")); + ND_PRINT(", invalid length"); break; } if (EXTRACT_U_1(ni6->ni_code) != ICMP6_NI_SUCCESS) { /*(*/ - ND_PRINT((ndo,")")); + ND_PRINT(")"); break; } switch (EXTRACT_BE_U_2(ni6->ni_qtype)) { case NI_QTYPE_NOOP: if (needcomma) - ND_PRINT((ndo,", ")); - ND_PRINT((ndo,"noop")); + ND_PRINT(", "); + ND_PRINT("noop"); if (siz != sizeof(*ni6)) if (ndo->ndo_vflag) - ND_PRINT((ndo,", invalid length")); + ND_PRINT(", invalid length"); break; case NI_QTYPE_SUPTYPES: if (needcomma) - ND_PRINT((ndo,", ")); - ND_PRINT((ndo,"supported qtypes")); + ND_PRINT(", "); + ND_PRINT("supported qtypes"); i = EXTRACT_BE_U_2(ni6->ni_flags); if (i) - ND_PRINT((ndo," [%s]", (i & 0x01) ? "C" : "")); + ND_PRINT(" [%s]", (i & 0x01) ? "C" : ""); break; case NI_QTYPE_FQDN: if (needcomma) - ND_PRINT((ndo,", ")); - ND_PRINT((ndo,"DNS name")); + ND_PRINT(", "); + ND_PRINT("DNS name"); cp = (const u_char *)(ni6 + 1) + 4; ND_TCHECK_1(cp); if (EXTRACT_U_1(cp) == ep - cp - 1) { /* icmp-name-lookup-03, pascal string */ if (ndo->ndo_vflag) - ND_PRINT((ndo,", 03 draft")); + ND_PRINT(", 03 draft"); cp++; - ND_PRINT((ndo,", \"")); + ND_PRINT(", \""); while (cp < ep) { safeputchar(ndo, EXTRACT_U_1(cp)); cp++; } - ND_PRINT((ndo,"\"")); + ND_PRINT("\""); } else dnsname_print(ndo, cp, ep); if ((EXTRACT_BE_U_2(ni6->ni_flags) & 0x01) != 0) - ND_PRINT((ndo," [TTL=%u]", EXTRACT_BE_U_4(ni6 + 1))); + ND_PRINT(" [TTL=%u]", EXTRACT_BE_U_4(ni6 + 1)); break; case NI_QTYPE_NODEADDR: if (needcomma) - ND_PRINT((ndo,", ")); - ND_PRINT((ndo,"node addresses")); + ND_PRINT(", "); + ND_PRINT("node addresses"); i = sizeof(*ni6); while (i < siz) { if (i + sizeof(uint32_t) + sizeof(struct in6_addr) > siz) break; - ND_PRINT((ndo," %s(%u)", + ND_PRINT(" %s(%u)", ip6addr_string(ndo, bp + i + sizeof(uint32_t)), - EXTRACT_BE_U_4(bp + i))); + EXTRACT_BE_U_4(bp + i)); i += sizeof(uint32_t) + sizeof(struct in6_addr); } i = EXTRACT_BE_U_2(ni6->ni_flags); if (!i) break; - ND_PRINT((ndo," [%s%s%s%s%s%s%s]", + ND_PRINT(" [%s%s%s%s%s%s%s]", (i & NI_NODEADDR_FLAG_ANYCAST) ? "a" : "", (i & NI_NODEADDR_FLAG_GLOBAL) ? "G" : "", (i & NI_NODEADDR_FLAG_SITELOCAL) ? "S" : "", (i & NI_NODEADDR_FLAG_LINKLOCAL) ? "L" : "", (i & NI_NODEADDR_FLAG_COMPAT) ? "C" : "", (i & NI_NODEADDR_FLAG_ALL) ? "A" : "", - (i & NI_NODEADDR_FLAG_TRUNCATE) ? "T" : "")); + (i & NI_NODEADDR_FLAG_TRUNCATE) ? "T" : ""); break; default: if (needcomma) - ND_PRINT((ndo,", ")); - ND_PRINT((ndo,"unknown")); + ND_PRINT(", "); + ND_PRINT("unknown"); break; } /*(*/ - ND_PRINT((ndo,")")); + ND_PRINT(")"); break; } return; trunc: - ND_PRINT((ndo, "[|icmp6]")); + ND_PRINT("[|icmp6]"); } static void @@ -1997,38 +1997,38 @@ icmp6_rrenum_print(netdissect_options *ndo, const u_char *bp, const u_char *ep) ND_TCHECK(rr6->rr_reserved); switch (EXTRACT_U_1(rr6->rr_code)) { case ICMP6_ROUTER_RENUMBERING_COMMAND: - ND_PRINT((ndo,"router renum: command")); + ND_PRINT("router renum: command"); break; case ICMP6_ROUTER_RENUMBERING_RESULT: - ND_PRINT((ndo,"router renum: result")); + ND_PRINT("router renum: result"); break; case ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET: - ND_PRINT((ndo,"router renum: sequence number reset")); + ND_PRINT("router renum: sequence number reset"); break; default: - ND_PRINT((ndo,"router renum: code-#%u", EXTRACT_U_1(rr6->rr_code))); + ND_PRINT("router renum: code-#%u", EXTRACT_U_1(rr6->rr_code)); break; } - ND_PRINT((ndo,", seq=%u", EXTRACT_BE_U_4(rr6->rr_seqnum))); + ND_PRINT(", seq=%u", EXTRACT_BE_U_4(rr6->rr_seqnum)); if (ndo->ndo_vflag) { uint8_t rr_flags = EXTRACT_U_1(rr6->rr_flags); #define F(x, y) (rr_flags & (x) ? (y) : "") - ND_PRINT((ndo,"[")); /*]*/ + ND_PRINT("["); /*]*/ if (rr_flags) { - ND_PRINT((ndo,"%s%s%s%s%s,", F(ICMP6_RR_FLAGS_TEST, "T"), + ND_PRINT("%s%s%s%s%s,", F(ICMP6_RR_FLAGS_TEST, "T"), F(ICMP6_RR_FLAGS_REQRESULT, "R"), F(ICMP6_RR_FLAGS_FORCEAPPLY, "A"), F(ICMP6_RR_FLAGS_SPECSITE, "S"), - F(ICMP6_RR_FLAGS_PREVDONE, "P"))); + F(ICMP6_RR_FLAGS_PREVDONE, "P")); } - ND_PRINT((ndo,"seg=%u,", EXTRACT_U_1(rr6->rr_segnum))); - ND_PRINT((ndo,"maxdelay=%u", EXTRACT_BE_U_2(rr6->rr_maxdelay))); + ND_PRINT("seg=%u,", EXTRACT_U_1(rr6->rr_segnum)); + ND_PRINT("maxdelay=%u", EXTRACT_BE_U_2(rr6->rr_maxdelay)); if (EXTRACT_BE_U_4(rr6->rr_reserved)) - ND_PRINT((ndo,"rsvd=0x%x", EXTRACT_BE_U_4(rr6->rr_reserved))); + ND_PRINT("rsvd=0x%x", EXTRACT_BE_U_4(rr6->rr_reserved)); /*[*/ - ND_PRINT((ndo,"]")); + ND_PRINT("]"); #undef F } @@ -2039,28 +2039,28 @@ icmp6_rrenum_print(netdissect_options *ndo, const u_char *bp, const u_char *ep) ND_TCHECK(match->rpm_prefix); if (ndo->ndo_vflag > 1) - ND_PRINT((ndo,"\n\t")); + ND_PRINT("\n\t"); else - ND_PRINT((ndo," ")); - ND_PRINT((ndo,"match(")); /*)*/ + ND_PRINT(" "); + ND_PRINT("match("); /*)*/ switch (EXTRACT_U_1(match->rpm_code)) { - case RPM_PCO_ADD: ND_PRINT((ndo,"add")); break; - case RPM_PCO_CHANGE: ND_PRINT((ndo,"change")); break; - case RPM_PCO_SETGLOBAL: ND_PRINT((ndo,"setglobal")); break; - default: ND_PRINT((ndo,"#%u", EXTRACT_U_1(match->rpm_code))); break; + case RPM_PCO_ADD: ND_PRINT("add"); break; + case RPM_PCO_CHANGE: ND_PRINT("change"); break; + case RPM_PCO_SETGLOBAL: ND_PRINT("setglobal"); break; + default: ND_PRINT("#%u", EXTRACT_U_1(match->rpm_code)); break; } if (ndo->ndo_vflag) { - ND_PRINT((ndo,",ord=%u", EXTRACT_U_1(match->rpm_ordinal))); - ND_PRINT((ndo,",min=%u", EXTRACT_U_1(match->rpm_minlen))); - ND_PRINT((ndo,",max=%u", EXTRACT_U_1(match->rpm_maxlen))); + ND_PRINT(",ord=%u", EXTRACT_U_1(match->rpm_ordinal)); + ND_PRINT(",min=%u", EXTRACT_U_1(match->rpm_minlen)); + ND_PRINT(",max=%u", EXTRACT_U_1(match->rpm_maxlen)); } if (addrtostr6(&match->rpm_prefix, hbuf, sizeof(hbuf))) - ND_PRINT((ndo,",%s/%u", hbuf, EXTRACT_U_1(match->rpm_matchlen))); + ND_PRINT(",%s/%u", hbuf, EXTRACT_U_1(match->rpm_matchlen)); else - ND_PRINT((ndo,",?/%u", EXTRACT_U_1(match->rpm_matchlen))); + ND_PRINT(",?/%u", EXTRACT_U_1(match->rpm_matchlen)); /*(*/ - ND_PRINT((ndo,")")); + ND_PRINT(")"); n = EXTRACT_U_1(match->rpm_len) - 3; if (n % 4) @@ -2073,46 +2073,46 @@ icmp6_rrenum_print(netdissect_options *ndo, const u_char *bp, const u_char *ep) ND_TCHECK(use->rpu_prefix); if (ndo->ndo_vflag > 1) - ND_PRINT((ndo,"\n\t")); + ND_PRINT("\n\t"); else - ND_PRINT((ndo," ")); - ND_PRINT((ndo,"use(")); /*)*/ + ND_PRINT(" "); + ND_PRINT("use("); /*)*/ if (EXTRACT_U_1(use->rpu_flags)) { #define F(x, y) (EXTRACT_U_1(use->rpu_flags) & (x) ? (y) : "") - ND_PRINT((ndo,"%s%s,", + ND_PRINT("%s%s,", F(ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME, "V"), - F(ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME, "P"))); + F(ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME, "P")); #undef F } if (ndo->ndo_vflag) { - ND_PRINT((ndo,"mask=0x%x,", EXTRACT_U_1(use->rpu_ramask))); - ND_PRINT((ndo,"raflags=0x%x,", EXTRACT_U_1(use->rpu_raflags))); + ND_PRINT("mask=0x%x,", EXTRACT_U_1(use->rpu_ramask)); + ND_PRINT("raflags=0x%x,", EXTRACT_U_1(use->rpu_raflags)); if (EXTRACT_BE_U_4(use->rpu_vltime) == 0xffffffff) - ND_PRINT((ndo,"vltime=infty,")); + ND_PRINT("vltime=infty,"); else - ND_PRINT((ndo,"vltime=%u,", - EXTRACT_BE_U_4(use->rpu_vltime))); + ND_PRINT("vltime=%u,", + EXTRACT_BE_U_4(use->rpu_vltime)); if (EXTRACT_BE_U_4(use->rpu_pltime) == 0xffffffff) - ND_PRINT((ndo,"pltime=infty,")); + ND_PRINT("pltime=infty,"); else - ND_PRINT((ndo,"pltime=%u,", - EXTRACT_BE_U_4(use->rpu_pltime))); + ND_PRINT("pltime=%u,", + EXTRACT_BE_U_4(use->rpu_pltime)); } if (addrtostr6(&use->rpu_prefix, hbuf, sizeof(hbuf))) - ND_PRINT((ndo,"%s/%u/%u", hbuf, EXTRACT_U_1(use->rpu_uselen), - EXTRACT_U_1(use->rpu_keeplen))); + ND_PRINT("%s/%u/%u", hbuf, EXTRACT_U_1(use->rpu_uselen), + EXTRACT_U_1(use->rpu_keeplen)); else - ND_PRINT((ndo,"?/%u/%u", EXTRACT_U_1(use->rpu_uselen), - EXTRACT_U_1(use->rpu_keeplen))); + ND_PRINT("?/%u/%u", EXTRACT_U_1(use->rpu_uselen), + EXTRACT_U_1(use->rpu_keeplen)); /*(*/ - ND_PRINT((ndo,")")); + ND_PRINT(")"); } } return; trunc: - ND_PRINT((ndo,"[|icmp6]")); + ND_PRINT("[|icmp6]"); } /* diff --git a/print-igmp.c b/print-igmp.c index 08ef4bd8..9be2c5d3 100644 --- a/print-igmp.c +++ b/print-igmp.c @@ -116,18 +116,18 @@ print_mtrace(netdissect_options *ndo, ND_TCHECK_SIZE(tr); if (len < 8 + sizeof (struct tr_query)) { - ND_PRINT((ndo, " [invalid len %d]", len)); + ND_PRINT(" [invalid len %d]", len); return; } - ND_PRINT((ndo, "mtrace %u: %s to %s reply-to %s", + ND_PRINT("mtrace %u: %s to %s reply-to %s", EXTRACT_BE_U_3(tr->tr_qid), ipaddr_string(ndo, tr->tr_src), ipaddr_string(ndo, tr->tr_dst), - ipaddr_string(ndo, tr->tr_raddr))); + ipaddr_string(ndo, tr->tr_raddr)); if (IN_CLASSD(EXTRACT_BE_U_4(tr->tr_raddr))) - ND_PRINT((ndo, " with-ttl %u", EXTRACT_U_1(tr->tr_rttl))); + ND_PRINT(" with-ttl %u", EXTRACT_U_1(tr->tr_rttl)); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -138,18 +138,18 @@ print_mresp(netdissect_options *ndo, ND_TCHECK_SIZE(tr); if (len < 8 + sizeof (struct tr_query)) { - ND_PRINT((ndo, " [invalid len %d]", len)); + ND_PRINT(" [invalid len %d]", len); return; } - ND_PRINT((ndo, "mresp %u: %s to %s reply-to %s", + ND_PRINT("mresp %u: %s to %s reply-to %s", EXTRACT_BE_U_3(tr->tr_qid), ipaddr_string(ndo, tr->tr_src), ipaddr_string(ndo, tr->tr_dst), - ipaddr_string(ndo, tr->tr_raddr))); + ipaddr_string(ndo, tr->tr_raddr)); if (IN_CLASSD(EXTRACT_BE_U_4(tr->tr_raddr))) - ND_PRINT((ndo, " with-ttl %u", EXTRACT_U_1(tr->tr_rttl))); + ND_PRINT(" with-ttl %u", EXTRACT_U_1(tr->tr_rttl)); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -161,49 +161,49 @@ print_igmpv3_report(netdissect_options *ndo, /* Minimum len is 16, and should be a multiple of 4 */ if (len < 16 || len & 0x03) { - ND_PRINT((ndo, " [invalid len %d]", len)); + ND_PRINT(" [invalid len %d]", len); return; } ND_TCHECK_2(bp + 6); ngroups = EXTRACT_BE_U_2(bp + 6); - ND_PRINT((ndo, ", %d group record(s)", ngroups)); + ND_PRINT(", %d group record(s)", ngroups); if (ndo->ndo_vflag > 0) { /* Print the group records */ group = 8; for (i=0; i<ngroups; i++) { if (len < group+8) { - ND_PRINT((ndo, " [invalid number of groups]")); + ND_PRINT(" [invalid number of groups]"); return; } ND_TCHECK_4(bp + (group + 4)); - ND_PRINT((ndo, " [gaddr %s", ipaddr_string(ndo, bp + group + 4))); - ND_PRINT((ndo, " %s", tok2str(igmpv3report2str, " [v3-report-#%d]", - EXTRACT_U_1(bp + group)))); + ND_PRINT(" [gaddr %s", ipaddr_string(ndo, bp + group + 4)); + ND_PRINT(" %s", tok2str(igmpv3report2str, " [v3-report-#%d]", + EXTRACT_U_1(bp + group))); nsrcs = EXTRACT_BE_U_2(bp + group + 2); /* Check the number of sources and print them */ if (len < group+8+(nsrcs<<2)) { - ND_PRINT((ndo, " [invalid number of sources %d]", nsrcs)); + ND_PRINT(" [invalid number of sources %d]", nsrcs); return; } if (ndo->ndo_vflag == 1) - ND_PRINT((ndo, ", %d source(s)", nsrcs)); + ND_PRINT(", %d source(s)", nsrcs); else { /* Print the sources */ - ND_PRINT((ndo, " {")); + ND_PRINT(" {"); for (j=0; j<nsrcs; j++) { ND_TCHECK_4(bp + (group + 8 + (j << 2))); - ND_PRINT((ndo, " %s", ipaddr_string(ndo, bp + group + 8 + (j << 2)))); + ND_PRINT(" %s", ipaddr_string(ndo, bp + group + 8 + (j << 2))); } - ND_PRINT((ndo, " }")); + ND_PRINT(" }"); } /* Next group record */ group += 8 + (nsrcs << 2); - ND_PRINT((ndo, "]")); + ND_PRINT("]"); } } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -215,10 +215,10 @@ print_igmpv3_query(netdissect_options *ndo, u_int nsrcs; u_int i; - ND_PRINT((ndo, " v3")); + ND_PRINT(" v3"); /* Minimum len is 12, and should be a multiple of 4 */ if (len < 12 || len & 0x03) { - ND_PRINT((ndo, " [invalid len %d]", len)); + ND_PRINT(" [invalid len %d]", len); return; } ND_TCHECK_1(bp + 1); @@ -229,37 +229,37 @@ print_igmpv3_query(netdissect_options *ndo, mrt = ((mrc & 0x0f) | 0x10) << (((mrc & 0x70) >> 4) + 3); } if (mrc != 100) { - ND_PRINT((ndo, " [max resp time ")); + ND_PRINT(" [max resp time "); if (mrt < 600) { - ND_PRINT((ndo, "%.1fs", mrt * 0.1)); + ND_PRINT("%.1fs", mrt * 0.1); } else { unsigned_relts_print(ndo, mrt / 10); } - ND_PRINT((ndo, "]")); + ND_PRINT("]"); } ND_TCHECK_4(bp + 4); if (EXTRACT_BE_U_4(bp + 4) == 0) return; - ND_PRINT((ndo, " [gaddr %s", ipaddr_string(ndo, bp + 4))); + ND_PRINT(" [gaddr %s", ipaddr_string(ndo, bp + 4)); ND_TCHECK_2(bp + 10); nsrcs = EXTRACT_BE_U_2(bp + 10); if (nsrcs > 0) { if (len < 12 + (nsrcs << 2)) - ND_PRINT((ndo, " [invalid number of sources]")); + ND_PRINT(" [invalid number of sources]"); else if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, " {")); + ND_PRINT(" {"); for (i=0; i<nsrcs; i++) { ND_TCHECK_4(bp + (12 + (i << 2))); - ND_PRINT((ndo, " %s", ipaddr_string(ndo, bp + 12 + (i << 2)))); + ND_PRINT(" %s", ipaddr_string(ndo, bp + 12 + (i << 2))); } - ND_PRINT((ndo, " }")); + ND_PRINT(" }"); } else - ND_PRINT((ndo, ", %d source(s)", nsrcs)); + ND_PRINT(", %d source(s)", nsrcs); } - ND_PRINT((ndo, "]")); + ND_PRINT("]"); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -269,58 +269,58 @@ igmp_print(netdissect_options *ndo, struct cksum_vec vec[1]; if (ndo->ndo_qflag) { - ND_PRINT((ndo, "igmp")); + ND_PRINT("igmp"); return; } ND_TCHECK_1(bp); switch (EXTRACT_U_1(bp)) { case 0x11: - ND_PRINT((ndo, "igmp query")); + ND_PRINT("igmp query"); if (len >= 12) print_igmpv3_query(ndo, bp, len); else { ND_TCHECK_1(bp + 1); if (EXTRACT_U_1(bp + 1)) { - ND_PRINT((ndo, " v2")); + ND_PRINT(" v2"); if (EXTRACT_U_1(bp + 1) != 100) - ND_PRINT((ndo, " [max resp time %u]", EXTRACT_U_1(bp + 1))); + ND_PRINT(" [max resp time %u]", EXTRACT_U_1(bp + 1)); } else - ND_PRINT((ndo, " v1")); + ND_PRINT(" v1"); ND_TCHECK_4(bp + 4); if (EXTRACT_BE_U_4(bp + 4)) - ND_PRINT((ndo, " [gaddr %s]", ipaddr_string(ndo, bp + 4))); + ND_PRINT(" [gaddr %s]", ipaddr_string(ndo, bp + 4)); if (len != 8) - ND_PRINT((ndo, " [len %d]", len)); + ND_PRINT(" [len %d]", len); } break; case 0x12: ND_TCHECK_4(bp + 4); - ND_PRINT((ndo, "igmp v1 report %s", ipaddr_string(ndo, bp + 4))); + ND_PRINT("igmp v1 report %s", ipaddr_string(ndo, bp + 4)); if (len != 8) - ND_PRINT((ndo, " [len %d]", len)); + ND_PRINT(" [len %d]", len); break; case 0x16: ND_TCHECK_4(bp + 4); - ND_PRINT((ndo, "igmp v2 report %s", ipaddr_string(ndo, bp + 4))); + ND_PRINT("igmp v2 report %s", ipaddr_string(ndo, bp + 4)); break; case 0x22: - ND_PRINT((ndo, "igmp v3 report")); + ND_PRINT("igmp v3 report"); print_igmpv3_report(ndo, bp, len); break; case 0x17: ND_TCHECK_4(bp + 4); - ND_PRINT((ndo, "igmp leave %s", ipaddr_string(ndo, bp + 4))); + ND_PRINT("igmp leave %s", ipaddr_string(ndo, bp + 4)); break; case 0x13: - ND_PRINT((ndo, "igmp dvmrp")); + ND_PRINT("igmp dvmrp"); if (len < 8) - ND_PRINT((ndo, " [len %d]", len)); + ND_PRINT(" [len %d]", len); else dvmrp_print(ndo, bp, len); break; case 0x14: - ND_PRINT((ndo, "igmp pimv1")); + ND_PRINT("igmp pimv1"); pimv1_print(ndo, bp, len); break; case 0x1e: @@ -330,7 +330,7 @@ igmp_print(netdissect_options *ndo, print_mtrace(ndo, bp, len); break; default: - ND_PRINT((ndo, "igmp-%d", EXTRACT_U_1(bp))); + ND_PRINT("igmp-%d", EXTRACT_U_1(bp)); break; } @@ -339,9 +339,9 @@ igmp_print(netdissect_options *ndo, vec[0].ptr = bp; vec[0].len = len; if (in_cksum(vec, 1)) - ND_PRINT((ndo, " bad igmp cksum %x!", EXTRACT_BE_U_2(bp + 2))); + ND_PRINT(" bad igmp cksum %x!", EXTRACT_BE_U_2(bp + 2)); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-igrp.c b/print-igrp.c index 56c82744..d114957d 100644 --- a/print-igrp.c +++ b/print-igrp.c @@ -73,14 +73,14 @@ igrp_entry_print(netdissect_options *ndo, const struct igrprte *igr, u_int metric, mtu; if (is_interior) - ND_PRINT((ndo, " *.%u.%u.%u", igr->igr_net[0], - igr->igr_net[1], igr->igr_net[2])); + ND_PRINT(" *.%u.%u.%u", igr->igr_net[0], + igr->igr_net[1], igr->igr_net[2]); else if (is_exterior) - ND_PRINT((ndo, " X%u.%u.%u.0", igr->igr_net[0], - igr->igr_net[1], igr->igr_net[2])); + ND_PRINT(" X%u.%u.%u.0", igr->igr_net[0], + igr->igr_net[1], igr->igr_net[2]); else - ND_PRINT((ndo, " %u.%u.%u.0", igr->igr_net[0], - igr->igr_net[1], igr->igr_net[2])); + ND_PRINT(" %u.%u.%u.0", igr->igr_net[0], + igr->igr_net[1], igr->igr_net[2]); delay = EXTRACT_BE_U_3(igr->igr_dly); bandwidth = EXTRACT_BE_U_3(igr->igr_bw); @@ -89,10 +89,10 @@ igrp_entry_print(netdissect_options *ndo, const struct igrprte *igr, metric = 0xffffff; mtu = EXTRACT_BE_U_2(igr->igr_mtu); - ND_PRINT((ndo, " d=%u b=%u r=%u l=%u M=%u mtu=%u in %u hops", + ND_PRINT(" d=%u b=%u r=%u l=%u M=%u mtu=%u in %u hops", 10 * delay, bandwidth == 0 ? 0 : 10000000 / bandwidth, EXTRACT_U_1(igr->igr_rel), EXTRACT_U_1(igr->igr_ld), metric, - mtu, EXTRACT_U_1(igr->igr_hct))); + mtu, EXTRACT_U_1(igr->igr_hct)); } static const struct tok op2str[] = { @@ -110,7 +110,7 @@ igrp_print(netdissect_options *ndo, const u_char *bp, u_int length) hdr = (const struct igrphdr *)bp; cp = (const u_char *)(hdr + 1); - ND_PRINT((ndo, "igrp:")); + ND_PRINT("igrp:"); /* Header */ ND_TCHECK_SIZE(hdr); @@ -118,14 +118,14 @@ igrp_print(netdissect_options *ndo, const u_char *bp, u_int length) nsys = EXTRACT_BE_U_2(hdr->ig_ns); next = EXTRACT_BE_U_2(hdr->ig_nx); - ND_PRINT((ndo, " %s V%u edit=%u AS=%u (%u/%u/%u)", + ND_PRINT(" %s V%u edit=%u AS=%u (%u/%u/%u)", tok2str(op2str, "op-#%u", IGRP_OP(EXTRACT_U_1(hdr->ig_vop))), IGRP_V(EXTRACT_U_1(hdr->ig_vop)), EXTRACT_U_1(hdr->ig_ed), EXTRACT_BE_U_2(hdr->ig_as), nint, nsys, - next)); + next); length -= sizeof(*hdr); while (length >= IGRP_RTE_SIZE) { @@ -142,7 +142,7 @@ igrp_print(netdissect_options *ndo, const u_char *bp, u_int length) igrp_entry_print(ndo, (const struct igrprte *)cp, 0, 1); --next; } else { - ND_PRINT((ndo, " [extra bytes %u]", length)); + ND_PRINT(" [extra bytes %u]", length); break; } cp += IGRP_RTE_SIZE; @@ -151,5 +151,5 @@ igrp_print(netdissect_options *ndo, const u_char *bp, u_int length) if (nint == 0 && nsys == 0 && next == 0) return; trunc: - ND_PRINT((ndo, " [|igrp]")); + ND_PRINT(" [|igrp]"); } @@ -62,21 +62,21 @@ ip_printroute(netdissect_options *ndo, u_int len; if (length < 3) { - ND_PRINT((ndo, " [bad length %u]", length)); + ND_PRINT(" [bad length %u]", length); return (0); } if ((length + 1) & 3) - ND_PRINT((ndo, " [bad length %u]", length)); + ND_PRINT(" [bad length %u]", length); ND_TCHECK_1(cp + 2); ptr = EXTRACT_U_1(cp + 2) - 1; if (ptr < 3 || ((ptr + 1) & 3) || ptr > length + 1) - ND_PRINT((ndo, " [bad ptr %u]", EXTRACT_U_1(cp + 2))); + ND_PRINT(" [bad ptr %u]", EXTRACT_U_1(cp + 2)); for (len = 3; len < length; len += 4) { ND_TCHECK_4(cp + len); - ND_PRINT((ndo, " %s", ipaddr_string(ndo, cp + len))); + ND_PRINT(" %s", ipaddr_string(ndo, cp + len)); if (ptr > len) - ND_PRINT((ndo, ",")); + ND_PRINT(","); } return (0); @@ -175,26 +175,26 @@ ip_printts(netdissect_options *ndo, const char *type; if (length < 4) { - ND_PRINT((ndo, "[bad length %u]", length)); + ND_PRINT("[bad length %u]", length); return (0); } - ND_PRINT((ndo, " TS{")); + ND_PRINT(" TS{"); ND_TCHECK_1(cp + 3); hoplen = ((EXTRACT_U_1(cp + 3) & 0xF) != IPOPT_TS_TSONLY) ? 8 : 4; if ((length - 4) & (hoplen-1)) - ND_PRINT((ndo, "[bad length %u]", length)); + ND_PRINT("[bad length %u]", length); ND_TCHECK_1(cp + 2); ptr = EXTRACT_U_1(cp + 2) - 1; len = 0; if (ptr < 4 || ((ptr - 4) & (hoplen-1)) || ptr > length + 1) - ND_PRINT((ndo, "[bad ptr %u]", EXTRACT_U_1(cp + 2))); + ND_PRINT("[bad ptr %u]", EXTRACT_U_1(cp + 2)); ND_TCHECK_1(cp + 3); switch (EXTRACT_U_1(cp + 3)&0xF) { case IPOPT_TS_TSONLY: - ND_PRINT((ndo, "TSONLY")); + ND_PRINT("TSONLY"); break; case IPOPT_TS_TSANDADDR: - ND_PRINT((ndo, "TS+ADDR")); + ND_PRINT("TS+ADDR"); break; /* * prespecified should really be 3, but some ones might send 2 @@ -203,13 +203,13 @@ ip_printts(netdissect_options *ndo, */ case 2: - ND_PRINT((ndo, "PRESPEC2.0")); + ND_PRINT("PRESPEC2.0"); break; case 3: /* IPOPT_TS_PRESPEC */ - ND_PRINT((ndo, "PRESPEC")); + ND_PRINT("PRESPEC"); break; default: - ND_PRINT((ndo, "[bad ts type %d]", EXTRACT_U_1(cp + 3)&0xF)); + ND_PRINT("[bad ts type %d]", EXTRACT_U_1(cp + 3)&0xF); goto done; } @@ -218,18 +218,18 @@ ip_printts(netdissect_options *ndo, if (ptr == len) type = " ^ "; ND_TCHECK_LEN(cp + len, hoplen); - ND_PRINT((ndo, "%s%d@%s", type, EXTRACT_BE_U_4(cp + len + hoplen - 4), - hoplen!=8 ? "" : ipaddr_string(ndo, cp + len))); + ND_PRINT("%s%d@%s", type, EXTRACT_BE_U_4(cp + len + hoplen - 4), + hoplen!=8 ? "" : ipaddr_string(ndo, cp + len)); type = " "; } done: - ND_PRINT((ndo, "%s", ptr == len ? " ^ " : "")); + ND_PRINT("%s", ptr == len ? " ^ " : ""); if (EXTRACT_U_1(cp + 3) >> 4) - ND_PRINT((ndo, " [%d hops not recorded]} ", EXTRACT_U_1(cp + 3)>>4)); + ND_PRINT(" [%d hops not recorded]} ", EXTRACT_U_1(cp + 3)>>4); else - ND_PRINT((ndo, "}")); + ND_PRINT("}"); return (0); trunc: @@ -249,14 +249,14 @@ ip_optprint(netdissect_options *ndo, for (; length > 0; cp += option_len, length -= option_len) { u_int option_code; - ND_PRINT((ndo, "%s", sep)); + ND_PRINT("%s", sep); sep = ","; ND_TCHECK_1(cp); option_code = EXTRACT_U_1(cp); - ND_PRINT((ndo, "%s", - tok2str(ip_option_values,"unknown %u",option_code))); + ND_PRINT("%s", + tok2str(ip_option_values,"unknown %u",option_code)); if (option_code == IPOPT_NOP || option_code == IPOPT_EOL) @@ -266,13 +266,13 @@ ip_optprint(netdissect_options *ndo, ND_TCHECK_1(cp + 1); option_len = EXTRACT_U_1(cp + 1); if (option_len < 2) { - ND_PRINT((ndo, " [bad length %u]", option_len)); + ND_PRINT(" [bad length %u]", option_len); return; } } if (option_len > length) { - ND_PRINT((ndo, " [bad length %u]", option_len)); + ND_PRINT(" [bad length %u]", option_len); return; } @@ -296,12 +296,12 @@ ip_optprint(netdissect_options *ndo, case IPOPT_RA: if (option_len < 4) { - ND_PRINT((ndo, " [bad length %u]", option_len)); + ND_PRINT(" [bad length %u]", option_len); break; } ND_TCHECK_1(cp + 3); if (EXTRACT_BE_U_2(cp + 2) != 0) - ND_PRINT((ndo, " value %u", EXTRACT_BE_U_2(cp + 2))); + ND_PRINT(" value %u", EXTRACT_BE_U_2(cp + 2)); break; case IPOPT_NOP: /* nothing to print - fall through */ @@ -313,7 +313,7 @@ ip_optprint(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } #define IP_RES 0x8000 @@ -344,7 +344,7 @@ again: case IPPROTO_AH: if (!ND_TTEST_1(ipds->cp)) { - ND_PRINT((ndo, "[|AH]")); + ND_PRINT("[|AH]"); break; } ipds->nh = EXTRACT_U_1(ipds->cp); @@ -429,7 +429,7 @@ again: break; case IPPROTO_ND: - ND_PRINT((ndo, " nd %d", ipds->len)); + ND_PRINT(" nd %d", ipds->len); break; case IPPROTO_EGP: @@ -448,7 +448,7 @@ again: /* DVMRP multicast tunnel (ip-in-ip encapsulation) */ ip_print(ndo, ipds->cp, ipds->len); if (! ndo->ndo_vflag) { - ND_PRINT((ndo, " (ipip-proto-4)")); + ND_PRINT(" (ipip-proto-4)"); return; } break; @@ -478,16 +478,16 @@ again: case IPPROTO_VRRP: if (ndo->ndo_packettype == PT_CARP) { if (ndo->ndo_vflag) - ND_PRINT((ndo, "carp %s > %s: ", + ND_PRINT("carp %s > %s: ", ipaddr_string(ndo, &ipds->ip->ip_src), - ipaddr_string(ndo, &ipds->ip->ip_dst))); + ipaddr_string(ndo, &ipds->ip->ip_dst)); carp_print(ndo, ipds->cp, ipds->len, EXTRACT_U_1(ipds->ip->ip_ttl)); } else { if (ndo->ndo_vflag) - ND_PRINT((ndo, "vrrp %s > %s: ", + ND_PRINT("vrrp %s > %s: ", ipaddr_string(ndo, &ipds->ip->ip_src), - ipaddr_string(ndo, &ipds->ip->ip_dst))); + ipaddr_string(ndo, &ipds->ip->ip_dst)); vrrp_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip, EXTRACT_U_1(ipds->ip->ip_ttl)); @@ -500,10 +500,10 @@ again: default: if (ndo->ndo_nflag==0 && (p_name = netdb_protoname(ipds->nh)) != NULL) - ND_PRINT((ndo, " %s", p_name)); + ND_PRINT(" %s", p_name); else - ND_PRINT((ndo, " ip-proto-%d", ipds->nh)); - ND_PRINT((ndo, " %d", ipds->len)); + ND_PRINT(" ip-proto-%d", ipds->nh); + ND_PRINT(" %d", ipds->len); break; } } @@ -548,33 +548,33 @@ ip_print(netdissect_options *ndo, ND_TCHECK(ipds->ip->ip_vhl); if (IP_V(ipds->ip) != 4) { /* print version and fail if != 4 */ if (IP_V(ipds->ip) == 6) - ND_PRINT((ndo, "IP6, wrong link-layer encapsulation ")); + ND_PRINT("IP6, wrong link-layer encapsulation "); else - ND_PRINT((ndo, "IP%u ", IP_V(ipds->ip))); + ND_PRINT("IP%u ", IP_V(ipds->ip)); return; } if (!ndo->ndo_eflag) - ND_PRINT((ndo, "IP ")); + ND_PRINT("IP "); ND_TCHECK_SIZE(ipds->ip); if (length < sizeof (struct ip)) { - ND_PRINT((ndo, "truncated-ip %u", length)); + ND_PRINT("truncated-ip %u", length); return; } hlen = IP_HL(ipds->ip) * 4; if (hlen < sizeof (struct ip)) { - ND_PRINT((ndo, "bad-hlen %u", hlen)); + ND_PRINT("bad-hlen %u", hlen); return; } ipds->len = EXTRACT_BE_U_2(&ipds->ip->ip_len); if (length < ipds->len) - ND_PRINT((ndo, "truncated-ip - %u bytes missing! ", - ipds->len - length)); + ND_PRINT("truncated-ip - %u bytes missing! ", + ipds->len - length); if (ipds->len < hlen) { #ifdef GUESS_TSO if (ipds->len) { - ND_PRINT((ndo, "bad-len %u", ipds->len)); + ND_PRINT("bad-len %u", ipds->len); return; } else { @@ -582,7 +582,7 @@ ip_print(netdissect_options *ndo, ipds->len = length; } #else - ND_PRINT((ndo, "bad-len %u", ipds->len)); + ND_PRINT("bad-len %u", ipds->len); return; #endif /* GUESS_TSO */ } @@ -602,7 +602,7 @@ ip_print(netdissect_options *ndo, if (ndo->ndo_vflag) { ip_tos = EXTRACT_U_1(ipds->ip->ip_tos); - ND_PRINT((ndo, "(tos 0x%x", ip_tos)); + ND_PRINT("(tos 0x%x", ip_tos); /* ECN bits */ switch (ip_tos & 0x03) { @@ -610,40 +610,40 @@ ip_print(netdissect_options *ndo, break; case 1: - ND_PRINT((ndo, ",ECT(1)")); + ND_PRINT(",ECT(1)"); break; case 2: - ND_PRINT((ndo, ",ECT(0)")); + ND_PRINT(",ECT(0)"); break; case 3: - ND_PRINT((ndo, ",CE")); + ND_PRINT(",CE"); break; } ip_ttl = EXTRACT_U_1(ipds->ip->ip_ttl); if (ip_ttl >= 1) - ND_PRINT((ndo, ", ttl %u", ip_ttl)); + ND_PRINT(", ttl %u", ip_ttl); /* * for the firewall guys, print id, offset. * On all but the last stick a "+" in the flags portion. * For unfragmented datagrams, note the don't fragment flag. */ - ND_PRINT((ndo, ", id %u, offset %u, flags [%s], proto %s (%u)", + ND_PRINT(", id %u, offset %u, flags [%s], proto %s (%u)", EXTRACT_BE_U_2(&ipds->ip->ip_id), (ipds->off & 0x1fff) * 8, bittok2str(ip_frag_values, "none", ipds->off&0xe000), tok2str(ipproto_values, "unknown", ip_proto), - ip_proto)); + ip_proto); - ND_PRINT((ndo, ", length %u", EXTRACT_BE_U_2(ipds->ip->ip_len))); + ND_PRINT(", length %u", EXTRACT_BE_U_2(ipds->ip->ip_len)); if ((hlen - sizeof(struct ip)) > 0) { - ND_PRINT((ndo, ", options (")); + ND_PRINT(", options ("); ip_optprint(ndo, (const u_char *)(ipds->ip + 1), hlen - sizeof(struct ip)); - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } if (!ndo->ndo_Kflag && (const u_char *)ipds->ip + hlen <= ndo->ndo_snapend) { @@ -652,12 +652,12 @@ ip_print(netdissect_options *ndo, sum = in_cksum(vec, 1); if (sum != 0) { ip_sum = EXTRACT_BE_U_2(ipds->ip->ip_sum); - ND_PRINT((ndo, ", bad cksum %x (->%x)!", ip_sum, - in_cksum_shouldbe(ip_sum, sum))); + ND_PRINT(", bad cksum %x (->%x)!", ip_sum, + in_cksum_shouldbe(ip_sum, sum)); } } - ND_PRINT((ndo, ")\n ")); + ND_PRINT(")\n "); } /* @@ -670,9 +670,9 @@ ip_print(netdissect_options *ndo, if (ipds->nh != IPPROTO_TCP && ipds->nh != IPPROTO_UDP && ipds->nh != IPPROTO_SCTP && ipds->nh != IPPROTO_DCCP) { - ND_PRINT((ndo, "%s > %s: ", + ND_PRINT("%s > %s: ", ipaddr_string(ndo, &ipds->ip->ip_src), - ipaddr_string(ndo, &ipds->ip->ip_dst))); + ipaddr_string(ndo, &ipds->ip->ip_dst)); } ip_print_demux(ndo, ipds); } else { @@ -688,17 +688,17 @@ ip_print(netdissect_options *ndo, * next level protocol header. print the ip addr * and the protocol. */ - ND_PRINT((ndo, "%s > %s:", ipaddr_string(ndo, &ipds->ip->ip_src), - ipaddr_string(ndo, &ipds->ip->ip_dst))); + ND_PRINT("%s > %s:", ipaddr_string(ndo, &ipds->ip->ip_src), + ipaddr_string(ndo, &ipds->ip->ip_dst)); if (!ndo->ndo_nflag && (p_name = netdb_protoname(ip_proto)) != NULL) - ND_PRINT((ndo, " %s", p_name)); + ND_PRINT(" %s", p_name); else - ND_PRINT((ndo, " ip-proto-%u", ip_proto)); + ND_PRINT(" ip-proto-%u", ip_proto); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } @@ -706,7 +706,7 @@ void ipN_print(netdissect_options *ndo, const u_char *bp, u_int length) { if (length < 1) { - ND_PRINT((ndo, "truncated-ip %d", length)); + ND_PRINT("truncated-ip %d", length); return; } @@ -719,13 +719,13 @@ ipN_print(netdissect_options *ndo, const u_char *bp, u_int length) ip6_print (ndo, bp, length); break; default: - ND_PRINT((ndo, "unknown ip %u", (EXTRACT_U_1(bp) & 0xF0) >> 4)); + ND_PRINT("unknown ip %u", (EXTRACT_U_1(bp) & 0xF0) >> 4); break; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } diff --git a/print-ip6.c b/print-ip6.c index ffc9d50f..fe264e49 100644 --- a/print-ip6.c +++ b/print-ip6.c @@ -229,47 +229,47 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) ND_TCHECK_SIZE(ip6); if (length < sizeof (struct ip6_hdr)) { - ND_PRINT((ndo, "truncated-ip6 %u", length)); + ND_PRINT("truncated-ip6 %u", length); return; } if (!ndo->ndo_eflag) - ND_PRINT((ndo, "IP6 ")); + ND_PRINT("IP6 "); if (IP6_VERSION(ip6) != 6) { - ND_PRINT((ndo,"version error: %u != 6", IP6_VERSION(ip6))); + ND_PRINT("version error: %u != 6", IP6_VERSION(ip6)); return; } payload_len = EXTRACT_BE_U_2(ip6->ip6_plen); len = payload_len + sizeof(struct ip6_hdr); if (length < len) - ND_PRINT((ndo, "truncated-ip6 - %u bytes missing!", - len - length)); + ND_PRINT("truncated-ip6 - %u bytes missing!", + len - length); nh = EXTRACT_U_1(ip6->ip6_nxt); if (ndo->ndo_vflag) { flow = EXTRACT_BE_U_4(ip6->ip6_flow); - ND_PRINT((ndo, "(")); + ND_PRINT("("); #if 0 /* rfc1883 */ if (flow & 0x0f000000) - ND_PRINT((ndo, "pri 0x%02x, ", (flow & 0x0f000000) >> 24)); + ND_PRINT("pri 0x%02x, ", (flow & 0x0f000000) >> 24); if (flow & 0x00ffffff) - ND_PRINT((ndo, "flowlabel 0x%06x, ", flow & 0x00ffffff)); + ND_PRINT("flowlabel 0x%06x, ", flow & 0x00ffffff); #else /* RFC 2460 */ if (flow & 0x0ff00000) - ND_PRINT((ndo, "class 0x%02x, ", (flow & 0x0ff00000) >> 20)); + ND_PRINT("class 0x%02x, ", (flow & 0x0ff00000) >> 20); if (flow & 0x000fffff) - ND_PRINT((ndo, "flowlabel 0x%05x, ", flow & 0x000fffff)); + ND_PRINT("flowlabel 0x%05x, ", flow & 0x000fffff); #endif - ND_PRINT((ndo, "hlim %u, next-header %s (%u) payload length: %u) ", + ND_PRINT("hlim %u, next-header %s (%u) payload length: %u) ", EXTRACT_U_1(ip6->ip6_hlim), tok2str(ipproto_values,"unknown",nh), nh, - payload_len)); + payload_len); } /* @@ -290,8 +290,8 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) if (cp == (const u_char *)(ip6 + 1) && nh != IPPROTO_TCP && nh != IPPROTO_UDP && nh != IPPROTO_DCCP && nh != IPPROTO_SCTP) { - ND_PRINT((ndo, "%s > %s: ", ip6addr_string(ndo, &ip6->ip6_src), - ip6addr_string(ndo, &ip6->ip6_dst))); + ND_PRINT("%s > %s: ", ip6addr_string(ndo, &ip6->ip6_src), + ip6addr_string(ndo, &ip6->ip6_dst)); } switch (nh) { @@ -414,16 +414,16 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) return; case IPPROTO_NONE: - ND_PRINT((ndo, "no next header")); + ND_PRINT("no next header"); return; default: - ND_PRINT((ndo, "ip-proto-%d %d", nh, len)); + ND_PRINT("ip-proto-%d %d", nh, len); return; } } return; trunc: - ND_PRINT((ndo, "[|ip6]")); + ND_PRINT("[|ip6]"); } diff --git a/print-ip6opts.c b/print-ip6opts.c index 00cad391..8448d905 100644 --- a/print-ip6opts.c +++ b/print-ip6opts.c @@ -61,28 +61,28 @@ ip6_sopt_print(netdissect_options *ndo, const u_char *bp, int len) switch (EXTRACT_U_1(bp + i)) { case IP6OPT_PAD1: - ND_PRINT((ndo, ", pad1")); + ND_PRINT(", pad1"); break; case IP6OPT_PADN: if (len - i < IP6OPT_MINLEN) { - ND_PRINT((ndo, ", padn: trunc")); + ND_PRINT(", padn: trunc"); goto trunc; } - ND_PRINT((ndo, ", padn")); + ND_PRINT(", padn"); break; default: if (len - i < IP6OPT_MINLEN) { - ND_PRINT((ndo, ", sopt_type %d: trunc)", EXTRACT_U_1(bp + i))); + ND_PRINT(", sopt_type %d: trunc)", EXTRACT_U_1(bp + i)); goto trunc; } - ND_PRINT((ndo, ", sopt_type 0x%02x: len=%d", EXTRACT_U_1(bp + i), EXTRACT_U_1(bp + i + 1))); + ND_PRINT(", sopt_type 0x%02x: len=%d", EXTRACT_U_1(bp + i), EXTRACT_U_1(bp + i + 1)); break; } } return; trunc: - ND_PRINT((ndo, "[trunc] ")); + ND_PRINT("[trunc] "); } static void @@ -107,67 +107,67 @@ ip6_opt_print(netdissect_options *ndo, const u_char *bp, int len) switch (EXTRACT_U_1(bp + i)) { case IP6OPT_PAD1: - ND_PRINT((ndo, "(pad1)")); + ND_PRINT("(pad1)"); break; case IP6OPT_PADN: if (len - i < IP6OPT_MINLEN) { - ND_PRINT((ndo, "(padn: trunc)")); + ND_PRINT("(padn: trunc)"); goto trunc; } - ND_PRINT((ndo, "(padn)")); + ND_PRINT("(padn)"); break; case IP6OPT_ROUTER_ALERT: if (len - i < IP6OPT_RTALERT_LEN) { - ND_PRINT((ndo, "(rtalert: trunc)")); + ND_PRINT("(rtalert: trunc)"); goto trunc; } if (EXTRACT_U_1(bp + i + 1) != IP6OPT_RTALERT_LEN - 2) { - ND_PRINT((ndo, "(rtalert: invalid len %d)", EXTRACT_U_1(bp + i + 1))); + ND_PRINT("(rtalert: invalid len %d)", EXTRACT_U_1(bp + i + 1)); goto trunc; } - ND_PRINT((ndo, "(rtalert: 0x%04x) ", EXTRACT_BE_U_2(bp + i + 2))); + ND_PRINT("(rtalert: 0x%04x) ", EXTRACT_BE_U_2(bp + i + 2)); break; case IP6OPT_JUMBO: if (len - i < IP6OPT_JUMBO_LEN) { - ND_PRINT((ndo, "(jumbo: trunc)")); + ND_PRINT("(jumbo: trunc)"); goto trunc; } if (EXTRACT_U_1(bp + i + 1) != IP6OPT_JUMBO_LEN - 2) { - ND_PRINT((ndo, "(jumbo: invalid len %d)", EXTRACT_U_1(bp + i + 1))); + ND_PRINT("(jumbo: invalid len %d)", EXTRACT_U_1(bp + i + 1)); goto trunc; } - ND_PRINT((ndo, "(jumbo: %u) ", EXTRACT_BE_U_4(bp + i + 2))); + ND_PRINT("(jumbo: %u) ", EXTRACT_BE_U_4(bp + i + 2)); break; case IP6OPT_HOME_ADDRESS: if (len - i < IP6OPT_HOMEADDR_MINLEN) { - ND_PRINT((ndo, "(homeaddr: trunc)")); + ND_PRINT("(homeaddr: trunc)"); goto trunc; } if (EXTRACT_U_1(bp + i + 1) < IP6OPT_HOMEADDR_MINLEN - 2) { - ND_PRINT((ndo, "(homeaddr: invalid len %d)", EXTRACT_U_1(bp + i + 1))); + ND_PRINT("(homeaddr: invalid len %d)", EXTRACT_U_1(bp + i + 1)); goto trunc; } - ND_PRINT((ndo, "(homeaddr: %s", ip6addr_string(ndo, bp + i + 2))); + ND_PRINT("(homeaddr: %s", ip6addr_string(ndo, bp + i + 2)); if (EXTRACT_U_1(bp + i + 1) > IP6OPT_HOMEADDR_MINLEN - 2) { ip6_sopt_print(ndo, bp + i + IP6OPT_HOMEADDR_MINLEN, (optlen - IP6OPT_HOMEADDR_MINLEN)); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; default: if (len - i < IP6OPT_MINLEN) { - ND_PRINT((ndo, "(type %d: trunc)", EXTRACT_U_1(bp + i))); + ND_PRINT("(type %d: trunc)", EXTRACT_U_1(bp + i)); goto trunc; } - ND_PRINT((ndo, "(opt_type 0x%02x: len=%d)", EXTRACT_U_1(bp + i), EXTRACT_U_1(bp + i + 1))); + ND_PRINT("(opt_type 0x%02x: len=%d)", EXTRACT_U_1(bp + i), EXTRACT_U_1(bp + i + 1)); break; } } - ND_PRINT((ndo, " ")); + ND_PRINT(" "); return; trunc: - ND_PRINT((ndo, "[trunc] ")); + ND_PRINT("[trunc] "); } int @@ -179,14 +179,14 @@ hbhopt_print(netdissect_options *ndo, const u_char *bp) ND_TCHECK(dp->ip6h_len); hbhlen = (EXTRACT_U_1(dp->ip6h_len) + 1) << 3; ND_TCHECK_LEN(dp, hbhlen); - ND_PRINT((ndo, "HBH ")); + ND_PRINT("HBH "); if (ndo->ndo_vflag) ip6_opt_print(ndo, (const u_char *)dp + sizeof(*dp), hbhlen - sizeof(*dp)); return(hbhlen); trunc: - ND_PRINT((ndo, "[|HBH]")); + ND_PRINT("[|HBH]"); return(-1); } @@ -199,7 +199,7 @@ dstopt_print(netdissect_options *ndo, const u_char *bp) ND_TCHECK(dp->ip6d_len); dstoptlen = (EXTRACT_U_1(dp->ip6d_len) + 1) << 3; ND_TCHECK_LEN(dp, dstoptlen); - ND_PRINT((ndo, "DSTOPT ")); + ND_PRINT("DSTOPT "); if (ndo->ndo_vflag) { ip6_opt_print(ndo, (const u_char *)dp + sizeof(*dp), dstoptlen - sizeof(*dp)); @@ -208,6 +208,6 @@ dstopt_print(netdissect_options *ndo, const u_char *bp) return(dstoptlen); trunc: - ND_PRINT((ndo, "[|DSTOPT]")); + ND_PRINT("[|DSTOPT]"); return(-1); } diff --git a/print-ipcomp.c b/print-ipcomp.c index acbbb37f..dea9ba76 100644 --- a/print-ipcomp.c +++ b/print-ipcomp.c @@ -46,7 +46,7 @@ ipcomp_print(netdissect_options *ndo, const u_char *bp) ND_TCHECK_SIZE(ipcomp); cpi = EXTRACT_BE_U_2(ipcomp->comp_cpi); - ND_PRINT((ndo, "IPComp(cpi=0x%04x)", cpi)); + ND_PRINT("IPComp(cpi=0x%04x)", cpi); /* * XXX - based on the CPI, we could decompress the packet here. @@ -64,6 +64,6 @@ ipcomp_print(netdissect_options *ndo, const u_char *bp) return; trunc: - ND_PRINT((ndo, "[|IPCOMP]")); + ND_PRINT("[|IPCOMP]"); return; } diff --git a/print-ipfc.c b/print-ipfc.c index b67e7f2d..c56fc220 100644 --- a/print-ipfc.c +++ b/print-ipfc.c @@ -83,7 +83,7 @@ ipfc_hdr_print(netdissect_options *ndo, * so, for captures following this specification, the upper 16 * bits should be 0x1000, followed by a MAC address. */ - ND_PRINT((ndo, "%s > %s, length %u: ", srcname, dstname, length)); + ND_PRINT("%s > %s, length %u: ", srcname, dstname, length); } static u_int @@ -95,7 +95,7 @@ ipfc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen) int llc_hdrlen; if (caplen < IPFC_HDRLEN) { - ND_PRINT((ndo, "[|ipfc]")); + ND_PRINT("[|ipfc]"); return (caplen); } /* diff --git a/print-ipnet.c b/print-ipnet.c index f02bfaf7..d013caf1 100644 --- a/print-ipnet.c +++ b/print-ipnet.c @@ -40,25 +40,25 @@ ipnet_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) hdr = (const ipnet_hdr_t *)bp; ND_TCHECK_SIZE(hdr); - ND_PRINT((ndo, "%d > %d", EXTRACT_BE_U_4(hdr->iph_zsrc), - EXTRACT_BE_U_4(hdr->iph_zdst))); + ND_PRINT("%d > %d", EXTRACT_BE_U_4(hdr->iph_zsrc), + EXTRACT_BE_U_4(hdr->iph_zdst)); if (!ndo->ndo_qflag) { - ND_PRINT((ndo,", family %s (%d)", + ND_PRINT(", family %s (%d)", tok2str(ipnet_values, "Unknown", EXTRACT_U_1(hdr->iph_family)), - EXTRACT_U_1(hdr->iph_family))); + EXTRACT_U_1(hdr->iph_family)); } else { - ND_PRINT((ndo,", %s", + ND_PRINT(", %s", tok2str(ipnet_values, "Unknown Ethertype (0x%04x)", - EXTRACT_U_1(hdr->iph_family)))); + EXTRACT_U_1(hdr->iph_family))); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); return; trunc: - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); } static void @@ -99,7 +99,7 @@ ipnet_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen } return; trunc: - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); } /* diff --git a/print-ipx.c b/print-ipx.c index 992612f5..f1ef218e 100644 --- a/print-ipx.c +++ b/print-ipx.c @@ -74,16 +74,16 @@ ipx_print(netdissect_options *ndo, const u_char *p, u_int length) const struct ipxHdr *ipx = (const struct ipxHdr *)p; if (!ndo->ndo_eflag) - ND_PRINT((ndo, "IPX ")); + ND_PRINT("IPX "); ND_TCHECK(ipx->srcSkt); - ND_PRINT((ndo, "%s.%04x > ", + ND_PRINT("%s.%04x > ", ipxaddr_string(EXTRACT_BE_U_4(ipx->srcNet), ipx->srcNode), - EXTRACT_BE_U_2(ipx->srcSkt))); + EXTRACT_BE_U_2(ipx->srcSkt)); - ND_PRINT((ndo, "%s.%04x: ", + ND_PRINT("%s.%04x: ", ipxaddr_string(EXTRACT_BE_U_4(ipx->dstNet), ipx->dstNode), - EXTRACT_BE_U_2(ipx->dstSkt))); + EXTRACT_BE_U_2(ipx->dstSkt)); /* take length from ipx header */ ND_TCHECK(ipx->length); @@ -92,7 +92,7 @@ ipx_print(netdissect_options *ndo, const u_char *p, u_int length) ipx_decode(ndo, ipx, p + ipxSize, length - ipxSize); return; trunc: - ND_PRINT((ndo, "[|ipx %u]", length)); + ND_PRINT("[|ipx %u]", length); } static const char * @@ -116,7 +116,7 @@ ipx_decode(netdissect_options *ndo, const struct ipxHdr *ipx, const u_char *data dstSkt = EXTRACT_BE_U_2(ipx->dstSkt); switch (dstSkt) { case IPX_SKT_NCP: - ND_PRINT((ndo, "ipx-ncp %u", length)); + ND_PRINT("ipx-ncp %u", length); break; case IPX_SKT_SAP: ipx_sap_print(ndo, datap, length); @@ -125,16 +125,16 @@ ipx_decode(netdissect_options *ndo, const struct ipxHdr *ipx, const u_char *data ipx_rip_print(ndo, datap, length); break; case IPX_SKT_NETBIOS: - ND_PRINT((ndo, "ipx-netbios %u", length)); + ND_PRINT("ipx-netbios %u", length); #ifdef ENABLE_SMB ipx_netbios_print(ndo, datap, length); #endif break; case IPX_SKT_DIAGNOSTICS: - ND_PRINT((ndo, "ipx-diags %u", length)); + ND_PRINT("ipx-diags %u", length); break; case IPX_SKT_NWLINK_DGM: - ND_PRINT((ndo, "ipx-nwlink-dgm %u", length)); + ND_PRINT("ipx-nwlink-dgm %u", length); #ifdef ENABLE_SMB ipx_netbios_print(ndo, datap, length); #endif @@ -143,7 +143,7 @@ ipx_decode(netdissect_options *ndo, const struct ipxHdr *ipx, const u_char *data eigrp_print(ndo, datap, length); break; default: - ND_PRINT((ndo, "ipx-#%x %u", dstSkt, length)); + ND_PRINT("ipx-#%x %u", dstSkt, length); break; } } @@ -162,37 +162,37 @@ ipx_sap_print(netdissect_options *ndo, const u_char *ipx, u_int length) case 1: case 3: if (command == 1) - ND_PRINT((ndo, "ipx-sap-req")); + ND_PRINT("ipx-sap-req"); else - ND_PRINT((ndo, "ipx-sap-nearest-req")); + ND_PRINT("ipx-sap-nearest-req"); ND_TCHECK_2(ipx); - ND_PRINT((ndo, " %s", ipxsap_string(ndo, htons(EXTRACT_BE_U_2(ipx))))); + ND_PRINT(" %s", ipxsap_string(ndo, htons(EXTRACT_BE_U_2(ipx)))); break; case 2: case 4: if (command == 2) - ND_PRINT((ndo, "ipx-sap-resp")); + ND_PRINT("ipx-sap-resp"); else - ND_PRINT((ndo, "ipx-sap-nearest-resp")); + ND_PRINT("ipx-sap-nearest-resp"); for (i = 0; i < 8 && length != 0; i++) { ND_TCHECK_2(ipx); if (length < 2) goto trunc; - ND_PRINT((ndo, " %s '", ipxsap_string(ndo, htons(EXTRACT_BE_U_2(ipx))))); + ND_PRINT(" %s '", ipxsap_string(ndo, htons(EXTRACT_BE_U_2(ipx)))); ipx += 2; length -= 2; if (length < 48) { - ND_PRINT((ndo, "'")); + ND_PRINT("'"); goto trunc; } if (fn_printzp(ndo, ipx, 48, ndo->ndo_snapend)) { - ND_PRINT((ndo, "'")); + ND_PRINT("'"); goto trunc; } - ND_PRINT((ndo, "'")); + ND_PRINT("'"); ipx += 48; length -= 48; /* @@ -201,8 +201,8 @@ ipx_sap_print(netdissect_options *ndo, const u_char *ipx, u_int length) ND_TCHECK_LEN(ipx, 10); if (length < 10) goto trunc; - ND_PRINT((ndo, " addr %s", - ipxaddr_string(EXTRACT_BE_U_4(ipx), ipx + 4))); + ND_PRINT(" addr %s", + ipxaddr_string(EXTRACT_BE_U_4(ipx), ipx + 4)); ipx += 10; length -= 10; /* @@ -217,12 +217,12 @@ ipx_sap_print(netdissect_options *ndo, const u_char *ipx, u_int length) } break; default: - ND_PRINT((ndo, "ipx-sap-?%x", command)); + ND_PRINT("ipx-sap-?%x", command); break; } return; trunc: - ND_PRINT((ndo, "[|ipx]")); + ND_PRINT("[|ipx]"); } static void @@ -237,33 +237,33 @@ ipx_rip_print(netdissect_options *ndo, const u_char *ipx, u_int length) switch (command) { case 1: - ND_PRINT((ndo, "ipx-rip-req")); + ND_PRINT("ipx-rip-req"); if (length != 0) { if (length < 8) goto trunc; ND_TCHECK_LEN(ipx, 8); - ND_PRINT((ndo, " %08x/%u.%u", EXTRACT_BE_U_4(ipx), - EXTRACT_BE_U_2(ipx + 4), EXTRACT_BE_U_2(ipx + 6))); + ND_PRINT(" %08x/%u.%u", EXTRACT_BE_U_4(ipx), + EXTRACT_BE_U_2(ipx + 4), EXTRACT_BE_U_2(ipx + 6)); } break; case 2: - ND_PRINT((ndo, "ipx-rip-resp")); + ND_PRINT("ipx-rip-resp"); for (i = 0; i < 50 && length != 0; i++) { if (length < 8) goto trunc; ND_TCHECK_LEN(ipx, 8); - ND_PRINT((ndo, " %08x/%u.%u", EXTRACT_BE_U_4(ipx), - EXTRACT_BE_U_2(ipx + 4), EXTRACT_BE_U_2(ipx + 6))); + ND_PRINT(" %08x/%u.%u", EXTRACT_BE_U_4(ipx), + EXTRACT_BE_U_2(ipx + 4), EXTRACT_BE_U_2(ipx + 6)); ipx += 8; length -= 8; } break; default: - ND_PRINT((ndo, "ipx-rip-?%x", command)); + ND_PRINT("ipx-rip-?%x", command); break; } return; trunc: - ND_PRINT((ndo, "[|ipx]")); + ND_PRINT("[|ipx]"); } diff --git a/print-isakmp.c b/print-isakmp.c index e7ce87c0..90892023 100644 --- a/print-isakmp.c +++ b/print-isakmp.c @@ -729,7 +729,7 @@ static const char *etypestr[] = { #define CHECKLEN(p, np) \ if (ep < (const u_char *)(p)) { \ - ND_PRINT((ndo," [|%s]", NPSTR(np))); \ + ND_PRINT(" [|%s]", NPSTR(np)); \ goto done; \ } @@ -844,7 +844,7 @@ hexprint(netdissect_options *ndo, const uint8_t *loc, size_t len) p = loc; for (i = 0; i < len; i++) - ND_PRINT((ndo,"%02x", p[i] & 0xff)); + ND_PRINT("%02x", p[i] & 0xff); } static int @@ -879,13 +879,13 @@ static int ike_show_somedata(netdissect_options *ndo, elen = ep - end; } - ND_PRINT((ndo," data=(")); + ND_PRINT(" data=("); if(!rawprint(ndo, (const uint8_t *)(cp), len)) goto trunc; - ND_PRINT((ndo, "...")); + ND_PRINT("..."); if(elen) { if(!rawprint(ndo, (const uint8_t *)(end), elen)) goto trunc; } - ND_PRINT((ndo,")")); + ND_PRINT(")"); return 1; trunc: @@ -914,37 +914,37 @@ ikev1_attrmap_print(netdissect_options *ndo, totlen = 4 + EXTRACT_BE_U_2(p + 2); } if (ep2 < p + totlen) { - ND_PRINT((ndo,"[|attr]")); + ND_PRINT("[|attr]"); return ep2 + 1; } ND_TCHECK_2(p); - ND_PRINT((ndo,"(")); + ND_PRINT("("); t = EXTRACT_BE_U_2(p) & 0x7fff; if (map && t < nmap && map[t].type) - ND_PRINT((ndo,"type=%s ", map[t].type)); + ND_PRINT("type=%s ", map[t].type); else - ND_PRINT((ndo,"type=#%u ", t)); + ND_PRINT("type=#%u ", t); if (EXTRACT_U_1(p) & 0x80) { - ND_PRINT((ndo,"value=")); + ND_PRINT("value="); ND_TCHECK_2(p + 2); v = EXTRACT_BE_U_2(p + 2); if (map && t < nmap && v < map[t].nvalue && map[t].value[v]) - ND_PRINT((ndo,"%s", map[t].value[v])); + ND_PRINT("%s", map[t].value[v]); else { if (!rawprint(ndo, (const uint8_t *)(p + 2), 2)) { - ND_PRINT((ndo,")")); + ND_PRINT(")"); goto trunc; } } } else { - ND_PRINT((ndo,"len=%u value=", totlen - 4)); + ND_PRINT("len=%u value=", totlen - 4); if (!rawprint(ndo, (const uint8_t *)(p + 4), totlen - 4)) { - ND_PRINT((ndo,")")); + ND_PRINT(")"); goto trunc; } } - ND_PRINT((ndo,")")); + ND_PRINT(")"); return p + totlen; trunc: @@ -965,29 +965,29 @@ ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep2) totlen = 4 + EXTRACT_BE_U_2(p + 2); } if (ep2 < p + totlen) { - ND_PRINT((ndo,"[|attr]")); + ND_PRINT("[|attr]"); return ep2 + 1; } ND_TCHECK_2(p); - ND_PRINT((ndo,"(")); + ND_PRINT("("); t = EXTRACT_BE_U_2(p) & 0x7fff; - ND_PRINT((ndo,"type=#%u ", t)); + ND_PRINT("type=#%u ", t); if (EXTRACT_U_1(p) & 0x80) { - ND_PRINT((ndo,"value=")); + ND_PRINT("value="); t = EXTRACT_U_1(p + 2); if (!rawprint(ndo, (const uint8_t *)(p + 2), 2)) { - ND_PRINT((ndo,")")); + ND_PRINT(")"); goto trunc; } } else { - ND_PRINT((ndo,"len=%u value=", totlen - 4)); + ND_PRINT("len=%u value=", totlen - 4); if (!rawprint(ndo, (const uint8_t *)(p + 4), totlen - 4)) { - ND_PRINT((ndo,")")); + ND_PRINT(")"); goto trunc; } } - ND_PRINT((ndo,")")); + ND_PRINT(")"); return p + totlen; trunc: @@ -1006,37 +1006,37 @@ ikev1_sa_print(netdissect_options *ndo, u_char tpay _U_, const u_char *cp, *np; int t; - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_SA))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_SA)); p = (const struct ikev1_pl_sa *)ext; ND_TCHECK_SIZE(p); doi = EXTRACT_BE_U_4(p->doi); sit = EXTRACT_BE_U_4(p->sit); if (doi != 1) { - ND_PRINT((ndo," doi=%u", doi)); - ND_PRINT((ndo," situation=%u", sit)); + ND_PRINT(" doi=%u", doi); + ND_PRINT(" situation=%u", sit); return (const u_char *)(p + 1); } - ND_PRINT((ndo," doi=ipsec")); - ND_PRINT((ndo," situation=")); + ND_PRINT(" doi=ipsec"); + ND_PRINT(" situation="); t = 0; if (sit & 0x01) { - ND_PRINT((ndo,"identity")); + ND_PRINT("identity"); t++; } if (sit & 0x02) { - ND_PRINT((ndo,"%ssecrecy", t ? "+" : "")); + ND_PRINT("%ssecrecy", t ? "+" : ""); t++; } if (sit & 0x04) - ND_PRINT((ndo,"%sintegrity", t ? "+" : "")); + ND_PRINT("%sintegrity", t ? "+" : ""); np = (const u_char *)ext + sizeof(struct ikev1_pl_sa); if (sit != 0x01) { ND_TCHECK_4(ext + 1); ident = EXTRACT_BE_U_4(ext + 1); - ND_PRINT((ndo," ident=%u", ident)); + ND_PRINT(" ident=%u", ident); np += sizeof(ident); } @@ -1048,7 +1048,7 @@ ikev1_sa_print(netdissect_options *ndo, u_char tpay _U_, return cp; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_SA))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_SA)); return NULL; } @@ -1062,16 +1062,16 @@ ikev1_p_print(netdissect_options *ndo, u_char tpay _U_, const u_char *cp; uint8_t spi_size; - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_P))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_P)); p = (const struct ikev1_pl_p *)ext; ND_TCHECK_SIZE(p); - ND_PRINT((ndo," #%u protoid=%s transform=%u", + ND_PRINT(" #%u protoid=%s transform=%u", EXTRACT_U_1(p->p_no), PROTOIDSTR(EXTRACT_U_1(p->prot_id)), - EXTRACT_U_1(p->num_t))); + EXTRACT_U_1(p->num_t)); spi_size = EXTRACT_U_1(p->spi_size); if (spi_size) { - ND_PRINT((ndo," spi=")); + ND_PRINT(" spi="); if (!rawprint(ndo, (const uint8_t *)(p + 1), spi_size)) goto trunc; } @@ -1084,7 +1084,7 @@ ikev1_p_print(netdissect_options *ndo, u_char tpay _U_, return cp; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_P))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_P)); return NULL; } @@ -1229,7 +1229,7 @@ ikev1_t_print(netdissect_options *ndo, u_char tpay _U_, size_t nmap; const u_char *ep2; - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_T))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_T)); p = (const struct ikev1_pl_t *)ext; ND_TCHECK_SIZE(p); @@ -1263,9 +1263,9 @@ ikev1_t_print(netdissect_options *ndo, u_char tpay _U_, } if (idstr) - ND_PRINT((ndo," #%u id=%s ", EXTRACT_U_1(p->t_no), idstr)); + ND_PRINT(" #%u id=%s ", EXTRACT_U_1(p->t_no), idstr); else - ND_PRINT((ndo," #%u id=%u ", EXTRACT_U_1(p->t_no), EXTRACT_U_1(p->t_id))); + ND_PRINT(" #%u id=%u ", EXTRACT_U_1(p->t_no), EXTRACT_U_1(p->t_id)); cp = (const u_char *)(p + 1); ep2 = (const u_char *)p + item_len; while (cp < ep && cp < ep2) { @@ -1277,10 +1277,10 @@ ikev1_t_print(netdissect_options *ndo, u_char tpay _U_, goto trunc; } if (ep < ep2) - ND_PRINT((ndo,"...")); + ND_PRINT("..."); return cp; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_T))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_T)); return NULL; } @@ -1290,22 +1290,22 @@ ikev1_ke_print(netdissect_options *ndo, u_char tpay _U_, const u_char *ep _U_, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_KE))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_KE)); ND_TCHECK_SIZE(ext); /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," key len=%u", item_len - 4)); + ND_PRINT(" key len=%u", item_len - 4); if (2 < ndo->ndo_vflag && item_len > 4) { /* Print the entire payload in hex */ - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_KE))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_KE)); return NULL; } @@ -1328,7 +1328,7 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_, u_int len; const u_char *data; - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_ID))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_ID)); p = (const struct ikev1_pl_id *)ext; ND_TCHECK_SIZE(p); @@ -1341,16 +1341,16 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_, } #if 0 /*debug*/ - ND_PRINT((ndo," [phase=%u doi=%u proto=%u]", phase, doi, proto)); + ND_PRINT(" [phase=%u doi=%u proto=%u]", phase, doi, proto); #endif switch (phase) { #ifndef USE_IPSECDOI_IN_PHASE1 case 1: #endif default: - ND_PRINT((ndo," idtype=%s", STR_OR_ID(EXTRACT_U_1(p->d.id_type), idtypestr))); - ND_PRINT((ndo," doi_data=%u", - EXTRACT_BE_U_4(p->d.doi_data) & 0xffffff)); + ND_PRINT(" idtype=%s", STR_OR_ID(EXTRACT_U_1(p->d.id_type), idtypestr)); + ND_PRINT(" doi_data=%u", + EXTRACT_BE_U_4(p->d.doi_data) & 0xffffff); break; #ifdef USE_IPSECDOI_IN_PHASE1 @@ -1365,14 +1365,14 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_, doi_p = (const struct ipsecdoi_id *)ext; ND_TCHECK_SIZE(doi_p); type = EXTRACT_U_1(doi_p->type); - ND_PRINT((ndo," idtype=%s", STR_OR_ID(type, ipsecidtypestr))); + ND_PRINT(" idtype=%s", STR_OR_ID(type, ipsecidtypestr)); /* A protocol ID of 0 DOES NOT mean IPPROTO_IP! */ proto_id = EXTRACT_U_1(doi_p->proto_id); if (!ndo->ndo_nflag && proto_id && (p_name = netdb_protoname(proto_id)) != NULL) - ND_PRINT((ndo," protoid=%s", p_name)); + ND_PRINT(" protoid=%s", p_name); else - ND_PRINT((ndo," protoid=%u", proto_id)); - ND_PRINT((ndo," port=%u", EXTRACT_BE_U_2(doi_p->port))); + ND_PRINT(" protoid=%u", proto_id); + ND_PRINT(" port=%u", EXTRACT_BE_U_2(doi_p->port)); if (!len) break; if (data == NULL) @@ -1381,16 +1381,16 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_, switch (type) { case IPSECDOI_ID_IPV4_ADDR: if (len < 4) - ND_PRINT((ndo," len=%u [bad: < 4]", len)); + ND_PRINT(" len=%u [bad: < 4]", len); else - ND_PRINT((ndo," len=%u %s", len, ipaddr_string(ndo, data))); + ND_PRINT(" len=%u %s", len, ipaddr_string(ndo, data)); len = 0; break; case IPSECDOI_ID_FQDN: case IPSECDOI_ID_USER_FQDN: { u_int i; - ND_PRINT((ndo," len=%u ", len)); + ND_PRINT(" len=%u ", len); for (i = 0; i < len; i++) safeputchar(ndo, EXTRACT_U_1(data + i)); len = 0; @@ -1400,59 +1400,59 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_, { const u_char *mask; if (len < 8) - ND_PRINT((ndo," len=%u [bad: < 8]", len)); + ND_PRINT(" len=%u [bad: < 8]", len); else { mask = data + sizeof(struct in_addr); - ND_PRINT((ndo," len=%u %s/%u.%u.%u.%u", len, + ND_PRINT(" len=%u %s/%u.%u.%u.%u", len, ipaddr_string(ndo, data), EXTRACT_U_1(mask), EXTRACT_U_1(mask + 1), - EXTRACT_U_1(mask + 2), EXTRACT_U_1(mask + 3))); + EXTRACT_U_1(mask + 2), EXTRACT_U_1(mask + 3)); } len = 0; break; } case IPSECDOI_ID_IPV6_ADDR: if (len < 16) - ND_PRINT((ndo," len=%u [bad: < 16]", len)); + ND_PRINT(" len=%u [bad: < 16]", len); else - ND_PRINT((ndo," len=%u %s", len, ip6addr_string(ndo, data))); + ND_PRINT(" len=%u %s", len, ip6addr_string(ndo, data)); len = 0; break; case IPSECDOI_ID_IPV6_ADDR_SUBNET: { const u_char *mask; if (len < 32) - ND_PRINT((ndo," len=%u [bad: < 32]", len)); + ND_PRINT(" len=%u [bad: < 32]", len); else { mask = (const u_char *)(data + sizeof(struct in6_addr)); /*XXX*/ - ND_PRINT((ndo," len=%u %s/0x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", len, + ND_PRINT(" len=%u %s/0x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", len, ip6addr_string(ndo, data), EXTRACT_U_1(mask), EXTRACT_U_1(mask + 1), EXTRACT_U_1(mask + 2), EXTRACT_U_1(mask + 3), EXTRACT_U_1(mask + 4), EXTRACT_U_1(mask + 5), EXTRACT_U_1(mask + 6), EXTRACT_U_1(mask + 7), EXTRACT_U_1(mask + 8), EXTRACT_U_1(mask + 9), EXTRACT_U_1(mask + 10), EXTRACT_U_1(mask + 11), - EXTRACT_U_1(mask + 12), EXTRACT_U_1(mask + 13), EXTRACT_U_1(mask + 14), EXTRACT_U_1(mask + 15))); + EXTRACT_U_1(mask + 12), EXTRACT_U_1(mask + 13), EXTRACT_U_1(mask + 14), EXTRACT_U_1(mask + 15)); } len = 0; break; } case IPSECDOI_ID_IPV4_ADDR_RANGE: if (len < 8) - ND_PRINT((ndo," len=%u [bad: < 8]", len)); + ND_PRINT(" len=%u [bad: < 8]", len); else { - ND_PRINT((ndo," len=%u %s-%s", len, + ND_PRINT(" len=%u %s-%s", len, ipaddr_string(ndo, data), - ipaddr_string(ndo, data + sizeof(struct in_addr)))); + ipaddr_string(ndo, data + sizeof(struct in_addr))); } len = 0; break; case IPSECDOI_ID_IPV6_ADDR_RANGE: if (len < 32) - ND_PRINT((ndo," len=%u [bad: < 32]", len)); + ND_PRINT(" len=%u [bad: < 32]", len); else { - ND_PRINT((ndo," len=%u %s-%s", len, + ND_PRINT(" len=%u %s-%s", len, ip6addr_string(ndo, data), - ip6addr_string(ndo, data + sizeof(struct in6_addr)))); + ip6addr_string(ndo, data + sizeof(struct in6_addr))); } len = 0; break; @@ -1465,16 +1465,16 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_, } } if (data && len) { - ND_PRINT((ndo," len=%u", len)); + ND_PRINT(" len=%u", len); if (2 < ndo->ndo_vflag) { - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)data, len)) goto trunc; } } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_ID))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_ID)); return NULL; } @@ -1492,24 +1492,24 @@ ikev1_cert_print(netdissect_options *ndo, u_char tpay _U_, "arl", "spki", "x509attr", }; - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_CERT))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_CERT)); p = (const struct ikev1_pl_cert *)ext; ND_TCHECK_SIZE(p); /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u", item_len - 4)); - ND_PRINT((ndo," type=%s", STR_OR_ID(EXTRACT_U_1(p->encode), certstr))); + ND_PRINT(" len=%u", item_len - 4); + ND_PRINT(" type=%s", STR_OR_ID(EXTRACT_U_1(p->encode), certstr)); if (2 < ndo->ndo_vflag && 4 < item_len) { /* Print the entire payload in hex */ - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_CERT))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_CERT)); return NULL; } @@ -1526,24 +1526,24 @@ ikev1_cr_print(netdissect_options *ndo, u_char tpay _U_, "arl", "spki", "x509attr", }; - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_CR))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_CR)); p = (const struct ikev1_pl_cert *)ext; ND_TCHECK_SIZE(p); /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u", item_len - 4)); - ND_PRINT((ndo," type=%s", STR_OR_ID(EXTRACT_U_1(p->encode), certstr))); + ND_PRINT(" len=%u", item_len - 4); + ND_PRINT(" type=%s", STR_OR_ID(EXTRACT_U_1(p->encode), certstr)); if (2 < ndo->ndo_vflag && 4 < item_len) { /* Print the entire payload in hex */ - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_CR))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_CR)); return NULL; } @@ -1553,22 +1553,22 @@ ikev1_hash_print(netdissect_options *ndo, u_char tpay _U_, const u_char *ep _U_, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_HASH))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_HASH)); ND_TCHECK_SIZE(ext); /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u", item_len - 4)); + ND_PRINT(" len=%u", item_len - 4); if (2 < ndo->ndo_vflag && 4 < item_len) { /* Print the entire payload in hex */ - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_HASH))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_HASH)); return NULL; } @@ -1578,22 +1578,22 @@ ikev1_sig_print(netdissect_options *ndo, u_char tpay _U_, const u_char *ep _U_, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_SIG))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_SIG)); ND_TCHECK_SIZE(ext); /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u", item_len - 4)); + ND_PRINT(" len=%u", item_len - 4); if (2 < ndo->ndo_vflag && 4 < item_len) { /* Print the entire payload in hex */ - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_SIG))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_SIG)); return NULL; } @@ -1605,27 +1605,27 @@ ikev1_nonce_print(netdissect_options *ndo, u_char tpay _U_, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_NONCE))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_NONCE)); ND_TCHECK_SIZE(ext); /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," n len=%u", item_len - 4)); + ND_PRINT(" n len=%u", item_len - 4); if (item_len > 4) { if (ndo->ndo_vflag > 2) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } else if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (!ike_show_somedata(ndo, (const u_char *)(ext + 1), ep)) goto trunc; } } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_NONCE))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_NONCE)); return NULL; } @@ -1688,49 +1688,49 @@ ikev1_n_print(netdissect_options *ndo, u_char tpay _U_, #define IPSEC_NOTIFY_STATUS_STR(x) \ STR_OR_ID((u_int)((x) - 24576), ipsec_notify_status_str) - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_N))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_N)); p = (const struct ikev1_pl_n *)ext; ND_TCHECK_SIZE(p); doi = EXTRACT_BE_U_4(p->doi); proto = EXTRACT_U_1(p->prot_id); if (doi != 1) { - ND_PRINT((ndo," doi=%u", doi)); - ND_PRINT((ndo," proto=%u", proto)); + ND_PRINT(" doi=%u", doi); + ND_PRINT(" proto=%u", proto); type = EXTRACT_BE_U_2(p->type); if (type < 8192) - ND_PRINT((ndo," type=%s", NOTIFY_ERROR_STR(type))); + ND_PRINT(" type=%s", NOTIFY_ERROR_STR(type)); else if (type < 16384) - ND_PRINT((ndo," type=%s", numstr(type))); + ND_PRINT(" type=%s", numstr(type)); else if (type < 24576) - ND_PRINT((ndo," type=%s", NOTIFY_STATUS_STR(type))); + ND_PRINT(" type=%s", NOTIFY_STATUS_STR(type)); else - ND_PRINT((ndo," type=%s", numstr(type))); + ND_PRINT(" type=%s", numstr(type)); spi_size = EXTRACT_U_1(p->spi_size); if (spi_size) { - ND_PRINT((ndo," spi=")); + ND_PRINT(" spi="); if (!rawprint(ndo, (const uint8_t *)(p + 1), spi_size)) goto trunc; } return (const u_char *)(p + 1) + spi_size; } - ND_PRINT((ndo," doi=ipsec")); - ND_PRINT((ndo," proto=%s", PROTOIDSTR(proto))); + ND_PRINT(" doi=ipsec"); + ND_PRINT(" proto=%s", PROTOIDSTR(proto)); type = EXTRACT_BE_U_2(p->type); if (type < 8192) - ND_PRINT((ndo," type=%s", NOTIFY_ERROR_STR(type))); + ND_PRINT(" type=%s", NOTIFY_ERROR_STR(type)); else if (type < 16384) - ND_PRINT((ndo," type=%s", IPSEC_NOTIFY_ERROR_STR(type))); + ND_PRINT(" type=%s", IPSEC_NOTIFY_ERROR_STR(type)); else if (type < 24576) - ND_PRINT((ndo," type=%s", NOTIFY_STATUS_STR(type))); + ND_PRINT(" type=%s", NOTIFY_STATUS_STR(type)); else if (type < 32768) - ND_PRINT((ndo," type=%s", IPSEC_NOTIFY_STATUS_STR(type))); + ND_PRINT(" type=%s", IPSEC_NOTIFY_STATUS_STR(type)); else - ND_PRINT((ndo," type=%s", numstr(type))); + ND_PRINT(" type=%s", numstr(type)); spi_size = EXTRACT_U_1(p->spi_size); if (spi_size) { - ND_PRINT((ndo," spi=")); + ND_PRINT(" spi="); if (!rawprint(ndo, (const uint8_t *)(p + 1), spi_size)) goto trunc; } @@ -1744,22 +1744,22 @@ ikev1_n_print(netdissect_options *ndo, u_char tpay _U_, { const struct attrmap *map = oakley_t_map; size_t nmap = sizeof(oakley_t_map)/sizeof(oakley_t_map[0]); - ND_PRINT((ndo," attrs=(")); + ND_PRINT(" attrs=("); while (cp < ep && cp < ep2) { cp = ikev1_attrmap_print(ndo, cp, ep2, map, nmap); if (cp == NULL) { - ND_PRINT((ndo,")")); + ND_PRINT(")"); goto trunc; } } - ND_PRINT((ndo,")")); + ND_PRINT(")"); break; } case IPSECDOI_NTYPE_REPLAY_STATUS: - ND_PRINT((ndo," status=(")); - ND_PRINT((ndo,"replay detection %sabled", - EXTRACT_BE_U_4(cp) ? "en" : "dis")); - ND_PRINT((ndo,")")); + ND_PRINT(" status=("); + ND_PRINT("replay detection %sabled", + EXTRACT_BE_U_4(cp) ? "en" : "dis"); + ND_PRINT(")"); break; default: /* @@ -1767,10 +1767,10 @@ ikev1_n_print(netdissect_options *ndo, u_char tpay _U_, * draft-ietf-ipsec-notifymsg-04. */ if (ndo->ndo_vflag > 3) { - ND_PRINT((ndo," data=(")); + ND_PRINT(" data=("); if (!rawprint(ndo, (const uint8_t *)(cp), ep - cp)) goto trunc; - ND_PRINT((ndo,")")); + ND_PRINT(")"); } else { if (!ike_show_somedata(ndo, cp, ep)) goto trunc; @@ -1780,7 +1780,7 @@ ikev1_n_print(netdissect_options *ndo, u_char tpay _U_, } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_N))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_N)); return NULL; } @@ -1798,35 +1798,35 @@ ikev1_d_print(netdissect_options *ndo, u_char tpay _U_, uint16_t num_spi; u_int i; - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_D))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_D)); p = (const struct ikev1_pl_d *)ext; ND_TCHECK_SIZE(p); doi = EXTRACT_BE_U_4(p->doi); proto = EXTRACT_U_1(p->prot_id); if (doi != 1) { - ND_PRINT((ndo," doi=%u", doi)); - ND_PRINT((ndo," proto=%u", proto)); + ND_PRINT(" doi=%u", doi); + ND_PRINT(" proto=%u", proto); } else { - ND_PRINT((ndo," doi=ipsec")); - ND_PRINT((ndo," proto=%s", PROTOIDSTR(proto))); + ND_PRINT(" doi=ipsec"); + ND_PRINT(" proto=%s", PROTOIDSTR(proto)); } spi_size = EXTRACT_U_1(p->spi_size); - ND_PRINT((ndo," spilen=%u", spi_size)); + ND_PRINT(" spilen=%u", spi_size); num_spi = EXTRACT_BE_U_2(p->num_spi); - ND_PRINT((ndo," nspi=%u", num_spi)); - ND_PRINT((ndo," spi=")); + ND_PRINT(" nspi=%u", num_spi); + ND_PRINT(" spi="); q = (const uint8_t *)(p + 1); for (i = 0; i < num_spi; i++) { if (i != 0) - ND_PRINT((ndo,",")); + ND_PRINT(","); if (!rawprint(ndo, (const uint8_t *)q, spi_size)) goto trunc; q += spi_size; } return q; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_D))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_D)); return NULL; } @@ -1837,22 +1837,22 @@ ikev1_vid_print(netdissect_options *ndo, u_char tpay _U_, uint32_t phase _U_, uint32_t doi _U_, uint32_t proto _U_, int depth _U_) { - ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_VID))); + ND_PRINT("%s:", NPSTR(ISAKMP_NPTYPE_VID)); ND_TCHECK_SIZE(ext); /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u", item_len - 4)); + ND_PRINT(" len=%u", item_len - 4); if (2 < ndo->ndo_vflag && 4 < item_len) { /* Print the entire payload in hex */ - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_VID))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_VID)); return NULL; } @@ -1865,7 +1865,7 @@ trunc: static void ikev2_pay_print(netdissect_options *ndo, const char *payname, uint8_t critical) { - ND_PRINT((ndo,"%s%s:", payname, critical&0x80 ? "[C]" : "")); + ND_PRINT("%s%s:", payname, critical&0x80 ? "[C]" : ""); } static const u_char * @@ -1880,16 +1880,16 @@ ikev2_gen_print(netdissect_options *ndo, u_char tpay, /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u", item_len - 4)); + ND_PRINT(" len=%u", item_len - 4); if (2 < ndo->ndo_vflag && 4 < item_len) { /* Print the entire payload in hex */ - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(tpay))); + ND_PRINT(" [|%s]", NPSTR(tpay)); return NULL; } @@ -1946,13 +1946,13 @@ ikev2_t_print(netdissect_options *ndo, int tcount, } if (idstr) - ND_PRINT((ndo," #%u type=%s id=%s ", tcount, + ND_PRINT(" #%u type=%s id=%s ", tcount, STR_OR_ID(t_type, ikev2_t_type_map), - idstr)); + idstr); else - ND_PRINT((ndo," #%u type=%s id=%u ", tcount, + ND_PRINT(" #%u type=%s id=%u ", tcount, STR_OR_ID(t_type, ikev2_t_type_map), - t_id)); + t_id); cp = (const u_char *)(p + 1); ep2 = (const u_char *)p + item_len; while (cp < ep && cp < ep2) { @@ -1964,10 +1964,10 @@ ikev2_t_print(netdissect_options *ndo, int tcount, goto trunc; } if (ep < ep2) - ND_PRINT((ndo,"...")); + ND_PRINT("..."); return cp; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_T))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_T)); return NULL; } @@ -1994,16 +1994,16 @@ ikev2_p_print(netdissect_options *ndo, u_char tpay _U_, int pcount _U_, * ikev2_sa_print() guarantees that this is >= 4. */ prop_length = oprop_length - 4; - ND_PRINT((ndo," #%u protoid=%s transform=%u len=%u", + ND_PRINT(" #%u protoid=%s transform=%u len=%u", EXTRACT_U_1(p->p_no), PROTOIDSTR(EXTRACT_U_1(p->prot_id)), - EXTRACT_U_1(p->num_t), oprop_length)); + EXTRACT_U_1(p->num_t), oprop_length); cp = (const u_char *)(p + 1); spi_size = EXTRACT_U_1(p->spi_size); if (spi_size) { if (prop_length < spi_size) goto toolong; - ND_PRINT((ndo," spi=")); + ND_PRINT(" spi="); if (!rawprint(ndo, (const uint8_t *)cp, spi_size)) goto trunc; cp += spi_size; @@ -2036,10 +2036,10 @@ ikev2_p_print(netdissect_options *ndo, u_char tpay _U_, int pcount _U_, ND_TCHECK_LEN(cp, item_len); depth++; - ND_PRINT((ndo,"\n")); + ND_PRINT("\n"); for (i = 0; i < depth; i++) - ND_PRINT((ndo," ")); - ND_PRINT((ndo,"(")); + ND_PRINT(" "); + ND_PRINT("("); if (np == ISAKMP_NPTYPE_T) { cp = ikev2_t_print(ndo, tcount, ext, item_len, ep); if (cp == NULL) { @@ -2047,10 +2047,10 @@ ikev2_p_print(netdissect_options *ndo, u_char tpay _U_, int pcount _U_, return NULL; } } else { - ND_PRINT((ndo, "%s", NPSTR(np))); + ND_PRINT("%s", NPSTR(np)); cp += item_len; } - ND_PRINT((ndo,")")); + ND_PRINT(")"); depth--; prop_length -= item_len; } @@ -2060,10 +2060,10 @@ toolong: * Skip the rest of the proposal. */ cp += prop_length; - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_P))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_P)); return cp; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_P))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_P)); return NULL; } @@ -2090,7 +2090,7 @@ ikev2_sa_print(netdissect_options *ndo, u_char tpay, */ osa_length= EXTRACT_BE_U_2(ext1->len); sa_length = osa_length - 4; - ND_PRINT((ndo," len=%u", sa_length)); + ND_PRINT(" len=%u", sa_length); /* * Print the payloads. @@ -2119,10 +2119,10 @@ ikev2_sa_print(netdissect_options *ndo, u_char tpay, ND_TCHECK_LEN(cp, item_len); depth++; - ND_PRINT((ndo,"\n")); + ND_PRINT("\n"); for (i = 0; i < depth; i++) - ND_PRINT((ndo," ")); - ND_PRINT((ndo,"(")); + ND_PRINT(" "); + ND_PRINT("("); if (np == ISAKMP_NPTYPE_P) { cp = ikev2_p_print(ndo, np, pcount, ext, item_len, ep, depth); @@ -2131,10 +2131,10 @@ ikev2_sa_print(netdissect_options *ndo, u_char tpay, return NULL; } } else { - ND_PRINT((ndo, "%s", NPSTR(np))); + ND_PRINT("%s", NPSTR(np)); cp += item_len; } - ND_PRINT((ndo,")")); + ND_PRINT(")"); depth--; sa_length -= item_len; } @@ -2144,10 +2144,10 @@ toolong: * Skip the rest of the SA. */ cp += sa_length; - ND_PRINT((ndo," [|%s]", NPSTR(tpay))); + ND_PRINT(" [|%s]", NPSTR(tpay)); return cp; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(tpay))); + ND_PRINT(" [|%s]", NPSTR(tpay)); return NULL; } @@ -2165,20 +2165,20 @@ ikev2_ke_print(netdissect_options *ndo, u_char tpay, ikev2_pay_print(ndo, NPSTR(tpay), EXTRACT_U_1(k->h.critical)); if (item_len < 8) { - ND_PRINT((ndo," len=%u < 8", item_len)); + ND_PRINT(" len=%u < 8", item_len); return (const u_char *)ext + item_len; } - ND_PRINT((ndo," len=%u group=%s", item_len - 8, - STR_OR_ID(EXTRACT_BE_U_2(k->ke_group), dh_p_map))); + ND_PRINT(" len=%u group=%s", item_len - 8, + STR_OR_ID(EXTRACT_BE_U_2(k->ke_group), dh_p_map)); if (2 < ndo->ndo_vflag && 8 < item_len) { - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(k + 1), item_len - 8)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(tpay))); + ND_PRINT(" [|%s]", NPSTR(tpay)); return NULL; } @@ -2201,10 +2201,10 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay, /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u", item_len - 4)); + ND_PRINT(" len=%u", item_len - 4); if (2 < ndo->ndo_vflag && 4 < item_len) { /* Print the entire payload in hex */ - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } @@ -2216,31 +2216,31 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay, switch(EXTRACT_U_1(idp->type)) { case ID_IPV4_ADDR: - ND_PRINT((ndo, " ipv4:")); + ND_PRINT(" ipv4:"); dumphex=1; break; case ID_FQDN: - ND_PRINT((ndo, " fqdn:")); + ND_PRINT(" fqdn:"); dumpascii=1; break; case ID_RFC822_ADDR: - ND_PRINT((ndo, " rfc822:")); + ND_PRINT(" rfc822:"); dumpascii=1; break; case ID_IPV6_ADDR: - ND_PRINT((ndo, " ipv6:")); + ND_PRINT(" ipv6:"); dumphex=1; break; case ID_DER_ASN1_DN: - ND_PRINT((ndo, " dn:")); + ND_PRINT(" dn:"); dumphex=1; break; case ID_DER_ASN1_GN: - ND_PRINT((ndo, " gn:")); + ND_PRINT(" gn:"); dumphex=1; break; case ID_KEY_ID: - ND_PRINT((ndo, " keyid:")); + ND_PRINT(" keyid:"); dumphex=1; break; } @@ -2249,9 +2249,9 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay, ND_TCHECK_LEN(typedata, idtype_len); for(i=0; i<idtype_len; i++) { if(ND_ISPRINT(EXTRACT_U_1(typedata + i))) { - ND_PRINT((ndo, "%c", EXTRACT_U_1(typedata + i))); + ND_PRINT("%c", EXTRACT_U_1(typedata + i)); } else { - ND_PRINT((ndo, ".")); + ND_PRINT("."); } } } @@ -2262,7 +2262,7 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay, return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(tpay))); + ND_PRINT(" [|%s]", NPSTR(tpay)); return NULL; } @@ -2305,14 +2305,14 @@ ikev2_auth_print(netdissect_options *ndo, u_char tpay, /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u method=%s", item_len-4, - STR_OR_ID(EXTRACT_U_1(p->auth_method), v2_auth))); + ND_PRINT(" len=%u method=%s", item_len-4, + STR_OR_ID(EXTRACT_U_1(p->auth_method), v2_auth)); if (item_len > 4) { if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, " authdata=(")); + ND_PRINT(" authdata=("); if (!rawprint(ndo, (const uint8_t *)authdata, item_len - sizeof(struct ikev2_auth))) goto trunc; - ND_PRINT((ndo, ") ")); + ND_PRINT(") "); } else if (ndo->ndo_vflag) { if (!ike_show_somedata(ndo, authdata, ep)) goto trunc; @@ -2321,7 +2321,7 @@ ikev2_auth_print(netdissect_options *ndo, u_char tpay, return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(tpay))); + ND_PRINT(" [|%s]", NPSTR(tpay)); return NULL; } @@ -2338,19 +2338,19 @@ ikev2_nonce_print(netdissect_options *ndo, u_char tpay, /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u", item_len - 4)); + ND_PRINT(" len=%u", item_len - 4); if (1 < ndo->ndo_vflag && 4 < item_len) { - ND_PRINT((ndo," nonce=(")); + ND_PRINT(" nonce=("); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; - ND_PRINT((ndo,") ")); + ND_PRINT(") "); } else if(ndo->ndo_vflag && 4 < item_len) { if(!ike_show_somedata(ndo, (const u_char *)(ext+1), ep)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(tpay))); + ND_PRINT(" [|%s]", NPSTR(tpay)); return NULL; } @@ -2377,7 +2377,7 @@ ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, showsomedata=0; notify_name=NULL; - ND_PRINT((ndo," prot_id=%s", PROTOIDSTR(EXTRACT_U_1(p->prot_id)))); + ND_PRINT(" prot_id=%s", PROTOIDSTR(EXTRACT_U_1(p->prot_id))); type = EXTRACT_BE_U_2(p->type); @@ -2527,13 +2527,13 @@ ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, } if(notify_name) { - ND_PRINT((ndo," type=%u(%s)", type, notify_name)); + ND_PRINT(" type=%u(%s)", type, notify_name); } spi_size = EXTRACT_U_1(p->spi_size); if (showspi && spi_size) { - ND_PRINT((ndo," spi=")); + ND_PRINT(" spi="); if (!rawprint(ndo, (const uint8_t *)(p + 1), spi_size)) goto trunc; } @@ -2542,11 +2542,11 @@ ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, if (cp < ep) { if (ndo->ndo_vflag > 3 || (showsomedata && ep-cp < 30)) { - ND_PRINT((ndo," data=(")); + ND_PRINT(" data=("); if (!rawprint(ndo, (const uint8_t *)(cp), ep - cp)) goto trunc; - ND_PRINT((ndo,")")); + ND_PRINT(")"); } else if (showsomedata) { if (!ike_show_somedata(ndo, cp, ep)) goto trunc; @@ -2555,7 +2555,7 @@ ikev2_n_print(netdissect_options *ndo, u_char tpay _U_, return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_N))); + ND_PRINT(" [|%s]", NPSTR(ISAKMP_NPTYPE_N)); return NULL; } @@ -2585,25 +2585,25 @@ ikev2_vid_print(netdissect_options *ndo, u_char tpay, /* * Our caller has ensured that the length is >= 4. */ - ND_PRINT((ndo," len=%u vid=", item_len - 4)); + ND_PRINT(" len=%u vid=", item_len - 4); vid = (const u_char *)(ext+1); len = item_len - 4; ND_TCHECK_LEN(vid, len); for(i=0; i<len; i++) { if(ND_ISPRINT(EXTRACT_U_1(vid + i))) - ND_PRINT((ndo, "%c", EXTRACT_U_1(vid + i))); - else ND_PRINT((ndo, ".")); + ND_PRINT("%c", EXTRACT_U_1(vid + i)); + else ND_PRINT("."); } if (2 < ndo->ndo_vflag && 4 < len) { /* Print the entire payload in hex */ - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), item_len - 4)) goto trunc; } return (const u_char *)ext + item_len; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(tpay))); + ND_PRINT(" [|%s]", NPSTR(tpay)); return NULL; } @@ -2654,9 +2654,9 @@ ikev2_e_print(netdissect_options *ndo, dlen = item_len-4; - ND_PRINT((ndo," len=%u", dlen)); + ND_PRINT(" len=%u", dlen); if (2 < ndo->ndo_vflag && 4 < dlen) { - ND_PRINT((ndo," ")); + ND_PRINT(" "); if (!rawprint(ndo, (const uint8_t *)(ext + 1), dlen)) goto trunc; } @@ -2687,7 +2687,7 @@ ikev2_e_print(netdissect_options *ndo, */ return NULL; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(tpay))); + ND_PRINT(" [|%s]", NPSTR(tpay)); return NULL; } @@ -2740,13 +2740,13 @@ ike_sub0_print(netdissect_options *ndo, */ cp = (*npfunc[np])(ndo, np, ext, item_len, ep, phase, doi, proto, depth); } else { - ND_PRINT((ndo,"%s", NPSTR(np))); + ND_PRINT("%s", NPSTR(np)); cp += item_len; } return cp; trunc: - ND_PRINT((ndo," [|isakmp]")); + ND_PRINT(" [|isakmp]"); return NULL; } @@ -2768,12 +2768,12 @@ ikev1_sub_print(netdissect_options *ndo, ND_TCHECK_LEN(ext, item_len); depth++; - ND_PRINT((ndo,"\n")); + ND_PRINT("\n"); for (i = 0; i < depth; i++) - ND_PRINT((ndo," ")); - ND_PRINT((ndo,"(")); + ND_PRINT(" "); + ND_PRINT("("); cp = ike_sub0_print(ndo, np, ext, ep, phase, doi, proto, depth); - ND_PRINT((ndo,")")); + ND_PRINT(")"); depth--; if (cp == NULL) { @@ -2786,7 +2786,7 @@ ikev1_sub_print(netdissect_options *ndo, } return cp; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(np))); + ND_PRINT(" [|%s]", NPSTR(np)); return NULL; } @@ -2815,39 +2815,39 @@ ikev1_print(netdissect_options *ndo, phase = (EXTRACT_BE_U_4(base->msgid) == 0) ? 1 : 2; if (phase == 1) - ND_PRINT((ndo," phase %u", phase)); + ND_PRINT(" phase %u", phase); else - ND_PRINT((ndo," phase %u/others", phase)); + ND_PRINT(" phase %u/others", phase); i = cookie_find(&base->i_ck); if (i < 0) { if (iszero((const u_char *)&base->r_ck, sizeof(base->r_ck))) { /* the first packet */ - ND_PRINT((ndo," I")); + ND_PRINT(" I"); if (bp2) cookie_record(&base->i_ck, bp2); } else - ND_PRINT((ndo," ?")); + ND_PRINT(" ?"); } else { if (bp2 && cookie_isinitiator(i, bp2)) - ND_PRINT((ndo," I")); + ND_PRINT(" I"); else if (bp2 && cookie_isresponder(i, bp2)) - ND_PRINT((ndo," R")); + ND_PRINT(" R"); else - ND_PRINT((ndo," ?")); + ND_PRINT(" ?"); } - ND_PRINT((ndo," %s", ETYPESTR(EXTRACT_U_1(base->etype)))); + ND_PRINT(" %s", ETYPESTR(EXTRACT_U_1(base->etype))); flags = EXTRACT_U_1(base->flags); if (flags) { - ND_PRINT((ndo,"[%s%s]", flags & ISAKMP_FLAG_E ? "E" : "", - flags & ISAKMP_FLAG_C ? "C" : "")); + ND_PRINT("[%s%s]", flags & ISAKMP_FLAG_E ? "E" : "", + flags & ISAKMP_FLAG_C ? "C" : ""); } if (ndo->ndo_vflag) { const struct isakmp_gen *ext; - ND_PRINT((ndo,":")); + ND_PRINT(":"); np = EXTRACT_U_1(base->np); @@ -2857,7 +2857,7 @@ ikev1_print(netdissect_options *ndo, * encrypted, nothing we can do right now. * we hope to decrypt the packet in the future... */ - ND_PRINT((ndo," [encrypted %s]", NPSTR(np))); + ND_PRINT(" [encrypted %s]", NPSTR(np)); goto done; } @@ -2869,8 +2869,8 @@ ikev1_print(netdissect_options *ndo, done: if (ndo->ndo_vflag) { if (EXTRACT_BE_U_4(base->len) != length) { - ND_PRINT((ndo," (len mismatch: isakmp %u/ip %u)", - EXTRACT_BE_U_4(base->len), length)); + ND_PRINT(" (len mismatch: isakmp %u/ip %u)", + EXTRACT_BE_U_4(base->len), length); } } } @@ -2908,13 +2908,13 @@ ikev2_sub0_print(netdissect_options *ndo, const struct isakmp *base, cp = (*npfunc[np])(ndo, np, ext, item_len, ep, phase, doi, proto, depth); } else { - ND_PRINT((ndo,"%s", NPSTR(np))); + ND_PRINT("%s", NPSTR(np)); cp += item_len; } return cp; trunc: - ND_PRINT((ndo," [|isakmp]")); + ND_PRINT(" [|isakmp]"); return NULL; } @@ -2934,13 +2934,13 @@ ikev2_sub_print(netdissect_options *ndo, ND_TCHECK_LEN(ext, EXTRACT_BE_U_2(ext->len)); depth++; - ND_PRINT((ndo,"\n")); + ND_PRINT("\n"); for (i = 0; i < depth; i++) - ND_PRINT((ndo," ")); - ND_PRINT((ndo,"(")); + ND_PRINT(" "); + ND_PRINT("("); cp = ikev2_sub0_print(ndo, base, np, ext, ep, phase, doi, proto, depth); - ND_PRINT((ndo,")")); + ND_PRINT(")"); depth--; if (cp == NULL) { @@ -2953,7 +2953,7 @@ ikev2_sub_print(netdissect_options *ndo, } return cp; trunc: - ND_PRINT((ndo," [|%s]", NPSTR(np))); + ND_PRINT(" [|%s]", NPSTR(np)); return NULL; } @@ -2973,23 +2973,23 @@ ikev2_print(netdissect_options *ndo, phase = (EXTRACT_BE_U_4(base->msgid) == 0) ? 1 : 2; if (phase == 1) - ND_PRINT((ndo, " parent_sa")); + ND_PRINT(" parent_sa"); else - ND_PRINT((ndo, " child_sa ")); + ND_PRINT(" child_sa "); - ND_PRINT((ndo, " %s", ETYPESTR(EXTRACT_U_1(base->etype)))); + ND_PRINT(" %s", ETYPESTR(EXTRACT_U_1(base->etype))); flags = EXTRACT_U_1(base->flags); if (flags) { - ND_PRINT((ndo, "[%s%s%s]", + ND_PRINT("[%s%s%s]", flags & ISAKMP_FLAG_I ? "I" : "", flags & ISAKMP_FLAG_V ? "V" : "", - flags & ISAKMP_FLAG_R ? "R" : "")); + flags & ISAKMP_FLAG_R ? "R" : ""); } if (ndo->ndo_vflag) { const struct isakmp_gen *ext; - ND_PRINT((ndo, ":")); + ND_PRINT(":"); np = EXTRACT_U_1(base->np); @@ -2999,7 +2999,7 @@ ikev2_print(netdissect_options *ndo, * encrypted, nothing we can do right now. * we hope to decrypt the packet in the future... */ - ND_PRINT((ndo, " [encrypted %s]", NPSTR(np))); + ND_PRINT(" [encrypted %s]", NPSTR(np)); goto done; } @@ -3011,8 +3011,8 @@ ikev2_print(netdissect_options *ndo, done: if (ndo->ndo_vflag) { if (EXTRACT_BE_U_4(base->len) != length) { - ND_PRINT((ndo, " (len mismatch: isakmp %u/ip %u)", - EXTRACT_BE_U_4(base->len), length)); + ND_PRINT(" (len mismatch: isakmp %u/ip %u)", + EXTRACT_BE_U_4(base->len), length); } } } @@ -3038,32 +3038,32 @@ isakmp_print(netdissect_options *ndo, ep = ndo->ndo_snapend; if ((const struct isakmp *)ep < p + 1) { - ND_PRINT((ndo,"[|isakmp]")); + ND_PRINT("[|isakmp]"); return; } - ND_PRINT((ndo,"isakmp")); + ND_PRINT("isakmp"); major = (EXTRACT_U_1(p->vers) & ISAKMP_VERS_MAJOR) >> ISAKMP_VERS_MAJOR_SHIFT; minor = (EXTRACT_U_1(p->vers) & ISAKMP_VERS_MINOR) >> ISAKMP_VERS_MINOR_SHIFT; if (ndo->ndo_vflag) { - ND_PRINT((ndo," %u.%u", major, minor)); + ND_PRINT(" %u.%u", major, minor); } if (ndo->ndo_vflag) { - ND_PRINT((ndo," msgid ")); + ND_PRINT(" msgid "); hexprint(ndo, p->msgid, sizeof(p->msgid)); } if (1 < ndo->ndo_vflag) { - ND_PRINT((ndo," cookie ")); + ND_PRINT(" cookie "); hexprint(ndo, p->i_ck, sizeof(p->i_ck)); - ND_PRINT((ndo,"->")); + ND_PRINT("->"); hexprint(ndo, p->r_ck, sizeof(p->r_ck)); } - ND_PRINT((ndo,":")); + ND_PRINT(":"); switch(major) { case IKEv1_MAJOR_VERSION: @@ -3083,7 +3083,7 @@ isakmp_rfc3948_print(netdissect_options *ndo, { ND_TCHECK_1(bp); if(length == 1 && EXTRACT_U_1(bp)==0xff) { - ND_PRINT((ndo, "isakmp-nat-keep-alive")); + ND_PRINT("isakmp-nat-keep-alive"); return; } @@ -3097,7 +3097,7 @@ isakmp_rfc3948_print(netdissect_options *ndo, */ if (EXTRACT_U_1(bp) == 0 && EXTRACT_U_1(bp + 1) == 0 && EXTRACT_U_1(bp + 2) == 0 && EXTRACT_U_1(bp + 3) == 0) { - ND_PRINT((ndo, "NONESP-encap: ")); + ND_PRINT("NONESP-encap: "); isakmp_print(ndo, bp+4, length-4, bp2); return; } @@ -3107,7 +3107,7 @@ isakmp_rfc3948_print(netdissect_options *ndo, u_int nh, enh, padlen; int advance; - ND_PRINT((ndo, "UDP-encap: ")); + ND_PRINT("UDP-encap: "); advance = esp_print(ndo, bp, length, bp2, &enh, &padlen); if(advance <= 0) @@ -3122,7 +3122,7 @@ isakmp_rfc3948_print(netdissect_options *ndo, } trunc: - ND_PRINT((ndo,"[|isakmp]")); + ND_PRINT("[|isakmp]"); return; } diff --git a/print-isoclns.c b/print-isoclns.c index 21fa263e..7c34943e 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -680,12 +680,12 @@ void isoclns_print(netdissect_options *ndo, const uint8_t *p, u_int length) { if (!ND_TTEST_1(p)) { /* enough bytes on the wire ? */ - ND_PRINT((ndo, "|OSI")); + ND_PRINT("|OSI"); return; } if (ndo->ndo_eflag) - ND_PRINT((ndo, "OSI NLPID %s (0x%02x): ", tok2str(nlpid_values, "Unknown", EXTRACT_U_1(p)), EXTRACT_U_1(p))); + ND_PRINT("OSI NLPID %s (0x%02x): ", tok2str(nlpid_values, "Unknown", EXTRACT_U_1(p)), EXTRACT_U_1(p)); switch (EXTRACT_U_1(p)) { @@ -704,7 +704,7 @@ isoclns_print(netdissect_options *ndo, const uint8_t *p, u_int length) break; case NLPID_NULLNS: - ND_PRINT((ndo, "%slength: %u", ndo->ndo_eflag ? "" : ", ", length)); + ND_PRINT("%slength: %u", ndo->ndo_eflag ? "" : ", ", length); break; case NLPID_Q933: @@ -725,8 +725,8 @@ isoclns_print(netdissect_options *ndo, const uint8_t *p, u_int length) default: if (!ndo->ndo_eflag) - ND_PRINT((ndo, "OSI NLPID 0x%02x unknown", EXTRACT_U_1(p))); - ND_PRINT((ndo, "%slength: %u", ndo->ndo_eflag ? "" : ", ", length)); + ND_PRINT("OSI NLPID 0x%02x unknown", EXTRACT_U_1(p)); + ND_PRINT("%slength: %u", ndo->ndo_eflag ? "" : ", ", length); if (length > 1) print_unknown_data(ndo, p, "\n\t", length); break; @@ -787,26 +787,26 @@ clnp_print(netdissect_options *ndo, optr = pptr; if (!ndo->ndo_eflag) - ND_PRINT((ndo, "CLNP")); + ND_PRINT("CLNP"); /* * Sanity checking of the header. */ if (EXTRACT_U_1(clnp_header->version) != CLNP_VERSION) { - ND_PRINT((ndo, "version %u packet not supported", EXTRACT_U_1(clnp_header->version))); + ND_PRINT("version %u packet not supported", EXTRACT_U_1(clnp_header->version)); return (0); } if (li > length) { - ND_PRINT((ndo, " length indicator(%u) > PDU size (%u)!", li, length)); + ND_PRINT(" length indicator(%u) > PDU size (%u)!", li, length); return (0); } if (li < sizeof(struct clnp_header_t)) { - ND_PRINT((ndo, " length indicator %u < min PDU size:", li)); + ND_PRINT(" length indicator %u < min PDU size:", li); while (pptr < ndo->ndo_snapend) { - ND_PRINT((ndo, "%02X", EXTRACT_U_1(pptr))); + ND_PRINT("%02X", EXTRACT_U_1(pptr)); pptr++; } return (0); @@ -821,7 +821,7 @@ clnp_print(netdissect_options *ndo, li_remaining -= sizeof(struct clnp_header_t); if (li_remaining < 1) { - ND_PRINT((ndo, "li < size of fixed part of CLNP header and addresses")); + ND_PRINT("li < size of fixed part of CLNP header and addresses"); return (0); } ND_TCHECK_1(pptr); @@ -829,7 +829,7 @@ clnp_print(netdissect_options *ndo, pptr += 1; li_remaining -= 1; if (li_remaining < dest_address_length) { - ND_PRINT((ndo, "li < size of fixed part of CLNP header and addresses")); + ND_PRINT("li < size of fixed part of CLNP header and addresses"); return (0); } ND_TCHECK_LEN(pptr, dest_address_length); @@ -838,7 +838,7 @@ clnp_print(netdissect_options *ndo, li_remaining -= dest_address_length; if (li_remaining < 1) { - ND_PRINT((ndo, "li < size of fixed part of CLNP header and addresses")); + ND_PRINT("li < size of fixed part of CLNP header and addresses"); return (0); } ND_TCHECK_1(pptr); @@ -846,7 +846,7 @@ clnp_print(netdissect_options *ndo, pptr += 1; li_remaining -= 1; if (li_remaining < source_address_length) { - ND_PRINT((ndo, "li < size of fixed part of CLNP header and addresses")); + ND_PRINT("li < size of fixed part of CLNP header and addresses"); return (0); } ND_TCHECK_LEN(pptr, source_address_length); @@ -855,48 +855,48 @@ clnp_print(netdissect_options *ndo, li_remaining -= source_address_length; if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "%s%s > %s, %s, length %u", + ND_PRINT("%s%s > %s, %s, length %u", ndo->ndo_eflag ? "" : ", ", isonsap_string(ndo, source_address, source_address_length), isonsap_string(ndo, dest_address, dest_address_length), tok2str(clnp_pdu_values,"unknown (%u)",clnp_pdu_type), - length)); + length); return (1); } - ND_PRINT((ndo, "%slength %u", ndo->ndo_eflag ? "" : ", ", length)); + ND_PRINT("%slength %u", ndo->ndo_eflag ? "" : ", ", length); - ND_PRINT((ndo, "\n\t%s PDU, hlen: %u, v: %u, lifetime: %u.%us, Segment PDU length: %u, checksum: 0x%04x", + ND_PRINT("\n\t%s PDU, hlen: %u, v: %u, lifetime: %u.%us, Segment PDU length: %u, checksum: 0x%04x", tok2str(clnp_pdu_values, "unknown (%u)",clnp_pdu_type), EXTRACT_U_1(clnp_header->length_indicator), EXTRACT_U_1(clnp_header->version), EXTRACT_U_1(clnp_header->lifetime)/2, (EXTRACT_U_1(clnp_header->lifetime)%2)*5, EXTRACT_BE_U_2(clnp_header->segment_length), - EXTRACT_BE_U_2(clnp_header->cksum))); + EXTRACT_BE_U_2(clnp_header->cksum)); osi_print_cksum(ndo, optr, EXTRACT_BE_U_2(clnp_header->cksum), 7, EXTRACT_U_1(clnp_header->length_indicator)); - ND_PRINT((ndo, "\n\tFlags [%s]", - bittok2str(clnp_flag_values, "none", clnp_flags))); + ND_PRINT("\n\tFlags [%s]", + bittok2str(clnp_flag_values, "none", clnp_flags)); - ND_PRINT((ndo, "\n\tsource address (length %u): %s\n\tdest address (length %u): %s", + ND_PRINT("\n\tsource address (length %u): %s\n\tdest address (length %u): %s", source_address_length, isonsap_string(ndo, source_address, source_address_length), dest_address_length, - isonsap_string(ndo, dest_address, dest_address_length))); + isonsap_string(ndo, dest_address, dest_address_length)); if (clnp_flags & CLNP_SEGMENT_PART) { if (li_remaining < sizeof(struct clnp_segment_header_t)) { - ND_PRINT((ndo, "li < size of fixed part of CLNP header, addresses, and segment part")); + ND_PRINT("li < size of fixed part of CLNP header, addresses, and segment part"); return (0); } clnp_segment_header = (const struct clnp_segment_header_t *) pptr; ND_TCHECK_SIZE(clnp_segment_header); - ND_PRINT((ndo, "\n\tData Unit ID: 0x%04x, Segment Offset: %u, Total PDU Length: %u", + ND_PRINT("\n\tData Unit ID: 0x%04x, Segment Offset: %u, Total PDU Length: %u", EXTRACT_BE_U_2(clnp_segment_header->data_unit_id), EXTRACT_BE_U_2(clnp_segment_header->segment_offset), - EXTRACT_BE_U_2(clnp_segment_header->total_length))); + EXTRACT_BE_U_2(clnp_segment_header->total_length)); pptr+=sizeof(struct clnp_segment_header_t); li_remaining-=sizeof(struct clnp_segment_header_t); } @@ -907,7 +907,7 @@ clnp_print(netdissect_options *ndo, const uint8_t *tptr; if (li_remaining < 2) { - ND_PRINT((ndo, ", bad opts/li")); + ND_PRINT(", bad opts/li"); return (0); } ND_TCHECK_2(pptr); @@ -916,7 +916,7 @@ clnp_print(netdissect_options *ndo, pptr += 2; li_remaining -= 2; if (opli > li_remaining) { - ND_PRINT((ndo, ", opt (%u) too long", op)); + ND_PRINT(", opt (%u) too long", op); return (0); } ND_TCHECK_LEN(pptr, opli); @@ -924,10 +924,10 @@ clnp_print(netdissect_options *ndo, tptr = pptr; tlen = opli; - ND_PRINT((ndo, "\n\t %s Option #%u, length %u, value: ", + ND_PRINT("\n\t %s Option #%u, length %u, value: ", tok2str(clnp_option_values,"Unknown",op), op, - opli)); + opli); /* * We've already checked that the entire option is present @@ -943,20 +943,20 @@ clnp_print(netdissect_options *ndo, case CLNP_OPTION_ROUTE_RECORDING: /* those two options share the format */ case CLNP_OPTION_SOURCE_ROUTING: if (tlen < 2) { - ND_PRINT((ndo, ", bad opt len")); + ND_PRINT(", bad opt len"); return (0); } - ND_PRINT((ndo, "%s %s", + ND_PRINT("%s %s", tok2str(clnp_option_sr_rr_values,"Unknown",EXTRACT_U_1(tptr)), - tok2str(clnp_option_sr_rr_string_values, "Unknown Option %u", op))); + tok2str(clnp_option_sr_rr_string_values, "Unknown Option %u", op)); nsap_offset=EXTRACT_U_1(tptr + 1); if (nsap_offset == 0) { - ND_PRINT((ndo, " Bad NSAP offset (0)")); + ND_PRINT(" Bad NSAP offset (0)"); break; } nsap_offset-=1; /* offset to nsap list */ if (nsap_offset > tlen) { - ND_PRINT((ndo, " Bad NSAP offset (past end of option)")); + ND_PRINT(" Bad NSAP offset (past end of option)"); break; } tptr+=nsap_offset; @@ -964,16 +964,16 @@ clnp_print(netdissect_options *ndo, while (tlen > 0) { source_address_length=EXTRACT_U_1(tptr); if (tlen < source_address_length+1) { - ND_PRINT((ndo, "\n\t NSAP address goes past end of option")); + ND_PRINT("\n\t NSAP address goes past end of option"); break; } if (source_address_length > 0) { source_address=(tptr+1); ND_TCHECK_LEN(source_address, source_address_length); - ND_PRINT((ndo, "\n\t NSAP address (length %u): %s", + ND_PRINT("\n\t NSAP address (length %u): %s", source_address_length, - isonsap_string(ndo, source_address, source_address_length))); + isonsap_string(ndo, source_address, source_address_length)); } tlen-=source_address_length+1; } @@ -981,54 +981,54 @@ clnp_print(netdissect_options *ndo, case CLNP_OPTION_PRIORITY: if (tlen < 1) { - ND_PRINT((ndo, ", bad opt len")); + ND_PRINT(", bad opt len"); return (0); } - ND_PRINT((ndo, "0x%1x", EXTRACT_U_1(tptr)&0x0f)); + ND_PRINT("0x%1x", EXTRACT_U_1(tptr)&0x0f); break; case CLNP_OPTION_QOS_MAINTENANCE: if (tlen < 1) { - ND_PRINT((ndo, ", bad opt len")); + ND_PRINT(", bad opt len"); return (0); } - ND_PRINT((ndo, "\n\t Format Code: %s", - tok2str(clnp_option_scope_values, "Reserved", EXTRACT_U_1(tptr) & CLNP_OPTION_SCOPE_MASK))); + ND_PRINT("\n\t Format Code: %s", + tok2str(clnp_option_scope_values, "Reserved", EXTRACT_U_1(tptr) & CLNP_OPTION_SCOPE_MASK)); if ((EXTRACT_U_1(tptr)&CLNP_OPTION_SCOPE_MASK) == CLNP_OPTION_SCOPE_GLOBAL) - ND_PRINT((ndo, "\n\t QoS Flags [%s]", + ND_PRINT("\n\t QoS Flags [%s]", bittok2str(clnp_option_qos_global_values, "none", - EXTRACT_U_1(tptr)&CLNP_OPTION_OPTION_QOS_MASK))); + EXTRACT_U_1(tptr)&CLNP_OPTION_OPTION_QOS_MASK)); break; case CLNP_OPTION_SECURITY: if (tlen < 2) { - ND_PRINT((ndo, ", bad opt len")); + ND_PRINT(", bad opt len"); return (0); } - ND_PRINT((ndo, "\n\t Format Code: %s, Security-Level %u", + ND_PRINT("\n\t Format Code: %s, Security-Level %u", tok2str(clnp_option_scope_values,"Reserved",EXTRACT_U_1(tptr)&CLNP_OPTION_SCOPE_MASK), - EXTRACT_U_1(tptr + 1))); + EXTRACT_U_1(tptr + 1)); break; case CLNP_OPTION_DISCARD_REASON: if (tlen < 1) { - ND_PRINT((ndo, ", bad opt len")); + ND_PRINT(", bad opt len"); return (0); } rfd_error = EXTRACT_U_1(tptr); rfd_error_major = (rfd_error&0xf0) >> 4; rfd_error_minor = rfd_error&0x0f; - ND_PRINT((ndo, "\n\t Class: %s Error (0x%01x), %s (0x%01x)", + ND_PRINT("\n\t Class: %s Error (0x%01x), %s (0x%01x)", tok2str(clnp_option_rfd_class_values,"Unknown",rfd_error_major), rfd_error_major, tok2str(clnp_option_rfd_error_class[rfd_error_major],"Unknown",rfd_error_minor), - rfd_error_minor)); + rfd_error_minor); break; case CLNP_OPTION_PADDING: - ND_PRINT((ndo, "padding data")); + ND_PRINT("padding data"); break; /* @@ -1051,7 +1051,7 @@ clnp_print(netdissect_options *ndo, case CLNP_PDU_ERP: ND_TCHECK_1(pptr); if (EXTRACT_U_1(pptr) == NLPID_CLNP) { - ND_PRINT((ndo, "\n\t-----original packet-----\n\t")); + ND_PRINT("\n\t-----original packet-----\n\t"); /* FIXME recursion protection */ clnp_print(ndo, pptr, length - li); break; @@ -1064,7 +1064,7 @@ clnp_print(netdissect_options *ndo, default: /* dump the PDU specific data */ if (length-(pptr-optr) > 0) { - ND_PRINT((ndo, "\n\t undecoded non-header data, length %u", length-li)); + ND_PRINT("\n\t undecoded non-header data, length %u", length-li); print_unknown_data(ndo, pptr, "\n\t ", length - (pptr - optr)); } } @@ -1072,7 +1072,7 @@ clnp_print(netdissect_options *ndo, return (1); trunc: - ND_PRINT((ndo, "[|clnp]")); + ND_PRINT("[|clnp]"); return (1); } @@ -1108,10 +1108,10 @@ esis_print(netdissect_options *ndo, const struct esis_header_t *esis_header; if (!ndo->ndo_eflag) - ND_PRINT((ndo, "ES-IS")); + ND_PRINT("ES-IS"); if (length <= 2) { - ND_PRINT((ndo, ndo->ndo_qflag ? "bad pkt!" : "no header at all!")); + ND_PRINT(ndo->ndo_qflag ? "bad pkt!" : "no header at all!"); return; } @@ -1125,25 +1125,25 @@ esis_print(netdissect_options *ndo, */ if (EXTRACT_U_1(esis_header->nlpid) != NLPID_ESIS) { - ND_PRINT((ndo, " nlpid 0x%02x packet not supported", EXTRACT_U_1(esis_header->nlpid))); + ND_PRINT(" nlpid 0x%02x packet not supported", EXTRACT_U_1(esis_header->nlpid)); return; } version = EXTRACT_U_1(esis_header->version); if (version != ESIS_VERSION) { - ND_PRINT((ndo, " version %u packet not supported", version)); + ND_PRINT(" version %u packet not supported", version); return; } if (li > length) { - ND_PRINT((ndo, " length indicator(%u) > PDU size (%u)!", li, length)); + ND_PRINT(" length indicator(%u) > PDU size (%u)!", li, length); return; } if (li < sizeof(struct esis_header_t) + 2) { - ND_PRINT((ndo, " length indicator %u < min PDU size:", li)); + ND_PRINT(" length indicator %u < min PDU size:", li); while (pptr < ndo->ndo_snapend) { - ND_PRINT((ndo, "%02X", EXTRACT_U_1(pptr))); + ND_PRINT("%02X", EXTRACT_U_1(pptr)); pptr++; } return; @@ -1152,26 +1152,26 @@ esis_print(netdissect_options *ndo, esis_pdu_type = EXTRACT_U_1(esis_header->type) & ESIS_PDU_TYPE_MASK; if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "%s%s, length %u", + ND_PRINT("%s%s, length %u", ndo->ndo_eflag ? "" : ", ", tok2str(esis_pdu_values,"unknown type (%u)",esis_pdu_type), - length)); + length); return; } else - ND_PRINT((ndo, "%slength %u\n\t%s (%u)", + ND_PRINT("%slength %u\n\t%s (%u)", ndo->ndo_eflag ? "" : ", ", length, tok2str(esis_pdu_values,"unknown type: %u", esis_pdu_type), - esis_pdu_type)); + esis_pdu_type); - ND_PRINT((ndo, ", v: %u%s", version, version == ESIS_VERSION ? "" : "unsupported" )); - ND_PRINT((ndo, ", checksum: 0x%04x", EXTRACT_BE_U_2(esis_header->cksum))); + ND_PRINT(", v: %u%s", version, version == ESIS_VERSION ? "" : "unsupported" ); + ND_PRINT(", checksum: 0x%04x", EXTRACT_BE_U_2(esis_header->cksum)); osi_print_cksum(ndo, pptr, EXTRACT_BE_U_2(esis_header->cksum), 7, li); - ND_PRINT((ndo, ", holding time: %us, length indicator: %u", - EXTRACT_BE_U_2(esis_header->holdtime), li)); + ND_PRINT(", holding time: %us, length indicator: %u", + EXTRACT_BE_U_2(esis_header->holdtime), li); if (ndo->ndo_vflag > 1) print_unknown_data(ndo, optr, "\n\t", sizeof(struct esis_header_t)); @@ -1186,7 +1186,7 @@ esis_print(netdissect_options *ndo, ND_TCHECK_1(pptr); if (li < 1) { - ND_PRINT((ndo, ", bad redirect/li")); + ND_PRINT(", bad redirect/li"); return; } dstl = EXTRACT_U_1(pptr); @@ -1194,17 +1194,17 @@ esis_print(netdissect_options *ndo, li--; ND_TCHECK_LEN(pptr, dstl); if (li < dstl) { - ND_PRINT((ndo, ", bad redirect/li")); + ND_PRINT(", bad redirect/li"); return; } dst = pptr; pptr += dstl; li -= dstl; - ND_PRINT((ndo, "\n\t %s", isonsap_string(ndo, dst, dstl))); + ND_PRINT("\n\t %s", isonsap_string(ndo, dst, dstl)); ND_TCHECK_1(pptr); if (li < 1) { - ND_PRINT((ndo, ", bad redirect/li")); + ND_PRINT(", bad redirect/li"); return; } snpal = EXTRACT_U_1(pptr); @@ -1212,7 +1212,7 @@ esis_print(netdissect_options *ndo, li--; ND_TCHECK_LEN(pptr, snpal); if (li < snpal) { - ND_PRINT((ndo, ", bad redirect/li")); + ND_PRINT(", bad redirect/li"); return; } snpa = pptr; @@ -1220,14 +1220,14 @@ esis_print(netdissect_options *ndo, li -= snpal; ND_TCHECK_1(pptr); if (li < 1) { - ND_PRINT((ndo, ", bad redirect/li")); + ND_PRINT(", bad redirect/li"); return; } netal = EXTRACT_U_1(pptr); pptr++; ND_TCHECK_LEN(pptr, netal); if (li < netal) { - ND_PRINT((ndo, ", bad redirect/li")); + ND_PRINT(", bad redirect/li"); return; } neta = pptr; @@ -1235,36 +1235,36 @@ esis_print(netdissect_options *ndo, li -= netal; if (snpal == 6) - ND_PRINT((ndo, "\n\t SNPA (length: %u): %s", + ND_PRINT("\n\t SNPA (length: %u): %s", snpal, - etheraddr_string(ndo, snpa))); + etheraddr_string(ndo, snpa)); else - ND_PRINT((ndo, "\n\t SNPA (length: %u): %s", + ND_PRINT("\n\t SNPA (length: %u): %s", snpal, - linkaddr_string(ndo, snpa, LINKADDR_OTHER, snpal))); + linkaddr_string(ndo, snpa, LINKADDR_OTHER, snpal)); if (netal != 0) - ND_PRINT((ndo, "\n\t NET (length: %u) %s", + ND_PRINT("\n\t NET (length: %u) %s", netal, - isonsap_string(ndo, neta, netal))); + isonsap_string(ndo, neta, netal)); break; } case ESIS_PDU_ESH: ND_TCHECK_1(pptr); if (li < 1) { - ND_PRINT((ndo, ", bad esh/li")); + ND_PRINT(", bad esh/li"); return; } source_address_number = EXTRACT_U_1(pptr); pptr++; li--; - ND_PRINT((ndo, "\n\t Number of Source Addresses: %u", source_address_number)); + ND_PRINT("\n\t Number of Source Addresses: %u", source_address_number); while (source_address_number > 0) { ND_TCHECK_1(pptr); if (li < 1) { - ND_PRINT((ndo, ", bad esh/li")); + ND_PRINT(", bad esh/li"); return; } source_address_length = EXTRACT_U_1(pptr); @@ -1273,12 +1273,12 @@ esis_print(netdissect_options *ndo, ND_TCHECK_LEN(pptr, source_address_length); if (li < source_address_length) { - ND_PRINT((ndo, ", bad esh/li")); + ND_PRINT(", bad esh/li"); return; } - ND_PRINT((ndo, "\n\t NET (length: %u): %s", + ND_PRINT("\n\t NET (length: %u): %s", source_address_length, - isonsap_string(ndo, pptr, source_address_length))); + isonsap_string(ndo, pptr, source_address_length)); pptr += source_address_length; li -= source_address_length; source_address_number--; @@ -1289,7 +1289,7 @@ esis_print(netdissect_options *ndo, case ESIS_PDU_ISH: { ND_TCHECK_1(pptr); if (li < 1) { - ND_PRINT((ndo, ", bad ish/li")); + ND_PRINT(", bad ish/li"); return; } source_address_length = EXTRACT_U_1(pptr); @@ -1297,10 +1297,10 @@ esis_print(netdissect_options *ndo, li--; ND_TCHECK_LEN(pptr, source_address_length); if (li < source_address_length) { - ND_PRINT((ndo, ", bad ish/li")); + ND_PRINT(", bad ish/li"); return; } - ND_PRINT((ndo, "\n\t NET (length: %u): %s", source_address_length, isonsap_string(ndo, pptr, source_address_length))); + ND_PRINT("\n\t NET (length: %u): %s", source_address_length, isonsap_string(ndo, pptr, source_address_length)); pptr += source_address_length; li -= source_address_length; break; @@ -1320,7 +1320,7 @@ esis_print(netdissect_options *ndo, const uint8_t *tptr; if (li < 2) { - ND_PRINT((ndo, ", bad opts/li")); + ND_PRINT(", bad opts/li"); return; } ND_TCHECK_2(pptr); @@ -1329,37 +1329,37 @@ esis_print(netdissect_options *ndo, pptr += 2; li -= 2; if (opli > li) { - ND_PRINT((ndo, ", opt (%u) too long", op)); + ND_PRINT(", opt (%u) too long", op); return; } li -= opli; tptr = pptr; - ND_PRINT((ndo, "\n\t %s Option #%u, length %u, value: ", + ND_PRINT("\n\t %s Option #%u, length %u, value: ", tok2str(esis_option_values,"Unknown",op), op, - opli)); + opli); switch (op) { case ESIS_OPTION_ES_CONF_TIME: if (opli == 2) { ND_TCHECK_2(pptr); - ND_PRINT((ndo, "%us", EXTRACT_BE_U_2(tptr))); + ND_PRINT("%us", EXTRACT_BE_U_2(tptr)); } else - ND_PRINT((ndo, "(bad length)")); + ND_PRINT("(bad length)"); break; case ESIS_OPTION_PROTOCOLS: while (opli>0) { ND_TCHECK_1(tptr); - ND_PRINT((ndo, "%s (0x%02x)", + ND_PRINT("%s (0x%02x)", tok2str(nlpid_values, "unknown", EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr))); + EXTRACT_U_1(tptr)); if (opli>1) /* further NPLIDs ? - put comma */ - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); tptr++; opli--; } @@ -1385,7 +1385,7 @@ esis_print(netdissect_options *ndo, pptr += opli; } trunc: - ND_PRINT((ndo, "[|esis]")); + ND_PRINT("[|esis]"); } static void @@ -1395,20 +1395,20 @@ isis_print_mcid(netdissect_options *ndo, int i; ND_TCHECK_SIZE(mcid); - ND_PRINT((ndo, "ID: %u, Name: ", EXTRACT_U_1(mcid->format_id))); + ND_PRINT("ID: %u, Name: ", EXTRACT_U_1(mcid->format_id)); if (fn_printzp(ndo, mcid->name, 32, ndo->ndo_snapend)) goto trunc; - ND_PRINT((ndo, "\n\t Lvl: %u", EXTRACT_BE_U_2(mcid->revision_lvl))); + ND_PRINT("\n\t Lvl: %u", EXTRACT_BE_U_2(mcid->revision_lvl)); - ND_PRINT((ndo, ", Digest: ")); + ND_PRINT(", Digest: "); for(i=0;i<16;i++) - ND_PRINT((ndo, "%.2x ", mcid->digest[i])); + ND_PRINT("%.2x ", mcid->digest[i]); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static int @@ -1426,10 +1426,10 @@ isis_print_mt_port_cap_subtlv(netdissect_options *ndo, stlv_len = EXTRACT_U_1(tptr + 1); /* first lets see if we know the subTLVs name*/ - ND_PRINT((ndo, "\n\t %s subTLV #%u, length: %u", + ND_PRINT("\n\t %s subTLV #%u, length: %u", tok2str(isis_mt_port_cap_subtlv_values, "unknown", stlv_type), stlv_type, - stlv_len)); + stlv_len); tptr = tptr + 2; /*len -= TLV_TYPE_LEN_OFFSET;*/ @@ -1450,13 +1450,13 @@ isis_print_mt_port_cap_subtlv(netdissect_options *ndo, subtlv_spb_mcid = (const struct isis_subtlv_spb_mcid *)tptr; - ND_PRINT((ndo, "\n\t MCID: ")); + ND_PRINT("\n\t MCID: "); isis_print_mcid(ndo, &(subtlv_spb_mcid->mcid)); /*tptr += SPB_MCID_MIN_LEN; len -= SPB_MCID_MIN_LEN; */ - ND_PRINT((ndo, "\n\t AUX-MCID: ")); + ND_PRINT("\n\t AUX-MCID: "); isis_print_mcid(ndo, &(subtlv_spb_mcid->aux_mcid)); /*tptr += SPB_MCID_MIN_LEN; @@ -1473,21 +1473,21 @@ isis_print_mt_port_cap_subtlv(netdissect_options *ndo, if (stlv_len < ISIS_SUBTLV_SPB_DIGEST_MIN_LEN) goto trunc; - ND_PRINT((ndo, "\n\t RES: %u V: %u A: %u D: %u", + ND_PRINT("\n\t RES: %u V: %u A: %u D: %u", (EXTRACT_U_1(tptr) >> 5), ((EXTRACT_U_1(tptr) >> 4) & 0x01), ((EXTRACT_U_1(tptr) >> 2) & 0x03), - (EXTRACT_U_1(tptr) & 0x03))); + (EXTRACT_U_1(tptr) & 0x03)); tptr++; - ND_PRINT((ndo, "\n\t Digest: ")); + ND_PRINT("\n\t Digest: "); for(i=1;i<=8; i++) { - ND_PRINT((ndo, "%08x ", EXTRACT_BE_U_4(tptr))); + ND_PRINT("%08x ", EXTRACT_BE_U_4(tptr)); if (i%4 == 0 && i != 8) - ND_PRINT((ndo, "\n\t ")); + ND_PRINT("\n\t "); tptr = tptr + 4; } @@ -1501,15 +1501,15 @@ isis_print_mt_port_cap_subtlv(netdissect_options *ndo, { while (stlv_len >= ISIS_SUBTLV_SPB_BVID_MIN_LEN) { - ND_PRINT((ndo, "\n\t ECT: %08x", - EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t ECT: %08x", + EXTRACT_BE_U_4(tptr)); tptr = tptr+4; - ND_PRINT((ndo, " BVID: %u, U:%01x M:%01x ", + ND_PRINT(" BVID: %u, U:%01x M:%01x ", (EXTRACT_BE_U_2(tptr) >> 4) , (EXTRACT_BE_U_2(tptr) >> 3) & 0x01, - (EXTRACT_BE_U_2(tptr) >> 2) & 0x01)); + (EXTRACT_BE_U_2(tptr) >> 2) & 0x01); tptr = tptr + 2; len = len - ISIS_SUBTLV_SPB_BVID_MIN_LEN; @@ -1529,8 +1529,8 @@ isis_print_mt_port_cap_subtlv(netdissect_options *ndo, return 0; trunc: - ND_PRINT((ndo, "\n\t\t")); - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("\n\t\t"); + ND_PRINT("%s", tstr); return(1); } @@ -1549,10 +1549,10 @@ isis_print_mt_capability_subtlv(netdissect_options *ndo, len = len - 2; /* first lets see if we know the subTLVs name*/ - ND_PRINT((ndo, "\n\t %s subTLV #%u, length: %u", + ND_PRINT("\n\t %s subTLV #%u, length: %u", tok2str(isis_mt_capability_subtlv_values, "unknown", stlv_type), stlv_type, - stlv_len)); + stlv_len); /* Make sure the subTLV fits within the space left */ if (len < stlv_len) @@ -1566,22 +1566,22 @@ isis_print_mt_capability_subtlv(netdissect_options *ndo, if (stlv_len < ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN) goto trunc; - ND_PRINT((ndo, "\n\t CIST Root-ID: %08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t CIST Root-ID: %08x", EXTRACT_BE_U_4(tptr)); tptr = tptr+4; - ND_PRINT((ndo, " %08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT(" %08x", EXTRACT_BE_U_4(tptr)); tptr = tptr+4; - ND_PRINT((ndo, ", Path Cost: %08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT(", Path Cost: %08x", EXTRACT_BE_U_4(tptr)); tptr = tptr+4; - ND_PRINT((ndo, ", Prio: %u", EXTRACT_BE_U_2(tptr))); + ND_PRINT(", Prio: %u", EXTRACT_BE_U_2(tptr)); tptr = tptr + 2; - ND_PRINT((ndo, "\n\t RES: %u", - EXTRACT_BE_U_2(tptr) >> 5)); - ND_PRINT((ndo, ", V: %u", - (EXTRACT_BE_U_2(tptr) >> 4) & 0x0001)); - ND_PRINT((ndo, ", SPSource-ID: %u", - (EXTRACT_BE_U_4(tptr) & 0x000fffff))); + ND_PRINT("\n\t RES: %u", + EXTRACT_BE_U_2(tptr) >> 5); + ND_PRINT(", V: %u", + (EXTRACT_BE_U_2(tptr) >> 4) & 0x0001); + ND_PRINT(", SPSource-ID: %u", + (EXTRACT_BE_U_4(tptr) & 0x000fffff)); tptr = tptr+4; - ND_PRINT((ndo, ", No of Trees: %x", EXTRACT_U_1(tptr))); + ND_PRINT(", No of Trees: %x", EXTRACT_U_1(tptr)); tmp = EXTRACT_U_1(tptr); tptr++; @@ -1594,21 +1594,21 @@ isis_print_mt_capability_subtlv(netdissect_options *ndo, if (stlv_len < ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN) goto trunc; - ND_PRINT((ndo, "\n\t U:%u, M:%u, A:%u, RES:%u", + ND_PRINT("\n\t U:%u, M:%u, A:%u, RES:%u", EXTRACT_U_1(tptr) >> 7, (EXTRACT_U_1(tptr) >> 6) & 0x01, (EXTRACT_U_1(tptr) >> 5) & 0x01, - (EXTRACT_U_1(tptr) & 0x1f))); + (EXTRACT_U_1(tptr) & 0x1f)); tptr++; - ND_PRINT((ndo, ", ECT: %08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT(", ECT: %08x", EXTRACT_BE_U_4(tptr)); tptr = tptr + 4; - ND_PRINT((ndo, ", BVID: %u, SPVID: %u", + ND_PRINT(", BVID: %u, SPVID: %u", (EXTRACT_BE_U_3(tptr) >> 12) & 0x000fff, - EXTRACT_BE_U_3(tptr) & 0x000fff)); + EXTRACT_BE_U_3(tptr) & 0x000fff); tptr = tptr + 3; len = len - ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN; @@ -1622,13 +1622,13 @@ isis_print_mt_capability_subtlv(netdissect_options *ndo, if (stlv_len < 8) goto trunc; - ND_PRINT((ndo, "\n\t BMAC: %08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t BMAC: %08x", EXTRACT_BE_U_4(tptr)); tptr = tptr+4; - ND_PRINT((ndo, "%04x", EXTRACT_BE_U_2(tptr))); + ND_PRINT("%04x", EXTRACT_BE_U_2(tptr)); tptr = tptr+2; - ND_PRINT((ndo, ", RES: %u, VID: %u", EXTRACT_BE_U_2(tptr) >> 12, - (EXTRACT_BE_U_2(tptr)) & 0x0fff)); + ND_PRINT(", RES: %u, VID: %u", EXTRACT_BE_U_2(tptr) >> 12, + (EXTRACT_BE_U_2(tptr)) & 0x0fff); tptr = tptr+2; len = len - 8; @@ -1636,11 +1636,11 @@ isis_print_mt_capability_subtlv(netdissect_options *ndo, while (stlv_len >= 4) { ND_TCHECK_4(tptr); - ND_PRINT((ndo, "\n\t T: %u, R: %u, RES: %u, ISID: %u", + ND_PRINT("\n\t T: %u, R: %u, RES: %u, ISID: %u", (EXTRACT_BE_U_4(tptr) >> 31), (EXTRACT_BE_U_4(tptr) >> 30) & 0x01, (EXTRACT_BE_U_4(tptr) >> 24) & 0x03f, - (EXTRACT_BE_U_4(tptr)) & 0x0ffffff)); + (EXTRACT_BE_U_4(tptr)) & 0x0ffffff); tptr = tptr + 4; len = len - 4; @@ -1658,8 +1658,8 @@ isis_print_mt_capability_subtlv(netdissect_options *ndo, return 0; trunc: - ND_PRINT((ndo, "\n\t\t")); - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("\n\t\t"); + ND_PRINT("%s", tstr); return(1); } @@ -1697,21 +1697,21 @@ static int isis_print_metric_block(netdissect_options *ndo, const struct isis_metric_block *isis_metric_block) { - ND_PRINT((ndo, ", Default Metric: %u, %s", + ND_PRINT(", Default Metric: %u, %s", ISIS_LSP_TLV_METRIC_VALUE(isis_metric_block->metric_default), - ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_default) ? "External" : "Internal")); + ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_default) ? "External" : "Internal"); if (!ISIS_LSP_TLV_METRIC_SUPPORTED(isis_metric_block->metric_delay)) - ND_PRINT((ndo, "\n\t\t Delay Metric: %u, %s", + ND_PRINT("\n\t\t Delay Metric: %u, %s", ISIS_LSP_TLV_METRIC_VALUE(isis_metric_block->metric_delay), - ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_delay) ? "External" : "Internal")); + ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_delay) ? "External" : "Internal"); if (!ISIS_LSP_TLV_METRIC_SUPPORTED(isis_metric_block->metric_expense)) - ND_PRINT((ndo, "\n\t\t Expense Metric: %u, %s", + ND_PRINT("\n\t\t Expense Metric: %u, %s", ISIS_LSP_TLV_METRIC_VALUE(isis_metric_block->metric_expense), - ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_expense) ? "External" : "Internal")); + ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_expense) ? "External" : "Internal"); if (!ISIS_LSP_TLV_METRIC_SUPPORTED(isis_metric_block->metric_error)) - ND_PRINT((ndo, "\n\t\t Error Metric: %u, %s", + ND_PRINT("\n\t\t Error Metric: %u, %s", ISIS_LSP_TLV_METRIC_VALUE(isis_metric_block->metric_error), - ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_error) ? "External" : "Internal")); + ISIS_LSP_TLV_METRIC_IE(isis_metric_block->metric_error) ? "External" : "Internal"); return(1); /* everything is ok */ } @@ -1727,9 +1727,9 @@ isis_print_tlv_ip_reach(netdissect_options *ndo, while (length > 0) { if ((size_t)length < sizeof(*tlv_ip_reach)) { - ND_PRINT((ndo, "short IPv4 Reachability (%u vs %lu)", + ND_PRINT("short IPv4 Reachability (%u vs %lu)", length, - (unsigned long)sizeof(*tlv_ip_reach))); + (unsigned long)sizeof(*tlv_ip_reach)); return (0); } @@ -1739,38 +1739,38 @@ isis_print_tlv_ip_reach(netdissect_options *ndo, prefix_len = mask2plen(EXTRACT_IPV4_TO_HOST_ORDER(tlv_ip_reach->mask)); if (prefix_len == -1) - ND_PRINT((ndo, "%sIPv4 prefix: %s mask %s", + ND_PRINT("%sIPv4 prefix: %s mask %s", ident, ipaddr_string(ndo, (tlv_ip_reach->prefix)), - ipaddr_string(ndo, (tlv_ip_reach->mask)))); + ipaddr_string(ndo, (tlv_ip_reach->mask))); else - ND_PRINT((ndo, "%sIPv4 prefix: %15s/%u", + ND_PRINT("%sIPv4 prefix: %15s/%u", ident, ipaddr_string(ndo, (tlv_ip_reach->prefix)), - prefix_len)); + prefix_len); - ND_PRINT((ndo, ", Distribution: %s, Metric: %u, %s", + ND_PRINT(", Distribution: %s, Metric: %u, %s", ISIS_LSP_TLV_METRIC_UPDOWN(tlv_ip_reach->isis_metric_block.metric_default) ? "down" : "up", ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_default), - ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_default) ? "External" : "Internal")); + ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_default) ? "External" : "Internal"); if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_delay)) - ND_PRINT((ndo, "%s Delay Metric: %u, %s", + ND_PRINT("%s Delay Metric: %u, %s", ident, ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_delay), - ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_delay) ? "External" : "Internal")); + ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_delay) ? "External" : "Internal"); if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_expense)) - ND_PRINT((ndo, "%s Expense Metric: %u, %s", + ND_PRINT("%s Expense Metric: %u, %s", ident, ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_expense), - ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_expense) ? "External" : "Internal")); + ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_expense) ? "External" : "Internal"); if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_error)) - ND_PRINT((ndo, "%s Error Metric: %u, %s", + ND_PRINT("%s Error Metric: %u, %s", ident, ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_error), - ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_error) ? "External" : "Internal")); + ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_error) ? "External" : "Internal"); length -= sizeof(struct isis_tlv_ip_reach); tlv_ip_reach++; @@ -1789,9 +1789,9 @@ isis_print_ip_reach_subtlv(netdissect_options *ndo, const char *ident) { /* first lets see if we know the subTLVs name*/ - ND_PRINT((ndo, "%s%s subTLV #%u, length: %u", + ND_PRINT("%s%s subTLV #%u, length: %u", ident, tok2str(isis_ext_ip_reach_subtlv_values, "unknown", subt), - subt, subl)); + subt, subl); ND_TCHECK_LEN(tptr, subl); @@ -1799,18 +1799,18 @@ isis_print_ip_reach_subtlv(netdissect_options *ndo, case ISIS_SUBTLV_EXTD_IP_REACH_MGMT_PREFIX_COLOR: /* fall through */ case ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG32: while (subl >= 4) { - ND_PRINT((ndo, ", 0x%08x (=%u)", + ND_PRINT(", 0x%08x (=%u)", EXTRACT_BE_U_4(tptr), - EXTRACT_BE_U_4(tptr))); + EXTRACT_BE_U_4(tptr)); tptr+=4; subl-=4; } break; case ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG64: while (subl >= 8) { - ND_PRINT((ndo, ", 0x%08x%08x", + ND_PRINT(", 0x%08x%08x", EXTRACT_BE_U_4(tptr), - EXTRACT_BE_U_4(tptr + 4))); + EXTRACT_BE_U_4(tptr + 4)); tptr+=8; subl-=8; } @@ -1823,8 +1823,8 @@ isis_print_ip_reach_subtlv(netdissect_options *ndo, return(1); trunc: - ND_PRINT((ndo, "%s", ident)); - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", ident); + ND_PRINT("%s", tstr); return(0); } @@ -1852,7 +1852,7 @@ isis_print_ext_is_reach(netdissect_options *ndo, if (tlv_remaining < NODE_ID_LEN) return(0); - ND_PRINT((ndo, "%sIS Neighbor: %s", ident, isis_print_id(tptr, NODE_ID_LEN))); + ND_PRINT("%sIS Neighbor: %s", ident, isis_print_id(tptr, NODE_ID_LEN)); tptr+=NODE_ID_LEN; tlv_remaining-=NODE_ID_LEN; @@ -1861,7 +1861,7 @@ isis_print_ext_is_reach(netdissect_options *ndo, return(0); if (tlv_remaining < 3) return(0); - ND_PRINT((ndo, ", Metric: %u", EXTRACT_BE_U_3(tptr))); + ND_PRINT(", Metric: %u", EXTRACT_BE_U_3(tptr)); tptr+=3; tlv_remaining-=3; } @@ -1874,9 +1874,9 @@ isis_print_ext_is_reach(netdissect_options *ndo, tptr++; tlv_remaining--; proc_bytes=NODE_ID_LEN+3+1; - ND_PRINT((ndo, ", %ssub-TLVs present",subtlv_sum_len ? "" : "no ")); + ND_PRINT(", %ssub-TLVs present",subtlv_sum_len ? "" : "no "); if (subtlv_sum_len) { - ND_PRINT((ndo, " (%u)", subtlv_sum_len)); + ND_PRINT(" (%u)", subtlv_sum_len); /* prepend the indent string */ snprintf(ident_buffer, sizeof(ident_buffer), "%s ",ident); ident = ident_buffer; @@ -1884,12 +1884,12 @@ isis_print_ext_is_reach(netdissect_options *ndo, if (!ND_TTEST_2(tptr)) return(0); if (tlv_remaining < 2) { - ND_PRINT((ndo, "%sRemaining data in TLV shorter than a subTLV header",ident)); + ND_PRINT("%sRemaining data in TLV shorter than a subTLV header",ident); proc_bytes += tlv_remaining; break; } if (subtlv_sum_len < 2) { - ND_PRINT((ndo, "%sRemaining data in subTLVs shorter than a subTLV header",ident)); + ND_PRINT("%sRemaining data in subTLVs shorter than a subTLV header",ident); proc_bytes += subtlv_sum_len; break; } @@ -1899,18 +1899,18 @@ isis_print_ext_is_reach(netdissect_options *ndo, tlv_remaining -= 2; subtlv_sum_len -= 2; proc_bytes += 2; - ND_PRINT((ndo, "%s%s subTLV #%u, length: %u", + ND_PRINT("%s%s subTLV #%u, length: %u", ident, tok2str(isis_ext_is_reach_subtlv_values, "unknown", subtlv_type), - subtlv_type, subtlv_len)); + subtlv_type, subtlv_len); if (subtlv_sum_len < subtlv_len) { - ND_PRINT((ndo, " (remaining data in subTLVs shorter than the current subTLV)")); + ND_PRINT(" (remaining data in subTLVs shorter than the current subTLV)"); proc_bytes += subtlv_sum_len; break; } if (tlv_remaining < subtlv_len) { - ND_PRINT((ndo, " (> remaining tlv length)")); + ND_PRINT(" (> remaining tlv length)"); proc_bytes += tlv_remaining; break; } @@ -1922,31 +1922,31 @@ isis_print_ext_is_reach(netdissect_options *ndo, case ISIS_SUBTLV_EXT_IS_REACH_LINK_LOCAL_REMOTE_ID: case ISIS_SUBTLV_EXT_IS_REACH_LINK_REMOTE_ID: if (subtlv_len >= 4) { - ND_PRINT((ndo, ", 0x%08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT(", 0x%08x", EXTRACT_BE_U_4(tptr)); if (subtlv_len == 8) /* rfc4205 */ - ND_PRINT((ndo, ", 0x%08x", EXTRACT_BE_U_4(tptr + 4))); + ND_PRINT(", 0x%08x", EXTRACT_BE_U_4(tptr + 4)); } break; case ISIS_SUBTLV_EXT_IS_REACH_IPV4_INTF_ADDR: case ISIS_SUBTLV_EXT_IS_REACH_IPV4_NEIGHBOR_ADDR: if (subtlv_len >= sizeof(struct in_addr)) - ND_PRINT((ndo, ", %s", ipaddr_string(ndo, tptr))); + ND_PRINT(", %s", ipaddr_string(ndo, tptr)); break; case ISIS_SUBTLV_EXT_IS_REACH_MAX_LINK_BW : case ISIS_SUBTLV_EXT_IS_REACH_RESERVABLE_BW: if (subtlv_len >= 4) { bw.i = EXTRACT_BE_U_4(tptr); - ND_PRINT((ndo, ", %.3f Mbps", bw.f * 8 / 1000000)); + ND_PRINT(", %.3f Mbps", bw.f * 8 / 1000000); } break; case ISIS_SUBTLV_EXT_IS_REACH_UNRESERVED_BW : if (subtlv_len >= 32) { for (te_class = 0; te_class < 8; te_class++) { bw.i = EXTRACT_BE_U_4(tptr); - ND_PRINT((ndo, "%s TE-Class %u: %.3f Mbps", + ND_PRINT("%s TE-Class %u: %.3f Mbps", ident, te_class, - bw.f * 8 / 1000000)); + bw.f * 8 / 1000000); tptr += 4; subtlv_len -= 4; subtlv_sum_len -= 4; @@ -1958,10 +1958,10 @@ isis_print_ext_is_reach(netdissect_options *ndo, case ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS_OLD: if (subtlv_len == 0) break; - ND_PRINT((ndo, "%sBandwidth Constraints Model ID: %s (%u)", + ND_PRINT("%sBandwidth Constraints Model ID: %s (%u)", ident, tok2str(diffserv_te_bc_values, "unknown", EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr))); + EXTRACT_U_1(tptr)); tptr++; subtlv_len--; subtlv_sum_len--; @@ -1971,10 +1971,10 @@ isis_print_ext_is_reach(netdissect_options *ndo, if (subtlv_len < 4) break; bw.i = EXTRACT_BE_U_4(tptr); - ND_PRINT((ndo, "%s Bandwidth constraint CT%u: %.3f Mbps", + ND_PRINT("%s Bandwidth constraint CT%u: %.3f Mbps", ident, te_class, - bw.f * 8 / 1000000)); + bw.f * 8 / 1000000); tptr += 4; subtlv_len -= 4; subtlv_sum_len -= 4; @@ -1983,58 +1983,58 @@ isis_print_ext_is_reach(netdissect_options *ndo, break; case ISIS_SUBTLV_EXT_IS_REACH_TE_METRIC: if (subtlv_len >= 3) - ND_PRINT((ndo, ", %u", EXTRACT_BE_U_3(tptr))); + ND_PRINT(", %u", EXTRACT_BE_U_3(tptr)); break; case ISIS_SUBTLV_EXT_IS_REACH_LINK_ATTRIBUTE: if (subtlv_len == 2) { - ND_PRINT((ndo, ", [ %s ] (0x%04x)", + ND_PRINT(", [ %s ] (0x%04x)", bittok2str(isis_subtlv_link_attribute_values, "Unknown", EXTRACT_BE_U_2(tptr)), - EXTRACT_BE_U_2(tptr))); + EXTRACT_BE_U_2(tptr)); } break; case ISIS_SUBTLV_EXT_IS_REACH_LINK_PROTECTION_TYPE: if (subtlv_len >= 2) { - ND_PRINT((ndo, ", %s, Priority %u", + ND_PRINT(", %s, Priority %u", bittok2str(gmpls_link_prot_values, "none", EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr + 1))); + EXTRACT_U_1(tptr + 1)); } break; case ISIS_SUBTLV_SPB_METRIC: if (subtlv_len >= 6) { - ND_PRINT((ndo, ", LM: %u", EXTRACT_BE_U_3(tptr))); + ND_PRINT(", LM: %u", EXTRACT_BE_U_3(tptr)); tptr += 3; subtlv_len -= 3; subtlv_sum_len -= 3; proc_bytes += 3; - ND_PRINT((ndo, ", P: %u", EXTRACT_U_1(tptr))); + ND_PRINT(", P: %u", EXTRACT_U_1(tptr)); tptr++; subtlv_len--; subtlv_sum_len--; proc_bytes++; - ND_PRINT((ndo, ", P-ID: %u", EXTRACT_BE_U_2(tptr))); + ND_PRINT(", P-ID: %u", EXTRACT_BE_U_2(tptr)); } break; case ISIS_SUBTLV_EXT_IS_REACH_INTF_SW_CAP_DESCR: if (subtlv_len >= 36) { gmpls_switch_cap = EXTRACT_U_1(tptr); - ND_PRINT((ndo, "%s Interface Switching Capability:%s", + ND_PRINT("%s Interface Switching Capability:%s", ident, - tok2str(gmpls_switch_cap_values, "Unknown", gmpls_switch_cap))); - ND_PRINT((ndo, ", LSP Encoding: %s", - tok2str(gmpls_encoding_values, "Unknown", EXTRACT_U_1((tptr + 1))))); + tok2str(gmpls_switch_cap_values, "Unknown", gmpls_switch_cap)); + ND_PRINT(", LSP Encoding: %s", + tok2str(gmpls_encoding_values, "Unknown", EXTRACT_U_1((tptr + 1)))); tptr += 4; subtlv_len -= 4; subtlv_sum_len -= 4; proc_bytes += 4; - ND_PRINT((ndo, "%s Max LSP Bandwidth:", ident)); + ND_PRINT("%s Max LSP Bandwidth:", ident); for (priority_level = 0; priority_level < 8; priority_level++) { bw.i = EXTRACT_BE_U_4(tptr); - ND_PRINT((ndo, "%s priority level %u: %.3f Mbps", + ND_PRINT("%s priority level %u: %.3f Mbps", ident, priority_level, - bw.f * 8 / 1000000)); + bw.f * 8 / 1000000); tptr += 4; subtlv_len -= 4; subtlv_sum_len -= 4; @@ -2048,16 +2048,16 @@ isis_print_ext_is_reach(netdissect_options *ndo, if (subtlv_len < 6) break; bw.i = EXTRACT_BE_U_4(tptr); - ND_PRINT((ndo, "%s Min LSP Bandwidth: %.3f Mbps", ident, bw.f * 8 / 1000000)); - ND_PRINT((ndo, "%s Interface MTU: %u", ident, EXTRACT_BE_U_2(tptr + 4))); + ND_PRINT("%s Min LSP Bandwidth: %.3f Mbps", ident, bw.f * 8 / 1000000); + ND_PRINT("%s Interface MTU: %u", ident, EXTRACT_BE_U_2(tptr + 4)); break; case GMPLS_TSC: if (subtlv_len < 8) break; bw.i = EXTRACT_BE_U_4(tptr); - ND_PRINT((ndo, "%s Min LSP Bandwidth: %.3f Mbps", ident, bw.f * 8 / 1000000)); - ND_PRINT((ndo, "%s Indication %s", ident, - tok2str(gmpls_switch_cap_tsc_indication_values, "Unknown (%u)", EXTRACT_U_1((tptr + 4))))); + ND_PRINT("%s Min LSP Bandwidth: %.3f Mbps", ident, bw.f * 8 / 1000000); + ND_PRINT("%s Indication %s", ident, + tok2str(gmpls_switch_cap_tsc_indication_values, "Unknown (%u)", EXTRACT_U_1((tptr + 4)))); break; default: /* there is some optional stuff left to decode but this is as of yet @@ -2099,15 +2099,15 @@ isis_print_mtid(netdissect_options *ndo, if (!ND_TTEST_2(tptr)) return(0); - ND_PRINT((ndo, "%s%s", + ND_PRINT("%s%s", ident, tok2str(isis_mt_values, "Reserved for IETF Consensus", - ISIS_MASK_MTID(EXTRACT_BE_U_2(tptr))))); + ISIS_MASK_MTID(EXTRACT_BE_U_2(tptr)))); - ND_PRINT((ndo, " Topology (0x%03x), Flags: [%s]", + ND_PRINT(" Topology (0x%03x), Flags: [%s]", ISIS_MASK_MTID(EXTRACT_BE_U_2(tptr)), - bittok2str(isis_mt_flag_values, "none",ISIS_MASK_MTFLAGS(EXTRACT_BE_U_2(tptr))))); + bittok2str(isis_mt_flag_values, "none",ISIS_MASK_MTFLAGS(EXTRACT_BE_U_2(tptr)))); return(2); } @@ -2140,9 +2140,9 @@ isis_print_extd_ip_reach(netdissect_options *ndo, tptr++; bit_length = status_byte&0x3f; if (bit_length > 32) { - ND_PRINT((ndo, "%sIPv4 prefix: bad bit length %u", + ND_PRINT("%sIPv4 prefix: bad bit length %u", ident, - bit_length)); + bit_length); return (0); } processed++; @@ -2152,9 +2152,9 @@ isis_print_extd_ip_reach(netdissect_options *ndo, status_byte=EXTRACT_U_1(tptr); bit_length=EXTRACT_U_1(tptr + 1); if (bit_length > 128) { - ND_PRINT((ndo, "%sIPv6 prefix: bad bit length %u", + ND_PRINT("%sIPv6 prefix: bad bit length %u", ident, - bit_length)); + bit_length); return (0); } tptr+=2; @@ -2172,26 +2172,26 @@ isis_print_extd_ip_reach(netdissect_options *ndo, processed+=byte_length; if (afi == AF_INET) - ND_PRINT((ndo, "%sIPv4 prefix: %15s/%u", + ND_PRINT("%sIPv4 prefix: %15s/%u", ident, ipaddr_string(ndo, prefix), - bit_length)); + bit_length); else if (afi == AF_INET6) - ND_PRINT((ndo, "%sIPv6 prefix: %s/%u", + ND_PRINT("%sIPv6 prefix: %s/%u", ident, ip6addr_string(ndo, prefix), - bit_length)); + bit_length); - ND_PRINT((ndo, ", Distribution: %s, Metric: %u", + ND_PRINT(", Distribution: %s, Metric: %u", ISIS_MASK_TLV_EXTD_IP_UPDOWN(status_byte) ? "down" : "up", - metric)); + metric); if (afi == AF_INET && ISIS_MASK_TLV_EXTD_IP_SUBTLV(status_byte)) - ND_PRINT((ndo, ", sub-TLVs present")); + ND_PRINT(", sub-TLVs present"); else if (afi == AF_INET6) - ND_PRINT((ndo, ", %s%s", + ND_PRINT(", %s%s", ISIS_MASK_TLV_EXTD_IP6_IE(status_byte) ? "External" : "Internal", - ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte) ? ", sub-TLVs present" : "")); + ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte) ? ", sub-TLVs present" : ""); if ((afi == AF_INET && ISIS_MASK_TLV_EXTD_IP_SUBTLV(status_byte)) || (afi == AF_INET6 && ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte)) @@ -2205,7 +2205,7 @@ isis_print_extd_ip_reach(netdissect_options *ndo, sublen=EXTRACT_U_1(tptr); tptr++; processed+=sublen+1; - ND_PRINT((ndo, " (%u)", sublen)); /* print out subTLV length */ + ND_PRINT(" (%u)", sublen); /* print out subTLV length */ while (sublen>0) { if (!ND_TTEST_2(tptr)) @@ -2285,7 +2285,7 @@ isis_print(netdissect_options *ndo, header_psnp = (const struct isis_psnp_header *)pptr; if (!ndo->ndo_eflag) - ND_PRINT((ndo, "IS-IS")); + ND_PRINT("IS-IS"); /* * Sanity checking of the header. @@ -2293,31 +2293,31 @@ isis_print(netdissect_options *ndo, version = EXTRACT_U_1(isis_header->version); if (version != ISIS_VERSION) { - ND_PRINT((ndo, "version %u packet not supported", version)); + ND_PRINT("version %u packet not supported", version); return (0); } pdu_id_length = EXTRACT_U_1(isis_header->id_length); if ((pdu_id_length != SYSTEM_ID_LEN) && (pdu_id_length != 0)) { - ND_PRINT((ndo, "system ID length of %u is not supported", - pdu_id_length)); + ND_PRINT("system ID length of %u is not supported", + pdu_id_length); return (0); } pdu_version = EXTRACT_U_1(isis_header->pdu_version); if (pdu_version != ISIS_VERSION) { - ND_PRINT((ndo, "version %u packet not supported", pdu_version)); + ND_PRINT("version %u packet not supported", pdu_version); return (0); } fixed_len = EXTRACT_U_1(isis_header->fixed_len); if (length < fixed_len) { - ND_PRINT((ndo, "fixed header length %u > packet length %u", fixed_len, length)); + ND_PRINT("fixed header length %u > packet length %u", fixed_len, length); return (0); } if (fixed_len < ISIS_COMMON_HEADER_SIZE) { - ND_PRINT((ndo, "fixed header length %u < minimum header size %u", fixed_len, (u_int)ISIS_COMMON_HEADER_SIZE)); + ND_PRINT("fixed header length %u < minimum header size %u", fixed_len, (u_int)ISIS_COMMON_HEADER_SIZE); return (0); } @@ -2327,7 +2327,7 @@ isis_print(netdissect_options *ndo, max_area = 3; /* silly shit */ break; case 255: - ND_PRINT((ndo, "bad packet -- 255 areas")); + ND_PRINT("bad packet -- 255 areas"); return (0); default: max_area = pdu_max_area; @@ -2358,7 +2358,7 @@ isis_print(netdissect_options *ndo, /* toss any non 6-byte sys-ID len PDUs */ if (id_length != 6 ) { - ND_PRINT((ndo, "bad packet -- illegal sys-ID length (%u)", id_length)); + ND_PRINT("bad packet -- illegal sys-ID length (%u)", id_length); return (0); } @@ -2366,14 +2366,14 @@ isis_print(netdissect_options *ndo, /* in non-verbose mode print the basic PDU Type plus PDU specific brief information*/ if (ndo->ndo_vflag == 0) { - ND_PRINT((ndo, "%s%s", + ND_PRINT("%s%s", ndo->ndo_eflag ? "" : ", ", - tok2str(isis_pdu_values, "unknown PDU-Type %u", pdu_type))); + tok2str(isis_pdu_values, "unknown PDU-Type %u", pdu_type)); } else { /* ok they seem to want to know everything - lets fully decode it */ - ND_PRINT((ndo, "%slength %u", ndo->ndo_eflag ? "" : ", ", length)); + ND_PRINT("%slength %u", ndo->ndo_eflag ? "" : ", ", length); - ND_PRINT((ndo, "\n\t%s, hlen: %u, v: %u, pdu-v: %u, sys-id-len: %u (%u), max-area: %u (%u)", + ND_PRINT("\n\t%s, hlen: %u, v: %u, pdu-v: %u, sys-id-len: %u (%u), max-area: %u (%u)", tok2str(isis_pdu_values, "unknown, type %u", pdu_type), @@ -2383,7 +2383,7 @@ isis_print(netdissect_options *ndo, id_length, pdu_id_length, max_area, - pdu_max_area)); + pdu_max_area); if (ndo->ndo_vflag > 1) { if (!print_unknown_data(ndo, optr, "\n\t", 8)) /* provide the _o_riginal pointer */ @@ -2396,20 +2396,20 @@ isis_print(netdissect_options *ndo, case ISIS_PDU_L1_LAN_IIH: case ISIS_PDU_L2_LAN_IIH: if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_IIH_LAN_HEADER_SIZE)) { - ND_PRINT((ndo, ", bogus fixed header length %u should be %lu", - fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_IIH_LAN_HEADER_SIZE))); + ND_PRINT(", bogus fixed header length %u should be %lu", + fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_IIH_LAN_HEADER_SIZE)); return (0); } ND_TCHECK_SIZE(header_iih_lan); if (length < ISIS_COMMON_HEADER_SIZE+ISIS_IIH_LAN_HEADER_SIZE) goto trunc; if (ndo->ndo_vflag == 0) { - ND_PRINT((ndo, ", src-id %s", - isis_print_id(header_iih_lan->source_id, SYSTEM_ID_LEN))); - ND_PRINT((ndo, ", lan-id %s, prio %u", + ND_PRINT(", src-id %s", + isis_print_id(header_iih_lan->source_id, SYSTEM_ID_LEN)); + ND_PRINT(", lan-id %s, prio %u", isis_print_id(header_iih_lan->lan_id,NODE_ID_LEN), - EXTRACT_U_1(header_iih_lan->priority))); - ND_PRINT((ndo, ", length %u", length)); + EXTRACT_U_1(header_iih_lan->priority)); + ND_PRINT(", length %u", length); return (1); } pdu_len=EXTRACT_BE_U_2(header_iih_lan->pdu_len); @@ -2418,17 +2418,17 @@ isis_print(netdissect_options *ndo, length=pdu_len; } - ND_PRINT((ndo, "\n\t source-id: %s, holding time: %us, Flags: [%s]", + ND_PRINT("\n\t source-id: %s, holding time: %us, Flags: [%s]", isis_print_id(header_iih_lan->source_id,SYSTEM_ID_LEN), EXTRACT_BE_U_2(header_iih_lan->holding_time), tok2str(isis_iih_circuit_type_values, "unknown circuit type 0x%02x", - EXTRACT_U_1(header_iih_lan->circuit_type)))); + EXTRACT_U_1(header_iih_lan->circuit_type))); - ND_PRINT((ndo, "\n\t lan-id: %s, Priority: %u, PDU length: %u", + ND_PRINT("\n\t lan-id: %s, Priority: %u, PDU length: %u", isis_print_id(header_iih_lan->lan_id, NODE_ID_LEN), EXTRACT_U_1(header_iih_lan->priority) & ISIS_LAN_PRIORITY_MASK, - pdu_len)); + pdu_len); if (ndo->ndo_vflag > 1) { if (!print_unknown_data(ndo, pptr, "\n\t ", ISIS_IIH_LAN_HEADER_SIZE)) @@ -2441,16 +2441,16 @@ isis_print(netdissect_options *ndo, case ISIS_PDU_PTP_IIH: if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_IIH_PTP_HEADER_SIZE)) { - ND_PRINT((ndo, ", bogus fixed header length %u should be %lu", - fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_IIH_PTP_HEADER_SIZE))); + ND_PRINT(", bogus fixed header length %u should be %lu", + fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_IIH_PTP_HEADER_SIZE)); return (0); } ND_TCHECK_SIZE(header_iih_ptp); if (length < ISIS_COMMON_HEADER_SIZE+ISIS_IIH_PTP_HEADER_SIZE) goto trunc; if (ndo->ndo_vflag == 0) { - ND_PRINT((ndo, ", src-id %s", isis_print_id(header_iih_ptp->source_id, SYSTEM_ID_LEN))); - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT(", src-id %s", isis_print_id(header_iih_ptp->source_id, SYSTEM_ID_LEN)); + ND_PRINT(", length %u", length); return (1); } pdu_len=EXTRACT_BE_U_2(header_iih_ptp->pdu_len); @@ -2459,16 +2459,16 @@ isis_print(netdissect_options *ndo, length=pdu_len; } - ND_PRINT((ndo, "\n\t source-id: %s, holding time: %us, Flags: [%s]", + ND_PRINT("\n\t source-id: %s, holding time: %us, Flags: [%s]", isis_print_id(header_iih_ptp->source_id,SYSTEM_ID_LEN), EXTRACT_BE_U_2(header_iih_ptp->holding_time), tok2str(isis_iih_circuit_type_values, "unknown circuit type 0x%02x", - EXTRACT_U_1(header_iih_ptp->circuit_type)))); + EXTRACT_U_1(header_iih_ptp->circuit_type))); - ND_PRINT((ndo, "\n\t circuit-id: 0x%02x, PDU length: %u", + ND_PRINT("\n\t circuit-id: 0x%02x, PDU length: %u", EXTRACT_U_1(header_iih_ptp->circuit_id), - pdu_len)); + pdu_len); if (ndo->ndo_vflag > 1) { if (!print_unknown_data(ndo, pptr, "\n\t ", ISIS_IIH_PTP_HEADER_SIZE)) @@ -2482,19 +2482,19 @@ isis_print(netdissect_options *ndo, case ISIS_PDU_L1_LSP: case ISIS_PDU_L2_LSP: if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_LSP_HEADER_SIZE)) { - ND_PRINT((ndo, ", bogus fixed header length %u should be %lu", - fixed_len, (unsigned long)ISIS_LSP_HEADER_SIZE)); + ND_PRINT(", bogus fixed header length %u should be %lu", + fixed_len, (unsigned long)ISIS_LSP_HEADER_SIZE); return (0); } ND_TCHECK_SIZE(header_lsp); if (length < ISIS_COMMON_HEADER_SIZE+ISIS_LSP_HEADER_SIZE) goto trunc; if (ndo->ndo_vflag == 0) { - ND_PRINT((ndo, ", lsp-id %s, seq 0x%08x, lifetime %5us", + ND_PRINT(", lsp-id %s, seq 0x%08x, lifetime %5us", isis_print_id(header_lsp->lsp_id, LSP_ID_LEN), EXTRACT_BE_U_4(header_lsp->sequence_number), - EXTRACT_BE_U_2(header_lsp->remaining_lifetime))); - ND_PRINT((ndo, ", length %u", length)); + EXTRACT_BE_U_2(header_lsp->remaining_lifetime)); + ND_PRINT(", length %u", length); return (1); } pdu_len=EXTRACT_BE_U_2(header_lsp->pdu_len); @@ -2503,30 +2503,30 @@ isis_print(netdissect_options *ndo, length=pdu_len; } - ND_PRINT((ndo, "\n\t lsp-id: %s, seq: 0x%08x, lifetime: %5us\n\t chksum: 0x%04x", + ND_PRINT("\n\t lsp-id: %s, seq: 0x%08x, lifetime: %5us\n\t chksum: 0x%04x", isis_print_id(header_lsp->lsp_id, LSP_ID_LEN), EXTRACT_BE_U_4(header_lsp->sequence_number), EXTRACT_BE_U_2(header_lsp->remaining_lifetime), - EXTRACT_BE_U_2(header_lsp->checksum))); + EXTRACT_BE_U_2(header_lsp->checksum)); osi_print_cksum(ndo, (const uint8_t *)header_lsp->lsp_id, EXTRACT_BE_U_2(header_lsp->checksum), 12, length-12); - ND_PRINT((ndo, ", PDU length: %u, Flags: [ %s", + ND_PRINT(", PDU length: %u, Flags: [ %s", pdu_len, - ISIS_MASK_LSP_OL_BIT(header_lsp->typeblock) ? "Overload bit set, " : "")); + ISIS_MASK_LSP_OL_BIT(header_lsp->typeblock) ? "Overload bit set, " : ""); if (ISIS_MASK_LSP_ATT_BITS(header_lsp->typeblock)) { - ND_PRINT((ndo, "%s", ISIS_MASK_LSP_ATT_DEFAULT_BIT(header_lsp->typeblock) ? "default " : "")); - ND_PRINT((ndo, "%s", ISIS_MASK_LSP_ATT_DELAY_BIT(header_lsp->typeblock) ? "delay " : "")); - ND_PRINT((ndo, "%s", ISIS_MASK_LSP_ATT_EXPENSE_BIT(header_lsp->typeblock) ? "expense " : "")); - ND_PRINT((ndo, "%s", ISIS_MASK_LSP_ATT_ERROR_BIT(header_lsp->typeblock) ? "error " : "")); - ND_PRINT((ndo, "ATT bit set, ")); + ND_PRINT("%s", ISIS_MASK_LSP_ATT_DEFAULT_BIT(header_lsp->typeblock) ? "default " : ""); + ND_PRINT("%s", ISIS_MASK_LSP_ATT_DELAY_BIT(header_lsp->typeblock) ? "delay " : ""); + ND_PRINT("%s", ISIS_MASK_LSP_ATT_EXPENSE_BIT(header_lsp->typeblock) ? "expense " : ""); + ND_PRINT("%s", ISIS_MASK_LSP_ATT_ERROR_BIT(header_lsp->typeblock) ? "error " : ""); + ND_PRINT("ATT bit set, "); } - ND_PRINT((ndo, "%s", ISIS_MASK_LSP_PARTITION_BIT(header_lsp->typeblock) ? "P bit set, " : "")); - ND_PRINT((ndo, "%s ]", tok2str(isis_lsp_istype_values, "Unknown(0x%x)", - ISIS_MASK_LSP_ISTYPE_BITS(header_lsp->typeblock)))); + ND_PRINT("%s", ISIS_MASK_LSP_PARTITION_BIT(header_lsp->typeblock) ? "P bit set, " : ""); + ND_PRINT("%s ]", tok2str(isis_lsp_istype_values, "Unknown(0x%x)", + ISIS_MASK_LSP_ISTYPE_BITS(header_lsp->typeblock))); if (ndo->ndo_vflag > 1) { if (!print_unknown_data(ndo, pptr, "\n\t ", ISIS_LSP_HEADER_SIZE)) @@ -2540,16 +2540,16 @@ isis_print(netdissect_options *ndo, case ISIS_PDU_L1_CSNP: case ISIS_PDU_L2_CSNP: if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_CSNP_HEADER_SIZE)) { - ND_PRINT((ndo, ", bogus fixed header length %u should be %lu", - fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_CSNP_HEADER_SIZE))); + ND_PRINT(", bogus fixed header length %u should be %lu", + fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_CSNP_HEADER_SIZE)); return (0); } ND_TCHECK_SIZE(header_csnp); if (length < ISIS_COMMON_HEADER_SIZE+ISIS_CSNP_HEADER_SIZE) goto trunc; if (ndo->ndo_vflag == 0) { - ND_PRINT((ndo, ", src-id %s", isis_print_id(header_csnp->source_id, NODE_ID_LEN))); - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT(", src-id %s", isis_print_id(header_csnp->source_id, NODE_ID_LEN)); + ND_PRINT(", length %u", length); return (1); } pdu_len=EXTRACT_BE_U_2(header_csnp->pdu_len); @@ -2558,13 +2558,13 @@ isis_print(netdissect_options *ndo, length=pdu_len; } - ND_PRINT((ndo, "\n\t source-id: %s, PDU length: %u", + ND_PRINT("\n\t source-id: %s, PDU length: %u", isis_print_id(header_csnp->source_id, NODE_ID_LEN), - pdu_len)); - ND_PRINT((ndo, "\n\t start lsp-id: %s", - isis_print_id(header_csnp->start_lsp_id, LSP_ID_LEN))); - ND_PRINT((ndo, "\n\t end lsp-id: %s", - isis_print_id(header_csnp->end_lsp_id, LSP_ID_LEN))); + pdu_len); + ND_PRINT("\n\t start lsp-id: %s", + isis_print_id(header_csnp->start_lsp_id, LSP_ID_LEN)); + ND_PRINT("\n\t end lsp-id: %s", + isis_print_id(header_csnp->end_lsp_id, LSP_ID_LEN)); if (ndo->ndo_vflag > 1) { if (!print_unknown_data(ndo, pptr, "\n\t ", ISIS_CSNP_HEADER_SIZE)) @@ -2578,16 +2578,16 @@ isis_print(netdissect_options *ndo, case ISIS_PDU_L1_PSNP: case ISIS_PDU_L2_PSNP: if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_PSNP_HEADER_SIZE)) { - ND_PRINT((ndo, "- bogus fixed header length %u should be %lu", - fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_PSNP_HEADER_SIZE))); + ND_PRINT("- bogus fixed header length %u should be %lu", + fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_PSNP_HEADER_SIZE)); return (0); } ND_TCHECK_SIZE(header_psnp); if (length < ISIS_COMMON_HEADER_SIZE+ISIS_PSNP_HEADER_SIZE) goto trunc; if (ndo->ndo_vflag == 0) { - ND_PRINT((ndo, ", src-id %s", isis_print_id(header_psnp->source_id, NODE_ID_LEN))); - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT(", src-id %s", isis_print_id(header_psnp->source_id, NODE_ID_LEN)); + ND_PRINT(", length %u", length); return (1); } pdu_len=EXTRACT_BE_U_2(header_psnp->pdu_len); @@ -2596,9 +2596,9 @@ isis_print(netdissect_options *ndo, length=pdu_len; } - ND_PRINT((ndo, "\n\t source-id: %s, PDU length: %u", + ND_PRINT("\n\t source-id: %s, PDU length: %u", isis_print_id(header_psnp->source_id, NODE_ID_LEN), - pdu_len)); + pdu_len); if (ndo->ndo_vflag > 1) { if (!print_unknown_data(ndo, pptr, "\n\t ", ISIS_PSNP_HEADER_SIZE)) @@ -2611,7 +2611,7 @@ isis_print(netdissect_options *ndo, default: if (ndo->ndo_vflag == 0) { - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT(", length %u", length); return (1); } (void)print_unknown_data(ndo, pptr, "\n\t ", length); @@ -2634,12 +2634,12 @@ isis_print(netdissect_options *ndo, tptr = pptr; /* first lets see if we know the TLVs name*/ - ND_PRINT((ndo, "\n\t %s TLV #%u, length: %u", + ND_PRINT("\n\t %s TLV #%u, length: %u", tok2str(isis_tlv_values, "unknown", tlv_type), tlv_type, - tlv_len)); + tlv_len); if (tlv_len == 0) /* something is invalid */ continue; @@ -2655,9 +2655,9 @@ isis_print(netdissect_options *ndo, tptr++; while (tmp && alen < tmp) { ND_TCHECK_LEN(tptr, alen); - ND_PRINT((ndo, "\n\t Area address (length: %u): %s", + ND_PRINT("\n\t Area address (length: %u): %s", alen, - isonsap_string(ndo, tptr, alen))); + isonsap_string(ndo, tptr, alen)); tptr += alen; tmp -= alen + 1; if (tmp==0) /* if this is the last area address do not attemt a boundary check */ @@ -2670,7 +2670,7 @@ isis_print(netdissect_options *ndo, case ISIS_TLV_ISNEIGH: while (tmp >= MAC_ADDR_LEN) { ND_TCHECK_LEN(tptr, MAC_ADDR_LEN); - ND_PRINT((ndo, "\n\t SNPA: %s", isis_print_id(tptr, MAC_ADDR_LEN))); + ND_PRINT("\n\t SNPA: %s", isis_print_id(tptr, MAC_ADDR_LEN)); tmp -= MAC_ADDR_LEN; tptr += MAC_ADDR_LEN; } @@ -2682,14 +2682,14 @@ isis_print(netdissect_options *ndo, lan_alen = EXTRACT_U_1(tptr); /* LAN address length */ tptr++; if (lan_alen == 0) { - ND_PRINT((ndo, "\n\t LAN address length 0 bytes (invalid)")); + ND_PRINT("\n\t LAN address length 0 bytes (invalid)"); break; } tmp --; - ND_PRINT((ndo, "\n\t LAN address length %u bytes ", lan_alen)); + ND_PRINT("\n\t LAN address length %u bytes ", lan_alen); while (tmp >= lan_alen) { ND_TCHECK_LEN(tptr, lan_alen); - ND_PRINT((ndo, "\n\t\tIS Neighbor: %s", isis_print_id(tptr, lan_alen))); + ND_PRINT("\n\t\tIS Neighbor: %s", isis_print_id(tptr, lan_alen)); tmp -= lan_alen; tptr +=lan_alen; } @@ -2735,16 +2735,16 @@ isis_print(netdissect_options *ndo, break; case ISIS_TLV_IS_REACH: ND_TCHECK_1(tptr); /* check if there is one byte left to read out the virtual flag */ - ND_PRINT((ndo, "\n\t %s", + ND_PRINT("\n\t %s", tok2str(isis_is_reach_virtual_values, "bogus virtual flag 0x%02x", - EXTRACT_U_1(tptr)))); + EXTRACT_U_1(tptr))); tptr++; tlv_is_reach = (const struct isis_tlv_is_reach *)tptr; while (tmp >= sizeof(struct isis_tlv_is_reach)) { ND_TCHECK_SIZE(tlv_is_reach); - ND_PRINT((ndo, "\n\t IS Neighbor: %s", - isis_print_id(tlv_is_reach->neighbor_nodeid, NODE_ID_LEN))); + ND_PRINT("\n\t IS Neighbor: %s", + isis_print_id(tlv_is_reach->neighbor_nodeid, NODE_ID_LEN)); isis_print_metric_block(ndo, &tlv_is_reach->isis_metric_block); tmp -= sizeof(struct isis_tlv_is_reach); tlv_is_reach++; @@ -2755,8 +2755,8 @@ isis_print(netdissect_options *ndo, tlv_es_reach = (const struct isis_tlv_es_reach *)tptr; while (tmp >= sizeof(struct isis_tlv_es_reach)) { ND_TCHECK_SIZE(tlv_es_reach); - ND_PRINT((ndo, "\n\t ES Neighbor: %s", - isis_print_id(tlv_es_reach->neighbor_sysid, SYSTEM_ID_LEN))); + ND_PRINT("\n\t ES Neighbor: %s", + isis_print_id(tlv_es_reach->neighbor_sysid, SYSTEM_ID_LEN)); isis_print_metric_block(ndo, &tlv_es_reach->isis_metric_block); tmp -= sizeof(struct isis_tlv_es_reach); tlv_es_reach++; @@ -2828,8 +2828,8 @@ isis_print(netdissect_options *ndo, while (tmp>=sizeof(struct in6_addr)) { ND_TCHECK_LEN(tptr, sizeof(struct in6_addr)); - ND_PRINT((ndo, "\n\t IPv6 interface address: %s", - ip6addr_string(ndo, tptr))); + ND_PRINT("\n\t IPv6 interface address: %s", + ip6addr_string(ndo, tptr)); tptr += sizeof(struct in6_addr); tmp -= sizeof(struct in6_addr); @@ -2838,10 +2838,10 @@ isis_print(netdissect_options *ndo, case ISIS_TLV_AUTH: ND_TCHECK_1(tptr); - ND_PRINT((ndo, "\n\t %s: ", + ND_PRINT("\n\t %s: ", tok2str(isis_subtlv_auth_values, "unknown Authentication type 0x%02x", - EXTRACT_U_1(tptr)))); + EXTRACT_U_1(tptr))); switch (EXTRACT_U_1(tptr)) { case ISIS_SUBTLV_AUTH_SIMPLE: @@ -2851,24 +2851,24 @@ isis_print(netdissect_options *ndo, case ISIS_SUBTLV_AUTH_MD5: for(i=1;i<tlv_len;i++) { ND_TCHECK_1(tptr + i); - ND_PRINT((ndo, "%02x", EXTRACT_U_1(tptr + i))); + ND_PRINT("%02x", EXTRACT_U_1(tptr + i)); } if (tlv_len != ISIS_SUBTLV_AUTH_MD5_LEN+1) - ND_PRINT((ndo, ", (invalid subTLV) ")); + ND_PRINT(", (invalid subTLV) "); sigcheck = signature_verify(ndo, optr, length, tptr + 1, isis_clear_checksum_lifetime, header_lsp); - ND_PRINT((ndo, " (%s)", tok2str(signature_check_values, "Unknown", sigcheck))); + ND_PRINT(" (%s)", tok2str(signature_check_values, "Unknown", sigcheck)); break; case ISIS_SUBTLV_AUTH_GENERIC: ND_TCHECK_2(tptr + 1); key_id = EXTRACT_BE_U_2(tptr + 1); - ND_PRINT((ndo, "%u, password: ", key_id)); + ND_PRINT("%u, password: ", key_id); for(i=1 + sizeof(uint16_t);i<tlv_len;i++) { ND_TCHECK_1(tptr + i); - ND_PRINT((ndo, "%02x", EXTRACT_U_1(tptr + i))); + ND_PRINT("%02x", EXTRACT_U_1(tptr + i)); } break; case ISIS_SUBTLV_AUTH_PRIVATE: @@ -2883,41 +2883,41 @@ isis_print(netdissect_options *ndo, tlv_ptp_adj = (const struct isis_tlv_ptp_adj *)tptr; if(tmp>=1) { ND_TCHECK_1(tptr); - ND_PRINT((ndo, "\n\t Adjacency State: %s (%u)", + ND_PRINT("\n\t Adjacency State: %s (%u)", tok2str(isis_ptp_adjancey_values, "unknown", EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr))); + EXTRACT_U_1(tptr)); tmp--; } if(tmp>sizeof(tlv_ptp_adj->extd_local_circuit_id)) { ND_TCHECK(tlv_ptp_adj->extd_local_circuit_id); - ND_PRINT((ndo, "\n\t Extended Local circuit-ID: 0x%08x", - EXTRACT_BE_U_4(tlv_ptp_adj->extd_local_circuit_id))); + ND_PRINT("\n\t Extended Local circuit-ID: 0x%08x", + EXTRACT_BE_U_4(tlv_ptp_adj->extd_local_circuit_id)); tmp-=sizeof(tlv_ptp_adj->extd_local_circuit_id); } if(tmp>=SYSTEM_ID_LEN) { ND_TCHECK_LEN(tlv_ptp_adj->neighbor_sysid, SYSTEM_ID_LEN); - ND_PRINT((ndo, "\n\t Neighbor System-ID: %s", - isis_print_id(tlv_ptp_adj->neighbor_sysid, SYSTEM_ID_LEN))); + ND_PRINT("\n\t Neighbor System-ID: %s", + isis_print_id(tlv_ptp_adj->neighbor_sysid, SYSTEM_ID_LEN)); tmp-=SYSTEM_ID_LEN; } if(tmp>=sizeof(tlv_ptp_adj->neighbor_extd_local_circuit_id)) { ND_TCHECK(tlv_ptp_adj->neighbor_extd_local_circuit_id); - ND_PRINT((ndo, "\n\t Neighbor Extended Local circuit-ID: 0x%08x", - EXTRACT_BE_U_4(tlv_ptp_adj->neighbor_extd_local_circuit_id))); + ND_PRINT("\n\t Neighbor Extended Local circuit-ID: 0x%08x", + EXTRACT_BE_U_4(tlv_ptp_adj->neighbor_extd_local_circuit_id)); } break; case ISIS_TLV_PROTOCOLS: - ND_PRINT((ndo, "\n\t NLPID(s): ")); + ND_PRINT("\n\t NLPID(s): "); while (tmp>0) { ND_TCHECK_1(tptr); - ND_PRINT((ndo, "%s (0x%02x)", + ND_PRINT("%s (0x%02x)", tok2str(nlpid_values, "unknown", EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr))); + EXTRACT_U_1(tptr)); if (tmp>1) /* further NPLIDs ? - put comma */ - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); tptr++; tmp--; } @@ -2927,9 +2927,9 @@ isis_print(netdissect_options *ndo, { ND_TCHECK_2(tptr); - ND_PRINT((ndo, "\n\t RES: %u, MTID(s): %u", + ND_PRINT("\n\t RES: %u, MTID(s): %u", (EXTRACT_BE_U_2(tptr) >> 12), - (EXTRACT_BE_U_2(tptr) & 0x0fff))); + (EXTRACT_BE_U_2(tptr) & 0x0fff)); tmp = tmp-2; tptr = tptr+2; @@ -2944,10 +2944,10 @@ isis_print(netdissect_options *ndo, ND_TCHECK_2(tptr); - ND_PRINT((ndo, "\n\t O: %u, RES: %u, MTID(s): %u", + ND_PRINT("\n\t O: %u, RES: %u, MTID(s): %u", (EXTRACT_BE_U_2(tptr) >> 15) & 0x01, (EXTRACT_BE_U_2(tptr) >> 12) & 0x07, - EXTRACT_BE_U_2(tptr) & 0x0fff)); + EXTRACT_BE_U_2(tptr) & 0x0fff); tmp = tmp-2; tptr = tptr+2; @@ -2959,20 +2959,20 @@ isis_print(netdissect_options *ndo, case ISIS_TLV_TE_ROUTER_ID: ND_TCHECK_LEN(pptr, sizeof(struct in_addr)); - ND_PRINT((ndo, "\n\t Traffic Engineering Router ID: %s", ipaddr_string(ndo, pptr))); + ND_PRINT("\n\t Traffic Engineering Router ID: %s", ipaddr_string(ndo, pptr)); break; case ISIS_TLV_IPADDR: while (tmp>=sizeof(struct in_addr)) { ND_TCHECK_LEN(tptr, sizeof(struct in_addr)); - ND_PRINT((ndo, "\n\t IPv4 interface address: %s", ipaddr_string(ndo, tptr))); + ND_PRINT("\n\t IPv4 interface address: %s", ipaddr_string(ndo, tptr)); tptr += sizeof(struct in_addr); tmp -= sizeof(struct in_addr); } break; case ISIS_TLV_HOSTNAME: - ND_PRINT((ndo, "\n\t Hostname: ")); + ND_PRINT("\n\t Hostname: "); if (fn_printzp(ndo, tptr, tmp, ndo->ndo_snapend)) goto trunctlv; break; @@ -2981,34 +2981,34 @@ isis_print(netdissect_options *ndo, if (tmp < NODE_ID_LEN) break; ND_TCHECK_LEN(tptr, NODE_ID_LEN); - ND_PRINT((ndo, "\n\t IS Neighbor: %s", isis_print_id(tptr, NODE_ID_LEN))); + ND_PRINT("\n\t IS Neighbor: %s", isis_print_id(tptr, NODE_ID_LEN)); tptr+=NODE_ID_LEN; tmp-=NODE_ID_LEN; if (tmp < 1) break; ND_TCHECK_1(tptr); - ND_PRINT((ndo, ", Flags: [%s]", ISIS_MASK_TLV_SHARED_RISK_GROUP(EXTRACT_U_1(tptr)) ? "numbered" : "unnumbered")); + ND_PRINT(", Flags: [%s]", ISIS_MASK_TLV_SHARED_RISK_GROUP(EXTRACT_U_1(tptr)) ? "numbered" : "unnumbered"); tptr++; tmp--; if (tmp < sizeof(struct in_addr)) break; ND_TCHECK_LEN(tptr, sizeof(struct in_addr)); - ND_PRINT((ndo, "\n\t IPv4 interface address: %s", ipaddr_string(ndo, tptr))); + ND_PRINT("\n\t IPv4 interface address: %s", ipaddr_string(ndo, tptr)); tptr+=sizeof(struct in_addr); tmp-=sizeof(struct in_addr); if (tmp < sizeof(struct in_addr)) break; ND_TCHECK_LEN(tptr, sizeof(struct in_addr)); - ND_PRINT((ndo, "\n\t IPv4 neighbor address: %s", ipaddr_string(ndo, tptr))); + ND_PRINT("\n\t IPv4 neighbor address: %s", ipaddr_string(ndo, tptr)); tptr+=sizeof(struct in_addr); tmp-=sizeof(struct in_addr); while (tmp>=4) { ND_TCHECK_4(tptr); - ND_PRINT((ndo, "\n\t Link-ID: 0x%08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t Link-ID: 0x%08x", EXTRACT_BE_U_4(tptr)); tptr+=4; tmp-=4; } @@ -3018,14 +3018,14 @@ isis_print(netdissect_options *ndo, tlv_lsp = (const struct isis_tlv_lsp *)tptr; while(tmp>=sizeof(struct isis_tlv_lsp)) { ND_TCHECK((tlv_lsp->lsp_id)[LSP_ID_LEN-1]); - ND_PRINT((ndo, "\n\t lsp-id: %s", - isis_print_id(tlv_lsp->lsp_id, LSP_ID_LEN))); + ND_PRINT("\n\t lsp-id: %s", + isis_print_id(tlv_lsp->lsp_id, LSP_ID_LEN)); ND_TCHECK_LEN(tlv_lsp->sequence_number, 4); - ND_PRINT((ndo, ", seq: 0x%08x", EXTRACT_BE_U_4(tlv_lsp->sequence_number))); + ND_PRINT(", seq: 0x%08x", EXTRACT_BE_U_4(tlv_lsp->sequence_number)); ND_TCHECK_LEN(tlv_lsp->remaining_lifetime, 2); - ND_PRINT((ndo, ", lifetime: %5ds", EXTRACT_BE_U_2(tlv_lsp->remaining_lifetime))); + ND_PRINT(", lifetime: %5ds", EXTRACT_BE_U_2(tlv_lsp->remaining_lifetime)); ND_TCHECK_LEN(tlv_lsp->checksum, 2); - ND_PRINT((ndo, ", chksum: 0x%04x", EXTRACT_BE_U_2(tlv_lsp->checksum))); + ND_PRINT(", chksum: 0x%04x", EXTRACT_BE_U_2(tlv_lsp->checksum)); tmp-=sizeof(struct isis_tlv_lsp); tlv_lsp++; } @@ -3035,7 +3035,7 @@ isis_print(netdissect_options *ndo, if (tmp < ISIS_TLV_CHECKSUM_MINLEN) break; ND_TCHECK_LEN(tptr, ISIS_TLV_CHECKSUM_MINLEN); - ND_PRINT((ndo, "\n\t checksum: 0x%04x ", EXTRACT_BE_U_2(tptr))); + ND_PRINT("\n\t checksum: 0x%04x ", EXTRACT_BE_U_2(tptr)); /* do not attempt to verify the checksum if it is zero * most likely a HMAC-MD5 TLV is also present and * to avoid conflicts the checksum TLV is zeroed. @@ -3048,14 +3048,14 @@ isis_print(netdissect_options *ndo, case ISIS_TLV_POI: if (tlv_len >= SYSTEM_ID_LEN + 1) { ND_TCHECK_LEN(tptr, SYSTEM_ID_LEN + 1); - ND_PRINT((ndo, "\n\t Purge Originator System-ID: %s", - isis_print_id(tptr + 1, SYSTEM_ID_LEN))); + ND_PRINT("\n\t Purge Originator System-ID: %s", + isis_print_id(tptr + 1, SYSTEM_ID_LEN)); } if (tlv_len == 2 * SYSTEM_ID_LEN + 1) { ND_TCHECK_LEN(tptr, 2 * SYSTEM_ID_LEN + 1); - ND_PRINT((ndo, "\n\t Received from System-ID: %s", - isis_print_id(tptr + SYSTEM_ID_LEN + 1, SYSTEM_ID_LEN))); + ND_PRINT("\n\t Received from System-ID: %s", + isis_print_id(tptr + SYSTEM_ID_LEN + 1, SYSTEM_ID_LEN)); } break; @@ -3072,7 +3072,7 @@ isis_print(netdissect_options *ndo, tptr+=mt_len; tmp-=mt_len; } else { - ND_PRINT((ndo, "\n\t invalid MT-ID")); + ND_PRINT("\n\t invalid MT-ID"); break; } } @@ -3083,8 +3083,8 @@ isis_print(netdissect_options *ndo, if (tmp < ISIS_TLV_RESTART_SIGNALING_FLAGLEN) break; ND_TCHECK_LEN(tptr, ISIS_TLV_RESTART_SIGNALING_FLAGLEN); - ND_PRINT((ndo, "\n\t Flags [%s]", - bittok2str(isis_restart_flag_values, "none", EXTRACT_U_1(tptr)))); + ND_PRINT("\n\t Flags [%s]", + bittok2str(isis_restart_flag_values, "none", EXTRACT_U_1(tptr))); tptr+=ISIS_TLV_RESTART_SIGNALING_FLAGLEN; tmp-=ISIS_TLV_RESTART_SIGNALING_FLAGLEN; @@ -3096,14 +3096,14 @@ isis_print(netdissect_options *ndo, break; ND_TCHECK_LEN(tptr, ISIS_TLV_RESTART_SIGNALING_HOLDTIMELEN); - ND_PRINT((ndo, ", Remaining holding time %us", EXTRACT_BE_U_2(tptr))); + ND_PRINT(", Remaining holding time %us", EXTRACT_BE_U_2(tptr)); tptr+=ISIS_TLV_RESTART_SIGNALING_HOLDTIMELEN; tmp-=ISIS_TLV_RESTART_SIGNALING_HOLDTIMELEN; /* is there an additional sysid field present ?*/ if (tmp == SYSTEM_ID_LEN) { ND_TCHECK_LEN(tptr, SYSTEM_ID_LEN); - ND_PRINT((ndo, ", for %s", isis_print_id(tptr,SYSTEM_ID_LEN))); + ND_PRINT(", for %s", isis_print_id(tptr,SYSTEM_ID_LEN)); } break; @@ -3111,16 +3111,16 @@ isis_print(netdissect_options *ndo, if (tmp < ISIS_TLV_IDRP_INFO_MINLEN) break; ND_TCHECK_LEN(tptr, ISIS_TLV_IDRP_INFO_MINLEN); - ND_PRINT((ndo, "\n\t Inter-Domain Information Type: %s", + ND_PRINT("\n\t Inter-Domain Information Type: %s", tok2str(isis_subtlv_idrp_values, "Unknown (0x%02x)", - EXTRACT_U_1(tptr)))); + EXTRACT_U_1(tptr))); isis_subtlv_idrp = EXTRACT_U_1(tptr); tptr++; switch (isis_subtlv_idrp) { case ISIS_SUBTLV_IDRP_ASN: ND_TCHECK_2(tptr); /* fetch AS number */ - ND_PRINT((ndo, "AS Number: %u", EXTRACT_BE_U_2(tptr))); + ND_PRINT("AS Number: %u", EXTRACT_BE_U_2(tptr)); break; case ISIS_SUBTLV_IDRP_LOCAL: case ISIS_SUBTLV_IDRP_RES: @@ -3135,13 +3135,13 @@ isis_print(netdissect_options *ndo, if (tmp < ISIS_TLV_LSP_BUFFERSIZE_MINLEN) break; ND_TCHECK_LEN(tptr, ISIS_TLV_LSP_BUFFERSIZE_MINLEN); - ND_PRINT((ndo, "\n\t LSP Buffersize: %u", EXTRACT_BE_U_2(tptr))); + ND_PRINT("\n\t LSP Buffersize: %u", EXTRACT_BE_U_2(tptr)); break; case ISIS_TLV_PART_DIS: while (tmp >= SYSTEM_ID_LEN) { ND_TCHECK_LEN(tptr, SYSTEM_ID_LEN); - ND_PRINT((ndo, "\n\t %s", isis_print_id(tptr, SYSTEM_ID_LEN))); + ND_PRINT("\n\t %s", isis_print_id(tptr, SYSTEM_ID_LEN)); tptr+=SYSTEM_ID_LEN; tmp-=SYSTEM_ID_LEN; } @@ -3151,7 +3151,7 @@ isis_print(netdissect_options *ndo, if (tmp < sizeof(struct isis_metric_block)) break; ND_TCHECK_LEN(tptr, sizeof(struct isis_metric_block)); - ND_PRINT((ndo, "\n\t Metric Block")); + ND_PRINT("\n\t Metric Block"); isis_print_metric_block(ndo, (const struct isis_metric_block *)tptr); tptr+=sizeof(struct isis_metric_block); tmp-=sizeof(struct isis_metric_block); @@ -3161,15 +3161,15 @@ isis_print(netdissect_options *ndo, prefix_len=EXTRACT_U_1(tptr); /* read out prefix length in semioctets*/ tptr++; if (prefix_len < 2) { - ND_PRINT((ndo, "\n\t\tAddress: prefix length %u < 2", prefix_len)); + ND_PRINT("\n\t\tAddress: prefix length %u < 2", prefix_len); break; } tmp--; if (tmp < prefix_len/2) break; ND_TCHECK_LEN(tptr, prefix_len / 2); - ND_PRINT((ndo, "\n\t\tAddress: %s/%u", - isonsap_string(ndo, tptr, prefix_len / 2), prefix_len * 4)); + ND_PRINT("\n\t\tAddress: %s/%u", + isonsap_string(ndo, tptr, prefix_len / 2), prefix_len * 4); tptr+=prefix_len/2; tmp-=prefix_len/2; } @@ -3179,7 +3179,7 @@ isis_print(netdissect_options *ndo, if (tmp < ISIS_TLV_IIH_SEQNR_MINLEN) break; ND_TCHECK_LEN(tptr, ISIS_TLV_IIH_SEQNR_MINLEN); /* check if four bytes are on the wire */ - ND_PRINT((ndo, "\n\t Sequence number: %u", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t Sequence number: %u", EXTRACT_BE_U_4(tptr)); break; case ISIS_TLV_VENDOR_PRIVATE: @@ -3187,9 +3187,9 @@ isis_print(netdissect_options *ndo, break; ND_TCHECK_LEN(tptr, ISIS_TLV_VENDOR_PRIVATE_MINLEN); /* check if enough byte for a full oui */ vendor_id = EXTRACT_BE_U_3(tptr); - ND_PRINT((ndo, "\n\t Vendor: %s (%u)", + ND_PRINT("\n\t Vendor: %s (%u)", tok2str(oui_values, "Unknown", vendor_id), - vendor_id)); + vendor_id); tptr+=3; tmp-=3; if (tmp > 0) /* hexdump the rest */ @@ -3225,17 +3225,17 @@ isis_print(netdissect_options *ndo, } if (packet_len != 0) { - ND_PRINT((ndo, "\n\t %u straggler bytes", packet_len)); + ND_PRINT("\n\t %u straggler bytes", packet_len); } return (1); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (1); trunctlv: - ND_PRINT((ndo, "\n\t\t")); - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("\n\t\t"); + ND_PRINT("%s", tstr); return(1); } @@ -3254,16 +3254,16 @@ osi_print_cksum(netdissect_options *ndo, const uint8_t *pptr, || !ND_TTEST_2(pptr + checksum_offset) || (u_int)checksum_offset > length || !ND_TTEST_LEN(pptr, length)) { - ND_PRINT((ndo, " (unverified)")); + ND_PRINT(" (unverified)"); } else { #if 0 printf("\nosi_print_cksum: %p %u %u\n", pptr, checksum_offset, length); #endif calculated_checksum = create_osi_cksum(pptr, checksum_offset, length); if (checksum == calculated_checksum) { - ND_PRINT((ndo, " (correct)")); + ND_PRINT(" (correct)"); } else { - ND_PRINT((ndo, " (incorrect should be 0x%04x)", calculated_checksum)); + ND_PRINT(" (incorrect should be 0x%04x)", calculated_checksum); } } } diff --git a/print-juniper.c b/print-juniper.c index 9a4d1fdc..5bfac963 100644 --- a/print-juniper.c +++ b/print-juniper.c @@ -476,10 +476,10 @@ juniper_ggsn_if_print(netdissect_options *ndo, ND_TCHECK_SIZE(gh); proto = EXTRACT_U_1(gh->proto); if (ndo->ndo_eflag) { - ND_PRINT((ndo, "proto %s (%u), vlan %u: ", + ND_PRINT("proto %s (%u), vlan %u: ", tok2str(juniper_protocol_values,"Unknown",proto), proto, - EXTRACT_BE_U_2(gh->vlan_id))); + EXTRACT_BE_U_2(gh->vlan_id)); } switch (proto) { @@ -491,13 +491,13 @@ juniper_ggsn_if_print(netdissect_options *ndo, break; default: if (!ndo->ndo_eflag) - ND_PRINT((ndo, "unknown GGSN proto (%u)", proto)); + ND_PRINT("unknown GGSN proto (%u)", proto); } return l2info.header_len; trunc: - ND_PRINT((ndo, "[|juniper_services]")); + ND_PRINT("[|juniper_services]"); return l2info.header_len; } #endif @@ -540,9 +540,9 @@ juniper_es_if_print(netdissect_options *ndo, es_type_bundle = 0; break; default: - ND_PRINT((ndo, "ES Invalid type %u, length %u", + ND_PRINT("ES Invalid type %u, length %u", EXTRACT_U_1(ih->type), - l2info.length)); + l2info.length); return l2info.header_len; } @@ -551,7 +551,7 @@ juniper_es_if_print(netdissect_options *ndo, if (ndo->ndo_eflag) { if (!es_type_bundle) { - ND_PRINT((ndo, "ES SA, index %u, ttl %u type %s (%u), spi %u, Tunnel %s > %s, length %u\n", + ND_PRINT("ES SA, index %u, ttl %u type %s (%u), spi %u, Tunnel %s > %s, length %u\n", EXTRACT_BE_U_2(ih->sa_index), EXTRACT_U_1(ih->ttl), tok2str(juniper_ipsec_type_values,"Unknown",EXTRACT_U_1(ih->type)), @@ -559,14 +559,14 @@ juniper_es_if_print(netdissect_options *ndo, EXTRACT_BE_U_4(ih->spi), ipaddr_string(ndo, &ih->src_ip), ipaddr_string(ndo, &ih->dst_ip), - l2info.length)); + l2info.length); } else { - ND_PRINT((ndo, "ES SA, index %u, ttl %u type %s (%u), length %u\n", + ND_PRINT("ES SA, index %u, ttl %u type %s (%u), length %u\n", EXTRACT_BE_U_2(ih->sa_index), EXTRACT_U_1(ih->ttl), tok2str(juniper_ipsec_type_values,"Unknown",EXTRACT_U_1(ih->type)), EXTRACT_U_1(ih->type), - l2info.length)); + l2info.length); } } @@ -574,7 +574,7 @@ juniper_es_if_print(netdissect_options *ndo, return l2info.header_len; trunc: - ND_PRINT((ndo, "[|juniper_services]")); + ND_PRINT("[|juniper_services]"); return l2info.header_len; } #endif @@ -602,10 +602,10 @@ juniper_monitor_if_print(netdissect_options *ndo, ND_TCHECK_SIZE(mh); if (ndo->ndo_eflag) - ND_PRINT((ndo, "service-id %u, iif %u, pkt-type %u: ", + ND_PRINT("service-id %u, iif %u, pkt-type %u: ", EXTRACT_BE_U_4(mh->service_id), EXTRACT_BE_U_2(mh->iif), - EXTRACT_U_1(mh->pkt_type))); + EXTRACT_U_1(mh->pkt_type)); /* no proto field - lets guess by first byte of IP header*/ ip_heuristic_guess (ndo, p, l2info.length); @@ -613,7 +613,7 @@ juniper_monitor_if_print(netdissect_options *ndo, return l2info.header_len; trunc: - ND_PRINT((ndo, "[|juniper_services]")); + ND_PRINT("[|juniper_services]"); return l2info.header_len; } #endif @@ -642,11 +642,11 @@ juniper_services_if_print(netdissect_options *ndo, ND_TCHECK_SIZE(sh); if (ndo->ndo_eflag) - ND_PRINT((ndo, "service-id %u flags 0x%02x service-set-id 0x%04x iif %u: ", + ND_PRINT("service-id %u flags 0x%02x service-set-id 0x%04x iif %u: ", EXTRACT_U_1(sh->svc_id), EXTRACT_U_1(sh->flags_len), EXTRACT_BE_U_2(sh->svc_set_id), - EXTRACT_BE_U_3(sh->dir_iif))); + EXTRACT_BE_U_3(sh->dir_iif)); /* no proto field - lets guess by first byte of IP header*/ ip_heuristic_guess (ndo, p, l2info.length); @@ -654,7 +654,7 @@ juniper_services_if_print(netdissect_options *ndo, return l2info.header_len; trunc: - ND_PRINT((ndo, "[|juniper_services]")); + ND_PRINT("[|juniper_services]"); return l2info.header_len; } #endif @@ -773,12 +773,12 @@ juniper_pppoe_atm_if_print(netdissect_options *ndo, l2info.caplen-ETHERTYPE_LEN, NULL, NULL) == 0) /* ether_type not known, probably it wasn't one */ - ND_PRINT((ndo, "unknown ethertype 0x%04x", extracted_ethertype)); + ND_PRINT("unknown ethertype 0x%04x", extracted_ethertype); return l2info.header_len; trunc: - ND_PRINT((ndo, "[|juniper_pppoe_atm]")); + ND_PRINT("[|juniper_pppoe_atm]"); return l2info.header_len; } #endif @@ -799,7 +799,7 @@ juniper_mlppp_if_print(netdissect_options *ndo, if (ndo->ndo_eflag && EXTRACT_BE_U_2(&l2info.cookie) != PPP_OSI && EXTRACT_BE_U_2(&l2info.cookie) != (PPP_ADDRESS << 8 | PPP_CONTROL)) - ND_PRINT((ndo, "Bundle-ID %u: ", l2info.bundle)); + ND_PRINT("Bundle-ID %u: ", l2info.bundle); p+=l2info.header_len; @@ -886,7 +886,7 @@ juniper_mfr_if_print(netdissect_options *ndo, /* suppress Bundle-ID if frame was captured on a child-link */ if (ndo->ndo_eflag && EXTRACT_BE_U_4(l2info.cookie) != 1) - ND_PRINT((ndo, "Bundle-ID %u, ", l2info.bundle)); + ND_PRINT("Bundle-ID %u, ", l2info.bundle); switch (l2info.proto) { case (LLCSAP_ISONS<<8 | LLCSAP_ISONS): isoclns_print(ndo, p + 1, l2info.length - 1); @@ -898,7 +898,7 @@ juniper_mfr_if_print(netdissect_options *ndo, isoclns_print(ndo, p - 1, l2info.length + 1); break; default: - ND_PRINT((ndo, "unknown protocol 0x%04x, length %u", l2info.proto, l2info.length)); + ND_PRINT("unknown protocol 0x%04x, length %u", l2info.proto, l2info.length); } return l2info.header_len; @@ -920,7 +920,7 @@ juniper_mlfr_if_print(netdissect_options *ndo, /* suppress Bundle-ID if frame was captured on a child-link */ if (ndo->ndo_eflag && EXTRACT_BE_U_4(l2info.cookie) != 1) - ND_PRINT((ndo, "Bundle-ID %u, ", l2info.bundle)); + ND_PRINT("Bundle-ID %u, ", l2info.bundle); switch (l2info.proto) { case (LLC_UI): case (LLC_UI<<8): @@ -933,7 +933,7 @@ juniper_mlfr_if_print(netdissect_options *ndo, isoclns_print(ndo, p - 1, l2info.length + 1); break; default: - ND_PRINT((ndo, "unknown protocol 0x%04x, length %u", l2info.proto, l2info.length)); + ND_PRINT("unknown protocol 0x%04x, length %u", l2info.proto, l2info.length); } return l2info.header_len; @@ -989,7 +989,7 @@ juniper_atm1_if_print(netdissect_options *ndo, return l2info.header_len; trunc: - ND_PRINT((ndo, "[|juniper_atm1]")); + ND_PRINT("[|juniper_atm1]"); return l2info.header_len; } #endif @@ -1052,7 +1052,7 @@ juniper_atm2_if_print(netdissect_options *ndo, return l2info.header_len; trunc: - ND_PRINT((ndo, "[|juniper_atm2]")); + ND_PRINT("[|juniper_atm2]"); return l2info.header_len; } #endif @@ -1202,19 +1202,19 @@ juniper_parse_header(netdissect_options *ndo, l2info->direction = EXTRACT_U_1(p + 3) & JUNIPER_BPF_PKT_IN; if (EXTRACT_BE_U_3(p) != JUNIPER_MGC_NUMBER) { /* magic number found ? */ - ND_PRINT((ndo, "no magic-number found!")); + ND_PRINT("no magic-number found!"); return 0; } if (ndo->ndo_eflag) /* print direction */ - ND_PRINT((ndo, "%3s ", tok2str(juniper_direction_values, "---", l2info->direction))); + ND_PRINT("%3s ", tok2str(juniper_direction_values, "---", l2info->direction)); /* magic number + flags */ jnx_header_len = 4; if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "\n\tJuniper PCAP Flags [%s]", - bittok2str(jnx_flag_values, "none", l2info->flags))); + ND_PRINT("\n\tJuniper PCAP Flags [%s]", + bittok2str(jnx_flag_values, "none", l2info->flags)); /* extensions present ? - calculate how much bytes to skip */ if ((l2info->flags & JUNIPER_BPF_EXT ) == JUNIPER_BPF_EXT ) { @@ -1233,7 +1233,7 @@ juniper_parse_header(netdissect_options *ndo, jnx_header_len += jnx_ext_len; if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, ", PCAP Extension(s) total length %u", jnx_ext_len)); + ND_PRINT(", PCAP Extension(s) total length %u", jnx_ext_len); ND_TCHECK_LEN(tptr, jnx_ext_len); while (jnx_ext_len > JUNIPER_EXT_TLV_OVERHEAD) { @@ -1250,10 +1250,10 @@ juniper_parse_header(netdissect_options *ndo, goto trunc; if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "\n\t %s Extension TLV #%u, length %u, value ", + ND_PRINT("\n\t %s Extension TLV #%u, length %u, value ", tok2str(jnx_ext_tlv_values,"Unknown",tlv_type), tlv_type, - tlv_len)); + tlv_len); tlv_value = juniper_read_tlv_value(tptr, tlv_type, tlv_len); switch (tlv_type) { @@ -1264,18 +1264,18 @@ juniper_parse_header(netdissect_options *ndo, case JUNIPER_EXT_TLV_TTP_IFD_MEDIATYPE: if (tlv_value != -1) { if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "%s (%u)", + ND_PRINT("%s (%u)", tok2str(juniper_ifmt_values, "Unknown", tlv_value), - tlv_value)); + tlv_value); } break; case JUNIPER_EXT_TLV_IFL_ENCAPS: case JUNIPER_EXT_TLV_TTP_IFL_ENCAPS: if (tlv_value != -1) { if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "%s (%u)", + ND_PRINT("%s (%u)", tok2str(juniper_ifle_values, "Unknown", tlv_value), - tlv_value)); + tlv_value); } break; case JUNIPER_EXT_TLV_IFL_IDX: /* fall through */ @@ -1284,7 +1284,7 @@ juniper_parse_header(netdissect_options *ndo, default: if (tlv_value != -1) { if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "%u", tlv_value)); + ND_PRINT("%u", tlv_value); } break; } @@ -1294,12 +1294,12 @@ juniper_parse_header(netdissect_options *ndo, } if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "\n\t-----original packet-----\n\t")); + ND_PRINT("\n\t-----original packet-----\n\t"); } if ((l2info->flags & JUNIPER_BPF_NO_L2 ) == JUNIPER_BPF_NO_L2 ) { if (ndo->ndo_eflag) - ND_PRINT((ndo, "no-L2-hdr, ")); + ND_PRINT("no-L2-hdr, "); /* there is no link-layer present - * perform the v4/v6 heuristics @@ -1308,7 +1308,7 @@ juniper_parse_header(netdissect_options *ndo, ND_TCHECK_1(p + (jnx_header_len + 4)); if (ip_heuristic_guess(ndo, p + jnx_header_len + 4, l2info->length - (jnx_header_len + 4)) == 0) - ND_PRINT((ndo, "no IP-hdr found!")); + ND_PRINT("no IP-hdr found!"); l2info->header_len=jnx_header_len+4; return 0; /* stop parsing the output further */ @@ -1355,21 +1355,21 @@ juniper_parse_header(netdissect_options *ndo, l2info->caplen -= l2info->cookie_len; if (ndo->ndo_eflag) - ND_PRINT((ndo, "%s-PIC, cookie-len %u", + ND_PRINT("%s-PIC, cookie-len %u", lp->s, - l2info->cookie_len)); + l2info->cookie_len); if (l2info->cookie_len > 0) { ND_TCHECK_LEN(p, l2info->cookie_len); if (ndo->ndo_eflag) - ND_PRINT((ndo, ", cookie 0x")); + ND_PRINT(", cookie 0x"); for (idx = 0; idx < l2info->cookie_len; idx++) { l2info->cookie[idx] = EXTRACT_U_1(p + idx); /* copy cookie data */ - if (ndo->ndo_eflag) ND_PRINT((ndo, "%02x", EXTRACT_U_1(p + idx))); + if (ndo->ndo_eflag) ND_PRINT("%02x", EXTRACT_U_1(p + idx)); } } - if (ndo->ndo_eflag) ND_PRINT((ndo, ": ")); /* print demarc b/w L2/L3*/ + if (ndo->ndo_eflag) ND_PRINT(": "); /* print demarc b/w L2/L3*/ ND_TCHECK_2(p + l2info->cookie_len); @@ -1461,7 +1461,7 @@ juniper_parse_header(netdissect_options *ndo, } if (ndo->ndo_eflag) - ND_PRINT((ndo, "control-word 0x%08x ", control_word)); + ND_PRINT("control-word 0x%08x ", control_word); } break; #endif @@ -1491,16 +1491,16 @@ juniper_parse_header(netdissect_options *ndo, #endif default: - ND_PRINT((ndo, "Unknown Juniper DLT_ type %u: ", l2info->pictype)); + ND_PRINT("Unknown Juniper DLT_ type %u: ", l2info->pictype); break; } if (ndo->ndo_eflag > 1) - ND_PRINT((ndo, "hlen %u, proto 0x%04x, ", l2info->header_len, l2info->proto)); + ND_PRINT("hlen %u, proto 0x%04x, ", l2info->header_len, l2info->proto); return 1; /* everything went ok so far. continue parsing */ trunc: - ND_PRINT((ndo, "[|juniper_hdr], length %u", h->len)); + ND_PRINT("[|juniper_hdr], length %u", h->len); return 0; } diff --git a/print-krb.c b/print-krb.c index 4a5b1afa..491b8c6a 100644 --- a/print-krb.c +++ b/print-krb.c @@ -127,13 +127,13 @@ c_print(netdissect_options *ndo, } if (!ND_ISASCII(c)) { c = ND_TOASCII(c); - ND_PRINT((ndo, "M-")); + ND_PRINT("M-"); } if (!ND_ISPRINT(c)) { c ^= 0x40; /* DEL to ?, others to alpha */ - ND_PRINT((ndo, "^")); + ND_PRINT("^"); } - ND_PRINT((ndo, "%c", c)); + ND_PRINT("%c", c); } if (flag) return NULL; @@ -149,14 +149,14 @@ krb4_print_hdr(netdissect_options *ndo, #define PRINT if ((cp = c_print(ndo, cp, ndo->ndo_snapend)) == NULL) goto trunc PRINT; - ND_PRINT((ndo, ".")); + ND_PRINT("."); PRINT; - ND_PRINT((ndo, "@")); + ND_PRINT("@"); PRINT; return (cp); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (NULL); #undef PRINT @@ -178,14 +178,14 @@ krb4_print(netdissect_options *ndo, kp = (const struct krb *)cp; if (!ND_TTEST_1(kp->type)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } type = EXTRACT_U_1(kp->type) & (0xFF << 1); - ND_PRINT((ndo, " %s %s: ", - IS_LENDIAN(kp) ? "le" : "be", tok2str(type2str, NULL, type))); + ND_PRINT(" %s %s: ", + IS_LENDIAN(kp) ? "le" : "be", tok2str(type2str, NULL, type)); switch (type) { @@ -194,24 +194,24 @@ krb4_print(netdissect_options *ndo, return; cp += 4; /* ctime */ ND_TCHECK_1(cp); - ND_PRINT((ndo, " %umin ", EXTRACT_U_1(cp) * 5)); + ND_PRINT(" %umin ", EXTRACT_U_1(cp) * 5); cp++; PRINT; - ND_PRINT((ndo, ".")); + ND_PRINT("."); PRINT; break; case AUTH_MSG_APPL_REQUEST: cp += 2; ND_TCHECK_1(cp); - ND_PRINT((ndo, "v%u ", EXTRACT_U_1(cp))); + ND_PRINT("v%u ", EXTRACT_U_1(cp)); cp++; PRINT; ND_TCHECK_1(cp); - ND_PRINT((ndo, " (%u)", EXTRACT_U_1(cp))); + ND_PRINT(" (%u)", EXTRACT_U_1(cp)); cp++; ND_TCHECK_1(cp); - ND_PRINT((ndo, " (%u)", EXTRACT_U_1(cp))); + ND_PRINT(" (%u)", EXTRACT_U_1(cp)); break; case AUTH_MSG_KDC_REPLY: @@ -220,7 +220,7 @@ krb4_print(netdissect_options *ndo, cp += 10; /* timestamp + n + exp + kvno */ ND_TCHECK_LEN(cp, sizeof(short)); len = KTOHSP(kp, cp); - ND_PRINT((ndo, " (%u)", len)); + ND_PRINT(" (%u)", len); break; case AUTH_MSG_ERR_REPLY: @@ -228,19 +228,19 @@ krb4_print(netdissect_options *ndo, return; cp += 4; /* timestamp */ ND_TCHECK_LEN(cp, sizeof(short)); - ND_PRINT((ndo, " %s ", tok2str(kerr2str, NULL, KTOHSP(kp, cp)))); + ND_PRINT(" %s ", tok2str(kerr2str, NULL, KTOHSP(kp, cp))); cp += 4; PRINT; break; default: - ND_PRINT((ndo, "(unknown)")); + ND_PRINT("(unknown)"); break; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -252,7 +252,7 @@ krb_print(netdissect_options *ndo, kp = (const struct krb *)dat; if (dat >= ndo->ndo_snapend) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } @@ -261,17 +261,17 @@ krb_print(netdissect_options *ndo, case 1: case 2: case 3: - ND_PRINT((ndo, " v%u", EXTRACT_U_1(kp->pvno))); + ND_PRINT(" v%u", EXTRACT_U_1(kp->pvno)); break; case 4: - ND_PRINT((ndo, " v%u", EXTRACT_U_1(kp->pvno))); + ND_PRINT(" v%u", EXTRACT_U_1(kp->pvno)); krb4_print(ndo, (const u_char *)kp); break; case 106: case 107: - ND_PRINT((ndo, " v5")); + ND_PRINT(" v5"); /* Decode ASN.1 here "someday" */ break; } diff --git a/print-l2tp.c b/print-l2tp.c index e45520a3..de49a2f6 100644 --- a/print-l2tp.c +++ b/print-l2tp.c @@ -268,7 +268,7 @@ print_string(netdissect_options *ndo, const u_char *dat, u_int length) { u_int i; for (i=0; i<length; i++) { - ND_PRINT((ndo, "%c", EXTRACT_U_1(dat))); + ND_PRINT("%c", EXTRACT_U_1(dat)); dat++; } } @@ -278,7 +278,7 @@ print_octets(netdissect_options *ndo, const u_char *dat, u_int length) { u_int i; for (i=0; i<length; i++) { - ND_PRINT((ndo, "%02x", EXTRACT_U_1(dat))); + ND_PRINT("%02x", EXTRACT_U_1(dat)); dat++; } } @@ -286,13 +286,13 @@ print_octets(netdissect_options *ndo, const u_char *dat, u_int length) static void print_16bits_val(netdissect_options *ndo, const uint16_t *dat) { - ND_PRINT((ndo, "%u", EXTRACT_BE_U_2(dat))); + ND_PRINT("%u", EXTRACT_BE_U_2(dat)); } static void print_32bits_val(netdissect_options *ndo, const uint32_t *dat) { - ND_PRINT((ndo, "%lu", (u_long) EXTRACT_BE_U_4(dat))); + ND_PRINT("%lu", (u_long) EXTRACT_BE_U_4(dat)); } /***********************************/ @@ -304,11 +304,11 @@ l2tp_msgtype_print(netdissect_options *ndo, const u_char *dat, u_int length) const uint16_t *ptr = (const uint16_t *)dat; if (length < 2) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } - ND_PRINT((ndo, "%s", tok2str(l2tp_msgtype2str, "MSGTYPE-#%u", - EXTRACT_BE_U_2(ptr)))); + ND_PRINT("%s", tok2str(l2tp_msgtype2str, "MSGTYPE-#%u", + EXTRACT_BE_U_2(ptr))); } static void @@ -318,10 +318,10 @@ l2tp_result_code_print(netdissect_options *ndo, const u_char *dat, u_int length) /* Result Code */ if (length < 2) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } - ND_PRINT((ndo, "%u", EXTRACT_BE_U_2(ptr))); + ND_PRINT("%u", EXTRACT_BE_U_2(ptr)); ptr++; length -= 2; @@ -329,17 +329,17 @@ l2tp_result_code_print(netdissect_options *ndo, const u_char *dat, u_int length) if (length == 0) return; if (length < 2) { - ND_PRINT((ndo, " AVP too short")); + ND_PRINT(" AVP too short"); return; } - ND_PRINT((ndo, "/%u", EXTRACT_BE_U_2(ptr))); + ND_PRINT("/%u", EXTRACT_BE_U_2(ptr)); ptr++; length -= 2; /* Error Message (opt) */ if (length == 0) return; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); print_string(ndo, (const u_char *)ptr, length); } @@ -347,11 +347,11 @@ static void l2tp_proto_ver_print(netdissect_options *ndo, const uint16_t *dat, u_int length) { if (length < 2) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } - ND_PRINT((ndo, "%u.%u", (EXTRACT_BE_U_2(dat) >> 8), - (EXTRACT_BE_U_2(dat) & 0xff))); + ND_PRINT("%u.%u", (EXTRACT_BE_U_2(dat) >> 8), + (EXTRACT_BE_U_2(dat) & 0xff)); } static void @@ -360,14 +360,14 @@ l2tp_framing_cap_print(netdissect_options *ndo, const u_char *dat, u_int length) const uint32_t *ptr = (const uint32_t *)dat; if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } if (EXTRACT_BE_U_4(ptr) & L2TP_FRAMING_CAP_ASYNC_MASK) { - ND_PRINT((ndo, "A")); + ND_PRINT("A"); } if (EXTRACT_BE_U_4(ptr) & L2TP_FRAMING_CAP_SYNC_MASK) { - ND_PRINT((ndo, "S")); + ND_PRINT("S"); } } @@ -377,14 +377,14 @@ l2tp_bearer_cap_print(netdissect_options *ndo, const u_char *dat, u_int length) const uint32_t *ptr = (const uint32_t *)dat; if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } if (EXTRACT_BE_U_4(ptr) & L2TP_BEARER_CAP_ANALOG_MASK) { - ND_PRINT((ndo, "A")); + ND_PRINT("A"); } if (EXTRACT_BE_U_4(ptr) & L2TP_BEARER_CAP_DIGITAL_MASK) { - ND_PRINT((ndo, "D")); + ND_PRINT("D"); } } @@ -392,15 +392,15 @@ static void l2tp_q931_cc_print(netdissect_options *ndo, const u_char *dat, u_int length) { if (length < 3) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } print_16bits_val(ndo, (const uint16_t *)dat); - ND_PRINT((ndo, ", %02x", EXTRACT_U_1(dat + 2))); + ND_PRINT(", %02x", EXTRACT_U_1(dat + 2)); dat += 3; length -= 3; if (length != 0) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); print_string(ndo, dat, length); } } @@ -411,14 +411,14 @@ l2tp_bearer_type_print(netdissect_options *ndo, const u_char *dat, u_int length) const uint32_t *ptr = (const uint32_t *)dat; if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } if (EXTRACT_BE_U_4(ptr) & L2TP_BEARER_TYPE_ANALOG_MASK) { - ND_PRINT((ndo, "A")); + ND_PRINT("A"); } if (EXTRACT_BE_U_4(ptr) & L2TP_BEARER_TYPE_DIGITAL_MASK) { - ND_PRINT((ndo, "D")); + ND_PRINT("D"); } } @@ -428,21 +428,21 @@ l2tp_framing_type_print(netdissect_options *ndo, const u_char *dat, u_int length const uint32_t *ptr = (const uint32_t *)dat; if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } if (EXTRACT_BE_U_4(ptr) & L2TP_FRAMING_TYPE_ASYNC_MASK) { - ND_PRINT((ndo, "A")); + ND_PRINT("A"); } if (EXTRACT_BE_U_4(ptr) & L2TP_FRAMING_TYPE_SYNC_MASK) { - ND_PRINT((ndo, "S")); + ND_PRINT("S"); } } static void l2tp_packet_proc_delay_print(netdissect_options *ndo) { - ND_PRINT((ndo, "obsolete")); + ND_PRINT("obsolete"); } static void @@ -451,11 +451,11 @@ l2tp_proxy_auth_type_print(netdissect_options *ndo, const u_char *dat, u_int len const uint16_t *ptr = (const uint16_t *)dat; if (length < 2) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } - ND_PRINT((ndo, "%s", tok2str(l2tp_authentype2str, - "AuthType-#%u", EXTRACT_BE_U_2(ptr)))); + ND_PRINT("%s", tok2str(l2tp_authentype2str, + "AuthType-#%u", EXTRACT_BE_U_2(ptr))); } static void @@ -464,10 +464,10 @@ l2tp_proxy_auth_id_print(netdissect_options *ndo, const u_char *dat, u_int lengt const uint16_t *ptr = (const uint16_t *)dat; if (length < 2) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } - ND_PRINT((ndo, "%u", EXTRACT_BE_U_2(ptr) & L2TP_PROXY_AUTH_ID_MASK)); + ND_PRINT("%u", EXTRACT_BE_U_2(ptr) & L2TP_PROXY_AUTH_ID_MASK); } static void @@ -477,59 +477,59 @@ l2tp_call_errors_print(netdissect_options *ndo, const u_char *dat, u_int length) uint16_t val_h, val_l; if (length < 2) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } ptr++; /* skip "Reserved" */ length -= 2; if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } val_h = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; val_l = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; - ND_PRINT((ndo, "CRCErr=%u ", (val_h<<16) + val_l)); + ND_PRINT("CRCErr=%u ", (val_h<<16) + val_l); if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } val_h = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; val_l = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; - ND_PRINT((ndo, "FrameErr=%u ", (val_h<<16) + val_l)); + ND_PRINT("FrameErr=%u ", (val_h<<16) + val_l); if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } val_h = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; val_l = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; - ND_PRINT((ndo, "HardOver=%u ", (val_h<<16) + val_l)); + ND_PRINT("HardOver=%u ", (val_h<<16) + val_l); if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } val_h = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; val_l = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; - ND_PRINT((ndo, "BufOver=%u ", (val_h<<16) + val_l)); + ND_PRINT("BufOver=%u ", (val_h<<16) + val_l); if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } val_h = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; val_l = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; - ND_PRINT((ndo, "Timeout=%u ", (val_h<<16) + val_l)); + ND_PRINT("Timeout=%u ", (val_h<<16) + val_l); if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } val_h = EXTRACT_BE_U_2(ptr); ptr++; val_l = EXTRACT_BE_U_2(ptr); ptr++; - ND_PRINT((ndo, "AlignErr=%u ", (val_h<<16) + val_l)); + ND_PRINT("AlignErr=%u ", (val_h<<16) + val_l); } static void @@ -539,27 +539,27 @@ l2tp_accm_print(netdissect_options *ndo, const u_char *dat, u_int length) uint16_t val_h, val_l; if (length < 2) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } ptr++; /* skip "Reserved" */ length -= 2; if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } val_h = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; val_l = EXTRACT_BE_U_2(ptr); ptr++; length -= 2; - ND_PRINT((ndo, "send=%08x ", (val_h<<16) + val_l)); + ND_PRINT("send=%08x ", (val_h<<16) + val_l); if (length < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } val_h = EXTRACT_BE_U_2(ptr); ptr++; val_l = EXTRACT_BE_U_2(ptr); ptr++; - ND_PRINT((ndo, "recv=%08x ", (val_h<<16) + val_l)); + ND_PRINT("recv=%08x ", (val_h<<16) + val_l); } static void @@ -568,25 +568,25 @@ l2tp_ppp_discon_cc_print(netdissect_options *ndo, const u_char *dat, u_int lengt const uint16_t *ptr = (const uint16_t *)dat; if (length < 5) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); return; } /* Disconnect Code */ - ND_PRINT((ndo, "%04x, ", EXTRACT_BE_U_2(dat))); + ND_PRINT("%04x, ", EXTRACT_BE_U_2(dat)); dat += 2; length -= 2; /* Control Protocol Number */ - ND_PRINT((ndo, "%04x ", EXTRACT_BE_U_2(dat))); + ND_PRINT("%04x ", EXTRACT_BE_U_2(dat)); dat += 2; length -= 2; /* Direction */ - ND_PRINT((ndo, "%s", tok2str(l2tp_cc_direction2str, - "Direction-#%u", EXTRACT_U_1(ptr)))); + ND_PRINT("%s", tok2str(l2tp_cc_direction2str, + "Direction-#%u", EXTRACT_U_1(ptr))); ptr++; length--; if (length != 0) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); print_string(ndo, (const u_char *)ptr, length); } } @@ -603,7 +603,7 @@ l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length) return; } - ND_PRINT((ndo, " ")); + ND_PRINT(" "); ND_TCHECK_2(ptr); /* Flags & Length */ len = EXTRACT_BE_U_2(ptr) & L2TP_AVP_HDR_LEN_MASK; @@ -628,29 +628,29 @@ l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length) */ if (EXTRACT_BE_U_2(ptr) & L2TP_AVP_HDR_FLAG_MANDATORY) { - ND_PRINT((ndo, "*")); + ND_PRINT("*"); } if (EXTRACT_BE_U_2(ptr) & L2TP_AVP_HDR_FLAG_HIDDEN) { hidden = TRUE; - ND_PRINT((ndo, "?")); + ND_PRINT("?"); } ptr++; if (EXTRACT_BE_U_2(ptr)) { /* Vendor Specific Attribute */ - ND_PRINT((ndo, "VENDOR%04x:", EXTRACT_BE_U_2(ptr))); ptr++; - ND_PRINT((ndo, "ATTR%04x", EXTRACT_BE_U_2(ptr))); ptr++; - ND_PRINT((ndo, "(")); + ND_PRINT("VENDOR%04x:", EXTRACT_BE_U_2(ptr)); ptr++; + ND_PRINT("ATTR%04x", EXTRACT_BE_U_2(ptr)); ptr++; + ND_PRINT("("); print_octets(ndo, (const u_char *)ptr, len-6); - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } else { /* IETF-defined Attributes */ ptr++; attr_type = EXTRACT_BE_U_2(ptr); ptr++; - ND_PRINT((ndo, "%s", tok2str(l2tp_avp2str, "AVP-#%u", attr_type))); - ND_PRINT((ndo, "(")); + ND_PRINT("%s", tok2str(l2tp_avp2str, "AVP-#%u", attr_type)); + ND_PRINT("("); if (hidden) { - ND_PRINT((ndo, "???")); + ND_PRINT("???"); } else { switch (attr_type) { case L2TP_AVP_MSGTYPE: @@ -670,7 +670,7 @@ l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length) break; case L2TP_AVP_TIE_BREAKER: if (len-6 < 8) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); break; } print_octets(ndo, (const u_char *)ptr, 8); @@ -680,7 +680,7 @@ l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length) case L2TP_AVP_RECV_WIN_SIZE: case L2TP_AVP_ASSND_SESS_ID: if (len-6 < 2) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); break; } print_16bits_val(ndo, ptr); @@ -708,7 +708,7 @@ l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length) break; case L2TP_AVP_CHALLENGE_RESP: if (len-6 < 16) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); break; } print_octets(ndo, (const u_char *)ptr, 16); @@ -720,7 +720,7 @@ l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length) case L2TP_AVP_PHY_CHANNEL_ID: case L2TP_AVP_RX_CONN_SPEED: if (len-6 < 4) { - ND_PRINT((ndo, "AVP too short")); + ND_PRINT("AVP too short"); break; } print_32bits_val(ndo, (const uint32_t *)ptr); @@ -755,14 +755,14 @@ l2tp_avp_print(netdissect_options *ndo, const u_char *dat, int length) break; } } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } l2tp_avp_print(ndo, dat+len, length-len); return; trunc: - ND_PRINT((ndo, "|...")); + ND_PRINT("|..."); } @@ -779,35 +779,35 @@ l2tp_print(netdissect_options *ndo, const u_char *dat, u_int length) ND_TCHECK_2(ptr); /* Flags & Version */ if ((EXTRACT_BE_U_2(ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2TP) { - ND_PRINT((ndo, " l2tp:")); + ND_PRINT(" l2tp:"); } else if ((EXTRACT_BE_U_2(ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2F) { - ND_PRINT((ndo, " l2f:")); + ND_PRINT(" l2f:"); return; /* nothing to do */ } else { - ND_PRINT((ndo, " Unknown Version, neither L2F(1) nor L2TP(2)")); + ND_PRINT(" Unknown Version, neither L2F(1) nor L2TP(2)"); return; /* nothing we can do */ } - ND_PRINT((ndo, "[")); + ND_PRINT("["); if (EXTRACT_BE_U_2(ptr) & L2TP_FLAG_TYPE) { flag_t = TRUE; - ND_PRINT((ndo, "T")); + ND_PRINT("T"); } if (EXTRACT_BE_U_2(ptr) & L2TP_FLAG_LENGTH) { flag_l = TRUE; - ND_PRINT((ndo, "L")); + ND_PRINT("L"); } if (EXTRACT_BE_U_2(ptr) & L2TP_FLAG_SEQUENCE) { flag_s = TRUE; - ND_PRINT((ndo, "S")); + ND_PRINT("S"); } if (EXTRACT_BE_U_2(ptr) & L2TP_FLAG_OFFSET) { flag_o = TRUE; - ND_PRINT((ndo, "O")); + ND_PRINT("O"); } if (EXTRACT_BE_U_2(ptr) & L2TP_FLAG_PRIORITY) - ND_PRINT((ndo, "P")); - ND_PRINT((ndo, "]")); + ND_PRINT("P"); + ND_PRINT("]"); ptr += 2; cnt += 2; @@ -822,21 +822,21 @@ l2tp_print(netdissect_options *ndo, const u_char *dat, u_int length) } ND_TCHECK_2(ptr); /* Tunnel ID */ - ND_PRINT((ndo, "(%u/", EXTRACT_BE_U_2(ptr))); + ND_PRINT("(%u/", EXTRACT_BE_U_2(ptr)); ptr += 2; cnt += 2; ND_TCHECK_2(ptr); /* Session ID */ - ND_PRINT((ndo, "%u)", EXTRACT_BE_U_2(ptr))); + ND_PRINT("%u)", EXTRACT_BE_U_2(ptr)); ptr += 2; cnt += 2; if (flag_s) { ND_TCHECK_2(ptr); /* Ns */ - ND_PRINT((ndo, "Ns=%u,", EXTRACT_BE_U_2(ptr))); + ND_PRINT("Ns=%u,", EXTRACT_BE_U_2(ptr)); ptr += 2; cnt += 2; ND_TCHECK_2(ptr); /* Nr */ - ND_PRINT((ndo, "Nr=%u", EXTRACT_BE_U_2(ptr))); + ND_PRINT("Nr=%u", EXTRACT_BE_U_2(ptr)); ptr += 2; cnt += 2; } @@ -850,33 +850,33 @@ l2tp_print(netdissect_options *ndo, const u_char *dat, u_int length) if (flag_l) { if (length < l2tp_len) { - ND_PRINT((ndo, " Length %u larger than packet", l2tp_len)); + ND_PRINT(" Length %u larger than packet", l2tp_len); return; } length = l2tp_len; } if (length < cnt) { - ND_PRINT((ndo, " Length %u smaller than header length", length)); + ND_PRINT(" Length %u smaller than header length", length); return; } if (flag_t) { if (!flag_l) { - ND_PRINT((ndo, " No length")); + ND_PRINT(" No length"); return; } if (length - cnt == 0) { - ND_PRINT((ndo, " ZLB")); + ND_PRINT(" ZLB"); } else { l2tp_avp_print(ndo, ptr, length - cnt); } } else { - ND_PRINT((ndo, " {")); + ND_PRINT(" {"); ppp_print(ndo, ptr, length - cnt); - ND_PRINT((ndo, "}")); + ND_PRINT("}"); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-lane.c b/print-lane.c index 745c339c..b856f9c1 100644 --- a/print-lane.c +++ b/print-lane.c @@ -68,7 +68,7 @@ static const struct tok lecop2str[] = { static void lane_hdr_print(netdissect_options *ndo, const u_char *bp) { - ND_PRINT((ndo, "lecid:%x ", EXTRACT_BE_U_2(bp))); + ND_PRINT("lecid:%x ", EXTRACT_BE_U_2(bp)); } /* @@ -85,7 +85,7 @@ lane_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen) const struct lane_controlhdr *lec; if (caplen < sizeof(struct lane_controlhdr)) { - ND_PRINT((ndo, "[|lane]")); + ND_PRINT("[|lane]"); return; } @@ -94,10 +94,10 @@ lane_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen) /* * LE Control. */ - ND_PRINT((ndo, "lec: proto %x vers %x %s", + ND_PRINT("lec: proto %x vers %x %s", EXTRACT_U_1(lec->lec_proto), EXTRACT_U_1(lec->lec_vers), - tok2str(lecop2str, "opcode-#%u", EXTRACT_BE_U_2(lec->lec_opcode)))); + tok2str(lecop2str, "opcode-#%u", EXTRACT_BE_U_2(lec->lec_opcode))); return; } diff --git a/print-ldp.c b/print-ldp.c index eef5cc2b..878d8efb 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -253,21 +253,21 @@ ldp_tlv_print(netdissect_options *ndo, ND_TCHECK_SIZE(ldp_tlv_header); tlv_len=EXTRACT_BE_U_2(ldp_tlv_header->length); if (tlv_len + 4 > msg_tlen) { - ND_PRINT((ndo, "\n\t\t TLV contents go past end of message")); + ND_PRINT("\n\t\t TLV contents go past end of message"); return 0; } tlv_tlen=tlv_len; tlv_type=LDP_MASK_TLV_TYPE(EXTRACT_BE_U_2(ldp_tlv_header->type)); /* FIXME vendor private / experimental check */ - ND_PRINT((ndo, "\n\t %s TLV (0x%04x), length: %u, Flags: [%s and %s forward if unknown]", + ND_PRINT("\n\t %s TLV (0x%04x), length: %u, Flags: [%s and %s forward if unknown]", tok2str(ldp_tlv_values, "Unknown", tlv_type), tlv_type, tlv_len, LDP_MASK_U_BIT(EXTRACT_BE_U_2(ldp_tlv_header->type)) ? "continue processing" : "ignore", - LDP_MASK_F_BIT(EXTRACT_BE_U_2(ldp_tlv_header->type)) ? "do" : "don't")); + LDP_MASK_F_BIT(EXTRACT_BE_U_2(ldp_tlv_header->type)) ? "do" : "don't"); tptr+=sizeof(struct ldp_tlv_header); @@ -275,23 +275,23 @@ ldp_tlv_print(netdissect_options *ndo, case LDP_TLV_COMMON_HELLO: TLV_TCHECK(4); - ND_PRINT((ndo, "\n\t Hold Time: %us, Flags: [%s Hello%s]", + ND_PRINT("\n\t Hold Time: %us, Flags: [%s Hello%s]", EXTRACT_BE_U_2(tptr), (EXTRACT_BE_U_2(tptr + 2)&0x8000) ? "Targeted" : "Link", - (EXTRACT_BE_U_2(tptr + 2)&0x4000) ? ", Request for targeted Hellos" : "")); + (EXTRACT_BE_U_2(tptr + 2)&0x4000) ? ", Request for targeted Hellos" : ""); break; case LDP_TLV_IPV4_TRANSPORT_ADDR: TLV_TCHECK(4); - ND_PRINT((ndo, "\n\t IPv4 Transport Address: %s", ipaddr_string(ndo, tptr))); + ND_PRINT("\n\t IPv4 Transport Address: %s", ipaddr_string(ndo, tptr)); break; case LDP_TLV_IPV6_TRANSPORT_ADDR: TLV_TCHECK(16); - ND_PRINT((ndo, "\n\t IPv6 Transport Address: %s", ip6addr_string(ndo, tptr))); + ND_PRINT("\n\t IPv6 Transport Address: %s", ip6addr_string(ndo, tptr)); break; case LDP_TLV_CONFIG_SEQ_NUMBER: TLV_TCHECK(4); - ND_PRINT((ndo, "\n\t Sequence Number: %u", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t Sequence Number: %u", EXTRACT_BE_U_4(tptr)); break; case LDP_TLV_ADDRESS_LIST: @@ -299,13 +299,13 @@ ldp_tlv_print(netdissect_options *ndo, af = EXTRACT_BE_U_2(tptr); tptr+=LDP_TLV_ADDRESS_LIST_AFNUM_LEN; tlv_tlen -= LDP_TLV_ADDRESS_LIST_AFNUM_LEN; - ND_PRINT((ndo, "\n\t Address Family: %s, addresses", - tok2str(af_values, "Unknown (%u)", af))); + ND_PRINT("\n\t Address Family: %s, addresses", + tok2str(af_values, "Unknown (%u)", af)); switch (af) { case AFNUM_INET: while(tlv_tlen >= sizeof(struct in_addr)) { ND_TCHECK_LEN(tptr, sizeof(struct in_addr)); - ND_PRINT((ndo, " %s", ipaddr_string(ndo, tptr))); + ND_PRINT(" %s", ipaddr_string(ndo, tptr)); tlv_tlen-=sizeof(struct in_addr); tptr+=sizeof(struct in_addr); } @@ -313,7 +313,7 @@ ldp_tlv_print(netdissect_options *ndo, case AFNUM_INET6: while(tlv_tlen >= sizeof(struct in6_addr)) { ND_TCHECK_LEN(tptr, sizeof(struct in6_addr)); - ND_PRINT((ndo, " %s", ip6addr_string(ndo, tptr))); + ND_PRINT(" %s", ip6addr_string(ndo, tptr)); tlv_tlen-=sizeof(struct in6_addr); tptr+=sizeof(struct in6_addr); } @@ -326,19 +326,19 @@ ldp_tlv_print(netdissect_options *ndo, case LDP_TLV_COMMON_SESSION: TLV_TCHECK(8); - ND_PRINT((ndo, "\n\t Version: %u, Keepalive: %us, Flags: [Downstream %s, Loop Detection %s]", + ND_PRINT("\n\t Version: %u, Keepalive: %us, Flags: [Downstream %s, Loop Detection %s]", EXTRACT_BE_U_2(tptr), EXTRACT_BE_U_2(tptr + 2), (EXTRACT_BE_U_2(tptr + 6)&0x8000) ? "On Demand" : "Unsolicited", (EXTRACT_BE_U_2(tptr + 6)&0x4000) ? "Enabled" : "Disabled" - )); + ); break; case LDP_TLV_FEC: TLV_TCHECK(1); fec_type = EXTRACT_U_1(tptr); - ND_PRINT((ndo, "\n\t %s FEC (0x%02x)", + ND_PRINT("\n\t %s FEC (0x%02x)", tok2str(ldp_fec_values, "Unknown", fec_type), - fec_type)); + fec_type); tptr+=1; tlv_tlen-=1; @@ -356,25 +356,25 @@ ldp_tlv_print(netdissect_options *ndo, if (i == -2) goto trunc; if (i == -3) - ND_PRINT((ndo, ": IPv4 prefix (goes past end of TLV)")); + ND_PRINT(": IPv4 prefix (goes past end of TLV)"); else if (i == -1) - ND_PRINT((ndo, ": IPv4 prefix (invalid length)")); + ND_PRINT(": IPv4 prefix (invalid length)"); else - ND_PRINT((ndo, ": IPv4 prefix %s", buf)); + ND_PRINT(": IPv4 prefix %s", buf); } else if (af == AFNUM_INET6) { i=decode_prefix6(ndo, tptr, tlv_tlen, buf, sizeof(buf)); if (i == -2) goto trunc; if (i == -3) - ND_PRINT((ndo, ": IPv4 prefix (goes past end of TLV)")); + ND_PRINT(": IPv4 prefix (goes past end of TLV)"); else if (i == -1) - ND_PRINT((ndo, ": IPv6 prefix (invalid length)")); + ND_PRINT(": IPv6 prefix (invalid length)"); else - ND_PRINT((ndo, ": IPv6 prefix %s", buf)); + ND_PRINT(": IPv6 prefix %s", buf); } else - ND_PRINT((ndo, ": Address family %u prefix", af)); + ND_PRINT(": Address family %u prefix", af); break; case LDP_FEC_HOSTADDRESS: break; @@ -392,25 +392,25 @@ ldp_tlv_print(netdissect_options *ndo, * there's no VC ID. */ if (vc_info_len == 0) { - ND_PRINT((ndo, ": %s, %scontrol word, group-ID %u, VC-info-length: %u", + ND_PRINT(": %s, %scontrol word, group-ID %u, VC-info-length: %u", tok2str(mpls_pw_types_values, "Unknown", EXTRACT_BE_U_2(tptr)&0x7fff), EXTRACT_BE_U_2(tptr)&0x8000 ? "" : "no ", EXTRACT_BE_U_4(tptr + 3), - vc_info_len)); + vc_info_len); break; } /* Make sure we have the VC ID as well */ TLV_TCHECK(11); - ND_PRINT((ndo, ": %s, %scontrol word, group-ID %u, VC-ID %u, VC-info-length: %u", + ND_PRINT(": %s, %scontrol word, group-ID %u, VC-ID %u, VC-info-length: %u", tok2str(mpls_pw_types_values, "Unknown", EXTRACT_BE_U_2(tptr)&0x7fff), EXTRACT_BE_U_2(tptr)&0x8000 ? "" : "no ", EXTRACT_BE_U_4(tptr + 3), EXTRACT_BE_U_4(tptr + 7), - vc_info_len)); + vc_info_len); if (vc_info_len < 4) { /* minimum 4, for the VC ID */ - ND_PRINT((ndo, " (invalid, < 4")); + ND_PRINT(" (invalid, < 4"); return(tlv_len+4); /* Type & Length fields not included */ } vc_info_len -= 4; /* subtract out the VC ID, giving the length of the interface parameters */ @@ -428,29 +428,29 @@ ldp_tlv_print(netdissect_options *ndo, if (vc_info_len < vc_info_tlv_len) break; - ND_PRINT((ndo, "\n\t\tInterface Parameter: %s (0x%02x), len %u", + ND_PRINT("\n\t\tInterface Parameter: %s (0x%02x), len %u", tok2str(ldp_fec_martini_ifparm_values,"Unknown",vc_info_tlv_type), vc_info_tlv_type, - vc_info_tlv_len)); + vc_info_tlv_len); switch(vc_info_tlv_type) { case LDP_FEC_MARTINI_IFPARM_MTU: - ND_PRINT((ndo, ": %u", EXTRACT_BE_U_2(tptr + 2))); + ND_PRINT(": %u", EXTRACT_BE_U_2(tptr + 2)); break; case LDP_FEC_MARTINI_IFPARM_DESC: - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); for (idx = 2; idx < vc_info_tlv_len; idx++) safeputchar(ndo, EXTRACT_U_1(tptr + idx)); break; case LDP_FEC_MARTINI_IFPARM_VCCV: - ND_PRINT((ndo, "\n\t\t Control Channels (0x%02x) = [%s]", + ND_PRINT("\n\t\t Control Channels (0x%02x) = [%s]", EXTRACT_U_1((tptr + 2)), - bittok2str(ldp_fec_martini_ifparm_vccv_cc_values, "none", EXTRACT_U_1((tptr + 2))))); - ND_PRINT((ndo, "\n\t\t CV Types (0x%02x) = [%s]", + bittok2str(ldp_fec_martini_ifparm_vccv_cc_values, "none", EXTRACT_U_1((tptr + 2)))); + ND_PRINT("\n\t\t CV Types (0x%02x) = [%s]", EXTRACT_U_1((tptr + 3)), - bittok2str(ldp_fec_martini_ifparm_vccv_cv_values, "none", EXTRACT_U_1((tptr + 3))))); + bittok2str(ldp_fec_martini_ifparm_vccv_cv_values, "none", EXTRACT_U_1((tptr + 3)))); break; default: @@ -468,45 +468,45 @@ ldp_tlv_print(netdissect_options *ndo, case LDP_TLV_GENERIC_LABEL: TLV_TCHECK(4); - ND_PRINT((ndo, "\n\t Label: %u", EXTRACT_BE_U_4(tptr) & 0xfffff)); + ND_PRINT("\n\t Label: %u", EXTRACT_BE_U_4(tptr) & 0xfffff); break; case LDP_TLV_STATUS: TLV_TCHECK(8); ui = EXTRACT_BE_U_4(tptr); tptr+=4; - ND_PRINT((ndo, "\n\t Status: 0x%02x, Flags: [%s and %s forward]", + ND_PRINT("\n\t Status: 0x%02x, Flags: [%s and %s forward]", ui&0x3fffffff, ui&0x80000000 ? "Fatal error" : "Advisory Notification", - ui&0x40000000 ? "do" : "don't")); + ui&0x40000000 ? "do" : "don't"); ui = EXTRACT_BE_U_4(tptr); tptr+=4; if (ui) - ND_PRINT((ndo, ", causing Message ID: 0x%08x", ui)); + ND_PRINT(", causing Message ID: 0x%08x", ui); break; case LDP_TLV_FT_SESSION: TLV_TCHECK(8); ft_flags = EXTRACT_BE_U_2(tptr); - ND_PRINT((ndo, "\n\t Flags: [%sReconnect, %sSave State, %sAll-Label Protection, %s Checkpoint, %sRe-Learn State]", + ND_PRINT("\n\t Flags: [%sReconnect, %sSave State, %sAll-Label Protection, %s Checkpoint, %sRe-Learn State]", ft_flags&0x8000 ? "" : "No ", ft_flags&0x8 ? "" : "Don't ", ft_flags&0x4 ? "" : "No ", ft_flags&0x2 ? "Sequence Numbered Label" : "All Labels", - ft_flags&0x1 ? "" : "Don't ")); + ft_flags&0x1 ? "" : "Don't "); tptr+=4; ui = EXTRACT_BE_U_4(tptr); if (ui) - ND_PRINT((ndo, ", Reconnect Timeout: %ums", ui)); + ND_PRINT(", Reconnect Timeout: %ums", ui); tptr+=4; ui = EXTRACT_BE_U_4(tptr); if (ui) - ND_PRINT((ndo, ", Recovery Time: %ums", ui)); + ND_PRINT(", Recovery Time: %ums", ui); break; case LDP_TLV_MTU: TLV_TCHECK(2); - ND_PRINT((ndo, "\n\t MTU: %u", EXTRACT_BE_U_2(tptr))); + ND_PRINT("\n\t MTU: %u", EXTRACT_BE_U_2(tptr)); break; @@ -534,11 +534,11 @@ ldp_tlv_print(netdissect_options *ndo, return(tlv_len+4); /* Type & Length fields not included */ trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); return 0; badtlv: - ND_PRINT((ndo, "\n\t\t TLV contents go past end of TLV")); + ND_PRINT("\n\t\t TLV contents go past end of TLV"); return(tlv_len+4); /* Type & Length fields not included */ } @@ -574,28 +574,28 @@ ldp_pdu_print(netdissect_options *ndo, * Sanity checking of the header. */ if (EXTRACT_BE_U_2(ldp_com_header->version) != LDP_VERSION) { - ND_PRINT((ndo, "%sLDP version %u packet not supported", + ND_PRINT("%sLDP version %u packet not supported", (ndo->ndo_vflag < 1) ? "" : "\n\t", - EXTRACT_BE_U_2(ldp_com_header->version))); + EXTRACT_BE_U_2(ldp_com_header->version)); return 0; } pdu_len = EXTRACT_BE_U_2(ldp_com_header->pdu_length); if (pdu_len < sizeof(struct ldp_common_header)-4) { /* length too short */ - ND_PRINT((ndo, "%sLDP, pdu-length: %u (too short, < %u)", + ND_PRINT("%sLDP, pdu-length: %u (too short, < %u)", (ndo->ndo_vflag < 1) ? "" : "\n\t", pdu_len, - (u_int)(sizeof(struct ldp_common_header)-4))); + (u_int)(sizeof(struct ldp_common_header)-4)); return 0; } /* print the LSR-ID, label-space & length */ - ND_PRINT((ndo, "%sLDP, Label-Space-ID: %s:%u, pdu-length: %u", + ND_PRINT("%sLDP, Label-Space-ID: %s:%u, pdu-length: %u", (ndo->ndo_vflag < 1) ? "" : "\n\t", ipaddr_string(ndo, &ldp_com_header->lsr_id), EXTRACT_BE_U_2(ldp_com_header->label_space), - pdu_len)); + pdu_len); /* bail out if non-verbose */ if (ndo->ndo_vflag < 1) @@ -616,25 +616,25 @@ ldp_pdu_print(netdissect_options *ndo, if (msg_len < sizeof(struct ldp_msg_header)-4) { /* length too short */ /* FIXME vendor private / experimental check */ - ND_PRINT((ndo, "\n\t %s Message (0x%04x), length: %u (too short, < %u)", + ND_PRINT("\n\t %s Message (0x%04x), length: %u (too short, < %u)", tok2str(ldp_msg_values, "Unknown", msg_type), msg_type, msg_len, - (u_int)(sizeof(struct ldp_msg_header)-4))); + (u_int)(sizeof(struct ldp_msg_header)-4)); return 0; } /* FIXME vendor private / experimental check */ - ND_PRINT((ndo, "\n\t %s Message (0x%04x), length: %u, Message ID: 0x%08x, Flags: [%s if unknown]", + ND_PRINT("\n\t %s Message (0x%04x), length: %u, Message ID: 0x%08x, Flags: [%s if unknown]", tok2str(ldp_msg_values, "Unknown", msg_type), msg_type, msg_len, EXTRACT_BE_U_4(ldp_msg_header->id), - LDP_MASK_U_BIT(EXTRACT_BE_U_2(ldp_msg_header->type)) ? "continue processing" : "ignore")); + LDP_MASK_U_BIT(EXTRACT_BE_U_2(ldp_msg_header->type)) ? "continue processing" : "ignore"); msg_tptr=tptr+sizeof(struct ldp_msg_header); msg_tlen=msg_len-(sizeof(struct ldp_msg_header)-4); /* Type & Length fields not included */ @@ -686,7 +686,7 @@ ldp_pdu_print(netdissect_options *ndo, } return pdu_len+4; trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); return 0; } diff --git a/print-lisp.c b/print-lisp.c index 804f898e..d0766e5b 100644 --- a/print-lisp.c +++ b/print-lisp.c @@ -271,13 +271,13 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) if (ndo->ndo_vflag) { key_id = EXTRACT_BE_U_2(lisp_hdr->key_id); - ND_PRINT((ndo, "\n %u record(s), ", record_count)); - ND_PRINT((ndo, "Authentication %s,", - tok2str(auth_type, "unknown-type", key_id))); + ND_PRINT("\n %u record(s), ", record_count); + ND_PRINT("Authentication %s,", + tok2str(auth_type, "unknown-type", key_id)); hex_print(ndo, "\n Authentication-Data: ", packet_iterator + packet_offset, auth_data_len); } else { - ND_PRINT((ndo, " %u record(s),", record_count)); + ND_PRINT(" %u record(s),", record_count); } packet_offset += auth_data_len; @@ -289,7 +289,7 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) ND_TCHECK_LEN(packet_iterator + packet_offset, MAP_REGISTER_EID_LEN); - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); lisp_eid = (const lisp_map_register_eid *) ((const u_char *)lisp_hdr + packet_offset); packet_offset += MAP_REGISTER_EID_LEN; @@ -299,23 +299,23 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) if (ndo->ndo_vflag) { ttl = EXTRACT_BE_U_4(lisp_eid->ttl); - ND_PRINT((ndo, " Record TTL %u,", ttl)); + ND_PRINT(" Record TTL %u,", ttl); action_flag(ndo, EXTRACT_U_1(lisp_eid->act_auth_inc_res)); map_version = EXTRACT_BE_U_2(lisp_eid->reserved_and_version) & 0x0FFF; - ND_PRINT((ndo, " Map Version: %u,", map_version)); + ND_PRINT(" Map Version: %u,", map_version); } switch (eid_afi) { case IPv4_AFI: ND_TCHECK_4(packet_iterator + packet_offset); - ND_PRINT((ndo, " EID %s/%u,", ipaddr_string(ndo, - packet_iterator + packet_offset), mask_len)); + ND_PRINT(" EID %s/%u,", ipaddr_string(ndo, + packet_iterator + packet_offset), mask_len); packet_offset += 4; break; case IPv6_AFI: ND_TCHECK_16(packet_iterator + packet_offset); - ND_PRINT((ndo, " EID %s/%u,", ip6addr_string(ndo, - packet_iterator + packet_offset), mask_len)); + ND_PRINT(" EID %s/%u,", ip6addr_string(ndo, + packet_iterator + packet_offset), mask_len); packet_offset += 16; break; default: @@ -326,7 +326,7 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) break; } - ND_PRINT((ndo, " %u locator(s)", loc_count)); + ND_PRINT(" %u locator(s)", loc_count); while (loc_count--) { ND_TCHECK_LEN(packet_iterator + packet_offset, @@ -337,29 +337,29 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) loc_afi = EXTRACT_BE_U_2(lisp_loc->locator_afi); if (ndo->ndo_vflag) - ND_PRINT((ndo, "\n ")); + ND_PRINT("\n "); switch (loc_afi) { case IPv4_AFI: ND_TCHECK_4(packet_iterator + packet_offset); - ND_PRINT((ndo, " LOC %s", ipaddr_string(ndo, loc_ip_pointer))); + ND_PRINT(" LOC %s", ipaddr_string(ndo, loc_ip_pointer)); packet_offset += 4; break; case IPv6_AFI: ND_TCHECK_16(packet_iterator + packet_offset); - ND_PRINT((ndo, " LOC %s", ip6addr_string(ndo, loc_ip_pointer))); + ND_PRINT(" LOC %s", ip6addr_string(ndo, loc_ip_pointer)); packet_offset += 16; break; default: break; } if (ndo->ndo_vflag) { - ND_PRINT((ndo, "\n Priority/Weight %u/%u," + ND_PRINT("\n Priority/Weight %u/%u," " Multicast Priority/Weight %u/%u,", EXTRACT_U_1(lisp_loc->priority), EXTRACT_U_1(lisp_loc->weight), EXTRACT_U_1(lisp_loc->m_priority), - EXTRACT_U_1(lisp_loc->m_weight))); + EXTRACT_U_1(lisp_loc->m_weight)); loc_hdr_flag(ndo, EXTRACT_BE_U_2(lisp_loc->unused_and_flag)); } @@ -375,8 +375,8 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) if (!ND_TTEST_LEN(packet_iterator + packet_offset, 24)) goto invalid; hex_print_with_offset(ndo, "\n xTR-ID: ", packet_iterator + packet_offset, 16, 0); - ND_PRINT((ndo, "\n SITE-ID: %" PRIu64, - EXTRACT_BE_U_8(packet_iterator + packet_offset + 16))); + ND_PRINT("\n SITE-ID: %" PRIu64, + EXTRACT_BE_U_8(packet_iterator + packet_offset + 16)); } else { /* Check if packet isn't over yet */ if (packet_iterator + packet_offset < ndo->ndo_snapend) { @@ -386,10 +386,10 @@ lisp_print(netdissect_options *ndo, const u_char *bp, u_int length) } return; trunc: - ND_PRINT((ndo, "\n %s", tstr)); + ND_PRINT("\n %s", tstr); return; invalid: - ND_PRINT((ndo, "\n %s", istr)); + ND_PRINT("\n %s", istr); return; } @@ -415,18 +415,18 @@ static void lisp_hdr_flag(netdissect_options *ndo, const lisp_map_register_hdr * uint8_t type = extract_lisp_type(EXTRACT_U_1(lisp_hdr->type_and_flag)); if (!ndo->ndo_vflag) { - ND_PRINT((ndo, "%s,", tok2str(lisp_type, "unknown-type-%u", type))); + ND_PRINT("%s,", tok2str(lisp_type, "unknown-type-%u", type)); return; } else { - ND_PRINT((ndo, "%s,", tok2str(lisp_type, "unknown-type-%u", type))); + ND_PRINT("%s,", tok2str(lisp_type, "unknown-type-%u", type)); } if (type == LISP_MAP_REGISTER) { - ND_PRINT((ndo, " flags [%s],", bittok2str(map_register_hdr_flag, - "none", EXTRACT_BE_U_4(lisp_hdr)))); + ND_PRINT(" flags [%s],", bittok2str(map_register_hdr_flag, + "none", EXTRACT_BE_U_4(lisp_hdr))); } else if (type == LISP_MAP_NOTIFY) { - ND_PRINT((ndo, " flags [%s],", bittok2str(map_notify_hdr_flag, - "none", EXTRACT_BE_U_4(lisp_hdr)))); + ND_PRINT(" flags [%s],", bittok2str(map_notify_hdr_flag, + "none", EXTRACT_BE_U_4(lisp_hdr))); } return; @@ -440,16 +440,16 @@ static void action_flag(netdissect_options *ndo, uint8_t act_auth_inc_res) authoritative = ((act_auth_inc_res >> 4) & 1); if (authoritative) - ND_PRINT((ndo, " Authoritative,")); + ND_PRINT(" Authoritative,"); else - ND_PRINT((ndo, " Non-Authoritative,")); + ND_PRINT(" Non-Authoritative,"); action = act_auth_inc_res >> 5; - ND_PRINT((ndo, " %s,", tok2str(lisp_eid_action, "unknown", action))); + ND_PRINT(" %s,", tok2str(lisp_eid_action, "unknown", action)); } static void loc_hdr_flag(netdissect_options *ndo, uint16_t flag) { - ND_PRINT((ndo, " flags [%s],", bittok2str(lisp_loc_flag, "none", flag))); + ND_PRINT(" flags [%s],", bittok2str(lisp_loc_flag, "none", flag)); } diff --git a/print-llc.c b/print-llc.c index 3d0a7cd0..a1a507bb 100644 --- a/print-llc.c +++ b/print-llc.c @@ -156,12 +156,12 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, int is_u; if (caplen < 3) { - ND_PRINT((ndo, "[|llc]")); + ND_PRINT("[|llc]"); ND_DEFAULTPRINT((const u_char *)p, caplen); return (caplen); } if (length < 3) { - ND_PRINT((ndo, "[|llc]")); + ND_PRINT("[|llc]"); ND_DEFAULTPRINT((const u_char *)p, caplen); return (length); } @@ -188,12 +188,12 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, * 2 bytes... */ if (caplen < 4) { - ND_PRINT((ndo, "[|llc]")); + ND_PRINT("[|llc]"); ND_DEFAULTPRINT((const u_char *)p, caplen); return (caplen); } if (length < 4) { - ND_PRINT((ndo, "[|llc]")); + ND_PRINT("[|llc]"); ND_DEFAULTPRINT((const u_char *)p, caplen); return (length); } @@ -223,7 +223,7 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, */ if (ndo->ndo_eflag) - ND_PRINT((ndo, "IPX 802.3: ")); + ND_PRINT("IPX 802.3: "); ipx_print(ndo, p, length); return (0); /* no LLC header */ @@ -233,18 +233,18 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, ssap = ssap_field & ~LLC_GSAP; if (ndo->ndo_eflag) { - ND_PRINT((ndo, "LLC, dsap %s (0x%02x) %s, ssap %s (0x%02x) %s", + ND_PRINT("LLC, dsap %s (0x%02x) %s, ssap %s (0x%02x) %s", tok2str(llc_values, "Unknown", dsap), dsap, tok2str(llc_ig_flag_values, "Unknown", dsap_field & LLC_IG), tok2str(llc_values, "Unknown", ssap), ssap, - tok2str(llc_flag_values, "Unknown", ssap_field & LLC_GSAP))); + tok2str(llc_flag_values, "Unknown", ssap_field & LLC_GSAP)); if (is_u) { - ND_PRINT((ndo, ", ctrl 0x%02x: ", control)); + ND_PRINT(", ctrl 0x%02x: ", control); } else { - ND_PRINT((ndo, ", ctrl 0x%04x: ", control)); + ND_PRINT(", ctrl 0x%04x: ", control); } } @@ -299,7 +299,7 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, * destination SAPs being the IPX SAP. */ if (ndo->ndo_eflag) - ND_PRINT((ndo, "IPX 802.2: ")); + ND_PRINT("IPX 802.2: "); ipx_print(ndo, p, length); return (hdrlen); @@ -331,31 +331,31 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, if (!ndo->ndo_eflag) { if (ssap == dsap) { if (src == NULL || dst == NULL) - ND_PRINT((ndo, "%s ", tok2str(llc_values, "Unknown DSAP 0x%02x", dsap))); + ND_PRINT("%s ", tok2str(llc_values, "Unknown DSAP 0x%02x", dsap)); else - ND_PRINT((ndo, "%s > %s %s ", + ND_PRINT("%s > %s %s ", (src->addr_string)(ndo, src->addr), (dst->addr_string)(ndo, dst->addr), - tok2str(llc_values, "Unknown DSAP 0x%02x", dsap))); + tok2str(llc_values, "Unknown DSAP 0x%02x", dsap)); } else { if (src == NULL || dst == NULL) - ND_PRINT((ndo, "%s > %s ", + ND_PRINT("%s > %s ", tok2str(llc_values, "Unknown SSAP 0x%02x", ssap), - tok2str(llc_values, "Unknown DSAP 0x%02x", dsap))); + tok2str(llc_values, "Unknown DSAP 0x%02x", dsap)); else - ND_PRINT((ndo, "%s %s > %s %s ", + ND_PRINT("%s %s > %s %s ", (src->addr_string)(ndo, src->addr), tok2str(llc_values, "Unknown SSAP 0x%02x", ssap), (dst->addr_string)(ndo, dst->addr), - tok2str(llc_values, "Unknown DSAP 0x%02x", dsap))); + tok2str(llc_values, "Unknown DSAP 0x%02x", dsap)); } } if (is_u) { - ND_PRINT((ndo, "Unnumbered, %s, Flags [%s], length %u", + ND_PRINT("Unnumbered, %s, Flags [%s], length %u", tok2str(llc_cmd_values, "%02x", LLC_U_CMD(control)), tok2str(llc_flag_values,"?",(ssap_field & LLC_GSAP) | (control & LLC_U_POLL)), - length + hdrlen)); + length + hdrlen); if ((control & ~LLC_U_POLL) == LLC_XID) { if (length == 0) { @@ -367,37 +367,37 @@ llc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, return (hdrlen); } if (caplen < 1) { - ND_PRINT((ndo, "[|llc]")); + ND_PRINT("[|llc]"); if (caplen > 0) ND_DEFAULTPRINT((const u_char *)p, caplen); return (hdrlen); } if (EXTRACT_U_1(p) == LLC_XID_FI) { if (caplen < 3 || length < 3) { - ND_PRINT((ndo, "[|llc]")); + ND_PRINT("[|llc]"); if (caplen > 0) ND_DEFAULTPRINT((const u_char *)p, caplen); } else - ND_PRINT((ndo, ": %02x %02x", + ND_PRINT(": %02x %02x", EXTRACT_U_1(p + 1), - EXTRACT_U_1(p + 2))); + EXTRACT_U_1(p + 2)); return (hdrlen); } } } else { if ((control & LLC_S_FMT) == LLC_S_FMT) { - ND_PRINT((ndo, "Supervisory, %s, rcv seq %u, Flags [%s], length %u", + ND_PRINT("Supervisory, %s, rcv seq %u, Flags [%s], length %u", tok2str(llc_supervisory_values,"?",LLC_S_CMD(control)), LLC_IS_NR(control), tok2str(llc_flag_values,"?",(ssap_field & LLC_GSAP) | (control & LLC_IS_POLL)), - length + hdrlen)); + length + hdrlen); return (hdrlen); /* no payload to print */ } else { - ND_PRINT((ndo, "Information, send seq %u, rcv seq %u, Flags [%s], length %u", + ND_PRINT("Information, send seq %u, rcv seq %u, Flags [%s], length %u", LLC_I_NS(control), LLC_IS_NR(control), tok2str(llc_flag_values,"?",(ssap_field & LLC_GSAP) | (control & LLC_IS_POLL)), - length + hdrlen)); + length + hdrlen); } } return (-hdrlen); @@ -439,12 +439,12 @@ snap_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, * are any, so just print the SNAP header, not the MAC * addresses. */ - ND_PRINT((ndo, "oui %s (0x%06x), %s %s (0x%04x), length %u: ", + ND_PRINT("oui %s (0x%06x), %s %s (0x%04x), length %u: ", tok2str(oui_values, "Unknown", orgcode), orgcode, (orgcode == 0x000000 ? "ethertype" : "pid"), tok2str(oui_to_struct_tok(orgcode), "Unknown", et), - et, length - 5)); + et, length - 5); } p += 5; length -= 5; @@ -579,9 +579,9 @@ snap_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, * we have any. */ if (src != NULL && dst != NULL) { - ND_PRINT((ndo, "%s > %s ", + ND_PRINT("%s > %s ", (src->addr_string)(ndo, src->addr), - (dst->addr_string)(ndo, dst->addr))); + (dst->addr_string)(ndo, dst->addr)); } /* * Print the SNAP header, but if the OUI is 000000, don't @@ -589,21 +589,21 @@ snap_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen, * ethertype. */ if (orgcode == 0x000000) { - ND_PRINT((ndo, "SNAP, ethertype %s (0x%04x), length %u: ", + ND_PRINT("SNAP, ethertype %s (0x%04x), length %u: ", tok2str(ethertype_values, "Unknown", et), - et, length)); + et, length); } else { - ND_PRINT((ndo, "SNAP, oui %s (0x%06x), pid %s (0x%04x), length %u: ", + ND_PRINT("SNAP, oui %s (0x%06x), pid %s (0x%04x), length %u: ", tok2str(oui_values, "Unknown", orgcode), orgcode, tok2str(oui_to_struct_tok(orgcode), "Unknown", et), - et, length)); + et, length); } } return (0); trunc: - ND_PRINT((ndo, "[|snap]")); + ND_PRINT("[|snap]"); return (1); } diff --git a/print-lldp.c b/print-lldp.c index f4752d49..927d77f1 100644 --- a/print-lldp.c +++ b/print-lldp.c @@ -614,37 +614,37 @@ static void print_ets_priority_assignment_table(netdissect_options *ndo, const u_char *ptr) { - ND_PRINT((ndo, "\n\t Priority Assignment Table")); - ND_PRINT((ndo, "\n\t Priority : 0 1 2 3 4 5 6 7")); - ND_PRINT((ndo, "\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d", + ND_PRINT("\n\t Priority Assignment Table"); + ND_PRINT("\n\t Priority : 0 1 2 3 4 5 6 7"); + ND_PRINT("\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d", EXTRACT_U_1(ptr) >> 4, EXTRACT_U_1(ptr) & 0x0f, EXTRACT_U_1(ptr + 1) >> 4, EXTRACT_U_1(ptr + 1) & 0x0f, EXTRACT_U_1(ptr + 2) >> 4, EXTRACT_U_1(ptr + 2) & 0x0f, - EXTRACT_U_1(ptr + 3) >> 4, EXTRACT_U_1(ptr + 3) & 0x0f)); + EXTRACT_U_1(ptr + 3) >> 4, EXTRACT_U_1(ptr + 3) & 0x0f); } static void print_tc_bandwidth_table(netdissect_options *ndo, const u_char *ptr) { - ND_PRINT((ndo, "\n\t TC Bandwidth Table")); - ND_PRINT((ndo, "\n\t TC%% : 0 1 2 3 4 5 6 7")); - ND_PRINT((ndo, "\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d", + ND_PRINT("\n\t TC Bandwidth Table"); + ND_PRINT("\n\t TC%% : 0 1 2 3 4 5 6 7"); + ND_PRINT("\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d", EXTRACT_U_1(ptr), EXTRACT_U_1(ptr + 1), EXTRACT_U_1(ptr + 2), EXTRACT_U_1(ptr + 3), EXTRACT_U_1(ptr + 4), EXTRACT_U_1(ptr + 5), - EXTRACT_U_1(ptr + 6), EXTRACT_U_1(ptr + 7))); + EXTRACT_U_1(ptr + 6), EXTRACT_U_1(ptr + 7)); } static void print_tsa_assignment_table(netdissect_options *ndo, const u_char *ptr) { - ND_PRINT((ndo, "\n\t TSA Assignment Table")); - ND_PRINT((ndo, "\n\t Traffic Class: 0 1 2 3 4 5 6 7")); - ND_PRINT((ndo, "\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d", + ND_PRINT("\n\t TSA Assignment Table"); + ND_PRINT("\n\t Traffic Class: 0 1 2 3 4 5 6 7"); + ND_PRINT("\n\t Value : %-3d %-3d %-3d %-3d %-3d %-3d %-3d %-3d", EXTRACT_U_1(ptr), EXTRACT_U_1(ptr + 1), EXTRACT_U_1(ptr + 2), EXTRACT_U_1(ptr + 3), EXTRACT_U_1(ptr + 4), EXTRACT_U_1(ptr + 5), - EXTRACT_U_1(ptr + 6), EXTRACT_U_1(ptr + 7))); + EXTRACT_U_1(ptr + 6), EXTRACT_U_1(ptr + 7)); } /* @@ -664,32 +664,32 @@ lldp_private_8021_print(netdissect_options *ndo, } subtype = EXTRACT_U_1(tptr + 3); - ND_PRINT((ndo, "\n\t %s Subtype (%u)", + ND_PRINT("\n\t %s Subtype (%u)", tok2str(lldp_8021_subtype_values, "unknown", subtype), - subtype)); + subtype); switch (subtype) { case LLDP_PRIVATE_8021_SUBTYPE_PORT_VLAN_ID: if (tlv_len < 6) { return hexdump; } - ND_PRINT((ndo, "\n\t port vlan id (PVID): %u", - EXTRACT_BE_U_2(tptr + 4))); + ND_PRINT("\n\t port vlan id (PVID): %u", + EXTRACT_BE_U_2(tptr + 4)); break; case LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_VLAN_ID: if (tlv_len < 7) { return hexdump; } - ND_PRINT((ndo, "\n\t port and protocol vlan id (PPVID): %u, flags [%s] (0x%02x)", + ND_PRINT("\n\t port and protocol vlan id (PPVID): %u, flags [%s] (0x%02x)", EXTRACT_BE_U_2(tptr + 5), bittok2str(lldp_8021_port_protocol_id_values, "none", EXTRACT_U_1(tptr + 4)), - EXTRACT_U_1(tptr + 4))); + EXTRACT_U_1(tptr + 4)); break; case LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME: if (tlv_len < 6) { return hexdump; } - ND_PRINT((ndo, "\n\t vlan id (VID): %u", EXTRACT_BE_U_2(tptr + 4))); + ND_PRINT("\n\t vlan id (VID): %u", EXTRACT_BE_U_2(tptr + 4)); if (tlv_len < 7) { return hexdump; } @@ -697,7 +697,7 @@ lldp_private_8021_print(netdissect_options *ndo, if (tlv_len < 7+sublen) { return hexdump; } - ND_PRINT((ndo, "\n\t vlan name: ")); + ND_PRINT("\n\t vlan name: "); safeputs(ndo, tptr + 7, sublen); break; case LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY: @@ -708,7 +708,7 @@ lldp_private_8021_print(netdissect_options *ndo, if (tlv_len < 5+sublen) { return hexdump; } - ND_PRINT((ndo, "\n\t protocol identity: ")); + ND_PRINT("\n\t protocol identity: "); safeputs(ndo, tptr + 5, sublen); break; case LLDP_PRIVATE_8021_SUBTYPE_CONGESTION_NOTIFICATION: @@ -716,17 +716,17 @@ lldp_private_8021_print(netdissect_options *ndo, return hexdump; } tval=EXTRACT_U_1(tptr + 4); - ND_PRINT((ndo, "\n\t Pre-Priority CNPV Indicator")); - ND_PRINT((ndo, "\n\t Priority : 0 1 2 3 4 5 6 7")); - ND_PRINT((ndo, "\n\t Value : ")); + ND_PRINT("\n\t Pre-Priority CNPV Indicator"); + ND_PRINT("\n\t Priority : 0 1 2 3 4 5 6 7"); + ND_PRINT("\n\t Value : "); for(i=0;i<NO_OF_BITS;i++) - ND_PRINT((ndo, "%-2d ", (tval >> i) & 0x01)); + ND_PRINT("%-2d ", (tval >> i) & 0x01); tval=EXTRACT_U_1(tptr + 5); - ND_PRINT((ndo, "\n\t Pre-Priority Ready Indicator")); - ND_PRINT((ndo, "\n\t Priority : 0 1 2 3 4 5 6 7")); - ND_PRINT((ndo, "\n\t Value : ")); + ND_PRINT("\n\t Pre-Priority Ready Indicator"); + ND_PRINT("\n\t Priority : 0 1 2 3 4 5 6 7"); + ND_PRINT("\n\t Value : "); for(i=0;i<NO_OF_BITS;i++) - ND_PRINT((ndo, "%-2d ", (tval >> i) & 0x01)); + ND_PRINT("%-2d ", (tval >> i) & 0x01); break; case LLDP_PRIVATE_8021_SUBTYPE_ETS_CONFIGURATION: @@ -734,8 +734,8 @@ lldp_private_8021_print(netdissect_options *ndo, return hexdump; } tval=EXTRACT_U_1(tptr + 4); - ND_PRINT((ndo, "\n\t Willing:%d, CBS:%d, RES:%d, Max TCs:%d", - tval >> 7, (tval >> 6) & 0x02, (tval >> 3) & 0x07, tval & 0x07)); + ND_PRINT("\n\t Willing:%d, CBS:%d, RES:%d, Max TCs:%d", + tval >> 7, (tval >> 6) & 0x02, (tval >> 3) & 0x07, tval & 0x07); /*Print Priority Assignment Table*/ print_ets_priority_assignment_table(ndo, tptr + 5); @@ -752,7 +752,7 @@ lldp_private_8021_print(netdissect_options *ndo, if(tlv_len<LLDP_PRIVATE_8021_SUBTYPE_ETS_RECOMMENDATION_LENGTH) { return hexdump; } - ND_PRINT((ndo, "\n\t RES: %d", EXTRACT_U_1(tptr + 4))); + ND_PRINT("\n\t RES: %d", EXTRACT_U_1(tptr + 4)); /*Print Priority Assignment Table */ print_ets_priority_assignment_table(ndo, tptr + 5); /*Print TC Bandwidth Table */ @@ -766,21 +766,21 @@ lldp_private_8021_print(netdissect_options *ndo, return hexdump; } tval=EXTRACT_U_1(tptr + 4); - ND_PRINT((ndo, "\n\t Willing: %d, MBC: %d, RES: %d, PFC cap:%d ", - tval >> 7, (tval >> 6) & 0x01, (tval >> 4) & 0x03, (tval & 0x0f))); - ND_PRINT((ndo, "\n\t PFC Enable")); + ND_PRINT("\n\t Willing: %d, MBC: %d, RES: %d, PFC cap:%d ", + tval >> 7, (tval >> 6) & 0x01, (tval >> 4) & 0x03, (tval & 0x0f)); + ND_PRINT("\n\t PFC Enable"); tval=EXTRACT_U_1(tptr + 5); - ND_PRINT((ndo, "\n\t Priority : 0 1 2 3 4 5 6 7")); - ND_PRINT((ndo, "\n\t Value : ")); + ND_PRINT("\n\t Priority : 0 1 2 3 4 5 6 7"); + ND_PRINT("\n\t Value : "); for(i=0;i<NO_OF_BITS;i++) - ND_PRINT((ndo, "%-2d ", (tval >> i) & 0x01)); + ND_PRINT("%-2d ", (tval >> i) & 0x01); break; case LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY: if(tlv_len<LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY_MIN_LENGTH) { return hexdump; } - ND_PRINT((ndo, "\n\t RES: %d", EXTRACT_U_1(tptr + 4))); + ND_PRINT("\n\t RES: %d", EXTRACT_U_1(tptr + 4)); if(tlv_len<=LLDP_PRIVATE_8021_SUBTYPE_APPLICATION_PRIORITY_MIN_LENGTH){ return hexdump; } @@ -790,12 +790,12 @@ lldp_private_8021_print(netdissect_options *ndo, return hexdump; } i=0; - ND_PRINT((ndo, "\n\t Application Priority Table")); + ND_PRINT("\n\t Application Priority Table"); while(i<sublen) { tval=EXTRACT_U_1(tptr + i + 5); - ND_PRINT((ndo, "\n\t Priority: %u, RES: %u, Sel: %u, Protocol ID: %u", + ND_PRINT("\n\t Priority: %u, RES: %u, Sel: %u, Protocol ID: %u", tval >> 5, (tval >> 3) & 0x03, (tval & 0x07), - EXTRACT_BE_U_2(tptr + i + 5))); + EXTRACT_BE_U_2(tptr + i + 5)); i=i+3; } break; @@ -803,22 +803,22 @@ lldp_private_8021_print(netdissect_options *ndo, if(tlv_len<LLDP_PRIVATE_8021_SUBTYPE_EVB_LENGTH){ return hexdump; } - ND_PRINT((ndo, "\n\t EVB Bridge Status")); + ND_PRINT("\n\t EVB Bridge Status"); tval=EXTRACT_U_1(tptr + 4); - ND_PRINT((ndo, "\n\t RES: %d, BGID: %d, RRCAP: %d, RRCTR: %d", - tval >> 3, (tval >> 2) & 0x01, (tval >> 1) & 0x01, tval & 0x01)); - ND_PRINT((ndo, "\n\t EVB Station Status")); + ND_PRINT("\n\t RES: %d, BGID: %d, RRCAP: %d, RRCTR: %d", + tval >> 3, (tval >> 2) & 0x01, (tval >> 1) & 0x01, tval & 0x01); + ND_PRINT("\n\t EVB Station Status"); tval=EXTRACT_U_1(tptr + 5); - ND_PRINT((ndo, "\n\t RES: %d, SGID: %d, RRREQ: %d,RRSTAT: %d", - tval >> 4, (tval >> 3) & 0x01, (tval >> 2) & 0x01, tval & 0x03)); + ND_PRINT("\n\t RES: %d, SGID: %d, RRREQ: %d,RRSTAT: %d", + tval >> 4, (tval >> 3) & 0x01, (tval >> 2) & 0x01, tval & 0x03); tval=EXTRACT_U_1(tptr + 6); - ND_PRINT((ndo, "\n\t R: %d, RTE: %d, ",tval >> 5, tval & 0x1f)); + ND_PRINT("\n\t R: %d, RTE: %d, ",tval >> 5, tval & 0x1f); tval=EXTRACT_U_1(tptr + 7); - ND_PRINT((ndo, "EVB Mode: %s [%d]", - tok2str(lldp_evb_mode_values, "unknown", tval >> 6), tval >> 6)); - ND_PRINT((ndo, "\n\t ROL: %d, RWD: %d, ", (tval >> 5) & 0x01, tval & 0x1f)); + ND_PRINT("EVB Mode: %s [%d]", + tok2str(lldp_evb_mode_values, "unknown", tval >> 6), tval >> 6); + ND_PRINT("\n\t ROL: %d, RWD: %d, ", (tval >> 5) & 0x01, tval & 0x1f); tval=EXTRACT_U_1(tptr + 8); - ND_PRINT((ndo, "RES: %d, ROL: %d, RKA: %d", tval >> 6, (tval >> 5) & 0x01, tval & 0x1f)); + ND_PRINT("RES: %d, ROL: %d, RKA: %d", tval >> 6, (tval >> 5) & 0x01, tval & 0x1f); break; case LLDP_PRIVATE_8021_SUBTYPE_CDCP: @@ -826,9 +826,9 @@ lldp_private_8021_print(netdissect_options *ndo, return hexdump; } tval=EXTRACT_U_1(tptr + 4); - ND_PRINT((ndo, "\n\t Role: %d, RES: %d, Scomp: %d ", - tval >> 7, (tval >> 4) & 0x07, (tval >> 3) & 0x01)); - ND_PRINT((ndo, "ChnCap: %d", EXTRACT_BE_U_2(tptr + 6) & 0x0fff)); + ND_PRINT("\n\t Role: %d, RES: %d, Scomp: %d ", + tval >> 7, (tval >> 4) & 0x07, (tval >> 3) & 0x01); + ND_PRINT("ChnCap: %d", EXTRACT_BE_U_2(tptr + 6) & 0x0fff); sublen=tlv_len-8; if(sublen%3!=0) { return hexdump; @@ -836,8 +836,8 @@ lldp_private_8021_print(netdissect_options *ndo, i=0; while(i<sublen) { tval=EXTRACT_BE_U_3(tptr + i + 8); - ND_PRINT((ndo, "\n\t SCID: %d, SVID: %d", - tval >> 12, tval & 0x000fff)); + ND_PRINT("\n\t SCID: %d, SVID: %d", + tval >> 12, tval & 0x000fff); i=i+3; } break; @@ -864,50 +864,50 @@ lldp_private_8023_print(netdissect_options *ndo, } subtype = EXTRACT_U_1(tptr + 3); - ND_PRINT((ndo, "\n\t %s Subtype (%u)", + ND_PRINT("\n\t %s Subtype (%u)", tok2str(lldp_8023_subtype_values, "unknown", subtype), - subtype)); + subtype); switch (subtype) { case LLDP_PRIVATE_8023_SUBTYPE_MACPHY: if (tlv_len < 9) { return hexdump; } - ND_PRINT((ndo, "\n\t autonegotiation [%s] (0x%02x)", + ND_PRINT("\n\t autonegotiation [%s] (0x%02x)", bittok2str(lldp_8023_autonegotiation_values, "none", EXTRACT_U_1(tptr + 4)), - EXTRACT_U_1(tptr + 4))); - ND_PRINT((ndo, "\n\t PMD autoneg capability [%s] (0x%04x)", + EXTRACT_U_1(tptr + 4)); + ND_PRINT("\n\t PMD autoneg capability [%s] (0x%04x)", bittok2str(lldp_pmd_capability_values,"unknown", EXTRACT_BE_U_2(tptr + 5)), - EXTRACT_BE_U_2(tptr + 5))); - ND_PRINT((ndo, "\n\t MAU type %s (0x%04x)", + EXTRACT_BE_U_2(tptr + 5)); + ND_PRINT("\n\t MAU type %s (0x%04x)", tok2str(lldp_mau_types_values, "unknown", EXTRACT_BE_U_2(tptr + 7)), - EXTRACT_BE_U_2(tptr + 7))); + EXTRACT_BE_U_2(tptr + 7)); break; case LLDP_PRIVATE_8023_SUBTYPE_MDIPOWER: if (tlv_len < 7) { return hexdump; } - ND_PRINT((ndo, "\n\t MDI power support [%s], power pair %s, power class %s", + ND_PRINT("\n\t MDI power support [%s], power pair %s, power class %s", bittok2str(lldp_mdi_values, "none", EXTRACT_U_1((tptr + 4))), tok2str(lldp_mdi_power_pairs_values, "unknown", EXTRACT_U_1((tptr + 5))), - tok2str(lldp_mdi_power_class_values, "unknown", EXTRACT_U_1((tptr + 6))))); + tok2str(lldp_mdi_power_class_values, "unknown", EXTRACT_U_1((tptr + 6)))); break; case LLDP_PRIVATE_8023_SUBTYPE_LINKAGGR: if (tlv_len < 9) { return hexdump; } - ND_PRINT((ndo, "\n\t aggregation status [%s], aggregation port ID %u", + ND_PRINT("\n\t aggregation status [%s], aggregation port ID %u", bittok2str(lldp_aggregation_values, "none", EXTRACT_U_1((tptr + 4))), - EXTRACT_BE_U_4(tptr + 5))); + EXTRACT_BE_U_4(tptr + 5)); break; case LLDP_PRIVATE_8023_SUBTYPE_MTU: if (tlv_len < 6) { return hexdump; } - ND_PRINT((ndo, "\n\t MTU size %u", EXTRACT_BE_U_2(tptr + 4))); + ND_PRINT("\n\t MTU size %u", EXTRACT_BE_U_2(tptr + 4)); break; default: @@ -948,13 +948,13 @@ lldp_private_iana_print(netdissect_options *ndo, } subtype = EXTRACT_U_1(tptr + 3); - ND_PRINT((ndo, "\n\t %s Subtype (%u)", + ND_PRINT("\n\t %s Subtype (%u)", tok2str(lldp_iana_subtype_values, "unknown", subtype), - subtype)); + subtype); switch (subtype) { case LLDP_IANA_SUBTYPE_MUDURL: - ND_PRINT((ndo, "\n\t MUD-URL=")); + ND_PRINT("\n\t MUD-URL="); (void)fn_printn(ndo, tptr+4, tlv_len-4, NULL); break; default: @@ -984,38 +984,38 @@ lldp_private_tia_print(netdissect_options *ndo, } subtype = EXTRACT_U_1(tptr + 3); - ND_PRINT((ndo, "\n\t %s Subtype (%u)", + ND_PRINT("\n\t %s Subtype (%u)", tok2str(lldp_tia_subtype_values, "unknown", subtype), - subtype)); + subtype); switch (subtype) { case LLDP_PRIVATE_TIA_SUBTYPE_CAPABILITIES: if (tlv_len < 7) { return hexdump; } - ND_PRINT((ndo, "\n\t Media capabilities [%s] (0x%04x)", + ND_PRINT("\n\t Media capabilities [%s] (0x%04x)", bittok2str(lldp_tia_capabilities_values, "none", - EXTRACT_BE_U_2(tptr + 4)), EXTRACT_BE_U_2(tptr + 4))); - ND_PRINT((ndo, "\n\t Device type [%s] (0x%02x)", + EXTRACT_BE_U_2(tptr + 4)), EXTRACT_BE_U_2(tptr + 4)); + ND_PRINT("\n\t Device type [%s] (0x%02x)", tok2str(lldp_tia_device_type_values, "unknown", EXTRACT_U_1(tptr + 6)), - EXTRACT_U_1(tptr + 6))); + EXTRACT_U_1(tptr + 6)); break; case LLDP_PRIVATE_TIA_SUBTYPE_NETWORK_POLICY: if (tlv_len < 8) { return hexdump; } - ND_PRINT((ndo, "\n\t Application type [%s] (0x%02x)", + ND_PRINT("\n\t Application type [%s] (0x%02x)", tok2str(lldp_tia_application_type_values, "none", EXTRACT_U_1(tptr + 4)), - EXTRACT_U_1(tptr + 4))); - ND_PRINT((ndo, ", Flags [%s]", bittok2str( - lldp_tia_network_policy_bits_values, "none", EXTRACT_U_1((tptr + 5))))); - ND_PRINT((ndo, "\n\t Vlan id %u", - LLDP_EXTRACT_NETWORK_POLICY_VLAN(EXTRACT_BE_U_2(tptr + 5)))); - ND_PRINT((ndo, ", L2 priority %u", - LLDP_EXTRACT_NETWORK_POLICY_L2_PRIORITY(EXTRACT_BE_U_2(tptr + 6)))); - ND_PRINT((ndo, ", DSCP value %u", - LLDP_EXTRACT_NETWORK_POLICY_DSCP(EXTRACT_BE_U_2(tptr + 6)))); + EXTRACT_U_1(tptr + 4)); + ND_PRINT(", Flags [%s]", bittok2str( + lldp_tia_network_policy_bits_values, "none", EXTRACT_U_1((tptr + 5)))); + ND_PRINT("\n\t Vlan id %u", + LLDP_EXTRACT_NETWORK_POLICY_VLAN(EXTRACT_BE_U_2(tptr + 5))); + ND_PRINT(", L2 priority %u", + LLDP_EXTRACT_NETWORK_POLICY_L2_PRIORITY(EXTRACT_BE_U_2(tptr + 6))); + ND_PRINT(", DSCP value %u", + LLDP_EXTRACT_NETWORK_POLICY_DSCP(EXTRACT_BE_U_2(tptr + 6))); break; case LLDP_PRIVATE_TIA_SUBTYPE_LOCAL_ID: @@ -1023,28 +1023,28 @@ lldp_private_tia_print(netdissect_options *ndo, return hexdump; } location_format = EXTRACT_U_1(tptr + 4); - ND_PRINT((ndo, "\n\t Location data format %s (0x%02x)", + ND_PRINT("\n\t Location data format %s (0x%02x)", tok2str(lldp_tia_location_data_format_values, "unknown", location_format), - location_format)); + location_format); switch (location_format) { case LLDP_TIA_LOCATION_DATA_FORMAT_COORDINATE_BASED: if (tlv_len < 21) { return hexdump; } - ND_PRINT((ndo, "\n\t Latitude resolution %u, latitude value %" PRIu64, - (EXTRACT_U_1(tptr + 5) >> 2), lldp_extract_latlon(tptr + 5))); - ND_PRINT((ndo, "\n\t Longitude resolution %u, longitude value %" PRIu64, - (EXTRACT_U_1(tptr + 10) >> 2), lldp_extract_latlon(tptr + 10))); - ND_PRINT((ndo, "\n\t Altitude type %s (%u)", + ND_PRINT("\n\t Latitude resolution %u, latitude value %" PRIu64, + (EXTRACT_U_1(tptr + 5) >> 2), lldp_extract_latlon(tptr + 5)); + ND_PRINT("\n\t Longitude resolution %u, longitude value %" PRIu64, + (EXTRACT_U_1(tptr + 10) >> 2), lldp_extract_latlon(tptr + 10)); + ND_PRINT("\n\t Altitude type %s (%u)", tok2str(lldp_tia_location_altitude_type_values, "unknown",EXTRACT_U_1(tptr + 15) >> 4), - (EXTRACT_U_1(tptr + 15) >> 4))); - ND_PRINT((ndo, "\n\t Altitude resolution %u, altitude value 0x%x", + (EXTRACT_U_1(tptr + 15) >> 4)); + ND_PRINT("\n\t Altitude resolution %u, altitude value 0x%x", (EXTRACT_BE_U_2(tptr + 15)>>6)&0x3f, - ((EXTRACT_BE_U_4(tptr + 16) & 0x3fffffff)))); - ND_PRINT((ndo, "\n\t Datum %s (0x%02x)", + ((EXTRACT_BE_U_4(tptr + 16) & 0x3fffffff))); + ND_PRINT("\n\t Datum %s (0x%02x)", tok2str(lldp_tia_location_datum_type_values, "unknown", EXTRACT_U_1(tptr + 20)), - EXTRACT_U_1(tptr + 20))); + EXTRACT_U_1(tptr + 20)); break; case LLDP_TIA_LOCATION_DATA_FORMAT_CIVIC_ADDRESS: @@ -1058,10 +1058,10 @@ lldp_private_tia_print(netdissect_options *ndo, if (tlv_len < 7+lci_len) { return hexdump; } - ND_PRINT((ndo, "\n\t LCI length %u, LCI what %s (0x%02x), Country-code ", + ND_PRINT("\n\t LCI length %u, LCI what %s (0x%02x), Country-code ", lci_len, tok2str(lldp_tia_location_lci_what_values, "unknown", EXTRACT_U_1(tptr + 6)), - EXTRACT_U_1(tptr + 6))); + EXTRACT_U_1(tptr + 6)); /* Country code */ safeputs(ndo, tptr + 7, 2); @@ -1080,9 +1080,9 @@ lldp_private_tia_print(netdissect_options *ndo, tptr += 2; lci_len -= 2; - ND_PRINT((ndo, "\n\t CA type \'%s\' (%u), length %u: ", + ND_PRINT("\n\t CA type \'%s\' (%u), length %u: ", tok2str(lldp_tia_location_lci_catype_values, "unknown", ca_type), - ca_type, ca_len)); + ca_type, ca_len); /* basic sanity check */ if ( ca_type == 0 || ca_len == 0) { @@ -1099,12 +1099,12 @@ lldp_private_tia_print(netdissect_options *ndo, break; case LLDP_TIA_LOCATION_DATA_FORMAT_ECS_ELIN: - ND_PRINT((ndo, "\n\t ECS ELIN id ")); + ND_PRINT("\n\t ECS ELIN id "); safeputs(ndo, tptr + 5, tlv_len - 5); break; default: - ND_PRINT((ndo, "\n\t Location ID ")); + ND_PRINT("\n\t Location ID "); print_unknown_data(ndo, tptr + 5, "\n\t ", tlv_len - 5); } break; @@ -1113,18 +1113,18 @@ lldp_private_tia_print(netdissect_options *ndo, if (tlv_len < 7) { return hexdump; } - ND_PRINT((ndo, "\n\t Power type [%s]", - (EXTRACT_U_1(tptr + 4) & 0xC0 >> 6) ? "PD device" : "PSE device")); - ND_PRINT((ndo, ", Power source [%s]", - tok2str(lldp_tia_power_source_values, "none", (EXTRACT_U_1((tptr + 4)) & 0x30) >> 4))); - ND_PRINT((ndo, "\n\t Power priority [%s] (0x%02x)", + ND_PRINT("\n\t Power type [%s]", + (EXTRACT_U_1(tptr + 4) & 0xC0 >> 6) ? "PD device" : "PSE device"); + ND_PRINT(", Power source [%s]", + tok2str(lldp_tia_power_source_values, "none", (EXTRACT_U_1((tptr + 4)) & 0x30) >> 4)); + ND_PRINT("\n\t Power priority [%s] (0x%02x)", tok2str(lldp_tia_power_priority_values, "none", EXTRACT_U_1(tptr + 4) & 0x0f), - EXTRACT_U_1(tptr + 4) & 0x0f)); + EXTRACT_U_1(tptr + 4) & 0x0f); power_val = EXTRACT_BE_U_2(tptr + 5); if (power_val < LLDP_TIA_POWER_VAL_MAX) { - ND_PRINT((ndo, ", Power %.1f Watts", ((float)power_val) / 10)); + ND_PRINT(", Power %.1f Watts", ((float)power_val) / 10); } else { - ND_PRINT((ndo, ", Power %u (Reserved)", power_val)); + ND_PRINT(", Power %u (Reserved)", power_val); } break; @@ -1135,8 +1135,8 @@ lldp_private_tia_print(netdissect_options *ndo, case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MANUFACTURER_NAME: case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MODEL_NAME: case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID: - ND_PRINT((ndo, "\n\t %s ", - tok2str(lldp_tia_inventory_values, "unknown", subtype))); + ND_PRINT("\n\t %s ", + tok2str(lldp_tia_inventory_values, "unknown", subtype)); safeputs(ndo, tptr + 4, tlv_len - 4); break; @@ -1167,9 +1167,9 @@ lldp_private_dcbx_print(netdissect_options *ndo, } subtype = EXTRACT_U_1(pptr + 3); - ND_PRINT((ndo, "\n\t %s Subtype (%u)", + ND_PRINT("\n\t %s Subtype (%u)", tok2str(lldp_dcbx_subtype_values, "unknown", subtype), - subtype)); + subtype); /* by passing old version */ if (subtype == LLDP_DCBX_SUBTYPE_1) @@ -1207,29 +1207,29 @@ lldp_private_dcbx_print(netdissect_options *ndo, if (tlv_len < 10) { goto trunc; } - ND_PRINT((ndo, "\n\t Control - Protocol Control (type 0x%x, length %d)", - LLDP_DCBX_CONTROL_TLV, tlv_len)); - ND_PRINT((ndo, "\n\t Oper_Version: %d", EXTRACT_U_1(tptr))); - ND_PRINT((ndo, "\n\t Max_Version: %d", EXTRACT_U_1(tptr + 1))); - ND_PRINT((ndo, "\n\t Sequence Number: %d", EXTRACT_BE_U_4(tptr + 2))); - ND_PRINT((ndo, "\n\t Acknowledgement Number: %d", - EXTRACT_BE_U_4(tptr + 6))); + ND_PRINT("\n\t Control - Protocol Control (type 0x%x, length %d)", + LLDP_DCBX_CONTROL_TLV, tlv_len); + ND_PRINT("\n\t Oper_Version: %d", EXTRACT_U_1(tptr)); + ND_PRINT("\n\t Max_Version: %d", EXTRACT_U_1(tptr + 1)); + ND_PRINT("\n\t Sequence Number: %d", EXTRACT_BE_U_4(tptr + 2)); + ND_PRINT("\n\t Acknowledgement Number: %d", + EXTRACT_BE_U_4(tptr + 6)); break; case LLDP_DCBX_PRIORITY_GROUPS_TLV: if (tlv_len < 17) { goto trunc; } - ND_PRINT((ndo, "\n\t Feature - Priority Group (type 0x%x, length %d)", - LLDP_DCBX_PRIORITY_GROUPS_TLV, tlv_len)); - ND_PRINT((ndo, "\n\t Oper_Version: %d", EXTRACT_U_1(tptr))); - ND_PRINT((ndo, "\n\t Max_Version: %d", EXTRACT_U_1(tptr + 1))); - ND_PRINT((ndo, "\n\t Info block(0x%02X): ", EXTRACT_U_1(tptr + 2))); + ND_PRINT("\n\t Feature - Priority Group (type 0x%x, length %d)", + LLDP_DCBX_PRIORITY_GROUPS_TLV, tlv_len); + ND_PRINT("\n\t Oper_Version: %d", EXTRACT_U_1(tptr)); + ND_PRINT("\n\t Max_Version: %d", EXTRACT_U_1(tptr + 1)); + ND_PRINT("\n\t Info block(0x%02X): ", EXTRACT_U_1(tptr + 2)); tval = EXTRACT_U_1(tptr + 2); - ND_PRINT((ndo, "Enable bit: %d, Willing bit: %d, Error Bit: %d", + ND_PRINT("Enable bit: %d, Willing bit: %d, Error Bit: %d", (tval & 0x80) ? 1 : 0, (tval & 0x40) ? 1 : 0, - (tval & 0x20) ? 1 : 0)); - ND_PRINT((ndo, "\n\t SubType: %d", EXTRACT_U_1(tptr + 3))); - ND_PRINT((ndo, "\n\t Priority Allocation")); + (tval & 0x20) ? 1 : 0); + ND_PRINT("\n\t SubType: %d", EXTRACT_U_1(tptr + 3)); + ND_PRINT("\n\t Priority Allocation"); /* * Array of 8 4-bit priority group ID values; we fetch all @@ -1237,62 +1237,62 @@ lldp_private_dcbx_print(netdissect_options *ndo, */ pgval = EXTRACT_BE_U_4(tptr + 4); for (i = 0; i <= 7; i++) { - ND_PRINT((ndo, "\n\t PgId_%d: %d", - i, (pgval >> (28 - 4 * i)) & 0xF)); + ND_PRINT("\n\t PgId_%d: %d", + i, (pgval >> (28 - 4 * i)) & 0xF); } - ND_PRINT((ndo, "\n\t Priority Group Allocation")); + ND_PRINT("\n\t Priority Group Allocation"); for (i = 0; i <= 7; i++) - ND_PRINT((ndo, "\n\t Pg percentage[%d]: %d", i, EXTRACT_U_1(tptr + 8 + i))); - ND_PRINT((ndo, "\n\t NumTCsSupported: %d", EXTRACT_U_1(tptr + 8 + 8))); + ND_PRINT("\n\t Pg percentage[%d]: %d", i, EXTRACT_U_1(tptr + 8 + i)); + ND_PRINT("\n\t NumTCsSupported: %d", EXTRACT_U_1(tptr + 8 + 8)); break; case LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV: if (tlv_len < 6) { goto trunc; } - ND_PRINT((ndo, "\n\t Feature - Priority Flow Control")); - ND_PRINT((ndo, " (type 0x%x, length %d)", - LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV, tlv_len)); - ND_PRINT((ndo, "\n\t Oper_Version: %d", EXTRACT_U_1(tptr))); - ND_PRINT((ndo, "\n\t Max_Version: %d", EXTRACT_U_1(tptr + 1))); - ND_PRINT((ndo, "\n\t Info block(0x%02X): ", EXTRACT_U_1(tptr + 2))); + ND_PRINT("\n\t Feature - Priority Flow Control"); + ND_PRINT(" (type 0x%x, length %d)", + LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV, tlv_len); + ND_PRINT("\n\t Oper_Version: %d", EXTRACT_U_1(tptr)); + ND_PRINT("\n\t Max_Version: %d", EXTRACT_U_1(tptr + 1)); + ND_PRINT("\n\t Info block(0x%02X): ", EXTRACT_U_1(tptr + 2)); tval = EXTRACT_U_1(tptr + 2); - ND_PRINT((ndo, "Enable bit: %d, Willing bit: %d, Error Bit: %d", + ND_PRINT("Enable bit: %d, Willing bit: %d, Error Bit: %d", (tval & 0x80) ? 1 : 0, (tval & 0x40) ? 1 : 0, - (tval & 0x20) ? 1 : 0)); - ND_PRINT((ndo, "\n\t SubType: %d", EXTRACT_U_1(tptr + 3))); + (tval & 0x20) ? 1 : 0); + ND_PRINT("\n\t SubType: %d", EXTRACT_U_1(tptr + 3)); tval = EXTRACT_U_1(tptr + 4); - ND_PRINT((ndo, "\n\t PFC Config (0x%02X)", EXTRACT_U_1(tptr + 4))); + ND_PRINT("\n\t PFC Config (0x%02X)", EXTRACT_U_1(tptr + 4)); for (i = 0; i <= 7; i++) - ND_PRINT((ndo, "\n\t Priority Bit %d: %s", - i, (tval & (1 << i)) ? "Enabled" : "Disabled")); - ND_PRINT((ndo, "\n\t NumTCPFCSupported: %d", EXTRACT_U_1(tptr + 5))); + ND_PRINT("\n\t Priority Bit %d: %s", + i, (tval & (1 << i)) ? "Enabled" : "Disabled"); + ND_PRINT("\n\t NumTCPFCSupported: %d", EXTRACT_U_1(tptr + 5)); break; case LLDP_DCBX_APPLICATION_TLV: if (tlv_len < 4) { goto trunc; } - ND_PRINT((ndo, "\n\t Feature - Application (type 0x%x, length %d)", - LLDP_DCBX_APPLICATION_TLV, tlv_len)); - ND_PRINT((ndo, "\n\t Oper_Version: %d", EXTRACT_U_1(tptr))); - ND_PRINT((ndo, "\n\t Max_Version: %d", EXTRACT_U_1(tptr + 1))); - ND_PRINT((ndo, "\n\t Info block(0x%02X): ", EXTRACT_U_1(tptr + 2))); + ND_PRINT("\n\t Feature - Application (type 0x%x, length %d)", + LLDP_DCBX_APPLICATION_TLV, tlv_len); + ND_PRINT("\n\t Oper_Version: %d", EXTRACT_U_1(tptr)); + ND_PRINT("\n\t Max_Version: %d", EXTRACT_U_1(tptr + 1)); + ND_PRINT("\n\t Info block(0x%02X): ", EXTRACT_U_1(tptr + 2)); tval = EXTRACT_U_1(tptr + 2); - ND_PRINT((ndo, "Enable bit: %d, Willing bit: %d, Error Bit: %d", + ND_PRINT("Enable bit: %d, Willing bit: %d, Error Bit: %d", (tval & 0x80) ? 1 : 0, (tval & 0x40) ? 1 : 0, - (tval & 0x20) ? 1 : 0)); - ND_PRINT((ndo, "\n\t SubType: %d", EXTRACT_U_1(tptr + 3))); + (tval & 0x20) ? 1 : 0); + ND_PRINT("\n\t SubType: %d", EXTRACT_U_1(tptr + 3)); tval = tlv_len - 4; mptr = tptr + 4; while (tval >= 6) { - ND_PRINT((ndo, "\n\t Application Value")); - ND_PRINT((ndo, "\n\t Application Protocol ID: 0x%04x", - EXTRACT_BE_U_2(mptr))); + ND_PRINT("\n\t Application Value"); + ND_PRINT("\n\t Application Protocol ID: 0x%04x", + EXTRACT_BE_U_2(mptr)); uval = EXTRACT_BE_U_3(mptr + 2); - ND_PRINT((ndo, "\n\t SF (0x%x) Application Protocol ID is %s", + ND_PRINT("\n\t SF (0x%x) Application Protocol ID is %s", (uval >> 22), - (uval >> 22) ? "Socket Number" : "L2 EtherType")); - ND_PRINT((ndo, "\n\t OUI: 0x%06x", uval & 0x3fffff)); - ND_PRINT((ndo, "\n\t User Priority Map: 0x%02x", EXTRACT_U_1(mptr + 5))); + (uval >> 22) ? "Socket Number" : "L2 EtherType"); + ND_PRINT("\n\t OUI: 0x%06x", uval & 0x3fffff); + ND_PRINT("\n\t User Priority Map: 0x%02x", EXTRACT_U_1(mptr + 5)); tval = tval - 6; mptr = mptr + 6; } @@ -1387,8 +1387,8 @@ lldp_mgmt_addr_tlv_print(netdissect_options *ndo, if (mgmt_addr == NULL) { return 0; } - ND_PRINT((ndo, "\n\t Management Address length %u, %s", - mgmt_addr_len, mgmt_addr)); + ND_PRINT("\n\t Management Address length %u, %s", + mgmt_addr_len, mgmt_addr); tptr += mgmt_addr_len; tlen -= mgmt_addr_len; @@ -1397,10 +1397,10 @@ lldp_mgmt_addr_tlv_print(netdissect_options *ndo, } intf_num_subtype = EXTRACT_U_1(tptr); - ND_PRINT((ndo, "\n\t %s Interface Numbering (%u): %u", + ND_PRINT("\n\t %s Interface Numbering (%u): %u", tok2str(lldp_intf_numb_subtype_values, "Unknown", intf_num_subtype), intf_num_subtype, - EXTRACT_BE_U_4(tptr + 1))); + EXTRACT_BE_U_4(tptr + 1)); tptr += LLDP_INTF_NUM_LEN; tlen -= LLDP_INTF_NUM_LEN; @@ -1415,7 +1415,7 @@ lldp_mgmt_addr_tlv_print(netdissect_options *ndo, return 0; } if (oid_len) { - ND_PRINT((ndo, "\n\t OID length %u", oid_len)); + ND_PRINT("\n\t OID length %u", oid_len); safeputs(ndo, tptr + 1, oid_len); } } @@ -1436,7 +1436,7 @@ lldp_print(netdissect_options *ndo, tptr = pptr; tlen = len; - ND_PRINT((ndo, "LLDP, length %u", len)); + ND_PRINT("LLDP, length %u", len); while (tlen >= sizeof(tlv)) { @@ -1452,9 +1452,9 @@ lldp_print(netdissect_options *ndo, tptr += sizeof(tlv); if (ndo->ndo_vflag) { - ND_PRINT((ndo, "\n\t%s TLV (%u), length %u", + ND_PRINT("\n\t%s TLV (%u), length %u", tok2str(lldp_tlv_values, "Unknown", tlv_type), - tlv_type, tlv_len)); + tlv_type, tlv_len); } /* infinite loop check */ @@ -1475,16 +1475,16 @@ lldp_print(netdissect_options *ndo, goto trunc; } subtype = EXTRACT_U_1(tptr); - ND_PRINT((ndo, "\n\t Subtype %s (%u): ", + ND_PRINT("\n\t Subtype %s (%u): ", tok2str(lldp_chassis_subtype_values, "Unknown", subtype), - subtype)); + subtype); switch (subtype) { case LLDP_CHASSIS_MAC_ADDR_SUBTYPE: if (tlv_len < 1+6) { goto trunc; } - ND_PRINT((ndo, "%s", etheraddr_string(ndo, tptr + 1))); + ND_PRINT("%s", etheraddr_string(ndo, tptr + 1)); break; case LLDP_CHASSIS_INTF_NAME_SUBTYPE: /* fall through */ @@ -1500,7 +1500,7 @@ lldp_print(netdissect_options *ndo, if (network_addr == NULL) { goto trunc; } - ND_PRINT((ndo, "%s", network_addr)); + ND_PRINT("%s", network_addr); break; default: @@ -1516,16 +1516,16 @@ lldp_print(netdissect_options *ndo, goto trunc; } subtype = EXTRACT_U_1(tptr); - ND_PRINT((ndo, "\n\t Subtype %s (%u): ", + ND_PRINT("\n\t Subtype %s (%u): ", tok2str(lldp_port_subtype_values, "Unknown", subtype), - subtype)); + subtype); switch (subtype) { case LLDP_PORT_MAC_ADDR_SUBTYPE: if (tlv_len < 1+6) { goto trunc; } - ND_PRINT((ndo, "%s", etheraddr_string(ndo, tptr + 1))); + ND_PRINT("%s", etheraddr_string(ndo, tptr + 1)); break; case LLDP_PORT_INTF_NAME_SUBTYPE: /* fall through */ @@ -1541,7 +1541,7 @@ lldp_print(netdissect_options *ndo, if (network_addr == NULL) { goto trunc; } - ND_PRINT((ndo, "%s", network_addr)); + ND_PRINT("%s", network_addr); break; default: @@ -1556,13 +1556,13 @@ lldp_print(netdissect_options *ndo, if (tlv_len < 2) { goto trunc; } - ND_PRINT((ndo, ": TTL %us", EXTRACT_BE_U_2(tptr))); + ND_PRINT(": TTL %us", EXTRACT_BE_U_2(tptr)); } break; case LLDP_PORT_DESCR_TLV: if (ndo->ndo_vflag) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); safeputs(ndo, tptr, tlv_len); } break; @@ -1572,13 +1572,13 @@ lldp_print(netdissect_options *ndo, * The system name is also print in non-verbose mode * similar to the CDP printer. */ - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); safeputs(ndo, tptr, tlv_len); break; case LLDP_SYSTEM_DESCR_TLV: if (ndo->ndo_vflag) { - ND_PRINT((ndo, "\n\t ")); + ND_PRINT("\n\t "); safeputs(ndo, tptr, tlv_len); } break; @@ -1596,10 +1596,10 @@ lldp_print(netdissect_options *ndo, } cap = EXTRACT_BE_U_2(tptr); ena_cap = EXTRACT_BE_U_2(tptr + 2); - ND_PRINT((ndo, "\n\t System Capabilities [%s] (0x%04x)", - bittok2str(lldp_cap_values, "none", cap), cap)); - ND_PRINT((ndo, "\n\t Enabled Capabilities [%s] (0x%04x)", - bittok2str(lldp_cap_values, "none", ena_cap), ena_cap)); + ND_PRINT("\n\t System Capabilities [%s] (0x%04x)", + bittok2str(lldp_cap_values, "none", cap), cap); + ND_PRINT("\n\t Enabled Capabilities [%s] (0x%04x)", + bittok2str(lldp_cap_values, "none", ena_cap), ena_cap); } break; @@ -1617,7 +1617,7 @@ lldp_print(netdissect_options *ndo, goto trunc; } oui = EXTRACT_BE_U_3(tptr); - ND_PRINT((ndo, ": OUI %s (0x%06x)", tok2str(oui_values, "Unknown", oui), oui)); + ND_PRINT(": OUI %s (0x%06x)", tok2str(oui_values, "Unknown", oui), oui); switch (oui) { case OUI_IEEE_8021_PRIVATE: @@ -1657,7 +1657,7 @@ lldp_print(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "\n\t[|LLDP]")); + ND_PRINT("\n\t[|LLDP]"); } /* diff --git a/print-lmp.c b/print-lmp.c index d32b1a77..ff3fd9d9 100644 --- a/print-lmp.c +++ b/print-lmp.c @@ -369,46 +369,46 @@ lmp_print_data_link_subobjs(netdissect_options *ndo, const u_char *obj_tptr, while (total_subobj_len > 0 && hexdump == FALSE ) { subobj_type = EXTRACT_U_1(obj_tptr + offset); subobj_len = EXTRACT_U_1(obj_tptr + offset + 1); - ND_PRINT((ndo, "\n\t Subobject, Type: %s (%u), Length: %u", + ND_PRINT("\n\t Subobject, Type: %s (%u), Length: %u", tok2str(lmp_data_link_subobj, "Unknown", subobj_type), subobj_type, - subobj_len)); + subobj_len); if (subobj_len < 4) { - ND_PRINT((ndo, " (too short)")); + ND_PRINT(" (too short)"); break; } if ((subobj_len % 4) != 0) { - ND_PRINT((ndo, " (not a multiple of 4)")); + ND_PRINT(" (not a multiple of 4)"); break; } if (total_subobj_len < subobj_len) { - ND_PRINT((ndo, " (goes past the end of the object)")); + ND_PRINT(" (goes past the end of the object)"); break; } switch(subobj_type) { case INT_SWITCHING_TYPE_SUBOBJ: - ND_PRINT((ndo, "\n\t Switching Type: %s (%u)", + ND_PRINT("\n\t Switching Type: %s (%u)", tok2str(gmpls_switch_cap_values, "Unknown", EXTRACT_U_1(obj_tptr + offset + 2)), - EXTRACT_U_1(obj_tptr + offset + 2))); - ND_PRINT((ndo, "\n\t Encoding Type: %s (%u)", + EXTRACT_U_1(obj_tptr + offset + 2)); + ND_PRINT("\n\t Encoding Type: %s (%u)", tok2str(gmpls_encoding_values, "Unknown", EXTRACT_U_1(obj_tptr + offset + 3)), - EXTRACT_U_1(obj_tptr + offset + 3))); + EXTRACT_U_1(obj_tptr + offset + 3)); bw.i = EXTRACT_BE_U_4(obj_tptr + offset + 4); - ND_PRINT((ndo, "\n\t Min Reservable Bandwidth: %.3f Mbps", - bw.f*8/1000000)); + ND_PRINT("\n\t Min Reservable Bandwidth: %.3f Mbps", + bw.f*8/1000000); bw.i = EXTRACT_BE_U_4(obj_tptr + offset + 8); - ND_PRINT((ndo, "\n\t Max Reservable Bandwidth: %.3f Mbps", - bw.f*8/1000000)); + ND_PRINT("\n\t Max Reservable Bandwidth: %.3f Mbps", + bw.f*8/1000000); break; case WAVELENGTH_SUBOBJ: - ND_PRINT((ndo, "\n\t Wavelength: %u", - EXTRACT_BE_U_4(obj_tptr + offset + 4))); + ND_PRINT("\n\t Wavelength: %u", + EXTRACT_BE_U_4(obj_tptr + offset + 4)); break; default: /* Any Unknown Subobject ==> Exit loop */ @@ -448,17 +448,17 @@ lmp_print(netdissect_options *ndo, * Sanity checking of the header. */ if (LMP_EXTRACT_VERSION(version_res) != LMP_VERSION) { - ND_PRINT((ndo, "LMP version %u packet not supported", - LMP_EXTRACT_VERSION(version_res))); + ND_PRINT("LMP version %u packet not supported", + LMP_EXTRACT_VERSION(version_res)); return; } /* in non-verbose mode just lets print the basic Message Type*/ if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "LMPv%u %s Message, length: %u", + ND_PRINT("LMPv%u %s Message, length: %u", LMP_EXTRACT_VERSION(version_res), tok2str(lmp_msg_type_values, "unknown (%u)",EXTRACT_U_1(lmp_com_header->msg_type)), - len)); + len); return; } @@ -466,17 +466,17 @@ lmp_print(netdissect_options *ndo, tlen=EXTRACT_BE_U_2(lmp_com_header->length); - ND_PRINT((ndo, "\n\tLMPv%u, msg-type: %s, Flags: [%s], length: %u", + ND_PRINT("\n\tLMPv%u, msg-type: %s, Flags: [%s], length: %u", LMP_EXTRACT_VERSION(version_res), tok2str(lmp_msg_type_values, "unknown, type: %u",EXTRACT_U_1(lmp_com_header->msg_type)), bittok2str(lmp_header_flag_values,"none",EXTRACT_U_1(lmp_com_header->flags)), - tlen)); + tlen); if (tlen < sizeof(struct lmp_common_header)) { - ND_PRINT((ndo, " (too short)")); + ND_PRINT(" (too short)"); return; } if (tlen > len) { - ND_PRINT((ndo, " (too long)")); + ND_PRINT(" (too long)"); tlen = len; } @@ -491,7 +491,7 @@ lmp_print(netdissect_options *ndo, lmp_obj_len=EXTRACT_BE_U_2(lmp_obj_header->length); lmp_obj_ctype=EXTRACT_U_1(lmp_obj_header->ctype)&0x7f; - ND_PRINT((ndo, "\n\t %s Object (%u), Class-Type: %s (%u) Flags: [%snegotiable], length: %u", + ND_PRINT("\n\t %s Object (%u), Class-Type: %s (%u) Flags: [%snegotiable], length: %u", tok2str(lmp_obj_values, "Unknown", EXTRACT_U_1(lmp_obj_header->class_num)), @@ -501,14 +501,14 @@ lmp_print(netdissect_options *ndo, (EXTRACT_U_1(lmp_obj_header->class_num)<<8)+lmp_obj_ctype), lmp_obj_ctype, EXTRACT_U_1(lmp_obj_header->ctype)&0x80 ? "" : "non-", - lmp_obj_len)); + lmp_obj_len); if (lmp_obj_len < 4) { - ND_PRINT((ndo, " (too short)")); + ND_PRINT(" (too short)"); return; } if ((lmp_obj_len % 4) != 0) { - ND_PRINT((ndo, " (not a multiple of 4)")); + ND_PRINT(" (not a multiple of 4)"); return; } @@ -526,12 +526,12 @@ lmp_print(netdissect_options *ndo, case LMP_CTYPE_LOC: case LMP_CTYPE_RMT: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Control Channel ID: %u (0x%08x)", + ND_PRINT("\n\t Control Channel ID: %u (0x%08x)", EXTRACT_BE_U_4(obj_tptr), - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); break; default: @@ -545,32 +545,32 @@ lmp_print(netdissect_options *ndo, case LMP_CTYPE_IPV4_LOC: case LMP_CTYPE_IPV4_RMT: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t IPv4 Link ID: %s (0x%08x)", + ND_PRINT("\n\t IPv4 Link ID: %s (0x%08x)", ipaddr_string(ndo, obj_tptr), - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); break; case LMP_CTYPE_IPV6_LOC: case LMP_CTYPE_IPV6_RMT: if (obj_tlen != 16) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t IPv6 Link ID: %s (0x%08x)", + ND_PRINT("\n\t IPv6 Link ID: %s (0x%08x)", ip6addr_string(ndo, obj_tptr), - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); break; case LMP_CTYPE_UNMD_LOC: case LMP_CTYPE_UNMD_RMT: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Link ID: %u (0x%08x)", + ND_PRINT("\n\t Link ID: %u (0x%08x)", EXTRACT_BE_U_4(obj_tptr), - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); break; default: hexdump=TRUE; @@ -581,21 +581,21 @@ lmp_print(netdissect_options *ndo, switch(lmp_obj_ctype) { case LMP_CTYPE_1: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Message ID: %u (0x%08x)", + ND_PRINT("\n\t Message ID: %u (0x%08x)", EXTRACT_BE_U_4(obj_tptr), - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); break; case LMP_CTYPE_2: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Message ID Ack: %u (0x%08x)", + ND_PRINT("\n\t Message ID Ack: %u (0x%08x)", EXTRACT_BE_U_4(obj_tptr), - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); break; default: hexdump=TRUE; @@ -607,12 +607,12 @@ lmp_print(netdissect_options *ndo, case LMP_CTYPE_LOC: case LMP_CTYPE_RMT: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Node ID: %s (0x%08x)", + ND_PRINT("\n\t Node ID: %s (0x%08x)", ipaddr_string(ndo, obj_tptr), - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); break; default: @@ -624,12 +624,12 @@ lmp_print(netdissect_options *ndo, switch(lmp_obj_ctype) { case LMP_CTYPE_HELLO_CONFIG: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Hello Interval: %u\n\t Hello Dead Interval: %u", + ND_PRINT("\n\t Hello Interval: %u\n\t Hello Dead Interval: %u", EXTRACT_BE_U_2(obj_tptr), - EXTRACT_BE_U_2(obj_tptr + 2))); + EXTRACT_BE_U_2(obj_tptr + 2)); break; default: @@ -641,12 +641,12 @@ lmp_print(netdissect_options *ndo, switch(lmp_obj_ctype) { case LMP_CTYPE_HELLO: if (obj_tlen != 8) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Tx Seq: %u, Rx Seq: %u", + ND_PRINT("\n\t Tx Seq: %u, Rx Seq: %u", EXTRACT_BE_U_4(obj_tptr), - EXTRACT_BE_U_4(obj_tptr + 4))); + EXTRACT_BE_U_4(obj_tptr + 4)); break; default: @@ -658,56 +658,56 @@ lmp_print(netdissect_options *ndo, switch(lmp_obj_ctype) { case LMP_CTYPE_IPV4: if (obj_tlen != 12) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Flags: [%s]", + ND_PRINT("\n\t Flags: [%s]", bittok2str(lmp_obj_te_link_flag_values, "none", - EXTRACT_U_1(obj_tptr)))); + EXTRACT_U_1(obj_tptr))); - ND_PRINT((ndo, "\n\t Local Link-ID: %s (0x%08x)" + ND_PRINT("\n\t Local Link-ID: %s (0x%08x)" "\n\t Remote Link-ID: %s (0x%08x)", ipaddr_string(ndo, obj_tptr+4), EXTRACT_BE_U_4(obj_tptr + 4), ipaddr_string(ndo, obj_tptr+8), - EXTRACT_BE_U_4(obj_tptr + 8))); + EXTRACT_BE_U_4(obj_tptr + 8)); break; case LMP_CTYPE_IPV6: if (obj_tlen != 36) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Flags: [%s]", + ND_PRINT("\n\t Flags: [%s]", bittok2str(lmp_obj_te_link_flag_values, "none", - EXTRACT_U_1(obj_tptr)))); + EXTRACT_U_1(obj_tptr))); - ND_PRINT((ndo, "\n\t Local Link-ID: %s (0x%08x)" + ND_PRINT("\n\t Local Link-ID: %s (0x%08x)" "\n\t Remote Link-ID: %s (0x%08x)", ip6addr_string(ndo, obj_tptr+4), EXTRACT_BE_U_4(obj_tptr + 4), ip6addr_string(ndo, obj_tptr+20), - EXTRACT_BE_U_4(obj_tptr + 20))); + EXTRACT_BE_U_4(obj_tptr + 20)); break; case LMP_CTYPE_UNMD: if (obj_tlen != 12) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Flags: [%s]", + ND_PRINT("\n\t Flags: [%s]", bittok2str(lmp_obj_te_link_flag_values, "none", - EXTRACT_U_1(obj_tptr)))); + EXTRACT_U_1(obj_tptr))); - ND_PRINT((ndo, "\n\t Local Link-ID: %u (0x%08x)" + ND_PRINT("\n\t Local Link-ID: %u (0x%08x)" "\n\t Remote Link-ID: %u (0x%08x)", EXTRACT_BE_U_4(obj_tptr + 4), EXTRACT_BE_U_4(obj_tptr + 4), EXTRACT_BE_U_4(obj_tptr + 8), - EXTRACT_BE_U_4(obj_tptr + 8))); + EXTRACT_BE_U_4(obj_tptr + 8)); break; default: @@ -719,19 +719,19 @@ lmp_print(netdissect_options *ndo, switch(lmp_obj_ctype) { case LMP_CTYPE_IPV4: if (obj_tlen < 12) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Flags: [%s]", + ND_PRINT("\n\t Flags: [%s]", bittok2str(lmp_obj_data_link_flag_values, "none", - EXTRACT_U_1(obj_tptr)))); - ND_PRINT((ndo, "\n\t Local Interface ID: %s (0x%08x)" + EXTRACT_U_1(obj_tptr))); + ND_PRINT("\n\t Local Interface ID: %s (0x%08x)" "\n\t Remote Interface ID: %s (0x%08x)", ipaddr_string(ndo, obj_tptr+4), EXTRACT_BE_U_4(obj_tptr + 4), ipaddr_string(ndo, obj_tptr+8), - EXTRACT_BE_U_4(obj_tptr + 8))); + EXTRACT_BE_U_4(obj_tptr + 8)); if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12)) hexdump=TRUE; @@ -739,19 +739,19 @@ lmp_print(netdissect_options *ndo, case LMP_CTYPE_IPV6: if (obj_tlen < 36) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Flags: [%s]", + ND_PRINT("\n\t Flags: [%s]", bittok2str(lmp_obj_data_link_flag_values, "none", - EXTRACT_U_1(obj_tptr)))); - ND_PRINT((ndo, "\n\t Local Interface ID: %s (0x%08x)" + EXTRACT_U_1(obj_tptr))); + ND_PRINT("\n\t Local Interface ID: %s (0x%08x)" "\n\t Remote Interface ID: %s (0x%08x)", ip6addr_string(ndo, obj_tptr+4), EXTRACT_BE_U_4(obj_tptr + 4), ip6addr_string(ndo, obj_tptr+20), - EXTRACT_BE_U_4(obj_tptr + 20))); + EXTRACT_BE_U_4(obj_tptr + 20)); if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 36, 36)) hexdump=TRUE; @@ -759,19 +759,19 @@ lmp_print(netdissect_options *ndo, case LMP_CTYPE_UNMD: if (obj_tlen < 12) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Flags: [%s]", + ND_PRINT("\n\t Flags: [%s]", bittok2str(lmp_obj_data_link_flag_values, "none", - EXTRACT_U_1(obj_tptr)))); - ND_PRINT((ndo, "\n\t Local Interface ID: %u (0x%08x)" + EXTRACT_U_1(obj_tptr))); + ND_PRINT("\n\t Local Interface ID: %u (0x%08x)" "\n\t Remote Interface ID: %u (0x%08x)", EXTRACT_BE_U_4(obj_tptr + 4), EXTRACT_BE_U_4(obj_tptr + 4), EXTRACT_BE_U_4(obj_tptr + 8), - EXTRACT_BE_U_4(obj_tptr + 8))); + EXTRACT_BE_U_4(obj_tptr + 8)); if (lmp_print_data_link_subobjs(ndo, obj_tptr, obj_tlen - 12, 12)) hexdump=TRUE; @@ -786,27 +786,27 @@ lmp_print(netdissect_options *ndo, switch(lmp_obj_ctype) { case LMP_CTYPE_1: if (obj_tlen != 20) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Flags: %s", + ND_PRINT("\n\t Flags: %s", bittok2str(lmp_obj_begin_verify_flag_values, "none", - EXTRACT_BE_U_2(obj_tptr)))); - ND_PRINT((ndo, "\n\t Verify Interval: %u", - EXTRACT_BE_U_2(obj_tptr + 2))); - ND_PRINT((ndo, "\n\t Data links: %u", - EXTRACT_BE_U_4(obj_tptr + 4))); - ND_PRINT((ndo, "\n\t Encoding type: %s", - tok2str(gmpls_encoding_values, "Unknown", EXTRACT_U_1((obj_tptr + 8))))); - ND_PRINT((ndo, "\n\t Verify Transport Mechanism: %u (0x%x)%s", + EXTRACT_BE_U_2(obj_tptr))); + ND_PRINT("\n\t Verify Interval: %u", + EXTRACT_BE_U_2(obj_tptr + 2)); + ND_PRINT("\n\t Data links: %u", + EXTRACT_BE_U_4(obj_tptr + 4)); + ND_PRINT("\n\t Encoding type: %s", + tok2str(gmpls_encoding_values, "Unknown", EXTRACT_U_1((obj_tptr + 8)))); + ND_PRINT("\n\t Verify Transport Mechanism: %u (0x%x)%s", EXTRACT_BE_U_2(obj_tptr + 10), EXTRACT_BE_U_2(obj_tptr + 10), - EXTRACT_BE_U_2(obj_tptr + 10)&8000 ? " (Payload test messages capable)" : "")); + EXTRACT_BE_U_2(obj_tptr + 10)&8000 ? " (Payload test messages capable)" : ""); bw.i = EXTRACT_BE_U_4(obj_tptr + 12); - ND_PRINT((ndo, "\n\t Transmission Rate: %.3f Mbps",bw.f*8/1000000)); - ND_PRINT((ndo, "\n\t Wavelength: %u", - EXTRACT_BE_U_4(obj_tptr + 16))); + ND_PRINT("\n\t Transmission Rate: %.3f Mbps",bw.f*8/1000000); + ND_PRINT("\n\t Wavelength: %u", + EXTRACT_BE_U_4(obj_tptr + 16)); break; default: @@ -818,13 +818,13 @@ lmp_print(netdissect_options *ndo, switch(lmp_obj_ctype) { case LMP_CTYPE_1: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Verify Dead Interval: %u" + ND_PRINT("\n\t Verify Dead Interval: %u" "\n\t Verify Transport Response: %u", EXTRACT_BE_U_2(obj_tptr), - EXTRACT_BE_U_2(obj_tptr + 2))); + EXTRACT_BE_U_2(obj_tptr + 2)); break; default: @@ -836,11 +836,11 @@ lmp_print(netdissect_options *ndo, switch(lmp_obj_ctype) { case LMP_CTYPE_1: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Verify ID: %u", - EXTRACT_BE_U_4(obj_tptr))); + ND_PRINT("\n\t Verify ID: %u", + EXTRACT_BE_U_4(obj_tptr)); break; default: @@ -854,25 +854,25 @@ lmp_print(netdissect_options *ndo, offset = 0; /* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */ while (offset+8 <= obj_tlen) { - ND_PRINT((ndo, "\n\t Interface ID: %s (0x%08x)", + ND_PRINT("\n\t Interface ID: %s (0x%08x)", ipaddr_string(ndo, obj_tptr+offset), - EXTRACT_BE_U_4(obj_tptr + offset))); + EXTRACT_BE_U_4(obj_tptr + offset)); - ND_PRINT((ndo, "\n\t\t Active: %s (%u)", + ND_PRINT("\n\t\t Active: %s (%u)", (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31) ? "Allocated" : "Non-allocated", - (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31))); + (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31)); - ND_PRINT((ndo, "\n\t\t Direction: %s (%u)", + ND_PRINT("\n\t\t Direction: %s (%u)", (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ? "Transmit" : "Receive", - (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1)); + (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1); - ND_PRINT((ndo, "\n\t\t Channel Status: %s (%u)", + ND_PRINT("\n\t\t Channel Status: %s (%u)", tok2str(lmp_obj_channel_status_values, "Unknown", EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF), - EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF)); + EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF); offset+=8; } break; @@ -881,25 +881,25 @@ lmp_print(netdissect_options *ndo, offset = 0; /* Decode pairs: <Interface_ID (16 bytes), Channel_status (4 bytes)> */ while (offset+20 <= obj_tlen) { - ND_PRINT((ndo, "\n\t Interface ID: %s (0x%08x)", + ND_PRINT("\n\t Interface ID: %s (0x%08x)", ip6addr_string(ndo, obj_tptr+offset), - EXTRACT_BE_U_4(obj_tptr + offset))); + EXTRACT_BE_U_4(obj_tptr + offset)); - ND_PRINT((ndo, "\n\t\t Active: %s (%u)", + ND_PRINT("\n\t\t Active: %s (%u)", (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>31) ? "Allocated" : "Non-allocated", - (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>31))); + (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>31)); - ND_PRINT((ndo, "\n\t\t Direction: %s (%u)", + ND_PRINT("\n\t\t Direction: %s (%u)", (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>30)&0x1 ? "Transmit" : "Receive", - (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>30)&0x1)); + (EXTRACT_BE_U_4(obj_tptr + offset + 16)>>30)&0x1); - ND_PRINT((ndo, "\n\t\t Channel Status: %s (%u)", + ND_PRINT("\n\t\t Channel Status: %s (%u)", tok2str(lmp_obj_channel_status_values, "Unknown", EXTRACT_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF), - EXTRACT_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF)); + EXTRACT_BE_U_4(obj_tptr + offset + 16)&0x3FFFFFF); offset+=20; } break; @@ -908,25 +908,25 @@ lmp_print(netdissect_options *ndo, offset = 0; /* Decode pairs: <Interface_ID (4 bytes), Channel_status (4 bytes)> */ while (offset+8 <= obj_tlen) { - ND_PRINT((ndo, "\n\t Interface ID: %u (0x%08x)", + ND_PRINT("\n\t Interface ID: %u (0x%08x)", EXTRACT_BE_U_4(obj_tptr + offset), - EXTRACT_BE_U_4(obj_tptr + offset))); + EXTRACT_BE_U_4(obj_tptr + offset)); - ND_PRINT((ndo, "\n\t\t Active: %s (%u)", + ND_PRINT("\n\t\t Active: %s (%u)", (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31) ? "Allocated" : "Non-allocated", - (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31))); + (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>31)); - ND_PRINT((ndo, "\n\t\t Direction: %s (%u)", + ND_PRINT("\n\t\t Direction: %s (%u)", (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1 ? "Transmit" : "Receive", - (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1)); + (EXTRACT_BE_U_4(obj_tptr + offset + 4)>>30)&0x1); - ND_PRINT((ndo, "\n\t\t Channel Status: %s (%u)", + ND_PRINT("\n\t\t Channel Status: %s (%u)", tok2str(lmp_obj_channel_status_values, "Unknown", EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF), - EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF)); + EXTRACT_BE_U_4(obj_tptr + offset + 4)&0x3FFFFFF); offset+=8; } break; @@ -941,9 +941,9 @@ lmp_print(netdissect_options *ndo, case LMP_CTYPE_IPV4: offset = 0; while (offset+4 <= obj_tlen) { - ND_PRINT((ndo, "\n\t Interface ID: %s (0x%08x)", + ND_PRINT("\n\t Interface ID: %s (0x%08x)", ipaddr_string(ndo, obj_tptr+offset), - EXTRACT_BE_U_4(obj_tptr + offset))); + EXTRACT_BE_U_4(obj_tptr + offset)); offset+=4; } break; @@ -951,9 +951,9 @@ lmp_print(netdissect_options *ndo, case LMP_CTYPE_IPV6: offset = 0; while (offset+16 <= obj_tlen) { - ND_PRINT((ndo, "\n\t Interface ID: %s (0x%08x)", + ND_PRINT("\n\t Interface ID: %s (0x%08x)", ip6addr_string(ndo, obj_tptr+offset), - EXTRACT_BE_U_4(obj_tptr + offset))); + EXTRACT_BE_U_4(obj_tptr + offset)); offset+=16; } break; @@ -961,9 +961,9 @@ lmp_print(netdissect_options *ndo, case LMP_CTYPE_UNMD: offset = 0; while (offset+4 <= obj_tlen) { - ND_PRINT((ndo, "\n\t Interface ID: %u (0x%08x)", + ND_PRINT("\n\t Interface ID: %u (0x%08x)", EXTRACT_BE_U_4(obj_tptr + offset), - EXTRACT_BE_U_4(obj_tptr + offset))); + EXTRACT_BE_U_4(obj_tptr + offset)); offset+=4; } break; @@ -977,24 +977,24 @@ lmp_print(netdissect_options *ndo, switch(lmp_obj_ctype) { case LMP_CTYPE_BEGIN_VERIFY_ERROR: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Error Code: %s", + ND_PRINT("\n\t Error Code: %s", bittok2str(lmp_obj_begin_verify_error_values, "none", - EXTRACT_BE_U_4(obj_tptr)))); + EXTRACT_BE_U_4(obj_tptr))); break; case LMP_CTYPE_LINK_SUMMARY_ERROR: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Error Code: %s", + ND_PRINT("\n\t Error Code: %s", bittok2str(lmp_obj_link_summary_error_values, "none", - EXTRACT_BE_U_4(obj_tptr)))); + EXTRACT_BE_U_4(obj_tptr))); break; default: hexdump=TRUE; @@ -1005,109 +1005,109 @@ lmp_print(netdissect_options *ndo, switch (lmp_obj_ctype) { case LMP_CTYPE_SERVICE_CONFIG_SP: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Flags: %s", + ND_PRINT("\n\t Flags: %s", bittok2str(lmp_obj_service_config_sp_flag_values, "none", - EXTRACT_U_1(obj_tptr)))); + EXTRACT_U_1(obj_tptr))); - ND_PRINT((ndo, "\n\t UNI Version: %u", - EXTRACT_U_1(obj_tptr + 1))); + ND_PRINT("\n\t UNI Version: %u", + EXTRACT_U_1(obj_tptr + 1)); break; case LMP_CTYPE_SERVICE_CONFIG_CPSA: if (obj_tlen != 16) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } link_type = EXTRACT_U_1(obj_tptr); - ND_PRINT((ndo, "\n\t Link Type: %s (%u)", + ND_PRINT("\n\t Link Type: %s (%u)", tok2str(lmp_sd_service_config_cpsa_link_type_values, "Unknown", link_type), - link_type)); + link_type); switch (link_type) { case LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SDH: - ND_PRINT((ndo, "\n\t Signal Type: %s (%u)", + ND_PRINT("\n\t Signal Type: %s (%u)", tok2str(lmp_sd_service_config_cpsa_signal_type_sdh_values, "Unknown", EXTRACT_U_1(obj_tptr + 1)), - EXTRACT_U_1(obj_tptr + 1))); + EXTRACT_U_1(obj_tptr + 1)); break; case LMP_SD_SERVICE_CONFIG_CPSA_LINK_TYPE_SONET: - ND_PRINT((ndo, "\n\t Signal Type: %s (%u)", + ND_PRINT("\n\t Signal Type: %s (%u)", tok2str(lmp_sd_service_config_cpsa_signal_type_sonet_values, "Unknown", EXTRACT_U_1(obj_tptr + 1)), - EXTRACT_U_1(obj_tptr + 1))); + EXTRACT_U_1(obj_tptr + 1)); break; } - ND_PRINT((ndo, "\n\t Transparency: %s", + ND_PRINT("\n\t Transparency: %s", bittok2str(lmp_obj_service_config_cpsa_tp_flag_values, "none", - EXTRACT_U_1(obj_tptr + 2)))); + EXTRACT_U_1(obj_tptr + 2))); - ND_PRINT((ndo, "\n\t Contiguous Concatenation Types: %s", + ND_PRINT("\n\t Contiguous Concatenation Types: %s", bittok2str(lmp_obj_service_config_cpsa_cct_flag_values, "none", - EXTRACT_U_1(obj_tptr + 3)))); + EXTRACT_U_1(obj_tptr + 3))); - ND_PRINT((ndo, "\n\t Minimum NCC: %u", - EXTRACT_BE_U_2(obj_tptr + 4))); + ND_PRINT("\n\t Minimum NCC: %u", + EXTRACT_BE_U_2(obj_tptr + 4)); - ND_PRINT((ndo, "\n\t Maximum NCC: %u", - EXTRACT_BE_U_2(obj_tptr + 6))); + ND_PRINT("\n\t Maximum NCC: %u", + EXTRACT_BE_U_2(obj_tptr + 6)); - ND_PRINT((ndo, "\n\t Minimum NVC:%u", - EXTRACT_BE_U_2(obj_tptr + 8))); + ND_PRINT("\n\t Minimum NVC:%u", + EXTRACT_BE_U_2(obj_tptr + 8)); - ND_PRINT((ndo, "\n\t Maximum NVC:%u", - EXTRACT_BE_U_2(obj_tptr + 10))); + ND_PRINT("\n\t Maximum NVC:%u", + EXTRACT_BE_U_2(obj_tptr + 10)); - ND_PRINT((ndo, "\n\t Local Interface ID: %s (0x%08x)", + ND_PRINT("\n\t Local Interface ID: %s (0x%08x)", ipaddr_string(ndo, obj_tptr+12), - EXTRACT_BE_U_4(obj_tptr + 12))); + EXTRACT_BE_U_4(obj_tptr + 12)); break; case LMP_CTYPE_SERVICE_CONFIG_TRANSPARENCY_TCM: if (obj_tlen != 8) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Transparency Flags: %s", + ND_PRINT("\n\t Transparency Flags: %s", bittok2str( lmp_obj_service_config_nsa_transparency_flag_values, "none", - EXTRACT_BE_U_4(obj_tptr)))); + EXTRACT_BE_U_4(obj_tptr))); - ND_PRINT((ndo, "\n\t TCM Monitoring Flags: %s", + ND_PRINT("\n\t TCM Monitoring Flags: %s", bittok2str( lmp_obj_service_config_nsa_tcm_flag_values, "none", - EXTRACT_U_1(obj_tptr + 7)))); + EXTRACT_U_1(obj_tptr + 7))); break; case LMP_CTYPE_SERVICE_CONFIG_NETWORK_DIVERSITY: if (obj_tlen != 4) { - ND_PRINT((ndo, " (not correct for object)")); + ND_PRINT(" (not correct for object)"); break; } - ND_PRINT((ndo, "\n\t Diversity: Flags: %s", + ND_PRINT("\n\t Diversity: Flags: %s", bittok2str( lmp_obj_service_config_nsa_network_diversity_flag_values, "none", - EXTRACT_U_1(obj_tptr + 3)))); + EXTRACT_U_1(obj_tptr + 3))); break; default: @@ -1131,7 +1131,7 @@ lmp_print(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); } /* * Local Variables: diff --git a/print-loopback.c b/print-loopback.c index 205c4aed..f9dda1a5 100644 --- a/print-loopback.c +++ b/print-loopback.c @@ -65,7 +65,7 @@ loopback_message_print(netdissect_options *ndo, const u_char *cp, const u_int le ND_TCHECK_2(cp); function = EXTRACT_LE_U_2(cp); cp += 2; - ND_PRINT((ndo, ", %s", tok2str(fcode_str, " invalid (%u)", function))); + ND_PRINT(", %s", tok2str(fcode_str, " invalid (%u)", function)); switch (function) { case LOOPBACK_REPLY: @@ -73,10 +73,10 @@ loopback_message_print(netdissect_options *ndo, const u_char *cp, const u_int le goto invalid; /* receipt number */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", receipt number %u", EXTRACT_LE_U_2(cp))); + ND_PRINT(", receipt number %u", EXTRACT_LE_U_2(cp)); cp += 2; /* data */ - ND_PRINT((ndo, ", data (%u octets)", len - 4)); + ND_PRINT(", data (%u octets)", len - 4); ND_TCHECK_LEN(cp, len - 4); break; case LOOPBACK_FWDDATA: @@ -84,10 +84,10 @@ loopback_message_print(netdissect_options *ndo, const u_char *cp, const u_int le goto invalid; /* forwarding address */ ND_TCHECK_LEN(cp, MAC_ADDR_LEN); - ND_PRINT((ndo, ", forwarding address %s", etheraddr_string(ndo, cp))); + ND_PRINT(", forwarding address %s", etheraddr_string(ndo, cp)); cp += MAC_ADDR_LEN; /* data */ - ND_PRINT((ndo, ", data (%u octets)", len - 8)); + ND_PRINT(", data (%u octets)", len - 8); ND_TCHECK_LEN(cp, len - 8); break; default: @@ -97,11 +97,11 @@ loopback_message_print(netdissect_options *ndo, const u_char *cp, const u_int le return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -110,26 +110,26 @@ loopback_print(netdissect_options *ndo, const u_char *cp, const u_int len) const u_char *ep = cp + len; uint16_t skipCount; - ND_PRINT((ndo, "Loopback")); + ND_PRINT("Loopback"); if (len < 2) goto invalid; /* skipCount */ ND_TCHECK_2(cp); skipCount = EXTRACT_LE_U_2(cp); cp += 2; - ND_PRINT((ndo, ", skipCount %u", skipCount)); + ND_PRINT(", skipCount %u", skipCount); if (skipCount % 8) - ND_PRINT((ndo, " (bogus)")); + ND_PRINT(" (bogus)"); if (skipCount > len - 2) goto invalid; loopback_message_print(ndo, cp + skipCount, len - 2 - skipCount); return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-lspping.c b/print-lspping.c index 686b8767..42c7a682 100644 --- a/print-lspping.c +++ b/print-lspping.c @@ -533,18 +533,18 @@ lspping_print(netdissect_options *ndo, * Sanity checking of the header. */ if (EXTRACT_BE_U_2(lspping_com_header->version) != LSPPING_VERSION) { - ND_PRINT((ndo, "LSP-PING version %u packet not supported", - EXTRACT_BE_U_2(lspping_com_header->version))); + ND_PRINT("LSP-PING version %u packet not supported", + EXTRACT_BE_U_2(lspping_com_header->version)); return; } /* in non-verbose mode just lets print the basic Message Type*/ if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "LSP-PINGv%u, %s, seq %u, length: %u", + ND_PRINT("LSP-PINGv%u, %s, seq %u, length: %u", EXTRACT_BE_U_2(lspping_com_header->version), tok2str(lspping_msg_type_values, "unknown (%u)",EXTRACT_U_1(lspping_com_header->msg_type)), EXTRACT_BE_U_4(lspping_com_header->seq_number), - len)); + len); return; } @@ -552,13 +552,13 @@ lspping_print(netdissect_options *ndo, tlen=len; - ND_PRINT((ndo, "\n\tLSP-PINGv%u, msg-type: %s (%u), length: %u\n\t reply-mode: %s (%u)", + ND_PRINT("\n\tLSP-PINGv%u, msg-type: %s (%u), length: %u\n\t reply-mode: %s (%u)", EXTRACT_BE_U_2(lspping_com_header->version), tok2str(lspping_msg_type_values, "unknown",EXTRACT_U_1(lspping_com_header->msg_type)), EXTRACT_U_1(lspping_com_header->msg_type), len, tok2str(lspping_reply_mode_values, "unknown",EXTRACT_U_1(lspping_com_header->reply_mode)), - EXTRACT_U_1(lspping_com_header->reply_mode))); + EXTRACT_U_1(lspping_com_header->reply_mode)); /* * the following return codes require that the subcode is attached @@ -572,33 +572,33 @@ lspping_print(netdissect_options *ndo, return_code == 10 || return_code == 11 || return_code == 12 ) - ND_PRINT((ndo, "\n\t Return Code: %s %u (%u)\n\t Return Subcode: (%u)", + ND_PRINT("\n\t Return Code: %s %u (%u)\n\t Return Subcode: (%u)", tok2str(lspping_return_code_values, "unknown",return_code), return_subcode, return_code, - return_subcode)); + return_subcode); else - ND_PRINT((ndo, "\n\t Return Code: %s (%u)\n\t Return Subcode: (%u)", + ND_PRINT("\n\t Return Code: %s (%u)\n\t Return Subcode: (%u)", tok2str(lspping_return_code_values, "unknown",return_code), return_code, - return_subcode)); + return_subcode); - ND_PRINT((ndo, "\n\t Sender Handle: 0x%08x, Sequence: %u", + ND_PRINT("\n\t Sender Handle: 0x%08x, Sequence: %u", EXTRACT_BE_U_4(lspping_com_header->sender_handle), - EXTRACT_BE_U_4(lspping_com_header->seq_number))); + EXTRACT_BE_U_4(lspping_com_header->seq_number)); timestamp.tv_sec=EXTRACT_BE_U_4(lspping_com_header->ts_sent_sec); timestamp.tv_usec=EXTRACT_BE_U_4(lspping_com_header->ts_sent_usec); - ND_PRINT((ndo, "\n\t Sender Timestamp: ")); + ND_PRINT("\n\t Sender Timestamp: "); ts_print(ndo, ×tamp); timestamp.tv_sec=EXTRACT_BE_U_4(lspping_com_header->ts_rcvd_sec); timestamp.tv_usec=EXTRACT_BE_U_4(lspping_com_header->ts_rcvd_usec); - ND_PRINT((ndo, "Receiver Timestamp: ")); + ND_PRINT("Receiver Timestamp: "); if ((timestamp.tv_sec != 0) && (timestamp.tv_usec != 0)) ts_print(ndo, ×tamp); else - ND_PRINT((ndo, "no timestamp")); + ND_PRINT("no timestamp"); tptr+=sizeof(struct lspping_common_header); tlen-=sizeof(struct lspping_common_header); @@ -615,12 +615,12 @@ lspping_print(netdissect_options *ndo, lspping_tlv_type=EXTRACT_BE_U_2(lspping_tlv_header->type); lspping_tlv_len=EXTRACT_BE_U_2(lspping_tlv_header->length); - ND_PRINT((ndo, "\n\t %s TLV (%u), length: %u", + ND_PRINT("\n\t %s TLV (%u), length: %u", tok2str(lspping_tlv_values, "Unknown", lspping_tlv_type), lspping_tlv_type, - lspping_tlv_len)); + lspping_tlv_len); /* some little sanity checking */ if (lspping_tlv_len == 0) { @@ -644,7 +644,7 @@ lspping_print(netdissect_options *ndo, while (tlv_tlen != 0) { /* Does the subTLV header go past the end of the TLV? */ if (tlv_tlen < sizeof(struct lspping_tlv_header)) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } @@ -659,7 +659,7 @@ lspping_print(netdissect_options *ndo, /* Does the subTLV go past the end of the TLV? */ if (tlv_tlen < lspping_subtlv_len+sizeof(struct lspping_tlv_header)) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } @@ -667,146 +667,146 @@ lspping_print(netdissect_options *ndo, /* Did we capture enough for fully decoding the subTLV? */ ND_TCHECK_LEN(subtlv_tptr, lspping_subtlv_len); - ND_PRINT((ndo, "\n\t %s subTLV (%u), length: %u", + ND_PRINT("\n\t %s subTLV (%u), length: %u", tok2str(lspping_tlvtargetfec_subtlv_values, "Unknown", lspping_subtlv_type), lspping_subtlv_type, - lspping_subtlv_len)); + lspping_subtlv_len); switch(lspping_subtlv_type) { case LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV4: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 5) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 5")); + ND_PRINT("\n\t invalid subTLV length, should be 5"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv4 = (const struct lspping_tlv_targetfec_subtlv_ldp_ipv4_t *)subtlv_tptr; - ND_PRINT((ndo, "\n\t %s/%u", + ND_PRINT("\n\t %s/%u", ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv4->prefix), - EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv4->prefix_len))); + EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv4->prefix_len)); } break; case LSPPING_TLV_TARGETFEC_SUBTLV_LDP_IPV6: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 17) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 17")); + ND_PRINT("\n\t invalid subTLV length, should be 17"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6 = (const struct lspping_tlv_targetfec_subtlv_ldp_ipv6_t *)subtlv_tptr; - ND_PRINT((ndo, "\n\t %s/%u", + ND_PRINT("\n\t %s/%u", ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6->prefix), - EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6->prefix_len))); + EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_ldp_ipv6->prefix_len)); } break; case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV4: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 5) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 5")); + ND_PRINT("\n\t invalid subTLV length, should be 5"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4 = (const struct lspping_tlv_targetfec_subtlv_bgp_ipv4_t *)subtlv_tptr; - ND_PRINT((ndo, "\n\t %s/%u", + ND_PRINT("\n\t %s/%u", ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4->prefix), - EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4->prefix_len))); + EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv4->prefix_len)); } break; case LSPPING_TLV_TARGETFEC_SUBTLV_BGP_IPV6: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 17) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 17")); + ND_PRINT("\n\t invalid subTLV length, should be 17"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6 = (const struct lspping_tlv_targetfec_subtlv_bgp_ipv6_t *)subtlv_tptr; - ND_PRINT((ndo, "\n\t %s/%u", + ND_PRINT("\n\t %s/%u", ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->prefix), - EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->prefix_len))); + EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_bgp_ipv6->prefix_len)); } break; case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV4: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 20) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 20")); + ND_PRINT("\n\t invalid subTLV length, should be 20"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4 = (const struct lspping_tlv_targetfec_subtlv_rsvp_ipv4_t *)subtlv_tptr; - ND_PRINT((ndo, "\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" + ND_PRINT("\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" "\n\t tunnel-id 0x%04x, extended tunnel-id %s", ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->tunnel_endpoint), ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->tunnel_sender), EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->lsp_id), EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->tunnel_id), - ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->extended_tunnel_id))); + ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv4->extended_tunnel_id)); } break; case LSPPING_TLV_TARGETFEC_SUBTLV_RSVP_IPV6: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 56) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 56")); + ND_PRINT("\n\t invalid subTLV length, should be 56"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6 = (const struct lspping_tlv_targetfec_subtlv_rsvp_ipv6_t *)subtlv_tptr; - ND_PRINT((ndo, "\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" + ND_PRINT("\n\t tunnel end-point %s, tunnel sender %s, lsp-id 0x%04x" "\n\t tunnel-id 0x%04x, extended tunnel-id %s", ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->tunnel_endpoint), ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->tunnel_sender), EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->lsp_id), EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->tunnel_id), - ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->extended_tunnel_id))); + ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_rsvp_ipv6->extended_tunnel_id)); } break; case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV4: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 13) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 13")); + ND_PRINT("\n\t invalid subTLV length, should be 13"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4 = (const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv4_t *)subtlv_tptr; - ND_PRINT((ndo, "\n\t RD: %s, %s/%u", + ND_PRINT("\n\t RD: %s, %s/%u", bgp_vpn_rd_print(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4->rd), ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4->prefix), - EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4->prefix_len))); + EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv4->prefix_len)); } break; case LSPPING_TLV_TARGETFEC_SUBTLV_L3VPN_IPV6: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 25) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 25")); + ND_PRINT("\n\t invalid subTLV length, should be 25"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6 = (const struct lspping_tlv_targetfec_subtlv_l3vpn_ipv6_t *)subtlv_tptr; - ND_PRINT((ndo, "\n\t RD: %s, %s/%u", + ND_PRINT("\n\t RD: %s, %s/%u", bgp_vpn_rd_print(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->rd), ip6addr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->prefix), - EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->prefix_len))); + EXTRACT_U_1(subtlv_ptr.lspping_tlv_targetfec_subtlv_l3vpn_ipv6->prefix_len)); } break; case LSPPING_TLV_TARGETFEC_SUBTLV_L2VPN_ENDPT: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 14) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 14")); + ND_PRINT("\n\t invalid subTLV length, should be 14"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_endpt = (const struct lspping_tlv_targetfec_subtlv_l2vpn_endpt_t *)subtlv_tptr; - ND_PRINT((ndo, "\n\t RD: %s, Sender VE ID: %u, Receiver VE ID: %u" + ND_PRINT("\n\t RD: %s, Sender VE ID: %u, Receiver VE ID: %u" "\n\t Encapsulation Type: %s (%u)", bgp_vpn_rd_print(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_endpt->rd), EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_endpt->sender_ve_id), @@ -814,7 +814,7 @@ lspping_print(netdissect_options *ndo, tok2str(mpls_pw_types_values, "unknown", EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_endpt->encapsulation)), - EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_endpt->encapsulation))); + EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_endpt->encapsulation)); } break; @@ -822,31 +822,31 @@ lspping_print(netdissect_options *ndo, case LSPPING_TLV_TARGETFEC_SUBTLV_FEC_128_PW_OLD: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 10) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 10")); + ND_PRINT("\n\t invalid subTLV length, should be 10"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old = (const struct lspping_tlv_targetfec_subtlv_fec_128_pw_old *)subtlv_tptr; - ND_PRINT((ndo, "\n\t Remote PE: %s" + ND_PRINT("\n\t Remote PE: %s" "\n\t PW ID: 0x%08x, PW Type: %s (%u)", ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->remote_pe_address), EXTRACT_BE_U_4(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->pw_id), tok2str(mpls_pw_types_values, "unknown", EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->pw_type)), - EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->pw_type))); + EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid_old->pw_type)); } break; case LSPPING_TLV_TARGETFEC_SUBTLV_FEC_128_PW: /* Is the subTLV length correct? */ if (lspping_subtlv_len != 14) { - ND_PRINT((ndo, "\n\t invalid subTLV length, should be 14")); + ND_PRINT("\n\t invalid subTLV length, should be 14"); subtlv_hexdump=TRUE; /* unknown subTLV just hexdump it */ } else { subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid = (const struct lspping_tlv_targetfec_subtlv_fec_128_pw *)subtlv_tptr; - ND_PRINT((ndo, "\n\t Sender PE: %s, Remote PE: %s" + ND_PRINT("\n\t Sender PE: %s, Remote PE: %s" "\n\t PW ID: 0x%08x, PW Type: %s (%u)", ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->sender_pe_address), ipaddr_string(ndo, subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->remote_pe_address), @@ -854,7 +854,7 @@ lspping_print(netdissect_options *ndo, tok2str(mpls_pw_types_values, "unknown", EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->pw_type)), - EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->pw_type))); + EXTRACT_BE_U_2(subtlv_ptr.lspping_tlv_targetfec_subtlv_l2vpn_vcid->pw_type)); } break; @@ -873,7 +873,7 @@ lspping_print(netdissect_options *ndo, lspping_subtlv_len += 4 - (lspping_subtlv_len % 4); /* Does the subTLV, including padding, go past the end of the TLV? */ if (tlv_tlen < lspping_subtlv_len+sizeof(struct lspping_tlv_header)) { - ND_PRINT((ndo, "\n\t\t TLV is too short")); + ND_PRINT("\n\t\t TLV is too short"); return; } } @@ -885,7 +885,7 @@ lspping_print(netdissect_options *ndo, case LSPPING_TLV_DOWNSTREAM_MAPPING: /* Does the header go past the end of the TLV? */ if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_t)) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } @@ -901,19 +901,19 @@ lspping_print(netdissect_options *ndo, * we find the address-type, we recast the tlv_tptr and move on. */ address_type = EXTRACT_U_1(tlv_ptr.lspping_tlv_downstream_map->address_type); - ND_PRINT((ndo, "\n\t MTU: %u, Address-Type: %s (%u)", + ND_PRINT("\n\t MTU: %u, Address-Type: %s (%u)", EXTRACT_BE_U_2(tlv_ptr.lspping_tlv_downstream_map->mtu), tok2str(lspping_tlv_downstream_addr_values, "unknown", address_type), - address_type)); + address_type); switch(address_type) { case LSPPING_AFI_IPV4: /* Does the data go past the end of the TLV? */ if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_ipv4_t)) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } @@ -923,17 +923,17 @@ lspping_print(netdissect_options *ndo, tlv_ptr.lspping_tlv_downstream_map_ipv4= (const struct lspping_tlv_downstream_map_ipv4_t *)tlv_tptr; - ND_PRINT((ndo, "\n\t Downstream IP: %s" + ND_PRINT("\n\t Downstream IP: %s" "\n\t Downstream Interface IP: %s", ipaddr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_ip), - ipaddr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_interface))); + ipaddr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv4->downstream_interface)); tlv_tptr+=sizeof(struct lspping_tlv_downstream_map_ipv4_t); tlv_tlen-=sizeof(struct lspping_tlv_downstream_map_ipv4_t); break; case LSPPING_AFI_IPV4_UNMB: /* Does the data go past the end of the TLV? */ if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_ipv4_unmb_t)) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } @@ -943,17 +943,17 @@ lspping_print(netdissect_options *ndo, tlv_ptr.lspping_tlv_downstream_map_ipv4_unmb= (const struct lspping_tlv_downstream_map_ipv4_unmb_t *)tlv_tptr; - ND_PRINT((ndo, "\n\t Downstream IP: %s" + ND_PRINT("\n\t Downstream IP: %s" "\n\t Downstream Interface Index: 0x%08x", ipaddr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv4_unmb->downstream_ip), - EXTRACT_BE_U_4(tlv_ptr.lspping_tlv_downstream_map_ipv4_unmb->downstream_interface))); + EXTRACT_BE_U_4(tlv_ptr.lspping_tlv_downstream_map_ipv4_unmb->downstream_interface)); tlv_tptr+=sizeof(struct lspping_tlv_downstream_map_ipv4_unmb_t); tlv_tlen-=sizeof(struct lspping_tlv_downstream_map_ipv4_unmb_t); break; case LSPPING_AFI_IPV6: /* Does the data go past the end of the TLV? */ if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_ipv6_t)) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } @@ -963,17 +963,17 @@ lspping_print(netdissect_options *ndo, tlv_ptr.lspping_tlv_downstream_map_ipv6= (const struct lspping_tlv_downstream_map_ipv6_t *)tlv_tptr; - ND_PRINT((ndo, "\n\t Downstream IP: %s" + ND_PRINT("\n\t Downstream IP: %s" "\n\t Downstream Interface IP: %s", ip6addr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv6->downstream_ip), - ip6addr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv6->downstream_interface))); + ip6addr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv6->downstream_interface)); tlv_tptr+=sizeof(struct lspping_tlv_downstream_map_ipv6_t); tlv_tlen-=sizeof(struct lspping_tlv_downstream_map_ipv6_t); break; case LSPPING_AFI_IPV6_UNMB: /* Does the data go past the end of the TLV? */ if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_ipv6_unmb_t)) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } @@ -983,10 +983,10 @@ lspping_print(netdissect_options *ndo, tlv_ptr.lspping_tlv_downstream_map_ipv6_unmb= (const struct lspping_tlv_downstream_map_ipv6_unmb_t *)tlv_tptr; - ND_PRINT((ndo, "\n\t Downstream IP: %s" + ND_PRINT("\n\t Downstream IP: %s" "\n\t Downstream Interface Index: 0x%08x", ip6addr_string(ndo, tlv_ptr.lspping_tlv_downstream_map_ipv6_unmb->downstream_ip), - EXTRACT_BE_U_4(tlv_ptr.lspping_tlv_downstream_map_ipv6_unmb->downstream_interface))); + EXTRACT_BE_U_4(tlv_ptr.lspping_tlv_downstream_map_ipv6_unmb->downstream_interface)); tlv_tptr+=sizeof(struct lspping_tlv_downstream_map_ipv6_unmb_t); tlv_tlen-=sizeof(struct lspping_tlv_downstream_map_ipv6_unmb_t); break; @@ -998,7 +998,7 @@ lspping_print(netdissect_options *ndo, /* Does the data go past the end of the TLV? */ if (tlv_tlen < sizeof(struct lspping_tlv_downstream_map_info_t)) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } @@ -1022,12 +1022,12 @@ lspping_print(netdissect_options *ndo, case LSPPING_TLV_BFD_DISCRIMINATOR: if (tlv_tlen < LSPPING_TLV_BFD_DISCRIMINATOR_LEN) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } else { ND_TCHECK_LEN(tptr, LSPPING_TLV_BFD_DISCRIMINATOR_LEN); - ND_PRINT((ndo, "\n\t BFD Discriminator 0x%08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t BFD Discriminator 0x%08x", EXTRACT_BE_U_4(tptr)); } break; @@ -1036,15 +1036,15 @@ lspping_print(netdissect_options *ndo, uint32_t vendor_id; if (tlv_tlen < LSPPING_TLV_VENDOR_ENTERPRISE_LEN) { - ND_PRINT((ndo, "\n\t TLV is too short")); + ND_PRINT("\n\t TLV is too short"); tlv_hexdump = TRUE; goto tlv_tooshort; } else { ND_TCHECK_LEN(tptr, LSPPING_TLV_VENDOR_ENTERPRISE_LEN); vendor_id = EXTRACT_BE_U_4(tlv_tptr); - ND_PRINT((ndo, "\n\t Vendor: %s (0x%04x)", + ND_PRINT("\n\t Vendor: %s (0x%04x)", tok2str(smi_values, "Unknown", vendor_id), - vendor_id)); + vendor_id); } } break; @@ -1082,10 +1082,10 @@ lspping_print(netdissect_options *ndo, } return; tooshort: - ND_PRINT((ndo, "\n\t\t packet is too short")); + ND_PRINT("\n\t\t packet is too short"); return; trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); return; } /* diff --git a/print-lwapp.c b/print-lwapp.c index 7c229de5..3c8cc75f 100644 --- a/print-lwapp.c +++ b/print-lwapp.c @@ -188,34 +188,34 @@ lwapp_control_print(netdissect_options *ndo, * Sanity checking of the header. */ if (LWAPP_EXTRACT_VERSION(version) != LWAPP_VERSION) { - ND_PRINT((ndo, "LWAPP version %u packet not supported", - LWAPP_EXTRACT_VERSION(version))); + ND_PRINT("LWAPP version %u packet not supported", + LWAPP_EXTRACT_VERSION(version)); return; } /* non-verbose */ if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "LWAPPv%u, %s frame, Flags [%s], length %u", + ND_PRINT("LWAPPv%u, %s frame, Flags [%s], length %u", LWAPP_EXTRACT_VERSION(version), LWAPP_EXTRACT_CONTROL_BIT(version) ? "Control" : "Data", bittok2str(lwapp_header_bits_values,"none",version&0x07), - len)); + len); return; } /* ok they seem to want to know everything - lets fully decode it */ tlen=EXTRACT_BE_U_2(lwapp_trans_header->length); - ND_PRINT((ndo, "LWAPPv%u, %s frame, Radio-id %u, Flags [%s], Frag-id %u, length %u", + ND_PRINT("LWAPPv%u, %s frame, Radio-id %u, Flags [%s], Frag-id %u, length %u", LWAPP_EXTRACT_VERSION(version), LWAPP_EXTRACT_CONTROL_BIT(version) ? "Control" : "Data", LWAPP_EXTRACT_RID(version), bittok2str(lwapp_header_bits_values,"none",version&0x07), EXTRACT_U_1(lwapp_trans_header->frag_id), - tlen)); + tlen); if (has_ap_ident) { - ND_PRINT((ndo, "\n\tAP identity: %s", etheraddr_string(ndo, tptr))); + ND_PRINT("\n\tAP identity: %s", etheraddr_string(ndo, tptr)); tptr+=sizeof(struct lwapp_transport_header)+6; } else { tptr+=sizeof(struct lwapp_transport_header); @@ -226,25 +226,25 @@ lwapp_control_print(netdissect_options *ndo, /* did we capture enough for fully decoding the object header ? */ ND_TCHECK_LEN(tptr, sizeof(struct lwapp_control_header)); if (tlen < sizeof(struct lwapp_control_header)) { - ND_PRINT((ndo, "\n\t Msg goes past end of PDU")); + ND_PRINT("\n\t Msg goes past end of PDU"); break; } lwapp_control_header = (const struct lwapp_control_header *)tptr; msg_tlen = EXTRACT_BE_U_2(lwapp_control_header->len); if (tlen < sizeof(struct lwapp_control_header) + msg_tlen) { - ND_PRINT((ndo, "\n\t Msg goes past end of PDU")); + ND_PRINT("\n\t Msg goes past end of PDU"); break; } /* print message header */ msg_type = EXTRACT_U_1(lwapp_control_header->msg_type); - ND_PRINT((ndo, "\n\t Msg type: %s (%u), Seqnum: %u, Msg len: %u, Session: 0x%08x", + ND_PRINT("\n\t Msg type: %s (%u), Seqnum: %u, Msg len: %u, Session: 0x%08x", tok2str(lwapp_msg_type_values,"Unknown",msg_type), msg_type, EXTRACT_U_1(lwapp_control_header->seq_num), msg_tlen, - EXTRACT_BE_U_4(lwapp_control_header->session_id))); + EXTRACT_BE_U_4(lwapp_control_header->session_id)); /* did we capture enough for fully decoding the message */ ND_TCHECK_LEN(tptr, msg_tlen); @@ -292,7 +292,7 @@ lwapp_control_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); } void @@ -316,40 +316,40 @@ lwapp_data_print(netdissect_options *ndo, * Sanity checking of the header. */ if (LWAPP_EXTRACT_VERSION(version) != LWAPP_VERSION) { - ND_PRINT((ndo, "LWAPP version %u packet not supported", - LWAPP_EXTRACT_VERSION(version))); + ND_PRINT("LWAPP version %u packet not supported", + LWAPP_EXTRACT_VERSION(version)); return; } /* non-verbose */ if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "LWAPPv%u, %s frame, Flags [%s], length %u", + ND_PRINT("LWAPPv%u, %s frame, Flags [%s], length %u", LWAPP_EXTRACT_VERSION(version), LWAPP_EXTRACT_CONTROL_BIT(version) ? "Control" : "Data", bittok2str(lwapp_header_bits_values,"none",version&0x07), - len)); + len); return; } /* ok they seem to want to know everything - lets fully decode it */ tlen=EXTRACT_BE_U_2(lwapp_trans_header->length); if (tlen < sizeof(struct lwapp_transport_header)) { - ND_PRINT((ndo, "LWAPPv%u, %s frame, Radio-id %u, Flags [%s], length %u < transport header length", + ND_PRINT("LWAPPv%u, %s frame, Radio-id %u, Flags [%s], length %u < transport header length", LWAPP_EXTRACT_VERSION(version), LWAPP_EXTRACT_CONTROL_BIT(version) ? "Control" : "Data", LWAPP_EXTRACT_RID(version), bittok2str(lwapp_header_bits_values,"none",version&0x07), - tlen)); + tlen); return; } - ND_PRINT((ndo, "LWAPPv%u, %s frame, Radio-id %u, Flags [%s], Frag-id %u, length %u", + ND_PRINT("LWAPPv%u, %s frame, Radio-id %u, Flags [%s], Frag-id %u, length %u", LWAPP_EXTRACT_VERSION(version), LWAPP_EXTRACT_CONTROL_BIT(version) ? "Control" : "Data", LWAPP_EXTRACT_RID(version), bittok2str(lwapp_header_bits_values,"none",version&0x07), EXTRACT_U_1(lwapp_trans_header->frag_id), - tlen)); + tlen); tptr+=sizeof(struct lwapp_transport_header); tlen-=sizeof(struct lwapp_transport_header); @@ -360,7 +360,7 @@ lwapp_data_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); } /* diff --git a/print-lwres.c b/print-lwres.c index d5e27da4..532d5d5c 100644 --- a/print-lwres.c +++ b/print-lwres.c @@ -196,7 +196,7 @@ lwres_printname(netdissect_options *ndo, if (p + l + 1 > (const char *)ndo->ndo_snapend) goto trunc; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); for (i = 0; i < l; i++) safeputchar(ndo, *p++); p++; /* skip terminating \0 */ @@ -242,7 +242,7 @@ lwres_printbinlen(netdissect_options *ndo, goto trunc; p += 2; for (i = 0; i < l; i++) - ND_PRINT((ndo, "%02x", *p++)); + ND_PRINT("%02x", *p++); return p - p0; trunc: @@ -267,19 +267,19 @@ lwres_printaddr(netdissect_options *ndo, case 1: /* IPv4 */ if (l < 4) return -1; - ND_PRINT((ndo, " %s", ipaddr_string(ndo, p))); + ND_PRINT(" %s", ipaddr_string(ndo, p)); p += sizeof(struct in_addr); break; case 2: /* IPv6 */ if (l < 16) return -1; - ND_PRINT((ndo, " %s", ip6addr_string(ndo, p))); + ND_PRINT(" %s", ip6addr_string(ndo, p)); p += sizeof(struct in6_addr); break; default: - ND_PRINT((ndo, " %u/", EXTRACT_BE_U_4(ap->family))); + ND_PRINT(" %u/", EXTRACT_BE_U_4(ap->family)); for (i = 0; i < l; i++) - ND_PRINT((ndo, "%02x", *p++)); + ND_PRINT("%02x", *p++); } return p - (const char *)ap; @@ -302,10 +302,10 @@ lwres_print(netdissect_options *ndo, np = (const struct lwres_lwpacket *)bp; ND_TCHECK(np->authlength); - ND_PRINT((ndo, " lwres")); + ND_PRINT(" lwres"); v = EXTRACT_BE_U_2(np->version); if (ndo->ndo_vflag || v != LWRES_LWPACKETVERSION_0) - ND_PRINT((ndo, " v%u", v)); + ND_PRINT(" v%u", v); if (v != LWRES_LWPACKETVERSION_0) { s = (const char *)np + EXTRACT_BE_U_4(np->length); goto tail; @@ -316,25 +316,25 @@ lwres_print(netdissect_options *ndo, /* opcode and pktflags */ v = EXTRACT_BE_U_4(np->opcode); s = tok2str(opcode, "#0x%x", v); - ND_PRINT((ndo, " %s%s", s, response ? "" : "?")); + ND_PRINT(" %s%s", s, response ? "" : "?"); /* pktflags */ v = EXTRACT_BE_U_2(np->pktflags); if (v & ~LWRES_LWPACKETFLAG_RESPONSE) - ND_PRINT((ndo, "[0x%x]", v)); + ND_PRINT("[0x%x]", v); if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, " (")); /*)*/ - ND_PRINT((ndo, "serial:0x%x", EXTRACT_BE_U_4(np->serial))); - ND_PRINT((ndo, " result:0x%x", EXTRACT_BE_U_4(np->result))); - ND_PRINT((ndo, " recvlen:%u", EXTRACT_BE_U_4(np->recvlength))); + ND_PRINT(" ("); /*)*/ + ND_PRINT("serial:0x%x", EXTRACT_BE_U_4(np->serial)); + ND_PRINT(" result:0x%x", EXTRACT_BE_U_4(np->result)); + ND_PRINT(" recvlen:%u", EXTRACT_BE_U_4(np->recvlength)); /* BIND910: not used */ if (ndo->ndo_vflag > 2) { - ND_PRINT((ndo, " authtype:0x%x", EXTRACT_BE_U_2(np->authtype))); - ND_PRINT((ndo, " authlen:%u", EXTRACT_BE_U_2(np->authlength))); + ND_PRINT(" authtype:0x%x", EXTRACT_BE_U_2(np->authtype)); + ND_PRINT(" authlen:%u", EXTRACT_BE_U_2(np->authlength)); } /*(*/ - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } /* per-opcode content */ @@ -364,24 +364,24 @@ lwres_print(netdissect_options *ndo, /* BIND910: not used */ if (ndo->ndo_vflag > 2) { - ND_PRINT((ndo, " flags:0x%x", - EXTRACT_BE_U_4(gabn->flags))); + ND_PRINT(" flags:0x%x", + EXTRACT_BE_U_4(gabn->flags)); } v = EXTRACT_BE_U_4(gabn->addrtypes); switch (v & (LWRES_ADDRTYPE_V4 | LWRES_ADDRTYPE_V6)) { case LWRES_ADDRTYPE_V4: - ND_PRINT((ndo, " IPv4")); + ND_PRINT(" IPv4"); break; case LWRES_ADDRTYPE_V6: - ND_PRINT((ndo, " IPv6")); + ND_PRINT(" IPv6"); break; case LWRES_ADDRTYPE_V4 | LWRES_ADDRTYPE_V6: - ND_PRINT((ndo, " IPv4/6")); + ND_PRINT(" IPv4/6"); break; } if (v & ~(LWRES_ADDRTYPE_V4 | LWRES_ADDRTYPE_V6)) - ND_PRINT((ndo, "[0x%x]", v)); + ND_PRINT("[0x%x]", v); advance = lwres_printname(ndo, l, s); if (advance < 0) @@ -394,8 +394,8 @@ lwres_print(netdissect_options *ndo, /* BIND910: not used */ if (ndo->ndo_vflag > 2) { - ND_PRINT((ndo, " flags:0x%x", - EXTRACT_BE_U_4(gnba->flags))); + ND_PRINT(" flags:0x%x", + EXTRACT_BE_U_4(gnba->flags)); } s = (const char *)&gnba->addr; @@ -412,15 +412,15 @@ lwres_print(netdissect_options *ndo, /* BIND910: not used */ if (ndo->ndo_vflag > 2) { - ND_PRINT((ndo, " flags:0x%x", - EXTRACT_BE_U_4(grbn->flags))); + ND_PRINT(" flags:0x%x", + EXTRACT_BE_U_4(grbn->flags)); } - ND_PRINT((ndo, " %s", tok2str(ns_type2str, "Type%u", - EXTRACT_BE_U_2(grbn->rdtype)))); + ND_PRINT(" %s", tok2str(ns_type2str, "Type%u", + EXTRACT_BE_U_2(grbn->rdtype))); if (EXTRACT_BE_U_2(grbn->rdclass) != C_IN) { - ND_PRINT((ndo, " %s", tok2str(ns_class2str, "Class%u", - EXTRACT_BE_U_2(grbn->rdclass)))); + ND_PRINT(" %s", tok2str(ns_class2str, "Class%u", + EXTRACT_BE_U_2(grbn->rdclass))); } /* XXX grbn points to packed struct */ @@ -464,12 +464,12 @@ lwres_print(netdissect_options *ndo, /* BIND910: not used */ if (ndo->ndo_vflag > 2) { - ND_PRINT((ndo, " flags:0x%x", - EXTRACT_BE_U_4(gabn->flags))); + ND_PRINT(" flags:0x%x", + EXTRACT_BE_U_4(gabn->flags)); } - ND_PRINT((ndo, " %u/%u", EXTRACT_BE_U_2(gabn->naliases), - EXTRACT_BE_U_2(gabn->naddrs))); + ND_PRINT(" %u/%u", EXTRACT_BE_U_2(gabn->naliases), + EXTRACT_BE_U_2(gabn->naddrs)); advance = lwres_printname(ndo, l, s); if (advance < 0) @@ -504,11 +504,11 @@ lwres_print(netdissect_options *ndo, /* BIND910: not used */ if (ndo->ndo_vflag > 2) { - ND_PRINT((ndo, " flags:0x%x", - EXTRACT_BE_U_4(gnba->flags))); + ND_PRINT(" flags:0x%x", + EXTRACT_BE_U_4(gnba->flags)); } - ND_PRINT((ndo, " %u", EXTRACT_BE_U_2(gnba->naliases))); + ND_PRINT(" %u", EXTRACT_BE_U_2(gnba->naliases)); advance = lwres_printname(ndo, l, s); if (advance < 0) @@ -531,21 +531,21 @@ lwres_print(netdissect_options *ndo, /* BIND910: not used */ if (ndo->ndo_vflag > 2) { - ND_PRINT((ndo, " flags:0x%x", - EXTRACT_BE_U_4(grbn->flags))); + ND_PRINT(" flags:0x%x", + EXTRACT_BE_U_4(grbn->flags)); } - ND_PRINT((ndo, " %s", tok2str(ns_type2str, "Type%u", - EXTRACT_BE_U_2(grbn->rdtype)))); + ND_PRINT(" %s", tok2str(ns_type2str, "Type%u", + EXTRACT_BE_U_2(grbn->rdtype))); if (EXTRACT_BE_U_2(grbn->rdclass) != C_IN) { - ND_PRINT((ndo, " %s", tok2str(ns_class2str, "Class%u", - EXTRACT_BE_U_2(grbn->rdclass)))); + ND_PRINT(" %s", tok2str(ns_class2str, "Class%u", + EXTRACT_BE_U_2(grbn->rdclass))); } - ND_PRINT((ndo, " TTL ")); + ND_PRINT(" TTL "); unsigned_relts_print(ndo, EXTRACT_BE_U_4(grbn->ttl)); - ND_PRINT((ndo, " %u/%u", EXTRACT_BE_U_2(grbn->nrdatas), - EXTRACT_BE_U_2(grbn->nsigs))); + ND_PRINT(" %u/%u", EXTRACT_BE_U_2(grbn->nrdatas), + EXTRACT_BE_U_2(grbn->nsigs)); /* XXX grbn points to packed struct */ s = (const char *)&grbn->nsigs+ sizeof(grbn->nsigs); @@ -584,13 +584,13 @@ lwres_print(netdissect_options *ndo, tail: /* length mismatch */ if (EXTRACT_BE_U_4(np->length) != length) { - ND_PRINT((ndo, " [len: %u != %u]", EXTRACT_BE_U_4(np->length), - length)); + ND_PRINT(" [len: %u != %u]", EXTRACT_BE_U_4(np->length), + length); } if (!unsupported && s < (const char *)np + EXTRACT_BE_U_4(np->length)) - ND_PRINT((ndo, "[extra]")); + ND_PRINT("[extra]"); return; trunc: - ND_PRINT((ndo, "[|lwres]")); + ND_PRINT("[|lwres]"); } diff --git a/print-m3ua.c b/print-m3ua.c index a0305cfd..24426a18 100644 --- a/print-m3ua.c +++ b/print-m3ua.c @@ -220,21 +220,21 @@ tag_value_print(netdissect_options *ndo, if (size < 4) goto invalid; ND_TCHECK_LEN(buf, size); - ND_PRINT((ndo, "0x%08x", EXTRACT_BE_U_4(buf))); + ND_PRINT("0x%08x", EXTRACT_BE_U_4(buf)); break; /* ... */ default: - ND_PRINT((ndo, "(length %u)", size + (u_int)sizeof(struct m3ua_param_header))); + ND_PRINT("(length %u)", size + (u_int)sizeof(struct m3ua_param_header)); ND_TCHECK_LEN(buf, size); } return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(buf, size); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* @@ -263,7 +263,7 @@ m3ua_tags_print(netdissect_options *ndo, ND_TCHECK_LEN(p, sizeof(struct m3ua_param_header)); /* Parameter Tag */ hdr_tag = EXTRACT_BE_U_2(p); - ND_PRINT((ndo, "\n\t\t\t%s: ", tok2str(ParamName, "Unknown Parameter (0x%04x)", hdr_tag))); + ND_PRINT("\n\t\t\t%s: ", tok2str(ParamName, "Unknown Parameter (0x%04x)", hdr_tag)); /* Parameter Length */ hdr_len = EXTRACT_BE_U_2(p + 2); if (hdr_len < sizeof(struct m3ua_param_header)) @@ -278,11 +278,11 @@ m3ua_tags_print(netdissect_options *ndo, return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(buf, size); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* @@ -321,22 +321,22 @@ m3ua_print(netdissect_options *ndo, msg_class == M3UA_MSGC_RKM ? RoutingKeyMgmtMessages : NULL; - ND_PRINT((ndo, "\n\t\t%s", tok2str(MessageClasses, "Unknown message class %i", msg_class))); + ND_PRINT("\n\t\t%s", tok2str(MessageClasses, "Unknown message class %i", msg_class)); if (dict != NULL) - ND_PRINT((ndo, " %s Message", tok2str(dict, "Unknown (0x%02x)", EXTRACT_U_1(hdr->msg_type)))); + ND_PRINT(" %s Message", tok2str(dict, "Unknown (0x%02x)", EXTRACT_U_1(hdr->msg_type))); if (size != EXTRACT_BE_U_4(hdr->len)) - ND_PRINT((ndo, "\n\t\t\t@@@@@@ Corrupted length %u of message @@@@@@", EXTRACT_BE_U_4(hdr->len))); + ND_PRINT("\n\t\t\t@@@@@@ Corrupted length %u of message @@@@@@", EXTRACT_BE_U_4(hdr->len)); else m3ua_tags_print(ndo, buf + sizeof(struct m3ua_common_header), EXTRACT_BE_U_4(hdr->len) - sizeof(struct m3ua_common_header)); return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(buf, size); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-medsa.c b/print-medsa.c index f9b47a35..f7d501a5 100644 --- a/print-medsa.c +++ b/print-medsa.c @@ -93,45 +93,45 @@ medsa_print_full(netdissect_options *ndo, { u_char tag = TAG(medsa); - ND_PRINT((ndo, "%s", - tok2str(tag_values, "Unknown (%u)", tag))); + ND_PRINT("%s", + tok2str(tag_values, "Unknown (%u)", tag)); switch (tag) { case TAG_TO_CPU: - ND_PRINT((ndo, ", %stagged", SRC_TAG(medsa) ? "" : "un")); - ND_PRINT((ndo, ", dev.port:vlan %d.%d:%d", - SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa))); + ND_PRINT(", %stagged", SRC_TAG(medsa) ? "" : "un"); + ND_PRINT(", dev.port:vlan %d.%d:%d", + SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa)); - ND_PRINT((ndo, ", %s", - tok2str(code_values, "Unknown (%u)", CODE(medsa)))); + ND_PRINT(", %s", + tok2str(code_values, "Unknown (%u)", CODE(medsa))); if (CFI(medsa)) - ND_PRINT((ndo, ", CFI")); + ND_PRINT(", CFI"); - ND_PRINT((ndo, ", pri %d: ", PRI(medsa))); + ND_PRINT(", pri %d: ", PRI(medsa)); break; case TAG_FROM_CPU: - ND_PRINT((ndo, ", %stagged", SRC_TAG(medsa) ? "" : "un")); - ND_PRINT((ndo, ", dev.port:vlan %d.%d:%d", - SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa))); + ND_PRINT(", %stagged", SRC_TAG(medsa) ? "" : "un"); + ND_PRINT(", dev.port:vlan %d.%d:%d", + SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa)); if (CFI(medsa)) - ND_PRINT((ndo, ", CFI")); + ND_PRINT(", CFI"); - ND_PRINT((ndo, ", pri %d: ", PRI(medsa))); + ND_PRINT(", pri %d: ", PRI(medsa)); break; case TAG_FORWARD: - ND_PRINT((ndo, ", %stagged", SRC_TAG(medsa) ? "" : "un")); + ND_PRINT(", %stagged", SRC_TAG(medsa) ? "" : "un"); if (TRUNK(medsa)) - ND_PRINT((ndo, ", dev.trunk:vlan %d.%d:%d", - SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa))); + ND_PRINT(", dev.trunk:vlan %d.%d:%d", + SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa)); else - ND_PRINT((ndo, ", dev.port:vlan %d.%d:%d", - SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa))); + ND_PRINT(", dev.port:vlan %d.%d:%d", + SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa)); if (CFI(medsa)) - ND_PRINT((ndo, ", CFI")); + ND_PRINT(", CFI"); - ND_PRINT((ndo, ", pri %d: ", PRI(medsa))); + ND_PRINT(", pri %d: ", PRI(medsa)); break; default: ND_DEFAULTPRINT((const u_char *)medsa, caplen); @@ -151,8 +151,8 @@ medsa_print(netdissect_options *ndo, ND_TCHECK_SIZE(medsa); if (!ndo->ndo_eflag) - ND_PRINT((ndo, "MEDSA %d.%d:%d: ", - SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa))); + ND_PRINT("MEDSA %d.%d:%d: ", + SRC_DEV(medsa), SRC_PORT(medsa), VID(medsa)); else medsa_print_full(ndo, medsa, caplen); @@ -170,17 +170,17 @@ medsa_print(netdissect_options *ndo, } } else { if (ndo->ndo_eflag) - ND_PRINT((ndo, "ethertype %s (0x%04x) ", + ND_PRINT("ethertype %s (0x%04x) ", tok2str(ethertype_values, "Unknown", ether_type), - ether_type)); + ether_type); if (ethertype_print(ndo, ether_type, bp, length, caplen, src, dst) == 0) { /* ether_type not known, print raw packet */ if (!ndo->ndo_eflag) - ND_PRINT((ndo, "ethertype %s (0x%04x) ", + ND_PRINT("ethertype %s (0x%04x) ", tok2str(ethertype_values, "Unknown", ether_type), - ether_type)); + ether_type); if (!ndo->ndo_suppress_default_print) ND_DEFAULTPRINT(bp, caplen); @@ -188,7 +188,7 @@ medsa_print(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* diff --git a/print-mobile.c b/print-mobile.c index f34c10d9..de4d68cf 100644 --- a/print-mobile.c +++ b/print-mobile.c @@ -73,10 +73,10 @@ mobile_print(netdissect_options *ndo, const u_char *bp, u_int length) mob = (const struct mobile_ip *)bp; if (length < MOBILE_SIZE || !ND_TTEST_SIZE(mob)) { - ND_PRINT((ndo, "[|mobile]")); + ND_PRINT("[|mobile]"); return; } - ND_PRINT((ndo, "mobile: ")); + ND_PRINT("mobile: "); proto = EXTRACT_BE_U_2(mob->proto); crc = EXTRACT_BE_U_2(mob->hcheck); @@ -85,19 +85,19 @@ mobile_print(netdissect_options *ndo, const u_char *bp, u_int length) } if (osp) { - ND_PRINT((ndo, "[S] ")); + ND_PRINT("[S] "); if (ndo->ndo_vflag) - ND_PRINT((ndo, "%s ", ipaddr_string(ndo, &mob->osrc))); + ND_PRINT("%s ", ipaddr_string(ndo, &mob->osrc)); } else { - ND_PRINT((ndo, "[] ")); + ND_PRINT("[] "); } if (ndo->ndo_vflag) { - ND_PRINT((ndo, "> %s ", ipaddr_string(ndo, &mob->odst))); - ND_PRINT((ndo, "(oproto=%u)", proto>>8)); + ND_PRINT("> %s ", ipaddr_string(ndo, &mob->odst)); + ND_PRINT("(oproto=%u)", proto>>8); } vec[0].ptr = (const uint8_t *)(const void *)mob; vec[0].len = osp ? 12 : 8; if (in_cksum(vec, 1)!=0) { - ND_PRINT((ndo, " (bad checksum %u)", crc)); + ND_PRINT(" (bad checksum %u)", crc); } } diff --git a/print-mobility.c b/print-mobility.c index 02b739c9..bb56b9a4 100644 --- a/print-mobility.c +++ b/print-mobility.c @@ -135,57 +135,57 @@ mobility_opt_print(netdissect_options *ndo, switch (EXTRACT_U_1(bp + i)) { case IP6MOPT_PAD1: - ND_PRINT((ndo, "(pad1)")); + ND_PRINT("(pad1)"); break; case IP6MOPT_PADN: if (len - i < IP6MOPT_MINLEN) { - ND_PRINT((ndo, "(padn: trunc)")); + ND_PRINT("(padn: trunc)"); goto trunc; } - ND_PRINT((ndo, "(padn)")); + ND_PRINT("(padn)"); break; case IP6MOPT_REFRESH: if (len - i < IP6MOPT_REFRESH_MINLEN) { - ND_PRINT((ndo, "(refresh: trunc)")); + ND_PRINT("(refresh: trunc)"); goto trunc; } /* units of 4 secs */ ND_TCHECK_2(bp + i + 2); - ND_PRINT((ndo, "(refresh: %u)", - EXTRACT_BE_U_2(bp + i + 2) << 2)); + ND_PRINT("(refresh: %u)", + EXTRACT_BE_U_2(bp + i + 2) << 2); break; case IP6MOPT_ALTCOA: if (len - i < IP6MOPT_ALTCOA_MINLEN) { - ND_PRINT((ndo, "(altcoa: trunc)")); + ND_PRINT("(altcoa: trunc)"); goto trunc; } ND_TCHECK_16(bp + i + 2); - ND_PRINT((ndo, "(alt-CoA: %s)", ip6addr_string(ndo, bp + i + 2))); + ND_PRINT("(alt-CoA: %s)", ip6addr_string(ndo, bp + i + 2)); break; case IP6MOPT_NONCEID: if (len - i < IP6MOPT_NONCEID_MINLEN) { - ND_PRINT((ndo, "(ni: trunc)")); + ND_PRINT("(ni: trunc)"); goto trunc; } ND_TCHECK_2(bp + i + 2); ND_TCHECK_2(bp + i + 4); - ND_PRINT((ndo, "(ni: ho=0x%04x co=0x%04x)", + ND_PRINT("(ni: ho=0x%04x co=0x%04x)", EXTRACT_BE_U_2(bp + i + 2), - EXTRACT_BE_U_2(bp + i + 4))); + EXTRACT_BE_U_2(bp + i + 4)); break; case IP6MOPT_AUTH: if (len - i < IP6MOPT_AUTH_MINLEN) { - ND_PRINT((ndo, "(auth: trunc)")); + ND_PRINT("(auth: trunc)"); goto trunc; } - ND_PRINT((ndo, "(auth)")); + ND_PRINT("(auth)"); break; default: if (len - i < IP6MOPT_MINLEN) { - ND_PRINT((ndo, "(sopt_type %u: trunc)", EXTRACT_U_1(bp + i))); + ND_PRINT("(sopt_type %u: trunc)", EXTRACT_U_1(bp + i)); goto trunc; } - ND_PRINT((ndo, "(type-0x%02x: len=%u)", EXTRACT_U_1(bp + i), EXTRACT_U_1(bp + i + 1))); + ND_PRINT("(type-0x%02x: len=%u)", EXTRACT_U_1(bp + i), EXTRACT_U_1(bp + i + 1)); break; } } @@ -235,10 +235,10 @@ mobility_print(netdissect_options *ndo, ND_TCHECK_1(mh->ip6m_type); type = EXTRACT_U_1(mh->ip6m_type); if (type <= IP6M_MAX && mhlen < ip6m_hdrlen[type]) { - ND_PRINT((ndo, "(header length %u is too small for type %u)", mhlen, type)); + ND_PRINT("(header length %u is too small for type %u)", mhlen, type); goto trunc; } - ND_PRINT((ndo, "mobility: %s", tok2str(ip6m_str, "type-#%u", type))); + ND_PRINT("mobility: %s", tok2str(ip6m_str, "type-#%u", type)); switch (type) { case IP6M_BINDING_REQUEST: hlen = IP6M_MINLEN; @@ -248,50 +248,50 @@ mobility_print(netdissect_options *ndo, hlen = IP6M_MINLEN; if (ndo->ndo_vflag) { ND_TCHECK_4(bp + hlen + 4); - ND_PRINT((ndo, " %s Init Cookie=%08x:%08x", + ND_PRINT(" %s Init Cookie=%08x:%08x", type == IP6M_HOME_TEST_INIT ? "Home" : "Care-of", EXTRACT_BE_U_4(bp + hlen), - EXTRACT_BE_U_4(bp + hlen + 4))); + EXTRACT_BE_U_4(bp + hlen + 4)); } hlen += 8; break; case IP6M_HOME_TEST: case IP6M_CAREOF_TEST: ND_TCHECK_2(mh->ip6m_data16[0]); - ND_PRINT((ndo, " nonce id=0x%x", EXTRACT_BE_U_2(mh->ip6m_data16[0]))); + ND_PRINT(" nonce id=0x%x", EXTRACT_BE_U_2(mh->ip6m_data16[0])); hlen = IP6M_MINLEN; if (ndo->ndo_vflag) { ND_TCHECK_4(bp + hlen + 4); - ND_PRINT((ndo, " %s Init Cookie=%08x:%08x", + ND_PRINT(" %s Init Cookie=%08x:%08x", type == IP6M_HOME_TEST ? "Home" : "Care-of", EXTRACT_BE_U_4(bp + hlen), - EXTRACT_BE_U_4(bp + hlen + 4))); + EXTRACT_BE_U_4(bp + hlen + 4)); } hlen += 8; if (ndo->ndo_vflag) { ND_TCHECK_4(bp + hlen + 4); - ND_PRINT((ndo, " %s Keygen Token=%08x:%08x", + ND_PRINT(" %s Keygen Token=%08x:%08x", type == IP6M_HOME_TEST ? "Home" : "Care-of", EXTRACT_BE_U_4(bp + hlen), - EXTRACT_BE_U_4(bp + hlen + 4))); + EXTRACT_BE_U_4(bp + hlen + 4)); } hlen += 8; break; case IP6M_BINDING_UPDATE: ND_TCHECK_2(mh->ip6m_data16[0]); - ND_PRINT((ndo, " seq#=%u", EXTRACT_BE_U_2(mh->ip6m_data16[0]))); + ND_PRINT(" seq#=%u", EXTRACT_BE_U_2(mh->ip6m_data16[0])); hlen = IP6M_MINLEN; ND_TCHECK_2(bp + hlen); if (EXTRACT_U_1(bp + hlen) & 0xf0) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (EXTRACT_U_1(bp + hlen) & 0x80) - ND_PRINT((ndo, "A")); + ND_PRINT("A"); if (EXTRACT_U_1(bp + hlen) & 0x40) - ND_PRINT((ndo, "H")); + ND_PRINT("H"); if (EXTRACT_U_1(bp + hlen) & 0x20) - ND_PRINT((ndo, "L")); + ND_PRINT("L"); if (EXTRACT_U_1(bp + hlen) & 0x10) - ND_PRINT((ndo, "K")); + ND_PRINT("K"); } /* Reserved (4bits) */ hlen += 1; @@ -299,36 +299,36 @@ mobility_print(netdissect_options *ndo, hlen += 1; ND_TCHECK_2(bp + hlen); /* units of 4 secs */ - ND_PRINT((ndo, " lifetime=%u", EXTRACT_BE_U_2(bp + hlen) << 2)); + ND_PRINT(" lifetime=%u", EXTRACT_BE_U_2(bp + hlen) << 2); hlen += 2; break; case IP6M_BINDING_ACK: ND_TCHECK_1(mh->ip6m_data8[0]); - ND_PRINT((ndo, " status=%u", EXTRACT_U_1(mh->ip6m_data8[0]))); + ND_PRINT(" status=%u", EXTRACT_U_1(mh->ip6m_data8[0])); ND_TCHECK_1(mh->ip6m_data8[1]); if (EXTRACT_U_1(mh->ip6m_data8[1]) & 0x80) - ND_PRINT((ndo, " K")); + ND_PRINT(" K"); /* Reserved (7bits) */ hlen = IP6M_MINLEN; ND_TCHECK_2(bp + hlen); - ND_PRINT((ndo, " seq#=%u", EXTRACT_BE_U_2(bp + hlen))); + ND_PRINT(" seq#=%u", EXTRACT_BE_U_2(bp + hlen)); hlen += 2; ND_TCHECK_2(bp + hlen); /* units of 4 secs */ - ND_PRINT((ndo, " lifetime=%u", EXTRACT_BE_U_2(bp + hlen) << 2)); + ND_PRINT(" lifetime=%u", EXTRACT_BE_U_2(bp + hlen) << 2); hlen += 2; break; case IP6M_BINDING_ERROR: ND_TCHECK_1(mh->ip6m_data8[0]); - ND_PRINT((ndo, " status=%u", EXTRACT_U_1(mh->ip6m_data8[0]))); + ND_PRINT(" status=%u", EXTRACT_U_1(mh->ip6m_data8[0])); /* Reserved */ hlen = IP6M_MINLEN; ND_TCHECK_16(bp + hlen); - ND_PRINT((ndo, " homeaddr %s", ip6addr_string(ndo, bp + hlen))); + ND_PRINT(" homeaddr %s", ip6addr_string(ndo, bp + hlen)); hlen += 16; break; default: - ND_PRINT((ndo, " len=%u", EXTRACT_U_1(mh->ip6m_len))); + ND_PRINT(" len=%u", EXTRACT_U_1(mh->ip6m_len)); return(mhlen); break; } @@ -339,6 +339,6 @@ mobility_print(netdissect_options *ndo, return(mhlen); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return(-1); } diff --git a/print-mpcp.c b/print-mpcp.c index 5fa0a421..9c0675ad 100644 --- a/print-mpcp.c +++ b/print-mpcp.c @@ -139,11 +139,11 @@ mpcp_print(netdissect_options *ndo, const u_char *pptr, u_int length) ND_TCHECK_LEN(tptr, sizeof(struct mpcp_common_header_t)); opcode = EXTRACT_BE_U_2(mpcp.common_header->opcode); - ND_PRINT((ndo, "MPCP, Opcode %s", tok2str(mpcp_opcode_values, "Unknown (%u)", opcode))); + ND_PRINT("MPCP, Opcode %s", tok2str(mpcp_opcode_values, "Unknown (%u)", opcode)); if (opcode != MPCP_OPCODE_PAUSE) { - ND_PRINT((ndo, ", Timestamp %u ticks", EXTRACT_BE_U_4(mpcp.common_header->timestamp))); + ND_PRINT(", Timestamp %u ticks", EXTRACT_BE_U_4(mpcp.common_header->timestamp)); } - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT(", length %u", length); if (!ndo->ndo_vflag) return; @@ -157,25 +157,25 @@ mpcp_print(netdissect_options *ndo, const u_char *pptr, u_int length) case MPCP_OPCODE_GATE: ND_TCHECK_LEN(tptr, MPCP_GRANT_NUMBER_LEN); grant_numbers = EXTRACT_U_1(tptr) & MPCP_GRANT_NUMBER_MASK; - ND_PRINT((ndo, "\n\tGrant Numbers %u, Flags [ %s ]", + ND_PRINT("\n\tGrant Numbers %u, Flags [ %s ]", grant_numbers, bittok2str(mpcp_grant_flag_values, "?", - EXTRACT_U_1(tptr) & ~MPCP_GRANT_NUMBER_MASK))); + EXTRACT_U_1(tptr) & ~MPCP_GRANT_NUMBER_MASK)); tptr++; for (grant = 1; grant <= grant_numbers; grant++) { ND_TCHECK_LEN(tptr, sizeof(struct mpcp_grant_t)); mpcp.grant = (const struct mpcp_grant_t *)tptr; - ND_PRINT((ndo, "\n\tGrant #%u, Start-Time %u ticks, duration %u ticks", + ND_PRINT("\n\tGrant #%u, Start-Time %u ticks, duration %u ticks", grant, EXTRACT_BE_U_4(mpcp.grant->starttime), - EXTRACT_BE_U_2(mpcp.grant->duration))); + EXTRACT_BE_U_2(mpcp.grant->duration)); tptr += sizeof(struct mpcp_grant_t); } ND_TCHECK_2(tptr); - ND_PRINT((ndo, "\n\tSync-Time %u ticks", EXTRACT_BE_U_2(tptr))); + ND_PRINT("\n\tSync-Time %u ticks", EXTRACT_BE_U_2(tptr)); break; @@ -183,23 +183,23 @@ mpcp_print(netdissect_options *ndo, const u_char *pptr, u_int length) ND_TCHECK_LEN(tptr, MPCP_REPORT_QUEUESETS_LEN); queue_sets = EXTRACT_U_1(tptr); tptr+=MPCP_REPORT_QUEUESETS_LEN; - ND_PRINT((ndo, "\n\tTotal Queue-Sets %u", queue_sets)); + ND_PRINT("\n\tTotal Queue-Sets %u", queue_sets); for (queue_set = 1; queue_set < queue_sets; queue_set++) { ND_TCHECK_LEN(tptr, MPCP_REPORT_REPORTBITMAP_LEN); report_bitmap = EXTRACT_U_1(tptr); - ND_PRINT((ndo, "\n\t Queue-Set #%u, Report-Bitmap [ %s ]", + ND_PRINT("\n\t Queue-Set #%u, Report-Bitmap [ %s ]", queue_sets, - bittok2str(mpcp_report_bitmap_values, "Unknown", report_bitmap))); + bittok2str(mpcp_report_bitmap_values, "Unknown", report_bitmap)); tptr++; report=1; while (report_bitmap != 0) { if (report_bitmap & 1) { ND_TCHECK_2(tptr); - ND_PRINT((ndo, "\n\t Q%u Report, Duration %u ticks", + ND_PRINT("\n\t Q%u Report, Duration %u ticks", report, - EXTRACT_BE_U_2(tptr))); + EXTRACT_BE_U_2(tptr)); tptr += 2; } report++; @@ -211,30 +211,30 @@ mpcp_print(netdissect_options *ndo, const u_char *pptr, u_int length) case MPCP_OPCODE_REG_REQ: ND_TCHECK_LEN(tptr, sizeof(struct mpcp_reg_req_t)); mpcp.reg_req = (const struct mpcp_reg_req_t *)tptr; - ND_PRINT((ndo, "\n\tFlags [ %s ], Pending-Grants %u", + ND_PRINT("\n\tFlags [ %s ], Pending-Grants %u", bittok2str(mpcp_reg_req_flag_values, "Reserved", EXTRACT_U_1(mpcp.reg_req->flags)), - EXTRACT_U_1(mpcp.reg_req->pending_grants))); + EXTRACT_U_1(mpcp.reg_req->pending_grants)); break; case MPCP_OPCODE_REG: ND_TCHECK_LEN(tptr, sizeof(struct mpcp_reg_t)); mpcp.reg = (const struct mpcp_reg_t *)tptr; - ND_PRINT((ndo, "\n\tAssigned-Port %u, Flags [ %s ]" + ND_PRINT("\n\tAssigned-Port %u, Flags [ %s ]" "\n\tSync-Time %u ticks, Echoed-Pending-Grants %u", EXTRACT_BE_U_2(mpcp.reg->assigned_port), bittok2str(mpcp_reg_flag_values, "Reserved", EXTRACT_U_1(mpcp.reg->flags)), EXTRACT_BE_U_2(mpcp.reg->sync_time), - EXTRACT_U_1(mpcp.reg->echoed_pending_grants))); + EXTRACT_U_1(mpcp.reg->echoed_pending_grants)); break; case MPCP_OPCODE_REG_ACK: ND_TCHECK_LEN(tptr, sizeof(struct mpcp_reg_ack_t)); mpcp.reg_ack = (const struct mpcp_reg_ack_t *)tptr; - ND_PRINT((ndo, "\n\tEchoed-Assigned-Port %u, Flags [ %s ]" + ND_PRINT("\n\tEchoed-Assigned-Port %u, Flags [ %s ]" "\n\tEchoed-Sync-Time %u ticks", EXTRACT_BE_U_2(mpcp.reg_ack->echoed_assigned_port), bittok2str(mpcp_reg_ack_flag_values, "Reserved", EXTRACT_U_1(mpcp.reg_ack->flags)), - EXTRACT_BE_U_2(mpcp.reg_ack->echoed_sync_time))); + EXTRACT_BE_U_2(mpcp.reg_ack->echoed_sync_time)); break; default: @@ -246,7 +246,7 @@ mpcp_print(netdissect_options *ndo, const u_char *pptr, u_int length) return; trunc: - ND_PRINT((ndo, "\n\t[|MPCP]")); + ND_PRINT("\n\t[|MPCP]"); } /* * Local Variables: diff --git a/print-mpls.c b/print-mpls.c index c566ea14..d744b9e3 100644 --- a/print-mpls.c +++ b/print-mpls.c @@ -65,25 +65,25 @@ mpls_print(netdissect_options *ndo, const u_char *bp, u_int length) enum mpls_packet_type pt = PT_UNKNOWN; p = bp; - ND_PRINT((ndo, "MPLS")); + ND_PRINT("MPLS"); do { ND_TCHECK_LEN(p, sizeof(label_entry)); if (length < sizeof(label_entry)) { - ND_PRINT((ndo, "[|MPLS], length %u", length)); + ND_PRINT("[|MPLS], length %u", length); return; } label_entry = EXTRACT_BE_U_4(p); - ND_PRINT((ndo, "%s(label %u", + ND_PRINT("%s(label %u", (label_stack_depth && ndo->ndo_vflag) ? "\n\t" : " ", - MPLS_LABEL(label_entry))); + MPLS_LABEL(label_entry)); label_stack_depth++; if (ndo->ndo_vflag && MPLS_LABEL(label_entry) < sizeof(mpls_labelname) / sizeof(mpls_labelname[0])) - ND_PRINT((ndo, " (%s)", mpls_labelname[MPLS_LABEL(label_entry)])); - ND_PRINT((ndo, ", exp %u", MPLS_EXP(label_entry))); + ND_PRINT(" (%s)", mpls_labelname[MPLS_LABEL(label_entry)]); + ND_PRINT(", exp %u", MPLS_EXP(label_entry)); if (MPLS_STACK(label_entry)) - ND_PRINT((ndo, ", [S]")); - ND_PRINT((ndo, ", ttl %u)", MPLS_TTL(label_entry))); + ND_PRINT(", [S]"); + ND_PRINT(", ttl %u)", MPLS_TTL(label_entry)); p += sizeof(label_entry); length -= sizeof(label_entry); @@ -189,7 +189,7 @@ mpls_print(netdissect_options *ndo, const u_char *bp, u_int length) ND_DEFAULTPRINT(p, length); return; } - ND_PRINT((ndo, ndo->ndo_vflag ? "\n\t" : " ")); + ND_PRINT(ndo->ndo_vflag ? "\n\t" : " "); switch (pt) { case PT_IPV4: @@ -210,7 +210,7 @@ mpls_print(netdissect_options *ndo, const u_char *bp, u_int length) return; trunc: - ND_PRINT((ndo, "[|MPLS]")); + ND_PRINT("[|MPLS]"); } diff --git a/print-mptcp.c b/print-mptcp.c index 5610e23c..77f12f0a 100644 --- a/print-mptcp.c +++ b/print-mptcp.c @@ -183,16 +183,16 @@ mp_capable_print(netdissect_options *ndo, return 0; if (MP_CAPABLE_OPT_VERSION(mpc->sub_ver) != 0) { - ND_PRINT((ndo, " Unknown Version (%u)", MP_CAPABLE_OPT_VERSION(mpc->sub_ver))); + ND_PRINT(" Unknown Version (%u)", MP_CAPABLE_OPT_VERSION(mpc->sub_ver)); return 1; } if (EXTRACT_U_1(mpc->flags) & MP_CAPABLE_C) - ND_PRINT((ndo, " csum")); - ND_PRINT((ndo, " {0x%" PRIx64, EXTRACT_BE_U_8(mpc->sender_key))); + ND_PRINT(" csum"); + ND_PRINT(" {0x%" PRIx64, EXTRACT_BE_U_8(mpc->sender_key)); if (opt_len == 20) /* ACK */ - ND_PRINT((ndo, ",0x%" PRIx64, EXTRACT_BE_U_8(mpc->receiver_key))); - ND_PRINT((ndo, "}")); + ND_PRINT(",0x%" PRIx64, EXTRACT_BE_U_8(mpc->receiver_key)); + ND_PRINT("}"); return 1; } @@ -209,26 +209,26 @@ mp_join_print(netdissect_options *ndo, if (opt_len != 24) { if (EXTRACT_U_1(mpj->sub_b) & MP_JOIN_B) - ND_PRINT((ndo, " backup")); - ND_PRINT((ndo, " id %u", EXTRACT_U_1(mpj->addr_id))); + ND_PRINT(" backup"); + ND_PRINT(" id %u", EXTRACT_U_1(mpj->addr_id)); } switch (opt_len) { case 12: /* SYN */ - ND_PRINT((ndo, " token 0x%x" " nonce 0x%x", + ND_PRINT(" token 0x%x" " nonce 0x%x", EXTRACT_BE_U_4(mpj->u.syn.token), - EXTRACT_BE_U_4(mpj->u.syn.nonce))); + EXTRACT_BE_U_4(mpj->u.syn.nonce)); break; case 16: /* SYN/ACK */ - ND_PRINT((ndo, " hmac 0x%" PRIx64 " nonce 0x%x", + ND_PRINT(" hmac 0x%" PRIx64 " nonce 0x%x", EXTRACT_BE_U_8(mpj->u.synack.mac), - EXTRACT_BE_U_4(mpj->u.synack.nonce))); + EXTRACT_BE_U_4(mpj->u.synack.nonce)); break; case 24: {/* ACK */ size_t i; - ND_PRINT((ndo, " hmac 0x")); + ND_PRINT(" hmac 0x"); for (i = 0; i < sizeof(mpj->u.ack.mac); ++i) - ND_PRINT((ndo, "%02x", mpj->u.ack.mac[i])); + ND_PRINT("%02x", mpj->u.ack.mac[i]); } default: break; @@ -252,13 +252,13 @@ mp_dss_print(netdissect_options *ndo, mdss_flags = EXTRACT_U_1(mdss->flags); if (mdss_flags & MP_DSS_F) - ND_PRINT((ndo, " fin")); + ND_PRINT(" fin"); opt += 4; opt_len -= 4; if (mdss_flags & MP_DSS_A) { /* Ack present */ - ND_PRINT((ndo, " ack ")); + ND_PRINT(" ack "); /* * If the a flag is set, we have an 8-byte ack; if it's * clear, we have a 4-byte ack. @@ -266,13 +266,13 @@ mp_dss_print(netdissect_options *ndo, if (mdss_flags & MP_DSS_a) { if (opt_len < 8) return 0; - ND_PRINT((ndo, "%" PRIu64, EXTRACT_BE_U_8(opt))); + ND_PRINT("%" PRIu64, EXTRACT_BE_U_8(opt)); opt += 8; opt_len -= 8; } else { if (opt_len < 4) return 0; - ND_PRINT((ndo, "%u", EXTRACT_BE_U_4(opt))); + ND_PRINT("%u", EXTRACT_BE_U_4(opt)); opt += 4; opt_len -= 4; } @@ -283,7 +283,7 @@ mp_dss_print(netdissect_options *ndo, * Data Sequence Number (DSN), Subflow Sequence Number (SSN), * Data-Level Length present, and Checksum possibly present. */ - ND_PRINT((ndo, " seq ")); + ND_PRINT(" seq "); /* * If the m flag is set, we have an 8-byte NDS; if it's clear, * we have a 4-byte DSN. @@ -291,24 +291,24 @@ mp_dss_print(netdissect_options *ndo, if (mdss_flags & MP_DSS_m) { if (opt_len < 8) return 0; - ND_PRINT((ndo, "%" PRIu64, EXTRACT_BE_U_8(opt))); + ND_PRINT("%" PRIu64, EXTRACT_BE_U_8(opt)); opt += 8; opt_len -= 8; } else { if (opt_len < 4) return 0; - ND_PRINT((ndo, "%u", EXTRACT_BE_U_4(opt))); + ND_PRINT("%u", EXTRACT_BE_U_4(opt)); opt += 4; opt_len -= 4; } if (opt_len < 4) return 0; - ND_PRINT((ndo, " subseq %u", EXTRACT_BE_U_4(opt))); + ND_PRINT(" subseq %u", EXTRACT_BE_U_4(opt)); opt += 4; opt_len -= 4; if (opt_len < 2) return 0; - ND_PRINT((ndo, " len %u", EXTRACT_BE_U_2(opt))); + ND_PRINT(" len %u", EXTRACT_BE_U_2(opt)); opt += 2; opt_len -= 2; @@ -318,7 +318,7 @@ mp_dss_print(netdissect_options *ndo, * bytes as the Checksum. */ if (opt_len >= 2) { - ND_PRINT((ndo, " csum 0x%x", EXTRACT_BE_U_2(opt))); + ND_PRINT(" csum 0x%x", EXTRACT_BE_U_2(opt)); opt_len -= 2; } } @@ -338,17 +338,17 @@ add_addr_print(netdissect_options *ndo, !((opt_len == 20 || opt_len == 22) && ipver == 6)) return 0; - ND_PRINT((ndo, " id %u", EXTRACT_U_1(add_addr->addr_id))); + ND_PRINT(" id %u", EXTRACT_U_1(add_addr->addr_id)); switch (ipver) { case 4: - ND_PRINT((ndo, " %s", ipaddr_string(ndo, add_addr->u.v4.addr))); + ND_PRINT(" %s", ipaddr_string(ndo, add_addr->u.v4.addr)); if (opt_len == 10) - ND_PRINT((ndo, ":%u", EXTRACT_BE_U_2(add_addr->u.v4.port))); + ND_PRINT(":%u", EXTRACT_BE_U_2(add_addr->u.v4.port)); break; case 6: - ND_PRINT((ndo, " %s", ip6addr_string(ndo, add_addr->u.v6.addr))); + ND_PRINT(" %s", ip6addr_string(ndo, add_addr->u.v6.addr)); if (opt_len == 22) - ND_PRINT((ndo, ":%u", EXTRACT_BE_U_2(add_addr->u.v6.port))); + ND_PRINT(":%u", EXTRACT_BE_U_2(add_addr->u.v6.port)); break; default: return 0; @@ -368,9 +368,9 @@ remove_addr_print(netdissect_options *ndo, return 0; opt_len -= 3; - ND_PRINT((ndo, " id")); + ND_PRINT(" id"); for (i = 0; i < opt_len; i++) - ND_PRINT((ndo, " %u", EXTRACT_U_1(remove_addr->addrs_id[i]))); + ND_PRINT(" %u", EXTRACT_U_1(remove_addr->addrs_id[i])); return 1; } @@ -384,11 +384,11 @@ mp_prio_print(netdissect_options *ndo, return 0; if (EXTRACT_U_1(mpp->sub_b) & MP_PRIO_B) - ND_PRINT((ndo, " backup")); + ND_PRINT(" backup"); else - ND_PRINT((ndo, " non-backup")); + ND_PRINT(" non-backup"); if (opt_len == 4) - ND_PRINT((ndo, " id %u", EXTRACT_U_1(mpp->addr_id))); + ND_PRINT(" id %u", EXTRACT_U_1(mpp->addr_id)); return 1; } @@ -400,7 +400,7 @@ mp_fail_print(netdissect_options *ndo, if (opt_len != 12) return 0; - ND_PRINT((ndo, " seq %" PRIu64, EXTRACT_BE_U_8(opt + 4))); + ND_PRINT(" seq %" PRIu64, EXTRACT_BE_U_8(opt + 4)); return 1; } @@ -411,7 +411,7 @@ mp_fast_close_print(netdissect_options *ndo, if (opt_len != 12) return 0; - ND_PRINT((ndo, " key 0x%" PRIx64, EXTRACT_BE_U_8(opt + 4))); + ND_PRINT(" key 0x%" PRIx64, EXTRACT_BE_U_8(opt + 4)); return 1; } @@ -443,6 +443,6 @@ mptcp_print(netdissect_options *ndo, opt = (const struct mptcp_option *) cp; subtype = min(MPTCP_OPT_SUBTYPE(opt->sub_etc), MPTCP_SUB_FCLOSE + 1); - ND_PRINT((ndo, " %s", mptcp_options[subtype].name)); + ND_PRINT(" %s", mptcp_options[subtype].name); return mptcp_options[subtype].print(ndo, cp, len, flags); } diff --git a/print-msdp.c b/print-msdp.c index f1769de0..68bb3159 100644 --- a/print-msdp.c +++ b/print-msdp.c @@ -41,13 +41,13 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length) len = EXTRACT_BE_U_2(sp + 1); if (len > 1500 || len < 3 || type == 0 || type > MSDP_TYPE_MAX) goto trunc; /* not really truncated, but still not decodable */ - ND_PRINT((ndo, " msdp:")); + ND_PRINT(" msdp:"); while (length > 0) { ND_TCHECK_3(sp); type = EXTRACT_U_1(sp); len = EXTRACT_BE_U_2(sp + 1); if (len > 1400 || ndo->ndo_vflag) - ND_PRINT((ndo, " [len %u]", len)); + ND_PRINT(" [len %u]", len); if (len < 3) goto trunc; sp += 3; @@ -56,15 +56,15 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length) case 1: /* IPv4 Source-Active */ case 3: /* IPv4 Source-Active Response */ if (type == 1) - ND_PRINT((ndo, " SA")); + ND_PRINT(" SA"); else - ND_PRINT((ndo, " SA-Response")); + ND_PRINT(" SA-Response"); ND_TCHECK_1(sp); - ND_PRINT((ndo, " %u entries", EXTRACT_U_1(sp))); + ND_PRINT(" %u entries", EXTRACT_U_1(sp)); if ((u_int)((EXTRACT_U_1(sp) * 12) + 8) < len) { - ND_PRINT((ndo, " [w/data]")); + ND_PRINT(" [w/data]"); if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); ip_print(ndo, sp + EXTRACT_U_1(sp) * 12 + 8 - 3, len - (EXTRACT_U_1(sp) * 12 + 8)); @@ -72,20 +72,20 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length) } break; case 2: - ND_PRINT((ndo, " SA-Request")); + ND_PRINT(" SA-Request"); ND_TCHECK_5(sp); - ND_PRINT((ndo, " for %s", ipaddr_string(ndo, sp + 1))); + ND_PRINT(" for %s", ipaddr_string(ndo, sp + 1)); break; case 4: - ND_PRINT((ndo, " Keepalive")); + ND_PRINT(" Keepalive"); if (len != 3) - ND_PRINT((ndo, "[len=%d] ", len)); + ND_PRINT("[len=%d] ", len); break; case 5: - ND_PRINT((ndo, " Notification")); + ND_PRINT(" Notification"); break; default: - ND_PRINT((ndo, " [type=%d len=%d]", type, len)); + ND_PRINT(" [type=%d len=%d]", type, len); break; } sp += (len - 3); @@ -93,7 +93,7 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length) } return; trunc: - ND_PRINT((ndo, " [|msdp]")); + ND_PRINT(" [|msdp]"); } /* diff --git a/print-msnlb.c b/print-msnlb.c index f1359d5b..02e047f3 100644 --- a/print-msnlb.c +++ b/print-msnlb.c @@ -55,11 +55,11 @@ msnlb_print(netdissect_options *ndo, const u_char *bp) hb = (const struct msnlb_heartbeat_pkt *)bp; ND_TCHECK_SIZE(hb); - ND_PRINT((ndo, "MS NLB heartbeat, host priority: %u,", - EXTRACT_LE_U_4((hb->host_prio)))); - ND_PRINT((ndo, " cluster IP: %s,", ipaddr_string(ndo, &(hb->virtual_ip)))); - ND_PRINT((ndo, " host IP: %s", ipaddr_string(ndo, &(hb->host_ip)))); + ND_PRINT("MS NLB heartbeat, host priority: %u,", + EXTRACT_LE_U_4((hb->host_prio))); + ND_PRINT(" cluster IP: %s,", ipaddr_string(ndo, &(hb->virtual_ip))); + ND_PRINT(" host IP: %s", ipaddr_string(ndo, &(hb->host_ip))); return; trunc: - ND_PRINT((ndo, "[|MS NLB]")); + ND_PRINT("[|MS NLB]"); } diff --git a/print-nflog.c b/print-nflog.c index 622743bf..c7cc47c1 100644 --- a/print-nflog.c +++ b/print-nflog.c @@ -49,21 +49,21 @@ static const struct tok nflog_values[] = { static inline void nflog_hdr_print(netdissect_options *ndo, const nflog_hdr_t *hdr, u_int length) { - ND_PRINT((ndo, "version %d, resource ID %d", hdr->nflog_version, ntohs(hdr->nflog_rid))); + ND_PRINT("version %d, resource ID %d", hdr->nflog_version, ntohs(hdr->nflog_rid)); if (!ndo->ndo_qflag) { - ND_PRINT((ndo,", family %s (%d)", + ND_PRINT(", family %s (%d)", tok2str(nflog_values, "Unknown", hdr->nflog_family), - hdr->nflog_family)); + hdr->nflog_family); } else { - ND_PRINT((ndo,", %s", + ND_PRINT(", %s", tok2str(nflog_values, "Unknown NFLOG (0x%02x)", - hdr->nflog_family))); + hdr->nflog_family)); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } u_int @@ -78,12 +78,12 @@ nflog_if_print(netdissect_options *ndo, u_int length = h->len; if (caplen < sizeof(nflog_hdr_t) || length < sizeof(nflog_hdr_t)) { - ND_PRINT((ndo, "[|nflog]")); + ND_PRINT("[|nflog]"); return h_size; } if (hdr->nflog_version != 0) { - ND_PRINT((ndo, "version %u (unknown)", hdr->nflog_version)); + ND_PRINT("version %u (unknown)", hdr->nflog_version); return h_size; } @@ -98,7 +98,7 @@ nflog_if_print(netdissect_options *ndo, /* We have some data. Do we have enough for the TLV header? */ if (caplen < sizeof(nflog_tlv_t) || length < sizeof(nflog_tlv_t)) { /* No. */ - ND_PRINT((ndo, "[|nflog]")); + ND_PRINT("[|nflog]"); return h_size; } @@ -110,14 +110,14 @@ nflog_if_print(netdissect_options *ndo, /* Is the TLV's length less than the minimum? */ if (size < sizeof(nflog_tlv_t)) { /* Yes. Give up now. */ - ND_PRINT((ndo, "[|nflog]")); + ND_PRINT("[|nflog]"); return h_size; } /* Do we have enough data for the full TLV? */ if (caplen < size || length < size) { /* No. */ - ND_PRINT((ndo, "[|nflog]")); + ND_PRINT("[|nflog]"); return h_size; } diff --git a/print-nfs.c b/print-nfs.c index 37c02b12..2f44f67d 100644 --- a/print-nfs.c +++ b/print-nfs.c @@ -226,7 +226,7 @@ print_nfsaddr(netdissect_options *ndo, break; } - ND_PRINT((ndo, "%s.%s > %s.%s: ", srcaddr, s, dstaddr, d)); + ND_PRINT("%s.%s > %s.%s: ", srcaddr, s, dstaddr, d); } static const uint32_t * @@ -303,18 +303,18 @@ print_sattr3(netdissect_options *ndo, const struct nfsv3_sattr *sa3, int verbose) { if (sa3->sa_modeset) - ND_PRINT((ndo, " mode %o", sa3->sa_mode)); + ND_PRINT(" mode %o", sa3->sa_mode); if (sa3->sa_uidset) - ND_PRINT((ndo, " uid %u", sa3->sa_uid)); + ND_PRINT(" uid %u", sa3->sa_uid); if (sa3->sa_gidset) - ND_PRINT((ndo, " gid %u", sa3->sa_gid)); + ND_PRINT(" gid %u", sa3->sa_gid); if (verbose > 1) { if (sa3->sa_atimetype == NFSV3SATTRTIME_TOCLIENT) - ND_PRINT((ndo, " atime %u.%06u", sa3->sa_atime.nfsv3_sec, - sa3->sa_atime.nfsv3_nsec)); + ND_PRINT(" atime %u.%06u", sa3->sa_atime.nfsv3_sec, + sa3->sa_atime.nfsv3_nsec); if (sa3->sa_mtimetype == NFSV3SATTRTIME_TOCLIENT) - ND_PRINT((ndo, " mtime %u.%06u", sa3->sa_mtime.nfsv3_sec, - sa3->sa_mtime.nfsv3_nsec)); + ND_PRINT(" mtime %u.%06u", sa3->sa_mtime.nfsv3_sec, + sa3->sa_mtime.nfsv3_nsec); } } @@ -346,7 +346,7 @@ nfsreply_print(netdissect_options *ndo, trunc: if (!nfserr) - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -369,13 +369,13 @@ nfsreply_noaddr_print(netdissect_options *ndo, switch (reply_stat) { case SUNRPC_MSG_ACCEPTED: - ND_PRINT((ndo, "reply ok %u", length)); + ND_PRINT("reply ok %u", length); if (xid_map_find(rp, bp2, &proc, &vers) >= 0) interp_reply(ndo, rp, proc, vers, length); break; case SUNRPC_MSG_DENIED: - ND_PRINT((ndo, "reply ERR %u: ", length)); + ND_PRINT("reply ERR %u: ", length); ND_TCHECK(rp->rm_reply.rp_reject.rj_stat); rstat = EXTRACT_BE_U_4(&rp->rm_reply.rp_reject.rj_stat); switch (rstat) { @@ -384,30 +384,30 @@ nfsreply_noaddr_print(netdissect_options *ndo, ND_TCHECK(rp->rm_reply.rp_reject.rj_vers.high); rlow = EXTRACT_BE_U_4(&rp->rm_reply.rp_reject.rj_vers.low); rhigh = EXTRACT_BE_U_4(&rp->rm_reply.rp_reject.rj_vers.high); - ND_PRINT((ndo, "RPC Version mismatch (%u-%u)", rlow, rhigh)); + ND_PRINT("RPC Version mismatch (%u-%u)", rlow, rhigh); break; case SUNRPC_AUTH_ERROR: ND_TCHECK(rp->rm_reply.rp_reject.rj_why); rwhy = EXTRACT_BE_U_4(&rp->rm_reply.rp_reject.rj_why); - ND_PRINT((ndo, "Auth %s", tok2str(sunrpc_auth_str, "Invalid failure code %u", rwhy))); + ND_PRINT("Auth %s", tok2str(sunrpc_auth_str, "Invalid failure code %u", rwhy)); break; default: - ND_PRINT((ndo, "Unknown reason for rejecting rpc message %u", (unsigned int)rstat)); + ND_PRINT("Unknown reason for rejecting rpc message %u", (unsigned int)rstat); break; } break; default: - ND_PRINT((ndo, "reply Unknown rpc response code=%u %u", reply_stat, length)); + ND_PRINT("reply Unknown rpc response code=%u %u", reply_stat, length); break; } return; trunc: if (!nfserr) - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* @@ -489,12 +489,12 @@ parsefn(netdissect_options *ndo, cp = (const u_char *)dp; /* Update 32-bit pointer (NFS filenames padded to 32-bit boundaries) */ dp += ((len + 3) & ~3) / sizeof(*dp); - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); if (fn_printn(ndo, cp, len, ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); goto trunc; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); return (dp); trunc: @@ -513,7 +513,7 @@ parsefhn(netdissect_options *ndo, dp = parsefh(ndo, dp, v3); if (dp == NULL) return (NULL); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); return (parsefn(ndo, dp)); } @@ -530,7 +530,7 @@ nfsreq_noaddr_print(netdissect_options *ndo, uint32_t access_flags; struct nfsv3_sattr sa3; - ND_PRINT((ndo, "%d", length)); + ND_PRINT("%d", length); nfserr = 0; /* assume no error */ rp = (const struct sunrpc_msg *)bp; @@ -543,7 +543,7 @@ nfsreq_noaddr_print(netdissect_options *ndo, if (!v3 && proc < NFS_NPROCS) proc = nfsv3_procid[proc]; - ND_PRINT((ndo, " %s", tok2str(nfsproc_str, "proc-%u", proc))); + ND_PRINT(" %s", tok2str(nfsproc_str, "proc-%u", proc)); switch (proc) { case NFSPROC_GETATTR: @@ -574,33 +574,33 @@ nfsreq_noaddr_print(netdissect_options *ndo, access_flags = EXTRACT_BE_U_4(dp); if (access_flags & ~NFSV3ACCESS_FULL) { /* NFSV3ACCESS definitions aren't up to date */ - ND_PRINT((ndo, " %04x", access_flags)); + ND_PRINT(" %04x", access_flags); } else if ((access_flags & NFSV3ACCESS_FULL) == NFSV3ACCESS_FULL) { - ND_PRINT((ndo, " NFS_ACCESS_FULL")); + ND_PRINT(" NFS_ACCESS_FULL"); } else { char separator = ' '; if (access_flags & NFSV3ACCESS_READ) { - ND_PRINT((ndo, " NFS_ACCESS_READ")); + ND_PRINT(" NFS_ACCESS_READ"); separator = '|'; } if (access_flags & NFSV3ACCESS_LOOKUP) { - ND_PRINT((ndo, "%cNFS_ACCESS_LOOKUP", separator)); + ND_PRINT("%cNFS_ACCESS_LOOKUP", separator); separator = '|'; } if (access_flags & NFSV3ACCESS_MODIFY) { - ND_PRINT((ndo, "%cNFS_ACCESS_MODIFY", separator)); + ND_PRINT("%cNFS_ACCESS_MODIFY", separator); separator = '|'; } if (access_flags & NFSV3ACCESS_EXTEND) { - ND_PRINT((ndo, "%cNFS_ACCESS_EXTEND", separator)); + ND_PRINT("%cNFS_ACCESS_EXTEND", separator); separator = '|'; } if (access_flags & NFSV3ACCESS_DELETE) { - ND_PRINT((ndo, "%cNFS_ACCESS_DELETE", separator)); + ND_PRINT("%cNFS_ACCESS_DELETE", separator); separator = '|'; } if (access_flags & NFSV3ACCESS_EXECUTE) - ND_PRINT((ndo, "%cNFS_ACCESS_EXECUTE", separator)); + ND_PRINT("%cNFS_ACCESS_EXECUTE", separator); } return; } @@ -611,14 +611,14 @@ nfsreq_noaddr_print(netdissect_options *ndo, (dp = parsefh(ndo, dp, v3)) != NULL) { if (v3) { ND_TCHECK_4(dp + 2); - ND_PRINT((ndo, " %u bytes @ %" PRIu64, + ND_PRINT(" %u bytes @ %" PRIu64, EXTRACT_BE_U_4(dp + 2), - EXTRACT_BE_U_8(dp))); + EXTRACT_BE_U_8(dp)); } else { ND_TCHECK_4(dp + 1); - ND_PRINT((ndo, " %u bytes @ %u", + ND_PRINT(" %u bytes @ %u", EXTRACT_BE_U_4(dp + 1), - EXTRACT_BE_U_4(dp))); + EXTRACT_BE_U_4(dp)); } return; } @@ -629,22 +629,22 @@ nfsreq_noaddr_print(netdissect_options *ndo, (dp = parsefh(ndo, dp, v3)) != NULL) { if (v3) { ND_TCHECK_4(dp + 4); - ND_PRINT((ndo, " %u (%u) bytes @ %" PRIu64, + ND_PRINT(" %u (%u) bytes @ %" PRIu64, EXTRACT_BE_U_4(dp + 4), EXTRACT_BE_U_4(dp + 2), - EXTRACT_BE_U_8(dp))); + EXTRACT_BE_U_8(dp)); if (ndo->ndo_vflag) { - ND_PRINT((ndo, " <%s>", + ND_PRINT(" <%s>", tok2str(nfsv3_writemodes, - NULL, EXTRACT_BE_U_4(dp + 3)))); + NULL, EXTRACT_BE_U_4(dp + 3))); } } else { ND_TCHECK_4(dp + 3); - ND_PRINT((ndo, " %u (%u) bytes @ %u (%u)", + ND_PRINT(" %u (%u) bytes @ %u (%u)", EXTRACT_BE_U_4(dp + 3), EXTRACT_BE_U_4(dp + 2), EXTRACT_BE_U_4(dp + 1), - EXTRACT_BE_U_4(dp))); + EXTRACT_BE_U_4(dp)); } return; } @@ -653,7 +653,7 @@ nfsreq_noaddr_print(netdissect_options *ndo, case NFSPROC_SYMLINK: if ((dp = parsereq(ndo, rp, length)) != NULL && (dp = parsefhn(ndo, dp, v3)) != NULL) { - ND_PRINT((ndo, " ->")); + ND_PRINT(" ->"); if (v3 && (dp = parse_sattr3(ndo, dp, &sa3)) == NULL) break; if (parsefn(ndo, dp) == NULL) @@ -672,12 +672,12 @@ nfsreq_noaddr_print(netdissect_options *ndo, dp++; if ((dp = parse_sattr3(ndo, dp, &sa3)) == NULL) break; - ND_PRINT((ndo, " %s", tok2str(type2str, "unk-ft %d", type))); + ND_PRINT(" %s", tok2str(type2str, "unk-ft %d", type)); if (ndo->ndo_vflag && (type == NFCHR || type == NFBLK)) { ND_TCHECK_4(dp + 1); - ND_PRINT((ndo, " %u/%u", + ND_PRINT(" %u/%u", EXTRACT_BE_U_4(dp), - EXTRACT_BE_U_4(dp + 1))); + EXTRACT_BE_U_4(dp + 1)); dp += 2; } if (ndo->ndo_vflag) @@ -689,7 +689,7 @@ nfsreq_noaddr_print(netdissect_options *ndo, case NFSPROC_RENAME: if ((dp = parsereq(ndo, rp, length)) != NULL && (dp = parsefhn(ndo, dp, v3)) != NULL) { - ND_PRINT((ndo, " ->")); + ND_PRINT(" ->"); if (parsefhn(ndo, dp, v3) != NULL) return; } @@ -698,7 +698,7 @@ nfsreq_noaddr_print(netdissect_options *ndo, case NFSPROC_LINK: if ((dp = parsereq(ndo, rp, length)) != NULL && (dp = parsefh(ndo, dp, v3)) != NULL) { - ND_PRINT((ndo, " ->")); + ND_PRINT(" ->"); if (parsefhn(ndo, dp, v3) != NULL) return; } @@ -713,9 +713,9 @@ nfsreq_noaddr_print(netdissect_options *ndo, * We shouldn't really try to interpret the * offset cookie here. */ - ND_PRINT((ndo, " %u bytes @ %" PRId64, + ND_PRINT(" %u bytes @ %" PRId64, EXTRACT_BE_U_4(dp + 4), - EXTRACT_BE_U_8(dp))); + EXTRACT_BE_U_8(dp)); if (ndo->ndo_vflag) { /* * This displays the 8 bytes @@ -723,9 +723,9 @@ nfsreq_noaddr_print(netdissect_options *ndo, * from the low-order byte * to the high-order byte. */ - ND_PRINT((ndo, " verf %08x%08x", + ND_PRINT(" verf %08x%08x", EXTRACT_BE_U_4(dp + 2), - EXTRACT_BE_U_4(dp + 3))); + EXTRACT_BE_U_4(dp + 3)); } } else { ND_TCHECK_4(dp + 1); @@ -733,9 +733,9 @@ nfsreq_noaddr_print(netdissect_options *ndo, * Print the offset as signed, since -1 is * common, but offsets > 2^31 aren't. */ - ND_PRINT((ndo, " %u bytes @ %d", + ND_PRINT(" %u bytes @ %d", EXTRACT_BE_U_4(dp + 1), - EXTRACT_BE_U_4(dp))); + EXTRACT_BE_U_4(dp)); } return; } @@ -749,9 +749,9 @@ nfsreq_noaddr_print(netdissect_options *ndo, * We don't try to interpret the offset * cookie here. */ - ND_PRINT((ndo, " %u bytes @ %" PRId64, + ND_PRINT(" %u bytes @ %" PRId64, EXTRACT_BE_U_4(dp + 4), - EXTRACT_BE_U_8(dp))); + EXTRACT_BE_U_8(dp)); if (ndo->ndo_vflag) { ND_TCHECK_4(dp + 5); /* @@ -760,10 +760,10 @@ nfsreq_noaddr_print(netdissect_options *ndo, * from the low-order byte * to the high-order byte. */ - ND_PRINT((ndo, " max %u verf %08x%08x", + ND_PRINT(" max %u verf %08x%08x", EXTRACT_BE_U_4(dp + 5), EXTRACT_BE_U_4(dp + 2), - EXTRACT_BE_U_4(dp + 3))); + EXTRACT_BE_U_4(dp + 3)); } return; } @@ -773,9 +773,9 @@ nfsreq_noaddr_print(netdissect_options *ndo, if ((dp = parsereq(ndo, rp, length)) != NULL && (dp = parsefh(ndo, dp, v3)) != NULL) { ND_TCHECK_4(dp + 2); - ND_PRINT((ndo, " %u bytes @ %" PRIu64, + ND_PRINT(" %u bytes @ %" PRIu64, EXTRACT_BE_U_4(dp + 2), - EXTRACT_BE_U_8(dp))); + EXTRACT_BE_U_8(dp)); return; } break; @@ -786,7 +786,7 @@ nfsreq_noaddr_print(netdissect_options *ndo, trunc: if (!nfserr) - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* @@ -811,7 +811,7 @@ nfs_printfh(netdissect_options *ndo, u_int i; char const *sep = ""; - ND_PRINT((ndo, " fh[")); + ND_PRINT(" fh["); for (i=0; i<len; i++) { /* * This displays 4 bytes in big-endian byte @@ -825,10 +825,10 @@ nfs_printfh(netdissect_options *ndo, * running tcpdump may show the same file * handle in different ways. */ - ND_PRINT((ndo, "%s%x", sep, EXTRACT_BE_U_4(dp + i))); + ND_PRINT("%s%x", sep, EXTRACT_BE_U_4(dp + i)); sep = ":"; } - ND_PRINT((ndo, "]")); + ND_PRINT("]"); return; } @@ -850,17 +850,17 @@ nfs_printfh(netdissect_options *ndo, if (spacep) *spacep = '\0'; - ND_PRINT((ndo, " fh %s/", temp)); + ND_PRINT(" fh %s/", temp); } else { - ND_PRINT((ndo, " fh %d,%d/", - fsid.Fsid_dev.Major, fsid.Fsid_dev.Minor)); + ND_PRINT(" fh %d,%d/", + fsid.Fsid_dev.Major, fsid.Fsid_dev.Minor); } if(fsid.Fsid_dev.Minor == 257) /* Print the undecoded handle */ - ND_PRINT((ndo, "%s", fsid.Opaque_Handle)); + ND_PRINT("%s", fsid.Opaque_Handle); else - ND_PRINT((ndo, "%ld", (long) ino)); + ND_PRINT("%ld", (long) ino); } /* @@ -1040,7 +1040,7 @@ parserep(netdissect_options *ndo, ND_TCHECK_4(dp); astat = (enum sunrpc_accept_stat) EXTRACT_BE_U_4(dp); if (astat != SUNRPC_SUCCESS) { - ND_PRINT((ndo, " %s", tok2str(sunrpc_str, "ar_stat %d", astat))); + ND_PRINT(" %s", tok2str(sunrpc_str, "ar_stat %d", astat)); nfserr = 1; /* suppress trunc string */ return (NULL); } @@ -1064,8 +1064,8 @@ parsestatus(netdissect_options *ndo, *er = errnum; if (errnum != 0) { if (!ndo->ndo_qflag) - ND_PRINT((ndo, " ERROR: %s", - tok2str(status2str, "unk %d", errnum))); + ND_PRINT(" ERROR: %s", + tok2str(status2str, "unk %d", errnum)); nfserr = 1; } return (dp + 1); @@ -1082,58 +1082,58 @@ parsefattr(netdissect_options *ndo, fap = (const struct nfs_fattr *)dp; ND_TCHECK(fap->fa_gid); if (verbose) { - ND_PRINT((ndo, " %s %o ids %d/%d", + ND_PRINT(" %s %o ids %d/%d", tok2str(type2str, "unk-ft %d ", EXTRACT_BE_U_4(&fap->fa_type)), EXTRACT_BE_U_4(&fap->fa_mode), EXTRACT_BE_U_4(&fap->fa_uid), - EXTRACT_BE_U_4(&fap->fa_gid))); + EXTRACT_BE_U_4(&fap->fa_gid)); if (v3) { ND_TCHECK(fap->fa3_size); - ND_PRINT((ndo, " sz %" PRIu64, - EXTRACT_BE_U_8((const uint32_t *)&fap->fa3_size))); + ND_PRINT(" sz %" PRIu64, + EXTRACT_BE_U_8((const uint32_t *)&fap->fa3_size)); } else { ND_TCHECK(fap->fa2_size); - ND_PRINT((ndo, " sz %d", EXTRACT_BE_U_4(&fap->fa2_size))); + ND_PRINT(" sz %d", EXTRACT_BE_U_4(&fap->fa2_size)); } } /* print lots more stuff */ if (verbose > 1) { if (v3) { ND_TCHECK(fap->fa3_ctime); - ND_PRINT((ndo, " nlink %d rdev %d/%d", + ND_PRINT(" nlink %d rdev %d/%d", EXTRACT_BE_U_4(&fap->fa_nlink), EXTRACT_BE_U_4(&fap->fa3_rdev.specdata1), - EXTRACT_BE_U_4(&fap->fa3_rdev.specdata2))); - ND_PRINT((ndo, " fsid %" PRIx64, - EXTRACT_BE_U_8((const uint32_t *)&fap->fa3_fsid))); - ND_PRINT((ndo, " fileid %" PRIx64, - EXTRACT_BE_U_8((const uint32_t *)&fap->fa3_fileid))); - ND_PRINT((ndo, " a/m/ctime %u.%06u", + EXTRACT_BE_U_4(&fap->fa3_rdev.specdata2)); + ND_PRINT(" fsid %" PRIx64, + EXTRACT_BE_U_8((const uint32_t *)&fap->fa3_fsid)); + ND_PRINT(" fileid %" PRIx64, + EXTRACT_BE_U_8((const uint32_t *)&fap->fa3_fileid)); + ND_PRINT(" a/m/ctime %u.%06u", EXTRACT_BE_U_4(&fap->fa3_atime.nfsv3_sec), - EXTRACT_BE_U_4(&fap->fa3_atime.nfsv3_nsec))); - ND_PRINT((ndo, " %u.%06u", + EXTRACT_BE_U_4(&fap->fa3_atime.nfsv3_nsec)); + ND_PRINT(" %u.%06u", EXTRACT_BE_U_4(&fap->fa3_mtime.nfsv3_sec), - EXTRACT_BE_U_4(&fap->fa3_mtime.nfsv3_nsec))); - ND_PRINT((ndo, " %u.%06u", + EXTRACT_BE_U_4(&fap->fa3_mtime.nfsv3_nsec)); + ND_PRINT(" %u.%06u", EXTRACT_BE_U_4(&fap->fa3_ctime.nfsv3_sec), - EXTRACT_BE_U_4(&fap->fa3_ctime.nfsv3_nsec))); + EXTRACT_BE_U_4(&fap->fa3_ctime.nfsv3_nsec)); } else { ND_TCHECK(fap->fa2_ctime); - ND_PRINT((ndo, " nlink %d rdev 0x%x fsid 0x%x nodeid 0x%x a/m/ctime", + ND_PRINT(" nlink %d rdev 0x%x fsid 0x%x nodeid 0x%x a/m/ctime", EXTRACT_BE_U_4(&fap->fa_nlink), EXTRACT_BE_U_4(&fap->fa2_rdev), EXTRACT_BE_U_4(&fap->fa2_fsid), - EXTRACT_BE_U_4(&fap->fa2_fileid))); - ND_PRINT((ndo, " %u.%06u", + EXTRACT_BE_U_4(&fap->fa2_fileid)); + ND_PRINT(" %u.%06u", EXTRACT_BE_U_4(&fap->fa2_atime.nfsv2_sec), - EXTRACT_BE_U_4(&fap->fa2_atime.nfsv2_usec))); - ND_PRINT((ndo, " %u.%06u", + EXTRACT_BE_U_4(&fap->fa2_atime.nfsv2_usec)); + ND_PRINT(" %u.%06u", EXTRACT_BE_U_4(&fap->fa2_mtime.nfsv2_sec), - EXTRACT_BE_U_4(&fap->fa2_mtime.nfsv2_usec))); - ND_PRINT((ndo, " %u.%06u", + EXTRACT_BE_U_4(&fap->fa2_mtime.nfsv2_usec)); + ND_PRINT(" %u.%06u", EXTRACT_BE_U_4(&fap->fa2_ctime.nfsv2_sec), - EXTRACT_BE_U_4(&fap->fa2_ctime.nfsv2_usec))); + EXTRACT_BE_U_4(&fap->fa2_ctime.nfsv2_usec)); } } return ((const uint32_t *)((const unsigned char *)dp + @@ -1188,7 +1188,7 @@ parselinkres(netdissect_options *ndo, return(1); if (v3 && !(dp = parse_post_op_attr(ndo, dp, ndo->ndo_vflag))) return (0); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); return (parsefn(ndo, dp) != NULL); } @@ -1210,7 +1210,7 @@ parsestatfs(netdissect_options *ndo, if (v3) { if (ndo->ndo_vflag) - ND_PRINT((ndo, " POST:")); + ND_PRINT(" POST:"); if (!(dp = parse_post_op_attr(ndo, dp, ndo->ndo_vflag))) return (0); } @@ -1220,24 +1220,24 @@ parsestatfs(netdissect_options *ndo, sfsp = (const struct nfs_statfs *)dp; if (v3) { - ND_PRINT((ndo, " tbytes %" PRIu64 " fbytes %" PRIu64 " abytes %" PRIu64, + ND_PRINT(" tbytes %" PRIu64 " fbytes %" PRIu64 " abytes %" PRIu64, EXTRACT_BE_U_8((const uint32_t *)&sfsp->sf_tbytes), EXTRACT_BE_U_8((const uint32_t *)&sfsp->sf_fbytes), - EXTRACT_BE_U_8((const uint32_t *)&sfsp->sf_abytes))); + EXTRACT_BE_U_8((const uint32_t *)&sfsp->sf_abytes)); if (ndo->ndo_vflag) { - ND_PRINT((ndo, " tfiles %" PRIu64 " ffiles %" PRIu64 " afiles %" PRIu64 " invar %u", + ND_PRINT(" tfiles %" PRIu64 " ffiles %" PRIu64 " afiles %" PRIu64 " invar %u", EXTRACT_BE_U_8((const uint32_t *)&sfsp->sf_tfiles), EXTRACT_BE_U_8((const uint32_t *)&sfsp->sf_ffiles), EXTRACT_BE_U_8((const uint32_t *)&sfsp->sf_afiles), - EXTRACT_BE_U_4(&sfsp->sf_invarsec))); + EXTRACT_BE_U_4(&sfsp->sf_invarsec)); } } else { - ND_PRINT((ndo, " tsize %d bsize %d blocks %d bfree %d bavail %d", + ND_PRINT(" tsize %d bsize %d blocks %d bfree %d bavail %d", EXTRACT_BE_U_4(&sfsp->sf_tsize), EXTRACT_BE_U_4(&sfsp->sf_bsize), EXTRACT_BE_U_4(&sfsp->sf_blocks), EXTRACT_BE_U_4(&sfsp->sf_bfree), - EXTRACT_BE_U_4(&sfsp->sf_bavail))); + EXTRACT_BE_U_4(&sfsp->sf_bavail)); } return (1); @@ -1260,10 +1260,10 @@ parserddires(netdissect_options *ndo, return (1); ND_TCHECK_4(dp + 2); - ND_PRINT((ndo, " offset 0x%x size %d ", - EXTRACT_BE_U_4(dp), EXTRACT_BE_U_4(dp + 1))); + ND_PRINT(" offset 0x%x size %d ", + EXTRACT_BE_U_4(dp), EXTRACT_BE_U_4(dp + 1)); if (EXTRACT_BE_U_4(dp + 2) != 0) - ND_PRINT((ndo, " eof")); + ND_PRINT(" eof"); return (1); trunc: @@ -1275,10 +1275,10 @@ parse_wcc_attr(netdissect_options *ndo, const uint32_t *dp) { /* Our caller has already checked this */ - ND_PRINT((ndo, " sz %" PRIu64, EXTRACT_BE_U_8(dp))); - ND_PRINT((ndo, " mtime %u.%06u ctime %u.%06u", + ND_PRINT(" sz %" PRIu64, EXTRACT_BE_U_8(dp)); + ND_PRINT(" mtime %u.%06u ctime %u.%06u", EXTRACT_BE_U_4(dp + 2), EXTRACT_BE_U_4(dp + 3), - EXTRACT_BE_U_4(dp + 4), EXTRACT_BE_U_4(dp + 5))); + EXTRACT_BE_U_4(dp + 4), EXTRACT_BE_U_4(dp + 5)); return (dp + 6); } @@ -1328,12 +1328,12 @@ parse_wcc_data(netdissect_options *ndo, const uint32_t *dp, int verbose) { if (verbose > 1) - ND_PRINT((ndo, " PRE:")); + ND_PRINT(" PRE:"); if (!(dp = parse_pre_op_attr(ndo, dp, verbose))) return (0); if (verbose) - ND_PRINT((ndo, " POST:")); + ND_PRINT(" POST:"); return parse_post_op_attr(ndo, dp, verbose); } @@ -1358,7 +1358,7 @@ parsecreateopres(netdissect_options *ndo, if (!(dp = parse_post_op_attr(ndo, dp, verbose))) return (0); if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, " dir attr:")); + ND_PRINT(" dir attr:"); dp = parse_wcc_data(ndo, dp, verbose); } } @@ -1388,7 +1388,7 @@ parsev3rddirres(netdissect_options *ndo, if (!(dp = parsestatus(ndo, dp, &er))) return (0); if (ndo->ndo_vflag) - ND_PRINT((ndo, " POST:")); + ND_PRINT(" POST:"); if (!(dp = parse_post_op_attr(ndo, dp, verbose))) return (0); if (er) @@ -1399,8 +1399,8 @@ parsev3rddirres(netdissect_options *ndo, * This displays the 8 bytes of the verifier in order, * from the low-order byte to the high-order byte. */ - ND_PRINT((ndo, " verf %08x%08x", - EXTRACT_BE_U_4(dp), EXTRACT_BE_U_4(dp + 1))); + ND_PRINT(" verf %08x%08x", + EXTRACT_BE_U_4(dp), EXTRACT_BE_U_4(dp + 1)); dp += 2; } return dp; @@ -1418,7 +1418,7 @@ parsefsinfo(netdissect_options *ndo, if (!(dp = parsestatus(ndo, dp, &er))) return (0); if (ndo->ndo_vflag) - ND_PRINT((ndo, " POST:")); + ND_PRINT(" POST:"); if (!(dp = parse_post_op_attr(ndo, dp, ndo->ndo_vflag))) return (0); if (er) @@ -1426,20 +1426,20 @@ parsefsinfo(netdissect_options *ndo, sfp = (const struct nfsv3_fsinfo *)dp; ND_TCHECK_SIZE(sfp); - ND_PRINT((ndo, " rtmax %u rtpref %u wtmax %u wtpref %u dtpref %u", + ND_PRINT(" rtmax %u rtpref %u wtmax %u wtpref %u dtpref %u", EXTRACT_BE_U_4(&sfp->fs_rtmax), EXTRACT_BE_U_4(&sfp->fs_rtpref), EXTRACT_BE_U_4(&sfp->fs_wtmax), EXTRACT_BE_U_4(&sfp->fs_wtpref), - EXTRACT_BE_U_4(&sfp->fs_dtpref))); + EXTRACT_BE_U_4(&sfp->fs_dtpref)); if (ndo->ndo_vflag) { - ND_PRINT((ndo, " rtmult %u wtmult %u maxfsz %" PRIu64, + ND_PRINT(" rtmult %u wtmult %u maxfsz %" PRIu64, EXTRACT_BE_U_4(&sfp->fs_rtmult), EXTRACT_BE_U_4(&sfp->fs_wtmult), - EXTRACT_BE_U_8((const uint32_t *)&sfp->fs_maxfilesize))); - ND_PRINT((ndo, " delta %u.%06u ", + EXTRACT_BE_U_8((const uint32_t *)&sfp->fs_maxfilesize)); + ND_PRINT(" delta %u.%06u ", EXTRACT_BE_U_4(&sfp->fs_timedelta.nfsv3_sec), - EXTRACT_BE_U_4(&sfp->fs_timedelta.nfsv3_nsec))); + EXTRACT_BE_U_4(&sfp->fs_timedelta.nfsv3_nsec)); } return (1); trunc: @@ -1456,7 +1456,7 @@ parsepathconf(netdissect_options *ndo, if (!(dp = parsestatus(ndo, dp, &er))) return (0); if (ndo->ndo_vflag) - ND_PRINT((ndo, " POST:")); + ND_PRINT(" POST:"); if (!(dp = parse_post_op_attr(ndo, dp, ndo->ndo_vflag))) return (0); if (er) @@ -1465,13 +1465,13 @@ parsepathconf(netdissect_options *ndo, spp = (const struct nfsv3_pathconf *)dp; ND_TCHECK_SIZE(spp); - ND_PRINT((ndo, " linkmax %u namemax %u %s %s %s %s", + ND_PRINT(" linkmax %u namemax %u %s %s %s %s", EXTRACT_BE_U_4(&spp->pc_linkmax), EXTRACT_BE_U_4(&spp->pc_namemax), EXTRACT_BE_U_4(&spp->pc_notrunc) ? "notrunc" : "", EXTRACT_BE_U_4(&spp->pc_chownrestricted) ? "chownres" : "", EXTRACT_BE_U_4(&spp->pc_caseinsensitive) ? "igncase" : "", - EXTRACT_BE_U_4(&spp->pc_casepreserving) ? "keepcase" : "")); + EXTRACT_BE_U_4(&spp->pc_casepreserving) ? "keepcase" : ""); return (1); trunc: return (0); @@ -1490,7 +1490,7 @@ interp_reply(netdissect_options *ndo, if (!v3 && proc < NFS_NPROCS) proc = nfsv3_procid[proc]; - ND_PRINT((ndo, " %s", tok2str(nfsproc_str, "proc-%u", proc))); + ND_PRINT(" %s", tok2str(nfsproc_str, "proc-%u", proc)); switch (proc) { case NFSPROC_GETATTR: @@ -1519,7 +1519,7 @@ interp_reply(netdissect_options *ndo, break; if (er) { if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, " post dattr:")); + ND_PRINT(" post dattr:"); dp = parse_post_op_attr(ndo, dp, ndo->ndo_vflag); } } else { @@ -1527,7 +1527,7 @@ interp_reply(netdissect_options *ndo, break; if ((dp = parse_post_op_attr(ndo, dp, ndo->ndo_vflag)) && ndo->ndo_vflag > 1) { - ND_PRINT((ndo, " post dattr:")); + ND_PRINT(" post dattr:"); dp = parse_post_op_attr(ndo, dp, ndo->ndo_vflag); } } @@ -1545,12 +1545,12 @@ interp_reply(netdissect_options *ndo, if (!(dp = parsestatus(ndo, dp, &er))) break; if (ndo->ndo_vflag) - ND_PRINT((ndo, " attr:")); + ND_PRINT(" attr:"); if (!(dp = parse_post_op_attr(ndo, dp, ndo->ndo_vflag))) break; if (!er) { ND_TCHECK_4(dp); - ND_PRINT((ndo, " c %04x", EXTRACT_BE_U_4(dp))); + ND_PRINT(" c %04x", EXTRACT_BE_U_4(dp)); } return; @@ -1572,9 +1572,9 @@ interp_reply(netdissect_options *ndo, return; if (ndo->ndo_vflag) { ND_TCHECK_4(dp + 1); - ND_PRINT((ndo, " %u bytes", EXTRACT_BE_U_4(dp))); + ND_PRINT(" %u bytes", EXTRACT_BE_U_4(dp)); if (EXTRACT_BE_U_4(dp + 1)) - ND_PRINT((ndo, " EOF")); + ND_PRINT(" EOF"); } return; } else { @@ -1595,12 +1595,12 @@ interp_reply(netdissect_options *ndo, return; if (ndo->ndo_vflag) { ND_TCHECK_4(dp); - ND_PRINT((ndo, " %u bytes", EXTRACT_BE_U_4(dp))); + ND_PRINT(" %u bytes", EXTRACT_BE_U_4(dp)); if (ndo->ndo_vflag > 1) { ND_TCHECK_4(dp + 1); - ND_PRINT((ndo, " <%s>", + ND_PRINT(" <%s>", tok2str(nfsv3_writemodes, - NULL, EXTRACT_BE_U_4(dp + 1)))); + NULL, EXTRACT_BE_U_4(dp + 1))); } return; } @@ -1662,10 +1662,10 @@ interp_reply(netdissect_options *ndo, if (!(dp = parsestatus(ndo, dp, &er))) break; if (ndo->ndo_vflag) { - ND_PRINT((ndo, " from:")); + ND_PRINT(" from:"); if (!(dp = parse_wcc_data(ndo, dp, ndo->ndo_vflag))) break; - ND_PRINT((ndo, " to:")); + ND_PRINT(" to:"); if (!(dp = parse_wcc_data(ndo, dp, ndo->ndo_vflag))) break; } @@ -1683,10 +1683,10 @@ interp_reply(netdissect_options *ndo, if (!(dp = parsestatus(ndo, dp, &er))) break; if (ndo->ndo_vflag) { - ND_PRINT((ndo, " file POST:")); + ND_PRINT(" file POST:"); if (!(dp = parse_post_op_attr(ndo, dp, ndo->ndo_vflag))) break; - ND_PRINT((ndo, " dir:")); + ND_PRINT(" dir:"); if (!(dp = parse_wcc_data(ndo, dp, ndo->ndo_vflag))) break; return; @@ -1745,5 +1745,5 @@ interp_reply(netdissect_options *ndo, } trunc: if (!nfserr) - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-nsh.c b/print-nsh.c index 2734382c..0ad1364c 100644 --- a/print-nsh.c +++ b/print-nsh.c @@ -82,20 +82,20 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len) service_index = EXTRACT_U_1(bp); bp += 1; - ND_PRINT((ndo, "NSH, ")); + ND_PRINT("NSH, "); if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, "ver %d, ", ver)); + ND_PRINT("ver %d, ", ver); } - ND_PRINT((ndo, "flags [%s], ", bittok2str_nosep(nsh_flags, "none", flags))); + ND_PRINT("flags [%s], ", bittok2str_nosep(nsh_flags, "none", flags)); if (ndo->ndo_vflag > 2) { - ND_PRINT((ndo, "length %d, ", length)); - ND_PRINT((ndo, "md type 0x%x, ", md_type)); + ND_PRINT("length %d, ", length); + ND_PRINT("md type 0x%x, ", md_type); } if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, "next-protocol 0x%x, ", next_protocol)); + ND_PRINT("next-protocol 0x%x, ", next_protocol); } - ND_PRINT((ndo, "service-path-id 0x%06x, ", service_path_id)); - ND_PRINT((ndo, "service-index 0x%x", service_index)); + ND_PRINT("service-path-id 0x%06x, ", service_path_id); + ND_PRINT("service-index 0x%x", service_index); /* Make sure we have all the headers */ if (len < length * NSH_HDR_WORD_SIZE) @@ -119,7 +119,7 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len) for (n = 0; n < length - 2; n++) { ctx = EXTRACT_BE_U_4(bp); bp += NSH_HDR_WORD_SIZE; - ND_PRINT((ndo, "\n Context[%02d]: 0x%08x", n, ctx)); + ND_PRINT("\n Context[%02d]: 0x%08x", n, ctx); } } else if (md_type == 0x02) { @@ -132,33 +132,33 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len) tlv_len = EXTRACT_U_1(bp); bp += 1; - ND_PRINT((ndo, "\n TLV Class %d, Type %d, Len %d", - tlv_class, tlv_type, tlv_len)); + ND_PRINT("\n TLV Class %d, Type %d, Len %d", + tlv_class, tlv_type, tlv_len); n += 1; if (length - 2 < n + tlv_len) { - ND_PRINT((ndo, " ERROR: invalid-tlv-length")); + ND_PRINT(" ERROR: invalid-tlv-length"); return; } for (vn = 0; vn < tlv_len; vn++) { ctx = EXTRACT_BE_U_4(bp); bp += NSH_HDR_WORD_SIZE; - ND_PRINT((ndo, "\n Value[%02d]: 0x%08x", vn, ctx)); + ND_PRINT("\n Value[%02d]: 0x%08x", vn, ctx); } n += tlv_len; } } else { - ND_PRINT((ndo, "ERROR: unknown-next-protocol")); + ND_PRINT("ERROR: unknown-next-protocol"); return; } } else { bp += (length - 2) * NSH_HDR_WORD_SIZE; } - ND_PRINT((ndo, ndo->ndo_vflag ? "\n " : ": ")); + ND_PRINT(ndo->ndo_vflag ? "\n " : ": "); /* print Next Protocol */ next_len = len - length * NSH_HDR_WORD_SIZE; @@ -173,13 +173,13 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len) ether_print(ndo, bp, next_len, ndo->ndo_snapend - bp, NULL, NULL); break; default: - ND_PRINT((ndo, "ERROR: unknown-next-protocol")); + ND_PRINT("ERROR: unknown-next-protocol"); return; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-ntp.c b/print-ntp.c index c9d0a200..9079c616 100644 --- a/print-ntp.c +++ b/print-ntp.c @@ -271,32 +271,32 @@ ntp_time_print(netdissect_options *ndo, ND_TCHECK_1(bp->stratum); stratum = EXTRACT_U_1(bp->stratum); - ND_PRINT((ndo, ", Stratum %u (%s)", + ND_PRINT(", Stratum %u (%s)", stratum, - tok2str(ntp_stratum_values, (stratum >=2 && stratum<=15) ? "secondary reference" : "reserved", stratum))); + tok2str(ntp_stratum_values, (stratum >=2 && stratum<=15) ? "secondary reference" : "reserved", stratum)); ND_TCHECK_1(bp->ppoll); - ND_PRINT((ndo, ", poll %d", EXTRACT_S_1(bp->ppoll))); + ND_PRINT(", poll %d", EXTRACT_S_1(bp->ppoll)); p_poll(ndo, EXTRACT_U_1(bp->ppoll)); ND_TCHECK_1(bp->precision); - ND_PRINT((ndo, ", precision %d", EXTRACT_S_1(bp->precision))); + ND_PRINT(", precision %d", EXTRACT_S_1(bp->precision)); ND_TCHECK(bp->root_delay); - ND_PRINT((ndo, "\n\tRoot Delay: ")); + ND_PRINT("\n\tRoot Delay: "); p_sfix(ndo, &bp->root_delay); ND_TCHECK(bp->root_dispersion); - ND_PRINT((ndo, ", Root dispersion: ")); + ND_PRINT(", Root dispersion: "); p_sfix(ndo, &bp->root_dispersion); ND_TCHECK(bp->refid); - ND_PRINT((ndo, ", Reference-ID: ")); + ND_PRINT(", Reference-ID: "); /* Interpretation depends on stratum */ switch (stratum) { case UNSPECIFIED: - ND_PRINT((ndo, "(unspec)")); + ND_PRINT("(unspec)"); break; case PRIM_REF: @@ -305,79 +305,79 @@ ntp_time_print(netdissect_options *ndo, break; case INFO_QUERY: - ND_PRINT((ndo, "%s INFO_QUERY", ipaddr_string(ndo, &(bp->refid)))); + ND_PRINT("%s INFO_QUERY", ipaddr_string(ndo, &(bp->refid))); /* this doesn't have more content */ return; case INFO_REPLY: - ND_PRINT((ndo, "%s INFO_REPLY", ipaddr_string(ndo, &(bp->refid)))); + ND_PRINT("%s INFO_REPLY", ipaddr_string(ndo, &(bp->refid))); /* this is too complex to be worth printing */ return; default: /* In NTPv4 (RFC 5905) refid is an IPv4 address or first 32 bits of MD5 sum of IPv6 address */ - ND_PRINT((ndo, "0x%08x", EXTRACT_BE_U_4(&bp->refid))); + ND_PRINT("0x%08x", EXTRACT_BE_U_4(&bp->refid)); break; } ND_TCHECK(bp->ref_timestamp); - ND_PRINT((ndo, "\n\t Reference Timestamp: ")); + ND_PRINT("\n\t Reference Timestamp: "); p_ntp_time(ndo, &(bp->ref_timestamp)); ND_TCHECK(bp->org_timestamp); - ND_PRINT((ndo, "\n\t Originator Timestamp: ")); + ND_PRINT("\n\t Originator Timestamp: "); p_ntp_time(ndo, &(bp->org_timestamp)); ND_TCHECK(bp->rec_timestamp); - ND_PRINT((ndo, "\n\t Receive Timestamp: ")); + ND_PRINT("\n\t Receive Timestamp: "); p_ntp_time(ndo, &(bp->rec_timestamp)); ND_TCHECK(bp->xmt_timestamp); - ND_PRINT((ndo, "\n\t Transmit Timestamp: ")); + ND_PRINT("\n\t Transmit Timestamp: "); p_ntp_time(ndo, &(bp->xmt_timestamp)); - ND_PRINT((ndo, "\n\t Originator - Receive Timestamp: ")); + ND_PRINT("\n\t Originator - Receive Timestamp: "); p_ntp_delta(ndo, &(bp->org_timestamp), &(bp->rec_timestamp)); - ND_PRINT((ndo, "\n\t Originator - Transmit Timestamp: ")); + ND_PRINT("\n\t Originator - Transmit Timestamp: "); p_ntp_delta(ndo, &(bp->org_timestamp), &(bp->xmt_timestamp)); /* FIXME: this code is not aware of any extension fields */ if (length == NTP_TIMEMSG_MINLEN + 4) { /* Optional: key-id (crypto-NAK) */ ND_TCHECK_4(bp->key_id); - ND_PRINT((ndo, "\n\tKey id: %u", EXTRACT_BE_U_4(bp->key_id))); + ND_PRINT("\n\tKey id: %u", EXTRACT_BE_U_4(bp->key_id)); } else if (length == NTP_TIMEMSG_MINLEN + 4 + 16) { /* Optional: key-id + 128-bit digest */ ND_TCHECK_4(bp->key_id); - ND_PRINT((ndo, "\n\tKey id: %u", EXTRACT_BE_U_4(bp->key_id))); + ND_PRINT("\n\tKey id: %u", EXTRACT_BE_U_4(bp->key_id)); ND_TCHECK_LEN(bp->message_digest, 16); - ND_PRINT((ndo, "\n\tAuthentication: %08x%08x%08x%08x", + ND_PRINT("\n\tAuthentication: %08x%08x%08x%08x", EXTRACT_BE_U_4(bp->message_digest), EXTRACT_BE_U_4(bp->message_digest + 4), EXTRACT_BE_U_4(bp->message_digest + 8), - EXTRACT_BE_U_4(bp->message_digest + 12))); + EXTRACT_BE_U_4(bp->message_digest + 12)); } else if (length == NTP_TIMEMSG_MINLEN + 4 + 20) { /* Optional: key-id + 160-bit digest */ ND_TCHECK_4(bp->key_id); - ND_PRINT((ndo, "\n\tKey id: %u", EXTRACT_BE_U_4(bp->key_id))); + ND_PRINT("\n\tKey id: %u", EXTRACT_BE_U_4(bp->key_id)); ND_TCHECK_LEN(bp->message_digest, 20); - ND_PRINT((ndo, "\n\tAuthentication: %08x%08x%08x%08x%08x", + ND_PRINT("\n\tAuthentication: %08x%08x%08x%08x%08x", EXTRACT_BE_U_4(bp->message_digest), EXTRACT_BE_U_4(bp->message_digest + 4), EXTRACT_BE_U_4(bp->message_digest + 8), EXTRACT_BE_U_4(bp->message_digest + 12), - EXTRACT_BE_U_4(bp->message_digest + 16))); + EXTRACT_BE_U_4(bp->message_digest + 16)); } else if (length > NTP_TIMEMSG_MINLEN) { - ND_PRINT((ndo, "\n\t(%u more bytes after the header)", length - NTP_TIMEMSG_MINLEN)); + ND_PRINT("\n\t(%u more bytes after the header)", length - NTP_TIMEMSG_MINLEN); } return; invalid: - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); ND_TCHECK_LEN(bp, length); return; trunc: - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); } /* @@ -399,45 +399,45 @@ ntp_control_print(netdissect_options *ndo, E = (control & 0x40) != 0; M = (control & 0x20) != 0; opcode = control & 0x1f; - ND_PRINT((ndo, ", %s, %s, %s, OpCode=%u\n", + ND_PRINT(", %s, %s, %s, OpCode=%u\n", R ? "Response" : "Request", E ? "Error" : "OK", - M ? "More" : "Last", opcode)); + M ? "More" : "Last", opcode); ND_TCHECK_2(cd->sequence); sequence = EXTRACT_BE_U_2(cd->sequence); - ND_PRINT((ndo, "\tSequence=%hu", sequence)); + ND_PRINT("\tSequence=%hu", sequence); ND_TCHECK_2(cd->status); status = EXTRACT_BE_U_2(cd->status); - ND_PRINT((ndo, ", Status=%#hx", status)); + ND_PRINT(", Status=%#hx", status); ND_TCHECK_2(cd->assoc); assoc = EXTRACT_BE_U_2(cd->assoc); - ND_PRINT((ndo, ", Assoc.=%hu", assoc)); + ND_PRINT(", Assoc.=%hu", assoc); ND_TCHECK_2(cd->offset); offset = EXTRACT_BE_U_2(cd->offset); - ND_PRINT((ndo, ", Offset=%hu", offset)); + ND_PRINT(", Offset=%hu", offset); ND_TCHECK_2(cd->count); count = EXTRACT_BE_U_2(cd->count); - ND_PRINT((ndo, ", Count=%hu", count)); + ND_PRINT(", Count=%hu", count); if (NTP_CTRLMSG_MINLEN + count > length) goto invalid; if (count != 0) { ND_TCHECK_LEN(cd->data, count); - ND_PRINT((ndo, "\n\tTO-BE-DONE: data not interpreted")); + ND_PRINT("\n\tTO-BE-DONE: data not interpreted"); } return; invalid: - ND_PRINT((ndo, " %s", istr)); + ND_PRINT(" %s", istr); ND_TCHECK_LEN(cd, length); return; trunc: - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); } union ntpdata { @@ -460,24 +460,24 @@ ntp_print(netdissect_options *ndo, status = EXTRACT_U_1(bp->td.status); version = (status & VERSIONMASK) >> VERSIONSHIFT; - ND_PRINT((ndo, "NTPv%d", version)); + ND_PRINT("NTPv%d", version); mode = (status & MODEMASK) >> MODESHIFT; if (!ndo->ndo_vflag) { - ND_PRINT((ndo, ", %s, length %u", + ND_PRINT(", %s, length %u", tok2str(ntp_mode_values, "Unknown mode", mode), - length)); + length); return; } - ND_PRINT((ndo, ", %s, length %u\n", - tok2str(ntp_mode_values, "Unknown mode", mode), length)); + ND_PRINT(", %s, length %u\n", + tok2str(ntp_mode_values, "Unknown mode", mode), length); /* leapind = (status & LEAPMASK) >> LEAPSHIFT; */ leapind = (status & LEAPMASK); - ND_PRINT((ndo, "\tLeap indicator: %s (%u)", + ND_PRINT("\tLeap indicator: %s (%u)", tok2str(ntp_leapind_values, "Unknown", leapind), - leapind)); + leapind); if (mode >= MODE_UNSPEC && mode <= MODE_BROADCAST) ntp_time_print(ndo, &bp->td, length); @@ -488,7 +488,7 @@ ntp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); } static void @@ -503,7 +503,7 @@ p_sfix(netdissect_options *ndo, f = EXTRACT_BE_U_2(&sfp->fraction); ff = f / 65536.0; /* shift radix point by 16 bits */ f = (int)(ff * 1000000.0); /* Treat fraction as parts per million */ - ND_PRINT((ndo, "%d.%06d", i, f)); + ND_PRINT("%d.%06d", i, f); } #define FMAXINT (4294967296.0) /* floating point rep. of MAXINT */ @@ -524,7 +524,7 @@ p_ntp_time(netdissect_options *ndo, ff += FMAXINT; ff = ff / FMAXINT; /* shift radix point by 32 bits */ f = (uint32_t)(ff * 1000000000.0); /* treat fraction as parts per billion */ - ND_PRINT((ndo, "%u.%09d", i, f)); + ND_PRINT("%u.%09d", i, f); #ifdef HAVE_STRFTIME /* @@ -542,7 +542,7 @@ p_ntp_time(netdissect_options *ndo, * It doesn't fit into a time_t, so we can't hand it * to gmtime. */ - ND_PRINT((ndo, " (unrepresentable)")); + ND_PRINT(" (unrepresentable)"); } else { tm = gmtime(&seconds); if (tm == NULL) { @@ -551,11 +551,11 @@ p_ntp_time(netdissect_options *ndo, * (Yes, that might happen with some version of * Microsoft's C library.) */ - ND_PRINT((ndo, " (unrepresentable)")); + ND_PRINT(" (unrepresentable)"); } else { /* use ISO 8601 (RFC3339) format */ strftime(time_buf, sizeof (time_buf), "%Y-%m-%dT%H:%M:%S", tm); - ND_PRINT((ndo, " (%s)", time_buf)); + ND_PRINT(" (%s)", time_buf); } } } @@ -612,7 +612,7 @@ p_ntp_delta(netdissect_options *ndo, ff += FMAXINT; ff = ff / FMAXINT; /* shift radix point by 32 bits */ f = (uint32_t)(ff * 1000000000.0); /* treat fraction as parts per billion */ - ND_PRINT((ndo, "%s%d.%09d", signbit ? "-" : "+", i, f)); + ND_PRINT("%s%d.%09d", signbit ? "-" : "+", i, f); } /* Prints polling interval in log2 as seconds or fraction of second */ @@ -624,8 +624,8 @@ p_poll(netdissect_options *ndo, return; if (poll_interval >= 0) - ND_PRINT((ndo, " (%us)", 1U << poll_interval)); + ND_PRINT(" (%us)", 1U << poll_interval); else - ND_PRINT((ndo, " (1/%us)", 1U << -poll_interval)); + ND_PRINT(" (1/%us)", 1U << -poll_interval); } diff --git a/print-null.c b/print-null.c index 59b691cc..27e8e4dc 100644 --- a/print-null.c +++ b/print-null.c @@ -56,14 +56,14 @@ static inline void null_hdr_print(netdissect_options *ndo, u_int family, u_int length) { if (!ndo->ndo_qflag) { - ND_PRINT((ndo, "AF %s (%u)", - tok2str(bsd_af_values,"Unknown",family),family)); + ND_PRINT("AF %s (%u)", + tok2str(bsd_af_values,"Unknown",family),family); } else { - ND_PRINT((ndo, "%s", - tok2str(bsd_af_values,"Unknown AF %u",family))); + ND_PRINT("%s", + tok2str(bsd_af_values,"Unknown AF %u",family)); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } /* @@ -80,7 +80,7 @@ null_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char u_int family; if (caplen < NULL_HDRLEN) { - ND_PRINT((ndo, "[|null]")); + ND_PRINT("[|null]"); return (NULL_HDRLEN); } diff --git a/print-olsr.c b/print-olsr.c index 86b39b01..449fc917 100644 --- a/print-olsr.c +++ b/print-olsr.c @@ -242,11 +242,11 @@ olsr_print_lq_neighbor4(netdissect_options *ndo, if (!ND_TTEST_SIZE(lq_neighbor)) return (-1); - ND_PRINT((ndo, "\n\t neighbor %s, link-quality %.2f%%" + ND_PRINT("\n\t neighbor %s, link-quality %.2f%%" ", neighbor-link-quality %.2f%%", ipaddr_string(ndo, lq_neighbor->neighbor), ((double)EXTRACT_U_1(lq_neighbor->link_quality)/2.55), - ((double)EXTRACT_U_1(lq_neighbor->neighbor_link_quality)/2.55))); + ((double)EXTRACT_U_1(lq_neighbor->neighbor_link_quality)/2.55)); msg_data += sizeof(struct olsr_lq_neighbor4); hello_len -= sizeof(struct olsr_lq_neighbor4); @@ -266,11 +266,11 @@ olsr_print_lq_neighbor6(netdissect_options *ndo, if (!ND_TTEST_SIZE(lq_neighbor)) return (-1); - ND_PRINT((ndo, "\n\t neighbor %s, link-quality %.2f%%" + ND_PRINT("\n\t neighbor %s, link-quality %.2f%%" ", neighbor-link-quality %.2f%%", ip6addr_string(ndo, lq_neighbor->neighbor), ((double)EXTRACT_U_1(lq_neighbor->link_quality)/2.55), - ((double)EXTRACT_U_1(lq_neighbor->neighbor_link_quality)/2.55))); + ((double)EXTRACT_U_1(lq_neighbor->neighbor_link_quality)/2.55)); msg_data += sizeof(struct olsr_lq_neighbor6); hello_len -= sizeof(struct olsr_lq_neighbor6); @@ -287,7 +287,7 @@ olsr_print_neighbor(netdissect_options *ndo, { int neighbor; - ND_PRINT((ndo, "\n\t neighbor\n\t\t")); + ND_PRINT("\n\t neighbor\n\t\t"); neighbor = 1; while (hello_len >= sizeof(struct in_addr)) { @@ -296,8 +296,8 @@ olsr_print_neighbor(netdissect_options *ndo, return (-1); /* print 4 neighbors per line */ - ND_PRINT((ndo, "%s%s", ipaddr_string(ndo, msg_data), - neighbor % 4 == 0 ? "\n\t\t" : " ")); + ND_PRINT("%s%s", ipaddr_string(ndo, msg_data), + neighbor % 4 == 0 ? "\n\t\t" : " "); msg_data += sizeof(struct in_addr); hello_len -= sizeof(struct in_addr); @@ -337,10 +337,10 @@ olsr_print(netdissect_options *ndo, ptr.common = (const struct olsr_common *)tptr; length = min(length, EXTRACT_BE_U_2(ptr.common->packet_len)); - ND_PRINT((ndo, "OLSRv%i, seq 0x%04x, length %u", + ND_PRINT("OLSRv%i, seq 0x%04x, length %u", (is_ipv6 == 0) ? 4 : 6, EXTRACT_BE_U_2(ptr.common->packet_seq), - length)); + length); tptr += sizeof(struct olsr_common); @@ -374,7 +374,7 @@ olsr_print(netdissect_options *ndo, return; } - ND_PRINT((ndo, "\n\t%s Message (%#04x), originator %s, ttl %u, hop %u" + ND_PRINT("\n\t%s Message (%#04x), originator %s, ttl %u, hop %u" "\n\t vtime %.3fs, msg-seq 0x%04x, length %u%s", tok2str(olsr_msg_values, "Unknown", msg_type), msg_type, ip6addr_string(ndo, msgptr.v6->originator), @@ -382,7 +382,7 @@ olsr_print(netdissect_options *ndo, EXTRACT_U_1(msgptr.v6->hopcount), ME_TO_DOUBLE(EXTRACT_U_1(msgptr.v6->vtime)), EXTRACT_BE_U_2(msgptr.v6->msg_seq), - msg_len, (msg_len_valid == 0) ? " (invalid)" : "")); + msg_len, (msg_len_valid == 0) ? " (invalid)" : ""); if (!msg_len_valid) { return; } @@ -405,7 +405,7 @@ olsr_print(netdissect_options *ndo, return; } - ND_PRINT((ndo, "\n\t%s Message (%#04x), originator %s, ttl %u, hop %u" + ND_PRINT("\n\t%s Message (%#04x), originator %s, ttl %u, hop %u" "\n\t vtime %.3fs, msg-seq 0x%04x, length %u%s", tok2str(olsr_msg_values, "Unknown", msg_type), msg_type, ipaddr_string(ndo, msgptr.v4->originator), @@ -413,7 +413,7 @@ olsr_print(netdissect_options *ndo, EXTRACT_U_1(msgptr.v4->hopcount), ME_TO_DOUBLE(EXTRACT_U_1(msgptr.v4->vtime)), EXTRACT_BE_U_2(msgptr.v4->msg_seq), - msg_len, (msg_len_valid == 0) ? " (invalid)" : "")); + msg_len, (msg_len_valid == 0) ? " (invalid)" : ""); if (!msg_len_valid) { return; } @@ -430,9 +430,9 @@ olsr_print(netdissect_options *ndo, ND_TCHECK_LEN(msg_data, sizeof(struct olsr_hello)); ptr.hello = (const struct olsr_hello *)msg_data; - ND_PRINT((ndo, "\n\t hello-time %.3fs, MPR willingness %u", + ND_PRINT("\n\t hello-time %.3fs, MPR willingness %u", ME_TO_DOUBLE(EXTRACT_U_1(ptr.hello->htime)), - EXTRACT_U_1(ptr.hello->will))); + EXTRACT_U_1(ptr.hello->will)); msg_data += sizeof(struct olsr_hello); msg_tlen -= sizeof(struct olsr_hello); @@ -454,11 +454,11 @@ olsr_print(netdissect_options *ndo, && (hello_len >= sizeof(struct olsr_hello_link))) hello_len_valid = 1; - ND_PRINT((ndo, "\n\t link-type %s, neighbor-type %s, len %u%s", + ND_PRINT("\n\t link-type %s, neighbor-type %s, len %u%s", tok2str(olsr_link_type_values, "Unknown", link_type), tok2str(olsr_neighbor_type_values, "Unknown", neighbor_type), hello_len, - (hello_len_valid == 0) ? " (invalid)" : "")); + (hello_len_valid == 0) ? " (invalid)" : ""); if (hello_len_valid == 0) break; @@ -493,8 +493,8 @@ olsr_print(netdissect_options *ndo, ND_TCHECK_LEN(msg_data, sizeof(struct olsr_tc)); ptr.tc = (const struct olsr_tc *)msg_data; - ND_PRINT((ndo, "\n\t advertised neighbor seq 0x%04x", - EXTRACT_BE_U_2(ptr.tc->ans_seq))); + ND_PRINT("\n\t advertised neighbor seq 0x%04x", + EXTRACT_BE_U_2(ptr.tc->ans_seq)); msg_data += sizeof(struct olsr_tc); msg_tlen -= sizeof(struct olsr_tc); @@ -521,9 +521,9 @@ olsr_print(netdissect_options *ndo, while (msg_tlen >= addr_size) { ND_TCHECK_LEN(msg_data, addr_size); - ND_PRINT((ndo, "\n\t interface address %s", + ND_PRINT("\n\t interface address %s", is_ipv6 ? ip6addr_string(ndo, msg_data) : - ipaddr_string(ndo, msg_data))); + ipaddr_string(ndo, msg_data)); msg_data += addr_size; msg_tlen -= addr_size; @@ -536,8 +536,8 @@ olsr_print(netdissect_options *ndo, { int i = 0; - ND_PRINT((ndo, "\n\t Advertised networks (total %u)", - (unsigned int) (msg_tlen / sizeof(struct olsr_hna6)))); + ND_PRINT("\n\t Advertised networks (total %u)", + (unsigned int) (msg_tlen / sizeof(struct olsr_hna6))); while (msg_tlen >= sizeof(struct olsr_hna6)) { const struct olsr_hna6 *hna6; @@ -546,9 +546,9 @@ olsr_print(netdissect_options *ndo, hna6 = (const struct olsr_hna6 *)msg_data; - ND_PRINT((ndo, "\n\t #%i: %s/%u", + ND_PRINT("\n\t #%i: %s/%u", i, ip6addr_string(ndo, hna6->network), - mask62plen (hna6->mask))); + mask62plen (hna6->mask)); msg_data += sizeof(struct olsr_hna6); msg_tlen -= sizeof(struct olsr_hna6); @@ -558,8 +558,8 @@ olsr_print(netdissect_options *ndo, { int col = 0; - ND_PRINT((ndo, "\n\t Advertised networks (total %u)", - (unsigned int) (msg_tlen / sizeof(struct olsr_hna4)))); + ND_PRINT("\n\t Advertised networks (total %u)", + (unsigned int) (msg_tlen / sizeof(struct olsr_hna4))); while (msg_tlen >= sizeof(struct olsr_hna4)) { ND_TCHECK_LEN(msg_data, sizeof(struct olsr_hna4)); @@ -572,7 +572,7 @@ olsr_print(netdissect_options *ndo, !ptr.hna->mask[GW_HNA_PAD] && ptr.hna->mask[GW_HNA_FLAGS]) { /* smart gateway */ - ND_PRINT((ndo, "%sSmart-Gateway:%s%s%s%s%s %u/%u", + ND_PRINT("%sSmart-Gateway:%s%s%s%s%s %u/%u", col == 0 ? "\n\t " : ", ", /* indent */ /* sgw */ /* LINKSPEED */ @@ -598,13 +598,13 @@ olsr_print(netdissect_options *ndo, (ptr.hna->mask[GW_HNA_FLAGS] & GW_HNA_FLAG_LINKSPEED) ? deserialize_gw_speed(ptr.hna->mask[GW_HNA_DOWNLINK]) : 0 - )); + ); } else { /* normal route */ - ND_PRINT((ndo, "%s%s/%u", + ND_PRINT("%s%s/%u", col == 0 ? "\n\t " : ", ", ipaddr_string(ndo, ptr.hna->network), - mask2plen(EXTRACT_BE_U_4(ptr.hna->mask)))); + mask2plen(EXTRACT_BE_U_4(ptr.hna->mask))); } msg_data += sizeof(struct olsr_hna4); @@ -636,9 +636,9 @@ olsr_print(netdissect_options *ndo, && ((name_entries * (4 + addr_size)) <= msg_tlen)) name_entries_valid = 1; - ND_PRINT((ndo, "\n\t Version %u, Entries %u%s", + ND_PRINT("\n\t Version %u, Entries %u%s", EXTRACT_BE_U_2(msg_data), - name_entries, (name_entries_valid == 0) ? " (invalid)" : "")); + name_entries, (name_entries_valid == 0) ? " (invalid)" : ""); if (name_entries_valid == 0) break; @@ -662,9 +662,9 @@ olsr_print(netdissect_options *ndo, if ((name_entry_len > 0) && ((addr_size + name_entry_len) <= msg_tlen)) name_entry_len_valid = 1; - ND_PRINT((ndo, "\n\t #%u: type %#06x, length %u%s", + ND_PRINT("\n\t #%u: type %#06x, length %u%s", (unsigned int) i, name_entry_type, - name_entry_len, (name_entry_len_valid == 0) ? " (invalid)" : "")); + name_entry_len, (name_entry_len_valid == 0) ? " (invalid)" : ""); if (name_entry_len_valid == 0) break; @@ -681,13 +681,13 @@ olsr_print(netdissect_options *ndo, addr_size + name_entry_len + name_entry_padding); if (is_ipv6) - ND_PRINT((ndo, ", address %s, name \"", - ip6addr_string(ndo, msg_data))); + ND_PRINT(", address %s, name \"", + ip6addr_string(ndo, msg_data)); else - ND_PRINT((ndo, ", address %s, name \"", - ipaddr_string(ndo, msg_data))); + ND_PRINT(", address %s, name \"", + ipaddr_string(ndo, msg_data)); (void)fn_printn(ndo, msg_data + addr_size, name_entry_len, NULL); - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); msg_data += addr_size + name_entry_len + name_entry_padding; msg_tlen -= addr_size + name_entry_len + name_entry_padding; @@ -710,7 +710,7 @@ olsr_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|olsr]")); + ND_PRINT("[|olsr]"); } /* diff --git a/print-openflow-1.0.c b/print-openflow-1.0.c index d544a3a9..03d26dff 100644 --- a/print-openflow-1.0.c +++ b/print-openflow-1.0.c @@ -726,11 +726,11 @@ of10_bitmap_print(netdissect_options *ndo, /* assigned bits */ for (; t->s != NULL; t++) if (v & t->v) { - ND_PRINT((ndo, "%s%s", sep, t->s)); + ND_PRINT("%s%s", sep, t->s); sep = ", "; } /* unassigned bits? */ - ND_PRINT((ndo, v & u ? ") (bogus)" : ")")); + ND_PRINT(v & u ? ") (bogus)" : ")"); } static const u_char * @@ -740,14 +740,14 @@ of10_data_print(netdissect_options *ndo, if (len == 0) return cp; /* data */ - ND_PRINT((ndo, "\n\t data (%u octets)", len)); + ND_PRINT("\n\t data (%u octets)", len); ND_TCHECK_LEN(cp, len); if (ndo->ndo_vflag >= 2) hex_and_ascii_print(ndo, "\n\t ", cp, len); return cp + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -764,7 +764,7 @@ of10_bsn_message_print(netdissect_options *ndo, ND_TCHECK_4(cp); subtype = EXTRACT_BE_U_4(cp); cp += 4; - ND_PRINT((ndo, "\n\t subtype %s", tok2str(bsn_subtype_str, "unknown (0x%08x)", subtype))); + ND_PRINT("\n\t subtype %s", tok2str(bsn_subtype_str, "unknown (0x%08x)", subtype)); switch (subtype) { case BSN_GET_IP_MASK_REQUEST: /* @@ -783,7 +783,7 @@ of10_bsn_message_print(netdissect_options *ndo, goto invalid; /* index */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", index %u", EXTRACT_U_1(cp))); + ND_PRINT(", index %u", EXTRACT_U_1(cp)); cp += 1; /* pad */ ND_TCHECK_7(cp); @@ -807,14 +807,14 @@ of10_bsn_message_print(netdissect_options *ndo, goto invalid; /* index */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", index %u", EXTRACT_U_1(cp))); + ND_PRINT(", index %u", EXTRACT_U_1(cp)); cp += 1; /* pad */ ND_TCHECK_3(cp); cp += 3; /* mask */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", mask %s", ipaddr_string(ndo, cp))); + ND_PRINT(", mask %s", ipaddr_string(ndo, cp)); cp += 4; break; case BSN_SET_MIRRORING: @@ -834,7 +834,7 @@ of10_bsn_message_print(netdissect_options *ndo, goto invalid; /* report_mirror_ports */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", report_mirror_ports %s", tok2str(bsn_onoff_str, "bogus (%u)", EXTRACT_U_1(cp)))); + ND_PRINT(", report_mirror_ports %s", tok2str(bsn_onoff_str, "bogus (%u)", EXTRACT_U_1(cp))); cp += 1; /* pad */ ND_TCHECK_3(cp); @@ -871,7 +871,7 @@ of10_bsn_message_print(netdissect_options *ndo, goto invalid; /* vport_no */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", vport_no %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", vport_no %u", EXTRACT_BE_U_4(cp)); cp += 4; break; case BSN_SHELL_COMMAND: @@ -891,15 +891,15 @@ of10_bsn_message_print(netdissect_options *ndo, goto invalid; /* service */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", service %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", service %u", EXTRACT_BE_U_4(cp)); cp += 4; /* data */ - ND_PRINT((ndo, ", data '")); + ND_PRINT(", data '"); if (fn_printn(ndo, cp, len - 8, ep)) { - ND_PRINT((ndo, "'")); + ND_PRINT("'"); goto trunc; } - ND_PRINT((ndo, "'")); + ND_PRINT("'"); cp += len - 8; break; case BSN_SHELL_OUTPUT: @@ -915,12 +915,12 @@ of10_bsn_message_print(netdissect_options *ndo, */ /* already checked that len >= 4 */ /* data */ - ND_PRINT((ndo, ", data '")); + ND_PRINT(", data '"); if (fn_printn(ndo, cp, len - 4, ep)) { - ND_PRINT((ndo, "'")); + ND_PRINT("'"); goto trunc; } - ND_PRINT((ndo, "'")); + ND_PRINT("'"); cp += len - 4; break; case BSN_SHELL_STATUS: @@ -938,7 +938,7 @@ of10_bsn_message_print(netdissect_options *ndo, goto invalid; /* status */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", status 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT(", status 0x%08x", EXTRACT_BE_U_4(cp)); cp += 4; break; default: @@ -948,11 +948,11 @@ of10_bsn_message_print(netdissect_options *ndo, return cp; invalid: /* skip the undersized data */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len); return cp0 + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -969,7 +969,7 @@ of10_bsn_actions_print(netdissect_options *ndo, ND_TCHECK_4(cp); subtype = EXTRACT_BE_U_4(cp); cp += 4; - ND_PRINT((ndo, "\n\t subtype %s", tok2str(bsn_action_subtype_str, "unknown (0x%08x)", subtype))); + ND_PRINT("\n\t subtype %s", tok2str(bsn_action_subtype_str, "unknown (0x%08x)", subtype)); switch (subtype) { case BSN_ACTION_MIRROR: /* @@ -990,7 +990,7 @@ of10_bsn_actions_print(netdissect_options *ndo, goto invalid; /* dest_port */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", dest_port %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", dest_port %u", EXTRACT_BE_U_4(cp)); cp += 4; /* vlan_tag */ ND_TCHECK_4(cp); @@ -998,17 +998,17 @@ of10_bsn_actions_print(netdissect_options *ndo, cp += 4; switch (vlan_tag >> 16) { case 0: - ND_PRINT((ndo, ", vlan_tag none")); + ND_PRINT(", vlan_tag none"); break; case ETHERTYPE_8021Q: - ND_PRINT((ndo, ", vlan_tag 802.1Q (%s)", ieee8021q_tci_string(vlan_tag & 0xffff))); + ND_PRINT(", vlan_tag 802.1Q (%s)", ieee8021q_tci_string(vlan_tag & 0xffff)); break; default: - ND_PRINT((ndo, ", vlan_tag unknown (0x%04x)", vlan_tag >> 16)); + ND_PRINT(", vlan_tag unknown (0x%04x)", vlan_tag >> 16); } /* copy_stage */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", copy_stage %s", tok2str(bsn_mirror_copy_stage_str, "unknown (%u)", EXTRACT_U_1(cp)))); + ND_PRINT(", copy_stage %s", tok2str(bsn_mirror_copy_stage_str, "unknown (%u)", EXTRACT_U_1(cp))); cp += 1; /* pad */ ND_TCHECK_3(cp); @@ -1022,11 +1022,11 @@ of10_bsn_actions_print(netdissect_options *ndo, return cp; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len); return cp0 + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1043,7 +1043,7 @@ of10_vendor_action_print(netdissect_options *ndo, ND_TCHECK_4(cp); vendor = EXTRACT_BE_U_4(cp); cp += 4; - ND_PRINT((ndo, ", vendor 0x%08x (%s)", vendor, of_vendor_name(vendor))); + ND_PRINT(", vendor 0x%08x (%s)", vendor, of_vendor_name(vendor)); /* data */ decoder = vendor == OUI_BSN ? of10_bsn_actions_print : @@ -1051,11 +1051,11 @@ of10_vendor_action_print(netdissect_options *ndo, return decoder(ndo, cp, ep, len - 4); invalid: /* skip the undersized data */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, len); return cp + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1072,7 +1072,7 @@ of10_vendor_message_print(netdissect_options *ndo, ND_TCHECK_4(cp); vendor = EXTRACT_BE_U_4(cp); cp += 4; - ND_PRINT((ndo, ", vendor 0x%08x (%s)", vendor, of_vendor_name(vendor))); + ND_PRINT(", vendor 0x%08x (%s)", vendor, of_vendor_name(vendor)); /* data */ decoder = vendor == OUI_BSN ? of10_bsn_message_print : @@ -1080,11 +1080,11 @@ of10_vendor_message_print(netdissect_options *ndo, return decoder(ndo, cp, ep, len - 4); invalid: /* skip the undersized data */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, len); return cp + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1101,16 +1101,16 @@ of10_vendor_data_print(netdissect_options *ndo, ND_TCHECK_4(cp); vendor = EXTRACT_BE_U_4(cp); cp += 4; - ND_PRINT((ndo, ", vendor 0x%08x (%s)", vendor, of_vendor_name(vendor))); + ND_PRINT(", vendor 0x%08x (%s)", vendor, of_vendor_name(vendor)); /* data */ return of10_data_print(ndo, cp, ep, len - 4); invalid: /* skip the undersized data */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, len); return cp + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1121,18 +1121,18 @@ of10_packet_data_print(netdissect_options *ndo, if (len == 0) return cp; /* data */ - ND_PRINT((ndo, "\n\t data (%u octets)", len)); + ND_PRINT("\n\t data (%u octets)", len); if (ndo->ndo_vflag < 3) return cp + len; ND_TCHECK_LEN(cp, len); ndo->ndo_vflag -= 3; - ND_PRINT((ndo, ", frame decoding below\n")); + ND_PRINT(", frame decoding below\n"); ether_print(ndo, cp, len, ndo->ndo_snapend - cp, NULL, NULL); ndo->ndo_vflag += 3; return cp + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1149,17 +1149,17 @@ of10_phy_ports_print(netdissect_options *ndo, goto invalid; /* port_no */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* hw_addr */ ND_TCHECK_LEN(cp, MAC_ADDR_LEN); - ND_PRINT((ndo, ", hw_addr %s", etheraddr_string(ndo, cp))); + ND_PRINT(", hw_addr %s", etheraddr_string(ndo, cp)); cp += MAC_ADDR_LEN; /* name */ ND_TCHECK_LEN(cp, OFP_MAX_PORT_NAME_LEN); - ND_PRINT((ndo, ", name '")); + ND_PRINT(", name '"); fn_print(ndo, cp, cp + OFP_MAX_PORT_NAME_LEN); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); cp += OFP_MAX_PORT_NAME_LEN; if (ndo->ndo_vflag < 2) { @@ -1169,37 +1169,37 @@ of10_phy_ports_print(netdissect_options *ndo, } /* config */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t config 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t config 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofppc_bm, EXTRACT_BE_U_4(cp), OFPPC_U); cp += 4; /* state */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t state 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t state 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofpps_bm, EXTRACT_BE_U_4(cp), OFPPS_U); cp += 4; /* curr */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t curr 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t curr 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofppf_bm, EXTRACT_BE_U_4(cp), OFPPF_U); cp += 4; /* advertised */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t advertised 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t advertised 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofppf_bm, EXTRACT_BE_U_4(cp), OFPPF_U); cp += 4; /* supported */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t supported 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t supported 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofppf_bm, EXTRACT_BE_U_4(cp), OFPPF_U); cp += 4; /* peer */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t peer 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t peer 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofppf_bm, EXTRACT_BE_U_4(cp), OFPPF_U); cp += 4; @@ -1209,11 +1209,11 @@ next_port: return cp; invalid: /* skip the undersized trailing data */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1235,12 +1235,12 @@ of10_queue_props_print(netdissect_options *ndo, ND_TCHECK_2(cp); property = EXTRACT_BE_U_2(cp); cp += 2; - ND_PRINT((ndo, "\n\t property %s", tok2str(ofpqt_str, "invalid (0x%04x)", property))); + ND_PRINT("\n\t property %s", tok2str(ofpqt_str, "invalid (0x%04x)", property)); /* len */ ND_TCHECK_2(cp); plen = EXTRACT_BE_U_2(cp); cp += 2; - ND_PRINT((ndo, ", len %u", plen)); + ND_PRINT(", len %u", plen); if (plen < OF_QUEUE_PROP_HEADER_LEN || plen > len) goto invalid; /* pad */ @@ -1258,7 +1258,7 @@ of10_queue_props_print(netdissect_options *ndo, skip = 1; } if (plen_bogus) { - ND_PRINT((ndo, " (bogus)")); + ND_PRINT(" (bogus)"); skip = 1; } if (skip) { @@ -1272,9 +1272,9 @@ of10_queue_props_print(netdissect_options *ndo, rate = EXTRACT_BE_U_2(cp); cp += 2; if (rate > 1000) - ND_PRINT((ndo, ", rate disabled")); + ND_PRINT(", rate disabled"); else - ND_PRINT((ndo, ", rate %u.%u%%", rate / 10, rate % 10)); + ND_PRINT(", rate %u.%u%%", rate / 10, rate % 10); /* pad */ ND_TCHECK_6(cp); cp += 6; @@ -1285,11 +1285,11 @@ next_property: return cp; invalid: /* skip the rest of queue properties */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1307,13 +1307,13 @@ of10_queues_print(netdissect_options *ndo, goto invalid; /* queue_id */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t queue_id %u", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t queue_id %u", EXTRACT_BE_U_4(cp)); cp += 4; /* len */ ND_TCHECK_2(cp); desclen = EXTRACT_BE_U_2(cp); cp += 2; - ND_PRINT((ndo, ", len %u", desclen)); + ND_PRINT(", len %u", desclen); if (desclen < OF_PACKET_QUEUE_LEN || desclen > len) goto invalid; /* pad */ @@ -1333,11 +1333,11 @@ next_queue: return cp; invalid: /* skip the rest of queues */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1356,32 +1356,32 @@ of10_match_print(netdissect_options *ndo, ND_TCHECK_4(cp); wildcards = EXTRACT_BE_U_4(cp); if (wildcards & OFPFW_U) - ND_PRINT((ndo, "%swildcards 0x%08x (bogus)", pfx, wildcards)); + ND_PRINT("%swildcards 0x%08x (bogus)", pfx, wildcards); cp += 4; /* in_port */ ND_TCHECK_2(cp); if (! (wildcards & OFPFW_IN_PORT)) - ND_PRINT((ndo, "%smatch in_port %s", pfx, tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT("%smatch in_port %s", pfx, tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* dl_src */ ND_TCHECK_LEN(cp, MAC_ADDR_LEN); if (! (wildcards & OFPFW_DL_SRC)) - ND_PRINT((ndo, "%smatch dl_src %s", pfx, etheraddr_string(ndo, cp))); + ND_PRINT("%smatch dl_src %s", pfx, etheraddr_string(ndo, cp)); cp += MAC_ADDR_LEN; /* dl_dst */ ND_TCHECK_LEN(cp, MAC_ADDR_LEN); if (! (wildcards & OFPFW_DL_DST)) - ND_PRINT((ndo, "%smatch dl_dst %s", pfx, etheraddr_string(ndo, cp))); + ND_PRINT("%smatch dl_dst %s", pfx, etheraddr_string(ndo, cp)); cp += MAC_ADDR_LEN; /* dl_vlan */ ND_TCHECK_2(cp); if (! (wildcards & OFPFW_DL_VLAN)) - ND_PRINT((ndo, "%smatch dl_vlan %s", pfx, vlan_str(EXTRACT_BE_U_2(cp)))); + ND_PRINT("%smatch dl_vlan %s", pfx, vlan_str(EXTRACT_BE_U_2(cp))); cp += 2; /* dl_vlan_pcp */ ND_TCHECK_1(cp); if (! (wildcards & OFPFW_DL_VLAN_PCP)) - ND_PRINT((ndo, "%smatch dl_vlan_pcp %s", pfx, pcp_str(EXTRACT_U_1(cp)))); + ND_PRINT("%smatch dl_vlan_pcp %s", pfx, pcp_str(EXTRACT_U_1(cp))); cp += 1; /* pad1 */ ND_TCHECK_1(cp); @@ -1391,11 +1391,11 @@ of10_match_print(netdissect_options *ndo, dl_type = EXTRACT_BE_U_2(cp); cp += 2; if (! (wildcards & OFPFW_DL_TYPE)) - ND_PRINT((ndo, "%smatch dl_type 0x%04x", pfx, dl_type)); + ND_PRINT("%smatch dl_type 0x%04x", pfx, dl_type); /* nw_tos */ ND_TCHECK_1(cp); if (! (wildcards & OFPFW_NW_TOS)) - ND_PRINT((ndo, "%smatch nw_tos 0x%02x", pfx, EXTRACT_U_1(cp))); + ND_PRINT("%smatch nw_tos 0x%02x", pfx, EXTRACT_U_1(cp)); cp += 1; /* nw_proto */ ND_TCHECK_1(cp); @@ -1404,7 +1404,7 @@ of10_match_print(netdissect_options *ndo, if (! (wildcards & OFPFW_NW_PROTO)) { field_name = ! (wildcards & OFPFW_DL_TYPE) && dl_type == ETHERTYPE_ARP ? "arp_opcode" : "nw_proto"; - ND_PRINT((ndo, "%smatch %s %u", pfx, field_name, nw_proto)); + ND_PRINT("%smatch %s %u", pfx, field_name, nw_proto); } /* pad2 */ ND_TCHECK_2(cp); @@ -1413,13 +1413,13 @@ of10_match_print(netdissect_options *ndo, ND_TCHECK_4(cp); nw_bits = (wildcards & OFPFW_NW_SRC_MASK) >> OFPFW_NW_SRC_SHIFT; if (nw_bits < 32) - ND_PRINT((ndo, "%smatch nw_src %s/%u", pfx, ipaddr_string(ndo, cp), 32 - nw_bits)); + ND_PRINT("%smatch nw_src %s/%u", pfx, ipaddr_string(ndo, cp), 32 - nw_bits); cp += 4; /* nw_dst */ ND_TCHECK_4(cp); nw_bits = (wildcards & OFPFW_NW_DST_MASK) >> OFPFW_NW_DST_SHIFT; if (nw_bits < 32) - ND_PRINT((ndo, "%smatch nw_dst %s/%u", pfx, ipaddr_string(ndo, cp), 32 - nw_bits)); + ND_PRINT("%smatch nw_dst %s/%u", pfx, ipaddr_string(ndo, cp), 32 - nw_bits); cp += 4; /* tp_src */ ND_TCHECK_2(cp); @@ -1427,7 +1427,7 @@ of10_match_print(netdissect_options *ndo, field_name = ! (wildcards & OFPFW_DL_TYPE) && dl_type == ETHERTYPE_IP && ! (wildcards & OFPFW_NW_PROTO) && nw_proto == IPPROTO_ICMP ? "icmp_type" : "tp_src"; - ND_PRINT((ndo, "%smatch %s %u", pfx, field_name, EXTRACT_BE_U_2(cp))); + ND_PRINT("%smatch %s %u", pfx, field_name, EXTRACT_BE_U_2(cp)); } cp += 2; /* tp_dst */ @@ -1436,12 +1436,12 @@ of10_match_print(netdissect_options *ndo, field_name = ! (wildcards & OFPFW_DL_TYPE) && dl_type == ETHERTYPE_IP && ! (wildcards & OFPFW_NW_PROTO) && nw_proto == IPPROTO_ICMP ? "icmp_code" : "tp_dst"; - ND_PRINT((ndo, "%smatch %s %u", pfx, field_name, EXTRACT_BE_U_2(cp))); + ND_PRINT("%smatch %s %u", pfx, field_name, EXTRACT_BE_U_2(cp)); } return cp + 2; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1464,12 +1464,12 @@ of10_actions_print(netdissect_options *ndo, ND_TCHECK_2(cp); type = EXTRACT_BE_U_2(cp); cp += 2; - ND_PRINT((ndo, "%saction type %s", pfx, tok2str(ofpat_str, "invalid (0x%04x)", type))); + ND_PRINT("%saction type %s", pfx, tok2str(ofpat_str, "invalid (0x%04x)", type)); /* length */ ND_TCHECK_2(cp); alen = EXTRACT_BE_U_2(cp); cp += 2; - ND_PRINT((ndo, ", len %u", alen)); + ND_PRINT(", len %u", alen); /* On action size underrun/overrun skip the rest of the action list. */ if (alen < OF_ACTION_HEADER_LEN || alen > len) goto invalid; @@ -1499,7 +1499,7 @@ of10_actions_print(netdissect_options *ndo, skip = 1; } if (alen_bogus) { - ND_PRINT((ndo, " (bogus)")); + ND_PRINT(" (bogus)"); skip = 1; } if (skip) { @@ -1514,17 +1514,17 @@ of10_actions_print(netdissect_options *ndo, ND_TCHECK_2(cp); output_port = EXTRACT_BE_U_2(cp); cp += 2; - ND_PRINT((ndo, ", port %s", tok2str(ofpp_str, "%u", output_port))); + ND_PRINT(", port %s", tok2str(ofpp_str, "%u", output_port)); /* max_len */ ND_TCHECK_2(cp); if (output_port == OFPP_CONTROLLER) - ND_PRINT((ndo, ", max_len %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", max_len %u", EXTRACT_BE_U_2(cp)); cp += 2; break; case OFPAT_SET_VLAN_VID: /* vlan_vid */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", vlan_vid %s", vlan_str(EXTRACT_BE_U_2(cp)))); + ND_PRINT(", vlan_vid %s", vlan_str(EXTRACT_BE_U_2(cp))); cp += 2; /* pad */ ND_TCHECK_2(cp); @@ -1533,7 +1533,7 @@ of10_actions_print(netdissect_options *ndo, case OFPAT_SET_VLAN_PCP: /* vlan_pcp */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", vlan_pcp %s", pcp_str(EXTRACT_U_1(cp)))); + ND_PRINT(", vlan_pcp %s", pcp_str(EXTRACT_U_1(cp))); cp += 1; /* pad */ ND_TCHECK_3(cp); @@ -1543,7 +1543,7 @@ of10_actions_print(netdissect_options *ndo, case OFPAT_SET_DL_DST: /* dl_addr */ ND_TCHECK_LEN(cp, MAC_ADDR_LEN); - ND_PRINT((ndo, ", dl_addr %s", etheraddr_string(ndo, cp))); + ND_PRINT(", dl_addr %s", etheraddr_string(ndo, cp)); cp += MAC_ADDR_LEN; /* pad */ ND_TCHECK_6(cp); @@ -1553,13 +1553,13 @@ of10_actions_print(netdissect_options *ndo, case OFPAT_SET_NW_DST: /* nw_addr */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", nw_addr %s", ipaddr_string(ndo, cp))); + ND_PRINT(", nw_addr %s", ipaddr_string(ndo, cp)); cp += 4; break; case OFPAT_SET_NW_TOS: /* nw_tos */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", nw_tos 0x%02x", EXTRACT_U_1(cp))); + ND_PRINT(", nw_tos 0x%02x", EXTRACT_U_1(cp)); cp += 1; /* pad */ ND_TCHECK_3(cp); @@ -1569,7 +1569,7 @@ of10_actions_print(netdissect_options *ndo, case OFPAT_SET_TP_DST: /* nw_tos */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", tp_port %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", tp_port %u", EXTRACT_BE_U_2(cp)); cp += 2; /* pad */ ND_TCHECK_2(cp); @@ -1578,14 +1578,14 @@ of10_actions_print(netdissect_options *ndo, case OFPAT_ENQUEUE: /* port */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT(", port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* pad */ ND_TCHECK_6(cp); cp += 6; /* queue_id */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", queue_id %s", tok2str(ofpq_str, "%u", EXTRACT_BE_U_4(cp)))); + ND_PRINT(", queue_id %s", tok2str(ofpq_str, "%u", EXTRACT_BE_U_4(cp))); cp += 4; break; case OFPAT_VENDOR: @@ -1604,11 +1604,11 @@ next_action: return cp; invalid: /* skip the rest of actions */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1619,35 +1619,35 @@ of10_features_reply_print(netdissect_options *ndo, { /* datapath_id */ ND_TCHECK_8(cp); - ND_PRINT((ndo, "\n\t dpid 0x%016" PRIx64, EXTRACT_BE_U_8(cp))); + ND_PRINT("\n\t dpid 0x%016" PRIx64, EXTRACT_BE_U_8(cp)); cp += 8; /* n_buffers */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", n_buffers %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", n_buffers %u", EXTRACT_BE_U_4(cp)); cp += 4; /* n_tables */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", n_tables %u", EXTRACT_U_1(cp))); + ND_PRINT(", n_tables %u", EXTRACT_U_1(cp)); cp += 1; /* pad */ ND_TCHECK_3(cp); cp += 3; /* capabilities */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t capabilities 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t capabilities 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofp_capabilities_bm, EXTRACT_BE_U_4(cp), OFPCAP_U); cp += 4; /* actions */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t actions 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t actions 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofpat_bm, EXTRACT_BE_U_4(cp), OFPAT_U); cp += 4; /* ports */ return of10_phy_ports_print(ndo, cp, ep, len - OF_SWITCH_FEATURES_LEN); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1663,49 +1663,49 @@ of10_flow_mod_print(netdissect_options *ndo, return ep; /* end of snapshot */ /* cookie */ ND_TCHECK_8(cp); - ND_PRINT((ndo, "\n\t cookie 0x%016" PRIx64, EXTRACT_BE_U_8(cp))); + ND_PRINT("\n\t cookie 0x%016" PRIx64, EXTRACT_BE_U_8(cp)); cp += 8; /* command */ ND_TCHECK_2(cp); command = EXTRACT_BE_U_2(cp); - ND_PRINT((ndo, ", command %s", tok2str(ofpfc_str, "invalid (0x%04x)", command))); + ND_PRINT(", command %s", tok2str(ofpfc_str, "invalid (0x%04x)", command)); cp += 2; /* idle_timeout */ ND_TCHECK_2(cp); if (EXTRACT_BE_U_2(cp)) - ND_PRINT((ndo, ", idle_timeout %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", idle_timeout %u", EXTRACT_BE_U_2(cp)); cp += 2; /* hard_timeout */ ND_TCHECK_2(cp); if (EXTRACT_BE_U_2(cp)) - ND_PRINT((ndo, ", hard_timeout %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", hard_timeout %u", EXTRACT_BE_U_2(cp)); cp += 2; /* priority */ ND_TCHECK_2(cp); if (EXTRACT_BE_U_2(cp)) - ND_PRINT((ndo, ", priority %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", priority %u", EXTRACT_BE_U_2(cp)); cp += 2; /* buffer_id */ ND_TCHECK_4(cp); if (command == OFPFC_ADD || command == OFPFC_MODIFY || command == OFPFC_MODIFY_STRICT) - ND_PRINT((ndo, ", buffer_id %s", tok2str(bufferid_str, "0x%08x", EXTRACT_BE_U_4(cp)))); + ND_PRINT(", buffer_id %s", tok2str(bufferid_str, "0x%08x", EXTRACT_BE_U_4(cp))); cp += 4; /* out_port */ ND_TCHECK_2(cp); if (command == OFPFC_DELETE || command == OFPFC_DELETE_STRICT) - ND_PRINT((ndo, ", out_port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT(", out_port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* flags */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", flags 0x%04x", EXTRACT_BE_U_2(cp))); + ND_PRINT(", flags 0x%04x", EXTRACT_BE_U_2(cp)); of10_bitmap_print(ndo, ofpff_bm, EXTRACT_BE_U_2(cp), OFPFF_U); cp += 2; /* actions */ return of10_actions_print(ndo, "\n\t ", cp, ep, len - OF_FLOW_MOD_LEN); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1716,25 +1716,25 @@ of10_port_mod_print(netdissect_options *ndo, { /* port_no */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* hw_addr */ ND_TCHECK_LEN(cp, MAC_ADDR_LEN); - ND_PRINT((ndo, ", hw_addr %s", etheraddr_string(ndo, cp))); + ND_PRINT(", hw_addr %s", etheraddr_string(ndo, cp)); cp += MAC_ADDR_LEN; /* config */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t config 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t config 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofppc_bm, EXTRACT_BE_U_4(cp), OFPPC_U); cp += 4; /* mask */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t mask 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t mask 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofppc_bm, EXTRACT_BE_U_4(cp), OFPPC_U); cp += 4; /* advertise */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t advertise 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t advertise 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofppf_bm, EXTRACT_BE_U_4(cp), OFPPF_U); cp += 4; /* pad */ @@ -1742,7 +1742,7 @@ of10_port_mod_print(netdissect_options *ndo, return cp + 4; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1759,12 +1759,12 @@ of10_stats_request_print(netdissect_options *ndo, ND_TCHECK_2(cp); type = EXTRACT_BE_U_2(cp); cp += 2; - ND_PRINT((ndo, "\n\t type %s", tok2str(ofpst_str, "invalid (0x%04x)", type))); + ND_PRINT("\n\t type %s", tok2str(ofpst_str, "invalid (0x%04x)", type)); /* flags */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", flags 0x%04x", EXTRACT_BE_U_2(cp))); + ND_PRINT(", flags 0x%04x", EXTRACT_BE_U_2(cp)); if (EXTRACT_BE_U_2(cp)) - ND_PRINT((ndo, " (bogus)")); + ND_PRINT(" (bogus)"); cp += 2; /* type-specific body of one of fixed lengths */ len -= OF_STATS_REQUEST_LEN; @@ -1783,21 +1783,21 @@ of10_stats_request_print(netdissect_options *ndo, return ep; /* end of snapshot */ /* table_id */ ND_TCHECK_1(cp); - ND_PRINT((ndo, "\n\t table_id %s", tok2str(tableid_str, "%u", EXTRACT_U_1(cp)))); + ND_PRINT("\n\t table_id %s", tok2str(tableid_str, "%u", EXTRACT_U_1(cp))); cp += 1; /* pad */ ND_TCHECK_1(cp); cp += 1; /* out_port */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", out_port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT(", out_port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); return cp + 2; case OFPST_PORT: if (len != OF_PORT_STATS_REQUEST_LEN) goto invalid; /* port_no */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* pad */ ND_TCHECK_6(cp); @@ -1807,14 +1807,14 @@ of10_stats_request_print(netdissect_options *ndo, goto invalid; /* port_no */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* pad */ ND_TCHECK_2(cp); cp += 2; /* queue_id */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", queue_id %s", tok2str(ofpq_str, "%u", EXTRACT_BE_U_4(cp)))); + ND_PRINT(", queue_id %s", tok2str(ofpq_str, "%u", EXTRACT_BE_U_4(cp))); return cp + 4; case OFPST_VENDOR: return of10_vendor_data_print(ndo, cp, ep, len); @@ -1822,11 +1822,11 @@ of10_stats_request_print(netdissect_options *ndo, return cp; invalid: /* skip the message body */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1839,41 +1839,41 @@ of10_desc_stats_reply_print(netdissect_options *ndo, goto invalid; /* mfr_desc */ ND_TCHECK_LEN(cp, DESC_STR_LEN); - ND_PRINT((ndo, "\n\t mfr_desc '")); + ND_PRINT("\n\t mfr_desc '"); fn_print(ndo, cp, cp + DESC_STR_LEN); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); cp += DESC_STR_LEN; /* hw_desc */ ND_TCHECK_LEN(cp, DESC_STR_LEN); - ND_PRINT((ndo, "\n\t hw_desc '")); + ND_PRINT("\n\t hw_desc '"); fn_print(ndo, cp, cp + DESC_STR_LEN); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); cp += DESC_STR_LEN; /* sw_desc */ ND_TCHECK_LEN(cp, DESC_STR_LEN); - ND_PRINT((ndo, "\n\t sw_desc '")); + ND_PRINT("\n\t sw_desc '"); fn_print(ndo, cp, cp + DESC_STR_LEN); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); cp += DESC_STR_LEN; /* serial_num */ ND_TCHECK_LEN(cp, SERIAL_NUM_LEN); - ND_PRINT((ndo, "\n\t serial_num '")); + ND_PRINT("\n\t serial_num '"); fn_print(ndo, cp, cp + SERIAL_NUM_LEN); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); cp += SERIAL_NUM_LEN; /* dp_desc */ ND_TCHECK_LEN(cp, DESC_STR_LEN); - ND_PRINT((ndo, "\n\t dp_desc '")); + ND_PRINT("\n\t dp_desc '"); fn_print(ndo, cp, cp + DESC_STR_LEN); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); return cp + DESC_STR_LEN; invalid: /* skip the message body */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, len); return cp + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1892,13 +1892,13 @@ of10_flow_stats_reply_print(netdissect_options *ndo, /* length */ ND_TCHECK_2(cp); entry_len = EXTRACT_BE_U_2(cp); - ND_PRINT((ndo, "\n\t length %u", entry_len)); + ND_PRINT("\n\t length %u", entry_len); if (entry_len < OF_FLOW_STATS_LEN || entry_len > len) goto invalid; cp += 2; /* table_id */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", table_id %s", tok2str(tableid_str, "%u", EXTRACT_U_1(cp)))); + ND_PRINT(", table_id %s", tok2str(tableid_str, "%u", EXTRACT_U_1(cp))); cp += 1; /* pad */ ND_TCHECK_1(cp); @@ -1908,38 +1908,38 @@ of10_flow_stats_reply_print(netdissect_options *ndo, return ep; /* end of snapshot */ /* duration_sec */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t duration_sec %u", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t duration_sec %u", EXTRACT_BE_U_4(cp)); cp += 4; /* duration_nsec */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", duration_nsec %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", duration_nsec %u", EXTRACT_BE_U_4(cp)); cp += 4; /* priority */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", priority %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", priority %u", EXTRACT_BE_U_2(cp)); cp += 2; /* idle_timeout */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", idle_timeout %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", idle_timeout %u", EXTRACT_BE_U_2(cp)); cp += 2; /* hard_timeout */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", hard_timeout %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", hard_timeout %u", EXTRACT_BE_U_2(cp)); cp += 2; /* pad2 */ ND_TCHECK_6(cp); cp += 6; /* cookie */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", cookie 0x%016" PRIx64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", cookie 0x%016" PRIx64, EXTRACT_BE_U_8(cp)); cp += 8; /* packet_count */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", packet_count %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", packet_count %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* byte_count */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", byte_count %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", byte_count %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* actions */ if (ep == (cp = of10_actions_print(ndo, "\n\t ", cp, ep, entry_len - OF_FLOW_STATS_LEN))) @@ -1950,11 +1950,11 @@ of10_flow_stats_reply_print(netdissect_options *ndo, return cp; invalid: /* skip the rest of flow statistics entries */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -1968,26 +1968,26 @@ of10_aggregate_stats_reply_print(netdissect_options *ndo, goto invalid; /* packet_count */ ND_TCHECK_8(cp); - ND_PRINT((ndo, "\n\t packet_count %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT("\n\t packet_count %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* byte_count */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", byte_count %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", byte_count %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* flow_count */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", flow_count %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", flow_count %u", EXTRACT_BE_U_4(cp)); cp += 4; /* pad */ ND_TCHECK_4(cp); return cp + 4; invalid: /* skip the message body */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, len); return cp + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -2004,38 +2004,38 @@ of10_table_stats_reply_print(netdissect_options *ndo, goto invalid; /* table_id */ ND_TCHECK_1(cp); - ND_PRINT((ndo, "\n\t table_id %s", tok2str(tableid_str, "%u", EXTRACT_U_1(cp)))); + ND_PRINT("\n\t table_id %s", tok2str(tableid_str, "%u", EXTRACT_U_1(cp))); cp += 1; /* pad */ ND_TCHECK_3(cp); cp += 3; /* name */ ND_TCHECK_LEN(cp, OFP_MAX_TABLE_NAME_LEN); - ND_PRINT((ndo, ", name '")); + ND_PRINT(", name '"); fn_print(ndo, cp, cp + OFP_MAX_TABLE_NAME_LEN); - ND_PRINT((ndo, "'")); + ND_PRINT("'"); cp += OFP_MAX_TABLE_NAME_LEN; /* wildcards */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t wildcards 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t wildcards 0x%08x", EXTRACT_BE_U_4(cp)); of10_bitmap_print(ndo, ofpfw_bm, EXTRACT_BE_U_4(cp), OFPFW_U); cp += 4; /* max_entries */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t max_entries %u", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t max_entries %u", EXTRACT_BE_U_4(cp)); cp += 4; /* active_count */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", active_count %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", active_count %u", EXTRACT_BE_U_4(cp)); cp += 4; /* lookup_count */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", lookup_count %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", lookup_count %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* matched_count */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", matched_count %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", matched_count %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; len -= OF_TABLE_STATS_LEN; @@ -2043,11 +2043,11 @@ of10_table_stats_reply_print(netdissect_options *ndo, return cp; invalid: /* skip the undersized trailing data */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -2064,7 +2064,7 @@ of10_port_stats_reply_print(netdissect_options *ndo, goto invalid; /* port_no */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; if (ndo->ndo_vflag < 2) { ND_TCHECK_LEN(cp, OF_PORT_STATS_LEN - 2); @@ -2076,51 +2076,51 @@ of10_port_stats_reply_print(netdissect_options *ndo, cp += 6; /* rx_packets */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", rx_packets %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", rx_packets %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* tx_packets */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", tx_packets %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", tx_packets %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* rx_bytes */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", rx_bytes %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", rx_bytes %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* tx_bytes */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", tx_bytes %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", tx_bytes %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* rx_dropped */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", rx_dropped %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", rx_dropped %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* tx_dropped */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", tx_dropped %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", tx_dropped %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* rx_errors */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", rx_errors %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", rx_errors %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* tx_errors */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", tx_errors %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", tx_errors %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* rx_frame_err */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", rx_frame_err %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", rx_frame_err %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* rx_over_err */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", rx_over_err %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", rx_over_err %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* rx_crc_err */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", rx_crc_err %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", rx_crc_err %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* collisions */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", collisions %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", collisions %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; next_port: len -= OF_PORT_STATS_LEN; @@ -2128,11 +2128,11 @@ next_port: return cp; invalid: /* skip the undersized trailing data */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -2149,26 +2149,26 @@ of10_queue_stats_reply_print(netdissect_options *ndo, goto invalid; /* port_no */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* pad */ ND_TCHECK_2(cp); cp += 2; /* queue_id */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", queue_id %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", queue_id %u", EXTRACT_BE_U_4(cp)); cp += 4; /* tx_bytes */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", tx_bytes %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", tx_bytes %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* tx_packets */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", tx_packets %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", tx_packets %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* tx_errors */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", tx_errors %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", tx_errors %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; len -= OF_QUEUE_STATS_LEN; @@ -2176,11 +2176,11 @@ of10_queue_stats_reply_print(netdissect_options *ndo, return cp; invalid: /* skip the undersized trailing data */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -2195,11 +2195,11 @@ of10_stats_reply_print(netdissect_options *ndo, /* type */ ND_TCHECK_2(cp); type = EXTRACT_BE_U_2(cp); - ND_PRINT((ndo, "\n\t type %s", tok2str(ofpst_str, "invalid (0x%04x)", type))); + ND_PRINT("\n\t type %s", tok2str(ofpst_str, "invalid (0x%04x)", type)); cp += 2; /* flags */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", flags 0x%04x", EXTRACT_BE_U_2(cp))); + ND_PRINT(", flags 0x%04x", EXTRACT_BE_U_2(cp)); of10_bitmap_print(ndo, ofpsf_reply_bm, EXTRACT_BE_U_2(cp), OFPSF_REPLY_U); cp += 2; @@ -2221,7 +2221,7 @@ of10_stats_reply_print(netdissect_options *ndo, return cp0 + len; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -2236,11 +2236,11 @@ of10_packet_out_print(netdissect_options *ndo, /* buffer_id */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t buffer_id 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT("\n\t buffer_id 0x%08x", EXTRACT_BE_U_4(cp)); cp += 4; /* in_port */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", in_port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT(", in_port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* actions_len */ ND_TCHECK_2(cp); @@ -2255,11 +2255,11 @@ of10_packet_out_print(netdissect_options *ndo, return of10_packet_data_print(ndo, cp, ep, len - OF_PACKET_OUT_LEN - actions_len); invalid: /* skip the rest of the message body */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp0, len0); return cp0 + len0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -2270,19 +2270,19 @@ of10_packet_in_print(netdissect_options *ndo, { /* buffer_id */ ND_TCHECK_4(cp); - ND_PRINT((ndo, "\n\t buffer_id %s", tok2str(bufferid_str, "0x%08x", EXTRACT_BE_U_4(cp)))); + ND_PRINT("\n\t buffer_id %s", tok2str(bufferid_str, "0x%08x", EXTRACT_BE_U_4(cp))); cp += 4; /* total_len */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", total_len %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", total_len %u", EXTRACT_BE_U_2(cp)); cp += 2; /* in_port */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", in_port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT(", in_port %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* reason */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", reason %s", tok2str(ofpr_str, "invalid (0x%02x)", EXTRACT_U_1(cp)))); + ND_PRINT(", reason %s", tok2str(ofpr_str, "invalid (0x%02x)", EXTRACT_U_1(cp))); cp += 1; /* pad */ ND_TCHECK_1(cp); @@ -2292,7 +2292,7 @@ of10_packet_in_print(netdissect_options *ndo, return of10_packet_data_print(ndo, cp, ep, len - (OF_PACKET_IN_LEN - 2)); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -2306,47 +2306,47 @@ of10_flow_removed_print(netdissect_options *ndo, return ep; /* end of snapshot */ /* cookie */ ND_TCHECK_8(cp); - ND_PRINT((ndo, "\n\t cookie 0x%016" PRIx64, EXTRACT_BE_U_8(cp))); + ND_PRINT("\n\t cookie 0x%016" PRIx64, EXTRACT_BE_U_8(cp)); cp += 8; /* priority */ ND_TCHECK_2(cp); if (EXTRACT_BE_U_2(cp)) - ND_PRINT((ndo, ", priority %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", priority %u", EXTRACT_BE_U_2(cp)); cp += 2; /* reason */ ND_TCHECK_1(cp); - ND_PRINT((ndo, ", reason %s", tok2str(ofprr_str, "unknown (0x%02x)", EXTRACT_U_1(cp)))); + ND_PRINT(", reason %s", tok2str(ofprr_str, "unknown (0x%02x)", EXTRACT_U_1(cp))); cp += 1; /* pad */ ND_TCHECK_1(cp); cp += 1; /* duration_sec */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", duration_sec %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", duration_sec %u", EXTRACT_BE_U_4(cp)); cp += 4; /* duration_nsec */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", duration_nsec %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(", duration_nsec %u", EXTRACT_BE_U_4(cp)); cp += 4; /* idle_timeout */ ND_TCHECK_2(cp); if (EXTRACT_BE_U_2(cp)) - ND_PRINT((ndo, ", idle_timeout %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", idle_timeout %u", EXTRACT_BE_U_2(cp)); cp += 2; /* pad2 */ ND_TCHECK_2(cp); cp += 2; /* packet_count */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", packet_count %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", packet_count %" PRIu64, EXTRACT_BE_U_8(cp)); cp += 8; /* byte_count */ ND_TCHECK_8(cp); - ND_PRINT((ndo, ", byte_count %" PRIu64, EXTRACT_BE_U_8(cp))); + ND_PRINT(", byte_count %" PRIu64, EXTRACT_BE_U_8(cp)); return cp + 8; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -2362,7 +2362,7 @@ of10_error_print(netdissect_options *ndo, ND_TCHECK_2(cp); type = EXTRACT_BE_U_2(cp); cp += 2; - ND_PRINT((ndo, "\n\t type %s", tok2str(ofpet_str, "invalid (0x%04x)", type))); + ND_PRINT("\n\t type %s", tok2str(ofpet_str, "invalid (0x%04x)", type)); /* code */ ND_TCHECK_2(cp); code_str = @@ -2373,13 +2373,13 @@ of10_error_print(netdissect_options *ndo, type == OFPET_PORT_MOD_FAILED ? ofppmfc_str : type == OFPET_QUEUE_OP_FAILED ? ofpqofc_str : empty_str; - ND_PRINT((ndo, ", code %s", tok2str(code_str, "invalid (0x%04x)", EXTRACT_BE_U_2(cp)))); + ND_PRINT(", code %s", tok2str(code_str, "invalid (0x%04x)", EXTRACT_BE_U_2(cp))); cp += 2; /* data */ return of10_data_print(ndo, cp, ep, len - OF_ERROR_MSG_LEN); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -2398,8 +2398,8 @@ of10_header_body_print(netdissect_options *ndo, * invalid, proceed to the next message. */ /* [OF10] Section 5.1 */ - ND_PRINT((ndo, "\n\tversion 1.0, type %s, length %u, xid 0x%08x", - tok2str(ofpt_str, "invalid (0x%02x)", type), len, xid)); + ND_PRINT("\n\tversion 1.0, type %s, length %u, xid 0x%08x", + tok2str(ofpt_str, "invalid (0x%02x)", type), len, xid); switch (type) { /* OpenFlow header only. */ case OFPT_FEATURES_REQUEST: /* [OF10] Section 5.3.1 */ @@ -2419,11 +2419,11 @@ of10_header_body_print(netdissect_options *ndo, goto next_message; /* flags */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\t flags %s", tok2str(ofp_config_str, "invalid (0x%04x)", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\t flags %s", tok2str(ofp_config_str, "invalid (0x%04x)", EXTRACT_BE_U_2(cp))); cp += 2; /* miss_send_len */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", miss_send_len %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", miss_send_len %u", EXTRACT_BE_U_2(cp)); return cp + 2; case OFPT_PORT_MOD: if (len != OF_PORT_MOD_LEN) @@ -2438,7 +2438,7 @@ of10_header_body_print(netdissect_options *ndo, goto next_message; /* port */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* pad */ ND_TCHECK_2(cp); @@ -2456,7 +2456,7 @@ of10_header_body_print(netdissect_options *ndo, goto next_message; /* reason */ ND_TCHECK_1(cp); - ND_PRINT((ndo, "\n\t reason %s", tok2str(ofppr_str, "invalid (0x%02x)", EXTRACT_U_1(cp)))); + ND_PRINT("\n\t reason %s", tok2str(ofppr_str, "invalid (0x%02x)", EXTRACT_U_1(cp))); cp += 1; /* pad */ ND_TCHECK_7(cp); @@ -2547,7 +2547,7 @@ of10_header_body_print(netdissect_options *ndo, goto next_message; /* port */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_BE_U_2(cp))); cp += 2; /* pad */ ND_TCHECK_6(cp); @@ -2558,11 +2558,11 @@ of10_header_body_print(netdissect_options *ndo, goto next_message; invalid: /* skip the message body */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); next_message: ND_TCHECK_LEN(cp0, len0 - OF_HEADER_LEN); return cp0 + len0 - OF_HEADER_LEN; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } diff --git a/print-openflow.c b/print-openflow.c index 3ef91432..d9271a29 100644 --- a/print-openflow.c +++ b/print-openflow.c @@ -70,8 +70,8 @@ static void of_header_print(netdissect_options *ndo, const uint8_t version, const uint8_t type, const uint16_t length, const uint32_t xid) { - ND_PRINT((ndo, "\n\tversion unknown (0x%02x), type 0x%02x, length %u, xid 0x%08x", - version, type, length, xid)); + ND_PRINT("\n\tversion unknown (0x%02x), type 0x%02x, length %u, xid 0x%08x", + version, type, length, xid); } /* Print a single OpenFlow message. */ @@ -121,11 +121,11 @@ of_header_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep } invalid: /* fail current packet */ - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(cp, ep - cp); return ep; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -136,7 +136,7 @@ openflow_print(netdissect_options *ndo, const u_char *cp, const u_int len) { const u_char *ep = cp + len; - ND_PRINT((ndo, ": OpenFlow")); + ND_PRINT(": OpenFlow"); while (cp < ep) cp = of_header_body_print(ndo, cp, ep); } diff --git a/print-ospf.c b/print-ospf.c index 84b3a7bc..1bf03652 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -189,7 +189,7 @@ ospf_print_grace_lsa(netdissect_options *ndo, while (ls_length > 0) { ND_TCHECK_4(tptr); if (ls_length < 4) { - ND_PRINT((ndo, "\n\t Remaining LS length %u < 4", ls_length)); + ND_PRINT("\n\t Remaining LS length %u < 4", ls_length); return -1; } tlv_type = EXTRACT_BE_U_2(tptr); @@ -197,14 +197,14 @@ ospf_print_grace_lsa(netdissect_options *ndo, tptr+=4; ls_length-=4; - ND_PRINT((ndo, "\n\t %s TLV (%u), length %u, value: ", + ND_PRINT("\n\t %s TLV (%u), length %u, value: ", tok2str(lsa_opaque_grace_tlv_values,"unknown",tlv_type), tlv_type, - tlv_length)); + tlv_length); if (tlv_length > ls_length) { - ND_PRINT((ndo, "\n\t Bogus length %u > %u", tlv_length, - ls_length)); + ND_PRINT("\n\t Bogus length %u > %u", tlv_length, + ls_length); return -1; } @@ -218,28 +218,28 @@ ospf_print_grace_lsa(netdissect_options *ndo, case LS_OPAQUE_GRACE_TLV_PERIOD: if (tlv_length != 4) { - ND_PRINT((ndo, "\n\t Bogus length %u != 4", tlv_length)); + ND_PRINT("\n\t Bogus length %u != 4", tlv_length); return -1; } - ND_PRINT((ndo, "%us", EXTRACT_BE_U_4(tptr))); + ND_PRINT("%us", EXTRACT_BE_U_4(tptr)); break; case LS_OPAQUE_GRACE_TLV_REASON: if (tlv_length != 1) { - ND_PRINT((ndo, "\n\t Bogus length %u != 1", tlv_length)); + ND_PRINT("\n\t Bogus length %u != 1", tlv_length); return -1; } - ND_PRINT((ndo, "%s (%u)", + ND_PRINT("%s (%u)", tok2str(lsa_opaque_grace_tlv_reason_values, "Unknown", EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr))); + EXTRACT_U_1(tptr)); break; case LS_OPAQUE_GRACE_TLV_INT_ADDRESS: if (tlv_length != 4) { - ND_PRINT((ndo, "\n\t Bogus length %u != 4", tlv_length)); + ND_PRINT("\n\t Bogus length %u != 4", tlv_length); return -1; } - ND_PRINT((ndo, "%s", ipaddr_string(ndo, tptr))); + ND_PRINT("%s", ipaddr_string(ndo, tptr)); break; default: @@ -276,7 +276,7 @@ ospf_print_te_lsa(netdissect_options *ndo, while (ls_length != 0) { ND_TCHECK_4(tptr); if (ls_length < 4) { - ND_PRINT((ndo, "\n\t Remaining LS length %u < 4", ls_length)); + ND_PRINT("\n\t Remaining LS length %u < 4", ls_length); return -1; } tlv_type = EXTRACT_BE_U_2(tptr); @@ -284,14 +284,14 @@ ospf_print_te_lsa(netdissect_options *ndo, tptr+=4; ls_length-=4; - ND_PRINT((ndo, "\n\t %s TLV (%u), length: %u", + ND_PRINT("\n\t %s TLV (%u), length: %u", tok2str(lsa_opaque_te_tlv_values,"unknown",tlv_type), tlv_type, - tlv_length)); + tlv_length); if (tlv_length > ls_length) { - ND_PRINT((ndo, "\n\t Bogus length %u > %u", tlv_length, - ls_length)); + ND_PRINT("\n\t Bogus length %u > %u", tlv_length, + ls_length); return -1; } @@ -304,8 +304,8 @@ ospf_print_te_lsa(netdissect_options *ndo, case LS_OPAQUE_TE_TLV_LINK: while (tlv_length >= sizeof(subtlv_type) + sizeof(subtlv_length)) { if (tlv_length < 4) { - ND_PRINT((ndo, "\n\t Remaining TLV length %u < 4", - tlv_length)); + ND_PRINT("\n\t Remaining TLV length %u < 4", + tlv_length); return -1; } ND_TCHECK_4(tptr); @@ -318,146 +318,146 @@ ospf_print_te_lsa(netdissect_options *ndo, if (subtlv_type == 0 || subtlv_length == 0) goto invalid; - ND_PRINT((ndo, "\n\t %s subTLV (%u), length: %u", + ND_PRINT("\n\t %s subTLV (%u), length: %u", tok2str(lsa_opaque_te_link_tlv_subtlv_values,"unknown",subtlv_type), subtlv_type, - subtlv_length)); + subtlv_length); ND_TCHECK_LEN(tptr, subtlv_length); switch(subtlv_type) { case LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP: if (subtlv_length != 4) { - ND_PRINT((ndo, " != 4")); + ND_PRINT(" != 4"); goto invalid; } - ND_PRINT((ndo, ", 0x%08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT(", 0x%08x", EXTRACT_BE_U_4(tptr)); break; case LS_OPAQUE_TE_LINK_SUBTLV_LINK_ID: case LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID: if (subtlv_length != 4 && subtlv_length != 8) { - ND_PRINT((ndo, " != 4 && != 8")); + ND_PRINT(" != 4 && != 8"); goto invalid; } - ND_PRINT((ndo, ", %s (0x%08x)", + ND_PRINT(", %s (0x%08x)", ipaddr_string(ndo, tptr), - EXTRACT_BE_U_4(tptr))); + EXTRACT_BE_U_4(tptr)); if (subtlv_length == 8) /* rfc4203 */ - ND_PRINT((ndo, ", %s (0x%08x)", + ND_PRINT(", %s (0x%08x)", ipaddr_string(ndo, tptr+4), - EXTRACT_BE_U_4(tptr + 4))); + EXTRACT_BE_U_4(tptr + 4)); break; case LS_OPAQUE_TE_LINK_SUBTLV_LOCAL_IP: case LS_OPAQUE_TE_LINK_SUBTLV_REMOTE_IP: if (subtlv_length != 4) { - ND_PRINT((ndo, " != 4")); + ND_PRINT(" != 4"); goto invalid; } - ND_PRINT((ndo, ", %s", ipaddr_string(ndo, tptr))); + ND_PRINT(", %s", ipaddr_string(ndo, tptr)); break; case LS_OPAQUE_TE_LINK_SUBTLV_MAX_BW: case LS_OPAQUE_TE_LINK_SUBTLV_MAX_RES_BW: if (subtlv_length != 4) { - ND_PRINT((ndo, " != 4")); + ND_PRINT(" != 4"); goto invalid; } bw.i = EXTRACT_BE_U_4(tptr); - ND_PRINT((ndo, ", %.3f Mbps", bw.f * 8 / 1000000)); + ND_PRINT(", %.3f Mbps", bw.f * 8 / 1000000); break; case LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW: if (subtlv_length != 32) { - ND_PRINT((ndo, " != 32")); + ND_PRINT(" != 32"); goto invalid; } for (te_class = 0; te_class < 8; te_class++) { bw.i = EXTRACT_BE_U_4(tptr + te_class * 4); - ND_PRINT((ndo, "\n\t\tTE-Class %u: %.3f Mbps", + ND_PRINT("\n\t\tTE-Class %u: %.3f Mbps", te_class, - bw.f * 8 / 1000000)); + bw.f * 8 / 1000000); } break; case LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS: if (subtlv_length < 4) { - ND_PRINT((ndo, " < 4")); + ND_PRINT(" < 4"); goto invalid; } /* BC Model Id (1 octet) + Reserved (3 octets) */ - ND_PRINT((ndo, "\n\t\tBandwidth Constraints Model ID: %s (%u)", + ND_PRINT("\n\t\tBandwidth Constraints Model ID: %s (%u)", tok2str(diffserv_te_bc_values, "unknown", EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr))); + EXTRACT_U_1(tptr)); if (subtlv_length % 4 != 0) { - ND_PRINT((ndo, "\n\t\tlength %u != N x 4", subtlv_length)); + ND_PRINT("\n\t\tlength %u != N x 4", subtlv_length); goto invalid; } if (subtlv_length > 36) { - ND_PRINT((ndo, "\n\t\tlength %u > 36", subtlv_length)); + ND_PRINT("\n\t\tlength %u > 36", subtlv_length); goto invalid; } /* decode BCs until the subTLV ends */ for (te_class = 0; te_class < (subtlv_length-4)/4; te_class++) { bw.i = EXTRACT_BE_U_4(tptr + 4 + te_class * 4); - ND_PRINT((ndo, "\n\t\t Bandwidth constraint CT%u: %.3f Mbps", + ND_PRINT("\n\t\t Bandwidth constraint CT%u: %.3f Mbps", te_class, - bw.f * 8 / 1000000)); + bw.f * 8 / 1000000); } break; case LS_OPAQUE_TE_LINK_SUBTLV_TE_METRIC: if (subtlv_length != 4) { - ND_PRINT((ndo, " != 4")); + ND_PRINT(" != 4"); goto invalid; } - ND_PRINT((ndo, ", Metric %u", EXTRACT_BE_U_4(tptr))); + ND_PRINT(", Metric %u", EXTRACT_BE_U_4(tptr)); break; case LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE: /* Protection Cap (1 octet) + Reserved ((3 octets) */ if (subtlv_length != 4) { - ND_PRINT((ndo, " != 4")); + ND_PRINT(" != 4"); goto invalid; } - ND_PRINT((ndo, ", %s", - bittok2str(gmpls_link_prot_values, "none", EXTRACT_U_1(tptr)))); + ND_PRINT(", %s", + bittok2str(gmpls_link_prot_values, "none", EXTRACT_U_1(tptr))); break; case LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR: if (subtlv_length < 36) { - ND_PRINT((ndo, " < 36")); + ND_PRINT(" < 36"); goto invalid; } /* Switching Cap (1 octet) + Encoding (1) + Reserved (2) */ - ND_PRINT((ndo, "\n\t\tInterface Switching Capability: %s", - tok2str(gmpls_switch_cap_values, "Unknown", EXTRACT_U_1((tptr))))); - ND_PRINT((ndo, "\n\t\tLSP Encoding: %s\n\t\tMax LSP Bandwidth:", - tok2str(gmpls_encoding_values, "Unknown", EXTRACT_U_1((tptr + 1))))); + ND_PRINT("\n\t\tInterface Switching Capability: %s", + tok2str(gmpls_switch_cap_values, "Unknown", EXTRACT_U_1((tptr)))); + ND_PRINT("\n\t\tLSP Encoding: %s\n\t\tMax LSP Bandwidth:", + tok2str(gmpls_encoding_values, "Unknown", EXTRACT_U_1((tptr + 1)))); for (priority_level = 0; priority_level < 8; priority_level++) { bw.i = EXTRACT_BE_U_4(tptr + 4 + (priority_level * 4)); - ND_PRINT((ndo, "\n\t\t priority level %d: %.3f Mbps", + ND_PRINT("\n\t\t priority level %d: %.3f Mbps", priority_level, - bw.f * 8 / 1000000)); + bw.f * 8 / 1000000); } break; case LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE: if (subtlv_length != 1) { - ND_PRINT((ndo, " != 1")); + ND_PRINT(" != 1"); goto invalid; } - ND_PRINT((ndo, ", %s (%u)", + ND_PRINT(", %s (%u)", tok2str(lsa_opaque_te_tlv_link_type_sub_tlv_values,"unknown",EXTRACT_U_1(tptr)), - EXTRACT_U_1(tptr))); + EXTRACT_U_1(tptr)); break; case LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP: if (subtlv_length % 4 != 0) { - ND_PRINT((ndo, " != N x 4")); + ND_PRINT(" != N x 4"); goto invalid; } count_srlg = subtlv_length / 4; if (count_srlg != 0) - ND_PRINT((ndo, "\n\t\t Shared risk group: ")); + ND_PRINT("\n\t\t Shared risk group: "); while (count_srlg > 0) { bw.i = EXTRACT_BE_U_4(tptr); - ND_PRINT((ndo, "%d", bw.i)); + ND_PRINT("%d", bw.i); tptr+=4; count_srlg--; if (count_srlg > 0) - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); } break; @@ -480,11 +480,11 @@ ospf_print_te_lsa(netdissect_options *ndo, case LS_OPAQUE_TE_TLV_ROUTER: if (tlv_length < 4) { - ND_PRINT((ndo, "\n\t TLV length %u < 4", tlv_length)); + ND_PRINT("\n\t TLV length %u < 4", tlv_length); return -1; } ND_TCHECK_4(tptr); - ND_PRINT((ndo, ", %s", ipaddr_string(ndo, tptr))); + ND_PRINT(", %s", ipaddr_string(ndo, tptr)); break; default: @@ -504,7 +504,7 @@ ospf_print_te_lsa(netdissect_options *ndo, trunc: return -1; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); return -1; } @@ -518,17 +518,17 @@ ospf_print_lshdr(netdissect_options *ndo, ND_TCHECK(lshp->ls_length); ls_length = EXTRACT_BE_U_2(lshp->ls_length); if (ls_length < sizeof(struct lsa_hdr)) { - ND_PRINT((ndo, "\n\t Bogus length %u < header (%lu)", ls_length, - (unsigned long)sizeof(struct lsa_hdr))); + ND_PRINT("\n\t Bogus length %u < header (%lu)", ls_length, + (unsigned long)sizeof(struct lsa_hdr)); return(-1); } ND_TCHECK(lshp->ls_seq); /* XXX - ls_length check checked this */ - ND_PRINT((ndo, "\n\t Advertising Router %s, seq 0x%08x, age %us, length %u", + ND_PRINT("\n\t Advertising Router %s, seq 0x%08x, age %us, length %u", ipaddr_string(ndo, &lshp->ls_router), EXTRACT_BE_U_4(lshp->ls_seq), EXTRACT_BE_U_2(lshp->ls_age), - ls_length - (u_int)sizeof(struct lsa_hdr))); + ls_length - (u_int)sizeof(struct lsa_hdr)); ND_TCHECK(lshp->ls_type); /* XXX - ls_length check checked this */ ls_type = EXTRACT_U_1(lshp->ls_type); @@ -537,7 +537,7 @@ ospf_print_lshdr(netdissect_options *ndo, case LS_TYPE_OPAQUE_LL: case LS_TYPE_OPAQUE_AL: case LS_TYPE_OPAQUE_DW: - ND_PRINT((ndo, "\n\t %s LSA (%d), Opaque-Type %s LSA (%u), Opaque-ID %u", + ND_PRINT("\n\t %s LSA (%d), Opaque-Type %s LSA (%u), Opaque-ID %u", tok2str(lsa_values,"unknown",ls_type), ls_type, @@ -547,20 +547,20 @@ ospf_print_lshdr(netdissect_options *ndo, EXTRACT_U_1(lshp->un_lsa_id.opaque_field.opaque_type), EXTRACT_BE_U_3(lshp->un_lsa_id.opaque_field.opaque_id) - )); + ); break; /* all other LSA types use regular style LSA headers */ default: - ND_PRINT((ndo, "\n\t %s LSA (%d), LSA-ID: %s", + ND_PRINT("\n\t %s LSA (%d), LSA-ID: %s", tok2str(lsa_values,"unknown",ls_type), ls_type, - ipaddr_string(ndo, &lshp->un_lsa_id.lsa_id))); + ipaddr_string(ndo, &lshp->un_lsa_id.lsa_id)); break; } ND_TCHECK(lshp->ls_options); /* XXX - ls_length check checked this */ - ND_PRINT((ndo, "\n\t Options: [%s]", bittok2str(ospf_option_values, "none", EXTRACT_U_1(lshp->ls_options)))); + ND_PRINT("\n\t Options: [%s]", bittok2str(ospf_option_values, "none", EXTRACT_U_1(lshp->ls_options))); return (ls_length); trunc: @@ -595,11 +595,11 @@ ospf_print_tos_metrics(netdissect_options *ndo, while (toscount != 0) { ND_TCHECK_SIZE(tos); tos_type = EXTRACT_U_1(tos->metrics.tos_type); - ND_PRINT((ndo, "\n\t\ttopology %s (%u), metric %u", + ND_PRINT("\n\t\ttopology %s (%u), metric %u", tok2str(ospf_topology_values, "Unknown", metric_count ? tos_type : 0), metric_count ? tos_type : 0, - EXTRACT_BE_U_2(tos->metrics.tos_metric))); + EXTRACT_BE_U_2(tos->metrics.tos_metric)); metric_count++; tos++; toscount--; @@ -639,8 +639,8 @@ ospf_print_lsa(netdissect_options *ndo, case LS_TYPE_ROUTER: ND_TCHECK(lsap->lsa_un.un_rla.rla_flags); - ND_PRINT((ndo, "\n\t Router LSA Options: [%s]", - bittok2str(ospf_rla_flag_values, "none", EXTRACT_U_1(lsap->lsa_un.un_rla.rla_flags)))); + ND_PRINT("\n\t Router LSA Options: [%s]", + bittok2str(ospf_rla_flag_values, "none", EXTRACT_U_1(lsap->lsa_un.un_rla.rla_flags))); ND_TCHECK(lsap->lsa_un.un_rla.rla_count); j = EXTRACT_BE_U_2(lsap->lsa_un.un_rla.rla_count); @@ -651,32 +651,32 @@ ospf_print_lsa(netdissect_options *ndo, switch (EXTRACT_U_1(rlp->un_tos.link.link_type)) { case RLA_TYPE_VIRTUAL: - ND_PRINT((ndo, "\n\t Virtual Link: Neighbor Router-ID: %s, Interface Address: %s", + ND_PRINT("\n\t Virtual Link: Neighbor Router-ID: %s, Interface Address: %s", ipaddr_string(ndo, &rlp->link_id), - ipaddr_string(ndo, &rlp->link_data))); + ipaddr_string(ndo, &rlp->link_data)); break; case RLA_TYPE_ROUTER: - ND_PRINT((ndo, "\n\t Neighbor Router-ID: %s, Interface Address: %s", + ND_PRINT("\n\t Neighbor Router-ID: %s, Interface Address: %s", ipaddr_string(ndo, &rlp->link_id), - ipaddr_string(ndo, &rlp->link_data))); + ipaddr_string(ndo, &rlp->link_data)); break; case RLA_TYPE_TRANSIT: - ND_PRINT((ndo, "\n\t Neighbor Network-ID: %s, Interface Address: %s", + ND_PRINT("\n\t Neighbor Network-ID: %s, Interface Address: %s", ipaddr_string(ndo, &rlp->link_id), - ipaddr_string(ndo, &rlp->link_data))); + ipaddr_string(ndo, &rlp->link_data)); break; case RLA_TYPE_STUB: - ND_PRINT((ndo, "\n\t Stub Network: %s, Mask: %s", + ND_PRINT("\n\t Stub Network: %s, Mask: %s", ipaddr_string(ndo, &rlp->link_id), - ipaddr_string(ndo, &rlp->link_data))); + ipaddr_string(ndo, &rlp->link_data)); break; default: - ND_PRINT((ndo, "\n\t Unknown Router Link Type (%u)", - EXTRACT_U_1(rlp->un_tos.link.link_type))); + ND_PRINT("\n\t Unknown Router Link Type (%u)", + EXTRACT_U_1(rlp->un_tos.link.link_type)); return (ls_end); } @@ -690,20 +690,20 @@ ospf_print_lsa(netdissect_options *ndo, case LS_TYPE_NETWORK: ND_TCHECK(lsap->lsa_un.un_nla.nla_mask); - ND_PRINT((ndo, "\n\t Mask %s\n\t Connected Routers:", - ipaddr_string(ndo, &lsap->lsa_un.un_nla.nla_mask))); + ND_PRINT("\n\t Mask %s\n\t Connected Routers:", + ipaddr_string(ndo, &lsap->lsa_un.un_nla.nla_mask)); ap = lsap->lsa_un.un_nla.nla_router; while ((const u_char *)ap < ls_end) { ND_TCHECK_SIZE(ap); - ND_PRINT((ndo, "\n\t %s", ipaddr_string(ndo, ap))); + ND_PRINT("\n\t %s", ipaddr_string(ndo, ap)); ++ap; } break; case LS_TYPE_SUM_IP: ND_TCHECK(lsap->lsa_un.un_nla.nla_mask); - ND_PRINT((ndo, "\n\t Mask %s", - ipaddr_string(ndo, &lsap->lsa_un.un_sla.sla_mask))); + ND_PRINT("\n\t Mask %s", + ipaddr_string(ndo, &lsap->lsa_un.un_sla.sla_mask)); ND_TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); lp = (const uint8_t *)lsap->lsa_un.un_sla.sla_tosmetric; while (lp < ls_end) { @@ -712,10 +712,10 @@ ospf_print_lsa(netdissect_options *ndo, ND_TCHECK_4(lp); ul = EXTRACT_BE_U_4(lp); topology = (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS; - ND_PRINT((ndo, "\n\t\ttopology %s (%u) metric %d", + ND_PRINT("\n\t\ttopology %s (%u) metric %d", tok2str(ospf_topology_values, "Unknown", topology), topology, - ul & SLA_MASK_METRIC)); + ul & SLA_MASK_METRIC); lp += 4; } break; @@ -729,10 +729,10 @@ ospf_print_lsa(netdissect_options *ndo, ND_TCHECK_4(lp); ul = EXTRACT_BE_U_4(lp); topology = (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS; - ND_PRINT((ndo, "\n\t\ttopology %s (%u) metric %d", + ND_PRINT("\n\t\ttopology %s (%u) metric %d", tok2str(ospf_topology_values, "Unknown", topology), topology, - ul & SLA_MASK_METRIC)); + ul & SLA_MASK_METRIC); lp += 4; } break; @@ -740,8 +740,8 @@ ospf_print_lsa(netdissect_options *ndo, case LS_TYPE_ASE: case LS_TYPE_NSSA: /* fall through - those LSAs share the same format */ ND_TCHECK(lsap->lsa_un.un_nla.nla_mask); - ND_PRINT((ndo, "\n\t Mask %s", - ipaddr_string(ndo, &lsap->lsa_un.un_asla.asla_mask))); + ND_PRINT("\n\t Mask %s", + ipaddr_string(ndo, &lsap->lsa_un.un_asla.asla_mask)); ND_TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); almp = lsap->lsa_un.un_asla.asla_metric; @@ -751,22 +751,22 @@ ospf_print_lsa(netdissect_options *ndo, ND_TCHECK(almp->asla_tosmetric); ul = EXTRACT_BE_U_4(almp->asla_tosmetric); topology = ((ul & ASLA_MASK_TOS) >> ASLA_SHIFT_TOS); - ND_PRINT((ndo, "\n\t\ttopology %s (%u), type %d, metric", + ND_PRINT("\n\t\ttopology %s (%u), type %d, metric", tok2str(ospf_topology_values, "Unknown", topology), topology, - (ul & ASLA_FLAG_EXTERNAL) ? 2 : 1)); + (ul & ASLA_FLAG_EXTERNAL) ? 2 : 1); if ((ul & ASLA_MASK_METRIC) == 0xffffff) - ND_PRINT((ndo, " infinite")); + ND_PRINT(" infinite"); else - ND_PRINT((ndo, " %d", (ul & ASLA_MASK_METRIC))); + ND_PRINT(" %d", (ul & ASLA_MASK_METRIC)); ND_TCHECK(almp->asla_forward); if (almp->asla_forward.s_addr) { - ND_PRINT((ndo, ", forward %s", ipaddr_string(ndo, &almp->asla_forward))); + ND_PRINT(", forward %s", ipaddr_string(ndo, &almp->asla_forward)); } ND_TCHECK(almp->asla_tag); if (almp->asla_tag.s_addr) { - ND_PRINT((ndo, ", tag %s", ipaddr_string(ndo, &almp->asla_tag))); + ND_PRINT(", tag %s", ipaddr_string(ndo, &almp->asla_tag)); } ++almp; } @@ -780,18 +780,18 @@ ospf_print_lsa(netdissect_options *ndo, switch (EXTRACT_BE_U_4(mcp->mcla_vtype)) { case MCLA_VERTEX_ROUTER: - ND_PRINT((ndo, "\n\t Router Router-ID %s", - ipaddr_string(ndo, &mcp->mcla_vid))); + ND_PRINT("\n\t Router Router-ID %s", + ipaddr_string(ndo, &mcp->mcla_vid)); break; case MCLA_VERTEX_NETWORK: - ND_PRINT((ndo, "\n\t Network Designated Router %s", - ipaddr_string(ndo, &mcp->mcla_vid))); + ND_PRINT("\n\t Network Designated Router %s", + ipaddr_string(ndo, &mcp->mcla_vid)); break; default: - ND_PRINT((ndo, "\n\t unknown VertexType (%u)", - EXTRACT_BE_U_4(mcp->mcla_vtype))); + ND_PRINT("\n\t unknown VertexType (%u)", + EXTRACT_BE_U_4(mcp->mcla_vtype)); break; } ++mcp; @@ -809,7 +809,7 @@ ospf_print_lsa(netdissect_options *ndo, while (ls_length != 0) { ND_TCHECK_4(tptr); if (ls_length < 4) { - ND_PRINT((ndo, "\n\t Remaining LS length %u < 4", ls_length)); + ND_PRINT("\n\t Remaining LS length %u < 4", ls_length); return(ls_end); } tlv_type = EXTRACT_BE_U_2(tptr); @@ -817,14 +817,14 @@ ospf_print_lsa(netdissect_options *ndo, tptr+=4; ls_length-=4; - ND_PRINT((ndo, "\n\t %s TLV (%u), length: %u, value: ", + ND_PRINT("\n\t %s TLV (%u), length: %u, value: ", tok2str(lsa_opaque_ri_tlv_values,"unknown",tlv_type), tlv_type, - tlv_length)); + tlv_length); if (tlv_length > ls_length) { - ND_PRINT((ndo, "\n\t Bogus length %u > %u", tlv_length, - ls_length)); + ND_PRINT("\n\t Bogus length %u > %u", tlv_length, + ls_length); return(ls_end); } ND_TCHECK_LEN(tptr, tlv_length); @@ -832,11 +832,11 @@ ospf_print_lsa(netdissect_options *ndo, case LS_OPAQUE_RI_TLV_CAP: if (tlv_length != 4) { - ND_PRINT((ndo, "\n\t Bogus length %u != 4", tlv_length)); + ND_PRINT("\n\t Bogus length %u != 4", tlv_length); return(ls_end); } - ND_PRINT((ndo, "Capabilities: %s", - bittok2str(lsa_opaque_ri_tlv_cap_values, "Unknown", EXTRACT_BE_U_4(tptr)))); + ND_PRINT("Capabilities: %s", + bittok2str(lsa_opaque_ri_tlv_cap_values, "Unknown", EXTRACT_BE_U_4(tptr))); break; default: if (ndo->ndo_vflag <= 1) { @@ -923,51 +923,51 @@ ospf_decode_lls(netdissect_options *ndo, length2 += op->ospf_authdata[3]; } if (length2 >= length) { - ND_PRINT((ndo, "\n\t[LLS truncated]")); + ND_PRINT("\n\t[LLS truncated]"); return (1); } ND_TCHECK_2(dptr); - ND_PRINT((ndo, "\n\t LLS: checksum: 0x%04x", (u_int) EXTRACT_BE_U_2(dptr))); + ND_PRINT("\n\t LLS: checksum: 0x%04x", (u_int) EXTRACT_BE_U_2(dptr)); dptr += 2; ND_TCHECK_2(dptr); length2 = EXTRACT_BE_U_2(dptr); - ND_PRINT((ndo, ", length: %u", length2)); + ND_PRINT(", length: %u", length2); dptr += 2; ND_TCHECK_1(dptr); while (dptr < dataend) { ND_TCHECK_2(dptr); lls_type = EXTRACT_BE_U_2(dptr); - ND_PRINT((ndo, "\n\t %s (%u)", + ND_PRINT("\n\t %s (%u)", tok2str(ospf_lls_tlv_values,"Unknown TLV",lls_type), - lls_type)); + lls_type); dptr += 2; ND_TCHECK_2(dptr); lls_len = EXTRACT_BE_U_2(dptr); - ND_PRINT((ndo, ", length: %u", lls_len)); + ND_PRINT(", length: %u", lls_len); dptr += 2; switch (lls_type) { case OSPF_LLS_EO: if (lls_len != 4) { - ND_PRINT((ndo, " [should be 4]")); + ND_PRINT(" [should be 4]"); lls_len = 4; } ND_TCHECK_4(dptr); lls_flags = EXTRACT_BE_U_4(dptr); - ND_PRINT((ndo, "\n\t Options: 0x%08x [%s]", lls_flags, - bittok2str(ospf_lls_eo_options, "?", lls_flags))); + ND_PRINT("\n\t Options: 0x%08x [%s]", lls_flags, + bittok2str(ospf_lls_eo_options, "?", lls_flags)); break; case OSPF_LLS_MD5: if (lls_len != 20) { - ND_PRINT((ndo, " [should be 20]")); + ND_PRINT(" [should be 20]"); lls_len = 20; } ND_TCHECK_4(dptr); - ND_PRINT((ndo, "\n\t Sequence number: 0x%08x", EXTRACT_BE_U_4(dptr))); + ND_PRINT("\n\t Sequence number: 0x%08x", EXTRACT_BE_U_4(dptr)); break; } @@ -993,49 +993,49 @@ ospf_decode_v2(netdissect_options *ndo, case OSPF_TYPE_HELLO: ND_TCHECK(op->ospf_hello.hello_options); - ND_PRINT((ndo, "\n\tOptions [%s]", - bittok2str(ospf_option_values,"none",EXTRACT_U_1(op->ospf_hello.hello_options)))); + ND_PRINT("\n\tOptions [%s]", + bittok2str(ospf_option_values,"none",EXTRACT_U_1(op->ospf_hello.hello_options))); ND_TCHECK(op->ospf_hello.hello_deadint); - ND_PRINT((ndo, "\n\t Hello Timer %us, Dead Timer %us, Mask %s, Priority %u", + ND_PRINT("\n\t Hello Timer %us, Dead Timer %us, Mask %s, Priority %u", EXTRACT_BE_U_2(op->ospf_hello.hello_helloint), EXTRACT_BE_U_4(op->ospf_hello.hello_deadint), ipaddr_string(ndo, &op->ospf_hello.hello_mask), - EXTRACT_U_1(op->ospf_hello.hello_priority))); + EXTRACT_U_1(op->ospf_hello.hello_priority)); ND_TCHECK(op->ospf_hello.hello_dr); if (op->ospf_hello.hello_dr.s_addr != 0) - ND_PRINT((ndo, "\n\t Designated Router %s", - ipaddr_string(ndo, &op->ospf_hello.hello_dr))); + ND_PRINT("\n\t Designated Router %s", + ipaddr_string(ndo, &op->ospf_hello.hello_dr)); ND_TCHECK(op->ospf_hello.hello_bdr); if (op->ospf_hello.hello_bdr.s_addr != 0) - ND_PRINT((ndo, ", Backup Designated Router %s", - ipaddr_string(ndo, &op->ospf_hello.hello_bdr))); + ND_PRINT(", Backup Designated Router %s", + ipaddr_string(ndo, &op->ospf_hello.hello_bdr)); ap = op->ospf_hello.hello_neighbor; if ((const u_char *)ap < dataend) - ND_PRINT((ndo, "\n\t Neighbor List:")); + ND_PRINT("\n\t Neighbor List:"); while ((const u_char *)ap < dataend) { ND_TCHECK_SIZE(ap); - ND_PRINT((ndo, "\n\t %s", ipaddr_string(ndo, ap))); + ND_PRINT("\n\t %s", ipaddr_string(ndo, ap)); ++ap; } break; /* HELLO */ case OSPF_TYPE_DD: ND_TCHECK(op->ospf_db.db_options); - ND_PRINT((ndo, "\n\tOptions [%s]", - bittok2str(ospf_option_values, "none", EXTRACT_U_1(op->ospf_db.db_options)))); + ND_PRINT("\n\tOptions [%s]", + bittok2str(ospf_option_values, "none", EXTRACT_U_1(op->ospf_db.db_options))); ND_TCHECK(op->ospf_db.db_flags); - ND_PRINT((ndo, ", DD Flags [%s]", - bittok2str(ospf_dd_flag_values, "none", EXTRACT_U_1(op->ospf_db.db_flags)))); + ND_PRINT(", DD Flags [%s]", + bittok2str(ospf_dd_flag_values, "none", EXTRACT_U_1(op->ospf_db.db_flags))); ND_TCHECK(op->ospf_db.db_ifmtu); if (EXTRACT_BE_U_2(op->ospf_db.db_ifmtu)) { - ND_PRINT((ndo, ", MTU: %u", EXTRACT_BE_U_2(op->ospf_db.db_ifmtu))); + ND_PRINT(", MTU: %u", EXTRACT_BE_U_2(op->ospf_db.db_ifmtu)); } ND_TCHECK(op->ospf_db.db_seq); - ND_PRINT((ndo, ", Sequence: 0x%08x", EXTRACT_BE_U_4(op->ospf_db.db_seq))); + ND_PRINT(", Sequence: 0x%08x", EXTRACT_BE_U_4(op->ospf_db.db_seq)); /* Print all the LS adv's */ lshp = op->ospf_db.db_lshdr; @@ -1049,24 +1049,24 @@ ospf_decode_v2(netdissect_options *ndo, while ((const u_char *)lsrp < dataend) { ND_TCHECK_SIZE(lsrp); - ND_PRINT((ndo, "\n\t Advertising Router: %s, %s LSA (%u)", + ND_PRINT("\n\t Advertising Router: %s, %s LSA (%u)", ipaddr_string(ndo, &lsrp->ls_router), tok2str(lsa_values,"unknown",EXTRACT_BE_U_4(lsrp->ls_type)), - EXTRACT_BE_U_4(lsrp->ls_type))); + EXTRACT_BE_U_4(lsrp->ls_type)); switch (EXTRACT_BE_U_4(lsrp->ls_type)) { /* the LSA header for opaque LSAs was slightly changed */ case LS_TYPE_OPAQUE_LL: case LS_TYPE_OPAQUE_AL: case LS_TYPE_OPAQUE_DW: - ND_PRINT((ndo, ", Opaque-Type: %s LSA (%u), Opaque-ID: %u", + ND_PRINT(", Opaque-Type: %s LSA (%u), Opaque-ID: %u", tok2str(lsa_opaque_values, "unknown",EXTRACT_U_1(lsrp->un_ls_stateid.opaque_field.opaque_type)), EXTRACT_U_1(lsrp->un_ls_stateid.opaque_field.opaque_type), - EXTRACT_BE_U_3(lsrp->un_ls_stateid.opaque_field.opaque_id))); + EXTRACT_BE_U_3(lsrp->un_ls_stateid.opaque_field.opaque_id)); break; default: - ND_PRINT((ndo, ", LSA-ID: %s", - ipaddr_string(ndo, &lsrp->un_ls_stateid.ls_stateid))); + ND_PRINT(", LSA-ID: %s", + ipaddr_string(ndo, &lsrp->un_ls_stateid.ls_stateid)); break; } @@ -1078,9 +1078,9 @@ ospf_decode_v2(netdissect_options *ndo, lsap = op->ospf_lsu.lsu_lsa; ND_TCHECK(op->ospf_lsu.lsu_count); lsa_count_max = EXTRACT_BE_U_4(op->ospf_lsu.lsu_count); - ND_PRINT((ndo, ", %d LSA%s", lsa_count_max, PLURAL_SUFFIX(lsa_count_max))); + ND_PRINT(", %d LSA%s", lsa_count_max, PLURAL_SUFFIX(lsa_count_max)); for (lsa_count=1;lsa_count <= lsa_count_max;lsa_count++) { - ND_PRINT((ndo, "\n\t LSA #%u", lsa_count)); + ND_PRINT("\n\t LSA #%u", lsa_count); lsap = (const struct lsa *)ospf_print_lsa(ndo, lsap); if (lsap == NULL) goto trunc; @@ -1124,7 +1124,7 @@ ospf_print(netdissect_options *ndo, /* value. If it's not valid, say so and return */ ND_TCHECK(op->ospf_type); cp = tok2str(type2str, "unknown LS-type %u", EXTRACT_U_1(op->ospf_type)); - ND_PRINT((ndo, "OSPFv%u, %s, length %u", EXTRACT_U_1(op->ospf_version), cp, length)); + ND_PRINT("OSPFv%u, %s, length %u", EXTRACT_U_1(op->ospf_version), cp, length); if (*cp == 'u') return; @@ -1134,7 +1134,7 @@ ospf_print(netdissect_options *ndo, ND_TCHECK(op->ospf_len); if (length != EXTRACT_BE_U_2(op->ospf_len)) { - ND_PRINT((ndo, " [len %d]", EXTRACT_BE_U_2(op->ospf_len))); + ND_PRINT(" [len %d]", EXTRACT_BE_U_2(op->ospf_len)); } if (length > EXTRACT_BE_U_2(op->ospf_len)) { @@ -1144,21 +1144,21 @@ ospf_print(netdissect_options *ndo, } ND_TCHECK(op->ospf_routerid); - ND_PRINT((ndo, "\n\tRouter-ID %s", ipaddr_string(ndo, &op->ospf_routerid))); + ND_PRINT("\n\tRouter-ID %s", ipaddr_string(ndo, &op->ospf_routerid)); ND_TCHECK(op->ospf_areaid); if (op->ospf_areaid.s_addr != 0) - ND_PRINT((ndo, ", Area %s", ipaddr_string(ndo, &op->ospf_areaid))); + ND_PRINT(", Area %s", ipaddr_string(ndo, &op->ospf_areaid)); else - ND_PRINT((ndo, ", Backbone Area")); + ND_PRINT(", Backbone Area"); if (ndo->ndo_vflag) { /* Print authentication data (should we really do this?) */ ND_TCHECK_LEN(op->ospf_authdata, sizeof(op->ospf_authdata)); - ND_PRINT((ndo, ", Authentication Type: %s (%u)", + ND_PRINT(", Authentication Type: %s (%u)", tok2str(ospf_authtype_values, "unknown", EXTRACT_BE_U_2(op->ospf_authtype)), - EXTRACT_BE_U_2(op->ospf_authtype))); + EXTRACT_BE_U_2(op->ospf_authtype)); switch (EXTRACT_BE_U_2(op->ospf_authtype)) { @@ -1166,15 +1166,15 @@ ospf_print(netdissect_options *ndo, break; case OSPF_AUTH_SIMPLE: - ND_PRINT((ndo, "\n\tSimple text password: ")); + ND_PRINT("\n\tSimple text password: "); safeputs(ndo, op->ospf_authdata, OSPF_AUTH_SIMPLE_LEN); break; case OSPF_AUTH_MD5: - ND_PRINT((ndo, "\n\tKey-ID: %u, Auth-Length: %u, Crypto Sequence Number: 0x%08x", + ND_PRINT("\n\tKey-ID: %u, Auth-Length: %u, Crypto Sequence Number: 0x%08x", *((op->ospf_authdata) + 2), *((op->ospf_authdata) + 3), - EXTRACT_BE_U_4((op->ospf_authdata) + 4))); + EXTRACT_BE_U_4((op->ospf_authdata) + 4)); break; default: @@ -1195,11 +1195,11 @@ ospf_print(netdissect_options *ndo, break; default: - ND_PRINT((ndo, " ospf [version %u]", EXTRACT_U_1(op->ospf_version))); + ND_PRINT(" ospf [version %u]", EXTRACT_U_1(op->ospf_version)); break; } /* end switch on version */ return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-ospf6.c b/print-ospf6.c index b055a7ac..cb6acda1 100644 --- a/print-ospf6.c +++ b/print-ospf6.c @@ -375,12 +375,12 @@ static void ospf6_print_ls_type(netdissect_options *ndo, u_int ls_type, const rtrid_t *ls_stateid) { - ND_PRINT((ndo, "\n\t %s LSA (%d), %s Scope%s, LSA-ID %s", + ND_PRINT("\n\t %s LSA (%d), %s Scope%s, LSA-ID %s", tok2str(ospf6_lsa_values, "Unknown", ls_type & LS_TYPE_MASK), ls_type & LS_TYPE_MASK, tok2str(ospf6_ls_scope_values, "Unknown", ls_type & LS_SCOPE_MASK), ls_type &0x8000 ? ", transitive" : "", /* U-bit */ - ipaddr_string(ndo, ls_stateid))); + ipaddr_string(ndo, ls_stateid)); } static int @@ -392,11 +392,11 @@ ospf6_print_lshdr(netdissect_options *ndo, ND_TCHECK(lshp->ls_type); ND_TCHECK(lshp->ls_seq); - ND_PRINT((ndo, "\n\t Advertising Router %s, seq 0x%08x, age %us, length %u", + ND_PRINT("\n\t Advertising Router %s, seq 0x%08x, age %us, length %u", ipaddr_string(ndo, &lshp->ls_router), EXTRACT_BE_U_4(lshp->ls_seq), EXTRACT_BE_U_2(lshp->ls_age), - EXTRACT_BE_U_2(lshp->ls_length)-(u_int)sizeof(struct lsa6_hdr))); + EXTRACT_BE_U_2(lshp->ls_length)-(u_int)sizeof(struct lsa6_hdr)); ospf6_print_ls_type(ndo, EXTRACT_BE_U_2(lshp->ls_type), &lshp->ls_stateid); @@ -420,7 +420,7 @@ ospf6_print_lsaprefix(netdissect_options *ndo, ND_TCHECK_LEN(lsapp, sizeof(*lsapp) - IPV6_ADDR_LEN_BYTES); wordlen = (EXTRACT_U_1(lsapp->lsa_p_len) + 31) / 32; if (wordlen * 4 > sizeof(struct in6_addr)) { - ND_PRINT((ndo, " bogus prefixlen /%u", EXTRACT_U_1(lsapp->lsa_p_len))); + ND_PRINT(" bogus prefixlen /%u", EXTRACT_U_1(lsapp->lsa_p_len)); goto trunc; } if (lsa_length < wordlen * 4) @@ -429,14 +429,14 @@ ospf6_print_lsaprefix(netdissect_options *ndo, ND_TCHECK_LEN(lsapp->lsa_p_prefix, wordlen * 4); memset(&prefix, 0, sizeof(prefix)); memcpy(&prefix, lsapp->lsa_p_prefix, wordlen * 4); - ND_PRINT((ndo, "\n\t\t%s/%u", ip6addr_string(ndo, &prefix), - EXTRACT_U_1(lsapp->lsa_p_len))); + ND_PRINT("\n\t\t%s/%u", ip6addr_string(ndo, &prefix), + EXTRACT_U_1(lsapp->lsa_p_len)); if (EXTRACT_U_1(lsapp->lsa_p_opt)) { - ND_PRINT((ndo, ", Options [%s]", + ND_PRINT(", Options [%s]", bittok2str(ospf6_lsa_prefix_option_values, - "none", EXTRACT_U_1(lsapp->lsa_p_opt)))); + "none", EXTRACT_U_1(lsapp->lsa_p_opt))); } - ND_PRINT((ndo, ", metric %u", EXTRACT_BE_U_2(lsapp->lsa_p_metric))); + ND_PRINT(", metric %u", EXTRACT_BE_U_2(lsapp->lsa_p_metric)); return sizeof(*lsapp) - IPV6_ADDR_LEN_BYTES + wordlen * 4; trunc: @@ -493,12 +493,12 @@ ospf6_print_lsa(netdissect_options *ndo, return (1); lsa_length -= sizeof (lsap->lsa_un.un_rla.rla_options); ND_TCHECK(lsap->lsa_un.un_rla.rla_options); - ND_PRINT((ndo, "\n\t Options [%s]", + ND_PRINT("\n\t Options [%s]", bittok2str(ospf6_option_values, "none", - EXTRACT_BE_U_4(lsap->lsa_un.un_rla.rla_options)))); - ND_PRINT((ndo, ", RLA-Flags [%s]", + EXTRACT_BE_U_4(lsap->lsa_un.un_rla.rla_options))); + ND_PRINT(", RLA-Flags [%s]", bittok2str(ospf6_rla_flag_values, "none", - EXTRACT_U_1(lsap->lsa_un.un_rla.rla_flags)))); + EXTRACT_U_1(lsap->lsa_un.un_rla.rla_flags))); rlp = lsap->lsa_un.un_rla.rla_link; while (lsa_length != 0) { @@ -509,35 +509,35 @@ ospf6_print_lsa(netdissect_options *ndo, switch (EXTRACT_U_1(rlp->link_type)) { case RLA_TYPE_VIRTUAL: - ND_PRINT((ndo, "\n\t Virtual Link: Neighbor Router-ID %s" + ND_PRINT("\n\t Virtual Link: Neighbor Router-ID %s" "\n\t Neighbor Interface-ID %s, Interface %s", ipaddr_string(ndo, &rlp->link_nrtid), ipaddr_string(ndo, &rlp->link_nifid), - ipaddr_string(ndo, &rlp->link_ifid))); + ipaddr_string(ndo, &rlp->link_ifid)); break; case RLA_TYPE_ROUTER: - ND_PRINT((ndo, "\n\t Neighbor Router-ID %s" + ND_PRINT("\n\t Neighbor Router-ID %s" "\n\t Neighbor Interface-ID %s, Interface %s", ipaddr_string(ndo, &rlp->link_nrtid), ipaddr_string(ndo, &rlp->link_nifid), - ipaddr_string(ndo, &rlp->link_ifid))); + ipaddr_string(ndo, &rlp->link_ifid)); break; case RLA_TYPE_TRANSIT: - ND_PRINT((ndo, "\n\t Neighbor Network-ID %s" + ND_PRINT("\n\t Neighbor Network-ID %s" "\n\t Neighbor Interface-ID %s, Interface %s", ipaddr_string(ndo, &rlp->link_nrtid), ipaddr_string(ndo, &rlp->link_nifid), - ipaddr_string(ndo, &rlp->link_ifid))); + ipaddr_string(ndo, &rlp->link_ifid)); break; default: - ND_PRINT((ndo, "\n\t Unknown Router Links Type 0x%02x", - EXTRACT_U_1(rlp->link_type))); + ND_PRINT("\n\t Unknown Router Links Type 0x%02x", + EXTRACT_U_1(rlp->link_type)); return (0); } - ND_PRINT((ndo, ", metric %d", EXTRACT_BE_U_2(rlp->link_metric))); + ND_PRINT(", metric %d", EXTRACT_BE_U_2(rlp->link_metric)); rlp++; } break; @@ -547,18 +547,18 @@ ospf6_print_lsa(netdissect_options *ndo, return (1); lsa_length -= sizeof (lsap->lsa_un.un_nla.nla_options); ND_TCHECK(lsap->lsa_un.un_nla.nla_options); - ND_PRINT((ndo, "\n\t Options [%s]", + ND_PRINT("\n\t Options [%s]", bittok2str(ospf6_option_values, "none", - EXTRACT_BE_U_4(lsap->lsa_un.un_nla.nla_options)))); + EXTRACT_BE_U_4(lsap->lsa_un.un_nla.nla_options))); - ND_PRINT((ndo, "\n\t Connected Routers:")); + ND_PRINT("\n\t Connected Routers:"); ap = lsap->lsa_un.un_nla.nla_router; while (lsa_length != 0) { if (lsa_length < sizeof (*ap)) return (1); lsa_length -= sizeof (*ap); ND_TCHECK_SIZE(ap); - ND_PRINT((ndo, "\n\t\t%s", ipaddr_string(ndo, ap))); + ND_PRINT("\n\t\t%s", ipaddr_string(ndo, ap)); ++ap; } break; @@ -568,8 +568,8 @@ ospf6_print_lsa(netdissect_options *ndo, return (1); lsa_length -= sizeof (lsap->lsa_un.un_inter_ap.inter_ap_metric); ND_TCHECK(lsap->lsa_un.un_inter_ap.inter_ap_metric); - ND_PRINT((ndo, ", metric %u", - EXTRACT_BE_U_4(lsap->lsa_un.un_inter_ap.inter_ap_metric) & SLA_MASK_METRIC)); + ND_PRINT(", metric %u", + EXTRACT_BE_U_4(lsap->lsa_un.un_inter_ap.inter_ap_metric) & SLA_MASK_METRIC); tptr = (const uint8_t *)lsap->lsa_un.un_inter_ap.inter_ap_prefix; while (lsa_length != 0) { @@ -587,11 +587,11 @@ ospf6_print_lsa(netdissect_options *ndo, lsa_length -= sizeof (lsap->lsa_un.un_asla.asla_metric); ND_TCHECK(lsap->lsa_un.un_asla.asla_metric); flags32 = EXTRACT_BE_U_4(lsap->lsa_un.un_asla.asla_metric); - ND_PRINT((ndo, "\n\t Flags [%s]", - bittok2str(ospf6_asla_flag_values, "none", flags32))); - ND_PRINT((ndo, " metric %u", + ND_PRINT("\n\t Flags [%s]", + bittok2str(ospf6_asla_flag_values, "none", flags32)); + ND_PRINT(" metric %u", EXTRACT_BE_U_4(lsap->lsa_un.un_asla.asla_metric) & - ASLA_MASK_METRIC)); + ASLA_MASK_METRIC); tptr = (const uint8_t *)lsap->lsa_un.un_asla.asla_prefix; lsapp = (const struct lsa6_prefix *)tptr; @@ -609,8 +609,8 @@ ospf6_print_lsa(netdissect_options *ndo, return (1); lsa_length -= sizeof (*fwdaddr6); ND_TCHECK_SIZE(fwdaddr6); - ND_PRINT((ndo, " forward %s", - ip6addr_string(ndo, fwdaddr6))); + ND_PRINT(" forward %s", + ip6addr_string(ndo, fwdaddr6)); tptr += sizeof(*fwdaddr6); } @@ -619,8 +619,8 @@ ospf6_print_lsa(netdissect_options *ndo, return (1); lsa_length -= sizeof (uint32_t); ND_TCHECK(*(const uint32_t *)tptr); - ND_PRINT((ndo, " tag %s", - ipaddr_string(ndo, (const uint32_t *)tptr))); + ND_PRINT(" tag %s", + ipaddr_string(ndo, (const uint32_t *)tptr)); tptr += sizeof(uint32_t); } @@ -629,8 +629,8 @@ ospf6_print_lsa(netdissect_options *ndo, return (1); lsa_length -= sizeof (uint32_t); ND_TCHECK(*(const uint32_t *)tptr); - ND_PRINT((ndo, " RefLSID: %s", - ipaddr_string(ndo, (const uint32_t *)tptr))); + ND_PRINT(" RefLSID: %s", + ipaddr_string(ndo, (const uint32_t *)tptr)); tptr += sizeof(uint32_t); } break; @@ -642,19 +642,19 @@ ospf6_print_lsa(netdissect_options *ndo, return (1); lsa_length -= sizeof (llsap->llsa_priandopt); ND_TCHECK(llsap->llsa_priandopt); - ND_PRINT((ndo, "\n\t Options [%s]", + ND_PRINT("\n\t Options [%s]", bittok2str(ospf6_option_values, "none", - EXTRACT_BE_U_4(llsap->llsa_options)))); + EXTRACT_BE_U_4(llsap->llsa_options))); if (lsa_length < sizeof (llsap->llsa_lladdr) + sizeof (llsap->llsa_nprefix)) return (1); lsa_length -= sizeof (llsap->llsa_lladdr) + sizeof (llsap->llsa_nprefix); ND_TCHECK(llsap->llsa_nprefix); prefixes = EXTRACT_BE_U_4(llsap->llsa_nprefix); - ND_PRINT((ndo, "\n\t Priority %d, Link-local address %s, Prefixes %d:", + ND_PRINT("\n\t Priority %d, Link-local address %s, Prefixes %d:", EXTRACT_U_1(llsap->llsa_priority), ip6addr_string(ndo, &llsap->llsa_lladdr), - prefixes)); + prefixes); tptr = (const uint8_t *)llsap->llsa_prefix; while (prefixes > 0) { @@ -682,7 +682,7 @@ ospf6_print_lsa(netdissect_options *ndo, lsa_length -= sizeof (lsap->lsa_un.un_intra_ap.intra_ap_nprefix); ND_TCHECK(lsap->lsa_un.un_intra_ap.intra_ap_nprefix); prefixes = EXTRACT_BE_U_2(lsap->lsa_un.un_intra_ap.intra_ap_nprefix); - ND_PRINT((ndo, "\n\t Prefixes %d:", prefixes)); + ND_PRINT("\n\t Prefixes %d:", prefixes); tptr = (const uint8_t *)lsap->lsa_un.un_intra_ap.intra_ap_prefix; while (prefixes > 0) { @@ -738,31 +738,31 @@ ospf6_decode_v3(netdissect_options *ndo, const struct hello6 *hellop = (const struct hello6 *)((const uint8_t *)op + OSPF6HDR_LEN); ND_TCHECK_4(hellop->hello_options); - ND_PRINT((ndo, "\n\tOptions [%s]", + ND_PRINT("\n\tOptions [%s]", bittok2str(ospf6_option_values, "none", - EXTRACT_BE_U_4(hellop->hello_options)))); + EXTRACT_BE_U_4(hellop->hello_options))); ND_TCHECK(hellop->hello_deadint); - ND_PRINT((ndo, "\n\t Hello Timer %us, Dead Timer %us, Interface-ID %s, Priority %u", + ND_PRINT("\n\t Hello Timer %us, Dead Timer %us, Interface-ID %s, Priority %u", EXTRACT_BE_U_2(hellop->hello_helloint), EXTRACT_BE_U_2(hellop->hello_deadint), ipaddr_string(ndo, &hellop->hello_ifid), - EXTRACT_U_1(hellop->hello_priority))); + EXTRACT_U_1(hellop->hello_priority)); ND_TCHECK(hellop->hello_dr); if (EXTRACT_BE_U_4(hellop->hello_dr) != 0) - ND_PRINT((ndo, "\n\t Designated Router %s", - ipaddr_string(ndo, &hellop->hello_dr))); + ND_PRINT("\n\t Designated Router %s", + ipaddr_string(ndo, &hellop->hello_dr)); ND_TCHECK(hellop->hello_bdr); if (EXTRACT_BE_U_4(hellop->hello_bdr) != 0) - ND_PRINT((ndo, ", Backup Designated Router %s", - ipaddr_string(ndo, &hellop->hello_bdr))); + ND_PRINT(", Backup Designated Router %s", + ipaddr_string(ndo, &hellop->hello_bdr)); if (ndo->ndo_vflag > 1) { - ND_PRINT((ndo, "\n\t Neighbor List:")); + ND_PRINT("\n\t Neighbor List:"); ap = hellop->hello_neighbor; while ((const u_char *)ap < dataend) { ND_TCHECK_SIZE(ap); - ND_PRINT((ndo, "\n\t %s", ipaddr_string(ndo, ap))); + ND_PRINT("\n\t %s", ipaddr_string(ndo, ap)); ++ap; } } @@ -773,17 +773,17 @@ ospf6_decode_v3(netdissect_options *ndo, const struct dd6 *ddp = (const struct dd6 *)((const uint8_t *)op + OSPF6HDR_LEN); ND_TCHECK(ddp->db_options); - ND_PRINT((ndo, "\n\tOptions [%s]", + ND_PRINT("\n\tOptions [%s]", bittok2str(ospf6_option_values, "none", - EXTRACT_BE_U_4(ddp->db_options)))); + EXTRACT_BE_U_4(ddp->db_options))); ND_TCHECK(ddp->db_flags); - ND_PRINT((ndo, ", DD Flags [%s]", - bittok2str(ospf6_dd_flag_values,"none",EXTRACT_U_1(ddp->db_flags)))); + ND_PRINT(", DD Flags [%s]", + bittok2str(ospf6_dd_flag_values,"none",EXTRACT_U_1(ddp->db_flags))); ND_TCHECK(ddp->db_seq); - ND_PRINT((ndo, ", MTU %u, DD-Sequence 0x%08x", + ND_PRINT(", MTU %u, DD-Sequence 0x%08x", EXTRACT_BE_U_2(ddp->db_mtu), - EXTRACT_BE_U_4(ddp->db_seq))); + EXTRACT_BE_U_4(ddp->db_seq)); if (ndo->ndo_vflag > 1) { /* Print all the LS adv's */ lshp = ddp->db_lshdr; @@ -800,8 +800,8 @@ ospf6_decode_v3(netdissect_options *ndo, lsrp = (const struct lsr6 *)((const uint8_t *)op + OSPF6HDR_LEN); while ((const u_char *)lsrp < dataend) { ND_TCHECK_SIZE(lsrp); - ND_PRINT((ndo, "\n\t Advertising Router %s", - ipaddr_string(ndo, &lsrp->ls_router))); + ND_PRINT("\n\t Advertising Router %s", + ipaddr_string(ndo, &lsrp->ls_router)); ospf6_print_ls_type(ndo, EXTRACT_BE_U_2(lsrp->ls_type), &lsrp->ls_stateid); @@ -857,12 +857,12 @@ ospf6_print_lls(netdissect_options *ndo, goto trunc; /* Checksum */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\tLLS Checksum 0x%04x", EXTRACT_BE_U_2(cp))); + ND_PRINT("\n\tLLS Checksum 0x%04x", EXTRACT_BE_U_2(cp)); cp += 2; /* LLS Data Length */ ND_TCHECK_2(cp); llsdatalen = EXTRACT_BE_U_2(cp); - ND_PRINT((ndo, ", Data Length %u", llsdatalen)); + ND_PRINT(", Data Length %u", llsdatalen); if (llsdatalen < OSPF_LLS_HDRLEN || llsdatalen > len) goto trunc; cp += 2; @@ -888,12 +888,12 @@ ospf6_decode_at(netdissect_options *ndo, goto trunc; /* Authentication Type */ ND_TCHECK_2(cp); - ND_PRINT((ndo, "\n\tAuthentication Type %s", tok2str(ospf6_auth_type_str, "unknown (0x%04x)", EXTRACT_BE_U_2(cp)))); + ND_PRINT("\n\tAuthentication Type %s", tok2str(ospf6_auth_type_str, "unknown (0x%04x)", EXTRACT_BE_U_2(cp))); cp += 2; /* Auth Data Len */ ND_TCHECK_2(cp); authdatalen = EXTRACT_BE_U_2(cp); - ND_PRINT((ndo, ", Length %u", authdatalen)); + ND_PRINT(", Length %u", authdatalen); if (authdatalen < OSPF6_AT_HDRLEN || authdatalen > len) goto trunc; cp += 2; @@ -902,15 +902,15 @@ ospf6_decode_at(netdissect_options *ndo, cp += 2; /* Security Association ID */ ND_TCHECK_2(cp); - ND_PRINT((ndo, ", SAID %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(", SAID %u", EXTRACT_BE_U_2(cp)); cp += 2; /* Cryptographic Sequence Number (High-Order 32 Bits) */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ", CSN 0x%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT(", CSN 0x%08x", EXTRACT_BE_U_4(cp)); cp += 4; /* Cryptographic Sequence Number (Low-Order 32 Bits) */ ND_TCHECK_4(cp); - ND_PRINT((ndo, ":%08x", EXTRACT_BE_U_4(cp))); + ND_PRINT(":%08x", EXTRACT_BE_U_4(cp)); cp += 4; /* Authentication Data */ ND_TCHECK_LEN(cp, authdatalen - OSPF6_AT_HDRLEN); @@ -971,7 +971,7 @@ ospf6_print(netdissect_options *ndo, /* value. If it's not valid, say so and return */ ND_TCHECK(op->ospf6_type); cp = tok2str(ospf6_type_values, "unknown packet type (%u)", EXTRACT_U_1(op->ospf6_type)); - ND_PRINT((ndo, "OSPFv%u, %s, length %u", EXTRACT_U_1(op->ospf6_version), cp, length)); + ND_PRINT("OSPFv%u, %s, length %u", EXTRACT_U_1(op->ospf6_version), cp, length); if (*cp == 'u') { return; } @@ -984,22 +984,22 @@ ospf6_print(netdissect_options *ndo, ND_TCHECK(op->ospf6_len); datalen = EXTRACT_BE_U_2(op->ospf6_len); if (datalen > length) { - ND_PRINT((ndo, " [len %d]", datalen)); + ND_PRINT(" [len %d]", datalen); return; } dataend = bp + datalen; ND_TCHECK(op->ospf6_routerid); - ND_PRINT((ndo, "\n\tRouter-ID %s", ipaddr_string(ndo, &op->ospf6_routerid))); + ND_PRINT("\n\tRouter-ID %s", ipaddr_string(ndo, &op->ospf6_routerid)); ND_TCHECK(op->ospf6_areaid); if (EXTRACT_BE_U_4(op->ospf6_areaid) != 0) - ND_PRINT((ndo, ", Area %s", ipaddr_string(ndo, &op->ospf6_areaid))); + ND_PRINT(", Area %s", ipaddr_string(ndo, &op->ospf6_areaid)); else - ND_PRINT((ndo, ", Backbone Area")); + ND_PRINT(", Backbone Area"); ND_TCHECK(op->ospf6_instanceid); if (EXTRACT_U_1(op->ospf6_instanceid)) - ND_PRINT((ndo, ", Instance %u", EXTRACT_U_1(op->ospf6_instanceid))); + ND_PRINT(", Instance %u", EXTRACT_U_1(op->ospf6_instanceid)); /* Do rest according to version. */ switch (EXTRACT_U_1(op->ospf6_version)) { @@ -1014,5 +1014,5 @@ ospf6_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-otv.c b/print-otv.c index 502f93e4..0b98e74c 100644 --- a/print-otv.c +++ b/print-otv.c @@ -45,21 +45,21 @@ otv_print(netdissect_options *ndo, const u_char *bp, u_int len) { uint8_t flags; - ND_PRINT((ndo, "OTV, ")); + ND_PRINT("OTV, "); if (len < OTV_HDR_LEN) goto trunc; ND_TCHECK_1(bp); flags = EXTRACT_U_1(bp); - ND_PRINT((ndo, "flags [%s] (0x%02x), ", flags & 0x08 ? "I" : ".", flags)); + ND_PRINT("flags [%s] (0x%02x), ", flags & 0x08 ? "I" : ".", flags); bp += 1; ND_TCHECK_3(bp); - ND_PRINT((ndo, "overlay %u, ", EXTRACT_BE_U_3(bp))); + ND_PRINT("overlay %u, ", EXTRACT_BE_U_3(bp)); bp += 3; ND_TCHECK_3(bp); - ND_PRINT((ndo, "instance %u\n", EXTRACT_BE_U_3(bp))); + ND_PRINT("instance %u\n", EXTRACT_BE_U_3(bp)); bp += 3; /* Reserved */ @@ -70,5 +70,5 @@ otv_print(netdissect_options *ndo, const u_char *bp, u_int len) return; trunc: - ND_PRINT((ndo, " [|OTV]")); + ND_PRINT(" [|OTV]"); } diff --git a/print-pflog.c b/print-pflog.c index 084b314b..94164e98 100644 --- a/print-pflog.c +++ b/print-pflog.c @@ -93,15 +93,15 @@ pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr) rulenr = EXTRACT_BE_U_4(&hdr->rulenr); subrulenr = EXTRACT_BE_U_4(&hdr->subrulenr); if (subrulenr == (uint32_t)-1) - ND_PRINT((ndo, "rule %u/", rulenr)); + ND_PRINT("rule %u/", rulenr); else - ND_PRINT((ndo, "rule %u.%s.%u/", rulenr, hdr->ruleset, subrulenr)); + ND_PRINT("rule %u.%s.%u/", rulenr, hdr->ruleset, subrulenr); - ND_PRINT((ndo, "%s: %s %s on %s: ", + ND_PRINT("%s: %s %s on %s: ", tok2str(pf_reasons, "unkn(%u)", EXTRACT_U_1(&hdr->reason)), tok2str(pf_actions, "unkn(%u)", EXTRACT_U_1(&hdr->action)), tok2str(pf_directions, "unkn(%u)", EXTRACT_U_1(&hdr->dir)), - hdr->ifname)); + hdr->ifname); } u_int @@ -116,20 +116,20 @@ pflog_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, /* check length */ if (caplen < sizeof(uint8_t)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (caplen); } #define MIN_PFLOG_HDRLEN 45 hdr = (const struct pfloghdr *)p; if (hdr->length < MIN_PFLOG_HDRLEN) { - ND_PRINT((ndo, "[pflog: invalid header length!]")); + ND_PRINT("[pflog: invalid header length!]"); return (hdr->length); /* XXX: not really */ } hdrlen = BPF_WORDALIGN(hdr->length); if (caplen < hdrlen) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (hdrlen); /* XXX: true? */ } @@ -173,7 +173,7 @@ pflog_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, return (hdrlen); trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (hdrlen); } diff --git a/print-pgm.c b/print-pgm.c index de33a9af..30ac136c 100644 --- a/print-pgm.c +++ b/print-pgm.c @@ -167,13 +167,13 @@ pgm_print(netdissect_options *ndo, ch = '\0'; if (!ND_TTEST_2(pgm->pgm_dport)) { if (ip6) { - ND_PRINT((ndo, "%s > %s: [|pgm]", + ND_PRINT("%s > %s: [|pgm]", ip6addr_string(ndo, &ip6->ip6_src), - ip6addr_string(ndo, &ip6->ip6_dst))); + ip6addr_string(ndo, &ip6->ip6_dst)); } else { - ND_PRINT((ndo, "%s > %s: [|pgm]", + ND_PRINT("%s > %s: [|pgm]", ipaddr_string(ndo, &ip->ip_src), - ipaddr_string(ndo, &ip->ip_dst))); + ipaddr_string(ndo, &ip->ip_dst)); } return; } @@ -183,43 +183,43 @@ pgm_print(netdissect_options *ndo, if (ip6) { if (EXTRACT_U_1(ip6->ip6_nxt) == IPPROTO_PGM) { - ND_PRINT((ndo, "%s.%s > %s.%s: ", + ND_PRINT("%s.%s > %s.%s: ", ip6addr_string(ndo, &ip6->ip6_src), tcpport_string(ndo, sport), ip6addr_string(ndo, &ip6->ip6_dst), - tcpport_string(ndo, dport))); + tcpport_string(ndo, dport)); } else { - ND_PRINT((ndo, "%s > %s: ", - tcpport_string(ndo, sport), tcpport_string(ndo, dport))); + ND_PRINT("%s > %s: ", + tcpport_string(ndo, sport), tcpport_string(ndo, dport)); } } else { if (EXTRACT_U_1(ip->ip_p) == IPPROTO_PGM) { - ND_PRINT((ndo, "%s.%s > %s.%s: ", + ND_PRINT("%s.%s > %s.%s: ", ipaddr_string(ndo, &ip->ip_src), tcpport_string(ndo, sport), ipaddr_string(ndo, &ip->ip_dst), - tcpport_string(ndo, dport))); + tcpport_string(ndo, dport)); } else { - ND_PRINT((ndo, "%s > %s: ", - tcpport_string(ndo, sport), tcpport_string(ndo, dport))); + ND_PRINT("%s > %s: ", + tcpport_string(ndo, sport), tcpport_string(ndo, dport)); } } ND_TCHECK_SIZE(pgm); - ND_PRINT((ndo, "PGM, length %u", EXTRACT_BE_U_2(pgm->pgm_length))); + ND_PRINT("PGM, length %u", EXTRACT_BE_U_2(pgm->pgm_length)); if (!ndo->ndo_vflag) return; pgm_type_val = EXTRACT_U_1(pgm->pgm_type); - ND_PRINT((ndo, " 0x%02x%02x%02x%02x%02x%02x ", + ND_PRINT(" 0x%02x%02x%02x%02x%02x%02x ", pgm->pgm_gsid[0], pgm->pgm_gsid[1], pgm->pgm_gsid[2], pgm->pgm_gsid[3], pgm->pgm_gsid[4], - pgm->pgm_gsid[5])); + pgm->pgm_gsid[5]); switch (pgm_type_val) { case PGM_SPM: { const struct pgm_spm *spm; @@ -244,11 +244,11 @@ pgm_print(netdissect_options *ndo, break; } - ND_PRINT((ndo, "SPM seq %u trail %u lead %u nla %s", + ND_PRINT("SPM seq %u trail %u lead %u nla %s", EXTRACT_BE_U_4(spm->pgms_seq), EXTRACT_BE_U_4(spm->pgms_trailseq), EXTRACT_BE_U_4(spm->pgms_leadseq), - nla_buf)); + nla_buf); break; } @@ -257,9 +257,9 @@ pgm_print(netdissect_options *ndo, poll_msg = (const struct pgm_poll *)(pgm + 1); ND_TCHECK_SIZE(poll_msg); - ND_PRINT((ndo, "POLL seq %u round %u", + ND_PRINT("POLL seq %u round %u", EXTRACT_BE_U_4(poll_msg->pgmp_seq), - EXTRACT_BE_U_2(poll_msg->pgmp_round))); + EXTRACT_BE_U_2(poll_msg->pgmp_round)); bp = (const u_char *) (poll_msg + 1); break; } @@ -299,9 +299,9 @@ pgm_print(netdissect_options *ndo, mask = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); - ND_PRINT((ndo, "POLR seq %u round %u nla %s ivl %u rnd 0x%08x " + ND_PRINT("POLR seq %u round %u nla %s ivl %u rnd 0x%08x " "mask 0x%08x", EXTRACT_BE_U_4(polr->pgmp_seq), - EXTRACT_BE_U_2(polr->pgmp_round), nla_buf, ivl, rnd, mask)); + EXTRACT_BE_U_2(polr->pgmp_round), nla_buf, ivl, rnd, mask); break; } case PGM_ODATA: { @@ -309,9 +309,9 @@ pgm_print(netdissect_options *ndo, odata = (const struct pgm_data *)(pgm + 1); ND_TCHECK_SIZE(odata); - ND_PRINT((ndo, "ODATA trail %u seq %u", + ND_PRINT("ODATA trail %u seq %u", EXTRACT_BE_U_4(odata->pgmd_trailseq), - EXTRACT_BE_U_4(odata->pgmd_seq))); + EXTRACT_BE_U_4(odata->pgmd_seq)); bp = (const u_char *) (odata + 1); break; } @@ -321,9 +321,9 @@ pgm_print(netdissect_options *ndo, rdata = (const struct pgm_data *)(pgm + 1); ND_TCHECK_SIZE(rdata); - ND_PRINT((ndo, "RDATA trail %u seq %u", + ND_PRINT("RDATA trail %u seq %u", EXTRACT_BE_U_4(rdata->pgmd_trailseq), - EXTRACT_BE_U_4(rdata->pgmd_seq))); + EXTRACT_BE_U_4(rdata->pgmd_seq)); bp = (const u_char *) (rdata + 1); break; } @@ -385,19 +385,19 @@ pgm_print(netdissect_options *ndo, */ switch (pgm_type_val) { case PGM_NAK: - ND_PRINT((ndo, "NAK ")); + ND_PRINT("NAK "); break; case PGM_NULLNAK: - ND_PRINT((ndo, "NNAK ")); + ND_PRINT("NNAK "); break; case PGM_NCF: - ND_PRINT((ndo, "NCF ")); + ND_PRINT("NCF "); break; default: break; } - ND_PRINT((ndo, "(%s -> %s), seq %u", - source_buf, group_buf, EXTRACT_BE_U_4(nak->pgmn_seq))); + ND_PRINT("(%s -> %s), seq %u", + source_buf, group_buf, EXTRACT_BE_U_4(nak->pgmn_seq)); break; } @@ -406,18 +406,18 @@ pgm_print(netdissect_options *ndo, ack = (const struct pgm_ack *)(pgm + 1); ND_TCHECK_SIZE(ack); - ND_PRINT((ndo, "ACK seq %u", - EXTRACT_BE_U_4(ack->pgma_rx_max_seq))); + ND_PRINT("ACK seq %u", + EXTRACT_BE_U_4(ack->pgma_rx_max_seq)); bp = (const u_char *) (ack + 1); break; } case PGM_SPMR: - ND_PRINT((ndo, "SPMR")); + ND_PRINT("SPMR"); break; default: - ND_PRINT((ndo, "UNKNOWN type 0x%02x", pgm_type_val)); + ND_PRINT("UNKNOWN type 0x%02x", pgm_type_val); break; } @@ -427,7 +427,7 @@ pgm_print(netdissect_options *ndo, * make sure there's enough for the first option header */ if (!ND_TTEST_LEN(bp, PGM_MIN_OPT_LEN)) { - ND_PRINT((ndo, "[|OPT]")); + ND_PRINT("[|OPT]"); return; } @@ -438,31 +438,31 @@ pgm_print(netdissect_options *ndo, opt_type = EXTRACT_U_1(bp); bp++; if ((opt_type & PGM_OPT_MASK) != PGM_OPT_LENGTH) { - ND_PRINT((ndo, "[First option bad, should be PGM_OPT_LENGTH, is %u]", opt_type & PGM_OPT_MASK)); + ND_PRINT("[First option bad, should be PGM_OPT_LENGTH, is %u]", opt_type & PGM_OPT_MASK); return; } opt_len = EXTRACT_U_1(bp); bp++; if (opt_len != 4) { - ND_PRINT((ndo, "[Bad OPT_LENGTH option, length %u != 4]", opt_len)); + ND_PRINT("[Bad OPT_LENGTH option, length %u != 4]", opt_len); return; } opts_len = EXTRACT_BE_U_2(bp); bp += sizeof(uint16_t); if (opts_len < 4) { - ND_PRINT((ndo, "[Bad total option length %u < 4]", opts_len)); + ND_PRINT("[Bad total option length %u < 4]", opts_len); return; } - ND_PRINT((ndo, " OPTS LEN %u", opts_len)); + ND_PRINT(" OPTS LEN %u", opts_len); opts_len -= 4; while (opts_len) { if (opts_len < PGM_MIN_OPT_LEN) { - ND_PRINT((ndo, "[Total option length leaves no room for final option]")); + ND_PRINT("[Total option length leaves no room for final option]"); return; } if (!ND_TTEST_2(bp)) { - ND_PRINT((ndo, " [|OPT]")); + ND_PRINT(" [|OPT]"); return; } opt_type = EXTRACT_U_1(bp); @@ -470,16 +470,16 @@ pgm_print(netdissect_options *ndo, opt_len = EXTRACT_U_1(bp); bp++; if (opt_len < PGM_MIN_OPT_LEN) { - ND_PRINT((ndo, "[Bad option, length %u < %u]", opt_len, - PGM_MIN_OPT_LEN)); + ND_PRINT("[Bad option, length %u < %u]", opt_len, + PGM_MIN_OPT_LEN); break; } if (opts_len < opt_len) { - ND_PRINT((ndo, "[Total option length leaves no room for final option]")); + ND_PRINT("[Total option length leaves no room for final option]"); return; } if (!ND_TTEST_LEN(bp, opt_len - 2)) { - ND_PRINT((ndo, " [|OPT]")); + ND_PRINT(" [|OPT]"); return; } @@ -487,11 +487,11 @@ pgm_print(netdissect_options *ndo, case PGM_OPT_LENGTH: #define PGM_OPT_LENGTH_LEN (2+2) if (opt_len != PGM_OPT_LENGTH_LEN) { - ND_PRINT((ndo, "[Bad OPT_LENGTH option, length %u != %u]", - opt_len, PGM_OPT_LENGTH_LEN)); + ND_PRINT("[Bad OPT_LENGTH option, length %u != %u]", + opt_len, PGM_OPT_LENGTH_LEN); return; } - ND_PRINT((ndo, " OPTS LEN (extra?) %u", EXTRACT_BE_U_2(bp))); + ND_PRINT(" OPTS LEN (extra?) %u", EXTRACT_BE_U_2(bp)); bp += 2; opts_len -= PGM_OPT_LENGTH_LEN; break; @@ -499,8 +499,8 @@ pgm_print(netdissect_options *ndo, case PGM_OPT_FRAGMENT: #define PGM_OPT_FRAGMENT_LEN (2+2+4+4+4) if (opt_len != PGM_OPT_FRAGMENT_LEN) { - ND_PRINT((ndo, "[Bad OPT_FRAGMENT option, length %u != %u]", - opt_len, PGM_OPT_FRAGMENT_LEN)); + ND_PRINT("[Bad OPT_FRAGMENT option, length %u != %u]", + opt_len, PGM_OPT_FRAGMENT_LEN); return; } bp += 2; @@ -510,21 +510,21 @@ pgm_print(netdissect_options *ndo, bp += 4; len = EXTRACT_BE_U_4(bp); bp += 4; - ND_PRINT((ndo, " FRAG seq %u off %u len %u", seq, offset, len)); + ND_PRINT(" FRAG seq %u off %u len %u", seq, offset, len); opts_len -= PGM_OPT_FRAGMENT_LEN; break; case PGM_OPT_NAK_LIST: bp += 2; opt_len -= 4; /* option header */ - ND_PRINT((ndo, " NAK LIST")); + ND_PRINT(" NAK LIST"); while (opt_len) { if (opt_len < 4) { - ND_PRINT((ndo, "[Option length not a multiple of 4]")); + ND_PRINT("[Option length not a multiple of 4]"); return; } ND_TCHECK_4(bp); - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(bp))); + ND_PRINT(" %u", EXTRACT_BE_U_4(bp)); bp += 4; opt_len -= 4; opts_len -= 4; @@ -534,22 +534,22 @@ pgm_print(netdissect_options *ndo, case PGM_OPT_JOIN: #define PGM_OPT_JOIN_LEN (2+2+4) if (opt_len != PGM_OPT_JOIN_LEN) { - ND_PRINT((ndo, "[Bad OPT_JOIN option, length %u != %u]", - opt_len, PGM_OPT_JOIN_LEN)); + ND_PRINT("[Bad OPT_JOIN option, length %u != %u]", + opt_len, PGM_OPT_JOIN_LEN); return; } bp += 2; seq = EXTRACT_BE_U_4(bp); bp += 4; - ND_PRINT((ndo, " JOIN %u", seq)); + ND_PRINT(" JOIN %u", seq); opts_len -= PGM_OPT_JOIN_LEN; break; case PGM_OPT_NAK_BO_IVL: #define PGM_OPT_NAK_BO_IVL_LEN (2+2+4+4) if (opt_len != PGM_OPT_NAK_BO_IVL_LEN) { - ND_PRINT((ndo, "[Bad OPT_NAK_BO_IVL option, length %u != %u]", - opt_len, PGM_OPT_NAK_BO_IVL_LEN)); + ND_PRINT("[Bad OPT_NAK_BO_IVL option, length %u != %u]", + opt_len, PGM_OPT_NAK_BO_IVL_LEN); return; } bp += 2; @@ -557,15 +557,15 @@ pgm_print(netdissect_options *ndo, bp += 4; seq = EXTRACT_BE_U_4(bp); bp += 4; - ND_PRINT((ndo, " BACKOFF ivl %u ivlseq %u", offset, seq)); + ND_PRINT(" BACKOFF ivl %u ivlseq %u", offset, seq); opts_len -= PGM_OPT_NAK_BO_IVL_LEN; break; case PGM_OPT_NAK_BO_RNG: #define PGM_OPT_NAK_BO_RNG_LEN (2+2+4+4) if (opt_len != PGM_OPT_NAK_BO_RNG_LEN) { - ND_PRINT((ndo, "[Bad OPT_NAK_BO_RNG option, length %u != %u]", - opt_len, PGM_OPT_NAK_BO_RNG_LEN)); + ND_PRINT("[Bad OPT_NAK_BO_RNG option, length %u != %u]", + opt_len, PGM_OPT_NAK_BO_RNG_LEN); return; } bp += 2; @@ -573,15 +573,15 @@ pgm_print(netdissect_options *ndo, bp += 4; seq = EXTRACT_BE_U_4(bp); bp += 4; - ND_PRINT((ndo, " BACKOFF max %u min %u", offset, seq)); + ND_PRINT(" BACKOFF max %u min %u", offset, seq); opts_len -= PGM_OPT_NAK_BO_RNG_LEN; break; case PGM_OPT_REDIRECT: #define PGM_OPT_REDIRECT_FIXED_LEN (2+2+2+2) if (opt_len < PGM_OPT_REDIRECT_FIXED_LEN) { - ND_PRINT((ndo, "[Bad OPT_REDIRECT option, length %u < %u]", - opt_len, PGM_OPT_REDIRECT_FIXED_LEN)); + ND_PRINT("[Bad OPT_REDIRECT option, length %u < %u]", + opt_len, PGM_OPT_REDIRECT_FIXED_LEN); return; } bp += 2; @@ -590,8 +590,8 @@ pgm_print(netdissect_options *ndo, switch (nla_afnum) { case AFNUM_INET: if (opt_len != PGM_OPT_REDIRECT_FIXED_LEN + sizeof(struct in_addr)) { - ND_PRINT((ndo, "[Bad OPT_REDIRECT option, length %u != %u + address size]", - opt_len, PGM_OPT_REDIRECT_FIXED_LEN)); + ND_PRINT("[Bad OPT_REDIRECT option, length %u != %u + address size]", + opt_len, PGM_OPT_REDIRECT_FIXED_LEN); return; } ND_TCHECK_LEN(bp, sizeof(struct in_addr)); @@ -601,8 +601,8 @@ pgm_print(netdissect_options *ndo, break; case AFNUM_INET6: if (opt_len != PGM_OPT_REDIRECT_FIXED_LEN + sizeof(struct in6_addr)) { - ND_PRINT((ndo, "[Bad OPT_REDIRECT option, length %u != %u + address size]", - PGM_OPT_REDIRECT_FIXED_LEN, opt_len)); + ND_PRINT("[Bad OPT_REDIRECT option, length %u != %u + address size]", + PGM_OPT_REDIRECT_FIXED_LEN, opt_len); return; } ND_TCHECK_LEN(bp, sizeof(struct in6_addr)); @@ -615,65 +615,65 @@ pgm_print(netdissect_options *ndo, break; } - ND_PRINT((ndo, " REDIRECT %s", nla_buf)); + ND_PRINT(" REDIRECT %s", nla_buf); break; case PGM_OPT_PARITY_PRM: #define PGM_OPT_PARITY_PRM_LEN (2+2+4) if (opt_len != PGM_OPT_PARITY_PRM_LEN) { - ND_PRINT((ndo, "[Bad OPT_PARITY_PRM option, length %u != %u]", - opt_len, PGM_OPT_PARITY_PRM_LEN)); + ND_PRINT("[Bad OPT_PARITY_PRM option, length %u != %u]", + opt_len, PGM_OPT_PARITY_PRM_LEN); return; } bp += 2; len = EXTRACT_BE_U_4(bp); bp += 4; - ND_PRINT((ndo, " PARITY MAXTGS %u", len)); + ND_PRINT(" PARITY MAXTGS %u", len); opts_len -= PGM_OPT_PARITY_PRM_LEN; break; case PGM_OPT_PARITY_GRP: #define PGM_OPT_PARITY_GRP_LEN (2+2+4) if (opt_len != PGM_OPT_PARITY_GRP_LEN) { - ND_PRINT((ndo, "[Bad OPT_PARITY_GRP option, length %u != %u]", - opt_len, PGM_OPT_PARITY_GRP_LEN)); + ND_PRINT("[Bad OPT_PARITY_GRP option, length %u != %u]", + opt_len, PGM_OPT_PARITY_GRP_LEN); return; } bp += 2; seq = EXTRACT_BE_U_4(bp); bp += 4; - ND_PRINT((ndo, " PARITY GROUP %u", seq)); + ND_PRINT(" PARITY GROUP %u", seq); opts_len -= PGM_OPT_PARITY_GRP_LEN; break; case PGM_OPT_CURR_TGSIZE: #define PGM_OPT_CURR_TGSIZE_LEN (2+2+4) if (opt_len != PGM_OPT_CURR_TGSIZE_LEN) { - ND_PRINT((ndo, "[Bad OPT_CURR_TGSIZE option, length %u != %u]", - opt_len, PGM_OPT_CURR_TGSIZE_LEN)); + ND_PRINT("[Bad OPT_CURR_TGSIZE option, length %u != %u]", + opt_len, PGM_OPT_CURR_TGSIZE_LEN); return; } bp += 2; len = EXTRACT_BE_U_4(bp); bp += 4; - ND_PRINT((ndo, " PARITY ATGS %u", len)); + ND_PRINT(" PARITY ATGS %u", len); opts_len -= PGM_OPT_CURR_TGSIZE_LEN; break; case PGM_OPT_NBR_UNREACH: #define PGM_OPT_NBR_UNREACH_LEN (2+2) if (opt_len != PGM_OPT_NBR_UNREACH_LEN) { - ND_PRINT((ndo, "[Bad OPT_NBR_UNREACH option, length %u != %u]", - opt_len, PGM_OPT_NBR_UNREACH_LEN)); + ND_PRINT("[Bad OPT_NBR_UNREACH option, length %u != %u]", + opt_len, PGM_OPT_NBR_UNREACH_LEN); return; } bp += 2; - ND_PRINT((ndo, " NBR_UNREACH")); + ND_PRINT(" NBR_UNREACH"); opts_len -= PGM_OPT_NBR_UNREACH_LEN; break; case PGM_OPT_PATH_NLA: - ND_PRINT((ndo, " PATH_NLA [%u]", opt_len)); + ND_PRINT(" PATH_NLA [%u]", opt_len); bp += opt_len; opts_len -= opt_len; break; @@ -681,41 +681,41 @@ pgm_print(netdissect_options *ndo, case PGM_OPT_SYN: #define PGM_OPT_SYN_LEN (2+2) if (opt_len != PGM_OPT_SYN_LEN) { - ND_PRINT((ndo, "[Bad OPT_SYN option, length %u != %u]", - opt_len, PGM_OPT_SYN_LEN)); + ND_PRINT("[Bad OPT_SYN option, length %u != %u]", + opt_len, PGM_OPT_SYN_LEN); return; } bp += 2; - ND_PRINT((ndo, " SYN")); + ND_PRINT(" SYN"); opts_len -= PGM_OPT_SYN_LEN; break; case PGM_OPT_FIN: #define PGM_OPT_FIN_LEN (2+2) if (opt_len != PGM_OPT_FIN_LEN) { - ND_PRINT((ndo, "[Bad OPT_FIN option, length %u != %u]", - opt_len, PGM_OPT_FIN_LEN)); + ND_PRINT("[Bad OPT_FIN option, length %u != %u]", + opt_len, PGM_OPT_FIN_LEN); return; } bp += 2; - ND_PRINT((ndo, " FIN")); + ND_PRINT(" FIN"); opts_len -= PGM_OPT_FIN_LEN; break; case PGM_OPT_RST: #define PGM_OPT_RST_LEN (2+2) if (opt_len != PGM_OPT_RST_LEN) { - ND_PRINT((ndo, "[Bad OPT_RST option, length %u != %u]", - opt_len, PGM_OPT_RST_LEN)); + ND_PRINT("[Bad OPT_RST option, length %u != %u]", + opt_len, PGM_OPT_RST_LEN); return; } bp += 2; - ND_PRINT((ndo, " RST")); + ND_PRINT(" RST"); opts_len -= PGM_OPT_RST_LEN; break; case PGM_OPT_CR: - ND_PRINT((ndo, " CR")); + ND_PRINT(" CR"); bp += opt_len; opts_len -= opt_len; break; @@ -723,20 +723,20 @@ pgm_print(netdissect_options *ndo, case PGM_OPT_CRQST: #define PGM_OPT_CRQST_LEN (2+2) if (opt_len != PGM_OPT_CRQST_LEN) { - ND_PRINT((ndo, "[Bad OPT_CRQST option, length %u != %u]", - opt_len, PGM_OPT_CRQST_LEN)); + ND_PRINT("[Bad OPT_CRQST option, length %u != %u]", + opt_len, PGM_OPT_CRQST_LEN); return; } bp += 2; - ND_PRINT((ndo, " CRQST")); + ND_PRINT(" CRQST"); opts_len -= PGM_OPT_CRQST_LEN; break; case PGM_OPT_PGMCC_DATA: #define PGM_OPT_PGMCC_DATA_FIXED_LEN (2+2+4+2+2) if (opt_len < PGM_OPT_PGMCC_DATA_FIXED_LEN) { - ND_PRINT((ndo, "[Bad OPT_PGMCC_DATA option, length %u < %u]", - opt_len, PGM_OPT_PGMCC_DATA_FIXED_LEN)); + ND_PRINT("[Bad OPT_PGMCC_DATA option, length %u < %u]", + opt_len, PGM_OPT_PGMCC_DATA_FIXED_LEN); return; } bp += 2; @@ -747,8 +747,8 @@ pgm_print(netdissect_options *ndo, switch (nla_afnum) { case AFNUM_INET: if (opt_len != PGM_OPT_PGMCC_DATA_FIXED_LEN + sizeof(struct in_addr)) { - ND_PRINT((ndo, "[Bad OPT_PGMCC_DATA option, length %u != %u + address size]", - opt_len, PGM_OPT_PGMCC_DATA_FIXED_LEN)); + ND_PRINT("[Bad OPT_PGMCC_DATA option, length %u != %u + address size]", + opt_len, PGM_OPT_PGMCC_DATA_FIXED_LEN); return; } ND_TCHECK_LEN(bp, sizeof(struct in_addr)); @@ -758,8 +758,8 @@ pgm_print(netdissect_options *ndo, break; case AFNUM_INET6: if (opt_len != PGM_OPT_PGMCC_DATA_FIXED_LEN + sizeof(struct in6_addr)) { - ND_PRINT((ndo, "[Bad OPT_PGMCC_DATA option, length %u != %u + address size]", - opt_len, PGM_OPT_PGMCC_DATA_FIXED_LEN)); + ND_PRINT("[Bad OPT_PGMCC_DATA option, length %u != %u + address size]", + opt_len, PGM_OPT_PGMCC_DATA_FIXED_LEN); return; } ND_TCHECK_LEN(bp, sizeof(struct in6_addr)); @@ -772,14 +772,14 @@ pgm_print(netdissect_options *ndo, break; } - ND_PRINT((ndo, " PGMCC DATA %u %s", offset, nla_buf)); + ND_PRINT(" PGMCC DATA %u %s", offset, nla_buf); break; case PGM_OPT_PGMCC_FEEDBACK: #define PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN (2+2+4+2+2) if (opt_len < PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN) { - ND_PRINT((ndo, "[Bad PGM_OPT_PGMCC_FEEDBACK option, length %u < %u]", - opt_len, PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN)); + ND_PRINT("[Bad PGM_OPT_PGMCC_FEEDBACK option, length %u < %u]", + opt_len, PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN); return; } bp += 2; @@ -790,8 +790,8 @@ pgm_print(netdissect_options *ndo, switch (nla_afnum) { case AFNUM_INET: if (opt_len != PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN + sizeof(struct in_addr)) { - ND_PRINT((ndo, "[Bad OPT_PGMCC_FEEDBACK option, length %u != %u + address size]", - opt_len, PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN)); + ND_PRINT("[Bad OPT_PGMCC_FEEDBACK option, length %u != %u + address size]", + opt_len, PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN); return; } ND_TCHECK_LEN(bp, sizeof(struct in_addr)); @@ -801,8 +801,8 @@ pgm_print(netdissect_options *ndo, break; case AFNUM_INET6: if (opt_len != PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN + sizeof(struct in6_addr)) { - ND_PRINT((ndo, "[Bad OPT_PGMCC_FEEDBACK option, length %u != %u + address size]", - opt_len, PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN)); + ND_PRINT("[Bad OPT_PGMCC_FEEDBACK option, length %u != %u + address size]", + opt_len, PGM_OPT_PGMCC_FEEDBACK_FIXED_LEN); return; } ND_TCHECK_LEN(bp, sizeof(struct in6_addr)); @@ -815,11 +815,11 @@ pgm_print(netdissect_options *ndo, break; } - ND_PRINT((ndo, " PGMCC FEEDBACK %u %s", offset, nla_buf)); + ND_PRINT(" PGMCC FEEDBACK %u %s", offset, nla_buf); break; default: - ND_PRINT((ndo, " OPT_%02X [%u] ", opt_type, opt_len)); + ND_PRINT(" OPT_%02X [%u] ", opt_type, opt_len); bp += opt_len; opts_len -= opt_len; break; @@ -830,7 +830,7 @@ pgm_print(netdissect_options *ndo, } } - ND_PRINT((ndo, " [%u]", length)); + ND_PRINT(" [%u]", length); if (ndo->ndo_packettype == PT_PGM_ZMTP1 && (pgm_type_val == PGM_ODATA || pgm_type_val == PGM_RDATA)) zmtp1_datagram_print(ndo, bp, @@ -839,7 +839,7 @@ pgm_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|pgm]")); + ND_PRINT("[|pgm]"); if (ch != '\0') - ND_PRINT((ndo, ">")); + ND_PRINT(">"); } diff --git a/print-pim.c b/print-pim.c index 4f74a7d5..5dc311f1 100644 --- a/print-pim.c +++ b/print-pim.c @@ -151,21 +151,21 @@ pimv1_join_prune_print(netdissect_options *ndo, ((njoin = EXTRACT_BE_U_2(bp + 20)) + EXTRACT_BE_U_2(bp + 22)) == 1) { u_int hold; - ND_PRINT((ndo, " RPF %s ", ipaddr_string(ndo, bp))); + ND_PRINT(" RPF %s ", ipaddr_string(ndo, bp)); hold = EXTRACT_BE_U_2(bp + 6); if (hold != 180) { - ND_PRINT((ndo, "Hold ")); + ND_PRINT("Hold "); unsigned_relts_print(ndo, hold); } - ND_PRINT((ndo, "%s (%s/%u, %s", njoin ? "Join" : "Prune", + ND_PRINT("%s (%s/%u, %s", njoin ? "Join" : "Prune", ipaddr_string(ndo, bp + 26), EXTRACT_U_1(bp + 25) & 0x3f, - ipaddr_string(ndo, bp + 12))); + ipaddr_string(ndo, bp + 12)); if (EXTRACT_BE_U_4(bp + 16) != 0xffffffff) - ND_PRINT((ndo, "/%s", ipaddr_string(ndo, bp + 16))); - ND_PRINT((ndo, ") %s%s %s", + ND_PRINT("/%s", ipaddr_string(ndo, bp + 16)); + ND_PRINT(") %s%s %s", (EXTRACT_U_1(bp + 24) & 0x01) ? "Sparse" : "Dense", (EXTRACT_U_1(bp + 25) & 0x80) ? " WC" : "", - (EXTRACT_U_1(bp + 25) & 0x40) ? "RP" : "SPT")); + (EXTRACT_U_1(bp + 25) & 0x40) ? "RP" : "SPT"); return; } @@ -173,16 +173,16 @@ pimv1_join_prune_print(netdissect_options *ndo, goto trunc; ND_TCHECK_LEN(bp, sizeof(struct in_addr)); if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "\n")); - ND_PRINT((ndo, " Upstream Nbr: %s", ipaddr_string(ndo, bp))); + ND_PRINT("\n"); + ND_PRINT(" Upstream Nbr: %s", ipaddr_string(ndo, bp)); bp += 4; len -= 4; if (len < 4) goto trunc; ND_TCHECK_2(bp + 2); if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "\n")); - ND_PRINT((ndo, " Hold time: ")); + ND_PRINT("\n"); + ND_PRINT(" Hold time: "); unsigned_relts_print(ndo, EXTRACT_BE_U_2(bp + 2)); if (ndo->ndo_vflag < 2) return; @@ -203,14 +203,14 @@ pimv1_join_prune_print(netdissect_options *ndo, if (len < 4) goto trunc; ND_TCHECK_LEN(bp, sizeof(struct in_addr)); - ND_PRINT((ndo, "\n\tGroup: %s", ipaddr_string(ndo, bp))); + ND_PRINT("\n\tGroup: %s", ipaddr_string(ndo, bp)); bp += 4; len -= 4; if (len < 4) goto trunc; ND_TCHECK_LEN(bp, sizeof(struct in_addr)); if (EXTRACT_BE_U_4(bp) != 0xffffffff) - ND_PRINT((ndo, "/%s", ipaddr_string(ndo, bp))); + ND_PRINT("/%s", ipaddr_string(ndo, bp)); bp += 4; len -= 4; if (len < 4) @@ -218,7 +218,7 @@ pimv1_join_prune_print(netdissect_options *ndo, ND_TCHECK_4(bp); njoin = EXTRACT_BE_U_2(bp); nprune = EXTRACT_BE_U_2(bp + 2); - ND_PRINT((ndo, " joined: %u pruned: %u", njoin, nprune)); + ND_PRINT(" joined: %u pruned: %u", njoin, nprune); bp += 4; len -= 4; for (njp = 0; njp < (njoin + nprune); njp++) { @@ -231,12 +231,12 @@ pimv1_join_prune_print(netdissect_options *ndo, if (len < 6) goto trunc; ND_TCHECK_6(bp); - ND_PRINT((ndo, "\n\t%s %s%s%s%s/%u", type, + ND_PRINT("\n\t%s %s%s%s%s/%u", type, (EXTRACT_U_1(bp) & 0x01) ? "Sparse " : "Dense ", (EXTRACT_U_1(bp + 1) & 0x80) ? "WC " : "", (EXTRACT_U_1(bp + 1) & 0x40) ? "RP " : "SPT ", ipaddr_string(ndo, bp + 2), - EXTRACT_U_1(bp + 1) & 0x3f)); + EXTRACT_U_1(bp + 1) & 0x3f); bp += 6; len -= 6; } @@ -244,7 +244,7 @@ pimv1_join_prune_print(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "[|pim]")); + ND_PRINT("[|pim]"); return; } @@ -257,64 +257,64 @@ pimv1_print(netdissect_options *ndo, ND_TCHECK_1(bp + 1); type = EXTRACT_U_1(bp + 1); - ND_PRINT((ndo, " %s", tok2str(pimv1_type_str, "[type %u]", type))); + ND_PRINT(" %s", tok2str(pimv1_type_str, "[type %u]", type)); switch (type) { case PIMV1_TYPE_QUERY: if (ND_TTEST_1(bp + 8)) { switch (EXTRACT_U_1(bp + 8) >> 4) { case 0: - ND_PRINT((ndo, " Dense-mode")); + ND_PRINT(" Dense-mode"); break; case 1: - ND_PRINT((ndo, " Sparse-mode")); + ND_PRINT(" Sparse-mode"); break; case 2: - ND_PRINT((ndo, " Sparse-Dense-mode")); + ND_PRINT(" Sparse-Dense-mode"); break; default: - ND_PRINT((ndo, " mode-%u", EXTRACT_U_1(bp + 8) >> 4)); + ND_PRINT(" mode-%u", EXTRACT_U_1(bp + 8) >> 4); break; } } if (ndo->ndo_vflag) { ND_TCHECK_2(bp + 10); - ND_PRINT((ndo, " (Hold-time ")); + ND_PRINT(" (Hold-time "); unsigned_relts_print(ndo, EXTRACT_BE_U_2(bp + 10)); - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } break; case PIMV1_TYPE_REGISTER: ND_TCHECK_LEN(bp + 8, 20); /* ip header */ - ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, bp + 20), - ipaddr_string(ndo, bp + 24))); + ND_PRINT(" for %s > %s", ipaddr_string(ndo, bp + 20), + ipaddr_string(ndo, bp + 24)); break; case PIMV1_TYPE_REGISTER_STOP: ND_TCHECK_LEN(bp + 12, sizeof(struct in_addr)); - ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, bp + 8), - ipaddr_string(ndo, bp + 12))); + ND_PRINT(" for %s > %s", ipaddr_string(ndo, bp + 8), + ipaddr_string(ndo, bp + 12)); break; case PIMV1_TYPE_RP_REACHABILITY: if (ndo->ndo_vflag) { ND_TCHECK_2(bp + 22); - ND_PRINT((ndo, " group %s", ipaddr_string(ndo, bp + 8))); + ND_PRINT(" group %s", ipaddr_string(ndo, bp + 8)); if (EXTRACT_BE_U_4(bp + 12) != 0xffffffff) - ND_PRINT((ndo, "/%s", ipaddr_string(ndo, bp + 12))); - ND_PRINT((ndo, " RP %s hold ", ipaddr_string(ndo, bp + 16))); + ND_PRINT("/%s", ipaddr_string(ndo, bp + 12)); + ND_PRINT(" RP %s hold ", ipaddr_string(ndo, bp + 16)); unsigned_relts_print(ndo, EXTRACT_BE_U_2(bp + 22)); } break; case PIMV1_TYPE_ASSERT: ND_TCHECK_LEN(bp + 16, sizeof(struct in_addr)); - ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, bp + 16), - ipaddr_string(ndo, bp + 8))); + ND_PRINT(" for %s > %s", ipaddr_string(ndo, bp + 16), + ipaddr_string(ndo, bp + 8)); if (EXTRACT_BE_U_4(bp + 12) != 0xffffffff) - ND_PRINT((ndo, "/%s", ipaddr_string(ndo, bp + 12))); + ND_PRINT("/%s", ipaddr_string(ndo, bp + 12)); ND_TCHECK_4(bp + 24); - ND_PRINT((ndo, " %s pref %u metric %u", + ND_PRINT(" %s pref %u metric %u", (EXTRACT_U_1(bp + 20) & 0x80) ? "RP-tree" : "SPT", EXTRACT_BE_U_4(bp + 20) & 0x7fffffff, - EXTRACT_BE_U_4(bp + 24))); + EXTRACT_BE_U_4(bp + 24)); break; case PIMV1_TYPE_JOIN_PRUNE: case PIMV1_TYPE_GRAFT: @@ -328,11 +328,11 @@ pimv1_print(netdissect_options *ndo, } ND_TCHECK_1(bp + 4); if ((EXTRACT_U_1(bp + 4) >> 4) != 1) - ND_PRINT((ndo, " [v%u]", EXTRACT_U_1(bp + 4) >> 4)); + ND_PRINT(" [v%u]", EXTRACT_U_1(bp + 4) >> 4); return; trunc: - ND_PRINT((ndo, "[|pim]")); + ND_PRINT("[|pim]"); return; } @@ -353,17 +353,17 @@ cisco_autorp_print(netdissect_options *ndo, if (len < 8) goto trunc; ND_TCHECK_1(bp); - ND_PRINT((ndo, " auto-rp ")); + ND_PRINT(" auto-rp "); type = EXTRACT_U_1(bp); switch (type) { case 0x11: - ND_PRINT((ndo, "candidate-advert")); + ND_PRINT("candidate-advert"); break; case 0x12: - ND_PRINT((ndo, "mapping")); + ND_PRINT("mapping"); break; default: - ND_PRINT((ndo, "type-0x%02x", type)); + ND_PRINT("type-0x%02x", type); break; } @@ -371,12 +371,12 @@ cisco_autorp_print(netdissect_options *ndo, numrps = EXTRACT_U_1(bp + 1); ND_TCHECK_2(bp + 2); - ND_PRINT((ndo, " Hold ")); + ND_PRINT(" Hold "); hold = EXTRACT_BE_U_2(bp + 2); if (hold) unsigned_relts_print(ndo, EXTRACT_BE_U_2(bp + 2)); else - ND_PRINT((ndo, "FOREVER")); + ND_PRINT("FOREVER"); /* Next 4 bytes are reserved. */ @@ -402,24 +402,24 @@ cisco_autorp_print(netdissect_options *ndo, if (len < 4) goto trunc; ND_TCHECK_4(bp); - ND_PRINT((ndo, " RP %s", ipaddr_string(ndo, bp))); + ND_PRINT(" RP %s", ipaddr_string(ndo, bp)); bp += 4; len -= 4; if (len < 1) goto trunc; ND_TCHECK_1(bp); switch (EXTRACT_U_1(bp) & 0x3) { - case 0: ND_PRINT((ndo, " PIMv?")); + case 0: ND_PRINT(" PIMv?"); break; - case 1: ND_PRINT((ndo, " PIMv1")); + case 1: ND_PRINT(" PIMv1"); break; - case 2: ND_PRINT((ndo, " PIMv2")); + case 2: ND_PRINT(" PIMv2"); break; - case 3: ND_PRINT((ndo, " PIMv1+2")); + case 3: ND_PRINT(" PIMv1+2"); break; } if (EXTRACT_U_1(bp) & 0xfc) - ND_PRINT((ndo, " [rsvd=0x%02x]", EXTRACT_U_1(bp) & 0xfc)); + ND_PRINT(" [rsvd=0x%02x]", EXTRACT_U_1(bp) & 0xfc); bp += 1; len -= 1; if (len < 1) @@ -433,13 +433,13 @@ cisco_autorp_print(netdissect_options *ndo, if (len < 6) goto trunc; ND_TCHECK_6(bp); - ND_PRINT((ndo, "%c%s%s/%u", s, EXTRACT_U_1(bp) & 1 ? "!" : "", - ipaddr_string(ndo, bp + 2), EXTRACT_U_1(bp + 1))); + ND_PRINT("%c%s%s/%u", s, EXTRACT_U_1(bp) & 1 ? "!" : "", + ipaddr_string(ndo, bp + 2), EXTRACT_U_1(bp + 1)); if (EXTRACT_U_1(bp) & 0x02) { - ND_PRINT((ndo, " bidir")); + ND_PRINT(" bidir"); } if (EXTRACT_U_1(bp) & 0xfc) { - ND_PRINT((ndo, "[rsvd=0x%02x]", EXTRACT_U_1(bp) & 0xfc)); + ND_PRINT("[rsvd=0x%02x]", EXTRACT_U_1(bp) & 0xfc); } s = ','; bp += 6; len -= 6; @@ -450,7 +450,7 @@ cisco_autorp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|autorp]")); + ND_PRINT("[|autorp]"); return; } @@ -470,29 +470,29 @@ pim_print(netdissect_options *ndo, switch (PIM_VER(pim_typever)) { case 2: if (!ndo->ndo_vflag) { - ND_PRINT((ndo, "PIMv%u, %s, length %u", + ND_PRINT("PIMv%u, %s, length %u", PIM_VER(pim_typever), tok2str(pimv2_type_values,"Unknown Type",PIM_TYPE(pim_typever)), - len)); + len); return; } else { - ND_PRINT((ndo, "PIMv%u, length %u\n\t%s", + ND_PRINT("PIMv%u, length %u\n\t%s", PIM_VER(pim_typever), len, - tok2str(pimv2_type_values,"Unknown Type",PIM_TYPE(pim_typever)))); + tok2str(pimv2_type_values,"Unknown Type",PIM_TYPE(pim_typever))); pimv2_print(ndo, bp, len, bp2); } break; default: - ND_PRINT((ndo, "PIMv%u, length %u", + ND_PRINT("PIMv%u, length %u", PIM_VER(pim_typever), - len)); + len); break; } return; trunc: - ND_PRINT((ndo, "[|pim]")); + ND_PRINT("[|pim]"); return; } @@ -611,11 +611,11 @@ pimv2_addr_print(netdissect_options *ndo, ND_TCHECK_LEN(bp, addr_len); if (af == AF_INET) { if (!silent) - ND_PRINT((ndo, "%s", ipaddr_string(ndo, bp))); + ND_PRINT("%s", ipaddr_string(ndo, bp)); } else if (af == AF_INET6) { if (!silent) - ND_PRINT((ndo, "%s", ip6addr_string(ndo, bp))); + ND_PRINT("%s", ip6addr_string(ndo, bp)); } return hdrlen + addr_len; case pimv2_group: @@ -625,30 +625,30 @@ pimv2_addr_print(netdissect_options *ndo, ND_TCHECK_LEN(bp, addr_len + 2); if (af == AF_INET) { if (!silent) { - ND_PRINT((ndo, "%s", ipaddr_string(ndo, bp + 2))); + ND_PRINT("%s", ipaddr_string(ndo, bp + 2)); if (EXTRACT_U_1(bp + 1) != 32) - ND_PRINT((ndo, "/%u", EXTRACT_U_1(bp + 1))); + ND_PRINT("/%u", EXTRACT_U_1(bp + 1)); } } else if (af == AF_INET6) { if (!silent) { - ND_PRINT((ndo, "%s", ip6addr_string(ndo, bp + 2))); + ND_PRINT("%s", ip6addr_string(ndo, bp + 2)); if (EXTRACT_U_1(bp + 1) != 128) - ND_PRINT((ndo, "/%u", EXTRACT_U_1(bp + 1))); + ND_PRINT("/%u", EXTRACT_U_1(bp + 1)); } } if (EXTRACT_U_1(bp) && !silent) { if (at == pimv2_group) { - ND_PRINT((ndo, "(0x%02x)", EXTRACT_U_1(bp))); + ND_PRINT("(0x%02x)", EXTRACT_U_1(bp)); } else { - ND_PRINT((ndo, "(%s%s%s", + ND_PRINT("(%s%s%s", EXTRACT_U_1(bp) & 0x04 ? "S" : "", EXTRACT_U_1(bp) & 0x02 ? "W" : "", - EXTRACT_U_1(bp) & 0x01 ? "R" : "")); + EXTRACT_U_1(bp) & 0x01 ? "R" : ""); if (EXTRACT_U_1(bp) & 0xf8) { - ND_PRINT((ndo, "+0x%02x", EXTRACT_U_1(bp) & 0xf8)); + ND_PRINT("+0x%02x", EXTRACT_U_1(bp) & 0xf8); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } } return hdrlen + 2 + addr_len; @@ -711,14 +711,14 @@ pimv2_print(netdissect_options *ndo, pim_typever = EXTRACT_U_1(pim->pim_typever); pimv2_addr_len = EXTRACT_U_1(pim->pim_rsv); if (pimv2_addr_len != 0) - ND_PRINT((ndo, ", RFC2117-encoding")); + ND_PRINT(", RFC2117-encoding"); if (len < 4) goto trunc; ND_TCHECK(pim->pim_cksum); - ND_PRINT((ndo, ", cksum 0x%04x ", EXTRACT_BE_U_2(pim->pim_cksum))); + ND_PRINT(", cksum 0x%04x ", EXTRACT_BE_U_2(pim->pim_cksum)); if (EXTRACT_BE_U_2(pim->pim_cksum) == 0) { - ND_PRINT((ndo, "(unverified)")); + ND_PRINT("(unverified)"); } else { if (PIM_TYPE(pim_typever) == PIMV2_TYPE_REGISTER) { /* @@ -744,15 +744,15 @@ pimv2_print(netdissect_options *ndo, switch (cksum_status) { case CORRECT: - ND_PRINT((ndo, "(correct)")); + ND_PRINT("(correct)"); break; case INCORRECT: - ND_PRINT((ndo, "(incorrect)")); + ND_PRINT("(incorrect)"); break; case UNVERIFIED: - ND_PRINT((ndo, "(unverified)")); + ND_PRINT("(unverified)"); break; } } @@ -769,10 +769,10 @@ pimv2_print(netdissect_options *ndo, ND_TCHECK_4(bp); otype = EXTRACT_BE_U_2(bp); olen = EXTRACT_BE_U_2(bp + 2); - ND_PRINT((ndo, "\n\t %s Option (%u), length %u, Value: ", + ND_PRINT("\n\t %s Option (%u), length %u, Value: ", tok2str(pimv2_hello_option_values, "Unknown", otype), otype, - olen)); + olen); bp += 4; len -= 4; @@ -782,7 +782,7 @@ pimv2_print(netdissect_options *ndo, switch (otype) { case PIMV2_HELLO_OPTION_HOLDTIME: if (olen != 2) { - ND_PRINT((ndo, "ERROR: Option Length != 2 Bytes (%u)", olen)); + ND_PRINT("ERROR: Option Length != 2 Bytes (%u)", olen); } else { unsigned_relts_print(ndo, EXTRACT_BE_U_2(bp)); @@ -791,7 +791,7 @@ pimv2_print(netdissect_options *ndo, case PIMV2_HELLO_OPTION_LANPRUNEDELAY: if (olen != 4) { - ND_PRINT((ndo, "ERROR: Option Length != 4 Bytes (%u)", olen)); + ND_PRINT("ERROR: Option Length != 4 Bytes (%u)", olen); } else { char t_bit; uint16_t lan_delay, override_interval; @@ -799,8 +799,8 @@ pimv2_print(netdissect_options *ndo, override_interval = EXTRACT_BE_U_2(bp + 2); t_bit = (lan_delay & 0x8000)? 1 : 0; lan_delay &= ~0x8000; - ND_PRINT((ndo, "\n\t T-bit=%u, LAN delay %ums, Override interval %ums", - t_bit, lan_delay, override_interval)); + ND_PRINT("\n\t T-bit=%u, LAN delay %ums, Override interval %ums", + t_bit, lan_delay, override_interval); } break; @@ -808,37 +808,37 @@ pimv2_print(netdissect_options *ndo, case PIMV2_HELLO_OPTION_DR_PRIORITY: switch (olen) { case 0: - ND_PRINT((ndo, "Bi-Directional Capability (Old)")); + ND_PRINT("Bi-Directional Capability (Old)"); break; case 4: - ND_PRINT((ndo, "%u", EXTRACT_BE_U_4(bp))); + ND_PRINT("%u", EXTRACT_BE_U_4(bp)); break; default: - ND_PRINT((ndo, "ERROR: Option Length != 4 Bytes (%u)", olen)); + ND_PRINT("ERROR: Option Length != 4 Bytes (%u)", olen); break; } break; case PIMV2_HELLO_OPTION_GENID: if (olen != 4) { - ND_PRINT((ndo, "ERROR: Option Length != 4 Bytes (%u)", olen)); + ND_PRINT("ERROR: Option Length != 4 Bytes (%u)", olen); } else { - ND_PRINT((ndo, "0x%08x", EXTRACT_BE_U_4(bp))); + ND_PRINT("0x%08x", EXTRACT_BE_U_4(bp)); } break; case PIMV2_HELLO_OPTION_REFRESH_CAP: if (olen != 4) { - ND_PRINT((ndo, "ERROR: Option Length != 4 Bytes (%u)", olen)); + ND_PRINT("ERROR: Option Length != 4 Bytes (%u)", olen); } else { - ND_PRINT((ndo, "v%u", EXTRACT_U_1(bp))); + ND_PRINT("v%u", EXTRACT_U_1(bp)); if (EXTRACT_U_1(bp + 1) != 0) { - ND_PRINT((ndo, ", interval ")); + ND_PRINT(", interval "); unsigned_relts_print(ndo, EXTRACT_U_1(bp + 1)); } if (EXTRACT_BE_U_2(bp + 2) != 0) { - ND_PRINT((ndo, " ?0x%04x?", EXTRACT_BE_U_2(bp + 2))); + ND_PRINT(" ?0x%04x?", EXTRACT_BE_U_2(bp + 2)); } } break; @@ -852,7 +852,7 @@ pimv2_print(netdissect_options *ndo, const u_char *ptr = bp; u_int plen = len; while (ptr < (bp+olen)) { - ND_PRINT((ndo, "\n\t ")); + ND_PRINT("\n\t "); advance = pimv2_addr_print(ndo, ptr, plen, pimv2_unicast, pimv2_addr_len, 0); if (advance < 0) goto trunc; @@ -883,10 +883,10 @@ pimv2_print(netdissect_options *ndo, goto trunc; ND_TCHECK_LEN(bp, PIMV2_REGISTER_FLAG_LEN); - ND_PRINT((ndo, ", Flags [ %s ]\n\t", + ND_PRINT(", Flags [ %s ]\n\t", tok2str(pimv2_register_flag_values, "none", - EXTRACT_BE_U_4(bp)))); + EXTRACT_BE_U_4(bp))); bp += 4; len -= 4; /* encapsulated multicast packet */ @@ -897,9 +897,9 @@ pimv2_print(netdissect_options *ndo, switch (IP_V(ip)) { case 0: /* Null header */ ND_TCHECK(ip->ip_dst); - ND_PRINT((ndo, "IP-Null-header %s > %s", + ND_PRINT("IP-Null-header %s > %s", ipaddr_string(ndo, &ip->ip_src), - ipaddr_string(ndo, &ip->ip_dst))); + ipaddr_string(ndo, &ip->ip_dst)); break; case 4: /* IPv4 */ @@ -911,18 +911,18 @@ pimv2_print(netdissect_options *ndo, break; default: - ND_PRINT((ndo, "IP ver %u", IP_V(ip))); + ND_PRINT("IP ver %u", IP_V(ip)); break; } break; } case PIMV2_TYPE_REGISTER_STOP: - ND_PRINT((ndo, " group=")); + ND_PRINT(" group="); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_group, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; - ND_PRINT((ndo, " source=")); + ND_PRINT(" source="); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_unicast, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; @@ -976,7 +976,7 @@ pimv2_print(netdissect_options *ndo, u_int i, j; if (PIM_TYPE(pim_typever) != 7) { /*not for Graft-ACK*/ - ND_PRINT((ndo, ", upstream-neighbor: ")); + ND_PRINT(", upstream-neighbor: "); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_unicast, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; @@ -986,17 +986,17 @@ pimv2_print(netdissect_options *ndo, ND_TCHECK_4(bp); ngroup = EXTRACT_U_1(bp + 1); holdtime = EXTRACT_BE_U_2(bp + 2); - ND_PRINT((ndo, "\n\t %u group(s)", ngroup)); + ND_PRINT("\n\t %u group(s)", ngroup); if (PIM_TYPE(pim_typever) != 7) { /*not for Graft-ACK*/ - ND_PRINT((ndo, ", holdtime: ")); + ND_PRINT(", holdtime: "); if (holdtime == 0xffff) - ND_PRINT((ndo, "infinite")); + ND_PRINT("infinite"); else unsigned_relts_print(ndo, holdtime); } bp += 4; len -= 4; for (i = 0; i < ngroup; i++) { - ND_PRINT((ndo, "\n\t group #%u: ", i+1)); + ND_PRINT("\n\t group #%u: ", i+1); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_group, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; @@ -1005,16 +1005,16 @@ pimv2_print(netdissect_options *ndo, ND_TCHECK_4(bp); njoin = EXTRACT_BE_U_2(bp); nprune = EXTRACT_BE_U_2(bp + 2); - ND_PRINT((ndo, ", joined sources: %u, pruned sources: %u", njoin, nprune)); + ND_PRINT(", joined sources: %u, pruned sources: %u", njoin, nprune); bp += 4; len -= 4; for (j = 0; j < njoin; j++) { - ND_PRINT((ndo, "\n\t joined source #%u: ", j+1)); + ND_PRINT("\n\t joined source #%u: ", j+1); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_source, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; } for (j = 0; j < nprune; j++) { - ND_PRINT((ndo, "\n\t pruned source #%u: ", j+1)); + ND_PRINT("\n\t pruned source #%u: ", j+1); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_source, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; @@ -1031,22 +1031,22 @@ pimv2_print(netdissect_options *ndo, if (len < 2) goto trunc; ND_TCHECK_2(bp); - ND_PRINT((ndo, " tag=%x", EXTRACT_BE_U_2(bp))); + ND_PRINT(" tag=%x", EXTRACT_BE_U_2(bp)); bp += 2; len -= 2; if (len < 1) goto trunc; ND_TCHECK_1(bp); - ND_PRINT((ndo, " hashmlen=%u", EXTRACT_U_1(bp))); + ND_PRINT(" hashmlen=%u", EXTRACT_U_1(bp)); if (len < 2) goto trunc; ND_TCHECK_1(bp + 2); - ND_PRINT((ndo, " BSRprio=%u", EXTRACT_U_1(bp + 1))); + ND_PRINT(" BSRprio=%u", EXTRACT_U_1(bp + 1)); bp += 2; len -= 2; /* Encoded-Unicast-BSR-Address */ - ND_PRINT((ndo, " BSR=")); + ND_PRINT(" BSR="); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_unicast, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; @@ -1054,7 +1054,7 @@ pimv2_print(netdissect_options *ndo, for (i = 0; len > 0; i++) { /* Encoded-Group Address */ - ND_PRINT((ndo, " (group%u: ", i)); + ND_PRINT(" (group%u: ", i); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_group, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; @@ -1064,12 +1064,12 @@ pimv2_print(netdissect_options *ndo, if (len < 1) goto trunc; ND_TCHECK_1(bp); - ND_PRINT((ndo, " RPcnt=%u", EXTRACT_U_1(bp))); + ND_PRINT(" RPcnt=%u", EXTRACT_U_1(bp)); if (len < 2) goto trunc; ND_TCHECK_1(bp + 1); frpcnt = EXTRACT_U_1(bp + 1); - ND_PRINT((ndo, " FRPcnt=%u", frpcnt)); + ND_PRINT(" FRPcnt=%u", frpcnt); if (len < 4) goto trunc; bp += 4; @@ -1077,7 +1077,7 @@ pimv2_print(netdissect_options *ndo, for (j = 0; j < frpcnt && len > 0; j++) { /* each RP info */ - ND_PRINT((ndo, " RP%u=", j)); + ND_PRINT(" RP%u=", j); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_unicast, pimv2_addr_len, @@ -1089,28 +1089,28 @@ pimv2_print(netdissect_options *ndo, if (len < 2) goto trunc; ND_TCHECK_2(bp); - ND_PRINT((ndo, ",holdtime=")); + ND_PRINT(",holdtime="); unsigned_relts_print(ndo, EXTRACT_BE_U_2(bp)); if (len < 3) goto trunc; ND_TCHECK_1(bp + 2); - ND_PRINT((ndo, ",prio=%u", EXTRACT_U_1(bp + 2))); + ND_PRINT(",prio=%u", EXTRACT_U_1(bp + 2)); if (len < 4) goto trunc; bp += 4; len -= 4; } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } break; } case PIMV2_TYPE_ASSERT: - ND_PRINT((ndo, " group=")); + ND_PRINT(" group="); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_group, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; - ND_PRINT((ndo, " src=")); + ND_PRINT(" src="); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_unicast, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; @@ -1118,9 +1118,9 @@ pimv2_print(netdissect_options *ndo, goto trunc; ND_TCHECK_8(bp); if (EXTRACT_U_1(bp) & 0x80) - ND_PRINT((ndo, " RPT")); - ND_PRINT((ndo, " pref=%u", EXTRACT_BE_U_4(bp) & 0x7fffffff)); - ND_PRINT((ndo, " metric=%u", EXTRACT_BE_U_4(bp + 4))); + ND_PRINT(" RPT"); + ND_PRINT(" pref=%u", EXTRACT_BE_U_4(bp) & 0x7fffffff); + ND_PRINT(" metric=%u", EXTRACT_BE_U_4(bp + 4)); break; case PIMV2_TYPE_CANDIDATE_RP: @@ -1131,22 +1131,22 @@ pimv2_print(netdissect_options *ndo, if (len < 1) goto trunc; ND_TCHECK_1(bp); - ND_PRINT((ndo, " prefix-cnt=%u", EXTRACT_U_1(bp))); + ND_PRINT(" prefix-cnt=%u", EXTRACT_U_1(bp)); pfxcnt = EXTRACT_U_1(bp); if (len < 2) goto trunc; ND_TCHECK_1(bp + 1); - ND_PRINT((ndo, " prio=%u", EXTRACT_U_1(bp + 1))); + ND_PRINT(" prio=%u", EXTRACT_U_1(bp + 1)); if (len < 4) goto trunc; ND_TCHECK_2(bp + 2); - ND_PRINT((ndo, " holdtime=")); + ND_PRINT(" holdtime="); unsigned_relts_print(ndo, EXTRACT_BE_U_2(bp + 2)); bp += 4; len -= 4; /* Encoded-Unicast-RP-Address */ - ND_PRINT((ndo, " RP=")); + ND_PRINT(" RP="); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_unicast, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; @@ -1154,7 +1154,7 @@ pimv2_print(netdissect_options *ndo, /* Encoded-Group Addresses */ for (i = 0; i < pfxcnt && len > 0; i++) { - ND_PRINT((ndo, " Group%u=", i)); + ND_PRINT(" Group%u=", i); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_group, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; @@ -1164,17 +1164,17 @@ pimv2_print(netdissect_options *ndo, } case PIMV2_TYPE_PRUNE_REFRESH: - ND_PRINT((ndo, " src=")); + ND_PRINT(" src="); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_unicast, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; - ND_PRINT((ndo, " grp=")); + ND_PRINT(" grp="); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_group, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; len -= advance; - ND_PRINT((ndo, " forwarder=")); + ND_PRINT(" forwarder="); if ((advance = pimv2_addr_print(ndo, bp, len, pimv2_unicast, pimv2_addr_len, 0)) < 0) goto trunc; bp += advance; @@ -1182,20 +1182,20 @@ pimv2_print(netdissect_options *ndo, if (len < 2) goto trunc; ND_TCHECK_2(bp); - ND_PRINT((ndo, " TUNR ")); + ND_PRINT(" TUNR "); unsigned_relts_print(ndo, EXTRACT_BE_U_2(bp)); break; default: - ND_PRINT((ndo, " [type %u]", PIM_TYPE(pim_typever))); + ND_PRINT(" [type %u]", PIM_TYPE(pim_typever)); break; } return; trunc: - ND_PRINT((ndo, "[|pim]")); + ND_PRINT("[|pim]"); } /* diff --git a/print-pktap.c b/print-pktap.c index 1d5c7647..fe0a265f 100644 --- a/print-pktap.c +++ b/print-pktap.c @@ -80,13 +80,13 @@ pktap_header_print(netdissect_options *ndo, const u_char *bp, u_int length) hdrlen = EXTRACT_LE_U_4(&hdr->pkt_len); dltname = pcap_datalink_val_to_name(dlt); if (!ndo->ndo_qflag) { - ND_PRINT((ndo,"DLT %s (%d) len %d", - (dltname != NULL ? dltname : "UNKNOWN"), dlt, hdrlen)); + ND_PRINT("DLT %s (%d) len %d", + (dltname != NULL ? dltname : "UNKNOWN"), dlt, hdrlen); } else { - ND_PRINT((ndo,"%s", (dltname != NULL ? dltname : "UNKNOWN"))); + ND_PRINT("%s", (dltname != NULL ? dltname : "UNKNOWN")); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } /* @@ -107,7 +107,7 @@ pktap_if_print(netdissect_options *ndo, struct pcap_pkthdr nhdr; if (caplen < sizeof(pktap_header_t) || length < sizeof(pktap_header_t)) { - ND_PRINT((ndo, "[|pktap]")); + ND_PRINT("[|pktap]"); return (0); } hdr = (const pktap_header_t *)p; @@ -121,11 +121,11 @@ pktap_if_print(netdissect_options *ndo, * is the length supplied so that the header can * be expanded in the future)? */ - ND_PRINT((ndo, "[|pktap]")); + ND_PRINT("[|pktap]"); return (0); } if (caplen < hdrlen || length < hdrlen) { - ND_PRINT((ndo, "[|pktap]")); + ND_PRINT("[|pktap]"); return (hdrlen); } @@ -140,7 +140,7 @@ pktap_if_print(netdissect_options *ndo, switch (rectype) { case PKT_REC_NONE: - ND_PRINT((ndo, "no data")); + ND_PRINT("no data"); break; case PKT_REC_PACKET: diff --git a/print-ppi.c b/print-ppi.c index 9cd5fc1e..ad5eb27f 100644 --- a/print-ppi.c +++ b/print-ppi.c @@ -39,14 +39,14 @@ ppi_header_print(netdissect_options *ndo, const u_char *bp, u_int length) dltname = pcap_datalink_val_to_name(dlt); if (!ndo->ndo_qflag) { - ND_PRINT((ndo, "V.%d DLT %s (%d) len %d", hdr->ppi_ver, + ND_PRINT("V.%d DLT %s (%d) len %d", hdr->ppi_ver, (dltname != NULL ? dltname : "UNKNOWN"), dlt, - len)); + len); } else { - ND_PRINT((ndo, "%s", (dltname != NULL ? dltname : "UNKNOWN"))); + ND_PRINT("%s", (dltname != NULL ? dltname : "UNKNOWN")); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } static u_int @@ -63,7 +63,7 @@ ppi_print(netdissect_options *ndo, struct pcap_pkthdr nhdr; if (caplen < sizeof(ppi_header_t)) { - ND_PRINT((ndo, "[|ppi]")); + ND_PRINT("[|ppi]"); return (caplen); } @@ -74,11 +74,11 @@ ppi_print(netdissect_options *ndo, * If we don't have the entire PPI header, don't * bother. */ - ND_PRINT((ndo, "[|ppi]")); + ND_PRINT("[|ppi]"); return (caplen); } if (len < sizeof(ppi_header_t)) { - ND_PRINT((ndo, "[|ppi]")); + ND_PRINT("[|ppi]"); return (len); } dlt = EXTRACT_LE_U_4(&hdr->ppi_dlt); diff --git a/print-ppp.c b/print-ppp.c index 6d5d05bd..5e3409f2 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -422,7 +422,7 @@ handle_ctrl_proto(netdissect_options *ndo, tptr=pptr; typestr = tok2str(ppptype2str, "unknown ctrl-proto (0x%04x)", proto); - ND_PRINT((ndo, "%s, ", typestr)); + ND_PRINT("%s, ", typestr); if (length < 4) /* FIXME weak boundary checking */ goto trunc; @@ -431,11 +431,11 @@ handle_ctrl_proto(netdissect_options *ndo, code = EXTRACT_U_1(tptr); tptr++; - ND_PRINT((ndo, "%s (0x%02x), id %u, length %u", + ND_PRINT("%s (0x%02x), id %u, length %u", tok2str(cpcodes, "Unknown Opcode",code), code, EXTRACT_U_1(tptr), /* ID */ - length + 2)); + length + 2); tptr++; if (!ndo->ndo_vflag) @@ -446,17 +446,17 @@ handle_ctrl_proto(netdissect_options *ndo, tptr += 2; if (len < 4) { - ND_PRINT((ndo, "\n\tencoded length %u (< 4))", len)); + ND_PRINT("\n\tencoded length %u (< 4))", len); return; } if (len > length) { - ND_PRINT((ndo, "\n\tencoded length %u (> packet length %u))", len, length)); + ND_PRINT("\n\tencoded length %u (> packet length %u))", len, length); return; } length = len; - ND_PRINT((ndo, "\n\tencoded length %u (=Option(s) length %u)", len, len - 4)); + ND_PRINT("\n\tencoded length %u (=Option(s) length %u)", len, len - 4); if (length == 4) return; /* there may be a NULL confreq etc. */ @@ -470,12 +470,12 @@ handle_ctrl_proto(netdissect_options *ndo, if (length < 11) break; ND_TCHECK_4(tptr); - ND_PRINT((ndo, "\n\t Magic-Num 0x%08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t Magic-Num 0x%08x", EXTRACT_BE_U_4(tptr)); tptr += 4; ND_TCHECK_3(tptr); - ND_PRINT((ndo, " Vendor: %s (%u)", + ND_PRINT(" Vendor: %s (%u)", tok2str(oui_values,"Unknown",EXTRACT_BE_U_3(tptr)), - EXTRACT_BE_U_3(tptr))); + EXTRACT_BE_U_3(tptr)); /* XXX: need to decode Kind and Value(s)? */ break; case CPCODES_CONF_REQ: @@ -530,12 +530,12 @@ handle_ctrl_proto(netdissect_options *ndo, if (length < 6) break; ND_TCHECK_2(tptr); - ND_PRINT((ndo, "\n\t Rejected %s Protocol (0x%04x)", + ND_PRINT("\n\t Rejected %s Protocol (0x%04x)", tok2str(ppptype2str,"unknown", EXTRACT_BE_U_2(tptr)), - EXTRACT_BE_U_2(tptr))); + EXTRACT_BE_U_2(tptr)); /* XXX: need to decode Rejected-Information? - hexdump for now */ if (len > 6) { - ND_PRINT((ndo, "\n\t Rejected Packet")); + ND_PRINT("\n\t Rejected Packet"); print_unknown_data(ndo, tptr + 2, "\n\t ", len - 2); } break; @@ -545,10 +545,10 @@ handle_ctrl_proto(netdissect_options *ndo, if (length < 8) break; ND_TCHECK_4(tptr); - ND_PRINT((ndo, "\n\t Magic-Num 0x%08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t Magic-Num 0x%08x", EXTRACT_BE_U_4(tptr)); /* XXX: need to decode Data? - hexdump for now */ if (len > 8) { - ND_PRINT((ndo, "\n\t -----trailing data-----")); + ND_PRINT("\n\t -----trailing data-----"); ND_TCHECK_LEN(tptr + 4, len - 8); print_unknown_data(ndo, tptr + 4, "\n\t ", len - 8); } @@ -557,10 +557,10 @@ handle_ctrl_proto(netdissect_options *ndo, if (length < 8) break; ND_TCHECK_4(tptr); - ND_PRINT((ndo, "\n\t Magic-Num 0x%08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t Magic-Num 0x%08x", EXTRACT_BE_U_4(tptr)); /* RFC 1661 says this is intended to be human readable */ if (len > 8) { - ND_PRINT((ndo, "\n\t Message\n\t ")); + ND_PRINT("\n\t Message\n\t "); if (fn_printn(ndo, tptr + 4, len - 4, ndo->ndo_snapend)) goto trunc; } @@ -569,9 +569,9 @@ handle_ctrl_proto(netdissect_options *ndo, if (length < 12) break; ND_TCHECK_4(tptr); - ND_PRINT((ndo, "\n\t Magic-Num 0x%08x", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\t Magic-Num 0x%08x", EXTRACT_BE_U_4(tptr)); ND_TCHECK_4(tptr + 4); - ND_PRINT((ndo, ", Seconds-Remaining %us", EXTRACT_BE_U_4(tptr + 4))); + ND_PRINT(", Seconds-Remaining %us", EXTRACT_BE_U_4(tptr + 4)); /* XXX: need to decode Message? */ break; default: @@ -585,7 +585,7 @@ handle_ctrl_proto(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|%s]", typestr)); + ND_PRINT("[|%s]", typestr); } /* LCP config options */ @@ -604,67 +604,67 @@ print_lcp_config_options(netdissect_options *ndo, return 0; if (len < 2) { if (opt < NUM_LCPOPTS) - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", - lcpconfopts[opt], opt, len)); + ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", + lcpconfopts[opt], opt, len); else - ND_PRINT((ndo, "\n\tunknown LCP option 0x%02x", opt)); + ND_PRINT("\n\tunknown LCP option 0x%02x", opt); return 0; } if (opt < NUM_LCPOPTS) - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", lcpconfopts[opt], opt, len)); + ND_PRINT("\n\t %s Option (0x%02x), length %u", lcpconfopts[opt], opt, len); else { - ND_PRINT((ndo, "\n\tunknown LCP option 0x%02x", opt)); + ND_PRINT("\n\tunknown LCP option 0x%02x", opt); return len; } switch (opt) { case LCPOPT_VEXT: if (len < 6) { - ND_PRINT((ndo, " (length bogus, should be >= 6)")); + ND_PRINT(" (length bogus, should be >= 6)"); return len; } ND_TCHECK_3(p + 2); - ND_PRINT((ndo, ": Vendor: %s (%u)", + ND_PRINT(": Vendor: %s (%u)", tok2str(oui_values,"Unknown",EXTRACT_BE_U_3(p + 2)), - EXTRACT_BE_U_3(p + 2))); + EXTRACT_BE_U_3(p + 2)); #if 0 ND_TCHECK_1(p + 5); - ND_PRINT((ndo, ", kind: 0x%02x", EXTRACT_U_1(p + 5))); - ND_PRINT((ndo, ", Value: 0x")); + ND_PRINT(", kind: 0x%02x", EXTRACT_U_1(p + 5)); + ND_PRINT(", Value: 0x"); for (i = 0; i < len - 6; i++) { ND_TCHECK_1(p + 6 + i); - ND_PRINT((ndo, "%02x", EXTRACT_U_1(p + 6 + i))); + ND_PRINT("%02x", EXTRACT_U_1(p + 6 + i)); } #endif break; case LCPOPT_MRU: if (len != 4) { - ND_PRINT((ndo, " (length bogus, should be = 4)")); + ND_PRINT(" (length bogus, should be = 4)"); return len; } ND_TCHECK_2(p + 2); - ND_PRINT((ndo, ": %u", EXTRACT_BE_U_2(p + 2))); + ND_PRINT(": %u", EXTRACT_BE_U_2(p + 2)); break; case LCPOPT_ACCM: if (len != 6) { - ND_PRINT((ndo, " (length bogus, should be = 6)")); + ND_PRINT(" (length bogus, should be = 6)"); return len; } ND_TCHECK_4(p + 2); - ND_PRINT((ndo, ": 0x%08x", EXTRACT_BE_U_4(p + 2))); + ND_PRINT(": 0x%08x", EXTRACT_BE_U_4(p + 2)); break; case LCPOPT_AP: if (len < 4) { - ND_PRINT((ndo, " (length bogus, should be >= 4)")); + ND_PRINT(" (length bogus, should be >= 4)"); return len; } ND_TCHECK_2(p + 2); - ND_PRINT((ndo, ": %s", tok2str(ppptype2str, "Unknown Auth Proto (0x04x)", EXTRACT_BE_U_2(p + 2)))); + ND_PRINT(": %s", tok2str(ppptype2str, "Unknown Auth Proto (0x04x)", EXTRACT_BE_U_2(p + 2))); switch (EXTRACT_BE_U_2(p + 2)) { case PPP_CHAP: ND_TCHECK_1(p + 4); - ND_PRINT((ndo, ", %s", tok2str(authalg_values, "Unknown Auth Alg %u", EXTRACT_U_1(p + 4)))); + ND_PRINT(", %s", tok2str(authalg_values, "Unknown Auth Alg %u", EXTRACT_U_1(p + 4))); break; case PPP_PAP: /* fall through */ case PPP_EAP: @@ -677,22 +677,22 @@ print_lcp_config_options(netdissect_options *ndo, break; case LCPOPT_QP: if (len < 4) { - ND_PRINT((ndo, " (length bogus, should be >= 4)")); + ND_PRINT(" (length bogus, should be >= 4)"); return 0; } ND_TCHECK_2(p + 2); if (EXTRACT_BE_U_2(p + 2) == PPP_LQM) - ND_PRINT((ndo, ": LQR")); + ND_PRINT(": LQR"); else - ND_PRINT((ndo, ": unknown")); + ND_PRINT(": unknown"); break; case LCPOPT_MN: if (len != 6) { - ND_PRINT((ndo, " (length bogus, should be = 6)")); + ND_PRINT(" (length bogus, should be = 6)"); return 0; } ND_TCHECK_4(p + 2); - ND_PRINT((ndo, ": 0x%08x", EXTRACT_BE_U_4(p + 2))); + ND_PRINT(": 0x%08x", EXTRACT_BE_U_4(p + 2)); break; case LCPOPT_PFC: break; @@ -700,68 +700,68 @@ print_lcp_config_options(netdissect_options *ndo, break; case LCPOPT_LD: if (len != 4) { - ND_PRINT((ndo, " (length bogus, should be = 4)")); + ND_PRINT(" (length bogus, should be = 4)"); return 0; } ND_TCHECK_2(p + 2); - ND_PRINT((ndo, ": 0x%04x", EXTRACT_BE_U_2(p + 2))); + ND_PRINT(": 0x%04x", EXTRACT_BE_U_2(p + 2)); break; case LCPOPT_CBACK: if (len < 3) { - ND_PRINT((ndo, " (length bogus, should be >= 3)")); + ND_PRINT(" (length bogus, should be >= 3)"); return 0; } - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); ND_TCHECK_1(p + 2); - ND_PRINT((ndo, ": Callback Operation %s (%u)", + ND_PRINT(": Callback Operation %s (%u)", tok2str(ppp_callback_values, "Unknown", EXTRACT_U_1(p + 2)), - EXTRACT_U_1(p + 2))); + EXTRACT_U_1(p + 2)); break; case LCPOPT_MLMRRU: if (len != 4) { - ND_PRINT((ndo, " (length bogus, should be = 4)")); + ND_PRINT(" (length bogus, should be = 4)"); return 0; } ND_TCHECK_2(p + 2); - ND_PRINT((ndo, ": %u", EXTRACT_BE_U_2(p + 2))); + ND_PRINT(": %u", EXTRACT_BE_U_2(p + 2)); break; case LCPOPT_MLED: if (len < 3) { - ND_PRINT((ndo, " (length bogus, should be >= 3)")); + ND_PRINT(" (length bogus, should be >= 3)"); return 0; } ND_TCHECK_1(p + 2); switch (EXTRACT_U_1(p + 2)) { /* class */ case MEDCLASS_NULL: - ND_PRINT((ndo, ": Null")); + ND_PRINT(": Null"); break; case MEDCLASS_LOCAL: - ND_PRINT((ndo, ": Local")); /* XXX */ + ND_PRINT(": Local"); /* XXX */ break; case MEDCLASS_IPV4: if (len != 7) { - ND_PRINT((ndo, " (length bogus, should be = 7)")); + ND_PRINT(" (length bogus, should be = 7)"); return 0; } ND_TCHECK_4(p + 3); - ND_PRINT((ndo, ": IPv4 %s", ipaddr_string(ndo, p + 3))); + ND_PRINT(": IPv4 %s", ipaddr_string(ndo, p + 3)); break; case MEDCLASS_MAC: if (len != 9) { - ND_PRINT((ndo, " (length bogus, should be = 9)")); + ND_PRINT(" (length bogus, should be = 9)"); return 0; } ND_TCHECK_6(p + 3); - ND_PRINT((ndo, ": MAC %s", etheraddr_string(ndo, p + 3))); + ND_PRINT(": MAC %s", etheraddr_string(ndo, p + 3)); break; case MEDCLASS_MNB: - ND_PRINT((ndo, ": Magic-Num-Block")); /* XXX */ + ND_PRINT(": Magic-Num-Block"); /* XXX */ break; case MEDCLASS_PSNDN: - ND_PRINT((ndo, ": PSNDN")); /* XXX */ + ND_PRINT(": PSNDN"); /* XXX */ break; default: - ND_PRINT((ndo, ": Unknown class %u", EXTRACT_U_1(p + 2))); + ND_PRINT(": Unknown class %u", EXTRACT_U_1(p + 2)); break; } break; @@ -805,7 +805,7 @@ print_lcp_config_options(netdissect_options *ndo, return len; trunc: - ND_PRINT((ndo, "[|lcp]")); + ND_PRINT("[|lcp]"); return 0; } @@ -821,21 +821,21 @@ handle_mlppp(netdissect_options *ndo, const u_char *p, u_int length) { if (!ndo->ndo_eflag) - ND_PRINT((ndo, "MLPPP, ")); + ND_PRINT("MLPPP, "); if (length < 2) { - ND_PRINT((ndo, "[|mlppp]")); + ND_PRINT("[|mlppp]"); return; } if (!ND_TTEST_2(p)) { - ND_PRINT((ndo, "[|mlppp]")); + ND_PRINT("[|mlppp]"); return; } - ND_PRINT((ndo, "seq 0x%03x, Flags [%s], length %u", + ND_PRINT("seq 0x%03x, Flags [%s], length %u", (EXTRACT_BE_U_2(p))&0x0fff, /* only support 12-Bit sequence space for now */ bittok2str(ppp_ml_flag_values, "none", EXTRACT_U_1(p) & 0xc0), - length)); + length); } /* CHAP */ @@ -850,23 +850,23 @@ handle_chap(netdissect_options *ndo, p0 = p; if (length < 1) { - ND_PRINT((ndo, "[|chap]")); + ND_PRINT("[|chap]"); return; } else if (length < 4) { ND_TCHECK_1(p); - ND_PRINT((ndo, "[|chap 0x%02x]", EXTRACT_U_1(p))); + ND_PRINT("[|chap 0x%02x]", EXTRACT_U_1(p)); return; } ND_TCHECK_1(p); code = EXTRACT_U_1(p); - ND_PRINT((ndo, "CHAP, %s (0x%02x)", + ND_PRINT("CHAP, %s (0x%02x)", tok2str(chapcode_values,"unknown",code), - code)); + code); p++; ND_TCHECK_1(p); - ND_PRINT((ndo, ", id %u", EXTRACT_U_1(p))); /* ID */ + ND_PRINT(", id %u", EXTRACT_U_1(p)); /* ID */ p++; ND_TCHECK_2(p); @@ -890,14 +890,14 @@ handle_chap(netdissect_options *ndo, p++; if (length - (p - p0) < val_size) return; - ND_PRINT((ndo, ", Value ")); + ND_PRINT(", Value "); for (i = 0; i < val_size; i++) { ND_TCHECK_1(p); - ND_PRINT((ndo, "%02x", EXTRACT_U_1(p))); + ND_PRINT("%02x", EXTRACT_U_1(p)); p++; } name_size = len - (p - p0); - ND_PRINT((ndo, ", Name ")); + ND_PRINT(", Name "); for (i = 0; i < name_size; i++) { ND_TCHECK_1(p); safeputchar(ndo, EXTRACT_U_1(p)); @@ -907,7 +907,7 @@ handle_chap(netdissect_options *ndo, case CHAP_SUCC: case CHAP_FAIL: msg_size = len - (p - p0); - ND_PRINT((ndo, ", Msg ")); + ND_PRINT(", Msg "); for (i = 0; i< msg_size; i++) { ND_TCHECK_1(p); safeputchar(ndo, EXTRACT_U_1(p)); @@ -918,7 +918,7 @@ handle_chap(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|chap]")); + ND_PRINT("[|chap]"); } /* PAP (see RFC 1334) */ @@ -933,23 +933,23 @@ handle_pap(netdissect_options *ndo, p0 = p; if (length < 1) { - ND_PRINT((ndo, "[|pap]")); + ND_PRINT("[|pap]"); return; } else if (length < 4) { ND_TCHECK_1(p); - ND_PRINT((ndo, "[|pap 0x%02x]", EXTRACT_U_1(p))); + ND_PRINT("[|pap 0x%02x]", EXTRACT_U_1(p)); return; } ND_TCHECK_1(p); code = EXTRACT_U_1(p); - ND_PRINT((ndo, "PAP, %s (0x%02x)", + ND_PRINT("PAP, %s (0x%02x)", tok2str(papcode_values, "unknown", code), - code)); + code); p++; ND_TCHECK_1(p); - ND_PRINT((ndo, ", id %u", EXTRACT_U_1(p))); /* ID */ + ND_PRINT(", id %u", EXTRACT_U_1(p)); /* ID */ p++; ND_TCHECK_2(p); @@ -957,12 +957,12 @@ handle_pap(netdissect_options *ndo, p += 2; if (len > length) { - ND_PRINT((ndo, ", length %u > packet size", len)); + ND_PRINT(", length %u > packet size", len); return; } length = len; if (length < (size_t)(p - p0)) { - ND_PRINT((ndo, ", length %u < PAP header length", length)); + ND_PRINT(", length %u < PAP header length", length); return; } @@ -978,7 +978,7 @@ handle_pap(netdissect_options *ndo, p++; if (length - (p - p0) < peerid_len) return; - ND_PRINT((ndo, ", Peer ")); + ND_PRINT(", Peer "); for (i = 0; i < peerid_len; i++) { ND_TCHECK_1(p); safeputchar(ndo, EXTRACT_U_1(p)); @@ -992,7 +992,7 @@ handle_pap(netdissect_options *ndo, p++; if (length - (p - p0) < passwd_len) return; - ND_PRINT((ndo, ", Name ")); + ND_PRINT(", Name "); for (i = 0; i < passwd_len; i++) { ND_TCHECK_1(p); safeputchar(ndo, EXTRACT_U_1(p)); @@ -1015,7 +1015,7 @@ handle_pap(netdissect_options *ndo, p++; if (length - (p - p0) < msg_len) return; - ND_PRINT((ndo, ", Msg ")); + ND_PRINT(", Msg "); for (i = 0; i< msg_len; i++) { ND_TCHECK_1(p); safeputchar(ndo, EXTRACT_U_1(p)); @@ -1026,7 +1026,7 @@ handle_pap(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|pap]")); + ND_PRINT("[|pap]"); } /* BAP */ @@ -1054,40 +1054,40 @@ print_ipcp_config_options(netdissect_options *ndo, if (length < len) return 0; if (len < 2) { - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", + ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", tok2str(ipcpopt_values,"unknown",opt), opt, - len)); + len); return 0; } - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", + ND_PRINT("\n\t %s Option (0x%02x), length %u", tok2str(ipcpopt_values,"unknown",opt), opt, - len)); + len); switch (opt) { case IPCPOPT_2ADDR: /* deprecated */ if (len != 10) { - ND_PRINT((ndo, " (length bogus, should be = 10)")); + ND_PRINT(" (length bogus, should be = 10)"); return len; } ND_TCHECK_4(p + 6); - ND_PRINT((ndo, ": src %s, dst %s", + ND_PRINT(": src %s, dst %s", ipaddr_string(ndo, p + 2), - ipaddr_string(ndo, p + 6))); + ipaddr_string(ndo, p + 6)); break; case IPCPOPT_IPCOMP: if (len < 4) { - ND_PRINT((ndo, " (length bogus, should be >= 4)")); + ND_PRINT(" (length bogus, should be >= 4)"); return 0; } ND_TCHECK_2(p + 2); compproto = EXTRACT_BE_U_2(p + 2); - ND_PRINT((ndo, ": %s (0x%02x):", + ND_PRINT(": %s (0x%02x):", tok2str(ipcpopt_compproto_values, "Unknown", compproto), - compproto)); + compproto); switch (compproto) { case PPP_VJC: @@ -1095,26 +1095,26 @@ print_ipcp_config_options(netdissect_options *ndo, break; case IPCPOPT_IPCOMP_HDRCOMP: if (len < IPCPOPT_IPCOMP_MINLEN) { - ND_PRINT((ndo, " (length bogus, should be >= %u)", - IPCPOPT_IPCOMP_MINLEN)); + ND_PRINT(" (length bogus, should be >= %u)", + IPCPOPT_IPCOMP_MINLEN); return 0; } ND_TCHECK_LEN(p + 2, IPCPOPT_IPCOMP_MINLEN); - ND_PRINT((ndo, "\n\t TCP Space %u, non-TCP Space %u" + ND_PRINT("\n\t TCP Space %u, non-TCP Space %u" ", maxPeriod %u, maxTime %u, maxHdr %u", EXTRACT_BE_U_2(p + 4), EXTRACT_BE_U_2(p + 6), EXTRACT_BE_U_2(p + 8), EXTRACT_BE_U_2(p + 10), - EXTRACT_BE_U_2(p + 12))); + EXTRACT_BE_U_2(p + 12)); /* suboptions present ? */ if (len > IPCPOPT_IPCOMP_MINLEN) { ipcomp_subopttotallen = len - IPCPOPT_IPCOMP_MINLEN; p += IPCPOPT_IPCOMP_MINLEN; - ND_PRINT((ndo, "\n\t Suboptions, length %u", ipcomp_subopttotallen)); + ND_PRINT("\n\t Suboptions, length %u", ipcomp_subopttotallen); while (ipcomp_subopttotallen >= 2) { ND_TCHECK_2(p); @@ -1127,12 +1127,12 @@ print_ipcp_config_options(netdissect_options *ndo, break; /* XXX: just display the suboptions for now */ - ND_PRINT((ndo, "\n\t\t%s Suboption #%u, length %u", + ND_PRINT("\n\t\t%s Suboption #%u, length %u", tok2str(ipcpopt_compproto_subopt_values, "Unknown", ipcomp_subopt), ipcomp_subopt, - ipcomp_suboptlen)); + ipcomp_suboptlen); ipcomp_subopttotallen -= ipcomp_suboptlen; p += ipcomp_suboptlen; @@ -1151,11 +1151,11 @@ print_ipcp_config_options(netdissect_options *ndo, case IPCPOPT_SECDNS: case IPCPOPT_SECNBNS: if (len != 6) { - ND_PRINT((ndo, " (length bogus, should be = 6)")); + ND_PRINT(" (length bogus, should be = 6)"); return 0; } ND_TCHECK_4(p + 2); - ND_PRINT((ndo, ": %s", ipaddr_string(ndo, p + 2))); + ND_PRINT(": %s", ipaddr_string(ndo, p + 2)); break; default: /* @@ -1171,7 +1171,7 @@ print_ipcp_config_options(netdissect_options *ndo, return len; trunc: - ND_PRINT((ndo, "[|ipcp]")); + ND_PRINT("[|ipcp]"); return 0; } @@ -1190,30 +1190,30 @@ print_ip6cp_config_options(netdissect_options *ndo, if (length < len) return 0; if (len < 2) { - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", + ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", tok2str(ip6cpopt_values,"unknown",opt), opt, - len)); + len); return 0; } - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", + ND_PRINT("\n\t %s Option (0x%02x), length %u", tok2str(ip6cpopt_values,"unknown",opt), opt, - len)); + len); switch (opt) { case IP6CP_IFID: if (len != 10) { - ND_PRINT((ndo, " (length bogus, should be = 10)")); + ND_PRINT(" (length bogus, should be = 10)"); return len; } ND_TCHECK_8(p + 2); - ND_PRINT((ndo, ": %04x:%04x:%04x:%04x", + ND_PRINT(": %04x:%04x:%04x:%04x", EXTRACT_BE_U_2(p + 2), EXTRACT_BE_U_2(p + 4), EXTRACT_BE_U_2(p + 6), - EXTRACT_BE_U_2(p + 8))); + EXTRACT_BE_U_2(p + 8)); break; default: /* @@ -1230,7 +1230,7 @@ print_ip6cp_config_options(netdissect_options *ndo, return len; trunc: - ND_PRINT((ndo, "[|ip6cp]")); + ND_PRINT("[|ip6cp]"); return 0; } @@ -1250,53 +1250,53 @@ print_ccp_config_options(netdissect_options *ndo, if (length < len) return 0; if (len < 2) { - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", + ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", tok2str(ccpconfopts_values, "Unknown", opt), opt, - len)); + len); return 0; } - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", + ND_PRINT("\n\t %s Option (0x%02x), length %u", tok2str(ccpconfopts_values, "Unknown", opt), opt, - len)); + len); switch (opt) { case CCPOPT_BSDCOMP: if (len < 3) { - ND_PRINT((ndo, " (length bogus, should be >= 3)")); + ND_PRINT(" (length bogus, should be >= 3)"); return len; } ND_TCHECK_1(p + 2); - ND_PRINT((ndo, ": Version: %u, Dictionary Bits: %u", + ND_PRINT(": Version: %u, Dictionary Bits: %u", EXTRACT_U_1(p + 2) >> 5, - EXTRACT_U_1(p + 2) & 0x1f)); + EXTRACT_U_1(p + 2) & 0x1f); break; case CCPOPT_MVRCA: if (len < 4) { - ND_PRINT((ndo, " (length bogus, should be >= 4)")); + ND_PRINT(" (length bogus, should be >= 4)"); return len; } ND_TCHECK_1(p + 3); - ND_PRINT((ndo, ": Features: %u, PxP: %s, History: %u, #CTX-ID: %u", + ND_PRINT(": Features: %u, PxP: %s, History: %u, #CTX-ID: %u", (EXTRACT_U_1(p + 2) & 0xc0) >> 6, (EXTRACT_U_1(p + 2) & 0x20) ? "Enabled" : "Disabled", EXTRACT_U_1(p + 2) & 0x1f, - EXTRACT_U_1(p + 3))); + EXTRACT_U_1(p + 3)); break; case CCPOPT_DEFLATE: if (len < 4) { - ND_PRINT((ndo, " (length bogus, should be >= 4)")); + ND_PRINT(" (length bogus, should be >= 4)"); return len; } ND_TCHECK_1(p + 3); - ND_PRINT((ndo, ": Window: %uK, Method: %s (0x%x), MBZ: %u, CHK: %u", + ND_PRINT(": Window: %uK, Method: %s (0x%x), MBZ: %u, CHK: %u", (EXTRACT_U_1(p + 2) & 0xf0) >> 4, ((EXTRACT_U_1(p + 2) & 0x0f) == 8) ? "zlib" : "unknown", EXTRACT_U_1(p + 2) & 0x0f, (EXTRACT_U_1(p + 3) & 0xfc) >> 2, - EXTRACT_U_1(p + 3) & 0x03)); + EXTRACT_U_1(p + 3) & 0x03); break; /* XXX: to be supported */ @@ -1330,7 +1330,7 @@ print_ccp_config_options(netdissect_options *ndo, return len; trunc: - ND_PRINT((ndo, "[|ccp]")); + ND_PRINT("[|ccp]"); return 0; } @@ -1349,26 +1349,26 @@ print_bacp_config_options(netdissect_options *ndo, if (length < len) return 0; if (len < 2) { - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", + ND_PRINT("\n\t %s Option (0x%02x), length %u (length bogus, should be >= 2)", tok2str(bacconfopts_values, "Unknown", opt), opt, - len)); + len); return 0; } - ND_PRINT((ndo, "\n\t %s Option (0x%02x), length %u", + ND_PRINT("\n\t %s Option (0x%02x), length %u", tok2str(bacconfopts_values, "Unknown", opt), opt, - len)); + len); switch (opt) { case BACPOPT_FPEER: if (len != 6) { - ND_PRINT((ndo, " (length bogus, should be = 6)")); + ND_PRINT(" (length bogus, should be = 6)"); return len; } ND_TCHECK_4(p + 2); - ND_PRINT((ndo, ": Magic-Num 0x%08x", EXTRACT_BE_U_4(p + 2))); + ND_PRINT(": Magic-Num 0x%08x", EXTRACT_BE_U_4(p + 2)); break; default: /* @@ -1385,7 +1385,7 @@ print_bacp_config_options(netdissect_options *ndo, return len; trunc: - ND_PRINT((ndo, "[|bacp]")); + ND_PRINT("[|bacp]"); return 0; } @@ -1470,7 +1470,7 @@ cleanup: trunc: ndo->ndo_snapend = se; free(b); - ND_PRINT((ndo, "[|ppp]")); + ND_PRINT("[|ppp]"); } @@ -1527,10 +1527,10 @@ handle_ppp(netdissect_options *ndo, mpls_print(ndo, p, length); break; case PPP_COMP: - ND_PRINT((ndo, "compressed PPP data")); + ND_PRINT("compressed PPP data"); break; default: - ND_PRINT((ndo, "%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto))); + ND_PRINT("%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto)); print_unknown_data(ndo, p, "\n\t", length); break; } @@ -1556,13 +1556,13 @@ ppp_print(netdissect_options *ndo, switch(ppp_header) { case (PPP_WITHDIRECTION_IN << 8 | PPP_CONTROL): - if (ndo->ndo_eflag) ND_PRINT((ndo, "In ")); + if (ndo->ndo_eflag) ND_PRINT("In "); p += 2; length -= 2; hdr_len += 2; break; case (PPP_WITHDIRECTION_OUT << 8 | PPP_CONTROL): - if (ndo->ndo_eflag) ND_PRINT((ndo, "Out ")); + if (ndo->ndo_eflag) ND_PRINT("Out "); p += 2; length -= 2; hdr_len += 2; @@ -1594,15 +1594,15 @@ ppp_print(netdissect_options *ndo, } if (ndo->ndo_eflag) - ND_PRINT((ndo, "%s (0x%04x), length %u: ", + ND_PRINT("%s (0x%04x), length %u: ", tok2str(ppptype2str, "unknown", proto), proto, - olen)); + olen); handle_ppp(ndo, proto, p, length); return (hdr_len); trunc: - ND_PRINT((ndo, "[|ppp]")); + ND_PRINT("[|ppp]"); return (0); } @@ -1616,7 +1616,7 @@ ppp_if_print(netdissect_options *ndo, u_int caplen = h->caplen; if (caplen < PPP_HDRLEN) { - ND_PRINT((ndo, "[|ppp]")); + ND_PRINT("[|ppp]"); return (caplen); } @@ -1658,8 +1658,8 @@ ppp_if_print(netdissect_options *ndo, * BSD/OS, is?) */ if (ndo->ndo_eflag) - ND_PRINT((ndo, "%c %4d %02x ", EXTRACT_U_1(p) ? 'O' : 'I', - length, EXTRACT_U_1(p + 1))); + ND_PRINT("%c %4d %02x ", EXTRACT_U_1(p) ? 'O' : 'I', + length, EXTRACT_U_1(p + 1)); #endif ppp_print(ndo, p, length); @@ -1686,7 +1686,7 @@ ppp_hdlc_if_print(netdissect_options *ndo, u_int hdrlen = 0; if (caplen < 2) { - ND_PRINT((ndo, "[|ppp]")); + ND_PRINT("[|ppp]"); return (caplen); } @@ -1694,13 +1694,13 @@ ppp_hdlc_if_print(netdissect_options *ndo, case PPP_ADDRESS: if (caplen < 4 || length < 4) { - ND_PRINT((ndo, "[|ppp]")); + ND_PRINT("[|ppp]"); return (caplen); } if (ndo->ndo_eflag) - ND_PRINT((ndo, "%02x %02x %u ", EXTRACT_U_1(p), - EXTRACT_U_1(p + 1), length)); + ND_PRINT("%02x %02x %u ", EXTRACT_U_1(p), + EXTRACT_U_1(p + 1), length); p += 2; length -= 2; hdrlen += 2; @@ -1709,7 +1709,7 @@ ppp_hdlc_if_print(netdissect_options *ndo, p += 2; length -= 2; hdrlen += 2; - ND_PRINT((ndo, "%s: ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto))); + ND_PRINT("%s: ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto)); handle_ppp(ndo, proto, p, length); break; @@ -1720,13 +1720,13 @@ ppp_hdlc_if_print(netdissect_options *ndo, default: if (caplen < 4) { - ND_PRINT((ndo, "[|ppp]")); + ND_PRINT("[|ppp]"); return (caplen); } if (ndo->ndo_eflag) - ND_PRINT((ndo, "%02x %02x %d ", EXTRACT_U_1(p), - EXTRACT_U_1(p + 1), length)); + ND_PRINT("%02x %02x %d ", EXTRACT_U_1(p), + EXTRACT_U_1(p + 1), length); p += 2; hdrlen += 2; @@ -1735,8 +1735,8 @@ ppp_hdlc_if_print(netdissect_options *ndo, * the next two octets as an Ethernet type; does that * ever happen? */ - ND_PRINT((ndo, "unknown addr %02x; ctrl %02x", EXTRACT_U_1(p), - EXTRACT_U_1(p + 1))); + ND_PRINT("unknown addr %02x; ctrl %02x", EXTRACT_U_1(p), + EXTRACT_U_1(p + 1)); break; } @@ -1760,7 +1760,7 @@ ppp_bsdos_if_print(netdissect_options *ndo _U_, u_int i; if (caplen < PPP_BSDI_HDRLEN) { - ND_PRINT((ndo, "[|ppp]")); + ND_PRINT("[|ppp]"); return (caplen); } @@ -1770,34 +1770,34 @@ ppp_bsdos_if_print(netdissect_options *ndo _U_, if (EXTRACT_U_1(p) == PPP_ADDRESS && EXTRACT_U_1(p + 1) == PPP_CONTROL) { if (ndo->ndo_eflag) - ND_PRINT((ndo, "%02x %02x ", EXTRACT_U_1(p), - EXTRACT_U_1(p + 1))); + ND_PRINT("%02x %02x ", EXTRACT_U_1(p), + EXTRACT_U_1(p + 1)); p += 2; hdrlength = 2; } if (ndo->ndo_eflag) - ND_PRINT((ndo, "%d ", length)); + ND_PRINT("%d ", length); /* Retrieve the protocol type */ if (EXTRACT_U_1(p) & 01) { /* Compressed protocol field */ ptype = EXTRACT_U_1(p); if (ndo->ndo_eflag) - ND_PRINT((ndo, "%02x ", ptype)); + ND_PRINT("%02x ", ptype); p++; hdrlength += 1; } else { /* Un-compressed protocol field */ ptype = EXTRACT_BE_U_2(p); if (ndo->ndo_eflag) - ND_PRINT((ndo, "%04x ", ptype)); + ND_PRINT("%04x ", ptype); p += 2; hdrlength += 2; } #else ptype = 0; /*XXX*/ if (ndo->ndo_eflag) - ND_PRINT((ndo, "%c ", EXTRACT_U_1(p + SLC_DIR) ? 'O' : 'I')); + ND_PRINT("%c ", EXTRACT_U_1(p + SLC_DIR) ? 'O' : 'I'); llhl = EXTRACT_U_1(p + SLC_LLHL); if (llhl) { /* link level header */ @@ -1808,24 +1808,24 @@ ppp_bsdos_if_print(netdissect_options *ndo _U_, if (ph->phdr_addr == PPP_ADDRESS && ph->phdr_ctl == PPP_CONTROL) { if (ndo->ndo_eflag) - ND_PRINT((ndo, "%02x %02x ", EXTRACT_U_1(q), - EXTRACT_U_1(q + 1))); + ND_PRINT("%02x %02x ", EXTRACT_U_1(q), + EXTRACT_U_1(q + 1)); ptype = EXTRACT_BE_U_2(&ph->phdr_type); if (ndo->ndo_eflag && (ptype == PPP_VJC || ptype == PPP_VJNC)) { - ND_PRINT((ndo, "%s ", tok2str(ppptype2str, - "proto-#%d", ptype))); + ND_PRINT("%s ", tok2str(ppptype2str, + "proto-#%d", ptype)); } } else { if (ndo->ndo_eflag) { - ND_PRINT((ndo, "LLH=[")); + ND_PRINT("LLH=["); for (i = 0; i < llhl; i++) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(q + i))); - ND_PRINT((ndo, "] ")); + ND_PRINT("%02x", EXTRACT_U_1(q + i)); + ND_PRINT("] "); } } } if (ndo->ndo_eflag) - ND_PRINT((ndo, "%d ", length)); + ND_PRINT("%d ", length); if (EXTRACT_U_1(p + SLC_CHL)) { q = p + SLC_BPFHDRLEN + llhl; @@ -1866,11 +1866,11 @@ ppp_bsdos_if_print(netdissect_options *ndo _U_, goto printx; default: if (ndo->ndo_eflag) { - ND_PRINT((ndo, "CH=[")); + ND_PRINT("CH=["); for (i = 0; i < llhl; i++) - ND_PRINT((ndo, "%02x", - EXTRACT_U_1(q + i))); - ND_PRINT((ndo, "] ")); + ND_PRINT("%02x", + EXTRACT_U_1(q + i)); + ND_PRINT("] "); } break; } @@ -1894,7 +1894,7 @@ ppp_bsdos_if_print(netdissect_options *ndo _U_, mpls_print(ndo, p, length); break; default: - ND_PRINT((ndo, "%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", ptype))); + ND_PRINT("%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", ptype)); } printx: diff --git a/print-pppoe.c b/print-pppoe.c index fe108396..189e1b8a 100644 --- a/print-pppoe.c +++ b/print-pppoe.c @@ -98,7 +98,7 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length) const u_char *pppoe_packet, *pppoe_payload; if (length < PPPOE_HDRLEN) { - ND_PRINT((ndo, "truncated-pppoe %u", length)); + ND_PRINT("truncated-pppoe %u", length); return (length); } length -= PPPOE_HDRLEN; @@ -112,22 +112,22 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length) pppoe_payload = pppoe_packet + PPPOE_HDRLEN; if (pppoe_ver != 1) { - ND_PRINT((ndo, " [ver %d]",pppoe_ver)); + ND_PRINT(" [ver %d]",pppoe_ver); } if (pppoe_type != 1) { - ND_PRINT((ndo, " [type %d]",pppoe_type)); + ND_PRINT(" [type %d]",pppoe_type); } - ND_PRINT((ndo, "PPPoE %s", tok2str(pppoecode2str, "PAD-%x", pppoe_code))); + ND_PRINT("PPPoE %s", tok2str(pppoecode2str, "PAD-%x", pppoe_code)); if (pppoe_code == PPPOE_PADI && pppoe_length > 1484 - PPPOE_HDRLEN) { - ND_PRINT((ndo, " [len %u!]",pppoe_length)); + ND_PRINT(" [len %u!]",pppoe_length); } if (pppoe_length > length) { - ND_PRINT((ndo, " [len %u > %u!]", pppoe_length, length)); + ND_PRINT(" [len %u > %u!]", pppoe_length, length); pppoe_length = length; } if (pppoe_sessionid) { - ND_PRINT((ndo, " [ses 0x%x]", pppoe_sessionid)); + ND_PRINT(" [ses 0x%x]", pppoe_sessionid); } if (pppoe_code) { @@ -166,24 +166,24 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length) tag_str[tag_str_len] = 0; if (ascii_count > garbage_count) { - ND_PRINT((ndo, " [%s \"%*.*s\"]", + ND_PRINT(" [%s \"%*.*s\"]", tok2str(pppoetag2str, "TAG-0x%x", tag_type), (int)tag_str_len, (int)tag_str_len, - tag_str)); + tag_str); } else { /* Print hex, not fast to abuse printf but this doesn't get used much */ - ND_PRINT((ndo, " [%s 0x", tok2str(pppoetag2str, "TAG-0x%x", tag_type))); + ND_PRINT(" [%s 0x", tok2str(pppoetag2str, "TAG-0x%x", tag_type)); for (v=p; v<p+tag_len; v++) { - ND_PRINT((ndo, "%02X", EXTRACT_U_1(v))); + ND_PRINT("%02X", EXTRACT_U_1(v)); } - ND_PRINT((ndo, "]")); + ND_PRINT("]"); } } else - ND_PRINT((ndo, " [%s]", tok2str(pppoetag2str, - "TAG-0x%x", tag_type))); + ND_PRINT(" [%s]", tok2str(pppoetag2str, + "TAG-0x%x", tag_type)); p += tag_len; /* p points to next tag */ @@ -191,11 +191,11 @@ pppoe_print(netdissect_options *ndo, const u_char *bp, u_int length) return (0); } else { /* PPPoE data */ - ND_PRINT((ndo, " ")); + ND_PRINT(" "); return (PPPOE_HDRLEN + ppp_print(ndo, pppoe_payload, pppoe_length)); } trunc: - ND_PRINT((ndo, "[|pppoe]")); + ND_PRINT("[|pppoe]"); return (PPPOE_HDRLEN); } diff --git a/print-pptp.c b/print-pptp.c index c89eb33a..ee1acc92 100644 --- a/print-pptp.c +++ b/print-pptp.c @@ -275,9 +275,9 @@ static void pptp_bearer_cap_print(netdissect_options *ndo, const nd_uint32_t *bearer_cap) { - ND_PRINT((ndo, " BEARER_CAP(%s%s)", + ND_PRINT(" BEARER_CAP(%s%s)", EXTRACT_BE_U_4(*bearer_cap) & PPTP_BEARER_CAP_DIGITAL_MASK ? "D" : "", - EXTRACT_BE_U_4(*bearer_cap) & PPTP_BEARER_CAP_ANALOG_MASK ? "A" : "")); + EXTRACT_BE_U_4(*bearer_cap) & PPTP_BEARER_CAP_ANALOG_MASK ? "A" : ""); } static const struct tok pptp_btype_str[] = { @@ -291,36 +291,36 @@ static void pptp_bearer_type_print(netdissect_options *ndo, const nd_uint32_t *bearer_type) { - ND_PRINT((ndo, " BEARER_TYPE(%s)", - tok2str(pptp_btype_str, "?", EXTRACT_BE_U_4(*bearer_type)))); + ND_PRINT(" BEARER_TYPE(%s)", + tok2str(pptp_btype_str, "?", EXTRACT_BE_U_4(*bearer_type))); } static void pptp_call_id_print(netdissect_options *ndo, const nd_uint16_t *call_id) { - ND_PRINT((ndo, " CALL_ID(%u)", EXTRACT_BE_U_2(*call_id))); + ND_PRINT(" CALL_ID(%u)", EXTRACT_BE_U_2(*call_id)); } static void pptp_call_ser_print(netdissect_options *ndo, const nd_uint16_t *call_ser) { - ND_PRINT((ndo, " CALL_SER_NUM(%u)", EXTRACT_BE_U_2(*call_ser))); + ND_PRINT(" CALL_SER_NUM(%u)", EXTRACT_BE_U_2(*call_ser)); } static void pptp_cause_code_print(netdissect_options *ndo, const nd_uint16_t *cause_code) { - ND_PRINT((ndo, " CAUSE_CODE(%u)", EXTRACT_BE_U_2(*cause_code))); + ND_PRINT(" CAUSE_CODE(%u)", EXTRACT_BE_U_2(*cause_code)); } static void pptp_conn_speed_print(netdissect_options *ndo, const nd_uint32_t *conn_speed) { - ND_PRINT((ndo, " CONN_SPEED(%u)", EXTRACT_BE_U_4(*conn_speed))); + ND_PRINT(" CONN_SPEED(%u)", EXTRACT_BE_U_4(*conn_speed)); } static const struct tok pptp_errcode_str[] = { @@ -338,32 +338,32 @@ static void pptp_err_code_print(netdissect_options *ndo, const nd_uint8_t *err_code) { - ND_PRINT((ndo, " ERR_CODE(%u", EXTRACT_U_1(*err_code))); + ND_PRINT(" ERR_CODE(%u", EXTRACT_U_1(*err_code)); if (ndo->ndo_vflag) { - ND_PRINT((ndo, ":%s", tok2str(pptp_errcode_str, "?", EXTRACT_U_1(*err_code)))); + ND_PRINT(":%s", tok2str(pptp_errcode_str, "?", EXTRACT_U_1(*err_code))); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } static void pptp_firm_rev_print(netdissect_options *ndo, const nd_uint16_t *firm_rev) { - ND_PRINT((ndo, " FIRM_REV(%u)", EXTRACT_BE_U_2(*firm_rev))); + ND_PRINT(" FIRM_REV(%u)", EXTRACT_BE_U_2(*firm_rev)); } static void pptp_framing_cap_print(netdissect_options *ndo, const nd_uint32_t *framing_cap) { - ND_PRINT((ndo, " FRAME_CAP(")); + ND_PRINT(" FRAME_CAP("); if (EXTRACT_BE_U_4(*framing_cap) & PPTP_FRAMING_CAP_ASYNC_MASK) { - ND_PRINT((ndo, "A")); /* Async */ + ND_PRINT("A"); /* Async */ } if (EXTRACT_BE_U_4(*framing_cap) & PPTP_FRAMING_CAP_SYNC_MASK) { - ND_PRINT((ndo, "S")); /* Sync */ + ND_PRINT("S"); /* Sync */ } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } static const struct tok pptp_ftype_str[] = { @@ -377,66 +377,66 @@ static void pptp_framing_type_print(netdissect_options *ndo, const nd_uint32_t *framing_type) { - ND_PRINT((ndo, " FRAME_TYPE(%s)", - tok2str(pptp_ftype_str, "?", EXTRACT_BE_U_4(*framing_type)))); + ND_PRINT(" FRAME_TYPE(%s)", + tok2str(pptp_ftype_str, "?", EXTRACT_BE_U_4(*framing_type))); } static void pptp_hostname_print(netdissect_options *ndo, const u_char *hostname) { - ND_PRINT((ndo, " HOSTNAME(%.64s)", hostname)); + ND_PRINT(" HOSTNAME(%.64s)", hostname); } static void pptp_id_print(netdissect_options *ndo, const nd_uint32_t *id) { - ND_PRINT((ndo, " ID(%u)", EXTRACT_BE_U_4(*id))); + ND_PRINT(" ID(%u)", EXTRACT_BE_U_4(*id)); } static void pptp_max_channel_print(netdissect_options *ndo, const nd_uint16_t *max_channel) { - ND_PRINT((ndo, " MAX_CHAN(%u)", EXTRACT_BE_U_2(*max_channel))); + ND_PRINT(" MAX_CHAN(%u)", EXTRACT_BE_U_2(*max_channel)); } static void pptp_peer_call_id_print(netdissect_options *ndo, const nd_uint16_t *peer_call_id) { - ND_PRINT((ndo, " PEER_CALL_ID(%u)", EXTRACT_BE_U_2(*peer_call_id))); + ND_PRINT(" PEER_CALL_ID(%u)", EXTRACT_BE_U_2(*peer_call_id)); } static void pptp_phy_chan_id_print(netdissect_options *ndo, const nd_uint32_t *phy_chan_id) { - ND_PRINT((ndo, " PHY_CHAN_ID(%u)", EXTRACT_BE_U_4(*phy_chan_id))); + ND_PRINT(" PHY_CHAN_ID(%u)", EXTRACT_BE_U_4(*phy_chan_id)); } static void pptp_pkt_proc_delay_print(netdissect_options *ndo, const nd_uint16_t *pkt_proc_delay) { - ND_PRINT((ndo, " PROC_DELAY(%u)", EXTRACT_BE_U_2(*pkt_proc_delay))); + ND_PRINT(" PROC_DELAY(%u)", EXTRACT_BE_U_2(*pkt_proc_delay)); } static void pptp_proto_ver_print(netdissect_options *ndo, const nd_uint16_t *proto_ver) { - ND_PRINT((ndo, " PROTO_VER(%u.%u)", /* Version.Revision */ + ND_PRINT(" PROTO_VER(%u.%u)", /* Version.Revision */ EXTRACT_BE_U_2(*proto_ver) >> 8, - EXTRACT_BE_U_2(*proto_ver) & 0xff)); + EXTRACT_BE_U_2(*proto_ver) & 0xff); } static void pptp_recv_winsiz_print(netdissect_options *ndo, const nd_uint16_t *recv_winsiz) { - ND_PRINT((ndo, " RECV_WIN(%u)", EXTRACT_BE_U_2(*recv_winsiz))); + ND_PRINT(" RECV_WIN(%u)", EXTRACT_BE_U_2(*recv_winsiz)); } static const struct tok pptp_scrrp_str[] = { @@ -484,7 +484,7 @@ static void pptp_result_code_print(netdissect_options *ndo, const nd_uint8_t *result_code, int ctrl_msg_type) { - ND_PRINT((ndo, " RESULT_CODE(%u", EXTRACT_U_1(*result_code))); + ND_PRINT(" RESULT_CODE(%u", EXTRACT_U_1(*result_code)); if (ndo->ndo_vflag) { const struct tok *dict = ctrl_msg_type == PPTP_CTRL_MSG_TYPE_SCCRP ? pptp_scrrp_str : @@ -495,23 +495,23 @@ pptp_result_code_print(netdissect_options *ndo, ctrl_msg_type == PPTP_CTRL_MSG_TYPE_CDN ? pptp_cdn_str : NULL; /* assertion error */ if (dict != NULL) - ND_PRINT((ndo, ":%s", tok2str(dict, "?", EXTRACT_U_1(*result_code)))); + ND_PRINT(":%s", tok2str(dict, "?", EXTRACT_U_1(*result_code))); } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); } static void pptp_subaddr_print(netdissect_options *ndo, const u_char *subaddr) { - ND_PRINT((ndo, " SUB_ADDR(%.64s)", subaddr)); + ND_PRINT(" SUB_ADDR(%.64s)", subaddr); } static void pptp_vendor_print(netdissect_options *ndo, const u_char *vendor) { - ND_PRINT((ndo, " VENDOR(%.64s)", vendor)); + ND_PRINT(" VENDOR(%.64s)", vendor); } /************************************/ @@ -542,7 +542,7 @@ pptp_sccrq_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -573,7 +573,7 @@ pptp_sccrp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -583,31 +583,31 @@ pptp_stopccrq_print(netdissect_options *ndo, const struct pptp_msg_stopccrq *ptr = (const struct pptp_msg_stopccrq *)dat; ND_TCHECK(ptr->reason); - ND_PRINT((ndo, " REASON(%u", EXTRACT_U_1(ptr->reason))); + ND_PRINT(" REASON(%u", EXTRACT_U_1(ptr->reason)); if (ndo->ndo_vflag) { switch (EXTRACT_U_1(ptr->reason)) { case 1: - ND_PRINT((ndo, ":None")); + ND_PRINT(":None"); break; case 2: - ND_PRINT((ndo, ":Stop-Protocol")); + ND_PRINT(":Stop-Protocol"); break; case 3: - ND_PRINT((ndo, ":Stop-Local-Shutdown")); + ND_PRINT(":Stop-Local-Shutdown"); break; default: - ND_PRINT((ndo, ":?")); + ND_PRINT(":?"); break; } } - ND_PRINT((ndo, ")")); + ND_PRINT(")"); ND_TCHECK(ptr->reserved1); ND_TCHECK(ptr->reserved2); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -625,7 +625,7 @@ pptp_stopccrp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -640,7 +640,7 @@ pptp_echorq_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -660,7 +660,7 @@ pptp_echorp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -674,9 +674,9 @@ pptp_ocrq_print(netdissect_options *ndo, ND_TCHECK(ptr->call_ser); pptp_call_ser_print(ndo, &ptr->call_ser); ND_TCHECK(ptr->min_bps); - ND_PRINT((ndo, " MIN_BPS(%u)", EXTRACT_BE_U_4(ptr->min_bps))); + ND_PRINT(" MIN_BPS(%u)", EXTRACT_BE_U_4(ptr->min_bps)); ND_TCHECK(ptr->max_bps); - ND_PRINT((ndo, " MAX_BPS(%u)", EXTRACT_BE_U_4(ptr->max_bps))); + ND_PRINT(" MAX_BPS(%u)", EXTRACT_BE_U_4(ptr->max_bps)); ND_TCHECK(ptr->bearer_type); pptp_bearer_type_print(ndo, &ptr->bearer_type); ND_TCHECK(ptr->framing_type); @@ -686,17 +686,17 @@ pptp_ocrq_print(netdissect_options *ndo, ND_TCHECK(ptr->pkt_proc_delay); pptp_pkt_proc_delay_print(ndo, &ptr->pkt_proc_delay); ND_TCHECK(ptr->phone_no_len); - ND_PRINT((ndo, " PHONE_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->phone_no_len))); + ND_PRINT(" PHONE_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->phone_no_len)); ND_TCHECK(ptr->reserved1); ND_TCHECK(ptr->phone_no); - ND_PRINT((ndo, " PHONE_NO(%.64s)", ptr->phone_no)); + ND_PRINT(" PHONE_NO(%.64s)", ptr->phone_no); ND_TCHECK(ptr->subaddr); pptp_subaddr_print(ndo, &ptr->subaddr[0]); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -727,7 +727,7 @@ pptp_ocrp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -745,20 +745,20 @@ pptp_icrq_print(netdissect_options *ndo, ND_TCHECK(ptr->phy_chan_id); pptp_phy_chan_id_print(ndo, &ptr->phy_chan_id); ND_TCHECK(ptr->dialed_no_len); - ND_PRINT((ndo, " DIALED_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialed_no_len))); + ND_PRINT(" DIALED_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialed_no_len)); ND_TCHECK(ptr->dialing_no_len); - ND_PRINT((ndo, " DIALING_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialing_no_len))); + ND_PRINT(" DIALING_NO_LEN(%u)", EXTRACT_BE_U_2(ptr->dialing_no_len)); ND_TCHECK(ptr->dialed_no); - ND_PRINT((ndo, " DIALED_NO(%.64s)", ptr->dialed_no)); + ND_PRINT(" DIALED_NO(%.64s)", ptr->dialed_no); ND_TCHECK(ptr->dialing_no); - ND_PRINT((ndo, " DIALING_NO(%.64s)", ptr->dialing_no)); + ND_PRINT(" DIALING_NO(%.64s)", ptr->dialing_no); ND_TCHECK(ptr->subaddr); pptp_subaddr_print(ndo, &ptr->subaddr[0]); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -784,7 +784,7 @@ pptp_icrp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -808,7 +808,7 @@ pptp_iccn_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -824,7 +824,7 @@ pptp_ccrq_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -843,12 +843,12 @@ pptp_cdn_print(netdissect_options *ndo, pptp_cause_code_print(ndo, &ptr->cause_code); ND_TCHECK(ptr->reserved1); ND_TCHECK(ptr->call_stats); - ND_PRINT((ndo, " CALL_STATS(%.128s)", ptr->call_stats)); + ND_PRINT(" CALL_STATS(%.128s)", ptr->call_stats); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -861,22 +861,22 @@ pptp_wen_print(netdissect_options *ndo, pptp_peer_call_id_print(ndo, &ptr->peer_call_id); ND_TCHECK(ptr->reserved1); ND_TCHECK(ptr->crc_err); - ND_PRINT((ndo, " CRC_ERR(%u)", EXTRACT_BE_U_4(ptr->crc_err))); + ND_PRINT(" CRC_ERR(%u)", EXTRACT_BE_U_4(ptr->crc_err)); ND_TCHECK(ptr->framing_err); - ND_PRINT((ndo, " FRAMING_ERR(%u)", EXTRACT_BE_U_4(ptr->framing_err))); + ND_PRINT(" FRAMING_ERR(%u)", EXTRACT_BE_U_4(ptr->framing_err)); ND_TCHECK(ptr->hardware_overrun); - ND_PRINT((ndo, " HARDWARE_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->hardware_overrun))); + ND_PRINT(" HARDWARE_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->hardware_overrun)); ND_TCHECK(ptr->buffer_overrun); - ND_PRINT((ndo, " BUFFER_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->buffer_overrun))); + ND_PRINT(" BUFFER_OVERRUN(%u)", EXTRACT_BE_U_4(ptr->buffer_overrun)); ND_TCHECK(ptr->timeout_err); - ND_PRINT((ndo, " TIMEOUT_ERR(%u)", EXTRACT_BE_U_4(ptr->timeout_err))); + ND_PRINT(" TIMEOUT_ERR(%u)", EXTRACT_BE_U_4(ptr->timeout_err)); ND_TCHECK(ptr->align_err); - ND_PRINT((ndo, " ALIGN_ERR(%u)", EXTRACT_BE_U_4(ptr->align_err))); + ND_PRINT(" ALIGN_ERR(%u)", EXTRACT_BE_U_4(ptr->align_err)); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -889,14 +889,14 @@ pptp_sli_print(netdissect_options *ndo, pptp_peer_call_id_print(ndo, &ptr->peer_call_id); ND_TCHECK(ptr->reserved1); ND_TCHECK(ptr->send_accm); - ND_PRINT((ndo, " SEND_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->send_accm))); + ND_PRINT(" SEND_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->send_accm)); ND_TCHECK(ptr->recv_accm); - ND_PRINT((ndo, " RECV_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->recv_accm))); + ND_PRINT(" RECV_ACCM(0x%08x)", EXTRACT_BE_U_4(ptr->recv_accm)); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -907,25 +907,25 @@ pptp_print(netdissect_options *ndo, uint32_t mc; uint16_t ctrl_msg_type; - ND_PRINT((ndo, ": pptp")); + ND_PRINT(": pptp"); hdr = (const struct pptp_hdr *)dat; ND_TCHECK(hdr->length); if (ndo->ndo_vflag) { - ND_PRINT((ndo, " Length=%u", EXTRACT_BE_U_2(hdr->length))); + ND_PRINT(" Length=%u", EXTRACT_BE_U_2(hdr->length)); } ND_TCHECK(hdr->msg_type); if (ndo->ndo_vflag) { switch(EXTRACT_BE_U_2(hdr->msg_type)) { case PPTP_MSG_TYPE_CTRL: - ND_PRINT((ndo, " CTRL-MSG")); + ND_PRINT(" CTRL-MSG"); break; case PPTP_MSG_TYPE_MGMT: - ND_PRINT((ndo, " MGMT-MSG")); + ND_PRINT(" MGMT-MSG"); break; default: - ND_PRINT((ndo, " UNKNOWN-MSG-TYPE")); + ND_PRINT(" UNKNOWN-MSG-TYPE"); break; } } @@ -933,18 +933,18 @@ pptp_print(netdissect_options *ndo, ND_TCHECK(hdr->magic_cookie); mc = EXTRACT_BE_U_4(hdr->magic_cookie); if (mc != PPTP_MAGIC_COOKIE) { - ND_PRINT((ndo, " UNEXPECTED Magic-Cookie!!(%08x)", mc)); + ND_PRINT(" UNEXPECTED Magic-Cookie!!(%08x)", mc); } if (ndo->ndo_vflag || mc != PPTP_MAGIC_COOKIE) { - ND_PRINT((ndo, " Magic-Cookie=%08x", mc)); + ND_PRINT(" Magic-Cookie=%08x", mc); } ND_TCHECK(hdr->ctrl_msg_type); ctrl_msg_type = EXTRACT_BE_U_2(hdr->ctrl_msg_type); if (ctrl_msg_type < PPTP_MAX_MSGTYPE_INDEX) { - ND_PRINT((ndo, " CTRL_MSGTYPE=%s", - pptp_message_type_string[ctrl_msg_type])); + ND_PRINT(" CTRL_MSGTYPE=%s", + pptp_message_type_string[ctrl_msg_type]); } else { - ND_PRINT((ndo, " UNKNOWN_CTRL_MSGTYPE(%u)", ctrl_msg_type)); + ND_PRINT(" UNKNOWN_CTRL_MSGTYPE(%u)", ctrl_msg_type); } ND_TCHECK(hdr->reserved0); @@ -1004,5 +1004,5 @@ pptp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-radius.c b/print-radius.c index 0d849919..0b0c2843 100644 --- a/print-radius.c +++ b/print-radius.c @@ -96,7 +96,7 @@ static const char tstr[] = " [|radius]"; #define PRINT_HEX(bytes_len, ptr_data) \ while(bytes_len) \ { \ - ND_PRINT((ndo, "%02X", *ptr_data )); \ + ND_PRINT("%02X", *ptr_data ); \ ptr_data++; \ bytes_len--; \ } @@ -594,12 +594,12 @@ print_attr_string(netdissect_options *ndo, if (length < 3) goto trunc; if (EXTRACT_U_1(data) && (EXTRACT_U_1(data) <= 0x1F)) - ND_PRINT((ndo, "Tag[%u] ", EXTRACT_U_1(data))); + ND_PRINT("Tag[%u] ", EXTRACT_U_1(data)); else - ND_PRINT((ndo, "Tag[Unused] ")); + ND_PRINT("Tag[Unused] "); data++; length--; - ND_PRINT((ndo, "Salt %u ", EXTRACT_BE_U_2(data))); + ND_PRINT("Salt %u ", EXTRACT_BE_U_2(data)); data+=2; length-=2; break; @@ -614,9 +614,9 @@ print_attr_string(netdissect_options *ndo, if (length < 1) goto trunc; if (EXTRACT_U_1(data)) - ND_PRINT((ndo, "Tag[%u] ", EXTRACT_U_1(data))); + ND_PRINT("Tag[%u] ", EXTRACT_U_1(data)); else - ND_PRINT((ndo, "Tag[Unused] ")); + ND_PRINT("Tag[Unused] "); data++; length--; } @@ -624,21 +624,21 @@ print_attr_string(netdissect_options *ndo, case EGRESS_VLAN_NAME: if (length < 1) goto trunc; - ND_PRINT((ndo, "%s (0x%02x) ", + ND_PRINT("%s (0x%02x) ", tok2str(rfc4675_tagged,"Unknown tag",EXTRACT_U_1(data)), - EXTRACT_U_1(data))); + EXTRACT_U_1(data)); data++; length--; break; } for (i=0; i < length && EXTRACT_U_1(data); i++, data++) - ND_PRINT((ndo, "%c", ND_ISPRINT(EXTRACT_U_1(data)) ? EXTRACT_U_1(data) : '.')); + ND_PRINT("%c", ND_ISPRINT(EXTRACT_U_1(data)) ? EXTRACT_U_1(data) : '.'); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* @@ -660,9 +660,9 @@ print_vendor_attr(netdissect_options *ndo, data+=4; length-=4; - ND_PRINT((ndo, "Vendor: %s (%u)", + ND_PRINT("Vendor: %s (%u)", tok2str(smi_values,"Unknown",vendor_id), - vendor_id)); + vendor_id); while (length >= 2) { ND_TCHECK_2(data); @@ -672,16 +672,16 @@ print_vendor_attr(netdissect_options *ndo, if (vendor_length < 2) { - ND_PRINT((ndo, "\n\t Vendor Attribute: %u, Length: %u (bogus, must be >= 2)", + ND_PRINT("\n\t Vendor Attribute: %u, Length: %u (bogus, must be >= 2)", vendor_type, - vendor_length)); + vendor_length); return; } if (vendor_length > length) { - ND_PRINT((ndo, "\n\t Vendor Attribute: %u, Length: %u (bogus, goes past end of vendor-specific attribute)", + ND_PRINT("\n\t Vendor Attribute: %u, Length: %u (bogus, goes past end of vendor-specific attribute)", vendor_type, - vendor_length)); + vendor_length); return; } data+=2; @@ -689,17 +689,17 @@ print_vendor_attr(netdissect_options *ndo, length-=2; ND_TCHECK_LEN(data, vendor_length); - ND_PRINT((ndo, "\n\t Vendor Attribute: %u, Length: %u, Value: ", + ND_PRINT("\n\t Vendor Attribute: %u, Length: %u, Value: ", vendor_type, - vendor_length)); + vendor_length); for (idx = 0; idx < vendor_length ; idx++, data++) - ND_PRINT((ndo, "%c", ND_ISPRINT(EXTRACT_U_1(data)) ? EXTRACT_U_1(data) : '.')); + ND_PRINT("%c", ND_ISPRINT(EXTRACT_U_1(data)) ? EXTRACT_U_1(data) : '.'); length-=vendor_length; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /******************************/ @@ -717,7 +717,7 @@ print_attr_num(netdissect_options *ndo, if (length != 4) { - ND_PRINT((ndo, "ERROR: length %u != 4", length)); + ND_PRINT("ERROR: length %u != 4", length); return; } @@ -732,9 +732,9 @@ print_attr_num(netdissect_options *ndo, if ( (attr_code == TUNNEL_TYPE) || (attr_code == TUNNEL_MEDIUM) ) { if (!EXTRACT_U_1(data)) - ND_PRINT((ndo, "Tag[Unused] ")); + ND_PRINT("Tag[Unused] "); else - ND_PRINT((ndo, "Tag[%u] ", EXTRACT_U_1(data))); + ND_PRINT("Tag[%u] ", EXTRACT_U_1(data)); data++; data_value = EXTRACT_BE_U_3(data); } @@ -745,9 +745,9 @@ print_attr_num(netdissect_options *ndo, if ( data_value <= (uint32_t)(attr_type[attr_code].siz_subtypes - 1 + attr_type[attr_code].first_subtype) && data_value >= attr_type[attr_code].first_subtype ) - ND_PRINT((ndo, "%s", table[data_value])); + ND_PRINT("%s", table[data_value]); else - ND_PRINT((ndo, "#%u", data_value)); + ND_PRINT("#%u", data_value); } else { @@ -755,9 +755,9 @@ print_attr_num(netdissect_options *ndo, { case FRM_IPX: if (EXTRACT_BE_U_4(data) == 0xFFFFFFFE ) - ND_PRINT((ndo, "NAS Select")); + ND_PRINT("NAS Select"); else - ND_PRINT((ndo, "%u", EXTRACT_BE_U_4(data))); + ND_PRINT("%u", EXTRACT_BE_U_4(data)); break; case SESSION_TIMEOUT: @@ -767,52 +767,52 @@ print_attr_num(netdissect_options *ndo, case ACCT_INT_INTERVAL: timeout = EXTRACT_BE_U_4(data); if ( timeout < 60 ) - ND_PRINT((ndo, "%02d secs", timeout)); + ND_PRINT("%02d secs", timeout); else { if ( timeout < 3600 ) - ND_PRINT((ndo, "%02d:%02d min", - timeout / 60, timeout % 60)); + ND_PRINT("%02d:%02d min", + timeout / 60, timeout % 60); else - ND_PRINT((ndo, "%02d:%02d:%02d hours", + ND_PRINT("%02d:%02d:%02d hours", timeout / 3600, (timeout % 3600) / 60, - timeout % 60)); + timeout % 60); } break; case FRM_ATALK_LINK: if (EXTRACT_BE_U_4(data)) - ND_PRINT((ndo, "%u", EXTRACT_BE_U_4(data))); + ND_PRINT("%u", EXTRACT_BE_U_4(data)); else - ND_PRINT((ndo, "Unnumbered")); + ND_PRINT("Unnumbered"); break; case FRM_ATALK_NETWORK: if (EXTRACT_BE_U_4(data)) - ND_PRINT((ndo, "%u", EXTRACT_BE_U_4(data))); + ND_PRINT("%u", EXTRACT_BE_U_4(data)); else - ND_PRINT((ndo, "NAS assigned")); + ND_PRINT("NAS assigned"); break; case TUNNEL_PREFERENCE: if (EXTRACT_U_1(data)) - ND_PRINT((ndo, "Tag[%u] ", EXTRACT_U_1(data))); + ND_PRINT("Tag[%u] ", EXTRACT_U_1(data)); else - ND_PRINT((ndo, "Tag[Unused] ")); + ND_PRINT("Tag[Unused] "); data++; - ND_PRINT((ndo, "%u", EXTRACT_BE_U_3(data))); + ND_PRINT("%u", EXTRACT_BE_U_3(data)); break; case EGRESS_VLAN_ID: - ND_PRINT((ndo, "%s (0x%02x) ", + ND_PRINT("%s (0x%02x) ", tok2str(rfc4675_tagged,"Unknown tag",EXTRACT_U_1(data)), - EXTRACT_U_1(data))); + EXTRACT_U_1(data)); data++; - ND_PRINT((ndo, "%u", EXTRACT_BE_U_3(data))); + ND_PRINT("%u", EXTRACT_BE_U_3(data)); break; default: - ND_PRINT((ndo, "%u", EXTRACT_BE_U_4(data))); + ND_PRINT("%u", EXTRACT_BE_U_4(data)); break; } /* switch */ @@ -822,7 +822,7 @@ print_attr_num(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /*****************************/ @@ -838,7 +838,7 @@ print_attr_address(netdissect_options *ndo, { if (length != 4) { - ND_PRINT((ndo, "ERROR: length %u != 4", length)); + ND_PRINT("ERROR: length %u != 4", length); return; } @@ -849,23 +849,23 @@ print_attr_address(netdissect_options *ndo, case FRM_IPADDR: case LOG_IPHOST: if (EXTRACT_BE_U_4(data) == 0xFFFFFFFF ) - ND_PRINT((ndo, "User Selected")); + ND_PRINT("User Selected"); else if (EXTRACT_BE_U_4(data) == 0xFFFFFFFE ) - ND_PRINT((ndo, "NAS Select")); + ND_PRINT("NAS Select"); else - ND_PRINT((ndo, "%s",ipaddr_string(ndo, data))); + ND_PRINT("%s",ipaddr_string(ndo, data)); break; default: - ND_PRINT((ndo, "%s", ipaddr_string(ndo, data))); + ND_PRINT("%s", ipaddr_string(ndo, data)); break; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /*****************************/ @@ -881,18 +881,18 @@ print_attr_address6(netdissect_options *ndo, { if (length != 16) { - ND_PRINT((ndo, "ERROR: length %u != 16", length)); + ND_PRINT("ERROR: length %u != 16", length); return; } ND_TCHECK_16(data); - ND_PRINT((ndo, "%s", ip6addr_string(ndo, data))); + ND_PRINT("%s", ip6addr_string(ndo, data)); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -903,13 +903,13 @@ print_attr_netmask6(netdissect_options *ndo, if (length < 2 || length > 18) { - ND_PRINT((ndo, "ERROR: length %u not in range (2..18)", length)); + ND_PRINT("ERROR: length %u not in range (2..18)", length); return; } ND_TCHECK_LEN(data, length); if (EXTRACT_U_1(data + 1) > 128) { - ND_PRINT((ndo, "ERROR: netmask %u not in range (0..128)", EXTRACT_U_1(data + 1))); + ND_PRINT("ERROR: netmask %u not in range (0..128)", EXTRACT_U_1(data + 1)); return; } @@ -917,15 +917,15 @@ print_attr_netmask6(netdissect_options *ndo, if (length > 2) memcpy(data2, data+2, length-2); - ND_PRINT((ndo, "%s/%u", ip6addr_string(ndo, data2), EXTRACT_U_1(data + 1))); + ND_PRINT("%s/%u", ip6addr_string(ndo, data2), EXTRACT_U_1(data + 1)); if (EXTRACT_U_1(data + 1) > 8 * (length - 2)) - ND_PRINT((ndo, " (inconsistent prefix length)")); + ND_PRINT(" (inconsistent prefix length)"); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /*************************************/ @@ -945,7 +945,7 @@ print_attr_time(netdissect_options *ndo, if (length != 4) { - ND_PRINT((ndo, "ERROR: length %u != 4", length)); + ND_PRINT("ERROR: length %u != 4", length); return; } @@ -955,11 +955,11 @@ print_attr_time(netdissect_options *ndo, strlcpy(string, ctime(&attr_time), sizeof(string)); /* Get rid of the newline */ string[24] = '\0'; - ND_PRINT((ndo, "%.24s", string)); + ND_PRINT("%.24s", string); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /***********************************/ @@ -981,44 +981,44 @@ print_attr_strange(netdissect_options *ndo, case ARAP_PASS: if (length != 16) { - ND_PRINT((ndo, "ERROR: length %u != 16", length)); + ND_PRINT("ERROR: length %u != 16", length); return; } - ND_PRINT((ndo, "User_challenge (")); + ND_PRINT("User_challenge ("); ND_TCHECK_8(data); len_data = 8; PRINT_HEX(len_data, data); - ND_PRINT((ndo, ") User_resp(")); + ND_PRINT(") User_resp("); ND_TCHECK_8(data); len_data = 8; PRINT_HEX(len_data, data); - ND_PRINT((ndo, ")")); + ND_PRINT(")"); break; case ARAP_FEATURES: if (length != 14) { - ND_PRINT((ndo, "ERROR: length %u != 14", length)); + ND_PRINT("ERROR: length %u != 14", length); return; } ND_TCHECK_1(data); if (EXTRACT_U_1(data)) - ND_PRINT((ndo, "User can change password")); + ND_PRINT("User can change password"); else - ND_PRINT((ndo, "User cannot change password")); + ND_PRINT("User cannot change password"); data++; ND_TCHECK_1(data); - ND_PRINT((ndo, ", Min password length: %u", EXTRACT_U_1(data))); + ND_PRINT(", Min password length: %u", EXTRACT_U_1(data)); data++; - ND_PRINT((ndo, ", created at: ")); + ND_PRINT(", created at: "); ND_TCHECK_4(data); len_data = 4; PRINT_HEX(len_data, data); - ND_PRINT((ndo, ", expires in: ")); + ND_PRINT(", expires in: "); ND_TCHECK_4(data); len_data = 4; PRINT_HEX(len_data, data); - ND_PRINT((ndo, ", Current Time: ")); + ND_PRINT(", Current Time: "); ND_TCHECK_4(data); len_data = 4; PRINT_HEX(len_data, data); @@ -1027,7 +1027,7 @@ print_attr_strange(netdissect_options *ndo, case ARAP_CHALLENGE_RESP: if (length < 8) { - ND_PRINT((ndo, "ERROR: length %u != 8", length)); + ND_PRINT("ERROR: length %u != 8", length); return; } ND_TCHECK_8(data); @@ -1038,19 +1038,19 @@ print_attr_strange(netdissect_options *ndo, case ERROR_CAUSE: if (length != 4) { - ND_PRINT((ndo, "Error: length %u != 4", length)); + ND_PRINT("Error: length %u != 4", length); return; } ND_TCHECK_4(data); error_cause_value = EXTRACT_BE_U_4(data); - ND_PRINT((ndo, "Error cause %u: %s", error_cause_value, tok2str(errorcausetype, "Error-Cause %u not known", error_cause_value))); + ND_PRINT("Error cause %u: %s", error_cause_value, tok2str(errorcausetype, "Error-Cause %u not known", error_cause_value)); break; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -1075,24 +1075,24 @@ radius_attrs_print(netdissect_options *ndo, attr_string = "Unknown"; if (len < 2) { - ND_PRINT((ndo, "\n\t %s Attribute (%u), length: %u (bogus, must be >= 2)", + ND_PRINT("\n\t %s Attribute (%u), length: %u (bogus, must be >= 2)", attr_string, type, - len)); + len); return; } if (len > length) { - ND_PRINT((ndo, "\n\t %s Attribute (%u), length: %u (bogus, goes past end of packet)", + ND_PRINT("\n\t %s Attribute (%u), length: %u (bogus, goes past end of packet)", attr_string, type, - len)); + len); return; } - ND_PRINT((ndo, "\n\t %s Attribute (%u), length: %u, Value: ", + ND_PRINT("\n\t %s Attribute (%u), length: %u, Value: ", attr_string, type, - len)); + len); if (type < TAM_SIZE(attr_type)) { @@ -1114,7 +1114,7 @@ radius_attrs_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -1130,7 +1130,7 @@ radius_print(netdissect_options *ndo, if (len < MIN_RADIUS_LEN) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } @@ -1138,22 +1138,22 @@ radius_print(netdissect_options *ndo, len = length; if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "RADIUS, %s (%u), id: 0x%02x length: %u", + ND_PRINT("RADIUS, %s (%u), id: 0x%02x length: %u", tok2str(radius_command_values,"Unknown Command",EXTRACT_U_1(rad->code)), EXTRACT_U_1(rad->code), EXTRACT_U_1(rad->id), - len)); + len); return; } else { - ND_PRINT((ndo, "RADIUS, length: %u\n\t%s (%u), id: 0x%02x, Authenticator: ", + ND_PRINT("RADIUS, length: %u\n\t%s (%u), id: 0x%02x, Authenticator: ", len, tok2str(radius_command_values,"Unknown Command",EXTRACT_U_1(rad->code)), EXTRACT_U_1(rad->code), - EXTRACT_U_1(rad->id))); + EXTRACT_U_1(rad->id)); for(auth_idx=0; auth_idx < 16; auth_idx++) - ND_PRINT((ndo, "%02x", rad->auth[auth_idx])); + ND_PRINT("%02x", rad->auth[auth_idx]); } if (len > MIN_RADIUS_LEN) @@ -1161,5 +1161,5 @@ radius_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-raw.c b/print-raw.c index 463aa41f..9f006870 100644 --- a/print-raw.c +++ b/print-raw.c @@ -37,7 +37,7 @@ u_int raw_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { if (ndo->ndo_eflag) - ND_PRINT((ndo, "ip: ")); + ND_PRINT("ip: "); ipN_print(ndo, p, h->len); diff --git a/print-resp.c b/print-resp.c index 5e5bde0d..bec3858e 100644 --- a/print-resp.c +++ b/print-resp.c @@ -54,11 +54,11 @@ static const char tstr[] = " [|RESP]"; #define RESP_BULK_STRING '$' #define RESP_ARRAY '*' -#define resp_print_empty(ndo) ND_PRINT((ndo, " empty")) -#define resp_print_null(ndo) ND_PRINT((ndo, " null")) -#define resp_print_length_too_large(ndo) ND_PRINT((ndo, " length too large")) -#define resp_print_length_negative(ndo) ND_PRINT((ndo, " length negative and not -1")) -#define resp_print_invalid(ndo) ND_PRINT((ndo, " invalid")) +#define resp_print_empty(ndo) ND_PRINT(" empty") +#define resp_print_null(ndo) ND_PRINT(" null") +#define resp_print_length_too_large(ndo) ND_PRINT(" length too large") +#define resp_print_length_negative(ndo) ND_PRINT(" length negative and not -1") +#define resp_print_invalid(ndo) ND_PRINT(" invalid") void resp_print(netdissect_options *, const u_char *, u_int); static int resp_parse(netdissect_options *, const u_char *, int); @@ -204,7 +204,7 @@ static int resp_get_length(netdissect_options *, const u_char *, int, const u_ch * Assumes the data has already been verified as present. */ #define RESP_PRINT_SEGMENT(_ndo, _bp, _len) \ - ND_PRINT((_ndo, " \"")); \ + ND_PRINT(" \""); \ if (fn_printn(_ndo, _bp, _len, _ndo->ndo_snapend)) \ goto trunc; \ fn_print_char(_ndo, '"'); @@ -217,7 +217,7 @@ resp_print(netdissect_options *ndo, const u_char *bp, u_int length) if(!bp || length <= 0) return; - ND_PRINT((ndo, ": RESP")); + ND_PRINT(": RESP"); while (length_cur > 0) { /* * This block supports redis pipelining. @@ -237,7 +237,7 @@ resp_print(netdissect_options *ndo, const u_char *bp, u_int length) return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static int diff --git a/print-rip.c b/print-rip.c index 9e72bf6e..546b609b 100644 --- a/print-rip.c +++ b/print-rip.c @@ -104,7 +104,7 @@ rip_entry_print_v1(netdissect_options *ndo, /* RFC 1058 */ family = EXTRACT_BE_U_2(ni->rip_family); if (family != BSD_AFNUM_INET && family != 0) { - ND_PRINT((ndo, "\n\t AFI %s, ", tok2str(bsd_af_values, "Unknown (%u)", family))); + ND_PRINT("\n\t AFI %s, ", tok2str(bsd_af_values, "Unknown (%u)", family)); print_unknown_data(ndo, (const uint8_t *)&ni->rip_family, "\n\t ", RIP_ROUTELEN); return; } @@ -116,14 +116,14 @@ rip_entry_print_v1(netdissect_options *ndo, return; } if (family == 0) { - ND_PRINT((ndo, "\n\t AFI 0, %s, metric: %u", + ND_PRINT("\n\t AFI 0, %s, metric: %u", ipaddr_string(ndo, &ni->rip_dest), - EXTRACT_BE_U_4(ni->rip_metric))); + EXTRACT_BE_U_4(ni->rip_metric)); return; } /* BSD_AFNUM_INET */ - ND_PRINT((ndo, "\n\t %s, metric: %u", + ND_PRINT("\n\t %s, metric: %u", ipaddr_string(ndo, &ni->rip_dest), - EXTRACT_BE_U_4(ni->rip_metric))); + EXTRACT_BE_U_4(ni->rip_metric)); } static unsigned @@ -138,41 +138,41 @@ rip_entry_print_v2(netdissect_options *ndo, if (auth_type == 2) { const u_char *p = (const u_char *)&ni->rip_dest; u_int i = 0; - ND_PRINT((ndo, "\n\t Simple Text Authentication data: ")); + ND_PRINT("\n\t Simple Text Authentication data: "); for (; i < RIP_AUTHLEN; p++, i++) - ND_PRINT((ndo, "%c", - ND_ISPRINT(EXTRACT_U_1(p)) ? EXTRACT_U_1(p) : '.')); + ND_PRINT("%c", + ND_ISPRINT(EXTRACT_U_1(p)) ? EXTRACT_U_1(p) : '.'); } else if (auth_type == 3) { - ND_PRINT((ndo, "\n\t Auth header:")); - ND_PRINT((ndo, " Packet Len %u,", EXTRACT_BE_U_2((const uint8_t *)ni + 4))); - ND_PRINT((ndo, " Key-ID %u,", EXTRACT_U_1((const uint8_t *)ni + 6))); - ND_PRINT((ndo, " Auth Data Len %u,", EXTRACT_U_1((const uint8_t *)ni + 7))); - ND_PRINT((ndo, " SeqNo %u,", EXTRACT_BE_U_4(ni->rip_dest_mask))); - ND_PRINT((ndo, " MBZ %u,", EXTRACT_BE_U_4(ni->rip_router))); - ND_PRINT((ndo, " MBZ %u", EXTRACT_BE_U_4(ni->rip_metric))); + ND_PRINT("\n\t Auth header:"); + ND_PRINT(" Packet Len %u,", EXTRACT_BE_U_2((const uint8_t *)ni + 4)); + ND_PRINT(" Key-ID %u,", EXTRACT_U_1((const uint8_t *)ni + 6)); + ND_PRINT(" Auth Data Len %u,", EXTRACT_U_1((const uint8_t *)ni + 7)); + ND_PRINT(" SeqNo %u,", EXTRACT_BE_U_4(ni->rip_dest_mask)); + ND_PRINT(" MBZ %u,", EXTRACT_BE_U_4(ni->rip_router)); + ND_PRINT(" MBZ %u", EXTRACT_BE_U_4(ni->rip_metric)); } else if (auth_type == 1) { - ND_PRINT((ndo, "\n\t Auth trailer:")); + ND_PRINT("\n\t Auth trailer:"); print_unknown_data(ndo, (const uint8_t *)&ni->rip_dest, "\n\t ", remaining); return remaining; /* AT spans till the packet end */ } else { - ND_PRINT((ndo, "\n\t Unknown (%u) Authentication data:", - EXTRACT_BE_U_2(ni->rip_tag))); + ND_PRINT("\n\t Unknown (%u) Authentication data:", + EXTRACT_BE_U_2(ni->rip_tag)); print_unknown_data(ndo, (const uint8_t *)&ni->rip_dest, "\n\t ", remaining); } } else if (family != BSD_AFNUM_INET && family != 0) { - ND_PRINT((ndo, "\n\t AFI %s", tok2str(bsd_af_values, "Unknown (%u)", family))); + ND_PRINT("\n\t AFI %s", tok2str(bsd_af_values, "Unknown (%u)", family)); print_unknown_data(ndo, (const uint8_t *)&ni->rip_tag, "\n\t ", RIP_ROUTELEN-2); } else { /* BSD_AFNUM_INET or AFI 0 */ - ND_PRINT((ndo, "\n\t AFI %s, %15s/%-2d, tag 0x%04x, metric: %u, next-hop: ", + ND_PRINT("\n\t AFI %s, %15s/%-2d, tag 0x%04x, metric: %u, next-hop: ", tok2str(bsd_af_values, "%u", family), ipaddr_string(ndo, &ni->rip_dest), mask2plen(EXTRACT_BE_U_4(ni->rip_dest_mask)), EXTRACT_BE_U_2(ni->rip_tag), - EXTRACT_BE_U_4(ni->rip_metric))); + EXTRACT_BE_U_4(ni->rip_metric)); if (EXTRACT_BE_U_4(ni->rip_router)) - ND_PRINT((ndo, "%s", ipaddr_string(ndo, &ni->rip_router))); + ND_PRINT("%s", ipaddr_string(ndo, &ni->rip_router)); else - ND_PRINT((ndo, "self")); + ND_PRINT("self"); } return sizeof (*ni); } @@ -187,14 +187,14 @@ rip_print(netdissect_options *ndo, u_int i, j; if (ndo->ndo_snapend < dat) { - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); return; } i = ndo->ndo_snapend - dat; if (i > length) i = length; if (i < sizeof(*rp)) { - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); return; } i -= sizeof(*rp); @@ -202,9 +202,9 @@ rip_print(netdissect_options *ndo, rp = (const struct rip *)dat; vers = EXTRACT_U_1(rp->rip_vers); - ND_PRINT((ndo, "%sRIPv%u", + ND_PRINT("%sRIPv%u", (ndo->ndo_vflag >= 1) ? "\n\t" : "", - vers)); + vers); switch (vers) { case 0: @@ -224,11 +224,11 @@ rip_print(netdissect_options *ndo, default: /* dump version and lets see if we know the commands name*/ cmd = EXTRACT_U_1(rp->rip_cmd); - ND_PRINT((ndo, ", %s, length: %u", + ND_PRINT(", %s, length: %u", tok2str(rip_cmd_values, "unknown command (%u)", cmd), - length)); + length); if (ndo->ndo_vflag < 1) return; @@ -237,7 +237,7 @@ rip_print(netdissect_options *ndo, case RIPCMD_REQUEST: case RIPCMD_RESPONSE: j = length / sizeof(*ni); - ND_PRINT((ndo, ", routes: %u%s", j, vers == 2 ? " or less" : "")); + ND_PRINT(", routes: %u%s", j, vers == 2 ? " or less" : ""); ni = (const struct rip_netinfo *)(rp + 1); for (; i >= sizeof(*ni); ++ni) { if (vers == 1) @@ -251,7 +251,7 @@ rip_print(netdissect_options *ndo, break; } if (i) - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; case RIPCMD_TRACEOFF: diff --git a/print-ripng.c b/print-ripng.c index 78ad5a67..87218a70 100644 --- a/print-ripng.c +++ b/print-ripng.c @@ -99,12 +99,12 @@ rip6_entry_print(netdissect_options *ndo, const struct netinfo6 *ni, u_int metri int l; uint16_t tag; - l = ND_PRINT((ndo, "%s/%u", ip6addr_string(ndo, &ni->rip6_dest), EXTRACT_U_1(ni->rip6_plen))); + l = ND_PRINT("%s/%u", ip6addr_string(ndo, &ni->rip6_dest), EXTRACT_U_1(ni->rip6_plen)); tag = EXTRACT_BE_U_2(ni->rip6_tag); if (tag) - l += ND_PRINT((ndo, " [%u]", tag)); + l += ND_PRINT(" [%u]", tag); if (metric) - l += ND_PRINT((ndo, " (%u)", metric)); + l += ND_PRINT(" (%u)", metric); return l; } @@ -131,21 +131,21 @@ ripng_print(netdissect_options *ndo, const u_char *dat, unsigned int length) ND_TCHECK(rp->rip6_nets); if (EXTRACT_U_1(rp->rip6_nets->rip6_metric) == HOPCNT_INFINITY6 && IN6_IS_ADDR_UNSPECIFIED(&rp->rip6_nets->rip6_dest)) { - ND_PRINT((ndo, " ripng-req dump")); + ND_PRINT(" ripng-req dump"); break; } } if (j * sizeof(*ni) != length_left) - ND_PRINT((ndo, " ripng-req %u[%u]:", j, length)); + ND_PRINT(" ripng-req %u[%u]:", j, length); else - ND_PRINT((ndo, " ripng-req %u:", j)); + ND_PRINT(" ripng-req %u:", j); for (ni = rp->rip6_nets; length_left >= sizeof(*ni); length_left -= sizeof(*ni), ++ni) { ND_TCHECK_SIZE(ni); if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "\n\t")); + ND_PRINT("\n\t"); else - ND_PRINT((ndo, " ")); + ND_PRINT(" "); rip6_entry_print(ndo, ni, 0); } if (length_left != 0) @@ -158,31 +158,31 @@ ripng_print(netdissect_options *ndo, const u_char *dat, unsigned int length) length_left -= (sizeof(struct rip6) - sizeof(struct netinfo6)); j = length_left / sizeof(*ni); if (j * sizeof(*ni) != length_left) - ND_PRINT((ndo, " ripng-resp %u[%u]:", j, length)); + ND_PRINT(" ripng-resp %u[%u]:", j, length); else - ND_PRINT((ndo, " ripng-resp %u:", j)); + ND_PRINT(" ripng-resp %u:", j); for (ni = rp->rip6_nets; length_left >= sizeof(*ni); length_left -= sizeof(*ni), ++ni) { ND_TCHECK_SIZE(ni); if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "\n\t")); + ND_PRINT("\n\t"); else - ND_PRINT((ndo, " ")); + ND_PRINT(" "); rip6_entry_print(ndo, ni, EXTRACT_U_1(ni->rip6_metric)); } if (length_left != 0) goto trunc; break; default: - ND_PRINT((ndo, " ripng-%u ?? %u", cmd, length)); + ND_PRINT(" ripng-%u ?? %u", cmd, length); break; } ND_TCHECK(rp->rip6_vers); if (EXTRACT_U_1(rp->rip6_vers) != RIP6_VERSION) - ND_PRINT((ndo, " [vers %u]", EXTRACT_U_1(rp->rip6_vers))); + ND_PRINT(" [vers %u]", EXTRACT_U_1(rp->rip6_vers)); return; trunc: - ND_PRINT((ndo, "[|ripng]")); + ND_PRINT("[|ripng]"); return; } diff --git a/print-rpki-rtr.c b/print-rpki-rtr.c index 45e2787d..58bdf7f9 100644 --- a/print-rpki-rtr.c +++ b/print-rpki-rtr.c @@ -190,11 +190,11 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len * version 0, there is no way to know exactly how to skip the * current PDU. */ - ND_PRINT((ndo, "%sRPKI-RTRv%u (unknown)", indent_string(8), EXTRACT_U_1(tptr))); + ND_PRINT("%sRPKI-RTRv%u (unknown)", indent_string(8), EXTRACT_U_1(tptr)); return len; } if (len < sizeof(rpki_rtr_pdu)) { - ND_PRINT((ndo, "(%u bytes is too few to decode)", len)); + ND_PRINT("(%u bytes is too few to decode)", len); goto invalid; } ND_TCHECK_LEN(tptr, sizeof(rpki_rtr_pdu)); @@ -207,11 +207,11 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len */ hexdump = FALSE; - ND_PRINT((ndo, "%sRPKI-RTRv%u, %s PDU (%u), length: %u", + ND_PRINT("%sRPKI-RTRv%u, %s PDU (%u), length: %u", indent_string(8), pdu_header->version, tok2str(rpki_rtr_pdu_values, "Unknown", pdu_type), - pdu_type, pdu_len)); + pdu_type, pdu_len); if (pdu_len < sizeof(rpki_rtr_pdu) || pdu_len > len) goto invalid; @@ -227,10 +227,10 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len goto invalid; ND_TCHECK_LEN(tptr, pdu_len); msg = (const u_char *)(pdu_header + 1); - ND_PRINT((ndo, "%sSession ID: 0x%04x, Serial: %u", + ND_PRINT("%sSession ID: 0x%04x, Serial: %u", indent_string(indent+2), EXTRACT_BE_U_2(pdu_header->u.session_id), - EXTRACT_BE_U_4(msg))); + EXTRACT_BE_U_4(msg)); break; /* @@ -251,9 +251,9 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len if (pdu_len != sizeof(rpki_rtr_pdu)) goto invalid; /* no additional boundary to check */ - ND_PRINT((ndo, "%sSession ID: 0x%04x", + ND_PRINT("%sSession ID: 0x%04x", indent_string(indent+2), - EXTRACT_BE_U_2(pdu_header->u.session_id))); + EXTRACT_BE_U_2(pdu_header->u.session_id)); break; case RPKI_RTR_IPV4_PREFIX_PDU: @@ -264,11 +264,11 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len goto invalid; ND_TCHECK_LEN(tptr, pdu_len); pdu = (const rpki_rtr_pdu_ipv4_prefix *)tptr; - ND_PRINT((ndo, "%sIPv4 Prefix %s/%u-%u, origin-as %u, flags 0x%02x", + ND_PRINT("%sIPv4 Prefix %s/%u-%u, origin-as %u, flags 0x%02x", indent_string(indent+2), ipaddr_string(ndo, pdu->prefix), pdu->prefix_length, pdu->max_length, - EXTRACT_BE_U_4(pdu->as), pdu->flags)); + EXTRACT_BE_U_4(pdu->as), pdu->flags); } break; @@ -280,11 +280,11 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len goto invalid; ND_TCHECK_LEN(tptr, pdu_len); pdu = (const rpki_rtr_pdu_ipv6_prefix *)tptr; - ND_PRINT((ndo, "%sIPv6 Prefix %s/%u-%u, origin-as %u, flags 0x%02x", + ND_PRINT("%sIPv6 Prefix %s/%u-%u, origin-as %u, flags 0x%02x", indent_string(indent+2), ip6addr_string(ndo, pdu->prefix), pdu->prefix_length, pdu->max_length, - EXTRACT_BE_U_4(pdu->as), pdu->flags)); + EXTRACT_BE_U_4(pdu->as), pdu->flags); } break; @@ -306,10 +306,10 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len tlen += 4; error_code = EXTRACT_BE_U_2(pdu->pdu_header.u.error_code); - ND_PRINT((ndo, "%sError code: %s (%u), Encapsulated PDU length: %u", + ND_PRINT("%sError code: %s (%u), Encapsulated PDU length: %u", indent_string(indent+2), tok2str(rpki_rtr_error_codes, "Unknown", error_code), - error_code, encapsulated_pdu_length)); + error_code, encapsulated_pdu_length); if (encapsulated_pdu_length) { /* Section 5.10 of RFC 6810 says: @@ -330,7 +330,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len ND_TCHECK_LEN(tptr, tlen + encapsulated_pdu_length); } else { - ND_PRINT((ndo, "%s-----encapsulated PDU-----", indent_string(indent+4))); + ND_PRINT("%s-----encapsulated PDU-----", indent_string(indent+4)); rpki_rtr_pdu_print(ndo, tptr + tlen, encapsulated_pdu_length, 0, indent + 2); } @@ -354,7 +354,7 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len if (pdu_len < tlen + text_length) goto invalid; /* fn_printn() makes the bounds check */ - ND_PRINT((ndo, "%sError text: ", indent_string(indent+2))); + ND_PRINT("%sError text: ", indent_string(indent+2)); if (fn_printn(ndo, tptr + tlen, text_length, ndo->ndo_snapend)) goto trunc; } @@ -377,11 +377,11 @@ rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, const u_int len return pdu_len; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); ND_TCHECK_LEN(tptr, len); return len; trunc: - ND_PRINT((ndo, "\n\t%s", tstr)); + ND_PRINT("\n\t%s", tstr); return len; } @@ -389,7 +389,7 @@ void rpki_rtr_print(netdissect_options *ndo, const u_char *pptr, u_int len) { if (!ndo->ndo_vflag) { - ND_PRINT((ndo, ", RPKI-RTR")); + ND_PRINT(", RPKI-RTR"); return; } while (len) { diff --git a/print-rrcp.c b/print-rrcp.c index 0885f646..94406f9f 100644 --- a/print-rrcp.c +++ b/print-rrcp.c @@ -101,45 +101,45 @@ rrcp_print(netdissect_options *ndo, ND_TCHECK_1(cp + RRCP_OPCODE_ISREPLY_OFFSET); rrcp_opcode = EXTRACT_U_1((cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_OPCODE_MASK; if (src != NULL && dst != NULL) { - ND_PRINT((ndo, "%s > %s, ", + ND_PRINT("%s > %s, ", (src->addr_string)(ndo, src->addr), - (dst->addr_string)(ndo, dst->addr))); + (dst->addr_string)(ndo, dst->addr)); } - ND_PRINT((ndo, "%s %s", + ND_PRINT("%s %s", tok2str(proto_values,"RRCP-0x%02x",rrcp_proto), - ((EXTRACT_U_1(cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY) ? "reply" : "query")); + ((EXTRACT_U_1(cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY) ? "reply" : "query"); if (rrcp_proto==1){ - ND_PRINT((ndo, ": %s", - tok2str(opcode_values,"unknown opcode (0x%02x)",rrcp_opcode))); + ND_PRINT(": %s", + tok2str(opcode_values,"unknown opcode (0x%02x)",rrcp_opcode)); } if (rrcp_opcode==1 || rrcp_opcode==2){ ND_TCHECK_6(cp + RRCP_REG_ADDR_OFFSET); - ND_PRINT((ndo, " addr=0x%04x, data=0x%08x", + ND_PRINT(" addr=0x%04x, data=0x%08x", EXTRACT_LE_U_2(cp + RRCP_REG_ADDR_OFFSET), - EXTRACT_LE_U_4(cp + RRCP_REG_DATA_OFFSET))); + EXTRACT_LE_U_4(cp + RRCP_REG_DATA_OFFSET)); } if (rrcp_proto==1){ ND_TCHECK_2(cp + RRCP_AUTHKEY_OFFSET); - ND_PRINT((ndo, ", auth=0x%04x", - EXTRACT_BE_U_2(cp + RRCP_AUTHKEY_OFFSET))); + ND_PRINT(", auth=0x%04x", + EXTRACT_BE_U_2(cp + RRCP_AUTHKEY_OFFSET)); } if (rrcp_proto==1 && rrcp_opcode==0 && ((EXTRACT_U_1(cp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY)){ ND_TCHECK_4(cp + RRCP_VENDOR_ID_OFFSET); - ND_PRINT((ndo, " downlink_port=%d, uplink_port=%d, uplink_mac=%s, vendor_id=%08x ,chip_id=%04x ", + ND_PRINT(" downlink_port=%d, uplink_port=%d, uplink_mac=%s, vendor_id=%08x ,chip_id=%04x ", EXTRACT_U_1(cp + RRCP_DOWNLINK_PORT_OFFSET), EXTRACT_U_1(cp + RRCP_UPLINK_PORT_OFFSET), etheraddr_string(ndo, cp + RRCP_UPLINK_MAC_OFFSET), EXTRACT_BE_U_4(cp + RRCP_VENDOR_ID_OFFSET), - EXTRACT_BE_U_2(cp + RRCP_CHIP_ID_OFFSET))); + EXTRACT_BE_U_2(cp + RRCP_CHIP_ID_OFFSET)); }else if (rrcp_opcode==1 || rrcp_opcode==2 || rrcp_proto==2){ ND_TCHECK_4(cp + RRCP_COOKIE2_OFFSET); - ND_PRINT((ndo, ", cookie=0x%08x%08x ", + ND_PRINT(", cookie=0x%08x%08x ", EXTRACT_BE_U_4(cp + RRCP_COOKIE2_OFFSET), - EXTRACT_BE_U_4(cp + RRCP_COOKIE1_OFFSET))); + EXTRACT_BE_U_4(cp + RRCP_COOKIE1_OFFSET)); } return; trunc: - ND_PRINT((ndo, "[|rrcp]")); + ND_PRINT("[|rrcp]"); } diff --git a/print-rsvp.c b/print-rsvp.c index c87796f7..8d89abf4 100644 --- a/print-rsvp.c +++ b/print-rsvp.c @@ -506,11 +506,11 @@ rsvp_intserv_print(netdissect_options *ndo, ND_TCHECK_2(tptr + 2); parameter_length = EXTRACT_BE_U_2(tptr + 2)<<2; /* convert wordcount to bytecount */ - ND_PRINT((ndo, "\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]", + ND_PRINT("\n\t Parameter ID: %s (%u), length: %u, Flags: [0x%02x]", tok2str(rsvp_intserv_parameter_id_values,"unknown",parameter_id), parameter_id, parameter_length, - EXTRACT_U_1(tptr + 1))); + EXTRACT_U_1(tptr + 1)); if (obj_tlen < parameter_length+4) return 0; @@ -526,7 +526,7 @@ rsvp_intserv_print(netdissect_options *ndo, */ if (parameter_length == 4) { ND_TCHECK_4(tptr + 4); - ND_PRINT((ndo, "\n\t\tIS hop count: %u", EXTRACT_BE_U_4(tptr + 4))); + ND_PRINT("\n\t\tIS hop count: %u", EXTRACT_BE_U_4(tptr + 4)); } break; @@ -541,7 +541,7 @@ rsvp_intserv_print(netdissect_options *ndo, if (parameter_length == 4) { ND_TCHECK_4(tptr + 4); bw.i = EXTRACT_BE_U_4(tptr + 4); - ND_PRINT((ndo, "\n\t\tPath b/w estimate: %.10g Mbps", bw.f / 125000)); + ND_PRINT("\n\t\tPath b/w estimate: %.10g Mbps", bw.f / 125000); } break; @@ -555,11 +555,11 @@ rsvp_intserv_print(netdissect_options *ndo, */ if (parameter_length == 4) { ND_TCHECK_4(tptr + 4); - ND_PRINT((ndo, "\n\t\tMinimum path latency: ")); + ND_PRINT("\n\t\tMinimum path latency: "); if (EXTRACT_BE_U_4(tptr + 4) == 0xffffffff) - ND_PRINT((ndo, "don't care")); + ND_PRINT("don't care"); else - ND_PRINT((ndo, "%u", EXTRACT_BE_U_4(tptr + 4))); + ND_PRINT("%u", EXTRACT_BE_U_4(tptr + 4)); } break; @@ -574,7 +574,7 @@ rsvp_intserv_print(netdissect_options *ndo, */ if (parameter_length == 4) { ND_TCHECK_4(tptr + 4); - ND_PRINT((ndo, "\n\t\tComposed MTU: %u bytes", EXTRACT_BE_U_4(tptr + 4))); + ND_PRINT("\n\t\tComposed MTU: %u bytes", EXTRACT_BE_U_4(tptr + 4)); } break; case 127: @@ -597,13 +597,13 @@ rsvp_intserv_print(netdissect_options *ndo, if (parameter_length == 20) { ND_TCHECK_LEN(tptr + 4, 20); bw.i = EXTRACT_BE_U_4(tptr + 4); - ND_PRINT((ndo, "\n\t\tToken Bucket Rate: %.10g Mbps", bw.f / 125000)); + ND_PRINT("\n\t\tToken Bucket Rate: %.10g Mbps", bw.f / 125000); bw.i = EXTRACT_BE_U_4(tptr + 8); - ND_PRINT((ndo, "\n\t\tToken Bucket Size: %.10g bytes", bw.f)); + ND_PRINT("\n\t\tToken Bucket Size: %.10g bytes", bw.f); bw.i = EXTRACT_BE_U_4(tptr + 12); - ND_PRINT((ndo, "\n\t\tPeak Data Rate: %.10g Mbps", bw.f / 125000)); - ND_PRINT((ndo, "\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_BE_U_4(tptr + 16))); - ND_PRINT((ndo, "\n\t\tMaximum Packet Size: %u bytes", EXTRACT_BE_U_4(tptr + 20))); + ND_PRINT("\n\t\tPeak Data Rate: %.10g Mbps", bw.f / 125000); + ND_PRINT("\n\t\tMinimum Policed Unit: %u bytes", EXTRACT_BE_U_4(tptr + 16)); + ND_PRINT("\n\t\tMaximum Packet Size: %u bytes", EXTRACT_BE_U_4(tptr + 20)); } break; @@ -621,8 +621,8 @@ rsvp_intserv_print(netdissect_options *ndo, if (parameter_length == 8) { ND_TCHECK_8(tptr + 4); bw.i = EXTRACT_BE_U_4(tptr + 4); - ND_PRINT((ndo, "\n\t\tRate: %.10g Mbps", bw.f / 125000)); - ND_PRINT((ndo, "\n\t\tSlack Term: %u", EXTRACT_BE_U_4(tptr + 8))); + ND_PRINT("\n\t\tRate: %.10g Mbps", bw.f / 125000); + ND_PRINT("\n\t\tSlack Term: %u", EXTRACT_BE_U_4(tptr + 8)); } break; @@ -632,7 +632,7 @@ rsvp_intserv_print(netdissect_options *ndo, case 136: if (parameter_length == 4) { ND_TCHECK_4(tptr + 4); - ND_PRINT((ndo, "\n\t\tValue: %u", EXTRACT_BE_U_4(tptr + 4))); + ND_PRINT("\n\t\tValue: %u", EXTRACT_BE_U_4(tptr + 4)); } break; @@ -643,7 +643,7 @@ rsvp_intserv_print(netdissect_options *ndo, return (parameter_length+4); /* header length 4 bytes */ trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return 0; } @@ -693,17 +693,17 @@ rsvp_obj_print(netdissect_options *ndo, rsvp_obj_ctype=EXTRACT_U_1(rsvp_obj_header->ctype); if(rsvp_obj_len % 4) { - ND_PRINT((ndo, "%sERROR: object header size %u not a multiple of 4", indent, rsvp_obj_len)); + ND_PRINT("%sERROR: object header size %u not a multiple of 4", indent, rsvp_obj_len); return -1; } if(rsvp_obj_len < sizeof(struct rsvp_object_header)) { - ND_PRINT((ndo, "%sERROR: object header too short %u < %lu", indent, rsvp_obj_len, - (unsigned long)sizeof(struct rsvp_object_header))); + ND_PRINT("%sERROR: object header too short %u < %lu", indent, rsvp_obj_len, + (unsigned long)sizeof(struct rsvp_object_header)); return -1; } rsvp_obj_class_num = EXTRACT_U_1(rsvp_obj_header->class_num); - ND_PRINT((ndo, "%s%s Object (%u) Flags: [%s", + ND_PRINT("%s%s Object (%u) Flags: [%s", indent, tok2str(rsvp_obj_values, "Unknown", @@ -712,17 +712,17 @@ rsvp_obj_print(netdissect_options *ndo, (rsvp_obj_class_num & 0x80) ? ((rsvp_obj_class_num & 0x40) ? "ignore and forward" : "ignore silently") : - "reject")); + "reject"); - ND_PRINT((ndo, " if unknown], Class-Type: %s (%u), length: %u", + ND_PRINT(" if unknown], Class-Type: %s (%u), length: %u", tok2str(rsvp_ctype_values, "Unknown", (rsvp_obj_class_num<<8)+rsvp_obj_ctype), rsvp_obj_ctype, - rsvp_obj_len)); + rsvp_obj_len); if(tlen < rsvp_obj_len) { - ND_PRINT((ndo, "%sERROR: object goes past end of objects TLV", indent)); + ND_PRINT("%sERROR: object goes past end of objects TLV", indent); return -1; } @@ -740,28 +740,28 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_IPV4: if (obj_tlen < 8) return -1; - ND_PRINT((ndo, "%s IPv4 DestAddress: %s, Protocol ID: 0x%02x", + ND_PRINT("%s IPv4 DestAddress: %s, Protocol ID: 0x%02x", indent, ipaddr_string(ndo, obj_tptr), - EXTRACT_U_1(obj_tptr + sizeof(struct in_addr)))); - ND_PRINT((ndo, "%s Flags: [0x%02x], DestPort %u", + EXTRACT_U_1(obj_tptr + sizeof(struct in_addr))); + ND_PRINT("%s Flags: [0x%02x], DestPort %u", indent, EXTRACT_U_1((obj_tptr + 5)), - EXTRACT_BE_U_2(obj_tptr + 6))); + EXTRACT_BE_U_2(obj_tptr + 6)); obj_tlen-=8; obj_tptr+=8; break; case RSVP_CTYPE_IPV6: if (obj_tlen < 20) return -1; - ND_PRINT((ndo, "%s IPv6 DestAddress: %s, Protocol ID: 0x%02x", + ND_PRINT("%s IPv6 DestAddress: %s, Protocol ID: 0x%02x", indent, ip6addr_string(ndo, obj_tptr), - EXTRACT_U_1(obj_tptr + sizeof(struct in6_addr)))); - ND_PRINT((ndo, "%s Flags: [0x%02x], DestPort %u", + EXTRACT_U_1(obj_tptr + sizeof(struct in6_addr))); + ND_PRINT("%s Flags: [0x%02x], DestPort %u", indent, EXTRACT_U_1((obj_tptr + sizeof(struct in6_addr) + 1)), - EXTRACT_BE_U_2(obj_tptr + sizeof(struct in6_addr) + 2))); + EXTRACT_BE_U_2(obj_tptr + sizeof(struct in6_addr) + 2)); obj_tlen-=20; obj_tptr+=20; break; @@ -769,11 +769,11 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_TUNNEL_IPV6: if (obj_tlen < 36) return -1; - ND_PRINT((ndo, "%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s", + ND_PRINT("%s IPv6 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s", indent, ip6addr_string(ndo, obj_tptr), EXTRACT_BE_U_2(obj_tptr + 18), - ip6addr_string(ndo, obj_tptr + 20))); + ip6addr_string(ndo, obj_tptr + 20)); obj_tlen-=36; obj_tptr+=36; break; @@ -781,22 +781,22 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_14: /* IPv6 p2mp LSP Tunnel */ if (obj_tlen < 26) return -1; - ND_PRINT((ndo, "%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s", + ND_PRINT("%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s", indent, EXTRACT_BE_U_4(obj_tptr), EXTRACT_BE_U_2(obj_tptr + 6), - ip6addr_string(ndo, obj_tptr + 8))); + ip6addr_string(ndo, obj_tptr + 8)); obj_tlen-=26; obj_tptr+=26; break; case RSVP_CTYPE_13: /* IPv4 p2mp LSP Tunnel */ if (obj_tlen < 12) return -1; - ND_PRINT((ndo, "%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s", + ND_PRINT("%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s", indent, ipaddr_string(ndo, obj_tptr), EXTRACT_BE_U_2(obj_tptr + 6), - ipaddr_string(ndo, obj_tptr + 8))); + ipaddr_string(ndo, obj_tptr + 8)); obj_tlen-=12; obj_tptr+=12; break; @@ -804,11 +804,11 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_UNI_IPV4: if (obj_tlen < 12) return -1; - ND_PRINT((ndo, "%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s", + ND_PRINT("%s IPv4 Tunnel EndPoint: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s", indent, ipaddr_string(ndo, obj_tptr), EXTRACT_BE_U_2(obj_tptr + 6), - ipaddr_string(ndo, obj_tptr + 8))); + ipaddr_string(ndo, obj_tptr + 8)); obj_tlen-=12; obj_tptr+=12; break; @@ -822,18 +822,18 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_IPV4: if (obj_tlen < sizeof(struct in_addr)) return -1; - ND_PRINT((ndo, "%s IPv4 Receiver Address: %s", + ND_PRINT("%s IPv4 Receiver Address: %s", indent, - ipaddr_string(ndo, obj_tptr))); + ipaddr_string(ndo, obj_tptr)); obj_tlen-=sizeof(struct in_addr); obj_tptr+=sizeof(struct in_addr); break; case RSVP_CTYPE_IPV6: if (obj_tlen < sizeof(struct in6_addr)) return -1; - ND_PRINT((ndo, "%s IPv6 Receiver Address: %s", + ND_PRINT("%s IPv6 Receiver Address: %s", indent, - ip6addr_string(ndo, obj_tptr))); + ip6addr_string(ndo, obj_tptr)); obj_tlen-=sizeof(struct in6_addr); obj_tptr+=sizeof(struct in6_addr); break; @@ -847,18 +847,18 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_IPV4: if (obj_tlen < sizeof(struct in_addr)) return -1; - ND_PRINT((ndo, "%s IPv4 Notify Node Address: %s", + ND_PRINT("%s IPv4 Notify Node Address: %s", indent, - ipaddr_string(ndo, obj_tptr))); + ipaddr_string(ndo, obj_tptr)); obj_tlen-=sizeof(struct in_addr); obj_tptr+=sizeof(struct in_addr); break; case RSVP_CTYPE_IPV6: if (obj_tlen < sizeof(struct in6_addr)) return-1; - ND_PRINT((ndo, "%s IPv6 Notify Node Address: %s", + ND_PRINT("%s IPv6 Notify Node Address: %s", indent, - ip6addr_string(ndo, obj_tptr))); + ip6addr_string(ndo, obj_tptr)); obj_tlen-=sizeof(struct in6_addr); obj_tptr+=sizeof(struct in6_addr); break; @@ -874,7 +874,7 @@ rsvp_obj_print(netdissect_options *ndo, switch(rsvp_obj_ctype) { case RSVP_CTYPE_1: while(obj_tlen >= 4 ) { - ND_PRINT((ndo, "%s Label: %u", indent, EXTRACT_BE_U_4(obj_tptr))); + ND_PRINT("%s Label: %u", indent, EXTRACT_BE_U_4(obj_tptr)); obj_tlen-=4; obj_tptr+=4; } @@ -882,21 +882,21 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_2: if (obj_tlen < 4) return-1; - ND_PRINT((ndo, "%s Generalized Label: %u", + ND_PRINT("%s Generalized Label: %u", indent, - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); obj_tlen-=4; obj_tptr+=4; break; case RSVP_CTYPE_3: if (obj_tlen < 12) return-1; - ND_PRINT((ndo, "%s Waveband ID: %u%s Start Label: %u, Stop Label: %u", + ND_PRINT("%s Waveband ID: %u%s Start Label: %u, Stop Label: %u", indent, EXTRACT_BE_U_4(obj_tptr), indent, EXTRACT_BE_U_4(obj_tptr + 4), - EXTRACT_BE_U_4(obj_tptr + 8))); + EXTRACT_BE_U_4(obj_tptr + 8)); obj_tlen-=12; obj_tptr+=12; break; @@ -910,12 +910,12 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_1: if (obj_tlen < 4) return-1; - ND_PRINT((ndo, "%s Reservation Style: %s, Flags: [0x%02x]", + ND_PRINT("%s Reservation Style: %s, Flags: [0x%02x]", indent, tok2str(rsvp_resstyle_values, "Unknown", EXTRACT_BE_U_3(obj_tptr + 1)), - EXTRACT_U_1(obj_tptr))); + EXTRACT_U_1(obj_tptr)); obj_tlen-=4; obj_tptr+=4; break; @@ -929,58 +929,58 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_IPV4: if (obj_tlen < 8) return-1; - ND_PRINT((ndo, "%s Source Address: %s, Source Port: %u", + ND_PRINT("%s Source Address: %s, Source Port: %u", indent, ipaddr_string(ndo, obj_tptr), - EXTRACT_BE_U_2(obj_tptr + 6))); + EXTRACT_BE_U_2(obj_tptr + 6)); obj_tlen-=8; obj_tptr+=8; break; case RSVP_CTYPE_IPV6: if (obj_tlen < 20) return-1; - ND_PRINT((ndo, "%s Source Address: %s, Source Port: %u", + ND_PRINT("%s Source Address: %s, Source Port: %u", indent, ip6addr_string(ndo, obj_tptr), - EXTRACT_BE_U_2(obj_tptr + 18))); + EXTRACT_BE_U_2(obj_tptr + 18)); obj_tlen-=20; obj_tptr+=20; break; case RSVP_CTYPE_13: /* IPv6 p2mp LSP tunnel */ if (obj_tlen < 40) return-1; - ND_PRINT((ndo, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x" + ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x" "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x", indent, ip6addr_string(ndo, obj_tptr), EXTRACT_BE_U_2(obj_tptr + 18), indent, ip6addr_string(ndo, obj_tptr+20), - EXTRACT_BE_U_2(obj_tptr + 38))); + EXTRACT_BE_U_2(obj_tptr + 38)); obj_tlen-=40; obj_tptr+=40; break; case RSVP_CTYPE_TUNNEL_IPV4: if (obj_tlen < 8) return-1; - ND_PRINT((ndo, "%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x", + ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP-ID: 0x%04x", indent, ipaddr_string(ndo, obj_tptr), - EXTRACT_BE_U_2(obj_tptr + 6))); + EXTRACT_BE_U_2(obj_tptr + 6)); obj_tlen-=8; obj_tptr+=8; break; case RSVP_CTYPE_12: /* IPv4 p2mp LSP tunnel */ if (obj_tlen < 16) return-1; - ND_PRINT((ndo, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x" + ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x" "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x", indent, ipaddr_string(ndo, obj_tptr), EXTRACT_BE_U_2(obj_tptr + 6), indent, ipaddr_string(ndo, obj_tptr+8), - EXTRACT_BE_U_2(obj_tptr + 12))); + EXTRACT_BE_U_2(obj_tptr + 12)); obj_tlen-=16; obj_tptr+=16; break; @@ -993,11 +993,11 @@ rsvp_obj_print(netdissect_options *ndo, switch(rsvp_obj_ctype) { case RSVP_CTYPE_1: while(obj_tlen >= 4 ) { - ND_PRINT((ndo, "%s L3 Protocol ID: %s", + ND_PRINT("%s L3 Protocol ID: %s", indent, tok2str(ethertype_values, "Unknown Protocol (0x%04x)", - EXTRACT_BE_U_2(obj_tptr + 2)))); + EXTRACT_BE_U_2(obj_tptr + 2))); obj_tlen-=4; obj_tptr+=4; } @@ -1005,50 +1005,50 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_2: if (obj_tlen < 12) return-1; - ND_PRINT((ndo, "%s L3 Protocol ID: %s", + ND_PRINT("%s L3 Protocol ID: %s", indent, tok2str(ethertype_values, "Unknown Protocol (0x%04x)", - EXTRACT_BE_U_2(obj_tptr + 2)))); - ND_PRINT((ndo, ",%s merge capability",((EXTRACT_U_1(obj_tptr + 4)) & 0x80) ? "no" : "" )); - ND_PRINT((ndo, "%s Minimum VPI/VCI: %u/%u", + EXTRACT_BE_U_2(obj_tptr + 2))); + ND_PRINT(",%s merge capability",((EXTRACT_U_1(obj_tptr + 4)) & 0x80) ? "no" : "" ); + ND_PRINT("%s Minimum VPI/VCI: %u/%u", indent, (EXTRACT_BE_U_2(obj_tptr + 4))&0xfff, - (EXTRACT_BE_U_2(obj_tptr + 6)) & 0xfff)); - ND_PRINT((ndo, "%s Maximum VPI/VCI: %u/%u", + (EXTRACT_BE_U_2(obj_tptr + 6)) & 0xfff); + ND_PRINT("%s Maximum VPI/VCI: %u/%u", indent, (EXTRACT_BE_U_2(obj_tptr + 8))&0xfff, - (EXTRACT_BE_U_2(obj_tptr + 10)) & 0xfff)); + (EXTRACT_BE_U_2(obj_tptr + 10)) & 0xfff); obj_tlen-=12; obj_tptr+=12; break; case RSVP_CTYPE_3: if (obj_tlen < 12) return-1; - ND_PRINT((ndo, "%s L3 Protocol ID: %s", + ND_PRINT("%s L3 Protocol ID: %s", indent, tok2str(ethertype_values, "Unknown Protocol (0x%04x)", - EXTRACT_BE_U_2(obj_tptr + 2)))); - ND_PRINT((ndo, "%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI", + EXTRACT_BE_U_2(obj_tptr + 2))); + ND_PRINT("%s Minimum/Maximum DLCI: %u/%u, %s%s bit DLCI", indent, (EXTRACT_BE_U_4(obj_tptr + 4))&0x7fffff, (EXTRACT_BE_U_4(obj_tptr + 8))&0x7fffff, (((EXTRACT_BE_U_2(obj_tptr + 4)>>7)&3) == 0 ) ? "10" : "", - (((EXTRACT_BE_U_2(obj_tptr + 4) >> 7) & 3) == 2 ) ? "23" : "")); + (((EXTRACT_BE_U_2(obj_tptr + 4) >> 7) & 3) == 2 ) ? "23" : ""); obj_tlen-=12; obj_tptr+=12; break; case RSVP_CTYPE_4: if (obj_tlen < 4) return-1; - ND_PRINT((ndo, "%s LSP Encoding Type: %s (%u)", + ND_PRINT("%s LSP Encoding Type: %s (%u)", indent, tok2str(gmpls_encoding_values, "Unknown", EXTRACT_U_1(obj_tptr)), - EXTRACT_U_1(obj_tptr))); - ND_PRINT((ndo, "%s Switching Type: %s (%u), Payload ID: %s (0x%04x)", + EXTRACT_U_1(obj_tptr)); + ND_PRINT("%s Switching Type: %s (%u), Payload ID: %s (0x%04x)", indent, tok2str(gmpls_switch_cap_values, "Unknown", @@ -1057,7 +1057,7 @@ rsvp_obj_print(netdissect_options *ndo, tok2str(gmpls_payload_values, "Unknown", EXTRACT_BE_U_2(obj_tptr + 2)), - EXTRACT_BE_U_2(obj_tptr + 2))); + EXTRACT_BE_U_2(obj_tptr + 2)); obj_tlen-=4; obj_tptr+=4; break; @@ -1075,19 +1075,19 @@ rsvp_obj_print(netdissect_options *ndo, ND_TCHECK_4(obj_tptr); length = EXTRACT_U_1(obj_tptr + 1); - ND_PRINT((ndo, "%s Subobject Type: %s, length %u", + ND_PRINT("%s Subobject Type: %s, length %u", indent, tok2str(rsvp_obj_xro_values, "Unknown %u", RSVP_OBJ_XRO_MASK_SUBOBJ(EXTRACT_U_1(obj_tptr))), - length)); + length); if (obj_tlen < length) { - ND_PRINT((ndo, "%s ERROR: ERO subobject length > object length", indent)); + ND_PRINT("%s ERROR: ERO subobject length > object length", indent); break; }; if (length == 0) { /* prevent infinite loops */ - ND_PRINT((ndo, "%s ERROR: zero length ERO subtype", indent)); + ND_PRINT("%s ERROR: zero length ERO subtype", indent); break; } @@ -1096,31 +1096,31 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_OBJ_XRO_IPV4: if (length != 8) { - ND_PRINT((ndo, " ERROR: length != 8")); + ND_PRINT(" ERROR: length != 8"); goto invalid; } ND_TCHECK_8(obj_tptr); prefix_length = EXTRACT_U_1(obj_tptr + 6); if (prefix_length != 32) { - ND_PRINT((ndo, " ERROR: Prefix length %u != 32", - prefix_length)); + ND_PRINT(" ERROR: Prefix length %u != 32", + prefix_length); goto invalid; } - ND_PRINT((ndo, ", %s, %s/%u, Flags: [%s]", + ND_PRINT(", %s, %s/%u, Flags: [%s]", RSVP_OBJ_XRO_MASK_LOOSE(EXTRACT_U_1(obj_tptr)) ? "Loose" : "Strict", ipaddr_string(ndo, obj_tptr+2), EXTRACT_U_1((obj_tptr + 6)), bittok2str(rsvp_obj_rro_flag_values, "none", - EXTRACT_U_1((obj_tptr + 7))))); /* rfc3209 says that this field is rsvd. */ + EXTRACT_U_1((obj_tptr + 7)))); /* rfc3209 says that this field is rsvd. */ break; case RSVP_OBJ_XRO_LABEL: if (length != 8) { - ND_PRINT((ndo, " ERROR: length != 8")); + ND_PRINT(" ERROR: length != 8"); goto invalid; } ND_TCHECK_8(obj_tptr); - ND_PRINT((ndo, ", Flags: [%s] (%#x), Class-Type: %s (%u), %u", + ND_PRINT(", Flags: [%s] (%#x), Class-Type: %s (%u), %u", bittok2str(rsvp_obj_rro_label_flag_values, "none", EXTRACT_U_1((obj_tptr + 2))), @@ -1129,7 +1129,7 @@ rsvp_obj_print(netdissect_options *ndo, "Unknown", EXTRACT_U_1((obj_tptr + 3)) + (256 * RSVP_OBJ_RRO)), EXTRACT_U_1((obj_tptr + 3)), - EXTRACT_BE_U_4(obj_tptr + 4))); + EXTRACT_BE_U_4(obj_tptr + 4)); } obj_tlen-=length; obj_tptr+=length; @@ -1146,10 +1146,10 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_2: if (obj_tlen < 8) return-1; - ND_PRINT((ndo, "%s Source Instance: 0x%08x, Destination Instance: 0x%08x", + ND_PRINT("%s Source Instance: 0x%08x, Destination Instance: 0x%08x", indent, EXTRACT_BE_U_4(obj_tptr), - EXTRACT_BE_U_4(obj_tptr + 4))); + EXTRACT_BE_U_4(obj_tptr + 4)); obj_tlen-=8; obj_tptr+=8; break; @@ -1163,10 +1163,10 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_1: if (obj_tlen < 8) return-1; - ND_PRINT((ndo, "%s Restart Time: %ums, Recovery Time: %ums", + ND_PRINT("%s Restart Time: %ums, Recovery Time: %ums", indent, EXTRACT_BE_U_4(obj_tptr), - EXTRACT_BE_U_4(obj_tptr + 4))); + EXTRACT_BE_U_4(obj_tptr + 4)); obj_tlen-=8; obj_tptr+=8; break; @@ -1183,17 +1183,17 @@ rsvp_obj_print(netdissect_options *ndo, namelen = EXTRACT_U_1(obj_tptr + 3); if (obj_tlen < 4+namelen) return-1; - ND_PRINT((ndo, "%s Session Name: ", indent)); + ND_PRINT("%s Session Name: ", indent); for (i = 0; i < namelen; i++) safeputchar(ndo, EXTRACT_U_1(obj_tptr + 4 + i)); - ND_PRINT((ndo, "%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)", + ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)", indent, EXTRACT_U_1(obj_tptr), EXTRACT_U_1(obj_tptr + 1), bittok2str(rsvp_session_attribute_flag_values, "none", EXTRACT_U_1((obj_tptr + 2))), - EXTRACT_U_1(obj_tptr + 2))); + EXTRACT_U_1(obj_tptr + 2)); obj_tlen-=4+namelen; obj_tptr+=4+namelen; break; @@ -1229,12 +1229,12 @@ rsvp_obj_print(netdissect_options *ndo, subobj_type = (EXTRACT_BE_U_2(obj_tptr + 2))>>8; af = (EXTRACT_BE_U_2(obj_tptr + 2))&0x00FF; - ND_PRINT((ndo, "%s Subobject Type: %s (%u), AF: %s (%u), length: %u", + ND_PRINT("%s Subobject Type: %s (%u), AF: %s (%u), length: %u", indent, tok2str(rsvp_obj_generalized_uni_values, "Unknown", subobj_type), subobj_type, tok2str(af_values, "Unknown", af), af, - subobj_len)); + subobj_len); /* In addition to what is explained above, the same spec does not * explicitly say that the same Length field includes the 4-octet @@ -1274,14 +1274,14 @@ rsvp_obj_print(netdissect_options *ndo, case AFNUM_INET: if (subobj_len < 8) return -1; - ND_PRINT((ndo, "%s UNI IPv4 TNA address: %s", - indent, ipaddr_string(ndo, obj_tptr + 4))); + ND_PRINT("%s UNI IPv4 TNA address: %s", + indent, ipaddr_string(ndo, obj_tptr + 4)); break; case AFNUM_INET6: if (subobj_len < 20) return -1; - ND_PRINT((ndo, "%s UNI IPv6 TNA address: %s", - indent, ip6addr_string(ndo, obj_tptr + 4))); + ND_PRINT("%s UNI IPv6 TNA address: %s", + indent, ip6addr_string(ndo, obj_tptr + 4)); break; case AFNUM_NSAP: if (subobj_len) { @@ -1304,12 +1304,12 @@ rsvp_obj_print(netdissect_options *ndo, return -1; } - ND_PRINT((ndo, "%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u", + ND_PRINT("%s U-bit: %x, Label type: %u, Logical port id: %u, Label: %u", indent, ((EXTRACT_BE_U_4(obj_tptr + 4))>>31), ((EXTRACT_BE_U_4(obj_tptr + 4))&0xFF), EXTRACT_BE_U_4(obj_tptr + 8), - EXTRACT_BE_U_4(obj_tptr + 12))); + EXTRACT_BE_U_4(obj_tptr + 12)); break; case RSVP_GEN_UNI_SUBOBJ_SERVICE_LEVEL: @@ -1317,8 +1317,8 @@ rsvp_obj_print(netdissect_options *ndo, return -1; } - ND_PRINT((ndo, "%s Service level: %u", - indent, (EXTRACT_BE_U_4(obj_tptr + 4)) >> 24)); + ND_PRINT("%s Service level: %u", + indent, (EXTRACT_BE_U_4(obj_tptr + 4)) >> 24); break; default: @@ -1347,10 +1347,10 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_IPV4: if (obj_tlen < 8) return-1; - ND_PRINT((ndo, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x", + ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x", indent, ipaddr_string(ndo, obj_tptr), - EXTRACT_BE_U_4(obj_tptr + 4))); + EXTRACT_BE_U_4(obj_tptr + 4)); obj_tlen-=8; obj_tptr+=8; if (obj_tlen) @@ -1360,10 +1360,10 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_IPV6: if (obj_tlen < 20) return-1; - ND_PRINT((ndo, "%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x", + ND_PRINT("%s Previous/Next Interface: %s, Logical Interface Handle: 0x%08x", indent, ip6addr_string(ndo, obj_tptr), - EXTRACT_BE_U_4(obj_tptr + 16))); + EXTRACT_BE_U_4(obj_tptr + 16)); obj_tlen-=20; obj_tptr+=20; hexdump=TRUE; /* unless we have a TLV parser lets just hexdump */ @@ -1378,9 +1378,9 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_1: if (obj_tlen < 4) return-1; - ND_PRINT((ndo, "%s Refresh Period: %ums", + ND_PRINT("%s Refresh Period: %ums", indent, - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); obj_tlen-=4; obj_tptr+=4; break; @@ -1397,21 +1397,21 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_2: if (obj_tlen < 4) return-1; - ND_PRINT((ndo, "%s Msg-Version: %u, length: %u", + ND_PRINT("%s Msg-Version: %u, length: %u", indent, (EXTRACT_U_1(obj_tptr) & 0xf0) >> 4, - EXTRACT_BE_U_2(obj_tptr + 2) << 2)); + EXTRACT_BE_U_2(obj_tptr + 2) << 2); obj_tptr+=4; /* get to the start of the service header */ obj_tlen-=4; while (obj_tlen >= 4) { intserv_serv_tlen=EXTRACT_BE_U_2(obj_tptr + 2)<<2; - ND_PRINT((ndo, "%s Service Type: %s (%u), break bit %sset, Service length: %u", + ND_PRINT("%s Service Type: %s (%u), break bit %sset, Service length: %u", indent, tok2str(rsvp_intserv_service_type_values,"unknown",EXTRACT_U_1((obj_tptr))), EXTRACT_U_1(obj_tptr), (EXTRACT_U_1(obj_tptr + 1)&0x80) ? "" : "not ", - intserv_serv_tlen)); + intserv_serv_tlen); obj_tptr+=4; /* get to the start of the parameter list */ obj_tlen-=4; @@ -1436,78 +1436,78 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_IPV4: if (obj_tlen < 8) return-1; - ND_PRINT((ndo, "%s Source Address: %s, Source Port: %u", + ND_PRINT("%s Source Address: %s, Source Port: %u", indent, ipaddr_string(ndo, obj_tptr), - EXTRACT_BE_U_2(obj_tptr + 6))); + EXTRACT_BE_U_2(obj_tptr + 6)); obj_tlen-=8; obj_tptr+=8; break; case RSVP_CTYPE_IPV6: if (obj_tlen < 20) return-1; - ND_PRINT((ndo, "%s Source Address: %s, Source Port: %u", + ND_PRINT("%s Source Address: %s, Source Port: %u", indent, ip6addr_string(ndo, obj_tptr), - EXTRACT_BE_U_2(obj_tptr + 18))); + EXTRACT_BE_U_2(obj_tptr + 18)); obj_tlen-=20; obj_tptr+=20; break; case RSVP_CTYPE_3: if (obj_tlen < 20) return-1; - ND_PRINT((ndo, "%s Source Address: %s, Flow Label: %u", + ND_PRINT("%s Source Address: %s, Flow Label: %u", indent, ip6addr_string(ndo, obj_tptr), - EXTRACT_BE_U_3(obj_tptr + 17))); + EXTRACT_BE_U_3(obj_tptr + 17)); obj_tlen-=20; obj_tptr+=20; break; case RSVP_CTYPE_TUNNEL_IPV6: if (obj_tlen < 20) return-1; - ND_PRINT((ndo, "%s Source Address: %s, LSP-ID: 0x%04x", + ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x", indent, ipaddr_string(ndo, obj_tptr), - EXTRACT_BE_U_2(obj_tptr + 18))); + EXTRACT_BE_U_2(obj_tptr + 18)); obj_tlen-=20; obj_tptr+=20; break; case RSVP_CTYPE_13: /* IPv6 p2mp LSP tunnel */ if (obj_tlen < 40) return-1; - ND_PRINT((ndo, "%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x" + ND_PRINT("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x" "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x", indent, ip6addr_string(ndo, obj_tptr), EXTRACT_BE_U_2(obj_tptr + 18), indent, ip6addr_string(ndo, obj_tptr+20), - EXTRACT_BE_U_2(obj_tptr + 38))); + EXTRACT_BE_U_2(obj_tptr + 38)); obj_tlen-=40; obj_tptr+=40; break; case RSVP_CTYPE_TUNNEL_IPV4: if (obj_tlen < 8) return-1; - ND_PRINT((ndo, "%s Source Address: %s, LSP-ID: 0x%04x", + ND_PRINT("%s Source Address: %s, LSP-ID: 0x%04x", indent, ipaddr_string(ndo, obj_tptr), - EXTRACT_BE_U_2(obj_tptr + 6))); + EXTRACT_BE_U_2(obj_tptr + 6)); obj_tlen-=8; obj_tptr+=8; break; case RSVP_CTYPE_12: /* IPv4 p2mp LSP tunnel */ if (obj_tlen < 16) return-1; - ND_PRINT((ndo, "%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x" + ND_PRINT("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x" "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x", indent, ipaddr_string(ndo, obj_tptr), EXTRACT_BE_U_2(obj_tptr + 6), indent, ipaddr_string(ndo, obj_tptr+8), - EXTRACT_BE_U_2(obj_tptr + 12))); + EXTRACT_BE_U_2(obj_tptr + 12)); obj_tlen-=16; obj_tptr+=16; break; @@ -1525,17 +1525,17 @@ rsvp_obj_print(netdissect_options *ndo, if (obj_tlen < sizeof(struct rsvp_obj_frr_t)) return-1; bw.i = EXTRACT_BE_U_4(obj_ptr.rsvp_obj_frr->bandwidth); - ND_PRINT((ndo, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps", + ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps", indent, obj_ptr.rsvp_obj_frr->setup_prio, obj_ptr.rsvp_obj_frr->hold_prio, obj_ptr.rsvp_obj_frr->hop_limit, - bw.f * 8 / 1000000)); - ND_PRINT((ndo, "%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x", + bw.f * 8 / 1000000); + ND_PRINT("%s Include-any: 0x%08x, Exclude-any: 0x%08x, Include-all: 0x%08x", indent, EXTRACT_BE_U_4(obj_ptr.rsvp_obj_frr->include_any), EXTRACT_BE_U_4(obj_ptr.rsvp_obj_frr->exclude_any), - EXTRACT_BE_U_4(obj_ptr.rsvp_obj_frr->include_all))); + EXTRACT_BE_U_4(obj_ptr.rsvp_obj_frr->include_all)); obj_tlen-=sizeof(struct rsvp_obj_frr_t); obj_tptr+=sizeof(struct rsvp_obj_frr_t); break; @@ -1544,16 +1544,16 @@ rsvp_obj_print(netdissect_options *ndo, if (obj_tlen < 16) return-1; bw.i = EXTRACT_BE_U_4(obj_ptr.rsvp_obj_frr->bandwidth); - ND_PRINT((ndo, "%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps", + ND_PRINT("%s Setup Priority: %u, Holding Priority: %u, Hop-limit: %u, Bandwidth: %.10g Mbps", indent, obj_ptr.rsvp_obj_frr->setup_prio, obj_ptr.rsvp_obj_frr->hold_prio, obj_ptr.rsvp_obj_frr->hop_limit, - bw.f * 8 / 1000000)); - ND_PRINT((ndo, "%s Include Colors: 0x%08x, Exclude Colors: 0x%08x", + bw.f * 8 / 1000000); + ND_PRINT("%s Include Colors: 0x%08x, Exclude Colors: 0x%08x", indent, EXTRACT_BE_U_4(obj_ptr.rsvp_obj_frr->include_any), - EXTRACT_BE_U_4(obj_ptr.rsvp_obj_frr->exclude_any))); + EXTRACT_BE_U_4(obj_ptr.rsvp_obj_frr->exclude_any)); obj_tlen-=16; obj_tptr+=16; break; @@ -1567,10 +1567,10 @@ rsvp_obj_print(netdissect_options *ndo, switch(rsvp_obj_ctype) { case RSVP_CTYPE_TUNNEL_IPV4: while(obj_tlen >= 8) { - ND_PRINT((ndo, "%s PLR-ID: %s, Avoid-Node-ID: %s", + ND_PRINT("%s PLR-ID: %s, Avoid-Node-ID: %s", indent, ipaddr_string(ndo, obj_tptr), - ipaddr_string(ndo, obj_tptr + 4))); + ipaddr_string(ndo, obj_tptr + 4)); obj_tlen-=8; obj_tptr+=8; } @@ -1584,9 +1584,9 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_OBJ_CLASSTYPE_OLD: /* fall through */ switch(rsvp_obj_ctype) { case RSVP_CTYPE_1: - ND_PRINT((ndo, "%s CT: %u", + ND_PRINT("%s CT: %u", indent, - EXTRACT_BE_U_4(obj_tptr) & 0x7)); + EXTRACT_BE_U_4(obj_tptr) & 0x7); obj_tlen-=4; obj_tptr+=4; break; @@ -1603,27 +1603,27 @@ rsvp_obj_print(netdissect_options *ndo, return-1; error_code=EXTRACT_U_1(obj_tptr + 5); error_value=EXTRACT_BE_U_2(obj_tptr + 6); - ND_PRINT((ndo, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)", + ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)", indent, ipaddr_string(ndo, obj_tptr), EXTRACT_U_1(obj_tptr + 4), indent, tok2str(rsvp_obj_error_code_values,"unknown",error_code), - error_code)); + error_code); switch (error_code) { case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING: - ND_PRINT((ndo, ", Error Value: %s (%u)", + ND_PRINT(", Error Value: %s (%u)", tok2str(rsvp_obj_error_code_routing_values,"unknown",error_value), - error_value)); + error_value); break; case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE: /* fall through */ case RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD: - ND_PRINT((ndo, ", Error Value: %s (%u)", + ND_PRINT(", Error Value: %s (%u)", tok2str(rsvp_obj_error_code_diffserv_te_values,"unknown",error_value), - error_value)); + error_value); break; default: - ND_PRINT((ndo, ", Unknown Error Value (%u)", error_value)); + ND_PRINT(", Unknown Error Value (%u)", error_value); break; } obj_tlen-=8; @@ -1635,19 +1635,19 @@ rsvp_obj_print(netdissect_options *ndo, return-1; error_code=EXTRACT_U_1(obj_tptr + 17); error_value=EXTRACT_BE_U_2(obj_tptr + 18); - ND_PRINT((ndo, "%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)", + ND_PRINT("%s Error Node Address: %s, Flags: [0x%02x]%s Error Code: %s (%u)", indent, ip6addr_string(ndo, obj_tptr), EXTRACT_U_1(obj_tptr + 16), indent, tok2str(rsvp_obj_error_code_values,"unknown",error_code), - error_code)); + error_code); switch (error_code) { case RSVP_OBJ_ERROR_SPEC_CODE_ROUTING: - ND_PRINT((ndo, ", Error Value: %s (%u)", + ND_PRINT(", Error Value: %s (%u)", tok2str(rsvp_obj_error_code_routing_values,"unknown",error_value), - error_value)); + error_value); break; default: break; @@ -1666,19 +1666,19 @@ rsvp_obj_print(netdissect_options *ndo, if (obj_tlen < 4) return-1; padbytes = EXTRACT_BE_U_2(obj_tptr + 2); - ND_PRINT((ndo, "%s TLV count: %u, padding bytes: %u", + ND_PRINT("%s TLV count: %u, padding bytes: %u", indent, EXTRACT_BE_U_2(obj_tptr), - padbytes)); + padbytes); obj_tlen-=4; obj_tptr+=4; /* loop through as long there is anything longer than the TLV header (2) */ while(obj_tlen >= 2 + padbytes) { - ND_PRINT((ndo, "%s %s TLV (0x%02x), length: %u", /* length includes header */ + ND_PRINT("%s %s TLV (0x%02x), length: %u", /* length includes header */ indent, tok2str(rsvp_obj_prop_tlv_values,"unknown",EXTRACT_U_1(obj_tptr)), EXTRACT_U_1(obj_tptr), - EXTRACT_U_1(obj_tptr + 1))); + EXTRACT_U_1(obj_tptr + 1)); if (obj_tlen < EXTRACT_U_1(obj_tptr + 1)) return-1; if (EXTRACT_U_1(obj_tptr + 1) < 2) @@ -1702,18 +1702,18 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_2: if (obj_tlen < 8) return-1; - ND_PRINT((ndo, "%s Flags [0x%02x], epoch: %u", + ND_PRINT("%s Flags [0x%02x], epoch: %u", indent, EXTRACT_U_1(obj_tptr), - EXTRACT_BE_U_3(obj_tptr + 1))); + EXTRACT_BE_U_3(obj_tptr + 1)); obj_tlen-=4; obj_tptr+=4; /* loop through as long there are no messages left */ while(obj_tlen >= 4) { - ND_PRINT((ndo, "%s Message-ID 0x%08x (%u)", + ND_PRINT("%s Message-ID 0x%08x (%u)", indent, EXTRACT_BE_U_4(obj_tptr), - EXTRACT_BE_U_4(obj_tptr))); + EXTRACT_BE_U_4(obj_tptr)); obj_tlen-=4; obj_tptr+=4; } @@ -1729,7 +1729,7 @@ rsvp_obj_print(netdissect_options *ndo, if (obj_tlen < sizeof(struct rsvp_obj_integrity_t)) return-1; obj_ptr.rsvp_obj_integrity = (const struct rsvp_obj_integrity_t *)obj_tptr; - ND_PRINT((ndo, "%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]", + ND_PRINT("%s Key-ID 0x%04x%08x, Sequence 0x%08x%08x, Flags [%s]", indent, EXTRACT_BE_U_2(obj_ptr.rsvp_obj_integrity->key_id), EXTRACT_BE_U_4(obj_ptr.rsvp_obj_integrity->key_id + 2), @@ -1737,19 +1737,19 @@ rsvp_obj_print(netdissect_options *ndo, EXTRACT_BE_U_4(obj_ptr.rsvp_obj_integrity->sequence + 4), bittok2str(rsvp_obj_integrity_flag_values, "none", - obj_ptr.rsvp_obj_integrity->flags))); - ND_PRINT((ndo, "%s MD5-sum 0x%08x%08x%08x%08x ", + obj_ptr.rsvp_obj_integrity->flags)); + ND_PRINT("%s MD5-sum 0x%08x%08x%08x%08x ", indent, EXTRACT_BE_U_4(obj_ptr.rsvp_obj_integrity->digest), EXTRACT_BE_U_4(obj_ptr.rsvp_obj_integrity->digest + 4), EXTRACT_BE_U_4(obj_ptr.rsvp_obj_integrity->digest + 8), - EXTRACT_BE_U_4(obj_ptr.rsvp_obj_integrity->digest + 12))); + EXTRACT_BE_U_4(obj_ptr.rsvp_obj_integrity->digest + 12)); sigcheck = signature_verify(ndo, pptr, plen, obj_ptr.rsvp_obj_integrity->digest, rsvp_clear_checksum, rsvp_com_header); - ND_PRINT((ndo, " (%s)", tok2str(signature_check_values, "Unknown", sigcheck))); + ND_PRINT(" (%s)", tok2str(signature_check_values, "Unknown", sigcheck)); obj_tlen+=sizeof(struct rsvp_obj_integrity_t); obj_tptr+=sizeof(struct rsvp_obj_integrity_t); @@ -1764,9 +1764,9 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_1: if (obj_tlen < 4) return-1; - ND_PRINT((ndo, "%s Flags [%s]", indent, + ND_PRINT("%s Flags [%s]", indent, bittok2str(rsvp_obj_admin_status_flag_values, "none", - EXTRACT_BE_U_4(obj_tptr)))); + EXTRACT_BE_U_4(obj_tptr))); obj_tlen-=4; obj_tptr+=4; break; @@ -1782,9 +1782,9 @@ rsvp_obj_print(netdissect_options *ndo, return-1; action = (EXTRACT_BE_U_2(obj_tptr)>>8); - ND_PRINT((ndo, "%s Action: %s (%u), Label type: %u", indent, + ND_PRINT("%s Action: %s (%u), Label type: %u", indent, tok2str(rsvp_obj_label_set_action_values, "Unknown", action), - action, ((EXTRACT_BE_U_4(obj_tptr) & 0x7F)))); + action, ((EXTRACT_BE_U_4(obj_tptr) & 0x7F))); switch (action) { case LABEL_SET_INCLUSIVE_RANGE: @@ -1793,9 +1793,9 @@ rsvp_obj_print(netdissect_options *ndo, /* only a couple of subchannels are expected */ if (obj_tlen < 12) return -1; - ND_PRINT((ndo, "%s Start range: %u, End range: %u", indent, + ND_PRINT("%s Start range: %u, End range: %u", indent, EXTRACT_BE_U_4(obj_tptr + 4), - EXTRACT_BE_U_4(obj_tptr + 8))); + EXTRACT_BE_U_4(obj_tptr + 8)); obj_tlen-=12; obj_tptr+=12; break; @@ -1805,8 +1805,8 @@ rsvp_obj_print(netdissect_options *ndo, obj_tptr+=4; subchannel = 1; while(obj_tlen >= 4 ) { - ND_PRINT((ndo, "%s Subchannel #%u: %u", indent, subchannel, - EXTRACT_BE_U_4(obj_tptr))); + ND_PRINT("%s Subchannel #%u: %u", indent, subchannel, + EXTRACT_BE_U_4(obj_tptr)); obj_tptr+=4; obj_tlen-=4; subchannel++; @@ -1824,8 +1824,8 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_IPV4: if (obj_tlen < 4) return-1; - ND_PRINT((ndo, "%s Sub-LSP destination address: %s", - indent, ipaddr_string(ndo, obj_tptr))); + ND_PRINT("%s Sub-LSP destination address: %s", + indent, ipaddr_string(ndo, obj_tptr)); obj_tlen-=4; obj_tptr+=4; @@ -1833,8 +1833,8 @@ rsvp_obj_print(netdissect_options *ndo, case RSVP_CTYPE_IPV6: if (obj_tlen < 16) return-1; - ND_PRINT((ndo, "%s Sub-LSP destination address: %s", - indent, ip6addr_string(ndo, obj_tptr))); + ND_PRINT("%s Sub-LSP destination address: %s", + indent, ip6addr_string(ndo, obj_tptr)); obj_tlen-=16; obj_tptr+=16; @@ -1868,11 +1868,11 @@ rsvp_obj_print(netdissect_options *ndo, } return 0; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); return -1; trunc: - ND_PRINT((ndo, "\n\t\t")); - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("\n\t\t"); + ND_PRINT("%s", tstr); return -1; } @@ -1895,8 +1895,8 @@ rsvp_print(netdissect_options *ndo, * Sanity checking of the header. */ if (RSVP_EXTRACT_VERSION(version_flags) != RSVP_VERSION) { - ND_PRINT((ndo, "ERROR: RSVP version %u packet not supported", - RSVP_EXTRACT_VERSION(version_flags))); + ND_PRINT("ERROR: RSVP version %u packet not supported", + RSVP_EXTRACT_VERSION(version_flags)); return; } @@ -1904,10 +1904,10 @@ rsvp_print(netdissect_options *ndo, /* in non-verbose mode just lets print the basic Message Type*/ if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "RSVPv%u %s Message, length: %u", + ND_PRINT("RSVPv%u %s Message, length: %u", RSVP_EXTRACT_VERSION(version_flags), tok2str(rsvp_msg_type_values, "unknown (%u)",msg_type), - len)); + len); return; } @@ -1915,18 +1915,18 @@ rsvp_print(netdissect_options *ndo, plen = tlen = EXTRACT_BE_U_2(rsvp_com_header->length); - ND_PRINT((ndo, "\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x", + ND_PRINT("\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x", RSVP_EXTRACT_VERSION(version_flags), tok2str(rsvp_msg_type_values, "unknown, type: %u",msg_type), msg_type, bittok2str(rsvp_header_flag_values,"none",RSVP_EXTRACT_FLAGS(version_flags)), tlen, EXTRACT_U_1(rsvp_com_header->ttl), - EXTRACT_BE_U_2(rsvp_com_header->checksum))); + EXTRACT_BE_U_2(rsvp_com_header->checksum)); if (tlen < sizeof(struct rsvp_common_header)) { - ND_PRINT((ndo, "ERROR: common header too short %u < %lu", tlen, - (unsigned long)sizeof(struct rsvp_common_header))); + ND_PRINT("ERROR: common header too short %u < %lu", tlen, + (unsigned long)sizeof(struct rsvp_common_header)); return; } @@ -1955,32 +1955,32 @@ rsvp_print(netdissect_options *ndo, * Sanity checking of the header. */ if (RSVP_EXTRACT_VERSION(version_flags) != RSVP_VERSION) { - ND_PRINT((ndo, "ERROR: RSVP version %u packet not supported", - RSVP_EXTRACT_VERSION(version_flags))); + ND_PRINT("ERROR: RSVP version %u packet not supported", + RSVP_EXTRACT_VERSION(version_flags)); return; } subplen = subtlen = EXTRACT_BE_U_2(rsvp_com_header->length); msg_type = EXTRACT_U_1(rsvp_com_header->msg_type); - ND_PRINT((ndo, "\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x", + ND_PRINT("\n\t RSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x", RSVP_EXTRACT_VERSION(version_flags), tok2str(rsvp_msg_type_values, "unknown, type: %u",msg_type), msg_type, bittok2str(rsvp_header_flag_values,"none",RSVP_EXTRACT_FLAGS(version_flags)), subtlen, EXTRACT_U_1(rsvp_com_header->ttl), - EXTRACT_BE_U_2(rsvp_com_header->checksum))); + EXTRACT_BE_U_2(rsvp_com_header->checksum)); if (subtlen < sizeof(struct rsvp_common_header)) { - ND_PRINT((ndo, "ERROR: common header too short %u < %lu", subtlen, - (unsigned long)sizeof(struct rsvp_common_header))); + ND_PRINT("ERROR: common header too short %u < %lu", subtlen, + (unsigned long)sizeof(struct rsvp_common_header)); return; } if (tlen < subtlen) { - ND_PRINT((ndo, "ERROR: common header too large %u > %u", subtlen, - tlen)); + ND_PRINT("ERROR: common header too large %u > %u", subtlen, + tlen); return; } @@ -2024,6 +2024,6 @@ rsvp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "\n\t\t")); - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("\n\t\t"); + ND_PRINT("%s", tstr); } diff --git a/print-rt6.c b/print-rt6.c index af74fa0a..52b81b9e 100644 --- a/print-rt6.c +++ b/print-rt6.c @@ -53,10 +53,10 @@ rt6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2 _U_) ND_TCHECK(dp->ip6r_segleft); len = EXTRACT_U_1(dp->ip6r_len); - ND_PRINT((ndo, "srcrt (len=%u", len)); /*)*/ + ND_PRINT("srcrt (len=%u", len); /*)*/ type = EXTRACT_U_1(dp->ip6r_type); - ND_PRINT((ndo, ", type=%u", type)); - ND_PRINT((ndo, ", segleft=%u", EXTRACT_U_1(dp->ip6r_segleft))); + ND_PRINT(", type=%u", type); + ND_PRINT(", segleft=%u", EXTRACT_U_1(dp->ip6r_segleft)); switch (type) { case IPV6_RTHDR_TYPE_0: @@ -65,8 +65,8 @@ rt6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2 _U_) ND_TCHECK(dp0->ip6r0_reserved); if (EXTRACT_BE_U_4(dp0->ip6r0_reserved) || ndo->ndo_vflag) { - ND_PRINT((ndo, ", rsv=0x%0x", - EXTRACT_BE_U_4(dp0->ip6r0_reserved))); + ND_PRINT(", rsv=0x%0x", + EXTRACT_BE_U_4(dp0->ip6r0_reserved)); } if (len % 2 == 1) @@ -77,24 +77,24 @@ rt6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2 _U_) if ((const u_char *)(addr + 1) > ep) goto trunc; - ND_PRINT((ndo, ", [%d]%s", i, ip6addr_string(ndo, addr))); + ND_PRINT(", [%d]%s", i, ip6addr_string(ndo, addr)); addr++; } /*(*/ - ND_PRINT((ndo, ") ")); + ND_PRINT(") "); return((EXTRACT_U_1(dp0->ip6r0_len) + 1) << 3); break; case IPV6_RTHDR_TYPE_4: srh = (const struct ip6_srh *)dp; - ND_PRINT((ndo, ", last-entry=%u", EXTRACT_U_1(srh->srh_last_ent))); + ND_PRINT(", last-entry=%u", EXTRACT_U_1(srh->srh_last_ent)); ND_TCHECK(srh->srh_flags); if (EXTRACT_U_1(srh->srh_flags) || ndo->ndo_vflag) { - ND_PRINT((ndo, ", flags=0x%0x", - EXTRACT_U_1(srh->srh_flags))); + ND_PRINT(", flags=0x%0x", + EXTRACT_U_1(srh->srh_flags)); } - ND_PRINT((ndo, ", tag=%x", EXTRACT_BE_U_2(srh->srh_tag))); + ND_PRINT(", tag=%x", EXTRACT_BE_U_2(srh->srh_tag)); if (len % 2 == 1) goto trunc; @@ -104,11 +104,11 @@ rt6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2 _U_) if ((const u_char *)(addr + 1) > ep) goto trunc; - ND_PRINT((ndo, ", [%d]%s", i, ip6addr_string(ndo, addr))); + ND_PRINT(", [%d]%s", i, ip6addr_string(ndo, addr)); addr++; } /*(*/ - ND_PRINT((ndo, ") ")); + ND_PRINT(") "); return((EXTRACT_U_1(srh->srh_len) + 1) << 3); break; default: @@ -117,6 +117,6 @@ rt6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2 _U_) } trunc: - ND_PRINT((ndo, "[|srcrt]")); + ND_PRINT("[|srcrt]"); return -1; } @@ -535,32 +535,32 @@ rx_print(netdissect_options *ndo, uint32_t opcode; if (!ND_TTEST_LEN(bp, sizeof(struct rx_header))) { - ND_PRINT((ndo, " [|rx] (%u)", length)); + ND_PRINT(" [|rx] (%u)", length); return; } rxh = (const struct rx_header *) bp; type = EXTRACT_U_1(rxh->type); - ND_PRINT((ndo, " rx %s", tok2str(rx_types, "type %u", type))); + ND_PRINT(" rx %s", tok2str(rx_types, "type %u", type)); flags = EXTRACT_U_1(rxh->flags); if (ndo->ndo_vflag) { int firstflag = 0; if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, " cid %08x call# %u", + ND_PRINT(" cid %08x call# %u", EXTRACT_BE_U_4(rxh->cid), - EXTRACT_BE_U_4(rxh->callNumber))); + EXTRACT_BE_U_4(rxh->callNumber)); - ND_PRINT((ndo, " seq %u ser %u", + ND_PRINT(" seq %u ser %u", EXTRACT_BE_U_4(rxh->seq), - EXTRACT_BE_U_4(rxh->serial))); + EXTRACT_BE_U_4(rxh->serial)); if (ndo->ndo_vflag > 2) - ND_PRINT((ndo, " secindex %u serviceid %hu", + ND_PRINT(" secindex %u serviceid %hu", EXTRACT_U_1(rxh->securityIndex), - EXTRACT_BE_U_2(rxh->serviceId))); + EXTRACT_BE_U_2(rxh->serviceId)); if (ndo->ndo_vflag > 1) for (i = 0; i < NUM_RX_FLAGS; i++) { @@ -569,11 +569,11 @@ rx_print(netdissect_options *ndo, type == rx_flags[i].packetType)) { if (!firstflag) { firstflag = 1; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); } else { - ND_PRINT((ndo, ",")); + ND_PRINT(","); } - ND_PRINT((ndo, "<%s>", rx_flags[i].s)); + ND_PRINT("<%s>", rx_flags[i].s); } } } @@ -674,7 +674,7 @@ rx_print(netdissect_options *ndo, rx_ack_print(ndo, bp, length); - ND_PRINT((ndo, " (%u)", length)); + ND_PRINT(" (%u)", length); } /* @@ -760,7 +760,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, bp += sizeof(uint32_t); \ n3 = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ - ND_PRINT((ndo, " fid %u/%u/%u", n1, n2, n3)); \ + ND_PRINT(" fid %u/%u/%u", n1, n2, n3); \ } #define STROUT(MAX) { uint32_t _i; \ @@ -769,10 +769,10 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, if (_i > (MAX)) \ goto trunc; \ bp += sizeof(uint32_t); \ - ND_PRINT((ndo, " \"")); \ + ND_PRINT(" \""); \ if (fn_printn(ndo, bp, _i, ndo->ndo_snapend)) \ goto trunc; \ - ND_PRINT((ndo, "\"")); \ + ND_PRINT("\""); \ bp += ((_i + sizeof(uint32_t) - 1) / sizeof(uint32_t)) * sizeof(uint32_t); \ } @@ -780,21 +780,21 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, ND_TCHECK_4(bp); \ _i = EXTRACT_BE_S_4(bp); \ bp += sizeof(int32_t); \ - ND_PRINT((ndo, " %d", _i)); \ + ND_PRINT(" %d", _i); \ } #define UINTOUT() { uint32_t _i; \ ND_TCHECK_4(bp); \ _i = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ - ND_PRINT((ndo, " %u", _i)); \ + ND_PRINT(" %u", _i); \ } #define UINT64OUT() { uint64_t _i; \ ND_TCHECK_LEN(bp, sizeof(uint64_t)); \ _i = EXTRACT_BE_U_8(bp); \ bp += sizeof(uint64_t); \ - ND_PRINT((ndo, " %" PRIu64, _i)); \ + ND_PRINT(" %" PRIu64, _i); \ } #define DATEOUT() { time_t _t; struct tm *tm; char str[256]; \ @@ -803,25 +803,25 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, bp += sizeof(int32_t); \ tm = localtime(&_t); \ strftime(str, 256, "%Y/%m/%d %H:%M:%S", tm); \ - ND_PRINT((ndo, " %s", str)); \ + ND_PRINT(" %s", str); \ } #define STOREATTROUT() { uint32_t mask, _i; \ ND_TCHECK_LEN(bp, (sizeof(uint32_t) * 6)); \ mask = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); \ - if (mask) ND_PRINT((ndo, " StoreStatus")); \ - if (mask & 1) { ND_PRINT((ndo, " date")); DATEOUT(); } \ + if (mask) ND_PRINT(" StoreStatus"); \ + if (mask & 1) { ND_PRINT(" date"); DATEOUT(); } \ else bp += sizeof(uint32_t); \ _i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); \ - if (mask & 2) ND_PRINT((ndo, " owner %u", _i)); \ + if (mask & 2) ND_PRINT(" owner %u", _i); \ _i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); \ - if (mask & 4) ND_PRINT((ndo, " group %u", _i)); \ + if (mask & 4) ND_PRINT(" group %u", _i); \ _i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); \ - if (mask & 8) ND_PRINT((ndo, " mode %o", _i & 07777)); \ + if (mask & 8) ND_PRINT(" mode %o", _i & 07777); \ _i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); \ - if (mask & 16) ND_PRINT((ndo, " segsize %u", _i)); \ + if (mask & 16) ND_PRINT(" segsize %u", _i); \ /* undocumented in 3.3 docu */ \ - if (mask & 1024) ND_PRINT((ndo, " fsync")); \ + if (mask & 1024) ND_PRINT(" fsync"); \ } #define UBIK_VERSIONOUT() {uint32_t epoch; uint32_t counter; \ @@ -830,24 +830,24 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, bp += sizeof(uint32_t); \ counter = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ - ND_PRINT((ndo, " %u.%u", epoch, counter)); \ + ND_PRINT(" %u.%u", epoch, counter); \ } #define AFSUUIDOUT() {uint32_t temp; int _i; \ ND_TCHECK_LEN(bp, 11 * sizeof(uint32_t)); \ temp = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ - ND_PRINT((ndo, " %08x", temp)); \ + ND_PRINT(" %08x", temp); \ temp = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ - ND_PRINT((ndo, "%04x", temp)); \ + ND_PRINT("%04x", temp); \ temp = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ - ND_PRINT((ndo, "%04x", temp)); \ + ND_PRINT("%04x", temp); \ for (_i = 0; _i < 8; _i++) { \ temp = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ - ND_PRINT((ndo, "%02x", (unsigned char) temp)); \ + ND_PRINT("%02x", (unsigned char) temp); \ } \ } @@ -867,9 +867,9 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, bp += sizeof(uint32_t); \ } \ s[(MAX)] = '\0'; \ - ND_PRINT((ndo, " \"")); \ + ND_PRINT(" \""); \ fn_print(ndo, s, NULL); \ - ND_PRINT((ndo, "\"")); \ + ND_PRINT("\""); \ } #define DESTSERVEROUT() { uint32_t n1, n2, n3; \ @@ -880,7 +880,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport, bp += sizeof(uint32_t); \ n3 = EXTRACT_BE_U_4(bp); \ bp += sizeof(uint32_t); \ - ND_PRINT((ndo, " server %u:%u:%u", n1, n2, n3)); \ + ND_PRINT(" server %u:%u:%u", n1, n2, n3); \ } /* @@ -905,7 +905,7 @@ fs_print(netdissect_options *ndo, ND_TCHECK_4(bp + sizeof(struct rx_header)); fs_op = EXTRACT_BE_U_4(bp + sizeof(struct rx_header)); - ND_PRINT((ndo, " fs call %s", tok2str(fs_req, "op#%u", fs_op))); + ND_PRINT(" fs call %s", tok2str(fs_req, "op#%u", fs_op)); /* * Print out arguments to some of the AFS calls. This stuff is @@ -921,9 +921,9 @@ fs_print(netdissect_options *ndo, switch (fs_op) { case 130: /* Fetch data */ FIDOUT(); - ND_PRINT((ndo, " offset")); + ND_PRINT(" offset"); UINTOUT(); - ND_PRINT((ndo, " length")); + ND_PRINT(" length"); UINTOUT(); break; case 131: /* Fetch ACL */ @@ -943,11 +943,11 @@ fs_print(netdissect_options *ndo, case 133: /* Store data */ FIDOUT(); STOREATTROUT(); - ND_PRINT((ndo, " offset")); + ND_PRINT(" offset"); UINTOUT(); - ND_PRINT((ndo, " length")); + ND_PRINT(" length"); UINTOUT(); - ND_PRINT((ndo, " flen")); + ND_PRINT(" flen"); UINTOUT(); break; case 134: /* Store ACL */ @@ -976,23 +976,23 @@ fs_print(netdissect_options *ndo, STROUT(AFSNAMEMAX); break; case 138: /* Rename file */ - ND_PRINT((ndo, " old")); + ND_PRINT(" old"); FIDOUT(); STROUT(AFSNAMEMAX); - ND_PRINT((ndo, " new")); + ND_PRINT(" new"); FIDOUT(); STROUT(AFSNAMEMAX); break; case 139: /* Symlink */ FIDOUT(); STROUT(AFSNAMEMAX); - ND_PRINT((ndo, " link to")); + ND_PRINT(" link to"); STROUT(AFSNAMEMAX); break; case 140: /* Link */ FIDOUT(); STROUT(AFSNAMEMAX); - ND_PRINT((ndo, " link to")); + ND_PRINT(" link to"); FIDOUT(); break; case 148: /* Get volume info */ @@ -1000,11 +1000,11 @@ fs_print(netdissect_options *ndo, break; case 149: /* Get volume stats */ case 150: /* Set volume stats */ - ND_PRINT((ndo, " volid")); + ND_PRINT(" volid"); UINTOUT(); break; case 154: /* New get volume info */ - ND_PRINT((ndo, " volname")); + ND_PRINT(" volname"); STROUT(AFSNAMEMAX); break; case 155: /* Bulk stat */ @@ -1018,30 +1018,30 @@ fs_print(netdissect_options *ndo, for (i = 0; i < j; i++) { FIDOUT(); if (i != j - 1) - ND_PRINT((ndo, ",")); + ND_PRINT(","); } if (j == 0) - ND_PRINT((ndo, " <none!>")); + ND_PRINT(" <none!>"); } case 65537: /* Fetch data 64 */ FIDOUT(); - ND_PRINT((ndo, " offset")); + ND_PRINT(" offset"); UINT64OUT(); - ND_PRINT((ndo, " length")); + ND_PRINT(" length"); UINT64OUT(); break; case 65538: /* Store data 64 */ FIDOUT(); STOREATTROUT(); - ND_PRINT((ndo, " offset")); + ND_PRINT(" offset"); UINT64OUT(); - ND_PRINT((ndo, " length")); + ND_PRINT(" length"); UINT64OUT(); - ND_PRINT((ndo, " flen")); + ND_PRINT(" flen"); UINT64OUT(); break; case 65541: /* CallBack rx conn address */ - ND_PRINT((ndo, " addr")); + ND_PRINT(" addr"); UINTOUT(); default: ; @@ -1050,7 +1050,7 @@ fs_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " [|fs]")); + ND_PRINT(" [|fs]"); } /* @@ -1075,7 +1075,7 @@ fs_reply_print(netdissect_options *ndo, * gleaned from fsint/afsint.xg */ - ND_PRINT((ndo, " fs reply %s", tok2str(fs_req, "op#%u", opcode))); + ND_PRINT(" fs reply %s", tok2str(fs_req, "op#%u", opcode)); type = EXTRACT_U_1(rxh->type); bp += sizeof(struct rx_header); @@ -1101,11 +1101,11 @@ fs_reply_print(netdissect_options *ndo, } case 137: /* Create file */ case 141: /* MakeDir */ - ND_PRINT((ndo, " new")); + ND_PRINT(" new"); FIDOUT(); break; case 151: /* Get root volume */ - ND_PRINT((ndo, " root volume")); + ND_PRINT(" root volume"); STROUT(AFSNAMEMAX); break; case 153: /* Get time */ @@ -1124,15 +1124,15 @@ fs_reply_print(netdissect_options *ndo, errcode = EXTRACT_BE_S_4(bp); bp += sizeof(int32_t); - ND_PRINT((ndo, " error %s", tok2str(afs_fs_errors, "#%d", errcode))); + ND_PRINT(" error %s", tok2str(afs_fs_errors, "#%d", errcode)); } else { - ND_PRINT((ndo, " strange fs reply of type %u", type)); + ND_PRINT(" strange fs reply of type %u", type); } return; trunc: - ND_PRINT((ndo, " [|fs]")); + ND_PRINT(" [|fs]"); } /* @@ -1174,25 +1174,25 @@ acl_print(netdissect_options *ndo, */ #define ACLOUT(acl) \ - ND_PRINT((ndo, "%s%s%s%s%s%s%s", \ + ND_PRINT("%s%s%s%s%s%s%s", \ acl & PRSFS_READ ? "r" : "", \ acl & PRSFS_LOOKUP ? "l" : "", \ acl & PRSFS_INSERT ? "i" : "", \ acl & PRSFS_DELETE ? "d" : "", \ acl & PRSFS_WRITE ? "w" : "", \ acl & PRSFS_LOCK ? "k" : "", \ - acl & PRSFS_ADMINISTER ? "a" : "")); + acl & PRSFS_ADMINISTER ? "a" : ""); for (i = 0; i < pos; i++) { snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1); if (sscanf((char *) s, fmt, user, &acl, &n) != 2) goto finish; s += n; - ND_PRINT((ndo, " +{")); + ND_PRINT(" +{"); fn_print(ndo, (u_char *)user, NULL); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); ACLOUT(acl); - ND_PRINT((ndo, "}")); + ND_PRINT("}"); if (s > end) goto finish; } @@ -1202,11 +1202,11 @@ acl_print(netdissect_options *ndo, if (sscanf((char *) s, fmt, user, &acl, &n) != 2) goto finish; s += n; - ND_PRINT((ndo, " -{")); + ND_PRINT(" -{"); fn_print(ndo, (u_char *)user, NULL); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); ACLOUT(acl); - ND_PRINT((ndo, "}")); + ND_PRINT("}"); if (s > end) goto finish; } @@ -1240,7 +1240,7 @@ cb_print(netdissect_options *ndo, ND_TCHECK_4(bp + sizeof(struct rx_header)); cb_op = EXTRACT_BE_U_4(bp + sizeof(struct rx_header)); - ND_PRINT((ndo, " cb call %s", tok2str(cb_req, "op#%u", cb_op))); + ND_PRINT(" cb call %s", tok2str(cb_req, "op#%u", cb_op)); bp += sizeof(struct rx_header) + 4; @@ -1260,23 +1260,23 @@ cb_print(netdissect_options *ndo, for (i = 0; i < j; i++) { FIDOUT(); if (i != j - 1) - ND_PRINT((ndo, ",")); + ND_PRINT(","); } if (j == 0) - ND_PRINT((ndo, " <none!>")); + ND_PRINT(" <none!>"); ND_TCHECK_4(bp); j = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); if (j != 0) - ND_PRINT((ndo, ";")); + ND_PRINT(";"); for (i = 0; i < j; i++) { - ND_PRINT((ndo, " ver")); + ND_PRINT(" ver"); INTOUT(); - ND_PRINT((ndo, " expires")); + ND_PRINT(" expires"); DATEOUT(); ND_TCHECK_4(bp); t = EXTRACT_BE_U_4(bp); @@ -1285,7 +1285,7 @@ cb_print(netdissect_options *ndo, } } case 214: { - ND_PRINT((ndo, " afsuuid")); + ND_PRINT(" afsuuid"); AFSUUIDOUT(); break; } @@ -1296,7 +1296,7 @@ cb_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " [|cb]")); + ND_PRINT(" [|cb]"); } /* @@ -1320,7 +1320,7 @@ cb_reply_print(netdissect_options *ndo, * gleaned from fsint/afscbint.xg */ - ND_PRINT((ndo, " cb reply %s", tok2str(cb_req, "op#%u", opcode))); + ND_PRINT(" cb reply %s", tok2str(cb_req, "op#%u", opcode)); type = EXTRACT_U_1(rxh->type); bp += sizeof(struct rx_header); @@ -1341,14 +1341,14 @@ cb_reply_print(netdissect_options *ndo, /* * Otherwise, just print out the return code */ - ND_PRINT((ndo, " errcode")); + ND_PRINT(" errcode"); INTOUT(); } return; trunc: - ND_PRINT((ndo, " [|cb]")); + ND_PRINT(" [|cb]"); } /* @@ -1373,14 +1373,14 @@ prot_print(netdissect_options *ndo, ND_TCHECK_4(bp + sizeof(struct rx_header)); pt_op = EXTRACT_BE_U_4(bp + sizeof(struct rx_header)); - ND_PRINT((ndo, " pt")); + ND_PRINT(" pt"); if (is_ubik(pt_op)) { ubik_print(ndo, bp); return; } - ND_PRINT((ndo, " call %s", tok2str(pt_req, "op#%u", pt_op))); + ND_PRINT(" call %s", tok2str(pt_req, "op#%u", pt_op)); /* * Decode some of the arguments to the PT calls @@ -1391,9 +1391,9 @@ prot_print(netdissect_options *ndo, switch (pt_op) { case 500: /* I New User */ STROUT(PRNAMEMAX); - ND_PRINT((ndo, " id")); + ND_PRINT(" id"); INTOUT(); - ND_PRINT((ndo, " oldid")); + ND_PRINT(" oldid"); INTOUT(); break; case 501: /* Where is it */ @@ -1405,19 +1405,19 @@ prot_print(netdissect_options *ndo, case 518: /* Get CPS2 */ case 519: /* Get host CPS */ case 530: /* List super groups */ - ND_PRINT((ndo, " id")); + ND_PRINT(" id"); INTOUT(); break; case 502: /* Dump entry */ - ND_PRINT((ndo, " pos")); + ND_PRINT(" pos"); INTOUT(); break; case 503: /* Add to group */ case 507: /* Remove from group */ case 515: /* Is a member of? */ - ND_PRINT((ndo, " uid")); + ND_PRINT(" uid"); INTOUT(); - ND_PRINT((ndo, " gid")); + ND_PRINT(" gid"); INTOUT(); break; case 504: /* Name to ID */ @@ -1438,46 +1438,46 @@ prot_print(netdissect_options *ndo, VECOUT(PRNAMEMAX); } if (j == 0) - ND_PRINT((ndo, " <none!>")); + ND_PRINT(" <none!>"); } break; case 505: /* Id to name */ { uint32_t j; - ND_PRINT((ndo, " ids:")); + ND_PRINT(" ids:"); ND_TCHECK_4(bp); i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); for (j = 0; j < i; j++) INTOUT(); if (j == 0) - ND_PRINT((ndo, " <none!>")); + ND_PRINT(" <none!>"); } break; case 509: /* New entry */ STROUT(PRNAMEMAX); - ND_PRINT((ndo, " flag")); + ND_PRINT(" flag"); INTOUT(); - ND_PRINT((ndo, " oid")); + ND_PRINT(" oid"); INTOUT(); break; case 511: /* Set max */ - ND_PRINT((ndo, " id")); + ND_PRINT(" id"); INTOUT(); - ND_PRINT((ndo, " gflag")); + ND_PRINT(" gflag"); INTOUT(); break; case 513: /* Change entry */ - ND_PRINT((ndo, " id")); + ND_PRINT(" id"); INTOUT(); STROUT(PRNAMEMAX); - ND_PRINT((ndo, " oldid")); + ND_PRINT(" oldid"); INTOUT(); - ND_PRINT((ndo, " newid")); + ND_PRINT(" newid"); INTOUT(); break; case 520: /* Update entry */ - ND_PRINT((ndo, " id")); + ND_PRINT(" id"); INTOUT(); STROUT(PRNAMEMAX); break; @@ -1489,7 +1489,7 @@ prot_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " [|pt]")); + ND_PRINT(" [|pt]"); } /* @@ -1515,14 +1515,14 @@ prot_reply_print(netdissect_options *ndo, * Ubik call, however. */ - ND_PRINT((ndo, " pt")); + ND_PRINT(" pt"); if (is_ubik(opcode)) { ubik_reply_print(ndo, bp, length, opcode); return; } - ND_PRINT((ndo, " reply %s", tok2str(pt_req, "op#%u", opcode))); + ND_PRINT(" reply %s", tok2str(pt_req, "op#%u", opcode)); type = EXTRACT_U_1(rxh->type); bp += sizeof(struct rx_header); @@ -1536,14 +1536,14 @@ prot_reply_print(netdissect_options *ndo, case 504: /* Name to ID */ { uint32_t j; - ND_PRINT((ndo, " ids:")); + ND_PRINT(" ids:"); ND_TCHECK_4(bp); i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); for (j = 0; j < i; j++) INTOUT(); if (j == 0) - ND_PRINT((ndo, " <none!>")); + ND_PRINT(" <none!>"); } break; case 505: /* ID to name */ @@ -1564,7 +1564,7 @@ prot_reply_print(netdissect_options *ndo, VECOUT(PRNAMEMAX); } if (j == 0) - ND_PRINT((ndo, " <none!>")); + ND_PRINT(" <none!>"); } break; case 508: /* Get CPS */ @@ -1581,13 +1581,13 @@ prot_reply_print(netdissect_options *ndo, INTOUT(); } if (j == 0) - ND_PRINT((ndo, " <none!>")); + ND_PRINT(" <none!>"); } break; case 510: /* List max */ - ND_PRINT((ndo, " maxuid")); + ND_PRINT(" maxuid"); INTOUT(); - ND_PRINT((ndo, " maxgid")); + ND_PRINT(" maxgid"); INTOUT(); break; default: @@ -1597,14 +1597,14 @@ prot_reply_print(netdissect_options *ndo, /* * Otherwise, just print out the return code */ - ND_PRINT((ndo, " errcode")); + ND_PRINT(" errcode"); INTOUT(); } return; trunc: - ND_PRINT((ndo, " [|pt]")); + ND_PRINT(" [|pt]"); } /* @@ -1629,13 +1629,13 @@ vldb_print(netdissect_options *ndo, ND_TCHECK_4(bp + sizeof(struct rx_header)); vldb_op = EXTRACT_BE_U_4(bp + sizeof(struct rx_header)); - ND_PRINT((ndo, " vldb")); + ND_PRINT(" vldb"); if (is_ubik(vldb_op)) { ubik_print(ndo, bp); return; } - ND_PRINT((ndo, " call %s", tok2str(vldb_req, "op#%u", vldb_op))); + ND_PRINT(" call %s", tok2str(vldb_req, "op#%u", vldb_op)); /* * Decode some of the arguments to the VLDB calls @@ -1654,13 +1654,13 @@ vldb_print(netdissect_options *ndo, case 508: /* Set lock */ case 509: /* Release lock */ case 518: /* Get entry by ID N */ - ND_PRINT((ndo, " volid")); + ND_PRINT(" volid"); INTOUT(); ND_TCHECK_4(bp); i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); if (i <= 2) - ND_PRINT((ndo, " type %s", voltype[i])); + ND_PRINT(" type %s", voltype[i]); break; case 504: /* Get entry by name */ case 519: /* Get entry by name N */ @@ -1669,23 +1669,23 @@ vldb_print(netdissect_options *ndo, STROUT(VLNAMEMAX); break; case 505: /* Get new vol id */ - ND_PRINT((ndo, " bump")); + ND_PRINT(" bump"); INTOUT(); break; case 506: /* Replace entry */ case 520: /* Replace entry N */ - ND_PRINT((ndo, " volid")); + ND_PRINT(" volid"); INTOUT(); ND_TCHECK_4(bp); i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); if (i <= 2) - ND_PRINT((ndo, " type %s", voltype[i])); + ND_PRINT(" type %s", voltype[i]); VECOUT(VLNAMEMAX); break; case 510: /* List entry */ case 521: /* List entry N */ - ND_PRINT((ndo, " index")); + ND_PRINT(" index"); INTOUT(); break; default: @@ -1695,7 +1695,7 @@ vldb_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " [|vldb]")); + ND_PRINT(" [|vldb]"); } /* @@ -1721,14 +1721,14 @@ vldb_reply_print(netdissect_options *ndo, * Ubik call, however. */ - ND_PRINT((ndo, " vldb")); + ND_PRINT(" vldb"); if (is_ubik(opcode)) { ubik_reply_print(ndo, bp, length, opcode); return; } - ND_PRINT((ndo, " reply %s", tok2str(vldb_req, "op#%u", opcode))); + ND_PRINT(" reply %s", tok2str(vldb_req, "op#%u", opcode)); type = EXTRACT_U_1(rxh->type); bp += sizeof(struct rx_header); @@ -1740,9 +1740,9 @@ vldb_reply_print(netdissect_options *ndo, if (type == RX_PACKET_TYPE_DATA) switch (opcode) { case 510: /* List entry */ - ND_PRINT((ndo, " count")); + ND_PRINT(" count"); INTOUT(); - ND_PRINT((ndo, " nextindex")); + ND_PRINT(" nextindex"); INTOUT(); case 503: /* Get entry by id */ case 504: /* Get entry by name */ @@ -1750,83 +1750,83 @@ vldb_reply_print(netdissect_options *ndo, VECOUT(VLNAMEMAX); ND_TCHECK_4(bp); bp += sizeof(uint32_t); - ND_PRINT((ndo, " numservers")); + ND_PRINT(" numservers"); ND_TCHECK_4(bp); nservers = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); - ND_PRINT((ndo, " %u", nservers)); - ND_PRINT((ndo, " servers")); + ND_PRINT(" %u", nservers); + ND_PRINT(" servers"); for (i = 0; i < 8; i++) { ND_TCHECK_4(bp); if (i < nservers) - ND_PRINT((ndo, " %s", - intoa(((const struct in_addr *) bp)->s_addr))); + ND_PRINT(" %s", + intoa(((const struct in_addr *) bp)->s_addr)); bp += sizeof(uint32_t); } - ND_PRINT((ndo, " partitions")); + ND_PRINT(" partitions"); for (i = 0; i < 8; i++) { ND_TCHECK_4(bp); j = EXTRACT_BE_U_4(bp); if (i < nservers && j <= 26) - ND_PRINT((ndo, " %c", 'a' + j)); + ND_PRINT(" %c", 'a' + j); else if (i < nservers) - ND_PRINT((ndo, " %u", j)); + ND_PRINT(" %u", j); bp += sizeof(uint32_t); } ND_TCHECK_LEN(bp, 8 * sizeof(uint32_t)); bp += 8 * sizeof(uint32_t); - ND_PRINT((ndo, " rwvol")); + ND_PRINT(" rwvol"); UINTOUT(); - ND_PRINT((ndo, " rovol")); + ND_PRINT(" rovol"); UINTOUT(); - ND_PRINT((ndo, " backup")); + ND_PRINT(" backup"); UINTOUT(); } break; case 505: /* Get new volume ID */ - ND_PRINT((ndo, " newvol")); + ND_PRINT(" newvol"); UINTOUT(); break; case 521: /* List entry */ case 529: /* List entry U */ - ND_PRINT((ndo, " count")); + ND_PRINT(" count"); INTOUT(); - ND_PRINT((ndo, " nextindex")); + ND_PRINT(" nextindex"); INTOUT(); case 518: /* Get entry by ID N */ case 519: /* Get entry by name N */ { uint32_t nservers, j; VECOUT(VLNAMEMAX); - ND_PRINT((ndo, " numservers")); + ND_PRINT(" numservers"); ND_TCHECK_4(bp); nservers = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); - ND_PRINT((ndo, " %u", nservers)); - ND_PRINT((ndo, " servers")); + ND_PRINT(" %u", nservers); + ND_PRINT(" servers"); for (i = 0; i < 13; i++) { ND_TCHECK_4(bp); if (i < nservers) - ND_PRINT((ndo, " %s", - intoa(((const struct in_addr *) bp)->s_addr))); + ND_PRINT(" %s", + intoa(((const struct in_addr *) bp)->s_addr)); bp += sizeof(uint32_t); } - ND_PRINT((ndo, " partitions")); + ND_PRINT(" partitions"); for (i = 0; i < 13; i++) { ND_TCHECK_4(bp); j = EXTRACT_BE_U_4(bp); if (i < nservers && j <= 26) - ND_PRINT((ndo, " %c", 'a' + j)); + ND_PRINT(" %c", 'a' + j); else if (i < nservers) - ND_PRINT((ndo, " %u", j)); + ND_PRINT(" %u", j); bp += sizeof(uint32_t); } ND_TCHECK_LEN(bp, 13 * sizeof(uint32_t)); bp += 13 * sizeof(uint32_t); - ND_PRINT((ndo, " rwvol")); + ND_PRINT(" rwvol"); UINTOUT(); - ND_PRINT((ndo, " rovol")); + ND_PRINT(" rovol"); UINTOUT(); - ND_PRINT((ndo, " backup")); + ND_PRINT(" backup"); UINTOUT(); } break; @@ -1834,15 +1834,15 @@ vldb_reply_print(netdissect_options *ndo, case 527: /* Get entry by name U */ { uint32_t nservers, j; VECOUT(VLNAMEMAX); - ND_PRINT((ndo, " numservers")); + ND_PRINT(" numservers"); ND_TCHECK_4(bp); nservers = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); - ND_PRINT((ndo, " %u", nservers)); - ND_PRINT((ndo, " servers")); + ND_PRINT(" %u", nservers); + ND_PRINT(" servers"); for (i = 0; i < 13; i++) { if (i < nservers) { - ND_PRINT((ndo, " afsuuid")); + ND_PRINT(" afsuuid"); AFSUUIDOUT(); } else { ND_TCHECK_LEN(bp, 44); @@ -1851,23 +1851,23 @@ vldb_reply_print(netdissect_options *ndo, } ND_TCHECK_LEN(bp, 4 * 13); bp += 4 * 13; - ND_PRINT((ndo, " partitions")); + ND_PRINT(" partitions"); for (i = 0; i < 13; i++) { ND_TCHECK_4(bp); j = EXTRACT_BE_U_4(bp); if (i < nservers && j <= 26) - ND_PRINT((ndo, " %c", 'a' + j)); + ND_PRINT(" %c", 'a' + j); else if (i < nservers) - ND_PRINT((ndo, " %u", j)); + ND_PRINT(" %u", j); bp += sizeof(uint32_t); } ND_TCHECK_LEN(bp, 13 * sizeof(uint32_t)); bp += 13 * sizeof(uint32_t); - ND_PRINT((ndo, " rwvol")); + ND_PRINT(" rwvol"); UINTOUT(); - ND_PRINT((ndo, " rovol")); + ND_PRINT(" rovol"); UINTOUT(); - ND_PRINT((ndo, " backup")); + ND_PRINT(" backup"); UINTOUT(); } default: @@ -1878,14 +1878,14 @@ vldb_reply_print(netdissect_options *ndo, /* * Otherwise, just print out the return code */ - ND_PRINT((ndo, " errcode")); + ND_PRINT(" errcode"); INTOUT(); } return; trunc: - ND_PRINT((ndo, " [|vldb]")); + ND_PRINT(" [|vldb]"); } /* @@ -1909,7 +1909,7 @@ kauth_print(netdissect_options *ndo, ND_TCHECK_4(bp + sizeof(struct rx_header)); kauth_op = EXTRACT_BE_U_4(bp + sizeof(struct rx_header)); - ND_PRINT((ndo, " kauth")); + ND_PRINT(" kauth"); if (is_ubik(kauth_op)) { ubik_print(ndo, bp); @@ -1917,7 +1917,7 @@ kauth_print(netdissect_options *ndo, } - ND_PRINT((ndo, " call %s", tok2str(kauth_req, "op#%u", kauth_op))); + ND_PRINT(" call %s", tok2str(kauth_req, "op#%u", kauth_op)); /* * Decode some of the arguments to the KA calls @@ -1936,7 +1936,7 @@ kauth_print(netdissect_options *ndo, case 8: /* Get entry */ case 14: /* Unlock */ case 15: /* Lock status */ - ND_PRINT((ndo, " principal")); + ND_PRINT(" principal"); STROUT(KANAMEMAX); STROUT(KANAMEMAX); break; @@ -1944,29 +1944,29 @@ kauth_print(netdissect_options *ndo, case 23: /* GetTicket */ { uint32_t i; - ND_PRINT((ndo, " kvno")); + ND_PRINT(" kvno"); INTOUT(); - ND_PRINT((ndo, " domain")); + ND_PRINT(" domain"); STROUT(KANAMEMAX); ND_TCHECK_4(bp); i = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); ND_TCHECK_LEN(bp, i); bp += i; - ND_PRINT((ndo, " principal")); + ND_PRINT(" principal"); STROUT(KANAMEMAX); STROUT(KANAMEMAX); break; } case 4: /* Set Password */ - ND_PRINT((ndo, " principal")); + ND_PRINT(" principal"); STROUT(KANAMEMAX); STROUT(KANAMEMAX); - ND_PRINT((ndo, " kvno")); + ND_PRINT(" kvno"); INTOUT(); break; case 12: /* Get password */ - ND_PRINT((ndo, " name")); + ND_PRINT(" name"); STROUT(KANAMEMAX); break; default: @@ -1976,7 +1976,7 @@ kauth_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " [|kauth]")); + ND_PRINT(" [|kauth]"); } /* @@ -2000,14 +2000,14 @@ kauth_reply_print(netdissect_options *ndo, * gleaned from kauth/kauth.rg */ - ND_PRINT((ndo, " kauth")); + ND_PRINT(" kauth"); if (is_ubik(opcode)) { ubik_reply_print(ndo, bp, length, opcode); return; } - ND_PRINT((ndo, " reply %s", tok2str(kauth_req, "op#%u", opcode))); + ND_PRINT(" reply %s", tok2str(kauth_req, "op#%u", opcode)); type = EXTRACT_U_1(rxh->type); bp += sizeof(struct rx_header); @@ -2023,14 +2023,14 @@ kauth_reply_print(netdissect_options *ndo, /* * Otherwise, just print out the return code */ - ND_PRINT((ndo, " errcode")); + ND_PRINT(" errcode"); INTOUT(); } return; trunc: - ND_PRINT((ndo, " [|kauth]")); + ND_PRINT(" [|kauth]"); } /* @@ -2054,126 +2054,126 @@ vol_print(netdissect_options *ndo, ND_TCHECK_4(bp + sizeof(struct rx_header)); vol_op = EXTRACT_BE_U_4(bp + sizeof(struct rx_header)); - ND_PRINT((ndo, " vol call %s", tok2str(vol_req, "op#%u", vol_op))); + ND_PRINT(" vol call %s", tok2str(vol_req, "op#%u", vol_op)); bp += sizeof(struct rx_header) + 4; switch (vol_op) { case 100: /* Create volume */ - ND_PRINT((ndo, " partition")); + ND_PRINT(" partition"); UINTOUT(); - ND_PRINT((ndo, " name")); + ND_PRINT(" name"); STROUT(AFSNAMEMAX); - ND_PRINT((ndo, " type")); + ND_PRINT(" type"); UINTOUT(); - ND_PRINT((ndo, " parent")); + ND_PRINT(" parent"); UINTOUT(); break; case 101: /* Delete volume */ case 107: /* Get flags */ - ND_PRINT((ndo, " trans")); + ND_PRINT(" trans"); UINTOUT(); break; case 102: /* Restore */ - ND_PRINT((ndo, " totrans")); + ND_PRINT(" totrans"); UINTOUT(); - ND_PRINT((ndo, " flags")); + ND_PRINT(" flags"); UINTOUT(); break; case 103: /* Forward */ - ND_PRINT((ndo, " fromtrans")); + ND_PRINT(" fromtrans"); UINTOUT(); - ND_PRINT((ndo, " fromdate")); + ND_PRINT(" fromdate"); DATEOUT(); DESTSERVEROUT(); - ND_PRINT((ndo, " desttrans")); + ND_PRINT(" desttrans"); INTOUT(); break; case 104: /* End trans */ - ND_PRINT((ndo, " trans")); + ND_PRINT(" trans"); UINTOUT(); break; case 105: /* Clone */ - ND_PRINT((ndo, " trans")); + ND_PRINT(" trans"); UINTOUT(); - ND_PRINT((ndo, " purgevol")); + ND_PRINT(" purgevol"); UINTOUT(); - ND_PRINT((ndo, " newtype")); + ND_PRINT(" newtype"); UINTOUT(); - ND_PRINT((ndo, " newname")); + ND_PRINT(" newname"); STROUT(AFSNAMEMAX); break; case 106: /* Set flags */ - ND_PRINT((ndo, " trans")); + ND_PRINT(" trans"); UINTOUT(); - ND_PRINT((ndo, " flags")); + ND_PRINT(" flags"); UINTOUT(); break; case 108: /* Trans create */ - ND_PRINT((ndo, " vol")); + ND_PRINT(" vol"); UINTOUT(); - ND_PRINT((ndo, " partition")); + ND_PRINT(" partition"); UINTOUT(); - ND_PRINT((ndo, " flags")); + ND_PRINT(" flags"); UINTOUT(); break; case 109: /* Dump */ case 655537: /* Get size */ - ND_PRINT((ndo, " fromtrans")); + ND_PRINT(" fromtrans"); UINTOUT(); - ND_PRINT((ndo, " fromdate")); + ND_PRINT(" fromdate"); DATEOUT(); break; case 110: /* Get n-th volume */ - ND_PRINT((ndo, " index")); + ND_PRINT(" index"); UINTOUT(); break; case 111: /* Set forwarding */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UINTOUT(); - ND_PRINT((ndo, " newsite")); + ND_PRINT(" newsite"); UINTOUT(); break; case 112: /* Get name */ case 113: /* Get status */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); break; case 114: /* Signal restore */ - ND_PRINT((ndo, " name")); + ND_PRINT(" name"); STROUT(AFSNAMEMAX); - ND_PRINT((ndo, " type")); + ND_PRINT(" type"); UINTOUT(); - ND_PRINT((ndo, " pid")); + ND_PRINT(" pid"); UINTOUT(); - ND_PRINT((ndo, " cloneid")); + ND_PRINT(" cloneid"); UINTOUT(); break; case 116: /* List volumes */ - ND_PRINT((ndo, " partition")); + ND_PRINT(" partition"); UINTOUT(); - ND_PRINT((ndo, " flags")); + ND_PRINT(" flags"); UINTOUT(); break; case 117: /* Set id types */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UINTOUT(); - ND_PRINT((ndo, " name")); + ND_PRINT(" name"); STROUT(AFSNAMEMAX); - ND_PRINT((ndo, " type")); + ND_PRINT(" type"); UINTOUT(); - ND_PRINT((ndo, " pid")); + ND_PRINT(" pid"); UINTOUT(); - ND_PRINT((ndo, " clone")); + ND_PRINT(" clone"); UINTOUT(); - ND_PRINT((ndo, " backup")); + ND_PRINT(" backup"); UINTOUT(); break; case 119: /* Partition info */ - ND_PRINT((ndo, " name")); + ND_PRINT(" name"); STROUT(AFSNAMEMAX); break; case 120: /* Reclone */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UINTOUT(); break; case 121: /* List one volume */ @@ -2181,25 +2181,25 @@ vol_print(netdissect_options *ndo, case 124: /* Extended List volumes */ case 125: /* Extended List one volume */ case 65536: /* Convert RO to RW volume */ - ND_PRINT((ndo, " partid")); + ND_PRINT(" partid"); UINTOUT(); - ND_PRINT((ndo, " volid")); + ND_PRINT(" volid"); UINTOUT(); break; case 123: /* Set date */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UINTOUT(); - ND_PRINT((ndo, " date")); + ND_PRINT(" date"); DATEOUT(); break; case 126: /* Set info */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UINTOUT(); break; case 128: /* Forward multiple */ - ND_PRINT((ndo, " fromtrans")); + ND_PRINT(" fromtrans"); UINTOUT(); - ND_PRINT((ndo, " fromdate")); + ND_PRINT(" fromdate"); DATEOUT(); { uint32_t i, j; @@ -2209,18 +2209,18 @@ vol_print(netdissect_options *ndo, for (i = 0; i < j; i++) { DESTSERVEROUT(); if (i != j - 1) - ND_PRINT((ndo, ",")); + ND_PRINT(","); } if (j == 0) - ND_PRINT((ndo, " <none!>")); + ND_PRINT(" <none!>"); } break; case 65538: /* Dump version 2 */ - ND_PRINT((ndo, " fromtrans")); + ND_PRINT(" fromtrans"); UINTOUT(); - ND_PRINT((ndo, " fromdate")); + ND_PRINT(" fromdate"); DATEOUT(); - ND_PRINT((ndo, " flags")); + ND_PRINT(" flags"); UINTOUT(); break; default: @@ -2229,7 +2229,7 @@ vol_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " [|vol]")); + ND_PRINT(" [|vol]"); } /* @@ -2253,7 +2253,7 @@ vol_reply_print(netdissect_options *ndo, * gleaned from volser/volint.xg */ - ND_PRINT((ndo, " vol reply %s", tok2str(vol_req, "op#%u", opcode))); + ND_PRINT(" vol reply %s", tok2str(vol_req, "op#%u", opcode)); type = EXTRACT_U_1(rxh->type); bp += sizeof(struct rx_header); @@ -2265,66 +2265,66 @@ vol_reply_print(netdissect_options *ndo, if (type == RX_PACKET_TYPE_DATA) { switch (opcode) { case 100: /* Create volume */ - ND_PRINT((ndo, " volid")); + ND_PRINT(" volid"); UINTOUT(); - ND_PRINT((ndo, " trans")); + ND_PRINT(" trans"); UINTOUT(); break; case 104: /* End transaction */ UINTOUT(); break; case 105: /* Clone */ - ND_PRINT((ndo, " newvol")); + ND_PRINT(" newvol"); UINTOUT(); break; case 107: /* Get flags */ UINTOUT(); break; case 108: /* Transaction create */ - ND_PRINT((ndo, " trans")); + ND_PRINT(" trans"); UINTOUT(); break; case 110: /* Get n-th volume */ - ND_PRINT((ndo, " volume")); + ND_PRINT(" volume"); UINTOUT(); - ND_PRINT((ndo, " partition")); + ND_PRINT(" partition"); UINTOUT(); break; case 112: /* Get name */ STROUT(AFSNAMEMAX); break; case 113: /* Get status */ - ND_PRINT((ndo, " volid")); + ND_PRINT(" volid"); UINTOUT(); - ND_PRINT((ndo, " nextuniq")); + ND_PRINT(" nextuniq"); UINTOUT(); - ND_PRINT((ndo, " type")); + ND_PRINT(" type"); UINTOUT(); - ND_PRINT((ndo, " parentid")); + ND_PRINT(" parentid"); UINTOUT(); - ND_PRINT((ndo, " clone")); + ND_PRINT(" clone"); UINTOUT(); - ND_PRINT((ndo, " backup")); + ND_PRINT(" backup"); UINTOUT(); - ND_PRINT((ndo, " restore")); + ND_PRINT(" restore"); UINTOUT(); - ND_PRINT((ndo, " maxquota")); + ND_PRINT(" maxquota"); UINTOUT(); - ND_PRINT((ndo, " minquota")); + ND_PRINT(" minquota"); UINTOUT(); - ND_PRINT((ndo, " owner")); + ND_PRINT(" owner"); UINTOUT(); - ND_PRINT((ndo, " create")); + ND_PRINT(" create"); DATEOUT(); - ND_PRINT((ndo, " access")); + ND_PRINT(" access"); DATEOUT(); - ND_PRINT((ndo, " update")); + ND_PRINT(" update"); DATEOUT(); - ND_PRINT((ndo, " expire")); + ND_PRINT(" expire"); DATEOUT(); - ND_PRINT((ndo, " backup")); + ND_PRINT(" backup"); DATEOUT(); - ND_PRINT((ndo, " copy")); + ND_PRINT(" copy"); DATEOUT(); break; case 115: /* Old list partitions */ @@ -2337,17 +2337,17 @@ vol_reply_print(netdissect_options *ndo, j = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); for (i = 0; i < j; i++) { - ND_PRINT((ndo, " name")); + ND_PRINT(" name"); VECOUT(32); - ND_PRINT((ndo, " volid")); + ND_PRINT(" volid"); UINTOUT(); - ND_PRINT((ndo, " type")); + ND_PRINT(" type"); bp += sizeof(uint32_t) * 21; if (i != j - 1) - ND_PRINT((ndo, ",")); + ND_PRINT(","); } if (j == 0) - ND_PRINT((ndo, " <none!>")); + ND_PRINT(" <none!>"); } break; @@ -2359,14 +2359,14 @@ vol_reply_print(netdissect_options *ndo, /* * Otherwise, just print out the return code */ - ND_PRINT((ndo, " errcode")); + ND_PRINT(" errcode"); INTOUT(); } return; trunc: - ND_PRINT((ndo, " [|vol]")); + ND_PRINT(" [|vol]"); } /* @@ -2390,7 +2390,7 @@ bos_print(netdissect_options *ndo, ND_TCHECK_4(bp + sizeof(struct rx_header)); bos_op = EXTRACT_BE_U_4(bp + sizeof(struct rx_header)); - ND_PRINT((ndo, " bos call %s", tok2str(bos_req, "op#%u", bos_op))); + ND_PRINT(" bos call %s", tok2str(bos_req, "op#%u", bos_op)); /* * Decode some of the arguments to the BOS calls @@ -2400,9 +2400,9 @@ bos_print(netdissect_options *ndo, switch (bos_op) { case 80: /* Create B node */ - ND_PRINT((ndo, " type")); + ND_PRINT(" type"); STROUT(BOSNAMEMAX); - ND_PRINT((ndo, " instance")); + ND_PRINT(" instance"); STROUT(BOSNAMEMAX); break; case 81: /* Delete B node */ @@ -2423,12 +2423,12 @@ bos_print(netdissect_options *ndo, case 82: /* Set status */ case 98: /* Set T status */ STROUT(BOSNAMEMAX); - ND_PRINT((ndo, " status")); + ND_PRINT(" status"); INTOUT(); break; case 86: /* Get instance parm */ STROUT(BOSNAMEMAX); - ND_PRINT((ndo, " num")); + ND_PRINT(" num"); INTOUT(); break; case 84: /* Enumerate instance */ @@ -2441,11 +2441,11 @@ bos_print(netdissect_options *ndo, break; case 105: /* Install */ STROUT(BOSNAMEMAX); - ND_PRINT((ndo, " size")); + ND_PRINT(" size"); INTOUT(); - ND_PRINT((ndo, " flags")); + ND_PRINT(" flags"); INTOUT(); - ND_PRINT((ndo, " date")); + ND_PRINT(" date"); INTOUT(); break; default: @@ -2455,7 +2455,7 @@ bos_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " [|bos]")); + ND_PRINT(" [|bos]"); } /* @@ -2479,7 +2479,7 @@ bos_reply_print(netdissect_options *ndo, * gleaned from volser/volint.xg */ - ND_PRINT((ndo, " bos reply %s", tok2str(bos_req, "op#%u", opcode))); + ND_PRINT(" bos reply %s", tok2str(bos_req, "op#%u", opcode)); type = EXTRACT_U_1(rxh->type); bp += sizeof(struct rx_header); @@ -2495,14 +2495,14 @@ bos_reply_print(netdissect_options *ndo, /* * Otherwise, just print out the return code */ - ND_PRINT((ndo, " errcode")); + ND_PRINT(" errcode"); INTOUT(); } return; trunc: - ND_PRINT((ndo, " [|bos]")); + ND_PRINT(" [|bos]"); } /* @@ -2541,7 +2541,7 @@ ubik_print(netdissect_options *ndo, */ ubik_op = EXTRACT_BE_U_4(bp + sizeof(struct rx_header)); - ND_PRINT((ndo, " ubik call %s", tok2str(ubik_req, "op#%u", ubik_op))); + ND_PRINT(" ubik call %s", tok2str(ubik_req, "op#%u", ubik_op)); /* * Decode some of the arguments to the Ubik calls @@ -2554,16 +2554,16 @@ ubik_print(netdissect_options *ndo, ND_TCHECK_4(bp); temp = EXTRACT_BE_U_4(bp); bp += sizeof(uint32_t); - ND_PRINT((ndo, " syncsite %s", temp ? "yes" : "no")); - ND_PRINT((ndo, " votestart")); + ND_PRINT(" syncsite %s", temp ? "yes" : "no"); + ND_PRINT(" votestart"); DATEOUT(); - ND_PRINT((ndo, " dbversion")); + ND_PRINT(" dbversion"); UBIK_VERSIONOUT(); - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UBIK_VERSIONOUT(); break; case 10003: /* Get sync site */ - ND_PRINT((ndo, " site")); + ND_PRINT(" site"); UINTOUT(); break; case 20000: /* Begin */ @@ -2571,17 +2571,17 @@ ubik_print(netdissect_options *ndo, case 20007: /* Abort */ case 20008: /* Release locks */ case 20010: /* Writev */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UBIK_VERSIONOUT(); break; case 20002: /* Lock */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UBIK_VERSIONOUT(); - ND_PRINT((ndo, " file")); + ND_PRINT(" file"); INTOUT(); - ND_PRINT((ndo, " pos")); + ND_PRINT(" pos"); INTOUT(); - ND_PRINT((ndo, " length")); + ND_PRINT(" length"); INTOUT(); ND_TCHECK_4(bp); temp = EXTRACT_BE_U_4(bp); @@ -2589,39 +2589,39 @@ ubik_print(netdissect_options *ndo, tok2str(ubik_lock_types, "type %u", temp); break; case 20003: /* Write */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UBIK_VERSIONOUT(); - ND_PRINT((ndo, " file")); + ND_PRINT(" file"); INTOUT(); - ND_PRINT((ndo, " pos")); + ND_PRINT(" pos"); INTOUT(); break; case 20005: /* Get file */ - ND_PRINT((ndo, " file")); + ND_PRINT(" file"); INTOUT(); break; case 20006: /* Send file */ - ND_PRINT((ndo, " file")); + ND_PRINT(" file"); INTOUT(); - ND_PRINT((ndo, " length")); + ND_PRINT(" length"); INTOUT(); - ND_PRINT((ndo, " dbversion")); + ND_PRINT(" dbversion"); UBIK_VERSIONOUT(); break; case 20009: /* Truncate */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UBIK_VERSIONOUT(); - ND_PRINT((ndo, " file")); + ND_PRINT(" file"); INTOUT(); - ND_PRINT((ndo, " length")); + ND_PRINT(" length"); INTOUT(); break; case 20012: /* Set version */ - ND_PRINT((ndo, " tid")); + ND_PRINT(" tid"); UBIK_VERSIONOUT(); - ND_PRINT((ndo, " oldversion")); + ND_PRINT(" oldversion"); UBIK_VERSIONOUT(); - ND_PRINT((ndo, " newversion")); + ND_PRINT(" newversion"); UBIK_VERSIONOUT(); break; default: @@ -2631,7 +2631,7 @@ ubik_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, " [|ubik]")); + ND_PRINT(" [|ubik]"); } /* @@ -2655,7 +2655,7 @@ ubik_reply_print(netdissect_options *ndo, * from ubik/ubik_int.xg */ - ND_PRINT((ndo, " ubik reply %s", tok2str(ubik_req, "op#%u", opcode))); + ND_PRINT(" ubik reply %s", tok2str(ubik_req, "op#%u", opcode)); type = EXTRACT_U_1(rxh->type); bp += sizeof(struct rx_header); @@ -2667,10 +2667,10 @@ ubik_reply_print(netdissect_options *ndo, if (type == RX_PACKET_TYPE_DATA) switch (opcode) { case 10000: /* Beacon */ - ND_PRINT((ndo, " vote no")); + ND_PRINT(" vote no"); break; case 20004: /* Get version */ - ND_PRINT((ndo, " dbversion")); + ND_PRINT(" dbversion"); UBIK_VERSIONOUT(); break; default: @@ -2686,18 +2686,18 @@ ubik_reply_print(netdissect_options *ndo, else switch (opcode) { case 10000: /* Beacon */ - ND_PRINT((ndo, " vote yes until")); + ND_PRINT(" vote yes until"); DATEOUT(); break; default: - ND_PRINT((ndo, " errcode")); + ND_PRINT(" errcode"); INTOUT(); } return; trunc: - ND_PRINT((ndo, " [|ubik]")); + ND_PRINT(" [|ubik]"); } /* @@ -2728,14 +2728,14 @@ rx_ack_print(netdissect_options *ndo, */ if (ndo->ndo_vflag > 2) - ND_PRINT((ndo, " bufspace %u maxskew %d", + ND_PRINT(" bufspace %u maxskew %d", EXTRACT_BE_U_2(rxa->bufferSpace), - EXTRACT_BE_U_2(rxa->maxSkew))); + EXTRACT_BE_U_2(rxa->maxSkew)); firstPacket = EXTRACT_BE_U_4(rxa->firstPacket); - ND_PRINT((ndo, " first %u serial %u reason %s", + ND_PRINT(" first %u serial %u reason %s", firstPacket, EXTRACT_BE_U_4(rxa->serial), - tok2str(rx_ack_reasons, "#%u", EXTRACT_U_1(rxa->reason)))); + tok2str(rx_ack_reasons, "#%u", EXTRACT_U_1(rxa->reason))); /* * Okay, now we print out the ack array. The way _this_ works @@ -2777,7 +2777,7 @@ rx_ack_print(netdissect_options *ndo, */ if (last == -2) { - ND_PRINT((ndo, " acked %u", firstPacket + i)); + ND_PRINT(" acked %u", firstPacket + i); start = i; } @@ -2791,7 +2791,7 @@ rx_ack_print(netdissect_options *ndo, */ else if (last != i - 1) { - ND_PRINT((ndo, ",%u", firstPacket + i)); + ND_PRINT(",%u", firstPacket + i); start = i; } @@ -2817,7 +2817,7 @@ rx_ack_print(netdissect_options *ndo, * range. */ } else if (last == i - 1 && start != last) - ND_PRINT((ndo, "-%u", firstPacket + i - 1)); + ND_PRINT("-%u", firstPacket + i - 1); /* * So, what's going on here? We ran off the end of the @@ -2831,7 +2831,7 @@ rx_ack_print(netdissect_options *ndo, */ if (last == i - 1 && start != last) - ND_PRINT((ndo, "-%u", firstPacket + i - 1)); + ND_PRINT("-%u", firstPacket + i - 1); /* * Same as above, just without comments @@ -2840,18 +2840,18 @@ rx_ack_print(netdissect_options *ndo, for (i = 0, start = last = -2; i < nAcks; i++) if (EXTRACT_U_1(bp + i) == RX_ACK_TYPE_NACK) { if (last == -2) { - ND_PRINT((ndo, " nacked %u", firstPacket + i)); + ND_PRINT(" nacked %u", firstPacket + i); start = i; } else if (last != i - 1) { - ND_PRINT((ndo, ",%u", firstPacket + i)); + ND_PRINT(",%u", firstPacket + i); start = i; } last = i; } else if (last == i - 1 && start != last) - ND_PRINT((ndo, "-%u", firstPacket + i - 1)); + ND_PRINT("-%u", firstPacket + i - 1); if (last == i - 1 && start != last) - ND_PRINT((ndo, "-%u", firstPacket + i - 1)); + ND_PRINT("-%u", firstPacket + i - 1); bp += nAcks; } @@ -2868,25 +2868,25 @@ rx_ack_print(netdissect_options *ndo, if (ndo->ndo_vflag > 1) { TRUNCRET(4); - ND_PRINT((ndo, " ifmtu")); + ND_PRINT(" ifmtu"); UINTOUT(); TRUNCRET(4); - ND_PRINT((ndo, " maxmtu")); + ND_PRINT(" maxmtu"); UINTOUT(); TRUNCRET(4); - ND_PRINT((ndo, " rwind")); + ND_PRINT(" rwind"); UINTOUT(); TRUNCRET(4); - ND_PRINT((ndo, " maxpackets")); + ND_PRINT(" maxpackets"); UINTOUT(); } return; trunc: - ND_PRINT((ndo, " [|ack]")); + ND_PRINT(" [|ack]"); } #undef TRUNCRET diff --git a/print-sctp.c b/print-sctp.c index 63200d49..39757666 100644 --- a/print-sctp.c +++ b/print-sctp.c @@ -465,8 +465,8 @@ sctp_print(netdissect_options *ndo, if (sctpPacketLength < sizeof(struct sctpHeader)) { - ND_PRINT((ndo, "truncated-sctp - %ld bytes missing!", - (long)(sizeof(struct sctpHeader) - sctpPacketLength))); + ND_PRINT("truncated-sctp - %ld bytes missing!", + (long)(sizeof(struct sctpHeader) - sctpPacketLength)); return; } sctpPktHdr = (const struct sctpHeader*) bp; @@ -483,26 +483,26 @@ sctp_print(netdissect_options *ndo, ip6 = NULL; if (ip6) { - ND_PRINT((ndo, "%s.%u > %s.%u: sctp", + ND_PRINT("%s.%u > %s.%u: sctp", ip6addr_string(ndo, &ip6->ip6_src), sourcePort, ip6addr_string(ndo, &ip6->ip6_dst), - destPort)); + destPort); } else { - ND_PRINT((ndo, "%s.%u > %s.%u: sctp", + ND_PRINT("%s.%u > %s.%u: sctp", ipaddr_string(ndo, &ip->ip_src), sourcePort, ipaddr_string(ndo, &ip->ip_dst), - destPort)); + destPort); } if (isForCES_port(sourcePort)) { - ND_PRINT((ndo, "[%s]", tok2str(ForCES_channels, NULL, sourcePort))); + ND_PRINT("[%s]", tok2str(ForCES_channels, NULL, sourcePort)); isforces = 1; } if (isForCES_port(destPort)) { - ND_PRINT((ndo, "[%s]", tok2str(ForCES_channels, NULL, destPort))); + ND_PRINT("[%s]", tok2str(ForCES_channels, NULL, destPort)); isforces = 1; } @@ -523,13 +523,13 @@ sctp_print(netdissect_options *ndo, chunkDescPtr = (const struct sctpChunkDesc *)bp; if (sctpPacketLengthRemaining < sizeof(*chunkDescPtr)) { - ND_PRINT((ndo, "%s%u) [chunk descriptor cut off at end of packet]", sep, chunkCount+1)); + ND_PRINT("%s%u) [chunk descriptor cut off at end of packet]", sep, chunkCount+1); break; } ND_TCHECK_SIZE(chunkDescPtr); chunkLength = EXTRACT_BE_U_2(&chunkDescPtr->chunkLength); if (chunkLength < sizeof(*chunkDescPtr)) { - ND_PRINT((ndo, "%s%u) [Bad chunk length %u, < size of chunk descriptor]", sep, chunkCount+1, chunkLength)); + ND_PRINT("%s%u) [Bad chunk length %u, < size of chunk descriptor]", sep, chunkCount+1, chunkLength); break; } chunkLengthRemaining = chunkLength; @@ -539,7 +539,7 @@ sctp_print(netdissect_options *ndo, align = 4 - align; if (sctpPacketLengthRemaining < align) { - ND_PRINT((ndo, "%s%u) [Bad chunk length %u, > remaining data in packet]", sep, chunkCount+1, chunkLength)); + ND_PRINT("%s%u) [Bad chunk length %u, > remaining data in packet]", sep, chunkCount+1, chunkLength); break; } @@ -549,10 +549,10 @@ sctp_print(netdissect_options *ndo, sctpPacketLengthRemaining -= sizeof(*chunkDescPtr); chunkLengthRemaining -= sizeof(*chunkDescPtr); - ND_PRINT((ndo, "%s%u) ", sep, chunkCount+1)); + ND_PRINT("%s%u) ", sep, chunkCount+1); chunkID = EXTRACT_U_1(chunkDescPtr->chunkID); - ND_PRINT((ndo, "[%s] ", tok2str(sctp_chunkid_str, "Unknown chunk type: 0x%x", - chunkID))); + ND_PRINT("[%s] ", tok2str(sctp_chunkid_str, "Unknown chunk type: 0x%x", + chunkID)); switch (chunkID) { case SCTP_DATA : @@ -564,31 +564,31 @@ sctp_print(netdissect_options *ndo, chunkFlg = EXTRACT_U_1(chunkDescPtr->chunkFlg); if ((chunkFlg & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED) - ND_PRINT((ndo, "(U)")); + ND_PRINT("(U)"); if ((chunkFlg & SCTP_DATA_FIRST_FRAG) == SCTP_DATA_FIRST_FRAG) - ND_PRINT((ndo, "(B)")); + ND_PRINT("(B)"); if ((chunkFlg & SCTP_DATA_LAST_FRAG) == SCTP_DATA_LAST_FRAG) - ND_PRINT((ndo, "(E)")); + ND_PRINT("(E)"); if( ((chunkFlg & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED) || ((chunkFlg & SCTP_DATA_FIRST_FRAG) == SCTP_DATA_FIRST_FRAG) || ((chunkFlg & SCTP_DATA_LAST_FRAG) == SCTP_DATA_LAST_FRAG) ) - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (chunkLengthRemaining < sizeof(*dataHdrPtr)) { - ND_PRINT((ndo, "bogus chunk length %u]", chunkLength)); + ND_PRINT("bogus chunk length %u]", chunkLength); return; } dataHdrPtr=(const struct sctpDataPart*)bp; ppid = EXTRACT_BE_U_4(&dataHdrPtr->payloadtype); - ND_PRINT((ndo, "[TSN: %u] ", EXTRACT_BE_U_4(&dataHdrPtr->TSN))); - ND_PRINT((ndo, "[SID: %u] ", EXTRACT_BE_U_2(&dataHdrPtr->streamId))); - ND_PRINT((ndo, "[SSEQ %u] ", EXTRACT_BE_U_2(&dataHdrPtr->sequence))); - ND_PRINT((ndo, "[PPID %s] ", - tok2str(PayloadProto_idents, "0x%x", ppid))); + ND_PRINT("[TSN: %u] ", EXTRACT_BE_U_4(&dataHdrPtr->TSN)); + ND_PRINT("[SID: %u] ", EXTRACT_BE_U_2(&dataHdrPtr->streamId)); + ND_PRINT("[SSEQ %u] ", EXTRACT_BE_U_2(&dataHdrPtr->sequence)); + ND_PRINT("[PPID %s] ", + tok2str(PayloadProto_idents, "0x%x", ppid)); if (!isforces) { isforces = (ppid == SCTP_PPID_FORCES_HP) || @@ -601,7 +601,7 @@ sctp_print(netdissect_options *ndo, chunkLengthRemaining -= sizeof(*dataHdrPtr); payload_size = chunkLengthRemaining; if (payload_size == 0) { - ND_PRINT((ndo, "bogus chunk length %u]", chunkLength)); + ND_PRINT("bogus chunk length %u]", chunkLength); return; } @@ -614,12 +614,12 @@ sctp_print(netdissect_options *ndo, m3ua_print(ndo, bp, payload_size); break; default: - ND_PRINT((ndo, "[Payload")); + ND_PRINT("[Payload"); if (!ndo->ndo_suppress_default_print) { - ND_PRINT((ndo, ":")); + ND_PRINT(":"); ND_DEFAULTPRINT(bp, payload_size); } - ND_PRINT((ndo, "]")); + ND_PRINT("]"); break; } } @@ -633,23 +633,23 @@ sctp_print(netdissect_options *ndo, const struct sctpInitiation *init; if (chunkLengthRemaining < sizeof(*init)) { - ND_PRINT((ndo, "bogus chunk length %u]", chunkLength)); + ND_PRINT("bogus chunk length %u]", chunkLength); return; } init=(const struct sctpInitiation*)bp; - ND_PRINT((ndo, "[init tag: %u] ", EXTRACT_BE_U_4(&init->initTag))); - ND_PRINT((ndo, "[rwnd: %u] ", EXTRACT_BE_U_4(&init->rcvWindowCredit))); - ND_PRINT((ndo, "[OS: %u] ", EXTRACT_BE_U_2(&init->NumPreopenStreams))); - ND_PRINT((ndo, "[MIS: %u] ", EXTRACT_BE_U_2(&init->MaxInboundStreams))); - ND_PRINT((ndo, "[init TSN: %u] ", EXTRACT_BE_U_4(&init->initialTSN))); + ND_PRINT("[init tag: %u] ", EXTRACT_BE_U_4(&init->initTag)); + ND_PRINT("[rwnd: %u] ", EXTRACT_BE_U_4(&init->rcvWindowCredit)); + ND_PRINT("[OS: %u] ", EXTRACT_BE_U_2(&init->NumPreopenStreams)); + ND_PRINT("[MIS: %u] ", EXTRACT_BE_U_2(&init->MaxInboundStreams)); + ND_PRINT("[init TSN: %u] ", EXTRACT_BE_U_4(&init->initialTSN)); bp += sizeof(*init); sctpPacketLengthRemaining -= sizeof(*init); chunkLengthRemaining -= sizeof(*init); #if 0 /* ALC you can add code for optional params here */ if( chunkLengthRemaining != 0 ) - ND_PRINT((ndo, " @@@@@ UNFINISHED @@@@@@%s\n", - "Optional params present, but not printed.")); + ND_PRINT(" @@@@@ UNFINISHED @@@@@@%s\n", + "Optional params present, but not printed."); #endif bp += chunkLengthRemaining; sctpPacketLengthRemaining -= chunkLengthRemaining; @@ -661,23 +661,23 @@ sctp_print(netdissect_options *ndo, const struct sctpInitiation *init; if (chunkLengthRemaining < sizeof(*init)) { - ND_PRINT((ndo, "bogus chunk length %u]", chunkLength)); + ND_PRINT("bogus chunk length %u]", chunkLength); return; } init=(const struct sctpInitiation*)bp; - ND_PRINT((ndo, "[init tag: %u] ", EXTRACT_BE_U_4(&init->initTag))); - ND_PRINT((ndo, "[rwnd: %u] ", EXTRACT_BE_U_4(&init->rcvWindowCredit))); - ND_PRINT((ndo, "[OS: %u] ", EXTRACT_BE_U_2(&init->NumPreopenStreams))); - ND_PRINT((ndo, "[MIS: %u] ", EXTRACT_BE_U_2(&init->MaxInboundStreams))); - ND_PRINT((ndo, "[init TSN: %u] ", EXTRACT_BE_U_4(&init->initialTSN))); + ND_PRINT("[init tag: %u] ", EXTRACT_BE_U_4(&init->initTag)); + ND_PRINT("[rwnd: %u] ", EXTRACT_BE_U_4(&init->rcvWindowCredit)); + ND_PRINT("[OS: %u] ", EXTRACT_BE_U_2(&init->NumPreopenStreams)); + ND_PRINT("[MIS: %u] ", EXTRACT_BE_U_2(&init->MaxInboundStreams)); + ND_PRINT("[init TSN: %u] ", EXTRACT_BE_U_4(&init->initialTSN)); bp += sizeof(*init); sctpPacketLengthRemaining -= sizeof(*init); chunkLengthRemaining -= sizeof(*init); #if 0 /* ALC you can add code for optional params here */ if( chunkLengthRemaining != 0 ) - ND_PRINT((ndo, " @@@@@ UNFINISHED @@@@@@%s\n", - "Optional params present, but not printed.")); + ND_PRINT(" @@@@@ UNFINISHED @@@@@@%s\n", + "Optional params present, but not printed."); #endif bp += chunkLengthRemaining; sctpPacketLengthRemaining -= chunkLengthRemaining; @@ -692,14 +692,14 @@ sctp_print(netdissect_options *ndo, const u_char *dupTSN; if (chunkLengthRemaining < sizeof(*sack)) { - ND_PRINT((ndo, "bogus chunk length %u]", chunkLength)); + ND_PRINT("bogus chunk length %u]", chunkLength); return; } sack=(const struct sctpSelectiveAck*)bp; - ND_PRINT((ndo, "[cum ack %u] ", EXTRACT_BE_U_4(&sack->highestConseqTSN))); - ND_PRINT((ndo, "[a_rwnd %u] ", EXTRACT_BE_U_4(&sack->updatedRwnd))); - ND_PRINT((ndo, "[#gap acks %u] ", EXTRACT_BE_U_2(&sack->numberOfdesc))); - ND_PRINT((ndo, "[#dup tsns %u] ", EXTRACT_BE_U_2(&sack->numDupTsns))); + ND_PRINT("[cum ack %u] ", EXTRACT_BE_U_4(&sack->highestConseqTSN)); + ND_PRINT("[a_rwnd %u] ", EXTRACT_BE_U_4(&sack->updatedRwnd)); + ND_PRINT("[#gap acks %u] ", EXTRACT_BE_U_2(&sack->numberOfdesc)); + ND_PRINT("[#dup tsns %u] ", EXTRACT_BE_U_2(&sack->numDupTsns)); bp += sizeof(*sack); sctpPacketLengthRemaining -= sizeof(*sack); chunkLengthRemaining -= sizeof(*sack); @@ -710,14 +710,14 @@ sctp_print(netdissect_options *ndo, chunkLengthRemaining != 0 && fragNo < EXTRACT_BE_U_2(&sack->numberOfdesc); bp += sizeof(*frag), sctpPacketLengthRemaining -= sizeof(*frag), chunkLengthRemaining -= sizeof(*frag), fragNo++) { if (chunkLengthRemaining < sizeof(*frag)) { - ND_PRINT((ndo, "bogus chunk length %u]", chunkLength)); + ND_PRINT("bogus chunk length %u]", chunkLength); return; } frag = (const struct sctpSelectiveFrag *)bp; - ND_PRINT((ndo, "\n\t\t[gap ack block #%u: start = %u, end = %u] ", + ND_PRINT("\n\t\t[gap ack block #%u: start = %u, end = %u] ", fragNo+1, EXTRACT_BE_U_4(&sack->highestConseqTSN) + EXTRACT_BE_U_2(&frag->fragmentStart), - EXTRACT_BE_U_4(&sack->highestConseqTSN) + EXTRACT_BE_U_2(&frag->fragmentEnd))); + EXTRACT_BE_U_4(&sack->highestConseqTSN) + EXTRACT_BE_U_2(&frag->fragmentEnd)); } /* print duplicate TSNs */ @@ -725,12 +725,12 @@ sctp_print(netdissect_options *ndo, chunkLengthRemaining != 0 && tsnNo<EXTRACT_BE_U_2(&sack->numDupTsns); bp += 4, sctpPacketLengthRemaining -= 4, chunkLengthRemaining -= 4, tsnNo++) { if (chunkLengthRemaining < 4) { - ND_PRINT((ndo, "bogus chunk length %u]", chunkLength)); + ND_PRINT("bogus chunk length %u]", chunkLength); return; } dupTSN = (const u_char *)bp; - ND_PRINT((ndo, "\n\t\t[dup TSN #%u: %u] ", tsnNo+1, - EXTRACT_BE_U_4(dupTSN))); + ND_PRINT("\n\t\t[dup TSN #%u: %u] ", tsnNo+1, + EXTRACT_BE_U_4(dupTSN)); } break; } @@ -766,5 +766,5 @@ sctp_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|sctp]")); + ND_PRINT("[|sctp]"); } diff --git a/print-sflow.c b/print-sflow.c index 1ec5adee..4ba11508 100644 --- a/print-sflow.c +++ b/print-sflow.c @@ -309,37 +309,37 @@ print_sflow_counter_generic(netdissect_options *ndo, sflow_gen_counter = (const struct sflow_generic_counter_t *)pointer; ND_TCHECK_SIZE(sflow_gen_counter); - ND_PRINT((ndo, "\n\t ifindex %u, iftype %u, ifspeed %" PRIu64 ", ifdirection %u (%s)", + ND_PRINT("\n\t ifindex %u, iftype %u, ifspeed %" PRIu64 ", ifdirection %u (%s)", EXTRACT_BE_U_4(sflow_gen_counter->ifindex), EXTRACT_BE_U_4(sflow_gen_counter->iftype), EXTRACT_BE_U_8(sflow_gen_counter->ifspeed), EXTRACT_BE_U_4(sflow_gen_counter->ifdirection), tok2str(sflow_iface_direction_values, "Unknown", - EXTRACT_BE_U_4(sflow_gen_counter->ifdirection)))); - ND_PRINT((ndo, "\n\t ifstatus %u, adminstatus: %s, operstatus: %s", + EXTRACT_BE_U_4(sflow_gen_counter->ifdirection))); + ND_PRINT("\n\t ifstatus %u, adminstatus: %s, operstatus: %s", EXTRACT_BE_U_4(sflow_gen_counter->ifstatus), EXTRACT_BE_U_4(sflow_gen_counter->ifstatus)&1 ? "up" : "down", - (EXTRACT_BE_U_4(sflow_gen_counter->ifstatus)>>1)&1 ? "up" : "down")); - ND_PRINT((ndo, "\n\t In octets %" PRIu64 + (EXTRACT_BE_U_4(sflow_gen_counter->ifstatus)>>1)&1 ? "up" : "down"); + ND_PRINT("\n\t In octets %" PRIu64 ", unicast pkts %u, multicast pkts %u, broadcast pkts %u, discards %u", EXTRACT_BE_U_8(sflow_gen_counter->ifinoctets), EXTRACT_BE_U_4(sflow_gen_counter->ifinunicastpkts), EXTRACT_BE_U_4(sflow_gen_counter->ifinmulticastpkts), EXTRACT_BE_U_4(sflow_gen_counter->ifinbroadcastpkts), - EXTRACT_BE_U_4(sflow_gen_counter->ifindiscards))); - ND_PRINT((ndo, "\n\t In errors %u, unknown protos %u", + EXTRACT_BE_U_4(sflow_gen_counter->ifindiscards)); + ND_PRINT("\n\t In errors %u, unknown protos %u", EXTRACT_BE_U_4(sflow_gen_counter->ifinerrors), - EXTRACT_BE_U_4(sflow_gen_counter->ifinunkownprotos))); - ND_PRINT((ndo, "\n\t Out octets %" PRIu64 + EXTRACT_BE_U_4(sflow_gen_counter->ifinunkownprotos)); + ND_PRINT("\n\t Out octets %" PRIu64 ", unicast pkts %u, multicast pkts %u, broadcast pkts %u, discards %u", EXTRACT_BE_U_8(sflow_gen_counter->ifoutoctets), EXTRACT_BE_U_4(sflow_gen_counter->ifoutunicastpkts), EXTRACT_BE_U_4(sflow_gen_counter->ifoutmulticastpkts), EXTRACT_BE_U_4(sflow_gen_counter->ifoutbroadcastpkts), - EXTRACT_BE_U_4(sflow_gen_counter->ifoutdiscards))); - ND_PRINT((ndo, "\n\t Out errors %u, promisc mode %u", + EXTRACT_BE_U_4(sflow_gen_counter->ifoutdiscards)); + ND_PRINT("\n\t Out errors %u, promisc mode %u", EXTRACT_BE_U_4(sflow_gen_counter->ifouterrors), - EXTRACT_BE_U_4(sflow_gen_counter->ifpromiscmode))); + EXTRACT_BE_U_4(sflow_gen_counter->ifpromiscmode)); return 0; @@ -358,22 +358,22 @@ print_sflow_counter_ethernet(netdissect_options *ndo, sflow_eth_counter = (const struct sflow_ethernet_counter_t *)pointer; ND_TCHECK_SIZE(sflow_eth_counter); - ND_PRINT((ndo, "\n\t align errors %u, fcs errors %u, single collision %u, multiple collision %u, test error %u", + ND_PRINT("\n\t align errors %u, fcs errors %u, single collision %u, multiple collision %u, test error %u", EXTRACT_BE_U_4(sflow_eth_counter->alignerrors), EXTRACT_BE_U_4(sflow_eth_counter->fcserrors), EXTRACT_BE_U_4(sflow_eth_counter->single_collision_frames), EXTRACT_BE_U_4(sflow_eth_counter->multiple_collision_frames), - EXTRACT_BE_U_4(sflow_eth_counter->test_errors))); - ND_PRINT((ndo, "\n\t deferred %u, late collision %u, excessive collision %u, mac trans error %u", + EXTRACT_BE_U_4(sflow_eth_counter->test_errors)); + ND_PRINT("\n\t deferred %u, late collision %u, excessive collision %u, mac trans error %u", EXTRACT_BE_U_4(sflow_eth_counter->deferred_transmissions), EXTRACT_BE_U_4(sflow_eth_counter->late_collisions), EXTRACT_BE_U_4(sflow_eth_counter->excessive_collisions), - EXTRACT_BE_U_4(sflow_eth_counter->mac_transmit_errors))); - ND_PRINT((ndo, "\n\t carrier error %u, frames too long %u, mac receive errors %u, symbol errors %u", + EXTRACT_BE_U_4(sflow_eth_counter->mac_transmit_errors)); + ND_PRINT("\n\t carrier error %u, frames too long %u, mac receive errors %u, symbol errors %u", EXTRACT_BE_U_4(sflow_eth_counter->carrier_sense_errors), EXTRACT_BE_U_4(sflow_eth_counter->frame_too_longs), EXTRACT_BE_U_4(sflow_eth_counter->mac_receive_errors), - EXTRACT_BE_U_4(sflow_eth_counter->symbol_errors))); + EXTRACT_BE_U_4(sflow_eth_counter->symbol_errors)); return 0; @@ -399,28 +399,28 @@ print_sflow_counter_basevg(netdissect_options *ndo, sflow_100basevg_counter = (const struct sflow_100basevg_counter_t *)pointer; ND_TCHECK_SIZE(sflow_100basevg_counter); - ND_PRINT((ndo, "\n\t in high prio frames %u, in high prio octets %" PRIu64, + ND_PRINT("\n\t in high prio frames %u, in high prio octets %" PRIu64, EXTRACT_BE_U_4(sflow_100basevg_counter->in_highpriority_frames), - EXTRACT_BE_U_8(sflow_100basevg_counter->in_highpriority_octets))); - ND_PRINT((ndo, "\n\t in norm prio frames %u, in norm prio octets %" PRIu64, + EXTRACT_BE_U_8(sflow_100basevg_counter->in_highpriority_octets)); + ND_PRINT("\n\t in norm prio frames %u, in norm prio octets %" PRIu64, EXTRACT_BE_U_4(sflow_100basevg_counter->in_normpriority_frames), - EXTRACT_BE_U_8(sflow_100basevg_counter->in_normpriority_octets))); - ND_PRINT((ndo, "\n\t in ipm errors %u, oversized %u, in data errors %u, null addressed frames %u", + EXTRACT_BE_U_8(sflow_100basevg_counter->in_normpriority_octets)); + ND_PRINT("\n\t in ipm errors %u, oversized %u, in data errors %u, null addressed frames %u", EXTRACT_BE_U_4(sflow_100basevg_counter->in_ipmerrors), EXTRACT_BE_U_4(sflow_100basevg_counter->in_oversized), EXTRACT_BE_U_4(sflow_100basevg_counter->in_data_errors), - EXTRACT_BE_U_4(sflow_100basevg_counter->in_null_addressed_frames))); - ND_PRINT((ndo, "\n\t out high prio frames %u, out high prio octets %" PRIu64 + EXTRACT_BE_U_4(sflow_100basevg_counter->in_null_addressed_frames)); + ND_PRINT("\n\t out high prio frames %u, out high prio octets %" PRIu64 ", trans into frames %u", EXTRACT_BE_U_4(sflow_100basevg_counter->out_highpriority_frames), EXTRACT_BE_U_8(sflow_100basevg_counter->out_highpriority_octets), - EXTRACT_BE_U_4(sflow_100basevg_counter->transitioninto_frames))); - ND_PRINT((ndo, "\n\t in hc high prio octets %" PRIu64 + EXTRACT_BE_U_4(sflow_100basevg_counter->transitioninto_frames)); + ND_PRINT("\n\t in hc high prio octets %" PRIu64 ", in hc norm prio octets %" PRIu64 ", out hc high prio octets %" PRIu64, EXTRACT_BE_U_8(sflow_100basevg_counter->hc_in_highpriority_octets), EXTRACT_BE_U_8(sflow_100basevg_counter->hc_in_normpriority_octets), - EXTRACT_BE_U_8(sflow_100basevg_counter->hc_out_highpriority_octets))); + EXTRACT_BE_U_8(sflow_100basevg_counter->hc_out_highpriority_octets)); return 0; @@ -439,14 +439,14 @@ print_sflow_counter_vlan(netdissect_options *ndo, sflow_vlan_counter = (const struct sflow_vlan_counter_t *)pointer; ND_TCHECK_SIZE(sflow_vlan_counter); - ND_PRINT((ndo, "\n\t vlan_id %u, octets %" PRIu64 + ND_PRINT("\n\t vlan_id %u, octets %" PRIu64 ", unicast_pkt %u, multicast_pkt %u, broadcast_pkt %u, discards %u", EXTRACT_BE_U_4(sflow_vlan_counter->vlan_id), EXTRACT_BE_U_8(sflow_vlan_counter->octets), EXTRACT_BE_U_4(sflow_vlan_counter->unicast_pkt), EXTRACT_BE_U_4(sflow_vlan_counter->multicast_pkt), EXTRACT_BE_U_4(sflow_vlan_counter->broadcast_pkt), - EXTRACT_BE_U_4(sflow_vlan_counter->discards))); + EXTRACT_BE_U_4(sflow_vlan_counter->discards)); return 0; @@ -473,13 +473,13 @@ print_sflow_counter_processor(netdissect_options *ndo, sflow_processor_counter = (const struct sflow_processor_counter_t *)pointer; ND_TCHECK_SIZE(sflow_processor_counter); - ND_PRINT((ndo, "\n\t 5sec %u, 1min %u, 5min %u, total_mem %" PRIu64 + ND_PRINT("\n\t 5sec %u, 1min %u, 5min %u, total_mem %" PRIu64 ", total_mem %" PRIu64, EXTRACT_BE_U_4(sflow_processor_counter->five_sec_util), EXTRACT_BE_U_4(sflow_processor_counter->one_min_util), EXTRACT_BE_U_4(sflow_processor_counter->five_min_util), EXTRACT_BE_U_8(sflow_processor_counter->total_memory), - EXTRACT_BE_U_8(sflow_processor_counter->free_memory))); + EXTRACT_BE_U_8(sflow_processor_counter->free_memory)); return 0; @@ -514,11 +514,11 @@ sflow_print_counter_records(netdissect_options *ndo, counter_type = enterprise & 0x0FFF; enterprise = enterprise >> 20; counter_len = EXTRACT_BE_U_4(sflow_counter_record->length); - ND_PRINT((ndo, "\n\t enterprise %u, %s (%u) length %u", + ND_PRINT("\n\t enterprise %u, %s (%u) length %u", enterprise, (enterprise == 0) ? tok2str(sflow_counter_type_values,"Unknown",counter_type) : "Unknown", counter_type, - counter_len)); + counter_len); tptr += sizeof(struct sflow_counter_record_t); tlen -= sizeof(struct sflow_counter_record_t); @@ -584,11 +584,11 @@ sflow_print_counter_sample(netdissect_options *ndo, nrecords = EXTRACT_BE_U_4(sflow_counter_sample->records); - ND_PRINT((ndo, " seqnum %u, type %u, idx %u, records %u", + ND_PRINT(" seqnum %u, type %u, idx %u, records %u", EXTRACT_BE_U_4(sflow_counter_sample->seqnum), EXTRACT_U_1(sflow_counter_sample->type), EXTRACT_BE_U_3(sflow_counter_sample->index), - nrecords)); + nrecords); return sflow_print_counter_records(ndo, pointer + sizeof(struct sflow_counter_sample_t), len - sizeof(struct sflow_counter_sample_t), @@ -614,11 +614,11 @@ sflow_print_expanded_counter_sample(netdissect_options *ndo, nrecords = EXTRACT_BE_U_4(sflow_expanded_counter_sample->records); - ND_PRINT((ndo, " seqnum %u, type %u, idx %u, records %u", + ND_PRINT(" seqnum %u, type %u, idx %u, records %u", EXTRACT_BE_U_4(sflow_expanded_counter_sample->seqnum), EXTRACT_BE_U_4(sflow_expanded_counter_sample->type), EXTRACT_BE_U_4(sflow_expanded_counter_sample->index), - nrecords)); + nrecords); return sflow_print_counter_records(ndo, pointer + sizeof(struct sflow_expanded_counter_sample_t), len - sizeof(struct sflow_expanded_counter_sample_t), @@ -639,12 +639,12 @@ print_sflow_raw_packet(netdissect_options *ndo, sflow_flow_raw = (const struct sflow_expanded_flow_raw_t *)pointer; ND_TCHECK_SIZE(sflow_flow_raw); - ND_PRINT((ndo, "\n\t protocol %s (%u), length %u, stripped bytes %u, header_size %u", + ND_PRINT("\n\t protocol %s (%u), length %u, stripped bytes %u, header_size %u", tok2str(sflow_flow_raw_protocol_values,"Unknown",EXTRACT_BE_U_4(sflow_flow_raw->protocol)), EXTRACT_BE_U_4(sflow_flow_raw->protocol), EXTRACT_BE_U_4(sflow_flow_raw->length), EXTRACT_BE_U_4(sflow_flow_raw->stripped_bytes), - EXTRACT_BE_U_4(sflow_flow_raw->header_size))); + EXTRACT_BE_U_4(sflow_flow_raw->header_size)); /* QUESTION - should we attempt to print the raw header itself? assuming of course there is wnough data present to do so... */ @@ -667,9 +667,9 @@ print_sflow_ethernet_frame(netdissect_options *ndo, sflow_ethernet_frame = (const struct sflow_ethernet_frame_t *)pointer; ND_TCHECK_SIZE(sflow_ethernet_frame); - ND_PRINT((ndo, "\n\t frame len %u, type %u", + ND_PRINT("\n\t frame len %u, type %u", EXTRACT_BE_U_4(sflow_ethernet_frame->length), - EXTRACT_BE_U_4(sflow_ethernet_frame->type))); + EXTRACT_BE_U_4(sflow_ethernet_frame->type)); return 0; @@ -688,11 +688,11 @@ print_sflow_extended_switch_data(netdissect_options *ndo, sflow_extended_sw_data = (const struct sflow_extended_switch_data_t *)pointer; ND_TCHECK_SIZE(sflow_extended_sw_data); - ND_PRINT((ndo, "\n\t src vlan %u, src pri %u, dst vlan %u, dst pri %u", + ND_PRINT("\n\t src vlan %u, src pri %u, dst vlan %u, dst pri %u", EXTRACT_BE_U_4(sflow_extended_sw_data->src_vlan), EXTRACT_BE_U_4(sflow_extended_sw_data->src_pri), EXTRACT_BE_U_4(sflow_extended_sw_data->dst_vlan), - EXTRACT_BE_U_4(sflow_extended_sw_data->dst_pri))); + EXTRACT_BE_U_4(sflow_extended_sw_data->dst_pri)); return 0; @@ -731,11 +731,11 @@ sflow_print_flow_records(netdissect_options *ndo, flow_type = enterprise & 0x0FFF; enterprise = enterprise >> 12; flow_len = EXTRACT_BE_U_4(sflow_flow_record->length); - ND_PRINT((ndo, "\n\t enterprise %u %s (%u) length %u", + ND_PRINT("\n\t enterprise %u %s (%u) length %u", enterprise, (enterprise == 0) ? tok2str(sflow_flow_type_values,"Unknown",flow_type) : "Unknown", flow_type, - flow_len)); + flow_len); tptr += sizeof(struct sflow_flow_record_t); tlen -= sizeof(struct sflow_flow_record_t); @@ -805,7 +805,7 @@ sflow_print_flow_sample(netdissect_options *ndo, nrecords = EXTRACT_BE_U_4(sflow_flow_sample->records); - ND_PRINT((ndo, " seqnum %u, type %u, idx %u, rate %u, pool %u, drops %u, input %u output %u records %u", + ND_PRINT(" seqnum %u, type %u, idx %u, rate %u, pool %u, drops %u, input %u output %u records %u", EXTRACT_BE_U_4(sflow_flow_sample->seqnum), EXTRACT_U_1(sflow_flow_sample->type), EXTRACT_BE_U_3(sflow_flow_sample->index), @@ -814,7 +814,7 @@ sflow_print_flow_sample(netdissect_options *ndo, EXTRACT_BE_U_4(sflow_flow_sample->drops), EXTRACT_BE_U_4(sflow_flow_sample->in_interface), EXTRACT_BE_U_4(sflow_flow_sample->out_interface), - nrecords)); + nrecords); return sflow_print_flow_records(ndo, pointer + sizeof(struct sflow_flow_sample_t), len - sizeof(struct sflow_flow_sample_t), @@ -839,14 +839,14 @@ sflow_print_expanded_flow_sample(netdissect_options *ndo, nrecords = EXTRACT_BE_U_4(sflow_expanded_flow_sample->records); - ND_PRINT((ndo, " seqnum %u, type %u, idx %u, rate %u, pool %u, drops %u, records %u", + ND_PRINT(" seqnum %u, type %u, idx %u, rate %u, pool %u, drops %u, records %u", EXTRACT_BE_U_4(sflow_expanded_flow_sample->seqnum), EXTRACT_BE_U_4(sflow_expanded_flow_sample->type), EXTRACT_BE_U_4(sflow_expanded_flow_sample->index), EXTRACT_BE_U_4(sflow_expanded_flow_sample->rate), EXTRACT_BE_U_4(sflow_expanded_flow_sample->pool), EXTRACT_BE_U_4(sflow_expanded_flow_sample->drops), - EXTRACT_BE_U_4(sflow_expanded_flow_sample->records))); + EXTRACT_BE_U_4(sflow_expanded_flow_sample->records)); return sflow_print_flow_records(ndo, pointer + sizeof(struct sflow_expanded_flow_sample_t), len - sizeof(struct sflow_expanded_flow_sample_t), @@ -877,24 +877,24 @@ sflow_print(netdissect_options *ndo, * Sanity checking of the header. */ if (EXTRACT_BE_U_4(sflow_datagram->version) != 5) { - ND_PRINT((ndo, "sFlow version %u packet not supported", - EXTRACT_BE_U_4(sflow_datagram->version))); + ND_PRINT("sFlow version %u packet not supported", + EXTRACT_BE_U_4(sflow_datagram->version)); return; } if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "sFlowv%u, %s agent %s, agent-id %u, length %u", + ND_PRINT("sFlowv%u, %s agent %s, agent-id %u, length %u", EXTRACT_BE_U_4(sflow_datagram->version), EXTRACT_BE_U_4(sflow_datagram->ip_version) == 1 ? "IPv4" : "IPv6", ipaddr_string(ndo, sflow_datagram->agent), EXTRACT_BE_U_4(sflow_datagram->agent_id), - len)); + len); return; } /* ok they seem to want to know everything - lets fully decode it */ nsamples=EXTRACT_BE_U_4(sflow_datagram->samples); - ND_PRINT((ndo, "sFlowv%u, %s agent %s, agent-id %u, seqnum %u, uptime %u, samples %u, length %u", + ND_PRINT("sFlowv%u, %s agent %s, agent-id %u, seqnum %u, uptime %u, samples %u, length %u", EXTRACT_BE_U_4(sflow_datagram->version), EXTRACT_BE_U_4(sflow_datagram->ip_version) == 1 ? "IPv4" : "IPv6", ipaddr_string(ndo, sflow_datagram->agent), @@ -902,7 +902,7 @@ sflow_print(netdissect_options *ndo, EXTRACT_BE_U_4(sflow_datagram->seqnum), EXTRACT_BE_U_4(sflow_datagram->uptime), nsamples, - len)); + len); /* skip Common header */ tptr += sizeof(struct sflow_datagram_t); @@ -921,10 +921,10 @@ sflow_print(netdissect_options *ndo, tptr += sizeof(struct sflow_sample_header); tlen -= sizeof(struct sflow_sample_header); - ND_PRINT((ndo, "\n\t%s (%u), length %u,", + ND_PRINT("\n\t%s (%u), length %u,", tok2str(sflow_format_values, "Unknown", sflow_sample_type), sflow_sample_type, - sflow_sample_len)); + sflow_sample_len); /* basic sanity check */ if (sflow_sample_type == 0 || sflow_sample_len ==0) { @@ -970,7 +970,7 @@ sflow_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|SFLOW]")); + ND_PRINT("[|SFLOW]"); } /* @@ -64,7 +64,7 @@ sl_if_print(netdissect_options *ndo, const struct ip *ip; if (caplen < SLIP_HDRLEN || length < SLIP_HDRLEN) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (caplen); } @@ -77,7 +77,7 @@ sl_if_print(netdissect_options *ndo, sliplink_print(ndo, p, ip, length); if (caplen < 1 || length < 1) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (caplen + SLIP_HDRLEN); } @@ -89,7 +89,7 @@ sl_if_print(netdissect_options *ndo, ip6_print(ndo, (const u_char *)ip, length); break; default: - ND_PRINT((ndo, "ip v%d", IP_V(ip))); + ND_PRINT("ip v%d", IP_V(ip)); } return (SLIP_HDRLEN); @@ -104,7 +104,7 @@ sl_bsdos_if_print(netdissect_options *ndo, const struct ip *ip; if (caplen < SLIP_HDRLEN) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return (caplen); } @@ -134,15 +134,15 @@ sliplink_print(netdissect_options *ndo, switch (dir) { case SLIPDIR_IN: - ND_PRINT((ndo, "I ")); + ND_PRINT("I "); break; case SLIPDIR_OUT: - ND_PRINT((ndo, "O ")); + ND_PRINT("O "); break; default: - ND_PRINT((ndo, "Invalid direction %d ", dir)); + ND_PRINT("Invalid direction %d ", dir); dir = -1; break; } @@ -151,14 +151,14 @@ sliplink_print(netdissect_options *ndo, int i; for (i = SLX_CHDR; i < SLX_CHDR + CHDR_LEN - 1; ++i) - ND_PRINT((ndo, "%02x.", EXTRACT_U_1(p + i))); - ND_PRINT((ndo, "%02x: ", EXTRACT_U_1(p + SLX_CHDR + CHDR_LEN - 1))); + ND_PRINT("%02x.", EXTRACT_U_1(p + i)); + ND_PRINT("%02x: ", EXTRACT_U_1(p + SLX_CHDR + CHDR_LEN - 1)); return; } switch (EXTRACT_U_1(p + SLX_CHDR) & 0xf0) { case TYPE_IP: - ND_PRINT((ndo, "ip %d: ", length + SLIP_HDRLEN)); + ND_PRINT("ip %d: ", length + SLIP_HDRLEN); break; case TYPE_UNCOMPRESSED_TCP: @@ -168,7 +168,7 @@ sliplink_print(netdissect_options *ndo, * has restored the IP header copy to IPPROTO_TCP. */ lastconn = EXTRACT_U_1(((const struct ip *)(p + SLX_CHDR))->ip_p); - ND_PRINT((ndo, "utcp %d: ", lastconn)); + ND_PRINT("utcp %d: ", lastconn); if (dir == -1) { /* Direction is bogus, don't use it */ return; @@ -186,9 +186,9 @@ sliplink_print(netdissect_options *ndo, if (EXTRACT_U_1(p + SLX_CHDR) & TYPE_COMPRESSED_TCP) { compressed_sl_print(ndo, p + SLX_CHDR, ip, length, dir); - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); } else - ND_PRINT((ndo, "slip-%d!: ", EXTRACT_U_1(p + SLX_CHDR))); + ND_PRINT("slip-%d!: ", EXTRACT_U_1(p + SLX_CHDR)); } } @@ -203,7 +203,7 @@ print_sl_change(netdissect_options *ndo, i = EXTRACT_BE_U_2(cp); cp += 2; } - ND_PRINT((ndo, " %s%d", str, i)); + ND_PRINT(" %s%d", str, i); return (cp); } @@ -219,9 +219,9 @@ print_sl_winchange(netdissect_options *ndo, cp += 2; } if (i >= 0) - ND_PRINT((ndo, " W+%d", i)); + ND_PRINT(" W+%d", i); else - ND_PRINT((ndo, " W%d", i)); + ND_PRINT(" W%d", i); return (cp); } @@ -238,20 +238,20 @@ compressed_sl_print(netdissect_options *ndo, if (flags & NEW_C) { lastconn = EXTRACT_U_1(cp); cp++; - ND_PRINT((ndo, "ctcp %d", lastconn)); + ND_PRINT("ctcp %d", lastconn); } else - ND_PRINT((ndo, "ctcp *")); + ND_PRINT("ctcp *"); /* skip tcp checksum */ cp += 2; switch (flags & SPECIALS_MASK) { case SPECIAL_I: - ND_PRINT((ndo, " *SA+%d", lastlen[dir][lastconn])); + ND_PRINT(" *SA+%d", lastlen[dir][lastconn]); break; case SPECIAL_D: - ND_PRINT((ndo, " *S+%d", lastlen[dir][lastconn])); + ND_PRINT(" *S+%d", lastlen[dir][lastconn]); break; default: @@ -276,5 +276,5 @@ compressed_sl_print(netdissect_options *ndo, hlen = IP_HL(ip); hlen += TH_OFF((const struct tcphdr *)&((const int32_t *)ip)[hlen]); lastlen[dir][lastconn] = length - (hlen << 2); - ND_PRINT((ndo, " %d (%ld)", lastlen[dir][lastconn], (long)(cp - chdr))); + ND_PRINT(" %d (%ld)", lastlen[dir][lastconn], (long)(cp - chdr)); } diff --git a/print-sll.c b/print-sll.c index edda8a44..2cfef6f2 100644 --- a/print-sll.c +++ b/print-sll.c @@ -134,7 +134,7 @@ sll_print(netdissect_options *ndo, const struct sll_header *sllp, u_int length) { u_short ether_type; - ND_PRINT((ndo, "%3s ",tok2str(sll_pkttype_values,"?",EXTRACT_BE_U_2(sllp->sll_pkttype)))); + ND_PRINT("%3s ",tok2str(sll_pkttype_values,"?",EXTRACT_BE_U_2(sllp->sll_pkttype))); /* * XXX - check the link-layer address type value? @@ -142,7 +142,7 @@ sll_print(netdissect_options *ndo, const struct sll_header *sllp, u_int length) * XXX - print others as strings of hex? */ if (EXTRACT_BE_U_2(sllp->sll_halen) == 6) - ND_PRINT((ndo, "%s ", etheraddr_string(ndo, sllp->sll_addr))); + ND_PRINT("%s ", etheraddr_string(ndo, sllp->sll_addr)); if (!ndo->ndo_qflag) { ether_type = EXTRACT_BE_U_2(sllp->sll_protocol); @@ -157,30 +157,30 @@ sll_print(netdissect_options *ndo, const struct sll_header *sllp, u_int length) /* * Ethernet_802.3 IPX frame. */ - ND_PRINT((ndo, "802.3")); + ND_PRINT("802.3"); break; case LINUX_SLL_P_802_2: /* * 802.2. */ - ND_PRINT((ndo, "802.2")); + ND_PRINT("802.2"); break; default: /* * What is it? */ - ND_PRINT((ndo, "ethertype Unknown (0x%04x)", - ether_type)); + ND_PRINT("ethertype Unknown (0x%04x)", + ether_type); break; } } else { - ND_PRINT((ndo, "ethertype %s (0x%04x)", + ND_PRINT("ethertype %s (0x%04x)", tok2str(ethertype_values, "Unknown", ether_type), - ether_type)); + ether_type); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } } @@ -206,7 +206,7 @@ sll_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char * adds this many bytes of header to every packet in a * cooked socket capture. */ - ND_PRINT((ndo, "[|sll]")); + ND_PRINT("[|sll]"); return (caplen); } @@ -269,25 +269,25 @@ recurse: * the enclosed type field. */ if (caplen < 4) { - ND_PRINT((ndo, "[|vlan]")); + ND_PRINT("[|vlan]"); return (hdrlen + caplen); } if (length < 4) { - ND_PRINT((ndo, "[|vlan]")); + ND_PRINT("[|vlan]"); return (hdrlen + length); } if (ndo->ndo_eflag) { uint16_t tag = EXTRACT_BE_U_2(p); - ND_PRINT((ndo, "%s, ", ieee8021q_tci_string(tag))); + ND_PRINT("%s, ", ieee8021q_tci_string(tag)); } ether_type = EXTRACT_BE_U_2(p + 2); if (ether_type <= MAX_ETHERNET_LENGTH_VAL) ether_type = LINUX_SLL_P_802_2; if (!ndo->ndo_qflag) { - ND_PRINT((ndo, "ethertype %s, ", - tok2str(ethertype_values, "Unknown", ether_type))); + ND_PRINT("ethertype %s, ", + tok2str(ethertype_values, "Unknown", ether_type)); } p += 4; length -= 4; diff --git a/print-slow.c b/print-slow.c index dc2da076..c1c500d7 100644 --- a/print-slow.c +++ b/print-slow.c @@ -261,7 +261,7 @@ slow_print(netdissect_options *ndo, goto tooshort; ND_TCHECK_1(pptr + 1); if (EXTRACT_U_1(pptr + 1) != LACP_VERSION) { - ND_PRINT((ndo, "LACP version %u packet not supported", EXTRACT_U_1(pptr + 1))); + ND_PRINT("LACP version %u packet not supported", EXTRACT_U_1(pptr + 1)); return; } print_version = 1; @@ -272,7 +272,7 @@ slow_print(netdissect_options *ndo, goto tooshort; ND_TCHECK_1(pptr + 1); if (EXTRACT_U_1(pptr + 1) != MARKER_VERSION) { - ND_PRINT((ndo, "MARKER version %u packet not supported", EXTRACT_U_1(pptr + 1))); + ND_PRINT("MARKER version %u packet not supported", EXTRACT_U_1(pptr + 1)); return; } print_version = 1; @@ -289,15 +289,15 @@ slow_print(netdissect_options *ndo, } if (print_version == 1) { - ND_PRINT((ndo, "%sv%u, length %u", + ND_PRINT("%sv%u, length %u", tok2str(slow_proto_values, "unknown (%u)", subtype), EXTRACT_U_1((pptr + 1)), - len)); + len); } else { /* some slow protos don't have a version number in the header */ - ND_PRINT((ndo, "%s, length %u", + ND_PRINT("%s, length %u", tok2str(slow_proto_values, "unknown (%u)", subtype), - len)); + len); } /* unrecognized subtype */ @@ -332,16 +332,16 @@ slow_print(netdissect_options *ndo, tooshort: if (!ndo->ndo_vflag) - ND_PRINT((ndo, " (packet is too short)")); + ND_PRINT(" (packet is too short)"); else - ND_PRINT((ndo, "\n\t\t packet is too short")); + ND_PRINT("\n\t\t packet is too short"); return; trunc: if (!ndo->ndo_vflag) - ND_PRINT((ndo, " (packet exceeded snapshot)")); + ND_PRINT(" (packet exceeded snapshot)"); else - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); } static void @@ -370,12 +370,12 @@ slow_marker_lacp_print(netdissect_options *ndo, tlv_type = EXTRACT_U_1(tlv_header->type); tlv_len = EXTRACT_U_1(tlv_header->length); - ND_PRINT((ndo, "\n\t%s TLV (0x%02x), length %u", + ND_PRINT("\n\t%s TLV (0x%02x), length %u", tok2str(slow_tlv_values, "Unknown", (proto_subtype << 8) + tlv_type), tlv_type, - tlv_len)); + tlv_len); if (tlv_type == LACP_MARKER_TLV_TERMINATOR) { /* @@ -387,8 +387,8 @@ slow_marker_lacp_print(netdissect_options *ndo, /* length includes the type and length fields */ if (tlv_len < sizeof(struct tlv_header_t)) { - ND_PRINT((ndo, "\n\t ERROR: illegal length - should be >= %lu", - (unsigned long) sizeof(struct tlv_header_t))); + ND_PRINT("\n\t ERROR: illegal length - should be >= %lu", + (unsigned long) sizeof(struct tlv_header_t)); return; } @@ -408,14 +408,14 @@ slow_marker_lacp_print(netdissect_options *ndo, case ((SLOW_PROTO_LACP << 8) + LACP_TLV_PARTNER_INFO): if (tlv_tlen != sizeof(struct lacp_tlv_actor_partner_info_t)) { - ND_PRINT((ndo, "\n\t ERROR: illegal length - should be %lu", - (unsigned long) (sizeof(struct tlv_header_t) + sizeof(struct lacp_tlv_actor_partner_info_t)))); + ND_PRINT("\n\t ERROR: illegal length - should be %lu", + (unsigned long) (sizeof(struct tlv_header_t) + sizeof(struct lacp_tlv_actor_partner_info_t))); goto badlength; } tlv_ptr.lacp_tlv_actor_partner_info = (const struct lacp_tlv_actor_partner_info_t *)tlv_tptr; - ND_PRINT((ndo, "\n\t System %s, System Priority %u, Key %u" + ND_PRINT("\n\t System %s, System Priority %u, Key %u" ", Port %u, Port Priority %u\n\t State Flags [%s]", etheraddr_string(ndo, tlv_ptr.lacp_tlv_actor_partner_info->sys), EXTRACT_BE_U_2(tlv_ptr.lacp_tlv_actor_partner_info->sys_pri), @@ -424,39 +424,39 @@ slow_marker_lacp_print(netdissect_options *ndo, EXTRACT_BE_U_2(tlv_ptr.lacp_tlv_actor_partner_info->port_pri), bittok2str(lacp_tlv_actor_partner_info_state_values, "none", - EXTRACT_U_1(tlv_ptr.lacp_tlv_actor_partner_info->state)))); + EXTRACT_U_1(tlv_ptr.lacp_tlv_actor_partner_info->state))); break; case ((SLOW_PROTO_LACP << 8) + LACP_TLV_COLLECTOR_INFO): if (tlv_tlen != sizeof(struct lacp_tlv_collector_info_t)) { - ND_PRINT((ndo, "\n\t ERROR: illegal length - should be %lu", - (unsigned long) (sizeof(struct tlv_header_t) + sizeof(struct lacp_tlv_collector_info_t)))); + ND_PRINT("\n\t ERROR: illegal length - should be %lu", + (unsigned long) (sizeof(struct tlv_header_t) + sizeof(struct lacp_tlv_collector_info_t))); goto badlength; } tlv_ptr.lacp_tlv_collector_info = (const struct lacp_tlv_collector_info_t *)tlv_tptr; - ND_PRINT((ndo, "\n\t Max Delay %u", - EXTRACT_BE_U_2(tlv_ptr.lacp_tlv_collector_info->max_delay))); + ND_PRINT("\n\t Max Delay %u", + EXTRACT_BE_U_2(tlv_ptr.lacp_tlv_collector_info->max_delay)); break; case ((SLOW_PROTO_MARKER << 8) + MARKER_TLV_MARKER_INFO): if (tlv_tlen != sizeof(struct marker_tlv_marker_info_t)) { - ND_PRINT((ndo, "\n\t ERROR: illegal length - should be %lu", - (unsigned long) (sizeof(struct tlv_header_t) + sizeof(struct marker_tlv_marker_info_t)))); + ND_PRINT("\n\t ERROR: illegal length - should be %lu", + (unsigned long) (sizeof(struct tlv_header_t) + sizeof(struct marker_tlv_marker_info_t))); goto badlength; } tlv_ptr.marker_tlv_marker_info = (const struct marker_tlv_marker_info_t *)tlv_tptr; - ND_PRINT((ndo, "\n\t Request System %s, Request Port %u, Request Transaction ID 0x%08x", + ND_PRINT("\n\t Request System %s, Request Port %u, Request Transaction ID 0x%08x", etheraddr_string(ndo, tlv_ptr.marker_tlv_marker_info->req_sys), EXTRACT_BE_U_2(tlv_ptr.marker_tlv_marker_info->req_port), - EXTRACT_BE_U_4(tlv_ptr.marker_tlv_marker_info->req_trans_id))); + EXTRACT_BE_U_4(tlv_ptr.marker_tlv_marker_info->req_trans_id)); break; @@ -479,11 +479,11 @@ slow_marker_lacp_print(netdissect_options *ndo, return; tooshort: - ND_PRINT((ndo, "\n\t\t packet is too short")); + ND_PRINT("\n\t\t packet is too short"); return; trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); } static void @@ -527,11 +527,11 @@ slow_oam_print(netdissect_options *ndo, tlen -= sizeof(struct slow_oam_common_header_t); code = EXTRACT_U_1(ptr.slow_oam_common_header->code); - ND_PRINT((ndo, "\n\tCode %s OAM PDU, Flags [%s]", + ND_PRINT("\n\tCode %s OAM PDU, Flags [%s]", tok2str(slow_oam_code_values, "Unknown (%u)", code), bittok2str(slow_oam_flag_values, "none", - EXTRACT_BE_U_2(ptr.slow_oam_common_header->flags)))); + EXTRACT_BE_U_2(ptr.slow_oam_common_header->flags))); switch (code) { case SLOW_OAM_CODE_INFO: @@ -542,10 +542,10 @@ slow_oam_print(netdissect_options *ndo, ND_TCHECK_SIZE(ptr.slow_oam_tlv_header); type = EXTRACT_U_1(ptr.slow_oam_tlv_header->type); length = EXTRACT_U_1(ptr.slow_oam_tlv_header->length); - ND_PRINT((ndo, "\n\t %s Information Type (%u), length %u", + ND_PRINT("\n\t %s Information Type (%u), length %u", tok2str(slow_oam_info_type_values, "Reserved", type), type, - length)); + length); if (type == SLOW_OAM_INFO_TYPE_END_OF_TLV) { /* @@ -557,8 +557,8 @@ slow_oam_print(netdissect_options *ndo, /* length includes the type and length fields */ if (length < sizeof(struct slow_oam_tlv_header_t)) { - ND_PRINT((ndo, "\n\t ERROR: illegal length - should be >= %u", - (u_int)sizeof(struct slow_oam_tlv_header_t))); + ND_PRINT("\n\t ERROR: illegal length - should be >= %u", + (u_int)sizeof(struct slow_oam_tlv_header_t)); return; } @@ -574,32 +574,32 @@ slow_oam_print(netdissect_options *ndo, if (EXTRACT_U_1(tlv.slow_oam_info->info_length) != sizeof(struct slow_oam_info_t)) { - ND_PRINT((ndo, "\n\t ERROR: illegal length - should be %lu", - (unsigned long) sizeof(struct slow_oam_info_t))); + ND_PRINT("\n\t ERROR: illegal length - should be %lu", + (unsigned long) sizeof(struct slow_oam_info_t)); hexdump = TRUE; goto badlength_code_info; } - ND_PRINT((ndo, "\n\t OAM-Version %u, Revision %u", + ND_PRINT("\n\t OAM-Version %u, Revision %u", EXTRACT_U_1(tlv.slow_oam_info->oam_version), - EXTRACT_BE_U_2(tlv.slow_oam_info->revision))); + EXTRACT_BE_U_2(tlv.slow_oam_info->revision)); state = EXTRACT_U_1(tlv.slow_oam_info->state); - ND_PRINT((ndo, "\n\t State-Parser-Action %s, State-MUX-Action %s", + ND_PRINT("\n\t State-Parser-Action %s, State-MUX-Action %s", tok2str(slow_oam_info_type_state_parser_values, "Reserved", state & OAM_INFO_TYPE_PARSER_MASK), tok2str(slow_oam_info_type_state_mux_values, "Reserved", - state & OAM_INFO_TYPE_MUX_MASK))); - ND_PRINT((ndo, "\n\t OAM-Config Flags [%s], OAM-PDU-Config max-PDU size %u", + state & OAM_INFO_TYPE_MUX_MASK)); + ND_PRINT("\n\t OAM-Config Flags [%s], OAM-PDU-Config max-PDU size %u", bittok2str(slow_oam_info_type_oam_config_values, "none", EXTRACT_U_1(tlv.slow_oam_info->oam_config)), EXTRACT_BE_U_2(tlv.slow_oam_info->oam_pdu_config) & - OAM_INFO_TYPE_PDU_SIZE_MASK)); - ND_PRINT((ndo, "\n\t OUI %s (0x%06x), Vendor-Private 0x%08x", + OAM_INFO_TYPE_PDU_SIZE_MASK); + ND_PRINT("\n\t OUI %s (0x%06x), Vendor-Private 0x%08x", tok2str(oui_values, "Unknown", EXTRACT_BE_U_3(tlv.slow_oam_info->oui)), EXTRACT_BE_U_3(tlv.slow_oam_info->oui), - EXTRACT_BE_U_4(tlv.slow_oam_info->vendor_private))); + EXTRACT_BE_U_4(tlv.slow_oam_info->vendor_private)); break; case SLOW_OAM_INFO_TYPE_ORG_SPECIFIC: @@ -628,7 +628,7 @@ slow_oam_print(netdissect_options *ndo, if (tlen < 2) goto tooshort; ND_TCHECK_2(tptr); - ND_PRINT((ndo, "\n\t Sequence Number %u", EXTRACT_BE_U_2(tptr))); + ND_PRINT("\n\t Sequence Number %u", EXTRACT_BE_U_2(tptr)); tlen -= 2; tptr += 2; @@ -640,11 +640,11 @@ slow_oam_print(netdissect_options *ndo, ND_TCHECK_SIZE(ptr.slow_oam_tlv_header); type = EXTRACT_U_1(ptr.slow_oam_tlv_header->type); length = EXTRACT_U_1(ptr.slow_oam_tlv_header->length); - ND_PRINT((ndo, "\n\t %s Link Event Type (%u), length %u", + ND_PRINT("\n\t %s Link Event Type (%u), length %u", tok2str(slow_oam_link_event_values, "Reserved", type), type, - length)); + length); if (type == SLOW_OAM_INFO_TYPE_END_OF_TLV) { /* @@ -656,8 +656,8 @@ slow_oam_print(netdissect_options *ndo, /* length includes the type and length fields */ if (length < sizeof(struct slow_oam_tlv_header_t)) { - ND_PRINT((ndo, "\n\t ERROR: illegal length - should be >= %u", - (u_int)sizeof(struct slow_oam_tlv_header_t))); + ND_PRINT("\n\t ERROR: illegal length - should be >= %u", + (u_int)sizeof(struct slow_oam_tlv_header_t)); return; } @@ -675,13 +675,13 @@ slow_oam_print(netdissect_options *ndo, if (EXTRACT_U_1(tlv.slow_oam_link_event->event_length) != sizeof(struct slow_oam_link_event_t)) { - ND_PRINT((ndo, "\n\t ERROR: illegal length - should be %lu", - (unsigned long) sizeof(struct slow_oam_link_event_t))); + ND_PRINT("\n\t ERROR: illegal length - should be %lu", + (unsigned long) sizeof(struct slow_oam_link_event_t)); hexdump = TRUE; goto badlength_event_notif; } - ND_PRINT((ndo, "\n\t Timestamp %u ms, Errored Window %" PRIu64 + ND_PRINT("\n\t Timestamp %u ms, Errored Window %" PRIu64 "\n\t Errored Threshold %" PRIu64 "\n\t Errors %" PRIu64 "\n\t Error Running Total %" PRIu64 @@ -691,7 +691,7 @@ slow_oam_print(netdissect_options *ndo, EXTRACT_BE_U_8(tlv.slow_oam_link_event->threshold), EXTRACT_BE_U_8(tlv.slow_oam_link_event->errors), EXTRACT_BE_U_8(tlv.slow_oam_link_event->errors_running_total), - EXTRACT_BE_U_4(tlv.slow_oam_link_event->event_running_total))); + EXTRACT_BE_U_4(tlv.slow_oam_link_event->event_running_total)); break; case SLOW_OAM_LINK_EVENT_ORG_SPECIFIC: @@ -721,11 +721,11 @@ slow_oam_print(netdissect_options *ndo, goto tooshort; ND_TCHECK_SIZE(tlv.slow_oam_loopbackctrl); command = EXTRACT_U_1(tlv.slow_oam_loopbackctrl->command); - ND_PRINT((ndo, "\n\t Command %s (%u)", + ND_PRINT("\n\t Command %s (%u)", tok2str(slow_oam_loopbackctrl_cmd_values, "Unknown", command), - command)); + command); tptr ++; tlen --; break; @@ -746,9 +746,9 @@ slow_oam_print(netdissect_options *ndo, return; tooshort: - ND_PRINT((ndo, "\n\t\t packet is too short")); + ND_PRINT("\n\t\t packet is too short"); return; trunc: - ND_PRINT((ndo, "\n\t\t packet exceeded snapshot")); + ND_PRINT("\n\t\t packet exceeded snapshot"); } diff --git a/print-smb.c b/print-smb.c index 6c84f733..ef2f83d9 100644 --- a/print-smb.c +++ b/print-smb.c @@ -102,7 +102,7 @@ trans2_findfirst(netdissect_options *ndo, smb_fdata(ndo, param, fmt, param + pcnt, unicodestr); if (dcnt) { - ND_PRINT((ndo, "data:\n")); + ND_PRINT("data:\n"); smb_print_data(ndo, data, dcnt); } } @@ -137,12 +137,12 @@ trans2_qfsinfo(netdissect_options *ndo, smb_fdata(ndo, data, fmt, data + dcnt, unicodestr); } if (dcnt) { - ND_PRINT((ndo, "data:\n")); + ND_PRINT("data:\n"); smb_print_data(ndo, data, dcnt); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static const struct smbfnsint trans2_fns[] = { @@ -191,8 +191,8 @@ print_trans2(netdissect_options *ndo, fn = smbfindint(EXTRACT_LE_U_2(w + 14 * 2), trans2_fns); } else { if (EXTRACT_U_1(words) == 0) { - ND_PRINT((ndo, "%s\n", fn->name)); - ND_PRINT((ndo, "Trans2Interim\n")); + ND_PRINT("%s\n", fn->name); + ND_PRINT("Trans2Interim\n"); return; } ND_TCHECK_2(w + (7 * 2)); @@ -202,7 +202,7 @@ print_trans2(netdissect_options *ndo, data = buf + EXTRACT_LE_U_2(w + 7 * 2); } - ND_PRINT((ndo, "%s param_length=%u data_length=%u\n", fn->name, pcnt, dcnt)); + ND_PRINT("%s param_length=%u data_length=%u\n", fn->name, pcnt, dcnt); if (request) { if (EXTRACT_U_1(words) == 8) { @@ -227,7 +227,7 @@ print_trans2(netdissect_options *ndo, ND_TCHECK_2(dat); bcc = EXTRACT_LE_U_2(dat); - ND_PRINT((ndo, "smb_bcc=%u\n", bcc)); + ND_PRINT("smb_bcc=%u\n", bcc); if (fn->descript.fn) (*fn->descript.fn)(ndo, param, data, pcnt, dcnt); else { @@ -236,7 +236,7 @@ print_trans2(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -317,7 +317,7 @@ print_browse(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } @@ -371,7 +371,7 @@ print_trans(netdissect_options *ndo, ND_TCHECK_2(data1); bcc = EXTRACT_LE_U_2(data1); - ND_PRINT((ndo, "smb_bcc=%u\n", bcc)); + ND_PRINT("smb_bcc=%u\n", bcc); if (bcc > 0) { smb_fdata(ndo, data1 + 2, f2, maxbuf - (paramlen + datalen), unicodestr); @@ -392,7 +392,7 @@ print_trans(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } @@ -424,7 +424,7 @@ print_negprot(netdissect_options *ndo, ND_TCHECK_2(data); bcc = EXTRACT_LE_U_2(data); - ND_PRINT((ndo, "smb_bcc=%u\n", bcc)); + ND_PRINT("smb_bcc=%u\n", bcc); if (bcc > 0) { if (f2) smb_fdata(ndo, data + 2, f2, min(data + 2 + EXTRACT_LE_U_2(data), @@ -435,7 +435,7 @@ print_negprot(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -469,7 +469,7 @@ print_sesssetup(netdissect_options *ndo, ND_TCHECK_2(data); bcc = EXTRACT_LE_U_2(data); - ND_PRINT((ndo, "smb_bcc=%u\n", bcc)); + ND_PRINT("smb_bcc=%u\n", bcc); if (bcc > 0) { if (f2) smb_fdata(ndo, data + 2, f2, min(data + 2 + EXTRACT_LE_U_2(data), @@ -480,7 +480,7 @@ print_sesssetup(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -510,7 +510,7 @@ print_lockingandx(netdissect_options *ndo, ND_TCHECK_2(data); bcc = EXTRACT_LE_U_2(data); - ND_PRINT((ndo, "smb_bcc=%u\n", bcc)); + ND_PRINT("smb_bcc=%u\n", bcc); if (bcc > 0) { if (f2) smb_fdata(ndo, data + 2, f2, min(data + 2 + EXTRACT_LE_U_2(data), @@ -521,7 +521,7 @@ print_lockingandx(netdissect_options *ndo, } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } @@ -819,9 +819,9 @@ print_smb(netdissect_options *ndo, fn = smbfind(command, smb_fns); if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); - ND_PRINT((ndo, "SMB PACKET: %s (%s)\n", fn->name, request ? "REQUEST" : "REPLY")); + ND_PRINT("SMB PACKET: %s (%s)\n", fn->name, request ? "REQUEST" : "REPLY"); if (ndo->ndo_vflag < 2) return; @@ -837,11 +837,11 @@ print_smb(netdissect_options *ndo, if (nterrcodes) { nterror = EXTRACT_LE_U_4(buf + 5); if (nterror) - ND_PRINT((ndo, "NTError = %s\n", nt_errstr(nterror))); + ND_PRINT("NTError = %s\n", nt_errstr(nterror)); } else { if (EXTRACT_U_1(buf + 5)) - ND_PRINT((ndo, "SMBError = %s\n", smb_errstr(EXTRACT_U_1(buf + 5), - EXTRACT_LE_U_2(buf + 7)))); + ND_PRINT("SMBError = %s\n", smb_errstr(EXTRACT_U_1(buf + 5), + EXTRACT_LE_U_2(buf + 7))); } smboffset = 32; @@ -879,20 +879,20 @@ print_smb(netdissect_options *ndo, for (i = 0; words + 1 + 2 * i < maxwords; i++) { ND_TCHECK_2(words + 1 + 2 * i); v = EXTRACT_LE_U_2(words + 1 + 2 * i); - ND_PRINT((ndo, "smb_vwv[%u]=%u (0x%X)\n", i, v, v)); + ND_PRINT("smb_vwv[%u]=%u (0x%X)\n", i, v, v); } } } ND_TCHECK_2(data); bcc = EXTRACT_LE_U_2(data); - ND_PRINT((ndo, "smb_bcc=%u\n", bcc)); + ND_PRINT("smb_bcc=%u\n", bcc); if (f2) { if (bcc > 0) smb_fdata(ndo, data + 2, f2, data + 2 + bcc, unicodestr); } else { if (bcc > 0) { - ND_PRINT((ndo, "smb_buf[]=\n")); + ND_PRINT("smb_buf[]=\n"); smb_print_data(ndo, data + 2, min(bcc, PTR_DIFF(maxbuf, data + 2))); } } @@ -911,19 +911,19 @@ print_smb(netdissect_options *ndo, fn = smbfind(command, smb_fns); - ND_PRINT((ndo, "\nSMB PACKET: %s (%s) (CHAINED)\n", - fn->name, request ? "REQUEST" : "REPLY")); + ND_PRINT("\nSMB PACKET: %s (%s) (CHAINED)\n", + fn->name, request ? "REQUEST" : "REPLY"); if (newsmboffset <= smboffset) { - ND_PRINT((ndo, "Bad andX offset: %u <= %u\n", newsmboffset, smboffset)); + ND_PRINT("Bad andX offset: %u <= %u\n", newsmboffset, smboffset); break; } smboffset = newsmboffset; } - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } @@ -957,18 +957,18 @@ nbt_tcp_print(netdissect_options *ndo, startbuf = data; if (ndo->ndo_vflag < 2) { - ND_PRINT((ndo, " NBT Session Packet: ")); + ND_PRINT(" NBT Session Packet: "); switch (type) { case 0x00: - ND_PRINT((ndo, "Session Message")); + ND_PRINT("Session Message"); break; case 0x81: - ND_PRINT((ndo, "Session Request")); + ND_PRINT("Session Request"); break; case 0x82: - ND_PRINT((ndo, "Session Granted")); + ND_PRINT("Session Granted"); break; case 0x83: @@ -983,29 +983,29 @@ nbt_tcp_print(netdissect_options *ndo, goto trunc; ecode = EXTRACT_U_1(data + 4); - ND_PRINT((ndo, "Session Reject, ")); + ND_PRINT("Session Reject, "); switch (ecode) { case 0x80: - ND_PRINT((ndo, "Not listening on called name")); + ND_PRINT("Not listening on called name"); break; case 0x81: - ND_PRINT((ndo, "Not listening for calling name")); + ND_PRINT("Not listening for calling name"); break; case 0x82: - ND_PRINT((ndo, "Called name not present")); + ND_PRINT("Called name not present"); break; case 0x83: - ND_PRINT((ndo, "Called name present, but insufficient resources")); + ND_PRINT("Called name present, but insufficient resources"); break; default: - ND_PRINT((ndo, "Unspecified error 0x%X", ecode)); + ND_PRINT("Unspecified error 0x%X", ecode); break; } } break; case 0x85: - ND_PRINT((ndo, "Session Keepalive")); + ND_PRINT("Session Keepalive"); break; default: @@ -1013,7 +1013,7 @@ nbt_tcp_print(netdissect_options *ndo, break; } } else { - ND_PRINT((ndo, "\n>>> NBT Session Packet\n")); + ND_PRINT("\n>>> NBT Session Packet\n"); switch (type) { case 0x00: data = smb_fdata(ndo, data, "[P1]NBT Session Message\nFlags=[B]\nLength=[ru]\n", @@ -1023,14 +1023,14 @@ nbt_tcp_print(netdissect_options *ndo, if (nbt_len >= 4 && caplen >= 4 && memcmp(data,"\377SMB",4) == 0) { if (nbt_len > caplen) { if (nbt_len > length) - ND_PRINT((ndo, "WARNING: Packet is continued in later TCP segments\n")); + ND_PRINT("WARNING: Packet is continued in later TCP segments\n"); else - ND_PRINT((ndo, "WARNING: Short packet. Try increasing the snap length by %u\n", - nbt_len - caplen)); + ND_PRINT("WARNING: Short packet. Try increasing the snap length by %u\n", + nbt_len - caplen); } print_smb(ndo, data, maxbuf > data + nbt_len ? data + nbt_len : maxbuf); } else - ND_PRINT((ndo, "Session packet:(raw data or continuation?)\n")); + ND_PRINT("Session packet:(raw data or continuation?)\n"); break; case 0x81: @@ -1057,19 +1057,19 @@ nbt_tcp_print(netdissect_options *ndo, ecode = EXTRACT_U_1(origdata + 4); switch (ecode) { case 0x80: - ND_PRINT((ndo, "Not listening on called name\n")); + ND_PRINT("Not listening on called name\n"); break; case 0x81: - ND_PRINT((ndo, "Not listening for calling name\n")); + ND_PRINT("Not listening for calling name\n"); break; case 0x82: - ND_PRINT((ndo, "Called name not present\n")); + ND_PRINT("Called name not present\n"); break; case 0x83: - ND_PRINT((ndo, "Called name present, but insufficient resources\n")); + ND_PRINT("Called name present, but insufficient resources\n"); break; default: - ND_PRINT((ndo, "Unspecified error 0x%X\n", ecode)); + ND_PRINT("Unspecified error 0x%X\n", ecode); break; } } @@ -1084,11 +1084,11 @@ nbt_tcp_print(netdissect_options *ndo, data = smb_fdata(ndo, data, "NBT - Unknown packet type\nType=[B]\n", maxbuf, 0); break; } - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static const struct tok opcode_str[] = { @@ -1131,33 +1131,33 @@ nbt_udp137_print(netdissect_options *ndo, return; if (ndo->ndo_vflag > 1) - ND_PRINT((ndo, "\n>>> ")); + ND_PRINT("\n>>> "); - ND_PRINT((ndo, "NBT UDP PACKET(137): %s", tok2str(opcode_str, "OPUNKNOWN", opcode))); + ND_PRINT("NBT UDP PACKET(137): %s", tok2str(opcode_str, "OPUNKNOWN", opcode)); if (response) { - ND_PRINT((ndo, "; %s", rcode ? "NEGATIVE" : "POSITIVE")); + ND_PRINT("; %s", rcode ? "NEGATIVE" : "POSITIVE"); } - ND_PRINT((ndo, "; %s; %s", response ? "RESPONSE" : "REQUEST", - (nm_flags & 1) ? "BROADCAST" : "UNICAST")); + ND_PRINT("; %s; %s", response ? "RESPONSE" : "REQUEST", + (nm_flags & 1) ? "BROADCAST" : "UNICAST"); if (ndo->ndo_vflag < 2) return; - ND_PRINT((ndo, "\nTrnID=0x%X\nOpCode=%u\nNmFlags=0x%X\nRcode=%u\nQueryCount=%u\nAnswerCount=%u\nAuthorityCount=%u\nAddressRecCount=%u\n", + ND_PRINT("\nTrnID=0x%X\nOpCode=%u\nNmFlags=0x%X\nRcode=%u\nQueryCount=%u\nAnswerCount=%u\nAuthorityCount=%u\nAddressRecCount=%u\n", name_trn_id, opcode, nm_flags, rcode, qdcount, ancount, nscount, - arcount)); + arcount); p = data + 12; total = ancount + nscount + arcount; if (qdcount > 100 || total > 100) { - ND_PRINT((ndo, "Corrupt packet??\n")); + ND_PRINT("Corrupt packet??\n"); return; } if (qdcount) { - ND_PRINT((ndo, "QuestionRecords:\n")); + ND_PRINT("QuestionRecords:\n"); for (i = 0; i < qdcount; i++) { p = smb_fdata(ndo, p, "|Name=[n1]\nQuestionType=[rw]\nQuestionClass=[rw]\n#", @@ -1168,7 +1168,7 @@ nbt_udp137_print(netdissect_options *ndo, } if (total) { - ND_PRINT((ndo, "\nResourceRecords:\n")); + ND_PRINT("\nResourceRecords:\n"); for (i = 0; i < total; i++) { u_int rdlen; u_int restype; @@ -1183,7 +1183,7 @@ nbt_udp137_print(netdissect_options *ndo, goto out; ND_TCHECK_2(p); rdlen = EXTRACT_BE_U_2(p); - ND_PRINT((ndo, "ResourceLength=%u\nResourceData=\n", rdlen)); + ND_PRINT("ResourceLength=%u\nResourceData=\n", rdlen); p += 2; if (rdlen == 6) { p = smb_fdata(ndo, p, "AddrType=[rw]\nAddress=[b.b.b.b]\n", p + rdlen, 0); @@ -1206,22 +1206,22 @@ nbt_udp137_print(netdissect_options *ndo, if (p >= maxbuf) goto out; if (EXTRACT_U_1(p) & 0x80) - ND_PRINT((ndo, "<GROUP> ")); + ND_PRINT("<GROUP> "); switch (EXTRACT_U_1(p) & 0x60) { - case 0x00: ND_PRINT((ndo, "B ")); break; - case 0x20: ND_PRINT((ndo, "P ")); break; - case 0x40: ND_PRINT((ndo, "M ")); break; - case 0x60: ND_PRINT((ndo, "_ ")); break; + case 0x00: ND_PRINT("B "); break; + case 0x20: ND_PRINT("P "); break; + case 0x40: ND_PRINT("M "); break; + case 0x60: ND_PRINT("_ "); break; } if (EXTRACT_U_1(p) & 0x10) - ND_PRINT((ndo, "<DEREGISTERING> ")); + ND_PRINT("<DEREGISTERING> "); if (EXTRACT_U_1(p) & 0x08) - ND_PRINT((ndo, "<CONFLICT> ")); + ND_PRINT("<CONFLICT> "); if (EXTRACT_U_1(p) & 0x04) - ND_PRINT((ndo, "<ACTIVE> ")); + ND_PRINT("<ACTIVE> "); if (EXTRACT_U_1(p) & 0x02) - ND_PRINT((ndo, "<PERMANENT> ")); - ND_PRINT((ndo, "\n")); + ND_PRINT("<PERMANENT> "); + ND_PRINT("\n"); p += 2; } } else { @@ -1238,10 +1238,10 @@ nbt_udp137_print(netdissect_options *ndo, smb_fdata(ndo, p, "AdditionalData:\n", maxbuf, 0); out: - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* @@ -1273,18 +1273,18 @@ smb_tcp_print(netdissect_options *ndo, if (smb_len >= 4 && caplen >= 4 && memcmp(data,"\377SMB",4) == 0) { if (smb_len > caplen) { if (smb_len > length) - ND_PRINT((ndo, " WARNING: Packet is continued in later TCP segments\n")); + ND_PRINT(" WARNING: Packet is continued in later TCP segments\n"); else - ND_PRINT((ndo, " WARNING: Short packet. Try increasing the snap length by %u\n", - smb_len - caplen)); + ND_PRINT(" WARNING: Short packet. Try increasing the snap length by %u\n", + smb_len - caplen); } else - ND_PRINT((ndo, " ")); + ND_PRINT(" "); print_smb(ndo, data, maxbuf > data + smb_len ? data + smb_len : maxbuf); } else - ND_PRINT((ndo, " SMB-over-TCP packet:(raw data or continuation?)\n")); + ND_PRINT(" SMB-over-TCP packet:(raw data or continuation?)\n"); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* @@ -1303,7 +1303,7 @@ nbt_udp138_print(netdissect_options *ndo, startbuf = data; if (ndo->ndo_vflag < 2) { - ND_PRINT((ndo, "NBT UDP PACKET(138)")); + ND_PRINT("NBT UDP PACKET(138)"); return; } @@ -1320,7 +1320,7 @@ nbt_udp138_print(netdissect_options *ndo, print_smb(ndo, data, maxbuf); } out: - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); } @@ -1406,10 +1406,10 @@ netbeui_print(netdissect_options *ndo, startbuf = data; if (ndo->ndo_vflag < 2) { - ND_PRINT((ndo, "NBF Packet: ")); + ND_PRINT("NBF Packet: "); data = smb_fdata(ndo, data, "[P5]#", maxbuf, 0); } else { - ND_PRINT((ndo, "\n>>> NBF Packet\nType=0x%X ", control)); + ND_PRINT("\n>>> NBF Packet\nType=0x%X ", control); data = smb_fdata(ndo, data, "Length=[u] Signature=[w] Command=[B]\n#", maxbuf, 0); } if (data == NULL) @@ -1422,15 +1422,15 @@ netbeui_print(netdissect_options *ndo, data = smb_fdata(ndo, data, "Unknown NBF Command\n", data2, 0); } else { if (ndo->ndo_vflag < 2) { - ND_PRINT((ndo, "%s", nbf_strings[command].name)); + ND_PRINT("%s", nbf_strings[command].name); if (nbf_strings[command].nonverbose != NULL) data = smb_fdata(ndo, data, nbf_strings[command].nonverbose, data2, 0); } else { - ND_PRINT((ndo, "%s:\n", nbf_strings[command].name)); + ND_PRINT("%s:\n", nbf_strings[command].name); if (nbf_strings[command].verbose != NULL) data = smb_fdata(ndo, data, nbf_strings[command].verbose, data2, 0); else - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); } } @@ -1462,7 +1462,7 @@ netbeui_print(netdissect_options *ndo, if ((data2 + i + 3) >= maxbuf) break; if (memcmp(data2 + i, "\377SMB", 4) == 0) { - ND_PRINT((ndo, "found SMB packet at %u\n", i)); + ND_PRINT("found SMB packet at %u\n", i); print_smb(ndo, data2 + i, maxbuf); break; } @@ -1470,10 +1470,10 @@ netbeui_print(netdissect_options *ndo, } out: - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } @@ -1502,7 +1502,7 @@ ipx_netbios_print(netdissect_options *ndo, if (memcmp(data + i, "\377SMB", 4) == 0) { smb_fdata(ndo, data, "\n>>> IPX transport ", data + i, 0); print_smb(ndo, data + i, maxbuf); - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); break; } } diff --git a/print-snmp.c b/print-snmp.c index 976264c6..8a13adcb 100644 --- a/print-snmp.c +++ b/print-snmp.c @@ -332,10 +332,10 @@ static const struct obj_abrev { } while ((objp = objp->next) != NULL); \ } \ if (objp) { \ - ND_PRINT((ndo, suppressdot?"%s":".%s", objp->desc)); \ + ND_PRINT(suppressdot?"%s":".%s", objp->desc); \ objp = objp->child; \ } else \ - ND_PRINT((ndo, suppressdot?"%u":".%u", (o))); \ + ND_PRINT(suppressdot?"%u":".%u", (o)); \ } /* @@ -426,7 +426,7 @@ asn1_parse(netdissect_options *ndo, elem->asnlen = 0; elem->type = BE_ANY; if (len < 1) { - ND_PRINT((ndo, "[nothing to parse]")); + ND_PRINT("[nothing to parse]"); return -1; } ND_TCHECK_1(p); @@ -467,7 +467,7 @@ asn1_parse(netdissect_options *ndo, ND_TCHECK_1(p); while (EXTRACT_U_1(p) & ASN_BIT8) { if (len < 1) { - ND_PRINT((ndo, "[Xtagfield?]")); + ND_PRINT("[Xtagfield?]"); return -1; } id = (id << 7) | (EXTRACT_U_1(p) & ~ASN_BIT8); @@ -477,7 +477,7 @@ asn1_parse(netdissect_options *ndo, ND_TCHECK_1(p); } if (len < 1) { - ND_PRINT((ndo, "[Xtagfield?]")); + ND_PRINT("[Xtagfield?]"); return -1; } ND_TCHECK_1(p); @@ -487,7 +487,7 @@ asn1_parse(netdissect_options *ndo, ++p; } if (len < 1) { - ND_PRINT((ndo, "[no asnlen]")); + ND_PRINT("[no asnlen]"); return -1; } ND_TCHECK_1(p); @@ -497,7 +497,7 @@ asn1_parse(netdissect_options *ndo, uint32_t noct = elem->asnlen % ASN_BIT8; elem->asnlen = 0; if (len < noct) { - ND_PRINT((ndo, "[asnlen? %d<%d]", len, noct)); + ND_PRINT("[asnlen? %d<%d]", len, noct); return -1; } ND_TCHECK_LEN(p, noct); @@ -507,19 +507,19 @@ asn1_parse(netdissect_options *ndo, } } if (len < elem->asnlen) { - ND_PRINT((ndo, "[len%d<asnlen%u]", len, elem->asnlen)); + ND_PRINT("[len%d<asnlen%u]", len, elem->asnlen); return -1; } if (form >= sizeof(Form)/sizeof(Form[0])) { - ND_PRINT((ndo, "[form?%d]", form)); + ND_PRINT("[form?%d]", form); return -1; } if (class >= sizeof(Class)/sizeof(Class[0])) { - ND_PRINT((ndo, "[class?%c/%d]", *Form[form], class)); + ND_PRINT("[class?%c/%d]", *Form[form], class); return -1; } if ((int)id >= Class[class].numIDs) { - ND_PRINT((ndo, "[id?%c/%s/%d]", *Form[form], Class[class].name, id)); + ND_PRINT("[id?%c/%s/%d]", *Form[form], Class[class].name, id); return -1; } ND_TCHECK_LEN(p, elem->asnlen); @@ -540,7 +540,7 @@ asn1_parse(netdissect_options *ndo, data = 0; if (elem->asnlen == 0) { - ND_PRINT((ndo, "[asnlen=0]")); + ND_PRINT("[asnlen=0]"); return -1; } if (EXTRACT_U_1(p) & ASN_BIT8) /* negative */ @@ -564,7 +564,7 @@ asn1_parse(netdissect_options *ndo, default: elem->type = BE_OCTET; elem->data.raw = (const uint8_t *)p; - ND_PRINT((ndo, "[P/U/%s]", Class[class].Id[id])); + ND_PRINT("[P/U/%s]", Class[class].Id[id]); break; } break; @@ -601,8 +601,8 @@ asn1_parse(netdissect_options *ndo, default: elem->type = BE_OCTET; elem->data.raw = (const uint8_t *)p; - ND_PRINT((ndo, "[P/A/%s]", - Class[class].Id[id])); + ND_PRINT("[P/A/%s]", + Class[class].Id[id]); break; } break; @@ -627,7 +627,7 @@ asn1_parse(netdissect_options *ndo, break; default: - ND_PRINT((ndo, "[P/%s/%s]", Class[class].name, Class[class].Id[id])); + ND_PRINT("[P/%s/%s]", Class[class].name, Class[class].Id[id]); elem->type = BE_OCTET; elem->data.raw = (const uint8_t *)p; break; @@ -646,7 +646,7 @@ asn1_parse(netdissect_options *ndo, default: elem->type = BE_OCTET; elem->data.raw = (const uint8_t *)p; - ND_PRINT((ndo, "C/U/%s", Class[class].Id[id])); + ND_PRINT("C/U/%s", Class[class].Id[id]); break; } break; @@ -659,7 +659,7 @@ asn1_parse(netdissect_options *ndo, default: elem->type = BE_OCTET; elem->data.raw = (const uint8_t *)p; - ND_PRINT((ndo, "C/%s/%s", Class[class].name, Class[class].Id[id])); + ND_PRINT("C/%s/%s", Class[class].name, Class[class].Id[id]); break; } break; @@ -669,7 +669,7 @@ asn1_parse(netdissect_options *ndo, return elem->asnlen + hdr; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -682,11 +682,11 @@ asn1_print_octets(netdissect_options *ndo, struct be *elem) ND_TCHECK_LEN(p, asnlen); for (i = asnlen; i-- > 0; p++) - ND_PRINT((ndo, "_%.2x", EXTRACT_U_1(p))); + ND_PRINT("_%.2x", EXTRACT_U_1(p)); return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -704,22 +704,22 @@ asn1_print_string(netdissect_options *ndo, struct be *elem) printable = ND_ISPRINT(EXTRACT_U_1(p)); p = elem->data.str; if (printable) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); if (fn_printn(ndo, p, asnlen, ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); goto trunc; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); } else { for (i = asnlen; i-- > 0; p++) { - ND_PRINT((ndo, first ? "%.2x" : "_%.2x", EXTRACT_U_1(p))); + ND_PRINT(first ? "%.2x" : "_%.2x", EXTRACT_U_1(p)); first = 0; } } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -762,7 +762,7 @@ asn1_print(netdissect_options *ndo, objp = a->node->child; i -= a->oid_len; p += a->oid_len; - ND_PRINT((ndo, "%s", a->prefix)); + ND_PRINT("%s", a->prefix); first = 1; break; } @@ -799,15 +799,15 @@ asn1_print(netdissect_options *ndo, } case BE_INT: - ND_PRINT((ndo, "%d", elem->data.integer)); + ND_PRINT("%d", elem->data.integer); break; case BE_UNS: - ND_PRINT((ndo, "%u", elem->data.uns)); + ND_PRINT("%u", elem->data.uns); break; case BE_UNS64: - ND_PRINT((ndo, "%" PRIu64, elem->data.uns64)); + ND_PRINT("%" PRIu64, elem->data.uns64); break; case BE_STR: @@ -816,41 +816,41 @@ asn1_print(netdissect_options *ndo, break; case BE_SEQ: - ND_PRINT((ndo, "Seq(%u)", elem->asnlen)); + ND_PRINT("Seq(%u)", elem->asnlen); break; case BE_INETADDR: if (asnlen != ASNLEN_INETADDR) - ND_PRINT((ndo, "[inetaddr len!=%d]", ASNLEN_INETADDR)); + ND_PRINT("[inetaddr len!=%d]", ASNLEN_INETADDR); p = (const u_char *)elem->data.raw; ND_TCHECK_LEN(p, asnlen); for (i = asnlen; i-- != 0; p++) { - ND_PRINT((ndo, (i == asnlen-1) ? "%u" : ".%u", EXTRACT_U_1(p))); + ND_PRINT((i == asnlen-1) ? "%u" : ".%u", EXTRACT_U_1(p)); } break; case BE_NOSUCHOBJECT: case BE_NOSUCHINST: case BE_ENDOFMIBVIEW: - ND_PRINT((ndo, "[%s]", Class[EXCEPTIONS].Id[elem->id])); + ND_PRINT("[%s]", Class[EXCEPTIONS].Id[elem->id]); break; case BE_PDU: - ND_PRINT((ndo, "%s(%u)", Class[CONTEXT].Id[elem->id], elem->asnlen)); + ND_PRINT("%s(%u)", Class[CONTEXT].Id[elem->id], elem->asnlen); break; case BE_ANY: - ND_PRINT((ndo, "[BE_ANY!?]")); + ND_PRINT("[BE_ANY!?]"); break; default: - ND_PRINT((ndo, "[be!?]")); + ND_PRINT("[be!?]"); break; } return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -873,13 +873,13 @@ asn1_decode(u_char *p, u_int length) while (i >= 0 && length > 0) { i = asn1_parse(ndo, p, length, &elem); if (i >= 0) { - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (asn1_print(ndo, &elem) < 0) return; if (elem.type == BE_SEQ || elem.type == BE_PDU) { - ND_PRINT((ndo, " {")); + ND_PRINT(" {"); asn1_decode(elem.data.raw, elem.asnlen); - ND_PRINT((ndo, " }")); + ND_PRINT(" }"); } length -= i; p += i; @@ -948,7 +948,7 @@ smi_decode_oid(netdissect_options *ndo, return 0; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return -1; } @@ -1064,12 +1064,12 @@ smi_print_variable(netdissect_options *ndo, return NULL; } if (ndo->ndo_vflag) { - ND_PRINT((ndo, "%s::", smiGetNodeModule(smiNode)->name)); + ND_PRINT("%s::", smiGetNodeModule(smiNode)->name); } - ND_PRINT((ndo, "%s", smiNode->name)); + ND_PRINT("%s", smiNode->name); if (smiNode->oidlen < oidlen) { for (i = smiNode->oidlen; i < oidlen; i++) { - ND_PRINT((ndo, ".%u", oid[i])); + ND_PRINT(".%u", oid[i]); } } *status = 0; @@ -1097,20 +1097,20 @@ smi_print_value(netdissect_options *ndo, } if (NOTIFY_CLASS(pduid) && smiNode->access < SMI_ACCESS_NOTIFY) { - ND_PRINT((ndo, "[notNotifyable]")); + ND_PRINT("[notNotifyable]"); } if (READ_CLASS(pduid) && smiNode->access < SMI_ACCESS_READ_ONLY) { - ND_PRINT((ndo, "[notReadable]")); + ND_PRINT("[notReadable]"); } if (WRITE_CLASS(pduid) && smiNode->access < SMI_ACCESS_READ_WRITE) { - ND_PRINT((ndo, "[notWritable]")); + ND_PRINT("[notWritable]"); } if (RESPONSE_CLASS(pduid) && smiNode->access == SMI_ACCESS_NOT_ACCESSIBLE) { - ND_PRINT((ndo, "[noAccess]")); + ND_PRINT("[noAccess]"); } smiType = smiGetNodeType(smiNode); @@ -1119,11 +1119,11 @@ smi_print_value(netdissect_options *ndo, } if (! smi_check_type(smiType->basetype, elem->type)) { - ND_PRINT((ndo, "[wrongType]")); + ND_PRINT("[wrongType]"); } if (! smi_check_range(smiType, elem)) { - ND_PRINT((ndo, "[outOfRange]")); + ND_PRINT("[outOfRange]"); } /* resolve bits to named bits */ @@ -1146,13 +1146,13 @@ smi_print_value(netdissect_options *ndo, smiNode = smiGetNodeByOID(oidlen, oid); if (smiNode) { if (ndo->ndo_vflag) { - ND_PRINT((ndo, "%s::", smiGetNodeModule(smiNode)->name)); + ND_PRINT("%s::", smiGetNodeModule(smiNode)->name); } - ND_PRINT((ndo, "%s", smiNode->name)); + ND_PRINT("%s", smiNode->name); if (smiNode->oidlen < oidlen) { for (i = smiNode->oidlen; i < oidlen; i++) { - ND_PRINT((ndo, ".%u", oid[i])); + ND_PRINT(".%u", oid[i]); } } done++; @@ -1168,8 +1168,8 @@ smi_print_value(netdissect_options *ndo, nn = smiGetNextNamedNumber(nn)) { if (nn->value.value.integer32 == elem->data.integer) { - ND_PRINT((ndo, "%s", nn->name)); - ND_PRINT((ndo, "(%d)", elem->data.integer)); + ND_PRINT("%s", nn->name); + ND_PRINT("(%d)", elem->data.integer); done++; break; } @@ -1236,12 +1236,12 @@ varbind_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_SEQ) { - ND_PRINT((ndo, "[!SEQ of varbind]")); + ND_PRINT("[!SEQ of varbind]"); asn1_print(ndo, &elem); return; } if ((u_int)count < length) - ND_PRINT((ndo, "[%d extra after SEQ of varbind]", length - count)); + ND_PRINT("[%d extra after SEQ of varbind]", length - count); /* descend */ length = elem.asnlen; np = (const u_char *)elem.data.raw; @@ -1250,13 +1250,13 @@ varbind_print(netdissect_options *ndo, const u_char *vbend; u_int vblength; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* Sequence */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_SEQ) { - ND_PRINT((ndo, "[!varbind]")); + ND_PRINT("[!varbind]"); asn1_print(ndo, &elem); return; } @@ -1270,7 +1270,7 @@ varbind_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_OID) { - ND_PRINT((ndo, "[objName!=OID]")); + ND_PRINT("[objName!=OID]"); asn1_print(ndo, &elem); return; } @@ -1286,7 +1286,7 @@ varbind_print(netdissect_options *ndo, if (pduid != GETREQ && pduid != GETNEXTREQ && pduid != GETBULKREQ) - ND_PRINT((ndo, "=")); + ND_PRINT("="); /* objVal (ANY) */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) @@ -1294,7 +1294,7 @@ varbind_print(netdissect_options *ndo, if (pduid == GETREQ || pduid == GETNEXTREQ || pduid == GETBULKREQ) { if (elem.type != BE_NULL) { - ND_PRINT((ndo, "[objVal!=NULL]")); + ND_PRINT("[objVal!=NULL]"); if (asn1_print(ndo, &elem) < 0) return; } @@ -1329,12 +1329,12 @@ snmppdu_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[reqId!=INT]")); + ND_PRINT("[reqId!=INT]"); asn1_print(ndo, &elem); return; } if (ndo->ndo_vflag) - ND_PRINT((ndo, "R=%d ", elem.data.integer)); + ND_PRINT("R=%d ", elem.data.integer); length -= count; np += count; @@ -1342,7 +1342,7 @@ snmppdu_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[errorStatus!=INT]")); + ND_PRINT("[errorStatus!=INT]"); asn1_print(ndo, &elem); return; } @@ -1351,13 +1351,13 @@ snmppdu_print(netdissect_options *ndo, || pduid == INFORMREQ || pduid == V2TRAP || pduid == REPORT) && elem.data.integer != 0) { char errbuf[20]; - ND_PRINT((ndo, "[errorStatus(%s)!=0]", - DECODE_ErrorStatus(elem.data.integer))); + ND_PRINT("[errorStatus(%s)!=0]", + DECODE_ErrorStatus(elem.data.integer)); } else if (pduid == GETBULKREQ) { - ND_PRINT((ndo, " N=%d", elem.data.integer)); + ND_PRINT(" N=%d", elem.data.integer); } else if (elem.data.integer != 0) { char errbuf[20]; - ND_PRINT((ndo, " %s", DECODE_ErrorStatus(elem.data.integer))); + ND_PRINT(" %s", DECODE_ErrorStatus(elem.data.integer)); error_status = elem.data.integer; } length -= count; @@ -1367,23 +1367,23 @@ snmppdu_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[errorIndex!=INT]")); + ND_PRINT("[errorIndex!=INT]"); asn1_print(ndo, &elem); return; } if ((pduid == GETREQ || pduid == GETNEXTREQ || pduid == SETREQ || pduid == INFORMREQ || pduid == V2TRAP || pduid == REPORT) && elem.data.integer != 0) - ND_PRINT((ndo, "[errorIndex(%d)!=0]", elem.data.integer)); + ND_PRINT("[errorIndex(%d)!=0]", elem.data.integer); else if (pduid == GETBULKREQ) - ND_PRINT((ndo, " M=%d", elem.data.integer)); + ND_PRINT(" M=%d", elem.data.integer); else if (elem.data.integer != 0) { if (!error_status) - ND_PRINT((ndo, "[errorIndex(%d) w/o errorStatus]", elem.data.integer)); + ND_PRINT("[errorIndex(%d) w/o errorStatus]", elem.data.integer); else - ND_PRINT((ndo, "@%d", elem.data.integer)); + ND_PRINT("@%d", elem.data.integer); } else if (error_status) { - ND_PRINT((ndo, "[errorIndex==0]")); + ND_PRINT("[errorIndex==0]"); } length -= count; np += count; @@ -1402,13 +1402,13 @@ trappdu_print(netdissect_options *ndo, struct be elem; int count = 0, generic; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* enterprise (oid) */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_OID) { - ND_PRINT((ndo, "[enterprise!=OID]")); + ND_PRINT("[enterprise!=OID]"); asn1_print(ndo, &elem); return; } @@ -1417,13 +1417,13 @@ trappdu_print(netdissect_options *ndo, length -= count; np += count; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* agent-addr (inetaddr) */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INETADDR) { - ND_PRINT((ndo, "[agent-addr!=INETADDR]")); + ND_PRINT("[agent-addr!=INETADDR]"); asn1_print(ndo, &elem); return; } @@ -1436,14 +1436,14 @@ trappdu_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[generic-trap!=INT]")); + ND_PRINT("[generic-trap!=INT]"); asn1_print(ndo, &elem); return; } generic = elem.data.integer; { char buf[20]; - ND_PRINT((ndo, " %s", DECODE_GenericTrap(generic))); + ND_PRINT(" %s", DECODE_GenericTrap(generic)); } length -= count; np += count; @@ -1452,25 +1452,25 @@ trappdu_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[specific-trap!=INT]")); + ND_PRINT("[specific-trap!=INT]"); asn1_print(ndo, &elem); return; } if (generic != GT_ENTERPRISE) { if (elem.data.integer != 0) - ND_PRINT((ndo, "[specific-trap(%d)!=0]", elem.data.integer)); + ND_PRINT("[specific-trap(%d)!=0]", elem.data.integer); } else - ND_PRINT((ndo, " s=%d", elem.data.integer)); + ND_PRINT(" s=%d", elem.data.integer); length -= count; np += count; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* time-stamp (TimeTicks) */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_UNS) { /* XXX */ - ND_PRINT((ndo, "[time-stamp!=TIMETICKS]")); + ND_PRINT("[time-stamp!=TIMETICKS]"); asn1_print(ndo, &elem); return; } @@ -1497,17 +1497,17 @@ pdu_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &pdu)) < 0) return; if (pdu.type != BE_PDU) { - ND_PRINT((ndo, "[no PDU]")); + ND_PRINT("[no PDU]"); return; } if ((u_int)count < length) - ND_PRINT((ndo, "[%d extra after PDU]", length - count)); + ND_PRINT("[%d extra after PDU]", length - count); if (ndo->ndo_vflag) { - ND_PRINT((ndo, "{ ")); + ND_PRINT("{ "); } if (asn1_print(ndo, &pdu) < 0) return; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* descend into PDU */ length = pdu.asnlen; np = (const u_char *)pdu.data.raw; @@ -1515,12 +1515,12 @@ pdu_print(netdissect_options *ndo, if (version == SNMP_VERSION_1 && (pdu.id == GETBULKREQ || pdu.id == INFORMREQ || pdu.id == V2TRAP || pdu.id == REPORT)) { - ND_PRINT((ndo, "[v2 PDU in v1 message]")); + ND_PRINT("[v2 PDU in v1 message]"); return; } if (version == SNMP_VERSION_2 && pdu.id == TRAP) { - ND_PRINT((ndo, "[v1 PDU in v2 message]")); + ND_PRINT("[v1 PDU in v2 message]"); return; } @@ -1541,7 +1541,7 @@ pdu_print(netdissect_options *ndo, } if (ndo->ndo_vflag) { - ND_PRINT((ndo, " } ")); + ND_PRINT(" } "); } } @@ -1559,7 +1559,7 @@ scopedpdu_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_SEQ) { - ND_PRINT((ndo, "[!scoped PDU]")); + ND_PRINT("[!scoped PDU]"); asn1_print(ndo, &elem); return; } @@ -1570,33 +1570,33 @@ scopedpdu_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_STR) { - ND_PRINT((ndo, "[contextEngineID!=STR]")); + ND_PRINT("[contextEngineID!=STR]"); asn1_print(ndo, &elem); return; } length -= count; np += count; - ND_PRINT((ndo, "E=")); + ND_PRINT("E="); if (asn1_print_octets(ndo, &elem) == -1) return; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* contextName (OCTET STRING) */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_STR) { - ND_PRINT((ndo, "[contextName!=STR]")); + ND_PRINT("[contextName!=STR]"); asn1_print(ndo, &elem); return; } length -= count; np += count; - ND_PRINT((ndo, "C=")); + ND_PRINT("C="); if (asn1_print_string(ndo, &elem) == -1) return; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); pdu_print(ndo, np, length, version); } @@ -1615,7 +1615,7 @@ community_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_STR) { - ND_PRINT((ndo, "[comm!=STR]")); + ND_PRINT("[comm!=STR]"); asn1_print(ndo, &elem); return; } @@ -1624,10 +1624,10 @@ community_print(netdissect_options *ndo, strncmp((const char *)elem.data.str, DEF_COMMUNITY, sizeof(DEF_COMMUNITY) - 1) == 0)) { /* ! "public" */ - ND_PRINT((ndo, "C=")); + ND_PRINT("C="); if (asn1_print_string(ndo, &elem) == -1) return; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); } length -= count; np += count; @@ -1649,7 +1649,7 @@ usm_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_SEQ) { - ND_PRINT((ndo, "[!usm]")); + ND_PRINT("[!usm]"); asn1_print(ndo, &elem); return; } @@ -1660,7 +1660,7 @@ usm_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_STR) { - ND_PRINT((ndo, "[msgAuthoritativeEngineID!=STR]")); + ND_PRINT("[msgAuthoritativeEngineID!=STR]"); asn1_print(ndo, &elem); return; } @@ -1671,12 +1671,12 @@ usm_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[msgAuthoritativeEngineBoots!=INT]")); + ND_PRINT("[msgAuthoritativeEngineBoots!=INT]"); asn1_print(ndo, &elem); return; } if (ndo->ndo_vflag) - ND_PRINT((ndo, "B=%d ", elem.data.integer)); + ND_PRINT("B=%d ", elem.data.integer); length -= count; np += count; @@ -1684,12 +1684,12 @@ usm_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[msgAuthoritativeEngineTime!=INT]")); + ND_PRINT("[msgAuthoritativeEngineTime!=INT]"); asn1_print(ndo, &elem); return; } if (ndo->ndo_vflag) - ND_PRINT((ndo, "T=%d ", elem.data.integer)); + ND_PRINT("T=%d ", elem.data.integer); length -= count; np += count; @@ -1697,23 +1697,23 @@ usm_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_STR) { - ND_PRINT((ndo, "[msgUserName!=STR]")); + ND_PRINT("[msgUserName!=STR]"); asn1_print(ndo, &elem); return; } length -= count; np += count; - ND_PRINT((ndo, "U=")); + ND_PRINT("U="); if (asn1_print_string(ndo, &elem) == -1) return; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* msgAuthenticationParameters (OCTET STRING) */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_STR) { - ND_PRINT((ndo, "[msgAuthenticationParameters!=STR]")); + ND_PRINT("[msgAuthenticationParameters!=STR]"); asn1_print(ndo, &elem); return; } @@ -1724,7 +1724,7 @@ usm_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_STR) { - ND_PRINT((ndo, "[msgPrivacyParameters!=STR]")); + ND_PRINT("[msgPrivacyParameters!=STR]"); asn1_print(ndo, &elem); return; } @@ -1732,7 +1732,7 @@ usm_print(netdissect_options *ndo, np += count; if ((u_int)count < length) - ND_PRINT((ndo, "[%d extra after usm SEQ]", length - count)); + ND_PRINT("[%d extra after usm SEQ]", length - count); } /* @@ -1753,7 +1753,7 @@ v3msg_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_SEQ) { - ND_PRINT((ndo, "[!message]")); + ND_PRINT("[!message]"); asn1_print(ndo, &elem); return; } @@ -1761,14 +1761,14 @@ v3msg_print(netdissect_options *ndo, np = (const u_char *)elem.data.raw; if (ndo->ndo_vflag) { - ND_PRINT((ndo, "{ ")); + ND_PRINT("{ "); } /* msgID (INTEGER) */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[msgID!=INT]")); + ND_PRINT("[msgID!=INT]"); asn1_print(ndo, &elem); return; } @@ -1779,7 +1779,7 @@ v3msg_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[msgMaxSize!=INT]")); + ND_PRINT("[msgMaxSize!=INT]"); asn1_print(ndo, &elem); return; } @@ -1790,33 +1790,33 @@ v3msg_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_STR) { - ND_PRINT((ndo, "[msgFlags!=STR]")); + ND_PRINT("[msgFlags!=STR]"); asn1_print(ndo, &elem); return; } if (elem.asnlen != 1) { - ND_PRINT((ndo, "[msgFlags size %d]", elem.asnlen)); + ND_PRINT("[msgFlags size %d]", elem.asnlen); return; } flags = EXTRACT_U_1(elem.data.str); if (flags != 0x00 && flags != 0x01 && flags != 0x03 && flags != 0x04 && flags != 0x05 && flags != 0x07) { - ND_PRINT((ndo, "[msgFlags=0x%02X]", flags)); + ND_PRINT("[msgFlags=0x%02X]", flags); return; } length -= count; np += count; - ND_PRINT((ndo, "F=%s%s%s ", + ND_PRINT("F=%s%s%s ", flags & 0x01 ? "a" : "", flags & 0x02 ? "p" : "", - flags & 0x04 ? "r" : "")); + flags & 0x04 ? "r" : ""); /* msgSecurityModel (INTEGER) */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[msgSecurityModel!=INT]")); + ND_PRINT("[msgSecurityModel!=INT]"); asn1_print(ndo, &elem); return; } @@ -1825,18 +1825,18 @@ v3msg_print(netdissect_options *ndo, np += count; if ((u_int)count < length) - ND_PRINT((ndo, "[%d extra after message SEQ]", length - count)); + ND_PRINT("[%d extra after message SEQ]", length - count); if (ndo->ndo_vflag) { - ND_PRINT((ndo, "} ")); + ND_PRINT("} "); } if (model == 3) { if (ndo->ndo_vflag) { - ND_PRINT((ndo, "{ USM ")); + ND_PRINT("{ USM "); } } else { - ND_PRINT((ndo, "[security model %d]", model)); + ND_PRINT("[security model %d]", model); return; } @@ -1847,7 +1847,7 @@ v3msg_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_STR) { - ND_PRINT((ndo, "[msgSecurityParameters!=STR]")); + ND_PRINT("[msgSecurityParameters!=STR]"); asn1_print(ndo, &elem); return; } @@ -1857,18 +1857,18 @@ v3msg_print(netdissect_options *ndo, if (model == 3) { usm_print(ndo, elem.data.str, elem.asnlen); if (ndo->ndo_vflag) { - ND_PRINT((ndo, "} ")); + ND_PRINT("} "); } } if (ndo->ndo_vflag) { - ND_PRINT((ndo, "{ ScopedPDU ")); + ND_PRINT("{ ScopedPDU "); } scopedpdu_print(ndo, np, length, 3); if (ndo->ndo_vflag) { - ND_PRINT((ndo, "} ")); + ND_PRINT("} "); } } @@ -1883,18 +1883,18 @@ snmp_print(netdissect_options *ndo, int count = 0; int version = 0; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* initial Sequence */ if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_SEQ) { - ND_PRINT((ndo, "[!init SEQ]")); + ND_PRINT("[!init SEQ]"); asn1_print(ndo, &elem); return; } if ((u_int)count < length) - ND_PRINT((ndo, "[%d extra after iSEQ]", length - count)); + ND_PRINT("[%d extra after iSEQ]", length - count); /* descend */ length = elem.asnlen; np = (const u_char *)elem.data.raw; @@ -1903,7 +1903,7 @@ snmp_print(netdissect_options *ndo, if ((count = asn1_parse(ndo, np, length, &elem)) < 0) return; if (elem.type != BE_INT) { - ND_PRINT((ndo, "[version!=INT]")); + ND_PRINT("[version!=INT]"); asn1_print(ndo, &elem); return; } @@ -1913,10 +1913,10 @@ snmp_print(netdissect_options *ndo, case SNMP_VERSION_2: case SNMP_VERSION_3: if (ndo->ndo_vflag) - ND_PRINT((ndo, "{ %s ", SnmpVersion[elem.data.integer])); + ND_PRINT("{ %s ", SnmpVersion[elem.data.integer]); break; default: - ND_PRINT((ndo, "SNMP [version = %d]", elem.data.integer)); + ND_PRINT("SNMP [version = %d]", elem.data.integer); return; } version = elem.data.integer; @@ -1932,11 +1932,11 @@ snmp_print(netdissect_options *ndo, v3msg_print(ndo, np, length); break; default: - ND_PRINT((ndo, "[version = %d]", elem.data.integer)); + ND_PRINT("[version = %d]", elem.data.integer); break; } if (ndo->ndo_vflag) { - ND_PRINT((ndo, "} ")); + ND_PRINT("} "); } } diff --git a/print-stp.c b/print-stp.c index fb3ad248..78cf1f4a 100644 --- a/print-stp.c +++ b/print-stp.c @@ -108,13 +108,13 @@ stp_print_config_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, ND_TCHECK(stp_bpdu->flags); bpdu_flags = EXTRACT_U_1(stp_bpdu->flags); - ND_PRINT((ndo, ", Flags [%s]", - bittok2str(stp_bpdu_flag_values, "none", bpdu_flags))); + ND_PRINT(", Flags [%s]", + bittok2str(stp_bpdu_flag_values, "none", bpdu_flags)); ND_TCHECK(stp_bpdu->port_id); - ND_PRINT((ndo, ", bridge-id %s.%04x, length %u", + ND_PRINT(", bridge-id %s.%04x, length %u", stp_print_bridge_id((const u_char *)&stp_bpdu->bridge_id), - EXTRACT_BE_U_2(stp_bpdu->port_id), length)); + EXTRACT_BE_U_2(stp_bpdu->port_id), length); /* in non-verbose mode just print the bridge-id */ if (!ndo->ndo_vflag) { @@ -122,22 +122,22 @@ stp_print_config_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, } ND_TCHECK(stp_bpdu->forward_delay); - ND_PRINT((ndo, "\n\tmessage-age %.2fs, max-age %.2fs" + ND_PRINT("\n\tmessage-age %.2fs, max-age %.2fs" ", hello-time %.2fs, forwarding-delay %.2fs", (float) EXTRACT_BE_U_2(stp_bpdu->message_age) / STP_TIME_BASE, (float) EXTRACT_BE_U_2(stp_bpdu->max_age) / STP_TIME_BASE, (float) EXTRACT_BE_U_2(stp_bpdu->hello_time) / STP_TIME_BASE, - (float) EXTRACT_BE_U_2(stp_bpdu->forward_delay) / STP_TIME_BASE)); + (float) EXTRACT_BE_U_2(stp_bpdu->forward_delay) / STP_TIME_BASE); - ND_PRINT((ndo, "\n\troot-id %s, root-pathcost %u", + ND_PRINT("\n\troot-id %s, root-pathcost %u", stp_print_bridge_id((const u_char *)&stp_bpdu->root_id), - EXTRACT_BE_U_4(stp_bpdu->root_path_cost))); + EXTRACT_BE_U_4(stp_bpdu->root_path_cost)); /* Port role is only valid for 802.1w */ if (EXTRACT_U_1(stp_bpdu->protocol_version) == STP_PROTO_RAPID) { - ND_PRINT((ndo, ", port-role %s", + ND_PRINT(", port-role %s", tok2str(rstp_obj_port_role_values, "Unknown", - RSTP_EXTRACT_PORT_ROLE(bpdu_flags)))); + RSTP_EXTRACT_PORT_ROLE(bpdu_flags))); } return 1; @@ -254,8 +254,8 @@ stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, ptr = (const u_char *)stp_bpdu; ND_TCHECK(stp_bpdu->flags); bpdu_flags = EXTRACT_U_1(stp_bpdu->flags); - ND_PRINT((ndo, ", CIST Flags [%s], length %u", - bittok2str(stp_bpdu_flag_values, "none", bpdu_flags), length)); + ND_PRINT(", CIST Flags [%s], length %u", + bittok2str(stp_bpdu_flag_values, "none", bpdu_flags), length); /* * in non-verbose mode just print the flags. @@ -264,54 +264,54 @@ stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, return 1; } - ND_PRINT((ndo, "\n\tport-role %s, ", + ND_PRINT("\n\tport-role %s, ", tok2str(rstp_obj_port_role_values, "Unknown", - RSTP_EXTRACT_PORT_ROLE(bpdu_flags)))); + RSTP_EXTRACT_PORT_ROLE(bpdu_flags))); ND_TCHECK(stp_bpdu->root_path_cost); - ND_PRINT((ndo, "CIST root-id %s, CIST ext-pathcost %u", + ND_PRINT("CIST root-id %s, CIST ext-pathcost %u", stp_print_bridge_id((const u_char *)&stp_bpdu->root_id), - EXTRACT_BE_U_4(stp_bpdu->root_path_cost))); + EXTRACT_BE_U_4(stp_bpdu->root_path_cost)); ND_TCHECK(stp_bpdu->bridge_id); - ND_PRINT((ndo, "\n\tCIST regional-root-id %s, ", - stp_print_bridge_id((const u_char *)&stp_bpdu->bridge_id))); + ND_PRINT("\n\tCIST regional-root-id %s, ", + stp_print_bridge_id((const u_char *)&stp_bpdu->bridge_id)); ND_TCHECK(stp_bpdu->port_id); - ND_PRINT((ndo, "CIST port-id %04x,", EXTRACT_BE_U_2(stp_bpdu->port_id))); + ND_PRINT("CIST port-id %04x,", EXTRACT_BE_U_2(stp_bpdu->port_id)); ND_TCHECK(stp_bpdu->forward_delay); - ND_PRINT((ndo, "\n\tmessage-age %.2fs, max-age %.2fs" + ND_PRINT("\n\tmessage-age %.2fs, max-age %.2fs" ", hello-time %.2fs, forwarding-delay %.2fs", (float) EXTRACT_BE_U_2(stp_bpdu->message_age) / STP_TIME_BASE, (float) EXTRACT_BE_U_2(stp_bpdu->max_age) / STP_TIME_BASE, (float) EXTRACT_BE_U_2(stp_bpdu->hello_time) / STP_TIME_BASE, - (float) EXTRACT_BE_U_2(stp_bpdu->forward_delay) / STP_TIME_BASE)); + (float) EXTRACT_BE_U_2(stp_bpdu->forward_delay) / STP_TIME_BASE); ND_TCHECK_2(ptr + MST_BPDU_VER3_LEN_OFFSET); - ND_PRINT((ndo, "\n\tv3len %u, ", EXTRACT_BE_U_2(ptr + MST_BPDU_VER3_LEN_OFFSET))); + ND_PRINT("\n\tv3len %u, ", EXTRACT_BE_U_2(ptr + MST_BPDU_VER3_LEN_OFFSET)); ND_TCHECK_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12); - ND_PRINT((ndo, "MCID Name ")); + ND_PRINT("MCID Name "); if (fn_printzp(ndo, ptr + MST_BPDU_CONFIG_NAME_OFFSET, 32, ndo->ndo_snapend)) goto trunc; - ND_PRINT((ndo, ", rev %u," + ND_PRINT(", rev %u," "\n\t\tdigest %08x%08x%08x%08x, ", EXTRACT_BE_U_2(ptr + MST_BPDU_CONFIG_NAME_OFFSET + 32), EXTRACT_BE_U_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET), EXTRACT_BE_U_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 4), EXTRACT_BE_U_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 8), - EXTRACT_BE_U_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12))); + EXTRACT_BE_U_4(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12)); ND_TCHECK_4(ptr + MST_BPDU_CIST_INT_PATH_COST_OFFSET); - ND_PRINT((ndo, "CIST int-root-pathcost %u,", - EXTRACT_BE_U_4(ptr + MST_BPDU_CIST_INT_PATH_COST_OFFSET))); + ND_PRINT("CIST int-root-pathcost %u,", + EXTRACT_BE_U_4(ptr + MST_BPDU_CIST_INT_PATH_COST_OFFSET)); ND_TCHECK_BRIDGE_ID(ptr + MST_BPDU_CIST_BRIDGE_ID_OFFSET); - ND_PRINT((ndo, "\n\tCIST bridge-id %s, ", - stp_print_bridge_id(ptr + MST_BPDU_CIST_BRIDGE_ID_OFFSET))); + ND_PRINT("\n\tCIST bridge-id %s, ", + stp_print_bridge_id(ptr + MST_BPDU_CIST_BRIDGE_ID_OFFSET)); ND_TCHECK_1(ptr + MST_BPDU_CIST_REMAIN_HOPS_OFFSET); - ND_PRINT((ndo, "CIST remaining-hops %u", EXTRACT_U_1(ptr + MST_BPDU_CIST_REMAIN_HOPS_OFFSET))); + ND_PRINT("CIST remaining-hops %u", EXTRACT_U_1(ptr + MST_BPDU_CIST_REMAIN_HOPS_OFFSET)); /* Dump all MSTI's */ ND_TCHECK_2(ptr + MST_BPDU_VER3_LEN_OFFSET); @@ -325,18 +325,18 @@ stp_print_mstp_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, msti = EXTRACT_BE_U_2(ptr + offset + MST_BPDU_MSTI_ROOT_PRIO_OFFSET); msti = msti & 0x0FFF; - ND_PRINT((ndo, "\n\tMSTI %u, Flags [%s], port-role %s", + ND_PRINT("\n\tMSTI %u, Flags [%s], port-role %s", msti, bittok2str(stp_bpdu_flag_values, "none", EXTRACT_U_1(ptr + offset)), tok2str(rstp_obj_port_role_values, "Unknown", - RSTP_EXTRACT_PORT_ROLE(EXTRACT_U_1(ptr + offset))))); - ND_PRINT((ndo, "\n\t\tMSTI regional-root-id %s, pathcost %u", + RSTP_EXTRACT_PORT_ROLE(EXTRACT_U_1(ptr + offset)))); + ND_PRINT("\n\t\tMSTI regional-root-id %s, pathcost %u", stp_print_bridge_id(ptr + offset + MST_BPDU_MSTI_ROOT_PRIO_OFFSET), - EXTRACT_BE_U_4(ptr + offset + MST_BPDU_MSTI_ROOT_PATH_COST_OFFSET))); - ND_PRINT((ndo, "\n\t\tMSTI bridge-prio %u, port-prio %u, hops %u", + EXTRACT_BE_U_4(ptr + offset + MST_BPDU_MSTI_ROOT_PATH_COST_OFFSET)); + ND_PRINT("\n\t\tMSTI bridge-prio %u, port-prio %u, hops %u", EXTRACT_U_1(ptr + offset + MST_BPDU_MSTI_BRIDGE_PRIO_OFFSET) >> 4, EXTRACT_U_1(ptr + offset + MST_BPDU_MSTI_PORT_PRIO_OFFSET) >> 4, - EXTRACT_U_1(ptr + offset + MST_BPDU_MSTI_REMAIN_HOPS_OFFSET))); + EXTRACT_U_1(ptr + offset + MST_BPDU_MSTI_REMAIN_HOPS_OFFSET)); len -= MST_BPDU_MSTI_LENGTH; offset += MST_BPDU_MSTI_LENGTH; @@ -364,19 +364,19 @@ stp_print_spb_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, ptr = (const u_char *)stp_bpdu; ND_TCHECK_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 16); - ND_PRINT((ndo, "\n\tv4len %u, ", EXTRACT_BE_U_2(ptr + offset))); - ND_PRINT((ndo, "AUXMCID Name ")); + ND_PRINT("\n\tv4len %u, ", EXTRACT_BE_U_2(ptr + offset)); + ND_PRINT("AUXMCID Name "); if (fn_printzp(ndo, ptr + offset + SPB_BPDU_CONFIG_NAME_OFFSET, 32, ndo->ndo_snapend)) goto trunc; - ND_PRINT((ndo, ", Rev %u,\n\t\tdigest %08x%08x%08x%08x", + ND_PRINT(", Rev %u,\n\t\tdigest %08x%08x%08x%08x", EXTRACT_BE_U_2(ptr + offset + SPB_BPDU_CONFIG_REV_OFFSET), EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET), EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 4), EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 8), - EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 12))); + EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 12)); - ND_PRINT((ndo, "\n\tAgreement num %u, Discarded Agreement num %u, Agreement valid-" + ND_PRINT("\n\tAgreement num %u, Discarded Agreement num %u, Agreement valid-" "flag %u,\n\tRestricted role-flag: %u, Format id %u cap %u, " "Convention id %u cap %u,\n\tEdge count %u, " "Agreement digest %08x%08x%08x%08x%08x\n", @@ -393,7 +393,7 @@ stp_print_spb_bpdu(netdissect_options *ndo, const struct stp_bpdu_ *stp_bpdu, EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 4), EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 8), EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 12), - EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 16))); + EXTRACT_BE_U_4(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET + 16)); return 1; trunc: @@ -420,14 +420,14 @@ stp_print(netdissect_options *ndo, const u_char *p, u_int length) ND_TCHECK(stp_bpdu->protocol_id); if (EXTRACT_BE_U_2(stp_bpdu->protocol_id)) { - ND_PRINT((ndo, "unknown STP version, length %u", length)); + ND_PRINT("unknown STP version, length %u", length); return; } ND_TCHECK(stp_bpdu->protocol_version); protocol_version = EXTRACT_U_1(stp_bpdu->protocol_version); - ND_PRINT((ndo, "STP %s", tok2str(stp_proto_values, "Unknown STP protocol (0x%02x)", - protocol_version))); + ND_PRINT("STP %s", tok2str(stp_proto_values, "Unknown STP protocol (0x%02x)", + protocol_version)); switch (protocol_version) { case STP_PROTO_REGULAR: @@ -441,8 +441,8 @@ stp_print(netdissect_options *ndo, const u_char *p, u_int length) ND_TCHECK(stp_bpdu->bpdu_type); bpdu_type = EXTRACT_U_1(stp_bpdu->bpdu_type); - ND_PRINT((ndo, ", %s", tok2str(stp_bpdu_type_values, "Unknown BPDU Type (0x%02x)", - bpdu_type))); + ND_PRINT(", %s", tok2str(stp_bpdu_type_values, "Unknown BPDU Type (0x%02x)", + bpdu_type)); switch (bpdu_type) { case STP_BPDU_TYPE_CONFIG: @@ -508,7 +508,7 @@ stp_print(netdissect_options *ndo, const u_char *p, u_int length) return; trunc: - ND_PRINT((ndo, "[|stp %u]", length)); + ND_PRINT("[|stp %u]", length); } /* diff --git a/print-sunatm.c b/print-sunatm.c index 4692c270..65578366 100644 --- a/print-sunatm.c +++ b/print-sunatm.c @@ -73,12 +73,12 @@ sunatm_if_print(netdissect_options *ndo, u_int traftype; if (caplen < PKT_BEGIN_POS) { - ND_PRINT((ndo, "[|atm]")); + ND_PRINT("[|atm]"); return (caplen); } if (ndo->ndo_eflag) { - ND_PRINT((ndo, EXTRACT_U_1(p + DIR_POS) & 0x80 ? "Tx: " : "Rx: ")); + ND_PRINT(EXTRACT_U_1(p + DIR_POS) & 0x80 ? "Tx: " : "Rx: "); } switch (EXTRACT_U_1(p + DIR_POS) & 0x0f) { diff --git a/print-sunrpc.c b/print-sunrpc.c index 239742bc..5aeab50a 100644 --- a/print-sunrpc.c +++ b/print-sunrpc.c @@ -189,26 +189,26 @@ sunrpc_print(netdissect_options *ndo, const u_char *bp, switch (IP_V((const struct ip *)bp2)) { case 4: ip = (const struct ip *)bp2; - ND_PRINT((ndo, "%s.%s > %s.%s: %d", + ND_PRINT("%s.%s > %s.%s: %d", ipaddr_string(ndo, &ip->ip_src), srcid, - ipaddr_string(ndo, &ip->ip_dst), dstid, length)); + ipaddr_string(ndo, &ip->ip_dst), dstid, length); break; case 6: ip6 = (const struct ip6_hdr *)bp2; - ND_PRINT((ndo, "%s.%s > %s.%s: %d", + ND_PRINT("%s.%s > %s.%s: %d", ip6addr_string(ndo, &ip6->ip6_src), srcid, - ip6addr_string(ndo, &ip6->ip6_dst), dstid, length)); + ip6addr_string(ndo, &ip6->ip6_dst), dstid, length); break; default: - ND_PRINT((ndo, "%s.%s > %s.%s: %d", "?", srcid, "?", dstid, length)); + ND_PRINT("%s.%s > %s.%s: %d", "?", srcid, "?", dstid, length); break; } - ND_PRINT((ndo, " %s", tok2str(proc2str, " proc #%u", - EXTRACT_BE_U_4(&rp->rm_call.cb_proc)))); + ND_PRINT(" %s", tok2str(proc2str, " proc #%u", + EXTRACT_BE_U_4(&rp->rm_call.cb_proc))); x = EXTRACT_BE_U_4(&rp->rm_call.cb_rpcvers); if (x != 2) - ND_PRINT((ndo, " [rpcver %u]", x)); + ND_PRINT(" [rpcver %u]", x); switch (EXTRACT_BE_U_4(&rp->rm_call.cb_proc)) { @@ -218,10 +218,10 @@ sunrpc_print(netdissect_options *ndo, const u_char *bp, case SUNRPC_PMAPPROC_CALLIT: x = EXTRACT_BE_U_4(&rp->rm_call.cb_prog); if (!ndo->ndo_nflag) - ND_PRINT((ndo, " %s", progstr(x))); + ND_PRINT(" %s", progstr(x)); else - ND_PRINT((ndo, " %u", x)); - ND_PRINT((ndo, ".%u", EXTRACT_BE_U_4(&rp->rm_call.cb_vers))); + ND_PRINT(" %u", x); + ND_PRINT(".%u", EXTRACT_BE_U_4(&rp->rm_call.cb_vers)); break; } } diff --git a/print-symantec.c b/print-symantec.c index 717e4802..a421b2d3 100644 --- a/print-symantec.c +++ b/print-symantec.c @@ -48,19 +48,19 @@ symantec_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) etype = EXTRACT_BE_U_2(sp->ether_type); if (!ndo->ndo_qflag) { if (etype <= MAX_ETHERNET_LENGTH_VAL) - ND_PRINT((ndo, "invalid ethertype %u", etype)); + ND_PRINT("invalid ethertype %u", etype); else - ND_PRINT((ndo, "ethertype %s (0x%04x)", + ND_PRINT("ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", etype), - etype)); + etype); } else { if (etype <= MAX_ETHERNET_LENGTH_VAL) - ND_PRINT((ndo, "invalid ethertype %u", etype)); + ND_PRINT("invalid ethertype %u", etype); else - ND_PRINT((ndo, "%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype))); + ND_PRINT("%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype)); } - ND_PRINT((ndo, ", length %u: ", length)); + ND_PRINT(", length %u: ", length); } /* @@ -78,7 +78,7 @@ symantec_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ u_short ether_type; if (caplen < sizeof (struct symantec_header)) { - ND_PRINT((ndo, "[|symantec]")); + ND_PRINT("[|symantec]"); return caplen; } diff --git a/print-syslog.c b/print-syslog.c index 901c6f3a..1b02ff84 100644 --- a/print-syslog.c +++ b/print-syslog.c @@ -102,12 +102,12 @@ syslog_print(netdissect_options *ndo, ND_TCHECK_1(pptr + msg_off); } if (EXTRACT_U_1(pptr + msg_off) != '>') { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } msg_off++; } else { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } @@ -116,19 +116,19 @@ syslog_print(netdissect_options *ndo, if (ndo->ndo_vflag < 1 ) { - ND_PRINT((ndo, "SYSLOG %s.%s, length: %u", + ND_PRINT("SYSLOG %s.%s, length: %u", tok2str(syslog_facility_values, "unknown (%u)", facility), tok2str(syslog_severity_values, "unknown (%u)", severity), - len)); + len); return; } - ND_PRINT((ndo, "SYSLOG, length: %u\n\tFacility %s (%u), Severity %s (%u)\n\tMsg: ", + ND_PRINT("SYSLOG, length: %u\n\tFacility %s (%u), Severity %s (%u)\n\tMsg: ", len, tok2str(syslog_facility_values, "unknown (%u)", facility), facility, tok2str(syslog_severity_values, "unknown (%u)", severity), - severity)); + severity); /* print the syslog text in verbose mode */ for (; msg_off < len; msg_off++) { @@ -142,5 +142,5 @@ syslog_print(netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-tcp.c b/print-tcp.c index 961f04af..0646caa9 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -181,9 +181,9 @@ tcp_print(netdissect_options *ndo, ip6 = NULL; ch = '\0'; if (!ND_TTEST(tp->th_dport)) { - ND_PRINT((ndo, "%s > %s: [|tcp]", + ND_PRINT("%s > %s: [|tcp]", ipaddr_string(ndo, &ip->ip_src), - ipaddr_string(ndo, &ip->ip_dst))); + ipaddr_string(ndo, &ip->ip_dst)); return; } @@ -192,25 +192,25 @@ tcp_print(netdissect_options *ndo, if (ip6) { if (EXTRACT_U_1(ip6->ip6_nxt) == IPPROTO_TCP) { - ND_PRINT((ndo, "%s.%s > %s.%s: ", + ND_PRINT("%s.%s > %s.%s: ", ip6addr_string(ndo, &ip6->ip6_src), tcpport_string(ndo, sport), ip6addr_string(ndo, &ip6->ip6_dst), - tcpport_string(ndo, dport))); + tcpport_string(ndo, dport)); } else { - ND_PRINT((ndo, "%s > %s: ", - tcpport_string(ndo, sport), tcpport_string(ndo, dport))); + ND_PRINT("%s > %s: ", + tcpport_string(ndo, sport), tcpport_string(ndo, dport)); } } else { if (EXTRACT_U_1(ip->ip_p) == IPPROTO_TCP) { - ND_PRINT((ndo, "%s.%s > %s.%s: ", + ND_PRINT("%s.%s > %s.%s: ", ipaddr_string(ndo, &ip->ip_src), tcpport_string(ndo, sport), ipaddr_string(ndo, &ip->ip_dst), - tcpport_string(ndo, dport))); + tcpport_string(ndo, dport)); } else { - ND_PRINT((ndo, "%s > %s: ", - tcpport_string(ndo, sport), tcpport_string(ndo, dport))); + ND_PRINT("%s > %s: ", + tcpport_string(ndo, sport), tcpport_string(ndo, dport)); } } @@ -219,8 +219,8 @@ tcp_print(netdissect_options *ndo, hlen = TH_OFF(tp) * 4; if (hlen < sizeof(*tp)) { - ND_PRINT((ndo, " tcp %d [bad hdr length %u - too short, < %lu]", - length - hlen, hlen, (unsigned long)sizeof(*tp))); + ND_PRINT(" tcp %d [bad hdr length %u - too short, < %lu]", + length - hlen, hlen, (unsigned long)sizeof(*tp)); return; } @@ -230,16 +230,16 @@ tcp_print(netdissect_options *ndo, urp = EXTRACT_BE_U_2(tp->th_urp); if (ndo->ndo_qflag) { - ND_PRINT((ndo, "tcp %d", length - hlen)); + ND_PRINT("tcp %d", length - hlen); if (hlen > length) { - ND_PRINT((ndo, " [bad hdr length %u - too long, > %u]", - hlen, length)); + ND_PRINT(" [bad hdr length %u - too long, > %u]", + hlen, length); } return; } flags = EXTRACT_U_1(tp->th_flags); - ND_PRINT((ndo, "Flags [%s]", bittok2str_nosep(tcp_flag_values, "none", flags))); + ND_PRINT("Flags [%s]", bittok2str_nosep(tcp_flag_values, "none", flags)); if (!ndo->ndo_Sflag && (flags & TH_ACK)) { /* @@ -360,8 +360,8 @@ tcp_print(netdissect_options *ndo, thseq = thack = rev = 0; } if (hlen > length) { - ND_PRINT((ndo, " [bad hdr length %u - too long, > %u]", - hlen, length)); + ND_PRINT(" [bad hdr length %u - too long, > %u]", + hlen, length); return; } @@ -374,24 +374,24 @@ tcp_print(netdissect_options *ndo, sum = tcp_cksum(ndo, ip, tp, length); tcp_sum = EXTRACT_BE_U_2(tp->th_sum); - ND_PRINT((ndo, ", cksum 0x%04x", tcp_sum)); + ND_PRINT(", cksum 0x%04x", tcp_sum); if (sum != 0) - ND_PRINT((ndo, " (incorrect -> 0x%04x)", - in_cksum_shouldbe(tcp_sum, sum))); + ND_PRINT(" (incorrect -> 0x%04x)", + in_cksum_shouldbe(tcp_sum, sum)); else - ND_PRINT((ndo, " (correct)")); + ND_PRINT(" (correct)"); } } else if (IP_V(ip) == 6 && ip6->ip6_plen) { if (ND_TTEST_LEN(tp->th_sport, length)) { sum = tcp6_cksum(ndo, ip6, tp, length); tcp_sum = EXTRACT_BE_U_2(tp->th_sum); - ND_PRINT((ndo, ", cksum 0x%04x", tcp_sum)); + ND_PRINT(", cksum 0x%04x", tcp_sum); if (sum != 0) - ND_PRINT((ndo, " (incorrect -> 0x%04x)", - in_cksum_shouldbe(tcp_sum, sum))); + ND_PRINT(" (incorrect -> 0x%04x)", + in_cksum_shouldbe(tcp_sum, sum)); else - ND_PRINT((ndo, " (correct)")); + ND_PRINT(" (correct)"); } } @@ -399,21 +399,21 @@ tcp_print(netdissect_options *ndo, length -= hlen; if (ndo->ndo_vflag > 1 || length > 0 || flags & (TH_SYN | TH_FIN | TH_RST)) { - ND_PRINT((ndo, ", seq %u", seq)); + ND_PRINT(", seq %u", seq); if (length > 0) { - ND_PRINT((ndo, ":%u", seq + length)); + ND_PRINT(":%u", seq + length); } } if (flags & TH_ACK) { - ND_PRINT((ndo, ", ack %u", ack)); + ND_PRINT(", ack %u", ack); } - ND_PRINT((ndo, ", win %d", win)); + ND_PRINT(", win %d", win); if (flags & TH_URG) - ND_PRINT((ndo, ", urg %d", urp)); + ND_PRINT(", urg %d", urp); /* * Handle any options. */ @@ -424,10 +424,10 @@ tcp_print(netdissect_options *ndo, hlen -= sizeof(*tp); cp = (const u_char *)tp + sizeof(*tp); - ND_PRINT((ndo, ", options [")); + ND_PRINT(", options ["); while (hlen > 0) { if (ch != '\0') - ND_PRINT((ndo, "%c", ch)); + ND_PRINT("%c", ch); ND_TCHECK_1(cp); opt = EXTRACT_U_1(cp); cp++; @@ -448,30 +448,30 @@ tcp_print(netdissect_options *ndo, #define LENCHECK(l) { if ((l) > hlen) goto bad; ND_TCHECK_LEN(cp, l); } - ND_PRINT((ndo, "%s", tok2str(tcp_option_values, "unknown-%u", opt))); + ND_PRINT("%s", tok2str(tcp_option_values, "unknown-%u", opt)); switch (opt) { case TCPOPT_MAXSEG: datalen = 2; LENCHECK(datalen); - ND_PRINT((ndo, " %u", EXTRACT_BE_U_2(cp))); + ND_PRINT(" %u", EXTRACT_BE_U_2(cp)); break; case TCPOPT_WSCALE: datalen = 1; LENCHECK(datalen); - ND_PRINT((ndo, " %u", EXTRACT_U_1(cp))); + ND_PRINT(" %u", EXTRACT_U_1(cp)); break; case TCPOPT_SACK: datalen = len - 2; if (datalen % 8 != 0) { - ND_PRINT((ndo, " invalid sack")); + ND_PRINT(" invalid sack"); } else { uint32_t s, e; - ND_PRINT((ndo, " %d ", datalen / 8)); + ND_PRINT(" %d ", datalen / 8); for (i = 0; i < datalen; i += 8) { LENCHECK(i + 4); s = EXTRACT_BE_U_4(cp + i); @@ -484,7 +484,7 @@ tcp_print(netdissect_options *ndo, s -= thack; e -= thack; } - ND_PRINT((ndo, "{%u:%u}", s, e)); + ND_PRINT("{%u:%u}", s, e); } } break; @@ -501,49 +501,49 @@ tcp_print(netdissect_options *ndo, */ datalen = 4; LENCHECK(datalen); - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(cp))); + ND_PRINT(" %u", EXTRACT_BE_U_4(cp)); break; case TCPOPT_TIMESTAMP: datalen = 8; LENCHECK(datalen); - ND_PRINT((ndo, " val %u ecr %u", + ND_PRINT(" val %u ecr %u", EXTRACT_BE_U_4(cp), - EXTRACT_BE_U_4(cp + 4))); + EXTRACT_BE_U_4(cp + 4)); break; case TCPOPT_SIGNATURE: datalen = TCP_SIGLEN; LENCHECK(datalen); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); #ifdef HAVE_LIBCRYPTO switch (tcp_verify_signature(ndo, ip, tp, bp + TH_OFF(tp) * 4, length, cp)) { case SIGNATURE_VALID: - ND_PRINT((ndo, "valid")); + ND_PRINT("valid"); break; case SIGNATURE_INVALID: - ND_PRINT((ndo, "invalid")); + ND_PRINT("invalid"); break; case CANT_CHECK_SIGNATURE: - ND_PRINT((ndo, "can't check - ")); + ND_PRINT("can't check - "); for (i = 0; i < TCP_SIGLEN; ++i) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(cp + i))); + ND_PRINT("%02x", EXTRACT_U_1(cp + i)); break; } #else for (i = 0; i < TCP_SIGLEN; ++i) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(cp + i))); + ND_PRINT("%02x", EXTRACT_U_1(cp + i)); #endif break; case TCPOPT_SCPS: datalen = 2; LENCHECK(datalen); - ND_PRINT((ndo, " cap %02x id %u", EXTRACT_U_1(cp), EXTRACT_U_1(cp + 1))); + ND_PRINT(" cap %02x id %u", EXTRACT_U_1(cp), EXTRACT_U_1(cp + 1)); break; case TCPOPT_TCPAO: @@ -554,17 +554,17 @@ tcp_print(netdissect_options *ndo, * at this point.) */ if (datalen < 2) { - ND_PRINT((ndo, " invalid")); + ND_PRINT(" invalid"); } else { LENCHECK(1); - ND_PRINT((ndo, " keyid %u", EXTRACT_U_1(cp))); + ND_PRINT(" keyid %u", EXTRACT_U_1(cp)); LENCHECK(2); - ND_PRINT((ndo, " rnextkeyid %u", EXTRACT_U_1(cp + 1))); + ND_PRINT(" rnextkeyid %u", EXTRACT_U_1(cp + 1)); if (datalen > 2) { - ND_PRINT((ndo, " mac 0x")); + ND_PRINT(" mac 0x"); for (i = 2; i < datalen; i++) { LENCHECK(i + 1); - ND_PRINT((ndo, "%02x", EXTRACT_U_1(cp + i))); + ND_PRINT("%02x", EXTRACT_U_1(cp + i)); } } } @@ -583,12 +583,12 @@ tcp_print(netdissect_options *ndo, datalen = 2; LENCHECK(datalen); utoval = EXTRACT_BE_U_2(cp); - ND_PRINT((ndo, " 0x%x", utoval)); + ND_PRINT(" 0x%x", utoval); if (utoval & 0x0001) utoval = (utoval >> 1) * 60; else utoval >>= 1; - ND_PRINT((ndo, " %u", utoval)); + ND_PRINT(" %u", utoval); break; case TCPOPT_MPTCP: @@ -601,7 +601,7 @@ tcp_print(netdissect_options *ndo, case TCPOPT_FASTOPEN: datalen = len - 2; LENCHECK(datalen); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); print_tcp_fastopen_option(ndo, cp, datalen, FALSE); break; @@ -612,7 +612,7 @@ tcp_print(netdissect_options *ndo, goto bad; /* RFC6994 */ magic = EXTRACT_BE_U_2(cp); - ND_PRINT((ndo, "-")); + ND_PRINT("-"); switch(magic) { @@ -622,7 +622,7 @@ tcp_print(netdissect_options *ndo, default: /* Unknown magic number */ - ND_PRINT((ndo, "%04x", magic)); + ND_PRINT("%04x", magic); break; } break; @@ -630,10 +630,10 @@ tcp_print(netdissect_options *ndo, default: datalen = len - 2; if (datalen) - ND_PRINT((ndo, " 0x")); + ND_PRINT(" 0x"); for (i = 0; i < datalen; ++i) { LENCHECK(i + 1); - ND_PRINT((ndo, "%02x", EXTRACT_U_1(cp + i))); + ND_PRINT("%02x", EXTRACT_U_1(cp + i)); } break; } @@ -647,18 +647,18 @@ tcp_print(netdissect_options *ndo, if (!ZEROLENOPT(opt)) ++datalen; /* size octet */ if (datalen != len) - ND_PRINT((ndo, "[len %d]", len)); + ND_PRINT("[len %d]", len); ch = ','; if (opt == TCPOPT_EOL) break; } - ND_PRINT((ndo, "]")); + ND_PRINT("]"); } /* * Print length field before crawling down the stack. */ - ND_PRINT((ndo, ", length %u", length)); + ND_PRINT(", length %u", length); if (length <= 0) return; @@ -687,10 +687,10 @@ tcp_print(netdissect_options *ndo, if (IS_SRC_OR_DST_PORT(TELNET_PORT)) { telnet_print(ndo, bp, length); } else if (IS_SRC_OR_DST_PORT(SMTP_PORT)) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); smtp_print(ndo, bp, length); } else if (IS_SRC_OR_DST_PORT(WHOIS_PORT)) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); txtproto_print(ndo, bp, length, "whois", NULL, 0); /* RFC 3912 */ } else if (IS_SRC_OR_DST_PORT(BGP_PORT)) bgp_print(ndo, bp, length); @@ -709,13 +709,13 @@ tcp_print(netdissect_options *ndo, else if (IS_SRC_OR_DST_PORT(OPENFLOW_PORT_OLD) || IS_SRC_OR_DST_PORT(OPENFLOW_PORT_IANA)) openflow_print(ndo, bp, length); else if (IS_SRC_OR_DST_PORT(FTP_PORT)) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); ftp_print(ndo, bp, length); } else if (IS_SRC_OR_DST_PORT(HTTP_PORT) || IS_SRC_OR_DST_PORT(HTTP_PORT_ALT)) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); http_print(ndo, bp, length); } else if (IS_SRC_OR_DST_PORT(RTSP_PORT) || IS_SRC_OR_DST_PORT(RTSP_PORT_ALT)) { - ND_PRINT((ndo, ": ")); + ND_PRINT(": "); rtsp_print(ndo, bp, length); } else if (length > 2 && (IS_SRC_OR_DST_PORT(NAMESERVER_PORT))) { @@ -751,12 +751,12 @@ tcp_print(netdissect_options *ndo, if (ND_TTEST(rp->rm_direction)) { direction = (enum sunrpc_msg_type) EXTRACT_BE_U_4(&rp->rm_direction); if (dport == NFS_PORT && direction == SUNRPC_CALL) { - ND_PRINT((ndo, ": NFS request xid %u ", EXTRACT_BE_U_4(&rp->rm_xid))); + ND_PRINT(": NFS request xid %u ", EXTRACT_BE_U_4(&rp->rm_xid)); nfsreq_noaddr_print(ndo, (const u_char *)rp, fraglen, (const u_char *)ip); return; } if (sport == NFS_PORT && direction == SUNRPC_REPLY) { - ND_PRINT((ndo, ": NFS reply xid %u ", EXTRACT_BE_U_4(&rp->rm_xid))); + ND_PRINT(": NFS reply xid %u ", EXTRACT_BE_U_4(&rp->rm_xid)); nfsreply_noaddr_print(ndo, (const u_char *)rp, fraglen, (const u_char *)ip); return; } @@ -765,14 +765,14 @@ tcp_print(netdissect_options *ndo, return; bad: - ND_PRINT((ndo, "[bad opt]")); + ND_PRINT("[bad opt]"); if (ch != '\0') - ND_PRINT((ndo, ">")); + ND_PRINT(">"); return; trunc: - ND_PRINT((ndo, "[|tcp]")); + ND_PRINT("[|tcp]"); if (ch != '\0') - ND_PRINT((ndo, ">")); + ND_PRINT(">"); } /* @@ -796,18 +796,18 @@ print_tcp_rst_data(netdissect_options *ndo, { int c; - ND_PRINT((ndo, ND_TTEST_LEN(sp, length) ? " [RST" : " [!RST")); + ND_PRINT(ND_TTEST_LEN(sp, length) ? " [RST" : " [!RST"); if (length > MAX_RST_DATA_LEN) { length = MAX_RST_DATA_LEN; /* can use -X for longer */ - ND_PRINT((ndo, "+")); /* indicate we truncate */ + ND_PRINT("+"); /* indicate we truncate */ } - ND_PRINT((ndo, " ")); + ND_PRINT(" "); while (length-- && sp < ndo->ndo_snapend) { c = EXTRACT_U_1(sp); sp++; safeputchar(ndo, c); } - ND_PRINT((ndo, "]")); + ND_PRINT("]"); } static void @@ -817,19 +817,19 @@ print_tcp_fastopen_option(netdissect_options *ndo, const u_char *cp, u_int i; if (exp) - ND_PRINT((ndo, "tfo")); + ND_PRINT("tfo"); if (datalen == 0) { /* Fast Open Cookie Request */ - ND_PRINT((ndo, " cookiereq")); + ND_PRINT(" cookiereq"); } else { /* Fast Open Cookie */ if (datalen % 2 != 0 || datalen < 4 || datalen > 16) { - ND_PRINT((ndo, " invalid")); + ND_PRINT(" invalid"); } else { - ND_PRINT((ndo, " cookie ")); + ND_PRINT(" cookie "); for (i = 0; i < datalen; ++i) - ND_PRINT((ndo, "%02x", EXTRACT_U_1(cp + i))); + ND_PRINT("%02x", EXTRACT_U_1(cp + i)); } } } @@ -851,14 +851,14 @@ tcp_verify_signature(netdissect_options *ndo, uint8_t nxt; if (data + length > ndo->ndo_snapend) { - ND_PRINT((ndo, "snaplen too short, ")); + ND_PRINT("snaplen too short, "); return (CANT_CHECK_SIGNATURE); } tp1 = *tp; if (ndo->ndo_sigsecret == NULL) { - ND_PRINT((ndo, "shared secret not supplied with -M, ")); + ND_PRINT("shared secret not supplied with -M, "); return (CANT_CHECK_SIGNATURE); } @@ -887,7 +887,7 @@ tcp_verify_signature(netdissect_options *ndo, nxt = IPPROTO_TCP; MD5_Update(&ctx, (const char *)&nxt, sizeof(nxt)); } else { - ND_PRINT((ndo, "IP version not 4 or 6, ")); + ND_PRINT("IP version not 4 or 6, "); return (CANT_CHECK_SIGNATURE); } diff --git a/print-telnet.c b/print-telnet.c index c65b48fb..f0604054 100644 --- a/print-telnet.c +++ b/print-telnet.c @@ -410,7 +410,7 @@ telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print) FETCH(c, sp, length); if (c == IAC) { /* <IAC><IAC>! */ if (print) - ND_PRINT((ndo, "IAC IAC")); + ND_PRINT("IAC IAC"); goto done; } @@ -428,10 +428,10 @@ telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print) FETCH(x, sp, length); if (x >= 0 && x < NTELOPTS) { if (print) - ND_PRINT((ndo, "%s %s", telcmds[i], telopts[x])); + ND_PRINT("%s %s", telcmds[i], telopts[x]); } else { if (print) - ND_PRINT((ndo, "%s %#x", telcmds[i], x)); + ND_PRINT("%s %#x", telcmds[i], x); } if (c != SB) break; @@ -453,46 +453,46 @@ telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print) break; FETCH(c, sp, length); if (print) - ND_PRINT((ndo, " %s", STR_OR_ID(c, authcmd))); + ND_PRINT(" %s", STR_OR_ID(c, authcmd)); if (p <= sp) break; FETCH(c, sp, length); if (print) - ND_PRINT((ndo, " %s", STR_OR_ID(c, authtype))); + ND_PRINT(" %s", STR_OR_ID(c, authtype)); break; case TELOPT_ENCRYPT: if (p <= sp) break; FETCH(c, sp, length); if (print) - ND_PRINT((ndo, " %s", STR_OR_ID(c, enccmd))); + ND_PRINT(" %s", STR_OR_ID(c, enccmd)); if (p <= sp) break; FETCH(c, sp, length); if (print) - ND_PRINT((ndo, " %s", STR_OR_ID(c, enctype))); + ND_PRINT(" %s", STR_OR_ID(c, enctype)); break; default: if (p <= sp) break; FETCH(c, sp, length); if (print) - ND_PRINT((ndo, " %s", STR_OR_ID(c, cmds))); + ND_PRINT(" %s", STR_OR_ID(c, cmds)); break; } while (p > sp) { FETCH(x, sp, length); if (print) - ND_PRINT((ndo, " %#x", x)); + ND_PRINT(" %#x", x); } /* terminating IAC SE */ if (print) - ND_PRINT((ndo, " SE")); + ND_PRINT(" SE"); sp += 2; break; default: if (print) - ND_PRINT((ndo, "%s", telcmds[i])); + ND_PRINT("%s", telcmds[i]); goto done; } @@ -500,7 +500,7 @@ done: return sp - osp; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); pktend: return -1; #undef FETCH @@ -530,14 +530,14 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length) */ if (ndo->ndo_Xflag && 2 < ndo->ndo_vflag) { if (first) - ND_PRINT((ndo, "\nTelnet:")); + ND_PRINT("\nTelnet:"); hex_print_with_offset(ndo, "\n", sp, l, sp - osp); if (l > 8) - ND_PRINT((ndo, "\n\t\t\t\t")); + ND_PRINT("\n\t\t\t\t"); else - ND_PRINT((ndo, "%*s\t", (8 - l) * 3, "")); + ND_PRINT("%*s\t", (8 - l) * 3, ""); } else - ND_PRINT((ndo, "%s", (first) ? " [telnet " : ", ")); + ND_PRINT("%s", (first) ? " [telnet " : ", "); (void)telnet_parse(ndo, sp, length, 1); first = 0; @@ -548,11 +548,11 @@ telnet_print(netdissect_options *ndo, const u_char *sp, u_int length) } if (!first) { if (ndo->ndo_Xflag && 2 < ndo->ndo_vflag) - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); else - ND_PRINT((ndo, "]")); + ND_PRINT("]"); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-tftp.c b/print-tftp.c index e0bedc39..8c72d582 100644 --- a/print-tftp.c +++ b/print-tftp.c @@ -96,7 +96,7 @@ tftp_print(netdissect_options *ndo, u_int ui; /* Print length */ - ND_PRINT((ndo, " %d", length)); + ND_PRINT(" %d", length); /* Print tftp request type */ if (length < 2) @@ -104,7 +104,7 @@ tftp_print(netdissect_options *ndo, ND_TCHECK_2(bp); opcode = EXTRACT_BE_U_2(bp); cp = tok2str(op2str, "tftp-#%d", opcode); - ND_PRINT((ndo, " %s", cp)); + ND_PRINT(" %s", cp); /* Bail if bogus opcode */ if (*cp == 't') return; @@ -117,11 +117,11 @@ tftp_print(netdissect_options *ndo, case WRQ: if (length == 0) goto trunc; - ND_PRINT((ndo, " ")); + ND_PRINT(" "); /* Print filename */ - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend); - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); if (ui == 0) goto trunc; bp += ui; @@ -130,7 +130,7 @@ tftp_print(netdissect_options *ndo, /* Print the mode - RRQ and WRQ only */ if (length == 0) goto trunc; /* no mode */ - ND_PRINT((ndo, " ")); + ND_PRINT(" "); ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend); if (ui == 0) goto trunc; @@ -141,7 +141,7 @@ tftp_print(netdissect_options *ndo, while (length != 0) { ND_TCHECK_1(bp); if (EXTRACT_U_1(bp) != '\0') - ND_PRINT((ndo, " ")); + ND_PRINT(" "); ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend); if (ui == 0) goto trunc; @@ -155,7 +155,7 @@ tftp_print(netdissect_options *ndo, while (length != 0) { ND_TCHECK_1(bp); if (EXTRACT_U_1(bp) != '\0') - ND_PRINT((ndo, " ")); + ND_PRINT(" "); ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend); if (ui == 0) goto trunc; @@ -169,7 +169,7 @@ tftp_print(netdissect_options *ndo, if (length < 2) goto trunc; /* no block number */ ND_TCHECK_2(bp); - ND_PRINT((ndo, " block %d", EXTRACT_BE_U_2(bp))); + ND_PRINT(" block %d", EXTRACT_BE_U_2(bp)); break; case TFTP_ERROR: @@ -177,27 +177,27 @@ tftp_print(netdissect_options *ndo, if (length < 2) goto trunc; /* no error code */ ND_TCHECK_2(bp); - ND_PRINT((ndo, " %s", tok2str(err2str, "tftp-err-#%d \"", - EXTRACT_BE_U_2(bp)))); + ND_PRINT(" %s", tok2str(err2str, "tftp-err-#%d \"", + EXTRACT_BE_U_2(bp))); bp += 2; length -= 2; /* Print error message string */ if (length == 0) goto trunc; /* no error message */ - ND_PRINT((ndo, " \"")); + ND_PRINT(" \""); ui = fn_printztn(ndo, bp, length, ndo->ndo_snapend); - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); if (ui == 0) goto trunc; break; default: /* We shouldn't get here */ - ND_PRINT((ndo, "(unknown #%d)", opcode)); + ND_PRINT("(unknown #%d)", opcode); break; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } diff --git a/print-timed.c b/print-timed.c index 1d3f7329..487b4e7d 100644 --- a/print-timed.c +++ b/print-timed.c @@ -101,20 +101,20 @@ timed_print(netdissect_options *ndo, ND_TCHECK(tsp->tsp_type); tsp_type = EXTRACT_U_1(tsp->tsp_type); if (tsp_type < TSPTYPENUMBER) - ND_PRINT((ndo, "TSP_%s", tsptype[tsp_type])); + ND_PRINT("TSP_%s", tsptype[tsp_type]); else - ND_PRINT((ndo, "(tsp_type %#x)", tsp_type)); + ND_PRINT("(tsp_type %#x)", tsp_type); ND_TCHECK(tsp->tsp_vers); - ND_PRINT((ndo, " vers %u", EXTRACT_U_1(tsp->tsp_vers))); + ND_PRINT(" vers %u", EXTRACT_U_1(tsp->tsp_vers)); ND_TCHECK(tsp->tsp_seq); - ND_PRINT((ndo, " seq %u", EXTRACT_BE_U_2(tsp->tsp_seq))); + ND_PRINT(" seq %u", EXTRACT_BE_U_2(tsp->tsp_seq)); switch (tsp_type) { case TSP_LOOP: ND_TCHECK(tsp->tsp_hopcnt); - ND_PRINT((ndo, " hopcnt %u", EXTRACT_U_1(tsp->tsp_hopcnt))); + ND_PRINT(" hopcnt %u", EXTRACT_U_1(tsp->tsp_hopcnt)); break; case TSP_SETTIME: case TSP_ADJTIME: @@ -127,21 +127,21 @@ timed_print(netdissect_options *ndo, if (usec < 0) /* invalid, skip the rest of the packet */ return; - ND_PRINT((ndo, " time ")); + ND_PRINT(" time "); if (sec < 0 && usec != 0) { sec++; if (sec == 0) - ND_PRINT((ndo, "-")); + ND_PRINT("-"); usec = 1000000 - usec; } - ND_PRINT((ndo, "%d.%06d", sec, usec)); + ND_PRINT("%d.%06d", sec, usec); break; } - ND_PRINT((ndo, " name ")); + ND_PRINT(" name "); if (fn_print(ndo, (const u_char *)tsp->tsp_name, (const u_char *)tsp->tsp_name + sizeof(tsp->tsp_name))) goto trunc; return; trunc: - ND_PRINT((ndo, " %s", tstr)); + ND_PRINT(" %s", tstr); } diff --git a/print-tipc.c b/print-tipc.c index 9c4bc768..88d4862b 100644 --- a/print-tipc.c +++ b/print-tipc.c @@ -182,18 +182,18 @@ print_payload(netdissect_options *ndo, const struct payload_tipc_pkthdr *ap) orig_port = EXTRACT_BE_U_4(ap->orig_port); dest_port = EXTRACT_BE_U_4(ap->dest_port); if (hsize <= 6) { - ND_PRINT((ndo, "TIPC v%u.0 %u.%u.%u:%u > %u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s", + ND_PRINT("TIPC v%u.0 %u.%u.%u:%u > %u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s", TIPC_VER(w0), TIPC_ZONE(prev_node), TIPC_CLUSTER(prev_node), TIPC_NODE(prev_node), orig_port, dest_port, hsize*4, msize, tok2str(tipcuser_values, "unknown", user), - tok2str(tipcmtype_values, "Unknown", mtype))); + tok2str(tipcmtype_values, "Unknown", mtype)); } else { ND_TCHECK(ap->dest_node); orig_node = EXTRACT_BE_U_4(ap->orig_node); dest_node = EXTRACT_BE_U_4(ap->dest_node); - ND_PRINT((ndo, "TIPC v%u.0 %u.%u.%u:%u > %u.%u.%u:%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s", + ND_PRINT("TIPC v%u.0 %u.%u.%u:%u > %u.%u.%u:%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s", TIPC_VER(w0), TIPC_ZONE(orig_node), TIPC_CLUSTER(orig_node), TIPC_NODE(orig_node), orig_port, @@ -201,22 +201,22 @@ print_payload(netdissect_options *ndo, const struct payload_tipc_pkthdr *ap) dest_port, hsize*4, msize, tok2str(tipcuser_values, "unknown", user), - tok2str(tipcmtype_values, "Unknown", mtype))); + tok2str(tipcmtype_values, "Unknown", mtype)); if (ndo->ndo_vflag) { broadcast_ack = TIPC_BROADCAST_ACK(w1); w2 = EXTRACT_BE_U_4(ap->w2); link_ack = TIPC_LINK_ACK(w2); link_seq = TIPC_LINK_SEQ(w2); - ND_PRINT((ndo, "\n\tPrevious Node %u.%u.%u, Broadcast Ack %u, Link Ack %u, Link Sequence %u", + ND_PRINT("\n\tPrevious Node %u.%u.%u, Broadcast Ack %u, Link Ack %u, Link Sequence %u", TIPC_ZONE(prev_node), TIPC_CLUSTER(prev_node), TIPC_NODE(prev_node), - broadcast_ack, link_ack, link_seq)); + broadcast_ack, link_ack, link_seq); } } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -250,13 +250,13 @@ print_internal(netdissect_options *ndo, const struct internal_tipc_pkthdr *ap) mtype = TIPC_MTYPE(w1); orig_node = EXTRACT_BE_U_4(ap->orig_node); dest_node = EXTRACT_BE_U_4(ap->dest_node); - ND_PRINT((ndo, "TIPC v%u.0 %u.%u.%u > %u.%u.%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s (0x%08x)", + ND_PRINT("TIPC v%u.0 %u.%u.%u > %u.%u.%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s (0x%08x)", TIPC_VER(w0), TIPC_ZONE(orig_node), TIPC_CLUSTER(orig_node), TIPC_NODE(orig_node), TIPC_ZONE(dest_node), TIPC_CLUSTER(dest_node), TIPC_NODE(dest_node), hsize*4, msize, tok2str(tipcuser_values, "unknown", user), - tok2str(tipcmtype_values, "Unknown", mtype), w1)); + tok2str(tipcmtype_values, "Unknown", mtype), w1); if (ndo->ndo_vflag) { ND_TCHECK_SIZE(ap); @@ -275,16 +275,16 @@ print_internal(netdissect_options *ndo, const struct internal_tipc_pkthdr *ap) w9 = EXTRACT_BE_U_4(ap->w9); msg_cnt = TIPC_MSG_CNT(w9); link_tol = TIPC_LINK_TOL(w9); - ND_PRINT((ndo, "\n\tPrevious Node %u.%u.%u, Session No. %u, Broadcast Ack %u, Sequence Gap %u, Broadcast Gap After %u, Broadcast Gap To %u, Last Sent Packet No. %u, Next sent Packet No. %u, Transport Sequence %u, msg_count %u, Link Tolerance %u", + ND_PRINT("\n\tPrevious Node %u.%u.%u, Session No. %u, Broadcast Ack %u, Sequence Gap %u, Broadcast Gap After %u, Broadcast Gap To %u, Last Sent Packet No. %u, Next sent Packet No. %u, Transport Sequence %u, msg_count %u, Link Tolerance %u", TIPC_ZONE(prev_node), TIPC_CLUSTER(prev_node), TIPC_NODE(prev_node), sess_no, broadcast_ack, seq_gap, bc_gap_after, bc_gap_to, last_sent_frag, next_sent_frag, trans_seq, msg_cnt, - link_tol)); + link_tol); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } static void @@ -311,26 +311,26 @@ print_link_conf(netdissect_options *ndo, const struct link_conf_tipc_pkthdr *ap) dest_domain = EXTRACT_BE_U_4(ap->dest_domain); prev_node = EXTRACT_BE_U_4(ap->prev_node); - ND_PRINT((ndo, "TIPC v%u.0 %u.%u.%u > %u.%u.%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s", + ND_PRINT("TIPC v%u.0 %u.%u.%u > %u.%u.%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s", TIPC_VER(w0), TIPC_ZONE(prev_node), TIPC_CLUSTER(prev_node), TIPC_NODE(prev_node), TIPC_ZONE(dest_domain), TIPC_CLUSTER(dest_domain), TIPC_NODE(dest_domain), hsize*4, msize, tok2str(tipcuser_values, "unknown", user), - tok2str(tipc_linkconf_mtype_values, "Unknown", mtype))); + tok2str(tipc_linkconf_mtype_values, "Unknown", mtype)); if (ndo->ndo_vflag) { ND_TCHECK(ap->w5); node_sig = TIPC_NODE_SIG(w1); ntwrk_id = EXTRACT_BE_U_4(ap->ntwrk_id); w5 = EXTRACT_BE_U_4(ap->w5); media_id = TIPC_MEDIA_ID(w5); - ND_PRINT((ndo, "\n\tNodeSignature %u, network_id %u, media_id %u", - node_sig, ntwrk_id, media_id)); + ND_PRINT("\n\tNodeSignature %u, network_id %u, media_id %u", + node_sig, ntwrk_id, media_id); } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } void @@ -373,7 +373,7 @@ tipc_print(netdissect_options *ndo, const u_char *bp, u_int length _U_, return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* diff --git a/print-token.c b/print-token.c index ff2a3841..80e7e88b 100644 --- a/print-token.c +++ b/print-token.c @@ -113,12 +113,12 @@ token_hdr_print(netdissect_options *ndo, dstname = etheraddr_string(ndo, fdst); if (!ndo->ndo_qflag) - ND_PRINT((ndo, "%02x %02x ", + ND_PRINT("%02x %02x ", EXTRACT_U_1(trp->token_ac), - EXTRACT_U_1(trp->token_fc))); - ND_PRINT((ndo, "%s > %s, length %u: ", + EXTRACT_U_1(trp->token_fc)); + ND_PRINT("%s > %s, length %u: ", srcname, dstname, - length)); + length); } static const char *broadcast_indicator[] = { @@ -156,7 +156,7 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen trp = (const struct token_header *)p; if (caplen < TOKEN_HDRLEN) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return hdr_len; } @@ -174,29 +174,29 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen token_hdr_print(ndo, trp, length, srcmac, dstmac); if (caplen < TOKEN_HDRLEN + 2) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return hdr_len; } route_len = RIF_LENGTH(trp); hdr_len += route_len; if (caplen < hdr_len) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return hdr_len; } if (ndo->ndo_vflag) { - ND_PRINT((ndo, "%s ", broadcast_indicator[BROADCAST(trp)])); - ND_PRINT((ndo, "%s", direction[DIRECTION(trp)])); + ND_PRINT("%s ", broadcast_indicator[BROADCAST(trp)]); + ND_PRINT("%s", direction[DIRECTION(trp)]); for (seg = 0; seg < SEGMENT_COUNT(trp); seg++) - ND_PRINT((ndo, " [%d:%d]", RING_NUMBER(trp, seg), - BRIDGE_NUMBER(trp, seg))); + ND_PRINT(" [%d:%d]", RING_NUMBER(trp, seg), + BRIDGE_NUMBER(trp, seg)); } else { - ND_PRINT((ndo, "rt = %x", EXTRACT_BE_U_2(trp->token_rcf))); + ND_PRINT("rt = %x", EXTRACT_BE_U_2(trp->token_rcf)); for (seg = 0; seg < SEGMENT_COUNT(trp); seg++) - ND_PRINT((ndo, ":%x", EXTRACT_BE_U_2(trp->token_rseg[seg]))); + ND_PRINT(":%x", EXTRACT_BE_U_2(trp->token_rseg[seg])); } - ND_PRINT((ndo, " (%s) ", largest_frame[LARGEST_FRAME(trp)])); + ND_PRINT(" (%s) ", largest_frame[LARGEST_FRAME(trp)]); } else { if (ndo->ndo_eflag) token_hdr_print(ndo, trp, length, srcmac, dstmac); diff --git a/print-udld.c b/print-udld.c index 0bc71ea8..e4c7bdca 100644 --- a/print-udld.c +++ b/print-udld.c @@ -108,13 +108,13 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) code = UDLD_EXTRACT_OPCODE(EXTRACT_U_1(tptr)); - ND_PRINT((ndo, "UDLDv%u, Code %s (%x), Flags [%s] (0x%02x), length %u", + ND_PRINT("UDLDv%u, Code %s (%x), Flags [%s] (0x%02x), length %u", UDLD_EXTRACT_VERSION(EXTRACT_U_1(tptr)), tok2str(udld_code_values, "Reserved", code), code, bittok2str(udld_flags_values, "none", EXTRACT_U_1((tptr + 1))), EXTRACT_U_1((tptr + 1)), - length)); + length); /* * In non-verbose mode, just print version and opcode type @@ -123,7 +123,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) return; } - ND_PRINT((ndo, "\n\tChecksum 0x%04x (unverified)", EXTRACT_BE_U_2(tptr + 2))); + ND_PRINT("\n\tChecksum 0x%04x (unverified)", EXTRACT_BE_U_2(tptr + 2)); tptr += UDLD_HEADER_LEN; @@ -133,9 +133,9 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) type = EXTRACT_BE_U_2(tptr); len = EXTRACT_BE_U_2(tptr + 2); - ND_PRINT((ndo, "\n\t%s (0x%04x) TLV, length %u", + ND_PRINT("\n\t%s (0x%04x) TLV, length %u", tok2str(udld_tlv_values, "Unknown", type), - type, len)); + type, len); if (type == 0) goto invalid; @@ -153,12 +153,12 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) case UDLD_DEVICE_ID_TLV: case UDLD_PORT_ID_TLV: case UDLD_DEVICE_NAME_TLV: - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); fn_printzp(ndo, tptr, len, NULL); break; case UDLD_ECHO_TLV: - ND_PRINT((ndo, ", ")); + ND_PRINT(", "); (void)fn_printn(ndo, tptr, len, NULL); break; @@ -166,13 +166,13 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) case UDLD_TIMEOUT_INTERVAL_TLV: if (len != 1) goto invalid; - ND_PRINT((ndo, ", %us", (EXTRACT_U_1(tptr)))); + ND_PRINT(", %us", (EXTRACT_U_1(tptr))); break; case UDLD_SEQ_NUMBER_TLV: if (len != 4) goto invalid; - ND_PRINT((ndo, ", %u", EXTRACT_BE_U_4(tptr))); + ND_PRINT(", %u", EXTRACT_BE_U_4(tptr)); break; default: @@ -184,10 +184,10 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length) return; invalid: - ND_PRINT((ndo, "%s", istr)); + ND_PRINT("%s", istr); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } /* diff --git a/print-udp.c b/print-udp.c index 02899e63..02684fd8 100644 --- a/print-udp.c +++ b/print-udp.c @@ -107,9 +107,9 @@ vat_print(netdissect_options *ndo, const void *hdr, const struct udphdr *up) if ((ts & 0xf060) != 0) { /* probably vt */ ND_TCHECK_2(up->uh_ulen); - ND_PRINT((ndo, "udp/vt %u %d / %d", + ND_PRINT("udp/vt %u %d / %d", (uint32_t)(EXTRACT_BE_U_2(up->uh_ulen) - sizeof(*up)), - ts & 0x3ff, ts >> 10)); + ts & 0x3ff, ts >> 10); } else { /* probably vat */ uint32_t i0, i1; @@ -119,19 +119,19 @@ vat_print(netdissect_options *ndo, const void *hdr, const struct udphdr *up) ND_TCHECK_4(&((const u_int *)hdr)[1]); i1 = EXTRACT_BE_U_4(&((const u_int *)hdr)[1]); ND_TCHECK_2(up->uh_ulen); - ND_PRINT((ndo, "udp/vat %u c%d %u%s", + ND_PRINT("udp/vat %u c%d %u%s", (uint32_t)(EXTRACT_BE_U_2(up->uh_ulen) - sizeof(*up) - 8), i0 & 0xffff, - i1, i0 & 0x800000? "*" : "")); + i1, i0 & 0x800000? "*" : ""); /* audio format */ if (i0 & 0x1f0000) - ND_PRINT((ndo, " f%d", (i0 >> 16) & 0x1f)); + ND_PRINT(" f%d", (i0 >> 16) & 0x1f); if (i0 & 0x3f000000) - ND_PRINT((ndo, " s%d", (i0 >> 24) & 0x3f)); + ND_PRINT(" s%d", (i0 >> 24) & 0x3f); } trunc: - ND_PRINT((ndo, "%s", vat_tstr)); + ND_PRINT("%s", vat_tstr); } static void @@ -171,17 +171,17 @@ rtp_print(netdissect_options *ndo, const void *hdr, u_int len, ip += 1; len -= 1; } - ND_PRINT((ndo, "udp/%s %d c%d %s%s %d %u", + ND_PRINT("udp/%s %d c%d %s%s %d %u", ptype, dlen, contype, (hasopt || hasext)? "+" : "", hasmarker? "*" : "", i0 & 0xffff, - i1)); + i1); if (ndo->ndo_vflag) { ND_TCHECK_4(&((const u_int *)hdr)[2]); - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(&((const u_int *)hdr)[2]))); + ND_PRINT(" %u", EXTRACT_BE_U_4(&((const u_int *)hdr)[2])); if (hasopt) { u_int i2, optlen; do { @@ -189,7 +189,7 @@ rtp_print(netdissect_options *ndo, const void *hdr, u_int len, i2 = EXTRACT_BE_U_4(ip); optlen = (i2 >> 16) & 0xff; if (optlen == 0 || optlen > len) { - ND_PRINT((ndo, " !opt")); + ND_PRINT(" !opt"); return; } ip += optlen; @@ -202,18 +202,18 @@ rtp_print(netdissect_options *ndo, const void *hdr, u_int len, i2 = EXTRACT_BE_U_4(ip); extlen = (i2 & 0xffff) + 1; if (extlen > len) { - ND_PRINT((ndo, " !ext")); + ND_PRINT(" !ext"); return; } ip += extlen; } ND_TCHECK_4(ip); if (contype == 0x1f) /*XXX H.261 */ - ND_PRINT((ndo, " 0x%04x", EXTRACT_BE_U_4(ip) >> 16)); + ND_PRINT(" 0x%04x", EXTRACT_BE_U_4(ip) >> 16); } trunc: - ND_PRINT((ndo, "%s", rtp_tstr)); + ND_PRINT("%s", rtp_tstr); } static const u_char * @@ -236,65 +236,65 @@ rtcp_print(netdissect_options *ndo, const u_char *hdr, const u_char *ep) switch (flags & 0xff) { case RTCP_PT_SR: sr = (const struct rtcp_sr *)(rh + 1); - ND_PRINT((ndo, " sr")); + ND_PRINT(" sr"); if (len != cnt * sizeof(*rr) + sizeof(*sr) + sizeof(*rh)) - ND_PRINT((ndo, " [%d]", len)); + ND_PRINT(" [%d]", len); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(rh->rh_ssrc))); + ND_PRINT(" %u", EXTRACT_BE_U_4(rh->rh_ssrc)); if ((const u_char *)(sr + 1) > ep) goto trunc; ND_TCHECK_SIZE(sr); ts = (double)(EXTRACT_BE_U_4(sr->sr_ntp.upper)) + ((double)(EXTRACT_BE_U_4(sr->sr_ntp.lower)) / 4294967296.0); - ND_PRINT((ndo, " @%.2f %u %up %ub", ts, EXTRACT_BE_U_4(sr->sr_ts), - EXTRACT_BE_U_4(sr->sr_np), EXTRACT_BE_U_4(sr->sr_nb))); + ND_PRINT(" @%.2f %u %up %ub", ts, EXTRACT_BE_U_4(sr->sr_ts), + EXTRACT_BE_U_4(sr->sr_np), EXTRACT_BE_U_4(sr->sr_nb)); rr = (const struct rtcp_rr *)(sr + 1); break; case RTCP_PT_RR: - ND_PRINT((ndo, " rr")); + ND_PRINT(" rr"); if (len != cnt * sizeof(*rr) + sizeof(*rh)) - ND_PRINT((ndo, " [%d]", len)); + ND_PRINT(" [%d]", len); rr = (const struct rtcp_rr *)(rh + 1); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(rh->rh_ssrc))); + ND_PRINT(" %u", EXTRACT_BE_U_4(rh->rh_ssrc)); break; case RTCP_PT_SDES: - ND_PRINT((ndo, " sdes %d", len)); + ND_PRINT(" sdes %d", len); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(rh->rh_ssrc))); + ND_PRINT(" %u", EXTRACT_BE_U_4(rh->rh_ssrc)); cnt = 0; break; case RTCP_PT_BYE: - ND_PRINT((ndo, " bye %d", len)); + ND_PRINT(" bye %d", len); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(rh->rh_ssrc))); + ND_PRINT(" %u", EXTRACT_BE_U_4(rh->rh_ssrc)); cnt = 0; break; default: - ND_PRINT((ndo, " type-0x%x %d", flags & 0xff, len)); + ND_PRINT(" type-0x%x %d", flags & 0xff, len); cnt = 0; break; } if (cnt > 1) - ND_PRINT((ndo, " c%d", cnt)); + ND_PRINT(" c%d", cnt); while (--cnt >= 0) { if ((const u_char *)(rr + 1) > ep) goto trunc; ND_TCHECK_SIZE(rr); if (ndo->ndo_vflag) - ND_PRINT((ndo, " %u", EXTRACT_BE_U_4(rr->rr_srcid))); + ND_PRINT(" %u", EXTRACT_BE_U_4(rr->rr_srcid)); ts = (double)(EXTRACT_BE_U_4(rr->rr_lsr)) / 65536.; dts = (double)(EXTRACT_BE_U_4(rr->rr_dlsr)) / 65536.; - ND_PRINT((ndo, " %ul %us %uj @%.2f+%.2f", + ND_PRINT(" %ul %us %uj @%.2f+%.2f", EXTRACT_BE_U_4(rr->rr_nl) & 0x00ffffff, EXTRACT_BE_U_4(rr->rr_ls), - EXTRACT_BE_U_4(rr->rr_dv), ts, dts)); + EXTRACT_BE_U_4(rr->rr_dv), ts, dts); } return (hdr + len); trunc: - ND_PRINT((ndo, "%s", rtcp_tstr)); + ND_PRINT("%s", rtcp_tstr); return ep; } @@ -326,41 +326,41 @@ udpipaddr_print(netdissect_options *ndo, const struct ip *ip, int sport, int dpo if (ip6) { if (EXTRACT_U_1(ip6->ip6_nxt) == IPPROTO_UDP) { if (sport == -1) { - ND_PRINT((ndo, "%s > %s: ", + ND_PRINT("%s > %s: ", ip6addr_string(ndo, &ip6->ip6_src), - ip6addr_string(ndo, &ip6->ip6_dst))); + ip6addr_string(ndo, &ip6->ip6_dst)); } else { - ND_PRINT((ndo, "%s.%s > %s.%s: ", + ND_PRINT("%s.%s > %s.%s: ", ip6addr_string(ndo, &ip6->ip6_src), udpport_string(ndo, sport), ip6addr_string(ndo, &ip6->ip6_dst), - udpport_string(ndo, dport))); + udpport_string(ndo, dport)); } } else { if (sport != -1) { - ND_PRINT((ndo, "%s > %s: ", + ND_PRINT("%s > %s: ", udpport_string(ndo, sport), - udpport_string(ndo, dport))); + udpport_string(ndo, dport)); } } } else { if (EXTRACT_U_1(ip->ip_p) == IPPROTO_UDP) { if (sport == -1) { - ND_PRINT((ndo, "%s > %s: ", + ND_PRINT("%s > %s: ", ipaddr_string(ndo, &ip->ip_src), - ipaddr_string(ndo, &ip->ip_dst))); + ipaddr_string(ndo, &ip->ip_dst)); } else { - ND_PRINT((ndo, "%s.%s > %s.%s: ", + ND_PRINT("%s.%s > %s.%s: ", ipaddr_string(ndo, &ip->ip_src), udpport_string(ndo, sport), ipaddr_string(ndo, &ip->ip_dst), - udpport_string(ndo, dport))); + udpport_string(ndo, dport)); } } else { if (sport != -1) { - ND_PRINT((ndo, "%s > %s: ", + ND_PRINT("%s > %s: ", udpport_string(ndo, sport), - udpport_string(ndo, dport))); + udpport_string(ndo, dport)); } } } @@ -395,7 +395,7 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, if (length < sizeof(struct udphdr)) { udpipaddr_print(ndo, ip, sport, dport); - ND_PRINT((ndo, "truncated-udp %d", length)); + ND_PRINT("truncated-udp %d", length); return; } if (!ND_TTEST(up->uh_ulen)) { @@ -405,7 +405,7 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, ulen = EXTRACT_BE_U_2(up->uh_ulen); if (ulen < sizeof(struct udphdr)) { udpipaddr_print(ndo, ip, sport, dport); - ND_PRINT((ndo, "truncated-udplength %d", ulen)); + ND_PRINT("truncated-udplength %d", ulen); return; } ulen -= sizeof(struct udphdr); @@ -510,13 +510,13 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, if (ND_TTEST(rp->rm_direction)) { direction = (enum sunrpc_msg_type) EXTRACT_BE_U_4(&rp->rm_direction); if (dport == NFS_PORT && direction == SUNRPC_CALL) { - ND_PRINT((ndo, "NFS request xid %u ", EXTRACT_BE_U_4(&rp->rm_xid))); + ND_PRINT("NFS request xid %u ", EXTRACT_BE_U_4(&rp->rm_xid)); nfsreq_noaddr_print(ndo, (const u_char *)rp, length, (const u_char *)ip); return; } if (sport == NFS_PORT && direction == SUNRPC_REPLY) { - ND_PRINT((ndo, "NFS reply xid %u ", EXTRACT_BE_U_4(&rp->rm_xid))); + ND_PRINT("NFS reply xid %u ", EXTRACT_BE_U_4(&rp->rm_xid)); nfsreply_noaddr_print(ndo, (const u_char *)rp, length, (const u_char *)ip); return; @@ -541,16 +541,16 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, if (IP_V(ip) == 4 && (ndo->ndo_vflag > 1)) { udp_sum = EXTRACT_BE_U_2(up->uh_sum); if (udp_sum == 0) { - ND_PRINT((ndo, "[no cksum] ")); + ND_PRINT("[no cksum] "); } else if (ND_TTEST_LEN(cp, length)) { sum = udp_cksum(ndo, ip, up, length + sizeof(struct udphdr)); if (sum != 0) { - ND_PRINT((ndo, "[bad udp cksum 0x%04x -> 0x%04x!] ", + ND_PRINT("[bad udp cksum 0x%04x -> 0x%04x!] ", udp_sum, - in_cksum_shouldbe(udp_sum, sum))); + in_cksum_shouldbe(udp_sum, sum)); } else - ND_PRINT((ndo, "[udp sum ok] ")); + ND_PRINT("[udp sum ok] "); } } else if (IP_V(ip) == 6 && ip6->ip6_plen) { @@ -560,11 +560,11 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, udp_sum = EXTRACT_BE_U_2(up->uh_sum); if (sum != 0) { - ND_PRINT((ndo, "[bad udp cksum 0x%04x -> 0x%04x!] ", + ND_PRINT("[bad udp cksum 0x%04x -> 0x%04x!] ", udp_sum, - in_cksum_shouldbe(udp_sum, sum))); + in_cksum_shouldbe(udp_sum, sum)); } else - ND_PRINT((ndo, "[udp sum ok] ")); + ND_PRINT("[udp sum ok] "); } } } @@ -685,26 +685,26 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, EXTRACT_U_1(((const struct LAP *)cp)->type) == lapDDP && (atalk_port(sport) || atalk_port(dport))) { if (ndo->ndo_vflag) - ND_PRINT((ndo, "kip ")); + ND_PRINT("kip "); llap_print(ndo, cp, length); } else { if (ulen > length) - ND_PRINT((ndo, "UDP, bad length %u > %u", - ulen, length)); + ND_PRINT("UDP, bad length %u > %u", + ulen, length); else - ND_PRINT((ndo, "UDP, length %u", ulen)); + ND_PRINT("UDP, length %u", ulen); } } else { if (ulen > length) - ND_PRINT((ndo, "UDP, bad length %u > %u", - ulen, length)); + ND_PRINT("UDP, bad length %u > %u", + ulen, length); else - ND_PRINT((ndo, "UDP, length %u", ulen)); + ND_PRINT("UDP, length %u", ulen); } return; trunc: - ND_PRINT((ndo, "%s", udp_tstr)); + ND_PRINT("%s", udp_tstr); } diff --git a/print-usb.c b/print-usb.c index 5e425f16..9031f275 100644 --- a/print-usb.c +++ b/print-usb.c @@ -88,42 +88,42 @@ usb_header_print(netdissect_options *ndo, const pcap_usb_header *uh) switch(uh->transfer_type) { case URB_ISOCHRONOUS: - ND_PRINT((ndo, "ISOCHRONOUS")); + ND_PRINT("ISOCHRONOUS"); break; case URB_INTERRUPT: - ND_PRINT((ndo, "INTERRUPT")); + ND_PRINT("INTERRUPT"); break; case URB_CONTROL: - ND_PRINT((ndo, "CONTROL")); + ND_PRINT("CONTROL"); break; case URB_BULK: - ND_PRINT((ndo, "BULK")); + ND_PRINT("BULK"); break; default: - ND_PRINT((ndo, " ?")); + ND_PRINT(" ?"); } switch(uh->event_type) { case URB_SUBMIT: - ND_PRINT((ndo, " SUBMIT")); + ND_PRINT(" SUBMIT"); break; case URB_COMPLETE: - ND_PRINT((ndo, " COMPLETE")); + ND_PRINT(" COMPLETE"); break; case URB_ERROR: - ND_PRINT((ndo, " ERROR")); + ND_PRINT(" ERROR"); break; default: - ND_PRINT((ndo, " ?")); + ND_PRINT(" ?"); } direction = get_direction(uh->transfer_type, uh->event_type); if(direction == 1) - ND_PRINT((ndo, " from")); + ND_PRINT(" from"); else if(direction == 2) - ND_PRINT((ndo, " to")); - ND_PRINT((ndo, " %d:%d:%d", uh->bus_id, uh->device_address, uh->endpoint_number & 0x7f)); + ND_PRINT(" to"); + ND_PRINT(" %d:%d:%d", uh->bus_id, uh->device_address, uh->endpoint_number & 0x7f); } /* @@ -139,7 +139,7 @@ usb_linux_48_byte_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { if (h->caplen < sizeof(pcap_usb_header)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return(sizeof(pcap_usb_header)); } @@ -162,7 +162,7 @@ usb_linux_64_byte_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { if (h->caplen < sizeof(pcap_usb_header_mmapped)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return(sizeof(pcap_usb_header_mmapped)); } diff --git a/print-vjc.c b/print-vjc.c index 0743cfa0..4a5fe9bd 100644 --- a/print-vjc.c +++ b/print-vjc.c @@ -91,31 +91,31 @@ vjc_print(netdissect_options *ndo, const u_char *bp, u_short proto _U_) switch (EXTRACT_U_1(bp) & 0xf0) { case TYPE_IP: if (ndo->ndo_eflag) - ND_PRINT((ndo, "(vjc type=IP) ")); + ND_PRINT("(vjc type=IP) "); return PPP_IP; case TYPE_UNCOMPRESSED_TCP: if (ndo->ndo_eflag) - ND_PRINT((ndo, "(vjc type=raw TCP) ")); + ND_PRINT("(vjc type=raw TCP) "); return PPP_IP; case TYPE_COMPRESSED_TCP: if (ndo->ndo_eflag) - ND_PRINT((ndo, "(vjc type=compressed TCP) ")); + ND_PRINT("(vjc type=compressed TCP) "); for (i = 0; i < 8; i++) { if (EXTRACT_U_1(bp + 1) & (0x80 >> i)) - ND_PRINT((ndo, "%c", "?CI?SAWU"[i])); + ND_PRINT("%c", "?CI?SAWU"[i]); } if (EXTRACT_U_1(bp + 1)) - ND_PRINT((ndo, " ")); - ND_PRINT((ndo, "C=0x%02x ", EXTRACT_U_1(bp + 2))); - ND_PRINT((ndo, "sum=0x%04x ", *(const u_short *)(bp + 3))); + ND_PRINT(" "); + ND_PRINT("C=0x%02x ", EXTRACT_U_1(bp + 2)); + ND_PRINT("sum=0x%04x ", *(const u_short *)(bp + 3)); return -1; case TYPE_ERROR: if (ndo->ndo_eflag) - ND_PRINT((ndo, "(vjc type=error) ")); + ND_PRINT("(vjc type=error) "); return -1; default: if (ndo->ndo_eflag) - ND_PRINT((ndo, "(vjc type=0x%02x) ", EXTRACT_U_1(bp) & 0xf0)); + ND_PRINT("(vjc type=0x%02x) ", EXTRACT_U_1(bp) & 0xf0); return -1; } } diff --git a/print-vqp.c b/print-vqp.c index 12680b03..672dbd8d 100644 --- a/print-vqp.c +++ b/print-vqp.c @@ -120,32 +120,32 @@ vqp_print(netdissect_options *ndo, const u_char *pptr, u_int len) * Sanity checking of the header. */ if (version != VQP_VERSION) { - ND_PRINT((ndo, "VQP version %u packet not supported", - version)); + ND_PRINT("VQP version %u packet not supported", + version); return; } /* in non-verbose mode just lets print the basic Message Type */ if (ndo->ndo_vflag < 1) { - ND_PRINT((ndo, "VQPv%u %s Message, error-code %s (%u), length %u", + ND_PRINT("VQPv%u %s Message, error-code %s (%u), length %u", version, tok2str(vqp_msg_type_values, "unknown (%u)",EXTRACT_U_1(vqp_common_header->msg_type)), tok2str(vqp_error_code_values, "unknown (%u)",EXTRACT_U_1(vqp_common_header->error_code)), EXTRACT_U_1(vqp_common_header->error_code), - len)); + len); return; } /* ok they seem to want to know everything - lets fully decode it */ nitems = EXTRACT_U_1(vqp_common_header->nitems); - ND_PRINT((ndo, "\n\tVQPv%u, %s Message, error-code %s (%u), seq 0x%08x, items %u, length %u", + ND_PRINT("\n\tVQPv%u, %s Message, error-code %s (%u), seq 0x%08x, items %u, length %u", version, tok2str(vqp_msg_type_values, "unknown (%u)",EXTRACT_U_1(vqp_common_header->msg_type)), tok2str(vqp_error_code_values, "unknown (%u)",EXTRACT_U_1(vqp_common_header->error_code)), EXTRACT_U_1(vqp_common_header->error_code), EXTRACT_BE_U_4(vqp_common_header->sequence), nitems, - len)); + len); /* skip VQP Common header */ tptr+=sizeof(struct vqp_common_header_t); @@ -162,9 +162,9 @@ vqp_print(netdissect_options *ndo, const u_char *pptr, u_int len) tptr+=sizeof(struct vqp_obj_tlv_t); tlen-=sizeof(struct vqp_obj_tlv_t); - ND_PRINT((ndo, "\n\t %s Object (0x%08x), length %u, value: ", + ND_PRINT("\n\t %s Object (0x%08x), length %u, value: ", tok2str(vqp_obj_values, "Unknown", vqp_obj_type), - vqp_obj_type, vqp_obj_len)); + vqp_obj_type, vqp_obj_len); /* basic sanity check */ if (vqp_obj_type == 0 || vqp_obj_len ==0) { @@ -180,7 +180,7 @@ vqp_print(netdissect_options *ndo, const u_char *pptr, u_int len) case VQP_OBJ_IP_ADDRESS: if (vqp_obj_len != 4) goto trunc; - ND_PRINT((ndo, "%s (0x%08x)", ipaddr_string(ndo, tptr), EXTRACT_BE_U_4(tptr))); + ND_PRINT("%s (0x%08x)", ipaddr_string(ndo, tptr), EXTRACT_BE_U_4(tptr)); break; /* those objects have similar semantics - fall through */ case VQP_OBJ_PORT_NAME: @@ -194,7 +194,7 @@ vqp_print(netdissect_options *ndo, const u_char *pptr, u_int len) case VQP_OBJ_MAC_NULL: if (vqp_obj_len != MAC_ADDR_LEN) goto trunc; - ND_PRINT((ndo, "%s", etheraddr_string(ndo, tptr))); + ND_PRINT("%s", etheraddr_string(ndo, tptr)); break; default: if (ndo->ndo_vflag <= 1) @@ -207,5 +207,5 @@ vqp_print(netdissect_options *ndo, const u_char *pptr, u_int len) } return; trunc: - ND_PRINT((ndo, "\n\t[|VQP]")); + ND_PRINT("\n\t[|VQP]"); } diff --git a/print-vrrp.c b/print-vrrp.c index b7e309d0..d6ef7afd 100644 --- a/print-vrrp.c +++ b/print-vrrp.c @@ -114,22 +114,22 @@ vrrp_print(netdissect_options *ndo, version = (EXTRACT_U_1(bp) & 0xf0) >> 4; type = EXTRACT_U_1(bp) & 0x0f; type_s = tok2str(type2str, "unknown type (%u)", type); - ND_PRINT((ndo, "VRRPv%u, %s", version, type_s)); + ND_PRINT("VRRPv%u, %s", version, type_s); if (ttl != 255) - ND_PRINT((ndo, ", (ttl %u)", ttl)); + ND_PRINT(", (ttl %u)", ttl); if (version < 2 || version > 3 || type != VRRP_TYPE_ADVERTISEMENT) return; ND_TCHECK_1(bp + 2); - ND_PRINT((ndo, ", vrid %u, prio %u", EXTRACT_U_1(bp + 1), EXTRACT_U_1(bp + 2))); + ND_PRINT(", vrid %u, prio %u", EXTRACT_U_1(bp + 1), EXTRACT_U_1(bp + 2)); ND_TCHECK_1(bp + 5); if (version == 2) { auth_type = EXTRACT_U_1(bp + 4); - ND_PRINT((ndo, ", authtype %s", tok2str(auth2str, NULL, auth_type))); - ND_PRINT((ndo, ", intvl %us, length %u", EXTRACT_U_1(bp + 5), len)); + ND_PRINT(", authtype %s", tok2str(auth2str, NULL, auth_type)); + ND_PRINT(", intvl %us, length %u", EXTRACT_U_1(bp + 5), len); } else { /* version == 3 */ uint16_t intvl = (EXTRACT_U_1(bp + 4) & 0x0f) << 8 | EXTRACT_U_1(bp + 5); - ND_PRINT((ndo, ", intvl %ucs, length %u", intvl, len)); + ND_PRINT(", intvl %ucs, length %u", intvl, len); } if (ndo->ndo_vflag) { @@ -143,41 +143,41 @@ vrrp_print(netdissect_options *ndo, vec[0].ptr = bp; vec[0].len = len; if (in_cksum(vec, 1)) - ND_PRINT((ndo, ", (bad vrrp cksum %x)", - EXTRACT_BE_U_2(bp + 6))); + ND_PRINT(", (bad vrrp cksum %x)", + EXTRACT_BE_U_2(bp + 6)); } if (version == 3 && ND_TTEST_LEN(bp, len)) { uint16_t cksum = nextproto4_cksum(ndo, (const struct ip *)bp2, bp, len, len, IPPROTO_VRRP); if (cksum) - ND_PRINT((ndo, ", (bad vrrp cksum %x)", - EXTRACT_BE_U_2(bp + 6))); + ND_PRINT(", (bad vrrp cksum %x)", + EXTRACT_BE_U_2(bp + 6)); } - ND_PRINT((ndo, ", addrs")); + ND_PRINT(", addrs"); if (naddrs > 1) - ND_PRINT((ndo, "(%d)", naddrs)); - ND_PRINT((ndo, ":")); + ND_PRINT("(%d)", naddrs); + ND_PRINT(":"); c = ' '; bp += 8; for (i = 0; i < naddrs; i++) { ND_TCHECK_1(bp + 3); - ND_PRINT((ndo, "%c%s", c, ipaddr_string(ndo, bp))); + ND_PRINT("%c%s", c, ipaddr_string(ndo, bp)); c = ','; bp += 4; } if (version == 2 && auth_type == VRRP_AUTH_SIMPLE) { /* simple text password */ ND_TCHECK_1(bp + 7); - ND_PRINT((ndo, " auth \"")); + ND_PRINT(" auth \""); if (fn_printn(ndo, bp, 8, ndo->ndo_snapend)) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); goto trunc; } - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); } } return; trunc: - ND_PRINT((ndo, "[|vrrp]")); + ND_PRINT("[|vrrp]"); } diff --git a/print-vtp.c b/print-vtp.c index a6e44bc5..a2dee70d 100644 --- a/print-vtp.c +++ b/print-vtp.c @@ -131,11 +131,11 @@ vtp_print (netdissect_options *ndo, ND_TCHECK_LEN(tptr, VTP_HEADER_LEN); type = EXTRACT_U_1(tptr + 1); - ND_PRINT((ndo, "VTPv%u, Message %s (0x%02x), length %u", + ND_PRINT("VTPv%u, Message %s (0x%02x), length %u", EXTRACT_U_1(tptr), tok2str(vtp_message_type_values,"Unknown message type", type), type, - length)); + length); /* In non-verbose mode, just print version and message type */ if (ndo->ndo_vflag < 1) { @@ -143,16 +143,16 @@ vtp_print (netdissect_options *ndo, } /* verbose mode print all fields */ - ND_PRINT((ndo, "\n\tDomain name: ")); + ND_PRINT("\n\tDomain name: "); mgmtd_len = EXTRACT_U_1(tptr + 3); if (mgmtd_len < 1 || mgmtd_len > 32) { - ND_PRINT((ndo, " [invalid MgmtD Len %u]", mgmtd_len)); + ND_PRINT(" [invalid MgmtD Len %u]", mgmtd_len); return; } fn_printzp(ndo, tptr + 4, mgmtd_len, NULL); - ND_PRINT((ndo, ", %s: %u", + ND_PRINT(", %s: %u", tok2str(vtp_header_values, "Unknown", type), - EXTRACT_U_1(tptr + 2))); + EXTRACT_U_1(tptr + 2)); tptr += VTP_HEADER_LEN; @@ -181,22 +181,22 @@ vtp_print (netdissect_options *ndo, */ ND_TCHECK_8(tptr); - ND_PRINT((ndo, "\n\t Config Rev %x, Updater %s", + ND_PRINT("\n\t Config Rev %x, Updater %s", EXTRACT_BE_U_4(tptr), - ipaddr_string(ndo, tptr+4))); + ipaddr_string(ndo, tptr+4)); tptr += 8; ND_TCHECK_LEN(tptr, VTP_UPDATE_TIMESTAMP_LEN); - ND_PRINT((ndo, ", Timestamp 0x%08x 0x%08x 0x%08x", + ND_PRINT(", Timestamp 0x%08x 0x%08x 0x%08x", EXTRACT_BE_U_4(tptr), EXTRACT_BE_U_4(tptr + 4), - EXTRACT_BE_U_4(tptr + 8))); + EXTRACT_BE_U_4(tptr + 8)); tptr += VTP_UPDATE_TIMESTAMP_LEN; ND_TCHECK_LEN(tptr, VTP_MD5_DIGEST_LEN); - ND_PRINT((ndo, ", MD5 digest: %08x%08x%08x%08x", + ND_PRINT(", MD5 digest: %08x%08x%08x%08x", EXTRACT_BE_U_4(tptr), EXTRACT_BE_U_4(tptr + 4), EXTRACT_BE_U_4(tptr + 8), - EXTRACT_BE_U_4(tptr + 12))); + EXTRACT_BE_U_4(tptr + 12)); tptr += VTP_MD5_DIGEST_LEN; break; @@ -223,7 +223,7 @@ vtp_print (netdissect_options *ndo, */ ND_TCHECK_4(tptr); - ND_PRINT((ndo, ", Config Rev %x", EXTRACT_BE_U_4(tptr))); + ND_PRINT(", Config Rev %x", EXTRACT_BE_U_4(tptr)); /* * VLAN INFORMATION @@ -254,12 +254,12 @@ vtp_print (netdissect_options *ndo, if (len < VTP_VLAN_INFO_FIXED_PART_LEN) goto trunc; ND_TCHECK_SIZE(vtp_vlan); - ND_PRINT((ndo, "\n\tVLAN info status %s, type %s, VLAN-id %u, MTU %u, SAID 0x%08x, Name ", + ND_PRINT("\n\tVLAN info status %s, type %s, VLAN-id %u, MTU %u, SAID 0x%08x, Name ", tok2str(vtp_vlan_status,"Unknown",EXTRACT_U_1(vtp_vlan->status)), tok2str(vtp_vlan_type_values,"Unknown",EXTRACT_U_1(vtp_vlan->type)), EXTRACT_BE_U_2(vtp_vlan->vlanid), EXTRACT_BE_U_2(vtp_vlan->mtu), - EXTRACT_BE_U_4(vtp_vlan->index))); + EXTRACT_BE_U_4(vtp_vlan->index)); len -= VTP_VLAN_INFO_FIXED_PART_LEN; tptr += VTP_VLAN_INFO_FIXED_PART_LEN; name_len = EXTRACT_U_1(vtp_vlan->name_len); @@ -291,12 +291,12 @@ vtp_print (netdissect_options *ndo, type = EXTRACT_U_1(tptr); tlv_len = EXTRACT_U_1(tptr + 1); - ND_PRINT((ndo, "\n\t\t%s (0x%04x) TLV", + ND_PRINT("\n\t\t%s (0x%04x) TLV", tok2str(vtp_vlan_tlv_values, "Unknown", type), - type)); + type); if (len < tlv_len * 2 + 2) { - ND_PRINT((ndo, " (TLV goes past the end of the packet)")); + ND_PRINT(" (TLV goes past the end of the packet)"); return; } ND_TCHECK_LEN(tptr, tlv_len * 2 + 2); @@ -306,38 +306,38 @@ vtp_print (netdissect_options *ndo, * in units of 16-bit words. */ if (tlv_len != 1) { - ND_PRINT((ndo, " (invalid TLV length %u != 1)", tlv_len)); + ND_PRINT(" (invalid TLV length %u != 1)", tlv_len); return; } else { tlv_value = EXTRACT_BE_U_2(tptr + 2); switch (type) { case VTP_VLAN_STE_HOP_COUNT: - ND_PRINT((ndo, ", %u", tlv_value)); + ND_PRINT(", %u", tlv_value); break; case VTP_VLAN_PRUNING: - ND_PRINT((ndo, ", %s (%u)", + ND_PRINT(", %s (%u)", tlv_value == 1 ? "Enabled" : "Disabled", - tlv_value)); + tlv_value); break; case VTP_VLAN_STP_TYPE: - ND_PRINT((ndo, ", %s (%u)", + ND_PRINT(", %s (%u)", tok2str(vtp_stp_type_values, "Unknown", tlv_value), - tlv_value)); + tlv_value); break; case VTP_VLAN_BRIDGE_TYPE: - ND_PRINT((ndo, ", %s (%u)", + ND_PRINT(", %s (%u)", tlv_value == 1 ? "SRB" : "SRT", - tlv_value)); + tlv_value); break; case VTP_VLAN_BACKUP_CRF_MODE: - ND_PRINT((ndo, ", %s (%u)", + ND_PRINT(", %s (%u)", tlv_value == 1 ? "Backup" : "Not backup", - tlv_value)); + tlv_value); break; /* @@ -378,7 +378,7 @@ vtp_print (netdissect_options *ndo, */ ND_TCHECK_4(tptr); - ND_PRINT((ndo, "\n\tStart value: %u", EXTRACT_BE_U_4(tptr))); + ND_PRINT("\n\tStart value: %u", EXTRACT_BE_U_4(tptr)); break; case VTP_JOIN_MESSAGE: @@ -393,7 +393,7 @@ vtp_print (netdissect_options *ndo, return; trunc: - ND_PRINT((ndo, "[|vtp]")); + ND_PRINT("[|vtp]"); } /* diff --git a/print-vxlan-gpe.c b/print-vxlan-gpe.c index f3fd8556..c51d4d2b 100644 --- a/print-vxlan-gpe.c +++ b/print-vxlan-gpe.c @@ -78,11 +78,11 @@ vxlan_gpe_print(netdissect_options *ndo, const u_char *bp, u_int len) vni = EXTRACT_BE_U_3(bp); bp += 4; - ND_PRINT((ndo, "VXLAN-GPE, ")); - ND_PRINT((ndo, "flags [%s], ", - bittok2str_nosep(vxlan_gpe_flags, "none", flags))); - ND_PRINT((ndo, "vni %u", vni)); - ND_PRINT((ndo, ndo->ndo_vflag ? "\n " : ": ")); + ND_PRINT("VXLAN-GPE, "); + ND_PRINT("flags [%s], ", + bittok2str_nosep(vxlan_gpe_flags, "none", flags)); + ND_PRINT("vni %u", vni); + ND_PRINT(ndo->ndo_vflag ? "\n " : ": "); switch (next_protocol) { case 0x1: @@ -101,13 +101,13 @@ vxlan_gpe_print(netdissect_options *ndo, const u_char *bp, u_int len) mpls_print(ndo, bp, len - VXLAN_GPE_HDR_LEN); break; default: - ND_PRINT((ndo, "ERROR: unknown-next-protocol")); + ND_PRINT("ERROR: unknown-next-protocol"); return; } return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } diff --git a/print-vxlan.c b/print-vxlan.c index 82aec20c..de0adbff 100644 --- a/print-vxlan.c +++ b/print-vxlan.c @@ -61,14 +61,14 @@ vxlan_print(netdissect_options *ndo, const u_char *bp, u_int len) vni = EXTRACT_BE_U_3(bp); bp += 4; - ND_PRINT((ndo, "VXLAN, ")); - ND_PRINT((ndo, "flags [%s] (0x%02x), ", flags & 0x08 ? "I" : ".", flags)); - ND_PRINT((ndo, "vni %u\n", vni)); + ND_PRINT("VXLAN, "); + ND_PRINT("flags [%s] (0x%02x), ", flags & 0x08 ? "I" : ".", flags); + ND_PRINT("vni %u\n", vni); ether_print(ndo, bp, len - VXLAN_HDR_LEN, ndo->ndo_snapend - bp, NULL, NULL); return; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); } @@ -186,37 +186,37 @@ wb_id(netdissect_options *ndo, char c; u_int nid; - ND_PRINT((ndo, " wb-id:")); + ND_PRINT(" wb-id:"); if (len < sizeof(*id) || !ND_TTEST_SIZE(id)) return (-1); len -= sizeof(*id); - ND_PRINT((ndo, " %u/%s:%u (max %u/%s:%u) ", + ND_PRINT(" %u/%s:%u (max %u/%s:%u) ", EXTRACT_BE_U_4(id->pi_ps.slot), ipaddr_string(ndo, &id->pi_ps.page.p_sid), EXTRACT_BE_U_4(id->pi_ps.page.p_uid), EXTRACT_BE_U_4(id->pi_mslot), ipaddr_string(ndo, &id->pi_mpage.p_sid), - EXTRACT_BE_U_4(id->pi_mpage.p_uid))); + EXTRACT_BE_U_4(id->pi_mpage.p_uid)); nid = EXTRACT_BE_U_2(id->pi_ps.nid); len -= sizeof(*io) * nid; io = (const struct id_off *)(id + 1); cp = (const char *)(io + nid); if (ND_TTEST_LEN(cp, len)) { - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); fn_print(ndo, (const u_char *)cp, (const u_char *)cp + len); - ND_PRINT((ndo, "\"")); + ND_PRINT("\""); } c = '<'; for (i = 0; i < nid && ND_TTEST_SIZE(io); ++io, ++i) { - ND_PRINT((ndo, "%c%s:%u", - c, ipaddr_string(ndo, &io->id), EXTRACT_BE_U_4(io->off))); + ND_PRINT("%c%s:%u", + c, ipaddr_string(ndo, &io->id), EXTRACT_BE_U_4(io->off)); c = ','; } if (i >= nid) { - ND_PRINT((ndo, ">")); + ND_PRINT(">"); return (0); } return (-1); @@ -226,16 +226,16 @@ static int wb_rreq(netdissect_options *ndo, const struct pkt_rreq *rreq, u_int len) { - ND_PRINT((ndo, " wb-rreq:")); + ND_PRINT(" wb-rreq:"); if (len < sizeof(*rreq) || !ND_TTEST_SIZE(rreq)) return (-1); - ND_PRINT((ndo, " please repair %s %s:%u<%u:%u>", + ND_PRINT(" please repair %s %s:%u<%u:%u>", ipaddr_string(ndo, &rreq->pr_id), ipaddr_string(ndo, &rreq->pr_page.p_sid), EXTRACT_BE_U_4(rreq->pr_page.p_uid), EXTRACT_BE_U_4(rreq->pr_sseq), - EXTRACT_BE_U_4(rreq->pr_eseq))); + EXTRACT_BE_U_4(rreq->pr_eseq)); return (0); } @@ -243,14 +243,14 @@ static int wb_preq(netdissect_options *ndo, const struct pkt_preq *preq, u_int len) { - ND_PRINT((ndo, " wb-preq:")); + ND_PRINT(" wb-preq:"); if (len < sizeof(*preq) || !ND_TTEST_SIZE(preq)) return (-1); - ND_PRINT((ndo, " need %u/%s:%u", + ND_PRINT(" need %u/%s:%u", EXTRACT_BE_U_4(preq->pp_low), ipaddr_string(ndo, &preq->pp_page.p_sid), - EXTRACT_BE_U_4(preq->pp_page.p_uid))); + EXTRACT_BE_U_4(preq->pp_page.p_uid)); return (0); } @@ -262,7 +262,7 @@ wb_prep(netdissect_options *ndo, const struct pgstate *ps; const u_char *ep = ndo->ndo_snapend; - ND_PRINT((ndo, " wb-prep:")); + ND_PRINT(" wb-prep:"); if (len < sizeof(*prep) || !ND_TTEST_SIZE(prep)) return (-1); n = EXTRACT_BE_U_4(prep->pp_n); @@ -271,17 +271,17 @@ wb_prep(netdissect_options *ndo, const struct id_off *io, *ie; char c = '<'; - ND_PRINT((ndo, " %u/%s:%u", + ND_PRINT(" %u/%s:%u", EXTRACT_BE_U_4(ps->slot), ipaddr_string(ndo, &ps->page.p_sid), - EXTRACT_BE_U_4(ps->page.p_uid))); + EXTRACT_BE_U_4(ps->page.p_uid)); io = (const struct id_off *)(ps + 1); for (ie = io + EXTRACT_U_1(ps->nid); io < ie && ND_TTEST_SIZE(io); ++io) { - ND_PRINT((ndo, "%c%s:%u", c, ipaddr_string(ndo, &io->id), - EXTRACT_BE_U_4(io->off))); + ND_PRINT("%c%s:%u", c, ipaddr_string(ndo, &io->id), + EXTRACT_BE_U_4(io->off)); c = ','; } - ND_PRINT((ndo, ">")); + ND_PRINT(">"); ps = (const struct pgstate *)io; n--; } @@ -314,25 +314,25 @@ wb_dops(netdissect_options *ndo, const struct pkt_dop *dop, { const struct dophdr *dh = (const struct dophdr *)((const u_char *)dop + sizeof(*dop)); - ND_PRINT((ndo, " <")); + ND_PRINT(" <"); for ( ; ss <= es; ++ss) { u_int t; if (!ND_TTEST_SIZE(dh)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; } t = EXTRACT_U_1(dh->dh_type); if (t > DT_MAXTYPE) - ND_PRINT((ndo, " dop-%u!", t)); + ND_PRINT(" dop-%u!", t); else { - ND_PRINT((ndo, " %s", dopstr[t])); + ND_PRINT(" %s", dopstr[t]); if (t == DT_SKIP || t == DT_HOLE) { uint32_t ts = EXTRACT_BE_U_4(dh->dh_ts); - ND_PRINT((ndo, "%u", ts - ss + 1)); + ND_PRINT("%u", ts - ss + 1); if (ss > ts || ts > es) { - ND_PRINT((ndo, "[|]")); + ND_PRINT("[|]"); if (ts < ss) return (0); } @@ -341,7 +341,7 @@ wb_dops(netdissect_options *ndo, const struct pkt_dop *dop, } dh = DOP_NEXT(dh); } - ND_PRINT((ndo, " >")); + ND_PRINT(" >"); return (0); } @@ -351,17 +351,17 @@ wb_rrep(netdissect_options *ndo, { const struct pkt_dop *dop = &rrep->pr_dop; - ND_PRINT((ndo, " wb-rrep:")); + ND_PRINT(" wb-rrep:"); if (len < sizeof(*rrep) || !ND_TTEST_SIZE(rrep)) return (-1); len -= sizeof(*rrep); - ND_PRINT((ndo, " for %s %s:%u<%u:%u>", + ND_PRINT(" for %s %s:%u<%u:%u>", ipaddr_string(ndo, &rrep->pr_id), ipaddr_string(ndo, &dop->pd_page.p_sid), EXTRACT_BE_U_4(dop->pd_page.p_uid), EXTRACT_BE_U_4(dop->pd_sseq), - EXTRACT_BE_U_4(dop->pd_eseq))); + EXTRACT_BE_U_4(dop->pd_eseq)); if (ndo->ndo_vflag) return (wb_dops(ndo, dop, @@ -374,16 +374,16 @@ static int wb_drawop(netdissect_options *ndo, const struct pkt_dop *dop, u_int len) { - ND_PRINT((ndo, " wb-dop:")); + ND_PRINT(" wb-dop:"); if (len < sizeof(*dop) || !ND_TTEST_SIZE(dop)) return (-1); len -= sizeof(*dop); - ND_PRINT((ndo, " %s:%u<%u:%u>", + ND_PRINT(" %s:%u<%u:%u>", ipaddr_string(ndo, &dop->pd_page.p_sid), EXTRACT_BE_U_4(dop->pd_page.p_uid), EXTRACT_BE_U_4(dop->pd_sseq), - EXTRACT_BE_U_4(dop->pd_eseq))); + EXTRACT_BE_U_4(dop->pd_eseq)); if (ndo->ndo_vflag) return (wb_dops(ndo, dop, @@ -404,58 +404,58 @@ wb_print(netdissect_options *ndo, ph = (const struct pkt_hdr *)hdr; if (len < sizeof(*ph) || !ND_TTEST_SIZE(ph)) { - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return; } len -= sizeof(*ph); if (EXTRACT_U_1(ph->ph_flags)) - ND_PRINT((ndo, "*")); + ND_PRINT("*"); type = EXTRACT_U_1(ph->ph_type); switch (type) { case PT_KILL: - ND_PRINT((ndo, " wb-kill")); + ND_PRINT(" wb-kill"); return; case PT_ID: if (wb_id(ndo, (const struct pkt_id *)(ph + 1), len) >= 0) return; - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; case PT_RREQ: if (wb_rreq(ndo, (const struct pkt_rreq *)(ph + 1), len) >= 0) return; - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; case PT_RREP: if (wb_rrep(ndo, (const struct pkt_rrep *)(ph + 1), len) >= 0) return; - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; case PT_DRAWOP: if (wb_drawop(ndo, (const struct pkt_dop *)(ph + 1), len) >= 0) return; - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; case PT_PREQ: if (wb_preq(ndo, (const struct pkt_preq *)(ph + 1), len) >= 0) return; - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; case PT_PREP: if (wb_prep(ndo, (const struct pkt_prep *)(ph + 1), len) >= 0) return; - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); break; default: - ND_PRINT((ndo, " wb-%u!", type)); + ND_PRINT(" wb-%u!", type); return; } } diff --git a/print-zephyr.c b/print-zephyr.c index bce894a4..2addd388 100644 --- a/print-zephyr.c +++ b/print-zephyr.c @@ -198,34 +198,34 @@ zephyr_print(netdissect_options *ndo, const u_char *cp, int length) if (lose) goto trunc; - ND_PRINT((ndo, " zephyr")); + ND_PRINT(" zephyr"); if (strncmp(z.version+4, "0.2", 3)) { - ND_PRINT((ndo, " v%s", z.version+4)); + ND_PRINT(" v%s", z.version+4); return; } - ND_PRINT((ndo, " %s", tok2str(z_types, "type %d", z.kind))); + ND_PRINT(" %s", tok2str(z_types, "type %d", z.kind)); if (z.kind == Z_PACKET_SERVACK) { /* Initialization to silence warnings */ const char *ackdata = NULL; PARSE_FIELD_STR(ackdata); if (!lose && strcmp(ackdata, "SENT")) - ND_PRINT((ndo, "/%s", str_to_lower(ackdata))); + ND_PRINT("/%s", str_to_lower(ackdata)); } - if (*z.sender) ND_PRINT((ndo, " %s", z.sender)); + if (*z.sender) ND_PRINT(" %s", z.sender); if (!strcmp(z.class, "USER_LOCATE")) { if (!strcmp(z.opcode, "USER_HIDE")) - ND_PRINT((ndo, " hide")); + ND_PRINT(" hide"); else if (!strcmp(z.opcode, "USER_UNHIDE")) - ND_PRINT((ndo, " unhide")); + ND_PRINT(" unhide"); else - ND_PRINT((ndo, " locate %s", z.inst)); + ND_PRINT(" locate %s", z.inst); return; } if (!strcmp(z.class, "ZEPHYR_ADMIN")) { - ND_PRINT((ndo, " zephyr-admin %s", str_to_lower(z.opcode))); + ND_PRINT(" zephyr-admin %s", str_to_lower(z.opcode)); return; } @@ -235,79 +235,79 @@ zephyr_print(netdissect_options *ndo, const u_char *cp, int length) !strcmp(z.opcode, "SUBSCRIBE_NODEFS") || !strcmp(z.opcode, "UNSUBSCRIBE")) { - ND_PRINT((ndo, " %ssub%s", strcmp(z.opcode, "SUBSCRIBE") ? "un" : "", + ND_PRINT(" %ssub%s", strcmp(z.opcode, "SUBSCRIBE") ? "un" : "", strcmp(z.opcode, "SUBSCRIBE_NODEFS") ? "" : - "-nodefs")); + "-nodefs"); if (z.kind != Z_PACKET_SERVACK) { /* Initialization to silence warnings */ const char *c = NULL, *i = NULL, *r = NULL; PARSE_FIELD_STR(c); PARSE_FIELD_STR(i); PARSE_FIELD_STR(r); - if (!lose) ND_PRINT((ndo, " %s", z_triple(c, i, r))); + if (!lose) ND_PRINT(" %s", z_triple(c, i, r)); } return; } if (!strcmp(z.opcode, "GIMME")) { - ND_PRINT((ndo, " ret")); + ND_PRINT(" ret"); return; } if (!strcmp(z.opcode, "GIMMEDEFS")) { - ND_PRINT((ndo, " gimme-defs")); + ND_PRINT(" gimme-defs"); return; } if (!strcmp(z.opcode, "CLEARSUB")) { - ND_PRINT((ndo, " clear-subs")); + ND_PRINT(" clear-subs"); return; } - ND_PRINT((ndo, " %s", str_to_lower(z.opcode))); + ND_PRINT(" %s", str_to_lower(z.opcode)); return; } if (!strcmp(z.inst, "HM")) { - ND_PRINT((ndo, " %s", str_to_lower(z.opcode))); + ND_PRINT(" %s", str_to_lower(z.opcode)); return; } if (!strcmp(z.inst, "REALM")) { if (!strcmp(z.opcode, "ADD_SUBSCRIBE")) - ND_PRINT((ndo, " realm add-subs")); + ND_PRINT(" realm add-subs"); if (!strcmp(z.opcode, "REQ_SUBSCRIBE")) - ND_PRINT((ndo, " realm req-subs")); + ND_PRINT(" realm req-subs"); if (!strcmp(z.opcode, "RLM_SUBSCRIBE")) - ND_PRINT((ndo, " realm rlm-sub")); + ND_PRINT(" realm rlm-sub"); if (!strcmp(z.opcode, "RLM_UNSUBSCRIBE")) - ND_PRINT((ndo, " realm rlm-unsub")); + ND_PRINT(" realm rlm-unsub"); return; } } if (!strcmp(z.class, "HM_CTL")) { - ND_PRINT((ndo, " hm_ctl %s", str_to_lower(z.inst))); - ND_PRINT((ndo, " %s", str_to_lower(z.opcode))); + ND_PRINT(" hm_ctl %s", str_to_lower(z.inst)); + ND_PRINT(" %s", str_to_lower(z.opcode)); return; } if (!strcmp(z.class, "HM_STAT")) { if (!strcmp(z.inst, "HMST_CLIENT") && !strcmp(z.opcode, "GIMMESTATS")) { - ND_PRINT((ndo, " get-client-stats")); + ND_PRINT(" get-client-stats"); return; } } if (!strcmp(z.class, "WG_CTL")) { - ND_PRINT((ndo, " wg_ctl %s", str_to_lower(z.inst))); - ND_PRINT((ndo, " %s", str_to_lower(z.opcode))); + ND_PRINT(" wg_ctl %s", str_to_lower(z.inst)); + ND_PRINT(" %s", str_to_lower(z.opcode)); return; } if (!strcmp(z.class, "LOGIN")) { if (!strcmp(z.opcode, "USER_FLUSH")) { - ND_PRINT((ndo, " flush_locs")); + ND_PRINT(" flush_locs"); return; } @@ -317,7 +317,7 @@ zephyr_print(netdissect_options *ndo, const u_char *cp, int length) !strcmp(z.opcode, "REALM-ANNOUNCED") || !strcmp(z.opcode, "NET-VISIBLE") || !strcmp(z.opcode, "NET-ANNOUNCED")) { - ND_PRINT((ndo, " set-exposure %s", str_to_lower(z.opcode))); + ND_PRINT(" set-exposure %s", str_to_lower(z.opcode)); return; } } @@ -325,12 +325,12 @@ zephyr_print(netdissect_options *ndo, const u_char *cp, int length) if (!*z.recipient) z.recipient = "*"; - ND_PRINT((ndo, " to %s", z_triple(z.class, z.inst, z.recipient))); + ND_PRINT(" to %s", z_triple(z.class, z.inst, z.recipient)); if (*z.opcode) - ND_PRINT((ndo, " op %s", z.opcode)); + ND_PRINT(" op %s", z.opcode); return; trunc: - ND_PRINT((ndo, " [|zephyr] (%d)", length)); + ND_PRINT(" [|zephyr] (%d)", length); return; } diff --git a/print-zeromq.c b/print-zeromq.c index e43d0717..587ee3e4 100644 --- a/print-zeromq.c +++ b/print-zeromq.c @@ -79,19 +79,19 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) uint64_t body_len_declared, body_len_captured, header_len; uint8_t flags; - ND_PRINT((ndo, "\n\t")); + ND_PRINT("\n\t"); ND_TCHECK_1(cp); /* length/0xFF */ if (EXTRACT_U_1(cp) != 0xFF) { header_len = 1; /* length */ body_len_declared = EXTRACT_U_1(cp); - ND_PRINT((ndo, " frame flags+body (8-bit) length %" PRIu64, body_len_declared)); + ND_PRINT(" frame flags+body (8-bit) length %" PRIu64, body_len_declared); } else { header_len = 1 + 8; /* 0xFF, length */ - ND_PRINT((ndo, " frame flags+body (64-bit) length")); + ND_PRINT(" frame flags+body (64-bit) length"); ND_TCHECK_LEN(cp, header_len); /* 0xFF, length */ body_len_declared = EXTRACT_BE_U_8(cp + 1); - ND_PRINT((ndo, " %" PRIu64, body_len_declared)); + ND_PRINT(" %" PRIu64, body_len_declared); } if (body_len_declared == 0) return cp + header_len; /* skip to the next frame */ @@ -100,13 +100,13 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) body_len_captured = ep - cp - header_len; if (body_len_declared > body_len_captured) - ND_PRINT((ndo, " (%" PRIu64 " captured)", body_len_captured)); - ND_PRINT((ndo, ", flags 0x%02x", flags)); + ND_PRINT(" (%" PRIu64 " captured)", body_len_captured); + ND_PRINT(", flags 0x%02x", flags); if (ndo->ndo_vflag) { uint64_t body_len_printed = min(body_len_captured, body_len_declared); - ND_PRINT((ndo, " (%s|%s|%s|%s|%s|%s|%s|%s)", + ND_PRINT(" (%s|%s|%s|%s|%s|%s|%s|%s)", flags & 0x80 ? "MBZ" : "-", flags & 0x40 ? "MBZ" : "-", flags & 0x20 ? "MBZ" : "-", @@ -114,14 +114,14 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) flags & 0x08 ? "MBZ" : "-", flags & 0x04 ? "MBZ" : "-", flags & 0x02 ? "MBZ" : "-", - flags & 0x01 ? "MORE" : "-")); + flags & 0x01 ? "MORE" : "-"); if (ndo->ndo_vflag == 1) body_len_printed = min(VBYTES + 1, body_len_printed); if (body_len_printed > 1) { - ND_PRINT((ndo, ", first %" PRIu64 " byte(s) of body:", body_len_printed - 1)); + ND_PRINT(", first %" PRIu64 " byte(s) of body:", body_len_printed - 1); hex_and_ascii_print(ndo, "\n\t ", cp + header_len + 1, body_len_printed - 1); - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); } } @@ -136,7 +136,7 @@ zmtp1_print_frame(netdissect_options *ndo, const u_char *cp, const u_char *ep) return cp + body_len_declared; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return ep; } @@ -145,7 +145,7 @@ zmtp1_print(netdissect_options *ndo, const u_char *cp, u_int len) { const u_char *ep = min(ndo->ndo_snapend, cp + len); - ND_PRINT((ndo, ": ZMTP/1.0")); + ND_PRINT(": ZMTP/1.0"); while (cp < ep) cp = zmtp1_print_frame(ndo, cp, ep); } @@ -174,38 +174,38 @@ zmtp1_print_intermediate_part(netdissect_options *ndo, const u_char *cp, const u ND_TCHECK_2(cp); frame_offset = EXTRACT_BE_U_2(cp); - ND_PRINT((ndo, "\n\t frame offset 0x%04x", frame_offset)); + ND_PRINT("\n\t frame offset 0x%04x", frame_offset); cp += 2; remaining_len = ndo->ndo_snapend - cp; /* without the frame length */ if (frame_offset == 0xFFFF) frame_offset = len - 2; /* always within the declared length */ else if (2 + frame_offset > len) { - ND_PRINT((ndo, " (exceeds datagram declared length)")); + ND_PRINT(" (exceeds datagram declared length)"); goto trunc; } /* offset within declared length of the datagram */ if (frame_offset) { - ND_PRINT((ndo, "\n\t frame intermediate part, %u bytes", frame_offset)); + ND_PRINT("\n\t frame intermediate part, %u bytes", frame_offset); if (frame_offset > remaining_len) - ND_PRINT((ndo, " (%"PRIu64" captured)", remaining_len)); + ND_PRINT(" (%"PRIu64" captured)", remaining_len); if (ndo->ndo_vflag) { uint64_t len_printed = min(frame_offset, remaining_len); if (ndo->ndo_vflag == 1) len_printed = min(VBYTES, len_printed); if (len_printed > 1) { - ND_PRINT((ndo, ", first %"PRIu64" byte(s):", len_printed)); + ND_PRINT(", first %"PRIu64" byte(s):", len_printed); hex_and_ascii_print(ndo, "\n\t ", cp, len_printed); - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); } } } return cp + frame_offset; trunc: - ND_PRINT((ndo, "%s", tstr)); + ND_PRINT("%s", tstr); return cp + len; } @@ -317,7 +317,7 @@ pretty_print_packet(netdissect_options *ndo, const struct pcap_pkthdr *h, u_int hdrlen; if(ndo->ndo_packet_number) - ND_PRINT((ndo, "%5u ", packets_captured)); + ND_PRINT("%5u ", packets_captured); ts_print(ndo, &h->ts); @@ -394,7 +394,7 @@ pretty_print_packet(netdissect_options *ndo, const struct pcap_pkthdr *h, } } - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); } /* diff --git a/signature.c b/signature.c index 51651bf3..493905ad 100644 --- a/signature.c +++ b/signature.c @@ -190,7 +190,7 @@ signature_verify(netdissect_options *ndo, const u_char *pptr, u_int plen, } else { /* No - print the computed signature. */ for (i = 0; i < sizeof(sig); ++i) { - ND_PRINT((ndo, "%02x", sig[i])); + ND_PRINT("%02x", sig[i]); } return (SIGNATURE_INVALID); @@ -281,45 +281,45 @@ smb_print_data(netdissect_options *ndo, const u_char *buf, u_int len) if (len == 0) return; - ND_PRINT((ndo, "[%03X] ", i)); + ND_PRINT("[%03X] ", i); for (i = 0; i < len; /*nothing*/) { ND_TCHECK_1(buf + i); - ND_PRINT((ndo, "%02X ", EXTRACT_U_1(buf + i) & 0xff)); + ND_PRINT("%02X ", EXTRACT_U_1(buf + i) & 0xff); i++; if (i%8 == 0) - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (i % 16 == 0) { print_asc(ndo, buf + i - 16, 8); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); print_asc(ndo, buf + i - 8, 8); - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); if (i < len) - ND_PRINT((ndo, "[%03X] ", i)); + ND_PRINT("[%03X] ", i); } } if (i % 16) { int n; n = 16 - (i % 16); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); if (n>8) - ND_PRINT((ndo, " ")); + ND_PRINT(" "); while (n--) - ND_PRINT((ndo, " ")); + ND_PRINT(" "); n = min(8, i % 16); print_asc(ndo, buf + i - (i % 16), n); - ND_PRINT((ndo, " ")); + ND_PRINT(" "); n = (i % 16) - n; if (n > 0) print_asc(ndo, buf + i - n, n); - ND_PRINT((ndo, "\n")); + ND_PRINT("\n"); } return; trunc: - ND_PRINT((ndo, "\n")); - ND_PRINT((ndo, "WARNING: Short packet. Try increasing the snap length\n")); + ND_PRINT("\n"); + ND_PRINT("WARNING: Short packet. Try increasing the snap length\n"); } @@ -333,7 +333,7 @@ write_bits(netdissect_options *ndo, while ((p = strchr(fmt, '|'))) { size_t l = PTR_DIFF(p, fmt); if (l && (val & (1 << i))) - ND_PRINT((ndo, "%.*s ", (int)l, fmt)); + ND_PRINT("%.*s ", (int)l, fmt); fmt = p + 1; i++; } @@ -498,7 +498,7 @@ smb_fdata1(netdissect_options *ndo, unsigned int x; ND_TCHECK_1(buf); x = EXTRACT_U_1(buf); - ND_PRINT((ndo, "%u (0x%x)", x, x)); + ND_PRINT("%u (0x%x)", x, x); buf += 1; fmt++; break; @@ -509,7 +509,7 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_2(buf); x = reverse ? EXTRACT_BE_S_2(buf) : EXTRACT_LE_S_2(buf); - ND_PRINT((ndo, "%d (0x%x)", x, x)); + ND_PRINT("%d (0x%x)", x, x); buf += 2; fmt++; break; @@ -520,7 +520,7 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_4(buf); x = reverse ? EXTRACT_BE_S_4(buf) : EXTRACT_LE_S_4(buf); - ND_PRINT((ndo, "%d (0x%x)", x, x)); + ND_PRINT("%d (0x%x)", x, x); buf += 4; fmt++; break; @@ -531,7 +531,7 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_8(buf); x = reverse ? EXTRACT_BE_U_8(buf) : EXTRACT_LE_U_8(buf); - ND_PRINT((ndo, "%" PRIu64 " (0x%" PRIx64 ")", x, x)); + ND_PRINT("%" PRIu64 " (0x%" PRIx64 ")", x, x); buf += 8; fmt++; break; @@ -542,7 +542,7 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_2(buf); x = reverse ? EXTRACT_BE_U_2(buf) : EXTRACT_LE_U_2(buf); - ND_PRINT((ndo, "%u (0x%x)", x, x)); + ND_PRINT("%u (0x%x)", x, x); buf += 2; fmt++; break; @@ -553,7 +553,7 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_4(buf); x = reverse ? EXTRACT_BE_U_4(buf) : EXTRACT_LE_U_4(buf); - ND_PRINT((ndo, "%u (0x%x)", x, x)); + ND_PRINT("%u (0x%x)", x, x); buf += 4; fmt++; break; @@ -569,7 +569,7 @@ smb_fdata1(netdissect_options *ndo, x2 = reverse ? EXTRACT_BE_U_4(buf + 4) : EXTRACT_LE_U_4(buf + 4); x = (((uint64_t)x1) << 32) | x2; - ND_PRINT((ndo, "%" PRIu64 " (0x%" PRIx64 ")", x, x)); + ND_PRINT("%" PRIu64 " (0x%" PRIx64 ")", x, x); buf += 8; fmt++; break; @@ -579,7 +579,7 @@ smb_fdata1(netdissect_options *ndo, unsigned int x; ND_TCHECK_1(buf); x = EXTRACT_U_1(buf); - ND_PRINT((ndo, "0x%X", x)); + ND_PRINT("0x%X", x); buf += 1; fmt++; break; @@ -590,7 +590,7 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_2(buf); x = reverse ? EXTRACT_BE_U_2(buf) : EXTRACT_LE_U_2(buf); - ND_PRINT((ndo, "0x%X", x)); + ND_PRINT("0x%X", x); buf += 2; fmt++; break; @@ -601,7 +601,7 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_4(buf); x = reverse ? EXTRACT_BE_U_4(buf) : EXTRACT_LE_U_4(buf); - ND_PRINT((ndo, "0x%X", x)); + ND_PRINT("0x%X", x); buf += 4; fmt++; break; @@ -614,7 +614,7 @@ smb_fdata1(netdissect_options *ndo, case 'b': ND_TCHECK_1(buf); stringlen = EXTRACT_U_1(buf); - ND_PRINT((ndo, "%u", stringlen)); + ND_PRINT("%u", stringlen); buf += 1; break; @@ -623,7 +623,7 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_2(buf); stringlen = reverse ? EXTRACT_BE_U_2(buf) : EXTRACT_LE_U_2(buf); - ND_PRINT((ndo, "%u", stringlen)); + ND_PRINT("%u", stringlen); buf += 2; break; @@ -632,7 +632,7 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_4(buf); stringlen = reverse ? EXTRACT_BE_U_4(buf) : EXTRACT_LE_U_4(buf); - ND_PRINT((ndo, "%u", stringlen)); + ND_PRINT("%u", stringlen); buf += 4; break; } @@ -650,7 +650,7 @@ smb_fdata1(netdissect_options *ndo, s = unistr(ndo, buf, &len, (*fmt == 'R') ? 0 : unicodestr); if (s == NULL) goto trunc; - ND_PRINT((ndo, "%s", s)); + ND_PRINT("%s", s); buf += len; fmt++; break; @@ -663,14 +663,14 @@ smb_fdata1(netdissect_options *ndo, ND_TCHECK_1(buf); if (EXTRACT_U_1(buf) != 4 && EXTRACT_U_1(buf) != 2) { - ND_PRINT((ndo, "Error! ASCIIZ buffer of type %u", EXTRACT_U_1(buf))); + ND_PRINT("Error! ASCIIZ buffer of type %u", EXTRACT_U_1(buf)); return maxbuf; /* give up */ } len = 0; s = unistr(ndo, buf + 1, &len, (*fmt == 'Y') ? 0 : unicodestr); if (s == NULL) goto trunc; - ND_PRINT((ndo, "%s", s)); + ND_PRINT("%s", s); buf += len + 1; fmt++; break; @@ -679,7 +679,7 @@ smb_fdata1(netdissect_options *ndo, { int l = atoi(fmt + 1); ND_TCHECK_LEN(buf, l); - ND_PRINT((ndo, "%-*.*s", l, l, buf)); + ND_PRINT("%-*.*s", l, l, buf); buf += l; fmt++; while (isdigit((unsigned char)*fmt)) @@ -689,7 +689,7 @@ smb_fdata1(netdissect_options *ndo, case 'c': { ND_TCHECK_LEN(buf, stringlen); - ND_PRINT((ndo, "%-*.*s", (int)stringlen, (int)stringlen, buf)); + ND_PRINT("%-*.*s", (int)stringlen, (int)stringlen, buf); buf += stringlen; fmt++; while (isdigit((unsigned char)*fmt)) @@ -702,7 +702,7 @@ smb_fdata1(netdissect_options *ndo, s = unistr(ndo, buf, &stringlen, unicodestr); if (s == NULL) goto trunc; - ND_PRINT((ndo, "%s", s)); + ND_PRINT("%s", s); buf += stringlen; fmt++; break; @@ -712,7 +712,7 @@ smb_fdata1(netdissect_options *ndo, int l = atoi(fmt + 1); ND_TCHECK_LEN(buf, l); while (l--) { - ND_PRINT((ndo, "%02x", EXTRACT_U_1(buf))); + ND_PRINT("%02x", EXTRACT_U_1(buf)); buf++; } fmt++; @@ -737,14 +737,14 @@ smb_fdata1(netdissect_options *ndo, if (len < 0) goto trunc; buf += len; - ND_PRINT((ndo, "%-15.15s NameType=0x%02X (%s)", nbuf, name_type, - name_type_str(name_type))); + ND_PRINT("%-15.15s NameType=0x%02X (%s)", nbuf, name_type, + name_type_str(name_type)); break; case 2: ND_TCHECK_1(buf + 15); name_type = EXTRACT_U_1(buf + 15); - ND_PRINT((ndo, "%-15.15s NameType=0x%02X (%s)", buf, name_type, - name_type_str(name_type))); + ND_PRINT("%-15.15s NameType=0x%02X (%s)", buf, name_type, + name_type_str(name_type)); buf += 16; break; } @@ -796,27 +796,27 @@ smb_fdata1(netdissect_options *ndo, tstring = "(Can't convert time)\n"; } else tstring = "NULL\n"; - ND_PRINT((ndo, "%s", tstring)); + ND_PRINT("%s", tstring); fmt++; while (isdigit((unsigned char)*fmt)) fmt++; break; } default: - ND_PRINT((ndo, "%c", *fmt)); + ND_PRINT("%c", *fmt); fmt++; break; } } if (buf >= maxbuf && *fmt) - ND_PRINT((ndo, "END OF BUFFER\n")); + ND_PRINT("END OF BUFFER\n"); return(buf); trunc: - ND_PRINT((ndo, "\n")); - ND_PRINT((ndo, "WARNING: Short packet. Try increasing the snap length\n")); + ND_PRINT("\n"); + ND_PRINT("WARNING: Short packet. Try increasing the snap length\n"); return(NULL); } @@ -881,14 +881,14 @@ smb_fdata(netdissect_options *ndo, break; default: - ND_PRINT((ndo, "%c", *fmt)); + ND_PRINT("%c", *fmt); fmt++; break; } } if (!depth && buf < maxbuf) { size_t len = PTR_DIFF(maxbuf, buf); - ND_PRINT((ndo, "Data: (%lu bytes)\n", (unsigned long)len)); + ND_PRINT("Data: (%lu bytes)\n", (unsigned long)len); smb_print_data(ndo, buf, len); return(buf + len); } diff --git a/util-print.c b/util-print.c index 58efc4b4..75165e51 100644 --- a/util-print.c +++ b/util-print.c @@ -77,13 +77,13 @@ fn_print_char(netdissect_options *ndo, u_char c) { if (!ND_ISASCII(c)) { c = ND_TOASCII(c); - ND_PRINT((ndo, "M-")); + ND_PRINT("M-"); } if (!ND_ISPRINT(c)) { c ^= 0x40; /* DEL to ?, others to alpha */ - ND_PRINT((ndo, "^")); + ND_PRINT("^"); } - ND_PRINT((ndo, "%c", c)); + ND_PRINT("%c", c); } /* @@ -108,13 +108,13 @@ fn_print(netdissect_options *ndo, } if (!ND_ISASCII(c)) { c = ND_TOASCII(c); - ND_PRINT((ndo, "M-")); + ND_PRINT("M-"); } if (!ND_ISPRINT(c)) { c ^= 0x40; /* DEL to ?, others to alpha */ - ND_PRINT((ndo, "^")); + ND_PRINT("^"); } - ND_PRINT((ndo, "%c", c)); + ND_PRINT("%c", c); } return(ret); } @@ -158,13 +158,13 @@ fn_printztn(netdissect_options *ndo, } if (!ND_ISASCII(c)) { c = ND_TOASCII(c); - ND_PRINT((ndo, "M-")); + ND_PRINT("M-"); } if (!ND_ISPRINT(c)) { c ^= 0x40; /* DEL to ?, others to alpha */ - ND_PRINT((ndo, "^")); + ND_PRINT("^"); } - ND_PRINT((ndo, "%c", c)); + ND_PRINT("%c", c); } return(bytes); } @@ -186,13 +186,13 @@ fn_printn(netdissect_options *ndo, c = *s++; if (!ND_ISASCII(c)) { c = ND_TOASCII(c); - ND_PRINT((ndo, "M-")); + ND_PRINT("M-"); } if (!ND_ISPRINT(c)) { c ^= 0x40; /* DEL to ?, others to alpha */ - ND_PRINT((ndo, "^")); + ND_PRINT("^"); } - ND_PRINT((ndo, "%c", c)); + ND_PRINT("%c", c); } return (n == 0) ? 0 : 1; } @@ -222,13 +222,13 @@ fn_printzp(netdissect_options *ndo, } if (!ND_ISASCII(c)) { c = ND_TOASCII(c); - ND_PRINT((ndo, "M-")); + ND_PRINT("M-"); } if (!ND_ISPRINT(c)) { c ^= 0x40; /* DEL to ?, others to alpha */ - ND_PRINT((ndo, "^")); + ND_PRINT("^"); } - ND_PRINT((ndo, "%c", c)); + ND_PRINT("%c", c); } return (n == 0) ? 0 : ret; } @@ -327,15 +327,15 @@ ts_print(netdissect_options *ndo, case 0: /* Default */ s = (tvp->tv_sec + thiszone) % 86400; - ND_PRINT((ndo, "%s ", ts_format(ndo, s, tvp->tv_usec, buf))); + ND_PRINT("%s ", ts_format(ndo, s, tvp->tv_usec, buf)); break; case 1: /* No time stamp */ break; case 2: /* Unix timeval style */ - ND_PRINT((ndo, "%s ", ts_unix_format(ndo, - tvp->tv_sec, tvp->tv_usec, buf))); + ND_PRINT("%s ", ts_unix_format(ndo, + tvp->tv_sec, tvp->tv_usec, buf)); break; case 3: /* Microseconds/nanoseconds since previous packet */ @@ -364,10 +364,10 @@ ts_print(netdissect_options *ndo, else netdissect_timevalsub(tvp, &tv_ref, &tv_result, nano_prec); - ND_PRINT((ndo, (negative_offset ? "-" : " "))); + ND_PRINT((negative_offset ? "-" : " ")); - ND_PRINT((ndo, "%s ", ts_format(ndo, - tv_result.tv_sec, tv_result.tv_usec, buf))); + ND_PRINT("%s ", ts_format(ndo, + tv_result.tv_sec, tv_result.tv_usec, buf)); if (ndo->ndo_tflag == 3) tv_ref = *tvp; /* set timestamp for previous packet */ @@ -378,11 +378,11 @@ ts_print(netdissect_options *ndo, Time = (tvp->tv_sec + thiszone) - s; tm = gmtime (&Time); if (!tm) - ND_PRINT((ndo, "Date fail ")); + ND_PRINT("Date fail "); else - ND_PRINT((ndo, "%04d-%02d-%02d %s ", + ND_PRINT("%04d-%02d-%02d %s ", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, - ts_format(ndo, s, tvp->tv_usec, buf))); + ts_format(ndo, s, tvp->tv_usec, buf)); break; } } @@ -402,12 +402,12 @@ unsigned_relts_print(netdissect_options *ndo, const u_int *s = seconds; if (secs == 0) { - ND_PRINT((ndo, "0s")); + ND_PRINT("0s"); return; } while (secs > 0) { if (secs >= *s) { - ND_PRINT((ndo, "%d%s", secs / *s, *l)); + ND_PRINT("%d%s", secs / *s, *l); secs -= (secs / *s) * *s; } s++; @@ -425,7 +425,7 @@ signed_relts_print(netdissect_options *ndo, int32_t secs) { if (secs < 0) { - ND_PRINT((ndo, "-")); + ND_PRINT("-"); if (secs == INT32_MIN) { /* * -2^31; you can't fit its absolute value into @@ -461,15 +461,15 @@ int print_unknown_data(netdissect_options *ndo, const u_char *cp,const char *ident,int len) { if (len < 0) { - ND_PRINT((ndo,"%sDissector error: print_unknown_data called with negative length", - ident)); + ND_PRINT("%sDissector error: print_unknown_data called with negative length", + ident); return(0); } if (ndo->ndo_snapend - cp < len) len = ndo->ndo_snapend - cp; if (len < 0) { - ND_PRINT((ndo,"%sDissector error: print_unknown_data called with pointer past end of packet", - ident)); + ND_PRINT("%sDissector error: print_unknown_data called with pointer past end of packet", + ident); return(0); } hex_print(ndo, ident,cp,len); @@ -812,12 +812,12 @@ print_txt_line(netdissect_options *ndo, const char *protoname, */ trunc: linelen = idx - startidx; - ND_PRINT((ndo, "%s%.*s[!%s]", prefix, (int)linelen, pptr + startidx, - protoname)); + ND_PRINT("%s%.*s[!%s]", prefix, (int)linelen, pptr + startidx, + protoname); return (0); print: - ND_PRINT((ndo, "%s%.*s", prefix, (int)linelen, pptr + startidx)); + ND_PRINT("%s%.*s", prefix, (int)linelen, pptr + startidx); return (idx); } @@ -896,7 +896,7 @@ txtproto_print(netdissect_options *ndo, const u_char *pptr, u_int len, /* Capitalize the protocol name */ for (pnp = protoname; *pnp != '\0'; pnp++) - ND_PRINT((ndo, "%c", toupper((u_char)*pnp))); + ND_PRINT("%c", toupper((u_char)*pnp)); if (print_this) { /* @@ -913,7 +913,7 @@ txtproto_print(netdissect_options *ndo, const u_char *pptr, u_int len, * request or response; just print the length * on the first line of the output. */ - ND_PRINT((ndo, ", length: %u", len)); + ND_PRINT(", length: %u", len); for (idx = 0; idx < len && (eol = print_txt_line(ndo, protoname, "\n\t", pptr, idx, len)) != 0; idx = eol) @@ -944,7 +944,7 @@ void safeputchar(netdissect_options *ndo, const u_char c) { - ND_PRINT((ndo, (c < 0x80 && ND_ISPRINT(c)) ? "%c" : "\\0x%02x", c)); + ND_PRINT((c < 0x80 && ND_ISPRINT(c)) ? "%c" : "\\0x%02x", c); } #if (defined(__i386__) || defined(_M_IX86) || defined(__X86__) || defined(__x86_64__) || defined(_M_X64)) || \ |