netfilter: Change return types of targets/watchers for Ebtables extensions
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
committed by
Patrick McHardy
parent
8cc784eec6
commit
0ac6ab1f79
@@ -221,7 +221,7 @@ struct ebt_watcher
|
|||||||
{
|
{
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
const char name[EBT_FUNCTION_MAXNAMELEN];
|
const char name[EBT_FUNCTION_MAXNAMELEN];
|
||||||
void (*watcher)(const struct sk_buff *skb, unsigned int hooknr,
|
unsigned int (*watcher)(const struct sk_buff *skb, unsigned int hooknr,
|
||||||
const struct net_device *in, const struct net_device *out,
|
const struct net_device *in, const struct net_device *out,
|
||||||
const void *watcherdata, unsigned int datalen);
|
const void *watcherdata, unsigned int datalen);
|
||||||
bool (*check)(const char *tablename, unsigned int hookmask,
|
bool (*check)(const char *tablename, unsigned int hookmask,
|
||||||
@@ -235,8 +235,8 @@ struct ebt_target
|
|||||||
{
|
{
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
const char name[EBT_FUNCTION_MAXNAMELEN];
|
const char name[EBT_FUNCTION_MAXNAMELEN];
|
||||||
/* returns one of the standard verdicts */
|
/* returns one of the standard EBT_* verdicts */
|
||||||
int (*target)(struct sk_buff *skb, unsigned int hooknr,
|
unsigned int (*target)(struct sk_buff *skb, unsigned int hooknr,
|
||||||
const struct net_device *in, const struct net_device *out,
|
const struct net_device *in, const struct net_device *out,
|
||||||
const void *targetdata, unsigned int datalen);
|
const void *targetdata, unsigned int datalen);
|
||||||
bool (*check)(const char *tablename, unsigned int hookmask,
|
bool (*check)(const char *tablename, unsigned int hookmask,
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
#include <linux/netfilter_bridge/ebtables.h>
|
#include <linux/netfilter_bridge/ebtables.h>
|
||||||
#include <linux/netfilter_bridge/ebt_arpreply.h>
|
#include <linux/netfilter_bridge/ebt_arpreply.h>
|
||||||
|
|
||||||
static int ebt_target_reply(struct sk_buff *skb, unsigned int hooknr,
|
static unsigned int ebt_target_reply(struct sk_buff *skb, unsigned int hooknr,
|
||||||
const struct net_device *in, const struct net_device *out,
|
const struct net_device *in, const struct net_device *out,
|
||||||
const void *data, unsigned int datalen)
|
const void *data, unsigned int datalen)
|
||||||
{
|
{
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
#include <linux/netfilter_bridge/ebtables.h>
|
#include <linux/netfilter_bridge/ebtables.h>
|
||||||
#include <linux/netfilter_bridge/ebt_nat.h>
|
#include <linux/netfilter_bridge/ebt_nat.h>
|
||||||
|
|
||||||
static int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr,
|
static unsigned int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr,
|
||||||
const struct net_device *in, const struct net_device *out,
|
const struct net_device *in, const struct net_device *out,
|
||||||
const void *data, unsigned int datalen)
|
const void *data, unsigned int datalen)
|
||||||
{
|
{
|
||||||
|
@@ -192,7 +192,7 @@ out:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ebt_log(const struct sk_buff *skb, unsigned int hooknr,
|
static unsigned int ebt_log(const struct sk_buff *skb, unsigned int hooknr,
|
||||||
const struct net_device *in, const struct net_device *out,
|
const struct net_device *in, const struct net_device *out,
|
||||||
const void *data, unsigned int datalen)
|
const void *data, unsigned int datalen)
|
||||||
{
|
{
|
||||||
@@ -209,6 +209,7 @@ static void ebt_log(const struct sk_buff *skb, unsigned int hooknr,
|
|||||||
else
|
else
|
||||||
ebt_log_packet(NFPROTO_BRIDGE, hooknr, skb, in, out, &li,
|
ebt_log_packet(NFPROTO_BRIDGE, hooknr, skb, in, out, &li,
|
||||||
info->prefix);
|
info->prefix);
|
||||||
|
return EBT_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ebt_watcher log =
|
static struct ebt_watcher log =
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
#include <linux/netfilter_bridge/ebtables.h>
|
#include <linux/netfilter_bridge/ebtables.h>
|
||||||
#include <linux/netfilter_bridge/ebt_mark_t.h>
|
#include <linux/netfilter_bridge/ebt_mark_t.h>
|
||||||
|
|
||||||
static int ebt_target_mark(struct sk_buff *skb, unsigned int hooknr,
|
static unsigned int ebt_target_mark(struct sk_buff *skb, unsigned int hooknr,
|
||||||
const struct net_device *in, const struct net_device *out,
|
const struct net_device *in, const struct net_device *out,
|
||||||
const void *data, unsigned int datalen)
|
const void *data, unsigned int datalen)
|
||||||
{
|
{
|
||||||
|
@@ -19,11 +19,11 @@
|
|||||||
#include <linux/netfilter_bridge/ebt_nflog.h>
|
#include <linux/netfilter_bridge/ebt_nflog.h>
|
||||||
#include <net/netfilter/nf_log.h>
|
#include <net/netfilter/nf_log.h>
|
||||||
|
|
||||||
static void ebt_nflog(const struct sk_buff *skb,
|
static unsigned int ebt_nflog(const struct sk_buff *skb,
|
||||||
unsigned int hooknr,
|
unsigned int hooknr,
|
||||||
const struct net_device *in,
|
const struct net_device *in,
|
||||||
const struct net_device *out,
|
const struct net_device *out,
|
||||||
const void *data, unsigned int datalen)
|
const void *data, unsigned int datalen)
|
||||||
{
|
{
|
||||||
struct ebt_nflog_info *info = (struct ebt_nflog_info *)data;
|
struct ebt_nflog_info *info = (struct ebt_nflog_info *)data;
|
||||||
struct nf_loginfo li;
|
struct nf_loginfo li;
|
||||||
@@ -34,6 +34,7 @@ static void ebt_nflog(const struct sk_buff *skb,
|
|||||||
li.u.ulog.qthreshold = info->threshold;
|
li.u.ulog.qthreshold = info->threshold;
|
||||||
|
|
||||||
nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, "%s", info->prefix);
|
nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, "%s", info->prefix);
|
||||||
|
return EBT_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ebt_nflog_check(const char *tablename,
|
static bool ebt_nflog_check(const char *tablename,
|
||||||
|
@@ -15,7 +15,8 @@
|
|||||||
#include <linux/netfilter_bridge/ebtables.h>
|
#include <linux/netfilter_bridge/ebtables.h>
|
||||||
#include <linux/netfilter_bridge/ebt_redirect.h>
|
#include <linux/netfilter_bridge/ebt_redirect.h>
|
||||||
|
|
||||||
static int ebt_target_redirect(struct sk_buff *skb, unsigned int hooknr,
|
static unsigned int ebt_target_redirect(struct sk_buff *skb,
|
||||||
|
unsigned int hooknr,
|
||||||
const struct net_device *in, const struct net_device *out,
|
const struct net_device *in, const struct net_device *out,
|
||||||
const void *data, unsigned int datalen)
|
const void *data, unsigned int datalen)
|
||||||
{
|
{
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include <linux/netfilter_bridge/ebtables.h>
|
#include <linux/netfilter_bridge/ebtables.h>
|
||||||
#include <linux/netfilter_bridge/ebt_nat.h>
|
#include <linux/netfilter_bridge/ebt_nat.h>
|
||||||
|
|
||||||
static int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr,
|
static unsigned int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr,
|
||||||
const struct net_device *in, const struct net_device *out,
|
const struct net_device *in, const struct net_device *out,
|
||||||
const void *data, unsigned int datalen)
|
const void *data, unsigned int datalen)
|
||||||
{
|
{
|
||||||
|
@@ -246,13 +246,14 @@ static void ebt_log_packet(u_int8_t pf, unsigned int hooknum,
|
|||||||
ebt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix);
|
ebt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ebt_ulog(const struct sk_buff *skb, unsigned int hooknr,
|
static unsigned int ebt_ulog(const struct sk_buff *skb, unsigned int hooknr,
|
||||||
const struct net_device *in, const struct net_device *out,
|
const struct net_device *in, const struct net_device *out,
|
||||||
const void *data, unsigned int datalen)
|
const void *data, unsigned int datalen)
|
||||||
{
|
{
|
||||||
const struct ebt_ulog_info *uloginfo = data;
|
const struct ebt_ulog_info *uloginfo = data;
|
||||||
|
|
||||||
ebt_ulog_packet(hooknr, skb, in, out, uloginfo, NULL);
|
ebt_ulog_packet(hooknr, skb, in, out, uloginfo, NULL);
|
||||||
|
return EBT_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ebt_ulog_check(const char *tablename, unsigned int hookmask,
|
static bool ebt_ulog_check(const char *tablename, unsigned int hookmask,
|
||||||
|
Reference in New Issue
Block a user