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

« back to all changes in this revision

Viewing changes to 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
 
 
22
 
%%
23
 
 
24
 
service return(T_SERVICE);
25
 
exec    return(T_EXEC);
26
 
port    return(T_PORT);
27
 
protocol        return(T_PROTO);
28
 
tcp     return(T_TCP);
29
 
udp     return(T_UDP);
30
 
user    return(T_UID);
31
 
group   return(T_GID);
32
 
backlog return(T_BACKLOG);
33
 
instances       return(T_INSTANCES);
34
 
defaults        return(T_DEFAULT);
35
 
nice    return(T_NICE);
36
 
rlimit  return(T_RLIMIT);
37
 
cpu     return(T_LIM_CPU);
38
 
fsize   return(T_LIM_FSIZE);
39
 
data    return(T_LIM_DATA);
40
 
stack   return(T_LIM_STACK);
41
 
core    return(T_LIM_CORE);
42
 
rss     return(T_LIM_RSS);
43
 
nproc   return(T_LIM_NPROC);
44
 
nofile  return(T_LIM_NOFILE);
45
 
memlock return(T_LIM_MEMLOCK);
46
 
unlimited       return(T_LIM_INFINITY);
47
 
interface       return(T_INTERFACE);
48
 
log     return(T_LOG);
49
 
fish    return(T_FISH);
50
 
soft    return(T_SOFT);
51
 
hard    return(T_HARD);
52
 
chroot  return(T_CHROOT);
53
 
pipe    return(T_PIPE);
54
 
syslog  return(T_SYSLOG);
55
 
path    return(T_PATH);
56
 
file    return(T_PATH);
57
 
mode    return(T_MODE);
58
 
server  return(T_SERVER);
59
 
directory       return(T_DIR);
60
 
rpc     return(T_RPC);
61
 
version return(T_VERSION);
62
 
name    return(T_NAME);
63
 
tcpd    return(T_WRAP);
64
 
capability      return(T_CAPS);
65
 
family  return(T_FAMILY);
66
 
ipv4    return(T_IPV4);
67
 
ipv6    return(T_IPV6);
68
 
initgroups      return(T_INITGROUPS);
69
 
accept  return(T_ACCEPT);
70
 
deny    return(T_DENY);
71
 
close   return(T_CLOSE);
72
 
banner  return(T_BANNER);
73
 
exit    return(T_EXIT);
74
 
echo    return(T_ECHO);
75
 
discard return(T_DISCARD);
76
 
filter  return(T_FILTER);
77
 
chargen return(T_CHARGEN);
78
 
loopback        return(T_LOOPBACK);
79
 
wait    return(T_WAIT);
80
 
yes     return(T_YES);
81
 
no      return(T_NO);
82
 
 
83
 
\{      return '{';
84
 
\}      return '}';
85
 
;       return ';';
86
 
,       return ',';
87
 
-       return '-';
88
 
 
89
 
\n              {
90
 
                        curfile_line++;
91
 
                }
92
 
#[^\n]*
93
 
\"[^\"]*\"      {
94
 
                        yylval.cp = malloc(yyleng - 1);
95
 
                        memcpy(yylval.cp, yytext + 1, yyleng - 2);
96
 
                        yylval.cp[yyleng - 2] = '\0';
97
 
                        return(T_QSTRING);
98
 
                }
99
 
([[:digit:]]{1,3}"."){1,3}([[:digit:]]{1,3})? {
100
 
                        yylval.cp = strdup(yytext);
101
 
                        return(T_IPADDR);
102
 
                }
103
 
[[:digit:]]+    {
104
 
                        yylval.num = strtol(yytext, NULL, 0);
105
 
                        return(T_NUMERIC);
106
 
                }
107
 
[[:xdigit:]:]+  {
108
 
                        yylval.cp = strdup(yytext);
109
 
                        return(T_IPADDR);
110
 
                }
111
 
[:blank:]+
112
 
[[:alnum:]]+    {
113
 
                        rl_pwarn(curfile_name, curfile_line,
114
 
                                "unknown directive: %s", strdup(yytext));
115
 
                }
116
 
 
117
 
%%
118
 
 
119
 
void freebufs() {
120
 
        yy_delete_buffer(YY_CURRENT_BUFFER);
121
 
}
122
 
 
123
 
void dummy() { yyunput(0, NULL); } /* shutup gcc */
124
 
 
125
 
/* vim: set ts=2: */