dhcp6_lexer.ll 52 KB
Newer Older
1
/* Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
2 3 4 5 6 7 8 9 10 11 12 13 14

   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++ -*- */
#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
15
#include <exceptions/exceptions.h>
16

17 18 19 20 21 22
/* 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>. */
23 24 25
# undef yywrap
# define yywrap() 1

Francis Dupont's avatar
Francis Dupont committed
26 27 28 29 30
namespace {

bool start_token_flag = false;

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

33 34
using namespace isc::dhcp;

Francis Dupont's avatar
Francis Dupont committed
35
};
36

37
/* To avoid the call to exit... oops! */
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#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

54 55 56
/* avoid to get static global variables to remain with C++. */
/* in last resort %option reentrant */

57 58 59 60 61 62 63 64 65
/* 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
66
%x COMMENT
Francis Dupont's avatar
Francis Dupont committed
67
%x DIR_ENTER DIR_INCLUDE DIR_EXIT
Tomek Mrugalski's avatar
Tomek Mrugalski committed
68

69 70 71 72
/* 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]+
73
blank [ \t\r]
74

75 76 77 78 79 80
UnicodeEscapeSequence           u[0-9A-Fa-f]{4}
JSONEscapeCharacter             ["\\/bfnrt]
JSONEscapeSequence              {JSONEscapeCharacter}|{UnicodeEscapeSequence}
JSONStandardCharacter           [^\x00-\x1f"\\]
JSONStringCharacter             {JSONStandardCharacter}|\\{JSONEscapeSequence}
JSONString                      \"{JSONStringCharacter}*\"
81

82 83 84 85 86 87
/* for errors */

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

%{
90 91 92
/* 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. */
93
#define YY_USER_ACTION  driver.loc_.columns(yyleng);
94 95 96 97 98
%}

%%

%{
99 100 101
    /* 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 */
102

103
    /* Code run each time yylex is called. */
104
    driver.loc_.step();
Tomek Mrugalski's avatar
Tomek Mrugalski committed
105

106 107 108
    if (start_token_flag) {
        start_token_flag = false;
        switch (start_token_value) {
109
        case Parser6Context::PARSER_JSON:
110
        default:
111
            return isc::dhcp::Dhcp6Parser::make_TOPLEVEL_JSON(driver.loc_);
112
        case Parser6Context::PARSER_DHCP6:
113
            return isc::dhcp::Dhcp6Parser::make_TOPLEVEL_DHCP6(driver.loc_);
114 115
        case Parser6Context::SUBPARSER_DHCP6:
            return isc::dhcp::Dhcp6Parser::make_SUB_DHCP6(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
116
        case Parser6Context::PARSER_INTERFACES:
117
            return isc::dhcp::Dhcp6Parser::make_SUB_INTERFACES6(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
118
        case Parser6Context::PARSER_SUBNET6:
119
            return isc::dhcp::Dhcp6Parser::make_SUB_SUBNET6(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
120
        case Parser6Context::PARSER_POOL6:
121
            return isc::dhcp::Dhcp6Parser::make_SUB_POOL6(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
122
        case Parser6Context::PARSER_PD_POOL:
123
            return isc::dhcp::Dhcp6Parser::make_SUB_PD_POOL(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
124
        case Parser6Context::PARSER_HOST_RESERVATION:
125
            return isc::dhcp::Dhcp6Parser::make_SUB_RESERVATION(driver.loc_);
Francis Dupont's avatar
Francis Dupont committed
126 127 128 129
        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
130
        case Parser6Context::PARSER_OPTION_DATA:
131
            return isc::dhcp::Dhcp6Parser::make_SUB_OPTION_DATA(driver.loc_);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
132
        case Parser6Context::PARSER_HOOKS_LIBRARY:
133
            return isc::dhcp::Dhcp6Parser::make_SUB_HOOKS_LIBRARY(driver.loc_);
134 135
        case Parser6Context::PARSER_DHCP_DDNS:
            return isc::dhcp::Dhcp6Parser::make_SUB_DHCP_DDNS(driver.loc_);
136 137
        }
    }
138 139
%}

Tomek Mrugalski's avatar
Tomek Mrugalski committed
140 141 142 143 144 145
#.* ;

"//"(.*) ;

"/*" {
  BEGIN(COMMENT);
146
  comment_start_line = driver.loc_.end.line;;
Tomek Mrugalski's avatar
Tomek Mrugalski committed
147 148 149
}

<COMMENT>"*/" BEGIN(INITIAL);
150
<COMMENT>. ;
Tomek Mrugalski's avatar
Tomek Mrugalski committed
151
<COMMENT><<EOF>> {
152
    isc_throw(Dhcp6ParseError, "Comment not closed. (/* in line " << comment_start_line);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
153 154
}

Francis Dupont's avatar
Francis Dupont committed
155 156 157
"<?" BEGIN(DIR_ENTER);
<DIR_ENTER>"include" BEGIN(DIR_INCLUDE);
<DIR_INCLUDE>\"([^\"\n])+\" {
158
    /* Include directive. */
Francis Dupont's avatar
Francis Dupont committed
159

160
    /* Extract the filename. */
Francis Dupont's avatar
Francis Dupont committed
161 162 163
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);

164
    driver.includeFile(tmp);
Francis Dupont's avatar
Francis Dupont committed
165
}
166
<DIR_ENTER,DIR_INCLUDE,DIR_EXIT><<EOF>> {
167
    isc_throw(Dhcp6ParseError, "Directive not closed.");
168
}
Francis Dupont's avatar
Francis Dupont committed
169
<DIR_EXIT>"?>" BEGIN(INITIAL);
170

Francis Dupont's avatar
Francis Dupont committed
171

172
<*>{blank}+   {
173
    /* Ok, we found a with space. Let's ignore it and update loc variable. */
174
    driver.loc_.step();
175
}
176

177
<*>[\n]+      {
178
    /* Newline found. Let's update the location and continue. */
179 180
    driver.loc_.lines(yyleng);
    driver.loc_.step();
181 182
}

183

184 185 186 187 188 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 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 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 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399
\"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_);
    }
}

\"always-include-fqdn\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP_DDNS:
        return isc::dhcp::Dhcp6Parser::make_ALWAYS_INCLUDE_FQDN(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("always-include-fqdn", 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_);
    }
}

