dhcp6_lexer.ll 52.1 KB
Newer Older
1
/* Copyright (C) 2016-2017 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
        }
    }
142 143
%}

Tomek Mrugalski's avatar
Tomek Mrugalski committed
144 145 146 147 148 149
#.* ;

"//"(.*) ;

"/*" {
  BEGIN(COMMENT);
150
  comment_start_line = driver.loc_.end.line;;
Tomek Mrugalski's avatar
Tomek Mrugalski committed
151 152 153
}

<COMMENT>"*/" BEGIN(INITIAL);
154
<COMMENT>. ;
Tomek Mrugalski's avatar
Tomek Mrugalski committed
155
<COMMENT><<EOF>> {
156
    isc_throw(Dhcp6ParseError, "Comment not closed. (/* in line " << comment_start_line);
Tomek Mrugalski's avatar
Tomek Mrugalski committed
157 158
}

Francis Dupont's avatar
Francis Dupont committed
159 160 161
"<?" BEGIN(DIR_ENTER);
<DIR_ENTER>"include" BEGIN(DIR_INCLUDE);
<DIR_INCLUDE>\"([^\"\n])+\" {
162
    /* Include directive. */
Francis Dupont's avatar
Francis Dupont committed
163

164
    /* Extract the filename. */
Francis Dupont's avatar
Francis Dupont committed
165 166 167
    std::string tmp(yytext+1);
    tmp.resize(tmp.size() - 1);

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

Francis Dupont's avatar
Francis Dupont committed
175

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

181
<*>[\n]+      {
182
    /* Newline found. Let's update the location and continue. */
183 184
    driver.loc_.lines(yyleng);
    driver.loc_.step();
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 400 401 402 403
\"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_);
}

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

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

\"interfaces\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::INTERFACES_CONFIG:
425
        return  isc::dhcp::Dhcp6Parser::make_INTERFACES(driver.loc_);
426
    default:
427
        return isc::dhcp::Dhcp6Parser::make_STRING("interfaces", driver.loc_);
428 429 430
    }
}

431 432 433 434 435 436 437 438 439
\"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_);
    }
}

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

\"hosts-database\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
452
        return isc::dhcp::Dhcp6Parser::make_HOSTS_DATABASE(driver.loc_);
453
    default:
454
        return isc::dhcp::Dhcp6Parser::make_STRING("hosts-database", driver.loc_);
455 456 457
    }
}

458 459 460 461 462 463 464 465 466
\"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_);
    }
}

467 468
\"type\" {
    switch(driver.ctx_) {
469 470
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
471
    case isc::dhcp::Parser6Context::OPTION_DEF:
472
    case isc::dhcp::Parser6Context::SERVER_ID:
473
        return isc::dhcp::Dhcp6Parser::make_TYPE(driver.loc_);
474
    default:
475
        return isc::dhcp::Dhcp6Parser::make_STRING("type", driver.loc_);
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 502 503 504 505
\"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_);
    }
}

506 507 508 509 510 511 512 513 514
\"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_);
    }
}

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

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

\"host\" {
    switch(driver.ctx_) {
537 538
    case isc::dhcp::Parser6Context::LEASE_DATABASE:
    case isc::dhcp::Parser6Context::HOSTS_DATABASE:
539
        return isc::dhcp::Dhcp6Parser::make_HOST(driver.loc_);
540
    default:
541
        return isc::dhcp::Dhcp6Parser::make_STRING("host", driver.loc_);
542 543 544
    }
}

Francis Dupont's avatar
Francis Dupont committed
545 546 547 548 549 550 551 552 553 554
\"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_);
    }
}

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

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

576 577 578 579 580 581 582 583 584 585
\"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_);
    }
}

586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605
\"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_);
    }
}

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

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

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

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

650 651 652 653 654 655 656 657 658
\"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_);
    }
}

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

669 670 671 672 673 674 675 676 677
\"shared-networks\" {
    switch (driver.ctx_) {
    case Parser6Context::DHCP6:
        return Dhcp6Parser::make_SHARED_NETWORKS(driver.loc_);
    default:
        return Dhcp6Parser::make_STRING("shared-networks", driver.loc_);
    }
}

678 679 680 681 682 683 684 685 686
\"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_);
    }
}

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

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

\"data\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DATA:
722
        return isc::dhcp::Dhcp6Parser::make_DATA(driver.loc_);
723
    default:
724
        return isc::dhcp::Dhcp6Parser::make_STRING("data", driver.loc_);
725 726 727
    }
}

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

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

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

\"prefix\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
758
        return isc::dhcp::Dhcp6Parser::make_PREFIX(driver.loc_);
759
    default:
760
        return isc::dhcp::Dhcp6Parser::make_STRING("prefix", driver.loc_);
