17c478bd9Sstevel@tonic-gate#!/bin/sh 27c478bd9Sstevel@tonic-gate# 37c478bd9Sstevel@tonic-gate# CDDL HEADER START 47c478bd9Sstevel@tonic-gate# 57c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 645916cd2Sjpk# Common Development and Distribution License (the "License"). 745916cd2Sjpk# You may not use this file except in compliance with the License. 87c478bd9Sstevel@tonic-gate# 97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate# and limitations under the License. 137c478bd9Sstevel@tonic-gate# 147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate# 207c478bd9Sstevel@tonic-gate# CDDL HEADER END 217c478bd9Sstevel@tonic-gate# 227c478bd9Sstevel@tonic-gate# 2345916cd2Sjpk# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2445916cd2Sjpk# Use is subject to license terms. 2545916cd2Sjpk# 267c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 277c478bd9Sstevel@tonic-gate# 2845916cd2Sjpk 297c478bd9Sstevel@tonic-gate# Automagically generate the audit_uevents.h header file. 307c478bd9Sstevel@tonic-gate# 317c478bd9Sstevel@tonic-gateDATABASE=audit_event.txt 327c478bd9Sstevel@tonic-gateHEADER_FILE=audit_uevents.h 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gatecat <<EOF > $HEADER_FILE 357c478bd9Sstevel@tonic-gate/* 3645916cd2Sjpk * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 3745916cd2Sjpk * Use is subject to license terms. 387c478bd9Sstevel@tonic-gate */ 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate#ifndef _BSM_AUDIT_UEVENTS_H 417c478bd9Sstevel@tonic-gate#define _BSM_AUDIT_UEVENTS_H 427c478bd9Sstevel@tonic-gate 43a6600459SstevelEOF 44a6600459Sstevel 45a6600459Sstevelgrep '^# ident' $DATABASE | sed -e 's/^#/#pragma/' \ 46a6600459Sstevel -e "s/$DATABASE/$HEADER_FILE/" >> $HEADER_FILE 47a6600459Sstevel 48a6600459Sstevelcat <<EOF >> $HEADER_FILE 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate/* 517c478bd9Sstevel@tonic-gate * User level audit event numbers. 527c478bd9Sstevel@tonic-gate * 537c478bd9Sstevel@tonic-gate * 0 Reserved as an invalid event number. 547c478bd9Sstevel@tonic-gate * 1 - 2047 Reserved for the Solaris Kernel events. 557c478bd9Sstevel@tonic-gate * 2048 - 32767 Reserved for the Solaris TCB programs. 567c478bd9Sstevel@tonic-gate * 32768 - 65535 Available for third party TCB applications. 577c478bd9Sstevel@tonic-gate * 587c478bd9Sstevel@tonic-gate */ 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate#ifdef __cplusplus 617c478bd9Sstevel@tonic-gateextern "C" { 627c478bd9Sstevel@tonic-gate#endif 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gateEOF 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gatenawk -F: '{if ((NF == 4) && substr($1,0,1) != "#") 677c478bd9Sstevel@tonic-gate if ($1 >= 2048) { 6845916cd2Sjpk tlen = length($2); 6945916cd2Sjpk 7045916cd2Sjpk printf("#define\t%s\t", $2) 7145916cd2Sjpk if (tlen < 8) 7245916cd2Sjpk printf("\t"); 7345916cd2Sjpk if (tlen < 16) 74*d31ffe99Srica printf("\t"); 75*d31ffe99Srica if (tlen < 24) 76*d31ffe99Srica printf("\t"); 77*d31ffe99Srica printf("%s\n", $1); 787c478bd9Sstevel@tonic-gate } 797c478bd9Sstevel@tonic-gate }' \ 807c478bd9Sstevel@tonic-gate< $DATABASE >> $HEADER_FILE 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gatecat <<EOF >> $HEADER_FILE 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate#ifdef __cplusplus 857c478bd9Sstevel@tonic-gate} 867c478bd9Sstevel@tonic-gate#endif 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate#endif /* _BSM_AUDIT_UEVENTS_H */ 897c478bd9Sstevel@tonic-gateEOF 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gateexit 0 92