dhcp6_lexer.ll 62.2 KB
Newer Older
1
/* Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
2 3 4 5 6 7

   This Source Code Form is subject to the terms of the Mozilla Public
   License, v. 2.0. If a copy of the MPL was not distributed with this
   file, You can obtain one at http://mozilla.org/MPL/2.0/. */

%{ /* -*- C++ -*- */
8 9 10 11

/* Generated files do not make clang static analyser so happy */
#ifndef __clang_analyzer__

12 13 14 15 16 17 18
#include <cerrno>
#include <climits>
#include <cstdlib>
#include <string>
#include <dhcp6/parser_context.h>
#include <asiolink/io_address.h>
#include <boost/lexical_cast.hpp>
Tomek Mrugalski's avatar
Tomek Mrugalski committed
19
#include <exceptions/exceptions.h>
20

21 22 23 24 25 26
/* Please avoid C++ style comments (// ... eol) as they break flex 2.6.2 */

/* Work around an incompatibility in flex (at least versions
   2.5.31 through 2.5.33): it generates code that does
   not conform to C89.  See Debian bug 333231
   <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
27 28 29
# undef yywrap
# define yywrap() 1

Francis Dupont's avatar
Francis Dupont committed
30 31 32 33 34
namespace {

bool start_token_flag = false;

isc::dhcp::Parser6Context::ParserType start_token_value;
35
unsigned int comment_start_line = 0;
Francis Dupont's avatar
Francis Dupont committed
36

37 38
using namespace isc::dhcp;

Francis Dupont's avatar
Francis Dupont committed
39
};
40

41
/* To avoid the call to exit... oops! */
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
#define YY_FATAL_ERROR(msg) isc::dhcp::Parser6Context::fatal(msg)
%}

/* noyywrap disables automatic rewinding for the next file to parse. Since we
   always parse only a single string, there's no need to do any wraps. And
   using yywrap requires linking with -lfl, which provides the default yywrap
   implementation that always returns 1 anyway. */
%option noyywrap

/* nounput simplifies the lexer, by removing support for putting a character
   back into the input stream. We never use such capability anyway. */
%option nounput

/* batch means that we'll never use the generated lexer interactively. */
%option batch

58 59 60
/* avoid to get static global variables to remain with C++. */
/* in last resort %option reentrant */

61 62 63 64 65 66 67 68 69
/* Enables debug mode. To see the debug messages, one needs to also set
   yy_flex_debug to 1, then the debug messages will be printed on stderr. */
%option debug

/* I have no idea what this option does, except it was specified in the bison
   examples and Postgres folks added it to remove gcc 4.3 warnings. Let's
   be on the safe side and keep it. */
%option noinput

Tomek Mrugalski's avatar
Tomek Mrugalski committed
70
%x COMMENT
Francis Dupont's avatar
Francis Dupont committed
71
%x DIR_ENTER DIR_INCLUDE DIR_EXIT
Tomek Mrugalski's avatar
Tomek Mrugalski committed
72

73 74 75 76
/* These are not token expressions yet, just convenience expressions that
   can be used during actual token definitions. Note some can match
   incorrect inputs (e.g., IP addresses) which must be checked. */
int   \-?[0-9]+
77
blank [ \t\r]
78

