]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Remove the etherproto_string() unused function
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 9 Mar 2018 19:49:53 +0000 (20:49 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 9 Mar 2018 19:49:53 +0000 (20:49 +0100)
addrtoname.c
addrtoname.h

index d43daac81f6bbb4590ffa5b40bd446a4b89f22b8..808ea57bcbdfd67110337224cd86cfd576a2c78c 100644 (file)
@@ -676,35 +676,6 @@ linkaddr_string(netdissect_options *ndo, const u_char *ep,
        return (tp->bs_name);
 }
 
-const char *
-etherproto_string(netdissect_options *ndo, u_short port)
-{
-       char *cp;
-       struct hnamemem *tp;
-       uint32_t i = port;
-       char buf[sizeof("0000")];
-
-       for (tp = &eprototable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt)
-               if (tp->addr == i)
-                       return (tp->name);
-
-       tp->addr = i;
-       tp->nxt = newhnamemem(ndo);
-
-       cp = buf;
-       NTOHS(port);
-       *cp++ = hex[port >> 12 & 0xf];
-       *cp++ = hex[port >> 8 & 0xf];
-       *cp++ = hex[port >> 4 & 0xf];
-       *cp++ = hex[port & 0xf];
-       *cp++ = '\0';
-       tp->name = strdup(buf);
-       if (tp->name == NULL)
-               (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
-                                 "etherproto_string: strdup(buf)");
-       return (tp->name);
-}
-
 #define ISONSAP_MAX_LENGTH 20
 const char *
 isonsap_string(netdissect_options *ndo, const u_char *nsap,
index dc22458f40dd7b91ff93411058d86cfd46d3ac40..a127b4e81d900e4b33c051aaaf2f41d4c44b9732 100644 (file)
@@ -42,7 +42,6 @@ enum {
 extern const char *linkaddr_string(netdissect_options *, const u_char *, const unsigned int, const unsigned int);
 extern const char *etheraddr_string(netdissect_options *, const u_char *);
 extern const char *le64addr_string(netdissect_options *, const u_char *);
-extern const char *etherproto_string(netdissect_options *, u_short);
 extern const char *tcpport_string(netdissect_options *, u_short);
 extern const char *udpport_string(netdissect_options *, u_short);
 extern const char *isonsap_string(netdissect_options *, const u_char *, u_int);