netlabel_unlabeled.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * NetLabel Unlabeled Support
  3. *
  4. * This file defines functions for dealing with unlabeled packets for the
  5. * NetLabel system. The NetLabel system manages static and dynamic label
  6. * mappings for network 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_UNLABELED_H
  30. #define _NETLABEL_UNLABELED_H
  31. #include <net/netlabel.h>
  32. /*
  33. * The following NetLabel payloads are supported by the Unlabeled subsystem.
  34. *
  35. * o ACCEPT
  36. * This message is sent from an application to specify if the kernel should
  37. * allow unlabled packets to pass if they do not match any of the static
  38. * mappings defined in the unlabeled module.
  39. *
  40. * Required attributes:
  41. *
  42. * NLBL_UNLABEL_A_ACPTFLG
  43. *
  44. * o LIST
  45. * This message can be sent either from an application or by the kernel in
  46. * response to an application generated LIST message. When sent by an
  47. * application there is no payload. The kernel should respond to a LIST
  48. * message with a LIST message on success.
  49. *
  50. * Required attributes:
  51. *
  52. * NLBL_UNLABEL_A_ACPTFLG
  53. *
  54. */
  55. /* NetLabel Unlabeled commands */
  56. enum {
  57. NLBL_UNLABEL_C_UNSPEC,
  58. NLBL_UNLABEL_C_ACCEPT,
  59. NLBL_UNLABEL_C_LIST,
  60. __NLBL_UNLABEL_C_MAX,
  61. };
  62. #define NLBL_UNLABEL_C_MAX (__NLBL_UNLABEL_C_MAX - 1)
  63. /* NetLabel Unlabeled attributes */
  64. enum {
  65. NLBL_UNLABEL_A_UNSPEC,
  66. NLBL_UNLABEL_A_ACPTFLG,
  67. /* (NLA_U8)
  68. * if true then unlabeled packets are allowed to pass, else unlabeled
  69. * packets are rejected */
  70. __NLBL_UNLABEL_A_MAX,
  71. };
  72. #define NLBL_UNLABEL_A_MAX (__NLBL_UNLABEL_A_MAX - 1)
  73. /* NetLabel protocol functions */
  74. int netlbl_unlabel_genl_init(void);
  75. /* Process Unlabeled incoming network packets */
  76. int netlbl_unlabel_getattr(struct netlbl_lsm_secattr *secattr);
  77. /* Set the default configuration to allow Unlabeled packets */
  78. int netlbl_unlabel_defconf(void);
  79. #endif