linux/include/linux/lsm_audit.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Common LSM logging functions
 * Heavily borrowed from selinux/avc.h
 *
 * Author : Etienne BASSET  <[email protected]>
 *
 * All credits to : Stephen Smalley, <[email protected]>
 * All BUGS to : Etienne BASSET  <[email protected]>
 */
#ifndef _LSM_COMMON_LOGGING_
#define _LSM_COMMON_LOGGING_

#include <linux/stddef.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/kdev_t.h>
#include <linux/spinlock.h>
#include <linux/init.h>
#include <linux/audit.h>
#include <linux/in6.h>
#include <linux/path.h>
#include <linux/key.h>
#include <linux/skbuff.h>
#include <rdma/ib_verbs.h>

struct lsm_network_audit {};

struct lsm_ioctlop_audit {};

struct lsm_ibpkey_audit {};

struct lsm_ibendport_audit {};

/* Auxiliary data to use in generating the audit record. */
struct common_audit_data {};

#define v4info
#define v6info

int ipv4_skb_to_auditdata(struct sk_buff *skb,
		struct common_audit_data *ad, u8 *proto);

int ipv6_skb_to_auditdata(struct sk_buff *skb,
		struct common_audit_data *ad, u8 *proto);

void common_lsm_audit(struct common_audit_data *a,
	void (*pre_audit)(struct audit_buffer *, void *),
	void (*post_audit)(struct audit_buffer *, void *));

#endif