summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/lib/printpacket6.c
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2013-07-19 05:41:57 +0000
committercy <cy@FreeBSD.org>2013-07-19 05:41:57 +0000
commit672af8808c0e7c15f330b401482f9271c2eb3fa6 (patch)
tree225b5acf68c01bc6a260b386c2b2dbf4fa2839e3 /contrib/ipfilter/lib/printpacket6.c
parent71e82d94e82560b20789833f60056506de34de8b (diff)
downloadFreeBSD-src-672af8808c0e7c15f330b401482f9271c2eb3fa6.zip
FreeBSD-src-672af8808c0e7c15f330b401482f9271c2eb3fa6.tar.gz
As per the developers handbook (5.3.1 step 1), prepare the vendor trees for
import of new ipfilter vendor sources by flattening them. To keep the tags consistent with dist, the tags are also flattened. Approved by: glebius (Mentor)
Diffstat (limited to 'contrib/ipfilter/lib/printpacket6.c')
-rw-r--r--contrib/ipfilter/lib/printpacket6.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/contrib/ipfilter/lib/printpacket6.c b/contrib/ipfilter/lib/printpacket6.c
deleted file mode 100644
index 16c807d..0000000
--- a/contrib/ipfilter/lib/printpacket6.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2002 by Darren Reed.
- *
- * See the IPFILTER.LICENCE file for details on licencing.
- *
- * $Id: printpacket6.c,v 1.3.4.1 2006/06/16 17:21:13 darrenr Exp $
- */
-
-#include "ipf.h"
-
-/*
- * This is meant to work without the IPv6 header files being present or
- * the inet_ntop() library.
- */
-void printpacket6(ip)
-struct ip *ip;
-{
- u_char *buf, p;
- u_short plen, *addrs;
- tcphdr_t *tcp;
- u_32_t flow;
-
- buf = (u_char *)ip;
- tcp = (tcphdr_t *)(buf + 40);
- p = buf[6];
- flow = ntohl(*(u_32_t *)buf);
- flow &= 0xfffff;
- plen = ntohs(*((u_short *)buf +2));
- addrs = (u_short *)buf + 4;
-
- printf("ip6/%d %d %#x %d", buf[0] & 0xf, plen, flow, p);
- printf(" %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
- ntohs(addrs[0]), ntohs(addrs[1]), ntohs(addrs[2]),
- ntohs(addrs[3]), ntohs(addrs[4]), ntohs(addrs[5]),
- ntohs(addrs[6]), ntohs(addrs[7]));
- if (plen >= 4)
- if (p == IPPROTO_TCP || p == IPPROTO_UDP)
- (void)printf(",%d", ntohs(tcp->th_sport));
- printf(" >");
- addrs += 8;
- printf(" %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
- ntohs(addrs[0]), ntohs(addrs[1]), ntohs(addrs[2]),
- ntohs(addrs[3]), ntohs(addrs[4]), ntohs(addrs[5]),
- ntohs(addrs[6]), ntohs(addrs[7]));
- if (plen >= 4)
- if (p == IPPROTO_TCP || p == IPPROTO_UDP)
- (void)printf(",%d", ntohs(tcp->th_dport));
- putchar('\n');
-}
OpenPOWER on IntegriCloud