Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90336
b: refs/heads/master
c: ef27559
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 26, 2008
1 parent e86092c commit 3019dbb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30c69fed7d94c5c330a47fcc4833627644c19a5b
refs/heads/master: ef27559b70bd5312dfcbeab3b9ab0296206413c4
38 changes: 33 additions & 5 deletions trunk/include/net/netfilter/nf_conntrack_tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,39 @@ struct nf_conntrack_tuple_mask

#ifdef __KERNEL__

#define NF_CT_DUMP_TUPLE(tp) \
pr_debug("tuple %p: %u %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", \
(tp), (tp)->src.l3num, (tp)->dst.protonum, \
NIP6(*(struct in6_addr *)(tp)->src.u3.all), ntohs((tp)->src.u.all), \
NIP6(*(struct in6_addr *)(tp)->dst.u3.all), ntohs((tp)->dst.u.all))
static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t)
{
#ifdef DEBUG
printk("tuple %p: %u " NIPQUAD_FMT ":%hu -> " NIPQUAD_FMT ":%hu\n",
t, t->dst.protonum,
NIPQUAD(t->src.u3.ip), ntohs(t->src.u.all),
NIPQUAD(t->dst.u3.ip), ntohs(t->dst.u.all));
#endif
}

static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t)
{
#ifdef DEBUG
printk("tuple %p: %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n",
t, t->dst.protonum,
NIP6(*(struct in6_addr *)t->src.u3.all), ntohs(t->src.u.all),
NIP6(*(struct in6_addr *)t->dst.u3.all), ntohs(t->dst.u.all));
#endif
}

static inline void nf_ct_dump_tuple(const struct nf_conntrack_tuple *t)
{
switch (t->src.l3num) {
case AF_INET:
nf_ct_dump_tuple_ip(t);
break;
case AF_INET6:
nf_ct_dump_tuple_ipv6(t);
break;
}
}

#define NF_CT_DUMP_TUPLE(tp) nf_ct_dump_tuple(tp)

/* If we're the first tuple, it's the original dir. */
#define NF_CT_DIRECTION(h) \
Expand Down

0 comments on commit 3019dbb

Please sign in to comment.