(?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_);
}

(?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_);
}

400 401 402
\"Dhcp6\"  {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CONFIG:
403
        return isc::dhcp::Dhcp6Parser::make_DHCP6(driver.loc_);
404
    default:
405
        return isc::dhcp::Dhcp6Parser::make_STRING("Dhcp6", driver.loc_);
406 407 408 409 410 411
    }
}

\"interfaces-config\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
412
        return  isc::dhcp::Dhcp6Parser::make_INTERFACES_CONFIG(driver.loc_);
413
    default:
414
        return isc::dhcp::Dhcp6Parser::make_STRING("interfaces-config", driver.loc_);
415 416 417 418 419 420
    }
}

\"interfaces\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::INTERFACES_CONFIG:
421
        return  isc::dhcp::Dhcp6Parser::make_INTERFACES(driver.loc_);
422
    default:
423
        return isc::dhcp::Dhcp6Parser::make_STRING("interfaces", driver.loc_);
424 425 426
    }
}

427 428 429 430 431 432 433 434 435
\"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_);
    }
}

436 437 438
\"lease-database\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
439
        return isc::dhcp::Dhcp6Parser::make_LEASE_DATABASE(driver.loc_);
440
    default:
441
        return isc::dhcp::Dhcp6Parser::make_STRING("lease-database", driver.loc_);
442 443 444 445 446 447
    }
}

\"hosts-database\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
448
        return isc::dhcp::Dhcp6Parser::make_HOSTS_DATABASE(driver.loc_);
449
    default:
450
        return isc::dhcp::Dhcp6Parser::make_STRING("hosts-database", driver.loc_);
451 452 453
    }
}

454 455 456 457 458 459 460 461 462
\"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_);
    }
}

463 464
\"type\" {
    switch(driver.ctx_) {
465 466
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
467
    case isc::dhcp::Parser6Context::OPTION_DEF:
468
    case isc::dhcp::Parser6Context::SERVER_ID:
469
        return isc::dhcp::Dhcp6Parser::make_TYPE(driver.loc_);
470
    default:
471
        return isc::dhcp::Dhcp6Parser::make_STRING("type", driver.loc_);
472 473 474
    }
}

