FreeBSD/contrib/openbsm/bin/auditreduce/auditreduce.c
/*
 * Check if the given ipc object with the given type matches the selection
 * criteria.
 */
Check if the given ipc object with the given type matches the selection
criteria.
Check if the given ipc object with the given type matches the selection criteria .
static int
select_ipcobj(u_char type, uint32_t id, uint32_t *optchkd)
{
	if (type == AT_IPC_MSG) {
		SETOPT((*optchkd), OPT_om);
		if (ISOPTSET(opttochk, OPT_om)) {
			if (id != (uint32_t)strtol(p_msgqobj, (char **)NULL,
			    10))
				return (0);
		}
		return (1);
	} else if (type == AT_IPC_SEM) {
		SETOPT((*optchkd), OPT_ose);
		if (ISOPTSET(opttochk, OPT_ose)) {
			if (id != (uint32_t)strtol(p_semobj, (char **)NULL, 10))
				return (0);
		}
		return (1);
	} else if (type == AT_IPC_SHM) {
		SETOPT((*optchkd), OPT_osh);
		if (ISOPTSET(opttochk, OPT_osh)) {
			if (id != (uint32_t)strtol(p_shmobj, (char **)NULL, 10))
				return (0);
		}
		return (1);
	}
	if (ISOPTSET(opttochk, OPT_om) || ISOPTSET(opttochk, OPT_ose)
	    || ISOPTSET(opttochk, OPT_osh))
		return (0);
	return (1);
}
static int select_ipcobj ( u_char type , uint32_t id , uint32_t * optchkd ) { if ( type == AT_IPC_MSG ) { SETOPT ( ( * optchkd ) , OPT_om ) ; if ( ISOPTSET ( opttochk , OPT_om ) ) { if ( id != ( uint32_t ) strtol ( p_msgqobj , ( char * * ) NULL , 10 ) ) return ( 0 ) ; } return ( 1 ) ; } else if ( type == AT_IPC_SEM ) { SETOPT ( ( * optchkd ) , OPT_ose ) ; if ( ISOPTSET ( opttochk , OPT_ose ) ) { if ( id != ( uint32_t ) strtol ( p_semobj , ( char * * ) NULL , 10 ) ) return ( 0 ) ; } return ( 1 ) ; } else if ( type == AT_IPC_SHM ) { SETOPT ( ( * optchkd ) , OPT_osh ) ; if ( ISOPTSET ( opttochk , OPT_osh ) ) { if ( id != ( uint32_t ) strtol ( p_shmobj , ( char * * ) NULL , 10 ) ) return ( 0 ) ; } return ( 1 ) ; } if ( ISOPTSET ( opttochk , OPT_om ) || ISOPTSET ( opttochk , OPT_ose ) || ISOPTSET ( opttochk , OPT_osh ) ) return ( 0 ) ; return ( 1 ) ; }
Check if the given ipc object with the given type matches the selection
 criteria.
Check if the given ipc object with the given type matches the selection criteria .
/* Unknown type -- filter if *any* ipc filtering is required. */