blob: 922d8810ed0e389881a33a718fa4c70508c930dc [file] [log] [blame]
Meki Cherkaoui8f173612012-06-06 01:05:40 -07001<?xml version = "1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3"DTD/xhtml1-strict.dtd">
Jeff Burke92dd8e42012-12-08 11:40:31 -08004
5<!--
6 See COPYING for copyright and distribution information.
7-->
8
Meki Cherkaoui8f173612012-06-06 01:05:40 -07009<html xmlns = "http://www.w3.org/1999/xhtml">
10
11<head>
12 <title>NDN Decode Face Instance</title>
13
Jeff Thompson38422f42012-11-15 00:20:39 -080014 <script type="text/javascript" src="../Helper.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070015
16 <script type="text/javascript">
17
18 function decode(){
19
20 var input = document.getElementById('result').innerHTML;
21
22
23 var faceInstance = decodeHexFaceInstance(input);
24
25 if(LOG>3)console.log('FACE INSTANCE DECODED');
26 if(LOG>3)console.log(faceInstance);
27
28 ///////////////////////////////////////
29
30 var output ="";
31
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070032 if(faceInstance.publisherPublicKeyDigest!=null ){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070033 output+= "PublisherPublicKeyDigest: ";
34
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070035 output+= DataUtils.toHex(faceInstance.publisherPublicKeyDigest.publisherPublicKeyDigest);
Meki Cherkaoui8f173612012-06-06 01:05:40 -070036
37 //output+= "PUBLISHER ID TYPE: ";
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070038 //output+= faceInstance.publisherPublicKeyDigest.PublisherPublicKeyDigest;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070039
40 output+= "<br />";
41 output+= "<br />";
42
43 }
44
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070045 if(faceInstance.faceID!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070046 output+= "FaceID: ";
47
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070048 output+= faceInstance.faceID;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070049 output+= "<br />";
50 }
51
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070052 if(faceInstance.ipProto!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070053 output+= "IPProto: ";
54
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070055 output+= faceInstance.ipProto;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070056 output+= "<br />";
57 }
58
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070059 if(faceInstance.host!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070060 output+= "Host: ";
61
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070062 output+= faceInstance.host;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070063 output+= "<br />";
64 }
65
66 if(faceInstance.Port!=null){
67 output+= "Port: ";
68
69 output+= faceInstance.Port;
70 output+= "<br />";
71 }
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070072 if(faceInstance.freshnessSeconds!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070073 output+= "FreshnessSeconds: ";
74
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070075 output+= faceInstance.freshnessSeconds;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070076 output+= "<br />";
77 }
78
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070079 /*if(interest.name!=null && interest.name.components!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070080 output+= "NAME: ";
81
82 for(var i=0;i<interest.Name.Components.length;i++){
83 output+= "/"+ DataUtils.toString(interest.Name.Components[i]);
84 }
85 output+= "<br />";
86 output+= "<br />";
87 }*/
88
89 document.getElementById('result').innerHTML = output;
90
91 }
92
93 </script>
94
95</head>
96<body >
97 <form>
98
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070099 Please Press Decode:<br />
Meki Cherkaoui8f173612012-06-06 01:05:40 -0700100
101 <!-- input id="faceInstance" type="text" name="FACEINSTANCE" value="/PARC/abc" /-->
102
103 </form>
104 <button onclick="decode()">Decode</button>
105
106
107
108 <p id="result">058203e20285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f0004d29632310004da9631370004e2c631302e312e312e310004eaa6393639350003d2d6323134373438333634370000</p>
109
110</body>
jeffdd4602f2012-09-16 16:05:01 -0700111</html>