blob: d9a996c365ae86c5c428b158cca377bf4858e202 [file] [log] [blame]
Chengyu Fan45d1a762014-07-08 14:21:32 -06001<xsl:stylesheet version="1.0"
Davide Pesaventod9c520b2018-02-24 14:49:14 -05002 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:nfd="ndn:/localhost/nfd/status/1">
Davide Pesavento9e5b8af2018-02-24 22:03:02 -05004<xsl:output method="html" encoding="UTF-8" doctype-system="about:legacy-compat"/>
Chengyu Fan45d1a762014-07-08 14:21:32 -06005
6<xsl:template match="/">
7 <html>
8 <head>
Davide Pesaventod9c520b2018-02-24 14:49:14 -05009 <title>NFD Status</title>
10 <link rel="stylesheet" type="text/css" href="style.css" />
Chengyu Fan45d1a762014-07-08 14:21:32 -060011 </head>
12 <body>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070013 <header>
14 <h1>NFD Status</h1>
15 </header>
16 <article>
17 <div id="content">
18 <xsl:apply-templates/>
19 </div>
20 </article>
21 <footer>
22 <xsl:variable name="version">
23 <xsl:apply-templates select="nfd:nfdStatus/nfd:generalStatus/nfd:version"/>
24 </xsl:variable>
Alexander Afanasyev01bbd092017-08-14 23:56:19 +000025 <span class="grey">Powered by </span><a target="_blank" href="https://named-data.net/doc/NFD/"><span class="green">NFD version <xsl:value-of select="$version"/></span></a><span class="grey">.</span>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070026 </footer>
Chengyu Fan45d1a762014-07-08 14:21:32 -060027 </body>
28 </html>
29</xsl:template>
30
Alexander Afanasyev8a093762014-07-16 18:43:09 -070031<xsl:template name="formatDate">
32 <xsl:param name="date" />
33 <xsl:value-of select="substring($date, 0, 11)"/>&#160;<xsl:value-of select="substring($date, 12, 8)"/>
34</xsl:template>
35
36<xsl:template name="formatDuration">
37 <xsl:param name="duration" />
Eric Newberryde332452018-01-30 11:45:32 -070038 <xsl:variable name="milliseconds">
39 <xsl:choose>
40 <xsl:when test="contains($duration, '.')">
41 <xsl:value-of select="substring($duration, string-length($duration)-4, 3)" />
42 </xsl:when>
43 <xsl:otherwise>
44 0
45 </xsl:otherwise>
46 </xsl:choose>
47 </xsl:variable>
48 <xsl:variable name="seconds">
49 <xsl:choose>
50 <xsl:when test="contains($duration, '.')">
51 <xsl:value-of select="substring($duration, 3, string-length($duration)-7)" />
52 </xsl:when>
53 <xsl:otherwise>
54 <xsl:value-of select="substring($duration, 3, string-length($duration)-3)" />
55 </xsl:otherwise>
56 </xsl:choose>
57 </xsl:variable>
Chengyu Fana55663d2014-08-13 20:31:03 -060058 <xsl:variable name="days"><xsl:value-of select="floor($seconds div 86400)" /></xsl:variable>
59 <xsl:variable name="hours"><xsl:value-of select="floor($seconds div 3600)" /></xsl:variable>
60 <xsl:variable name="minutes"><xsl:value-of select="floor($seconds div 60)" /></xsl:variable>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070061 <xsl:choose>
Chengyu Fana55663d2014-08-13 20:31:03 -060062 <xsl:when test="$days = 1">
63 <xsl:value-of select="$days"/> day
64 </xsl:when>
65 <xsl:when test="$days > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070066 <xsl:value-of select="$days"/> days
67 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060068 <xsl:when test="$hours = 1">
69 <xsl:value-of select="$hours"/> hour
70 </xsl:when>
71 <xsl:when test="$hours > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070072 <xsl:value-of select="$hours"/> hours
73 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060074 <xsl:when test="$minutes = 1">
75 <xsl:value-of select="$minutes"/> minute
76 </xsl:when>
77 <xsl:when test="$minutes > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070078 <xsl:value-of select="$minutes"/> minutes
79 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060080 <xsl:when test="$seconds = 1">
81 <xsl:value-of select="$seconds"/> second
82 </xsl:when>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070083 <xsl:otherwise>
84 <xsl:value-of select="$seconds"/> seconds
85 </xsl:otherwise>
Eric Newberryde332452018-01-30 11:45:32 -070086 <xsl:when test="$milliseconds > 1">
87 <xsl:value-of select="$milliseconds"/> milliseconds
88 </xsl:when>
89 <xsl:when test="$milliseconds = 1">
90 <xsl:value-of select="$milliseconds"/> millisecond
91 </xsl:when>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070092 </xsl:choose>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070093</xsl:template>
94
Chengyu Fan45d1a762014-07-08 14:21:32 -060095<xsl:template match="nfd:generalStatus">
Davide Pesavento9e5b8af2018-02-24 22:03:02 -050096 <h2>General Status</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070097 <table class="item-list">
98 <thead>
99 <tr>
100 <th>Version</th>
101 <th>Start time</th>
102 <th>Current time</th>
103 <th>Uptime</th>
104 <th>NameTree Entries</th>
105 <th>FIB entries</th>
106 <th>PIT entries</th>
107 <th>Measurements entries</th>
108 <th>CS entries</th>
109 <th>In Interests</th>
110 <th>Out Interests</th>
111 <th>In Data</th>
112 <th>Out Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700113 <th>In Nacks</th>
114 <th>Out Nacks</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700115 </tr>
116 </thead>
117 <tbody>
118 <tr class="center">
Hila Ben Abraham2ef99572014-12-02 02:45:51 -0600119 <td><xsl:value-of select="nfd:version"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700120 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:startTime" /></xsl:call-template></td>
121 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:currentTime" /></xsl:call-template></td>
122 <td><xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:uptime" /></xsl:call-template></td>
123 <td><xsl:value-of select="nfd:nNameTreeEntries"/></td>
124 <td><xsl:value-of select="nfd:nFibEntries"/></td>
125 <td><xsl:value-of select="nfd:nPitEntries"/></td>
126 <td><xsl:value-of select="nfd:nMeasurementsEntries"/></td>
127 <td><xsl:value-of select="nfd:nCsEntries"/></td>
128 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
129 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
Junxiao Shif03d4792017-04-06 16:41:22 +0000130 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nData"/></td>
131 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nData"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700132 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
133 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700134 </tr>
135 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600136 </table>
137</xsl:template>
138
139<xsl:template match="nfd:channels">
140 <h2>Channels</h2>
Davide Pesavento6a88b5f2018-02-24 16:50:46 -0500141 <table class="item-list alt-row-colors">
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700142 <thead>
143 <tr>
144 <th>Channel URI</th>
145 </tr>
146 </thead>
147 <tbody>
148 <xsl:for-each select="nfd:channel">
Davide Pesavento6a88b5f2018-02-24 16:50:46 -0500149 <tr>
150 <td><xsl:value-of select="nfd:localUri"/></td>
151 </tr>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700152 </xsl:for-each>
153 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600154 </table>
155</xsl:template>
156
157<xsl:template match="nfd:faces">
158 <h2>Faces</h2>
Davide Pesavento6a88b5f2018-02-24 16:50:46 -0500159 <table class="item-list alt-row-colors">
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700160 <thead>
161 <tr>
162 <th>Face ID</th>
163 <th>Remote URI</th>
164 <th>Local URI</th>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600165 <th>Scope</th>
166 <th>Persistency</th>
167 <th>LinkType</th>
Eric Newberry4f8dd962018-06-17 21:32:07 -0700168 <th>MTU</th>
Eric Newberry6d932e82016-11-24 05:05:43 +0000169 <th>Flags</th>
Chengyu Fan67179642014-08-15 16:00:43 -0600170 <th>Expires in</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700171 <th>In Interests</th>
172 <th>In Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700173 <th>In Nacks</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600174 <th>In Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700175 <th>Out Interests</th>
176 <th>Out Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700177 <th>Out Nacks</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600178 <th>Out Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700179 </tr>
180 </thead>
181 <tbody>
182 <xsl:for-each select="nfd:face">
Davide Pesavento6a88b5f2018-02-24 16:50:46 -0500183 <tr>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700184 <td><xsl:value-of select="nfd:faceId"/></td>
185 <td><xsl:value-of select="nfd:remoteUri"/></td>
186 <td><xsl:value-of select="nfd:localUri"/></td>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600187 <td><xsl:value-of select="nfd:faceScope"/></td>
188 <td><xsl:value-of select="nfd:facePersistency"/></td>
189 <td><xsl:value-of select="nfd:linkType"/></td>
Chengyu Fan67179642014-08-15 16:00:43 -0600190 <td>
Eric Newberry4f8dd962018-06-17 21:32:07 -0700191 <xsl:choose>
192 <xsl:when test="nfd:mtu">
193 <xsl:value-of select="nfd:mtu"/>
194 </xsl:when>
195 <xsl:otherwise>
196 n/a
197 </xsl:otherwise>
198 </xsl:choose>
199 </td>
200 <td>
Davide Pesaventod9c520b2018-02-24 14:49:14 -0500201 <xsl:if test="nfd:flags/nfd:localFieldsEnabled">local-fields </xsl:if>
202 <xsl:if test="nfd:flags/nfd:lpReliabilityEnabled">reliability </xsl:if>
203 <xsl:if test="nfd:flags/nfd:congestionMarkingEnabled">congestion-marking </xsl:if>
Eric Newberry6d932e82016-11-24 05:05:43 +0000204 </td>
205 <td>
206 <xsl:choose>
Chengyu Fan67179642014-08-15 16:00:43 -0600207 <xsl:when test="nfd:expirationPeriod">
208 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
209 </xsl:when>
210 <xsl:otherwise>
211 Never
212 </xsl:otherwise>
213 </xsl:choose>
214 </td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700215 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
Junxiao Shif03d4792017-04-06 16:41:22 +0000216 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nData"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700217 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600218 <td><xsl:value-of select="nfd:byteCounters/nfd:incomingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700219 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
Junxiao Shif03d4792017-04-06 16:41:22 +0000220 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nData"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700221 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600222 <td><xsl:value-of select="nfd:byteCounters/nfd:outgoingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700223 </tr>
224 </xsl:for-each>
225 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600226 </table>
227</xsl:template>
228
229<xsl:template match="nfd:fib">
230 <h2>FIB</h2>
Davide Pesavento6a88b5f2018-02-24 16:50:46 -0500231 <table class="item-list alt-row-colors">
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700232 <thead>
233 <tr>
Davide Pesavento9e5b8af2018-02-24 22:03:02 -0500234 <th class="name-prefix">Prefix</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700235 <th>NextHops</th>
236 </tr>
237 </thead>
238 <tbody>
239 <xsl:for-each select="nfd:fibEntry">
Davide Pesavento6a88b5f2018-02-24 16:50:46 -0500240 <tr>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700241 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
242 <td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600243 <table class="item-sublist">
244 <tr>
245 <th>FaceId</th>
246 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
247 <td><xsl:value-of select="nfd:faceId"/></td>
248 </xsl:for-each>
249 </tr>
250 <tr>
251 <th>Cost</th>
252 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
253 <td><xsl:value-of select="nfd:cost"/></td>
254 </xsl:for-each>
255 </tr>
256 </table>
257 </td>
258 </tr>
259 </xsl:for-each>
260 </tbody>
261 </table>
262</xsl:template>
263
264<xsl:template match="nfd:rib">
265 <h2>RIB</h2>
Davide Pesavento6a88b5f2018-02-24 16:50:46 -0500266 <table class="item-list alt-row-colors">
Chengyu Fan30aa2072014-07-20 13:52:32 -0600267 <thead>
268 <tr>
Davide Pesavento9e5b8af2018-02-24 22:03:02 -0500269 <th class="name-prefix">Prefix</th>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600270 <th>Routes</th>
271 </tr>
272 </thead>
273 <tbody>
274 <xsl:for-each select="nfd:ribEntry">
Davide Pesavento6a88b5f2018-02-24 16:50:46 -0500275 <tr>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600276 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
277 <td>
278 <table class="item-sublist">
279 <tr>
280 <th>FaceId</th>
281 <xsl:for-each select="nfd:routes/nfd:route">
282 <td><xsl:value-of select="nfd:faceId"/></td>
283 </xsl:for-each>
284 </tr>
285 <tr>
286 <th>Origin</th>
287 <xsl:for-each select="nfd:routes/nfd:route">
288 <td><xsl:value-of select="nfd:origin"/></td>
289 </xsl:for-each>
290 </tr>
291 <tr>
292 <th>Cost</th>
293 <xsl:for-each select="nfd:routes/nfd:route">
294 <td><xsl:value-of select="nfd:cost"/></td>
295 </xsl:for-each>
296 </tr>
297 <tr>
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500298 <th>ChildInherit</th>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600299 <xsl:for-each select="nfd:routes/nfd:route">
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500300 <td>
Davide Pesaventod9c520b2018-02-24 14:49:14 -0500301 <xsl:if test="nfd:flags/nfd:childInherit">Y</xsl:if>
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500302 </td>
303 </xsl:for-each>
304 </tr>
305 <tr>
306 <th>RibCapture</th>
307 <xsl:for-each select="nfd:routes/nfd:route">
308 <td>
Davide Pesaventod9c520b2018-02-24 14:49:14 -0500309 <xsl:if test="nfd:flags/nfd:ribCapture">Y</xsl:if>
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500310 </td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600311 </xsl:for-each>
312 </tr>
313 <tr>
314 <th>Expires in</th>
315 <xsl:for-each select="nfd:routes/nfd:route">
316 <td>
317 <xsl:choose>
318 <xsl:when test="nfd:expirationPeriod">
319 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
320 </xsl:when>
321 <xsl:otherwise>
322 Never
323 </xsl:otherwise>
324 </xsl:choose>
325 </td>
326 </xsl:for-each>
327 </tr>
328 </table>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700329 </td>
330 </tr>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600331 </xsl:for-each>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700332 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600333 </table>
334</xsl:template>
335
Junxiao Shi3160a3f2018-01-09 21:25:15 +0000336<xsl:template match="nfd:cs">
Davide Pesaventod9c520b2018-02-24 14:49:14 -0500337 <h2>Content Store</h2>
Junxiao Shi3160a3f2018-01-09 21:25:15 +0000338 <table class="item-list">
339 <thead>
340 <tr>
Junxiao Shi7a36ac72018-03-21 15:23:22 +0000341 <th>Enablement Flags</th>
342 <th>Capacity</th>
343 <th>Entries</th>
Junxiao Shi3160a3f2018-01-09 21:25:15 +0000344 <th>Hits</th>
345 <th>Misses</th>
346 </tr>
347 </thead>
348 <tbody>
Davide Pesavento9e5b8af2018-02-24 22:03:02 -0500349 <tr>
Junxiao Shi7a36ac72018-03-21 15:23:22 +0000350 <td>
351 <xsl:choose>
352 <xsl:when test="nfd:admitEnabled">admit</xsl:when>
353 <xsl:otherwise>no-admit</xsl:otherwise>
354 </xsl:choose>
355 ,
356 <xsl:choose>
357 <xsl:when test="nfd:serveEnabled">serve</xsl:when>
358 <xsl:otherwise>no-serve</xsl:otherwise>
359 </xsl:choose>
360 </td>
361 <td><xsl:value-of select="nfd:capacity"/></td>
362 <td><xsl:value-of select="nfd:nEntries"/></td>
Junxiao Shi3160a3f2018-01-09 21:25:15 +0000363 <td><xsl:value-of select="nfd:nHits"/></td>
364 <td><xsl:value-of select="nfd:nMisses"/></td>
365 </tr>
366 </tbody>
367 </table>
368</xsl:template>
369
Chengyu Fan45d1a762014-07-08 14:21:32 -0600370<xsl:template match="nfd:strategyChoices">
371 <h2>Strategy Choices</h2>
Davide Pesavento6a88b5f2018-02-24 16:50:46 -0500372 <table class="item-list alt-row-colors">
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700373 <thead>
374 <tr>
Davide Pesavento9e5b8af2018-02-24 22:03:02 -0500375 <th class="name-prefix">Namespace</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700376 <th>Strategy Name</th>
377 </tr>
378 </thead>
379 <tbody>
380 <xsl:for-each select="nfd:strategyChoice">
381 <tr>
382 <td><xsl:value-of select="nfd:namespace"/></td>
383 <td><xsl:value-of select="nfd:strategy/nfd:name"/></td>
384 </tr>
385 </xsl:for-each>
386 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600387 </table>
388</xsl:template>
389
390</xsl:stylesheet>