summaryrefslogtreecommitdiffstats
path: root/Bachelor/CCNA4/en_CCNA4_v30/elabs/Engine/actions_router_startup.txt
blob: 0149eb7531aa9dc8e62d60a8ee7dc939324cfdc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
//zmg, 03.01.01

//this file needs a better description!

//

//



// File: actions_router_startup.txt

// Description: Functions related to when a router is starting up



// router_startup_checkStartUp()

// IN : None

// DO : See if we need the active router needs to be started

// OUT: None

function router_startup_checkStartUp() {



	// get active router

	var rptr = eval("_root.r" + _root.active_router);



	// see if the router has been started

	if (rptr.router_startup == false && !_root.isComputer())

	  

	{

		// if it hasn't been started, start it

		rptr.MODE = "startUp";

		commandline_changeProcess("router_startup_processStartUp");//to change to that process



		// update startup flag

		rptr.router_startup = true;



		// go to the start up routine

		_root.router_startup_startUp();



	}

	else if (_root.isComputer())

	{

		rptr.MODE = "startUp";

		commandline_changeProcess("computer_startup_processStartUp");

		rptr.router_startup = true;

		_root.computer_startup_startUp();

	}

	else

	{

		// else the router has been started and we can continue

		commandline_changeProcess(rptr.processCurrent);

			//here the variable is pointer bcos it is the current routers current process

	}



}









//to start the router

// ***** router_startup_processStartUp(int) *****

// IN:	1 int representing the keycode of the key pressed

// DO:	if ENTER, then go to command line, else do nothing

// OUT: Possibly a 'User Access Verification' message

function router_startup_processStartUp(keycode) {



	// get the active router

	var rptr = eval("_root.r" + _root.active_router);//it is rRouterA here

        

	// if ENTER, go to command line

	if (keycode == 13) {



		rptr.scrollStartLine = rptr.lastLine-22;  // for more function 

		 

		// get the MOTD

		//_root.CheckBannerMOTD();

		_root.banner_checkBannerMOTD();



		// if the router requires a password and one has been specified

		if ((rptr.run.line.con_password != "") && (rptr.run.line.con_login == true)) {



			// print the user access message and go to password prompt

			output_write("User Access Verification\n",

				  "\n");

			_root.commandline_changeProcess("password_processPassword");

			password_passwordLine();



		} else

 		{



			// else no password is required, so go to user command line



			commandline_changeProcess("commandline_processCommandLine");

		}

		//calling the lab-drill object step 1

		loadImage(1,_root.stepnum);

		_root.goToNextStep(1,0);



//code added 3 Lines below on April 11 2002 just in case if we need to go a particulat step right in the begining...

			commandline_setMode(stepModeArray[1], _root.active_router);

			output_write("\n");

			commandline_commandLine();



	}

}



function computer_startup_processStartUp(keycode)

{

	// get the active router

	var rptr = eval("_root.r" + _root.active_router);



	// if ENTER, go to command line

	if (keycode == 13)

	{

		rptr.scrollStartLine = rptr.lastLine-22;  // for more function



		//calling the lab-drill object step 1

		loadImage(1,_root.stepnum);

		_root.goToNextStep(1,0);



		commandline_changeProcess("commandline_processCommandLine");

		commandline_setMode(stepModeArray[1], _root.active_router);

		output_write("\n");

		commandline_commandLine();

	}

}



function computer_startup_startUp()

{

	var rptr = eval("_root.r" + _root.active_router);



	output_write("\n");

	rptr.scrollStartLine++; // increment the start line



	output_write("\n",

	"Starting Computer...","\n","\n","\n","\n");

}









// ***** router_startup_startUp() *****

// IN : None

// DO :	Prints out the start up screen

// OUT: The start up screen

function router_startup_startUp() {



	// get the active router

	var rptr = eval("_root.r" + _root.active_router);



	output_write("\n");

	rptr.scrollStartLine++; // increment the start line



	// print the start screen

	output_write("\n",

		"\n",

		"\n",

		"\n",

		"\n",

		"\n",

		"\n",

		rptr.run.hostname + " con0 is now available\n",

		"\n",

		"\n",

		"\n",

		"\n",

		"\n",

		"Press RETURN to get started.\n",

		"\n",

		"\n",

		"\n",

		"\n",

		"\n",

		"\n",

		"\n",

		"\n");

}