Deleted Added
sdiff udiff text old ( 39300 ) new ( 56896 )
full compact
1/*
2 * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
4 *
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

--- 5 unchanged lines hidden (view full) ---

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
16 * written permission.
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.
20 *
21 * Format and print bootp packets.
22 */
23#ifndef lint
24static const char rcsid[] =
25 "@(#) $Header: print-bootp.c,v 1.46 98/07/18 13:33:58 leres Exp $ (LBL)";
26#endif
27
28#include <sys/param.h>
29#include <sys/time.h>
30#include <sys/socket.h>
31
32#if __STDC__
33struct mbuf;
34struct rtentry;
35#endif

--- 61 unchanged lines hidden (view full) ---

97
98 /* Only print interesting fields */
99 if (bp->bp_hops)
100 printf(" hops:%d", bp->bp_hops);
101 if (bp->bp_xid)
102 printf(" xid:0x%x", (u_int32_t)ntohl(bp->bp_xid));
103 if (bp->bp_secs)
104 printf(" secs:%d", ntohs(bp->bp_secs));
105
106 /* Client's ip address */
107 TCHECK(bp->bp_ciaddr);
108 if (bp->bp_ciaddr.s_addr)
109 printf(" C:%s", ipaddr_string(&bp->bp_ciaddr));
110
111 /* 'your' ip address (bootp client) */
112 TCHECK(bp->bp_yiaddr);

--- 89 unchanged lines hidden (view full) ---

202 { TAG_BOOTSIZE, "sBS" }, /* 512 byte blocks */
203 { TAG_END, " END" },
204/* RFC1497 tags */
205 { TAG_DUMPPATH, "aDP" },
206 { TAG_DOMAINNAME, "aDN" },
207 { TAG_SWAP_SERVER, "iSS" },
208 { TAG_ROOTPATH, "aRP" },
209 { TAG_EXTPATH, "aEP" },
210 { 0, NULL }
211};
212
213static void
214rfc1048_print(register const u_char *bp, register u_int length)
215{
216 register u_char tag;
217 register u_int len, size;

--- 25 unchanged lines hidden (view full) ---

243 return;
244 }
245 len = *bp++;
246 if (bp + len >= snapend) {
247 fputs(tstr, stdout);
248 return;
249 }
250
251 /* Print data */
252 size = len;
253 if (c == '?') {
254 /* Base default formats for unknown tags on data size */
255 if (size & 1)
256 c = 'b';
257 else if (size & 2)
258 c = 's';

--- 24 unchanged lines hidden (view full) ---

283 else
284 printf("%u", ul);
285 bp += sizeof(ul);
286 size -= sizeof(ul);
287 first = 0;
288 }
289 break;
290
291 case 's':
292 /* shorts */
293 while (size >= sizeof(us)) {
294 if (!first)
295 putchar(',');
296 memcpy((char *)&us, (char *)bp, sizeof(us));
297 printf("%d", us);
298 bp += sizeof(us);
299 size -= sizeof(us);
300 first = 0;
301 }
302 break;
303
304 case 'b':
305 default:
306 /* Bytes */
307 while (size > 0) {
308 if (!first)
309 putchar('.');
310 printf("%d", *bp);
311 ++bp;

--- 42 unchanged lines hidden ---