79 80 81 82 83 84
UnicodeEscapeSequence           u[0-9A-Fa-f]{4}
JSONEscapeCharacter             ["\\/bfnrt]
JSONEscapeSequence              {JSONEscapeCharacter}|{UnicodeEscapeSequence}
JSONStandardCharacter           [^\x00-\x1f"\\]
JSONStringCharacter             {JSONStandardCharacter}|\\{JSONEscapeSequence}
JSONString                      \"{JSONStringCharacter}*\"
85

86 87 88 89 90 91
/* for errors */

BadUnicodeEscapeSequence        u[0-9A-Fa-f]{0,3}[^0-9A-Fa-f]
BadJSONEscapeSequence           [^"\\/bfnrtu]|{BadUnicodeEscapeSequence}
ControlCharacter                [\x00-\x1f]
ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
92 93

%{
94 95 96
/* This code run each time a pattern is matched. It updates the location
   by moving it ahead by yyleng bytes. yyleng specifies the length of the
   currently matched token. */
97
#define YY_USER_ACTION  driver.loc_.columns(yyleng);
98 99 100 101 102
%}

%%

%{
103 104 105
    /* This part of the code is copied over to the verbatim to the top
       of the generated yylex function. Explanation:
       http://www.gnu.org/software/bison/manual/html_node/Multiple-start_002dsymbols.html */
106

107
    /* Code run each time yylex is called. */
108
    driver.loc_.step();
Tomek Mrugalski's avatar
Tomek Mrugalski committed
109

110 111 112
    if (start_token_flag) {
        start_token_flag = false;
        switch (start_token_value) {
113
        case Parser6Context::PARSER_JSON:
114
        default:
115
            return isc::dhcp::Dhcp6Parser::make_TOPLEVEL_JSON(driver.loc_);
116
        case Parser6Context::PARSER_DHCP6:
117
            return isc::dhcp::Dhcp6Parser::make_TOPLEVEL_DHCP6(driver.loc_);
118 119
        case Parser6Context::SUBPARSER_DHCP6:
            return isc::dhcp::Dhcp6Parser::make_SUB_DHCP6(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
120
        case Parser6Context::PARSER_INTERFACES:
121
            return isc::dhcp::Dhcp6Parser::make_SUB_INTERFACES6(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
122
        case Parser6Context::PARSER_SUBNET6:
123
            return isc::dhcp::Dhcp6Parser::make_SUB_SUBNET6(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
124
        case Parser6Context::PARSER_POOL6:
125
            return isc::dhcp::Dhcp6Parser::make_SUB_POOL6(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
126
        case Parser6Context::PARSER_PD_POOL:
127
            return isc::dhcp::Dhcp6Parser::make_SUB_PD_POOL(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
128
        case Parser6Context::PARSER_HOST_RESERVATION:
129
            return isc::dhcp::Dhcp6Parser::make_SUB_RESERVATION(driver.loc_);
Francis Dupont's avatar
Francis Dupont committed
130 131 132 133
        case Parser6Context::PARSER_OPTION_DEFS:
            return isc::dhcp::Dhcp6Parser::make_SUB_OPTION_DEFS(driver.loc_);
        case Parser6Context::PARSER_OPTION_DEF:
            return isc::dhcp::Dhcp6Parser::make_SUB_OPTION_DEF(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
134
        case Parser6Context::PARSER_OPTION_DATA:
135
            return isc::dhcp::Dhcp6Parser::make_SUB_OPTION_DATA(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
136
        case Parser6Context::PARSER_HOOKS_LIBRARY:
137
            return isc::dhcp::Dhcp6Parser::make_SUB_HOOKS_LIBRARY(driver.loc_);
138 139
        case Parser6Context::PARSER_DHCP_DDNS:
            return isc::dhcp::Dhcp6Parser::make_SUB_DHCP_DDNS(driver.loc_);
140 141
        case Parser6Context::PARSER_CONFIG_CONTROL:
            return isc::dhcp::Dhcp6Parser::make_SUB_CONFIG_CONTROL(driver.loc_);
142 143
        case Parser6Context::PARSER_LOGGING:
            return isc::dhcp::Dhcp6Parser::make_SUB_LOGGING(driver.loc_);
144 145
        }
    }
146 147
%}

Tomek Mrugalski's avatar
Tomek Mrugalski committed
148 149 150 151 152 153
#.* ;

"//"(.*) ;

"/*" {
  BEGIN(COMMENT);
154
  comment_start_line = driver.loc_.end.line;;
Tomek Mrugalski's avatar
Tomek Mrugalski committed
155 156 157
}

<COMMENT>"*/" BEGIN(INITIAL);
158
<COMMENT>. ;
Tomek Mrugalski's avatar
Tomek Mrugalski committed
159
<COMMENT><<EOF>> {
160
    isc_throw(Dhcp6ParseError, "Comment not closed. (/* in line " << comment_start_line);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
161 162
}

Francis Dupont's avatar
Francis Dupont committed
163 164 165
"<?" BEGIN(DIR_ENTER);
<DIR_ENTER>"include" BEGIN(DIR_INCLUDE);
<DIR_INCLUDE>\"([^\"\n])+\" {
166
    /* Include directive. */
Francis Dupont's avatar
Francis Dupont committed
167

168
    /* Extract the filename. */
Francis Dupont's avatar
Francis Dupont committed
169 170 171
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);

172
    driver.includeFile(tmp);
Francis Dupont's avatar
Francis Dupont committed
173
}
174
<DIR_ENTER,DIR_INCLUDE,DIR_EXIT><<EOF>> {
175
    isc_throw(Dhcp6ParseError, "Directive not closed.");
176
}
Francis Dupont's avatar
Francis Dupont committed
177
<DIR_EXIT>"?>" BEGIN(INITIAL);
178

Francis Dupont's avatar
Francis Dupont committed
179

180
<*>{blank}+   {
181
    /* Ok, we found a with space. Let's ignore it and update loc variable. */
182
    driver.loc_.step();
183
}
184

185
<*>[\n]+      {
186
    /* Newline found. Let's update the location and continue. */
187 188
    driver.loc_.lines(yyleng);
    driver.loc_.step();
189 190
}

191

192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
\"enable-updates\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_ENABLE_UPDATES(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("enable-updates", driver.loc_);
    }
}

\"qualifying-suffix\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_QUALIFYING_SUFFIX(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("qualifying-suffix", driver.loc_);
    }
}

\"server-ip\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_SERVER_IP(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("server-ip", driver.loc_);
    }
}

\"server-port\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_SERVER_PORT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("server-port", driver.loc_);
    }
}

