Lines Matching full:pd
43 static void l2tp_dfs_next_tunnel(struct l2tp_dfs_seq_data *pd) in l2tp_dfs_next_tunnel() argument
46 if (pd->tunnel) in l2tp_dfs_next_tunnel()
47 l2tp_tunnel_put(pd->tunnel); in l2tp_dfs_next_tunnel()
49 pd->tunnel = l2tp_tunnel_get_next(pd->net, &pd->tkey); in l2tp_dfs_next_tunnel()
50 pd->tkey++; in l2tp_dfs_next_tunnel()
53 static void l2tp_dfs_next_session(struct l2tp_dfs_seq_data *pd) in l2tp_dfs_next_session() argument
56 if (pd->session) in l2tp_dfs_next_session()
57 l2tp_session_put(pd->session); in l2tp_dfs_next_session()
59 pd->session = l2tp_session_get_next(pd->net, pd->tunnel->sock, in l2tp_dfs_next_session()
60 pd->tunnel->version, in l2tp_dfs_next_session()
61 pd->tunnel->tunnel_id, &pd->skey); in l2tp_dfs_next_session()
62 pd->skey++; in l2tp_dfs_next_session()
64 if (!pd->session) { in l2tp_dfs_next_session()
65 pd->skey = 0; in l2tp_dfs_next_session()
66 l2tp_dfs_next_tunnel(pd); in l2tp_dfs_next_session()
72 struct l2tp_dfs_seq_data *pd = SEQ_START_TOKEN; in l2tp_dfs_seq_start() local
79 pd = NULL; in l2tp_dfs_seq_start()
82 pd = m->private; in l2tp_dfs_seq_start()
84 if (!pd->tunnel) in l2tp_dfs_seq_start()
85 l2tp_dfs_next_tunnel(pd); in l2tp_dfs_seq_start()
87 l2tp_dfs_next_session(pd); in l2tp_dfs_seq_start()
90 if (!pd->tunnel && !pd->session) in l2tp_dfs_seq_start()
91 pd = NULL; in l2tp_dfs_seq_start()
94 return pd; in l2tp_dfs_seq_start()
105 struct l2tp_dfs_seq_data *pd = v; in l2tp_dfs_seq_stop() local
107 if (!pd || pd == SEQ_START_TOKEN) in l2tp_dfs_seq_stop()
113 if (pd->session) { in l2tp_dfs_seq_stop()
114 l2tp_session_put(pd->session); in l2tp_dfs_seq_stop()
115 pd->session = NULL; in l2tp_dfs_seq_stop()
117 if (pd->tunnel) { in l2tp_dfs_seq_stop()
118 l2tp_tunnel_put(pd->tunnel); in l2tp_dfs_seq_stop()
119 pd->tunnel = NULL; in l2tp_dfs_seq_stop()
232 struct l2tp_dfs_seq_data *pd = v; in l2tp_dfs_seq_show() local
250 if (!pd->session) in l2tp_dfs_seq_show()
251 l2tp_dfs_seq_tunnel_show(m, pd->tunnel); in l2tp_dfs_seq_show()
253 l2tp_dfs_seq_session_show(m, pd->session); in l2tp_dfs_seq_show()
268 struct l2tp_dfs_seq_data *pd; in l2tp_dfs_seq_open() local
272 pd = kzalloc(sizeof(*pd), GFP_KERNEL); in l2tp_dfs_seq_open()
273 if (!pd) in l2tp_dfs_seq_open()
279 pd->net = get_net_ns_by_pid(current->pid); in l2tp_dfs_seq_open()
280 if (IS_ERR(pd->net)) { in l2tp_dfs_seq_open()
281 rc = PTR_ERR(pd->net); in l2tp_dfs_seq_open()
284 netns_tracker_alloc(pd->net, &pd->ns_tracker, GFP_KERNEL); in l2tp_dfs_seq_open()
290 seq->private = pd; in l2tp_dfs_seq_open()
296 put_net_track(pd->net, &pd->ns_tracker); in l2tp_dfs_seq_open()
298 kfree(pd); in l2tp_dfs_seq_open()
304 struct l2tp_dfs_seq_data *pd; in l2tp_dfs_seq_release() local
308 pd = seq->private; in l2tp_dfs_seq_release()
309 if (pd->net) in l2tp_dfs_seq_release()
310 put_net_track(pd->net, &pd->ns_tracker); in l2tp_dfs_seq_release()
311 kfree(pd); in l2tp_dfs_seq_release()