]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ether.c
Functions in libnetdissect must use ndo_error() function
[tcpdump] / print-ether.c
index f4906260baad56d9cc82f9555f42b7b44e7abb48..ddf6a5305260056fd8416fb76a43c114652e6ac8 100644 (file)
@@ -82,6 +82,7 @@ const struct tok ethertype_values[] = {
     { ETHERTYPE_GEONET,         "GeoNet"},
     { ETHERTYPE_CALM_FAST,      "CALM FAST"},
     { ETHERTYPE_AOE,            "AoE" },
+    { ETHERTYPE_MEDSA,          "MEDSA" },
     { 0, NULL}
 };
 
@@ -127,7 +128,7 @@ ether_print(netdissect_options *ndo,
             const u_char *p, u_int length, u_int caplen,
             void (*print_encap_header)(netdissect_options *ndo, const u_char *), const u_char *encap_header_arg)
 {
-       struct ether_header *ep;
+       const struct ether_header *ep;
        u_int orig_length;
        u_short ether_type;
        u_int hdrlen;
@@ -151,7 +152,7 @@ ether_print(netdissect_options *ndo,
 
        length -= ETHER_HDRLEN;
        caplen -= ETHER_HDRLEN;
-       ep = (struct ether_header *)p;
+       ep = (const struct ether_header *)p;
        p += ETHER_HDRLEN;
        hdrlen = ETHER_HDRLEN;
 
@@ -226,7 +227,7 @@ recurse:
                        if (!ndo->ndo_eflag) {
                                if (print_encap_header != NULL)
                                        (*print_encap_header)(ndo, encap_header_arg);
-                               ether_hdr_print(ndo, (u_char *)ep, orig_length);
+                               ether_hdr_print(ndo, (const u_char *)ep, orig_length);
                        }
 
                        if (!ndo->ndo_suppress_default_print)
@@ -421,6 +422,10 @@ ethertype_print(netdissect_options *ndo,
                aoe_print(ndo, p, length);
                return (1);
 
+       case ETHERTYPE_MEDSA:
+               medsa_print(ndo, p, length, caplen);
+               return (1);
+
        case ETHERTYPE_LAT:
        case ETHERTYPE_SCA:
        case ETHERTYPE_MOPRC: