From owner-p4-projects@FreeBSD.ORG Tue Aug 4 20:15:16 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8B6591065706; Tue, 4 Aug 2009 20:15:16 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B6FD1065714 for ; Tue, 4 Aug 2009 20:15:16 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 283AE8FC19 for ; Tue, 4 Aug 2009 20:15:16 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n74KFGF2088133 for ; Tue, 4 Aug 2009 20:15:16 GMT (envelope-from sson@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n74KFF7U088131 for perforce@freebsd.org; Tue, 4 Aug 2009 20:15:15 GMT (envelope-from sson@FreeBSD.org) Date: Tue, 4 Aug 2009 20:15:15 GMT Message-Id: <200908042015.n74KFF7U088131@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sson@FreeBSD.org using -f From: Stacey Son To: Perforce Change Reviews Cc: Subject: PERFORCE change 167006 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2009 20:15:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=167006 Change 167006 by sson@sson_amd64 on 2009/08/04 20:15:05 Change au_write_tok() to au_print_flags_tok() to avoid confusion with other API functions. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#47 edit .. //depot/projects/trustedbsd/openbsm/libbsm/au_io.3#7 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#65 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#47 (text+ko) ==== @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#46 $ + * $P4: //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#47 $ */ #ifndef _LIBBSM_H_ @@ -101,7 +101,7 @@ #define AU_TO_WRITE 1 /* Commit audit record. */ /* - * Output format flags to au_write_tok(). + * Output format flags for au_print_flags_tok(). */ #define AU_OFLAG_NONE 0x0000 /* Default form. */ #define AU_OFLAG_RAW 0x0001 /* Raw, numeric form. */ @@ -829,10 +829,10 @@ //XXX The following interface has different prototype from BSM void au_print_tok(FILE *outfp, tokenstr_t *tok, char *del, char raw, char sfrm); +void au_print_flags_tok(FILE *outfp, tokenstr_t *tok, + char *del, int oflags); void au_print_tok_xml(FILE *outfp, tokenstr_t *tok, char *del, char raw, char sfrm); -void au_write_tok(FILE *outfp, tokenstr_t *tok, - char *del, int oflags); /* * Functions relating to XML output. ==== //depot/projects/trustedbsd/openbsm/libbsm/au_io.3#7 (text+ko) ==== @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_io.3#6 $ +.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/au_io.3#7 $ .\" .Dd August 4, 2009 .Dt AU_IO 3 @@ -31,6 +31,7 @@ .Sh NAME .Nm au_fetch_tok , .Nm au_print_tok , +.Nm au_print_flags_tok , .Nm au_read_rec .Nd "perform I/O involving an audit record" .Sh LIBRARY @@ -43,12 +44,12 @@ .Fo au_print_tok .Fa "FILE *outfp" "tokenstr_t *tok" "char *del" "char raw" "char sfrm" .Fc -.Ft int -.Fn au_read_rec "FILE *fp" "u_char **buf" .Ft void -.Fo au_write_tok +.Fo au_print_flags_tok .Fa "FILE *outfp" "tokenstr_t *tok" "char *del" "int oflags" .Fc +.Ft int +.Fn au_read_rec "FILE *fp" "u_char **buf" .Sh DESCRIPTION These interfaces support input and output (I/O) involving audit records, internalizing an audit record from a byte stream, converting a token to @@ -78,7 +79,7 @@ .Fa del is used when printing. The -.Fn au_write_tok +.Fn au_print_flags_tok function is a replacement for .Fn au_print_tok . The @@ -118,7 +119,7 @@ calls to .Fn au_fetch_tok on the buffer, and then invoking -.Fn au_write_tok +.Fn au_print_flags_tok to print each token to an output stream such as .Dv stdout . On completion of the processing of each record, a call to @@ -143,6 +144,15 @@ division of McAfee Inc., under contract to Apple Computer, Inc., in 2004. It was subsequently adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution. +.Pp +The +.Fn au_print_flags_tok +function was added by Stacey Son as a replacement for the +.Fn au_print_tok +so new output formatting flags can be easily added without changing the API. +The +.Fn au_print_tok +is obsolete but remains in the API to support legacy code. .Sh AUTHORS .An -nosplit This software was created by ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#65 (text+ko) ==== @@ -32,7 +32,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#64 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#65 $ */ #include @@ -4116,7 +4116,7 @@ } void -au_write_tok(FILE *outfp, tokenstr_t *tok, char *del, int oflags) +au_print_flags_tok(FILE *outfp, tokenstr_t *tok, char *del, int oflags) { switch(tok->id) { @@ -4302,7 +4302,7 @@ if (sfrm) oflags |= AU_OFLAG_SHORT; - au_write_tok(outfp, tok, del, oflags); + au_print_flags_tok(outfp, tok, del, oflags); } /* @@ -4319,7 +4319,7 @@ if (sfrm) oflags |= AU_OFLAG_SHORT; - au_write_tok(outfp, tok, del, oflags); + au_print_flags_tok(outfp, tok, del, oflags); } /*