Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
5ab41adb
Commit
5ab41adb
authored
Feb 28, 2017
by
Tomek Mrugalski
🛰
Browse files
[5061] contact_points converted to contact-points
parent
747a8a78
Changes
10
Hide whitespace changes
Inline
Side-by-side
doc/examples/kea4/backends.json
View file @
5ab41adb
...
...
@@ -70,7 +70,7 @@
#
"lease-database"
:
{
#
"type"
:
"cql"
,
#
"keyspace"
:
"keatest"
,
#
"contact
_
points"
:
"192.0.2.1,192.0.2.2,192.0.2.3"
,
#
"contact
-
points"
:
"192.0.2.1,192.0.2.2,192.0.2.3"
,
#
"port"
:
9042
#
},
...
...
doc/examples/kea4/cassandra.json
0 → 100644
View file @
5ab41adb
//
This
is
an
example
configuration
file
for
the
DHCPv
4
server
in
Kea.
//
It
is
a
basic
scenario
with
one
IPv
4
subnet
configured.
It
demonstrates
//
how
to
configure
Kea
to
use
CQL
(Cassandra)
backend
{
"Dhcp4"
:
{
//
Kea
is
told
to
listen
on
ethX
interface
only.
"interfaces-config"
:
{
"interfaces"
:
[
"ethX"
]
},
//
4
.
CQL
(Cassandra)
backend.
Leases
will
be
stored
in
Cassandra
database.
Make
//
sure
it
is
up
,
running
and
properly
initialized.
See
kea-admin
documentation
//
for
details
on
how
to
initialize
the
database.
The
only
strictly
required
//
parameters
are
type
,
keyspace
and
contact_points.
At
least
one
contact
point
//
must
be
specified
,
but
more
than
one
is
required
for
redundancy.
Make
sure
//
you
specify
the
contact
points
without
spaces.
Kea
must
be
compiled
with
//
--with-cql
option
to
use
this
backend.
"lease-database"
:
{
"type"
:
"cql"
,
"keyspace"
:
"keatest"
,
"contact-points"
:
"192.0.2.1,192.0.2.2,192.0.2.3"
,
"port"
:
9042
},
//
Addresses
will
be
assigned
with
a
lifetime
of
4000
seconds.
"valid-lifetime"
:
4000
,
//
Renew
and
rebind
timers
are
commented
out.
This
implies
that
options
//
58
and
59
will
not
be
sent
to
the
client.
In
this
case
it
is
up
to
//
the
client
to
pick
the
timer
values
according
to
RFC
2131
.
Uncomment
the
//
timers
to
send
these
options
to
the
client.
//
"renew-timer"
:
1000
,
//
"rebind-timer"
:
2000
,
//
The
following
list
defines
subnets.
We
have
only
one
subnet
//
here.
We
tell
Kea
that
it
is
directly
available
over
local
interface.
"subnet4"
:
[
{
"pools"
:
[
{
"pool"
:
"192.0.2.1 - 192.0.2.200"
}
],
"subnet"
:
"192.0.2.0/24"
,
"interface"
:
"ethX"
}
]
},
//
The
following
configures
logging.
It
assumes
that
messages
with
at
least
//
informational
level
(info
,
warn
,
error
and
fatal)
should
be
logged
to
stdout.
"Logging"
:
{
"loggers"
:
[
{
"name"
:
"kea-dhcp4"
,
"output_options"
:
[
{
"output"
:
"stdout"
}
],
"severity"
:
"INFO"
}
]
}
}
doc/examples/kea6/backends.json
View file @
5ab41adb
...
...
@@ -70,7 +70,7 @@
#
"lease-database"
:
{
#
"type"
:
"cql"
,
#
"keyspace"
:
"keatest"
,
#
"contact
_
points"
:
"192.0.2.1,192.0.2.2,192.0.2.3"
,
#
"contact
-
points"
:
"192.0.2.1,192.0.2.2,192.0.2.3"
,
#
"port"
:
9042
#
},
...
...
doc/examples/kea6/cassandra.json
0 → 100644
View file @
5ab41adb
//
This
is
an
example
configuration
file
for
the
DHCPv
6
server
in
Kea.
//
It
is
a
basic
scenario
with
one
IPv
6
subnet
configured.
It
demonstrates
//
how
to
configure
Kea
to
use
CQL
(Cassandra)
backend.
{
"Dhcp6"
:
{
//
Kea
is
told
to
listen
on
ethX
interface
only.
"interfaces-config"
:
{
"interfaces"
:
[
"ethX"
]
},
//
CQL
(Cassandra)
backend.
Leases
will
be
stored
in
Cassandra
database.
Make
//
sure
it
is
up
,
running
and
properly
initialized.
See
kea-admin
documentation
//
for
details
on
how
to
initialize
the
database.
The
only
strictly
required
//
parameters
are
type
,
keyspace
and
contact_points.
At
least
one
contact
point
//
must
be
specified
,
but
more
than
one
is
required
for
redundancy.
Make
sure
//
you
specify
the
contact
points
without
spaces.
Kea
must
be
compiled
with
//
--with-cql
option
to
use
this
backend.
"lease-database"
:
{
"type"
:
"cql"
,
"keyspace"
:
"keatest"
,
"contact_points"
:
"192.0.2.1,192.0.2.2,192.0.2.3"
,
"port"
:
9042
},
//
Addresses
will
be
assigned
with
preferred
and
valid
lifetimes
//
being
3000
and
4000
,
respectively.
Client
is
told
to
start
//
renewing
after
1000
seconds.
If
the
server
does
not
respond
//
after
2000
seconds
since
the
lease
was
granted
,
client
is
supposed
//
to
start
REBIND
procedure
(emergency
renewal
that
allows
switching
//
to
a
different
server).
"preferred-lifetime"
:
3000
,
"valid-lifetime"
:
4000
,
"renew-timer"
:
1000
,
"rebind-timer"
:
2000
,
//
The
following
list
defines
subnets.
Each
subnet
consists
of
at
//
least
subnet
and
pool
entries.
"subnet6"
:
[
{
"pools"
:
[
{
"pool"
:
"2001:db8:1::/80"
}
],
"subnet"
:
"2001:db8:1::/64"
,
"interface"
:
"ethX"
}
]
},
//
The
following
configures
logging.
It
assumes
that
messages
with
at
least
//
informational
level
(info
,
warn
,
error
and
fatal)
should
be
logged
to
stdout.
"Logging"
:
{
"loggers"
:
[
{
"name"
:
"kea-dhcp6"
,
"output_options"
:
[
{
"output"
:
"stdout"
}
],
"debuglevel"
:
0
,
"severity"
:
"INFO"
}
]
}
}
src/bin/dhcp4/dhcp4_lexer.ll
View file @
5ab41adb
...
...
@@ -380,16 +380,6 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
contact_points\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::LEASE_DATABASE:
case isc::dhcp::Parser4Context::HOSTS_DATABASE:
return isc::dhcp::Dhcp4Parser::make_CONTACT_POINTS(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("
contact_points
", driver.loc_);
}
}
\"
contact-points\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::LEASE_DATABASE:
...
...
src/bin/dhcp4/dhcp4_parser.yy
View file @
5ab41adb
...
...
@@ -77,7 +77,7 @@ using namespace std;
LFC_INTERVAL "lfc-interval"
READONLY "readonly"
CONNECT_TIMEOUT "connect-timeout"
CONTACT_POINTS "contact
_
points"
CONTACT_POINTS "contact
-
points"
KEYSPACE "keyspace"
VALID_LIFETIME "valid-lifetime"
...
...
@@ -601,7 +601,7 @@ contact_points: CONTACT_POINTS {
ctx.enter(ctx.NO_KEYWORD);
} COLON STRING {
ElementPtr cp(new StringElement($4, ctx.loc2pos(@4)));
ctx.stack_.back()->set("contact
_
points", cp);
ctx.stack_.back()->set("contact
-
points", cp);
ctx.leave();
};
...
...
src/bin/dhcp4/tests/parser_unittest.cc
View file @
5ab41adb
...
...
@@ -242,6 +242,7 @@ TEST(ParserTest, file) {
vector
<
string
>
configs
=
{
"advanced.json"
,
"backends.json"
,
"classify.json"
,
"cassandra.json"
,
"dhcpv4-over-dhcpv6.json"
,
"hooks.json"
,
"leases-expiration.json"
,
...
...
src/bin/dhcp6/dhcp6_lexer.ll
View file @
5ab41adb
...
...
@@ -581,16 +581,6 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"
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_);
}
}
\"
contact-points\
" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::LEASE_DATABASE:
...
...
src/bin/dhcp6/dhcp6_parser.yy
View file @
5ab41adb
...
...
@@ -68,7 +68,7 @@ using namespace std;
LFC_INTERVAL "lfc-interval"
READONLY "readonly"
CONNECT_TIMEOUT "connect-timeout"
CONTACT_POINTS "contact
_
points"
CONTACT_POINTS "contact
-
points"
KEYSPACE "keyspace"
PREFERRED_LIFETIME "preferred-lifetime"
...
...
@@ -586,7 +586,7 @@ contact_points: CONTACT_POINTS {
ctx.enter(ctx.NO_KEYWORD);
} COLON STRING {
ElementPtr cp(new StringElement($4, ctx.loc2pos(@4)));
ctx.stack_.back()->set("contact
_
points", cp);
ctx.stack_.back()->set("contact
-
points", cp);
ctx.leave();
};
...
...
src/lib/dhcpsrv/cql_connection.cc
View file @
5ab41adb
...
...
@@ -69,7 +69,7 @@ CqlConnection::openDatabase() {
const
char
*
contact_points
=
"127.0.0.1"
;
string
scontact_points
;
try
{
scontact_points
=
getParameter
(
"contact
_
points"
);
scontact_points
=
getParameter
(
"contact
-
points"
);
contact_points
=
scontact_points
.
c_str
();
}
catch
(...)
{
// No host. Fine, we'll use "localhost".
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment