~ubuntu-branches/debian/sid/rlinetd/sid

« back to all changes in this revision

Viewing changes to src/lex.l

  • Committer: Bazaar Package Importer
  • Author(s): Robert Luberda
  • Date: 2010-03-20 18:03:45 UTC
  • mfrom: (2.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100320180345-x1srfbe2tg00ezsf
Tags: 0.7-1
* New upstream version.
* Recommend rsyslog instead of sysklogd (closes: #526922).
* update-inetd:
  + add support for enabling, disabling and removing entries;
  + use ucf for managing generated files;
  + ignore ucf files in rlinetd.conf;
  + make appropriate changes in  postinst and postrm scripts.
* Set debhelper compat level to 7
* Standards-Version: 3.8.4 (no changes). 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%{
 
2
 
 
3
#include <stdlib.h>
 
4
#include <string.h>
 
5
#include <sysexits.h>
 
6
#include <syslog.h>
 
7
#include <sys/types.h>
 
8
#include <sys/socket.h>
 
9
#include <netinet/in.h>
 
10
#include <arpa/inet.h>
 
11
#include <sys/time.h>
 
12
#include <sys/resource.h>
 
13
 
 
14
#include "port/port.h"
 
15
#include "grammar.h"
 
16
#include "error.h"
 
17
#include "parse.h"
 
18
 
 
19
void yyerror(char *c);
 
20
 
 
21
/* Prevent compilation of static input() function in generated scanner
 
22
   code to avoid gcc 4.x `defined but not used' warnings
 
23
*/
 
24
#define YY_NO_INPUT
 
25
 
 
26
%}
 
27
 
 
28
%%
 
29
 
 
30
service return(T_SERVICE);
 
31
exec    return(T_EXEC);
 
32
port    return(T_PORT);
 
33
protocol        return(T_PROTO);
 
34
tcp     return(T_TCP);
 
35
udp     return(T_UDP);
 
36
user    return(T_UID);
 
37
group   return(T_GID);
 
38
backlog return(T_BACKLOG);
 
39
instances       return(T_INSTANCES);
 
40
defaults        return(T_DEFAULT);
 
41
nice    return(T_NICE);
 
42
rlimit  return(T_RLIMIT);
 
43
cpu     return(T_LIM_CPU);
 
44
fsize   return(T_LIM_FSIZE);
 
45
data    return(T_LIM_DATA);
 
46
stack   return(T_LIM_STACK);
 
47
core    return(T_LIM_CORE);
 
48
rss     return(T_LIM_RSS);
 
49
nproc   return(T_LIM_NPROC);
 
50
nofile  return(T_LIM_NOFILE);
 
51
memlock return(T_LIM_MEMLOCK);
 
52
unlimited       return(T_LIM_INFINITY);
 
53
interface       return(T_INTERFACE);
 
54
log     return(T_LOG);
 
55
fish    return(T_FISH);
 
56
soft    return(T_SOFT);
 
57
hard    return(T_HARD);
 
58
chroot  return(T_CHROOT);
 
59
pipe    return(T_PIPE);
 
60
syslog  return(T_SYSLOG);
 
61
path    return(T_PATH);
 
62
file    return(T_PATH);
 
63
mode    return(T_MODE);
 
64
server  return(T_SERVER);
 
65
directory       return(T_DIR);
 
66
rpc     return(T_RPC);
 
67
version return(T_VERSION);
 
68
name    return(T_NAME);
 
69
tcpd    return(T_WRAP);
 
70
capability      return(T_CAPS);
 
71
family  return(T_FAMILY);
 
72
ipv4    return(T_IPV4);
 
73
ipv6    return(T_IPV6);
 
74
initgroups      return(T_INITGROUPS);
 
75
accept  return(T_ACCEPT);
 
76
deny    return(T_DENY);
 
77
close   return(T_CLOSE);
 
78
banner  return(T_BANNER);
 
79
exit    return(T_EXIT);
 
80
echo    return(T_ECHO);
 
81
discard return(T_DISCARD);
 
82
filter  return(T_FILTER);
 
83
chargen return(T_CHARGEN);
 
84
loopback        return(T_LOOPBACK);
 
85
wait    return(T_WAIT);
 
86
enabled return(T_ENABLED);
 
87
yes     return(T_YES);
 
88
no      return(T_NO);
 
89
 
 
90
\{      return '{';
 
91
\}      return '}';
 
92
;       return ';';
 
93
,       return ',';
 
94
-       return '-';
 
95
 
 
96
\n              {
 
97
                        curfile_line++;
 
98
                }
 
99
#[^\n]*
 
100
\"[^\"]*\"      {
 
101
                        yylval.cp = malloc(yyleng - 1);
 
102
                        memcpy(yylval.cp, yytext + 1, yyleng - 2);
 
103
                        yylval.cp[yyleng - 2] = '\0';
 
104
                        return(T_QSTRING);
 
105
                }
 
106
([[:digit:]]{1,3}"."){1,3}([[:digit:]]{1,3})? {
 
107
                        yylval.cp = strdup(yytext);
 
108
                        return(T_IPADDR);
 
109
                }
 
110
[[:digit:]]+    {
 
111
                        yylval.num = strtol(yytext, NULL, 0);
 
112
                        return(T_NUMERIC);
 
113
                }
 
114
[[:xdigit:]:]+  {
 
115
                        yylval.cp = strdup(yytext);
 
116
                        return(T_IPADDR);
 
117
                }
 
118
[:blank:]+
 
119
[[:alnum:]]+    {
 
120
                        rl_pwarn(curfile_name, curfile_line,
 
121
                                "unknown directive: %s", strdup(yytext));
 
122
                }
 
123
 
 
124
%%
 
125
 
 
126
void freebufs() {
 
127
        yy_delete_buffer(YY_CURRENT_BUFFER);
 
128
}
 
129
 
 
130
void dummy() { yyunput(0, NULL); } /* shutup gcc */
 
131
 
 
132
/* vim: set ts=2: */