Lines Matching full:socket

18 #include "socket.h"
35 * @peer: peer whose socket reference counter should be decreased
36 * @sock: the RCU protected peer socket
41 * Return: true if the socket was released, false otherwise
49 * ovpn_socket_release - release resources owned by socket user
50 * @peer: peer whose socket should be released
53 * and wants to drop its link to the socket.
58 * In case of TCP, releasing the socket will cause dropping
74 /* release may be invoked after socket was detached */ in ovpn_socket_release()
80 * detached socket. in ovpn_socket_release()
82 * Holding the lock ensures that a socket with refcnt 0 is fully in ovpn_socket_release()
116 struct socket *sock, in ovpn_socket_attach()
128 * ovpn_socket_new - create a new socket and initialize it
129 * @sock: the kernel socket to embed
130 * @peer: the peer reachable via this socket
132 * Return: an openvpn socket on success or a negative error code otherwise
134 struct ovpn_socket *ovpn_socket_new(struct socket *sock, struct ovpn_peer *peer) in ovpn_socket_new()
142 /* a TCP socket can only be owned by a single peer, therefore there in ovpn_socket_new()
150 /* a UDP socket can be shared across multiple peers, but we must make in ovpn_socket_new()
156 /* socket owned by other encapsulation module */ in ovpn_socket_new()
165 /* socket owned by another ovpn instance, we can't use it */ in ovpn_socket_new()
172 /* this socket is already owned by this instance, in ovpn_socket_new()
178 * the refcnt to 0 and detaching the socket in ovpn_socket_new()
192 /* socket is not owned: attach to this ovpn instance */ in ovpn_socket_new()
211 /* in UDP we only link the ovpn instance since the socket is in ovpn_socket_new()
223 * using the same socket. in ovpn_socket_new()