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