475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
\"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_);
    }
}

502 503 504 505 506 507 508 509 510
\"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_);
    }
}

511 512
\"user\" {
    switch(driver.ctx_) {
513 514
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
515
        return isc::dhcp::Dhcp6Parser::make_USER(driver.loc_);
516
    default:
517
        return isc::dhcp::Dhcp6Parser::make_STRING("user", driver.loc_);
518 519 520 521 522
    }
}

\"password\" {
    switch(driver.ctx_) {
523 524
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
525
        return isc::dhcp::Dhcp6Parser::make_PASSWORD(driver.loc_);
526
    default:
527
        return isc::dhcp::Dhcp6Parser::make_STRING("password", driver.loc_);
528 529 530 531 532
    }
}

\"host\" {
    switch(driver.ctx_) {
533 534
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
535
        return isc::dhcp::Dhcp6Parser::make_HOST(driver.loc_);
536
    default:
537
        return isc::dhcp::Dhcp6Parser::make_STRING("host", driver.loc_);
538 539 540
    }
}

Francis Dupont's avatar
Francis Dupont committed
541 542 543 544 545 546 547 548 549 550
\"port\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
        return isc::dhcp::Dhcp6Parser::make_PORT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("port", driver.loc_);
    }
}

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

\"lfc-interval\" {
    switch(driver.ctx_) {
564 565
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
566
        return isc::dhcp::Dhcp6Parser::make_LFC_INTERVAL(driver.loc_);
567
    default:
568
        return isc::dhcp::Dhcp6Parser::make_STRING("lfc-interval", driver.loc_);
569 570 571
    }
}

572 573 574 575 576 577 578 579 580 581
\"connect-timeout\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
        return isc::dhcp::Dhcp6Parser::make_CONNECT_TIMEOUT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("connect-timeout", driver.loc_);
    }
}

582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601
\"keyspace\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
        return isc::dhcp::Dhcp6Parser::make_KEYSPACE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("keyspace", driver.loc_);
    }
}

\"contact-points\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
        return isc::dhcp::Dhcp6Parser::make_CONTACT_POINTS(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("contact-points", driver.loc_);
    }
}

602 603 604
\"preferred-lifetime\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
605
    case isc::dhcp::Parser6Context::SUBNET6:
606
    case Parser6Context::SHARED_NETWORK:
607
        return isc::dhcp::Dhcp6Parser::make_PREFERRED_LIFETIME(driver.loc_);
608
    default:
609
        return isc::dhcp::Dhcp6Parser::make_STRING("preferred-lifetime", driver.loc_);
610 611 612 613 614 615
    }
}

\"valid-lifetime\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
616
    case isc::dhcp::Parser6Context::SUBNET6:
617
    case Parser6Context::SHARED_NETWORK:
618
        return isc::dhcp::Dhcp6Parser::make_VALID_LIFETIME(driver.loc_);
619
    default:
620
        return isc::dhcp::Dhcp6Parser::make_STRING("valid-lifetime", driver.loc_);
621 622 623 624 625 626
    }
}

\"renew-timer\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
627
    case isc::dhcp::Parser6Context::SUBNET6:
628
    case Parser6Context::SHARED_NETWORK:
629
        return isc::dhcp::Dhcp6Parser::make_RENEW_TIMER(driver.loc_);
630
    default:
631
        return isc::dhcp::Dhcp6Parser::make_STRING("renew-timer", driver.loc_);
632 633 634 635 636 637
    }
}

\"rebind-timer\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
638
    case isc::dhcp::Parser6Context::SUBNET6:
639
    case Parser6Context::SHARED_NETWORK:
640
        return isc::dhcp::Dhcp6Parser::make_REBIND_TIMER(driver.loc_);
641
    default:
642
        return isc::dhcp::Dhcp6Parser::make_STRING("rebind-timer", driver.loc_);
643 644 645
    }
}

646 647 648 649 650 651 652 653 654
\"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_);
    }
}