\"sender-ip\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_SENDER_IP(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("sender-ip", driver.loc_);
    }
}

\"sender-port\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_SENDER_PORT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("sender-port", driver.loc_);
    }
}

\"max-queue-size\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_MAX_QUEUE_SIZE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("max-queue-size", driver.loc_);
    }
}

\"ncr-protocol\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_NCR_PROTOCOL(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("ncr-protocol", driver.loc_);
    }
}

\"ncr-format\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_NCR_FORMAT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("ncr-format", driver.loc_);
    }
}

\"override-no-update\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_OVERRIDE_NO_UPDATE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("override-no-update", driver.loc_);
    }
}

\"override-client-update\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_OVERRIDE_CLIENT_UPDATE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("override-client-update", driver.loc_);
    }
}

\"replace-client-name\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_REPLACE_CLIENT_NAME(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("replace-client-name", driver.loc_);
    }
}

\"generated-prefix\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_GENERATED_PREFIX(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("generated-prefix", driver.loc_);
    }
}

309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
\"hostname-char-set\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_HOSTNAME_CHAR_SET(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("hostname-char-set", driver.loc_);
    }
}

\"hostname-char-replacement\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_HOSTNAME_CHAR_REPLACEMENT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("hostname-char-replacement", driver.loc_);
    }
}

327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376
(?i:\"UDP\") {
    /* dhcp-ddns value keywords are case insensitive */
    if (driver.ctx_ == isc::dhcp::Parser6Context::NCR_PROTOCOL) {
        return isc::dhcp::Dhcp6Parser::make_UDP(driver.loc_);
    }
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);
    return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
}

(?i:\"TCP\") {
    /* dhcp-ddns value keywords are case insensitive */
    if (driver.ctx_ == isc::dhcp::Parser6Context::NCR_PROTOCOL) {
        return isc::dhcp::Dhcp6Parser::make_TCP(driver.loc_);
    }
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);
    return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
}

(?i:\"JSON\") {
    /* dhcp-ddns value keywords are case insensitive */
    if (driver.ctx_ == isc::dhcp::Parser6Context::NCR_FORMAT) {
        return isc::dhcp::Dhcp6Parser::make_JSON(driver.loc_);
    }
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);
    return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
}

(?i:\"when-present\") {
    /* dhcp-ddns value keywords are case insensitive */
    if (driver.ctx_ == isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME) {
        return isc::dhcp::Dhcp6Parser::make_WHEN_PRESENT(driver.loc_);
    }
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);
    return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
}

(?i:\"true\") {
    /* dhcp-ddns value keywords are case insensitive */
    if (driver.ctx_ == isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME) {
        return isc::dhcp::Dhcp6Parser::make_WHEN_PRESENT(driver.loc_);
    }
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);
    return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
}

Francis Dupont's avatar
Francis Dupont committed
377 378 379 380 381 382
\"never\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME:
        return isc::dhcp::Dhcp6Parser::make_NEVER(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("never", driver.loc_);
Francis Dupont's avatar
Francis Dupont committed
383
    }
Francis Dupont's avatar
Francis Dupont committed
384 385
}

