blob: 3c67afce64f128c7a6d795275883204270122b46 [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
31 * @skb: the packet
32 * @audit_info: NetLabel audit information
33 */
34static inline void netlbl_netlink_auditinfo(struct sk_buff *skb,
35 struct netlbl_audit *audit_info)
36{
Patrick McHardyc53fa1e2011-03-03 10:55:40 -080037 security_task_getsecid(current, &audit_info->secid);
38 audit_info->loginuid = audit_get_loginuid(current);
39 audit_info->sessionid = audit_get_sessionid(current);
Paul Moore95d4e6b2006-09-29 17:05:05 -070040}
41
Paul Moored15c3452006-08-03 16:48:37 -070042/* NetLabel NETLINK I/O functions */
43
44int netlbl_netlink_init(void);
Paul Moored15c3452006-08-03 16:48:37 -070045
Paul Moore32f50cd2006-09-28 14:51:47 -070046/* NetLabel Audit Functions */
47
Paul Moore95d4e6b2006-09-29 17:05:05 -070048struct audit_buffer *netlbl_audit_start_common(int type,
49 struct netlbl_audit *audit_info);
Paul Moore32f50cd2006-09-28 14:51:47 -070050
Paul Moored15c3452006-08-03 16:48:37 -070051#endif