761 762 763 764 765 766
    }
}

\"prefix-len\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::PD_POOLS:
767
        return isc::dhcp::Dhcp6Parser::make_PREFIX_LEN(driver.loc_);
768
    default:
769
        return isc::dhcp::Dhcp6Parser::make_STRING("prefix-len", driver.loc_);
770 771 772
    }
}

773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790
\"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_);
    }
}

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

\"pool\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::POOLS:
803
        return isc::dhcp::Dhcp6Parser::make_POOL(driver.loc_);
804
    default:
805
        return isc::dhcp::Dhcp6Parser::make_STRING("pool", driver.loc_);
806 807 808
    }
}

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

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

\"interface\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
832
    case Parser6Context::SHARED_NETWORK:
833
        return isc::dhcp::Dhcp6Parser::make_INTERFACE(driver.loc_);
834
    default:
835
        return isc::dhcp::Dhcp6Parser::make_STRING("interface", driver.loc_);
836 837 838
    }
}

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

849 850 851
\"id\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
852
        return isc::dhcp::Dhcp6Parser::make_ID(driver.loc_);
853
    default:
854
        return isc::dhcp::Dhcp6Parser::make_STRING("id", driver.loc_);
855 856 857
    }
}

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

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 910 911 912 913
\"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_);
    }
}

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

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

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

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

\"Logging\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CONFIG:
954
        return isc::dhcp::Dhcp6Parser::make_LOGGING(driver.loc_);
955
    default:
956
        return isc::dhcp::Dhcp6Parser::make_STRING("Logging", driver.loc_);
957 958 959 960 961 962
    }
}

\"loggers\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LOGGING:
963
        return isc::dhcp::Dhcp6Parser::make_LOGGERS(driver.loc_);
964
    default:
965
        return isc::dhcp::Dhcp6Parser::make_STRING("loggers", driver.loc_);
966 967 968 969 970 971
    }
}

\"output_options\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LOGGERS:
972
        return isc::dhcp::Dhcp6Parser::make_OUTPUT_OPTIONS(driver.loc_);
973
    default:
974
        return isc::dhcp::Dhcp6Parser::make_STRING("output_options", driver.loc_);
975 976 977 978 979 980
    }
}

\"output\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OUTPUT_OPTIONS:
981
        return isc::dhcp::Dhcp6Parser::make_OUTPUT(driver.loc_);
982
    default:
983
        return isc::dhcp::Dhcp6Parser::make_STRING("output", driver.loc_);
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 1011 1012 1013 1014
\"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_);
    }
}


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

\"severity\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::LOGGERS:
1027
        return isc::dhcp::Dhcp6Parser::make_SEVERITY(driver.loc_);
1028
    default:
1029
        return isc::dhcp::Dhcp6Parser::make_STRING("severity", driver.loc_);
1030 1031 1032 1033 1034 1035 1036
    }
}

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

\"client-class\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
    case isc::dhcp::Parser6Context::CLIENT_CLASSES:
1047
    case Parser6Context::SHARED_NETWORK:
1048
        return isc::dhcp::Dhcp6Parser::make_CLIENT_CLASS(driver.loc_);
1049
    default:
1050
        return isc::dhcp::Dhcp6Parser::make_STRING("client-class", driver.loc_);
1051 1052 1053 1054 1055 1056 1057
    }
}

\"test\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CLIENT_CLASSES:
    case isc::dhcp::Parser6Context::CLIENT_CLASS:
1058
        return isc::dhcp::Dhcp6Parser::make_TEST(driver.loc_);
1059
    default:
1060
        return isc::dhcp::Dhcp6Parser::make_STRING("test", driver.loc_);
1061 1062 1063 1064 1065 1066
    }
}

\"reservations\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SUBNET6:
1067
        return isc::dhcp::Dhcp6Parser::make_RESERVATIONS(driver.loc_);
1068
    default:
1069
        return isc::dhcp::Dhcp6Parser::make_STRING("reservations", driver.loc_);
1070 1071 1072 1073 1074 1075
    }
}

\"ip-addresses\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATIONS:
1076
        return isc::dhcp::Dhcp6Parser::make_IP_ADDRESSES(driver.loc_);
1077
    default:
1078
        return isc::dhcp::Dhcp6Parser::make_STRING("ip-addresses", driver.loc_);
1079 1080 1081 1082 1083 1084
    }
}

\"prefixes\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATIONS:
1085
        return isc::dhcp::Dhcp6Parser::make_PREFIXES(driver.loc_);
1086
    default:
1087
        return isc::dhcp::Dhcp6Parser::make_STRING("prefixes", driver.loc_);
1088 1089 1090 1091 1092 1093 1094 1095
    }
}

