vki-xen-xsm.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. This file is part of Valgrind, a dynamic binary instrumentation
  3. framework.
  4. Copyright (C) 2012-2017 Citrix
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the
  8. License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  16. 02111-1307, USA.
  17. The GNU General Public License is contained in the file COPYING.
  18. */
  19. /* Contributed by Andrew Cooper <andrew.cooper3@citrix.com>
  20. and Ian Campbell <ian.campbell@citrix.com> */
  21. #ifndef __VKI_XEN_XSM_H
  22. #define __VKI_XEN_XSM_H
  23. #define VKI_XEN_FLASK_INTERFACE_VERSION 1
  24. struct vki_xen_flask_sid_context {
  25. /* IN/OUT: sid to convert to/from string */
  26. vki_uint32_t sid;
  27. /* IN: size of the context buffer
  28. * OUT: actual size of the output context string
  29. */
  30. vki_uint32_t size;
  31. VKI_XEN_GUEST_HANDLE(char) context;
  32. };
  33. struct vki_xen_flask_op {
  34. vki_uint32_t cmd;
  35. #define VKI_FLASK_LOAD 1
  36. #define VKI_FLASK_GETENFORCE 2
  37. #define VKI_FLASK_SETENFORCE 3
  38. #define VKI_FLASK_CONTEXT_TO_SID 4
  39. #define VKI_FLASK_SID_TO_CONTEXT 5
  40. #define VKI_FLASK_ACCESS 6
  41. #define VKI_FLASK_CREATE 7
  42. #define VKI_FLASK_RELABEL 8
  43. #define VKI_FLASK_USER 9
  44. #define VKI_FLASK_POLICYVERS 10
  45. #define VKI_FLASK_GETBOOL 11
  46. #define VKI_FLASK_SETBOOL 12
  47. #define VKI_FLASK_COMMITBOOLS 13
  48. #define VKI_FLASK_MLS 14
  49. #define VKI_FLASK_DISABLE 15
  50. #define VKI_FLASK_GETAVC_THRESHOLD 16
  51. #define VKI_FLASK_SETAVC_THRESHOLD 17
  52. #define VKI_FLASK_AVC_HASHSTATS 18
  53. #define VKI_FLASK_AVC_CACHESTATS 19
  54. #define VKI_FLASK_MEMBER 20
  55. #define VKI_FLASK_ADD_OCONTEXT 21
  56. #define VKI_FLASK_DEL_OCONTEXT 22
  57. #define VKI_FLASK_GET_PEER_SID 23
  58. #define VKI_FLASK_RELABEL_DOMAIN 24
  59. vki_uint32_t interface_version; /* VKI_XEN_FLASK_INTERFACE_VERSION */
  60. union {
  61. //struct vki_xen_flask_load load;
  62. //struct vki_xen_flask_setenforce enforce;
  63. /* FLASK_CONTEXT_TO_SID and FLASK_SID_TO_CONTEXT */
  64. struct vki_xen_flask_sid_context sid_context;
  65. //struct vki_xen_flask_access access;
  66. /* FLASK_CREATE, FLASK_RELABEL, FLASK_MEMBER */
  67. //struct vki_xen_flask_transition transition;
  68. //struct vki_xen_flask_userlist userlist;
  69. /* FLASK_GETBOOL, FLASK_SETBOOL */
  70. //struct vki_xen_flask_boolean boolean;
  71. //struct vki_xen_flask_setavc_threshold setavc_threshold;
  72. //struct vki_xen_flask_hash_stats hash_stats;
  73. //struct vki_xen_flask_cache_stats cache_stats;
  74. /* FLASK_ADD_OCONTEXT, FLASK_DEL_OCONTEXT */
  75. //struct vki_xen_flask_ocontext ocontext;
  76. //struct vki_xen_flask_peersid peersid;
  77. //struct vki_xen_flask_relabel relabel;
  78. } u;
  79. };
  80. #endif // __VKI_XEN_XSM_H
  81. /*--------------------------------------------------------------------*/
  82. /*--- end ---*/
  83. /*--------------------------------------------------------------------*/