]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bootp.c
Fix the pointer tests in the non-ndoified TTEST2() macro as well.
[tcpdump] / print-bootp.c
index c1c2b6be191e7261ec6baba37076ab5238095c57..c7538ff8714029e19d4365f02a5f42ee30edc87a 100644 (file)
@@ -22,7 +22,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.86 2007-07-24 17:28:56 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.89 2008-04-22 09:45:08 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -280,6 +280,7 @@ static struct tok tag2str[] = {
        { TAG_IP4_SUBNET_SELECT, "iSUBNET" },
 /* RFC 3442 */
        { TAG_CLASSLESS_STATIC_RT, "$Classless-Static-Route" },
+       { TAG_CLASSLESS_STA_RT_MS, "$Classless-Static-Route-Microsoft" },
 /* http://www.iana.org/assignments/bootp-dhcp-extensions/index.htm */
        { TAG_USER_CLASS,       "aCLASS" },
        { TAG_SLP_NAMING_AUTH,  "aSLP-NA" },
@@ -351,9 +352,13 @@ static struct tok dhcp_msg_values[] = {
         { 0,                   NULL }
 };
 
-#define AGENT_SUBOPTION_CIRCUIT_ID 1
+#define AGENT_SUBOPTION_CIRCUIT_ID     1       /* RFC 3046 */
+#define AGENT_SUBOPTION_REMOTE_ID      2       /* RFC 3046 */
+#define AGENT_SUBOPTION_SUBSCRIBER_ID  6       /* RFC 3993 */
 static struct tok agent_suboption_values[] = {
         { AGENT_SUBOPTION_CIRCUIT_ID, "Circuit-ID" },
+        { AGENT_SUBOPTION_REMOTE_ID, "Remote-ID" },
+        { AGENT_SUBOPTION_SUBSCRIBER_ID, "Subscriber-ID" },
         { 0,                   NULL }
 };
 
@@ -580,8 +585,6 @@ rfc1048_print(register const u_char *bp)
                                if (len < 1)  {
                                        printf("ERROR: option %u len %u < 1 bytes",
                                            TAG_NETBIOS_NODE, len);
-                                       bp += len;
-                                       len = 0;
                                        break;
                                }
                                tag = *bp++;
@@ -594,8 +597,6 @@ rfc1048_print(register const u_char *bp)
                                if (len < 1)  {
                                        printf("ERROR: option %u len %u < 1 bytes",
                                            TAG_OPT_OVERLOAD, len);
-                                       bp += len;
-                                       len = 0;
                                        break;
                                }
                                tag = *bp++;
@@ -635,8 +636,6 @@ rfc1048_print(register const u_char *bp)
                                if (len < 1)  {
                                        printf("ERROR: option %u len %u < 1 bytes",
                                            TAG_CLIENT_ID, len);
-                                       bp += len;
-                                       len = 0;
                                        break;
                                }
                                type = *bp++;
@@ -685,9 +684,11 @@ rfc1048_print(register const u_char *bp)
                                           suboptlen);
                                        switch (subopt) {
 
-                                       case AGENT_SUBOPTION_CIRCUIT_ID:
-                                               fn_printn(bp, suboptlen, NULL);
-                                               break;
+                                        case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */
+                                        case AGENT_SUBOPTION_REMOTE_ID:
+                                        case AGENT_SUBOPTION_SUBSCRIBER_ID:
+                                                fn_printn(bp, suboptlen, NULL);
+                                                break;
 
                                        default:
                                                print_unknown_data(bp, "\n\t\t", suboptlen);
@@ -699,6 +700,7 @@ rfc1048_print(register const u_char *bp)
                            break;
 
                        case TAG_CLASSLESS_STATIC_RT:
+                       case TAG_CLASSLESS_STA_RT_MS:
                        {       
                                u_int mask_width, significant_octets, i;