]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-stp.c
When checking for pcap_if_t, add $V_INCLS to CFLAGS, so we look at the
[tcpdump] / print-stp.c
index f2615fd7ec30584c4cf673e486d67d8b6316b01d..11df16ca93991e9e43d69ceb9e7b6e7af0dde464 100644 (file)
  */
 
 #ifndef lint
-static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-stp.c,v 1.1 2000-06-10 20:57:57 assar Exp $";
+static const char rcsid[] _U_ =
+    "@(#) $Header: /tcpdump/master/tcpdump/print-stp.c,v 1.13 2003-11-16 09:36:38 guy Exp $";
 #endif
 
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcpip.h>
+#include <tcpdump-stdinc.h>
 
-#ifdef __STDC__
 #include <stdlib.h>
-#endif
 #include <stdio.h>
 #include <string.h>
 
@@ -45,7 +36,7 @@ stp_print_bridge_id(const u_char *p)
 }
 
 static void
-stp_print_config_bpdu(const u_char *p, u_int length)
+stp_print_config_bpdu(const u_char *p)
 {
        printf("config ");
        if (p[7] & 1)
@@ -68,7 +59,7 @@ stp_print_config_bpdu(const u_char *p, u_int length)
 }
 
 static void
-stp_print_tcn_bpdu(const u_char *p, u_int length)
+stp_print_tcn_bpdu(void)
 {
        printf("tcn");
 }
@@ -87,21 +78,21 @@ stp_print(const u_char *p, u_int length)
                printf("unknown version");
                return;
        }
-               
+
        switch (p[6])
        {
-       case 0:
+       case 0x00:
                if (length < 10)
                        goto trunc;
-               stp_print_config_bpdu(p, length);
+               stp_print_config_bpdu(p);
                break;
 
-       case 1:
-               stp_print_tcn_bpdu(p, length);
+       case 0x80:
+               stp_print_tcn_bpdu();
                break;
 
        default:
-               printf("unknown type %i\n", p[6]);
+               printf("unknown type %i", p[6]);
                break;
        }