]>
Commit | Line | Data |
---|---|---|
c2f1db8f | 1 | #pragma once |
b9f880f4 | 2 | |
15ae422b LP |
3 | /*** |
4 | This file is part of systemd. | |
5 | ||
6 | Copyright 2010 Lennart Poettering | |
7 | ||
8 | systemd is free software; you can redistribute it and/or modify it | |
5430f7f2 LP |
9 | under the terms of the GNU Lesser General Public License as published by |
10 | the Free Software Foundation; either version 2.1 of the License, or | |
15ae422b LP |
11 | (at your option) any later version. |
12 | ||
13 | systemd is distributed in the hope that it will be useful, but | |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
5430f7f2 | 16 | Lesser General Public License for more details. |
15ae422b | 17 | |
5430f7f2 | 18 | You should have received a copy of the GNU Lesser General Public License |
15ae422b LP |
19 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
20 | ***/ | |
21 | ||
b9f880f4 LP |
22 | /* Missing glibc definitions to access certain kernel APIs */ |
23 | ||
3b794314 | 24 | #include <errno.h> |
8ae4b6d1 | 25 | #include <fcntl.h> |
875c2e22 | 26 | #include <linux/audit.h> |
2822da4f | 27 | #include <linux/capability.h> |
8ae4b6d1 TG |
28 | #include <linux/if_link.h> |
29 | #include <linux/input.h> | |
30 | #include <linux/loop.h> | |
cf1755ba | 31 | #include <linux/neighbour.h> |
8ae4b6d1 TG |
32 | #include <linux/oom.h> |
33 | #include <linux/rtnetlink.h> | |
43a6a52e | 34 | #include <net/ethernet.h> |
8ae4b6d1 TG |
35 | #include <stdlib.h> |
36 | #include <sys/resource.h> | |
4e0399e6 | 37 | #include <sys/socket.h> |
8ae4b6d1 | 38 | #include <sys/syscall.h> |
c932fb71 | 39 | #include <uchar.h> |
8ae4b6d1 | 40 | #include <unistd.h> |
dd6c17b1 LP |
41 | |
42 | #ifdef HAVE_AUDIT | |
43 | #include <libaudit.h> | |
44 | #endif | |
b9f880f4 | 45 | |
d59d0a2b | 46 | #ifdef ARCH_MIPS |
47 | #include <asm/sgidefs.h> | |
48 | #endif | |
49 | ||
700c6087 LP |
50 | #ifdef HAVE_LINUX_BTRFS_H |
51 | #include <linux/btrfs.h> | |
52 | #endif | |
53 | ||
4e0399e6 SH |
54 | #ifdef HAVE_LINUX_VM_SOCKETS_H |
55 | #include <linux/vm_sockets.h> | |
56 | #else | |
57 | #define VMADDR_CID_ANY -1U | |
58 | struct sockaddr_vm { | |
59 | unsigned short svm_family; | |
60 | unsigned short svm_reserved1; | |
61 | unsigned int svm_port; | |
62 | unsigned int svm_cid; | |
63 | unsigned char svm_zero[sizeof(struct sockaddr) - | |
64 | sizeof(unsigned short) - | |
65 | sizeof(unsigned short) - | |
66 | sizeof(unsigned int) - | |
67 | sizeof(unsigned int)]; | |
68 | }; | |
69 | #endif /* !HAVE_LINUX_VM_SOCKETS_H */ | |
70 | ||
b9f880f4 LP |
71 | #ifndef RLIMIT_RTTIME |
72 | #define RLIMIT_RTTIME 15 | |
73 | #endif | |
74 | ||
517d56b1 LP |
75 | /* If RLIMIT_RTTIME is not defined, then we cannot use RLIMIT_NLIMITS as is */ |
76 | #define _RLIMIT_MAX (RLIMIT_RTTIME+1 > RLIMIT_NLIMITS ? RLIMIT_RTTIME+1 : RLIMIT_NLIMITS) | |
77 | ||
4fd5948e LP |
78 | #ifndef F_LINUX_SPECIFIC_BASE |
79 | #define F_LINUX_SPECIFIC_BASE 1024 | |
80 | #endif | |
81 | ||
82 | #ifndef F_SETPIPE_SZ | |
83 | #define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7) | |
84 | #endif | |
85 | ||
86 | #ifndef F_GETPIPE_SZ | |
87 | #define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8) | |
88 | #endif | |
89 | ||
a6082d77 DM |
90 | #ifndef F_ADD_SEALS |
91 | #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) | |
a6082d77 | 92 | #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) |
a6082d77 | 93 | |
a6082d77 | 94 | #define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */ |
a6082d77 | 95 | #define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */ |
a6082d77 | 96 | #define F_SEAL_GROW 0x0004 /* prevent file from growing */ |
a6082d77 DM |
97 | #define F_SEAL_WRITE 0x0008 /* prevent writes */ |
98 | #endif | |
99 | ||
f4a53250 MM |
100 | #ifndef F_OFD_GETLK |
101 | #define F_OFD_GETLK 36 | |
102 | #define F_OFD_SETLK 37 | |
103 | #define F_OFD_SETLKW 38 | |
104 | #endif | |
105 | ||
a6082d77 | 106 | #ifndef MFD_ALLOW_SEALING |
45071fca LP |
107 | #define MFD_ALLOW_SEALING 0x0002U |
108 | #endif | |
109 | ||
110 | #ifndef MFD_CLOEXEC | |
111 | #define MFD_CLOEXEC 0x0001U | |
a6082d77 DM |
112 | #endif |
113 | ||
16c42ce1 KS |
114 | #ifndef IP_FREEBIND |
115 | #define IP_FREEBIND 15 | |
116 | #endif | |
117 | ||
dd6c17b1 LP |
118 | #ifndef OOM_SCORE_ADJ_MIN |
119 | #define OOM_SCORE_ADJ_MIN (-1000) | |
120 | #endif | |
121 | ||
122 | #ifndef OOM_SCORE_ADJ_MAX | |
123 | #define OOM_SCORE_ADJ_MAX 1000 | |
124 | #endif | |
15ae422b | 125 | |
4927fcae | 126 | #ifndef AUDIT_SERVICE_START |
dd6c17b1 | 127 | #define AUDIT_SERVICE_START 1130 /* Service (daemon) start */ |
4927fcae LP |
128 | #endif |
129 | ||
130 | #ifndef AUDIT_SERVICE_STOP | |
dd6c17b1 | 131 | #define AUDIT_SERVICE_STOP 1131 /* Service (daemon) stop */ |
4927fcae LP |
132 | #endif |
133 | ||
6ea832a2 LP |
134 | #ifndef TIOCVHANGUP |
135 | #define TIOCVHANGUP 0x5437 | |
136 | #endif | |
137 | ||
b90865ba KS |
138 | #ifndef IP_TRANSPARENT |
139 | #define IP_TRANSPARENT 19 | |
140 | #endif | |
141 | ||
66269b05 TG |
142 | #ifndef SOL_NETLINK |
143 | #define SOL_NETLINK 270 | |
144 | #endif | |
145 | ||
9c5a882b TG |
146 | #ifndef NETLINK_LIST_MEMBERSHIPS |
147 | #define NETLINK_LIST_MEMBERSHIPS 9 | |
148 | #endif | |
149 | ||
62bc4efc SS |
150 | #ifndef SOL_SCTP |
151 | #define SOL_SCTP 132 | |
152 | #endif | |
153 | ||
97768fc5 LP |
154 | #ifndef GRND_NONBLOCK |
155 | #define GRND_NONBLOCK 0x0001 | |
156 | #endif | |
157 | ||
158 | #ifndef GRND_RANDOM | |
159 | #define GRND_RANDOM 0x0002 | |
160 | #endif | |
161 | ||
0f3be6ca LP |
162 | #ifndef FS_NOCOW_FL |
163 | #define FS_NOCOW_FL 0x00800000 | |
164 | #endif | |
165 | ||
4b357e15 MM |
166 | #ifndef BTRFS_IOCTL_MAGIC |
167 | #define BTRFS_IOCTL_MAGIC 0x94 | |
168 | #endif | |
169 | ||
170 | #ifndef BTRFS_PATH_NAME_MAX | |
171 | #define BTRFS_PATH_NAME_MAX 4087 | |
172 | #endif | |
173 | ||
174 | #ifndef BTRFS_DEVICE_PATH_NAME_MAX | |
175 | #define BTRFS_DEVICE_PATH_NAME_MAX 1024 | |
176 | #endif | |
177 | ||
178 | #ifndef BTRFS_FSID_SIZE | |
179 | #define BTRFS_FSID_SIZE 16 | |
180 | #endif | |
181 | ||
182 | #ifndef BTRFS_UUID_SIZE | |
183 | #define BTRFS_UUID_SIZE 16 | |
184 | #endif | |
185 | ||
8e8ba792 MO |
186 | #ifndef BTRFS_SUBVOL_RDONLY |
187 | #define BTRFS_SUBVOL_RDONLY (1ULL << 1) | |
188 | #endif | |
189 | ||
190 | #ifndef BTRFS_SUBVOL_NAME_MAX | |
191 | #define BTRFS_SUBVOL_NAME_MAX 4039 | |
192 | #endif | |
193 | ||
194 | #ifndef BTRFS_INO_LOOKUP_PATH_MAX | |
195 | #define BTRFS_INO_LOOKUP_PATH_MAX 4080 | |
196 | #endif | |
197 | ||
198 | #ifndef BTRFS_SEARCH_ARGS_BUFSIZE | |
199 | #define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key)) | |
200 | #endif | |
201 | ||
3f952f92 LP |
202 | #ifndef BTRFS_QGROUP_LEVEL_SHIFT |
203 | #define BTRFS_QGROUP_LEVEL_SHIFT 48 | |
204 | #endif | |
205 | ||
4b357e15 MM |
206 | #ifndef HAVE_LINUX_BTRFS_H |
207 | struct btrfs_ioctl_vol_args { | |
208 | int64_t fd; | |
209 | char name[BTRFS_PATH_NAME_MAX + 1]; | |
210 | }; | |
211 | ||
8e8ba792 MO |
212 | struct btrfs_qgroup_limit { |
213 | __u64 flags; | |
214 | __u64 max_rfer; | |
215 | __u64 max_excl; | |
216 | __u64 rsv_rfer; | |
217 | __u64 rsv_excl; | |
218 | }; | |
219 | ||
220 | struct btrfs_qgroup_inherit { | |
221 | __u64 flags; | |
222 | __u64 num_qgroups; | |
223 | __u64 num_ref_copies; | |
224 | __u64 num_excl_copies; | |
225 | struct btrfs_qgroup_limit lim; | |
226 | __u64 qgroups[0]; | |
227 | }; | |
228 | ||
d97fb408 MO |
229 | struct btrfs_ioctl_qgroup_limit_args { |
230 | __u64 qgroupid; | |
231 | struct btrfs_qgroup_limit lim; | |
232 | }; | |
233 | ||
8e8ba792 MO |
234 | struct btrfs_ioctl_vol_args_v2 { |
235 | __s64 fd; | |
236 | __u64 transid; | |
237 | __u64 flags; | |
238 | union { | |
239 | struct { | |
240 | __u64 size; | |
241 | struct btrfs_qgroup_inherit *qgroup_inherit; | |
242 | }; | |
243 | __u64 unused[4]; | |
244 | }; | |
245 | char name[BTRFS_SUBVOL_NAME_MAX + 1]; | |
246 | }; | |
247 | ||
4b357e15 MM |
248 | struct btrfs_ioctl_dev_info_args { |
249 | uint64_t devid; /* in/out */ | |
250 | uint8_t uuid[BTRFS_UUID_SIZE]; /* in/out */ | |
251 | uint64_t bytes_used; /* out */ | |
252 | uint64_t total_bytes; /* out */ | |
253 | uint64_t unused[379]; /* pad to 4k */ | |
254 | char path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */ | |
255 | }; | |
256 | ||
257 | struct btrfs_ioctl_fs_info_args { | |
258 | uint64_t max_id; /* out */ | |
259 | uint64_t num_devices; /* out */ | |
260 | uint8_t fsid[BTRFS_FSID_SIZE]; /* out */ | |
261 | uint64_t reserved[124]; /* pad to 1k */ | |
262 | }; | |
8e8ba792 MO |
263 | |
264 | struct btrfs_ioctl_ino_lookup_args { | |
265 | __u64 treeid; | |
266 | __u64 objectid; | |
267 | char name[BTRFS_INO_LOOKUP_PATH_MAX]; | |
268 | }; | |
269 | ||
270 | struct btrfs_ioctl_search_key { | |
271 | /* which root are we searching. 0 is the tree of tree roots */ | |
272 | __u64 tree_id; | |
273 | ||
274 | /* keys returned will be >= min and <= max */ | |
275 | __u64 min_objectid; | |
276 | __u64 max_objectid; | |
277 | ||
278 | /* keys returned will be >= min and <= max */ | |
279 | __u64 min_offset; | |
280 | __u64 max_offset; | |
281 | ||
282 | /* max and min transids to search for */ | |
283 | __u64 min_transid; | |
284 | __u64 max_transid; | |
285 | ||
286 | /* keys returned will be >= min and <= max */ | |
287 | __u32 min_type; | |
288 | __u32 max_type; | |
289 | ||
290 | /* | |
291 | * how many items did userland ask for, and how many are we | |
292 | * returning | |
293 | */ | |
294 | __u32 nr_items; | |
295 | ||
296 | /* align to 64 bits */ | |
297 | __u32 unused; | |
298 | ||
299 | /* some extra for later */ | |
300 | __u64 unused1; | |
301 | __u64 unused2; | |
302 | __u64 unused3; | |
303 | __u64 unused4; | |
304 | }; | |
305 | ||
306 | struct btrfs_ioctl_search_header { | |
307 | __u64 transid; | |
308 | __u64 objectid; | |
309 | __u64 offset; | |
310 | __u32 type; | |
311 | __u32 len; | |
312 | }; | |
313 | ||
314 | ||
315 | struct btrfs_ioctl_search_args { | |
316 | struct btrfs_ioctl_search_key key; | |
317 | char buf[BTRFS_SEARCH_ARGS_BUFSIZE]; | |
318 | }; | |
319 | ||
320 | struct btrfs_ioctl_clone_range_args { | |
321 | __s64 src_fd; | |
322 | __u64 src_offset, src_length; | |
323 | __u64 dest_offset; | |
324 | }; | |
d97fb408 MO |
325 | |
326 | #define BTRFS_QUOTA_CTL_ENABLE 1 | |
327 | #define BTRFS_QUOTA_CTL_DISABLE 2 | |
328 | #define BTRFS_QUOTA_CTL_RESCAN__NOTUSED 3 | |
329 | struct btrfs_ioctl_quota_ctl_args { | |
330 | __u64 cmd; | |
331 | __u64 status; | |
332 | }; | |
4b357e15 MM |
333 | #endif |
334 | ||
335 | #ifndef BTRFS_IOC_DEFRAG | |
7bed7f0e ZJS |
336 | #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ |
337 | struct btrfs_ioctl_vol_args) | |
4b357e15 MM |
338 | #endif |
339 | ||
d97fb408 MO |
340 | #ifndef BTRFS_IOC_RESIZE |
341 | #define BTRFS_IOC_RESIZE _IOW(BTRFS_IOCTL_MAGIC, 3, \ | |
342 | struct btrfs_ioctl_vol_args) | |
343 | #endif | |
344 | ||
8e8ba792 MO |
345 | #ifndef BTRFS_IOC_CLONE |
346 | #define BTRFS_IOC_CLONE _IOW(BTRFS_IOCTL_MAGIC, 9, int) | |
347 | #endif | |
348 | ||
349 | #ifndef BTRFS_IOC_CLONE_RANGE | |
350 | #define BTRFS_IOC_CLONE_RANGE _IOW(BTRFS_IOCTL_MAGIC, 13, \ | |
351 | struct btrfs_ioctl_clone_range_args) | |
352 | #endif | |
353 | ||
354 | #ifndef BTRFS_IOC_SUBVOL_CREATE | |
355 | #define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, \ | |
356 | struct btrfs_ioctl_vol_args) | |
357 | #endif | |
358 | ||
359 | #ifndef BTRFS_IOC_SNAP_DESTROY | |
360 | #define BTRFS_IOC_SNAP_DESTROY _IOW(BTRFS_IOCTL_MAGIC, 15, \ | |
361 | struct btrfs_ioctl_vol_args) | |
362 | #endif | |
363 | ||
364 | #ifndef BTRFS_IOC_TREE_SEARCH | |
365 | #define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \ | |
366 | struct btrfs_ioctl_search_args) | |
367 | #endif | |
368 | ||
369 | #ifndef BTRFS_IOC_INO_LOOKUP | |
370 | #define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \ | |
371 | struct btrfs_ioctl_ino_lookup_args) | |
372 | #endif | |
373 | ||
374 | #ifndef BTRFS_IOC_SNAP_CREATE_V2 | |
375 | #define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \ | |
376 | struct btrfs_ioctl_vol_args_v2) | |
377 | #endif | |
378 | ||
379 | #ifndef BTRFS_IOC_SUBVOL_GETFLAGS | |
380 | #define BTRFS_IOC_SUBVOL_GETFLAGS _IOR(BTRFS_IOCTL_MAGIC, 25, __u64) | |
381 | #endif | |
382 | ||
383 | #ifndef BTRFS_IOC_SUBVOL_SETFLAGS | |
384 | #define BTRFS_IOC_SUBVOL_SETFLAGS _IOW(BTRFS_IOCTL_MAGIC, 26, __u64) | |
385 | #endif | |
386 | ||
4b357e15 MM |
387 | #ifndef BTRFS_IOC_DEV_INFO |
388 | #define BTRFS_IOC_DEV_INFO _IOWR(BTRFS_IOCTL_MAGIC, 30, \ | |
389 | struct btrfs_ioctl_dev_info_args) | |
390 | #endif | |
391 | ||
392 | #ifndef BTRFS_IOC_FS_INFO | |
393 | #define BTRFS_IOC_FS_INFO _IOR(BTRFS_IOCTL_MAGIC, 31, \ | |
7bed7f0e ZJS |
394 | struct btrfs_ioctl_fs_info_args) |
395 | #endif | |
396 | ||
397 | #ifndef BTRFS_IOC_DEVICES_READY | |
398 | #define BTRFS_IOC_DEVICES_READY _IOR(BTRFS_IOCTL_MAGIC, 39, \ | |
399 | struct btrfs_ioctl_vol_args) | |
4b357e15 MM |
400 | #endif |
401 | ||
d97fb408 MO |
402 | #ifndef BTRFS_IOC_QUOTA_CTL |
403 | #define BTRFS_IOC_QUOTA_CTL _IOWR(BTRFS_IOCTL_MAGIC, 40, \ | |
404 | struct btrfs_ioctl_quota_ctl_args) | |
405 | #endif | |
406 | ||
407 | #ifndef BTRFS_IOC_QGROUP_LIMIT | |
408 | #define BTRFS_IOC_QGROUP_LIMIT _IOR(BTRFS_IOCTL_MAGIC, 43, \ | |
409 | struct btrfs_ioctl_qgroup_limit_args) | |
410 | #endif | |
411 | ||
306578e5 SS |
412 | #ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT |
413 | #define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) | |
414 | #endif | |
415 | ||
10f9c755 LP |
416 | #ifndef BTRFS_FIRST_FREE_OBJECTID |
417 | #define BTRFS_FIRST_FREE_OBJECTID 256 | |
418 | #endif | |
419 | ||
d9e2daaf LP |
420 | #ifndef BTRFS_LAST_FREE_OBJECTID |
421 | #define BTRFS_LAST_FREE_OBJECTID -256ULL | |
422 | #endif | |
423 | ||
b6b18498 LP |
424 | #ifndef BTRFS_ROOT_TREE_OBJECTID |
425 | #define BTRFS_ROOT_TREE_OBJECTID 1 | |
426 | #endif | |
427 | ||
428 | #ifndef BTRFS_QUOTA_TREE_OBJECTID | |
429 | #define BTRFS_QUOTA_TREE_OBJECTID 8ULL | |
430 | #endif | |
431 | ||
10f9c755 LP |
432 | #ifndef BTRFS_ROOT_ITEM_KEY |
433 | #define BTRFS_ROOT_ITEM_KEY 132 | |
434 | #endif | |
435 | ||
b6b18498 LP |
436 | #ifndef BTRFS_QGROUP_STATUS_KEY |
437 | #define BTRFS_QGROUP_STATUS_KEY 240 | |
438 | #endif | |
439 | ||
440 | #ifndef BTRFS_QGROUP_INFO_KEY | |
441 | #define BTRFS_QGROUP_INFO_KEY 242 | |
442 | #endif | |
443 | ||
444 | #ifndef BTRFS_QGROUP_LIMIT_KEY | |
445 | #define BTRFS_QGROUP_LIMIT_KEY 244 | |
446 | #endif | |
447 | ||
5bcd08db LP |
448 | #ifndef BTRFS_QGROUP_RELATION_KEY |
449 | #define BTRFS_QGROUP_RELATION_KEY 246 | |
450 | #endif | |
451 | ||
d9e2daaf LP |
452 | #ifndef BTRFS_ROOT_BACKREF_KEY |
453 | #define BTRFS_ROOT_BACKREF_KEY 144 | |
454 | #endif | |
455 | ||
746f8906 LP |
456 | #ifndef BTRFS_SUPER_MAGIC |
457 | #define BTRFS_SUPER_MAGIC 0x9123683E | |
458 | #endif | |
459 | ||
efdb0237 LP |
460 | #ifndef CGROUP_SUPER_MAGIC |
461 | #define CGROUP_SUPER_MAGIC 0x27e0eb | |
462 | #endif | |
463 | ||
09961995 AC |
464 | #ifndef CGROUP2_SUPER_MAGIC |
465 | #define CGROUP2_SUPER_MAGIC 0x63677270 | |
466 | #endif | |
467 | ||
3228995c CB |
468 | #ifndef CLONE_NEWCGROUP |
469 | #define CLONE_NEWCGROUP 0x02000000 | |
470 | #endif | |
471 | ||
efdb0237 LP |
472 | #ifndef TMPFS_MAGIC |
473 | #define TMPFS_MAGIC 0x01021994 | |
474 | #endif | |
475 | ||
88cd066e LP |
476 | #ifndef MQUEUE_MAGIC |
477 | #define MQUEUE_MAGIC 0x19800202 | |
478 | #endif | |
479 | ||
87c05f36 DH |
480 | #ifndef SECURITYFS_MAGIC |
481 | #define SECURITYFS_MAGIC 0x73636673 | |
482 | #endif | |
483 | ||
484 | #ifndef TRACEFS_MAGIC | |
485 | #define TRACEFS_MAGIC 0x74726163 | |
486 | #endif | |
487 | ||
488 | #ifndef BPF_FS_MAGIC | |
489 | #define BPF_FS_MAGIC 0xcafe4a11 | |
490 | #endif | |
491 | ||
94d82985 LP |
492 | #ifndef MS_MOVE |
493 | #define MS_MOVE 8192 | |
494 | #endif | |
495 | ||
7ef71470 ZJS |
496 | #ifndef MS_REC |
497 | #define MS_REC 16384 | |
498 | #endif | |
499 | ||
7cb1094a | 500 | #ifndef MS_PRIVATE |
7ef71470 | 501 | #define MS_PRIVATE (1<<18) |
7cb1094a HH |
502 | #endif |
503 | ||
7ef71470 ZJS |
504 | #ifndef MS_REC |
505 | #define MS_REC (1<<19) | |
506 | #endif | |
507 | ||
508 | #ifndef MS_SHARED | |
509 | #define MS_SHARED (1<<20) | |
510 | #endif | |
511 | ||
512 | #ifndef MS_RELATIME | |
513 | #define MS_RELATIME (1<<21) | |
514 | #endif | |
515 | ||
516 | #ifndef MS_KERNMOUNT | |
517 | #define MS_KERNMOUNT (1<<22) | |
518 | #endif | |
519 | ||
520 | #ifndef MS_I_VERSION | |
521 | #define MS_I_VERSION (1<<23) | |
54ecda32 LP |
522 | #endif |
523 | ||
48ac500b | 524 | #ifndef MS_STRICTATIME |
7ef71470 | 525 | #define MS_STRICTATIME (1<<24) |
48ac500b LP |
526 | #endif |
527 | ||
7ef71470 ZJS |
528 | #ifndef MS_LAZYTIME |
529 | #define MS_LAZYTIME (1<<25) | |
a9621528 AM |
530 | #endif |
531 | ||
7ef71470 ZJS |
532 | #ifndef SCM_SECURITY |
533 | #define SCM_SECURITY 0x03 | |
a9621528 AM |
534 | #endif |
535 | ||
8351ceae LP |
536 | #ifndef PR_SET_NO_NEW_PRIVS |
537 | #define PR_SET_NO_NEW_PRIVS 38 | |
538 | #endif | |
d4447f4d AK |
539 | |
540 | #ifndef PR_SET_CHILD_SUBREAPER | |
541 | #define PR_SET_CHILD_SUBREAPER 36 | |
542 | #endif | |
a8348796 LP |
543 | |
544 | #ifndef MAX_HANDLE_SZ | |
545 | #define MAX_HANDLE_SZ 128 | |
546 | #endif | |
547 | ||
4db17f29 ZJS |
548 | #ifndef HAVE_SECURE_GETENV |
549 | # ifdef HAVE___SECURE_GETENV | |
550 | # define secure_getenv __secure_getenv | |
551 | # else | |
66330455 | 552 | # error "neither secure_getenv nor __secure_getenv are available" |
4db17f29 ZJS |
553 | # endif |
554 | #endif | |
85210bff LP |
555 | |
556 | #ifndef CIFS_MAGIC_NUMBER | |
65b3903f | 557 | # define CIFS_MAGIC_NUMBER 0xFF534D42 |
85210bff | 558 | #endif |
8742514c LP |
559 | |
560 | #ifndef TFD_TIMER_CANCEL_ON_SET | |
65b3903f | 561 | # define TFD_TIMER_CANCEL_ON_SET (1 << 1) |
8742514c | 562 | #endif |
f7db7a69 SL |
563 | |
564 | #ifndef SO_REUSEPORT | |
65b3903f | 565 | # define SO_REUSEPORT 15 |
f7db7a69 | 566 | #endif |
118ecf32 DH |
567 | |
568 | #ifndef EVIOCREVOKE | |
65b3903f | 569 | # define EVIOCREVOKE _IOW('E', 0x91, int) |
118ecf32 DH |
570 | #endif |
571 | ||
572 | #ifndef DRM_IOCTL_SET_MASTER | |
65b3903f | 573 | # define DRM_IOCTL_SET_MASTER _IO('d', 0x1e) |
118ecf32 DH |
574 | #endif |
575 | ||
576 | #ifndef DRM_IOCTL_DROP_MASTER | |
65b3903f ZJS |
577 | # define DRM_IOCTL_DROP_MASTER _IO('d', 0x1f) |
578 | #endif | |
579 | ||
daad709a YM |
580 | /* The precise definition of __O_TMPFILE is arch specific; use the |
581 | * values defined by the kernel (note: some are hexa, some are octal, | |
582 | * duplicated as-is from the kernel definitions): | |
583 | * - alpha, parisc, sparc: each has a specific value; | |
584 | * - others: they use the "generic" value. | |
585 | */ | |
c09918f9 LP |
586 | |
587 | #ifndef __O_TMPFILE | |
daad709a YM |
588 | #if defined(__alpha__) |
589 | #define __O_TMPFILE 0100000000 | |
590 | #elif defined(__parisc__) || defined(__hppa__) | |
591 | #define __O_TMPFILE 0400000000 | |
592 | #elif defined(__sparc__) || defined(__sparc64__) | |
593 | #define __O_TMPFILE 0x2000000 | |
594 | #else | |
c09918f9 LP |
595 | #define __O_TMPFILE 020000000 |
596 | #endif | |
597 | ||
598 | /* a horrid kludge trying to make sure that this will fail on old kernels */ | |
599 | #ifndef O_TMPFILE | |
600 | #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) | |
601 | #endif | |
602 | ||
603 | #endif | |
3b794314 | 604 | |
5f381b35 LP |
605 | #if !HAVE_DECL_LO_FLAGS_PARTSCAN |
606 | #define LO_FLAGS_PARTSCAN 8 | |
607 | #endif | |
a853c45d LP |
608 | |
609 | #ifndef LOOP_CTL_REMOVE | |
610 | #define LOOP_CTL_REMOVE 0x4C81 | |
611 | #endif | |
612 | ||
613 | #ifndef LOOP_CTL_GET_FREE | |
614 | #define LOOP_CTL_GET_FREE 0x4C82 | |
615 | #endif | |
0830ba61 | 616 | |
84dd59b5 DH |
617 | #if !HAVE_DECL_IFLA_INET6_ADDR_GEN_MODE |
618 | #define IFLA_INET6_UNSPEC 0 | |
619 | #define IFLA_INET6_FLAGS 1 | |
620 | #define IFLA_INET6_CONF 2 | |
621 | #define IFLA_INET6_STATS 3 | |
622 | #define IFLA_INET6_MCAST 4 | |
623 | #define IFLA_INET6_CACHEINFO 5 | |
624 | #define IFLA_INET6_ICMP6STATS 6 | |
625 | #define IFLA_INET6_TOKEN 7 | |
626 | #define IFLA_INET6_ADDR_GEN_MODE 8 | |
627 | #define __IFLA_INET6_MAX 9 | |
628 | ||
3282493a | 629 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) |
84dd59b5 DH |
630 | |
631 | #define IN6_ADDR_GEN_MODE_EUI64 0 | |
632 | #define IN6_ADDR_GEN_MODE_NONE 1 | |
f4f5e50a AJ |
633 | #endif |
634 | ||
635 | #if !HAVE_DECL_IN6_ADDR_GEN_MODE_STABLE_PRIVACY | |
fbc38f23 | 636 | #define IN6_ADDR_GEN_MODE_STABLE_PRIVACY 2 |
84dd59b5 DH |
637 | #endif |
638 | ||
75616a13 ZJS |
639 | #if !HAVE_DECL_IFLA_MACVLAN_FLAGS |
640 | #define IFLA_MACVLAN_UNSPEC 0 | |
641 | #define IFLA_MACVLAN_MODE 1 | |
642 | #define IFLA_MACVLAN_FLAGS 2 | |
643 | #define __IFLA_MACVLAN_MAX 3 | |
644 | ||
645 | #define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1) | |
646 | #endif | |
647 | ||
c4a5ddc9 TG |
648 | #if !HAVE_DECL_IFLA_IPVLAN_MODE |
649 | #define IFLA_IPVLAN_UNSPEC 0 | |
650 | #define IFLA_IPVLAN_MODE 1 | |
651 | #define __IFLA_IPVLAN_MAX 2 | |
652 | ||
653 | #define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1) | |
654 | ||
655 | #define IPVLAN_MODE_L2 0 | |
656 | #define IPVLAN_MODE_L3 1 | |
657 | #define IPVLAN_MAX 2 | |
658 | #endif | |
659 | ||
6589d0db JAS |
660 | #if !HAVE_DECL_IFLA_VTI_REMOTE |
661 | #define IFLA_VTI_UNSPEC 0 | |
662 | #define IFLA_VTI_LINK 1 | |
663 | #define IFLA_VTI_IKEY 2 | |
664 | #define IFLA_VTI_OKEY 3 | |
665 | #define IFLA_VTI_LOCAL 4 | |
666 | #define IFLA_VTI_REMOTE 5 | |
667 | #define __IFLA_VTI_MAX 6 | |
668 | ||
669 | #define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1) | |
670 | #endif | |
671 | ||
81577dc2 | 672 | #if !HAVE_DECL_IFLA_PHYS_PORT_ID |
bacef2a2 | 673 | #define IFLA_EXT_MASK 29 |
81577dc2 ZJS |
674 | #undef IFLA_PROMISCUITY |
675 | #define IFLA_PROMISCUITY 30 | |
676 | #define IFLA_NUM_TX_QUEUES 31 | |
677 | #define IFLA_NUM_RX_QUEUES 32 | |
678 | #define IFLA_CARRIER 33 | |
679 | #define IFLA_PHYS_PORT_ID 34 | |
680 | #define __IFLA_MAX 35 | |
681 | ||
682 | #define IFLA_MAX (__IFLA_MAX - 1) | |
683 | #endif | |
684 | ||
685 | #if !HAVE_DECL_IFLA_BOND_AD_INFO | |
686 | #define IFLA_BOND_UNSPEC 0 | |
687 | #define IFLA_BOND_MODE 1 | |
688 | #define IFLA_BOND_ACTIVE_SLAVE 2 | |
689 | #define IFLA_BOND_MIIMON 3 | |
690 | #define IFLA_BOND_UPDELAY 4 | |
691 | #define IFLA_BOND_DOWNDELAY 5 | |
692 | #define IFLA_BOND_USE_CARRIER 6 | |
693 | #define IFLA_BOND_ARP_INTERVAL 7 | |
694 | #define IFLA_BOND_ARP_IP_TARGET 8 | |
695 | #define IFLA_BOND_ARP_VALIDATE 9 | |
696 | #define IFLA_BOND_ARP_ALL_TARGETS 10 | |
697 | #define IFLA_BOND_PRIMARY 11 | |
698 | #define IFLA_BOND_PRIMARY_RESELECT 12 | |
699 | #define IFLA_BOND_FAIL_OVER_MAC 13 | |
700 | #define IFLA_BOND_XMIT_HASH_POLICY 14 | |
701 | #define IFLA_BOND_RESEND_IGMP 15 | |
702 | #define IFLA_BOND_NUM_PEER_NOTIF 16 | |
703 | #define IFLA_BOND_ALL_SLAVES_ACTIVE 17 | |
704 | #define IFLA_BOND_MIN_LINKS 18 | |
705 | #define IFLA_BOND_LP_INTERVAL 19 | |
706 | #define IFLA_BOND_PACKETS_PER_SLAVE 20 | |
707 | #define IFLA_BOND_AD_LACP_RATE 21 | |
708 | #define IFLA_BOND_AD_SELECT 22 | |
709 | #define IFLA_BOND_AD_INFO 23 | |
710 | #define __IFLA_BOND_MAX 24 | |
0830ba61 | 711 | |
79306206 | 712 | #define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1) |
0830ba61 | 713 | #endif |
81577dc2 ZJS |
714 | |
715 | #if !HAVE_DECL_IFLA_VLAN_PROTOCOL | |
716 | #define IFLA_VLAN_UNSPEC 0 | |
717 | #define IFLA_VLAN_ID 1 | |
718 | #define IFLA_VLAN_FLAGS 2 | |
719 | #define IFLA_VLAN_EGRESS_QOS 3 | |
720 | #define IFLA_VLAN_INGRESS_QOS 4 | |
721 | #define IFLA_VLAN_PROTOCOL 5 | |
722 | #define __IFLA_VLAN_MAX 6 | |
723 | ||
724 | #define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1) | |
725 | #endif | |
726 | ||
015e1916 | 727 | #if !HAVE_DECL_IFLA_VXLAN_GPE |
81577dc2 ZJS |
728 | #define IFLA_VXLAN_UNSPEC 0 |
729 | #define IFLA_VXLAN_ID 1 | |
730 | #define IFLA_VXLAN_GROUP 2 | |
731 | #define IFLA_VXLAN_LINK 3 | |
732 | #define IFLA_VXLAN_LOCAL 4 | |
733 | #define IFLA_VXLAN_TTL 5 | |
734 | #define IFLA_VXLAN_TOS 6 | |
735 | #define IFLA_VXLAN_LEARNING 7 | |
736 | #define IFLA_VXLAN_AGEING 8 | |
737 | #define IFLA_VXLAN_LIMIT 9 | |
738 | #define IFLA_VXLAN_PORT_RANGE 10 | |
739 | #define IFLA_VXLAN_PROXY 11 | |
740 | #define IFLA_VXLAN_RSC 12 | |
741 | #define IFLA_VXLAN_L2MISS 13 | |
742 | #define IFLA_VXLAN_L3MISS 14 | |
743 | #define IFLA_VXLAN_PORT 15 | |
744 | #define IFLA_VXLAN_GROUP6 16 | |
745 | #define IFLA_VXLAN_LOCAL6 17 | |
583c14fc MO |
746 | #define IFLA_VXLAN_UDP_CSUM 18 |
747 | #define IFLA_VXLAN_UDP_ZERO_CSUM6_TX 19 | |
748 | #define IFLA_VXLAN_UDP_ZERO_CSUM6_RX 20 | |
749 | #define IFLA_VXLAN_REMCSUM_TX 21 | |
750 | #define IFLA_VXLAN_REMCSUM_RX 22 | |
751 | #define IFLA_VXLAN_GBP 23 | |
752 | #define IFLA_VXLAN_REMCSUM_NOPARTIAL 24 | |
015e1916 SS |
753 | #define IFLA_VXLAN_COLLECT_METADATA 25 |
754 | #define IFLA_VXLAN_LABEL 26 | |
755 | #define IFLA_VXLAN_GPE 27 | |
756 | ||
757 | #define __IFLA_VXLAN_MAX 28 | |
81577dc2 ZJS |
758 | |
759 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) | |
760 | #endif | |
761 | ||
56bf3853 | 762 | #if !HAVE_DECL_IFLA_IPTUN_ENCAP_DPORT |
81577dc2 ZJS |
763 | #define IFLA_IPTUN_UNSPEC 0 |
764 | #define IFLA_IPTUN_LINK 1 | |
765 | #define IFLA_IPTUN_LOCAL 2 | |
766 | #define IFLA_IPTUN_REMOTE 3 | |
767 | #define IFLA_IPTUN_TTL 4 | |
768 | #define IFLA_IPTUN_TOS 5 | |
769 | #define IFLA_IPTUN_ENCAP_LIMIT 6 | |
770 | #define IFLA_IPTUN_FLOWINFO 7 | |
771 | #define IFLA_IPTUN_FLAGS 8 | |
772 | #define IFLA_IPTUN_PROTO 9 | |
773 | #define IFLA_IPTUN_PMTUDISC 10 | |
774 | #define IFLA_IPTUN_6RD_PREFIX 11 | |
775 | #define IFLA_IPTUN_6RD_RELAY_PREFIX 12 | |
776 | #define IFLA_IPTUN_6RD_PREFIXLEN 13 | |
777 | #define IFLA_IPTUN_6RD_RELAY_PREFIXLEN 14 | |
56bf3853 SS |
778 | #define IFLA_IPTUN_ENCAP_TYPE 15 |
779 | #define IFLA_IPTUN_ENCAP_FLAGS 16 | |
780 | #define IFLA_IPTUN_ENCAP_SPORT 17 | |
781 | #define IFLA_IPTUN_ENCAP_DPORT 18 | |
782 | ||
783 | #define __IFLA_IPTUN_MAX 19 | |
81577dc2 ZJS |
784 | |
785 | #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) | |
786 | #endif | |
787 | ||
66f4bc77 SS |
788 | #if !HAVE_DECL_IFLA_GRE_ENCAP_DPORT |
789 | #define IFLA_GRE_UNSPEC 0 | |
790 | #define IFLA_GRE_LINK 1 | |
791 | #define IFLA_GRE_IFLAGS 2 | |
792 | #define IFLA_GRE_OFLAGS 3 | |
793 | #define IFLA_GRE_IKEY 4 | |
794 | #define IFLA_GRE_OKEY 5 | |
795 | #define IFLA_GRE_LOCAL 6 | |
796 | #define IFLA_GRE_REMOTE 7 | |
797 | #define IFLA_GRE_TTL 8 | |
798 | #define IFLA_GRE_TOS 9 | |
799 | #define IFLA_GRE_PMTUDISC 10 | |
800 | #define IFLA_GRE_ENCAP_LIMIT 11 | |
801 | #define IFLA_GRE_FLOWINFO 12 | |
802 | #define IFLA_GRE_FLAGS 13 | |
803 | #define IFLA_GRE_ENCAP_TYPE 14 | |
804 | #define IFLA_GRE_ENCAP_FLAGS 15 | |
805 | #define IFLA_GRE_ENCAP_SPORT 16 | |
806 | #define IFLA_GRE_ENCAP_DPORT 17 | |
807 | ||
808 | #define __IFLA_GRE_MAX 18 | |
809 | ||
810 | #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) | |
811 | #endif | |
812 | ||
81577dc2 ZJS |
813 | #if !HAVE_DECL_IFLA_BRIDGE_VLAN_INFO |
814 | #define IFLA_BRIDGE_FLAGS 0 | |
815 | #define IFLA_BRIDGE_MODE 1 | |
816 | #define IFLA_BRIDGE_VLAN_INFO 2 | |
817 | #define __IFLA_BRIDGE_MAX 3 | |
818 | ||
819 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) | |
820 | #endif | |
623a4c97 | 821 | |
13b498f9 TJ |
822 | #ifndef BRIDGE_VLAN_INFO_RANGE_BEGIN |
823 | #define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */ | |
824 | #endif | |
825 | ||
826 | #ifndef BRIDGE_VLAN_INFO_RANGE_END | |
827 | #define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */ | |
828 | #endif | |
829 | ||
3282493a | 830 | #if !HAVE_DECL_IFLA_BR_VLAN_DEFAULT_PVID |
c3eae485 SS |
831 | #define IFLA_BR_UNSPEC 0 |
832 | #define IFLA_BR_FORWARD_DELAY 1 | |
833 | #define IFLA_BR_HELLO_TIME 2 | |
834 | #define IFLA_BR_MAX_AGE 3 | |
835 | #define IFLA_BR_AGEING_TIME 4 | |
836 | #define IFLA_BR_STP_STATE 5 | |
837 | #define IFLA_BR_PRIORITY 6 | |
3fef7a3f SS |
838 | #define IFLA_BR_VLAN_FILTERING 7 |
839 | #define IFLA_BR_VLAN_PROTOCOL 8 | |
840 | #define IFLA_BR_GROUP_FWD_MASK 9 | |
841 | #define IFLA_BR_ROOT_ID 10 | |
842 | #define IFLA_BR_BRIDGE_ID 11 | |
843 | #define IFLA_BR_ROOT_PORT 12 | |
844 | #define IFLA_BR_ROOT_PATH_COST 13 | |
845 | #define IFLA_BR_TOPOLOGY_CHANGE 14 | |
846 | #define IFLA_BR_TOPOLOGY_CHANGE_DETECTED 15 | |
847 | #define IFLA_BR_HELLO_TIMER 16 | |
848 | #define IFLA_BR_TCN_TIMER 17 | |
849 | #define IFLA_BR_TOPOLOGY_CHANGE_TIMER 18 | |
850 | #define IFLA_BR_GC_TIMER 19 | |
851 | #define IFLA_BR_GROUP_ADDR 20 | |
852 | #define IFLA_BR_FDB_FLUSH 21 | |
853 | #define IFLA_BR_MCAST_ROUTER 22 | |
854 | #define IFLA_BR_MCAST_SNOOPING 23 | |
855 | #define IFLA_BR_MCAST_QUERY_USE_IFADDR 24 | |
856 | #define IFLA_BR_MCAST_QUERIER 25 | |
857 | #define IFLA_BR_MCAST_HASH_ELASTICITY 26 | |
858 | #define IFLA_BR_MCAST_HASH_MAX 27 | |
859 | #define IFLA_BR_MCAST_LAST_MEMBER_CNT 28 | |
860 | #define IFLA_BR_MCAST_STARTUP_QUERY_CNT 29 | |
861 | #define IFLA_BR_MCAST_LAST_MEMBER_INTVL 30 | |
862 | #define IFLA_BR_MCAST_MEMBERSHIP_INTVL 31 | |
863 | #define IFLA_BR_MCAST_QUERIER_INTVL 32 | |
864 | #define IFLA_BR_MCAST_QUERY_INTVL 33 | |
865 | #define IFLA_BR_MCAST_QUERY_RESPONSE_INTVL 34 | |
866 | #define IFLA_BR_MCAST_STARTUP_QUERY_INTVL 35 | |
867 | #define IFLA_BR_NF_CALL_IPTABLES 36 | |
868 | #define IFLA_BR_NF_CALL_IP6TABLES 37 | |
869 | #define IFLA_BR_NF_CALL_ARPTABLES 38 | |
870 | #define IFLA_BR_VLAN_DEFAULT_PVID 39 | |
871 | #define __IFLA_BR_MAX 40 | |
c3eae485 SS |
872 | |
873 | #define IFLA_BR_MAX (__IFLA_BR_MAX - 1) | |
874 | #endif | |
875 | ||
38a0245f | 876 | #if !HAVE_DECL_IFLA_BRPORT_LEARNING_SYNC |
8ecec322 ZJS |
877 | #define IFLA_BRPORT_UNSPEC 0 |
878 | #define IFLA_BRPORT_STATE 1 | |
879 | #define IFLA_BRPORT_PRIORITY 2 | |
880 | #define IFLA_BRPORT_COST 3 | |
881 | #define IFLA_BRPORT_MODE 4 | |
882 | #define IFLA_BRPORT_GUARD 5 | |
883 | #define IFLA_BRPORT_PROTECT 6 | |
884 | #define IFLA_BRPORT_FAST_LEAVE 7 | |
885 | #define IFLA_BRPORT_LEARNING 8 | |
886 | #define IFLA_BRPORT_UNICAST_FLOOD 9 | |
38a0245f SS |
887 | #define IFLA_BRPORT_LEARNING_SYNC 11 |
888 | #define __IFLA_BRPORT_MAX 12 | |
8ecec322 ZJS |
889 | |
890 | #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) | |
891 | #endif | |
892 | ||
26c34ab4 DM |
893 | #if !HAVE_DECL_IFLA_BRPORT_PROXYARP |
894 | #define IFLA_BRPORT_PROXYARP 10 | |
895 | #endif | |
896 | ||
20897a0d AR |
897 | #if !HAVE_DECL_IFLA_VRF_TABLE |
898 | #define IFLA_VRF_TABLE 1 | |
899 | #endif | |
900 | ||
cf1755ba MO |
901 | #if !HAVE_DECL_NDA_IFINDEX |
902 | #define NDA_UNSPEC 0 | |
903 | #define NDA_DST 1 | |
904 | #define NDA_LLADDR 2 | |
905 | #define NDA_CACHEINFO 3 | |
906 | #define NDA_PROBES 4 | |
907 | #define NDA_VLAN 5 | |
908 | #define NDA_PORT 6 | |
909 | #define NDA_VNI 7 | |
910 | #define NDA_IFINDEX 8 | |
911 | #define __NDA_MAX 9 | |
912 | ||
913 | #define NDA_MAX (__NDA_MAX - 1) | |
914 | #endif | |
915 | ||
b69015ef TG |
916 | #ifndef RTA_PREF |
917 | #define RTA_PREF 20 | |
918 | #endif | |
919 | ||
623a4c97 LP |
920 | #ifndef IPV6_UNICAST_IF |
921 | #define IPV6_UNICAST_IF 76 | |
922 | #endif | |
ec2c5e43 | 923 | |
439689c6 SS |
924 | #ifndef IPV6_MIN_MTU |
925 | #define IPV6_MIN_MTU 1280 | |
926 | #endif | |
927 | ||
04d180c8 TG |
928 | #ifndef IFF_MULTI_QUEUE |
929 | #define IFF_MULTI_QUEUE 0x100 | |
930 | #endif | |
931 | ||
ec2c5e43 LP |
932 | #ifndef IFF_LOWER_UP |
933 | #define IFF_LOWER_UP 0x10000 | |
934 | #endif | |
935 | ||
936 | #ifndef IFF_DORMANT | |
937 | #define IFF_DORMANT 0x20000 | |
938 | #endif | |
91988149 LP |
939 | |
940 | #ifndef BOND_XMIT_POLICY_ENCAP23 | |
941 | #define BOND_XMIT_POLICY_ENCAP23 3 | |
942 | #endif | |
943 | ||
944 | #ifndef BOND_XMIT_POLICY_ENCAP34 | |
945 | #define BOND_XMIT_POLICY_ENCAP34 4 | |
946 | #endif | |
04b67d49 TG |
947 | |
948 | #ifndef NET_ADDR_RANDOM | |
949 | # define NET_ADDR_RANDOM 1 | |
950 | #endif | |
951 | ||
1cb636d9 CW |
952 | #ifndef NET_NAME_UNKNOWN |
953 | # define NET_NAME_UNKNOWN 0 | |
954 | #endif | |
955 | ||
04b67d49 TG |
956 | #ifndef NET_NAME_ENUM |
957 | # define NET_NAME_ENUM 1 | |
958 | #endif | |
959 | ||
960 | #ifndef NET_NAME_PREDICTABLE | |
961 | # define NET_NAME_PREDICTABLE 2 | |
962 | #endif | |
963 | ||
964 | #ifndef NET_NAME_USER | |
965 | # define NET_NAME_USER 3 | |
966 | #endif | |
967 | ||
968 | #ifndef NET_NAME_RENAMED | |
969 | # define NET_NAME_RENAMED 4 | |
970 | #endif | |
7965435e MO |
971 | |
972 | #ifndef BPF_XOR | |
973 | # define BPF_XOR 0xa0 | |
974 | #endif | |
a5f03596 LP |
975 | |
976 | /* Note that LOOPBACK_IFINDEX is currently not exported by the | |
977 | * kernel/glibc, but hardcoded internally by the kernel. However, as | |
978 | * it is exported to userspace indirectly via rtnetlink and the | |
979 | * ioctls, and made use of widely we define it here too, in a way that | |
980 | * is compatible with the kernel's internal definition. */ | |
981 | #ifndef LOOPBACK_IFINDEX | |
982 | #define LOOPBACK_IFINDEX 1 | |
983 | #endif | |
875c2e22 | 984 | |
34f7b9f9 LP |
985 | #if !HAVE_DECL_IFA_FLAGS |
986 | #define IFA_FLAGS 8 | |
987 | #endif | |
988 | ||
f217be19 DH |
989 | #ifndef IFA_F_MANAGETEMPADDR |
990 | #define IFA_F_MANAGETEMPADDR 0x100 | |
991 | #endif | |
992 | ||
b06ac35c AS |
993 | #ifndef IFA_F_NOPREFIXROUTE |
994 | #define IFA_F_NOPREFIXROUTE 0x200 | |
995 | #endif | |
996 | ||
875c2e22 LP |
997 | #ifndef MAX_AUDIT_MESSAGE_LENGTH |
998 | #define MAX_AUDIT_MESSAGE_LENGTH 8970 | |
999 | #endif | |
1000 | ||
1001 | #ifndef AUDIT_NLGRP_MAX | |
1002 | #define AUDIT_NLGRP_READLOG 1 | |
1003 | #endif | |
2822da4f LP |
1004 | |
1005 | #ifndef CAP_MAC_OVERRIDE | |
1006 | #define CAP_MAC_OVERRIDE 32 | |
1007 | #endif | |
1008 | ||
1009 | #ifndef CAP_MAC_ADMIN | |
1010 | #define CAP_MAC_ADMIN 33 | |
1011 | #endif | |
1012 | ||
1013 | #ifndef CAP_SYSLOG | |
1014 | #define CAP_SYSLOG 34 | |
1015 | #endif | |
1016 | ||
1017 | #ifndef CAP_WAKE_ALARM | |
1018 | #define CAP_WAKE_ALARM 35 | |
1019 | #endif | |
1020 | ||
1021 | #ifndef CAP_BLOCK_SUSPEND | |
1022 | #define CAP_BLOCK_SUSPEND 36 | |
1023 | #endif | |
1024 | ||
1025 | #ifndef CAP_AUDIT_READ | |
1026 | #define CAP_AUDIT_READ 37 | |
1027 | #endif | |
60e1651a | 1028 | |
ebd93cb6 LP |
1029 | #ifndef RENAME_NOREPLACE |
1030 | #define RENAME_NOREPLACE (1 << 0) | |
1031 | #endif | |
f7ad54a3 | 1032 | |
f7ad54a3 LP |
1033 | #ifndef KCMP_FILE |
1034 | #define KCMP_FILE 0 | |
1035 | #endif | |
606df97b PH |
1036 | |
1037 | #ifndef INPUT_PROP_POINTING_STICK | |
1038 | #define INPUT_PROP_POINTING_STICK 0x05 | |
1039 | #endif | |
bd1acc9f HG |
1040 | |
1041 | #ifndef INPUT_PROP_ACCELEROMETER | |
1042 | #define INPUT_PROP_ACCELEROMETER 0x06 | |
1043 | #endif | |
e287086b | 1044 | |
de085700 | 1045 | #ifndef HAVE_KEY_SERIAL_T |
e287086b LP |
1046 | typedef int32_t key_serial_t; |
1047 | #endif | |
1048 | ||
74dd6b51 LP |
1049 | #ifndef KEYCTL_JOIN_SESSION_KEYRING |
1050 | #define KEYCTL_JOIN_SESSION_KEYRING 1 | |
1051 | #endif | |
1052 | ||
1053 | #ifndef KEYCTL_CHOWN | |
1054 | #define KEYCTL_CHOWN 4 | |
1055 | #endif | |
1056 | ||
1057 | #ifndef KEYCTL_SETPERM | |
1058 | #define KEYCTL_SETPERM 5 | |
1059 | #endif | |
1060 | ||
1061 | #ifndef KEYCTL_DESCRIBE | |
1062 | #define KEYCTL_DESCRIBE 6 | |
1063 | #endif | |
1064 | ||
e287086b LP |
1065 | #ifndef KEYCTL_READ |
1066 | #define KEYCTL_READ 11 | |
1067 | #endif | |
1068 | ||
1069 | #ifndef KEYCTL_SET_TIMEOUT | |
1070 | #define KEYCTL_SET_TIMEOUT 15 | |
1071 | #endif | |
1072 | ||
74dd6b51 LP |
1073 | #ifndef KEY_POS_VIEW |
1074 | #define KEY_POS_VIEW 0x01000000 | |
1075 | #define KEY_POS_READ 0x02000000 | |
1076 | #define KEY_POS_WRITE 0x04000000 | |
1077 | #define KEY_POS_SEARCH 0x08000000 | |
1078 | #define KEY_POS_LINK 0x10000000 | |
1079 | #define KEY_POS_SETATTR 0x20000000 | |
1080 | ||
1081 | #define KEY_USR_VIEW 0x00010000 | |
1082 | #define KEY_USR_READ 0x00020000 | |
1083 | #define KEY_USR_WRITE 0x00040000 | |
1084 | #define KEY_USR_SEARCH 0x00080000 | |
1085 | #define KEY_USR_LINK 0x00100000 | |
1086 | #define KEY_USR_SETATTR 0x00200000 | |
1087 | ||
1088 | #define KEY_GRP_VIEW 0x00000100 | |
1089 | #define KEY_GRP_READ 0x00000200 | |
1090 | #define KEY_GRP_WRITE 0x00000400 | |
1091 | #define KEY_GRP_SEARCH 0x00000800 | |
1092 | #define KEY_GRP_LINK 0x00001000 | |
1093 | #define KEY_GRP_SETATTR 0x00002000 | |
1094 | ||
1095 | #define KEY_OTH_VIEW 0x00000001 | |
1096 | #define KEY_OTH_READ 0x00000002 | |
1097 | #define KEY_OTH_WRITE 0x00000004 | |
1098 | #define KEY_OTH_SEARCH 0x00000008 | |
1099 | #define KEY_OTH_LINK 0x00000010 | |
1100 | #define KEY_OTH_SETATTR 0x00000020 | |
1101 | #endif | |
1102 | ||
e287086b LP |
1103 | #ifndef KEY_SPEC_USER_KEYRING |
1104 | #define KEY_SPEC_USER_KEYRING -4 | |
1105 | #endif | |
755d4b67 | 1106 | |
74dd6b51 LP |
1107 | #ifndef KEY_SPEC_SESSION_KEYRING |
1108 | #define KEY_SPEC_SESSION_KEYRING -3 | |
1109 | #endif | |
1110 | ||
755d4b67 IP |
1111 | #ifndef PR_CAP_AMBIENT |
1112 | #define PR_CAP_AMBIENT 47 | |
1113 | #endif | |
1114 | ||
1115 | #ifndef PR_CAP_AMBIENT_IS_SET | |
1116 | #define PR_CAP_AMBIENT_IS_SET 1 | |
1117 | #endif | |
1118 | ||
1119 | #ifndef PR_CAP_AMBIENT_RAISE | |
1120 | #define PR_CAP_AMBIENT_RAISE 2 | |
1121 | #endif | |
1122 | ||
1123 | #ifndef PR_CAP_AMBIENT_CLEAR_ALL | |
1124 | #define PR_CAP_AMBIENT_CLEAR_ALL 4 | |
1125 | #endif | |
6955a3ba LP |
1126 | |
1127 | /* The following two defines are actually available in the kernel headers for longer, but we define them here anyway, | |
1128 | * since that makes it easier to use them in conjunction with the glibc net/if.h header which conflicts with | |
1129 | * linux/if.h. */ | |
1130 | #ifndef IF_OPER_UNKNOWN | |
1131 | #define IF_OPER_UNKNOWN 0 | |
1132 | #endif | |
1133 | ||
1134 | #ifndef IF_OPER_UP | |
1135 | #define IF_OPER_UP 6 | |
c932fb71 | 1136 | |
de085700 | 1137 | #ifndef HAVE_CHAR32_T |
c932fb71 SL |
1138 | #define char32_t uint32_t |
1139 | #endif | |
1140 | ||
de085700 | 1141 | #ifndef HAVE_CHAR16_T |
c932fb71 SL |
1142 | #define char16_t uint16_t |
1143 | #endif | |
1144 | ||
43a6a52e LP |
1145 | #ifndef ETHERTYPE_LLDP |
1146 | #define ETHERTYPE_LLDP 0x88cc | |
1147 | #endif | |
1148 | ||
e63be084 SS |
1149 | #ifndef IFA_F_MCAUTOJOIN |
1150 | #define IFA_F_MCAUTOJOIN 0x400 | |
1151 | #endif | |
1152 | ||
a39f92d3 SS |
1153 | #ifndef HAVE_STRUCT_ETHTOOL_LINK_SETTINGS |
1154 | ||
1155 | #define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get ethtool_link_settings */ | |
1156 | #define ETHTOOL_SLINKSETTINGS 0x0000004d /* Set ethtool_link_settings */ | |
1157 | ||
1158 | struct ethtool_link_settings { | |
1159 | __u32 cmd; | |
1160 | __u32 speed; | |
1161 | __u8 duplex; | |
1162 | __u8 port; | |
1163 | __u8 phy_address; | |
1164 | __u8 autoneg; | |
1165 | __u8 mdio_support; | |
1166 | __u8 eth_tp_mdix; | |
1167 | __u8 eth_tp_mdix_ctrl; | |
1168 | __s8 link_mode_masks_nwords; | |
1169 | __u32 reserved[8]; | |
1170 | __u32 link_mode_masks[0]; | |
1171 | /* layout of link_mode_masks fields: | |
1172 | * __u32 map_supported[link_mode_masks_nwords]; | |
1173 | * __u32 map_advertising[link_mode_masks_nwords]; | |
1174 | * __u32 map_lp_advertising[link_mode_masks_nwords]; | |
1175 | */ | |
1176 | }; | |
1177 | ||
1178 | #endif | |
1179 | ||
6955a3ba | 1180 | #endif |
1d4b557d | 1181 | |
0fe5f3c5 LP |
1182 | #ifndef SOL_ALG |
1183 | #define SOL_ALG 279 | |
1184 | #endif | |
1185 | ||
4e0399e6 SH |
1186 | #ifndef AF_VSOCK |
1187 | #define AF_VSOCK 40 | |
1188 | #endif | |
1189 | ||
2f368e4a | 1190 | #include "missing_syscall.h" |