]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-dsa.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-dsa.c
index 975285c827867a82b39ae836f7378da20fdce074..42d59461fd4856cdf4dad7f46964985c0f129af9 100644 (file)
@@ -21,9 +21,7 @@
 
 /* \summary: Marvell (Ethertype) Distributed Switch Architecture printer */
 
 
 /* \summary: Marvell (Ethertype) Distributed Switch Architecture printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
 
 #include "netdissect-stdinc.h"
 
@@ -35,7 +33,7 @@
 /*
  * Format of (Ethertyped or not) DSA tagged frames:
  *
 /*
  * Format of (Ethertyped or not) DSA tagged frames:
  *
- *      7   6   5   4   3   2   1   0  
+ *      7   6   5   4   3   2   1   0
  *    .   .   .   .   .   .   .   .   .
  *  0 +---+---+---+---+---+---+---+---+
  *    |   Ether Destination Address   |
  *    .   .   .   .   .   .   .   .   .
  *  0 +---+---+---+---+---+---+---+---+
  *    |   Ether Destination Address   |
@@ -83,7 +81,7 @@
 #define DSA_RX_SNIFF(tag) TOK(tag, 1, 0x04, 2)
 #define DSA_CFI(tag) TOK(tag, 1, 0x01, 0)
 #define DSA_PRI(tag) TOK(tag, 2, 0xe0, 5)
 #define DSA_RX_SNIFF(tag) TOK(tag, 1, 0x04, 2)
 #define DSA_CFI(tag) TOK(tag, 1, 0x01, 0)
 #define DSA_PRI(tag) TOK(tag, 2, 0xe0, 5)
-#define DSA_VID(tag) ((u_short)((TOK(tag, 2, 0xe0, 5) << 8) | (TOK(tag, 3, 0xff, 0))))
+#define DSA_VID(tag) ((u_short)((TOK(tag, 2, 0x0f, 0) << 8) | (TOK(tag, 3, 0xff, 0))))
 #define DSA_CODE(tag) ((TOK(tag, 1, 0x06, 1) << 1) | TOK(tag, 2, 0x10, 4))
 
 #define EDSA_LEN 8
 #define DSA_CODE(tag) ((TOK(tag, 1, 0x06, 1) << 1) | TOK(tag, 2, 0x10, 4))
 
 #define EDSA_LEN 8
@@ -196,24 +194,24 @@ edsa_tag_print(netdissect_options *ndo, const u_char *bp)
        tag_common_print(ndo, p);
 }
 
        tag_common_print(ndo, p);
 }
 
-u_int
+void
 dsa_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
        u_int caplen = h->caplen;
        u_int length = h->len;
 
        ndo->ndo_protocol = "dsa";
 dsa_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
        u_int caplen = h->caplen;
        u_int length = h->len;
 
        ndo->ndo_protocol = "dsa";
-       return (ether_print_switch_tag(ndo, p, length, caplen,
-           dsa_tag_print, DSA_LEN));
+       ndo->ndo_ll_hdr_len +=
+               ether_switch_tag_print(ndo, p, length, caplen, dsa_tag_print, DSA_LEN);
 }
 
 }
 
-u_int
+void
 edsa_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
        u_int caplen = h->caplen;
        u_int length = h->len;
 
        ndo->ndo_protocol = "edsa";
 edsa_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
        u_int caplen = h->caplen;
        u_int length = h->len;
 
        ndo->ndo_protocol = "edsa";
-       return (ether_print_switch_tag(ndo, p, length, caplen,
-           edsa_tag_print, EDSA_LEN));
+       ndo->ndo_ll_hdr_len +=
+               ether_switch_tag_print(ndo, p, length, caplen, edsa_tag_print, EDSA_LEN);
 }
 }