]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-atalk.c
When discussing the "gateway" keyword, don't say that the host must be
[tcpdump] / print-atalk.c
index b00c08ff5538534beea59ad69aec6cb9217f0253..19e430971ae2a5bff79f2bca79e6708a4bc1c59b 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.64 2000-10-30 06:22:14 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.66 2001-06-18 08:52:53 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -40,13 +40,13 @@ static const char rcsid[] =
 #include <stdlib.h>
 #include <string.h>
 #include <netdb.h>             /* for MAXHOSTNAMELEN on some platforms */
+#include <pcap.h>
 
 #include "interface.h"
 #include "addrtoname.h"
 #include "ethertype.h"
 #include "extract.h"                   /* must come after interface.h */
 #include "appletalk.h"
-#include "savestr.h"
 
 static struct tok type2str[] = {
        { ddpRTMP,              "rtmp" },
@@ -83,6 +83,20 @@ static const char *ataddr_string(u_short, u_char);
 static void ddp_print(const u_char *, u_int, int, u_short, u_char, u_char);
 static const char *ddpskt_string(int);
 
+/*
+ * Print LLAP packets received on a physical LocalTalk interface.
+ */
+void
+ltalk_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+{
+       snapend = p + h->caplen;
+       ts_print(&h->ts);
+       llap_print(p, h->caplen);
+       if(xflag)
+               default_print(p, h->caplen);
+       putchar('\n');
+}
+
 /*
  * Print AppleTalk LLAP packets.
  */
@@ -542,7 +556,7 @@ ataddr_string(u_short atnet, u_char athost)
                                ;
                        tp->addr = i3;
                        tp->nxt = newhnamemem();
-                       tp->name = savestr(nambuf);
+                       tp->name = strdup(nambuf);
                }
                fclose(fp);
        }
@@ -559,7 +573,7 @@ ataddr_string(u_short atnet, u_char athost)
                        tp->nxt = newhnamemem();
                        (void)snprintf(nambuf, sizeof(nambuf), "%s.%d",
                            tp2->name, athost);
-                       tp->name = savestr(nambuf);
+                       tp->name = strdup(nambuf);
                        return (tp->name);
                }
 
@@ -571,7 +585,7 @@ ataddr_string(u_short atnet, u_char athost)
        else
                (void)snprintf(nambuf, sizeof(nambuf), "%d.%d", atnet >> 8,
                    atnet & 0xff);
-       tp->name = savestr(nambuf);
+       tp->name = strdup(nambuf);
 
        return (tp->name);
 }