blob: 3139afa7075e6d5c4cea97f9de08fd3bf5d6cfab (
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
|
var currentAnswerPtr = 1;
var showAns = false;
var stepBeforeAnswer = 0;
// Modified by Dean Wood 2/6/2003 - to include step 0 in help
function showAnswer(stepNum)
{
var indexvalue = 0;
if (showAns == true)
{
answerInitialize(true);
goToNextStep(stepNum, stepNum);
indexvalue = stepnum;
if(stepNum > 0)
expandCommand(stepNum,indexvalue);
}
}
function expandCommand(stepNum,index)
{
prompt = getPrompt(StepModeArray[stepNum]);
writeToRouter(prompt);
writeToRouter(AnswerArray[index][0].commandName);
for (i=1; i < 16; i++)
{
ptr = AnswerArray[index][0];
if ( eval("ptr.param" + i).length > 0)
writeToRouter(" " + eval("ptr.param" + i));
}
writeToRouter("\n");
if(AnswerArray[index+1][0].stepnum == AnswerArray[index][0].stepnum
&& AnswerArray[index+1][0].matrixCheck == True
&& AnswerArray[index][0].matrixCheck == True)
{
expandCommand(stepNum, index + 1); //recursion to show all answers (it works :P)
//Tony's answer to solve missing show answer steps 2/07/03
}
}
function writeToRouter(Str)
{
_root.HyperTerminal.sRouterB.output.text += Str;
}
function answerInitialize(flag)
{
if (flag)
{
_root.HyperTerminal.sRouterB.output.text = "";
_root.HyperTerminal.sRouterB._visible = true;
_root.HyperTerminal.sRouterA._visible = false;
_root.HyperTerminal.cursor._visible = false;
}
else
{
_root.HyperTerminal.sRouterB.output.text = "";
_root.HyperTerminal.sRouterB._visible = false;
_root.HyperTerminal.sRouterA._visible = true;
_root.HyperTerminal.cursor._visible = true;
}
}
function getPrompt(arg1)
{
var stepDevice = _root.routerInfoArray[_root.routerUsedForThisStep[_root.stepnum]].deviceType;
//holds the string that is the new prompt
var p = "";
if (arg1 == "user") {
if (stepDevice != "Switch 4006 Sup 2")
p = ">";
else
p = "> ";
} else if (arg1 == "enable") {
if (stepDevice != "Switch 4006 Sup 2")
p = "#";
else
p = "> (enable) ";
} else if (arg1 == "global") {
p = "(config)#";
}
else if (arg1.substr(0, 3) == "int") {
p = "(config-if)#";
}
else if (arg1.substr(0, 3) == "sub") {
p = "(config-subif)#";
}
else if (arg1.substr(0, 4) == "line") {
p = "(config-line)#";
}
else if (arg1.substr(0, 6) == "router") {
p = "(config-router)#";
}
else if (arg1.indexOf("controller") == 0) {
p = "(config-controller)#";
}
else if (arg1.indexOf("extNacl") == 0) {
p = "(config-ext-nacl)#";
}
else if (arg1.indexOf("mapClass") == 0) {
p = "(config-map-class)#";
}
else if (arg1.indexOf("timeRange") == 0) {
p = "(config-time-range)#";
}
else if (arg1.indexOf("dhcp") == 0) {
p = "(dhcp-config)#";
}
else if (arg1.indexOf("routeMap") == 0) {
p = "(config-route-map)#";
}
else if (arg1.indexOf("classMap") == 0) {
p = "(config-cmap)#";
}
else if (arg1.indexOf("policyMap") == 0) {
p = "(config-pmap)#";
}
else if (arg1.indexOf("policyMapClass") == 0) {
p = "(config-pmap-c)#";
}
else if (arg1 == "vlanDB") {
p = "(vlan)#";
}
else if (arg1 == "ATMPVC") {
p = "(config-if-atm-vc)#";
}
else if (arg1 == "DOS")
{
p = " C:\\>";
}
else if (arg1 == "NameOnly")
{
p = "";
}
trace("p = " + p);
//set the new prompt and mode on the router in question
return _root.rRouterA.run.hostname + p;
}
|