1. 20 Nov, 2018 7 commits
    • Thomas Markwalder's avatar
      [#260, !120] PacketQueueMgr4/6 are no longer singletons · 0741a035
      Thomas Markwalder authored
          dhcp::IfaceMgr simply owns instances of the packet queue
          managers, rather than them being singletons.
      0741a035
    • Thomas Markwalder's avatar
      [#260,!120] Moved thread creation from Receiver ctor to new start function · f205b568
      Thomas Markwalder authored
          dhcp::Receiver - moved creating receiver's thread out of the constructor
          to new Receier::start() method.  This alleviates issues with thread worker
          functions referring to Receiver members before Receiver fully exists.
      f205b568
    • Thomas Markwalder's avatar
      [#260,!120] Extracted IfaceMgr thread bits into new class, isc::dhcp::Receiver · 99ce2f4b
      Thomas Markwalder authored
      src/lib/dhcp/iface_mgr.*
          Extracted the thread, watch sockets, mutex, and error message members
          from IfaceMgr and wrapped them in a new class, isc:dhcp::Receiver.
      
          IfaceMgr::add_fd(int fd, int& maxfd, fd_set* sockets) - new
          convenience method for adding descriptors to fd_set(s)
      
      src/lib/dhcp/tests/iface_mgr_unittest.cc
          class ReceiverTest - new test fixture
          TEST_F(ReceiverTest, receiverClassBasics)  - new unit test
      99ce2f4b
    • Thomas Markwalder's avatar
      [#260,!120] Addressed most of review comments · 924a4f46
      Thomas Markwalder authored
          Addressed all comments except parsing regen and
          refactor of watch sockets in IfaceMgr.  Doing those
          separately.
      924a4f46
    • Thomas Markwalder's avatar
    • Thomas Markwalder's avatar
      [#260, !120] Beefed up IfaceMgr unit tests · 803d464c
      Thomas Markwalder authored
      src/lib/dhcp/iface_mgr.*
          IfaceMgr::isReceiverRunning() - new, public convenience method
      
      src/lib/dhcp/tests/iface_mgr_unittest.cc
          Revamped sendReceive<4/6> tests to test both direct and
          indirect packet reception
      
          TEST_F(IfaceMgrTest, configureDHCPPacketQueueTest4)
          TEST_F(IfaceMgrTest, configureDHCPPacketQueueTest6) - new tests
      803d464c
    • Thomas Markwalder's avatar
      [#260,!20] Packet queueing is now optional · bbb822b1
      Thomas Markwalder authored
      src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc
          ControlledDhcpv<4/6>Srv::processConfig() - now calls
              IfaceMgr::configureDHCPPacketQueue
      
      src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy
          dhpc-queue-control parsing updated to enforce
          enable-queue/queue-type rules
      
      src/bin/dhcp<4/6>/tests/config_parser_unittest.cc
          TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl)
          TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid)
      
      src/lib/dhcp/iface_mgr.*
          IfaceMgr
          - closeSockets()  - now calls stopDHCPReceiver
      
          - openSockets<4/6>() -  now calls startDHCPReceiver
      
          - receive<4/6>Indirect() - new function which monitors receiver
          thread watch sockets, reads DHCP packets from queue
      
          - receive<4/6>Direct() - new function which monitors and reads DHCP
          packets from interface sockets directly
      
          - receive<4/6>() - rewritten to call receive<4/6>Indirect
          if receiver thread is running, otherwise it calls receive<4/6>Direct
      
          - configureDHCPPacketQueue() - new function which either enables queuing
          by creating a new packet queue, or disables it by destroying the
          existing queue
      
      src/lib/dhcp/packet_queue_mgr.h
          PacketQueue::destroyPacketQueue() - new function
      
      src/lib/dhcp/packet_queue_mgr<4/6>.cc
          PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a
          default packet queue
      
      src/lib/dhcpsrv/cfg_iface.cc
          CfgIface::closeSockets() - removed call to stopDHCPReceiver
          CfgIface::openSockets() - removed call to startDHCPReceiver
      
      src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.*
          DHCPQueueControlParser
          - removed unused family_ member
          - parse() - added support for enable-queue
      
      src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc
          - new file
      bbb822b1
  2. 05 Nov, 2018 1 commit
    • Thomas Markwalder's avatar
      [#42] Implemented PacketQueueMgr class · 90fd7ebf
      Thomas Markwalder authored
      New files:
          src/lib/dhcp/packet_queue_mgr.h
          src/lib/dhcp/packet_queue_mgr4.cc
          src/lib/dhcp/packet_queue_mgr4.h
          src/lib/dhcp/packet_queue_mgr6.cc
          src/lib/dhcp/packet_queue_mgr6.h
          src/lib/dhcp/tests/packet_queue_mgr4_unittest.cc
          src/lib/dhcp/tests/packet_queue_mgr6_unittest.cc
          src/lib/dhcp/tests/packet_queue_testutils.h
      
      src/bin/dhcp4/ctrl_dhcp4_srv.cc
          Cleaned up packet queue config block
      
      src/bin/dhcp4/dhcp4_lexer.ll
      src/bin/dhcp4/dhcp4_parser.yy
      src/bin/dhcp4/tests/config_parser_unittest.cc
          added queue-type
      
      src/bin/dhcp4/dhcp4_messages.mes
          added DHCP4_CONFIG_PACKET_QUEUE message
      
      src/lib/dhcp/Makefile.am
          packet_queue_mgr.h
          packet_queue_mgr4.cc packet_queue_mgr4.h
          packet_queue_mgr6.cc packet_queue_mgr6.h
      
      src/lib/dhcp/iface_mgr.*
          Replaced packet queue members with PQM members
          Added PQM instantion to IfaceMgr ctor
      
      src/lib/dhcp/packet_queue.h
          added getInfo,getInfoStr
      
      src/lib/dhcp/tests/Makefile.am
          packet_queue_mgr4_unittest.cc
          packet_queue_mgr6_unittest.cc
      
      src/lib/dhcpsrv/parsers/queue_control_parser.cc
          added queue-type
      90fd7ebf
  3. 01 Nov, 2018 1 commit
    • Thomas Markwalder's avatar
      [#42, !103] Interrim commit, kea-dhcp4 supports "queue-control" · 036d249f
      Thomas Markwalder authored
          kea-dhcp4 will parse and use "queue-control" to configure ring
          buffer size:
      
          "Dhcp4":
          {
              "queue-control": {
                  # max number of packets the ring will hold
                  "capacity" : 100
              },
          :
      
          This is an interrim commit for testing purposes.
          Expect a fair amount of refactoring in subsequent commits.
      
      New files:
      	src/lib/dhcp/queue_control.cc
      	src/lib/dhcp/queue_control.h
      	src/lib/dhcp/tests/queue_control_unittest.cc
      	src/lib/dhcpsrv/parsers/queue_control_parser.cc
      	src/lib/dhcpsrv/parsers/queue_control_parser.h
      
      src/bin/dhcp4/ctrl_dhcp4_srv.cc
          ControlledDhcpv4Srv::processConfig() -
              added logic to set packet queue controller
      
      src/bin/dhcp4/dhcp4_lexer.ll b/src/bin/dhcp4/dhcp4_lexer.ll
      src/bin/dhcp4/dhcp4_parser.yy
      src/bin/dhcp4/parser_context.*
          Added queue-control parsing
      
      src/bin/dhcp4/json_config_parser.cc
          configureDhcp4Server() - recognize and parse "queue-control"
      
      src/bin/dhcp4/tests/config_parser_unittest.cc
          TEST_F(Dhcp4ParserTest, queueControl)
          TEST_F(Dhcp4ParserTest, queueControlInvalid)
          - new tests
      
      src/lib/dhcp/iface_mgr.*
          IfaceMgr::getPacketQueueControl4()
          IfaceMgr::setPacketQueueControl4()
          IfaceMgr::getPacketQueueControl6()
          IfaceMgr::setPacketQueueControl6()
      
      src/lib/dhcp/packet_queue.*
          Use QueueControl class
      
      src/lib/dhcpsrv/srv_config.*
          Added QueueControl member, getter/setter
          SrvConfig::toElement() - now emits queue-control if not null
      036d249f
  4. 29 Oct, 2018 1 commit
    • Thomas Markwalder's avatar
      [#42,!103] Initial receiver thread and packet queuing · 21cac7d0
      Thomas Markwalder authored
      New files:
          src/lib/dhcp -
          packet_queue.h - defines packet queuing template classes
          socket_info.h - contains existing class extracted iface_mgr.h
          tests/packet_queue4_unittest.cc
          tests/packet_queue6_unittest.cc
      
      src/lib/dhcp/iface_mgr.*
      IfaceMgr:: - new functions
          - receiveDHCP<4/6>Packets() - thread worker function which
          monitors interface sockets, enqueues packets as they are read
      
          - receiveDHCP<4/6>Packet() - reads a single packet from a socket
      
          - startDHCPReceiver(const uint16_t family) - runs
          receiveDHCP<4/6?appropriate worker function in a thread
      
          - stopReceiver() - stops the receiver thread
      
          - setPacketQueue<4/6> - replaces the default packet queue instance
      
          receiveDHCP<4/6>() - modified to monitor receiver watch
          socekts rather than interface sockets.  Dequeue packets
          from packet queue.
      
      src/lib/dhcp/tests/iface_mgr_unittest.cc
          TEST_F(IfaceMgrTest, packetQueue4)
          TEST_F(IfaceMgrTest, packetQueue6)
      
      src/lib/dhcpsrv/cfg_iface.cc
          CfgIface::openSockets() - starts DHCP receiver
          CfgIface::closeSockets() - stops DHCP receiver
      21cac7d0
  5. 18 Jan, 2018 1 commit
  6. 23 Jul, 2017 5 commits
  7. 09 Feb, 2017 1 commit
  8. 09 Jan, 2017 1 commit
  9. 14 Dec, 2016 1 commit
  10. 17 Aug, 2016 1 commit
  11. 14 Mar, 2016 1 commit
  12. 16 Dec, 2015 1 commit
  13. 04 Sep, 2015 1 commit
  14. 08 Jul, 2015 1 commit
  15. 11 Jun, 2015 1 commit
  16. 12 May, 2015 2 commits
  17. 27 Apr, 2015 1 commit
  18. 09 Apr, 2015 1 commit
  19. 13 Mar, 2015 2 commits
  20. 16 Feb, 2015 2 commits
  21. 13 Feb, 2015 2 commits
  22. 17 Dec, 2014 1 commit
  23. 26 Aug, 2014 1 commit
  24. 21 Aug, 2014 1 commit
    • Marcin Siodelski's avatar
      [3527] Fixed the failing IfaceMgrTest::detectIfaces. · 83b5c2c9
      Marcin Siodelski authored
      The updated code uses interface index to match the interface detected by
      the test with the interface found by the IfaceMgr. This is to avoid issues
      on Linux whereby Netlink-based implementation doesn't return the virtual
      interface names, but rather physical interface names.
      83b5c2c9
  25. 20 Aug, 2014 1 commit
  26. 14 Aug, 2014 1 commit