386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
(?i:\"never\") {
    /* dhcp-ddns value keywords are case insensitive */
    if (driver.ctx_ == isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME) {
        return isc::dhcp::Dhcp6Parser::make_NEVER(driver.loc_);
    }
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);
    return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
}

(?i:\"false\") {
    /* dhcp-ddns value keywords are case insensitive */
    if (driver.ctx_ == isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME) {
        return isc::dhcp::Dhcp6Parser::make_NEVER(driver.loc_);
    }
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);
    return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
}

(?i:\"always\") {
    /* dhcp-ddns value keywords are case insensitive */
    if (driver.ctx_ == isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME) {
        return isc::dhcp::Dhcp6Parser::make_ALWAYS(driver.loc_);
    }
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);
    return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
}

(?i:\"when-not-present\") {
    /* dhcp-ddns value keywords are case insensitive */
    if (driver.ctx_ == isc::dhcp::Parser6Context::REPLACE_CLIENT_NAME) {
        return isc::dhcp::Dhcp6Parser::make_WHEN_NOT_PRESENT(driver.loc_);
    }
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);
    return isc::dhcp::Dhcp6Parser::make_STRING(tmp, driver.loc_);
}

426 427 428
\"Dhcp6\"  {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CONFIG:
429
        return isc::dhcp::Dhcp6Parser::make_DHCP6(driver.loc_);
430
    default:
431
        return isc::dhcp::Dhcp6Parser::make_STRING("Dhcp6", driver.loc_);
432 433 434
    }
}

435 436 437 438 439 440 441 442 443
\"data-directory\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
        return  isc::dhcp::Dhcp6Parser::make_DATA_DIRECTORY(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("data-directory", driver.loc_);
    }
}

444 445 446
\"interfaces-config\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
447
        return  isc::dhcp::Dhcp6Parser::make_INTERFACES_CONFIG(driver.loc_);
448
    default:
449
        return isc::dhcp::Dhcp6Parser::make_STRING("interfaces-config", driver.loc_);
450 451 452 453 454 455
    }
}

\"interfaces\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::INTERFACES_CONFIG:
456
        return  isc::dhcp::Dhcp6Parser::make_INTERFACES(driver.loc_);
457
    default:
458
        return isc::dhcp::Dhcp6Parser::make_STRING("interfaces", driver.loc_);
459 460 461
    }
}

462 463 464 465 466 467 468 469 470
\"re-detect\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::INTERFACES_CONFIG:
        return  isc::dhcp::Dhcp6Parser::make_RE_DETECT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("re-detect", driver.loc_);
    }
}

471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488
\"sanity-checks\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
        return  isc::dhcp::Dhcp6Parser::make_SANITY_CHECKS(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("sanity-checks", driver.loc_);
    }
}

\"lease-checks\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SANITY_CHECKS:
        return  isc::dhcp::Dhcp6Parser::make_LEASE_CHECKS(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("lease-checks", driver.loc_);
    }
}

489 490 491
\"lease-database\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
492
        return isc::dhcp::Dhcp6Parser::make_LEASE_DATABASE(driver.loc_);
493
    default:
494
        return isc::dhcp::Dhcp6Parser::make_STRING("lease-database", driver.loc_);
495 496 497 498 499 500
    }
}

\"hosts-database\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
501
        return isc::dhcp::Dhcp6Parser::make_HOSTS_DATABASE(driver.loc_);
502
    default:
503
        return isc::dhcp::Dhcp6Parser::make_STRING("hosts-database", driver.loc_);
504 505 506
    }
}

507 508 509 510 511 512 513 514 515
\"hosts-databases\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
        return isc::dhcp::Dhcp6Parser::make_HOSTS_DATABASES(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("hosts-databases", driver.loc_);
    }
}

516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533
\"config-control\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
        return isc::dhcp::Dhcp6Parser::make_CONFIG_CONTROL(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("config-control", driver.loc_);
    }
}

\"config-databases\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CONFIG_CONTROL:
        return isc::dhcp::Dhcp6Parser::make_CONFIG_DATABASES(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("config-databases", driver.loc_);
    }
}

534 535 536 537 538 539 540 541
\"config-fetch-wait-time\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CONFIG_CONTROL:
        return isc::dhcp::Dhcp6Parser::make_CONFIG_FETCH_WAIT_TIME(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("config-fetch-wait-time", driver.loc_);
    }
}
542

