1*7c478bd9Sstevel@tonic-gate %{ 2*7c478bd9Sstevel@tonic-gate /* 3*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 4*7c478bd9Sstevel@tonic-gate * 5*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 6*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 7*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 8*7c478bd9Sstevel@tonic-gate * with the License. 9*7c478bd9Sstevel@tonic-gate * 10*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 12*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 13*7c478bd9Sstevel@tonic-gate * and limitations under the License. 14*7c478bd9Sstevel@tonic-gate * 15*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 16*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 18*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 19*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 20*7c478bd9Sstevel@tonic-gate * 21*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 22*7c478bd9Sstevel@tonic-gate * 23*7c478bd9Sstevel@tonic-gate * Copyright (c) 1994, by Sun Microsytems, Inc. 24*7c478bd9Sstevel@tonic-gate */ 25*7c478bd9Sstevel@tonic-gate 26*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 27*7c478bd9Sstevel@tonic-gate %} 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gate %token ADD 30*7c478bd9Sstevel@tonic-gate %token ALLOC 31*7c478bd9Sstevel@tonic-gate %token BUFFER 32*7c478bd9Sstevel@tonic-gate %token CLEAR 33*7c478bd9Sstevel@tonic-gate %token COMMA 34*7c478bd9Sstevel@tonic-gate %token CONNECT 35*7c478bd9Sstevel@tonic-gate %token DEALLOC 36*7c478bd9Sstevel@tonic-gate %token DELETE 37*7c478bd9Sstevel@tonic-gate %token FILTER 38*7c478bd9Sstevel@tonic-gate %token CONTINUE 39*7c478bd9Sstevel@tonic-gate %token CREATE 40*7c478bd9Sstevel@tonic-gate %token DISABLE 41*7c478bd9Sstevel@tonic-gate %token ENABLE 42*7c478bd9Sstevel@tonic-gate %token EQ 43*7c478bd9Sstevel@tonic-gate %token FCNNAME 44*7c478bd9Sstevel@tonic-gate %token FCNS 45*7c478bd9Sstevel@tonic-gate %token ON 46*7c478bd9Sstevel@tonic-gate %token OFF 47*7c478bd9Sstevel@tonic-gate %token HELP 48*7c478bd9Sstevel@tonic-gate %token KTRACE 49*7c478bd9Sstevel@tonic-gate %token HISTORY 50*7c478bd9Sstevel@tonic-gate %token IDENT 51*7c478bd9Sstevel@tonic-gate %token INVAL 52*7c478bd9Sstevel@tonic-gate %token KILL 53*7c478bd9Sstevel@tonic-gate %token LIST 54*7c478bd9Sstevel@tonic-gate %token NL 55*7c478bd9Sstevel@tonic-gate %token PFILTER 56*7c478bd9Sstevel@tonic-gate %token PROBES 57*7c478bd9Sstevel@tonic-gate %token QUIT 58*7c478bd9Sstevel@tonic-gate %token REGEXP 59*7c478bd9Sstevel@tonic-gate %token RESUME 60*7c478bd9Sstevel@tonic-gate %token SCALED_INT 61*7c478bd9Sstevel@tonic-gate %token SETNAME 62*7c478bd9Sstevel@tonic-gate %token SETS 63*7c478bd9Sstevel@tonic-gate %token SOURCE 64*7c478bd9Sstevel@tonic-gate %token SUSPEND 65*7c478bd9Sstevel@tonic-gate %token TRACE 66*7c478bd9Sstevel@tonic-gate %token TRACEFILE 67*7c478bd9Sstevel@tonic-gate %token UNTRACE 68*7c478bd9Sstevel@tonic-gate %token VALSTR 69*7c478bd9Sstevel@tonic-gate %token VALUES 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gate %{ 72*7c478bd9Sstevel@tonic-gate #include <stdio.h> 73*7c478bd9Sstevel@tonic-gate #include <string.h> 74*7c478bd9Sstevel@tonic-gate #include <sys/types.h> 75*7c478bd9Sstevel@tonic-gate 76*7c478bd9Sstevel@tonic-gate #include "set.h" 77*7c478bd9Sstevel@tonic-gate #include "cmd.h" 78*7c478bd9Sstevel@tonic-gate #include "fcn.h" 79*7c478bd9Sstevel@tonic-gate #include "list.h" 80*7c478bd9Sstevel@tonic-gate #include "expr.h" 81*7c478bd9Sstevel@tonic-gate #include "spec.h" 82*7c478bd9Sstevel@tonic-gate #include "source.h" 83*7c478bd9Sstevel@tonic-gate #include "prbk.h" 84*7c478bd9Sstevel@tonic-gate 85*7c478bd9Sstevel@tonic-gate extern int yylex(); 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate extern void help_on_topic(char *topic); 88*7c478bd9Sstevel@tonic-gate extern void help_on_command(int cmd); 89*7c478bd9Sstevel@tonic-gate extern boolean_t g_kernelmode; 90*7c478bd9Sstevel@tonic-gate extern tnfctl_handle_t *g_hndl; 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate void quit(boolean_t killtarget, boolean_t runtarget); 93*7c478bd9Sstevel@tonic-gate extern void help(void); 94*7c478bd9Sstevel@tonic-gate extern void process_cmd(tnfctl_handle_t *hndl, cmd_t *cmd); 95*7c478bd9Sstevel@tonic-gate extern void cmd_listtracefile(); 96*7c478bd9Sstevel@tonic-gate %} 97*7c478bd9Sstevel@tonic-gate 98*7c478bd9Sstevel@tonic-gate %union 99*7c478bd9Sstevel@tonic-gate { 100*7c478bd9Sstevel@tonic-gate char * strval; 101*7c478bd9Sstevel@tonic-gate expr_t * exprval; 102*7c478bd9Sstevel@tonic-gate spec_t * specval; 103*7c478bd9Sstevel@tonic-gate void * pidlistval; 104*7c478bd9Sstevel@tonic-gate int intval; 105*7c478bd9Sstevel@tonic-gate } 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate %type <strval> SETNAME FCNNAME IDENT VALSTR REGEXP 108*7c478bd9Sstevel@tonic-gate %type <intval> CONTINUE DISABLE ENABLE HELP LIST QUIT SOURCE TRACE UNTRACE BUFFER KTRACE PFILTER CLEAR CONNECT command 109*7c478bd9Sstevel@tonic-gate %type <exprval> expr exprlist 110*7c478bd9Sstevel@tonic-gate %type <specval> spec speclist 111*7c478bd9Sstevel@tonic-gate %type <pidlistval> pidlist 112*7c478bd9Sstevel@tonic-gate %type <intval> SCALED_INT singlepid 113*7c478bd9Sstevel@tonic-gate 114*7c478bd9Sstevel@tonic-gate %% 115*7c478bd9Sstevel@tonic-gate 116*7c478bd9Sstevel@tonic-gate file : statement_list 117*7c478bd9Sstevel@tonic-gate ; 118*7c478bd9Sstevel@tonic-gate 119*7c478bd9Sstevel@tonic-gate statement_list : /* empty */ { prompt(); } 120*7c478bd9Sstevel@tonic-gate | statement_list statement 121*7c478bd9Sstevel@tonic-gate { 122*7c478bd9Sstevel@tonic-gate if (g_kernelmode) 123*7c478bd9Sstevel@tonic-gate prbk_warn_pfilter_empty(); 124*7c478bd9Sstevel@tonic-gate prompt(); 125*7c478bd9Sstevel@tonic-gate } 126*7c478bd9Sstevel@tonic-gate ; 127*7c478bd9Sstevel@tonic-gate 128*7c478bd9Sstevel@tonic-gate statement : empty_statement 129*7c478bd9Sstevel@tonic-gate | help_statement 130*7c478bd9Sstevel@tonic-gate | continue_statement 131*7c478bd9Sstevel@tonic-gate | quit_statement 132*7c478bd9Sstevel@tonic-gate | enable_statement 133*7c478bd9Sstevel@tonic-gate | disable_statement 134*7c478bd9Sstevel@tonic-gate | trace_statement 135*7c478bd9Sstevel@tonic-gate | untrace_statement 136*7c478bd9Sstevel@tonic-gate | connect_statement 137*7c478bd9Sstevel@tonic-gate | clear_statement 138*7c478bd9Sstevel@tonic-gate | pfilter_statement 139*7c478bd9Sstevel@tonic-gate | ktrace_statement 140*7c478bd9Sstevel@tonic-gate | buffer_statement 141*7c478bd9Sstevel@tonic-gate | create_statement 142*7c478bd9Sstevel@tonic-gate | source_statement 143*7c478bd9Sstevel@tonic-gate | listsets_statement 144*7c478bd9Sstevel@tonic-gate | listhistory_statement 145*7c478bd9Sstevel@tonic-gate | listtracefile_statement 146*7c478bd9Sstevel@tonic-gate | listfcns_statement 147*7c478bd9Sstevel@tonic-gate | listprobes_statement 148*7c478bd9Sstevel@tonic-gate | listvalues_statement 149*7c478bd9Sstevel@tonic-gate | error NL { yyerrok; } 150*7c478bd9Sstevel@tonic-gate ; 151*7c478bd9Sstevel@tonic-gate 152*7c478bd9Sstevel@tonic-gate empty_statement : NL 153*7c478bd9Sstevel@tonic-gate ; 154*7c478bd9Sstevel@tonic-gate 155*7c478bd9Sstevel@tonic-gate command : CONTINUE { $$ = $1; } /* user&kernel */ 156*7c478bd9Sstevel@tonic-gate | DISABLE { $$ = $1; } 157*7c478bd9Sstevel@tonic-gate | ENABLE { $$ = $1; } 158*7c478bd9Sstevel@tonic-gate | HELP { $$ = $1; } 159*7c478bd9Sstevel@tonic-gate | LIST { $$ = $1; } 160*7c478bd9Sstevel@tonic-gate | QUIT { $$ = $1; } 161*7c478bd9Sstevel@tonic-gate | SOURCE { $$ = $1; } 162*7c478bd9Sstevel@tonic-gate | TRACE { $$ = $1; } 163*7c478bd9Sstevel@tonic-gate | UNTRACE { $$ = $1; } 164*7c478bd9Sstevel@tonic-gate | BUFFER { $$ = $1; } /* kernel only */ 165*7c478bd9Sstevel@tonic-gate | KTRACE { $$ = $1; } 166*7c478bd9Sstevel@tonic-gate | PFILTER { $$ = $1; } 167*7c478bd9Sstevel@tonic-gate | CLEAR { $$ = $1; } /* user only */ 168*7c478bd9Sstevel@tonic-gate | CONNECT { $$ = $1; } 169*7c478bd9Sstevel@tonic-gate ; 170*7c478bd9Sstevel@tonic-gate 171*7c478bd9Sstevel@tonic-gate help_statement : HELP NL { help(); } 172*7c478bd9Sstevel@tonic-gate | HELP command NL { help_on_command($2); } 173*7c478bd9Sstevel@tonic-gate | HELP IDENT NL { help_on_topic($2); } 174*7c478bd9Sstevel@tonic-gate ; 175*7c478bd9Sstevel@tonic-gate 176*7c478bd9Sstevel@tonic-gate continue_statement : CONTINUE NL 177*7c478bd9Sstevel@tonic-gate { 178*7c478bd9Sstevel@tonic-gate if (!g_kernelmode) YYACCEPT; 179*7c478bd9Sstevel@tonic-gate } 180*7c478bd9Sstevel@tonic-gate ; 181*7c478bd9Sstevel@tonic-gate 182*7c478bd9Sstevel@tonic-gate quit_statement : QUIT NL { quit(B_TRUE, B_TRUE); } 183*7c478bd9Sstevel@tonic-gate | QUIT KILL NL { quit(B_TRUE, B_FALSE); } 184*7c478bd9Sstevel@tonic-gate | QUIT RESUME NL { quit(B_FALSE, B_TRUE); } 185*7c478bd9Sstevel@tonic-gate | QUIT SUSPEND NL { quit(B_FALSE, B_FALSE); } 186*7c478bd9Sstevel@tonic-gate ; 187*7c478bd9Sstevel@tonic-gate 188*7c478bd9Sstevel@tonic-gate enable_statement : ENABLE SETNAME NL 189*7c478bd9Sstevel@tonic-gate { 190*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 191*7c478bd9Sstevel@tonic-gate cmd_p = cmd_set($2, CMD_ENABLE, NULL); 192*7c478bd9Sstevel@tonic-gate if (cmd_p) 193*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 194*7c478bd9Sstevel@tonic-gate } 195*7c478bd9Sstevel@tonic-gate | ENABLE exprlist NL 196*7c478bd9Sstevel@tonic-gate { 197*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 198*7c478bd9Sstevel@tonic-gate cmd_p = cmd_expr($2, CMD_ENABLE, NULL); 199*7c478bd9Sstevel@tonic-gate if (cmd_p) 200*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 201*7c478bd9Sstevel@tonic-gate } 202*7c478bd9Sstevel@tonic-gate ; 203*7c478bd9Sstevel@tonic-gate 204*7c478bd9Sstevel@tonic-gate disable_statement : DISABLE SETNAME NL 205*7c478bd9Sstevel@tonic-gate { 206*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 207*7c478bd9Sstevel@tonic-gate cmd_p = cmd_set($2, CMD_DISABLE, NULL); 208*7c478bd9Sstevel@tonic-gate if (cmd_p) 209*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 210*7c478bd9Sstevel@tonic-gate } 211*7c478bd9Sstevel@tonic-gate | DISABLE exprlist NL 212*7c478bd9Sstevel@tonic-gate { 213*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 214*7c478bd9Sstevel@tonic-gate cmd_p = cmd_expr($2, CMD_DISABLE, NULL); 215*7c478bd9Sstevel@tonic-gate if (cmd_p) 216*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 217*7c478bd9Sstevel@tonic-gate } 218*7c478bd9Sstevel@tonic-gate ; 219*7c478bd9Sstevel@tonic-gate 220*7c478bd9Sstevel@tonic-gate trace_statement : TRACE SETNAME NL 221*7c478bd9Sstevel@tonic-gate { 222*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 223*7c478bd9Sstevel@tonic-gate cmd_p = cmd_set($2, CMD_TRACE, NULL); 224*7c478bd9Sstevel@tonic-gate if (cmd_p) 225*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 226*7c478bd9Sstevel@tonic-gate } 227*7c478bd9Sstevel@tonic-gate | TRACE exprlist NL 228*7c478bd9Sstevel@tonic-gate { 229*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 230*7c478bd9Sstevel@tonic-gate cmd_p = cmd_expr($2, CMD_TRACE, NULL); 231*7c478bd9Sstevel@tonic-gate if (cmd_p) 232*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 233*7c478bd9Sstevel@tonic-gate } 234*7c478bd9Sstevel@tonic-gate ; 235*7c478bd9Sstevel@tonic-gate 236*7c478bd9Sstevel@tonic-gate untrace_statement : UNTRACE SETNAME NL 237*7c478bd9Sstevel@tonic-gate { 238*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 239*7c478bd9Sstevel@tonic-gate cmd_p = cmd_set($2, CMD_UNTRACE, NULL); 240*7c478bd9Sstevel@tonic-gate if (cmd_p) 241*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 242*7c478bd9Sstevel@tonic-gate } 243*7c478bd9Sstevel@tonic-gate | UNTRACE exprlist NL 244*7c478bd9Sstevel@tonic-gate { 245*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 246*7c478bd9Sstevel@tonic-gate cmd_p = cmd_expr($2, CMD_UNTRACE, NULL); 247*7c478bd9Sstevel@tonic-gate if (cmd_p) 248*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 249*7c478bd9Sstevel@tonic-gate } 250*7c478bd9Sstevel@tonic-gate ; 251*7c478bd9Sstevel@tonic-gate 252*7c478bd9Sstevel@tonic-gate connect_statement : CONNECT FCNNAME SETNAME NL 253*7c478bd9Sstevel@tonic-gate { 254*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 255*7c478bd9Sstevel@tonic-gate cmd_p = cmd_set($3, CMD_CONNECT, $2); 256*7c478bd9Sstevel@tonic-gate if (cmd_p) 257*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 258*7c478bd9Sstevel@tonic-gate } 259*7c478bd9Sstevel@tonic-gate | CONNECT FCNNAME exprlist NL 260*7c478bd9Sstevel@tonic-gate { 261*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 262*7c478bd9Sstevel@tonic-gate cmd_p = cmd_expr($3, CMD_CONNECT, $2); 263*7c478bd9Sstevel@tonic-gate if (cmd_p) 264*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 265*7c478bd9Sstevel@tonic-gate } 266*7c478bd9Sstevel@tonic-gate ; 267*7c478bd9Sstevel@tonic-gate 268*7c478bd9Sstevel@tonic-gate clear_statement : CLEAR SETNAME NL 269*7c478bd9Sstevel@tonic-gate { 270*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 271*7c478bd9Sstevel@tonic-gate cmd_p = cmd_set($2, CMD_CLEAR, NULL); 272*7c478bd9Sstevel@tonic-gate if (cmd_p) 273*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 274*7c478bd9Sstevel@tonic-gate } 275*7c478bd9Sstevel@tonic-gate | CLEAR exprlist NL 276*7c478bd9Sstevel@tonic-gate { 277*7c478bd9Sstevel@tonic-gate cmd_t *cmd_p; 278*7c478bd9Sstevel@tonic-gate cmd_p = cmd_expr($2, CMD_CLEAR, NULL); 279*7c478bd9Sstevel@tonic-gate if (cmd_p) 280*7c478bd9Sstevel@tonic-gate process_cmd(g_hndl, cmd_p); 281*7c478bd9Sstevel@tonic-gate } 282*7c478bd9Sstevel@tonic-gate ; 283*7c478bd9Sstevel@tonic-gate 284*7c478bd9Sstevel@tonic-gate create_statement : CREATE SETNAME exprlist NL { (void) set($2, $3); } 285*7c478bd9Sstevel@tonic-gate | CREATE FCNNAME IDENT NL { fcn($2, $3); } 286*7c478bd9Sstevel@tonic-gate ; 287*7c478bd9Sstevel@tonic-gate 288*7c478bd9Sstevel@tonic-gate source_statement : SOURCE VALSTR NL { source_file($2); } 289*7c478bd9Sstevel@tonic-gate | SOURCE IDENT NL { source_file($2); } 290*7c478bd9Sstevel@tonic-gate ; 291*7c478bd9Sstevel@tonic-gate 292*7c478bd9Sstevel@tonic-gate listsets_statement : LIST SETS NL { set_list(); } 293*7c478bd9Sstevel@tonic-gate ; 294*7c478bd9Sstevel@tonic-gate 295*7c478bd9Sstevel@tonic-gate listhistory_statement : LIST HISTORY NL { cmd_list(); } 296*7c478bd9Sstevel@tonic-gate ; 297*7c478bd9Sstevel@tonic-gate 298*7c478bd9Sstevel@tonic-gate listtracefile_statement : LIST TRACEFILE NL { cmd_listtracefile(); } 299*7c478bd9Sstevel@tonic-gate ; 300*7c478bd9Sstevel@tonic-gate 301*7c478bd9Sstevel@tonic-gate listfcns_statement : LIST FCNS NL { fcn_list(); } 302*7c478bd9Sstevel@tonic-gate ; 303*7c478bd9Sstevel@tonic-gate 304*7c478bd9Sstevel@tonic-gate ; 305*7c478bd9Sstevel@tonic-gate 306*7c478bd9Sstevel@tonic-gate pfilter_statement : PFILTER ON NL 307*7c478bd9Sstevel@tonic-gate { prbk_set_pfilter_mode(B_TRUE); } 308*7c478bd9Sstevel@tonic-gate | PFILTER OFF NL 309*7c478bd9Sstevel@tonic-gate { prbk_set_pfilter_mode(B_FALSE); } 310*7c478bd9Sstevel@tonic-gate | PFILTER ADD pidlist NL 311*7c478bd9Sstevel@tonic-gate { prbk_pfilter_add($3); } 312*7c478bd9Sstevel@tonic-gate | PFILTER DELETE pidlist NL 313*7c478bd9Sstevel@tonic-gate { prbk_pfilter_drop($3); } 314*7c478bd9Sstevel@tonic-gate | PFILTER NL 315*7c478bd9Sstevel@tonic-gate { prbk_show_pfilter_mode(); } 316*7c478bd9Sstevel@tonic-gate ; 317*7c478bd9Sstevel@tonic-gate 318*7c478bd9Sstevel@tonic-gate ktrace_statement : KTRACE ON NL 319*7c478bd9Sstevel@tonic-gate { prbk_set_tracing(B_TRUE); } 320*7c478bd9Sstevel@tonic-gate | KTRACE OFF NL 321*7c478bd9Sstevel@tonic-gate { prbk_set_tracing(B_FALSE); } 322*7c478bd9Sstevel@tonic-gate | KTRACE NL 323*7c478bd9Sstevel@tonic-gate { prbk_show_tracing(); } 324*7c478bd9Sstevel@tonic-gate ; 325*7c478bd9Sstevel@tonic-gate 326*7c478bd9Sstevel@tonic-gate listprobes_statement : LIST speclist PROBES SETNAME NL 327*7c478bd9Sstevel@tonic-gate { list_set($2, $4); } 328*7c478bd9Sstevel@tonic-gate | LIST speclist PROBES exprlist NL 329*7c478bd9Sstevel@tonic-gate { list_expr($2, $4); } 330*7c478bd9Sstevel@tonic-gate ; 331*7c478bd9Sstevel@tonic-gate 332*7c478bd9Sstevel@tonic-gate listvalues_statement : LIST VALUES speclist NL { list_values($3); } 333*7c478bd9Sstevel@tonic-gate ; 334*7c478bd9Sstevel@tonic-gate 335*7c478bd9Sstevel@tonic-gate exprlist : /* empty */ { $$ = NULL; } 336*7c478bd9Sstevel@tonic-gate | exprlist expr { $$ = expr_list($1, $2); } 337*7c478bd9Sstevel@tonic-gate ; 338*7c478bd9Sstevel@tonic-gate 339*7c478bd9Sstevel@tonic-gate speclist : /* empty */ { $$ = NULL; } 340*7c478bd9Sstevel@tonic-gate | speclist spec { $$ = spec_list($1, $2); } 341*7c478bd9Sstevel@tonic-gate ; 342*7c478bd9Sstevel@tonic-gate 343*7c478bd9Sstevel@tonic-gate expr : spec EQ spec { $$ = expr($1, $3); } 344*7c478bd9Sstevel@tonic-gate | spec { $$ = expr(spec(strdup("keys"), 345*7c478bd9Sstevel@tonic-gate SPEC_EXACT), $1); } 346*7c478bd9Sstevel@tonic-gate ; 347*7c478bd9Sstevel@tonic-gate 348*7c478bd9Sstevel@tonic-gate spec : IDENT { $$ = spec($1, SPEC_EXACT); } 349*7c478bd9Sstevel@tonic-gate | VALSTR { $$ = spec($1, SPEC_EXACT); } 350*7c478bd9Sstevel@tonic-gate | REGEXP { $$ = spec($1, SPEC_REGEXP); } 351*7c478bd9Sstevel@tonic-gate ; 352*7c478bd9Sstevel@tonic-gate 353*7c478bd9Sstevel@tonic-gate pidlist : pidlist COMMA singlepid 354*7c478bd9Sstevel@tonic-gate { $$ = prbk_pidlist_add($1, $3); } 355*7c478bd9Sstevel@tonic-gate | singlepid 356*7c478bd9Sstevel@tonic-gate { $$ = prbk_pidlist_add(NULL, $1); } 357*7c478bd9Sstevel@tonic-gate ; 358*7c478bd9Sstevel@tonic-gate 359*7c478bd9Sstevel@tonic-gate singlepid : SCALED_INT 360*7c478bd9Sstevel@tonic-gate ; 361*7c478bd9Sstevel@tonic-gate 362*7c478bd9Sstevel@tonic-gate buffer_statement : BUFFER NL 363*7c478bd9Sstevel@tonic-gate { 364*7c478bd9Sstevel@tonic-gate prbk_buffer_list(); 365*7c478bd9Sstevel@tonic-gate } 366*7c478bd9Sstevel@tonic-gate | BUFFER ALLOC NL 367*7c478bd9Sstevel@tonic-gate { 368*7c478bd9Sstevel@tonic-gate extern int g_outsize; 369*7c478bd9Sstevel@tonic-gate prbk_buffer_alloc(g_outsize); 370*7c478bd9Sstevel@tonic-gate } 371*7c478bd9Sstevel@tonic-gate | BUFFER ALLOC SCALED_INT NL 372*7c478bd9Sstevel@tonic-gate { 373*7c478bd9Sstevel@tonic-gate prbk_buffer_alloc($3); 374*7c478bd9Sstevel@tonic-gate } 375*7c478bd9Sstevel@tonic-gate | BUFFER DEALLOC NL 376*7c478bd9Sstevel@tonic-gate { 377*7c478bd9Sstevel@tonic-gate prbk_buffer_dealloc(); 378*7c478bd9Sstevel@tonic-gate } 379*7c478bd9Sstevel@tonic-gate ; 380*7c478bd9Sstevel@tonic-gate 381*7c478bd9Sstevel@tonic-gate 382*7c478bd9Sstevel@tonic-gate %% 383