$Revision: 1.39 $
Protocol config module (pc). This is the protocol that the admin uses to talk to the server.
Status: NOT REVUED, NOT TESTED
Maximum size of input that can be recieved from the client.
Main function that talks to the user connected on the given socket. Starts by authenticating the user (if this mode is active) and greeting her with the uptime data. Then it loops reading and executing commands until the "quit" command (or any other command that causes process_input to return 0).void PC_interact ( int sock )
Prototyped in: | /home/shane/release/RIP/include/protocol_config.h | |
Calls: | CO_get_authenticate() | co/constants.c |
CO_get_prompt() | co/constants.c | |
CO_get_welcome() | co/constants.c | |
ER_inf_va() | er/er.c | |
authenticate_user() | pc/protocol_config.c | |
process_input() | pc/protocol_config.c | |
show_uptime() | pc/pc_commands.c | |
SK_cd_gets(), SK_cd_printf(), SK_cd_puts(), SK_getpeerip(), SK_getpeername(), TA_increment(), TA_setactivity(), UT_free_real(), memset(), ut_string_compress() |
int command_execute ( Command* comm, char* comm_name, char* input, GString* output, sk_conn_st* condat )
returns the code of the last command. Code PC_RET_QUIT is reserved to indicate that the connection should be closed.
Prototyped in: | /home/shane/release/RIP/include/protocol_config.h | |
Calls: | find_command() | pc/protocol_config.c |
show_commands() | pc/protocol_config.c | |
UT_free_real(), fprintf(), g_string_sprintfa(), strlen(), strtok_r(), wr_real_string() | ||
Called by: | command_save() | pc/pc_commands.c |
command_set() | pc/pc_commands.c | |
command_show() | pc/pc_commands.c | |
command_stop() | pc/pc_commands.c | |
process_input() | pc/protocol_config.c |
Prototyped in: | /home/shane/release/RIP/include/protocol_config.h | |
Calls: | g_string_sprintfa() | |
Called by: | command_execute() | pc/protocol_config.c |
command_help() | pc/pc_commands.c |
Included from: | /usr/include/time.h | |
Calls: | __posix_asctime_r() |
Authenticates the user - asks for password and checks it. The password is echoed by the tcp stack, to disable that one would have to attach a tty to this connection and switch to raw mode or try the hard way - renegotiate the telnet connection to switch to character mode (and, possibly, back). The latter has the drawback that to do it right it has to be able to check whether there's telnet on the other side - otherwise, if the connection is made by a program just connecting to the socket, garbage will result. However, in such case password checking might be not a good idea.static char* authenticate_user ( sk_conn_st* condat )
More:Author: ottrey marek - slight changes and documentation.
Calls: | PR_get_property(), SK_cd_gets(), SK_cd_puts(), UT_strdup_real(), crypt(), strcmp(), strncpy() | |
Called by: | PC_interact() | pc/protocol_config.c |
Included from: | /usr/include/time.h | |
Calls: | __posix_ctime_r() |
Finds a command by name in the array of command function structures.static int find_command ( char* comm_name, Command* comm )
Calls: | UT_free_real(), strcmp(), strtok_r(), wr_real_string() | |
Called by: | command_execute() | pc/protocol_config.c |
process_input() | pc/protocol_config.c |
Included from: | /usr/include/unistd.h | |
Calls: | __posix_getlogin_r() |
Process the input. Finds the proper command in the top level command array and invokes the function associated with it with the input and output data as arguments.static int process_input ( char* input, sk_conn_st* condat )
More:Author: ottrey marek - changes and documentation.
Calls: | CO_get_clear_screen() | co/constants.c |
CO_get_prompt() | co/constants.c | |
command_execute() | pc/protocol_config.c | |
command_help() | pc/pc_commands.c | |
find_command() | pc/protocol_config.c | |
SK_cd_printf(), SK_cd_puts(), g_string_free(), g_string_new() | ||
Called by: | PC_interact() | pc/protocol_config.c |
References Variables: | command | pc/protocol_config.c |
Included from: | /usr/include/dirent.h | |
Calls: | __posix_readdir_r() |
Included from: | /usr/include/signal.h | |
Calls: | __posix_sigwait() |
Included from: | /usr/include/unistd.h | |
Calls: | __posix_ttyname_r() |