2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-03 07:45:20 +00:00

Add line-oriented argument to new_parse(). Add new tokens.

This commit is contained in:
Ted Lemon
2001-05-02 06:32:54 +00:00
parent 4ab46a1030
commit 24f9d67e03

View File

@@ -43,7 +43,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: conflex.c,v 1.91 2001/04/20 18:07:25 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n"; "$Id: conflex.c,v 1.92 2001/05/02 06:32:54 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -57,12 +57,13 @@ static enum dhcp_token read_number PROTO ((int, struct parse *));
static enum dhcp_token read_num_or_name PROTO ((int, struct parse *)); static enum dhcp_token read_num_or_name PROTO ((int, struct parse *));
static enum dhcp_token intern PROTO ((char *, enum dhcp_token)); static enum dhcp_token intern PROTO ((char *, enum dhcp_token));
isc_result_t new_parse (cfile, file, inbuf, buflen, name) isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
struct parse **cfile; struct parse **cfile;
int file; int file;
char *inbuf; char *inbuf;
unsigned buflen; unsigned buflen;
const char *name; const char *name;
int eolp;
{ {
struct parse *tmp; struct parse *tmp;
@@ -80,6 +81,7 @@ isc_result_t new_parse (cfile, file, inbuf, buflen, name)
tmp -> cur_line [0] = tmp -> prev_line [0] = 0; tmp -> cur_line [0] = tmp -> prev_line [0] = 0;
tmp -> warnings_occurred = 0; tmp -> warnings_occurred = 0;
tmp -> file = file; tmp -> file = file;
tmp -> eol_token = eolp;
tmp -> bufix = 0; tmp -> bufix = 0;
tmp -> buflen = buflen; tmp -> buflen = buflen;
@@ -588,8 +590,10 @@ static enum dhcp_token intern (atom, dfv)
if (!strcasecmp (atom + 6, "s")) if (!strcasecmp (atom + 6, "s"))
return CLIENTS; return CLIENTS;
} }
if (!strncasecmp (atom + 1, "oncat", 5)) if (!strcasecmp (atom + 1, "oncat"))
return CONCAT; return CONCAT;
if (!strcasecmp (atom + 1, "onnect"))
return CONNECT;
if (!strcasecmp (atom + 1, "ommunications-interrupted")) if (!strcasecmp (atom + 1, "ommunications-interrupted"))
return COMMUNICATIONS_INTERRUPTED; return COMMUNICATIONS_INTERRUPTED;
if (!strcasecmp (atom + 1, "ltt")) if (!strcasecmp (atom + 1, "ltt"))
@@ -952,6 +956,8 @@ static enum dhcp_token intern (atom, dfv)
return SERVER_NAME; return SERVER_NAME;
if (!strcasecmp (atom + 1, "erver-identifier")) if (!strcasecmp (atom + 1, "erver-identifier"))
return SERVER_IDENTIFIER; return SERVER_IDENTIFIER;
if (!strcasecmp (atom + 1, "erver"))
return SERVER;
if (!strcasecmp (atom + 1, "elect-timeout")) if (!strcasecmp (atom + 1, "elect-timeout"))
return SELECT_TIMEOUT; return SELECT_TIMEOUT;
if (!strcasecmp (atom + 1, "elect")) if (!strcasecmp (atom + 1, "elect"))