From: Tomek Mrugalski Date: Mon, 10 Oct 2011 11:48:27 +0000 (+0200) Subject: Part 1 of 1186 review changes X-Git-Tag: perftcpdns_before_epoll~86^2~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfea61834be28bc3c2413afb586971fc04056a41;p=thirdparty%2Fkea.git Part 1 of 1186 review changes - include paths fixed - dangling spaces removed - many parameters are now passed by reference - added doxygen comments for all methods in dhcp6_srv.h - src/bin/dhcp6/Makefile.am no longer references Pkt6.{cc|h} --- diff --git a/src/bin/dhcp6/Makefile.am b/src/bin/dhcp6/Makefile.am index 0535a5cfba..dd5cd42fed 100644 --- a/src/bin/dhcp6/Makefile.am +++ b/src/bin/dhcp6/Makefile.am @@ -4,9 +4,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns AM_CPPFLAGS += -I$(top_srcdir)/src/lib/cc -I$(top_builddir)/src/lib/cc -AM_CPPFLAGS += -I$(top_srcdir)/src/lib/asiolink -AM_CPPFLAGS += -I$(top_builddir)/src/lib/asiolink -AM_CPPFLAGS += $(BOOST_INCLUDES) + AM_CPPFLAGS += $(BOOST_INCLUDES) AM_CXXFLAGS = $(B10_CXXFLAGS) @@ -31,8 +29,10 @@ spec_config.h: spec_config.h.pre BUILT_SOURCES = spec_config.h pkglibexec_PROGRAMS = b10-dhcp6 + b10_dhcp6_SOURCES = main.cc iface_mgr.cc dhcp6_srv.cc b10_dhcp6_SOURCES += iface_mgr.h dhcp6_srv.h + b10_dhcp6_LDADD = $(top_builddir)/src/lib/dhcp/libdhcp.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/cc/libcc.la diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 2a61592d2b..05e3c77dba 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -18,7 +18,7 @@ #include "dhcp6/dhcp6_srv.h" #include "dhcp/option6_ia.h" #include "dhcp/option6_iaaddr.h" -#include "io_address.h" +#include "asiolink/io_address.h" using namespace std; using namespace isc; @@ -32,9 +32,9 @@ Dhcpv6Srv::Dhcpv6Srv() { // it may throw something if things go wrong IfaceMgr::instance(); - if (!setServerID()) { - isc_throw(Unexpected, "Failed to set up server-id."); - } + /// @todo: instantiate LeaseMgr here once it is imlpemented. + + setServerID(); } Dhcpv6Srv::~Dhcpv6Srv() { @@ -76,6 +76,9 @@ Dhcpv6Srv::run() { case DHCPV6_DECLINE: rsp = processDecline(query); break; + case DHCPV6_INFORMATION_REQUEST: + rsp = processInfRequest(query); + break; default: cout << "Unknown pkt type received:" << query->getType() << endl; @@ -84,13 +87,13 @@ Dhcpv6Srv::run() { cout << "Received " << query->data_len_ << " bytes packet type=" << query->getType() << endl; cout << query->toText(); - if (rsp != boost::shared_ptr()) { + if (rsp) { rsp->remote_addr_ = query->remote_addr_; rsp->local_addr_ = query->local_addr_; rsp->remote_port_ = DHCP6_CLIENT_PORT; rsp->local_port_ = DHCP6_SERVER_PORT; rsp->ifindex_ = query->ifindex_; - rsp->iface_ = query->iface_; + rsp->iface_ = query->iface_; cout << "Replying with:" << rsp->getType() << endl; cout << rsp->toText(); cout << "----" << endl; @@ -108,12 +111,7 @@ Dhcpv6Srv::run() { return (true); } -boost::shared_ptr