Lines Matching +full:server +full:- +full:side
1 .. SPDX-License-Identifier: GPL-2.0
7 The RxRPC protocol driver provides a reliable two-phase transport on top of UDP
28 (#) Example server usage.
38 RxRPC is a two-layer protocol. There is a session layer which provides
44 +-------------+
46 +-------------+
48 +-------------+
50 +-------------+
52 +-------------+
60 (2) A two-phase protocol. The client transmits a blob (the request) and then
61 receives a blob (the reply), and the server receives the request and then
68 manage security on the client end. The server end must of necessity be
82 to use - currently only PF_INET is supported.
106 (#) Client-originating packets are marked, thus a transport endpoint can be
107 shared between client and server connections (connections have a
126 (#) Calls are two-phase and asymmetric: the client sends its request data,
137 (#) Security is negotiated on a per-connection basis. The connection is
139 requested, the server then issues a "challenge" and then the client
142 upon it use that same security. In the event that the server lets a
149 (#) There are two types of positive acknowledgment: hard-ACKs and soft-ACKs.
150 A hard-ACK indicates to the far side that all the data received to a point
151 has been received and processed; a soft-ACK indicates that the data has
152 been received but may yet be discarded and re-requested. The sender may
153 not discard any transmittable packets until they've been hard-ACK'd.
155 (#) Reception of a reply data packet implicitly hard-ACK's all the data
159 received and the final hard-ACK on the last packet of the reply has
160 reached the server.
175 make multiple simultaneous calls to the same service. One server socket
189 (#) A client-side connection is only shared between calls if they have
191 would otherwise share the connection). Non-secured calls would also be
194 (#) A server-side connection is shared if the client says it is.
199 (#) SO_KEEPALIVE automatically pings the other side to keep the connection
208 (#) A socket is made into a server socket by binding an address with a
209 non-zero service ID.
225 (#) A server socket may also be used to make client calls. To do this, the
226 first sendmsg() of the call must specify the target address. The server's
234 (#) In the server, a request is received with one or more recvmsgs, then the
266 message to server application to let it know there's a new call awaiting
267 its acceptance [recvmsg reports a special control message]. The server
271 (#) The server application has to provide the server socket with a keyring of
301 (b) it meets a non-data message,
331 RXRPC_USER_CALL_ID sr- User ID App's call specifier
333 RXRPC_ACK -rt n/a Final ACK received
334 RXRPC_NET_ERROR -rt error num Network error on call
335 RXRPC_BUSY -rt n/a Call rejected (server busy)
336 RXRPC_LOCAL_ERROR -rt error num Local error encountered
337 RXRPC_NEW_CALL -r- n/a New call received
338 RXRPC_ACCEPT s-- n/a Accept new call
339 RXRPC_EXCLUSIVE_CALL s-- n/a Make an exclusive client call
340 RXRPC_UPGRADE_SERVICE s-- n/a Client call can be upgraded
341 RXRPC_TX_LENGTH s-- data len Total length of Tx data
350 message or in the server by passing it in association with an RXRPC_ACCEPT
364 This is delivered to a server application to indicate that the final ACK
372 errno-class integer value will be included in the control message data
379 rejected by the server due to the server being busy. It will be
386 errno-class integer value will be included in the control message data
392 This is delivered to indicate to a server application that a new call has
398 This is used by a server application to attempt to accept a call and
407 This is used to indicate that a client call should be made on a one-off
413 may be upgraded by the server. The caller must check msg_name returned to
418 thereof) of the server, the service ID returned should be used for all
419 future communication to that server and RXRPC_UPGRADE_SERVICE should no
457 Similar to above but specifies a keyring of server secret keys to use (key
478 encrypted - which includes the actual packet length.
494 This is a read-only option that writes an int into the buffer indicating
503 (security index 2 - rxkad). This requires the rxkad module to be loaded and,
505 kaserver or the kerberos server and installed as "rxrpc" type keys. This is
527 For the server, keys of type "rxrpc_s" must be made available to the server.
530 given the server's secret key as the instantiation data (see the example
535 A keyring is passed to the server socket by naming it in a sockopt. The server
536 socket then looks the server secret keys up in this keyring when secure
554 socket used - usually IPv4 but it can also be IPv6 [TODO].
569 non-privileged port will be used. A UDP port may be shared between
571 per-RxRPC virtual connection.
585 (4) The server to be contacted can then be specified (alternatively this can
598 (5) The request data should then be posted to the server socket using a series
615 (6) The reply data will then be posted to the server socket for recvmsg() to
622 RXRPC_USER_CALL_ID - specifies the user ID for this call
633 the service - otherwise it will be altered to indicate the service ID the
634 server upgraded to. Note that the upgraded service ID is chosen by the server.
640 Example Server Usage
643 A server would be set up to accept operations in the following manner:
647 server = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);
650 socket used - usually IPv4.
652 (2) Security is set up if desired by giving the socket a keyring with server
662 setsockopt(server, SOL_RXRPC, RXRPC_SECURITY_KEYRING, "AFSkeys", 7);
665 permits the server to add more keys, replace keys, etc. while it is live.
677 bind(server, &srx, sizeof(srx));
687 setsockopt(server, SOL_RXRPC, RXRPC_UPGRADEABLE_SERVICE,
694 (5) The server is then set to listen out for incoming calls::
696 listen(server, 100);
698 (6) The kernel notifies the server of pending incoming connections by sending
699 it a message for each. This is received with recvmsg() on the server
707 the time it is accepted - in which case the first call still on the queue
710 (7) The server then accepts the new call by issuing a sendmsg() with two
718 (8) The first request data packet will then be posted to the server socket for
722 Subsequent request data will be posted to the server socket for recvmsg()
733 (9) The reply data should then be posted to the server socket using a series
768 the one server socket, using control messages on sendmsg() and recvmsg() to
775 The AF_RXRPC module also provides an interface for use by in-kernel utilities
795 bind an address as appropriate and listen if it's to be a server socket, but
818 non-NULL).
829 with this call (or -1 if unknown at this point). Setting the data size
831 saving a copy. The value may not be less than -1.
837 the server upgrade the service to a better one. The resultant service ID
842 allocated; if it is set, the function may return -ERESTARTSYS.
880 reply part of a server call. msg.msg_iovlen and msg.msg_iov specify the
882 exclusively to in-kernel virtual addresses. msg.msg_flags may be given
915 emptied and want_more was false; and -EAGAIN if the function needs to be
958 The skb->mark field indicates the type of message:
965 RXRPC_SKB_MARK_BUSY Client call rejected as server busy
1005 a BUSY message. -ENODATA is returned if there were no incoming calls.
1006 Other errors may be returned if the call had been aborted (-ECONNABORTED)
1007 or had timed out (-ETIME).
1052 on the server). The caller should compare the numbers of two calls to see
1056 This allows the caller to work out if the server is still contactable and
1057 if the call is still alive on the server while waiting for the server to
1087 aborted and -ETIME or -ETIMEDOUT will be returned.
1108 request-ack flag set before we honour the flag and actually send the
1111 Usually the other side won't stop sending packets until the advertised
1118 generate a soft-ACK to tell the sender that it doesn't need to resend.
1123 received queue have been consumed before we generate a hard-ACK to tell
1171 packet. Non-terminal packets in a jumbo packet must contain a four byte