From: Ted Lemon Date: Mon, 20 Apr 1998 18:02:40 +0000 (+0000) Subject: Add new tokens for match expressions. X-Git-Tag: carrel-2~114 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80fcef916b00cc4b3f521fe956b5a08eeb92e9d9;p=thirdparty%2Fdhcp.git Add new tokens for match expressions. --- diff --git a/common/conflex.c b/common/conflex.c index b09f7a4f0..b15346c84 100644 --- a/common/conflex.c +++ b/common/conflex.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: conflex.c,v 1.31 1998/04/09 04:28:20 mellon Exp $ Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. All rights reserved.\n"; +"$Id: conflex.c,v 1.32 1998/04/20 18:01:08 mellon Exp $ Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -354,6 +354,8 @@ static int intern (atom, dfv) switch (tolower (atom [0])) { case 'a': + if (!strcasecmp (atom + 1, "nd")) + return AND; if (!strcasecmp (atom + 1, "ppend")) return APPEND; if (!strcasecmp (atom + 1, "llow")) @@ -373,6 +375,8 @@ static int intern (atom, dfv) if (!strcasecmp (atom + 1, "oot-unknown-clients")) return BOOT_UNKNOWN_CLIENTS; case 'c': + if (!strcasecmp (atom + 1, "heck")) + return CHECK; if (!strcasecmp (atom + 1, "lass")) return CLASS; if (!strcasecmp (atom + 1, "iaddr")) @@ -405,6 +409,8 @@ static int intern (atom, dfv) } break; case 'e': + if (!strcasecmp (atom + 1, "xtract-int")) + return EXTRACT_INT; if (!strcasecmp (atom + 1, "thernet")) return ETHERNET; if (!strcasecmp (atom + 1, "nds")) @@ -463,6 +469,8 @@ static int intern (atom, dfv) } break; case 'n': + if (!strcasecmp (atom + 1, "ot")) + return NOT; if (!strcasecmp (atom + 1, "ameserver")) return NAMESERVER; if (!strcasecmp (atom + 1, "etmask")) @@ -471,6 +479,8 @@ static int intern (atom, dfv) return NEXT_SERVER; break; case 'o': + if (!strcasecmp (atom + 1, "r")) + return OR; if (!strcasecmp (atom + 1, "ption")) return OPTION; if (!strcasecmp (atom + 1, "ne-lease-per-client")) @@ -501,6 +511,10 @@ static int intern (atom, dfv) return REJECT; break; case 's': + if (!strcasecmp (atom + 1, "uffix")) + return SUFFIX; + if (!strcasecmp (atom + 1, "ubstring")) + return SUBSTRING; if (!strcasecmp (atom + 1, "earch")) return SEARCH; if (!strcasecmp (atom + 1, "tarts")) diff --git a/includes/dhctoken.h b/includes/dhctoken.h index f68051716..b99ab7dad 100644 --- a/includes/dhctoken.h +++ b/includes/dhctoken.h @@ -3,7 +3,7 @@ Tokens for config file lexer and parser. */ /* - * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. + * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,9 @@ #define SLASH '/' #define LBRACE '{' #define RBRACE '}' +#define LPAREN '(' +#define RPAREN ')' +#define EQUAL '=' #define FIRST_TOKEN HOST #define HOST 256 @@ -127,6 +130,13 @@ #define USE_LEASE_ADDR_FOR_DEFAULT_ROUTE 331 #define MIN_LEASE_TIME 332 #define MIN_SECS 333 +#define AND 334 +#define OR 335 +#define NOT 336 +#define SUBSTRING 337 +#define SUFFIX 338 +#define CHECK 339 +#define EXTRACT_INT 340 #define is_identifier(x) ((x) >= FIRST_TOKEN && \ (x) != STRING && \