543 544 545 546 547 548 549 550 551
\"readonly\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
        return isc::dhcp::Dhcp6Parser::make_READONLY(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("readonly", driver.loc_);
    }
}

552 553
\"type\" {
    switch(driver.ctx_) {
554 555
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
556
    case isc::dhcp::Parser6Context::OPTION_DEF:
557
    case isc::dhcp::Parser6Context::SERVER_ID:
558
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
559
        return isc::dhcp::Dhcp6Parser::make_TYPE(driver.loc_);
560
    default:
561
        return isc::dhcp::Dhcp6Parser::make_STRING("type", driver.loc_);
562 563 564
    }
}

565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591
\"memfile\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DATABASE_TYPE:
        return isc::dhcp::Dhcp6Parser::make_MEMFILE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("memfile", driver.loc_);
    }
}

\"mysql\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DATABASE_TYPE:
        return isc::dhcp::Dhcp6Parser::make_MYSQL(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("mysql", driver.loc_);
    }
}

\"postgresql\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DATABASE_TYPE:
        return isc::dhcp::Dhcp6Parser::make_POSTGRESQL(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("postgresql", driver.loc_);
    }
}

592 593 594 595 596 597 598 599 600
\"cql\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DATABASE_TYPE:
        return isc::dhcp::Dhcp6Parser::make_CQL(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("cql", driver.loc_);
    }
}

601 602
\"user\" {
    switch(driver.ctx_) {
603 604
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
605
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
606
        return isc::dhcp::Dhcp6Parser::make_USER(driver.loc_);
607
    default:
608
        return isc::dhcp::Dhcp6Parser::make_STRING("user", driver.loc_);
609 610 611 612 613
    }
}

\"password\" {
    switch(driver.ctx_) {
614 615
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
616
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
617
        return isc::dhcp::Dhcp6Parser::make_PASSWORD(driver.loc_);
618
    default:
619
        return isc::dhcp::Dhcp6Parser::make_STRING("password", driver.loc_);
620 621 622 623 624
    }
}

\"host\" {
    switch(driver.ctx_) {
625 626
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
627
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
628
        return isc::dhcp::Dhcp6Parser::make_HOST(driver.loc_);
629
    default:
630
        return isc::dhcp::Dhcp6Parser::make_STRING("host", driver.loc_);
631 632 633
    }
}

Francis Dupont's avatar
Francis Dupont committed
634 635 636 637
\"port\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
638
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
Francis Dupont's avatar
Francis Dupont committed
639 640 641 642 643 644
        return isc::dhcp::Dhcp6Parser::make_PORT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("port", driver.loc_);
    }
}

645 646
\"persist\" {
    switch(driver.ctx_) {
647 648
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
649
    case isc::dhcp::Parser6Context::SERVER_ID:
650
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
651
        return isc::dhcp::Dhcp6Parser::make_PERSIST(driver.loc_);
652
    default:
653
        return isc::dhcp::Dhcp6Parser::make_STRING("persist", driver.loc_);
654 655 656 657 658
    }
}

\"lfc-interval\" {
    switch(driver.ctx_) {
659 660
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
661
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
662
        return isc::dhcp::Dhcp6Parser::make_LFC_INTERVAL(driver.loc_);
663
    default:
664
        return isc::dhcp::Dhcp6Parser::make_STRING("lfc-interval", driver.loc_);
665 666 667
    }
}

668 669 670 671
\"connect-timeout\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
672
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
673 674 675 676 677 678
        return isc::dhcp::Dhcp6Parser::make_CONNECT_TIMEOUT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("connect-timeout", driver.loc_);
    }
}

679 680 681 682
\"keyspace\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
683
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
684 685 686 687 688 689
        return isc::dhcp::Dhcp6Parser::make_KEYSPACE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("keyspace", driver.loc_);
    }
}

Razvan Becheriu's avatar
Razvan Becheriu committed
690
\"consistency\" {
691 692 693 694
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
Razvan Becheriu's avatar
Razvan Becheriu committed
695
        return isc::dhcp::Dhcp6Parser::make_CONSISTENCY(driver.loc_);
696
    default:
Razvan Becheriu's avatar
Razvan Becheriu committed
697
        return isc::dhcp::Dhcp6Parser::make_STRING("consistency", driver.loc_);
698 699 700
    }
}

701 702 703 704 705 706 707 708 709 710 711
\"serial-consistency\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
        return isc::dhcp::Dhcp6Parser::make_SERIAL_CONSISTENCY(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("serial-consistency", driver.loc_);
    }
}

