Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * NetLabel NETLINK Interface
0004  *
0005  * This file defines the NETLINK interface for the NetLabel system.  The
0006  * NetLabel system manages static and dynamic label mappings for network
0007  * protocols such as CIPSO and RIPSO.
0008  *
0009  * Author: Paul Moore <paul@paul-moore.com>
0010  */
0011 
0012 /*
0013  * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
0014  */
0015 
0016 #ifndef _NETLABEL_USER_H
0017 #define _NETLABEL_USER_H
0018 
0019 #include <linux/types.h>
0020 #include <linux/skbuff.h>
0021 #include <linux/capability.h>
0022 #include <linux/audit.h>
0023 #include <net/netlink.h>
0024 #include <net/genetlink.h>
0025 #include <net/netlabel.h>
0026 
0027 /* NetLabel NETLINK helper functions */
0028 
0029 /**
0030  * netlbl_netlink_auditinfo - Fetch the audit information from a NETLINK msg
0031  * @audit_info: NetLabel audit information
0032  */
0033 static inline void netlbl_netlink_auditinfo(struct netlbl_audit *audit_info)
0034 {
0035     security_current_getsecid_subj(&audit_info->secid);
0036     audit_info->loginuid = audit_get_loginuid(current);
0037     audit_info->sessionid = audit_get_sessionid(current);
0038 }
0039 
0040 /* NetLabel NETLINK I/O functions */
0041 
0042 int netlbl_netlink_init(void);
0043 
0044 /* NetLabel Audit Functions */
0045 
0046 struct audit_buffer *netlbl_audit_start_common(int type,
0047                           struct netlbl_audit *audit_info);
0048 
0049 #endif