Projet

Général

Profil

« Précédent | Suivant » 

Révision e19669c5

Ajouté par Colin Fleming il y a presque 10 ans

Tidy up "diag_packet_capture.php" XHTML

Add SUMMARY to TABLES
Update HTML Boolean operators
Close INPUT tags
Remove TYPE from INPUT tags, invalid in XHTML
Remove WRAP from TEXTAREA,, invalid in XHTML
Add ID statement to TEXTAREA, add a piece of JAVASCRIPT to read the ID
and set "wrap=off"
Add missing closing FONT, BODY and HTML tags

Voir les différences:

usr/local/www/diag_packet_capture.php
178 178

  
179 179
<?php if ($input_errors) print_input_errors($input_errors); ?>
180 180

  
181
<table width="100%" border="0" cellpadding="0" cellspacing="0">
181
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="diag packet capture">
182 182
	<tr><td>
183 183
	<form action="diag_packet_capture.php" method="post" name="iform" id="iform">
184
	<table width="100%" border="0" cellpadding="6" cellspacing="0">
184
	<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="table">
185 185
		<tr>
186 186
			<td colspan="3" valign="top" class="listtopic"><?=gettext("Packet capture");?></td>
187 187
		</tr>
......
192 192
			<?php
193 193
			?>
194 194
			<?php foreach ($interfaces as $iface => $ifacename): ?>
195
				<option value="<?=$iface;?>" <?php if ($selectedif == $iface) echo "selected"; ?>>
195
				<option value="<?=$iface;?>" <?php if ($selectedif == $iface) echo "selected=\"selected\""; ?>>
196 196
				<?php echo $ifacename;?>
197 197
				</option>
198 198
			<?php endforeach; ?>
......
203 203
		<tr>
204 204
			<td width="17%" valign="top" class="vncellreq"><?=gettext("Promiscuous");?></td>
205 205
			<td width="51%" class="vtable">
206
			<input name="promiscuous" type="checkbox"<?php if($_POST['promiscuous']) echo " CHECKED"; ?>>
206
			<input name="promiscuous" type="checkbox"<?php if($_POST['promiscuous']) echo " checked=\"checked\""; ?> />
207 207
			<br /><?=gettext("If checked, the");?> <a target="_blank" href="http://www.freebsd.org/cgi/man.cgi?query=tcpdump&amp;apropos=0&amp;sektion=0&amp;manpath=FreeBSD+8.3-stable&amp;arch=default&amp;format=html"><?= gettext("packet capture")?></a> <?= gettext("will be performed using promiscuous mode.");?>
208 208
			<br /><b><?=gettext("Note");?>: </b><?=gettext("Some network adapters do not support or work well in promiscuous mode.");?>
209 209
			</td>
......
213 213
			<td colspan="2" width="83%" class="vtable">
214 214
			<select name="fam">
215 215
				<option value="">Any</option>
216
				<option value="ip" <?php if ($fam == "ip") echo "selected"; ?>>IPv4 Only</option>
217
				<option value="ip6" <?php if ($fam == "ip6") echo "selected"; ?>>IPv6 Only</option>
216
				<option value="ip" <?php if ($fam == "ip") echo "selected=\"selected\""; ?>>IPv4 Only</option>
217
				<option value="ip6" <?php if ($fam == "ip6") echo "selected=\"selected\""; ?>>IPv6 Only</option>
218 218
			</select>
219 219
			<br /><?=gettext("Select the type of traffic to be captured, either Any, IPv4 only or IPv6 only.");?>
220 220
			</td>
......
224 224
			<td colspan="2" width="83%" class="vtable">
225 225
			<select name="proto">
226 226
				<option value="">Any</option>
227
				<option value="icmp" <?php if ($proto == "icmp") echo "selected"; ?>>ICMP</option>
228
				<option value="icmp6" <?php if ($proto == "icmp6") echo "selected"; ?>>ICMPv6</option>
229
				<option value="tcp" <?php if ($proto == "tcp") echo "selected"; ?>>TCP</option>
230
				<option value="udp" <?php if ($proto == "udp") echo "selected"; ?>>UDP</option>
231
				<option value="arp" <?php if ($proto == "arp") echo "selected"; ?>>ARP</option>
232
				<option value="carp" <?php if ($proto == "carp") echo "selected"; ?>>CARP (VRRP)</option>
233
				<option value="esp" <?php if ($proto == "esp") echo "selected"; ?>>ESP</option>
227
				<option value="icmp" <?php if ($proto == "icmp") echo "selected=\"selected\""; ?>>ICMP</option>
