Overview | Index by: file name | procedure name | procedure call | annotation

session.tcl Annotations

Created from source/session.tcl
Create, manage, query and terminate user and background sessions.

Procedure Summary
bg_sessions { }
          Get list of sids of background
close_all_bg_sessions { }
          Close all background
close_all_user_sessions { }
          Close all user
close_session { sid {reason Unspecified} }
          Terminate a session and release
common_state { sid }
          Set up a number of shared variables common for both 'user' and 'background' session
create_bg_session { username {authmode priv} {confmode global} }
          
create_user_session { pid cid fifos username type COLS ROWS }
          Establish a connection with a shell and set up a new user session @assume authmode 'user authmode and confmode 'entry' exist.
get_sessionId { }
          Finds the session Id of the session on behalf of the caller procedure.
is_bg_session { sid }
          Checks if a session is an background session or
is_user_session { sid }
          Checks if a session is a user session or
kill_shell { shell_pid }
          Kill
listen_for_connections { }
          Monitor for incoming control commands.
listen_for_connections { }
          Monitor for incoming control commands.
new_connection { con }
          
new_message { id }
          
proxy { sid from to }
          Proxy input from channel $from to channel $to, while inspecting forwarded data and taking actions as necessary.
register_new_fifos { pid }
          Assign a new pair of FIFOs for a new connection request for a User
user_sessions { }
          Get list of sids of user

Procedure Detail

bg_sessions

proc bg_sessions {  }
Get list of sids of background sessions
Returns:
The sid of all the user sessions in a list
Defined in:
session.tcl, line 624

close_all_bg_sessions

proc close_all_bg_sessions {  }
Close all background sessions
Defined in:
session.tcl, line 826

close_all_user_sessions

proc close_all_user_sessions {  }
Close all user sessions
Defined in:
session.tcl, line 817

close_session

proc close_session { sid {reason Unspecified} }
Terminate a session and release memory
Parameters:
sid - Session id
reason - The reason for Session termination.
Defined in:
session.tcl, line 761

common_state

proc common_state { sid }
Set up a number of shared variables common for both 'user' and 'background' session types.
Parameters:
sid - Session id
Defined in:
session.tcl, line 532

create_bg_session

proc create_bg_session { username {authmode priv} {confmode global} }
Parameters:
authmode - The authmode to enter to, and the relative root of authmodes to set. Default is "priv"
confmode - The confmode to enter to, and the relative root of confmodes to set. Default is "global"
Returns:
The session Id of the newly created user session.
Defined in:
session.tcl, line 448

create_user_session

proc create_user_session { pid cid fifos username type COLS ROWS }
Establish a connection with a shell and set up a new user session @assume authmode 'user authmode and confmode 'entry' exist. They should be created by 'base' module.
Parameters:
pid - The pid of the requesting shell.
cid - The connection Id as returned by ::comm::comm self.
fifos - A tuple: {input_fifo output_fifo} assigned to the shell.
type - The type of user session. Supported types: "console" "vty"
username - The name of the user connected to this session.
COLS - Reported number of supported columns in the user terminal.
ROWS - Reported number of supported rows in the user terminal.
Returns:
The session Id of the newly created user session. @error
Defined in:
session.tcl, line 247

get_sessionId

proc get_sessionId {  }
Finds the session Id of the session on behalf of the caller procedure. Since the entry point into Master for every MikroConf command execution is "::sysconf::execute", and this entry point uses the sid variable to store the sessionId, we can retrieve the value of sid from within this procedure. @assume The entry point is ::sysconf::execute and its second argument is the session id.
Returns:
The session id @error
Defined in:
session.tcl, line 842

is_bg_session

proc is_bg_session { sid }
Checks if a session is an background session or not.
Parameters:
sid - The sid to check if is an background session.
Returns:
The sid of all the user sessions in a list
Defined in:
session.tcl, line 646

is_user_session

proc is_user_session { sid }
Checks if a session is a user session or not.
Parameters:
sid - The sid to check if is an user session.
Returns:
The sid of all the user sessions in a list
Defined in:
session.tcl, line 633

kill_shell

proc kill_shell { shell_pid }
Kill shell.
Parameters:
shell_pid - Shell's PID.
Defined in:
session.tcl, line 657

listen_for_connections

proc listen_for_connections {  }
Monitor for incoming control commands. We generate some errors, but mostly we let the errors generated by the procedures used herein to propagate back to the caller (a shell or watchdog). @error
Defined in:
session.tcl, line 135

listen_for_connections

proc listen_for_connections {  }
Monitor for incoming control commands. We generate some errors, but mostly we let the errors generated by the procedures used herein to propagate back to the caller (a shell or watchdog). @error
Defined in:
session.tcl, line 135

new_connection

proc new_connection { con }
Defined in:
session.tcl, line 114

new_message

proc new_message { id }
Defined in:
session.tcl, line 52

proxy

proc proxy { sid from to }
Proxy input from channel $from to channel $to, while inspecting forwarded data and taking actions as necessary. This key sequences are recognized: Ctrl ^ + x : Terminate any currently executed command. Ctrl ^ + s : Resize terminal screen to correspond to the real terminal dimentions, if it is not does automatically. Ctrl ^ + r : Reset terminal screen. Useful if screen is distorded due to output etc. If connection in either $from or $to is lost, the session $sid is closed automatically.
Parameters:
sid - Session Id.
from - Channel to redirect input from.
to - Channel to redirect output to.
Defined in:
session.tcl, line 675

register_new_fifos

proc register_new_fifos { pid }
Assign a new pair of FIFOs for a new connection request for a User session.
Parameters:
pid - The pid of the requesting shell
Returns:
A pair of assigned fifos to communicate with the shell. @error
Defined in:
session.tcl, line 203

user_sessions

proc user_sessions {  }
Get list of sids of user sessions
Returns:
The sid of all the user sessions in a list
Defined in:
session.tcl, line 615

Overview | Index by: file name | procedure name | procedure call | annotation
File generated 2010-03-13 at 22:28.