BIND 10 #1651: Integrate DHCP4 process startup into BIND 10

BIND 10 Development do-not-reply at isc.org
Fri Jun 8 13:15:31 UTC 2012


#1651: Integrate DHCP4 process startup into BIND 10
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  tomek
  stephen                            |                Status:  reviewing
                       Type:  task   |             Milestone:  DHCP-
                   Priority:         |  Sprint-20120611
  medium                             |            Resolution:
                  Component:  dhcp4  |             Sensitive:  0
                   Keywords:         |           Sub-Project:  DHCP
            Defect Severity:  N/A    |  Estimated Difficulty:  0
Feature Depending on Ticket:         |           Total Hours:  0
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by tomek):

 Replying to [comment:5 stephen]:
 > Regarding testing:
 >
 > > We could write them now, but really don't know how to simulate
 commands.
 > Do the tests in src/bin/auth/tests give any clue to this?
 I was hoping for a bit more specific location. Another place where I
 looked for is srv/bin/resolver/tests.

 > '''src/bin/dhcp4/dhcp4_srv.h'''[[BR]]
 > "instructs" should start with capital I.
 Done.

 > '''src/bin/dhcp4/main.cc'''[[BR]]
 > verbose_mode should have a comment descibing what it is.
 >
 > I don't like global objects either.  However, if you put the declaration
 of "dhcp4" in the anonymous namespace (preferred over declaring it static)
 it is scope-limited to the main.cc file, so I would not be too concerned
 about it.
 To test session code, I had to refactor it a bit. To call session related
 methods/functions, they were moved to separate class ControlledDhcpv4Srv.
 The original idea still stands - for embedded environment, we will
 instantiate Dhcpv4Srv object directly. For "normal" BIND10 environment, we
 will create ControlledDhcpv4Srv. This new class code is available in
 ctrl_dhcp4_srv.{cc|h} files.

 > The logic behind extracting the control socket and plugging it into the
 interface manager should be explained in a comment. (In fact, a fuller
 description of the interaction between asio and select() should be
 explained in a header to the file, as it is not limited to a single
 function.)
 It is described thoroughly in doc/devel/02-dhcp.dox. I'm not sure if you
 haven't seen this description, saying that it is not detailed enough or
 located in the wrong place?

 This is a generic description of the architecture and spans several
 classes, thus no single class or file is the right place for such
 description, thus separate file. I have added pointers to that file in
 main.cc, dhcp4_srv.h and ctrl_dhcp4_srv.h.

 > Function names should be likeThis (not like_this).
 Fixed.

 > disconnect_session (or disconnectSession) needs a header comment.
 It was moved to a newly created ctrl_dhcpv4_srv.{cc|h} class, renamed and
 commented appropriately.

 The code has been refactored significantly. Most of the code that used to
 be in main.cc is now part of the ControlledDhcpv4Srv class. There are no
 more global objects anymore.

-- 
Ticket URL: <http://bind10.isc.org/ticket/1651#comment:6>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list