228
				<option value="icmp6" <?php if ($proto == "icmp6") echo "selected=\"selected\""; ?>>ICMPv6</option>
229
				<option value="tcp" <?php if ($proto == "tcp") echo "selected=\"selected\""; ?>>TCP</option>
230
				<option value="udp" <?php if ($proto == "udp") echo "selected=\"selected\""; ?>>UDP</option>
231
				<option value="arp" <?php if ($proto == "arp") echo "selected=\"selected\""; ?>>ARP</option>
232
				<option value="carp" <?php if ($proto == "carp") echo "selected=\"selected\""; ?>>CARP (VRRP)</option>
233
				<option value="esp" <?php if ($proto == "esp") echo "selected=\"selected\""; ?>>ESP</option>
234 234
			</select>
235 235
			<br /><?=gettext("Select the protocol to capture, or Any.");?>
236 236
			</td>
......
238 238
		<tr>
239 239
			<td width="17%" valign="top" class="vncellreq"><?=gettext("Host Address");?></td>
240 240
			<td colspan="2" width="83%" class="vtable">
241
			<input name="host" type="text" class="formfld host" id="host" size="20" value="<?=htmlspecialchars($host);?>">
241
			<input name="host" class="formfld host" id="host" size="20" value="<?=htmlspecialchars($host);?>" />
242 242
			<br /><?=gettext("This value is either the Source or Destination IP address or subnet in CIDR notation. The packet capture will look for this address in either field.");?>
243 243
			<br /><?=gettext("This value can be a domain name or IP address, or subnet in CIDR notation.");?>
244 244
			<br /><?=gettext("If you leave this field blank, all packets on the specified interface will be captured.");?>
......
247 247
		<tr>
248 248
			<td width="17%" valign="top" class="vncellreq"><?=gettext("Port");?></td>
249 249
			<td colspan="2" width="83%" class="vtable">
250
			<input name="port" type="text" class="formfld unknown" id="port" size="5" value="<?=$port;?>">
250
			<input name="port" class="formfld unknown" id="port" size="5" value="<?=$port;?>" />
251 251
			<br /><?=gettext("The port can be either the source or destination port. The packet capture will look for this port in either field.");?>
252 252
			<br /><?=gettext("Leave blank if you do not want to filter by port.");?>
253 253
			</td>
......
255 255
		<tr>
256 256
			<td width="17%" valign="top" class="vncellreq"><?=gettext("Packet Length");?></td>
257 257
			<td colspan="2" width="83%" class="vtable">
258
			<input name="snaplen" type="text" class="formfld unknown" id="snaplen" size="5" value="<?=$snaplen;?>">
258
			<input name="snaplen" class="formfld unknown" id="snaplen" size="5" value="<?=$snaplen;?>" />
259 259
			<br /><?=gettext("The Packet length is the number of bytes of each packet that will be captured. Default value is 0, which will capture the entire frame regardless of its size.");?>
260 260
			</td>
261 261
		</tr>
262 262
		<tr>
263 263
			<td width="17%" valign="top" class="vncellreq"><?=gettext("Count");?></td>
264 264
			<td colspan="2" width="83%" class="vtable">
265
			<input name="count" type="text" class="formfld unknown" id="count" size="5" value="<?=$count;?>">
265
			<input name="count" class="formfld unknown" id="count" size="5" value="<?=$count;?>" />
266 266
			<br /><?=gettext("This is the number of packets the packet capture will grab. Default value is 100.") . "<br />" . gettext("Enter 0 (zero) for no count limit.");?>
267 267
			</td>
268 268
		</tr>
269 269
		<tr>
270 270
			<td width="17%" valign="top" class="vncellreq"><?=gettext("Level of Detail");?></td>
271 271
			<td colspan="2" width="83%" class="vtable">
272
			<select name="detail" type="text" class="formselect" id="detail" size="1">
273
				<option value="normal" <?php if ($detail == "normal") echo "selected"; ?>><?=gettext("Normal");?></option>
274
				<option value="medium" <?php if ($detail == "medium") echo "selected"; ?>><?=gettext("Medium");?></option>
275
				<option value="high"   <?php if ($detail == "high")   echo "selected"; ?>><?=gettext("High");?></option>
276
				<option value="full"   <?php if ($detail == "full")   echo "selected"; ?>><?=gettext("Full");?></option>
272
			<select name="detail" class="formselect" id="detail" size="1">
273
				<option value="normal" <?php if ($detail == "normal") echo "selected=\"selected\""; ?>><?=gettext("Normal");?></option>
