sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget$/translations/zh_CN/networking/rxrpcmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/zh_TW/networking/rxrpcmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/it_IT/networking/rxrpcmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ja_JP/networking/rxrpcmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ko_KR/networking/rxrpcmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/sp_SP/networking/rxrpcmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh>/var/lib/git/docbuild/linux/Documentation/networking/rxrpc.rsthKubhsection)}(hhh](htitle)}(hRxRPC Network Protocolh]hRxRPC Network Protocol}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXThe RxRPC protocol driver provides a reliable two-phase transport on top of UDP that can be used to perform RxRPC remote operations. This is done over sockets of AF_RXRPC family, using sendmsg() and recvmsg() with control data to send and receive data, aborts and errors.h]hXThe RxRPC protocol driver provides a reliable two-phase transport on top of UDP that can be used to perform RxRPC remote operations. This is done over sockets of AF_RXRPC family, using sendmsg() and recvmsg() with control data to send and receive data, aborts and errors.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hContents of this document:h]hContents of this document:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh block_quote)}(h(#) Overview. (#) RxRPC protocol summary. (#) AF_RXRPC driver model. (#) Control messages. (#) Socket options. (#) Security. (#) Example client usage. (#) Example server usage. (#) AF_RXRPC kernel interface. (#) Configurable parameters. h]henumerated_list)}(hhh](h list_item)}(h Overview. h]h)}(h Overview.h]h Overview.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hRxRPC protocol summary. h]h)}(hRxRPC protocol summary.h]hRxRPC protocol summary.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hAF_RXRPC driver model. h]h)}(hAF_RXRPC driver model.h]hAF_RXRPC driver model.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj$ubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hControl messages. h]h)}(hControl messages.h]hControl messages.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj<ubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hSocket options. h]h)}(hSocket options.h]hSocket options.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjTubah}(h]h ]h"]h$]h&]uh1hhhubh)}(h Security. h]h)}(h Security.h]h Security.}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjlubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hExample client usage. h]h)}(hExample client usage.h]hExample client usage.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hExample server usage. h]h)}(hExample server usage.h]hExample server usage.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hAF_RXRPC kernel interface. h]h)}(hAF_RXRPC kernel interface.h]hAF_RXRPC kernel interface.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hConfigurable parameters. h]h)}(hConfigurable parameters.h]hConfigurable parameters.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]enumtypearabicprefix(suffix)uh1hhhubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hOverviewh]hOverview}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK$ubh)}(hX?RxRPC is a two-layer protocol. There is a session layer which provides reliable virtual connections using UDP over IPv4 (or IPv6) as the transport layer, but implements a real network protocol; and there's the presentation layer which renders structured data to binary blobs and back again using XDR (as does SunRPC)::h]hX@RxRPC is a two-layer protocol. There is a session layer which provides reliable virtual connections using UDP over IPv4 (or IPv6) as the transport layer, but implements a real network protocol; and there’s the presentation layer which renders structured data to binary blobs and back again using XDR (as does SunRPC):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjhhubh literal_block)}(h+-------------+ | Application | +-------------+ | XDR | Presentation +-------------+ | RxRPC | Session +-------------+ | UDP | Transport +-------------+h]h+-------------+ | Application | +-------------+ | XDR | Presentation +-------------+ | RxRPC | Session +-------------+ | UDP | Transport +-------------+}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhK,hjhhubh)}(hAF_RXRPC provides:h]hAF_RXRPC provides:}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hjhhubh)}(hX|(1) Part of an RxRPC facility for both kernel and userspace applications by making the session part of it a Linux network protocol (AF_RXRPC). (2) A two-phase protocol. The client transmits a blob (the request) and then receives a blob (the reply), and the server receives the request and then transmits the reply. (3) Retention of the reusable bits of the transport system set up for one call to speed up subsequent calls. (4) A secure protocol, using the Linux kernel's key retention facility to manage security on the client end. The server end must of necessity be more active in security negotiations. h]h)}(hhh](h)}(hPart of an RxRPC facility for both kernel and userspace applications by making the session part of it a Linux network protocol (AF_RXRPC). h]h)}(hPart of an RxRPC facility for both kernel and userspace applications by making the session part of it a Linux network protocol (AF_RXRPC).h]hPart of an RxRPC facility for both kernel and userspace applications by making the session part of it a Linux network protocol (AF_RXRPC).}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hj:ubah}(h]h ]h"]h$]h&]uh1hhj7ubh)}(hA two-phase protocol. The client transmits a blob (the request) and then receives a blob (the reply), and the server receives the request and then transmits the reply. h]h)}(hA two-phase protocol. The client transmits a blob (the request) and then receives a blob (the reply), and the server receives the request and then transmits the reply.h]hA two-phase protocol. The client transmits a blob (the request) and then receives a blob (the reply), and the server receives the request and then transmits the reply.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKubh)}(hRxRPC supports multiple virtual "connections" from any given transport endpoint, thus allowing the endpoints to be shared, even to the same remote endpoint. h]h)}(hRxRPC supports multiple virtual "connections" from any given transport endpoint, thus allowing the endpoints to be shared, even to the same remote endpoint.h]hRxRPC supports multiple virtual “connections” from any given transport endpoint, thus allowing the endpoints to be shared, even to the same remote endpoint.}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjYubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hEach connection goes to a particular "service". A connection may not go to multiple services. A service may be considered the RxRPC equivalent of a port number. AF_RXRPC permits multiple services to share an endpoint. h]h)}(hEach connection goes to a particular "service". A connection may not go to multiple services. A service may be considered the RxRPC equivalent of a port number. AF_RXRPC permits multiple services to share an endpoint.h]hEach connection goes to a particular “service”. A connection may not go to multiple services. A service may be considered the RxRPC equivalent of a port number. AF_RXRPC permits multiple services to share an endpoint.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjqubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hClient-originating packets are marked, thus a transport endpoint can be shared between client and server connections (connections have a direction). h]h)}(hClient-originating packets are marked, thus a transport endpoint can be shared between client and server connections (connections have a direction).h]hClient-originating packets are marked, thus a transport endpoint can be shared between client and server connections (connections have a direction).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hXUUp to a billion connections may be supported concurrently between one local transport endpoint and one service on one remote endpoint. An RxRPC connection is described by seven numbers:: Local address } Local port } Transport (UDP) address Remote address } Remote port } Direction Connection ID Service ID h](h)}(hUp to a billion connections may be supported concurrently between one local transport endpoint and one service on one remote endpoint. An RxRPC connection is described by seven numbers::h]hUp to a billion connections may be supported concurrently between one local transport endpoint and one service on one remote endpoint. An RxRPC connection is described by seven numbers:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjubj)}(hLocal address } Local port } Transport (UDP) address Remote address } Remote port } Direction Connection ID Service IDh]hLocal address } Local port } Transport (UDP) address Remote address } Remote port } Direction Connection ID Service ID}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKrhjubeh}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hEach RxRPC operation is a "call". A connection may make up to four billion calls, but only up to four calls may be in progress on a connection at any one time. h]h)}(hEach RxRPC operation is a "call". A connection may make up to four billion calls, but only up to four calls may be in progress on a connection at any one time.h]hEach RxRPC operation is a “call”. A connection may make up to four billion calls, but only up to four calls may be in progress on a connection at any one time.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhjubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hCalls are two-phase and asymmetric: the client sends its request data, which the service receives; then the service transmits the reply data which the client receives. h]h)}(hCalls are two-phase and asymmetric: the client sends its request data, which the service receives; then the service transmits the reply data which the client receives.h]hCalls are two-phase and asymmetric: the client sends its request data, which the service receives; then the service transmits the reply data which the client receives.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hThe data blobs are of indefinite size, the end of a phase is marked with a flag in the packet. The number of packets of data making up one blob may not exceed 4 billion, however, as this would cause the sequence number to wrap. h]h)}(hThe data blobs are of indefinite size, the end of a phase is marked with a flag in the packet. The number of packets of data making up one blob may not exceed 4 billion, however, as this would cause the sequence number to wrap.h]hThe data blobs are of indefinite size, the end of a phase is marked with a flag in the packet. The number of packets of data making up one blob may not exceed 4 billion, however, as this would cause the sequence number to wrap.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hGThe first four bytes of the request data are the service operation ID. h]h)}(hFThe first four bytes of the request data are the service operation ID.h]hFThe first four bytes of the request data are the service operation ID.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hXSecurity is negotiated on a per-connection basis. The connection is initiated by the first data packet on it arriving. If security is requested, the server then issues a "challenge" and then the client replies with a "response". If the response is successful, the security is set for the lifetime of that connection, and all subsequent calls made upon it use that same security. In the event that the server lets a connection lapse before the client, the security will be renegotiated if the client uses the connection again. h]h)}(hXSecurity is negotiated on a per-connection basis. The connection is initiated by the first data packet on it arriving. If security is requested, the server then issues a "challenge" and then the client replies with a "response". If the response is successful, the security is set for the lifetime of that connection, and all subsequent calls made upon it use that same security. In the event that the server lets a connection lapse before the client, the security will be renegotiated if the client uses the connection again.h]hXSecurity is negotiated on a per-connection basis. The connection is initiated by the first data packet on it arriving. If security is requested, the server then issues a “challenge” and then the client replies with a “response”. If the response is successful, the security is set for the lifetime of that connection, and all subsequent calls made upon it use that same security. In the event that the server lets a connection lapse before the client, the security will be renegotiated if the client uses the connection again.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj'ubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hcCalls use ACK packets to handle reliability. Data packets are also explicitly sequenced per call. h]h)}(hbCalls use ACK packets to handle reliability. Data packets are also explicitly sequenced per call.h]hbCalls use ACK packets to handle reliability. Data packets are also explicitly sequenced per call.}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj?ubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hXjThere are two types of positive acknowledgment: hard-ACKs and soft-ACKs. A hard-ACK indicates to the far side that all the data received to a point has been received and processed; a soft-ACK indicates that the data has been received but may yet be discarded and re-requested. The sender may not discard any transmittable packets until they've been hard-ACK'd. h]h)}(hXiThere are two types of positive acknowledgment: hard-ACKs and soft-ACKs. A hard-ACK indicates to the far side that all the data received to a point has been received and processed; a soft-ACK indicates that the data has been received but may yet be discarded and re-requested. The sender may not discard any transmittable packets until they've been hard-ACK'd.h]hXmThere are two types of positive acknowledgment: hard-ACKs and soft-ACKs. A hard-ACK indicates to the far side that all the data received to a point has been received and processed; a soft-ACK indicates that the data has been received but may yet be discarded and re-requested. The sender may not discard any transmittable packets until they’ve been hard-ACK’d.}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjWubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hfReception of a reply data packet implicitly hard-ACK's all the data packets that make up the request. h]h)}(heReception of a reply data packet implicitly hard-ACK's all the data packets that make up the request.h]hgReception of a reply data packet implicitly hard-ACK’s all the data packets that make up the request.}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjoubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hAn call is complete when the request has been sent, the reply has been received and the final hard-ACK on the last packet of the reply has reached the server. h]h)}(hAn call is complete when the request has been sent, the reply has been received and the final hard-ACK on the last packet of the reply has reached the server.h]hAn call is complete when the request has been sent, the reply has been received and the final hard-ACK on the last packet of the reply has reached the server.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj>ubh)}(hHAn call may be aborted by either end at any time up to its completion. h]h)}(hFAn call may be aborted by either end at any time up to its completion.h]hFAn call may be aborted by either end at any time up to its completion.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj>ubeh}(h]h ]h"]h$]h&]jjjjjjuh1hhj:ubah}(h]h ]h"]h$]h&]uh1hhhhK^hjhhubeh}(h]rxrpc-protocol-summaryah ]h"]rxrpc protocol summaryah$]h&]uh1hhhhhhhhKZubh)}(hhh](h)}(hAF_RXRPC Driver Modelh]hAF_RXRPC Driver Model}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hAbout the AF_RXRPC driver:h]hAbout the AF_RXRPC driver:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX(#) The AF_RXRPC protocol transparently uses internal sockets of the transport protocol to represent transport endpoints. (#) AF_RXRPC sockets map onto RxRPC connection bundles. Actual RxRPC connections are handled transparently. One client socket may be used to make multiple simultaneous calls to the same service. One server socket may handle calls from many clients. (#) Additional parallel client connections will be initiated to support extra concurrent calls, up to a tunable limit. (#) Each connection is retained for a certain amount of time [tunable] after the last call currently using it has completed in case a new call is made that could reuse it. (#) Each internal UDP socket is retained [tunable] for a certain amount of time [tunable] after the last connection using it discarded, in case a new connection is made that could use it. (#) A client-side connection is only shared between calls if they have the same key struct describing their security (and assuming the calls would otherwise share the connection). Non-secured calls would also be able to share connections with each other. (#) A server-side connection is shared if the client says it is. (#) ACK'ing is handled by the protocol driver automatically, including ping replying. (#) SO_KEEPALIVE automatically pings the other side to keep the connection alive [TODO]. (#) If an ICMP error is received, all calls affected by that error will be aborted with an appropriate network error passed through recvmsg(). h]h)}(hhh](h)}(hvThe AF_RXRPC protocol transparently uses internal sockets of the transport protocol to represent transport endpoints. h]h)}(huThe AF_RXRPC protocol transparently uses internal sockets of the transport protocol to represent transport endpoints.h]huThe AF_RXRPC protocol transparently uses internal sockets of the transport protocol to represent transport endpoints.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hAF_RXRPC sockets map onto RxRPC connection bundles. Actual RxRPC connections are handled transparently. One client socket may be used to make multiple simultaneous calls to the same service. One server socket may handle calls from many clients. h]h)}(hAF_RXRPC sockets map onto RxRPC connection bundles. Actual RxRPC connections are handled transparently. One client socket may be used to make multiple simultaneous calls to the same service. One server socket may handle calls from many clients.h]hAF_RXRPC sockets map onto RxRPC connection bundles. Actual RxRPC connections are handled transparently. One client socket may be used to make multiple simultaneous calls to the same service. One server socket may handle calls from many clients.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hsAdditional parallel client connections will be initiated to support extra concurrent calls, up to a tunable limit. h]h)}(hrAdditional parallel client connections will be initiated to support extra concurrent calls, up to a tunable limit.h]hrAdditional parallel client connections will be initiated to support extra concurrent calls, up to a tunable limit.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj!ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hEach connection is retained for a certain amount of time [tunable] after the last call currently using it has completed in case a new call is made that could reuse it. h]h)}(hEach connection is retained for a certain amount of time [tunable] after the last call currently using it has completed in case a new call is made that could reuse it.h]hEach connection is retained for a certain amount of time [tunable] after the last call currently using it has completed in case a new call is made that could reuse it.}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj9ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hEach internal UDP socket is retained [tunable] for a certain amount of time [tunable] after the last connection using it discarded, in case a new connection is made that could use it. h]h)}(hEach internal UDP socket is retained [tunable] for a certain amount of time [tunable] after the last connection using it discarded, in case a new connection is made that could use it.h]hEach internal UDP socket is retained [tunable] for a certain amount of time [tunable] after the last connection using it discarded, in case a new connection is made that could use it.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjQubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hA client-side connection is only shared between calls if they have the same key struct describing their security (and assuming the calls would otherwise share the connection). Non-secured calls would also be able to share connections with each other. h]h)}(hA client-side connection is only shared between calls if they have the same key struct describing their security (and assuming the calls would otherwise share the connection). Non-secured calls would also be able to share connections with each other.h]hA client-side connection is only shared between calls if they have the same key struct describing their security (and assuming the calls would otherwise share the connection). Non-secured calls would also be able to share connections with each other.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjiubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h=A server-side connection is shared if the client says it is. h]h)}(hhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj:ubh)}(hhh](h)}(h*The tag of the intended or affected call. h]h)}(h)The tag of the intended or affected call.h]h)The tag of the intended or affected call.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjOubah}(h]h ]h"]h$]h&]uh1hhjLubh)}(hRXRPC_SECURITY_KEY This is used to specify the description of the key to be used. The key is extracted from the calling process's keyrings with request_key() and should be of "rxrpc" type. The optval pointer points to the description string, and optlen indicates how long the string is, without the NUL terminator. h](h)}(hRXRPC_SECURITY_KEYh]hRXRPC_SECURITY_KEY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThis is used to specify the description of the key to be used. The key is extracted from the calling process's keyrings with request_key() and should be of "rxrpc" type.h]hThis is used to specify the description of the key to be used. The key is extracted from the calling process’s keyrings with request_key() and should be of “rxrpc” type.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(h}The optval pointer points to the description string, and optlen indicates how long the string is, without the NUL terminator.h]h}The optval pointer points to the description string, and optlen indicates how long the string is, without the NUL terminator.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hRXRPC_SECURITY_KEYRING Similar to above but specifies a keyring of server secret keys to use (key type "keyring"). See the "Security" section. h](h)}(hRXRPC_SECURITY_KEYRINGh]hRXRPC_SECURITY_KEYRING}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hxSimilar to above but specifies a keyring of server secret keys to use (key type "keyring"). See the "Security" section.h]hSimilar to above but specifies a keyring of server secret keys to use (key type “keyring”). See the “Security” section.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hRXRPC_EXCLUSIVE_CONNECTION This is used to request that new connections should be used for each call made subsequently on this socket. optval should be NULL and optlen 0. h](h)}(hRXRPC_EXCLUSIVE_CONNECTIONh]hRXRPC_EXCLUSIVE_CONNECTION}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThis is used to request that new connections should be used for each call made subsequently on this socket. optval should be NULL and optlen 0.h]hThis is used to request that new connections should be used for each call made subsequently on this socket. optval should be NULL and optlen 0.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hX RXRPC_MIN_SECURITY_LEVEL This is used to specify the minimum security level required for calls on this socket. optval must point to an int containing one of the following values: (a) RXRPC_SECURITY_PLAIN Encrypted checksum only. (b) RXRPC_SECURITY_AUTH Encrypted checksum plus packet padded and first eight bytes of packet encrypted - which includes the actual packet length. (c) RXRPC_SECURITY_ENCRYPT Encrypted checksum plus entire packet padded and encrypted, including actual packet length. h](h)}(hRXRPC_MIN_SECURITY_LEVELh]hRXRPC_MIN_SECURITY_LEVEL}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjDubh)}(hThis is used to specify the minimum security level required for calls on this socket. optval must point to an int containing one of the following values:h]hThis is used to specify the minimum security level required for calls on this socket. optval must point to an int containing one of the following values:}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjDubh)}(hhh](h)}(h/RXRPC_SECURITY_PLAIN Encrypted checksum only. h](h)}(hRXRPC_SECURITY_PLAINh]hRXRPC_SECURITY_PLAIN}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjgubh)}(hEncrypted checksum only.h]hEncrypted checksum only.}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjgubeh}(h]h ]h"]h$]h&]uh1hhjdubh)}(hRXRPC_SECURITY_AUTH Encrypted checksum plus packet padded and first eight bytes of packet encrypted - which includes the actual packet length. h](h)}(hRXRPC_SECURITY_AUTHh]hRXRPC_SECURITY_AUTH}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hzEncrypted checksum plus packet padded and first eight bytes of packet encrypted - which includes the actual packet length.h]hzEncrypted checksum plus packet padded and first eight bytes of packet encrypted - which includes the actual packet length.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjdubh)}(htRXRPC_SECURITY_ENCRYPT Encrypted checksum plus entire packet padded and encrypted, including actual packet length. h](h)}(hRXRPC_SECURITY_ENCRYPTh]hRXRPC_SECURITY_ENCRYPT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(h[Encrypted checksum plus entire packet padded and encrypted, including actual packet length.h]h[Encrypted checksum plus entire packet padded and encrypted, including actual packet length.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjdubeh}(h]h ]h"]h$]h&]jjjjjjuh1hhjDubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hX8RXRPC_UPGRADEABLE_SERVICE This is used to indicate that a service socket with two bindings may upgrade one bound service to the other if requested by the client. optval must point to an array of two unsigned short ints. The first is the service ID to upgrade from and the second the service ID to upgrade to. h](h)}(hRXRPC_UPGRADEABLE_SERVICEh]hRXRPC_UPGRADEABLE_SERVICE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hXThis is used to indicate that a service socket with two bindings may upgrade one bound service to the other if requested by the client. optval must point to an array of two unsigned short ints. The first is the service ID to upgrade from and the second the service ID to upgrade to.h]hXThis is used to indicate that a service socket with two bindings may upgrade one bound service to the other if requested by the client. optval must point to an array of two unsigned short ints. The first is the service ID to upgrade from and the second the service ID to upgrade to.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hRXRPC_SUPPORTED_CMSG This is a read-only option that writes an int into the buffer indicating the highest control message type supported. h](h)}(hRXRPC_SUPPORTED_CMSGh]hRXRPC_SUPPORTED_CMSG}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubh)}(htThis is a read-only option that writes an int into the buffer indicating the highest control message type supported.h]htThis is a read-only option that writes an int into the buffer indicating the highest control message type supported.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjjjjjuh1hhjubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]socket-optionsah ]h"]socket optionsah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hSECURITYh]hSECURITY}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjEhhhhhMubh)}(hXCurrently, only the kerberos 4 equivalent protocol has been implemented (security index 2 - rxkad). This requires the rxkad module to be loaded and, on the client, tickets of the appropriate type to be obtained from the AFS kaserver or the kerberos server and installed as "rxrpc" type keys. This is normally done using the klog program. An example simple klog program can be found at:h]hXCurrently, only the kerberos 4 equivalent protocol has been implemented (security index 2 - rxkad). This requires the rxkad module to be loaded and, on the client, tickets of the appropriate type to be obtained from the AFS kaserver or the kerberos server and installed as “rxrpc” type keys. This is normally done using the klog program. An example simple klog program can be found at:}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjEhhubh)}(h0http://people.redhat.com/~dhowells/rxrpc/klog.c h]h)}(h/http://people.redhat.com/~dhowells/rxrpc/klog.ch]h reference)}(hjjh]h/http://people.redhat.com/~dhowells/rxrpc/klog.c}(hjnhhhNhNubah}(h]h ]h"]h$]h&]refurijjuh1jlhjhubah}(h]h ]h"]h$]h&]uh1hhhhMhjdubah}(h]h ]h"]h$]h&]uh1hhhhMhjEhhubh)}(hQThe payload provided to add_key() on the client should be of the following form::h]hPThe payload provided to add_key() on the client should be of the following form:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjEhhubj)}(hXstruct rxrpc_key_sec2_v1 { uint16_t security_index; /* 2 */ uint16_t ticket_length; /* length of ticket[] */ uint32_t expiry; /* time at which expires */ uint8_t kvno; /* key version number */ uint8_t __pad[3]; uint8_t session_key[8]; /* DES session key */ uint8_t ticket[0]; /* the encrypted ticket */ };h]hXstruct rxrpc_key_sec2_v1 { uint16_t security_index; /* 2 */ uint16_t ticket_length; /* length of ticket[] */ uint32_t expiry; /* time at which expires */ uint8_t kvno; /* key version number */ uint8_t __pad[3]; uint8_t session_key[8]; /* DES session key */ uint8_t ticket[0]; /* the encrypted ticket */ };}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjEhhubh)}(h>Where the ticket blob is just appended to the above structure.h]h>Where the ticket blob is just appended to the above structure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjEhhubh)}(hX6For the server, keys of type "rxrpc_s" must be made available to the server. They have a description of ":" (eg: "52:2" for an rxkad key for the AFS VL service). When such a key is created, it should be given the server's secret key as the instantiation data (see the example below).h]hXDFor the server, keys of type “rxrpc_s” must be made available to the server. They have a description of “:” (eg: “52:2” for an rxkad key for the AFS VL service). When such a key is created, it should be given the server’s secret key as the instantiation data (see the example below).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjEhhubh)}(h4add_key("rxrpc_s", "52:2", secret_key, 8, keyring); h]h)}(h3add_key("rxrpc_s", "52:2", secret_key, 8, keyring);h]h;add_key(“rxrpc_s”, “52:2”, secret_key, 8, keyring);}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhhhMhjEhhubh)}(hA keyring is passed to the server socket by naming it in a sockopt. The server socket then looks the server secret keys up in this keyring when secure incoming connections are made. This can be seen in an example program that can be found at:h]hA keyring is passed to the server socket by naming it in a sockopt. The server socket then looks the server secret keys up in this keyring when secure incoming connections are made. This can be seen in an example program that can be found at:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjEhhubh)}(h3http://people.redhat.com/~dhowells/rxrpc/listen.c h]h)}(h1http://people.redhat.com/~dhowells/rxrpc/listen.ch]jm)}(hjh]h1http://people.redhat.com/~dhowells/rxrpc/listen.c}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jlhjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhhhMhjEhhubeh}(h]securityah ]h"]securityah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hEXAMPLE CLIENT USAGEh]hEXAMPLE CLIENT USAGE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM!ubh)}(h%A client would issue an operation by:h]h%A client would issue an operation by:}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hjhhubh)}(hX (1) An RxRPC socket is set up by:: client = socket(AF_RXRPC, SOCK_DGRAM, PF_INET); Where the third parameter indicates the protocol family of the transport socket used - usually IPv4 but it can also be IPv6 [TODO]. (2) A local address can optionally be bound:: struct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = 0, /* we're a client */ .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7000), /* AFS callback */ .transport.sin_address = 0, /* all local interfaces */ }; bind(client, &srx, sizeof(srx)); This specifies the local UDP port to be used. If not given, a random non-privileged port will be used. A UDP port may be shared between several unrelated RxRPC sockets. Security is handled on a basis of per-RxRPC virtual connection. (3) The security is set:: const char *key = "AFS:cambridge.redhat.com"; setsockopt(client, SOL_RXRPC, RXRPC_SECURITY_KEY, key, strlen(key)); This issues a request_key() to get the key representing the security context. The minimum security level can be set:: unsigned int sec = RXRPC_SECURITY_ENCRYPT; setsockopt(client, SOL_RXRPC, RXRPC_MIN_SECURITY_LEVEL, &sec, sizeof(sec)); (4) The server to be contacted can then be specified (alternatively this can be done through sendmsg):: struct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = VL_SERVICE_ID, .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7005), /* AFS volume manager */ .transport.sin_address = ..., }; connect(client, &srx, sizeof(srx)); (5) The request data should then be posted to the server socket using a series of sendmsg() calls, each with the following control message attached: ================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call ================== =================================== MSG_MORE should be set in msghdr::msg_flags on all but the last part of the request. Multiple requests may be made simultaneously. An RXRPC_TX_LENGTH control message can also be specified on the first sendmsg() call. If a call is intended to go to a destination other than the default specified through connect(), then msghdr::msg_name should be set on the first request message of that call. (6) The reply data will then be posted to the server socket for recvmsg() to pick up. MSG_MORE will be flagged by recvmsg() if there's more reply data for a particular call to be read. MSG_EOR will be set on the terminal read for a call. All data will be delivered with the following control message attached: RXRPC_USER_CALL_ID - specifies the user ID for this call If an abort or error occurred, this will be returned in the control data buffer instead, and MSG_EOR will be flagged to indicate the end of that call. h]h)}(hhh](h)}(hAn RxRPC socket is set up by:: client = socket(AF_RXRPC, SOCK_DGRAM, PF_INET); Where the third parameter indicates the protocol family of the transport socket used - usually IPv4 but it can also be IPv6 [TODO]. h](h)}(hAn RxRPC socket is set up by::h]hAn RxRPC socket is set up by:}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hj6ubj)}(h/client = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);h]h/client = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);}hjHsbah}(h]h ]h"]h$]h&]hhuh1jhhhM'hj6ubh)}(hWhere the third parameter indicates the protocol family of the transport socket used - usually IPv4 but it can also be IPv6 [TODO].h]hWhere the third parameter indicates the protocol family of the transport socket used - usually IPv4 but it can also be IPv6 [TODO].}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM)hj6ubeh}(h]h ]h"]h$]h&]uh1hhj3ubh)}(hXA local address can optionally be bound:: struct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = 0, /* we're a client */ .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7000), /* AFS callback */ .transport.sin_address = 0, /* all local interfaces */ }; bind(client, &srx, sizeof(srx)); This specifies the local UDP port to be used. If not given, a random non-privileged port will be used. A UDP port may be shared between several unrelated RxRPC sockets. Security is handled on a basis of per-RxRPC virtual connection. h](h)}(h)A local address can optionally be bound::h]h(A local address can optionally be bound:}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM,hjjubj)}(hXstruct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = 0, /* we're a client */ .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7000), /* AFS callback */ .transport.sin_address = 0, /* all local interfaces */ }; bind(client, &srx, sizeof(srx));h]hXstruct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = 0, /* we're a client */ .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7000), /* AFS callback */ .transport.sin_address = 0, /* all local interfaces */ }; bind(client, &srx, sizeof(srx));}hj|sbah}(h]h ]h"]h$]h&]hhuh1jhhhM.hjjubh)}(hThis specifies the local UDP port to be used. If not given, a random non-privileged port will be used. A UDP port may be shared between several unrelated RxRPC sockets. Security is handled on a basis of per-RxRPC virtual connection.h]hThis specifies the local UDP port to be used. If not given, a random non-privileged port will be used. A UDP port may be shared between several unrelated RxRPC sockets. Security is handled on a basis of per-RxRPC virtual connection.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM8hjjubeh}(h]h ]h"]h$]h&]uh1hhj3ubh)}(hXThe security is set:: const char *key = "AFS:cambridge.redhat.com"; setsockopt(client, SOL_RXRPC, RXRPC_SECURITY_KEY, key, strlen(key)); This issues a request_key() to get the key representing the security context. The minimum security level can be set:: unsigned int sec = RXRPC_SECURITY_ENCRYPT; setsockopt(client, SOL_RXRPC, RXRPC_MIN_SECURITY_LEVEL, &sec, sizeof(sec)); h](h)}(hThe security is set::h]hThe security is set:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM=hjubj)}(hrconst char *key = "AFS:cambridge.redhat.com"; setsockopt(client, SOL_RXRPC, RXRPC_SECURITY_KEY, key, strlen(key));h]hrconst char *key = "AFS:cambridge.redhat.com"; setsockopt(client, SOL_RXRPC, RXRPC_SECURITY_KEY, key, strlen(key));}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhM?hjubh)}(hvThis issues a request_key() to get the key representing the security context. The minimum security level can be set::h]huThis issues a request_key() to get the key representing the security context. The minimum security level can be set:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMBhjubj)}(hunsigned int sec = RXRPC_SECURITY_ENCRYPT; setsockopt(client, SOL_RXRPC, RXRPC_MIN_SECURITY_LEVEL, &sec, sizeof(sec));h]hunsigned int sec = RXRPC_SECURITY_ENCRYPT; setsockopt(client, SOL_RXRPC, RXRPC_MIN_SECURITY_LEVEL, &sec, sizeof(sec));}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMEhjubeh}(h]h ]h"]h$]h&]uh1hhj3ubh)}(hXThe server to be contacted can then be specified (alternatively this can be done through sendmsg):: struct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = VL_SERVICE_ID, .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7005), /* AFS volume manager */ .transport.sin_address = ..., }; connect(client, &srx, sizeof(srx)); h](h)}(hcThe server to be contacted can then be specified (alternatively this can be done through sendmsg)::h]hbThe server to be contacted can then be specified (alternatively this can be done through sendmsg):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMIhjubj)}(hXrstruct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = VL_SERVICE_ID, .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7005), /* AFS volume manager */ .transport.sin_address = ..., }; connect(client, &srx, sizeof(srx));h]hXrstruct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = VL_SERVICE_ID, .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7005), /* AFS volume manager */ .transport.sin_address = ..., }; connect(client, &srx, sizeof(srx));}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMLhjubeh}(h]h ]h"]h$]h&]uh1hhj3ubh)}(hXThe request data should then be posted to the server socket using a series of sendmsg() calls, each with the following control message attached: ================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call ================== =================================== MSG_MORE should be set in msghdr::msg_flags on all but the last part of the request. Multiple requests may be made simultaneously. An RXRPC_TX_LENGTH control message can also be specified on the first sendmsg() call. If a call is intended to go to a destination other than the default specified through connect(), then msghdr::msg_name should be set on the first request message of that call. h](h)}(hThe request data should then be posted to the server socket using a series of sendmsg() calls, each with the following control message attached:h]hThe request data should then be posted to the server socket using a series of sendmsg() calls, each with the following control message attached:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMVhjubh)}(h================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call ================== =================================== h]j )}(hhh]j )}(hhh](j )}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j hjubj )}(hhh]h}(h]h ]h"]h$]h&]colwidthK#uh1j hjubj1 )}(hhh]j )}(hhh](j )}(hhh]h)}(hRXRPC_USER_CALL_IDh]hRXRPC_USER_CALL_ID}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhj<ubah}(h]h ]h"]h$]h&]uh1j hj9ubj )}(hhh]h)}(h#specifies the user ID for this callh]h#specifies the user ID for this call}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhjSubah}(h]h ]h"]h$]h&]uh1j hj9ubeh}(h]h ]h"]h$]h&]uh1j hj6ubah}(h]h ]h"]h$]h&]uh1j0 hjubeh}(h]h ]h"]h$]h&]colsKuh1j hjubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMYhjubh)}(hMSG_MORE should be set in msghdr::msg_flags on all but the last part of the request. Multiple requests may be made simultaneously.h]hMSG_MORE should be set in msghdr::msg_flags on all but the last part of the request. Multiple requests may be made simultaneously.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hjubh)}(hUAn RXRPC_TX_LENGTH control message can also be specified on the first sendmsg() call.h]hUAn RXRPC_TX_LENGTH control message can also be specified on the first sendmsg() call.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM`hjubh)}(hIf a call is intended to go to a destination other than the default specified through connect(), then msghdr::msg_name should be set on the first request message of that call.h]hIf a call is intended to go to a destination other than the default specified through connect(), then msghdr::msg_name should be set on the first request message of that call.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMchjubeh}(h]h ]h"]h$]h&]uh1hhj3ubh)}(hXThe reply data will then be posted to the server socket for recvmsg() to pick up. MSG_MORE will be flagged by recvmsg() if there's more reply data for a particular call to be read. MSG_EOR will be set on the terminal read for a call. All data will be delivered with the following control message attached: RXRPC_USER_CALL_ID - specifies the user ID for this call If an abort or error occurred, this will be returned in the control data buffer instead, and MSG_EOR will be flagged to indicate the end of that call. h](h)}(hThe reply data will then be posted to the server socket for recvmsg() to pick up. MSG_MORE will be flagged by recvmsg() if there's more reply data for a particular call to be read. MSG_EOR will be set on the terminal read for a call.h]hThe reply data will then be posted to the server socket for recvmsg() to pick up. MSG_MORE will be flagged by recvmsg() if there’s more reply data for a particular call to be read. MSG_EOR will be set on the terminal read for a call.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMghjubh)}(hGAll data will be delivered with the following control message attached:h]hGAll data will be delivered with the following control message attached:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhjubh)}(h>RXRPC_USER_CALL_ID - specifies the user ID for this call h]h)}(h=RXRPC_USER_CALL_ID - specifies the user ID for this callh]h=RXRPC_USER_CALL_ID - specifies the user ID for this call}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMnhjubah}(h]h ]h"]h$]h&]uh1hhhhMnhjubh)}(hIf an abort or error occurred, this will be returned in the control data buffer instead, and MSG_EOR will be flagged to indicate the end of that call.h]hIf an abort or error occurred, this will be returned in the control data buffer instead, and MSG_EOR will be flagged to indicate the end of that call.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMphjubeh}(h]h ]h"]h$]h&]uh1hhj3ubeh}(h]h ]h"]h$]h&]jjjjjjuh1hhj/ubah}(h]h ]h"]h$]h&]uh1hhhhM%hjhhubh)}(hXA client may ask for a service ID it knows and ask that this be upgraded to a better service if one is available by supplying RXRPC_UPGRADE_SERVICE on the first sendmsg() of a call. The client should then check srx_service in the msg_name filled in by recvmsg() when collecting the result. srx_service will hold the same value as given to sendmsg() if the upgrade request was ignored by the service - otherwise it will be altered to indicate the service ID the server upgraded to. Note that the upgraded service ID is chosen by the server. The caller has to wait until it sees the service ID in the reply before sending any more calls (further calls to the same destination will be blocked until the probe is concluded).h]hXA client may ask for a service ID it knows and ask that this be upgraded to a better service if one is available by supplying RXRPC_UPGRADE_SERVICE on the first sendmsg() of a call. The client should then check srx_service in the msg_name filled in by recvmsg() when collecting the result. srx_service will hold the same value as given to sendmsg() if the upgrade request was ignored by the service - otherwise it will be altered to indicate the service ID the server upgraded to. Note that the upgraded service ID is chosen by the server. The caller has to wait until it sees the service ID in the reply before sending any more calls (further calls to the same destination will be blocked until the probe is concluded).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthjhhubh)}(hhh](h)}(hExample Server Usageh]hExample Server Usage}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hFA server would be set up to accept operations in the following manner:h]hFA server would be set up to accept operations in the following manner:}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXJ(1) An RxRPC socket is created by:: server = socket(AF_RXRPC, SOCK_DGRAM, PF_INET); Where the third parameter indicates the address type of the transport socket used - usually IPv4. (2) Security is set up if desired by giving the socket a keyring with server secret keys in it:: keyring = add_key("keyring", "AFSkeys", NULL, 0, KEY_SPEC_PROCESS_KEYRING); const char secret_key[8] = { 0xa7, 0x83, 0x8a, 0xcb, 0xc7, 0x83, 0xec, 0x94 }; add_key("rxrpc_s", "52:2", secret_key, 8, keyring); setsockopt(server, SOL_RXRPC, RXRPC_SECURITY_KEYRING, "AFSkeys", 7); The keyring can be manipulated after it has been given to the socket. This permits the server to add more keys, replace keys, etc. while it is live. (3) A local address must then be bound:: struct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = VL_SERVICE_ID, /* RxRPC service ID */ .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7000), /* AFS callback */ .transport.sin_address = 0, /* all local interfaces */ }; bind(server, &srx, sizeof(srx)); More than one service ID may be bound to a socket, provided the transport parameters are the same. The limit is currently two. To do this, bind() should be called twice. (4) If service upgrading is required, first two service IDs must have been bound and then the following option must be set:: unsigned short service_ids[2] = { from_ID, to_ID }; setsockopt(server, SOL_RXRPC, RXRPC_UPGRADEABLE_SERVICE, service_ids, sizeof(service_ids)); This will automatically upgrade connections on service from_ID to service to_ID if they request it. This will be reflected in msg_name obtained through recvmsg() when the request data is delivered to userspace. (5) The server is then set to listen out for incoming calls:: listen(server, 100); (6) The kernel notifies the server of pending incoming connections by sending it a message for each. This is received with recvmsg() on the server socket. It has no data, and has a single dataless control message attached:: RXRPC_NEW_CALL The address that can be passed back by recvmsg() at this point should be ignored since the call for which the message was posted may have gone by the time it is accepted - in which case the first call still on the queue will be accepted. (7) The server then accepts the new call by issuing a sendmsg() with two pieces of control data and no actual data: ================== ============================== RXRPC_ACCEPT indicate connection acceptance RXRPC_USER_CALL_ID specify user ID for this call ================== ============================== (8) The first request data packet will then be posted to the server socket for recvmsg() to pick up. At that point, the RxRPC address for the call can be read from the address fields in the msghdr struct. Subsequent request data will be posted to the server socket for recvmsg() to collect as it arrives. All but the last piece of the request data will be delivered with MSG_MORE flagged. All data will be delivered with the following control message attached: ================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call ================== =================================== (9) The reply data should then be posted to the server socket using a series of sendmsg() calls, each with the following control messages attached: ================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call ================== =================================== MSG_MORE should be set in msghdr::msg_flags on all but the last message for a particular call. h]h)}(hhh](h)}(hAn RxRPC socket is created by:: server = socket(AF_RXRPC, SOCK_DGRAM, PF_INET); Where the third parameter indicates the address type of the transport socket used - usually IPv4. h](h)}(hAn RxRPC socket is created by::h]hAn RxRPC socket is created by:}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjEubj)}(h/server = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);h]h/server = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);}hjWsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjEubh)}(haWhere the third parameter indicates the address type of the transport socket used - usually IPv4.h]haWhere the third parameter indicates the address type of the transport socket used - usually IPv4.}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjEubeh}(h]h ]h"]h$]h&]uh1hhjBubh)}(hX6Security is set up if desired by giving the socket a keyring with server secret keys in it:: keyring = add_key("keyring", "AFSkeys", NULL, 0, KEY_SPEC_PROCESS_KEYRING); const char secret_key[8] = { 0xa7, 0x83, 0x8a, 0xcb, 0xc7, 0x83, 0xec, 0x94 }; add_key("rxrpc_s", "52:2", secret_key, 8, keyring); setsockopt(server, SOL_RXRPC, RXRPC_SECURITY_KEYRING, "AFSkeys", 7); The keyring can be manipulated after it has been given to the socket. This permits the server to add more keys, replace keys, etc. while it is live. h](h)}(h\Security is set up if desired by giving the socket a keyring with server secret keys in it::h]h[Security is set up if desired by giving the socket a keyring with server secret keys in it:}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjyubj)}(hX/keyring = add_key("keyring", "AFSkeys", NULL, 0, KEY_SPEC_PROCESS_KEYRING); const char secret_key[8] = { 0xa7, 0x83, 0x8a, 0xcb, 0xc7, 0x83, 0xec, 0x94 }; add_key("rxrpc_s", "52:2", secret_key, 8, keyring); setsockopt(server, SOL_RXRPC, RXRPC_SECURITY_KEYRING, "AFSkeys", 7);h]hX/keyring = add_key("keyring", "AFSkeys", NULL, 0, KEY_SPEC_PROCESS_KEYRING); const char secret_key[8] = { 0xa7, 0x83, 0x8a, 0xcb, 0xc7, 0x83, 0xec, 0x94 }; add_key("rxrpc_s", "52:2", secret_key, 8, keyring); setsockopt(server, SOL_RXRPC, RXRPC_SECURITY_KEYRING, "AFSkeys", 7);}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjyubh)}(hThe keyring can be manipulated after it has been given to the socket. This permits the server to add more keys, replace keys, etc. while it is live.h]hThe keyring can be manipulated after it has been given to the socket. This permits the server to add more keys, replace keys, etc. while it is live.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjyubeh}(h]h ]h"]h$]h&]uh1hhjBubh)}(hXA local address must then be bound:: struct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = VL_SERVICE_ID, /* RxRPC service ID */ .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7000), /* AFS callback */ .transport.sin_address = 0, /* all local interfaces */ }; bind(server, &srx, sizeof(srx)); More than one service ID may be bound to a socket, provided the transport parameters are the same. The limit is currently two. To do this, bind() should be called twice. h](h)}(h$A local address must then be bound::h]h#A local address must then be bound:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hXstruct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = VL_SERVICE_ID, /* RxRPC service ID */ .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7000), /* AFS callback */ .transport.sin_address = 0, /* all local interfaces */ }; bind(server, &srx, sizeof(srx));h]hXstruct sockaddr_rxrpc srx = { .srx_family = AF_RXRPC, .srx_service = VL_SERVICE_ID, /* RxRPC service ID */ .transport_type = SOCK_DGRAM, /* type of transport socket */ .transport.sin_family = AF_INET, .transport.sin_port = htons(7000), /* AFS callback */ .transport.sin_address = 0, /* all local interfaces */ }; bind(server, &srx, sizeof(srx));}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubh)}(hMore than one service ID may be bound to a socket, provided the transport parameters are the same. The limit is currently two. To do this, bind() should be called twice.h]hMore than one service ID may be bound to a socket, provided the transport parameters are the same. The limit is currently two. To do this, bind() should be called twice.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjBubh)}(hXIf service upgrading is required, first two service IDs must have been bound and then the following option must be set:: unsigned short service_ids[2] = { from_ID, to_ID }; setsockopt(server, SOL_RXRPC, RXRPC_UPGRADEABLE_SERVICE, service_ids, sizeof(service_ids)); This will automatically upgrade connections on service from_ID to service to_ID if they request it. This will be reflected in msg_name obtained through recvmsg() when the request data is delivered to userspace. h](h)}(hxIf service upgrading is required, first two service IDs must have been bound and then the following option must be set::h]hwIf service upgrading is required, first two service IDs must have been bound and then the following option must be set:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hunsigned short service_ids[2] = { from_ID, to_ID }; setsockopt(server, SOL_RXRPC, RXRPC_UPGRADEABLE_SERVICE, service_ids, sizeof(service_ids));h]hunsigned short service_ids[2] = { from_ID, to_ID }; setsockopt(server, SOL_RXRPC, RXRPC_UPGRADEABLE_SERVICE, service_ids, sizeof(service_ids));}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubh)}(hThis will automatically upgrade connections on service from_ID to service to_ID if they request it. This will be reflected in msg_name obtained through recvmsg() when the request data is delivered to userspace.h]hThis will automatically upgrade connections on service from_ID to service to_ID if they request it. This will be reflected in msg_name obtained through recvmsg() when the request data is delivered to userspace.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjBubh)}(hSThe server is then set to listen out for incoming calls:: listen(server, 100); h](h)}(h9The server is then set to listen out for incoming calls::h]h8The server is then set to listen out for incoming calls:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hlisten(server, 100);h]hlisten(server, 100);}hj'sbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjBubh)}(hXThe kernel notifies the server of pending incoming connections by sending it a message for each. This is received with recvmsg() on the server socket. It has no data, and has a single dataless control message attached:: RXRPC_NEW_CALL The address that can be passed back by recvmsg() at this point should be ignored since the call for which the message was posted may have gone by the time it is accepted - in which case the first call still on the queue will be accepted. h](h)}(hThe kernel notifies the server of pending incoming connections by sending it a message for each. This is received with recvmsg() on the server socket. It has no data, and has a single dataless control message attached::h]hThe kernel notifies the server of pending incoming connections by sending it a message for each. This is received with recvmsg() on the server socket. It has no data, and has a single dataless control message attached:}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj;ubj)}(hRXRPC_NEW_CALLh]hRXRPC_NEW_CALL}hjMsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhj;ubh)}(hThe address that can be passed back by recvmsg() at this point should be ignored since the call for which the message was posted may have gone by the time it is accepted - in which case the first call still on the queue will be accepted.h]hThe address that can be passed back by recvmsg() at this point should be ignored since the call for which the message was posted may have gone by the time it is accepted - in which case the first call still on the queue will be accepted.}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj;ubeh}(h]h ]h"]h$]h&]uh1hhjBubh)}(hXXThe server then accepts the new call by issuing a sendmsg() with two pieces of control data and no actual data: ================== ============================== RXRPC_ACCEPT indicate connection acceptance RXRPC_USER_CALL_ID specify user ID for this call ================== ============================== h](h)}(hoThe server then accepts the new call by issuing a sendmsg() with two pieces of control data and no actual data:h]hoThe server then accepts the new call by issuing a sendmsg() with two pieces of control data and no actual data:}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjoubh)}(h================== ============================== RXRPC_ACCEPT indicate connection acceptance RXRPC_USER_CALL_ID specify user ID for this call ================== ============================== h]j )}(hhh]j )}(hhh](j )}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j hjubj )}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j hjubj1 )}(hhh](j )}(hhh](j )}(hhh]h)}(h RXRPC_ACCEPTh]h RXRPC_ACCEPT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hindicate connection acceptanceh]hindicate connection acceptance}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh](j )}(hhh]h)}(hRXRPC_USER_CALL_IDh]hRXRPC_USER_CALL_ID}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hspecify user ID for this callh]hspecify user ID for this call}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j0 hjubeh}(h]h ]h"]h$]h&]colsKuh1j hjubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMhjoubeh}(h]h ]h"]h$]h&]uh1hhjBubh)}(hXThe first request data packet will then be posted to the server socket for recvmsg() to pick up. At that point, the RxRPC address for the call can be read from the address fields in the msghdr struct. Subsequent request data will be posted to the server socket for recvmsg() to collect as it arrives. All but the last piece of the request data will be delivered with MSG_MORE flagged. All data will be delivered with the following control message attached: ================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call ================== =================================== h](h)}(hThe first request data packet will then be posted to the server socket for recvmsg() to pick up. At that point, the RxRPC address for the call can be read from the address fields in the msghdr struct.h]hThe first request data packet will then be posted to the server socket for recvmsg() to pick up. At that point, the RxRPC address for the call can be read from the address fields in the msghdr struct.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/ubh)}(hSubsequent request data will be posted to the server socket for recvmsg() to collect as it arrives. All but the last piece of the request data will be delivered with MSG_MORE flagged.h]hSubsequent request data will be posted to the server socket for recvmsg() to collect as it arrives. All but the last piece of the request data will be delivered with MSG_MORE flagged.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/ubh)}(hGAll data will be delivered with the following control message attached:h]hGAll data will be delivered with the following control message attached:}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/ubh)}(h================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call ================== =================================== h]j )}(hhh]j )}(hhh](j )}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j hjdubj )}(hhh]h}(h]h ]h"]h$]h&]colwidthK#uh1j hjdubj1 )}(hhh]j )}(hhh](j )}(hhh]h)}(hRXRPC_USER_CALL_IDh]hRXRPC_USER_CALL_ID}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hj~ubj )}(hhh]h)}(h#specifies the user ID for this callh]h#specifies the user ID for this call}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hj~ubeh}(h]h ]h"]h$]h&]uh1j hj{ubah}(h]h ]h"]h$]h&]uh1j0 hjdubeh}(h]h ]h"]h$]h&]colsKuh1j hjaubah}(h]h ]h"]h$]h&]uh1j hj]ubah}(h]h ]h"]h$]h&]uh1hhhhMhj/ubeh}(h]h ]h"]h$]h&]uh1hhjBubh)}(hXThe reply data should then be posted to the server socket using a series of sendmsg() calls, each with the following control messages attached: ================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call ================== =================================== MSG_MORE should be set in msghdr::msg_flags on all but the last message for a particular call. h](h)}(hThe reply data should then be posted to the server socket using a series of sendmsg() calls, each with the following control messages attached:h]hThe reply data should then be posted to the server socket using a series of sendmsg() calls, each with the following control messages attached:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(h================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call ================== =================================== h]j )}(hhh]j )}(hhh](j )}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j hjubj )}(hhh]h}(h]h ]h"]h$]h&]colwidthK#uh1j hjubj1 )}(hhh]j )}(hhh](j )}(hhh]h)}(hRXRPC_USER_CALL_IDh]hRXRPC_USER_CALL_ID}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h#specifies the user ID for this callh]h#specifies the user ID for this call}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1j0 hjubeh}(h]h ]h"]h$]h&]colsKuh1j hjubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(h^MSG_MORE should be set in msghdr::msg_flags on all but the last message for a particular call.h]h^MSG_MORE should be set in msghdr::msg_flags on all but the last message for a particular call.}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjBubeh}(h]h ]h"]h$]h&]jjjjjjuh1hhj>ubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(hXThe final ACK from the client will be posted for retrieval by recvmsg() when it is received. It will take the form of a dataless message with two control messages attached: ================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call RXRPC_ACK indicates final ACK (no data) ================== =================================== MSG_EOR will be flagged to indicate that this is the final message for this call. h](h)}(hThe final ACK from the client will be posted for retrieval by recvmsg() when it is received. It will take the form of a dataless message with two control messages attached:h]hThe final ACK from the client will be posted for retrieval by recvmsg() when it is received. It will take the form of a dataless message with two control messages attached:}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjzubh)}(h================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call RXRPC_ACK indicates final ACK (no data) ================== =================================== h]j )}(hhh]j )}(hhh](j )}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j hjubj )}(hhh]h}(h]h ]h"]h$]h&]colwidthK#uh1j hjubj1 )}(hhh](j )}(hhh](j )}(hhh]h)}(hRXRPC_USER_CALL_IDh]hRXRPC_USER_CALL_ID}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h#specifies the user ID for this callh]h#specifies the user ID for this call}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh](j )}(hhh]h)}(h RXRPC_ACKh]h RXRPC_ACK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hindicates final ACK (no data)h]hindicates final ACK (no data)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j0 hjubeh}(h]h ]h"]h$]h&]colsKuh1j hjubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMhjzubh)}(hQMSG_EOR will be flagged to indicate that this is the final message for this call.h]hQMSG_EOR will be flagged to indicate that this is the final message for this call.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjzubeh}(h]h ]h"]h$]h&]uh1hhjwhhhhhNubh)}(hXUp to the point the final packet of reply data is sent, the call can be aborted by calling sendmsg() with a dataless message with the following control messages attached: ================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call RXRPC_ABORT indicates abort code (4 byte data) ================== =================================== Any packets waiting in the socket's receive queue will be discarded if this is issued. h](h)}(hUp to the point the final packet of reply data is sent, the call can be aborted by calling sendmsg() with a dataless message with the following control messages attached:h]hUp to the point the final packet of reply data is sent, the call can be aborted by calling sendmsg() with a dataless message with the following control messages attached:}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjHubh)}(h================== =================================== RXRPC_USER_CALL_ID specifies the user ID for this call RXRPC_ABORT indicates abort code (4 byte data) ================== =================================== h]j )}(hhh]j )}(hhh](j )}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j hjaubj )}(hhh]h}(h]h ]h"]h$]h&]colwidthK#uh1j hjaubj1 )}(hhh](j )}(hhh](j )}(hhh]h)}(hRXRPC_USER_CALL_IDh]hRXRPC_USER_CALL_ID}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj~ubah}(h]h ]h"]h$]h&]uh1j hj{ubj )}(hhh]h)}(h#specifies the user ID for this callh]h#specifies the user ID for this call}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hj{ubeh}(h]h ]h"]h$]h&]uh1j hjxubj )}(hhh](j )}(hhh]h)}(h RXRPC_ABORTh]h RXRPC_ABORT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h"indicates abort code (4 byte data)h]h"indicates abort code (4 byte data)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjxubeh}(h]h ]h"]h$]h&]uh1j0 hjaubeh}(h]h ]h"]h$]h&]colsKuh1j hj^ubah}(h]h ]h"]h$]h&]uh1j hjZubah}(h]h ]h"]h$]h&]uh1hhhhMhjHubh)}(hVAny packets waiting in the socket's receive queue will be discarded if this is issued.h]hXAny packets waiting in the socket’s receive queue will be discarded if this is issued.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjHubeh}(h]h ]h"]h$]h&]uh1hhjwhhhhhNubeh}(h]h ]h"]h$]h&]jjjjjjjR K uh1hhjhhhhhMubh)}(hNote that all the communications for a particular service take place through the one server socket, using control messages on sendmsg() and recvmsg() to determine the call affected.h]hNote that all the communications for a particular service take place through the one server socket, using control messages on sendmsg() and recvmsg() to determine the call affected.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]example-server-usageah ]h"]example server usageah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hAF_RXRPC Kernel Interfaceh]hAF_RXRPC Kernel Interface}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2hhhhhMubh)}(hThe AF_RXRPC module also provides an interface for use by in-kernel utilities such as the AFS filesystem. This permits such a utility to:h]hThe AF_RXRPC module also provides an interface for use by in-kernel utilities such as the AFS filesystem. This permits such a utility to:}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2hhubh)}(hX(1) Use different keys directly on individual client calls on one socket rather than having to open a whole slew of sockets, one for each key it might want to use. (2) Avoid having RxRPC call request_key() at the point of issue of a call or opening of a socket. Instead the utility is responsible for requesting a key at the appropriate point. AFS, for instance, would do this during VFS operations such as open() or unlink(). The key is then handed through when the call is initiated. (3) Request the use of something other than GFP_KERNEL to allocate memory. (4) Avoid the overhead of using the recvmsg() call. RxRPC messages can be intercepted before they get put into the socket Rx queue and the socket buffers manipulated directly. h]h)}(hhh](h)}(hUse different keys directly on individual client calls on one socket rather than having to open a whole slew of sockets, one for each key it might want to use. h]h)}(hUse different keys directly on individual client calls on one socket rather than having to open a whole slew of sockets, one for each key it might want to use.h]hUse different keys directly on individual client calls on one socket rather than having to open a whole slew of sockets, one for each key it might want to use.}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjXubah}(h]h ]h"]h$]h&]uh1hhjUubh)}(hXAAvoid having RxRPC call request_key() at the point of issue of a call or opening of a socket. Instead the utility is responsible for requesting a key at the appropriate point. AFS, for instance, would do this during VFS operations such as open() or unlink(). The key is then handed through when the call is initiated. h]h)}(hX@Avoid having RxRPC call request_key() at the point of issue of a call or opening of a socket. Instead the utility is responsible for requesting a key at the appropriate point. AFS, for instance, would do this during VFS operations such as open() or unlink(). The key is then handed through when the call is initiated.h]hX@Avoid having RxRPC call request_key() at the point of issue of a call or opening of a socket. Instead the utility is responsible for requesting a key at the appropriate point. AFS, for instance, would do this during VFS operations such as open() or unlink(). The key is then handed through when the call is initiated.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjpubah}(h]h ]h"]h$]h&]uh1hhjUubh)}(hGRequest the use of something other than GFP_KERNEL to allocate memory. h]h)}(hFRequest the use of something other than GFP_KERNEL to allocate memory.h]hFRequest the use of something other than GFP_KERNEL to allocate memory.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjUubh)}(hAvoid the overhead of using the recvmsg() call. RxRPC messages can be intercepted before they get put into the socket Rx queue and the socket buffers manipulated directly. h]h)}(hAvoid the overhead of using the recvmsg() call. RxRPC messages can be intercepted before they get put into the socket Rx queue and the socket buffers manipulated directly.h]hAvoid the overhead of using the recvmsg() call. RxRPC messages can be intercepted before they get put into the socket Rx queue and the socket buffers manipulated directly.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjUubeh}(h]h ]h"]h$]h&]jjjjjjuh1hhjQubah}(h]h ]h"]h$]h&]uh1hhhhM hj2hhubh)}(hTo use the RxRPC facility, a kernel utility must still open an AF_RXRPC socket, bind an address as appropriate and listen if it's to be a server socket, but then it passes this to the kernel interface functions.h]hTo use the RxRPC facility, a kernel utility must still open an AF_RXRPC socket, bind an address as appropriate and listen if it’s to be a server socket, but then it passes this to the kernel interface functions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2hhubh)}(h.The kernel interface functions are as follows:h]h.The kernel interface functions are as follows:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2hhubh)}(hXH4(#) Begin a new client call:: struct rxrpc_call * rxrpc_kernel_begin_call(struct socket *sock, struct sockaddr_rxrpc *srx, struct key *key, unsigned long user_call_ID, s64 tx_total_len, gfp_t gfp, rxrpc_notify_rx_t notify_rx, bool upgrade, bool intr, unsigned int debug_id); This allocates the infrastructure to make a new RxRPC call and assigns call and connection numbers. The call will be made on the UDP port that the socket is bound to. The call will go to the destination address of a connected client socket unless an alternative is supplied (srx is non-NULL). If a key is supplied then this will be used to secure the call instead of the key bound to the socket with the RXRPC_SECURITY_KEY sockopt. Calls secured in this way will still share connections if at all possible. The user_call_ID is equivalent to that supplied to sendmsg() in the control data buffer. It is entirely feasible to use this to point to a kernel data structure. tx_total_len is the amount of data the caller is intending to transmit with this call (or -1 if unknown at this point). Setting the data size allows the kernel to encrypt directly to the packet buffers, thereby saving a copy. The value may not be less than -1. notify_rx is a pointer to a function to be called when events such as incoming data packets or remote aborts happen. upgrade should be set to true if a client operation should request that the server upgrade the service to a better one. The resultant service ID is returned by rxrpc_kernel_recv_data(). intr should be set to true if the call should be interruptible. If this is not set, this function may not return until a channel has been allocated; if it is set, the function may return -ERESTARTSYS. debug_id is the call debugging ID to be used for tracing. This can be obtained by atomically incrementing rxrpc_debug_id. If this function is successful, an opaque reference to the RxRPC call is returned. The caller now holds a reference on this and it must be properly ended. (#) Shut down a client call:: void rxrpc_kernel_shutdown_call(struct socket *sock, struct rxrpc_call *call); This is used to shut down a previously begun call. The user_call_ID is expunged from AF_RXRPC's knowledge and will not be seen again in association with the specified call. (#) Release the ref on a client call:: void rxrpc_kernel_put_call(struct socket *sock, struct rxrpc_call *call); This is used to release the caller's ref on an rxrpc call. (#) Send data through a call:: typedef void (*rxrpc_notify_end_tx_t)(struct sock *sk, unsigned long user_call_ID, struct sk_buff *skb); int rxrpc_kernel_send_data(struct socket *sock, struct rxrpc_call *call, struct msghdr *msg, size_t len, rxrpc_notify_end_tx_t notify_end_rx); This is used to supply either the request part of a client call or the reply part of a server call. msg.msg_iovlen and msg.msg_iov specify the data buffers to be used. msg_iov may not be NULL and must point exclusively to in-kernel virtual addresses. msg.msg_flags may be given MSG_MORE if there will be subsequent data sends for this call. The msg must not specify a destination address, control data or any flags other than MSG_MORE. len is the total amount of data to transmit. notify_end_rx can be NULL or it can be used to specify a function to be called when the call changes state to end the Tx phase. This function is called with a spinlock held to prevent the last DATA packet from being transmitted until the function returns. (#) Receive data from a call:: int rxrpc_kernel_recv_data(struct socket *sock, struct rxrpc_call *call, void *buf, size_t size, size_t *_offset, bool want_more, u32 *_abort, u16 *_service) This is used to receive data from either the reply part of a client call or the request part of a service call. buf and size specify how much data is desired and where to store it. *_offset is added on to buf and subtracted from size internally; the amount copied into the buffer is added to *_offset before returning. want_more should be true if further data will be required after this is satisfied and false if this is the last item of the receive phase. There are three normal returns: 0 if the buffer was filled and want_more was true; 1 if the buffer was filled, the last DATA packet has been emptied and want_more was false; and -EAGAIN if the function needs to be called again. If the last DATA packet is processed but the buffer contains less than the amount requested, EBADMSG is returned. If want_more wasn't set, but more data was available, EMSGSIZE is returned. If a remote ABORT is detected, the abort code received will be stored in ``*_abort`` and ECONNABORTED will be returned. The service ID that the call ended up with is returned into *_service. This can be used to see if a call got a service upgrade. (#) Abort a call?? :: void rxrpc_kernel_abort_call(struct socket *sock, struct rxrpc_call *call, u32 abort_code); This is used to abort a call if it's still in an abortable state. The abort code specified will be placed in the ABORT message sent. (#) Intercept received RxRPC messages:: typedef void (*rxrpc_interceptor_t)(struct sock *sk, unsigned long user_call_ID, struct sk_buff *skb); void rxrpc_kernel_intercept_rx_messages(struct socket *sock, rxrpc_interceptor_t interceptor); This installs an interceptor function on the specified AF_RXRPC socket. All messages that would otherwise wind up in the socket's Rx queue are then diverted to this function. Note that care must be taken to process the messages in the right order to maintain DATA message sequentiality. The interceptor function itself is provided with the address of the socket and handling the incoming message, the ID assigned by the kernel utility to the call and the socket buffer containing the message. The skb->mark field indicates the type of message: =============================== ======================================= Mark Meaning =============================== ======================================= RXRPC_SKB_MARK_DATA Data message RXRPC_SKB_MARK_FINAL_ACK Final ACK received for an incoming call RXRPC_SKB_MARK_BUSY Client call rejected as server busy RXRPC_SKB_MARK_REMOTE_ABORT Call aborted by peer RXRPC_SKB_MARK_NET_ERROR Network error detected RXRPC_SKB_MARK_LOCAL_ERROR Local error encountered RXRPC_SKB_MARK_NEW_CALL New incoming call awaiting acceptance =============================== ======================================= The remote abort message can be probed with rxrpc_kernel_get_abort_code(). The two error messages can be probed with rxrpc_kernel_get_error_number(). A new call can be accepted with rxrpc_kernel_accept_call(). Data messages can have their contents extracted with the usual bunch of socket buffer manipulation functions. A data message can be determined to be the last one in a sequence with rxrpc_kernel_is_data_last(). When a data message has been used up, rxrpc_kernel_data_consumed() should be called on it. Messages should be handled to rxrpc_kernel_free_skb() to dispose of. It is possible to get extra refs on all types of message for later freeing, but this may pin the state of a call until the message is finally freed. (#) Accept an incoming call:: struct rxrpc_call * rxrpc_kernel_accept_call(struct socket *sock, unsigned long user_call_ID); This is used to accept an incoming call and to assign it a call ID. This function is similar to rxrpc_kernel_begin_call() and calls accepted must be ended in the same way. If this function is successful, an opaque reference to the RxRPC call is returned. The caller now holds a reference on this and it must be properly ended. (#) Reject an incoming call:: int rxrpc_kernel_reject_call(struct socket *sock); This is used to reject the first incoming call on the socket's queue with a BUSY message. -ENODATA is returned if there were no incoming calls. Other errors may be returned if the call had been aborted (-ECONNABORTED) or had timed out (-ETIME). (#) Allocate a null key for doing anonymous security:: struct key *rxrpc_get_null_key(const char *keyname); This is used to allocate a null RxRPC key that can be used to indicate anonymous security for a particular domain. (#) Get the peer address of a call:: void rxrpc_kernel_get_peer(struct socket *sock, struct rxrpc_call *call, struct sockaddr_rxrpc *_srx); This is used to find the remote peer address of a call. (#) Set the total transmit data size on a call:: void rxrpc_kernel_set_tx_length(struct socket *sock, struct rxrpc_call *call, s64 tx_total_len); This sets the amount of data that the caller is intending to transmit on a call. It's intended to be used for setting the reply size as the request size should be set when the call is begun. tx_total_len may not be less than zero. (#) Get call RTT:: u64 rxrpc_kernel_get_rtt(struct socket *sock, struct rxrpc_call *call); Get the RTT time to the peer in use by a call. The value returned is in nanoseconds. (#) Check call still alive:: bool rxrpc_kernel_check_life(struct socket *sock, struct rxrpc_call *call, u32 *_life); void rxrpc_kernel_probe_life(struct socket *sock, struct rxrpc_call *call); The first function passes back in ``*_life`` a number that is updated when ACKs are received from the peer (notably including PING RESPONSE ACKs which we can elicit by sending PING ACKs to see if the call still exists on the server). The caller should compare the numbers of two calls to see if the call is still alive after waiting for a suitable interval. It also returns true as long as the call hasn't yet reached the completed state. This allows the caller to work out if the server is still contactable and if the call is still alive on the server while waiting for the server to process a client operation. The second function causes a ping ACK to be transmitted to try to provoke the peer into responding, which would then cause the value returned by the first function to change. Note that this must be called in TASK_RUNNING state. (#) Get remote client epoch:: u32 rxrpc_kernel_get_epoch(struct socket *sock, struct rxrpc_call *call) This allows the epoch that's contained in packets of an incoming client call to be queried. This value is returned. The function always successful if the call is still in progress. It shouldn't be called once the call has expired. Note that calling this on a local client call only returns the local epoch. This value can be used to determine if the remote client has been restarted as it shouldn't change otherwise. (#) Set the maximum lifespan on a call:: void rxrpc_kernel_set_max_life(struct socket *sock, struct rxrpc_call *call, unsigned long hard_timeout) This sets the maximum lifespan on a call to hard_timeout (which is in jiffies). In the event of the timeout occurring, the call will be aborted and -ETIME or -ETIMEDOUT will be returned. (#) Apply the RXRPC_MIN_SECURITY_LEVEL sockopt to a socket from within in the kernel:: int rxrpc_sock_set_min_security_level(struct sock *sk, unsigned int val); This specifies the minimum security level required for calls on this socket. h]h)}(hhh](h)}(hXBegin a new client call:: struct rxrpc_call * rxrpc_kernel_begin_call(struct socket *sock, struct sockaddr_rxrpc *srx, struct key *key, unsigned long user_call_ID, s64 tx_total_len, gfp_t gfp, rxrpc_notify_rx_t notify_rx, bool upgrade, bool intr, unsigned int debug_id); This allocates the infrastructure to make a new RxRPC call and assigns call and connection numbers. The call will be made on the UDP port that the socket is bound to. The call will go to the destination address of a connected client socket unless an alternative is supplied (srx is non-NULL). If a key is supplied then this will be used to secure the call instead of the key bound to the socket with the RXRPC_SECURITY_KEY sockopt. Calls secured in this way will still share connections if at all possible. The user_call_ID is equivalent to that supplied to sendmsg() in the control data buffer. It is entirely feasible to use this to point to a kernel data structure. tx_total_len is the amount of data the caller is intending to transmit with this call (or -1 if unknown at this point). Setting the data size allows the kernel to encrypt directly to the packet buffers, thereby saving a copy. The value may not be less than -1. notify_rx is a pointer to a function to be called when events such as incoming data packets or remote aborts happen. upgrade should be set to true if a client operation should request that the server upgrade the service to a better one. The resultant service ID is returned by rxrpc_kernel_recv_data(). intr should be set to true if the call should be interruptible. If this is not set, this function may not return until a channel has been allocated; if it is set, the function may return -ERESTARTSYS. debug_id is the call debugging ID to be used for tracing. This can be obtained by atomically incrementing rxrpc_debug_id. If this function is successful, an opaque reference to the RxRPC call is returned. The caller now holds a reference on this and it must be properly ended. h](h)}(hBegin a new client call::h]hBegin a new client call:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubj)}(hXstruct rxrpc_call * rxrpc_kernel_begin_call(struct socket *sock, struct sockaddr_rxrpc *srx, struct key *key, unsigned long user_call_ID, s64 tx_total_len, gfp_t gfp, rxrpc_notify_rx_t notify_rx, bool upgrade, bool intr, unsigned int debug_id);h]hXstruct rxrpc_call * rxrpc_kernel_begin_call(struct socket *sock, struct sockaddr_rxrpc *srx, struct key *key, unsigned long user_call_ID, s64 tx_total_len, gfp_t gfp, rxrpc_notify_rx_t notify_rx, bool upgrade, bool intr, unsigned int debug_id);}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhM"hjubh)}(hX&This allocates the infrastructure to make a new RxRPC call and assigns call and connection numbers. The call will be made on the UDP port that the socket is bound to. The call will go to the destination address of a connected client socket unless an alternative is supplied (srx is non-NULL).h]hX&This allocates the infrastructure to make a new RxRPC call and assigns call and connection numbers. The call will be made on the UDP port that the socket is bound to. The call will go to the destination address of a connected client socket unless an alternative is supplied (srx is non-NULL).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hjubh)}(hIf a key is supplied then this will be used to secure the call instead of the key bound to the socket with the RXRPC_SECURITY_KEY sockopt. Calls secured in this way will still share connections if at all possible.h]hIf a key is supplied then this will be used to secure the call instead of the key bound to the socket with the RXRPC_SECURITY_KEY sockopt. Calls secured in this way will still share connections if at all possible.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM4hjubh)}(hThe user_call_ID is equivalent to that supplied to sendmsg() in the control data buffer. It is entirely feasible to use this to point to a kernel data structure.h]hThe user_call_ID is equivalent to that supplied to sendmsg() in the control data buffer. It is entirely feasible to use this to point to a kernel data structure.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM8hjubh)}(hXtx_total_len is the amount of data the caller is intending to transmit with this call (or -1 if unknown at this point). Setting the data size allows the kernel to encrypt directly to the packet buffers, thereby saving a copy. The value may not be less than -1.h]hXtx_total_len is the amount of data the caller is intending to transmit with this call (or -1 if unknown at this point). Setting the data size allows the kernel to encrypt directly to the packet buffers, thereby saving a copy. The value may not be less than -1.}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM<hjubh)}(htnotify_rx is a pointer to a function to be called when events such as incoming data packets or remote aborts happen.h]htnotify_rx is a pointer to a function to be called when events such as incoming data packets or remote aborts happen.}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMAhjubh)}(hupgrade should be set to true if a client operation should request that the server upgrade the service to a better one. The resultant service ID is returned by rxrpc_kernel_recv_data().h]hupgrade should be set to true if a client operation should request that the server upgrade the service to a better one. The resultant service ID is returned by rxrpc_kernel_recv_data().}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMDhjubh)}(hintr should be set to true if the call should be interruptible. If this is not set, this function may not return until a channel has been allocated; if it is set, the function may return -ERESTARTSYS.h]hintr should be set to true if the call should be interruptible. If this is not set, this function may not return until a channel has been allocated; if it is set, the function may return -ERESTARTSYS.}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMHhjubh)}(hzdebug_id is the call debugging ID to be used for tracing. This can be obtained by atomically incrementing rxrpc_debug_id.h]hzdebug_id is the call debugging ID to be used for tracing. This can be obtained by atomically incrementing rxrpc_debug_id.}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhjubh)}(hIf this function is successful, an opaque reference to the RxRPC call is returned. The caller now holds a reference on this and it must be properly ended.h]hIf this function is successful, an opaque reference to the RxRPC call is returned. The caller now holds a reference on this and it must be properly ended.}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMOhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hX?Shut down a client call:: void rxrpc_kernel_shutdown_call(struct socket *sock, struct rxrpc_call *call); This is used to shut down a previously begun call. The user_call_ID is expunged from AF_RXRPC's knowledge and will not be seen again in association with the specified call. h](h)}(hShut down a client call::h]hShut down a client call:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMShjubj)}(hnvoid rxrpc_kernel_shutdown_call(struct socket *sock, struct rxrpc_call *call);h]hnvoid rxrpc_kernel_shutdown_call(struct socket *sock, struct rxrpc_call *call);}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMUhjubh)}(hThis is used to shut down a previously begun call. The user_call_ID is expunged from AF_RXRPC's knowledge and will not be seen again in association with the specified call.h]hThis is used to shut down a previously begun call. The user_call_ID is expunged from AF_RXRPC’s knowledge and will not be seen again in association with the specified call.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hRelease the ref on a client call:: void rxrpc_kernel_put_call(struct socket *sock, struct rxrpc_call *call); This is used to release the caller's ref on an rxrpc call. h](h)}(h"Release the ref on a client call::h]h!Release the ref on a client call:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\hjubj)}(hdvoid rxrpc_kernel_put_call(struct socket *sock, struct rxrpc_call *call);h]hdvoid rxrpc_kernel_put_call(struct socket *sock, struct rxrpc_call *call);}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhM^hjubh)}(h:This is used to release the caller's ref on an rxrpc call.h]hmark field indicates the type of message: =============================== ======================================= Mark Meaning =============================== ======================================= RXRPC_SKB_MARK_DATA Data message RXRPC_SKB_MARK_FINAL_ACK Final ACK received for an incoming call RXRPC_SKB_MARK_BUSY Client call rejected as server busy RXRPC_SKB_MARK_REMOTE_ABORT Call aborted by peer RXRPC_SKB_MARK_NET_ERROR Network error detected RXRPC_SKB_MARK_LOCAL_ERROR Local error encountered RXRPC_SKB_MARK_NEW_CALL New incoming call awaiting acceptance =============================== ======================================= The remote abort message can be probed with rxrpc_kernel_get_abort_code(). The two error messages can be probed with rxrpc_kernel_get_error_number(). A new call can be accepted with rxrpc_kernel_accept_call(). Data messages can have their contents extracted with the usual bunch of socket buffer manipulation functions. A data message can be determined to be the last one in a sequence with rxrpc_kernel_is_data_last(). When a data message has been used up, rxrpc_kernel_data_consumed() should be called on it. Messages should be handled to rxrpc_kernel_free_skb() to dispose of. It is possible to get extra refs on all types of message for later freeing, but this may pin the state of a call until the message is finally freed. h](h)}(h#Intercept received RxRPC messages::h]h"Intercept received RxRPC messages:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hX1typedef void (*rxrpc_interceptor_t)(struct sock *sk, unsigned long user_call_ID, struct sk_buff *skb); void rxrpc_kernel_intercept_rx_messages(struct socket *sock, rxrpc_interceptor_t interceptor);h]hX1typedef void (*rxrpc_interceptor_t)(struct sock *sk, unsigned long user_call_ID, struct sk_buff *skb); void rxrpc_kernel_intercept_rx_messages(struct socket *sock, rxrpc_interceptor_t interceptor);}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubh)}(hXThis installs an interceptor function on the specified AF_RXRPC socket. All messages that would otherwise wind up in the socket's Rx queue are then diverted to this function. Note that care must be taken to process the messages in the right order to maintain DATA message sequentiality.h]hX!This installs an interceptor function on the specified AF_RXRPC socket. All messages that would otherwise wind up in the socket’s Rx queue are then diverted to this function. Note that care must be taken to process the messages in the right order to maintain DATA message sequentiality.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThe interceptor function itself is provided with the address of the socket and handling the incoming message, the ID assigned by the kernel utility to the call and the socket buffer containing the message.h]hThe interceptor function itself is provided with the address of the socket and handling the incoming message, the ID assigned by the kernel utility to the call and the socket buffer containing the message.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(h2The skb->mark field indicates the type of message:h]h2The skb->mark field indicates the type of message:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hX=============================== ======================================= Mark Meaning =============================== ======================================= RXRPC_SKB_MARK_DATA Data message RXRPC_SKB_MARK_FINAL_ACK Final ACK received for an incoming call RXRPC_SKB_MARK_BUSY Client call rejected as server busy RXRPC_SKB_MARK_REMOTE_ABORT Call aborted by peer RXRPC_SKB_MARK_NET_ERROR Network error detected RXRPC_SKB_MARK_LOCAL_ERROR Local error encountered RXRPC_SKB_MARK_NEW_CALL New incoming call awaiting acceptance =============================== ======================================= h]j )}(hhh]j )}(hhh](j )}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j hjubj )}(hhh]h}(h]h ]h"]h$]h&]colwidthK'uh1j hjubj )}(hhh]j )}(hhh](j )}(hhh]h)}(hMarkh]hMark}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hMeaningh]hMeaning}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1j hjubj1 )}(hhh](j )}(hhh](j )}(hhh]h)}(hRXRPC_SKB_MARK_DATAh]hRXRPC_SKB_MARK_DATA}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjKubah}(h]h ]h"]h$]h&]uh1j hjHubj )}(hhh]h)}(h Data messageh]h Data message}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjbubah}(h]h ]h"]h$]h&]uh1j hjHubeh}(h]h ]h"]h$]h&]uh1j hjEubj )}(hhh](j )}(hhh]h)}(hRXRPC_SKB_MARK_FINAL_ACKh]hRXRPC_SKB_MARK_FINAL_ACK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h'Final ACK received for an incoming callh]h'Final ACK received for an incoming call}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjEubj )}(hhh](j )}(hhh]h)}(hRXRPC_SKB_MARK_BUSYh]hRXRPC_SKB_MARK_BUSY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h#Client call rejected as server busyh]h#Client call rejected as server busy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjEubj )}(hhh](j )}(hhh]h)}(hRXRPC_SKB_MARK_REMOTE_ABORTh]hRXRPC_SKB_MARK_REMOTE_ABORT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hCall aborted by peerh]hCall aborted by peer}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjEubj )}(hhh](j )}(hhh]h)}(hRXRPC_SKB_MARK_NET_ERRORh]hRXRPC_SKB_MARK_NET_ERROR}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj'ubah}(h]h ]h"]h$]h&]uh1j hj$ubj )}(hhh]h)}(hNetwork error detectedh]hNetwork error detected}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>ubah}(h]h ]h"]h$]h&]uh1j hj$ubeh}(h]h ]h"]h$]h&]uh1j hjEubj )}(hhh](j )}(hhh]h)}(hRXRPC_SKB_MARK_LOCAL_ERRORh]hRXRPC_SKB_MARK_LOCAL_ERROR}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj^ubah}(h]h ]h"]h$]h&]uh1j hj[ubj )}(hhh]h)}(hLocal error encounteredh]hLocal error encountered}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjuubah}(h]h ]h"]h$]h&]uh1j hj[ubeh}(h]h ]h"]h$]h&]uh1j hjEubj )}(hhh](j )}(hhh]h)}(hRXRPC_SKB_MARK_NEW_CALLh]hRXRPC_SKB_MARK_NEW_CALL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h%New incoming call awaiting acceptanceh]h%New incoming call awaiting acceptance}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hjEubeh}(h]h ]h"]h$]h&]uh1j0 hjubeh}(h]h ]h"]h$]h&]colsKuh1j hjubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThe remote abort message can be probed with rxrpc_kernel_get_abort_code(). The two error messages can be probed with rxrpc_kernel_get_error_number(). A new call can be accepted with rxrpc_kernel_accept_call().h]hThe remote abort message can be probed with rxrpc_kernel_get_abort_code(). The two error messages can be probed with rxrpc_kernel_get_error_number(). A new call can be accepted with rxrpc_kernel_accept_call().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hX.Data messages can have their contents extracted with the usual bunch of socket buffer manipulation functions. A data message can be determined to be the last one in a sequence with rxrpc_kernel_is_data_last(). When a data message has been used up, rxrpc_kernel_data_consumed() should be called on it.h]hX.Data messages can have their contents extracted with the usual bunch of socket buffer manipulation functions. A data message can be determined to be the last one in a sequence with rxrpc_kernel_is_data_last(). When a data message has been used up, rxrpc_kernel_data_consumed() should be called on it.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hMessages should be handled to rxrpc_kernel_free_skb() to dispose of. It is possible to get extra refs on all types of message for later freeing, but this may pin the state of a call until the message is finally freed.h]hMessages should be handled to rxrpc_kernel_free_skb() to dispose of. It is possible to get extra refs on all types of message for later freeing, but this may pin the state of a call until the message is finally freed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hXAccept an incoming call:: struct rxrpc_call * rxrpc_kernel_accept_call(struct socket *sock, unsigned long user_call_ID); This is used to accept an incoming call and to assign it a call ID. This function is similar to rxrpc_kernel_begin_call() and calls accepted must be ended in the same way. If this function is successful, an opaque reference to the RxRPC call is returned. The caller now holds a reference on this and it must be properly ended. h](h)}(hAccept an incoming call::h]hAccept an incoming call:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hwstruct rxrpc_call * rxrpc_kernel_accept_call(struct socket *sock, unsigned long user_call_ID);h]hwstruct rxrpc_call * rxrpc_kernel_accept_call(struct socket *sock, unsigned long user_call_ID);}hj$sbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubh)}(hThis is used to accept an incoming call and to assign it a call ID. This function is similar to rxrpc_kernel_begin_call() and calls accepted must be ended in the same way.h]hThis is used to accept an incoming call and to assign it a call ID. This function is similar to rxrpc_kernel_begin_call() and calls accepted must be ended in the same way.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hIf this function is successful, an opaque reference to the RxRPC call is returned. The caller now holds a reference on this and it must be properly ended.h]hIf this function is successful, an opaque reference to the RxRPC call is returned. The caller now holds a reference on this and it must be properly ended.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hXHReject an incoming call:: int rxrpc_kernel_reject_call(struct socket *sock); This is used to reject the first incoming call on the socket's queue with a BUSY message. -ENODATA is returned if there were no incoming calls. Other errors may be returned if the call had been aborted (-ECONNABORTED) or had timed out (-ETIME). h](h)}(hReject an incoming call::h]hReject an incoming call:}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjTubj)}(h2int rxrpc_kernel_reject_call(struct socket *sock);h]h2int rxrpc_kernel_reject_call(struct socket *sock);}hjfsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjTubh)}(hThis is used to reject the first incoming call on the socket's queue with a BUSY message. -ENODATA is returned if there were no incoming calls. Other errors may be returned if the call had been aborted (-ECONNABORTED) or had timed out (-ETIME).h]hThis is used to reject the first incoming call on the socket’s queue with a BUSY message. -ENODATA is returned if there were no incoming calls. Other errors may be returned if the call had been aborted (-ECONNABORTED) or had timed out (-ETIME).}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjTubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hAllocate a null key for doing anonymous security:: struct key *rxrpc_get_null_key(const char *keyname); This is used to allocate a null RxRPC key that can be used to indicate anonymous security for a particular domain. h](h)}(h2Allocate a null key for doing anonymous security::h]h1Allocate a null key for doing anonymous security:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(h4struct key *rxrpc_get_null_key(const char *keyname);h]h4struct key *rxrpc_get_null_key(const char *keyname);}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubh)}(hrThis is used to allocate a null RxRPC key that can be used to indicate anonymous security for a particular domain.h]hrThis is used to allocate a null RxRPC key that can be used to indicate anonymous security for a particular domain.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hGet the peer address of a call:: void rxrpc_kernel_get_peer(struct socket *sock, struct rxrpc_call *call, struct sockaddr_rxrpc *_srx); This is used to find the remote peer address of a call. h](h)}(h Get the peer address of a call::h]hGet the peer address of a call:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hvoid rxrpc_kernel_get_peer(struct socket *sock, struct rxrpc_call *call, struct sockaddr_rxrpc *_srx);h]hvoid rxrpc_kernel_get_peer(struct socket *sock, struct rxrpc_call *call, struct sockaddr_rxrpc *_srx);}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubh)}(h7This is used to find the remote peer address of a call.h]h7This is used to find the remote peer address of a call.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hXSet the total transmit data size on a call:: void rxrpc_kernel_set_tx_length(struct socket *sock, struct rxrpc_call *call, s64 tx_total_len); This sets the amount of data that the caller is intending to transmit on a call. It's intended to be used for setting the reply size as the request size should be set when the call is begun. tx_total_len may not be less than zero. h](h)}(h,Set the total transmit data size on a call::h]h+Set the total transmit data size on a call:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hvoid rxrpc_kernel_set_tx_length(struct socket *sock, struct rxrpc_call *call, s64 tx_total_len);h]hvoid rxrpc_kernel_set_tx_length(struct socket *sock, struct rxrpc_call *call, s64 tx_total_len);}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjubh)}(hThis sets the amount of data that the caller is intending to transmit on a call. It's intended to be used for setting the reply size as the request size should be set when the call is begun. tx_total_len may not be less than zero.h]hThis sets the amount of data that the caller is intending to transmit on a call. It’s intended to be used for setting the reply size as the request size should be set when the call is begun. tx_total_len may not be less than zero.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hGet call RTT:: u64 rxrpc_kernel_get_rtt(struct socket *sock, struct rxrpc_call *call); Get the RTT time to the peer in use by a call. The value returned is in nanoseconds. h](h)}(hGet call RTT::h]h Get call RTT:}(hj( hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj$ ubj)}(hGu64 rxrpc_kernel_get_rtt(struct socket *sock, struct rxrpc_call *call);h]hGu64 rxrpc_kernel_get_rtt(struct socket *sock, struct rxrpc_call *call);}hj6 sbah}(h]h ]h"]h$]h&]hhuh1jhhhM hj$ ubh)}(hUGet the RTT time to the peer in use by a call. The value returned is in nanoseconds.h]hUGet the RTT time to the peer in use by a call. The value returned is in nanoseconds.}(hjD hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj$ ubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hXtCheck call still alive:: bool rxrpc_kernel_check_life(struct socket *sock, struct rxrpc_call *call, u32 *_life); void rxrpc_kernel_probe_life(struct socket *sock, struct rxrpc_call *call); The first function passes back in ``*_life`` a number that is updated when ACKs are received from the peer (notably including PING RESPONSE ACKs which we can elicit by sending PING ACKs to see if the call still exists on the server). The caller should compare the numbers of two calls to see if the call is still alive after waiting for a suitable interval. It also returns true as long as the call hasn't yet reached the completed state. This allows the caller to work out if the server is still contactable and if the call is still alive on the server while waiting for the server to process a client operation. The second function causes a ping ACK to be transmitted to try to provoke the peer into responding, which would then cause the value returned by the first function to change. Note that this must be called in TASK_RUNNING state. h](h)}(hCheck call still alive::h]hCheck call still alive:}(hj\ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjX ubj)}(hbool rxrpc_kernel_check_life(struct socket *sock, struct rxrpc_call *call, u32 *_life); void rxrpc_kernel_probe_life(struct socket *sock, struct rxrpc_call *call);h]hbool rxrpc_kernel_check_life(struct socket *sock, struct rxrpc_call *call, u32 *_life); void rxrpc_kernel_probe_life(struct socket *sock, struct rxrpc_call *call);}hjj sbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjX ubh)}(hXThe first function passes back in ``*_life`` a number that is updated when ACKs are received from the peer (notably including PING RESPONSE ACKs which we can elicit by sending PING ACKs to see if the call still exists on the server). The caller should compare the numbers of two calls to see if the call is still alive after waiting for a suitable interval. It also returns true as long as the call hasn't yet reached the completed state.h](h"The first function passes back in }(hjx hhhNhNubhliteral)}(h ``*_life``h]h*_life}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjx ubhX a number that is updated when ACKs are received from the peer (notably including PING RESPONSE ACKs which we can elicit by sending PING ACKs to see if the call still exists on the server). The caller should compare the numbers of two calls to see if the call is still alive after waiting for a suitable interval. It also returns true as long as the call hasn’t yet reached the completed state.}(hjx hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjX ubh)}(hThis allows the caller to work out if the server is still contactable and if the call is still alive on the server while waiting for the server to process a client operation.h]hThis allows the caller to work out if the server is still contactable and if the call is still alive on the server while waiting for the server to process a client operation.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjX ubh)}(hThe second function causes a ping ACK to be transmitted to try to provoke the peer into responding, which would then cause the value returned by the first function to change. Note that this must be called in TASK_RUNNING state.h]hThe second function causes a ping ACK to be transmitted to try to provoke the peer into responding, which would then cause the value returned by the first function to change. Note that this must be called in TASK_RUNNING state.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$hjX ubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hX,Get remote client epoch:: u32 rxrpc_kernel_get_epoch(struct socket *sock, struct rxrpc_call *call) This allows the epoch that's contained in packets of an incoming client call to be queried. This value is returned. The function always successful if the call is still in progress. It shouldn't be called once the call has expired. Note that calling this on a local client call only returns the local epoch. This value can be used to determine if the remote client has been restarted as it shouldn't change otherwise. h](h)}(hGet remote client epoch::h]hGet remote client epoch:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM)hj ubj)}(hcu32 rxrpc_kernel_get_epoch(struct socket *sock, struct rxrpc_call *call)h]hcu32 rxrpc_kernel_get_epoch(struct socket *sock, struct rxrpc_call *call)}hj sbah}(h]h ]h"]h$]h&]hhuh1jhhhM+hj ubh)}(hX6This allows the epoch that's contained in packets of an incoming client call to be queried. This value is returned. The function always successful if the call is still in progress. It shouldn't be called once the call has expired. Note that calling this on a local client call only returns the local epoch.h]hX:This allows the epoch that’s contained in packets of an incoming client call to be queried. This value is returned. The function always successful if the call is still in progress. It shouldn’t be called once the call has expired. Note that calling this on a local client call only returns the local epoch.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hj ubh)}(hmThis value can be used to determine if the remote client has been restarted as it shouldn't change otherwise.h]hoThis value can be used to determine if the remote client has been restarted as it shouldn’t change otherwise.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM4hj ubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hXSet the maximum lifespan on a call:: void rxrpc_kernel_set_max_life(struct socket *sock, struct rxrpc_call *call, unsigned long hard_timeout) This sets the maximum lifespan on a call to hard_timeout (which is in jiffies). In the event of the timeout occurring, the call will be aborted and -ETIME or -ETIMEDOUT will be returned. h](h)}(h$Set the maximum lifespan on a call::h]h#Set the maximum lifespan on a call:}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7hj ubj)}(hvoid rxrpc_kernel_set_max_life(struct socket *sock, struct rxrpc_call *call, unsigned long hard_timeout)h]hvoid rxrpc_kernel_set_max_life(struct socket *sock, struct rxrpc_call *call, unsigned long hard_timeout)}hj!sbah}(h]h ]h"]h$]h&]hhuh1jhhhM9hj ubh)}(hThis sets the maximum lifespan on a call to hard_timeout (which is in jiffies). In the event of the timeout occurring, the call will be aborted and -ETIME or -ETIMEDOUT will be returned.h]hThis sets the maximum lifespan on a call to hard_timeout (which is in jiffies). In the event of the timeout occurring, the call will be aborted and -ETIME or -ETIMEDOUT will be returned.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM=hj ubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hXApply the RXRPC_MIN_SECURITY_LEVEL sockopt to a socket from within in the kernel:: int rxrpc_sock_set_min_security_level(struct sock *sk, unsigned int val); This specifies the minimum security level required for calls on this socket. h](h)}(hRApply the RXRPC_MIN_SECURITY_LEVEL sockopt to a socket from within in the kernel::h]hQApply the RXRPC_MIN_SECURITY_LEVEL sockopt to a socket from within in the kernel:}(hj6!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMAhj2!ubj)}(hoint rxrpc_sock_set_min_security_level(struct sock *sk, unsigned int val);h]hoint rxrpc_sock_set_min_security_level(struct sock *sk, unsigned int val);}hjD!sbah}(h]h ]h"]h$]h&]hhuh1jhhhMDhj2!ubh)}(hLThis specifies the minimum security level required for calls on this socket.h]hLThis specifies the minimum security level required for calls on this socket.}(hjR!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMGhj2!ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjjjjjuh1hhjubah}(h]h ]h"]h$]h&]uh1hhhhM hj2hhubeh}(h]af-rxrpc-kernel-interfaceah ]h"]af_rxrpc kernel interfaceah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hConfigurable Parametersh]hConfigurable Parameters}(hj}!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjz!hhhhhMLubh)}(h{The RxRPC protocol driver has a number of configurable parameters that can be adjusted through sysctls in /proc/net/rxrpc/:h]h{The RxRPC protocol driver has a number of configurable parameters that can be adjusted through sysctls in /proc/net/rxrpc/:}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMNhjz!hhubh)}(hXj (#) req_ack_delay The amount of time in milliseconds after receiving a packet with the request-ack flag set before we honour the flag and actually send the requested ack. Usually the other side won't stop sending packets until the advertised reception window is full (to a maximum of 255 packets), so delaying the ACK permits several packets to be ACK'd in one go. (#) soft_ack_delay The amount of time in milliseconds after receiving a new packet before we generate a soft-ACK to tell the sender that it doesn't need to resend. (#) idle_ack_delay The amount of time in milliseconds after all the packets currently in the received queue have been consumed before we generate a hard-ACK to tell the sender it can free its buffers, assuming no other reason occurs that we would send an ACK. (#) resend_timeout The amount of time in milliseconds after transmitting a packet before we transmit it again, assuming no ACK is received from the receiver telling us they got it. (#) max_call_lifetime The maximum amount of time in seconds that a call may be in progress before we preemptively kill it. (#) dead_call_expiry The amount of time in seconds before we remove a dead call from the call list. Dead calls are kept around for a little while for the purpose of repeating ACK and ABORT packets. (#) connection_expiry The amount of time in seconds after a connection was last used before we remove it from the connection list. While a connection is in existence, it serves as a placeholder for negotiated security; when it is deleted, the security must be renegotiated. (#) transport_expiry The amount of time in seconds after a transport was last used before we remove it from the transport list. While a transport is in existence, it serves to anchor the peer data and keeps the connection ID counter. (#) rxrpc_rx_window_size The size of the receive window in packets. This is the maximum number of unconsumed received packets we're willing to hold in memory for any particular call. (#) rxrpc_rx_mtu The maximum packet MTU size that we're willing to receive in bytes. This indicates to the peer whether we're willing to accept jumbo packets. (#) rxrpc_rx_jumbo_max The maximum number of packets that we're willing to accept in a jumbo packet. Non-terminal packets in a jumbo packet must contain a four byte header plus exactly 1412 bytes of data. The terminal packet must contain a four byte header plus any amount of data. In any event, a jumbo packet may not exceed rxrpc_rx_mtu in size.h]h)}(hhh](h)}(hXkreq_ack_delay The amount of time in milliseconds after receiving a packet with the request-ack flag set before we honour the flag and actually send the requested ack. Usually the other side won't stop sending packets until the advertised reception window is full (to a maximum of 255 packets), so delaying the ACK permits several packets to be ACK'd in one go. h](h)}(h req_ack_delayh]h req_ack_delay}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMQhj!ubh)}(hThe amount of time in milliseconds after receiving a packet with the request-ack flag set before we honour the flag and actually send the requested ack.h]hThe amount of time in milliseconds after receiving a packet with the request-ack flag set before we honour the flag and actually send the requested ack.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMShj!ubh)}(hUsually the other side won't stop sending packets until the advertised reception window is full (to a maximum of 255 packets), so delaying the ACK permits several packets to be ACK'd in one go.h]hUsually the other side won’t stop sending packets until the advertised reception window is full (to a maximum of 255 packets), so delaying the ACK permits several packets to be ACK’d in one go.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMWhj!ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(hsoft_ack_delay The amount of time in milliseconds after receiving a new packet before we generate a soft-ACK to tell the sender that it doesn't need to resend. h](h)}(hsoft_ack_delayh]hsoft_ack_delay}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hj!ubh)}(hThe amount of time in milliseconds after receiving a new packet before we generate a soft-ACK to tell the sender that it doesn't need to resend.h]hThe amount of time in milliseconds after receiving a new packet before we generate a soft-ACK to tell the sender that it doesn’t need to resend.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hj!ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(hXidle_ack_delay The amount of time in milliseconds after all the packets currently in the received queue have been consumed before we generate a hard-ACK to tell the sender it can free its buffers, assuming no other reason occurs that we would send an ACK. h](h)}(hidle_ack_delayh]hidle_ack_delay}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM`hj!ubh)}(hThe amount of time in milliseconds after all the packets currently in the received queue have been consumed before we generate a hard-ACK to tell the sender it can free its buffers, assuming no other reason occurs that we would send an ACK.h]hThe amount of time in milliseconds after all the packets currently in the received queue have been consumed before we generate a hard-ACK to tell the sender it can free its buffers, assuming no other reason occurs that we would send an ACK.}(hj "hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMbhj!ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(hresend_timeout The amount of time in milliseconds after transmitting a packet before we transmit it again, assuming no ACK is received from the receiver telling us they got it. h](h)}(hresend_timeouth]hresend_timeout}(hj$"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMghj "ubh)}(hThe amount of time in milliseconds after transmitting a packet before we transmit it again, assuming no ACK is received from the receiver telling us they got it.h]hThe amount of time in milliseconds after transmitting a packet before we transmit it again, assuming no ACK is received from the receiver telling us they got it.}(hj2"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMihj "ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(hxmax_call_lifetime The maximum amount of time in seconds that a call may be in progress before we preemptively kill it. h](h)}(hmax_call_lifetimeh]hmax_call_lifetime}(hjJ"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMmhjF"ubh)}(hdThe maximum amount of time in seconds that a call may be in progress before we preemptively kill it.h]hdThe maximum amount of time in seconds that a call may be in progress before we preemptively kill it.}(hjX"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMohjF"ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(hdead_call_expiry The amount of time in seconds before we remove a dead call from the call list. Dead calls are kept around for a little while for the purpose of repeating ACK and ABORT packets. h](h)}(hdead_call_expiryh]hdead_call_expiry}(hjp"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMrhjl"ubh)}(hThe amount of time in seconds before we remove a dead call from the call list. Dead calls are kept around for a little while for the purpose of repeating ACK and ABORT packets.h]hThe amount of time in seconds before we remove a dead call from the call list. Dead calls are kept around for a little while for the purpose of repeating ACK and ABORT packets.}(hj~"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthjl"ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(hXconnection_expiry The amount of time in seconds after a connection was last used before we remove it from the connection list. While a connection is in existence, it serves as a placeholder for negotiated security; when it is deleted, the security must be renegotiated. h](h)}(hconnection_expiryh]hconnection_expiry}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMxhj"ubh)}(hThe amount of time in seconds after a connection was last used before we remove it from the connection list. While a connection is in existence, it serves as a placeholder for negotiated security; when it is deleted, the security must be renegotiated.h]hThe amount of time in seconds after a connection was last used before we remove it from the connection list. While a connection is in existence, it serves as a placeholder for negotiated security; when it is deleted, the security must be renegotiated.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMzhj"ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(htransport_expiry The amount of time in seconds after a transport was last used before we remove it from the transport list. While a transport is in existence, it serves to anchor the peer data and keeps the connection ID counter. h](h)}(htransport_expiryh]htransport_expiry}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubh)}(hThe amount of time in seconds after a transport was last used before we remove it from the transport list. While a transport is in existence, it serves to anchor the peer data and keeps the connection ID counter.h]hThe amount of time in seconds after a transport was last used before we remove it from the transport list. While a transport is in existence, it serves to anchor the peer data and keeps the connection ID counter.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(hrxrpc_rx_window_size The size of the receive window in packets. This is the maximum number of unconsumed received packets we're willing to hold in memory for any particular call. h](h)}(hrxrpc_rx_window_sizeh]hrxrpc_rx_window_size}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubh)}(hThe size of the receive window in packets. This is the maximum number of unconsumed received packets we're willing to hold in memory for any particular call.h]hThe size of the receive window in packets. This is the maximum number of unconsumed received packets we’re willing to hold in memory for any particular call.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj"ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(hrxrpc_rx_mtu The maximum packet MTU size that we're willing to receive in bytes. This indicates to the peer whether we're willing to accept jumbo packets. h](h)}(h rxrpc_rx_mtuh]h rxrpc_rx_mtu}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#ubh)}(hThe maximum packet MTU size that we're willing to receive in bytes. This indicates to the peer whether we're willing to accept jumbo packets.h]hThe maximum packet MTU size that we’re willing to receive in bytes. This indicates to the peer whether we’re willing to accept jumbo packets.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#ubeh}(h]h ]h"]h$]h&]uh1hhj!ubh)}(hX[rxrpc_rx_jumbo_max The maximum number of packets that we're willing to accept in a jumbo packet. Non-terminal packets in a jumbo packet must contain a four byte header plus exactly 1412 bytes of data. The terminal packet must contain a four byte header plus any amount of data. In any event, a jumbo packet may not exceed rxrpc_rx_mtu in size.h](h)}(hrxrpc_rx_jumbo_maxh]hrxrpc_rx_jumbo_max}(hj.#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*#ubh)}(hXGThe maximum number of packets that we're willing to accept in a jumbo packet. Non-terminal packets in a jumbo packet must contain a four byte header plus exactly 1412 bytes of data. The terminal packet must contain a four byte header plus any amount of data. In any event, a jumbo packet may not exceed rxrpc_rx_mtu in size.h]hXIThe maximum number of packets that we’re willing to accept in a jumbo packet. Non-terminal packets in a jumbo packet must contain a four byte header plus exactly 1412 bytes of data. The terminal packet must contain a four byte header plus any amount of data. In any event, a jumbo packet may not exceed rxrpc_rx_mtu in size.}(hj<#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*#ubeh}(h]h ]h"]h$]h&]uh1hhj!ubeh}(h]h ]h"]h$]h&]jjjjjjuh1hhj!ubah}(h]h ]h"]h$]h&]uh1hhhhMQhjz!hhubeh}(h]configurable-parametersah ]h"]configurable parametersah$]h&]uh1hhjhhhhhMLubeh}(h]example-client-usageah ]h"]example client usageah$]h&]uh1hhhhhhhhM!ubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksj footnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj#error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjjjjj^ j[ jjjBj?j j ji#jf#j/j,jw!jt!ja#j^#u nametypes}(jjjj^ jjBj ji#j/jw!ja#uh}(jhjjjjj[ jjja j?jj jEjf#jj,jjt!j2j^#jz!u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages](hsystem_message)}(hhh]h)}(h:Enumerated list start value not ordinal-1: "2" (ordinal 2)h]h>Enumerated list start value not ordinal-1: “2” (ordinal 2)}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1j#hjdubj#)}(hhh]h)}(h