Lines Matching full:tunnel
38 int flags, struct l2tp_tunnel *tunnel, u8 cmd);
51 struct l2tp_tunnel *tunnel; in l2tp_nl_session_get() local
62 tunnel = l2tp_tunnel_get(net, tunnel_id); in l2tp_nl_session_get()
63 if (tunnel) { in l2tp_nl_session_get()
64 session = l2tp_session_get(net, tunnel->sock, tunnel->version, in l2tp_nl_session_get()
66 l2tp_tunnel_put(tunnel); in l2tp_nl_session_get()
105 struct l2tp_tunnel *tunnel, in l2tp_tunnel_notify() argument
116 NLM_F_ACK, tunnel, cmd); in l2tp_tunnel_notify()
193 struct l2tp_tunnel *tunnel; in l2tp_nl_cmd_tunnel_create() local
221 /* Managed tunnels take the tunnel socket from userspace. in l2tp_nl_cmd_tunnel_create()
223 * for the kernel to create the tunnel socket itself. in l2tp_nl_cmd_tunnel_create()
238 peer_tunnel_id, &cfg, &tunnel); in l2tp_nl_cmd_tunnel_create()
245 refcount_inc(&tunnel->ref_count); in l2tp_nl_cmd_tunnel_create()
246 ret = l2tp_tunnel_register(tunnel, net, &cfg); in l2tp_nl_cmd_tunnel_create()
248 kfree(tunnel); in l2tp_nl_cmd_tunnel_create()
251 ret = l2tp_tunnel_notify(&l2tp_nl_family, info, tunnel, in l2tp_nl_cmd_tunnel_create()
253 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_tunnel_create()
261 struct l2tp_tunnel *tunnel; in l2tp_nl_cmd_tunnel_delete() local
272 tunnel = l2tp_tunnel_get(net, tunnel_id); in l2tp_nl_cmd_tunnel_delete()
273 if (!tunnel) { in l2tp_nl_cmd_tunnel_delete()
279 tunnel, L2TP_CMD_TUNNEL_DELETE); in l2tp_nl_cmd_tunnel_delete()
281 l2tp_tunnel_delete(tunnel); in l2tp_nl_cmd_tunnel_delete()
283 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_tunnel_delete()
291 struct l2tp_tunnel *tunnel; in l2tp_nl_cmd_tunnel_modify() local
302 tunnel = l2tp_tunnel_get(net, tunnel_id); in l2tp_nl_cmd_tunnel_modify()
303 if (!tunnel) { in l2tp_nl_cmd_tunnel_modify()
309 tunnel, L2TP_CMD_TUNNEL_MODIFY); in l2tp_nl_cmd_tunnel_modify()
311 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_tunnel_modify()
368 /* Append attributes for the tunnel address, handling the different attribute types
369 * used for different tunnel encapsulation and AF_INET v.s. AF_INET6.
371 static int l2tp_nl_tunnel_send_addr(struct sk_buff *skb, struct l2tp_tunnel *tunnel) in l2tp_nl_tunnel_send_addr() argument
373 struct sock *sk = tunnel->sock; in l2tp_nl_tunnel_send_addr()
380 return l2tp_nl_tunnel_send_addr6(skb, sk, tunnel->encap); in l2tp_nl_tunnel_send_addr()
382 return l2tp_nl_tunnel_send_addr4(skb, sk, tunnel->encap); in l2tp_nl_tunnel_send_addr()
386 struct l2tp_tunnel *tunnel, u8 cmd) in l2tp_nl_tunnel_send() argument
395 if (nla_put_u8(skb, L2TP_ATTR_PROTO_VERSION, tunnel->version) || in l2tp_nl_tunnel_send()
396 nla_put_u32(skb, L2TP_ATTR_CONN_ID, tunnel->tunnel_id) || in l2tp_nl_tunnel_send()
397 nla_put_u32(skb, L2TP_ATTR_PEER_CONN_ID, tunnel->peer_tunnel_id) || in l2tp_nl_tunnel_send()
399 nla_put_u16(skb, L2TP_ATTR_ENCAP_TYPE, tunnel->encap)) in l2tp_nl_tunnel_send()
407 atomic_long_read(&tunnel->stats.tx_packets), in l2tp_nl_tunnel_send()
410 atomic_long_read(&tunnel->stats.tx_bytes), in l2tp_nl_tunnel_send()
413 atomic_long_read(&tunnel->stats.tx_errors), in l2tp_nl_tunnel_send()
416 atomic_long_read(&tunnel->stats.rx_packets), in l2tp_nl_tunnel_send()
419 atomic_long_read(&tunnel->stats.rx_bytes), in l2tp_nl_tunnel_send()
422 atomic_long_read(&tunnel->stats.rx_seq_discards), in l2tp_nl_tunnel_send()
425 atomic_long_read(&tunnel->stats.rx_cookie_discards), in l2tp_nl_tunnel_send()
428 atomic_long_read(&tunnel->stats.rx_oos_packets), in l2tp_nl_tunnel_send()
431 atomic_long_read(&tunnel->stats.rx_errors), in l2tp_nl_tunnel_send()
434 atomic_long_read(&tunnel->stats.rx_invalid), in l2tp_nl_tunnel_send()
439 if (l2tp_nl_tunnel_send_addr(skb, tunnel)) in l2tp_nl_tunnel_send()
452 struct l2tp_tunnel *tunnel; in l2tp_nl_cmd_tunnel_get() local
471 tunnel = l2tp_tunnel_get(net, tunnel_id); in l2tp_nl_cmd_tunnel_get()
472 if (!tunnel) { in l2tp_nl_cmd_tunnel_get()
478 NLM_F_ACK, tunnel, L2TP_CMD_TUNNEL_GET); in l2tp_nl_cmd_tunnel_get()
482 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_tunnel_get()
487 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_tunnel_get()
503 struct l2tp_tunnel *tunnel; in l2tp_nl_cmd_tunnel_dump() local
507 tunnel = l2tp_tunnel_get_next(net, &key); in l2tp_nl_cmd_tunnel_dump()
508 if (!tunnel) in l2tp_nl_cmd_tunnel_dump()
513 tunnel, L2TP_CMD_TUNNEL_GET) < 0) { in l2tp_nl_cmd_tunnel_dump()
514 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_tunnel_dump()
517 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_tunnel_dump()
534 struct l2tp_tunnel *tunnel; in l2tp_nl_cmd_session_create() local
545 tunnel = l2tp_tunnel_get(net, tunnel_id); in l2tp_nl_cmd_session_create()
546 if (!tunnel) { in l2tp_nl_cmd_session_create()
574 if (tunnel->version == 2 && cfg.pw_type != L2TP_PWTYPE_PPP) { in l2tp_nl_cmd_session_create()
579 if (tunnel->version > 2) { in l2tp_nl_cmd_session_create()
639 ret = l2tp_nl_cmd_ops[cfg.pw_type]->session_create(net, tunnel, in l2tp_nl_cmd_session_create()
645 session = l2tp_session_get(net, tunnel->sock, tunnel->version, in l2tp_nl_cmd_session_create()
655 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_session_create()
701 struct l2tp_tunnel *tunnel = session->tunnel; in l2tp_nl_cmd_session_modify() local
704 l2tp_session_set_header_len(session, tunnel->version, tunnel->encap); in l2tp_nl_cmd_session_modify()
727 struct l2tp_tunnel *tunnel = session->tunnel; in l2tp_nl_session_send() local
733 if (nla_put_u32(skb, L2TP_ATTR_CONN_ID, tunnel->tunnel_id) || in l2tp_nl_session_send()
735 nla_put_u32(skb, L2TP_ATTR_PEER_CONN_ID, tunnel->peer_tunnel_id) || in l2tp_nl_session_send()
750 (l2tp_tunnel_uses_xfrm(tunnel) && in l2tp_nl_session_send()
844 struct l2tp_tunnel *tunnel = NULL; in l2tp_nl_cmd_session_dump() local
849 if (!tunnel) { in l2tp_nl_cmd_session_dump()
850 tunnel = l2tp_tunnel_get_next(net, &tkey); in l2tp_nl_cmd_session_dump()
851 if (!tunnel) in l2tp_nl_cmd_session_dump()
855 session = l2tp_session_get_next(net, tunnel->sock, tunnel->version, in l2tp_nl_cmd_session_dump()
856 tunnel->tunnel_id, &skey); in l2tp_nl_cmd_session_dump()
859 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_session_dump()
860 tunnel = NULL; in l2tp_nl_cmd_session_dump()
869 l2tp_tunnel_put(tunnel); in l2tp_nl_cmd_session_dump()