Thomas Gleixner | 1ccea77 | 2019-05-19 15:51:43 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 2 | /* |
| 3 | * NetLabel NETLINK Interface |
| 4 | * |
| 5 | * This file defines the NETLINK interface for the NetLabel system. The |
| 6 | * NetLabel system manages static and dynamic label mappings for network |
| 7 | * protocols such as CIPSO and RIPSO. |
| 8 | * |
Paul Moore | 82c21bf | 2011-08-01 11:10:33 +0000 | [diff] [blame] | 9 | * Author: Paul Moore <paul@paul-moore.com> |
Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | /* |
| 13 | * (c) Copyright Hewlett-Packard Development Company, L.P., 2006 |
Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef _NETLABEL_USER_H |
| 17 | #define _NETLABEL_USER_H |
| 18 | |
Paul Moore | 7a0e1d6 | 2006-08-29 17:56:04 -0700 | [diff] [blame] | 19 | #include <linux/types.h> |
Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 20 | #include <linux/skbuff.h> |
| 21 | #include <linux/capability.h> |
Paul Moore | 32f50cd | 2006-09-28 14:51:47 -0700 | [diff] [blame] | 22 | #include <linux/audit.h> |
Paul Moore | 7a0e1d6 | 2006-08-29 17:56:04 -0700 | [diff] [blame] | 23 | #include <net/netlink.h> |
Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 24 | #include <net/genetlink.h> |
Paul Moore | 7a0e1d6 | 2006-08-29 17:56:04 -0700 | [diff] [blame] | 25 | #include <net/netlabel.h> |
Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 26 | |
| 27 | /* NetLabel NETLINK helper functions */ |
| 28 | |
| 29 | /** |
Paul Moore | 95d4e6b | 2006-09-29 17:05:05 -0700 | [diff] [blame] | 30 | * netlbl_netlink_auditinfo - Fetch the audit information from a NETLINK msg |
Paul Moore | 95d4e6b | 2006-09-29 17:05:05 -0700 | [diff] [blame] | 31 | * @audit_info: NetLabel audit information |
| 32 | */ |
Zheng Yejian | f7e0318 | 2021-05-19 15:34:38 +0800 | [diff] [blame^] | 33 | static inline void netlbl_netlink_auditinfo(struct netlbl_audit *audit_info) |
Paul Moore | 95d4e6b | 2006-09-29 17:05:05 -0700 | [diff] [blame] | 34 | { |
Paul Moore | 4ebd765 | 2021-02-19 14:26:21 -0500 | [diff] [blame] | 35 | security_task_getsecid_subj(current, &audit_info->secid); |
Patrick McHardy | c53fa1e | 2011-03-03 10:55:40 -0800 | [diff] [blame] | 36 | audit_info->loginuid = audit_get_loginuid(current); |
| 37 | audit_info->sessionid = audit_get_sessionid(current); |
Paul Moore | 95d4e6b | 2006-09-29 17:05:05 -0700 | [diff] [blame] | 38 | } |
| 39 | |
Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 40 | /* NetLabel NETLINK I/O functions */ |
| 41 | |
| 42 | int netlbl_netlink_init(void); |
Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 43 | |
Paul Moore | 32f50cd | 2006-09-28 14:51:47 -0700 | [diff] [blame] | 44 | /* NetLabel Audit Functions */ |
| 45 | |
Paul Moore | 95d4e6b | 2006-09-29 17:05:05 -0700 | [diff] [blame] | 46 | struct audit_buffer *netlbl_audit_start_common(int type, |
| 47 | struct netlbl_audit *audit_info); |
Paul Moore | 32f50cd | 2006-09-28 14:51:47 -0700 | [diff] [blame] | 48 | |
Paul Moore | d15c345 | 2006-08-03 16:48:37 -0700 | [diff] [blame] | 49 | #endif |