rxrpc.h 5.0 KB

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