netlabel_mgmt.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * NetLabel Management Support
  3. *
  4. * This file defines the management functions for the NetLabel system. The
  5. * NetLabel system manages static and dynamic label mappings for network
  6. * protocols such as CIPSO and RIPSO.
  7. *
  8. * Author: Paul Moore <paul.moore@hp.com>
  9. *
  10. */
  11. /*
  12. * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  22. * the GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  27. *
  28. */
  29. #ifndef _NETLABEL_MGMT_H
  30. #define _NETLABEL_MGMT_H
  31. #include <net/netlabel.h>
  32. /*
  33. * The following NetLabel payloads are supported by the management interface.
  34. *
  35. * o ADD:
  36. * Sent by an application to add a domain mapping to the NetLabel system.
  37. *
  38. * Required attributes:
  39. *
  40. * NLBL_MGMT_A_DOMAIN
  41. * NLBL_MGMT_A_PROTOCOL
  42. *
  43. * If using NETLBL_NLTYPE_CIPSOV4 the following attributes are required:
  44. *
  45. * NLBL_MGMT_A_CV4DOI
  46. *
  47. * If using NETLBL_NLTYPE_UNLABELED no other attributes are required.
  48. *
  49. * o REMOVE:
  50. * Sent by an application to remove a domain mapping from the NetLabel
  51. * system.
  52. *
  53. * Required attributes:
  54. *
  55. * NLBL_MGMT_A_DOMAIN
  56. *
  57. * o LISTALL:
  58. * This message can be sent either from an application or by the kernel in
  59. * response to an application generated LISTALL message. When sent by an
  60. * application there is no payload and the NLM_F_DUMP flag should be set.
  61. * The kernel should respond with a series of the following messages.
  62. *
  63. * Required attributes:
  64. *
  65. * NLBL_MGMT_A_DOMAIN
  66. * NLBL_MGMT_A_PROTOCOL
  67. *
  68. * If using NETLBL_NLTYPE_CIPSOV4 the following attributes are required:
  69. *
  70. * NLBL_MGMT_A_CV4DOI
  71. *
  72. * If using NETLBL_NLTYPE_UNLABELED no other attributes are required.
  73. *
  74. * o ADDDEF:
  75. * Sent by an application to set the default domain mapping for the NetLabel
  76. * system.
  77. *
  78. * Required attributes:
  79. *
  80. * NLBL_MGMT_A_PROTOCOL
  81. *
  82. * If using NETLBL_NLTYPE_CIPSOV4 the following attributes are required:
  83. *
  84. * NLBL_MGMT_A_CV4DOI
  85. *
  86. * If using NETLBL_NLTYPE_UNLABELED no other attributes are required.
  87. *
  88. * o REMOVEDEF:
  89. * Sent by an application to remove the default domain mapping from the
  90. * NetLabel system, there is no payload.
  91. *
  92. * o LISTDEF:
  93. * This message can be sent either from an application or by the kernel in
  94. * response to an application generated LISTDEF message. When sent by an
  95. * application there is no payload. On success the kernel should send a
  96. * response using the following format.
  97. *
  98. * Required attributes:
  99. *
  100. * NLBL_MGMT_A_PROTOCOL
  101. *
  102. * If using NETLBL_NLTYPE_CIPSOV4 the following attributes are required:
  103. *
  104. * NLBL_MGMT_A_CV4DOI
  105. *
  106. * If using NETLBL_NLTYPE_UNLABELED no other attributes are required.
  107. *
  108. * o PROTOCOLS:
  109. * Sent by an application to request a list of configured NetLabel protocols
  110. * in the kernel. When sent by an application there is no payload and the
  111. * NLM_F_DUMP flag should be set. The kernel should respond with a series of
  112. * the following messages.
  113. *
  114. * Required attributes:
  115. *
  116. * NLBL_MGMT_A_PROTOCOL
  117. *
  118. * o VERSION:
  119. * Sent by an application to request the NetLabel version. When sent by an
  120. * application there is no payload. This message type is also used by the
  121. * kernel to respond to an VERSION request.
  122. *
  123. * Required attributes:
  124. *
  125. * NLBL_MGMT_A_VERSION
  126. *
  127. */
  128. /* NetLabel Management commands */
  129. enum {
  130. NLBL_MGMT_C_UNSPEC,
  131. NLBL_MGMT_C_ADD,
  132. NLBL_MGMT_C_REMOVE,
  133. NLBL_MGMT_C_LISTALL,
  134. NLBL_MGMT_C_ADDDEF,
  135. NLBL_MGMT_C_REMOVEDEF,
  136. NLBL_MGMT_C_LISTDEF,
  137. NLBL_MGMT_C_PROTOCOLS,
  138. NLBL_MGMT_C_VERSION,
  139. __NLBL_MGMT_C_MAX,
  140. };
  141. #define NLBL_MGMT_C_MAX (__NLBL_MGMT_C_MAX - 1)
  142. /* NetLabel Management attributes */
  143. enum {
  144. NLBL_MGMT_A_UNSPEC,
  145. NLBL_MGMT_A_DOMAIN,
  146. /* (NLA_NUL_STRING)
  147. * the NULL terminated LSM domain string */
  148. NLBL_MGMT_A_PROTOCOL,
  149. /* (NLA_U32)
  150. * the NetLabel protocol type (defined by NETLBL_NLTYPE_*) */
  151. NLBL_MGMT_A_VERSION,
  152. /* (NLA_U32)
  153. * the NetLabel protocol version number (defined by
  154. * NETLBL_PROTO_VERSION) */
  155. NLBL_MGMT_A_CV4DOI,
  156. /* (NLA_U32)
  157. * the CIPSOv4 DOI value */
  158. __NLBL_MGMT_A_MAX,
  159. };
  160. #define NLBL_MGMT_A_MAX (__NLBL_MGMT_A_MAX - 1)
  161. /* NetLabel protocol functions */
  162. int netlbl_mgmt_genl_init(void);
  163. #endif