how to display the tuples in kernel:
Use %pI4 to print the ip address from kernel.static inline void vel_nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t, char *name)
{
printk("Vel %s %s %p: dst proto = %u src = %pI4:%hu -> dst = %pI4:%hu src l3num = %d \n", __FUNCTION__, name,
t, t->dst.protonum,
&t->src.u3.ip, ntohs(t->src.u.all),
&t->dst.u3.ip, ntohs(t->dst.u.all), t->src.l3num);
}
No comments:
Post a Comment