Date: Sun, 24 Apr 2005 16:37:04 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 75893 for review Message-ID: <200504241637.j3OGb44V093119@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=75893 Change 75893 by rwatson@rwatson_paprika on 2005/04/24 16:36:26 Move libbsm-internal macros and defines associated with token assembly and record assembly from public audit_record.h to a new private libbsm_internal.h to avoid leaking them into applications or building external dependencies. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#7 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#6 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#3 edit .. //depot/projects/trustedbsd/openbsm/libbsm/libbsm_internal.h#1 add Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#7 (text+ko) ==== @@ -24,50 +24,6 @@ #ifndef _BSM_AUDIT_RECORD_H_ #define _BSM_AUDIT_RECORD_H_ -/* We could determined the header and trailer sizes by - * defining appropriate structures. We hold off that approach - * till we have a consistant way of using structures for all tokens. - * This is not straightforward since these token structures may - * contain pointers of whose contents we dont know the size - * (e.g text tokens) - */ -#define BSM_HEADER_SIZE 18 -#define BSM_TRAILER_SIZE 7 - -#define ADD_U_CHAR(loc, val) \ - do {\ - *loc = val;\ - loc += sizeof(u_char);\ - }while(0) - - -#define ADD_U_INT16(loc, val) \ - do { \ - memcpy(loc, (u_char *)&val, sizeof(u_int16_t));\ - loc += sizeof(u_int16_t); \ - }while(0) - -#define ADD_U_INT32(loc, val) \ - do { \ - memcpy(loc, (u_char *)&val, sizeof(u_int32_t));\ - loc += sizeof(u_int32_t); \ - }while(0) - -#define ADD_U_INT64(loc, val)\ - do {\ - memcpy(loc, (u_char *)&val, sizeof(u_int64_t));\ - loc += sizeof(u_int64_t); \ - }while(0) - -#define ADD_MEM(loc, data, size) \ - do { \ - memcpy(loc, data, size);\ - loc += size;\ - }while(0) - -#define ADD_STRING(loc, data, size) ADD_MEM(loc, data, size) - - /* Various token id types */ /* ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#6 (text+ko) ==== @@ -37,6 +37,8 @@ #include <stdlib.h> #include <string.h> +#include "libbsm_internal.h" + /* array of used descriptors */ static au_record_t* open_desc_table[MAX_AUDIT_RECORDS]; ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#3 (text+ko) ==== @@ -42,6 +42,8 @@ #include <libbsm.h> +#include "libbsm_internal.h" + #define READ_TOKEN_BYTES(buf, len, dest, size, bytesread, err) \ do {\ if(bytesread + size > len) {\
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504241637.j3OGb44V093119>