2 * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 * Format and print bootp packets.
26 #define NETDISSECT_REWORKED
31 #include <tcpdump-stdinc.h>
35 #include "interface.h"
36 #include "addrtoname.h"
40 static const char tstr[] = " [|bootp]";
42 static void rfc1048_print(netdissect_options *, const u_char *);
43 static void cmu_print(netdissect_options *, const u_char *);
44 static char *client_fqdn_flags(u_int flags);
46 static const struct tok bootp_flag_values[] = {
47 { 0x8000, "Broadcast" },
51 static const struct tok bootp_op_values[] = {
52 { BOOTPREQUEST, "Request" },
53 { BOOTPREPLY, "Reply" },
58 * Print bootp requests
61 bootp_print(netdissect_options *ndo,
62 register const u_char *cp, u_int length)
64 register const struct bootp *bp;
65 static const u_char vm_cmu[4] = VM_CMU;
66 static const u_char vm_rfc1048[4] = VM_RFC1048;
68 bp = (const struct bootp *)cp;
71 ND_PRINT((ndo, "BOOTP/DHCP, %s",
72 tok2str(bootp_op_values, "unknown (0x%02x)", bp->bp_op)));
74 if (bp->bp_htype == 1 && bp->bp_hlen == 6 && bp->bp_op == BOOTPREQUEST) {
75 ND_TCHECK2(bp->bp_chaddr[0], 6);
76 ND_PRINT((ndo, " from %s", etheraddr_string(ndo, bp->bp_chaddr)));
79 ND_PRINT((ndo, ", length %u", length));
84 ND_TCHECK(bp->bp_secs);
86 /* The usual hardware address type is 1 (10Mb Ethernet) */
87 if (bp->bp_htype != 1)
88 ND_PRINT((ndo, ", htype %d", bp->bp_htype));
90 /* The usual length for 10Mb Ethernet address is 6 bytes */
91 if (bp->bp_htype != 1 || bp->bp_hlen != 6)
92 ND_PRINT((ndo, ", hlen %d", bp->bp_hlen));
94 /* Only print interesting fields */
96 ND_PRINT((ndo, ", hops %d", bp->bp_hops));
97 if (EXTRACT_32BITS(&bp->bp_xid))
98 ND_PRINT((ndo, ", xid 0x%x", EXTRACT_32BITS(&bp->bp_xid)));
99 if (EXTRACT_16BITS(&bp->bp_secs))
100 ND_PRINT((ndo, ", secs %d", EXTRACT_16BITS(&bp->bp_secs)));
102 ND_PRINT((ndo, ", Flags [%s]",
103 bittok2str(bootp_flag_values, "none", EXTRACT_16BITS(&bp->bp_flags))));
104 if (ndo->ndo_vflag > 1)
105 ND_PRINT((ndo, " (0x%04x)", EXTRACT_16BITS(&bp->bp_flags)));
107 /* Client's ip address */
108 ND_TCHECK(bp->bp_ciaddr);
109 if (EXTRACT_32BITS(&bp->bp_ciaddr.s_addr))
110 ND_PRINT((ndo, "\n\t Client-IP %s", ipaddr_string(ndo, &bp->bp_ciaddr)));
112 /* 'your' ip address (bootp client) */
113 ND_TCHECK(bp->bp_yiaddr);
114 if (EXTRACT_32BITS(&bp->bp_yiaddr.s_addr))
115 ND_PRINT((ndo, "\n\t Your-IP %s", ipaddr_string(ndo, &bp->bp_yiaddr)));
117 /* Server's ip address */
118 ND_TCHECK(bp->bp_siaddr);
119 if (EXTRACT_32BITS(&bp->bp_siaddr.s_addr))
120 ND_PRINT((ndo, "\n\t Server-IP %s", ipaddr_string(ndo, &bp->bp_siaddr)));
122 /* Gateway's ip address */
123 ND_TCHECK(bp->bp_giaddr);
124 if (EXTRACT_32BITS(&bp->bp_giaddr.s_addr))
125 ND_PRINT((ndo, "\n\t Gateway-IP %s", ipaddr_string(ndo, &bp->bp_giaddr)));
127 /* Client's Ethernet address */
128 if (bp->bp_htype == 1 && bp->bp_hlen == 6) {
129 ND_TCHECK2(bp->bp_chaddr[0], 6);
130 ND_PRINT((ndo, "\n\t Client-Ethernet-Address %s", etheraddr_string(ndo, bp->bp_chaddr)));
133 ND_TCHECK2(bp->bp_sname[0], 1); /* check first char only */
135 ND_PRINT((ndo, "\n\t sname \""));
136 if (fn_print(ndo, bp->bp_sname, ndo->ndo_snapend)) {
137 ND_PRINT((ndo, "\""));
138 ND_PRINT((ndo, "%s", tstr + 1));
141 ND_PRINT((ndo, "\""));
143 ND_TCHECK2(bp->bp_file[0], 1); /* check first char only */
145 ND_PRINT((ndo, "\n\t file \""));
146 if (fn_print(ndo, bp->bp_file, ndo->ndo_snapend)) {
147 ND_PRINT((ndo, "\""));
148 ND_PRINT((ndo, "%s", tstr + 1));
151 ND_PRINT((ndo, "\""));
154 /* Decode the vendor buffer */
155 ND_TCHECK(bp->bp_vend[0]);
156 if (memcmp((const char *)bp->bp_vend, vm_rfc1048,
157 sizeof(uint32_t)) == 0)
158 rfc1048_print(ndo, bp->bp_vend);
159 else if (memcmp((const char *)bp->bp_vend, vm_cmu,
160 sizeof(uint32_t)) == 0)
161 cmu_print(ndo, bp->bp_vend);
165 ul = EXTRACT_32BITS(&bp->bp_vend);
167 ND_PRINT((ndo, "\n\t Vendor-#0x%x", ul));
172 ND_PRINT((ndo, "%s", tstr));
176 * The first character specifies the format to print:
177 * i - ip address (32 bits)
178 * p - ip address pairs (32 bits + 32 bits)
180 * L - unsigned long (32 bits)
181 * s - short (16 bits)
182 * b - period-seperated decimal bytes (variable length)
183 * x - colon-seperated hex bytes (variable length)
184 * a - ascii string (variable length)
185 * B - on/off (8 bits)
186 * $ - special (explicit code to handle)
188 static const struct tok tag2str[] = {
191 { TAG_SUBNET_MASK, "iSubnet-Mask" }, /* subnet mask (RFC950) */
192 { TAG_TIME_OFFSET, "LTime-Zone" }, /* seconds from UTC */
193 { TAG_GATEWAY, "iDefault-Gateway" }, /* default gateway */
194 { TAG_TIME_SERVER, "iTime-Server" }, /* time servers (RFC868) */
195 { TAG_NAME_SERVER, "iIEN-Name-Server" }, /* IEN name servers (IEN116) */
196 { TAG_DOMAIN_SERVER, "iDomain-Name-Server" }, /* domain name (RFC1035) */
197 { TAG_LOG_SERVER, "iLOG" }, /* MIT log servers */
198 { TAG_COOKIE_SERVER, "iCS" }, /* cookie servers (RFC865) */
199 { TAG_LPR_SERVER, "iLPR-Server" }, /* lpr server (RFC1179) */
200 { TAG_IMPRESS_SERVER, "iIM" }, /* impress servers (Imagen) */
201 { TAG_RLP_SERVER, "iRL" }, /* resource location (RFC887) */
202 { TAG_HOSTNAME, "aHostname" }, /* ascii hostname */
203 { TAG_BOOTSIZE, "sBS" }, /* 512 byte blocks */
206 { TAG_DUMPPATH, "aDP" },
207 { TAG_DOMAINNAME, "aDomain-Name" },
208 { TAG_SWAP_SERVER, "iSS" },
209 { TAG_ROOTPATH, "aRP" },
210 { TAG_EXTPATH, "aEP" },
212 { TAG_IP_FORWARD, "BIPF" },
213 { TAG_NL_SRCRT, "BSRT" },
214 { TAG_PFILTERS, "pPF" },
215 { TAG_REASS_SIZE, "sRSZ" },
216 { TAG_DEF_TTL, "bTTL" },
217 { TAG_MTU_TIMEOUT, "lMTU-Timeout" },
218 { TAG_MTU_TABLE, "sMTU-Table" },
219 { TAG_INT_MTU, "sMTU" },
220 { TAG_LOCAL_SUBNETS, "BLSN" },
221 { TAG_BROAD_ADDR, "iBR" },
222 { TAG_DO_MASK_DISC, "BMD" },
223 { TAG_SUPPLY_MASK, "BMS" },
224 { TAG_DO_RDISC, "BRouter-Discovery" },
225 { TAG_RTR_SOL_ADDR, "iRSA" },
226 { TAG_STATIC_ROUTE, "pStatic-Route" },
227 { TAG_USE_TRAILERS, "BUT" },
228 { TAG_ARP_TIMEOUT, "lAT" },
229 { TAG_ETH_ENCAP, "BIE" },
230 { TAG_TCP_TTL, "bTT" },
231 { TAG_TCP_KEEPALIVE, "lKI" },
232 { TAG_KEEPALIVE_GO, "BKG" },
233 { TAG_NIS_DOMAIN, "aYD" },
234 { TAG_NIS_SERVERS, "iYS" },
235 { TAG_NTP_SERVERS, "iNTP" },
236 { TAG_VENDOR_OPTS, "bVendor-Option" },
237 { TAG_NETBIOS_NS, "iNetbios-Name-Server" },
238 { TAG_NETBIOS_DDS, "iWDD" },
239 { TAG_NETBIOS_NODE, "$Netbios-Node" },
240 { TAG_NETBIOS_SCOPE, "aNetbios-Scope" },
241 { TAG_XWIN_FS, "iXFS" },
242 { TAG_XWIN_DM, "iXDM" },
243 { TAG_NIS_P_DOMAIN, "sN+D" },
244 { TAG_NIS_P_SERVERS, "iN+S" },
245 { TAG_MOBILE_HOME, "iMH" },
246 { TAG_SMPT_SERVER, "iSMTP" },
247 { TAG_POP3_SERVER, "iPOP3" },
248 { TAG_NNTP_SERVER, "iNNTP" },
249 { TAG_WWW_SERVER, "iWWW" },
250 { TAG_FINGER_SERVER, "iFG" },
251 { TAG_IRC_SERVER, "iIRC" },
252 { TAG_STREETTALK_SRVR, "iSTS" },
253 { TAG_STREETTALK_STDA, "iSTDA" },
254 { TAG_REQUESTED_IP, "iRequested-IP" },
255 { TAG_IP_LEASE, "lLease-Time" },
256 { TAG_OPT_OVERLOAD, "$OO" },
257 { TAG_TFTP_SERVER, "aTFTP" },
258 { TAG_BOOTFILENAME, "aBF" },
259 { TAG_DHCP_MESSAGE, " DHCP-Message" },
260 { TAG_SERVER_ID, "iServer-ID" },
261 { TAG_PARM_REQUEST, "bParameter-Request" },
262 { TAG_MESSAGE, "aMSG" },
263 { TAG_MAX_MSG_SIZE, "sMSZ" },
264 { TAG_RENEWAL_TIME, "lRN" },
265 { TAG_REBIND_TIME, "lRB" },
266 { TAG_VENDOR_CLASS, "aVendor-Class" },
267 { TAG_CLIENT_ID, "$Client-ID" },
269 { TAG_OPEN_GROUP_UAP, "aUAP" },
271 { TAG_DISABLE_AUTOCONF, "BNOAUTO" },
273 { TAG_SLP_DA, "bSLP-DA" }, /*"b" is a little wrong */
274 { TAG_SLP_SCOPE, "bSLP-SCOPE" }, /*"b" is a little wrong */
276 { TAG_NS_SEARCH, "sNSSEARCH" }, /* XXX 's' */
278 { TAG_IP4_SUBNET_SELECT, "iSUBNET" },
280 { TAG_CLASSLESS_STATIC_RT, "$Classless-Static-Route" },
281 { TAG_CLASSLESS_STA_RT_MS, "$Classless-Static-Route-Microsoft" },
282 /* http://www.iana.org/assignments/bootp-dhcp-extensions/index.htm */
283 { TAG_USER_CLASS, "aCLASS" },
284 { TAG_SLP_NAMING_AUTH, "aSLP-NA" },
285 { TAG_CLIENT_FQDN, "$FQDN" },
286 { TAG_AGENT_CIRCUIT, "$Agent-Information" },
287 { TAG_AGENT_REMOTE, "bARMT" },
288 { TAG_AGENT_MASK, "bAMSK" },
289 { TAG_TZ_STRING, "aTZSTR" },
290 { TAG_FQDN_OPTION, "bFQDNS" }, /* XXX 'b' */
291 { TAG_AUTH, "bAUTH" }, /* XXX 'b' */
292 { TAG_VINES_SERVERS, "iVINES" },
293 { TAG_SERVER_RANK, "sRANK" },
294 { TAG_CLIENT_ARCH, "sARCH" },
295 { TAG_CLIENT_NDI, "bNDI" }, /* XXX 'b' */
296 { TAG_CLIENT_GUID, "bGUID" }, /* XXX 'b' */
297 { TAG_LDAP_URL, "aLDAP" },
298 { TAG_6OVER4, "i6o4" },
299 { TAG_PRINTER_NAME, "aPRTR" },
300 { TAG_MDHCP_SERVER, "bMDHCP" }, /* XXX 'b' */
301 { TAG_IPX_COMPAT, "bIPX" }, /* XXX 'b' */
302 { TAG_NETINFO_PARENT, "iNI" },
303 { TAG_NETINFO_PARENT_TAG, "aNITAG" },
305 { TAG_FAILOVER, "bFAIL" }, /* XXX 'b' */
308 /* 2-byte extended tags */
309 static const struct tok xtag2str[] = {
313 /* DHCP "options overload" types */
314 static const struct tok oo2str[] = {
321 /* NETBIOS over TCP/IP node type options */
322 static const struct tok nbo2str[] = {
330 /* ARP Hardware types, for Client-ID option */
331 static const struct tok arp2str[] = {
337 { 0x18, "ieee1394" },
341 static const struct tok dhcp_msg_values[] = {
342 { DHCPDISCOVER, "Discover" },
343 { DHCPOFFER, "Offer" },
344 { DHCPREQUEST, "Request" },
345 { DHCPDECLINE, "Decline" },
348 { DHCPRELEASE, "Release" },
349 { DHCPINFORM, "Inform" },
353 #define AGENT_SUBOPTION_CIRCUIT_ID 1 /* RFC 3046 */
354 #define AGENT_SUBOPTION_REMOTE_ID 2 /* RFC 3046 */
355 #define AGENT_SUBOPTION_SUBSCRIBER_ID 6 /* RFC 3993 */
356 static const struct tok agent_suboption_values[] = {
357 { AGENT_SUBOPTION_CIRCUIT_ID, "Circuit-ID" },
358 { AGENT_SUBOPTION_REMOTE_ID, "Remote-ID" },
359 { AGENT_SUBOPTION_SUBSCRIBER_ID, "Subscriber-ID" },
365 rfc1048_print(netdissect_options *ndo,
366 register const u_char *bp)
368 register uint16_t tag;
370 register const char *cp;
375 uint8_t uc, subopt, suboptlen;
377 ND_PRINT((ndo, "\n\t Vendor-rfc1048 Extensions"));
379 /* Step over magic cookie */
380 ND_PRINT((ndo, "\n\t Magic Cookie 0x%08x", EXTRACT_32BITS(bp)));
381 bp += sizeof(int32_t);
383 /* Loop while we there is a tag left in the buffer */
384 while (ND_TTEST2(*bp, 1)) {
386 if (tag == TAG_PAD && ndo->ndo_vflag < 3)
388 if (tag == TAG_END && ndo->ndo_vflag < 3)
390 if (tag == TAG_EXTENDED_OPTION) {
391 ND_TCHECK2(*(bp + 1), 2);
392 tag = EXTRACT_16BITS(bp + 1);
393 /* XXX we don't know yet if the IANA will
394 * preclude overlap of 1-byte and 2-byte spaces.
395 * If not, we need to offset tag after this step.
397 cp = tok2str(xtag2str, "?xT%u", tag);
399 cp = tok2str(tag2str, "?T%u", tag);
402 if (tag == TAG_PAD || tag == TAG_END)
405 /* Get the length; check for truncation */
410 ND_PRINT((ndo, "\n\t %s Option %u, length %u%s", cp, tag, len,
411 len > 0 ? ": " : ""));
413 if (tag == TAG_PAD && ndo->ndo_vflag > 2) {
415 while (ND_TTEST2(*bp, 1) && *bp == TAG_PAD) {
420 ND_PRINT((ndo, ", occurs %u", ntag));
423 if (!ND_TTEST2(*bp, len)) {
424 ND_PRINT((ndo, "[|rfc1048 %u]", len));
428 if (tag == TAG_DHCP_MESSAGE && len == 1) {
430 ND_PRINT((ndo, "%s", tok2str(dhcp_msg_values, "Unknown (%u)", uc)));
434 if (tag == TAG_PARM_REQUEST) {
438 cp = tok2str(tag2str, "?Option %u", uc);
440 ND_PRINT((ndo, "\n\t "));
442 ND_PRINT((ndo, ", "));
443 ND_PRINT((ndo, "%s", cp + 1));
449 if (tag == TAG_EXTENDED_REQUEST) {
453 us = EXTRACT_16BITS(bp);
455 cp = tok2str(xtag2str, "?xT%u", us);
457 ND_PRINT((ndo, "+"));
458 ND_PRINT((ndo, "%s", cp + 1));
466 /* Base default formats for unknown tags on data size */
479 ND_PRINT((ndo, "\""));
480 if (fn_printn(ndo, bp, len, ndo->ndo_snapend)) {
481 ND_PRINT((ndo, "\""));
484 ND_PRINT((ndo, "\""));
492 /* ip addresses/32-bit words */
493 while (len >= sizeof(ul)) {
495 ND_PRINT((ndo, ","));
496 ul = EXTRACT_32BITS(bp);
499 ND_PRINT((ndo, "%s", ipaddr_string(ndo, &ul)));
501 ND_PRINT((ndo, "%d", ul));
503 ND_PRINT((ndo, "%u", ul));
511 /* IP address pairs */
512 while (len >= 2*sizeof(ul)) {
514 ND_PRINT((ndo, ","));
515 memcpy((char *)&ul, (const char *)bp, sizeof(ul));
516 ND_PRINT((ndo, "(%s:", ipaddr_string(ndo, &ul)));
518 memcpy((char *)&ul, (const char *)bp, sizeof(ul));
519 ND_PRINT((ndo, "%s)", ipaddr_string(ndo, &ul)));
528 while (len >= sizeof(us)) {
530 ND_PRINT((ndo, ","));
531 us = EXTRACT_16BITS(bp);
532 ND_PRINT((ndo, "%u", us));
543 ND_PRINT((ndo, ","));
546 ND_PRINT((ndo, "N"));
549 ND_PRINT((ndo, "Y"));
552 ND_PRINT((ndo, "%u?", *bp));
567 ND_PRINT((ndo, c == 'x' ? ":" : "."));
569 ND_PRINT((ndo, "%02x", *bp));
571 ND_PRINT((ndo, "%u", *bp));
579 /* Guys we can't handle with one of the usual cases */
582 case TAG_NETBIOS_NODE:
583 /* this option should be at least 1 byte long */
585 ND_PRINT((ndo, "ERROR: option %u len %u < 1 bytes",
586 TAG_NETBIOS_NODE, len));
591 ND_PRINT((ndo, "%s", tok2str(nbo2str, NULL, tag)));
594 case TAG_OPT_OVERLOAD:
595 /* this option should be at least 1 byte long */
597 ND_PRINT((ndo, "ERROR: option %u len %u < 1 bytes",
598 TAG_OPT_OVERLOAD, len));
603 ND_PRINT((ndo, "%s", tok2str(oo2str, NULL, tag)));
606 case TAG_CLIENT_FQDN:
607 /* this option should be at least 3 bytes long */
609 ND_PRINT((ndo, "ERROR: option %u len %u < 3 bytes",
610 TAG_CLIENT_FQDN, len));
616 ND_PRINT((ndo, "[%s] ", client_fqdn_flags(*bp)));
619 ND_PRINT((ndo, "%u/%u ", *bp, *(bp+1)));
621 ND_PRINT((ndo, "\""));
622 if (fn_printn(ndo, bp, len - 3, ndo->ndo_snapend)) {
623 ND_PRINT((ndo, "\""));
626 ND_PRINT((ndo, "\""));
634 /* this option should be at least 1 byte long */
636 ND_PRINT((ndo, "ERROR: option %u len %u < 1 bytes",
637 TAG_CLIENT_ID, len));
643 ND_PRINT((ndo, "\""));
644 if (fn_printn(ndo, bp, len, ndo->ndo_snapend)) {
645 ND_PRINT((ndo, "\""));
648 ND_PRINT((ndo, "\""));
653 ND_PRINT((ndo, "%s ", tok2str(arp2str, "hardware-type %u,", type)));
656 ND_PRINT((ndo, ":"));
657 ND_PRINT((ndo, "%02x", *bp));
666 case TAG_AGENT_CIRCUIT:
671 if (suboptlen > len) {
672 ND_PRINT((ndo, "\n\t %s SubOption %u, length %u: length goes past end of option",
673 tok2str(agent_suboption_values, "Unknown", subopt),
680 ND_PRINT((ndo, "\n\t %s SubOption %u, length %u: ",
681 tok2str(agent_suboption_values, "Unknown", subopt),
686 case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */
687 case AGENT_SUBOPTION_REMOTE_ID:
688 case AGENT_SUBOPTION_SUBSCRIBER_ID:
689 fn_printn(ndo, bp, suboptlen, NULL);
693 print_unknown_data(ndo, bp, "\n\t\t", suboptlen);
701 case TAG_CLASSLESS_STATIC_RT:
702 case TAG_CLASSLESS_STA_RT_MS:
704 u_int mask_width, significant_octets, i;
706 /* this option should be at least 5 bytes long */
708 ND_PRINT((ndo, "ERROR: option %u len %u < 5 bytes",
709 TAG_CLASSLESS_STATIC_RT, len));
716 ND_PRINT((ndo, ","));
719 /* mask_width <= 32 */
720 if (mask_width > 32) {
721 ND_PRINT((ndo, "[ERROR: Mask width (%d) > 32]", mask_width));
726 significant_octets = (mask_width + 7) / 8;
727 /* significant octets + router(4) */
728 if (len < significant_octets + 4) {
729 ND_PRINT((ndo, "[ERROR: Remaining length (%u) < %u bytes]", len, significant_octets + 4));
734 ND_PRINT((ndo, "("));
736 ND_PRINT((ndo, "default"));
738 for (i = 0; i < significant_octets ; i++) {
740 ND_PRINT((ndo, "."));
741 ND_PRINT((ndo, "%d", *bp++));
743 for (i = significant_octets ; i < 4 ; i++)
744 ND_PRINT((ndo, ".0"));
745 ND_PRINT((ndo, "/%d", mask_width));
747 memcpy((char *)&ul, (const char *)bp, sizeof(ul));
748 ND_PRINT((ndo, ":%s)", ipaddr_string(ndo, &ul)));
750 len -= (significant_octets + 4);
757 ND_PRINT((ndo, "[unknown special tag %u, size %u]",
765 /* Data left over? */
767 ND_PRINT((ndo, "\n\t trailing data length %u", len));
773 ND_PRINT((ndo, "|[rfc1048]"));
777 cmu_print(netdissect_options *ndo,
778 register const u_char *bp)
780 register const struct cmu_vend *cmu;
782 #define PRINTCMUADDR(m, s) { ND_TCHECK(cmu->m); \
783 if (cmu->m.s_addr != 0) \
784 ND_PRINT((ndo, " %s:%s", s, ipaddr_string(ndo, &cmu->m.s_addr))); }
786 ND_PRINT((ndo, " vend-cmu"));
787 cmu = (const struct cmu_vend *)bp;
789 /* Only print if there are unknown bits */
790 ND_TCHECK(cmu->v_flags);
791 if ((cmu->v_flags & ~(VF_SMASK)) != 0)
792 ND_PRINT((ndo, " F:0x%x", cmu->v_flags));
793 PRINTCMUADDR(v_dgate, "DG");
794 PRINTCMUADDR(v_smask, cmu->v_flags & VF_SMASK ? "SM" : "SM*");
795 PRINTCMUADDR(v_dns1, "NS1");
796 PRINTCMUADDR(v_dns2, "NS2");
797 PRINTCMUADDR(v_ins1, "IEN1");
798 PRINTCMUADDR(v_ins2, "IEN2");
799 PRINTCMUADDR(v_ts1, "TS1");
800 PRINTCMUADDR(v_ts2, "TS2");
804 ND_PRINT((ndo, "%s", tstr));
809 client_fqdn_flags(u_int flags)
811 static char buf[8+1];
814 if (flags & CLIENT_FQDN_FLAGS_S)
816 if (flags & CLIENT_FQDN_FLAGS_O)
818 if (flags & CLIENT_FQDN_FLAGS_E)
820 if (flags & CLIENT_FQDN_FLAGS_N)