blob: d6c5b31eb4eb8dfa693bf63590081614540cb9ff [file] [log] [blame]
Thomas Gleixner1ccea772019-05-19 15:51:43 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Paul Moored15c3452006-08-03 16:48:37 -07002/*
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 Moore82c21bf2011-08-01 11:10:33 +00009 * Author: Paul Moore <paul@paul-moore.com>
Paul Moored15c3452006-08-03 16:48:37 -070010 */
11
12/*
13 * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
Paul Moored15c3452006-08-03 16:48:37 -070014 */
15
16#ifndef _NETLABEL_USER_H
17#define _NETLABEL_USER_H
18
Paul Moore7a0e1d62006-08-29 17:56:04 -070019#include <linux/types.h>
Paul Moored15c3452006-08-03 16:48:37 -070020#include <linux/skbuff.h>
21#include <linux/capability.h>
Paul Moore32f50cd2006-09-28 14:51:47 -070022#include <linux/audit.h>
Paul Moore7a0e1d62006-08-29 17:56:04 -070023#include <net/netlink.h>
Paul Moored15c3452006-08-03 16:48:37 -070024#include <net/genetlink.h>
Paul Moore7a0e1d62006-08-29 17:56:04 -070025#include <net/netlabel.h>
Paul Moored15c3452006-08-03 16:48:37 -070026
27/* NetLabel NETLINK helper functions */
28
29/**
Paul Moore95d4e6b2006-09-29 17:05:05 -070030 * netlbl_netlink_auditinfo - Fetch the audit information from a NETLINK msg
Paul Moore95d4e6b2006-09-29 17:05:05 -070031 * @audit_info: NetLabel audit information
32 */
Zheng Yejianf7e03182021-05-19 15:34:38 +080033static inline void netlbl_netlink_auditinfo(struct netlbl_audit *audit_info)
Paul Moore95d4e6b2006-09-29 17:05:05 -070034{
Paul Moore63269482021-09-29 11:01:21 -040035 security_current_getsecid_subj(&audit_info->secid);
Patrick McHardyc53fa1e2011-03-03 10:55:40 -080036 audit_info->loginuid = audit_get_loginuid(current);
37 audit_info->sessionid = audit_get_sessionid(current);
Paul Moore95d4e6b2006-09-29 17:05:05 -070038}
39
Paul Moored15c3452006-08-03 16:48:37 -070040/* NetLabel NETLINK I/O functions */
41
42int netlbl_netlink_init(void);
Paul Moored15c3452006-08-03 16:48:37 -070043
Paul Moore32f50cd2006-09-28 14:51:47 -070044/* NetLabel Audit Functions */
45
Paul Moore95d4e6b2006-09-29 17:05:05 -070046struct audit_buffer *netlbl_audit_start_common(int type,
47 struct netlbl_audit *audit_info);
Paul Moore32f50cd2006-09-28 14:51:47 -070048
Paul Moored15c3452006-08-03 16:48:37 -070049#endif