Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
0002 /* Types and definitions for AF_RXRPC.
0003  *
0004  * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
0005  * Written by David Howells (dhowells@redhat.com)
0006  */
0007 
0008 #ifndef _UAPI_LINUX_RXRPC_H
0009 #define _UAPI_LINUX_RXRPC_H
0010 
0011 #include <linux/types.h>
0012 #include <linux/in.h>
0013 #include <linux/in6.h>
0014 
0015 /*
0016  * RxRPC socket address
0017  */
0018 struct sockaddr_rxrpc {
0019     __kernel_sa_family_t    srx_family; /* address family */
0020     __u16           srx_service;    /* service desired */
0021     __u16           transport_type; /* type of transport socket (SOCK_DGRAM) */
0022     __u16           transport_len;  /* length of transport address */
0023     union {
0024         __kernel_sa_family_t family;    /* transport address family */
0025         struct sockaddr_in sin;     /* IPv4 transport address */
0026         struct sockaddr_in6 sin6;   /* IPv6 transport address */
0027     } transport;
0028 };
0029 
0030 /*
0031  * RxRPC socket options
0032  */
0033 #define RXRPC_SECURITY_KEY      1   /* [clnt] set client security key */
0034 #define RXRPC_SECURITY_KEYRING      2   /* [srvr] set ring of server security keys */
0035 #define RXRPC_EXCLUSIVE_CONNECTION  3   /* Deprecated; use RXRPC_EXCLUSIVE_CALL instead */
0036 #define RXRPC_MIN_SECURITY_LEVEL    4   /* minimum security level */
0037 #define RXRPC_UPGRADEABLE_SERVICE   5   /* Upgrade service[0] -> service[1] */
0038 #define RXRPC_SUPPORTED_CMSG        6   /* Get highest supported control message type */
0039 
0040 /*
0041  * RxRPC control messages
0042  * - If neither abort or accept are specified, the message is a data message.
0043  * - terminal messages mean that a user call ID tag can be recycled
0044  * - s/r/- indicate whether these are applicable to sendmsg() and/or recvmsg()
0045  */
0046 enum rxrpc_cmsg_type {
0047     RXRPC_USER_CALL_ID  = 1,    /* sr: user call ID specifier */
0048     RXRPC_ABORT     = 2,    /* sr: abort request / notification [terminal] */
0049     RXRPC_ACK       = 3,    /* -r: [Service] RPC op final ACK received [terminal] */
0050     RXRPC_NET_ERROR     = 5,    /* -r: network error received [terminal] */
0051     RXRPC_BUSY      = 6,    /* -r: server busy received [terminal] */
0052     RXRPC_LOCAL_ERROR   = 7,    /* -r: local error generated [terminal] */
0053     RXRPC_NEW_CALL      = 8,    /* -r: [Service] new incoming call notification */
0054     RXRPC_EXCLUSIVE_CALL    = 10,   /* s-: Call should be on exclusive connection */
0055     RXRPC_UPGRADE_SERVICE   = 11,   /* s-: Request service upgrade for client call */
0056     RXRPC_TX_LENGTH     = 12,   /* s-: Total length of Tx data */
0057     RXRPC_SET_CALL_TIMEOUT  = 13,   /* s-: Set one or more call timeouts */
0058     RXRPC_CHARGE_ACCEPT = 14,   /* s-: Charge the accept pool with a user call ID */
0059     RXRPC__SUPPORTED
0060 };
0061 
0062 /*
0063  * RxRPC security levels
0064  */
0065 #define RXRPC_SECURITY_PLAIN    0   /* plain secure-checksummed packets only */
0066 #define RXRPC_SECURITY_AUTH 1   /* authenticated packets */
0067 #define RXRPC_SECURITY_ENCRYPT  2   /* encrypted packets */
0068 
0069 /*
0070  * RxRPC security indices
0071  */
0072 #define RXRPC_SECURITY_NONE 0   /* no security protocol */
0073 #define RXRPC_SECURITY_RXKAD    2   /* kaserver or kerberos 4 */
0074 #define RXRPC_SECURITY_RXGK 4   /* gssapi-based */
0075 #define RXRPC_SECURITY_RXK5 5   /* kerberos 5 */
0076 
0077 /*
0078  * RxRPC-level abort codes
0079  */
0080 #define RX_CALL_DEAD        -1  /* call/conn has been inactive and is shut down */
0081 #define RX_INVALID_OPERATION    -2  /* invalid operation requested / attempted */
0082 #define RX_CALL_TIMEOUT     -3  /* call timeout exceeded */
0083 #define RX_EOF          -4  /* unexpected end of data on read op */
0084 #define RX_PROTOCOL_ERROR   -5  /* low-level protocol error */
0085 #define RX_USER_ABORT       -6  /* generic user abort */
0086 #define RX_ADDRINUSE        -7  /* UDP port in use */
0087 #define RX_DEBUGI_BADTYPE   -8  /* bad debugging packet type */
0088 
0089 /*
0090  * (un)marshalling abort codes (rxgen)
0091  */
0092 #define RXGEN_CC_MARSHAL    -450
0093 #define RXGEN_CC_UNMARSHAL  -451
0094 #define RXGEN_SS_MARSHAL    -452
0095 #define RXGEN_SS_UNMARSHAL  -453
0096 #define RXGEN_DECODE        -454
0097 #define RXGEN_OPCODE        -455
0098 #define RXGEN_SS_XDRFREE    -456
0099 #define RXGEN_CC_XDRFREE    -457
0100 
0101 /*
0102  * Rx kerberos security abort codes
0103  * - unfortunately we have no generalised security abort codes to say things
0104  *   like "unsupported security", so we have to use these instead and hope the
0105  *   other side understands
0106  */
0107 #define RXKADINCONSISTENCY  19270400    /* security module structure inconsistent */
0108 #define RXKADPACKETSHORT    19270401    /* packet too short for security challenge */
0109 #define RXKADLEVELFAIL      19270402    /* security level negotiation failed */
0110 #define RXKADTICKETLEN      19270403    /* ticket length too short or too long */
0111 #define RXKADOUTOFSEQUENCE  19270404    /* packet had bad sequence number */
0112 #define RXKADNOAUTH     19270405    /* caller not authorised */
0113 #define RXKADBADKEY     19270406    /* illegal key: bad parity or weak */
0114 #define RXKADBADTICKET      19270407    /* security object was passed a bad ticket */
0115 #define RXKADUNKNOWNKEY     19270408    /* ticket contained unknown key version number */
0116 #define RXKADEXPIRED        19270409    /* authentication expired */
0117 #define RXKADSEALEDINCON    19270410    /* sealed data inconsistent */
0118 #define RXKADDATALEN        19270411    /* user data too long */
0119 #define RXKADILLEGALLEVEL   19270412    /* caller not authorised to use encrypted conns */
0120 
0121 #endif /* _UAPI_LINUX_RXRPC_H */