\"duid\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::MAC_SOURCES:
    case isc::dhcp::Parser6Context::HOST_RESERVATION_IDENTIFIERS:
    case isc::dhcp::Parser6Context::RESERVATIONS:
1096
        return isc::dhcp::Dhcp6Parser::make_DUID(driver.loc_);
1097
    default:
1098
        return isc::dhcp::Dhcp6Parser::make_STRING("duid", driver.loc_);
1099 1100 1101 1102 1103 1104 1105
    }
}

\"hw-address\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::HOST_RESERVATION_IDENTIFIERS:
    case isc::dhcp::Parser6Context::RESERVATIONS:
1106
        return isc::dhcp::Dhcp6Parser::make_HW_ADDRESS(driver.loc_);
1107
    default:
1108
        return isc::dhcp::Dhcp6Parser::make_STRING("hw-address", driver.loc_);
1109 1110 1111 1112 1113 1114
    }
}

\"hostname\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::RESERVATIONS:
1115
        return isc::dhcp::Dhcp6Parser::make_HOSTNAME(driver.loc_);
1116
    default:
1117
        return isc::dhcp::Dhcp6Parser::make_STRING("hostname", driver.loc_);
1118 1119 1120
    }
}

1121 1122 1123 1124 1125 1126 1127 1128 1129 1130
\"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_);
    }
}

1131 1132
\"space\" {
    switch(driver.ctx_) {
1133
    case isc::dhcp::Parser6Context::OPTION_DEF:
1134
    case isc::dhcp::Parser6Context::OPTION_DATA:
1135
        return isc::dhcp::Dhcp6Parser::make_SPACE(driver.loc_);
1136
    default:
1137
        return isc::dhcp::Dhcp6Parser::make_STRING("space", driver.loc_);
1138 1139 1140 1141 1142 1143
    }
}

\"csv-format\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::OPTION_DATA:
1144
        return isc::dhcp::Dhcp6Parser::make_CSV_FORMAT(driver.loc_);
1145
    default:
1146
        return isc::dhcp::Dhcp6Parser::make_STRING("csv-format", driver.loc_);
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 1175 1176 1177 1178 1179
\"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:
1180
    case Parser6Context::SHARED_NETWORK:
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
        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_);
    }
}

1196 1197 1198
\"hooks-libraries\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
1199
        return isc::dhcp::Dhcp6Parser::make_HOOKS_LIBRARIES(driver.loc_);
1200
    default:
1201
        return isc::dhcp::Dhcp6Parser::make_STRING("hooks-libraries", driver.loc_);
1202 1203 1204
    }
}

1205 1206 1207 1208 1209 1210 1211 1212 1213 1214

\"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_);
    }
}

1215 1216 1217
\"library\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::HOOKS_LIBRARIES:
1218
        return isc::dhcp::Dhcp6Parser::make_LIBRARY(driver.loc_);
1219
    default:
1220
        return isc::dhcp::Dhcp6Parser::make_STRING("library", driver.loc_);
1221 1222 1223 1224 1225 1226
    }
}

\"server-id\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
1227
        return isc::dhcp::Dhcp6Parser::make_SERVER_ID(driver.loc_);
1228
    default:
1229
        return isc::dhcp::Dhcp6Parser::make_STRING("server-id", driver.loc_);
1230 1231 1232
    }
}

1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259
\"LLT\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DUID_TYPE:
        return isc::dhcp::Dhcp6Parser::make_LLT(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("LLT", driver.loc_);
    }
}

\"EN\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DUID_TYPE:
        return isc::dhcp::Dhcp6Parser::make_EN(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("EN", driver.loc_);
    }
}

\"LL\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DUID_TYPE:
        return isc::dhcp::Dhcp6Parser::make_LL(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("LL", driver.loc_);
    }
}

1260 1261 1262
\"identifier\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SERVER_ID:
1263
        return isc::dhcp::Dhcp6Parser::make_IDENTIFIER(driver.loc_);
1264
    default:
1265
        return isc::dhcp::Dhcp6Parser::make_STRING("identifier", driver.loc_);
1266 1267 1268 1269 1270 1271
    }
}

\"htype\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SERVER_ID:
1272
        return isc::dhcp::Dhcp6Parser::make_HTYPE(driver.loc_);
1273
    default:
1274
        return isc::dhcp::Dhcp6Parser::make_STRING("htype", driver.loc_);
1275 1276 1277 1278 1279 1280
    }
}

\"time\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SERVER_ID:
1281
        return isc::dhcp::Dhcp6Parser::make_TIME(driver.loc_);
1282
    default:
1283
        return isc::dhcp::Dhcp6Parser::make_STRING("time", driver.loc_);
1284 1285 1286 1287 1288 1289
    }
}

