break;
case 552:
-#line 1926 "dhcp6_parser.yy" // lalr1.cc:859
+#line 1928 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 553:
-#line 1928 "dhcp6_parser.yy" // lalr1.cc:859
+#line 1930 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr qc = yystack_[0].value.as< ElementPtr > ();
ctx.stack_.back()->set("queue-control", qc);
break;
case 554:
-#line 1944 "dhcp6_parser.yy" // lalr1.cc:859
+#line 1946 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("dhcp-ddns", m);
break;
case 555:
-#line 1949 "dhcp6_parser.yy" // lalr1.cc:859
+#line 1951 "dhcp6_parser.yy" // lalr1.cc:859
{
// The enable updates DHCP DDNS parameter is required.
ctx.require("enable-updates", ctx.loc2pos(yystack_[2].location), ctx.loc2pos(yystack_[0].location));
break;
case 556:
-#line 1956 "dhcp6_parser.yy" // lalr1.cc:859
+#line 1958 "dhcp6_parser.yy" // lalr1.cc:859
{
// Parse the dhcp-ddns map
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
break;
case 557:
-#line 1960 "dhcp6_parser.yy" // lalr1.cc:859
+#line 1962 "dhcp6_parser.yy" // lalr1.cc:859
{
// The enable updates DHCP DDNS parameter is required.
ctx.require("enable-updates", ctx.loc2pos(yystack_[3].location), ctx.loc2pos(yystack_[0].location));
break;
case 579:
-#line 1991 "dhcp6_parser.yy" // lalr1.cc:859
+#line 1993 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr b(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("enable-updates", b);
break;
case 580:
-#line 1996 "dhcp6_parser.yy" // lalr1.cc:859
+#line 1998 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 581:
-#line 1998 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2000 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("qualifying-suffix", s);
break;
case 582:
-#line 2004 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2006 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 583:
-#line 2006 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2008 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("server-ip", s);
break;
case 584:
-#line 2012 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2014 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("server-port", i);
break;
case 585:
-#line 2017 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2019 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 586:
-#line 2019 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2021 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("sender-ip", s);
break;
case 587:
-#line 2025 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2027 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("sender-port", i);
break;
case 588:
-#line 2030 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2032 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr i(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("max-queue-size", i);
break;
case 589:
-#line 2035 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2037 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NCR_PROTOCOL);
}
break;
case 590:
-#line 2037 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2039 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.back()->set("ncr-protocol", yystack_[0].value.as< ElementPtr > ());
ctx.leave();
break;
case 591:
-#line 2043 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2045 "dhcp6_parser.yy" // lalr1.cc:859
{ yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("UDP", ctx.loc2pos(yystack_[0].location))); }
#line 3220 "dhcp6_parser.cc" // lalr1.cc:859
break;
case 592:
-#line 2044 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2046 "dhcp6_parser.yy" // lalr1.cc:859
{ yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("TCP", ctx.loc2pos(yystack_[0].location))); }
#line 3226 "dhcp6_parser.cc" // lalr1.cc:859
break;
case 593:
-#line 2047 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2049 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NCR_FORMAT);
}
break;
case 594:
-#line 2049 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2051 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr json(new StringElement("JSON", ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("ncr-format", json);
break;
case 595:
-#line 2055 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2057 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr b(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("always-include-fqdn", b);
break;
case 596:
-#line 2060 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2062 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr b(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("override-no-update", b);
break;
case 597:
-#line 2065 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2067 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr b(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("override-client-update", b);
break;
case 598:
-#line 2070 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2072 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.REPLACE_CLIENT_NAME);
}
break;
case 599:
-#line 2072 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2074 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.back()->set("replace-client-name", yystack_[0].value.as< ElementPtr > ());
ctx.leave();
break;
case 600:
-#line 2078 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2080 "dhcp6_parser.yy" // lalr1.cc:859
{
yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("when-present", ctx.loc2pos(yystack_[0].location)));
}
break;
case 601:
-#line 2081 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2083 "dhcp6_parser.yy" // lalr1.cc:859
{
yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("never", ctx.loc2pos(yystack_[0].location)));
}
break;
case 602:
-#line 2084 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2086 "dhcp6_parser.yy" // lalr1.cc:859
{
yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("always", ctx.loc2pos(yystack_[0].location)));
}
break;
case 603:
-#line 2087 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2089 "dhcp6_parser.yy" // lalr1.cc:859
{
yylhs.value.as< ElementPtr > () = ElementPtr(new StringElement("when-not-present", ctx.loc2pos(yystack_[0].location)));
}
break;
case 604:
-#line 2090 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2092 "dhcp6_parser.yy" // lalr1.cc:859
{
error(yystack_[0].location, "boolean values for the replace-client-name are "
"no longer supported");
break;
case 605:
-#line 2096 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2098 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 606:
-#line 2098 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2100 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("generated-prefix", s);
break;
case 607:
-#line 2104 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2106 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 608:
-#line 2106 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2108 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("hostname-char-set", s);
break;
case 609:
-#line 2112 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2114 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 610:
-#line 2114 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2116 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr s(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("hostname-char-replacement", s);
break;
case 611:
-#line 2122 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2124 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 612:
-#line 2124 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2126 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.back()->set("Dhcp4", yystack_[0].value.as< ElementPtr > ());
ctx.leave();
break;
case 613:
-#line 2129 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2131 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 614:
-#line 2131 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2133 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.back()->set("DhcpDdns", yystack_[0].value.as< ElementPtr > ());
ctx.leave();
break;
case 615:
-#line 2136 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2138 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 616:
-#line 2138 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2140 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.back()->set("Control-agent", yystack_[0].value.as< ElementPtr > ());
ctx.leave();
break;
case 617:
-#line 2145 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2147 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
break;
case 618:
-#line 2149 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2151 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
}
break;
case 619:
-#line 2154 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2156 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr i(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("config-control", i);
break;
case 620:
-#line 2159 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2161 "dhcp6_parser.yy" // lalr1.cc:859
{
// No config control params are required
ctx.stack_.pop_back();
break;
case 621:
-#line 2165 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2167 "dhcp6_parser.yy" // lalr1.cc:859
{
// Parse the config-control map
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
break;
case 622:
-#line 2169 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2171 "dhcp6_parser.yy" // lalr1.cc:859
{
// No config_control params are required
// parsing completed
break;
case 627:
-#line 2184 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2186 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("config-databases", l);
break;
case 628:
-#line 2189 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2191 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 629:
-#line 2199 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2201 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("Logging", m);
break;
case 630:
-#line 2204 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2206 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 631:
-#line 2209 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2211 "dhcp6_parser.yy" // lalr1.cc:859
{
// Parse the Logging map
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
break;
case 632:
-#line 2213 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2215 "dhcp6_parser.yy" // lalr1.cc:859
{
// parsing completed
}
break;
case 636:
-#line 2229 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2231 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("loggers", l);
break;
case 637:
-#line 2234 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2236 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 640:
-#line 2246 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2248 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(l);
break;
case 641:
-#line 2250 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2252 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
}
break;
case 651:
-#line 2267 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2269 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr dl(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("debuglevel", dl);
break;
case 652:
-#line 2272 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2274 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 653:
-#line 2274 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2276 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("severity", sev);
break;
case 654:
-#line 2280 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2282 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("output_options", l);
break;
case 655:
-#line 2285 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2287 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
ctx.leave();
break;
case 658:
-#line 2294 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2296 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->add(m);
break;
case 659:
-#line 2298 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2300 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.stack_.pop_back();
}
break;
case 666:
-#line 2312 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2314 "dhcp6_parser.yy" // lalr1.cc:859
{
ctx.enter(ctx.NO_KEYWORD);
}
break;
case 667:
-#line 2314 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2316 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr sev(new StringElement(yystack_[0].value.as< std::string > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("output", sev);
break;
case 668:
-#line 2320 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2322 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr flush(new BoolElement(yystack_[0].value.as< bool > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("flush", flush);
break;
case 669:
-#line 2325 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2327 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr maxsize(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("maxsize", maxsize);
break;
case 670:
-#line 2330 "dhcp6_parser.yy" // lalr1.cc:859
+#line 2332 "dhcp6_parser.yy" // lalr1.cc:859
{
ElementPtr maxver(new IntElement(yystack_[0].value.as< int64_t > (), ctx.loc2pos(yystack_[0].location)));
ctx.stack_.back()->set("maxver", maxver);
1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1845, 1845,
1852, 1853, 1854, 1857, 1862, 1862, 1870, 1875, 1882, 1889,
1889, 1899, 1900, 1903, 1904, 1905, 1906, 1907, 1910, 1910,
- 1918, 1918, 1926, 1926, 1944, 1944, 1956, 1956, 1966, 1967,
- 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979,
- 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1991,
- 1996, 1996, 2004, 2004, 2012, 2017, 2017, 2025, 2030, 2035,
- 2035, 2043, 2044, 2047, 2047, 2055, 2060, 2065, 2070, 2070,
- 2078, 2081, 2084, 2087, 2090, 2096, 2096, 2104, 2104, 2112,
- 2112, 2122, 2122, 2129, 2129, 2136, 2136, 2145, 2145, 2154,
- 2154, 2165, 2165, 2175, 2176, 2180, 2181, 2184, 2184, 2199,
- 2199, 2209, 2209, 2220, 2221, 2225, 2229, 2229, 2241, 2242,
- 2246, 2246, 2254, 2255, 2258, 2259, 2260, 2261, 2262, 2263,
- 2264, 2267, 2272, 2272, 2280, 2280, 2290, 2291, 2294, 2294,
- 2302, 2303, 2306, 2307, 2308, 2309, 2312, 2312, 2320, 2325,
- 2330
+ 1918, 1918, 1928, 1928, 1946, 1946, 1958, 1958, 1968, 1969,
+ 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981,
+ 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1993,
+ 1998, 1998, 2006, 2006, 2014, 2019, 2019, 2027, 2032, 2037,
+ 2037, 2045, 2046, 2049, 2049, 2057, 2062, 2067, 2072, 2072,
+ 2080, 2083, 2086, 2089, 2092, 2098, 2098, 2106, 2106, 2114,
+ 2114, 2124, 2124, 2131, 2131, 2138, 2138, 2147, 2147, 2156,
+ 2156, 2167, 2167, 2177, 2178, 2182, 2183, 2186, 2186, 2201,
+ 2201, 2211, 2211, 2222, 2223, 2227, 2231, 2231, 2243, 2244,
+ 2248, 2248, 2256, 2257, 2260, 2261, 2262, 2263, 2264, 2265,
+ 2266, 2269, 2274, 2274, 2282, 2282, 2292, 2293, 2296, 2296,
+ 2304, 2305, 2308, 2309, 2310, 2311, 2314, 2314, 2322, 2327,
+ 2332
};
// Print the state stack on the debug stream.
#line 14 "dhcp6_parser.yy" // lalr1.cc:1167
} } // isc::dhcp
#line 5014 "dhcp6_parser.cc" // lalr1.cc:1167
-#line 2335 "dhcp6_parser.yy" // lalr1.cc:1168
+#line 2337 "dhcp6_parser.yy" // lalr1.cc:1168
void
};
/// @brief Interface for managing a queue of inbound DHCP packets
-template<typename PacketTypePtr>
+///
+/// This class serves as the abstract interface for packet queue
+/// implementations which may be used by @c IfaceMgr to store
+/// inbound packets until they are a dequeued for processing.
+///
+template<typename PacketTypePtr>
class PacketQueue {
public:
/// @brief Constructor
///
- /// @param queue_type name of this queue's implementation type.
+ /// @param queue_type name of this queue's implementation type.
/// Typically this is assigned by the factory that creates the
/// queue. It is the logical name used to register queue
/// implementations.
- PacketQueue(const std::string& queue_type)
+ PacketQueue(const std::string& queue_type)
: queue_type_(queue_type) {}
/// Virtual destructor
///
/// Calls @c dropPacket to determine if the packet should be queued
/// or dropped. If it should be queued it is added to the end of the
- /// specified by the "to" parameter.
+ /// specified by the "to" parameter.
///
- /// @param packet packet to enqueue
+ /// @param packet packet to enqueue
/// @param source socket the packet came from - this can be
/// @param to end of the queue from which to remove packet(s).
/// Defaults to BACK.
/// This function is called at the beginning of @enqueuePacket and
/// provides an opportunity to examine the packet and its source
/// and decide whether it should be dropped or added to the queue.
- /// Derivations are expected to provide implementations based on
+ /// Derivations are expected to provide implementations based on
/// their own requirements. Bear in mind that the packet has NOT
/// been unpacked at this point. The default implementation simply
/// returns false.
///
/// @return true if the packet should be dropped, false if it should be
/// kept.
- virtual bool dropPacket(PacketTypePtr /* packet */,
+ virtual bool dropPacket(PacketTypePtr /* packet */,
const SocketInfo& /* source */) {
return (false);
}
/// This function is called at the beginning of @c dequeuPacket and
/// provides an opportunity to examine and discard packets from
/// the queue prior to dequeuing the next packet to be
- /// processed. Derivations are expected to provide implementations
- /// based on their own requirements. The default implemenation is to
+ /// processed. Derivations are expected to provide implementations
+ /// based on their own requirements. The default implemenation is to
/// to simply returns without skipping any packets.
///
/// @param from end of the queue from which packets should discarded
///
/// @return The number of packets discarded.
virtual int eatPackets(const QueueEnd& /* from */) {
- return (0);
+ return (0);
}
/// @brief Pushes a packet onto the queue
/// @brief Gets the packet currently at one end of the queue
///
/// Returns a pointer the packet at the specified end of the
- /// queue without dequeuing it.
+ /// queue without dequeuing it.
///
- /// @return A pointer to packet, or an empty pointer if the
+ /// @return A pointer to packet, or an empty pointer if the
/// queue is empty.
virtual const PacketTypePtr peek(const QueueEnd& from=QueueEnd::FRONT) const = 0;
/// @brief Discards all packets currently in the buffer.
virtual void clear() = 0;
+ /// @brief Fetches operational information about the current state of the queue
+ ///
+ /// Creates and returns an ElementPtr containing a single entry,
+ /// "queue-type". Derivations are expected to call this method first
+ /// and then add their own values. Since implementations may vary
+ /// widely on data of interest, this is structured as an ElementPtr
+ /// for broad latitude.
+ ///
+ /// @return an ElementPtr containing elements for values of interest
virtual data::ElementPtr getInfo() {
data::ElementPtr info = data::Element::createMap();
info->set("queue-type", data::Element::create(queue_type_));
return(info);
}
+ /// @brief Fetches a JSON string representation of queue operational info
+ ///
+ /// This method calls @c getInfo() and then converts that into JSON text.
+ ///
+ /// @return string of JSON text
virtual std::string getInfoStr() {
data::ElementPtr info = getInfo();
std::ostringstream os;
return (os.str());
}
- /// @brief
+ /// @return Fetches the logical name of the type of this queue.
std::string getQueueType() {
return (queue_type_);
};
private:
- /// @brief Name of the this queue's implementation type.
+ /// @brief Logcial name of the this queue's implementation type.
std::string queue_type_;
-
+
};
-/// @brief Defines pointer to the DHCPv4 queue interface used at the application level.
+/// @brief Defines pointer to the DHCPv4 queue interface used at the application level.
+/// This is the type understood by IfaceMgr and the type that should be returned by
+/// DHCPv4 packet queue factories.
typedef boost::shared_ptr<PacketQueue<Pkt4Ptr>> PacketQueue4Ptr;
-/// @brief Defines pointer to the DHCPv6 queue interface used at the application level.
+/// @brief Defines pointer to the DHCPv6 queue interface used at the application level.
+/// This is the type understood by IfaceMgr and the type that should be returned by
+/// DHCPv6 packet queue factories.
typedef boost::shared_ptr<PacketQueue<Pkt6Ptr>> PacketQueue6Ptr;
+
/// @brief Provides an abstract ring-buffer implementation of the PacketQueue interface.
-template<typename PacketTypePtr>
+template<typename PacketTypePtr>
class PacketQueueRing : public PacketQueue<PacketTypePtr> {
public:
static const size_t MIN_RING_CAPACITY = 5;
///
/// @param queue_capacity maximum number of packets the queue can hold
PacketQueueRing(const std::string& queue_type, size_t capacity)
- : PacketQueue<PacketTypePtr>(queue_type) {
+ : PacketQueue<PacketTypePtr>(queue_type) {
queue_.set_capacity(capacity);
}
/// @brief Gets the packet currently at one end of the queue
///
/// Returns a pointer the packet at the specified end of the
- /// queue without dequeuing it.
+ /// queue without dequeuing it.
///
- /// @return A pointer to packet, or an empty pointer if the
+ /// @return A pointer to packet, or an empty pointer if the
/// queue is empty.
virtual const PacketTypePtr peek(const QueueEnd& from=QueueEnd::FRONT) const {
PacketTypePtr packet;
/// @brief Returns True if the queue is empty.
virtual bool empty() const {
return(queue_.empty());
- }
+ }
/// @brief Returns the maximum number of packets allowed in the buffer.
virtual size_t getCapacity() const {
/// @throw BadValue if capacity is too low.
virtual void setCapacity(size_t capacity) {
if (capacity < MIN_RING_CAPACITY) {
- isc_throw(BadValue, "Queue capacity of " << capacity
- << " is invalid. It must be at least "
+ isc_throw(BadValue, "Queue capacity of " << capacity
+ << " is invalid. It must be at least "
<< MIN_RING_CAPACITY);
}
queue_.clear();
}
+ /// @brief Fetches pertinent information
virtual data::ElementPtr getInfo() {
data::ElementPtr info = PacketQueue<PacketTypePtr>::getInfo();
info->set("capacity", data::Element::create(static_cast<int64_t>(getCapacity())));
};
-/// @brief Default DHCPv4 packet queue buffer implementation
+/// @brief DHCPv4 packet queue buffer implementation
+///
+/// This implementation does not (currently) add any drop
+/// or packet skip logic, it operates as a verbatim ring
+/// queue for DHCPv4 packets.
+///
class PacketQueueRing4 : public PacketQueueRing<Pkt4Ptr> {
public:
- static const size_t DEFAULT_RING_CAPACITY = 500;
-
/// @brief Constructor
///
/// @param capacity maximum number of packets the queue can hold
- PacketQueueRing4(const std::string& queue_type, size_t capacity=DEFAULT_RING_CAPACITY)
+ PacketQueueRing4(const std::string& queue_type, size_t capacity)
: PacketQueueRing(queue_type, capacity) {
};
/// @brief virtual Destructor
virtual ~PacketQueueRing4(){}
-
- virtual void useDefaults(){
- setCapacity(DEFAULT_RING_CAPACITY);
- }
};
-/// @brief Default DHCPv6 packet queue buffer implementation
+/// @brief DHCPv6 packet queue buffer implementation
+///
+/// This implementation does not (currently) add any drop
+/// or packet skip logic, it operates as a verbatim ring
+/// queue for DHCPv6 packets.
+///
class PacketQueueRing6 : public PacketQueueRing<Pkt6Ptr> {
public:
- static const size_t DEFAULT_RING_CAPACITY = 500;
-
/// @brief Constructor
///
/// @param capacity maximum number of packets the queue can hold
- PacketQueueRing6(const std::string& queue_type, size_t capacity=DEFAULT_RING_CAPACITY)
+ PacketQueueRing6(const std::string& queue_type, size_t capacity)
: PacketQueueRing(queue_type, capacity) {
};
/// @brief virtual Destructor
virtual ~PacketQueueRing6(){}
-
- virtual void useDefaults() {
- setCapacity(DEFAULT_RING_CAPACITY);
- }
};