-/* $OpenBSD: clparse.c,v 1.161 2018/01/02 00:13:27 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.162 2018/01/04 02:27:55 krw Exp $ */
/* Parser for dhclient config and lease files. */
/* 'bootp' is just a comment. See BOOTP_LEASE(). */
break;
case TOK_EPOCH:
- if (parse_decimal(cfile, (unsigned char *)&lease->epoch, 't')
+ if (parse_number(cfile, (unsigned char *)&lease->epoch, 't')
== 0)
return;
lease->epoch = betoh64(lease->epoch);
dp = (uint8_t *)&ip_addr;
break;
case 'l': /* Signed 32-bit integer. */
- if (parse_decimal(cfile, buf, 'l') == 0)
+ if (parse_number(cfile, buf, 'l') == 0)
return 0;
len = 4;
dp = buf;
break;
case 'L': /* Unsigned 32-bit integer. */
- if (parse_decimal(cfile, buf, 'L') == 0)
+ if (parse_number(cfile, buf, 'L') == 0)
return 0;
len = 4;
dp = buf;
break;
case 'S': /* Unsigned 16-bit integer. */
- if (parse_decimal(cfile, buf, 'S') == 0)
+ if (parse_number(cfile, buf, 'S') == 0)
return 0;
len = 2;
dp = buf;
break;
case 'B': /* Unsigned 8-bit integer. */
- if (parse_decimal(cfile, buf, 'B') == 0)
+ if (parse_number(cfile, buf, 'B') == 0)
return 0;
len = 1;
dp = buf;
-/* $OpenBSD: dhcpd.h,v 1.243 2017/12/18 14:17:58 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.244 2018/01/04 02:27:55 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
int parse_ip_addr(FILE *, struct in_addr *);
int parse_cidr(FILE *, unsigned char *);
int parse_lease_time(FILE *, time_t *);
-int parse_decimal(FILE *, unsigned char *, char);
+int parse_number(FILE *, unsigned char *, char);
int parse_boolean(FILE *, unsigned char *);
void parse_warn(char *);
-/* $OpenBSD: parse.c,v 1.77 2017/11/09 12:34:25 krw Exp $ */
+/* $OpenBSD: parse.c,v 1.78 2018/01/04 02:27:55 krw Exp $ */
/* Common parser code for dhcpd and dhclient. */
}
int
-parse_decimal(FILE *cfile, unsigned char *buf, char fmt)
+parse_number(FILE *cfile, unsigned char *buf, char fmt)
{
const char *errstr;
char *val, *msg;