netlabel_cipso_v4.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. * NetLabel CIPSO/IPv4 Support
  3. *
  4. * This file defines the CIPSO/IPv4 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_CIPSO_V4
  30. #define _NETLABEL_CIPSO_V4
  31. #include <net/netlabel.h>
  32. /*
  33. * The following NetLabel payloads are supported by the CIPSO subsystem.
  34. *
  35. * o ADD:
  36. * Sent by an application to add a new DOI mapping table.
  37. *
  38. * Required attributes:
  39. *
  40. * NLBL_CIPSOV4_A_DOI
  41. * NLBL_CIPSOV4_A_MTYPE
  42. * NLBL_CIPSOV4_A_TAGLST
  43. *
  44. * If using CIPSO_V4_MAP_STD the following attributes are required:
  45. *
  46. * NLBL_CIPSOV4_A_MLSLVLLST
  47. * NLBL_CIPSOV4_A_MLSCATLST
  48. *
  49. * If using CIPSO_V4_MAP_PASS no additional attributes are required.
  50. *
  51. * o REMOVE:
  52. * Sent by an application to remove a specific DOI mapping table from the
  53. * CIPSO V4 system.
  54. *
  55. * Required attributes:
  56. *
  57. * NLBL_CIPSOV4_A_DOI
  58. *
  59. * o LIST:
  60. * Sent by an application to list the details of a DOI definition. On
  61. * success the kernel should send a response using the following format.
  62. *
  63. * Required attributes:
  64. *
  65. * NLBL_CIPSOV4_A_DOI
  66. *
  67. * The valid response message format depends on the type of the DOI mapping,
  68. * the defined formats are shown below.
  69. *
  70. * Required attributes:
  71. *
  72. * NLBL_CIPSOV4_A_MTYPE
  73. * NLBL_CIPSOV4_A_TAGLST
  74. *
  75. * If using CIPSO_V4_MAP_STD the following attributes are required:
  76. *
  77. * NLBL_CIPSOV4_A_MLSLVLLST
  78. * NLBL_CIPSOV4_A_MLSCATLST
  79. *
  80. * If using CIPSO_V4_MAP_PASS no additional attributes are required.
  81. *
  82. * o LISTALL:
  83. * This message is sent by an application to list the valid DOIs on the
  84. * system. When sent by an application there is no payload and the
  85. * NLM_F_DUMP flag should be set. The kernel should respond with a series of
  86. * the following messages.
  87. *
  88. * Required attributes:
  89. *
  90. * NLBL_CIPSOV4_A_DOI
  91. * NLBL_CIPSOV4_A_MTYPE
  92. *
  93. */
  94. /* NetLabel CIPSOv4 commands */
  95. enum {
  96. NLBL_CIPSOV4_C_UNSPEC,
  97. NLBL_CIPSOV4_C_ADD,
  98. NLBL_CIPSOV4_C_REMOVE,
  99. NLBL_CIPSOV4_C_LIST,
  100. NLBL_CIPSOV4_C_LISTALL,
  101. __NLBL_CIPSOV4_C_MAX,
  102. };
  103. #define NLBL_CIPSOV4_C_MAX (__NLBL_CIPSOV4_C_MAX - 1)
  104. /* NetLabel CIPSOv4 attributes */
  105. enum {
  106. NLBL_CIPSOV4_A_UNSPEC,
  107. NLBL_CIPSOV4_A_DOI,
  108. /* (NLA_U32)
  109. * the DOI value */
  110. NLBL_CIPSOV4_A_MTYPE,
  111. /* (NLA_U32)
  112. * the mapping table type (defined in the cipso_ipv4.h header as
  113. * CIPSO_V4_MAP_*) */
  114. NLBL_CIPSOV4_A_TAG,
  115. /* (NLA_U8)
  116. * a CIPSO tag type, meant to be used within a NLBL_CIPSOV4_A_TAGLST
  117. * attribute */
  118. NLBL_CIPSOV4_A_TAGLST,
  119. /* (NLA_NESTED)
  120. * the CIPSO tag list for the DOI, there must be at least one
  121. * NLBL_CIPSOV4_A_TAG attribute, tags listed first are given higher
  122. * priorirty when sending packets */
  123. NLBL_CIPSOV4_A_MLSLVLLOC,
  124. /* (NLA_U32)
  125. * the local MLS sensitivity level */
  126. NLBL_CIPSOV4_A_MLSLVLREM,
  127. /* (NLA_U32)
  128. * the remote MLS sensitivity level */
  129. NLBL_CIPSOV4_A_MLSLVL,
  130. /* (NLA_NESTED)
  131. * a MLS sensitivity level mapping, must contain only one attribute of
  132. * each of the following types: NLBL_CIPSOV4_A_MLSLVLLOC and
  133. * NLBL_CIPSOV4_A_MLSLVLREM */
  134. NLBL_CIPSOV4_A_MLSLVLLST,
  135. /* (NLA_NESTED)
  136. * the CIPSO level mappings, there must be at least one
  137. * NLBL_CIPSOV4_A_MLSLVL attribute */
  138. NLBL_CIPSOV4_A_MLSCATLOC,
  139. /* (NLA_U32)
  140. * the local MLS category */
  141. NLBL_CIPSOV4_A_MLSCATREM,
  142. /* (NLA_U32)
  143. * the remote MLS category */
  144. NLBL_CIPSOV4_A_MLSCAT,
  145. /* (NLA_NESTED)
  146. * a MLS category mapping, must contain only one attribute of each of
  147. * the following types: NLBL_CIPSOV4_A_MLSCATLOC and
  148. * NLBL_CIPSOV4_A_MLSCATREM */
  149. NLBL_CIPSOV4_A_MLSCATLST,
  150. /* (NLA_NESTED)
  151. * the CIPSO category mappings, there must be at least one
  152. * NLBL_CIPSOV4_A_MLSCAT attribute */
  153. __NLBL_CIPSOV4_A_MAX,
  154. };
  155. #define NLBL_CIPSOV4_A_MAX (__NLBL_CIPSOV4_A_MAX - 1)
  156. /* NetLabel protocol functions */
  157. int netlbl_cipsov4_genl_init(void);
  158. #endif