From: Michael Altizer (mialtize) Date: Tue, 27 Jun 2017 18:47:14 +0000 (-0400) Subject: Merge pull request #925 in SNORT/snort3 from control_coverage to master X-Git-Tag: 3.0.0-239~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e026ff5bd30198bace07556491a206b2c6ef2fc;p=thirdparty%2Fsnort3.git Merge pull request #925 in SNORT/snort3 from control_coverage to master Squashed commit of the following: commit 1f704f85c48153704fc9a8ee4eb36514afbc55fb Author: Bhagya Tholpady Date: Tue Jun 13 23:43:46 2017 -0400 documentation updates to control channel code --- diff --git a/src/dev_notes.txt b/src/dev_notes.txt index 62f905a88..47e88274b 100644 --- a/src/dev_notes.txt +++ b/src/dev_notes.txt @@ -13,8 +13,8 @@ It also does housekeeping functions like servicing signal flags, shell commands, etc. The shell has to be explicitly enabled at build time to be available and -then must be configured at run time to be activated. Presently only one -remote shell at a time is supported. +then must be configured at run time to be activated. Multiple simultaneous +remote shells are supported. Unit test and piglet test harness build options also impact actual execution. diff --git a/src/main/control.h b/src/main/control.h index 8828275ca..8a27d018d 100644 --- a/src/main/control.h +++ b/src/main/control.h @@ -15,6 +15,10 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +// control.h author Bhagya Tholpady +// +// Header file defining control class used for remote and local connections. +// Each control class has a request and shell associated with it. #ifndef CONTROL_H #define CONTROL_H diff --git a/src/main/control_mgmt.cc b/src/main/control_mgmt.cc index c91ad0e26..014ab3039 100644 --- a/src/main/control_mgmt.cc +++ b/src/main/control_mgmt.cc @@ -89,11 +89,6 @@ void ControlMgmt::reconfigure_controls() } } -std::vector& ControlMgmt::get_controls() -{ - return controls; -} - void ControlMgmt::delete_controls() { for ( auto control : controls ) diff --git a/src/main/control_mgmt.h b/src/main/control_mgmt.h index 46e3f5d62..192ef3b9a 100644 --- a/src/main/control_mgmt.h +++ b/src/main/control_mgmt.h @@ -15,6 +15,10 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +// control_mgmt.h author Bhagya Tholpady +// +// This provides functions to create and control remote/local connections, +// socket creation/deletion/management functions, and shell commands used by the analyzer. #ifndef CONTROL_MGMT_H #define CONTROL_MGMT_H @@ -39,7 +43,6 @@ public: static bool find_control(int fd, std::vector::iterator& control); static void delete_control(std::vector::iterator& control); - static std::vector& get_controls(); static int socket_init(); static int socket_term(); diff --git a/src/main/dev_notes.txt b/src/main/dev_notes.txt index b2ebdd66a..aeae057fc 100644 --- a/src/main/dev_notes.txt +++ b/src/main/dev_notes.txt @@ -28,6 +28,14 @@ will swap in a new configuration at the earliest convenience, and the ROTATE command will cause open per-thread output files to be closed, rotated, and reopened anew. +On Control connections and management: + +Remote control connections can be created using tcp sockets or unix sockets. +Each control connection (local and/or remote) has a request and shell +associated with it. The asynchronous control commands within the control +connection are blocking and control connections are not returned the shell prompt +until the control commands are completed. + Re THREAD_LOCAL defined in thread.h: diff --git a/src/main/request.h b/src/main/request.h index eaeb88326..f2630875d 100644 --- a/src/main/request.h +++ b/src/main/request.h @@ -16,6 +16,9 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //-------------------------------------------------------------------------- +// This header includes request class which is used by the control connections +// to read control commands and send responses for those commands. + #ifndef REQUEST_H #define REQUEST_H