netlabel_user.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  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. *
  9. * Author: Paul Moore <paul@paul-moore.com>
  10. */
  11. /*
  12. * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
  13. */
  14. #ifndef _NETLABEL_USER_H
  15. #define _NETLABEL_USER_H
  16. #include <linux/types.h>
  17. #include <linux/skbuff.h>
  18. #include <linux/capability.h>
  19. #include <linux/audit.h>
  20. #include <net/netlink.h>
  21. #include <net/genetlink.h>
  22. #include <net/netlabel.h>
  23. /* NetLabel NETLINK helper functions */
  24. /**
  25. * netlbl_netlink_auditinfo - Fetch the audit information from a NETLINK msg
  26. * @skb: the packet
  27. * @audit_info: NetLabel audit information
  28. */
  29. static inline void netlbl_netlink_auditinfo(struct sk_buff *skb,
  30. struct netlbl_audit *audit_info)
  31. {
  32. security_task_getsecid(current, &audit_info->secid);
  33. audit_info->loginuid = audit_get_loginuid(current);
  34. audit_info->sessionid = audit_get_sessionid(current);
  35. }
  36. /* NetLabel NETLINK I/O functions */
  37. int netlbl_netlink_init(void);
  38. /* NetLabel Audit Functions */
  39. struct audit_buffer *netlbl_audit_start_common(int type,
  40. struct netlbl_audit *audit_info);
  41. #endif