Release 4.12 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>
enum nf_ct_ecache_state {
NFCT_ECACHE_UNKNOWN, /* destroy event not sent */
NFCT_ECACHE_DESTROY_FAIL, /* tried but failed to send destroy event */
NFCT_ECACHE_DESTROY_SENT, /* sent destroy event after failure */
};
struct nf_conntrack_ecache {
unsigned long cache; /* bitops want long */
u16 missed; /* missed events */
u16 ctmask; /* bitmask of ct events to be delivered */
u16 expmask; /* bitmask of expect events to be delivered */
enum nf_ct_ecache_state state:8;/* ecache state */
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 | 19 | 57.58% | 1 | 33.33% |
Changli Gao | 10 | 30.30% | 1 | 33.33% |
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 | 59 | 50.43% | 1 | 25.00% |
Pablo Neira Ayuso | 46 | 39.32% | 1 | 25.00% |
Changli Gao | 10 | 8.55% | 1 | 25.00% |
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 | 36 | 52.94% | 3 | 42.86% |
Martin Josefsson | 28 | 41.18% | 1 | 14.29% |
Alexey Dobriyan | 3 | 4.41% | 2 | 28.57% |
Patrick McHardy | 1 | 1.47% | 1 | 14.29% |
Total | 68 | 100.00% | 7 | 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 | 40 | 64.52% | 5 | 62.50% |
Martin Josefsson | 10 | 16.13% | 1 | 12.50% |
Florian Westphal | 10 | 16.13% | 1 | 12.50% |
Eric W. Biedermann | 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 | 27 | 48.21% | 3 | 60.00% |
Florian Westphal | 26 | 46.43% | 1 | 20.00% |
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 | 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 | 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 | 13 | 86.67% | 1 | 50.00% |
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 | 24 | 96.00% | 2 | 66.67% |
Eric W. Biedermann | 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 | 13 | 68.42% | 1 | 50.00% |
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 | 24 | 96.00% | 2 | 66.67% |
Eric W. Biedermann | 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 | 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 | 20 | 95.24% | 1 | 50.00% |
Eric W. Biedermann | 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 | 13 | 86.67% | 1 | 33.33% |
Guo-Fu Tseng | 1 | 6.67% | 1 | 33.33% |
Gao Feng | 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 | 10 | 90.91% | 1 | 50.00% |
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 | 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 | 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 | 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 | 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 | 370 | 40.88% | 6 | 27.27% |
Florian Westphal | 195 | 21.55% | 5 | 22.73% |
Martin Josefsson | 144 | 15.91% | 1 | 4.55% |
Patrick McHardy | 85 | 9.39% | 3 | 13.64% |
Alexey Dobriyan | 44 | 4.86% | 2 | 9.09% |
Gao Feng | 36 | 3.98% | 1 | 4.55% |
Changli Gao | 20 | 2.21% | 1 | 4.55% |
Eric W. Biedermann | 8 | 0.88% | 1 | 4.55% |
Linus Torvalds | 2 | 0.22% | 1 | 4.55% |
Guo-Fu Tseng | 1 | 0.11% | 1 | 4.55% |
Total | 905 | 100.00% | 22 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.