NetBurner 3.5.0
PDF Version
 
command.h
Go to the documentation of this file.
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
18#ifndef _NB_COMMAND_H
19#define _NB_COMMAND_H
20
21#include <basictypes.h>
22#include <stdio.h>
23
24#if defined(NB_SSH_SUPPORTED)
25// SSH Required Resources
27#endif
28
34#define CMD_OK (0)
35#define CMD_CLOSE (1)
36#define CMD_FAIL (2)
37#define CMD_AUTH_FAIL (3)
38#define CMD_TO_MANY_FDS (4)
39#define CMD_FAILED_SSH_KEY_GEN (5)
49enum ListenOn : int8_t
50{
53};
66extern int (*CmdAuthenticateFunc)(const char *name, const char *passwd);
67
68#if defined(NB_SSH_SUPPORTED)
81extern int (*CmdAuthenticateSshFunc)(const char *name, const char *authVal, AuthType authType);
82#endif
83
98extern int (*CmdCmd_func)(const char *command, FILE *fRespondto, void *pData);
99
116extern int (*CmdChar_func)(char command, FILE *fRespondto, void *pData);
117
131extern void *(*CmdConnect_func)(FILE *fRespondto);
132
143extern void (*CmdPrompt_func)(FILE *fRespondto, void *pData);
144
150#define CMD_DIS_CAUSE_TIMEOUT (1)
151#define CMD_DIS_CAUSE_CLOSED (2)
152#define CMD_DIS_SOCKET_CLOSED (3)
153#define CMD_DIS_AUTH_FAILED (4)
167extern void (*CmdDisConnect_func)(FILE *fRespondto, int cause, void *pData);
168
169extern int CmdIdleTimeout;
171
172extern const char
174
183int CmdStartCommandProcessor(int priority);
184
185/* Stop the running process and close all open sockets/fd's */
186void CmdStopCommandProcessor();
187
200int CmdAddCommandFd(int fd, bool require_auth, bool time_out_conn, bool local_echo = true);
201
211
222int CmdListenOnTcpPort(uint16_t port, int do_telnet_processing, int max_connections);
223
234int CmdListenQuietOnTcpPort(uint16_t port, int do_telnet_processing, int max_connections);
235
236#if defined(NB_SSH_SUPPORTED)
247int CmdListenOnSshPort(uint16_t port, int max_connections);
248
259int CmdListenQuietOnSshPort(uint16_t port, int max_connections);
260#endif
261
270int CmdStopListeningOnTcpPort(uint16_t port);
271
272#if defined(NB_SSH_SUPPORTED)
281int CmdStopListeningOnSshPort(uint16_t port);
282#endif
283
291void SendToAll(const char *buffer, int len, bool include_serial_ports);
292
293#endif /* _NB_COMMAND_H */
294
NetBurner User Authorization Manager.
ListenOn
The various remote channels that the command processor can listen to.
Definition command.h:50
@ eListenOnTcp
Listen on TCP.
Definition command.h:51
@ eListenOnSsh
Listen on SSH.
Definition command.h:52
int(* CmdCmd_func)(const char *command, FILE *fRespondto, void *pData)
The command processing callback function for handling string commands.
const char * Cmdlogin_prompt
If this is defined, then it will be sent to the socket on connection before Authentication is tried.
int CmdListenQuietOnSshPort(uint16_t port, int max_connections)
Start listening for a connection over SSH, but without the siggnon or password.
void(* CmdPrompt_func)(FILE *fRespondto, void *pData)
Prompt callback function. If this function is not NULL, then the system will call this function every...
int(* CmdAuthenticateSshFunc)(const char *name, const char *authVal, AuthType authType)
External Authentication function CALLBACK for SSH connections, used to verify username and password....
int CmdAddCommandFd(int fd, bool require_auth, bool time_out_conn, bool local_echo=true)
Add an established FD connection to the list of fd's managed by the command processor.
int CmdStartCommandProcessor(int priority)
Start the command processor.
int CmdStopListeningOnSshPort(uint16_t port)
Stop Listening for connections on the specified port. Also closes all open connections that were base...
void(* CmdDisConnect_func)(FILE *fRespondto, int cause, void *pData)
Dis-Connect callback function, if this function is not NULL then the system will call this function e...
int CmdStopListeningOnTcpPort(uint16_t port)
Stop Listening for connections on the specified port. Also closes all open connections that were base...
int CmdRemoveCommandFd(int fd)
Remove an established FD (either a TCP session, a serial connection, or an SSH session).
int CmdListenOnSshPort(uint16_t port, int max_connections)
Start listening for a connection over SSH.
int(* CmdChar_func)(char command, FILE *fRespondto, void *pData)
The command processing callback function for handling single character commands. If this is implement...
int(* CmdAuthenticateFunc)(const char *name, const char *passwd)
External Authentication function CALLBACK for TCP connections, used to verify username and password....
int CmdIdleTimeout
void SendToAll(const char *buffer, int len, bool include_serial_ports)
Send a message to all connected sockets, excluding "Listening sockets".
int CmdListenQuietOnTcpPort(uint16_t port, int do_telnet_processing, int max_connections)
Start listening for a connection over TCP, but without the siggnon or password.
int CmdListenOnTcpPort(uint16_t port, int do_telnet_processing, int max_connections)
Start listening for a connection over TCP.
AuthType
The types of authorization requests that are managed. These just indicate what the has value is,...
Definition UserAuthManager.h:44