]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-sunatm.c
add tracefiles for infinite loop testing
[tcpdump] / print-sunatm.c
index 0f9f6f586268a7711ac91b41fbdf12c734ec1a5c..9f17be34c7f031ff90d75380d37db9f5d59b2300 100644 (file)
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+#ifndef lint
+static const char rcsid[] _U_ =
+    "@(#) $Header: /tcpdump/master/tcpdump/print-sunatm.c,v 1.5.2.2 2003-11-16 08:51:47 guy Exp $ (LBL)";
+#endif
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
+#include <tcpdump-stdinc.h>
  
 struct mbuf;
 struct rtentry;
  
-#include <netinet/in.h>
 #include <stdio.h>
 #include <pcap.h>
 
@@ -64,13 +64,13 @@ struct rtentry;
 #define PT_LLC         0x02    /* LLC encapsulation */
 
 /*
- * This is the top level routine of the printer.  'p' is the points
- * to the SunATM pseudo-header for the packet, 'h->tv' is the timestamp,
+ * This is the top level routine of the printer.  'p' points
+ * to the SunATM pseudo-header for the packet, 'h->ts' is the timestamp,
  * 'h->length' is the length of the packet off the wire, and 'h->caplen'
  * is the number of bytes actually captured.
  */
-void
-sunatm_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+u_int
+sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p)
 {
        u_int caplen = h->caplen;
        u_int length = h->len;
@@ -78,11 +78,9 @@ sunatm_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
        u_char vpi;
        u_int traftype;
 
-       ts_print(&h->ts);
-
        if (caplen < PKT_BEGIN_POS) {
                printf("[|atm]");
-               goto out;
+               return (caplen);
        }
 
        if (eflag) {
@@ -115,9 +113,5 @@ sunatm_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
        length -= PKT_BEGIN_POS;
        atm_print(vpi, vci, traftype, p, length, caplen);
 
- out:
-       putchar('\n');
-       --infodelay;
-       if (infoprint)
-               info(0);
+       return (PKT_BEGIN_POS);
 }