From owner-freebsd-hackers@freebsd.org Fri Aug 5 17:28:31 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AB8FBAF332 for ; Fri, 5 Aug 2016 17:28:31 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4005319BA; Fri, 5 Aug 2016 17:28:30 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-wm0-f67.google.com with SMTP id q128so4668979wma.1; Fri, 05 Aug 2016 10:28:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:subject:date :message-id:cc:to:mime-version; bh=hmJc5iOXHcJ+WjiUHb3KSw4XmiEApazTpXXyMCpokds=; b=i4U+Q8rHNP0tWytumav1AvxnriFCGspJXHj7zYnoS/rJNOte44GMN4NZfqzmAv03tM EJ6aXx3lF7FgC/LTCNSUd4CV+W14fKaBkBrqwvQ+8s8j5BKT/+PVS23ivpOdBJviZJF5 xJqncKbN0LOJh8Wg1+Qi7iDlHhU1NK812cCYAQLVeGqbGb3kIVV1Q8fOL2rZPxYFGDgh 0bDkLqQVa5rOG/qb+i5GcOX7xHYWIogjWB1CHH621vfZoihAOMLaCavhUIeA1ynVma3P MTBdRdQ2eXIV+uqoCnyA62WiDP9M9Am/A/Hsj6xRUVVUR26uGW8BlZ+xk0wNp8r28u5m 3kGA== X-Gm-Message-State: AEkooutLAvCZI9AK3k1BZFtmpAjOlcFij4w1eKj7C6bKRVNYcB2lToY7ciX1yazOxoCyCw== X-Received: by 10.28.225.4 with SMTP id y4mr4529248wmg.98.1470417223829; Fri, 05 Aug 2016 10:13:43 -0700 (PDT) Received: from maka.fritz.box (dslb-094-223-132-163.094.223.pools.vodafone-ip.de. [94.223.132.163]) by smtp.gmail.com with ESMTPSA id 17sm9544088wmf.6.2016.08.05.10.13.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Aug 2016 10:13:43 -0700 (PDT) From: Mateusz Piotrowski <0mp@FreeBSD.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Accessing libbsm functions (conditionally compiled with #if defined(_KERNEL) || defined(KERNEL)) Date: Fri, 5 Aug 2016 19:13:39 +0200 Message-Id: Cc: Konrad Witaszczyk To: freebsd-hackers@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2016 17:28:31 -0000 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 I am = able to most of the functions listed=20 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=20 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?=20 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=