655 656 657
\"subnet6\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
658
    case Parser6Context::SHARED_NETWORK:
659
        return isc::dhcp::Dhcp6Parser::make_SUBNET6(driver.loc_);
660
    default:
661
        return isc::dhcp::Dhcp6Parser::make_STRING("subnet6", driver.loc_);
662 663 664
    }
}

665 666 667 668 669 670 671 672 673
\"shared-networks\" {
    switch (driver.ctx_) {
    case Parser6Context::DHCP6:
        return Dhcp6Parser::make_SHARED_NETWORKS(driver.loc_);
    default:
        return Dhcp6Parser::make_STRING("shared-networks", driver.loc_);
    }
}

674 675 676 677 678 679 680 681 682
\"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_);
    }
}

683 684 685 686 687 688 689 690 691
\"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:
    case isc::dhcp::Parser6Context::CLIENT_CLASS:
692
    case Parser6Context::SHARED_NETWORK:
693
        return isc::dhcp::Dhcp6Parser::make_OPTION_DATA(driver.loc_);
694
    default:
695
        return isc::dhcp::Dhcp6Parser::make_STRING("option-data", driver.loc_);
696 697 698 699 700
    }
}

\"name\" {
    switch(driver.ctx_) {
701 702
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
703
    case isc::dhcp::Parser6Context::OPTION_DEF:
704 705 706 707
    case isc::dhcp::Parser6Context::OPTION_DATA:
    case isc::dhcp::Parser6Context::CLIENT_CLASSES:
    case isc::dhcp::Parser6Context::CLIENT_CLASS:
    case isc::dhcp::Parser6Context::LOGGERS:
708
    case Parser6Context::SHARED_NETWORK:
709
        return isc::dhcp::Dhcp6Parser::make_NAME(driver.loc_);
710
    default:
711
        return isc::dhcp::Dhcp6Parser::make_STRING("name", driver.loc_);
712 713 714 715 716 717
    }
}

\"data\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DATA:
718
        return isc::dhcp::Dhcp6Parser::make_DATA(driver.loc_);
719
    default:
720
        return isc::dhcp::Dhcp6Parser::make_STRING("data", driver.loc_);
721 722 723
    }
}

724
\"always-send\" {
725 726
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DATA:
727
        return isc::dhcp::Dhcp6Parser::make_ALWAYS_SEND(driver.loc_);
728
    default:
729
        return isc::dhcp::Dhcp6Parser::make_STRING("always-send", driver.loc_);
730 731 732
    }
}

733 734 735
\"pools\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
736
        return isc::dhcp::Dhcp6Parser::make_POOLS(driver.loc_);
737
    default:
738
        return isc::dhcp::Dhcp6Parser::make_STRING("pools", driver.loc_);
739 740 741 742 743 744
    }
}

\"pd-pools\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
745
        return isc::dhcp::Dhcp6Parser::make_PD_POOLS(driver.loc_);
746
    default:
747
        return isc::dhcp::Dhcp6Parser::make_STRING("pd-pools", driver.loc_);
748 749 750 751 752 753
    }
}

\"prefix\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
754
        return isc::dhcp::Dhcp6Parser::make_PREFIX(driver.loc_);
755
    default:
756
        return isc::dhcp::Dhcp6Parser::make_STRING("prefix", driver.loc_);
757 758 759 760 761 762
    }
}

\"prefix-len\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
763
        return isc::dhcp::Dhcp6Parser::make_PREFIX_LEN(driver.loc_);
764
    default:
765
        return isc::dhcp::Dhcp6Parser::make_STRING("prefix-len", driver.loc_);
766 767 768
    }
}

769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786
\"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_);
    }
}

787 788 789
\"delegated-len\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
790
        return isc::dhcp::Dhcp6Parser::make_DELEGATED_LEN(driver.loc_);
791
    default:
792
        return isc::dhcp::Dhcp6Parser::make_STRING("delegated-len", driver.loc_);
793 794 795 796 797 798
    }
}

\"pool\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::POOLS:
799
        return isc::dhcp::Dhcp6Parser::make_POOL(driver.loc_);
800
    default:
801
        return isc::dhcp::Dhcp6Parser::make_STRING("pool", driver.loc_);
802 803 804
    }
}

805 806 807 808
\"user-context\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::POOLS:
    case isc::dhcp::Parser6Context::PD_POOLS:
809
    case isc::dhcp::Parser6Context::SUBNET6:
810 811 812 813 814 815
        return isc::dhcp::Dhcp6Parser::make_USER_CONTEXT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("user-context", driver.loc_);
    }
}

816 817 818
\"subnet\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
819
        return isc::dhcp::Dhcp6Parser::make_SUBNET(driver.loc_);
820
    default:
821
        return isc::dhcp::Dhcp6Parser::make_STRING("subnet", driver.loc_);
822 823 824 825 826 827
    }
}

\"interface\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
828
    case Parser6Context::SHARED_NETWORK:
829
        return isc::dhcp::Dhcp6Parser::make_INTERFACE(driver.loc_);
830
    default:
831
        return isc::dhcp::Dhcp6Parser::make_STRING("interface", driver.loc_);
832 833 834
    }
}

835 836 837
\"interface-id\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
838
    case Parser6Context::SHARED_NETWORK:
839 840 841 842 843 844
        return isc::dhcp::Dhcp6Parser::make_INTERFACE_ID(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("interface-id", driver.loc_);
    }
}

845 846 847
\"id\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
848
        return isc::dhcp::Dhcp6Parser::make_ID(driver.loc_);
849
    default:
850
        return isc::dhcp::Dhcp6Parser::make_STRING("id", driver.loc_);
851 852 853
    }
}

854 855 856
\"rapid-commit\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
857
    case Parser6Context::SHARED_NETWORK:
858 859 860 861 862 863 864 865 866
        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_) {
    case isc::dhcp::Parser6Context::SUBNET6:
867
    case Parser6Context::SHARED_NETWORK:
868 869 870 871 872 873
        return isc::dhcp::Dhcp6Parser::make_RESERVATION_MODE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("reservation-mode", driver.loc_);
    }
}

874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909
\"disabled\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATION_MODE:
        return isc::dhcp::Dhcp6Parser::make_DISABLED(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("disabled", driver.loc_);
    }
}

\"off\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATION_MODE:
        return isc::dhcp::Dhcp6Parser::make_DISABLED(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("off", driver.loc_);
    }
}

\"out-of-pool\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATION_MODE:
        return isc::dhcp::Dhcp6Parser::make_OUT_OF_POOL(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("out-of-pool", driver.loc_);
    }
}

\"all\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATION_MODE:
        return isc::dhcp::Dhcp6Parser::make_ALL(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("all", driver.loc_);
    }
}

910 911
\"code\" {
    switch(driver.ctx_) {
912
    case isc::dhcp::Parser6Context::OPTION_DEF:
913
    case isc::dhcp::Parser6Context::OPTION_DATA:
914
        return isc::dhcp::Dhcp6Parser::make_CODE(driver.loc_);
915
    default:
916
        return isc::dhcp::Dhcp6Parser::make_STRING("code", driver.loc_);
917 918 919 920 921 922
    }
}

\"mac-sources\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
923
        return isc::dhcp::Dhcp6Parser::make_MAC_SOURCES(driver.loc_);
924
    default:
925
        return isc::dhcp::Dhcp6Parser::make_STRING("mac-sources", driver.loc_);
926 927 928 929 930 931
    }
}

\"relay-supplied-options\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
932
        return isc::dhcp::Dhcp6Parser::make_RELAY_SUPPLIED_OPTIONS(driver.loc_);
933
    default:
934
        return isc::dhcp::Dhcp6Parser::make_STRING("relay-supplied-options", driver.loc_);
935 936 937 938 939 940
    }
}

\"host-reservation-identifiers\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
941
        return isc::dhcp::Dhcp6Parser::make_HOST_RESERVATION_IDENTIFIERS(driver.loc_);
942
    default:
943
        return isc::dhcp::Dhcp6Parser::make_STRING("host-reservation-identifiers", driver.loc_);
944 945 946 947 948 949
    }
}

\"Logging\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CONFIG:
950
        return isc::dhcp::Dhcp6Parser::make_LOGGING(driver.loc_);
