Mercurial > illumos > illumos-gate
view usr/src/cmd/svc/svccfg/svccfg.l @ 12979:ab9ae749152f
PSARC/2009/617 Software Events Notification Parameters CLI
PSARC/2009/618 snmp-notify: SNMP Notification Daemon for Software Events
PSARC/2009/619 smtp-notify: Email Notification Daemon for Software Events
PSARC/2010/225 fmd for non-global Solaris zones
PSARC/2010/226 Solaris Instance UUID
PSARC/2010/227 nvlist_nvflag(3NVPAIR)
PSARC/2010/228 libfmevent additions
PSARC/2010/257 sysevent_evc_setpropnvl and sysevent_evc_getpropnvl
PSARC/2010/265 FMRI and FMA Event Stabilty, 'ireport' category 1 event class, and the 'sw' FMRI scheme
PSARC/2010/278 FMA/SMF integration: instance state transitions
PSARC/2010/279 Modelling panics within FMA
PSARC/2010/290 logadm.conf upgrade
6392476 fmdump needs to pretty-print
6393375 userland ereport/ireport event generation interfaces
6445732 Add email notification agent for FMA and software events
6804168 RFE: Allow an efficient means to monitor SMF services status changes
6866661 scf_values_destroy(3SCF) will segfault if is passed NULL
6884709 Add snmp notification agent for FMA and software events
6884712 Add private interface to tap into libfmd_msg macro expansion capabilities
6897919 fmd to run in a non-global zone
6897937 fmd use of non-private doors is not safe
6900081 add a UUID to Solaris kernel image for use in crashdump identification
6914884 model panic events as a defect diagnosis in FMA
6944862 fmd_case_open_uuid, fmd_case_uuisresolved, fmd_nvl_create_defect
6944866 log legacy sysevents in fmd
6944867 enumerate svc scheme in topo
6944868 software-diagnosis and software-response fmd modules
6944870 model SMF maintenance state as a defect diagnosis in FMA
6944876 savecore runs in foreground for systems with zfs root and dedicated dump
6965796 Implement notification parameters for SMF state transitions and FMA events
6968287 SUN-FM-MIB.mib needs to be updated to reflect Oracle information
6972331 logadm.conf upgrade PSARC/2010/290
author | Gavin Maltby <gavin.maltby@oracle.com> |
---|---|
date | Fri, 30 Jul 2010 17:04:17 +1000 |
parents | 91b62f7b8186 |
children |
line wrap: on
line source
%{ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. */ #pragma error_messages(off, E_BLOCK_DECL_UNUSED) #pragma error_messages(off, E_EQUALITY_NOT_ASSIGNMENT) #pragma error_messages(off, E_FUNC_RET_MAYBE_IGNORED2) #pragma error_messages(off, E_STMT_NOT_REACHED) #include <libintl.h> #include <string.h> #include "svccfg.h" #include "svccfg_grammar.h" /* * We need to undefine lex's input, unput, and output macros so that references * to these call the functions we provide at the end of this source file, * instead of the default versions based on libc's stdio. */ #ifdef input #undef input #endif #ifdef unput #undef unput #endif #ifdef output #undef output #endif static int input(void); static void unput(int); static void output(int); int parens = 0; extern int yyerror(const char *); %} /* * Since command tokens are only valid at the beginning of the command (or * after help), we'll only return them in the INITIAL state, and report them * as SCV_WORDs afterwards. */ %Start WORD /* * The default value of lex for transitions is 2000 and it seems we reached it. * So we are bumping it up! */ %a 3000 %% #.*$ ; /* comments */ <INITIAL>validate { BEGIN WORD; return (SCC_VALIDATE); } <INITIAL>import { BEGIN WORD; return (SCC_IMPORT); } <INITIAL>cleanup { BEGIN WORD; return (SCC_CLEANUP); } <INITIAL>export { BEGIN WORD; return (SCC_EXPORT); } <INITIAL>archive { BEGIN WORD; return (SCC_ARCHIVE); } <INITIAL>restore { BEGIN WORD; return (SCC_RESTORE); } <INITIAL>apply { BEGIN WORD; return (SCC_APPLY); } <INITIAL>extract { BEGIN WORD; return (SCC_EXTRACT); } <INITIAL>repository { BEGIN WORD; return (SCC_REPOSITORY); } <INITIAL>inventory { BEGIN WORD; return (SCC_INVENTORY); } <INITIAL>set { BEGIN WORD; return (SCC_SET); } <INITIAL>end { BEGIN WORD; return (SCC_END); } <INITIAL>exit { BEGIN WORD; return (SCC_END); } <INITIAL>quit { BEGIN WORD; return (SCC_END); } <INITIAL>help { return (SCC_HELP); } <INITIAL>list { BEGIN WORD; return (SCC_LIST); } <INITIAL>add { BEGIN WORD; return (SCC_ADD); } <INITIAL>delete { BEGIN WORD; return (SCC_DELETE); } <INITIAL>select { BEGIN WORD; return (SCC_SELECT); } <INITIAL>unselect { BEGIN WORD; return (SCC_UNSELECT); } <INITIAL>listpg { BEGIN WORD; return (SCC_LISTPG); } <INITIAL>addpg { BEGIN WORD; return (SCC_ADDPG); } <INITIAL>delpg { BEGIN WORD; return (SCC_DELPG); } <INITIAL>delhash { BEGIN WORD; return (SCC_DELHASH); } <INITIAL>listprop { BEGIN WORD; return (SCC_LISTPROP); } <INITIAL>setprop { BEGIN WORD; return (SCC_SETPROP); } <INITIAL>delprop { BEGIN WORD; return (SCC_DELPROP); } <INITIAL>editprop { BEGIN WORD; return (SCC_EDITPROP); } <INITIAL>describe { BEGIN WORD; return (SCC_DESCRIBE); } <INITIAL>addpropvalue { BEGIN WORD; return (SCC_ADDPROPVALUE); } <INITIAL>delpropvalue { BEGIN WORD; return (SCC_DELPROPVALUE); } <INITIAL>setenv { BEGIN WORD; return (SCC_SETENV); } <INITIAL>unsetenv { BEGIN WORD; return (SCC_UNSETENV); } <INITIAL>listsnap { BEGIN WORD; return (SCC_LISTSNAP); } <INITIAL>selectsnap { BEGIN WORD; return (SCC_SELECTSNAP); } <INITIAL>revert { BEGIN WORD; return (SCC_REVERT); } <INITIAL>refresh { BEGIN WORD; return (SCC_REFRESH); } <INITIAL>delnotify { BEGIN WORD; return (SCC_DELNOTIFY); } <INITIAL>listnotify { BEGIN WORD; return (SCC_LISTNOTIFY); } <INITIAL>setnotify { BEGIN WORD; return (SCC_SETNOTIFY); } [^ \t\n">=()]+ { if ((yylval.str = strdup(yytext)) == NULL) { yyerror(gettext("Out of memory")); exit(UU_EXIT_FATAL); } return SCV_WORD; } \"([^"\\]|\\.)*\" { /* * double-quoted strings start at a * double-quote, include characters other than * double-quote and backslash, and * backslashed-characters, and end with a * double-quote. */ char *str, *cp; int shift; if ((str = strdup(yytext)) == NULL) { yyerror(gettext("Out of memory")); exit(UU_EXIT_FATAL); } /* Strip out the backslashes. */ for (cp = str, shift = 0; *cp != '\0'; ++cp) { if (*cp == '\\') { ++cp; /* * This can't be null because * the string always ends with * a double-quote. */ ++shift; *(cp - shift) = *cp; } else if (shift != 0) *(cp - shift) = *cp; } /* Nullify everything after trailing quote */ *(cp - shift) = '\0'; yylval.str = str; return SCV_STRING; } \n { est->sc_cmd_lineno++; BEGIN INITIAL; return (SCS_NEWLINE); } [ \t]+ ; ">" { return SCS_REDIRECT; } "=" { return SCS_EQUALS; } "(" { ++parens; return SCS_LPAREN; } ")" { --parens; return SCS_RPAREN; } . { uu_die(gettext("unrecognized character %s\n"), yytext); } %% int yyerror(const char *s) { return (0); } static int input(void) { static int saw_eof = 0; int c = engine_cmd_getc(est); /* * To ensure input is terminated, slip in a newline on EOF. */ if (c == EOF) { if (saw_eof) return (0); saw_eof = 1; return ('\n'); } else saw_eof = 0; if (c == '\n') yylineno++; return (c); } static void unput(int c) { if (c == '\n') yylineno--; (void) engine_cmd_ungetc(est, c == 0 ? EOF : c); } static void output(int c) { char ch = c; engine_cmd_nputs(est, &ch, sizeof (ch)); }