PERFORCE change 167006 for review
Stacey Son
sson at FreeBSD.org
Tue Aug 4 20:15:17 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167006
Change 167006 by sson at 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 <sys/types.h>
@@ -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);
}
/*
More information about the p4-projects
mailing list