Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
Pablo Neira Ayuso says: ==================== Netfilter/IPVS updates for net-next This small patchset contains three accumulated Netfilter/IPVS updates, they are: 1) Refactorize common NAT code by encapsulating it into a helper function, similarly to what we do in other conntrack extensions, from Florian Westphal. 2) A minor format string mismatch fix for IPVS, from Masanari Iida. 3) Add quota support to the netfilter accounting infrastructure, now you can add quotas to accounting objects via the nfnetlink interface and use them from iptables. You can also listen to quota notifications from userspace. This enhancement from Mathieu Poirier. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -3,11 +3,17 @@
|
||||
|
||||
#include <uapi/linux/netfilter/nfnetlink_acct.h>
|
||||
|
||||
enum {
|
||||
NFACCT_NO_QUOTA = -1,
|
||||
NFACCT_UNDERQUOTA,
|
||||
NFACCT_OVERQUOTA,
|
||||
};
|
||||
|
||||
struct nf_acct;
|
||||
|
||||
struct nf_acct *nfnl_acct_find_get(const char *filter_name);
|
||||
void nfnl_acct_put(struct nf_acct *acct);
|
||||
void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct);
|
||||
|
||||
extern int nfnl_acct_overquota(const struct sk_buff *skb,
|
||||
struct nf_acct *nfacct);
|
||||
#endif /* _NFNL_ACCT_H */
|
||||
|
||||
@@ -48,6 +48,8 @@ unsigned int nf_nat_setup_info(struct nf_conn *ct,
|
||||
extern unsigned int nf_nat_alloc_null_binding(struct nf_conn *ct,
|
||||
unsigned int hooknum);
|
||||
|
||||
struct nf_conn_nat *nf_ct_nat_ext_add(struct nf_conn *ct);
|
||||
|
||||
/* Is this tuple already taken? (not by us)*/
|
||||
int nf_nat_used_tuple(const struct nf_conntrack_tuple *tuple,
|
||||
const struct nf_conn *ignored_conntrack);
|
||||
|
||||
@@ -20,6 +20,8 @@ enum nfnetlink_groups {
|
||||
#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
|
||||
NFNLGRP_NFTABLES,
|
||||
#define NFNLGRP_NFTABLES NFNLGRP_NFTABLES
|
||||
NFNLGRP_ACCT_QUOTA,
|
||||
#define NFNLGRP_ACCT_QUOTA NFNLGRP_ACCT_QUOTA
|
||||
__NFNLGRP_MAX,
|
||||
};
|
||||
#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
|
||||
|
||||
@@ -10,15 +10,24 @@ enum nfnl_acct_msg_types {
|
||||
NFNL_MSG_ACCT_GET,
|
||||
NFNL_MSG_ACCT_GET_CTRZERO,
|
||||
NFNL_MSG_ACCT_DEL,
|
||||
NFNL_MSG_ACCT_OVERQUOTA,
|
||||
NFNL_MSG_ACCT_MAX
|
||||
};
|
||||
|
||||
enum nfnl_acct_flags {
|
||||
NFACCT_F_QUOTA_PKTS = (1 << 0),
|
||||
NFACCT_F_QUOTA_BYTES = (1 << 1),
|
||||
NFACCT_F_OVERQUOTA = (1 << 2), /* can't be set from userspace */
|
||||
};
|
||||
|
||||
enum nfnl_acct_type {
|
||||
NFACCT_UNSPEC,
|
||||
NFACCT_NAME,
|
||||
NFACCT_PKTS,
|
||||
NFACCT_BYTES,
|
||||
NFACCT_USE,
|
||||
NFACCT_FLAGS,
|
||||
NFACCT_QUOTA,
|
||||
__NFACCT_MAX
|
||||
};
|
||||
#define NFACCT_MAX (__NFACCT_MAX - 1)
|
||||
|
||||
Reference in New Issue
Block a user