Project

General

Profile

« Previous | Next » 

Revision fec2c3b7

Added by Sergio Carlos Morales Angeles over 8 years ago

Add expiration field to NDP listing

View differences:

src/usr/local/www/diag_ndp.php
65 65
	$hwif[$config['interfaces'][$key]['if']] = $interface;
66 66
}
67 67

  
68
/* Array ( [0] => Neighbor [1] => Linklayer [2] => Address
69
[3] => Netif [4] => Expire [5] => S
70
[6] => Flags ) */
68
/*
69
 * Key map for each element in $rawdata
70
 * 0 => Neighbor IP
71
 * 1 => Physical address (MAC)
72
 * 2 => Interface
73
 * 3 => Expiration
74
 * 4 => State
75
 * 5 => Flags
76
 */
71 77
$data = array();
72 78
array_shift($rawdata);
73 79
foreach ($rawdata as $line) {
......
77 83
	$ndpent['ipv6'] = trim($elements[0]);
78 84
	$ndpent['mac'] = trim($elements[1]);
79 85
	$ndpent['interface'] = trim($elements[2]);
86
	$ndpent['expiration'] = trim($elements[3]);
80 87
	$data[] = $ndpent;
81 88
}
82 89

  
......
128 135
	<table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
129 136
		<thead>
130 137
			<tr>
131
				<th><?= gettext("IPv6 address"); ?></th>
132
				<th><?= gettext("MAC address"); ?></th>
133
				<th><?= gettext("Hostname"); ?></th>
134
				<th><?= gettext("Interface"); ?></th>
138
				<th><?=gettext("IPv6 address")?></th>
139
				<th><?=gettext("MAC address")?></th>
140
				<th><?=gettext("Hostname")?></th>
141
				<th><?=gettext("Interface")?></th>
142
				<th><?=gettext("Expiration")?></th>
135 143
				<th data-sortable="false"><?=gettext("Actions")?></th>
136 144
			</tr>
137 145
	</thead>
......
163 171
						}
164 172
						?>
165 173
					</td>
174
					<td>
175
						<?=$entry['expiration']?>
176
					</td>
166 177
					<td>
167 178
						<a class="fa fa-trash" title="<?=gettext('Delete NDP entry')?>"	href="diag_ndp.php?deleteentry=<?=$entry['ipv6']?>" usepost></a>
168 179
					</td>

Also available in: Unified diff