2019-05-19 21:51:43 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2006-08-04 07:48:37 +08:00
|
|
|
/*
|
|
|
|
* NetLabel NETLINK Interface
|
|
|
|
*
|
|
|
|
* This file defines the NETLINK interface for the NetLabel system. The
|
|
|
|
* NetLabel system manages static and dynamic label mappings for network
|
|
|
|
* protocols such as CIPSO and RIPSO.
|
|
|
|
*
|
2011-08-01 19:10:33 +08:00
|
|
|
* Author: Paul Moore <paul@paul-moore.com>
|
2006-08-04 07:48:37 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* (c) Copyright Hewlett-Packard Development Company, L.P., 2006
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NETLABEL_USER_H
|
|
|
|
#define _NETLABEL_USER_H
|
|
|
|
|
2006-08-30 08:56:04 +08:00
|
|
|
#include <linux/types.h>
|
2006-08-04 07:48:37 +08:00
|
|
|
#include <linux/skbuff.h>
|
|
|
|
#include <linux/capability.h>
|
2006-09-29 05:51:47 +08:00
|
|
|
#include <linux/audit.h>
|
2006-08-30 08:56:04 +08:00
|
|
|
#include <net/netlink.h>
|
2006-08-04 07:48:37 +08:00
|
|
|
#include <net/genetlink.h>
|
2006-08-30 08:56:04 +08:00
|
|
|
#include <net/netlabel.h>
|
2006-08-04 07:48:37 +08:00
|
|
|
|
|
|
|
/* NetLabel NETLINK helper functions */
|
|
|
|
|
2006-09-30 08:05:05 +08:00
|
|
|
/**
|
|
|
|
* netlbl_netlink_auditinfo - Fetch the audit information from a NETLINK msg
|
|
|
|
* @audit_info: NetLabel audit information
|
|
|
|
*/
|
2021-05-19 15:34:38 +08:00
|
|
|
static inline void netlbl_netlink_auditinfo(struct netlbl_audit *audit_info)
|
2006-09-30 08:05:05 +08:00
|
|
|
{
|
2021-09-29 23:01:21 +08:00
|
|
|
security_current_getsecid_subj(&audit_info->secid);
|
2011-03-04 02:55:40 +08:00
|
|
|
audit_info->loginuid = audit_get_loginuid(current);
|
|
|
|
audit_info->sessionid = audit_get_sessionid(current);
|
2006-09-30 08:05:05 +08:00
|
|
|
}
|
|
|
|
|
2006-08-04 07:48:37 +08:00
|
|
|
/* NetLabel NETLINK I/O functions */
|
|
|
|
|
|
|
|
int netlbl_netlink_init(void);
|
|
|
|
|
2006-09-29 05:51:47 +08:00
|
|
|
/* NetLabel Audit Functions */
|
|
|
|
|
2006-09-30 08:05:05 +08:00
|
|
|
struct audit_buffer *netlbl_audit_start_common(int type,
|
|
|
|
struct netlbl_audit *audit_info);
|
2006-09-29 05:51:47 +08:00
|
|
|
|
2006-08-04 07:48:37 +08:00
|
|
|
#endif
|