summaryrefslogtreecommitdiff
path: root/common/conflex.c
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2010-02-03 23:25:25 +0000
committerDavid Hankins <dhankins@isc.org>2010-02-03 23:25:25 +0000
commitfdfebedf3e1e048d6f12a2332a72156c28ace88b (patch)
tree01347d8bf5ee2fd5c28f8e3cd0a87fba3976a246 /common/conflex.c
parent176c2a7d2d6f65597ce9957456b1b3371b5fd3f9 (diff)
downloadisc-dhcp-fdfebedf3e1e048d6f12a2332a72156c28ace88b.tar.gz
- An optimization described in the failover protocol draft is now included,
which permits a DHCP server operating in communications-interrupted state to 'rewind' a lease to the state most recently transmitted to its peer, greatly increasing a server's endurance in communications-interrupted. This is supported using a new 'rewind state' record on the dhcpd.leases entry for each lease. [ISC-Bugs #19601]
Diffstat (limited to 'common/conflex.c')
-rw-r--r--common/conflex.c109
1 files changed, 59 insertions, 50 deletions
diff --git a/common/conflex.c b/common/conflex.c
index f4775ff4..77a40be3 100644
--- a/common/conflex.c
+++ b/common/conflex.c
@@ -1229,63 +1229,72 @@ intern(char *atom, enum dhcp_token dfv) {
return PAUSED;
break;
case 'r':
- if (!strcasecmp (atom + 1, "esolution-interrupted"))
- return RESOLUTION_INTERRUPTED;
- if (!strcasecmp (atom + 1, "ange"))
+ if (!strcasecmp(atom + 1, "ange"))
return RANGE;
- if (!strcasecmp(atom + 1, "ange6")) {
+ if (!strcasecmp(atom + 1, "ange6"))
return RANGE6;
+ if (isascii(atom[1]) && (tolower(atom[1]) == 'e')) {
+ if (!strcasecmp(atom + 2, "bind"))
+ return REBIND;
+ if (!strcasecmp(atom + 2, "boot"))
+ return REBOOT;
+ if (!strcasecmp(atom + 2, "contact-interval"))
+ return RECONTACT_INTERVAL;
+ if (!strncasecmp(atom + 2, "cover", 5)) {
+ if (atom[7] == '\0')
+ return RECOVER;
+ if (!strcasecmp(atom + 7, "-done"))
+ return RECOVER_DONE;
+ if (!strcasecmp(atom + 7, "-wait"))
+ return RECOVER_WAIT;
+ break;
+ }
+ if (!strcasecmp(atom + 2, "fresh"))
+ return REFRESH;
+ if (!strcasecmp(atom + 2, "fused"))
+ return NS_REFUSED;
+ if (!strcasecmp(atom + 2, "ject"))
+ return REJECT;
+ if (!strcasecmp(atom + 2, "lease"))
+ return RELEASE;
+ if (!strcasecmp(atom + 2, "leased"))
+ return TOKEN_RELEASED;
+ if (!strcasecmp(atom + 2, "move"))
+ return REMOVE;
+ if (!strcasecmp(atom + 2, "new"))
+ return RENEW;
+ if (!strcasecmp(atom + 2, "quest"))
+ return REQUEST;
+ if (!strcasecmp(atom + 2, "quire"))
+ return REQUIRE;
+ if (isascii(atom[2]) && (tolower(atom[2]) == 's')) {
+ if (!strcasecmp(atom + 3, "erved"))
+ return TOKEN_RESERVED;
+ if (!strcasecmp(atom + 3, "et"))
+ return TOKEN_RESET;
+ if (!strcasecmp(atom + 3,
+ "olution-interrupted"))
+ return RESOLUTION_INTERRUPTED;
+ break;
+ }
+ if (!strcasecmp(atom + 2, "try"))
+ return RETRY;
+ if (!strcasecmp(atom + 2, "turn"))
+ return RETURN;
+ if (!strcasecmp(atom + 2, "verse"))
+ return REVERSE;
+ if (!strcasecmp(atom + 2, "wind"))
+ return REWIND;
+ break;
}
- if (!strcasecmp (atom + 1, "ecover"))
- return RECOVER;
- if (!strcasecmp (atom + 1, "ecover-done"))
- return RECOVER_DONE;
- if (!strcasecmp (atom + 1, "ecover-wait"))
- return RECOVER_WAIT;
- if (!strcasecmp (atom + 1, "econtact-interval"))
- return RECONTACT_INTERVAL;
- if (!strcasecmp (atom + 1, "equest"))
- return REQUEST;
- if (!strcasecmp (atom + 1, "equire"))
- return REQUIRE;
- if (!strcasecmp (atom + 1, "equire"))
- return REQUIRE;
- if (!strcasecmp (atom + 1, "etry"))
- return RETRY;
- if (!strcasecmp (atom + 1, "eturn"))
- return RETURN;
- 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;
- if (!strcasecmp (atom + 1, "everse"))
- return REVERSE;
- if (!strcasecmp (atom + 1, "elease"))
- return RELEASE;
- if (!strcasecmp (atom + 1, "efused"))
- return NS_REFUSED;
- if (!strcasecmp (atom + 1, "eleased"))
- return TOKEN_RELEASED;
- if (!strcasecmp (atom + 1, "eset"))
- return TOKEN_RESET;
- if (!strcasecmp (atom + 1, "eserved"))
- return TOKEN_RESERVED;
- if (!strcasecmp (atom + 1, "emove"))
- return REMOVE;
- if (!strcasecmp (atom + 1, "efresh"))
- return REFRESH;
break;
case 's':
- if (!strcasecmp(atom + 1, "cript"))
- return SCRIPT;
+ if (!strcasecmp(atom + 1, "cript"))
+ return SCRIPT;
if (isascii(atom[1]) &&
tolower((unsigned char)atom[1]) == 'e') {
- if (!strcasecmp(atom + 2, "arch"))
- return SEARCH;
+ if (!strcasecmp(atom + 2, "arch"))
+ return SEARCH;
if (isascii(atom[2]) &&
tolower((unsigned char)atom[2]) == 'c') {
if (!strncasecmp(atom + 3, "ond", 3)) {