rxrpc.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
  2. /* Types and definitions for AF_RXRPC.
  3. *
  4. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  5. * Written by David Howells ([email protected])
  6. */
  7. #ifndef _UAPI_LINUX_RXRPC_H
  8. #define _UAPI_LINUX_RXRPC_H
  9. #include <linux/types.h>
  10. #include <linux/in.h>
  11. #include <linux/in6.h>
  12. /*
  13. * RxRPC socket address
  14. */
  15. struct sockaddr_rxrpc {
  16. __kernel_sa_family_t srx_family; /* address family */
  17. __u16 srx_service; /* service desired */
  18. __u16 transport_type; /* type of transport socket (SOCK_DGRAM) */
  19. __u16 transport_len; /* length of transport address */
  20. union {
  21. __kernel_sa_family_t family; /* transport address family */
  22. struct sockaddr_in sin; /* IPv4 transport address */
  23. struct sockaddr_in6 sin6; /* IPv6 transport address */
  24. } transport;
  25. };
  26. /*
  27. * RxRPC socket options
  28. */
  29. #define RXRPC_SECURITY_KEY 1 /* [clnt] set client security key */
  30. #define RXRPC_SECURITY_KEYRING 2 /* [srvr] set ring of server security keys */
  31. #define RXRPC_EXCLUSIVE_CONNECTION 3 /* Deprecated; use RXRPC_EXCLUSIVE_CALL instead */
  32. #define RXRPC_MIN_SECURITY_LEVEL 4 /* minimum security level */
  33. #define RXRPC_UPGRADEABLE_SERVICE 5 /* Upgrade service[0] -> service[1] */
  34. #define RXRPC_SUPPORTED_CMSG 6 /* Get highest supported control message type */
  35. /*
  36. * RxRPC control messages
  37. * - If neither abort or accept are specified, the message is a data message.
  38. * - terminal messages mean that a user call ID tag can be recycled
  39. * - s/r/- indicate whether these are applicable to sendmsg() and/or recvmsg()
  40. */
  41. enum rxrpc_cmsg_type {
  42. RXRPC_USER_CALL_ID = 1, /* sr: user call ID specifier */
  43. RXRPC_ABORT = 2, /* sr: abort request / notification [terminal] */
  44. RXRPC_ACK = 3, /* -r: [Service] RPC op final ACK received [terminal] */
  45. RXRPC_NET_ERROR = 5, /* -r: network error received [terminal] */
  46. RXRPC_BUSY = 6, /* -r: server busy received [terminal] */
  47. RXRPC_LOCAL_ERROR = 7, /* -r: local error generated [terminal] */
  48. RXRPC_NEW_CALL = 8, /* -r: [Service] new incoming call notification */
  49. RXRPC_EXCLUSIVE_CALL = 10, /* s-: Call should be on exclusive connection */
  50. RXRPC_UPGRADE_SERVICE = 11, /* s-: Request service upgrade for client call */
  51. RXRPC_TX_LENGTH = 12, /* s-: Total length of Tx data */
  52. RXRPC_SET_CALL_TIMEOUT = 13, /* s-: Set one or more call timeouts */
  53. RXRPC_CHARGE_ACCEPT = 14, /* s-: Charge the accept pool with a user call ID */
  54. RXRPC__SUPPORTED
  55. };
  56. /*
  57. * RxRPC security levels
  58. */
  59. #define RXRPC_SECURITY_PLAIN 0 /* plain secure-checksummed packets only */
  60. #define RXRPC_SECURITY_AUTH 1 /* authenticated packets */
  61. #define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */
  62. /*
  63. * RxRPC security indices
  64. */
  65. #define RXRPC_SECURITY_NONE 0 /* no security protocol */
  66. #define RXRPC_SECURITY_RXKAD 2 /* kaserver or kerberos 4 */
  67. #define RXRPC_SECURITY_RXGK 4 /* gssapi-based */
  68. #define RXRPC_SECURITY_RXK5 5 /* kerberos 5 */
  69. /*
  70. * RxRPC-level abort codes
  71. */
  72. #define RX_CALL_DEAD -1 /* call/conn has been inactive and is shut down */
  73. #define RX_INVALID_OPERATION -2 /* invalid operation requested / attempted */
  74. #define RX_CALL_TIMEOUT -3 /* call timeout exceeded */
  75. #define RX_EOF -4 /* unexpected end of data on read op */
  76. #define RX_PROTOCOL_ERROR -5 /* low-level protocol error */
  77. #define RX_USER_ABORT -6 /* generic user abort */
  78. #define RX_ADDRINUSE -7 /* UDP port in use */
  79. #define RX_DEBUGI_BADTYPE -8 /* bad debugging packet type */
  80. /*
  81. * (un)marshalling abort codes (rxgen)
  82. */
  83. #define RXGEN_CC_MARSHAL -450
  84. #define RXGEN_CC_UNMARSHAL -451
  85. #define RXGEN_SS_MARSHAL -452
  86. #define RXGEN_SS_UNMARSHAL -453
  87. #define RXGEN_DECODE -454
  88. #define RXGEN_OPCODE -455
  89. #define RXGEN_SS_XDRFREE -456
  90. #define RXGEN_CC_XDRFREE -457
  91. /*
  92. * Rx kerberos security abort codes
  93. * - unfortunately we have no generalised security abort codes to say things
  94. * like "unsupported security", so we have to use these instead and hope the
  95. * other side understands
  96. */
  97. #define RXKADINCONSISTENCY 19270400 /* security module structure inconsistent */
  98. #define RXKADPACKETSHORT 19270401 /* packet too short for security challenge */
  99. #define RXKADLEVELFAIL 19270402 /* security level negotiation failed */
  100. #define RXKADTICKETLEN 19270403 /* ticket length too short or too long */
  101. #define RXKADOUTOFSEQUENCE 19270404 /* packet had bad sequence number */
  102. #define RXKADNOAUTH 19270405 /* caller not authorised */
  103. #define RXKADBADKEY 19270406 /* illegal key: bad parity or weak */
  104. #define RXKADBADTICKET 19270407 /* security object was passed a bad ticket */
  105. #define RXKADUNKNOWNKEY 19270408 /* ticket contained unknown key version number */
  106. #define RXKADEXPIRED 19270409 /* authentication expired */
  107. #define RXKADSEALEDINCON 19270410 /* sealed data inconsistent */
  108. #define RXKADDATALEN 19270411 /* user data too long */
  109. #define RXKADILLEGALLEVEL 19270412 /* caller not authorised to use encrypted conns */
  110. #endif /* _UAPI_LINUX_RXRPC_H */