Commit 4c8e6bbb authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

more sync with trunk


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/jinmei-dnsrdata2@972 e5f2f494-b856-4b98-b285-d166d9295462
parents 1a324c83 91847ce7
......@@ -16,6 +16,9 @@ Requires autoconf 2.59 or newer.
Use automake-1.11 or better for working Python 3.1 tests.
Install with:
make install
TEST COVERAGE
......@@ -36,18 +39,25 @@ Doing code coverage tests:
RUNNING
At the moment there is no install yet, you can run the bind10 parkinglot
server from the source tree:
./src/bin/bind10/bind10
You can start the BIND 10 processes by running bind10 which is
installed to the sbin directory under the installation prefix.
The default location is:
The server will listen on port 5300 for DNS requests.
/usr/local/sbin/bind10
For development work, you can also run the bind10 services from the
source tree:
./src/bin/bind10/run_bind10.sh
(Which will use the modules and configurations also from the source
tree.)
The server will listen on port 5300 for DNS requests.
CONFIGURATION
Commands can be given through the tool bindctl;
cd src/bin/bindctl
sh bindctl
Commands can be given through the bindctl tool.
The server must be running for bindctl to work.
......@@ -74,7 +84,7 @@ config commit: Commit all changes
EXAMPLE SESSION
~> sh bindctl
~> bindctl
> config show
ParkingLot/ module
> config show ParkingLot/
......
......@@ -29,6 +29,9 @@ fi
# Checks for libraries.
AC_SEARCH_LIBS(inet_pton, [nsl])
AC_SEARCH_LIBS(recvfrom, [socket])
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
......@@ -148,7 +151,6 @@ AC_CONFIG_FILES([Makefile
src/bin/host/Makefile
src/bin/msgq/Makefile
src/bin/auth/Makefile
src/bin/parkinglot/Makefile
src/lib/Makefile
src/lib/cc/Makefile
src/lib/cc/cpp/Makefile
......@@ -171,8 +173,9 @@ AC_CONFIG_FILES([Makefile
])
AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
src/bin/cfgmgr/run_b10-cfgmgr.sh
src/bin/cmdctl/b10-cmdctl.py
src/bin/cmdctl/cmdctl.py
src/bin/cmdctl/run_b10-cmdctl.sh
src/bin/cmdctl/unittest/cmdctl_test
src/bin/bind10/bind10.py
src/bin/bind10/bind10_test
src/bin/bind10/run_bind10.sh
......@@ -182,7 +185,6 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
src/bin/msgq/msgq_test
src/bin/msgq/run_msgq.sh
src/bin/auth/config.h
src/bin/parkinglot/config.h
src/lib/config/cpp/data_def_unittests_config.h
src/lib/config/python/isc/config/config_test
src/lib/dns/cpp/gen-rdatacode.py
......@@ -190,6 +192,8 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
chmod +x src/bin/cfgmgr/run_b10-cfgmgr.sh
chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
chmod +x src/bin/bind10/run_bind10.sh
chmod +x src/bin/cmdctl/unittest/cmdctl_test
chmod +x src/bin/bindctl/unittest/bindctl_test
chmod +x src/bin/bindctl/bindctl
chmod +x src/bin/msgq/run_msgq.sh
chmod +x src/bin/msgq/msgq_test
......
......@@ -568,7 +568,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../src/lib/cc/cpp ../src/lib/dns/cpp
INPUT = ../src/lib/cc/cpp ../src/lib/config/cpp ../src/lib/dns/cpp
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
......
// Boost.Assign library
//
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/assign/
//
#ifndef BOOST_ASSIGN_LIST_INSERTER_HPP
#define BOOST_ASSIGN_LIST_INSERTER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <boost/detail/workaround.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/config.hpp>
#include <cstddef>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/iteration/local.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
namespace boost
{
namespace assign_detail
{
template< class T >
struct repeater
{
std::size_t sz;
T val;
repeater( std::size_t sz, T r ) : sz( sz ), val( r )
{ }
};
template< class Fun >
struct fun_repeater
{
std::size_t sz;
Fun val;
fun_repeater( std::size_t sz, Fun r ) : sz( sz ), val( r )
{ }
};
template< class C >
class call_push_back
{
C& c_;
public:
call_push_back( C& c ) : c_( c )
{ }
template< class T >
void operator()( T r )
{
c_.push_back( r );
}
};
template< class C >
class call_push_front
{
C& c_;
public:
call_push_front( C& c ) : c_( c )
{ }
template< class T >
void operator()( T r )
{
c_.push_front( r );
}
};
template< class C >
class call_push
{
C& c_;
public:
call_push( C& c ) : c_( c )
{ }
template< class T >
void operator()( T r )
{
c_.push( r );
}
};
template< class C >
class call_insert
{
C& c_;
public:
call_insert( C& c ) : c_( c )
{ }
template< class T >
void operator()( T r )
{
c_.insert( r );
}
};
template< class C >
class call_add_edge
{
C& c_;
public:
call_add_edge( C& c ) : c_(c)
{ }
template< class T >
void operator()( T l, T r )
{
add_edge( l, r, c_ );
}
template< class T, class EP >
void operator()( T l, T r, const EP& ep )
{
add_edge( l, r, ep, c_ );
}
};
struct forward_n_arguments {};
} // namespace 'assign_detail'
namespace assign
{
template< class T >
inline assign_detail::repeater<T>
repeat( std::size_t sz, T r )
{
return assign_detail::repeater<T>( sz, r );
}
template< class Function >
inline assign_detail::fun_repeater<Function>
repeat_fun( std::size_t sz, Function r )
{
return assign_detail::fun_repeater<Function>( sz, r );
}
template< class Function, class Argument = assign_detail::forward_n_arguments >
class list_inserter
{
struct single_arg_type {};
struct n_arg_type {};
typedef BOOST_DEDUCED_TYPENAME mpl::if_c< is_same<Argument,assign_detail::forward_n_arguments>::value,
n_arg_type,
single_arg_type >::type arg_type;
public:
list_inserter( Function fun ) : insert_( fun )
{}
template< class Function2, class Arg >
list_inserter( const list_inserter<Function2,Arg>& r )
: insert_( r.fun_private() )
{}
list_inserter( const list_inserter& r ) : insert_( r.insert_ )
{}
list_inserter& operator()()
{
insert_( Argument() );
return *this;
}
template< class T >
list_inserter& operator=( const T& r )
{
insert_( r );
return *this;
}
template< class T >
list_inserter& operator=( assign_detail::repeater<T> r )
{
return operator,( r );
}
template< class Nullary_function >
list_inserter& operator=( const assign_detail::fun_repeater<Nullary_function>& r )
{
return operator,( r );
}
template< class T >
list_inserter& operator,( const T& r )
{
insert_( r );
return *this;
}
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
template< class T >
list_inserter& operator,( const assign_detail::repeater<T> & r )
{
return repeat( r.sz, r.val );
}
#else
template< class T >
list_inserter& operator,( assign_detail::repeater<T> r )
{
return repeat( r.sz, r.val );
}
#endif
template< class Nullary_function >
list_inserter& operator,( const assign_detail::fun_repeater<Nullary_function>& r )
{
return repeat_fun( r.sz, r.val );
}
template< class T >
list_inserter& repeat( std::size_t sz, T r )
{
std::size_t i = 0;
while( i++ != sz )
insert_( r );
return *this;
}
template< class Nullary_function >
list_inserter& repeat_fun( std::size_t sz, Nullary_function fun )
{
std::size_t i = 0;
while( i++ != sz )
insert_( fun() );
return *this;
}
template< class SinglePassIterator >
list_inserter& range( SinglePassIterator first,
SinglePassIterator last )
{
for( ; first != last; ++first )
insert_( *first );
return *this;
}
template< class SinglePassRange >
list_inserter& range( const SinglePassRange& r )
{
return range( boost::begin(r), boost::end(r) );
}
template< class T >
list_inserter& operator()( const T& t )
{
insert_( t );
return *this;
}
#ifndef BOOST_ASSIGN_MAX_PARAMS // use user's value
#define BOOST_ASSIGN_MAX_PARAMS 5
#endif
#define BOOST_ASSIGN_MAX_PARAMETERS (BOOST_ASSIGN_MAX_PARAMS - 1)
#define BOOST_ASSIGN_PARAMS1(n) BOOST_PP_ENUM_PARAMS(n, class T)
#define BOOST_ASSIGN_PARAMS2(n) BOOST_PP_ENUM_BINARY_PARAMS(n, T, const& t)
#define BOOST_ASSIGN_PARAMS3(n) BOOST_PP_ENUM_PARAMS(n, t)
#define BOOST_PP_LOCAL_LIMITS (1, BOOST_ASSIGN_MAX_PARAMETERS)
#define BOOST_PP_LOCAL_MACRO(n) \
template< class T, BOOST_ASSIGN_PARAMS1(n) > \
list_inserter& operator()(T t, BOOST_ASSIGN_PARAMS2(n) ) \
{ \
BOOST_PP_CAT(insert, BOOST_PP_INC(n))(t, BOOST_ASSIGN_PARAMS3(n), arg_type()); \
return *this; \
} \
/**/
#include BOOST_PP_LOCAL_ITERATE()
#define BOOST_PP_LOCAL_LIMITS (1, BOOST_ASSIGN_MAX_PARAMETERS)
#define BOOST_PP_LOCAL_MACRO(n) \
template< class T, BOOST_ASSIGN_PARAMS1(n) > \
void BOOST_PP_CAT(insert, BOOST_PP_INC(n))(T const& t, BOOST_ASSIGN_PARAMS2(n), single_arg_type) \
{ \
insert_( Argument(t, BOOST_ASSIGN_PARAMS3(n) )); \
} \
/**/
#include BOOST_PP_LOCAL_ITERATE()
#define BOOST_PP_LOCAL_LIMITS (1, BOOST_ASSIGN_MAX_PARAMETERS)
#define BOOST_PP_LOCAL_MACRO(n) \
template< class T, BOOST_ASSIGN_PARAMS1(n) > \
void BOOST_PP_CAT(insert, BOOST_PP_INC(n))(T const& t, BOOST_ASSIGN_PARAMS2(n), n_arg_type) \
{ \
insert_(t, BOOST_ASSIGN_PARAMS3(n) ); \
} \
/**/
#include BOOST_PP_LOCAL_ITERATE()
Function fun_private() const
{
return insert_;
}
private:
list_inserter& operator=( const list_inserter& );
Function insert_;
};
template< class Function >
inline list_inserter< Function >
make_list_inserter( Function fun )
{
return list_inserter< Function >( fun );
}
template< class Function, class Argument >
inline list_inserter<Function,Argument>
make_list_inserter( Function fun, Argument* )
{
return list_inserter<Function,Argument>( fun );
}
template< class C >
inline list_inserter< assign_detail::call_push_back<C>,
BOOST_DEDUCED_TYPENAME C::value_type >
push_back( C& c )
{
static BOOST_DEDUCED_TYPENAME C::value_type* p = 0;
return make_list_inserter( assign_detail::call_push_back<C>( c ),
p );
}
template< class C >
inline list_inserter< assign_detail::call_push_front<C>,
BOOST_DEDUCED_TYPENAME C::value_type >
push_front( C& c )
{
static BOOST_DEDUCED_TYPENAME C::value_type* p = 0;
return make_list_inserter( assign_detail::call_push_front<C>( c ),
p );
}
template< class C >
inline list_inserter< assign_detail::call_insert<C>,
BOOST_DEDUCED_TYPENAME C::value_type >
insert( C& c )
{
static BOOST_DEDUCED_TYPENAME C::value_type* p = 0;
return make_list_inserter( assign_detail::call_insert<C>( c ),
p );
}
template< class C >
inline list_inserter< assign_detail::call_push<C>,
BOOST_DEDUCED_TYPENAME C::value_type >
push( C& c )
{
static BOOST_DEDUCED_TYPENAME C::value_type* p = 0;
return make_list_inserter( assign_detail::call_push<C>( c ),
p );
}
template< class C >
inline list_inserter< assign_detail::call_add_edge<C> >
add_edge( C& c )
{
return make_list_inserter( assign_detail::call_add_edge<C>( c ) );
}
} // namespace 'assign'
} // namespace 'boost'
#undef BOOST_ASSIGN_PARAMS1
#undef BOOST_ASSIGN_PARAMS2
#undef BOOST_ASSIGN_PARAMS3
#undef BOOST_ASSIGN_MAX_PARAMETERS
#endif
// Boost.Assign library
//
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org/libs/assign/
//
#ifndef BOOST_ASSIGN_STD_VECTOR_HPP
#define BOOST_ASSIGN_STD_VECTOR_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <boost/assign/list_inserter.hpp>
#include <boost/config.hpp>
#include <vector>
namespace boost
{
namespace assign
{
template< class V, class A, class V2 >
inline list_inserter< assign_detail::call_push_back< std::vector<V,A> >, V >
operator+=( std::vector<V,A>& c, V2 v )
{
return push_back( c )( v );
}
}
}
#endif
SUBDIRS = bind10 bindctl cfgmgr msgq host cmdctl auth parkinglot
SUBDIRS = bind10 bindctl cfgmgr msgq host cmdctl auth
......@@ -2,6 +2,8 @@ AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_builddir)/src/lib -I$(top_buildd
pkglibexecdir = $(libexecdir)/@PACKAGE@
CLEANFILES = *.gcno *.gcda
pkglibexec_PROGRAMS = b10-auth
b10_auth_SOURCES = auth_srv.cc auth_srv.h
b10_auth_SOURCES += common.cc common.h
......
{
"data_specification": {
"module_name": "ParkingLot"
"module_spec": {
"module_name": "Auth",
"config_data": [
{ "item_name": "default_name",
"item_type": "string",
"item_optional": False,
"item_default": "Hello, world!"
},
{ "item_name": "zone_list",
"item_type": "list",
"item_optional": False,
"item_default": [],
"list_item_spec":
{ "item_name": "zone_name",
"item_type": "string",
"item_optional": True,
"item_default": ""
}
}
],
"commands": [
{
"command_name": "print_message",
"command_description": "Print the given message to stdout",
"command_args": [ {
"item_name": "message",
"item_type": "string",
"item_optional": False,
"item_default": ""
} ]
},
{
"command_name": "shutdown",
"command_description": "Shut down BIND 10",
"command_args": []
}
]
}
}
......@@ -32,6 +32,7 @@
#include <dns/rrset.h>
#include <dns/rrttl.h>
#include <dns/message.h>
#include <config/ccsession.h>
#include <cc/data.h>
......@@ -46,6 +47,7 @@ using namespace std;
using namespace isc::dns;
using namespace isc::dns::rdata;
using namespace isc::data;
using namespace isc::config;
AuthSrv::AuthSrv(int port) {
int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
......@@ -120,5 +122,11 @@ AuthSrv::updateConfig(isc::data::ElementPtr config) {
// todo: what to do with port change. restart automatically?
// ignore atm
//}
return isc::data::Element::createFromString("{ \"result\": [0] }");
if (config) {
std::cout << "[XX] auth: new config " << config << std::endl;
} else {
std::cout << "[XX] auth: new config empty" << std::endl;
}