David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 1 | /* AF_RXRPC parameters |
| 2 | * |
| 3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. |
| 4 | * Written by David Howells (dhowells@redhat.com) |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the License, or (at your option) any later version. |
| 10 | */ |
| 11 | |
| 12 | #ifndef _LINUX_RXRPC_H |
| 13 | #define _LINUX_RXRPC_H |
| 14 | |
| 15 | #include <linux/in.h> |
| 16 | #include <linux/in6.h> |
| 17 | |
| 18 | /* |
| 19 | * RxRPC socket address |
| 20 | */ |
| 21 | struct sockaddr_rxrpc { |
| 22 | sa_family_t srx_family; /* address family */ |
| 23 | u16 srx_service; /* service desired */ |
| 24 | u16 transport_type; /* type of transport socket (SOCK_DGRAM) */ |
| 25 | u16 transport_len; /* length of transport address */ |
| 26 | union { |
| 27 | sa_family_t family; /* transport address family */ |
| 28 | struct sockaddr_in sin; /* IPv4 transport address */ |
| 29 | struct sockaddr_in6 sin6; /* IPv6 transport address */ |
| 30 | } transport; |
| 31 | }; |
| 32 | |
| 33 | /* |
| 34 | * RxRPC socket options |
| 35 | */ |
| 36 | #define RXRPC_SECURITY_KEY 1 /* [clnt] set client security key */ |
| 37 | #define RXRPC_SECURITY_KEYRING 2 /* [srvr] set ring of server security keys */ |
David Howells | cc8feb8 | 2016-04-04 14:00:37 +0100 | [diff] [blame] | 38 | #define RXRPC_EXCLUSIVE_CONNECTION 3 /* Deprecated; use RXRPC_EXCLUSIVE_CALL instead */ |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 39 | #define RXRPC_MIN_SECURITY_LEVEL 4 /* minimum security level */ |
David Howells | 4722974 | 2017-06-05 14:30:49 +0100 | [diff] [blame] | 40 | #define RXRPC_UPGRADEABLE_SERVICE 5 /* Upgrade service[0] -> service[1] */ |
David Howells | 515559c | 2017-06-07 16:27:15 +0100 | [diff] [blame] | 41 | #define RXRPC_SUPPORTED_CMSG 6 /* Get highest supported control message type */ |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 42 | |
| 43 | /* |
| 44 | * RxRPC control messages |
David Howells | 2341e07 | 2016-06-09 23:02:51 +0100 | [diff] [blame] | 45 | * - If neither abort or accept are specified, the message is a data message. |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 46 | * - terminal messages mean that a user call ID tag can be recycled |
David Howells | 2341e07 | 2016-06-09 23:02:51 +0100 | [diff] [blame] | 47 | * - s/r/- indicate whether these are applicable to sendmsg() and/or recvmsg() |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 48 | */ |
David Howells | 515559c | 2017-06-07 16:27:15 +0100 | [diff] [blame] | 49 | enum rxrpc_cmsg_type { |
| 50 | RXRPC_USER_CALL_ID = 1, /* sr: user call ID specifier */ |
| 51 | RXRPC_ABORT = 2, /* sr: abort request / notification [terminal] */ |
| 52 | RXRPC_ACK = 3, /* -r: [Service] RPC op final ACK received [terminal] */ |
| 53 | RXRPC_NET_ERROR = 5, /* -r: network error received [terminal] */ |
| 54 | RXRPC_BUSY = 6, /* -r: server busy received [terminal] */ |
| 55 | RXRPC_LOCAL_ERROR = 7, /* -r: local error generated [terminal] */ |
| 56 | RXRPC_NEW_CALL = 8, /* -r: [Service] new incoming call notification */ |
| 57 | RXRPC_ACCEPT = 9, /* s-: [Service] accept request */ |
| 58 | RXRPC_EXCLUSIVE_CALL = 10, /* s-: Call should be on exclusive connection */ |
| 59 | RXRPC_UPGRADE_SERVICE = 11, /* s-: Request service upgrade for client call */ |
David Howells | e754eba | 2017-06-07 12:40:03 +0100 | [diff] [blame] | 60 | RXRPC_TX_LENGTH = 12, /* s-: Total length of Tx data */ |
David Howells | 515559c | 2017-06-07 16:27:15 +0100 | [diff] [blame] | 61 | RXRPC__SUPPORTED |
| 62 | }; |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 63 | |
| 64 | /* |
| 65 | * RxRPC security levels |
| 66 | */ |
| 67 | #define RXRPC_SECURITY_PLAIN 0 /* plain secure-checksummed packets only */ |
| 68 | #define RXRPC_SECURITY_AUTH 1 /* authenticated packets */ |
| 69 | #define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */ |
| 70 | |
David Howells | 8b81547 | 2009-09-14 01:17:30 +0000 | [diff] [blame] | 71 | /* |
| 72 | * RxRPC security indices |
| 73 | */ |
| 74 | #define RXRPC_SECURITY_NONE 0 /* no security protocol */ |
| 75 | #define RXRPC_SECURITY_RXKAD 2 /* kaserver or kerberos 4 */ |
| 76 | #define RXRPC_SECURITY_RXGK 4 /* gssapi-based */ |
| 77 | #define RXRPC_SECURITY_RXK5 5 /* kerberos 5 */ |
David Howells | 17926a7 | 2007-04-26 15:48:28 -0700 | [diff] [blame] | 78 | |
| 79 | #endif /* _LINUX_RXRPC_H */ |