2 * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
4 * Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 *---------------------------------------------------------------------------
30 * i4b daemon - runtime configuration lexical analyzer
31 * ---------------------------------------------------
33 * $FreeBSD: src/usr.sbin/i4b/isdnd/rc_scan.l,v 1.6.2.2 2001/08/10 23:17:32 obrien Exp $
35 * last edit-date: [Fri Jul 20 19:14:55 2001]
37 *---------------------------------------------------------------------------*/
60 * Drop comment. NB: this prevents a hash
61 * sign from appearing inside a quoted string.
67 if ((str = malloc(yyleng - 1)) == 0)
68 errx(EX_OSERR, "Out of virtual memory");
69 memcpy(str, yytext + 1, yyleng - 2);
79 if ((str = malloc(128)) == 0)
80 errx(EX_OSERR, "Out of virtual memory");
81 while(*p == '-' || isdigit(*p) || *p == '*')
88 acctall { return ACCTALL; }
89 acctfile { return ACCTFILE; }
90 alert { return ALERT; }
91 aliasing { return ALIASING; }
92 aliasfile { return ALIASFNAME; }
93 answerprog { return ANSWERPROG; }
94 b1protocol { return B1PROTOCOL; }
95 beepconnect { return BEEPCONNECT; }
96 budget-callbackperiod { return BUDGETCALLBACKPERIOD; }
97 budget-callbackncalls { return BUDGETCALLBACKNCALLS; }
98 budget-callbacksfile { return BUDGETCALLBACKSFILE; }
99 budget-callbacksfile-rotate { return BUDGETCALLBACKSFILEROTATE; }
100 budget-calloutperiod { return BUDGETCALLOUTPERIOD; }
101 budget-calloutncalls { return BUDGETCALLOUTNCALLS; }
102 budget-calloutsfile { return BUDGETCALLOUTSFILE; }
103 budget-calloutsfile-rotate { return BUDGETCALLOUTSFILEROTATE; }
104 callbackwait { return CALLBACKWAIT; }
105 calledbackwait { return CALLEDBACKWAIT; }
106 clone { return CLONE; }
107 connectprog { return CONNECTPROG; }
108 controller { return CONTROLLER; }
109 dialin-reaction { return REACTION; }
110 dialout-type { return DIALOUTTYPE; }
111 dialrandincr { return DIALRANDINCR; }
112 dialretries { return DIALRETRIES; }
113 direction { return DIRECTION; }
114 disconnectprog { return DISCONNECTPROG; }
115 downtries { return DOWNTRIES; }
116 downtime { return DOWNTIME; }
117 earlyhangup { return EARLYHANGUP; }
118 entry { return ENTRY; }
119 extcallattr { return EXTCALLATTR; }
120 firmware { return FIRMWARE; }
121 holidayfile { return HOLIDAYFILE; }
122 idletime-incoming { return IDLETIME_IN; }
123 idletime-outgoing { return IDLETIME_OUT; }
124 idle-algorithm-outgoing { return IDLE_ALG_OUT; }
125 isdncontroller { return ISDNCONTROLLER; }
126 isdnchannel { return ISDNCHANNEL; }
127 isdntime { return ISDNTIME; }
128 isdntxdel-incoming { return ISDNTXDELIN; }
129 isdntxdel-outgoing { return ISDNTXDELOUT; }
130 local-phone-dialout { return LOCAL_PHONE_DIALOUT; }
131 local-phone-incoming { return LOCAL_PHONE_INCOMING; }
132 mailer { return MAILER; }
133 mailto { return MAILTO; }
134 maxconnecttime { return MAXCONNECTTIME; }
135 monitor-allowed { return MONITORSW; }
136 monitor-port { return MONITORPORT; }
137 monitor { return MONITOR; }
138 monitor-access { return MONITORACCESS; }
139 fullcmd { return FULLCMD; }
140 restrictedcmd { return RESTRICTEDCMD; }
141 channelstate { return CHANNELSTATE; }
142 callin { return CALLIN; }
143 callout { return CALLOUT; }
144 logevents { return LOGEVENTS; }
145 name { return NAME; }
149 ppp-auth-rechallenge { return PPP_AUTH_RECHALLENGE; }
150 ppp-auth-paranoid { return PPP_AUTH_PARANOID; }
151 ppp-expect-auth { return PPP_EXPECT_AUTH; }
152 ppp-expect-name { return PPP_EXPECT_NAME; }
153 ppp-expect-password { return PPP_EXPECT_PASSWORD; }
154 ppp-send-auth { return PPP_SEND_AUTH; }
155 ppp-send-name { return PPP_SEND_NAME; }
156 ppp-send-password { return PPP_SEND_PASSWORD; }
157 protocol { return PROTOCOL; }
158 ratesfile { return RATESFILE; }
159 ratetype { return RATETYPE; }
160 recoverytime { return RECOVERYTIME; }
161 regexpr { return REGEXPR; }
162 regprog { return REGPROG; }
163 remdial-handling { return REMOTE_NUMBERS_HANDLING; }
164 remote-phone-dialout { return REMOTE_PHONE_DIALOUT; }
165 remote-phone-incoming { return REMOTE_PHONE_INCOMING; }
166 rotatesuffix { return ROTATESUFFIX; }
167 rtprio { return RTPRIO; }
168 system { return SYSTEM; }
169 tinainitprog { return TINAINITPROG; }
170 unitlength { return UNITLENGTH; }
171 unitlengthsrc { return UNITLENGTHSRC; }
172 useacctfile { return USEACCTFILE; }
173 usrdevicename { return USRDEVICENAME; }
174 usrdeviceunit { return USRDEVICEUNIT; }
175 usedown { return USEDOWN; }
176 valid { return VALID; }
179 \n { lineno++; return '\n'; }
181 [A-Za-z/.][-A-Za-z0-9_/.]* {
183 if ((str = strdup(yytext)) == 0)
184 err(EX_OSERR, "Out of virtual memory");
189 [ \t] { /* drop white space */ }
191 . { return yytext[0]; }
196 reset_scanner(FILE *infile)