951
    default:
952
        return isc::dhcp::Dhcp6Parser::make_STRING("Logging", driver.loc_);
953 954 955 956 957 958
    }
}

\"loggers\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LOGGING:
959
        return isc::dhcp::Dhcp6Parser::make_LOGGERS(driver.loc_);
960
    default:
961
        return isc::dhcp::Dhcp6Parser::make_STRING("loggers", driver.loc_);
962 963 964 965 966 967
    }
}

\"output_options\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LOGGERS:
968
        return isc::dhcp::Dhcp6Parser::make_OUTPUT_OPTIONS(driver.loc_);
969
    default:
970
        return isc::dhcp::Dhcp6Parser::make_STRING("output_options", driver.loc_);
971 972 973 974 975 976
    }
}

\"output\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OUTPUT_OPTIONS:
977
        return isc::dhcp::Dhcp6Parser::make_OUTPUT(driver.loc_);
978
    default:
979
        return isc::dhcp::Dhcp6Parser::make_STRING("output", driver.loc_);
980 981 982
    }
}

983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
\"flush\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OUTPUT_OPTIONS:
        return isc::dhcp::Dhcp6Parser::make_FLUSH(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("flush", driver.loc_);
    }
}

\"maxsize\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OUTPUT_OPTIONS:
        return isc::dhcp::Dhcp6Parser::make_MAXSIZE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("maxsize", driver.loc_);
    }
}

\"maxver\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OUTPUT_OPTIONS:
        return isc::dhcp::Dhcp6Parser::make_MAXVER(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("maxver", driver.loc_);
    }
}


1011 1012 1013
\"debuglevel\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LOGGERS:
1014
        return isc::dhcp::Dhcp6Parser::make_DEBUGLEVEL(driver.loc_);
1015
    default:
1016
        return isc::dhcp::Dhcp6Parser::make_STRING("debuglevel", driver.loc_);
1017 1018 1019 1020 1021 1022
    }
}

\"severity\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LOGGERS:
1023
        return isc::dhcp::Dhcp6Parser::make_SEVERITY(driver.loc_);
1024
    default:
1025
        return isc::dhcp::Dhcp6Parser::make_STRING("severity", driver.loc_);
1026 1027 1028 1029 1030 1031 1032
    }
}

\"client-classes\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
    case isc::dhcp::Parser6Context::RESERVATIONS:
1033
        return isc::dhcp::Dhcp6Parser::make_CLIENT_CLASSES(driver.loc_);
1034
    default:
1035
        return isc::dhcp::Dhcp6Parser::make_STRING("client-classes", driver.loc_);
1036 1037 1038 1039 1040 1041 1042
    }
}

\"client-class\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
    case isc::dhcp::Parser6Context::CLIENT_CLASSES:
1043
        return isc::dhcp::Dhcp6Parser::make_CLIENT_CLASS(driver.loc_);
1044
    default:
1045
        return isc::dhcp::Dhcp6Parser::make_STRING("client-class", driver.loc_);
1046 1047 1048 1049 1050 1051 1052
    }
}

\"test\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CLIENT_CLASSES:
    case isc::dhcp::Parser6Context::CLIENT_CLASS:
1053
        return isc::dhcp::Dhcp6Parser::make_TEST(driver.loc_);
1054
    default:
1055
        return isc::dhcp::Dhcp6Parser::make_STRING("test", driver.loc_);
1056 1057 1058 1059 1060 1061
    }
}

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

\"ip-addresses\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATIONS:
1071
        return isc::dhcp::Dhcp6Parser::make_IP_ADDRESSES(driver.loc_);
1072
    default:
1073
        return isc::dhcp::Dhcp6Parser::make_STRING("ip-addresses", driver.loc_);
1074 1075 1076 1077 1078 1079
    }
}

\"prefixes\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATIONS:
1080
        return isc::dhcp::Dhcp6Parser::make_PREFIXES(driver.loc_);
1081
    default:
1082
        return isc::dhcp::Dhcp6Parser::make_STRING("prefixes", driver.loc_);
1083 1084 1085 1086 1087 1088 1089 1090
    }
}

