blob: 79e8f3e3138d07800914748bc390eab5f6c2c44b [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">
4<html xmlns = "http://www.w3.org/1999/xhtml">
5
6<head>
7 <title>NDN Decode Face Instance</title>
8
Jeff Thompson38422f42012-11-15 00:20:39 -08009 <script type="text/javascript" src="../Helper.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070010
11 <script type="text/javascript">
12
13 function decode(){
14
15 var input = document.getElementById('result').innerHTML;
16
17
18 var faceInstance = decodeHexFaceInstance(input);
19
20 if(LOG>3)console.log('FACE INSTANCE DECODED');
21 if(LOG>3)console.log(faceInstance);
22
23 ///////////////////////////////////////
24
25 var output ="";
26
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070027 if(faceInstance.publisherPublicKeyDigest!=null ){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070028 output+= "PublisherPublicKeyDigest: ";
29
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070030 output+= DataUtils.toHex(faceInstance.publisherPublicKeyDigest.publisherPublicKeyDigest);
Meki Cherkaoui8f173612012-06-06 01:05:40 -070031
32 //output+= "PUBLISHER ID TYPE: ";
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070033 //output+= faceInstance.publisherPublicKeyDigest.PublisherPublicKeyDigest;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070034
35 output+= "<br />";
36 output+= "<br />";
37
38 }
39
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070040 if(faceInstance.faceID!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070041 output+= "FaceID: ";
42
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070043 output+= faceInstance.faceID;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070044 output+= "<br />";
45 }
46
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070047 if(faceInstance.ipProto!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070048 output+= "IPProto: ";
49
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070050 output+= faceInstance.ipProto;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070051 output+= "<br />";
52 }
53
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070054 if(faceInstance.host!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070055 output+= "Host: ";
56
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070057 output+= faceInstance.host;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070058 output+= "<br />";
59 }
60
61 if(faceInstance.Port!=null){
62 output+= "Port: ";
63
64 output+= faceInstance.Port;
65 output+= "<br />";
66 }
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070067 if(faceInstance.freshnessSeconds!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070068 output+= "FreshnessSeconds: ";
69
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070070 output+= faceInstance.freshnessSeconds;
Meki Cherkaoui8f173612012-06-06 01:05:40 -070071 output+= "<br />";
72 }
73
Jeff Thompsone85ff1d2012-09-29 21:21:57 -070074 /*if(interest.name!=null && interest.name.components!=null){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070075 output+= "NAME: ";
76
77 for(var i=0;i<interest.Name.Components.length;i++){
78 output+= "/"+ DataUtils.toString(interest.Name.Components[i]);
79 }
80 output+= "<br />";
81 output+= "<br />";
82 }*/
83
84 document.getElementById('result').innerHTML = output;
85
86 }
87
88 </script>
89
90</head>
91<body >
92 <form>
93
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070094 Please Press Decode:<br />
Meki Cherkaoui8f173612012-06-06 01:05:40 -070095
96 <!-- input id="faceInstance" type="text" name="FACEINSTANCE" value="/PARC/abc" /-->
97
98 </form>
99 <button onclick="decode()">Decode</button>
100
101
102
103 <p id="result">058203e20285e0a01e093968f9740ce7f4361babf5bb05a4e55aaca5e58f73eddeb8e013aa8f0004d29632310004da9631370004e2c631302e312e312e310004eaa6393639350003d2d6323134373438333634370000</p>
104
105</body>
jeffdd4602f2012-09-16 16:05:01 -0700106</html>