@@ -17,6 +17,13 @@ struct nf_conntrack_ecache {
1717 unsigned int events ;
1818};
1919
20+ /* This structure is passed to event handler */
21+ struct nf_ct_event {
22+ struct nf_conn * ct ;
23+ u32 pid ;
24+ int report ;
25+ };
26+
2027extern struct atomic_notifier_head nf_conntrack_chain ;
2128extern int nf_conntrack_register_notifier (struct notifier_block * nb );
2229extern int nf_conntrack_unregister_notifier (struct notifier_block * nb );
@@ -39,22 +46,56 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
3946 local_bh_enable ();
4047}
4148
42- static inline void nf_conntrack_event (enum ip_conntrack_events event ,
43- struct nf_conn * ct )
49+ static inline void
50+ nf_conntrack_event_report (enum ip_conntrack_events event ,
51+ struct nf_conn * ct ,
52+ u32 pid ,
53+ int report )
4454{
55+ struct nf_ct_event item = {
56+ .ct = ct ,
57+ .pid = pid ,
58+ .report = report
59+ };
4560 if (nf_ct_is_confirmed (ct ) && !nf_ct_is_dying (ct ))
46- atomic_notifier_call_chain (& nf_conntrack_chain , event , ct );
61+ atomic_notifier_call_chain (& nf_conntrack_chain , event , & item );
4762}
4863
64+ static inline void
65+ nf_conntrack_event (enum ip_conntrack_events event , struct nf_conn * ct )
66+ {
67+ nf_conntrack_event_report (event , ct , 0 , 0 );
68+ }
69+
70+ struct nf_exp_event {
71+ struct nf_conntrack_expect * exp ;
72+ u32 pid ;
73+ int report ;
74+ };
75+
4976extern struct atomic_notifier_head nf_ct_expect_chain ;
5077extern int nf_ct_expect_register_notifier (struct notifier_block * nb );
5178extern int nf_ct_expect_unregister_notifier (struct notifier_block * nb );
5279
80+ static inline void
81+ nf_ct_expect_event_report (enum ip_conntrack_expect_events event ,
82+ struct nf_conntrack_expect * exp ,
83+ u32 pid ,
84+ int report )
85+ {
86+ struct nf_exp_event item = {
87+ .exp = exp ,
88+ .pid = pid ,
89+ .report = report
90+ };
91+ atomic_notifier_call_chain (& nf_ct_expect_chain , event , & item );
92+ }
93+
5394static inline void
5495nf_ct_expect_event (enum ip_conntrack_expect_events event ,
5596 struct nf_conntrack_expect * exp )
5697{
57- atomic_notifier_call_chain ( & nf_ct_expect_chain , event , exp );
98+ nf_ct_expect_event_report ( event , exp , 0 , 0 );
5899}
59100
60101extern int nf_conntrack_ecache_init (struct net * net );
@@ -66,9 +107,17 @@ static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
66107 struct nf_conn * ct ) {}
67108static inline void nf_conntrack_event (enum ip_conntrack_events event ,
68109 struct nf_conn * ct ) {}
110+ static inline void nf_conntrack_event_report (enum ip_conntrack_events event ,
111+ struct nf_conn * ct ,
112+ u32 pid ,
113+ int report ) {}
69114static inline void nf_ct_deliver_cached_events (const struct nf_conn * ct ) {}
70115static inline void nf_ct_expect_event (enum ip_conntrack_expect_events event ,
71116 struct nf_conntrack_expect * exp ) {}
117+ static inline void nf_ct_expect_event_report (enum ip_conntrack_expect_events e ,
118+ struct nf_conntrack_expect * exp ,
119+ u32 pid ,
120+ int report ) {}
72121static inline void nf_ct_event_cache_flush (struct net * net ) {}
73122
74123static inline int nf_conntrack_ecache_init (struct net * net )
0 commit comments