Debian Codegraph @

include/utils/reverse_endian.h

raw
1 #ifndef REVERSE_ENDIAN_H
2 #define REVERSE_ENDIAN_H
3
4 #include "main.h"
5 #include <byteswap.h>
6 #include <linux/audit.h>
7 #include <stdbool.h>
8 #include <stdint.h>
9
10 static inline bool
11 need_reverse_endian (uint32_t target_scmp_arch)
12 {
13 #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
14 return (target_scmp_arch & __AUDIT_ARCH_LE);
15 #else
16 return !(target_scmp_arch & __AUDIT_ARCH_LE);
17 #endif
18 }
19
20 static inline void
21 reverse_endian (filter *f)
22 {
23 f->code = bswap_16 (f->code);
24 f->k = bswap_32 (f->k);
25 }
26
27 #endif