274
				<option value="medium" <?php if ($detail == "medium") echo "selected=\"selected\""; ?>><?=gettext("Medium");?></option>
275
				<option value="high"   <?php if ($detail == "high")   echo "selected=\"selected\""; ?>><?=gettext("High");?></option>
276
				<option value="full"   <?php if ($detail == "full")   echo "selected=\"selected\""; ?>><?=gettext("Full");?></option>
277 277
			</select>
278 278
			<br /><?=gettext("This is the level of detail that will be displayed after hitting 'Stop' when the packets have been captured.") .  "<br /><b>" .
279 279
					gettext("Note:") . "</b> " .
......
283 283
		<tr>
284 284
			<td width="17%" valign="top" class="vncellreq"><?=gettext("Reverse DNS Lookup");?></td>
285 285
			<td colspan="2" width="83%" class="vtable">
286
			<input name="dnsquery" type="checkbox"<?php if($_POST['dnsquery']) echo " CHECKED"; ?>>
286
			<input name="dnsquery" type="checkbox" <?php if($_POST['dnsquery']) echo " checked=\"checked\""; ?> />
287 287
			<br /><?=gettext("This check box will cause the packet capture to perform a reverse DNS lookup associated with all IP addresses.");?>
288 288
			<br /><b><?=gettext("Note");?>: </b><?=gettext("This option can cause delays for large packet captures.");?>
289 289
			</td>
......
302 302
				$processisrunning = false;
303 303

  
304 304
			if (($action == gettext("Stop") or $action == "") and $processisrunning != true)
305
				echo "<input type=\"submit\" name=\"startbtn\" value=\"" . gettext("Start") . "\">&nbsp;";
305
				echo "<input type=\"submit\" name=\"startbtn\" value=\"" . gettext("Start") . "\" />&nbsp;";
306 306
			else {
307
				echo "<input type=\"submit\" name=\"stopbtn\" value=\"" . gettext("Stop") . "\">&nbsp;";
307
				echo "<input type=\"submit\" name=\"stopbtn\" value=\"" . gettext("Stop") . "\" />&nbsp;";
308 308
			}
309 309
			if (file_exists($fp.$fn) and $processisrunning != true) {
310
				echo "<input type=\"submit\" name=\"viewbtn\" value=\"" . gettext("View Capture") . "\">&nbsp;";
311
				echo "<input type=\"submit\" name=\"downloadbtn\" value=\"" . gettext("Download Capture") . "\">";
310
				echo "<input type=\"submit\" name=\"viewbtn\" value=\"" . gettext("View Capture") . "\" />&nbsp;";
311
				echo "<input type=\"submit\" name=\"downloadbtn\" value=\"" . gettext("Download Capture") . "\" />";
312 312
				echo "<br />" . gettext("The packet capture file was last updated:") . " " . date("F jS, Y g:i:s a.", filemtime($fp.$fn));
313 313
			}
314 314
?>
......
316 316
		</tr>
317 317
	</table>
318 318
	</form>
319
	<table width="100%" border="0" cellpadding="6" cellspacing="0">
319
	<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="results">
320 320
		<tr>
321 321
		<td valign="top" colspan="2">
322 322
<?php
323
		echo "<font face='terminal' size='2'>";
323
		echo "<font face=\"terminal\" size=\"2\">";
324 324
		if ($processisrunning == true)
325 325
			echo("<strong>" . gettext("Packet Capture is running.") . "</strong><br />");
326 326

  
......
364 364
				//action = stop
365 365
				echo("<strong>" . gettext("Packet Capture stopped.") . "<br /><br />" . gettext("Packets Captured:") . "</strong><br />");
366 366
?>
367
				<textarea style="width:98%" name="code" rows="15" cols="66" wrap="off" readonly="readonly">
367
				<script type="text/javascript">
368
				//<![CDATA[
369
				window.onload=function(){
370
					document.getElementById("packetsCaptured").wrap='off';
371
				}
372
				//]]>
373
				</script>
374
				<textarea id="packetsCaptured" style="width:98%" name="code" rows="15" cols="66" readonly="readonly">
368 375
<?php
369 376
				$detail_args = "";
370 377
				switch ($detail) {
......
391 398
			}
392 399
		}
393 400
?>
401
		&nbsp;</font>
394 402
		</td>
395 403
		</tr>
396 404
	</table>
......
400 408
<?php
401 409
include("fend.inc");
402 410
?>
411
</body>
412
</html>

Formats disponibles : Unified diff