Accessing libbsm functions (conditionally compiled with #if defined(_KERNEL) || defined(KERNEL))
Mateusz Piotrowski
0mp at FreeBSD.org
Fri Aug 5 17:28:31 UTC 2016
Hello,
I am participating in Google Summer of Code and I work on converting auditing logs from the Linux Audit format to the BSM format (more details are available on wiki[1] and GitHub[2][3]).
I use libbsm to generate tokens. After including <bsm/libbsm.h> I am able to most of the functions listed
in au_token(3) (note that this manual is a little bit outdated), however I am unable to call au_to_attr() and to define
a struct vnode_au_info variable which is the parameter of au_to_attr().
I read the source code and I found out that au_to_attr() is prototyped in sys/bsm/audit_record.h like this:
#if defined(_KERNEL) || defined(KERNEL)
token_t *au_to_attr(struct vnode_au_info *vni);
token_t *au_to_attr32(struct vnode_au_info *vni);
token_t *au_to_attr64(struct vnode_au_info *vni);
#endif
The prototype of struct vnode_au_info is wrapped in if-defined-kernel-macros as well in the same file.
What should I do to be able to use those functions?
Why are those functions available only when the library was compiled with KERNEL defined?
Thanks for any help/hints.
-Mateusz
[1]: https://wiki.freebsd.org/SummerOfCode2016/NonBSMtoBSMConversionTools
[2]: https://github.com/0mp/freebsd
[3]: https://github.com/0mp/freebsd/wiki
More information about the freebsd-hackers
mailing list