712 713 714 715
\"reconnect-wait-time\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
716
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
717 718 719 720 721 722 723 724 725 726
        return isc::dhcp::Dhcp6Parser::make_RECONNECT_WAIT_TIME(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("reconnect-wait-time", driver.loc_);
    }
}

\"request-timeout\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
727
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
728 729 730 731 732 733 734 735 736 737
        return isc::dhcp::Dhcp6Parser::make_REQUEST_TIMEOUT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("request-timeout", driver.loc_);
    }
}

\"tcp-keepalive\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
738
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
739 740 741 742 743 744 745 746 747 748
        return isc::dhcp::Dhcp6Parser::make_TCP_KEEPALIVE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("tcp-keepalive", driver.loc_);
    }
}

\"tcp-nodelay\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
749
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
750 751 752 753 754 755
        return isc::dhcp::Dhcp6Parser::make_TCP_NODELAY(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("tcp-nodelay", driver.loc_);
    }
}

756 757 758 759
\"contact-points\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
760
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
761 762 763 764 765 766
        return isc::dhcp::Dhcp6Parser::make_CONTACT_POINTS(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("contact-points", driver.loc_);
    }
}

767 768 769 770
\"max-reconnect-tries\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
771
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
772 773 774 775 776 777
        return isc::dhcp::Dhcp6Parser::make_MAX_RECONNECT_TRIES(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("max-reconnect-tries", driver.loc_);
    }
}

778 779 780
\"preferred-lifetime\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
781
    case isc::dhcp::Parser6Context::SUBNET6:
782
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
783
        return isc::dhcp::Dhcp6Parser::make_PREFERRED_LIFETIME(driver.loc_);
784
    default:
785
        return isc::dhcp::Dhcp6Parser::make_STRING("preferred-lifetime", driver.loc_);
786 787 788 789 790 791
    }
}

\"valid-lifetime\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
792
    case isc::dhcp::Parser6Context::SUBNET6:
793
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
794
        return isc::dhcp::Dhcp6Parser::make_VALID_LIFETIME(driver.loc_);
795
    default:
796
        return isc::dhcp::Dhcp6Parser::make_STRING("valid-lifetime", driver.loc_);
797 798 799 800 801 802
    }
}

\"renew-timer\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
803
    case isc::dhcp::Parser6Context::SUBNET6:
804
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
805
        return isc::dhcp::Dhcp6Parser::make_RENEW_TIMER(driver.loc_);
806
    default:
807
        return isc::dhcp::Dhcp6Parser::make_STRING("renew-timer", driver.loc_);
808 809 810 811 812 813
    }
}

\"rebind-timer\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
814
    case isc::dhcp::Parser6Context::SUBNET6:
815
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
816
        return isc::dhcp::Dhcp6Parser::make_REBIND_TIMER(driver.loc_);
817
    default:
818
        return isc::dhcp::Dhcp6Parser::make_STRING("rebind-timer", driver.loc_);
819 820 821
    }
}

822 823 824 825 826 827 828 829 830
\"decline-probation-period\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
        return isc::dhcp::Dhcp6Parser::make_DECLINE_PROBATION_PERIOD(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("decline-probation-period", driver.loc_);
    }
}

831 832 833 834 835 836 837 838 839
\"server-tag\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
        return isc::dhcp::Dhcp6Parser::make_SERVER_TAG(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("server-tag", driver.loc_);
    }
}

840 841 842
\"subnet6\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
843
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
844
        return isc::dhcp::Dhcp6Parser::make_SUBNET6(driver.loc_);
845
    default:
846
        return isc::dhcp::Dhcp6Parser::make_STRING("subnet6", driver.loc_);
847 848 849
    }
}

850 851
\"shared-networks\" {
    switch (driver.ctx_) {
852
    case isc::dhcp::Parser6Context::DHCP6:
853 854 855 856 857 858
        return Dhcp6Parser::make_SHARED_NETWORKS(driver.loc_);
    default:
        return Dhcp6Parser::make_STRING("shared-networks", driver.loc_);
    }
}

859 860 861 862 863 864 865 866 867
\"option-def\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
        return isc::dhcp::Dhcp6Parser::make_OPTION_DEF(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("option-def", driver.loc_);
    }
}

