Branch data Line data Source code
1 : : /* This file is automatically generated. Do not edit. */
2 : : #ifndef _SELINUX_FLASK_H_
3 : : #define _SELINUX_FLASK_H_
4 : :
5 : : #define SECCLASS_SECURITY 1
6 : : #define SECCLASS_PROCESS 2
7 : : #define SECCLASS_SYSTEM 3
8 : : #define SECCLASS_CAPABILITY 4
9 : : #define SECCLASS_FILESYSTEM 5
10 : : #define SECCLASS_FILE 6
11 : : #define SECCLASS_DIR 7
12 : : #define SECCLASS_FD 8
13 : : #define SECCLASS_LNK_FILE 9
14 : : #define SECCLASS_CHR_FILE 10
15 : : #define SECCLASS_BLK_FILE 11
16 : : #define SECCLASS_SOCK_FILE 12
17 : : #define SECCLASS_FIFO_FILE 13
18 : : #define SECCLASS_SOCKET 14
19 : : #define SECCLASS_TCP_SOCKET 15
20 : : #define SECCLASS_UDP_SOCKET 16
21 : : #define SECCLASS_RAWIP_SOCKET 17
22 : : #define SECCLASS_NODE 18
23 : : #define SECCLASS_NETIF 19
24 : : #define SECCLASS_NETLINK_SOCKET 20
25 : : #define SECCLASS_PACKET_SOCKET 21
26 : : #define SECCLASS_KEY_SOCKET 22
27 : : #define SECCLASS_UNIX_STREAM_SOCKET 23
28 : : #define SECCLASS_UNIX_DGRAM_SOCKET 24
29 : : #define SECCLASS_SEM 25
30 : : #define SECCLASS_MSG 26
31 : : #define SECCLASS_MSGQ 27
32 : : #define SECCLASS_SHM 28
33 : : #define SECCLASS_IPC 29
34 : : #define SECCLASS_NETLINK_ROUTE_SOCKET 30
35 : : #define SECCLASS_NETLINK_FIREWALL_SOCKET 31
36 : : #define SECCLASS_NETLINK_TCPDIAG_SOCKET 32
37 : : #define SECCLASS_NETLINK_NFLOG_SOCKET 33
38 : : #define SECCLASS_NETLINK_XFRM_SOCKET 34
39 : : #define SECCLASS_NETLINK_SELINUX_SOCKET 35
40 : : #define SECCLASS_NETLINK_AUDIT_SOCKET 36
41 : : #define SECCLASS_NETLINK_IP6FW_SOCKET 37
42 : : #define SECCLASS_NETLINK_DNRT_SOCKET 38
43 : : #define SECCLASS_ASSOCIATION 39
44 : : #define SECCLASS_NETLINK_KOBJECT_UEVENT_SOCKET 40
45 : : #define SECCLASS_APPLETALK_SOCKET 41
46 : : #define SECCLASS_PACKET 42
47 : : #define SECCLASS_KEY 43
48 : : #define SECCLASS_DCCP_SOCKET 44
49 : : #define SECCLASS_MEMPROTECT 45
50 : : #define SECCLASS_PEER 46
51 : : #define SECCLASS_CAPABILITY2 47
52 : : #define SECCLASS_KERNEL_SERVICE 48
53 : : #define SECCLASS_TUN_SOCKET 49
54 : : #define SECCLASS_BINDER 50
55 : :
56 : : #define SECINITSID_KERNEL 1
57 : : #define SECINITSID_SECURITY 2
58 : : #define SECINITSID_UNLABELED 3
59 : : #define SECINITSID_FS 4
60 : : #define SECINITSID_FILE 5
61 : : #define SECINITSID_FILE_LABELS 6
62 : : #define SECINITSID_INIT 7
63 : : #define SECINITSID_ANY_SOCKET 8
64 : : #define SECINITSID_PORT 9
65 : : #define SECINITSID_NETIF 10
66 : : #define SECINITSID_NETMSG 11
67 : : #define SECINITSID_NODE 12
68 : : #define SECINITSID_IGMP_PACKET 13
69 : : #define SECINITSID_ICMP_SOCKET 14
70 : : #define SECINITSID_TCP_SOCKET 15
71 : : #define SECINITSID_SYSCTL_MODPROBE 16
72 : : #define SECINITSID_SYSCTL 17
73 : : #define SECINITSID_SYSCTL_FS 18
74 : : #define SECINITSID_SYSCTL_KERNEL 19
75 : : #define SECINITSID_SYSCTL_NET 20
76 : : #define SECINITSID_SYSCTL_NET_UNIX 21
77 : : #define SECINITSID_SYSCTL_VM 22
78 : : #define SECINITSID_SYSCTL_DEV 23
79 : : #define SECINITSID_KMOD 24
80 : : #define SECINITSID_POLICY 25
81 : : #define SECINITSID_SCMP_PACKET 26
82 : : #define SECINITSID_DEVNULL 27
83 : :
84 : : #define SECINITSID_NUM 27
85 : :
86 : : static inline bool security_is_socket_class(u16 kern_tclass)
87 : : {
88 : : bool sock = false;
89 : :
90 [ # # ][ # # ]: 0 : switch (kern_tclass) {
91 : : case SECCLASS_SOCKET:
92 : : case SECCLASS_TCP_SOCKET:
93 : : case SECCLASS_UDP_SOCKET:
94 : : case SECCLASS_RAWIP_SOCKET:
95 : : case SECCLASS_NETLINK_SOCKET:
96 : : case SECCLASS_PACKET_SOCKET:
97 : : case SECCLASS_KEY_SOCKET:
98 : : case SECCLASS_UNIX_STREAM_SOCKET:
99 : : case SECCLASS_UNIX_DGRAM_SOCKET:
100 : : case SECCLASS_NETLINK_ROUTE_SOCKET:
101 : : case SECCLASS_NETLINK_FIREWALL_SOCKET:
102 : : case SECCLASS_NETLINK_TCPDIAG_SOCKET:
103 : : case SECCLASS_NETLINK_NFLOG_SOCKET:
104 : : case SECCLASS_NETLINK_XFRM_SOCKET:
105 : : case SECCLASS_NETLINK_SELINUX_SOCKET:
106 : : case SECCLASS_NETLINK_AUDIT_SOCKET:
107 : : case SECCLASS_NETLINK_IP6FW_SOCKET:
108 : : case SECCLASS_NETLINK_DNRT_SOCKET:
109 : : case SECCLASS_NETLINK_KOBJECT_UEVENT_SOCKET:
110 : : case SECCLASS_APPLETALK_SOCKET:
111 : : case SECCLASS_DCCP_SOCKET:
112 : : case SECCLASS_TUN_SOCKET:
113 : : sock = true;
114 : : break;
115 : : default:
116 : : break;
117 : : }
118 : :
119 : : return sock;
120 : : }
121 : :
122 : : #endif
|