Project

General

Profile

« Previous | Next » 

Revision 3c98b3f7

Added by Jim Pingle over 12 years ago

Whitespace/HTML fixes

View differences:

usr/local/www/diag_ping.php
28 28
	POSSIBILITY OF SUCH DAMAGE.
29 29
*/
30 30

  
31
/*	
31
/*
32 32
	pfSense_BUILDER_BINARIES:	/sbin/ping /sbin/ping6
33 33
	pfSense_MODULE:	routing
34 34
*/
......
84 84
<body link="#000000" vlink="#000000" alink="#000000">
85 85
<?php include("fbegin.inc"); ?>
86 86
<table width="100%" border="0" cellpadding="0" cellspacing="0">
87
        <tr>
88
                <td>
87
<tr><td>
89 88
<?php if ($input_errors) print_input_errors($input_errors); ?>
90
			<form action="diag_ping.php" method="post" name="iform" id="iform">
91
			  <table width="100%" border="0" cellpadding="6" cellspacing="0">
92
				<tr>
93
					<td colspan="2" valign="top" class="listtopic"><?=gettext("Ping"); ?></td>
94
				</tr>
95
                <tr>
96
				  <td width="22%" valign="top" class="vncellreq"><?=gettext("Host"); ?></td>
97
				  <td width="78%" class="vtable"> 
98
                    <?=$mandfldhtml;?><input name="host" type="text" class="formfldunknown" id="host" size="20" value="<?=htmlspecialchars($host);?>"></td>
99
				</tr>
100
				<tr>
101
					<td width="22%" valign="top" class="vncellreq"><?=gettext("IP Protocol"); ?></td>
102
					<td width="78%" class="vtable">
103
						<select name="ipproto" class="formselect">
104
							<option value="ipv4" <?php if ($ipproto == "ipv4") echo 'selected="selected"' ?>>IPv4</option>
105
							<option value="ipv6" <?php if ($ipproto == "ipv6") echo 'selected="selected"' ?>>IPv6</option>
106
						</select>
107
					</td>
108
				</tr>
109
				<tr>
110
				  <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td>
111
				  <td width="78%" class="vtable">
112

  
113
				<select name="interface" class="formselect">
114
					<option value="">Any</option>
115
				<?php  $listenips = get_possible_listen_ips();
116
					foreach ($listenips as $lip):
117
						$selected = "";
118
						if (!link_interface_to_bridge($lip['value']) && ($lip['value'] == $interface))
119
							$selected = 'selected="selected"';
120
				?>
121
					<option value="<?=$lip['value'];?>" <?=$selected;?>>
122
						<?=htmlspecialchars($lip['name']);?>
123
					</option>
124
				<?php endforeach; ?>
125
				</select>
126
				</td>
127
				</tr>
128
				<tr>
129
				  <td width="22%" valign="top" class="vncellreq"><?= gettext("Count"); ?></td>
130
				  <td width="78%" class="vtable">
131
					<select name="count" class="formfld" id="count">
132
					<?php for ($i = 1; $i <= MAX_COUNT; $i++): ?>
133
					<option value="<?=$i;?>" <?php if ($i == $count) echo "selected"; ?>><?=$i;?></option>
134
					<?php endfor; ?>
135
					</select></td>
136
				</tr>
137
				<tr>
138
				  <td width="22%" valign="top">&nbsp;</td>
139
				  <td width="78%"> 
140
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Ping"); ?>">
141
				</td>
142
				</tr>
143
				<tr>
144
				<td valign="top" colspan="2">
145
				<?php if ($do_ping) {
146
					echo "<font face='terminal' size='2'>";
147
					echo "<strong>" . gettext("Ping output") . ":</strong><br>";
148
					echo('<pre>');
149
					$command = "/sbin/ping";
150
					
151
					if ($ipproto == "ipv6") {
152
						$command .= "6";
153
						$ifaddr = get_interface_ipv6($interface);
154
					} else {
155
						$ifaddr = is_ipaddr($interface) ? $interface : get_interface_ip($interface);
156
					}
157
					if ($ifaddr && (is_ipaddr($host) || is_hostname($host)))
158
						$cmd = "{$command} -S$ifaddr -c$count " . escapeshellarg($host);
159
					else
160
						$cmd = "{$command} -c$count " . escapeshellarg($host);
161
					//echo "Ping command: {$cmd}\n";
162
					system($cmd);
163
					echo('</pre>');
164
				}
