Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
senf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wiback
senf
Commits
79d1b9ef
Commit
79d1b9ef
authored
15 years ago
by
g0dil
Browse files
Options
Downloads
Patches
Plain Diff
Utils/Console: UDPServer documentation
parent
1302401d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Utils/Console/Mainpage.dox
+20
-1
20 additions, 1 deletion
Utils/Console/Mainpage.dox
Utils/Console/UDPServer.hh
+18
-2
18 additions, 2 deletions
Utils/Console/UDPServer.hh
with
38 additions
and
3 deletions
Utils/Console/Mainpage.dox
+
20
−
1
View file @
79d1b9ef
...
@@ -524,7 +524,7 @@
...
@@ -524,7 +524,7 @@
\subsection console_noninteractive Non-interactive network console
\subsection console_noninteractive Non-interactive network console
After a new connection is established, the console server waits a short time for data to arrive.
After a new connection is established, the console server waits a short time for data to arrive.
arrive.
Only if nothing happens in the first 500ms, an interactive session is initialized.
Only if nothing happens in the first 500ms, an interactive session is initialized.
By sending data immediately after opening the connection, the console is switched into
By sending data immediately after opening the connection, the console is switched into
non-interactive mode. In this mode, no prompt is displayed. In this mode, commands are \e not
non-interactive mode. In this mode, no prompt is displayed. In this mode, commands are \e not
...
@@ -549,6 +549,25 @@
...
@@ -549,6 +549,25 @@
Commands are executed as soon as the terminating character (';', '{' or '}') is received or when
Commands are executed as soon as the terminating character (';', '{' or '}') is received or when
the sending end of the connection is closed.
the sending end of the connection is closed.
\section console_udp Non-interactive UDP console
The UDP console allows to script the console tree via UDP packets. Every UDP packet must be a
complete command (or sequence of commands). The combined reply of all these commands will be
returned in a single UDP packet. This reply can be disabled or directed to a different address.
To start a UDP server, just create an instance of the senf::console::UDPServer class
\code
senf::console::UDPServer server (senf::INet4SocketAddress("127.0.0.1:23232"));
\endcode
(Remember to enter the scheduler main-loop for processing)
Commands may then be sent to this UDP console e.g. using netcat
<pre>
$ echo "cd sys; ls" | nc6 -u --half-close localhost 23232 2>/dev/null
</pre>
\see senf::console::UDPServer
*/
*/
/** \defgroup console_commands Supported command types
/** \defgroup console_commands Supported command types
...
...
This diff is collapsed.
Click to expand it.
Utils/Console/UDPServer.hh
+
18
−
2
View file @
79d1b9ef
...
@@ -40,7 +40,19 @@
...
@@ -40,7 +40,19 @@
namespace
senf
{
namespace
senf
{
namespace
console
{
namespace
console
{
/** \brief
/** \brief UDP Console server
This class provides UDP access to the console to allow remote scripting. The UDP console
does support multicast operation.
Every UDP packet will be executed in a clean context: No directory groups are open/closed,
and the current directory is always the root directory.
By default, the server will send command replies via UDP to the sender of the corresponding
incoming command. Replies may however either be completely disabled or be sent to a fixed
address (which may be a multicast address).
\ingroup console_access
*/
*/
class
UDPServer
class
UDPServer
:
public
boost
::
noncopyable
:
public
boost
::
noncopyable
...
@@ -60,14 +72,18 @@ namespace console {
...
@@ -60,14 +72,18 @@ namespace console {
///@{
///@{
explicit
UDPServer
(
senf
::
INet4SocketAddress
const
&
address
);
explicit
UDPServer
(
senf
::
INet4SocketAddress
const
&
address
);
///< Open UDP server on \a address
explicit
UDPServer
(
senf
::
INet6SocketAddress
const
&
address
);
explicit
UDPServer
(
senf
::
INet6SocketAddress
const
&
address
);
///< Open UDP server on \a address
///@}
///@}
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
UDPServer
&
replies
(
bool
enable
);
UDPServer
&
replies
(
bool
enable
);
///< Enable or disable reply packets
UDPServer
&
replies
(
senf
::
INet4SocketAddress
const
&
address
);
UDPServer
&
replies
(
senf
::
INet4SocketAddress
const
&
address
);
///< Send replies to \a address
UDPServer
&
replies
(
senf
::
INet6SocketAddress
const
&
address
);
UDPServer
&
replies
(
senf
::
INet6SocketAddress
const
&
address
);
///< Send replies to \a address
DirectoryNode
&
root
()
const
;
///< Get root node
DirectoryNode
&
root
()
const
;
///< Get root node
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment