]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bootp.c
provide multiline output for PIM Joins/Grafts/Graft-Acks
[tcpdump] / print-bootp.c
index b4864007ab025d60c044a3331547050627cdaecb..cde864561701041b7038bf6afdd4e4775b86e0bc 100644 (file)
@@ -21,8 +21,8 @@
  * Format and print bootp packets.
  */
 #ifndef lint
-static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.72 2003-04-28 07:43:03 hannes Exp $ (LBL)";
+static const char rcsid[] _U_ =
+    "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.78 2004-03-02 07:38:10 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -45,11 +45,22 @@ static void cmu_print(const u_char *);
 
 static char tstr[] = " [|bootp]";
 
+static const struct tok bootp_flag_values[] = {
+    { 0x8000,                   "Broadcast" },
+    { 0, NULL}
+};
+
+static const struct tok bootp_op_values[] = {
+    { BOOTPREQUEST,             "Request" },
+    { BOOTPREPLY,               "Reply" },
+    { 0, NULL}
+};
+
 /*
  * Print bootp requests
  */
 void
-bootp_print(register const u_char *cp, u_short sport, u_short dport, u_int length)
+bootp_print(register const u_char *cp, u_int length)
 {
        register const struct bootp *bp;
        static const u_char vm_cmu[4] = VM_CMU;
@@ -130,7 +141,7 @@ bootp_print(register const u_char *cp, u_short sport, u_short dport, u_int lengt
                }
                putchar('"');
        }
-       TCHECK2(bp->bp_sname[0], 1);            /* check first char only */
+       TCHECK2(bp->bp_file[0], 1);             /* check first char only */
        if (*bp->bp_file) {
                printf("\n\t  file \"");
                if (fn_print(bp->bp_file, snapend)) {
@@ -545,6 +556,10 @@ rfc1048_print(register const u_char *bp)
                                break;
 
                        case TAG_CLIENT_FQDN:
+                               /* option 81 should be at least 4 bytes long */
+                               if (len < 4) 
+                                        printf("ERROR: options 81 len %u < 4 bytes", len);
+                                       break;
                                if (*bp++)
                                        printf("[svrreg]");
                                if (*bp)