165
				?>
166
				</td>
167
				</tr>
168
				<tr>
169
				  <td width="22%" valign="top">&nbsp;</td>
170
				  <td width="78%"> 
171
				 </td>
172
				</tr>			
173
			</table>
174
		</form>
89
<form action="diag_ping.php" method="post" name="iform" id="iform">
90
<table width="100%" border="0" cellpadding="6" cellspacing="0">
91
<tr>
92
	<td colspan="2" valign="top" class="listtopic"><?=gettext("Ping"); ?></td>
93
</tr>
94
<tr>
95
	<td width="22%" valign="top" class="vncellreq"><?=gettext("Host"); ?></td>
96
	<td width="78%" class="vtable">
97
		<?=$mandfldhtml;?><input name="host" type="text" class="formfldunknown" id="host" size="20" value="<?=htmlspecialchars($host);?>"></td>
98
</tr>
99
<tr>
100
	<td width="22%" valign="top" class="vncellreq"><?=gettext("IP Protocol"); ?></td>
101
	<td width="78%" class="vtable">
102
		<select name="ipproto" class="formselect">
103
			<option value="ipv4" <?php if ($ipproto == "ipv4") echo 'selected="selected"' ?>>IPv4</option>
104
			<option value="ipv6" <?php if ($ipproto == "ipv6") echo 'selected="selected"' ?>>IPv6</option>
105
		</select>
106
	</td>
107
</tr>
108
<tr>
109
	<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td>
110
	<td width="78%" class="vtable">
111
		<select name="interface" class="formselect">
112
			<option value="">Any</option>
113
		<?php $listenips = get_possible_listen_ips();
114
			foreach ($listenips as $lip):
115
				$selected = "";
116
				if (!link_interface_to_bridge($lip['value']) && ($lip['value'] == $interface))
117
					$selected = 'selected="selected"';
118
		?>
119
			<option value="<?=$lip['value'];?>" <?=$selected;?>>
120
				<?=htmlspecialchars($lip['name']);?>
121
			</option>
122
			<?php endforeach; ?>
123
		</select>
124
	</td>
125
</tr>
126
<tr>
127
	<td width="22%" valign="top" class="vncellreq"><?= gettext("Count"); ?></td>
128
	<td width="78%" class="vtable">
129
		<select name="count" class="formfld" id="count">
130
		<?php for ($i = 1; $i <= MAX_COUNT; $i++): ?>
131
			<option value="<?=$i;?>" <?php if ($i == $count) echo "selected"; ?>><?=$i;?></option>
132
		<?php endfor; ?>
133
		</select>
175 134
	</td>
176 135
</tr>
136
<tr>
137
	<td width="22%" valign="top">&nbsp;</td>
138
	<td width="78%">
139
		<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Ping"); ?>">
140
	</td>
141
</tr>
142
<tr>
143
	<td valign="top" colspan="2">
144
	<?php if ($do_ping) {
145
		echo "<font face='terminal' size='2'>";
146
		echo "<strong>" . gettext("Ping output") . ":</strong><br>";
147
		echo('<pre>');
148
		$command = "/sbin/ping";
149
		if ($ipproto == "ipv6") {
150
			$command .= "6";
151
			$ifaddr = get_interface_ipv6($interface);
152
		} else {
153
			$ifaddr = is_ipaddr($interface) ? $interface : get_interface_ip($interface);
154
		}
155
		if ($ifaddr && (is_ipaddr($host) || is_hostname($host)))
156
			$cmd = "{$command} -S$ifaddr -c$count " . escapeshellarg($host);
157
		else
158
			$cmd = "{$command} -c$count " . escapeshellarg($host);
159
		//echo "Ping command: {$cmd}\n";
160
		system($cmd);
161
		echo('</pre>');
162
	}
163
	?>
164
	</td>
165
</tr>
166
<tr>
167
	<td width="22%" valign="top">&nbsp;</td>
168
	<td width="78%">&nbsp;</td>
169
</tr>
177 170
</table>
178
<?php include("fend.inc"); ?>
179

  
171
</form>
172
</td></tr>
173
</table>
174
<?php include("fend.inc"); ?>

Also available in: Unified diff