Release 4.7 include/net/netfilter/nf_conntrack_ecache.h
/*
* connection tracking event cache.
*/
#ifndef _NF_CONNTRACK_ECACHE_H
#define _NF_CONNTRACK_ECACHE_H
#include <net/netfilter/nf_conntrack.h>
#include <net/net_namespace.h>
#include <net/netfilter/nf_conntrack_expect.h>
#include <linux/netfilter/nf_conntrack_common.h>
#include <linux/netfilter/nf_conntrack_tuple_common.h>
#include <net/netfilter/nf_conntrack_extend.h>
struct nf_conntrack_ecache {
unsigned long cache; /* bitops want long */
unsigned long missed; /* missed events */
u16 ctmask; /* bitmask of ct events to be delivered */
u16 expmask; /* bitmask of expect events to be delivered */
u32 portid; /* netlink portid of destroyer */
};
static inline struct nf_conntrack_ecache *
nf_ct_ecache_find(const struct nf_conn *ct)
{
#ifdef CONFIG_NF_CONNTRACK_EVENTS
return nf_ct_ext_find(ct, NF_CT_EXT_ECACHE);
#else
return NULL;
#endif
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pablo neira ayuso | pablo neira ayuso | 19 | 57.58% | 1 | 33.33% |
changli gao | changli gao | 10 | 30.30% | 1 | 33.33% |
martin josefsson | martin josefsson | 4 | 12.12% | 1 | 33.33% |
| Total | 33 | 100.00% | 3 | 100.00% |
static inline struct nf_conntrack_ecache *
nf_ct_ecache_ext_add(struct nf_conn *ct, u16 ctmask, u16 expmask, gfp_t gfp)
{
#ifdef CONFIG_NF_CONNTRACK_EVENTS
struct net *net = nf_ct_net(ct);
struct nf_conntrack_ecache *e;
if (!ctmask && !expmask && net->ct.sysctl_events) {
ctmask = ~0;
expmask = ~0;
}
if (!ctmask && !expmask)
return NULL;
e = nf_ct_ext_add(ct, NF_CT_EXT_ECACHE, gfp);
if (e) {
e->ctmask = ctmask;
e->expmask = expmask;
}
return e;
#else
return NULL;
#endif
}Contributors
| Person | Tokens | Prop | Commits | CommitProp |
patrick mchardy | patrick mchardy | 59 | 50.43% | 1 | 25.00% |
pablo neira ayuso | pablo neira ayuso | 46 | 39.32% | 1 | 25.00% |
changli gao | changli gao | 10 | 8.55% | 1 | 25.00% |
martin josefsson | martin josefsson | 2 | 1.71% | 1 | 25.00% |
| Total | 117 | 100.00% | 4 | 100.00% |
;
#ifdef CONFIG_NF_CONNTRACK_EVENTS
/* This structure is passed to event handler */
struct nf_ct_event {
struct nf_conn *ct;
u32 portid;
int report;
};
struct nf_ct_event_notifier {
int (*fcn)(unsigned int events, struct nf_ct_event *item);
};
int nf_conntrack_register_notifier(struct net *net,
struct nf_ct_event_notifier *nb);
void nf_conntrack_unregister_notifier(struct net *net,
struct nf_ct_event_notifier *nb);
void nf_ct_deliver_cached_events(struct nf_conn *ct);
int nf_conntrack_eventmask_report(unsigned int eventmask, struct nf_conn *ct,
u32 portid, int report);
static inline void
nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
{
struct net *net = nf_ct_net(ct);
struct nf_conntrack_ecache *e;
if (!rcu_access_pointer(net->ct.nf_conntrack_event_cb))
return;
e = nf_ct_ecache_find(ct);
if (e == NULL)
return;
set_bit(event, &e->cache);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pablo neira ayuso | pablo neira ayuso | 37 | 54.41% | 3 | 50.00% |
martin josefsson | martin josefsson | 28 | 41.18% | 1 | 16.67% |
alexey dobriyan | alexey dobriyan | 3 | 4.41% | 2 | 33.33% |
| Total | 68 | 100.00% | 6 | 100.00% |
static inline int
nf_conntrack_event_report(enum ip_conntrack_events event, struct nf_conn *ct,
u32 portid, int report)
{
const struct net *net = nf_ct_net(ct);
if (!rcu_access_pointer(net->ct.nf_conntrack_event_cb))
return 0;
return nf_conntrack_eventmask_report(1 << event, ct, portid, report);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pablo neira ayuso | pablo neira ayuso | 40 | 64.52% | 5 | 62.50% |
florian westphal | florian westphal | 10 | 16.13% | 1 | 12.50% |
martin josefsson | martin josefsson | 10 | 16.13% | 1 | 12.50% |
eric w. biederman | eric w. biederman | 2 | 3.23% | 1 | 12.50% |
| Total | 62 | 100.00% | 8 | 100.00% |
static inline int
nf_conntrack_event(enum ip_conntrack_events event, struct nf_conn *ct)
{
const struct net *net = nf_ct_net(ct);
if (!rcu_access_pointer(net->ct.nf_conntrack_event_cb))
return 0;
return nf_conntrack_eventmask_report(1 << event, ct, 0, 0);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pablo neira ayuso | pablo neira ayuso | 27 | 48.21% | 3 | 60.00% |
florian westphal | florian westphal | 26 | 46.43% | 1 | 20.00% |
martin josefsson | martin josefsson | 3 | 5.36% | 1 | 20.00% |
| Total | 56 | 100.00% | 5 | 100.00% |
struct nf_exp_event {
struct nf_conntrack_expect *exp;
u32 portid;
int report;
};
struct nf_exp_event_notifier {
int (*fcn)(unsigned int events, struct nf_exp_event *item);
};
int nf_ct_expect_register_notifier(struct net *net,
struct nf_exp_event_notifier *nb);
void nf_ct_expect_unregister_notifier(struct net *net,
struct nf_exp_event_notifier *nb);
void nf_ct_expect_event_report(enum ip_conntrack_expect_events event,
struct nf_conntrack_expect *exp,
u32 portid, int report);
int nf_conntrack_ecache_pernet_init(struct net *net);
void nf_conntrack_ecache_pernet_fini(struct net *net);
int nf_conntrack_ecache_init(void);
void nf_conntrack_ecache_fini(void);
static inline void nf_conntrack_ecache_delayed_work(struct net *net)
{
if (!delayed_work_pending(&net->ct.ecache_dwork)) {
schedule_delayed_work(&net->ct.ecache_dwork, HZ);
net->ct.ecache_dwork_pending = true;
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
florian westphal | florian westphal | 47 | 100.00% | 1 | 100.00% |
| Total | 47 | 100.00% | 1 | 100.00% |
static inline void nf_conntrack_ecache_work(struct net *net)
{
if (net->ct.ecache_dwork_pending) {
net->ct.ecache_dwork_pending = false;
mod_delayed_work(system_wq, &net->ct.ecache_dwork, 0);
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
florian westphal | florian westphal | 44 | 100.00% | 1 | 100.00% |
| Total | 44 | 100.00% | 1 | 100.00% |
#else /* CONFIG_NF_CONNTRACK_EVENTS */
static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
struct nf_conn *ct) {}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin josefsson | martin josefsson | 13 | 86.67% | 1 | 50.00% |
linus torvalds | linus torvalds | 2 | 13.33% | 1 | 50.00% |
| Total | 15 | 100.00% | 2 | 100.00% |
static inline int nf_conntrack_eventmask_report(unsigned int eventmask,
struct nf_conn *ct,
u32 portid,
int report) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pablo neira ayuso | pablo neira ayuso | 24 | 96.00% | 2 | 66.67% |
eric w. biederman | eric w. biederman | 1 | 4.00% | 1 | 33.33% |
| Total | 25 | 100.00% | 3 | 100.00% |
static inline int nf_conntrack_event(enum ip_conntrack_events event,
struct nf_conn *ct) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin josefsson | martin josefsson | 13 | 68.42% | 1 | 50.00% |
pablo neira ayuso | pablo neira ayuso | 6 | 31.58% | 1 | 50.00% |
| Total | 19 | 100.00% | 2 | 100.00% |
static inline int nf_conntrack_event_report(enum ip_conntrack_events event,
struct nf_conn *ct,
u32 portid,
int report) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pablo neira ayuso | pablo neira ayuso | 24 | 96.00% | 2 | 66.67% |
eric w. biederman | eric w. biederman | 1 | 4.00% | 1 | 33.33% |
| Total | 25 | 100.00% | 3 | 100.00% |
static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin josefsson | martin josefsson | 12 | 100.00% | 1 | 100.00% |
| Total | 12 | 100.00% | 1 | 100.00% |
static inline void nf_ct_expect_event_report(enum ip_conntrack_expect_events e,
struct nf_conntrack_expect *exp,
u32 portid,
int report) {}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pablo neira ayuso | pablo neira ayuso | 20 | 95.24% | 1 | 50.00% |
eric w. biederman | eric w. biederman | 1 | 4.76% | 1 | 50.00% |
| Total | 21 | 100.00% | 2 | 100.00% |
static inline int nf_conntrack_ecache_pernet_init(struct net *net)
{
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
alexey dobriyan | alexey dobriyan | 13 | 86.67% | 1 | 33.33% |
gao feng | gao feng | 1 | 6.67% | 1 | 33.33% |
guo-fu tseng | guo-fu tseng | 1 | 6.67% | 1 | 33.33% |
| Total | 15 | 100.00% | 3 | 100.00% |
static inline void nf_conntrack_ecache_pernet_fini(struct net *net)
{
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
alexey dobriyan | alexey dobriyan | 10 | 90.91% | 1 | 50.00% |
gao feng | gao feng | 1 | 9.09% | 1 | 50.00% |
| Total | 11 | 100.00% | 2 | 100.00% |
static inline int nf_conntrack_ecache_init(void)
{
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gao feng | gao feng | 12 | 100.00% | 1 | 100.00% |
| Total | 12 | 100.00% | 1 | 100.00% |
static inline void nf_conntrack_ecache_fini(void)
{
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
gao feng | gao feng | 8 | 100.00% | 1 | 100.00% |
| Total | 8 | 100.00% | 1 | 100.00% |
static inline void nf_conntrack_ecache_delayed_work(struct net *net)
{
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
florian westphal | florian westphal | 11 | 100.00% | 1 | 100.00% |
| Total | 11 | 100.00% | 1 | 100.00% |
static inline void nf_conntrack_ecache_work(struct net *net)
{
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
florian westphal | florian westphal | 11 | 100.00% | 1 | 100.00% |
| Total | 11 | 100.00% | 1 | 100.00% |
#endif /* CONFIG_NF_CONNTRACK_EVENTS */
#endif /*_NF_CONNTRACK_ECACHE_H*/
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pablo neira ayuso | pablo neira ayuso | 375 | 42.37% | 6 | 30.00% |
florian westphal | florian westphal | 169 | 19.10% | 3 | 15.00% |
martin josefsson | martin josefsson | 144 | 16.27% | 1 | 5.00% |
patrick mchardy | patrick mchardy | 84 | 9.49% | 3 | 15.00% |
alexey dobriyan | alexey dobriyan | 44 | 4.97% | 2 | 10.00% |
gao feng | gao feng | 36 | 4.07% | 1 | 5.00% |
changli gao | changli gao | 20 | 2.26% | 1 | 5.00% |
eric w. biederman | eric w. biederman | 10 | 1.13% | 1 | 5.00% |
linus torvalds | linus torvalds | 2 | 0.23% | 1 | 5.00% |
guo-fu tseng | guo-fu tseng | 1 | 0.11% | 1 | 5.00% |
| Total | 885 | 100.00% | 20 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.