netlabel_user.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * NetLabel NETLINK Interface
  3. *
  4. * This file defines the NETLINK interface for the NetLabel system. The
  5. * NetLabel system manages static and dynamic label mappings for network
  6. * protocols such as CIPSO and RIPSO.
  7. *
  8. * Author: Paul Moore <paul@paul-moore.com>
  9. *
  10. */
  11. /*
  12. * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  22. * the GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  26. *
  27. */
  28. #ifndef _NETLABEL_USER_H
  29. #define _NETLABEL_USER_H
  30. #include <linux/types.h>
  31. #include <linux/skbuff.h>
  32. #include <linux/capability.h>
  33. #include <linux/audit.h>
  34. #include <net/netlink.h>
  35. #include <net/genetlink.h>
  36. #include <net/netlabel.h>
  37. /* NetLabel NETLINK helper functions */
  38. /**
  39. * netlbl_netlink_auditinfo - Fetch the audit information from a NETLINK msg
  40. * @skb: the packet
  41. * @audit_info: NetLabel audit information
  42. */
  43. static inline void netlbl_netlink_auditinfo(struct sk_buff *skb,
  44. struct netlbl_audit *audit_info)
  45. {
  46. security_task_getsecid(current, &audit_info->secid);
  47. audit_info->loginuid = audit_get_loginuid(current);
  48. audit_info->sessionid = audit_get_sessionid(current);
  49. }
  50. /* NetLabel NETLINK I/O functions */
  51. int netlbl_netlink_init(void);
  52. /* NetLabel Audit Functions */
  53. struct audit_buffer *netlbl_audit_start_common(int type,
  54. struct netlbl_audit *audit_info);
  55. #endif