868 869 870 871 872 873 874 875
\"option-data\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
    case isc::dhcp::Parser6Context::SUBNET6:
    case isc::dhcp::Parser6Context::POOLS:
    case isc::dhcp::Parser6Context::PD_POOLS:
    case isc::dhcp::Parser6Context::RESERVATIONS:
    case isc::dhcp::Parser6Context::CLIENT_CLASSES:
876
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
877
        return isc::dhcp::Dhcp6Parser::make_OPTION_DATA(driver.loc_);
878
    default:
879
        return isc::dhcp::Dhcp6Parser::make_STRING("option-data", driver.loc_);
880 881 882 883 884
    }
}

\"name\" {
    switch(driver.ctx_) {
885 886
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
887
    case isc::dhcp::Parser6Context::OPTION_DEF:
888 889 890
    case isc::dhcp::Parser6Context::OPTION_DATA:
    case isc::dhcp::Parser6Context::CLIENT_CLASSES:
    case isc::dhcp::Parser6Context::LOGGERS:
891
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
892
    case isc::dhcp::Parser6Context::CONFIG_DATABASE:
893
        return isc::dhcp::Dhcp6Parser::make_NAME(driver.loc_);
894
    default:
895
        return isc::dhcp::Dhcp6Parser::make_STRING("name", driver.loc_);
896 897 898 899 900 901
    }
}

\"data\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DATA:
902
        return isc::dhcp::Dhcp6Parser::make_DATA(driver.loc_);
903
    default:
904
        return isc::dhcp::Dhcp6Parser::make_STRING("data", driver.loc_);
905 906 907
    }
}

908
\"always-send\" {
909 910
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DATA:
911
        return isc::dhcp::Dhcp6Parser::make_ALWAYS_SEND(driver.loc_);
912
    default:
913
        return isc::dhcp::Dhcp6Parser::make_STRING("always-send", driver.loc_);
914 915 916
    }
}

917 918 919
\"pools\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
920
        return isc::dhcp::Dhcp6Parser::make_POOLS(driver.loc_);
921
    default:
922
        return isc::dhcp::Dhcp6Parser::make_STRING("pools", driver.loc_);
923 924 925 926 927 928
    }
}

\"pd-pools\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
929
        return isc::dhcp::Dhcp6Parser::make_PD_POOLS(driver.loc_);
930
    default:
931
        return isc::dhcp::Dhcp6Parser::make_STRING("pd-pools", driver.loc_);
932 933 934 935 936 937
    }
}

\"prefix\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
938
        return isc::dhcp::Dhcp6Parser::make_PREFIX(driver.loc_);
939
    default:
940
        return isc::dhcp::Dhcp6Parser::make_STRING("prefix", driver.loc_);
941 942 943 944 945 946
    }
}

\"prefix-len\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
947
        return isc::dhcp::Dhcp6Parser::make_PREFIX_LEN(driver.loc_);
948
    default:
949
        return isc::dhcp::Dhcp6Parser::make_STRING("prefix-len", driver.loc_);
950 951 952
    }
}

953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970
\"excluded-prefix\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
        return isc::dhcp::Dhcp6Parser::make_EXCLUDED_PREFIX(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("excluded-prefix", driver.loc_);
    }
}

\"excluded-prefix-len\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
        return isc::dhcp::Dhcp6Parser::make_EXCLUDED_PREFIX_LEN(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("excluded-prefix-len", driver.loc_);
    }
}

971 972 973
\"delegated-len\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
974
        return isc::dhcp::Dhcp6Parser::make_DELEGATED_LEN(driver.loc_);
975
    default:
976
        return isc::dhcp::Dhcp6Parser::make_STRING("delegated-len", driver.loc_);
977 978 979 980 981 982
    }
}

\"pool\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::POOLS:
983
        return isc::dhcp::Dhcp6Parser::make_POOL(driver.loc_);
984
    default:
985
        return isc::dhcp::Dhcp6Parser::make_STRING("pool", driver.loc_);
986 987 988
    }
}

