summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd/conflex.c
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2004-04-14 00:56:02 +0000
committerhenning <henning@openbsd.org>2004-04-14 00:56:02 +0000
commit3c41e82c680c97a95cf3fb06da0e74c82dca00c9 (patch)
treef9fe36d07fc2c4fc665f0665b51b70aea7678eb4 /usr.sbin/dhcpd/conflex.c
parentbye bye (diff)
downloadwireguard-openbsd-3c41e82c680c97a95cf3fb06da0e74c82dca00c9.tar.xz
wireguard-openbsd-3c41e82c680c97a95cf3fb06da0e74c82dca00c9.zip
more crap bites the dust
Diffstat (limited to 'usr.sbin/dhcpd/conflex.c')
-rw-r--r--usr.sbin/dhcpd/conflex.c604
1 files changed, 297 insertions, 307 deletions
diff --git a/usr.sbin/dhcpd/conflex.c b/usr.sbin/dhcpd/conflex.c
index cc7dde96aa3..2ea3289529e 100644
--- a/usr.sbin/dhcpd/conflex.c
+++ b/usr.sbin/dhcpd/conflex.c
@@ -1,6 +1,6 @@
-/* conflex.c
+/* $OpenBSD: conflex.c,v 1.3 2004/04/14 00:56:02 henning Exp $ */
- Lexical scanner for dhcpd config file... */
+/* Lexical scanner for dhcpd config file... */
/*
* Copyright (c) 1995, 1996, 1997 The Internet Software Consortium.
@@ -40,9 +40,10 @@
* Enterprises, see ``http://www.vix.com''.
*/
+#include <ctype.h>
+
#include "dhcpd.h"
#include "dhctoken.h"
-#include <ctype.h>
int lexline;
int lexchar;
@@ -52,8 +53,8 @@ char *cur_line;
char *tlname;
int eol_token;
-static char line1 [81];
-static char line2 [81];
+static char line1[81];
+static char line2[81];
static int lpos;
static int line;
static int tlpos;
@@ -61,41 +62,35 @@ static int tline;
static int token;
static int ugflag;
static char *tval;
-static char tokbuf [1500];
-
-#ifdef OLD_LEXER
-char comments [4096];
-int comment_index;
-#endif
+static char tokbuf[1500];
+static int get_char(FILE *);
+static int get_token(FILE *);
+static void skip_to_eol(FILE *);
+static int read_string(FILE *);
+static int read_number(int, FILE *);
+static int read_num_or_name(int, FILE *);
+static int intern(char *, int);
-static int get_char PROTO ((FILE *));
-static int get_token PROTO ((FILE *));
-static void skip_to_eol PROTO ((FILE *));
-static int read_string PROTO ((FILE *));
-static int read_number PROTO ((int, FILE *));
-static int read_num_or_name PROTO ((int, FILE *));
-static int intern PROTO ((char *, int));
-
-void new_parse (name)
- char *name;
+void
+new_parse(char *name)
{
tlname = name;
lpos = line = 1;
cur_line = line1;
prev_line = line2;
token_line = cur_line;
- cur_line [0] = prev_line [0] = 0;
+ cur_line[0] = prev_line[0] = 0;
warnings_occurred = 0;
}
-static int get_char (cfile)
- FILE *cfile;
+static int
+get_char(FILE *cfile)
{
- int c = getc (cfile);
+ int c = getc(cfile);
if (!ugflag) {
if (c == '\n') {
- if (cur_line == line1) {
+ if (cur_line == line1) {
cur_line = line2;
prev_line = line1;
} else {
@@ -104,74 +99,72 @@ static int get_char (cfile)
}
line++;
lpos = 1;
- cur_line [0] = 0;
+ cur_line[0] = 0;
} else if (c != EOF) {
if (lpos <= 81) {
- cur_line [lpos - 1] = c;
- cur_line [lpos] = 0;
+ cur_line[lpos - 1] = c;
+ cur_line[lpos] = 0;
}
lpos++;
}
} else
ugflag = 0;
- return c;
+ return (c);
}
-static int get_token (cfile)
- FILE *cfile;
+static int
+get_token(FILE *cfile)
{
- int c;
- int ttok;
- static char tb [2];
- int l, p, u;
+ int c, ttok;
+ static char tb[2];
+ int l, p, u;
do {
l = line;
p = lpos;
u = ugflag;
- c = get_char (cfile);
+ c = get_char(cfile);
- if (!(c == '\n' && eol_token) && isascii (c) && isspace (c))
+ if (!(c == '\n' && eol_token) && isascii(c) && isspace(c))
continue;
if (c == '#') {
- skip_to_eol (cfile);
+ skip_to_eol(cfile);
continue;
}
if (c == '"') {
lexline = l;
lexchar = p;
- ttok = read_string (cfile);
+ ttok = read_string(cfile);
break;
}
- if ((isascii (c) && isdigit (c)) || c == '-') {
+ if ((isascii(c) && isdigit(c)) || c == '-') {
lexline = l;
lexchar = p;
- ttok = read_number (c, cfile);
+ ttok = read_number(c, cfile);
break;
- } else if (isascii (c) && isalpha (c)) {
+ } else if (isascii(c) && isalpha(c)) {
lexline = l;
lexchar = p;
- ttok = read_num_or_name (c, cfile);
+ ttok = read_num_or_name(c, cfile);
break;
} else {
lexline = l;
lexchar = p;
- tb [0] = c;
- tb [1] = 0;
+ tb[0] = c;
+ tb[1] = 0;
tval = tb;
ttok = c;
break;
}
} while (1);
- return ttok;
+ return (ttok);
}
-int next_token (rval, cfile)
- char **rval;
- FILE *cfile;
+int
+next_token(char **rval, FILE *cfile)
{
- int rv;
+ int rv;
if (token) {
if (lexline != tline)
@@ -181,46 +174,46 @@ int next_token (rval, cfile)
rv = token;
token = 0;
} else {
- rv = get_token (cfile);
+ rv = get_token(cfile);
token_line = cur_line;
}
if (rval)
*rval = tval;
-#ifdef DEBUG_TOKENS
- fprintf (stderr, "%s:%d ", tval, rv);
-#endif
- return rv;
+
+ return (rv);
}
-int peek_token (rval, cfile)
- char **rval;
- FILE *cfile;
+int
+peek_token(char **rval, FILE *cfile)
{
- int x;
+ int x;
if (!token) {
tlpos = lexchar;
tline = lexline;
- token = get_token (cfile);
+ token = get_token(cfile);
if (lexline != tline)
token_line = prev_line;
- x = lexchar; lexchar = tlpos; tlpos = x;
- x = lexline; lexline = tline; tline = x;
+ x = lexchar;
+ lexchar = tlpos;
+ tlpos = x;
+ x = lexline;
+ lexline = tline;
+ tline = x;
}
if (rval)
*rval = tval;
-#ifdef DEBUG_TOKENS
- fprintf (stderr, "(%s:%d) ", tval, token);
-#endif
- return token;
+
+ return (token);
}
-static void skip_to_eol (cfile)
- FILE *cfile;
+static void
+skip_to_eol(FILE *cfile)
{
- int c;
+ int c;
+
do {
- c = get_char (cfile);
+ c = get_char(cfile);
if (c == EOF)
return;
if (c == '\n')
@@ -228,309 +221,306 @@ static void skip_to_eol (cfile)
} while (1);
}
-static int read_string (cfile)
- FILE *cfile;
+static int
+read_string(FILE *cfile)
{
- int i;
- int bs = 0;
- int c;
+ int i, c, bs = 0;
- for (i = 0; i < sizeof tokbuf; i++) {
- c = get_char (cfile);
+ for (i = 0; i < sizeof(tokbuf); i++) {
+ c = get_char(cfile);
if (c == EOF) {
- parse_warn ("eof in string constant");
+ parse_warn("eof in string constant");
break;
}
if (bs) {
bs = 0;
- tokbuf [i] = c;
+ tokbuf[i] = c;
} else if (c == '\\')
bs = 1;
else if (c == '"')
break;
else
- tokbuf [i] = c;
+ tokbuf[i] = c;
}
- /* Normally, I'd feel guilty about this, but we're talking about
- strings that'll fit in a DHCP packet here... */
- if (i == sizeof tokbuf) {
- parse_warn ("string constant larger than internal buffer");
- --i;
+ /*
+ * Normally, I'd feel guilty about this, but we're talking about
+ * strings that'll fit in a DHCP packet here...
+ */
+ if (i == sizeof(tokbuf)) {
+ parse_warn("string constant larger than internal buffer");
+ i--;
}
- tokbuf [i] = 0;
+ tokbuf[i] = 0;
tval = tokbuf;
- return STRING;
+ return (STRING);
}
-static int read_number (c, cfile)
- int c;
- FILE *cfile;
+static int
+read_number(int c, FILE *cfile)
{
- int seenx = 0;
- int i = 0;
- int token = NUMBER;
+ int seenx = 0, i = 0, token = NUMBER;
- tokbuf [i++] = c;
- for (; i < sizeof tokbuf; i++) {
- c = get_char (cfile);
- if (!seenx && c == 'x') {
+ tokbuf[i++] = c;
+ for (; i < sizeof(tokbuf); i++) {
+ c = get_char(cfile);
+ if (!seenx && c == 'x')
seenx = 1;
- } else if (!isascii (c) || !isxdigit (c)) {
- ungetc (c, cfile);
+ else if (!isascii(c) || !isxdigit(c)) {
+ ungetc(c, cfile);
ugflag = 1;
break;
}
- tokbuf [i] = c;
+ tokbuf[i] = c;
}
- if (i == sizeof tokbuf) {
- parse_warn ("numeric token larger than internal buffer");
- --i;
+ if (i == sizeof(tokbuf)) {
+ parse_warn("numeric token larger than internal buffer");
+ i--;
}
- tokbuf [i] = 0;
+ tokbuf[i] = 0;
tval = tokbuf;
- return token;
+
+ return (token);
}
-static int read_num_or_name (c, cfile)
- int c;
- FILE *cfile;
+static int
+read_num_or_name(int c, FILE *cfile)
{
- int i = 0;
- int rv = NUMBER_OR_NAME;
- tokbuf [i++] = c;
- for (; i < sizeof tokbuf; i++) {
- c = get_char (cfile);
- if (!isascii (c) ||
- (c != '-' && c != '_' && !isalnum (c))) {
- ungetc (c, cfile);
+ int i = 0;
+ int rv = NUMBER_OR_NAME;
+
+ tokbuf[i++] = c;
+ for (; i < sizeof(tokbuf); i++) {
+ c = get_char(cfile);
+ if (!isascii(c) || (c != '-' && c != '_' && !isalnum(c))) {
+ ungetc(c, cfile);
ugflag = 1;
break;
}
- if (!isxdigit (c))
+ if (!isxdigit(c))
rv = NAME;
- tokbuf [i] = c;
+ tokbuf[i] = c;
}
- if (i == sizeof tokbuf) {
- parse_warn ("token larger than internal buffer");
- --i;
+ if (i == sizeof(tokbuf)) {
+ parse_warn("token larger than internal buffer");
+ i--;
}
- tokbuf [i] = 0;
+ tokbuf[i] = 0;
tval = tokbuf;
- return intern (tval, rv);
+
+ return (intern(tval, rv));
}
-static int intern (atom, dfv)
- char *atom;
- int dfv;
+static int
+intern(char *atom, int dfv)
{
- if (!isascii (atom [0]))
- return dfv;
+ if (!isascii(atom[0]))
+ return (dfv);
- switch (tolower (atom [0])) {
- case 'a':
- if (!strcasecmp (atom + 1, "lways-reply-rfc1048"))
- return ALWAYS_REPLY_RFC1048;
- if (!strcasecmp (atom + 1, "ppend"))
- return APPEND;
- if (!strcasecmp (atom + 1, "llow"))
- return ALLOW;
- if (!strcasecmp (atom + 1, "lias"))
- return ALIAS;
- if (!strcasecmp (atom + 1, "bandoned"))
- return ABANDONED;
- if (!strcasecmp (atom + 1, "uthoritative"))
- return AUTHORITATIVE;
+ switch (tolower(atom[0])) {
+ case 'a':
+ if (!strcasecmp(atom + 1, "lways-reply-rfc1048"))
+ return (ALWAYS_REPLY_RFC1048);
+ if (!strcasecmp(atom + 1, "ppend"))
+ return (APPEND);
+ if (!strcasecmp(atom + 1, "llow"))
+ return (ALLOW);
+ if (!strcasecmp(atom + 1, "lias"))
+ return (ALIAS);
+ if (!strcasecmp(atom + 1, "bandoned"))
+ return (ABANDONED);
+ if (!strcasecmp(atom + 1, "uthoritative"))
+ return (AUTHORITATIVE);
break;
- case 'b':
- if (!strcasecmp (atom + 1, "ackoff-cutoff"))
- return BACKOFF_CUTOFF;
- if (!strcasecmp (atom + 1, "ootp"))
- return BOOTP;
- if (!strcasecmp (atom + 1, "ooting"))
- return BOOTING;
- if (!strcasecmp (atom + 1, "oot-unknown-clients"))
- return BOOT_UNKNOWN_CLIENTS;
- case 'c':
- if (!strcasecmp (atom + 1, "lass"))
- return CLASS;
- if (!strcasecmp (atom + 1, "iaddr"))
- return CIADDR;
- if (!strcasecmp (atom + 1, "lient-identifier"))
- return CLIENT_IDENTIFIER;
- if (!strcasecmp (atom + 1, "lient-hostname"))
- return CLIENT_HOSTNAME;
+ case 'b':
+ if (!strcasecmp(atom + 1, "ackoff-cutoff"))
+ return (BACKOFF_CUTOFF);
+ if (!strcasecmp(atom + 1, "ootp"))
+ return (BOOTP);
+ if (!strcasecmp(atom + 1, "ooting"))
+ return (BOOTING);
+ if (!strcasecmp(atom + 1, "oot-unknown-clients"))
+ return (BOOT_UNKNOWN_CLIENTS);
+ case 'c':
+ if (!strcasecmp(atom + 1, "lass"))
+ return (CLASS);
+ if (!strcasecmp(atom + 1, "iaddr"))
+ return (CIADDR);
+ if (!strcasecmp(atom + 1, "lient-identifier"))
+ return (CLIENT_IDENTIFIER);
+ if (!strcasecmp(atom + 1, "lient-hostname"))
+ return (CLIENT_HOSTNAME);
break;
- case 'd':
- if (!strcasecmp (atom + 1, "omain"))
- return DOMAIN;
- if (!strcasecmp (atom + 1, "eny"))
- return DENY;
- if (!strncasecmp (atom + 1, "efault", 6)) {
- if (!atom [7])
- return DEFAULT;
- if (!strcasecmp (atom + 7, "-lease-time"))
- return DEFAULT_LEASE_TIME;
+ case 'd':
+ if (!strcasecmp(atom + 1, "omain"))
+ return (DOMAIN);
+ if (!strcasecmp(atom + 1, "eny"))
+ return (DENY);
+ if (!strncasecmp(atom + 1, "efault", 6)) {
+ if (!atom[7])
+ return (DEFAULT);
+ if (!strcasecmp(atom + 7, "-lease-time"))
+ return (DEFAULT_LEASE_TIME);
break;
}
- if (!strncasecmp (atom + 1, "ynamic-bootp", 12)) {
- if (!atom [13])
- return DYNAMIC_BOOTP;
- if (!strcasecmp (atom + 13, "-lease-cutoff"))
- return DYNAMIC_BOOTP_LEASE_CUTOFF;
- if (!strcasecmp (atom + 13, "-lease-length"))
- return DYNAMIC_BOOTP_LEASE_LENGTH;
+ if (!strncasecmp(atom + 1, "ynamic-bootp", 12)) {
+ if (!atom[13])
+ return (DYNAMIC_BOOTP);
+ if (!strcasecmp(atom + 13, "-lease-cutoff"))
+ return (DYNAMIC_BOOTP_LEASE_CUTOFF);
+ if (!strcasecmp(atom + 13, "-lease-length"))
+ return (DYNAMIC_BOOTP_LEASE_LENGTH);
break;
}
break;
- case 'e':
- if (!strcasecmp (atom + 1, "thernet"))
- return ETHERNET;
- if (!strcasecmp (atom + 1, "nds"))
- return ENDS;
- if (!strcasecmp (atom + 1, "xpire"))
- return EXPIRE;
+ case 'e':
+ if (!strcasecmp(atom + 1, "thernet"))
+ return (ETHERNET);
+ if (!strcasecmp(atom + 1, "nds"))
+ return (ENDS);
+ if (!strcasecmp(atom + 1, "xpire"))
+ return (EXPIRE);
break;
- case 'f':
- if (!strcasecmp (atom + 1, "ilename"))
- return FILENAME;
- if (!strcasecmp (atom + 1, "ixed-address"))
- return FIXED_ADDR;
- if (!strcasecmp (atom + 1, "ddi"))
- return FDDI;
+ case 'f':
+ if (!strcasecmp(atom + 1, "ilename"))
+ return (FILENAME);
+ if (!strcasecmp(atom + 1, "ixed-address"))
+ return (FIXED_ADDR);
+ if (!strcasecmp(atom + 1, "ddi"))
+ return (FDDI);
break;
- case 'g':
- if (!strcasecmp (atom + 1, "iaddr"))
- return GIADDR;
- if (!strcasecmp (atom + 1, "roup"))
- return GROUP;
- if (!strcasecmp (atom + 1, "et-lease-hostnames"))
- return GET_LEASE_HOSTNAMES;
+ case 'g':
+ if (!strcasecmp(atom + 1, "iaddr"))
+ return (GIADDR);
+ if (!strcasecmp(atom + 1, "roup"))
+ return (GROUP);
+ if (!strcasecmp(atom + 1, "et-lease-hostnames"))
+ return (GET_LEASE_HOSTNAMES);
break;
- case 'h':
- if (!strcasecmp (atom + 1, "ost"))
- return HOST;
- if (!strcasecmp (atom + 1, "ardware"))
- return HARDWARE;
- if (!strcasecmp (atom + 1, "ostname"))
- return HOSTNAME;
+ case 'h':
+ if (!strcasecmp(atom + 1, "ost"))
+ return (HOST);
+ if (!strcasecmp(atom + 1, "ardware"))
+ return (HARDWARE);
+ if (!strcasecmp(atom + 1, "ostname"))
+ return (HOSTNAME);
break;
- case 'i':
- if (!strcasecmp (atom + 1, "nitial-interval"))
- return INITIAL_INTERVAL;
- if (!strcasecmp (atom + 1, "nterface"))
- return INTERFACE;
+ case 'i':
+ if (!strcasecmp(atom + 1, "nitial-interval"))
+ return (INITIAL_INTERVAL);
+ if (!strcasecmp(atom + 1, "nterface"))
+ return (INTERFACE);
break;
- case 'l':
- if (!strcasecmp (atom + 1, "ease"))
- return LEASE;
+ case 'l':
+ if (!strcasecmp(atom + 1, "ease"))
+ return (LEASE);
break;
- case 'm':
- if (!strcasecmp (atom + 1, "ax-lease-time"))
- return MAX_LEASE_TIME;
- if (!strncasecmp (atom + 1, "edi", 3)) {
- if (!strcasecmp (atom + 4, "a"))
- return MEDIA;
- if (!strcasecmp (atom + 4, "um"))
- return MEDIUM;
+ case 'm':
+ if (!strcasecmp(atom + 1, "ax-lease-time"))
+ return (MAX_LEASE_TIME);
+ if (!strncasecmp(atom + 1, "edi", 3)) {
+ if (!strcasecmp(atom + 4, "a"))
+ return (MEDIA);
+ if (!strcasecmp(atom + 4, "um"))
+ return (MEDIUM);
break;
}
break;
- case 'n':
- if (!strcasecmp (atom + 1, "ameserver"))
- return NAMESERVER;
- if (!strcasecmp (atom + 1, "etmask"))
- return NETMASK;
- if (!strcasecmp (atom + 1, "ext-server"))
- return NEXT_SERVER;
- if (!strcasecmp (atom + 1, "ot"))
- return TOKEN_NOT;
+ case 'n':
+ if (!strcasecmp(atom + 1, "ameserver"))
+ return (NAMESERVER);
+ if (!strcasecmp(atom + 1, "etmask"))
+ return (NETMASK);
+ if (!strcasecmp(atom + 1, "ext-server"))
+ return (NEXT_SERVER);
+ if (!strcasecmp(atom + 1, "ot"))
+ return (TOKEN_NOT);
break;
- case 'o':
- if (!strcasecmp (atom + 1, "ption"))
- return OPTION;
- if (!strcasecmp (atom + 1, "ne-lease-per-client"))
- return ONE_LEASE_PER_CLIENT;
+ case 'o':
+ if (!strcasecmp(atom + 1, "ption"))
+ return (OPTION);
+ if (!strcasecmp(atom + 1, "ne-lease-per-client"))
+ return (ONE_LEASE_PER_CLIENT);
break;
- case 'p':
- if (!strcasecmp (atom + 1, "repend"))
- return PREPEND;
- if (!strcasecmp (atom + 1, "acket"))
- return PACKET;
+ case 'p':
+ if (!strcasecmp(atom + 1, "repend"))
+ return (PREPEND);
+ if (!strcasecmp(atom + 1, "acket"))
+ return (PACKET);
break;
- case 'r':
- if (!strcasecmp (atom + 1, "ange"))
- return RANGE;
- if (!strcasecmp (atom + 1, "equest"))
- return REQUEST;
- if (!strcasecmp (atom + 1, "equire"))
- return REQUIRE;
- if (!strcasecmp (atom + 1, "etry"))
- return RETRY;
- if (!strcasecmp (atom + 1, "enew"))
- return RENEW;
- if (!strcasecmp (atom + 1, "ebind"))
- return REBIND;
- if (!strcasecmp (atom + 1, "eboot"))
- return REBOOT;
- if (!strcasecmp (atom + 1, "eject"))
- return REJECT;
+ case 'r':
+ if (!strcasecmp(atom + 1, "ange"))
+ return (RANGE);
+ if (!strcasecmp(atom + 1, "equest"))
+ return (REQUEST);
+ if (!strcasecmp(atom + 1, "equire"))
+ return (REQUIRE);
+ if (!strcasecmp(atom + 1, "etry"))
+ return (RETRY);
+ if (!strcasecmp(atom + 1, "enew"))
+ return (RENEW);
+ if (!strcasecmp(atom + 1, "ebind"))
+ return (REBIND);
+ if (!strcasecmp(atom + 1, "eboot"))
+ return (REBOOT);
+ if (!strcasecmp(atom + 1, "eject"))
+ return (REJECT);
break;
- case 's':
- if (!strcasecmp (atom + 1, "earch"))
- return SEARCH;
- if (!strcasecmp (atom + 1, "tarts"))
- return STARTS;
- if (!strcasecmp (atom + 1, "iaddr"))
- return SIADDR;
- if (!strcasecmp (atom + 1, "ubnet"))
- return SUBNET;
- if (!strcasecmp (atom + 1, "hared-network"))
- return SHARED_NETWORK;
- if (!strcasecmp (atom + 1, "erver-name"))
- return SERVER_NAME;
- if (!strcasecmp (atom + 1, "erver-identifier"))
- return SERVER_IDENTIFIER;
- if (!strcasecmp (atom + 1, "elect-timeout"))
- return SELECT_TIMEOUT;
- if (!strcasecmp (atom + 1, "end"))
- return SEND;
- if (!strcasecmp (atom + 1, "cript"))
- return SCRIPT;
- if (!strcasecmp (atom + 1, "upersede"))
- return SUPERSEDE;
+ case 's':
+ if (!strcasecmp(atom + 1, "earch"))
+ return (SEARCH);
+ if (!strcasecmp(atom + 1, "tarts"))
+ return (STARTS);
+ if (!strcasecmp(atom + 1, "iaddr"))
+ return (SIADDR);
+ if (!strcasecmp(atom + 1, "ubnet"))
+ return (SUBNET);
+ if (!strcasecmp(atom + 1, "hared-network"))
+ return (SHARED_NETWORK);
+ if (!strcasecmp(atom + 1, "erver-name"))
+ return (SERVER_NAME);
+ if (!strcasecmp(atom + 1, "erver-identifier"))
+ return (SERVER_IDENTIFIER);
+ if (!strcasecmp(atom + 1, "elect-timeout"))
+ return (SELECT_TIMEOUT);
+ if (!strcasecmp(atom + 1, "end"))
+ return (SEND);
+ if (!strcasecmp(atom + 1, "cript"))
+ return (SCRIPT);
+ if (!strcasecmp(atom + 1, "upersede"))
+ return (SUPERSEDE);
break;
- case 't':
- if (!strcasecmp (atom + 1, "imestamp"))
- return TIMESTAMP;
- if (!strcasecmp (atom + 1, "imeout"))
- return TIMEOUT;
- if (!strcasecmp (atom + 1, "oken-ring"))
- return TOKEN_RING;
+ case 't':
+ if (!strcasecmp(atom + 1, "imestamp"))
+ return (TIMESTAMP);
+ if (!strcasecmp(atom + 1, "imeout"))
+ return (TIMEOUT);
+ if (!strcasecmp(atom + 1, "oken-ring"))
+ return (TOKEN_RING);
break;
- case 'u':
- if (!strncasecmp (atom + 1, "se", 2)) {
- if (!strcasecmp (atom + 3, "r-class"))
- return USER_CLASS;
- if (!strcasecmp (atom + 3, "-host-decl-names"))
- return USE_HOST_DECL_NAMES;
- if (!strcasecmp (atom + 3,
+ case 'u':
+ if (!strncasecmp(atom + 1, "se", 2)) {
+ if (!strcasecmp(atom + 3, "r-class"))
+ return (USER_CLASS);
+ if (!strcasecmp(atom + 3, "-host-decl-names"))
+ return (USE_HOST_DECL_NAMES);
+ if (!strcasecmp(atom + 3,
"-lease-addr-for-default-route"))
- return USE_LEASE_ADDR_FOR_DEFAULT_ROUTE;
+ return (USE_LEASE_ADDR_FOR_DEFAULT_ROUTE);
break;
}
- if (!strcasecmp (atom + 1, "id"))
- return UID;
- if (!strcasecmp (atom + 1, "nknown-clients"))
- return UNKNOWN_CLIENTS;
+ if (!strcasecmp(atom + 1, "id"))
+ return (UID);
+ if (!strcasecmp(atom + 1, "nknown-clients"))
+ return (UNKNOWN_CLIENTS);
break;
- case 'v':
- if (!strcasecmp (atom + 1, "endor-class"))
- return VENDOR_CLASS;
+ case 'v':
+ if (!strcasecmp(atom + 1, "endor-class"))
+ return (VENDOR_CLASS);
break;
- case 'y':
- if (!strcasecmp (atom + 1, "iaddr"))
- return YIADDR;
+ case 'y':
+ if (!strcasecmp(atom + 1, "iaddr"))
+ return (YIADDR);
break;
}
- return dfv;
+ return (dfv);
}