summaryrefslogtreecommitdiffstats
path: root/kernel/linux/net/bridge/netfilter/ebt_log.c
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2002-08-20 17:06:14 +0000
committerBart De Schuymer <bdschuym@pandora.be>2002-08-20 17:06:14 +0000
commitf382b8eae1527e8abab106436bb8ff54d137d6c6 (patch)
tree5ec242ea28ab74d3bd0064adcef9158fb453fc93 /kernel/linux/net/bridge/netfilter/ebt_log.c
parent831873ee9b24b205f74640e89b01fb137e32bf5c (diff)
cleanups
Diffstat (limited to 'kernel/linux/net/bridge/netfilter/ebt_log.c')
-rw-r--r--kernel/linux/net/bridge/netfilter/ebt_log.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/kernel/linux/net/bridge/netfilter/ebt_log.c b/kernel/linux/net/bridge/netfilter/ebt_log.c
index 7d7ed83..86591d2 100644
--- a/kernel/linux/net/bridge/netfilter/ebt_log.c
+++ b/kernel/linux/net/bridge/netfilter/ebt_log.c
@@ -20,67 +20,56 @@ static spinlock_t ebt_log_lock = SPIN_LOCK_UNLOCKED;
static int ebt_log_check(const char *tablename, unsigned int hookmask,
const struct ebt_entry *e, void *data, unsigned int datalen)
{
- struct ebt_log_info *loginfo = (struct ebt_log_info *)data;
+ struct ebt_log_info *info = (struct ebt_log_info *)data;
if (datalen != sizeof(struct ebt_log_info))
return -EINVAL;
- if (loginfo->bitmask & ~EBT_LOG_MASK)
+ if (info->bitmask & ~EBT_LOG_MASK)
return -EINVAL;
- if (loginfo->loglevel >= 8)
+ if (info->loglevel >= 8)
return -EINVAL;
- loginfo->prefix[EBT_LOG_PREFIX_SIZE - 1] = '\0';
+ info->prefix[EBT_LOG_PREFIX_SIZE - 1] = '\0';
return 0;
}
static void ebt_log(const struct sk_buff *skb, const struct net_device *in,
- const struct net_device *out, const void *data, unsigned int datalen,
- const struct ebt_counter *c)
+ const struct net_device *out, const void *data, unsigned int datalen)
{
- struct ebt_log_info *loginfo = (struct ebt_log_info *)data;
+ struct ebt_log_info *info = (struct ebt_log_info *)data;
char level_string[4] = "< >";
- level_string[1] = '0' + loginfo->loglevel;
+ level_string[1] = '0' + info->loglevel;
spin_lock_bh(&ebt_log_lock);
printk(level_string);
- // max length: 29 + 10 + 2 * 16
- printk("%s IN=%s OUT=%s ",
- loginfo->prefix,
- in ? in->name : "",
- out ? out->name : "");
+ printk("%s IN=%s OUT=%s ", info->prefix, in ? in->name : "",
+ out ? out->name : "");
if (skb->dev->hard_header_len) {
int i;
unsigned char *p = (skb->mac.ethernet)->h_source;
+
printk("MAC source = ");
for (i = 0; i < ETH_ALEN; i++,p++)
- printk("%02x%c", *p,
- i == ETH_ALEN - 1
- ? ' ':':');// length: 31
+ printk("%02x%c", *p, i == ETH_ALEN - 1 ? ' ':':');
printk("MAC dest = ");
p = (skb->mac.ethernet)->h_dest;
for (i = 0; i < ETH_ALEN; i++,p++)
- printk("%02x%c", *p,
- i == ETH_ALEN - 1
- ? ' ':':');// length: 29
+ printk("%02x%c", *p, i == ETH_ALEN - 1 ? ' ':':');
}
- // length: 14
printk("proto = 0x%04x", ntohs(((*skb).mac.ethernet)->h_proto));
- if ((loginfo->bitmask & EBT_LOG_IP) && skb->mac.ethernet->h_proto ==
+ if ((info->bitmask & EBT_LOG_IP) && skb->mac.ethernet->h_proto ==
htons(ETH_P_IP)){
struct iphdr *iph = skb->nh.iph;
- // max length: 46
printk(" IP SRC=%u.%u.%u.%u IP DST=%u.%u.%u.%u,",
NIPQUAD(iph->saddr), NIPQUAD(iph->daddr));
- // max length: 26
printk(" IP tos=0x%02X, IP proto=%d", iph->tos, iph->protocol);
}
- if ((loginfo->bitmask & EBT_LOG_ARP) &&
+ if ((info->bitmask & EBT_LOG_ARP) &&
((skb->mac.ethernet->h_proto == __constant_htons(ETH_P_ARP)) ||
(skb->mac.ethernet->h_proto == __constant_htons(ETH_P_RARP)))) {
struct arphdr * arph = skb->nh.arph;
- // max length: 40
printk(" ARP HTYPE=%d, PTYPE=0x%04x, OPCODE=%d",
ntohs(arph->ar_hrd), ntohs(arph->ar_pro),
ntohs(arph->ar_op));