blob: 333e01b4d8913456003b3556e79af632334abbbc [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 Send Hex</title>
Jeff Thompson7ed5ef52012-08-26 11:28:48 -07008 <script type="text/javascript" src="../java_socket_bridge.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -07009
Jeff Thompsonc3164722012-09-30 18:35:02 -070010 <script type="text/javascript" src="../util/CCNProtocolDTags.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070011
Jeff Thompsonc3164722012-09-30 18:35:02 -070012 <script type="text/javascript" src="../util/CCNTime.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070013
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070014 <script type="text/javascript" src="../Name.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070015
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070016 <script type="text/javascript" src="../ContentObject.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070017
Jeff Thompsonc3164722012-09-30 18:35:02 -070018 <script type="text/javascript" src="../encoding/DateFormat.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070019
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070020 <script type="text/javascript" src="../Interest.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070021
Jeff Thompsonc3164722012-09-30 18:35:02 -070022 <script type="text/javascript" src="../Key.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070023
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070024 <script type="text/javascript" src="../PublisherID.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070025
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070026 <script type="text/javascript" src="../PublisherPublicKeyDigest.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070027
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070028 <script type="text/javascript" src="../FaceInstance.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070029
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070030 <script type="text/javascript" src="../ForwardingEntry.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070031
32
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070033 <script type="text/javascript" src="../encoding/BinaryXMLEncoder.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070034
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070035 <script type="text/javascript" src="../encoding/BinaryXMLCodec.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070036
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070037 <script type="text/javascript" src="../encoding/BinaryXMLDecoder.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070038
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070039 <script type="text/javascript" src="../encoding/DataUtils.js"></script>
jeff9a9fff22012-09-23 15:45:22 -070040
41 <script type="text/javascript" src="../encoding/EncodingUtils.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070042
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070043 <script language="JavaScript" type="text/javascript" src="../security/KeyManager.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070044
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070045 <script language="JavaScript" type="text/javascript" src="../securityLib/jsbn.js"></script>
46 <script language="JavaScript" type="text/javascript" src="../securityLib/jsbn2.js"></script>
47 <script language="JavaScript" type="text/javascript" src="../securityLib/rsa.js"></script>
48 <script language="JavaScript" type="text/javascript" src="../securityLib/rsa2.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070049
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070050 <script language="JavaScript" type="text/javascript" src="../securityLib/sha1.js"></script>
51 <script language="JavaScript" type="text/javascript" src="../securityLib/sha256.js"></script>
52 <script language="JavaScript" type="text/javascript" src="../securityLib/sha512.js"></script>
53 <script language="JavaScript" type="text/javascript" src="../securityLib/md5.js"></script>
54 <script language="JavaScript" type="text/javascript" src="../securityLib/ripemd160.js"></script>
55 <script language="JavaScript" type="text/javascript" src="../securityLib/base64.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070056
Jeff Thompson7ed5ef52012-08-26 11:28:48 -070057 <script language="JavaScript" type="text/javascript" src="../securityLib/rsapem-1.1.js"></script>
58 <script language="JavaScript" type="text/javascript" src="../securityLib/rsasign-1.2.js"></script>
59 <script language="JavaScript" type="text/javascript" src="../securityLib/asn1hex-1.1.js"></script>
60 <script language="JavaScript" type="text/javascript" src="../securityLib/x509-1.1.js"></script>
Meki Cherkaoui8f173612012-06-06 01:05:40 -070061
62 <script type="text/javascript">
63 function run(){
Meki Cherkaoui8f173612012-06-06 01:05:40 -070064 //var n = a.replace("%","");
65
66 //console.log(n);
67
68 var hex = document.getElementById('contentname').value;
69
70 ///////////////////////////////////////
71 //createRoute(, 9695);
72
73
74 /// /ndn/ucla.edu/apps/hydra/mainvideo
75 //createRoute('131.179.141.15', 9695);
76 //createRoute('borges.metwi.ucla.edu', 9695);
77
78 //content object
Jeff Thompsonf3bd3592012-09-29 23:25:30 -070079 //var co = queryPrefix( Name );
Meki Cherkaoui8f173612012-06-06 01:05:40 -070080 console.log('HEX IS');
81 console.log(hex);
82
jeff9a9fff22012-09-23 15:45:22 -070083 var result = get('127.0.0.1', 9695, hex);
Meki Cherkaoui8f173612012-06-06 01:05:40 -070084
85 console.log('BINARY RESPONSE IS ' +result);
86
87 var output ="";
88 output += "HEX ANSWER IS: "+ result;
89
90 output+= "<br />";
91 output+= "<br />";
92
93 //result[0] and result[1] should be 0 and 4 if there is a content object found
94 if(result==null || result==undefined || result =="" ){
95
96
97 if(LOG>2)console.log('INVALID ANSWER');
98 output += "NO CONTENT FOUND";
99
100 output+= "<br />";
101 output+= "<br />";
102 }
103
104 else if(result[0] != '0'||result[1]!='4') {
105 if(LOG>2)console.log('INVALID ANSWER');
106 output += "INVALID ANSWER";
107
108 output+= "<br />";
109 output+= "<br />";
110 }
111 else{
112
113 var numbers = DataUtils.toNumbers(result);
114
115 console.log('HEX RESPONSE IS \n'+numbers);
116 decoder = new BinaryXMLDecoder(numbers);
117
118
119 co = new ContentObject();
120
Jeff Thompson86aea882012-09-29 17:32:48 -0700121 co.from_ccnb(decoder);
Meki Cherkaoui8f173612012-06-06 01:05:40 -0700122
123 if(LOG>2) console.log(co);
124
jeff9a9fff22012-09-23 15:45:22 -0700125 output += contentObjectToHtml(co);
Meki Cherkaoui8f173612012-06-06 01:05:40 -0700126 }
127 document.getElementById('result').innerHTML = output;
128 }
129
130 </script>
131
132</head>
133<body >
134 <form>
jeff9a9fff22012-09-23 15:45:22 -0700135 Please Enter a Hex Encoded Interest:<br /><input id="contentname" type="text" name="CONTENTNAME" value="01d2f20002d28e310000" /> <br />
Meki Cherkaoui8f173612012-06-06 01:05:40 -0700136 </form>
137 <button onclick="run()">Request Data!</button>
138 <div >
Jeff Thompson67439692012-08-26 12:15:08 -0700139 <applet id="JavaSocketBridge" archive="../JavaSocketBridge.jar" code="JavaSocketBridge.class" width="0" height="0">
Meki Cherkaoui8f173612012-06-06 01:05:40 -0700140 </applet>
141 </div>
142
143 <p id="result"></p>
144
145</body>
jeff9a9fff22012-09-23 15:45:22 -0700146</html>