blob: 9620cba0c90f7ef7e7922cba9eec7f08dbc7fa40 [file] [log] [blame]
Chengyu Fan45d1a762014-07-08 14:21:32 -06001<xsl:stylesheet version="1.0"
Chengyu Fan45d1a762014-07-08 14:21:32 -06002xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3xmlns:nfd="ndn:/localhost/nfd/status/1">
Joao Pereira4e274ac2015-07-23 11:54:20 -04004<xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat"/>
Chengyu Fan45d1a762014-07-08 14:21:32 -06005
6<xsl:template match="/">
7 <html>
8 <head>
9 <title>NFD Status</title>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070010 <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
32<xsl:template name="formatDate">
33 <xsl:param name="date" />
34 <xsl:value-of select="substring($date, 0, 11)"/>&#160;<xsl:value-of select="substring($date, 12, 8)"/>
35</xsl:template>
36
37<xsl:template name="formatDuration">
38 <xsl:param name="duration" />
Eric Newberryde332452018-01-30 11:45:32 -070039 <xsl:variable name="milliseconds">
40 <xsl:choose>
41 <xsl:when test="contains($duration, '.')">
42 <xsl:value-of select="substring($duration, string-length($duration)-4, 3)" />
43 </xsl:when>
44 <xsl:otherwise>
45 0
46 </xsl:otherwise>
47 </xsl:choose>
48 </xsl:variable>
49 <xsl:variable name="seconds">
50 <xsl:choose>
51 <xsl:when test="contains($duration, '.')">
52 <xsl:value-of select="substring($duration, 3, string-length($duration)-7)" />
53 </xsl:when>
54 <xsl:otherwise>
55 <xsl:value-of select="substring($duration, 3, string-length($duration)-3)" />
56 </xsl:otherwise>
57 </xsl:choose>
58 </xsl:variable>
Chengyu Fana55663d2014-08-13 20:31:03 -060059 <xsl:variable name="days"><xsl:value-of select="floor($seconds div 86400)" /></xsl:variable>
60 <xsl:variable name="hours"><xsl:value-of select="floor($seconds div 3600)" /></xsl:variable>
61 <xsl:variable name="minutes"><xsl:value-of select="floor($seconds div 60)" /></xsl:variable>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070062 <xsl:choose>
Chengyu Fana55663d2014-08-13 20:31:03 -060063 <xsl:when test="$days = 1">
64 <xsl:value-of select="$days"/> day
65 </xsl:when>
66 <xsl:when test="$days > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070067 <xsl:value-of select="$days"/> days
68 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060069 <xsl:when test="$hours = 1">
70 <xsl:value-of select="$hours"/> hour
71 </xsl:when>
72 <xsl:when test="$hours > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070073 <xsl:value-of select="$hours"/> hours
74 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060075 <xsl:when test="$minutes = 1">
76 <xsl:value-of select="$minutes"/> minute
77 </xsl:when>
78 <xsl:when test="$minutes > 1">
Alexander Afanasyev8a093762014-07-16 18:43:09 -070079 <xsl:value-of select="$minutes"/> minutes
80 </xsl:when>
Chengyu Fana55663d2014-08-13 20:31:03 -060081 <xsl:when test="$seconds = 1">
82 <xsl:value-of select="$seconds"/> second
83 </xsl:when>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070084 <xsl:otherwise>
85 <xsl:value-of select="$seconds"/> seconds
86 </xsl:otherwise>
Eric Newberryde332452018-01-30 11:45:32 -070087 <xsl:when test="$milliseconds > 1">
88 <xsl:value-of select="$milliseconds"/> milliseconds
89 </xsl:when>
90 <xsl:when test="$milliseconds = 1">
91 <xsl:value-of select="$milliseconds"/> millisecond
92 </xsl:when>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070093 </xsl:choose>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070094</xsl:template>
95
Chengyu Fan45d1a762014-07-08 14:21:32 -060096<xsl:template match="nfd:generalStatus">
97 <h2>General NFD status</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -070098 <table class="item-list">
99 <thead>
100 <tr>
101 <th>Version</th>
102 <th>Start time</th>
103 <th>Current time</th>
104 <th>Uptime</th>
105 <th>NameTree Entries</th>
106 <th>FIB entries</th>
107 <th>PIT entries</th>
108 <th>Measurements entries</th>
109 <th>CS entries</th>
110 <th>In Interests</th>
111 <th>Out Interests</th>
112 <th>In Data</th>
113 <th>Out Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700114 <th>In Nacks</th>
115 <th>Out Nacks</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700116 </tr>
117 </thead>
118 <tbody>
119 <tr class="center">
Hila Ben Abraham2ef99572014-12-02 02:45:51 -0600120 <td><xsl:value-of select="nfd:version"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700121 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:startTime" /></xsl:call-template></td>
122 <td><xsl:call-template name="formatDate"><xsl:with-param name="date" select="nfd:currentTime" /></xsl:call-template></td>
123 <td><xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:uptime" /></xsl:call-template></td>
124 <td><xsl:value-of select="nfd:nNameTreeEntries"/></td>
125 <td><xsl:value-of select="nfd:nFibEntries"/></td>
126 <td><xsl:value-of select="nfd:nPitEntries"/></td>
127 <td><xsl:value-of select="nfd:nMeasurementsEntries"/></td>
128 <td><xsl:value-of select="nfd:nCsEntries"/></td>
129 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
130 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
Junxiao Shif03d4792017-04-06 16:41:22 +0000131 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nData"/></td>
132 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nData"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700133 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
134 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700135 </tr>
136 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600137 </table>
138</xsl:template>
139
140<xsl:template match="nfd:channels">
141 <h2>Channels</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700142 <table class="item-list">
143 <thead>
144 <tr>
145 <th>Channel URI</th>
146 </tr>
147 </thead>
148 <tbody>
149 <xsl:for-each select="nfd:channel">
150 <xsl:variable name="style">
151 <xsl:choose>
152 <xsl:when test="position() mod 2 = 1">
153 <xsl:text>odd</xsl:text>
154 </xsl:when>
155 <xsl:otherwise>even</xsl:otherwise>
156 </xsl:choose>
157 </xsl:variable>
158 <tr class="{$style}">
159 <td><xsl:value-of select="nfd:localUri"/></td>
160 </tr>
161 </xsl:for-each>
162 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600163 </table>
164</xsl:template>
165
166<xsl:template match="nfd:faces">
167 <h2>Faces</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700168 <table class="item-list">
169 <thead>
170 <tr>
171 <th>Face ID</th>
172 <th>Remote URI</th>
173 <th>Local URI</th>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600174 <th>Scope</th>
175 <th>Persistency</th>
176 <th>LinkType</th>
Eric Newberry6d932e82016-11-24 05:05:43 +0000177 <th>Flags</th>
Chengyu Fan67179642014-08-15 16:00:43 -0600178 <th>Expires in</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700179 <th>In Interests</th>
180 <th>In Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700181 <th>In Nacks</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600182 <th>In Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700183 <th>Out Interests</th>
184 <th>Out Data</th>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700185 <th>Out Nacks</th>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600186 <th>Out Bytes</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700187 </tr>
188 </thead>
189 <tbody>
190 <xsl:for-each select="nfd:face">
191 <xsl:variable name="style">
192 <xsl:choose>
193 <xsl:when test="position() mod 2 = 1">
194 <xsl:text>odd</xsl:text>
195 </xsl:when>
196 <xsl:otherwise>even</xsl:otherwise>
197 </xsl:choose>
198 </xsl:variable>
199 <tr class="{$style}">
200 <td><xsl:value-of select="nfd:faceId"/></td>
201 <td><xsl:value-of select="nfd:remoteUri"/></td>
202 <td><xsl:value-of select="nfd:localUri"/></td>
Chengyu Fan27d570a2014-10-09 11:52:17 -0600203 <td><xsl:value-of select="nfd:faceScope"/></td>
204 <td><xsl:value-of select="nfd:facePersistency"/></td>
205 <td><xsl:value-of select="nfd:linkType"/></td>
Chengyu Fan67179642014-08-15 16:00:43 -0600206 <td>
207 <xsl:choose>
Eric Newberry6d932e82016-11-24 05:05:43 +0000208 <xsl:when test="nfd:flags/nfd:localFieldsEnabled">
209 local-fields
210 </xsl:when>
Eric Newberryde332452018-01-30 11:45:32 -0700211 <xsl:when test="nfd:flags/nfd:lpReliabilityEnabled">
212 reliability
213 </xsl:when>
214 <xsl:when test="nfd:flags/nfd:congestionMarkingEnabled">
215 congestion-marking
216 </xsl:when>
Eric Newberry6d932e82016-11-24 05:05:43 +0000217 </xsl:choose>
218 </td>
219 <td>
220 <xsl:choose>
Chengyu Fan67179642014-08-15 16:00:43 -0600221 <xsl:when test="nfd:expirationPeriod">
222 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
223 </xsl:when>
224 <xsl:otherwise>
225 Never
226 </xsl:otherwise>
227 </xsl:choose>
228 </td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700229 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nInterests"/></td>
Junxiao Shif03d4792017-04-06 16:41:22 +0000230 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nData"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700231 <td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600232 <td><xsl:value-of select="nfd:byteCounters/nfd:incomingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700233 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nInterests"/></td>
Junxiao Shif03d4792017-04-06 16:41:22 +0000234 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nData"/></td>
Weiwei Liuace83ac2016-04-25 10:16:37 -0700235 <td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
Chengyu Fan3331cfa2014-07-25 17:36:31 -0600236 <td><xsl:value-of select="nfd:byteCounters/nfd:outgoingBytes"/></td>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700237 </tr>
238 </xsl:for-each>
239 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600240 </table>
241</xsl:template>
242
243<xsl:template match="nfd:fib">
244 <h2>FIB</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700245 <table class="item-list">
246 <thead>
247 <tr>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600248 <th width="20%">Prefix</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700249 <th>NextHops</th>
250 </tr>
251 </thead>
252 <tbody>
253 <xsl:for-each select="nfd:fibEntry">
254 <xsl:variable name="style">
255 <xsl:choose>
256 <xsl:when test="position() mod 2 = 1">
257 <xsl:text>odd</xsl:text>
258 </xsl:when>
259 <xsl:otherwise>even</xsl:otherwise>
260 </xsl:choose>
261 </xsl:variable>
262 <tr class="{$style}">
263 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
264 <td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600265 <table class="item-sublist">
266 <tr>
267 <th>FaceId</th>
268 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
269 <td><xsl:value-of select="nfd:faceId"/></td>
270 </xsl:for-each>
271 </tr>
272 <tr>
273 <th>Cost</th>
274 <xsl:for-each select="nfd:nextHops/nfd:nextHop">
275 <td><xsl:value-of select="nfd:cost"/></td>
276 </xsl:for-each>
277 </tr>
278 </table>
279 </td>
280 </tr>
281 </xsl:for-each>
282 </tbody>
283 </table>
284</xsl:template>
285
286<xsl:template match="nfd:rib">
287 <h2>RIB</h2>
288 <table class="item-list">
289 <thead>
290 <tr>
291 <th width="20%">Prefix</th>
292 <th>Routes</th>
293 </tr>
294 </thead>
295 <tbody>
296 <xsl:for-each select="nfd:ribEntry">
297 <xsl:variable name="style">
298 <xsl:choose>
299 <xsl:when test="position() mod 2 = 1">
300 <xsl:text>odd</xsl:text>
301 </xsl:when>
302 <xsl:otherwise>even</xsl:otherwise>
303 </xsl:choose>
304 </xsl:variable>
305 <tr class="{$style}">
306 <td style="text-align:left;vertical-align:top;padding:0"><xsl:value-of select="nfd:prefix"/></td>
307 <td>
308 <table class="item-sublist">
309 <tr>
310 <th>FaceId</th>
311 <xsl:for-each select="nfd:routes/nfd:route">
312 <td><xsl:value-of select="nfd:faceId"/></td>
313 </xsl:for-each>
314 </tr>
315 <tr>
316 <th>Origin</th>
317 <xsl:for-each select="nfd:routes/nfd:route">
318 <td><xsl:value-of select="nfd:origin"/></td>
319 </xsl:for-each>
320 </tr>
321 <tr>
322 <th>Cost</th>
323 <xsl:for-each select="nfd:routes/nfd:route">
324 <td><xsl:value-of select="nfd:cost"/></td>
325 </xsl:for-each>
326 </tr>
327 <tr>
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500328 <th>ChildInherit</th>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600329 <xsl:for-each select="nfd:routes/nfd:route">
Chengyu Fan1c630ba2014-08-20 13:27:58 -0500330 <td>
331 <xsl:if test="nfd:flags/nfd:childInherit">
332 Y
333 </xsl:if>
334 </td>
335 </xsl:for-each>
336 </tr>
337 <tr>
338 <th>RibCapture</th>
339 <xsl:for-each select="nfd:routes/nfd:route">
340 <td>
341 <xsl:if test="nfd:flags/nfd:ribCapture">
342 Y
343 </xsl:if>
344 </td>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600345 </xsl:for-each>
346 </tr>
347 <tr>
348 <th>Expires in</th>
349 <xsl:for-each select="nfd:routes/nfd:route">
350 <td>
351 <xsl:choose>
352 <xsl:when test="nfd:expirationPeriod">
353 <xsl:call-template name="formatDuration"><xsl:with-param name="duration" select="nfd:expirationPeriod" /></xsl:call-template>
354 </xsl:when>
355 <xsl:otherwise>
356 Never
357 </xsl:otherwise>
358 </xsl:choose>
359 </td>
360 </xsl:for-each>
361 </tr>
362 </table>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700363 </td>
364 </tr>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600365 </xsl:for-each>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700366 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600367 </table>
368</xsl:template>
369
Junxiao Shi3160a3f2018-01-09 21:25:15 +0000370<xsl:template match="nfd:cs">
371 <h2>CS Information</h2>
372 <table class="item-list">
373 <thead>
374 <tr>
375 <th>Hits</th>
376 <th>Misses</th>
377 </tr>
378 </thead>
379 <tbody>
380 <tr class="center">
381 <td><xsl:value-of select="nfd:nHits"/></td>
382 <td><xsl:value-of select="nfd:nMisses"/></td>
383 </tr>
384 </tbody>
385 </table>
386</xsl:template>
387
Chengyu Fan45d1a762014-07-08 14:21:32 -0600388<xsl:template match="nfd:strategyChoices">
389 <h2>Strategy Choices</h2>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700390 <table class="item-list">
391 <thead>
392 <tr>
Chengyu Fan30aa2072014-07-20 13:52:32 -0600393 <th width="20%">Namespace</th>
Alexander Afanasyev8a093762014-07-16 18:43:09 -0700394 <th>Strategy Name</th>
395 </tr>
396 </thead>
397 <tbody>
398 <xsl:for-each select="nfd:strategyChoice">
399 <tr>
400 <td><xsl:value-of select="nfd:namespace"/></td>
401 <td><xsl:value-of select="nfd:strategy/nfd:name"/></td>
402 </tr>
403 </xsl:for-each>
404 </tbody>
Chengyu Fan45d1a762014-07-08 14:21:32 -0600405 </table>
406</xsl:template>
407
408</xsl:stylesheet>