xref: /titanic_52/usr/src/cmd/ipf/lib/common/printfraginfo.c (revision 0eb822a1c0c2bea495647510b75f77f0e57633eb)
1 /*
2  * Copyright (C) 2004 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * $Id: printfraginfo.c,v 1.1.2.2 2004/03/23 15:15:45 darrenr Exp $
7  */
8 #include "ipf.h"
9 #include "kmem.h"
10 
11 void printfraginfo(prefix, ifr)
12 char *prefix;
13 struct ipfr *ifr;
14 {
15 	frentry_t fr;
16 
17 	fr.fr_flags = 0xffffffff;
18 
19 	printf("%s%s -> ", prefix, hostname(4, &ifr->ipfr_src));
20 	if (kmemcpy((char *)&fr, (u_long)ifr->ipfr_rule,
21 		    sizeof(fr)) == -1)
22 		return;
23 	printf("%s id %d ttl %d pr %d seen0 %d ifp %p tos %#02x = %#x\n",
24 		hostname(4, &ifr->ipfr_dst), ifr->ipfr_id, ifr->ipfr_seen0,
25 		ifr->ipfr_ttl, ifr->ipfr_p, ifr->ipfr_ifp, ifr->ipfr_tos,
26 		fr.fr_flags);
27 }
28