print-bootp.c (26183) | print-bootp.c (39300) |
---|---|
1/* | 1/* |
2 * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996 | 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 9 * this paragraph in its entirety in the documentation or other materials 10 * provided with the distribution, and (3) all advertising materials mentioning --- 6 unchanged lines hidden (view full) --- 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[] = | 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 9 * this paragraph in its entirety in the documentation or other materials 10 * provided with the distribution, and (3) all advertising materials mentioning --- 6 unchanged lines hidden (view full) --- 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.43 96/09/26 23:36:42 leres Exp $ (LBL)"; | 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 36#include <net/if.h> 37 38#include <netinet/in.h> 39#include <net/ethernet.h> 40 41#include <ctype.h> | 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 36#include <net/if.h> 37 38#include <netinet/in.h> 39#include <net/ethernet.h> 40 41#include <ctype.h> |
42#ifdef HAVE_MEMORY_H 43#include <memory.h> 44#endif |
|
42#include <stdio.h> 43#include <string.h> 44 45#include "interface.h" 46#include "addrtoname.h" 47#include "bootp.h" 48 49static void rfc1048_print(const u_char *, u_int); --- 90 unchanged lines hidden (view full) --- 140 TCHECK2(bp->bp_sname[0], 1); /* check first char only */ 141 if (*bp->bp_sname) { 142 printf(" sname \""); 143 if (fn_print(bp->bp_sname, snapend)) { 144 putchar('"'); 145 fputs(tstr + 1, stdout); 146 return; 147 } | 45#include <stdio.h> 46#include <string.h> 47 48#include "interface.h" 49#include "addrtoname.h" 50#include "bootp.h" 51 52static void rfc1048_print(const u_char *, u_int); --- 90 unchanged lines hidden (view full) --- 143 TCHECK2(bp->bp_sname[0], 1); /* check first char only */ 144 if (*bp->bp_sname) { 145 printf(" sname \""); 146 if (fn_print(bp->bp_sname, snapend)) { 147 putchar('"'); 148 fputs(tstr + 1, stdout); 149 return; 150 } |
151 putchar('"'); |
|
148 } 149 TCHECK2(bp->bp_sname[0], 1); /* check first char only */ 150 if (*bp->bp_file) { 151 printf(" file \""); 152 if (fn_print(bp->bp_file, snapend)) { 153 putchar('"'); 154 fputs(tstr + 1, stdout); 155 return; 156 } | 152 } 153 TCHECK2(bp->bp_sname[0], 1); /* check first char only */ 154 if (*bp->bp_file) { 155 printf(" file \""); 156 if (fn_print(bp->bp_file, snapend)) { 157 putchar('"'); 158 fputs(tstr + 1, stdout); 159 return; 160 } |
161 putchar('"'); |
|
157 } 158 159 /* Decode the vendor buffer */ 160 TCHECK(bp->bp_vend[0]); 161 length -= sizeof(*bp) - sizeof(bp->bp_vend); 162 if (memcmp((char *)bp->bp_vend, (char *)vm_rfc1048, 163 sizeof(u_int32_t)) == 0) 164 rfc1048_print(bp->bp_vend, length); --- 184 unchanged lines hidden --- | 162 } 163 164 /* Decode the vendor buffer */ 165 TCHECK(bp->bp_vend[0]); 166 length -= sizeof(*bp) - sizeof(bp->bp_vend); 167 if (memcmp((char *)bp->bp_vend, (char *)vm_rfc1048, 168 sizeof(u_int32_t)) == 0) 169 rfc1048_print(bp->bp_vend, length); --- 184 unchanged lines hidden --- |