\"enterprise-id\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::SERVER_ID:
1290
        return isc::dhcp::Dhcp6Parser::make_ENTERPRISE_ID(driver.loc_);
1291
    default:
1292
        return isc::dhcp::Dhcp6Parser::make_STRING("enterprise-id", driver.loc_);
1293 1294 1295 1296 1297 1298
    }
}

\"expired-leases-processing\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
1299
        return isc::dhcp::Dhcp6Parser::make_EXPIRED_LEASES_PROCESSING(driver.loc_);
1300
    default:
1301
        return isc::dhcp::Dhcp6Parser::make_STRING("expired-leases-processing", driver.loc_);
1302 1303 1304
    }
}

Francis Dupont's avatar
Francis Dupont committed
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358
\"reclaim-timer-wait-time\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::EXPIRED_LEASES_PROCESSING:
        return isc::dhcp::Dhcp6Parser::make_RECLAIM_TIMER_WAIT_TIME(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("reclaim-timer-wait-time", driver.loc_);
    }
}

\"flush-reclaimed-timer-wait-time\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::EXPIRED_LEASES_PROCESSING:
        return isc::dhcp::Dhcp6Parser::make_FLUSH_RECLAIMED_TIMER_WAIT_TIME(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("flush-reclaimed-timer-wait-time", driver.loc_);
    }
}

\"hold-reclaimed-time\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::EXPIRED_LEASES_PROCESSING:
        return isc::dhcp::Dhcp6Parser::make_HOLD_RECLAIMED_TIME(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("hold-reclaimed-time", driver.loc_);
    }
}

\"max-reclaim-leases\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::EXPIRED_LEASES_PROCESSING:
        return isc::dhcp::Dhcp6Parser::make_MAX_RECLAIM_LEASES(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("max-reclaim-leases", driver.loc_);
    }
}

\"max-reclaim-time\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::EXPIRED_LEASES_PROCESSING:
        return isc::dhcp::Dhcp6Parser::make_MAX_RECLAIM_TIME(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("max-reclaim-time", driver.loc_);
    }
}

\"unwarned-reclaim-cycles\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::EXPIRED_LEASES_PROCESSING:
        return isc::dhcp::Dhcp6Parser::make_UNWARNED_RECLAIM_CYCLES(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("unwarned-reclaim-cycles", driver.loc_);
    }
}

1359 1360 1361
\"dhcp4o6-port\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
1362
        return isc::dhcp::Dhcp6Parser::make_DHCP4O6_PORT(driver.loc_);
1363
    default:
1364
        return isc::dhcp::Dhcp6Parser::make_STRING("dhcp4o6-port", driver.loc_);
1365 1366 1367
    }
}

1368 1369 1370 1371 1372 1373
\"control-socket\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
        return isc::dhcp::Dhcp6Parser::make_CONTROL_SOCKET(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("control-socket", driver.loc_);
1374 1375 1376
    }
}

1377
\"socket-type\" {
1378
    switch(driver.ctx_) {
1379 1380
    case isc::dhcp::Parser6Context::CONTROL_SOCKET:
        return isc::dhcp::Dhcp6Parser::make_SOCKET_TYPE(driver.loc_);
1381
    default:
1382
        return isc::dhcp::Dhcp6Parser::make_STRING("socket-type", driver.loc_);
1383 1384 1385
    }
}

1386
\"socket-name\" {
1387
    switch(driver.ctx_) {
1388 1389
    case isc::dhcp::Parser6Context::CONTROL_SOCKET:
        return isc::dhcp::Dhcp6Parser::make_SOCKET_NAME(driver.loc_);
1390
    default:
1391 1392 1393 1394 1395 1396 1397 1398 1399 1400
        return isc::dhcp::Dhcp6Parser::make_STRING("socket-name", driver.loc_);
    }
}

\"dhcp-ddns\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::DHCP6:
        return isc::dhcp::Dhcp6Parser::make_DHCP_DDNS(driver.loc_);
    default:
        return isc::dhcp::Dhcp6Parser::make_STRING("dhcp-ddns", driver.loc_);
1401 1402
    }
}
1403

1404 1405 1406
\"Dhcp4\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CONFIG:
1407
        return isc::dhcp::Dhcp6Parser::make_DHCP4(driver.loc_);
1408
    default:
1409
        return isc::dhcp::Dhcp6Parser::make_STRING("Dhcp4", driver.loc_);
1410 1411 1412 1413 1414 1415
    }
}

\"DhcpDdns\" {
    switch(driver.ctx_) {
    case isc::dhcp::Parser6Context::CONFIG:
1416
        return isc::dhcp::Dhcp6Parser::make_DHCPDDNS(driver.loc_);
</