netlabel_user.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <[email protected]>
  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. * @audit_info: NetLabel audit information
  27. */
  28. static inline void netlbl_netlink_auditinfo(struct netlbl_audit *audit_info)
  29. {
  30. security_current_getsecid_subj(&audit_info->secid);
  31. audit_info->loginuid = audit_get_loginuid(current);
  32. audit_info->sessionid = audit_get_sessionid(current);
  33. }
  34. /* NetLabel NETLINK I/O functions */
  35. int netlbl_netlink_init(void);
  36. /* NetLabel Audit Functions */
  37. struct audit_buffer *netlbl_audit_start_common(int type,
  38. struct netlbl_audit *audit_info);
  39. #endif