| Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 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 | /* | 
|  | 13 | * (c) Copyright Hewlett-Packard Development Company, L.P., 2006 | 
|  | 14 | * | 
|  | 15 | * This program is free software;  you can redistribute it and/or modify | 
|  | 16 | * it under the terms of the GNU General Public License as published by | 
|  | 17 | * the Free Software Foundation; either version 2 of the License, or | 
|  | 18 | * (at your option) any later version. | 
|  | 19 | * | 
|  | 20 | * This program is distributed in the hope that it will be useful, | 
|  | 21 | * but WITHOUT ANY WARRANTY;  without even the implied warranty of | 
|  | 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See | 
|  | 23 | * the GNU General Public License for more details. | 
|  | 24 | * | 
|  | 25 | * You should have received a copy of the GNU General Public License | 
|  | 26 | * along with this program;  if not, write to the Free Software | 
|  | 27 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 
|  | 28 | * | 
|  | 29 | */ | 
|  | 30 |  | 
|  | 31 | #ifndef _NETLABEL_UNLABELED_H | 
|  | 32 | #define _NETLABEL_UNLABELED_H | 
|  | 33 |  | 
|  | 34 | #include <net/netlabel.h> | 
|  | 35 |  | 
|  | 36 | /* | 
|  | 37 | * The following NetLabel payloads are supported by the Unlabeled subsystem. | 
|  | 38 | * | 
| Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 39 | * o ACCEPT | 
|  | 40 | *   This message is sent from an application to specify if the kernel should | 
|  | 41 | *   allow unlabled packets to pass if they do not match any of the static | 
|  | 42 | *   mappings defined in the unlabeled module. | 
|  | 43 | * | 
| Paul Moore | fd38585 | 2006-09-25 15:56:37 -0700 | [diff] [blame] | 44 | *   Required attributes: | 
| Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 45 | * | 
| Paul Moore | fd38585 | 2006-09-25 15:56:37 -0700 | [diff] [blame] | 46 | *     NLBL_UNLABEL_A_ACPTFLG | 
| Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 47 | * | 
|  | 48 | * o LIST | 
|  | 49 | *   This message can be sent either from an application or by the kernel in | 
|  | 50 | *   response to an application generated LIST message.  When sent by an | 
|  | 51 | *   application there is no payload.  The kernel should respond to a LIST | 
| Paul Moore | fd38585 | 2006-09-25 15:56:37 -0700 | [diff] [blame] | 52 | *   message with a LIST message on success. | 
| Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 53 | * | 
| Paul Moore | fd38585 | 2006-09-25 15:56:37 -0700 | [diff] [blame] | 54 | *   Required attributes: | 
| Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 55 | * | 
| Paul Moore | fd38585 | 2006-09-25 15:56:37 -0700 | [diff] [blame] | 56 | *     NLBL_UNLABEL_A_ACPTFLG | 
| Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 57 | * | 
|  | 58 | */ | 
|  | 59 |  | 
|  | 60 | /* NetLabel Unlabeled commands */ | 
|  | 61 | enum { | 
|  | 62 | NLBL_UNLABEL_C_UNSPEC, | 
| Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 63 | NLBL_UNLABEL_C_ACCEPT, | 
|  | 64 | NLBL_UNLABEL_C_LIST, | 
|  | 65 | __NLBL_UNLABEL_C_MAX, | 
|  | 66 | }; | 
|  | 67 | #define NLBL_UNLABEL_C_MAX (__NLBL_UNLABEL_C_MAX - 1) | 
|  | 68 |  | 
| Paul Moore | fd38585 | 2006-09-25 15:56:37 -0700 | [diff] [blame] | 69 | /* NetLabel Unlabeled attributes */ | 
|  | 70 | enum { | 
|  | 71 | NLBL_UNLABEL_A_UNSPEC, | 
|  | 72 | NLBL_UNLABEL_A_ACPTFLG, | 
|  | 73 | /* (NLA_U8) | 
|  | 74 | * if true then unlabeled packets are allowed to pass, else unlabeled | 
|  | 75 | * packets are rejected */ | 
|  | 76 | __NLBL_UNLABEL_A_MAX, | 
|  | 77 | }; | 
|  | 78 | #define NLBL_UNLABEL_A_MAX (__NLBL_UNLABEL_A_MAX - 1) | 
|  | 79 |  | 
| Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 80 | /* NetLabel protocol functions */ | 
|  | 81 | int netlbl_unlabel_genl_init(void); | 
|  | 82 |  | 
|  | 83 | /* Process Unlabeled incoming network packets */ | 
|  | 84 | int netlbl_unlabel_getattr(struct netlbl_lsm_secattr *secattr); | 
|  | 85 |  | 
|  | 86 | /* Set the default configuration to allow Unlabeled packets */ | 
|  | 87 | int netlbl_unlabel_defconf(void); | 
|  | 88 |  | 
|  | 89 | #endif |