\"duid\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::MAC_SOURCES:
    case isc::dhcp::Parser6Context::HOST_RESERVATION_IDENTIFIERS:
    case isc::dhcp::Parser6Context::RESERVATIONS:
1091
        return isc::dhcp::Dhcp6Parser::make_DUID(driver.loc_);
1092
    default:
1093
        return isc::dhcp::Dhcp6Parser::make_STRING("duid", driver.loc_);
1094 1095 1096 1097 1098 1099 1100
    }
}

\"hw-address\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::HOST_RESERVATION_IDENTIFIERS:
    case isc::dhcp::Parser6Context::RESERVATIONS:
1101
        return isc::dhcp::Dhcp6Parser::make_HW_ADDRESS(driver.loc_);
1102
    default:
1103
        return isc::dhcp::Dhcp6Parser::make_STRING("hw-address", driver.loc_);
1104 1105 1106 1107 1108 1109
    }
}

\"hostname\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATIONS:
1110
        return isc::dhcp::Dhcp6Parser::make_HOSTNAME(driver.loc_);
1111
    default:
1112
        return isc::dhcp::Dhcp6Parser::make_STRING("hostname", driver.loc_);
1113 1114 1115
    }
}

1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
\"flex-id\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::HOST_RESERVATION_IDENTIFIERS:
    case isc::dhcp::Parser6Context::RESERVATIONS:
        return isc::dhcp::Dhcp6Parser::make_FLEX_ID(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("flex-id", driver.loc_);
    }
}

1126 1127
\"space\" {
    switch(driver.ctx_) {
1128
    case isc::dhcp::Parser6Context::OPTION_DEF:
1129
    case isc::dhcp::Parser6Context::OPTION_DATA:
1130
        return isc::dhcp::Dhcp6Parser::make_SPACE(driver.loc_);
1131
    default:
1132
        return isc::dhcp::Dhcp6Parser::make_STRING("space", driver.loc_);
1133 1134 1135 1136 1137 1138
    }
}

\"csv-format\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DATA:
1139
        return isc::dhcp::Dhcp6Parser::make_CSV_FORMAT(driver.loc_);
1140
    default:
1141
        return isc::dhcp::Dhcp6Parser::make_STRING("csv-format", driver.loc_);
1142 1143 1144
    }
}

1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174
\"record-types\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DEF:
        return isc::dhcp::Dhcp6Parser::make_RECORD_TYPES(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("record-types", driver.loc_);
    }
}

\"encapsulate\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DEF:
        return isc::dhcp::Dhcp6Parser::make_ENCAPSULATE(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("encapsulate", driver.loc_);
    }
}

\"array\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DEF:
        return isc::dhcp::Dhcp6Parser::make_ARRAY(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("array", driver.loc_);
    }
}

\"relay\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
1175
    case Parser6Context::SHARED_NETWORK:
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190
        return isc::dhcp::Dhcp6Parser::make_RELAY(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("relay", driver.loc_);
    }
}

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

1191 1192 1193
\"hooks-libraries\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
1194
        return isc::dhcp::Dhcp6Parser::make_HOOKS_LIBRARIES(driver.loc_);
1195
    default:
1196
        return isc::dhcp::Dhcp6Parser::make_STRING("hooks-libraries", driver.loc_);
1197 1198 1199
    }
}

1200 1201 1202 1203 1204 1205 1206 1207 1208 1209

\"parameters\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::HOOKS_LIBRARIES:
        return isc::dhcp::Dhcp6Parser::make_PARAMETERS(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("parameters", driver.loc_);
    }
}

1210 1211 1212
\"library\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::HOOKS_LIBRARIES:
1213
        return isc::dhcp::Dhcp6Parser::make_LIBRARY(driver.loc_);
1214
    default:
1215
        return isc::dhcp::Dhcp6Parser::make_STRING("library", driver.loc_);
1216 1217 1218 1219 1220 1221
    }
}

\"server-id\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
1222
        return isc::dhcp::Dhcp6Parser::make_SERVER_ID(driver.loc_);
1223
    default:
1224
        return isc::dhcp::Dhcp6Parser::make_STRING("server-id", driver.loc_);