989 990
\"user-context\" {
    switch(driver.ctx_) {
991
    case isc::dhcp::Parser6Context::DHCP6:
Francis Dupont's avatar
Francis Dupont committed
992
    case isc::dhcp::Parser6Context::INTERFACES_CONFIG:
993
    case isc::dhcp::Parser6Context::SUBNET6:
994
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
995
    case isc::dhcp::Parser6Context::OPTION_DEF:
996
    case isc::dhcp::Parser6Context::OPTION_DATA:
997
    case isc::dhcp::Parser6Context::CLIENT_CLASSES:
Francis Dupont's avatar
Francis Dupont committed
998
    case isc::dhcp::Parser6Context::SERVER_ID:
999
    case isc::dhcp::Parser6Context::CONTROL_SOCKET:
1000 1001
    case isc::dhcp::Parser6Context::POOLS:
    case isc::dhcp::Parser6Context::PD_POOLS:
Francis Dupont's avatar
Francis Dupont committed
1002 1003 1004
    case isc::dhcp::Parser6Context::RESERVATIONS:
    case isc::dhcp::Parser6Context::LOGGERS:
    case isc::dhcp::Parser6Context::DHCP_DDNS:
1005 1006 1007 1008 1009 1010
        return isc::dhcp::Dhcp6Parser::make_USER_CONTEXT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("user-context", driver.loc_);
    }
}

1011 1012
\"comment\" {
    switch(driver.ctx_) {
1013
    case isc::dhcp::Parser6Context::DHCP6:
Francis Dupont's avatar
Francis Dupont committed
1014
    case isc::dhcp::Parser6Context::INTERFACES_CONFIG:
1015
    case isc::dhcp::Parser6Context::SUBNET6:
1016
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
1017
    case isc::dhcp::Parser6Context::OPTION_DEF:
1018
    case isc::dhcp::Parser6Context::OPTION_DATA:
1019
    case isc::dhcp::Parser6Context::CLIENT_CLASSES:
Francis Dupont's avatar
Francis Dupont committed
1020
    case isc::dhcp::Parser6Context::SERVER_ID:
1021
    case isc::dhcp::Parser6Context::CONTROL_SOCKET:
Francis Dupont's avatar
Francis Dupont committed
1022 1023 1024 1025 1026
    case isc::dhcp::Parser6Context::POOLS:
    case isc::dhcp::Parser6Context::PD_POOLS:
    case isc::dhcp::Parser6Context::RESERVATIONS:
    case isc::dhcp::Parser6Context::LOGGERS:
    case isc::dhcp::Parser6Context::DHCP_DDNS:
1027 1028 1029 1030 1031 1032
        return isc::dhcp::Dhcp6Parser::make_COMMENT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("comment", driver.loc_);
    }
}

1033 1034 1035
\"subnet\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
1036
        return isc::dhcp::Dhcp6Parser::make_SUBNET(driver.loc_);
1037
    default:
1038
        return isc::dhcp::Dhcp6Parser::make_STRING("subnet", driver.loc_);
1039 1040 1041 1042 1043 1044
    }
}

\"interface\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
1045
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
1046
        return isc::dhcp::Dhcp6Parser::make_INTERFACE(driver.loc_);
1047
    default:
1048
        return isc::dhcp::Dhcp6Parser::make_STRING("interface", driver.loc_);
1049 1050 1051
    }
}

1052 1053 1054
\"interface-id\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
1055
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
1056 1057 1058 1059 1060 1061
        return isc::dhcp::Dhcp6Parser::make_INTERFACE_ID(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("interface-id", driver.loc_);
    }
}

1062 1063 1064
\"id\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
1065
        return isc::dhcp::Dhcp6Parser::make_ID(driver.loc_);
1066
    default:
1067
        return isc::dhcp::Dhcp6Parser::make_STRING("id", driver.loc_);
1068 1069 1070
    }
}

1071 1072 1073
\"rapid-commit\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
1074
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
1075 1076 1077 1078 1079 1080 1081 1082
        return isc::dhcp::Dhcp6Parser::make_RAPID_COMMIT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("rapid-commit", driver.loc_);
    }
}

\"reservation-mode\" {
    switch(driver.ctx_) {
1083
    case isc::dhcp::Parser6Context::DHCP6:
1084
    case isc::dhcp::Parser6Context::SUBNET6:
1085
    case isc::dhcp::Parser6Context::SHARED_NETWORK:
1086 1087 1088 1089 1090 1091
        return isc::dhcp::Dhcp6Parser::make_RESERVATION_MODE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("reservation-mode", driver.loc_);
    }
}

1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118
\"disabled\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATION_MODE:
        return isc::dhcp::Dhcp6Parser::make_DISABLED(driver.loc_);
    default: