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.
24 #define NETDISSECT_REWORKED
29 #include <tcpdump-stdinc.h>
33 #include "interface.h"
34 #include "addrtoname.h"
38 static const char tstr
[] = " [|bootp]";
40 static void rfc1048_print(netdissect_options
*, const u_char
*);
41 static void cmu_print(netdissect_options
*, const u_char
*);
42 static char *client_fqdn_flags(u_int flags
);
44 static const struct tok bootp_flag_values
[] = {
45 { 0x8000, "Broadcast" },
49 static const struct tok bootp_op_values
[] = {
50 { BOOTPREQUEST
, "Request" },
51 { BOOTPREPLY
, "Reply" },
56 * Print bootp requests
59 bootp_print(netdissect_options
*ndo
,
60 register const u_char
*cp
, u_int length
)
62 register const struct bootp
*bp
;
63 static const u_char vm_cmu
[4] = VM_CMU
;
64 static const u_char vm_rfc1048
[4] = VM_RFC1048
;
66 bp
= (const struct bootp
*)cp
;
69 ND_PRINT((ndo
, "BOOTP/DHCP, %s",
70 tok2str(bootp_op_values
, "unknown (0x%02x)", bp
->bp_op
)));
72 if (bp
->bp_htype
== 1 && bp
->bp_hlen
== 6 && bp
->bp_op
== BOOTPREQUEST
) {
73 ND_TCHECK2(bp
->bp_chaddr
[0], 6);
74 ND_PRINT((ndo
, " from %s", etheraddr_string(bp
->bp_chaddr
)));
77 ND_PRINT((ndo
, ", length %u", length
));
82 ND_TCHECK(bp
->bp_secs
);
84 /* The usual hardware address type is 1 (10Mb Ethernet) */
85 if (bp
->bp_htype
!= 1)
86 ND_PRINT((ndo
, ", htype %d", bp
->bp_htype
));
88 /* The usual length for 10Mb Ethernet address is 6 bytes */
89 if (bp
->bp_htype
!= 1 || bp
->bp_hlen
!= 6)
90 ND_PRINT((ndo
, ", hlen %d", bp
->bp_hlen
));
92 /* Only print interesting fields */
94 ND_PRINT((ndo
, ", hops %d", bp
->bp_hops
));
95 if (EXTRACT_32BITS(&bp
->bp_xid
))
96 ND_PRINT((ndo
, ", xid 0x%x", EXTRACT_32BITS(&bp
->bp_xid
)));
97 if (EXTRACT_16BITS(&bp
->bp_secs
))
98 ND_PRINT((ndo
, ", secs %d", EXTRACT_16BITS(&bp
->bp_secs
)));
100 ND_PRINT((ndo
, ", Flags [%s]",
101 bittok2str(bootp_flag_values
, "none", EXTRACT_16BITS(&bp
->bp_flags
))));
102 if (ndo
->ndo_vflag
> 1)
103 ND_PRINT((ndo
, " (0x%04x)", EXTRACT_16BITS(&bp
->bp_flags
)));
105 /* Client's ip address */
106 ND_TCHECK(bp
->bp_ciaddr
);
107 if (EXTRACT_32BITS(&bp
->bp_ciaddr
.s_addr
))
108 ND_PRINT((ndo
, "\n\t Client-IP %s", ipaddr_string(&bp
->bp_ciaddr
)));
110 /* 'your' ip address (bootp client) */
111 ND_TCHECK(bp
->bp_yiaddr
);
112 if (EXTRACT_32BITS(&bp
->bp_yiaddr
.s_addr
))
113 ND_PRINT((ndo
, "\n\t Your-IP %s", ipaddr_string(&bp
->bp_yiaddr
)));
115 /* Server's ip address */
116 ND_TCHECK(bp
->bp_siaddr
);
117 if (EXTRACT_32BITS(&bp
->bp_siaddr
.s_addr
))
118 ND_PRINT((ndo
, "\n\t Server-IP %s", ipaddr_string(&bp
->bp_siaddr
)));
120 /* Gateway's ip address */
121 ND_TCHECK(bp
->bp_giaddr
);
122 if (EXTRACT_32BITS(&bp
->bp_giaddr
.s_addr
))
123 ND_PRINT((ndo
, "\n\t Gateway-IP %s", ipaddr_string(&bp
->bp_giaddr
)));
125 /* Client's Ethernet address */
126 if (bp
->bp_htype
== 1 && bp
->bp_hlen
== 6) {
127 ND_TCHECK2(bp
->bp_chaddr
[0], 6);
128 ND_PRINT((ndo
, "\n\t Client-Ethernet-Address %s", etheraddr_string(bp
->bp_chaddr
)));
131 ND_TCHECK2(bp
->bp_sname
[0], 1); /* check first char only */
133 ND_PRINT((ndo
, "\n\t sname \""));
134 if (fn_print(bp
->bp_sname
, ndo
->ndo_snapend
)) {
135 ND_PRINT((ndo
, "\""));
136 ND_PRINT((ndo
, "%s", tstr
+ 1));
139 ND_PRINT((ndo
, "\""));
141 ND_TCHECK2(bp
->bp_file
[0], 1); /* check first char only */
143 ND_PRINT((ndo
, "\n\t file \""));
144 if (fn_print(bp
->bp_file
, ndo
->ndo_snapend
)) {
145 ND_PRINT((ndo
, "\""));
146 ND_PRINT((ndo
, "%s", tstr
+ 1));
149 ND_PRINT((ndo
, "\""));
152 /* Decode the vendor buffer */
153 ND_TCHECK(bp
->bp_vend
[0]);
154 if (memcmp((const char *)bp
->bp_vend
, vm_rfc1048
,
155 sizeof(u_int32_t
)) == 0)
156 rfc1048_print(ndo
, bp
->bp_vend
);
157 else if (memcmp((const char *)bp
->bp_vend
, vm_cmu
,
158 sizeof(u_int32_t
)) == 0)
159 cmu_print(ndo
, bp
->bp_vend
);
163 ul
= EXTRACT_32BITS(&bp
->bp_vend
);
165 ND_PRINT((ndo
, "\n\t Vendor-#0x%x", ul
));
170 ND_PRINT((ndo
, "%s", tstr
));
174 * The first character specifies the format to print:
175 * i - ip address (32 bits)
176 * p - ip address pairs (32 bits + 32 bits)
178 * L - unsigned long (32 bits)
179 * s - short (16 bits)
180 * b - period-seperated decimal bytes (variable length)
181 * x - colon-seperated hex bytes (variable length)
182 * a - ascii string (variable length)
183 * B - on/off (8 bits)
184 * $ - special (explicit code to handle)
186 static const struct tok tag2str
[] = {
189 { TAG_SUBNET_MASK
, "iSubnet-Mask" }, /* subnet mask (RFC950) */
190 { TAG_TIME_OFFSET
, "LTime-Zone" }, /* seconds from UTC */
191 { TAG_GATEWAY
, "iDefault-Gateway" }, /* default gateway */
192 { TAG_TIME_SERVER
, "iTime-Server" }, /* time servers (RFC868) */
193 { TAG_NAME_SERVER
, "iIEN-Name-Server" }, /* IEN name servers (IEN116) */
194 { TAG_DOMAIN_SERVER
, "iDomain-Name-Server" }, /* domain name (RFC1035) */
195 { TAG_LOG_SERVER
, "iLOG" }, /* MIT log servers */
196 { TAG_COOKIE_SERVER
, "iCS" }, /* cookie servers (RFC865) */
197 { TAG_LPR_SERVER
, "iLPR-Server" }, /* lpr server (RFC1179) */
198 { TAG_IMPRESS_SERVER
, "iIM" }, /* impress servers (Imagen) */
199 { TAG_RLP_SERVER
, "iRL" }, /* resource location (RFC887) */
200 { TAG_HOSTNAME
, "aHostname" }, /* ascii hostname */
201 { TAG_BOOTSIZE
, "sBS" }, /* 512 byte blocks */
204 { TAG_DUMPPATH
, "aDP" },
205 { TAG_DOMAINNAME
, "aDomain-Name" },
206 { TAG_SWAP_SERVER
, "iSS" },
207 { TAG_ROOTPATH
, "aRP" },
208 { TAG_EXTPATH
, "aEP" },
210 { TAG_IP_FORWARD
, "BIPF" },
211 { TAG_NL_SRCRT
, "BSRT" },
212 { TAG_PFILTERS
, "pPF" },
213 { TAG_REASS_SIZE
, "sRSZ" },
214 { TAG_DEF_TTL
, "bTTL" },
215 { TAG_MTU_TIMEOUT
, "lMTU-Timeout" },
216 { TAG_MTU_TABLE
, "sMTU-Table" },
217 { TAG_INT_MTU
, "sMTU" },
218 { TAG_LOCAL_SUBNETS
, "BLSN" },
219 { TAG_BROAD_ADDR
, "iBR" },
220 { TAG_DO_MASK_DISC
, "BMD" },
221 { TAG_SUPPLY_MASK
, "BMS" },
222 { TAG_DO_RDISC
, "BRouter-Discovery" },
223 { TAG_RTR_SOL_ADDR
, "iRSA" },
224 { TAG_STATIC_ROUTE
, "pStatic-Route" },
225 { TAG_USE_TRAILERS
, "BUT" },
226 { TAG_ARP_TIMEOUT
, "lAT" },
227 { TAG_ETH_ENCAP
, "BIE" },
228 { TAG_TCP_TTL
, "bTT" },
229 { TAG_TCP_KEEPALIVE
, "lKI" },
230 { TAG_KEEPALIVE_GO
, "BKG" },
231 { TAG_NIS_DOMAIN
, "aYD" },
232 { TAG_NIS_SERVERS
, "iYS" },
233 { TAG_NTP_SERVERS
, "iNTP" },
234 { TAG_VENDOR_OPTS
, "bVendor-Option" },
235 { TAG_NETBIOS_NS
, "iNetbios-Name-Server" },
236 { TAG_NETBIOS_DDS
, "iWDD" },
237 { TAG_NETBIOS_NODE
, "$Netbios-Node" },
238 { TAG_NETBIOS_SCOPE
, "aNetbios-Scope" },
239 { TAG_XWIN_FS
, "iXFS" },
240 { TAG_XWIN_DM
, "iXDM" },
241 { TAG_NIS_P_DOMAIN
, "sN+D" },
242 { TAG_NIS_P_SERVERS
, "iN+S" },
243 { TAG_MOBILE_HOME
, "iMH" },
244 { TAG_SMPT_SERVER
, "iSMTP" },
245 { TAG_POP3_SERVER
, "iPOP3" },
246 { TAG_NNTP_SERVER
, "iNNTP" },
247 { TAG_WWW_SERVER
, "iWWW" },
248 { TAG_FINGER_SERVER
, "iFG" },
249 { TAG_IRC_SERVER
, "iIRC" },
250 { TAG_STREETTALK_SRVR
, "iSTS" },
251 { TAG_STREETTALK_STDA
, "iSTDA" },
252 { TAG_REQUESTED_IP
, "iRequested-IP" },
253 { TAG_IP_LEASE
, "lLease-Time" },
254 { TAG_OPT_OVERLOAD
, "$OO" },
255 { TAG_TFTP_SERVER
, "aTFTP" },
256 { TAG_BOOTFILENAME
, "aBF" },
257 { TAG_DHCP_MESSAGE
, " DHCP-Message" },
258 { TAG_SERVER_ID
, "iServer-ID" },
259 { TAG_PARM_REQUEST
, "bParameter-Request" },
260 { TAG_MESSAGE
, "aMSG" },
261 { TAG_MAX_MSG_SIZE
, "sMSZ" },
262 { TAG_RENEWAL_TIME
, "lRN" },
263 { TAG_REBIND_TIME
, "lRB" },
264 { TAG_VENDOR_CLASS
, "aVendor-Class" },
265 { TAG_CLIENT_ID
, "$Client-ID" },
267 { TAG_OPEN_GROUP_UAP
, "aUAP" },
269 { TAG_DISABLE_AUTOCONF
, "BNOAUTO" },
271 { TAG_SLP_DA
, "bSLP-DA" }, /*"b" is a little wrong */
272 { TAG_SLP_SCOPE
, "bSLP-SCOPE" }, /*"b" is a little wrong */
274 { TAG_NS_SEARCH
, "sNSSEARCH" }, /* XXX 's' */
276 { TAG_IP4_SUBNET_SELECT
, "iSUBNET" },
278 { TAG_CLASSLESS_STATIC_RT
, "$Classless-Static-Route" },
279 { TAG_CLASSLESS_STA_RT_MS
, "$Classless-Static-Route-Microsoft" },
280 /* http://www.iana.org/assignments/bootp-dhcp-extensions/index.htm */
281 { TAG_USER_CLASS
, "aCLASS" },
282 { TAG_SLP_NAMING_AUTH
, "aSLP-NA" },
283 { TAG_CLIENT_FQDN
, "$FQDN" },
284 { TAG_AGENT_CIRCUIT
, "$Agent-Information" },
285 { TAG_AGENT_REMOTE
, "bARMT" },
286 { TAG_AGENT_MASK
, "bAMSK" },
287 { TAG_TZ_STRING
, "aTZSTR" },
288 { TAG_FQDN_OPTION
, "bFQDNS" }, /* XXX 'b' */
289 { TAG_AUTH
, "bAUTH" }, /* XXX 'b' */
290 { TAG_VINES_SERVERS
, "iVINES" },
291 { TAG_SERVER_RANK
, "sRANK" },
292 { TAG_CLIENT_ARCH
, "sARCH" },
293 { TAG_CLIENT_NDI
, "bNDI" }, /* XXX 'b' */
294 { TAG_CLIENT_GUID
, "bGUID" }, /* XXX 'b' */
295 { TAG_LDAP_URL
, "aLDAP" },
296 { TAG_6OVER4
, "i6o4" },
297 { TAG_PRINTER_NAME
, "aPRTR" },
298 { TAG_MDHCP_SERVER
, "bMDHCP" }, /* XXX 'b' */
299 { TAG_IPX_COMPAT
, "bIPX" }, /* XXX 'b' */
300 { TAG_NETINFO_PARENT
, "iNI" },
301 { TAG_NETINFO_PARENT_TAG
, "aNITAG" },
303 { TAG_FAILOVER
, "bFAIL" }, /* XXX 'b' */
306 /* 2-byte extended tags */
307 static const struct tok xtag2str
[] = {
311 /* DHCP "options overload" types */
312 static const struct tok oo2str
[] = {
319 /* NETBIOS over TCP/IP node type options */
320 static const struct tok nbo2str
[] = {
328 /* ARP Hardware types, for Client-ID option */
329 static const struct tok arp2str
[] = {
335 { 0x18, "ieee1394" },
339 static const struct tok dhcp_msg_values
[] = {
340 { DHCPDISCOVER
, "Discover" },
341 { DHCPOFFER
, "Offer" },
342 { DHCPREQUEST
, "Request" },
343 { DHCPDECLINE
, "Decline" },
346 { DHCPRELEASE
, "Release" },
347 { DHCPINFORM
, "Inform" },
351 #define AGENT_SUBOPTION_CIRCUIT_ID 1 /* RFC 3046 */
352 #define AGENT_SUBOPTION_REMOTE_ID 2 /* RFC 3046 */
353 #define AGENT_SUBOPTION_SUBSCRIBER_ID 6 /* RFC 3993 */
354 static const struct tok agent_suboption_values
[] = {
355 { AGENT_SUBOPTION_CIRCUIT_ID
, "Circuit-ID" },
356 { AGENT_SUBOPTION_REMOTE_ID
, "Remote-ID" },
357 { AGENT_SUBOPTION_SUBSCRIBER_ID
, "Subscriber-ID" },
363 rfc1048_print(netdissect_options
*ndo
,
364 register const u_char
*bp
)
366 register u_int16_t tag
;
368 register const char *cp
;
373 u_int8_t uc
, subopt
, suboptlen
;
375 ND_PRINT((ndo
, "\n\t Vendor-rfc1048 Extensions"));
377 /* Step over magic cookie */
378 ND_PRINT((ndo
, "\n\t Magic Cookie 0x%08x", EXTRACT_32BITS(bp
)));
379 bp
+= sizeof(int32_t);
381 /* Loop while we there is a tag left in the buffer */
382 while (ND_TTEST2(*bp
, 1)) {
384 if (tag
== TAG_PAD
&& ndo
->ndo_vflag
< 3)
386 if (tag
== TAG_END
&& ndo
->ndo_vflag
< 3)
388 if (tag
== TAG_EXTENDED_OPTION
) {
389 ND_TCHECK2(*(bp
+ 1), 2);
390 tag
= EXTRACT_16BITS(bp
+ 1);
391 /* XXX we don't know yet if the IANA will
392 * preclude overlap of 1-byte and 2-byte spaces.
393 * If not, we need to offset tag after this step.
395 cp
= tok2str(xtag2str
, "?xT%u", tag
);
397 cp
= tok2str(tag2str
, "?T%u", tag
);
400 if (tag
== TAG_PAD
|| tag
== TAG_END
)
403 /* Get the length; check for truncation */
408 ND_PRINT((ndo
, "\n\t %s Option %u, length %u%s", cp
, tag
, len
,
409 len
> 0 ? ": " : ""));
411 if (tag
== TAG_PAD
&& ndo
->ndo_vflag
> 2) {
413 while (ND_TTEST2(*bp
, 1) && *bp
== TAG_PAD
) {
418 ND_PRINT((ndo
, ", occurs %u", ntag
));
421 if (!ND_TTEST2(*bp
, len
)) {
422 ND_PRINT((ndo
, "[|rfc1048 %u]", len
));
426 if (tag
== TAG_DHCP_MESSAGE
&& len
== 1) {
428 ND_PRINT((ndo
, "%s", tok2str(dhcp_msg_values
, "Unknown (%u)", uc
)));
432 if (tag
== TAG_PARM_REQUEST
) {
436 cp
= tok2str(tag2str
, "?Option %u", uc
);
438 ND_PRINT((ndo
, "\n\t "));
440 ND_PRINT((ndo
, ", "));
441 ND_PRINT((ndo
, "%s", cp
+ 1));
447 if (tag
== TAG_EXTENDED_REQUEST
) {
451 us
= EXTRACT_16BITS(bp
);
453 cp
= tok2str(xtag2str
, "?xT%u", us
);
455 ND_PRINT((ndo
, "+"));
456 ND_PRINT((ndo
, "%s", cp
+ 1));
464 /* Base default formats for unknown tags on data size */
477 ND_PRINT((ndo
, "\""));
478 if (fn_printn(bp
, len
, ndo
->ndo_snapend
)) {
479 ND_PRINT((ndo
, "\""));
482 ND_PRINT((ndo
, "\""));
490 /* ip addresses/32-bit words */
491 while (len
>= sizeof(ul
)) {
493 ND_PRINT((ndo
, ","));
494 ul
= EXTRACT_32BITS(bp
);
497 ND_PRINT((ndo
, "%s", ipaddr_string(&ul
)));
499 ND_PRINT((ndo
, "%d", ul
));
501 ND_PRINT((ndo
, "%u", ul
));
509 /* IP address pairs */
510 while (len
>= 2*sizeof(ul
)) {
512 ND_PRINT((ndo
, ","));
513 memcpy((char *)&ul
, (const char *)bp
, sizeof(ul
));
514 ND_PRINT((ndo
, "(%s:", ipaddr_string(&ul
)));
516 memcpy((char *)&ul
, (const char *)bp
, sizeof(ul
));
517 ND_PRINT((ndo
, "%s)", ipaddr_string(&ul
)));
526 while (len
>= sizeof(us
)) {
528 ND_PRINT((ndo
, ","));
529 us
= EXTRACT_16BITS(bp
);
530 ND_PRINT((ndo
, "%u", us
));
541 ND_PRINT((ndo
, ","));
544 ND_PRINT((ndo
, "N"));
547 ND_PRINT((ndo
, "Y"));
550 ND_PRINT((ndo
, "%u?", *bp
));
565 ND_PRINT((ndo
, c
== 'x' ? ":" : "."));
567 ND_PRINT((ndo
, "%02x", *bp
));
569 ND_PRINT((ndo
, "%u", *bp
));
577 /* Guys we can't handle with one of the usual cases */
580 case TAG_NETBIOS_NODE
:
581 /* this option should be at least 1 byte long */
583 ND_PRINT((ndo
, "ERROR: option %u len %u < 1 bytes",
584 TAG_NETBIOS_NODE
, len
));
589 ND_PRINT((ndo
, "%s", tok2str(nbo2str
, NULL
, tag
)));
592 case TAG_OPT_OVERLOAD
:
593 /* this option should be at least 1 byte long */
595 ND_PRINT((ndo
, "ERROR: option %u len %u < 1 bytes",
596 TAG_OPT_OVERLOAD
, len
));
601 ND_PRINT((ndo
, "%s", tok2str(oo2str
, NULL
, tag
)));
604 case TAG_CLIENT_FQDN
:
605 /* this option should be at least 3 bytes long */
607 ND_PRINT((ndo
, "ERROR: option %u len %u < 3 bytes",
608 TAG_CLIENT_FQDN
, len
));
614 ND_PRINT((ndo
, "[%s] ", client_fqdn_flags(*bp
)));
617 ND_PRINT((ndo
, "%u/%u ", *bp
, *(bp
+1)));
619 ND_PRINT((ndo
, "\""));
620 if (fn_printn(bp
, len
- 3, ndo
->ndo_snapend
)) {
621 ND_PRINT((ndo
, "\""));
624 ND_PRINT((ndo
, "\""));
632 /* this option should be at least 1 byte long */
634 ND_PRINT((ndo
, "ERROR: option %u len %u < 1 bytes",
635 TAG_CLIENT_ID
, len
));
641 ND_PRINT((ndo
, "\""));
642 if (fn_printn(bp
, len
, ndo
->ndo_snapend
)) {
643 ND_PRINT((ndo
, "\""));
646 ND_PRINT((ndo
, "\""));
651 ND_PRINT((ndo
, "%s ", tok2str(arp2str
, "hardware-type %u,", type
)));
654 ND_PRINT((ndo
, ":"));
655 ND_PRINT((ndo
, "%02x", *bp
));
664 case TAG_AGENT_CIRCUIT
:
669 if (suboptlen
> len
) {
670 ND_PRINT((ndo
, "\n\t %s SubOption %u, length %u: length goes past end of option",
671 tok2str(agent_suboption_values
, "Unknown", subopt
),
678 ND_PRINT((ndo
, "\n\t %s SubOption %u, length %u: ",
679 tok2str(agent_suboption_values
, "Unknown", subopt
),
684 case AGENT_SUBOPTION_CIRCUIT_ID
: /* fall through */
685 case AGENT_SUBOPTION_REMOTE_ID
:
686 case AGENT_SUBOPTION_SUBSCRIBER_ID
:
687 fn_printn(bp
, suboptlen
, NULL
);
691 print_unknown_data(ndo
, bp
, "\n\t\t", suboptlen
);
699 case TAG_CLASSLESS_STATIC_RT
:
700 case TAG_CLASSLESS_STA_RT_MS
:
702 u_int mask_width
, significant_octets
, i
;
704 /* this option should be at least 5 bytes long */
706 ND_PRINT((ndo
, "ERROR: option %u len %u < 5 bytes",
707 TAG_CLASSLESS_STATIC_RT
, len
));
714 ND_PRINT((ndo
, ","));
717 /* mask_width <= 32 */
718 if (mask_width
> 32) {
719 ND_PRINT((ndo
, "[ERROR: Mask width (%d) > 32]", mask_width
));
724 significant_octets
= (mask_width
+ 7) / 8;
725 /* significant octets + router(4) */
726 if (len
< significant_octets
+ 4) {
727 ND_PRINT((ndo
, "[ERROR: Remaining length (%u) < %u bytes]", len
, significant_octets
+ 4));
732 ND_PRINT((ndo
, "("));
734 ND_PRINT((ndo
, "default"));
736 for (i
= 0; i
< significant_octets
; i
++) {
738 ND_PRINT((ndo
, "."));
739 ND_PRINT((ndo
, "%d", *bp
++));
741 for (i
= significant_octets
; i
< 4 ; i
++)
742 ND_PRINT((ndo
, ".0"));
743 ND_PRINT((ndo
, "/%d", mask_width
));
745 memcpy((char *)&ul
, (const char *)bp
, sizeof(ul
));
746 ND_PRINT((ndo
, ":%s)", ipaddr_string(&ul
)));
748 len
-= (significant_octets
+ 4);
755 ND_PRINT((ndo
, "[unknown special tag %u, size %u]",
763 /* Data left over? */
765 ND_PRINT((ndo
, "\n\t trailing data length %u", len
));
771 ND_PRINT((ndo
, "|[rfc1048]"));
775 cmu_print(netdissect_options
*ndo
,
776 register const u_char
*bp
)
778 register const struct cmu_vend
*cmu
;
780 #define PRINTCMUADDR(m, s) { ND_TCHECK(cmu->m); \
781 if (cmu->m.s_addr != 0) \
782 ND_PRINT((ndo, " %s:%s", s, ipaddr_string(&cmu->m.s_addr))); }
784 ND_PRINT((ndo
, " vend-cmu"));
785 cmu
= (const struct cmu_vend
*)bp
;
787 /* Only print if there are unknown bits */
788 ND_TCHECK(cmu
->v_flags
);
789 if ((cmu
->v_flags
& ~(VF_SMASK
)) != 0)
790 ND_PRINT((ndo
, " F:0x%x", cmu
->v_flags
));
791 PRINTCMUADDR(v_dgate
, "DG");
792 PRINTCMUADDR(v_smask
, cmu
->v_flags
& VF_SMASK
? "SM" : "SM*");
793 PRINTCMUADDR(v_dns1
, "NS1");
794 PRINTCMUADDR(v_dns2
, "NS2");
795 PRINTCMUADDR(v_ins1
, "IEN1");
796 PRINTCMUADDR(v_ins2
, "IEN2");
797 PRINTCMUADDR(v_ts1
, "TS1");
798 PRINTCMUADDR(v_ts2
, "TS2");
802 ND_PRINT((ndo
, "%s", tstr
));
807 client_fqdn_flags(u_int flags
)
809 static char buf
[8+1];
812 if (flags
& CLIENT_FQDN_FLAGS_S
)
814 if (flags
& CLIENT_FQDN_FLAGS_O
)
816 if (flags
& CLIENT_FQDN_FLAGS_E
)
818 if (flags
& CLIENT_FQDN_FLAGS_N
)