-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwiresharkFrame.php.original
201 lines (194 loc) · 6.59 KB
/
wiresharkFrame.php.original
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="static/css/wireshark.css">
<link rel="stylesheet" href="static/css/bootstrap.min.css">
<link rel="stylesheet" href="static/css/sharkcss.css">
</head>
<body>
<?php include('static/content/wiresharkFrameContent.php'); ?>
<form class='form-horizontal' role="form" method="post" id='form'>
<div class="form-group">
<label for='clientHost' class="col-sm-2 control-label"><?php echo $content['clientHost']; ?></label>
<div class="col-sm-10">
<input id="clientHost" type="text" name="clientHost" value="ple3.ipv6.lip6.fr" readonly>
</div>
</div>
<div class="form-group">
<label for='clientPort' class="col-sm-2 control-label"><?php echo $content['clientPort']; ?></label>
<div class="col-sm-10">
<input type="text" id="clientPort" name="clientPort" value="8080" readonly>
</div>
</div>
<!--<?php echo $content['sshPort']; ?>: --><input type="hidden" name="sshPort" value="22"/>
<!-- <?php echo $content['sliceName']; ?>: --><input type="hidden" name="sliceName" value="upmc_forge"/>
<div class="form-group">
<label for='serverAndPort' class="col-sm-2 control-label"><?php echo $content['serverHost']; ?></label>
<div class="col-sm-10">
<select name="serverAndPort" class="form-control">
<option value="ple4.ipv6.lip6.fr:8080">Local ple4.ipv6.lip6.fr:8080</option>
<option value="planetlab4.hiit.fi:8080">Continental planetlab4.hiit.fi:8080</option>
<option value="planet2.pnl.nitech.ac.jp:8080">Inter-Continental planet2.pnl.nitech.ac.jp:8080</option>
</select>
</div>
</div>
<div class="form-group">
<label for="fileName" class="col-sm-2 control-label"><?php echo $content['fileName']; ?></label>
<div class="col-sm-10">
<input type="text" name="fileName" id="fileName" value="test">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="radio">
<label>
<input type="radio" name="fileTarget" id="fileTargetIndex" value="index.html">
Index.html
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="fileTarget" id="fileTarget1Mo" value="file1Mo" checked>
1Mo File
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" value="valider" id="submit"/>
</div>
</div>
</form>
<div id="loader" style='display: none;'>Now running your experiment <img src="static/img/loader.gif"></div>
<div id="wrapper" style='display: none; width: 920px; height: 500px'>
<a id='downloadLink' href="#"><?php echo $content['download']; ?></a>
<div class="summary-div" class="pane">
<div class="fht_fixed_header" style="width: 920px; height: 29px;">
<table width="1420px" style="margin-left: 0px;">
<thead>
<tr>
<th class="first-cell" width="26px">
<div class="empty-cell" style="width:25px">No.</div>
</th>
<th width="66px">
<div class="empty-cell" style="width:65px;">Time</div>
</th>
<th width="114px">
<div class="empty-cell" style="width:113px;">Source</div>
</th>
<th width="114px">
<div class="empty-cell" style="width:113px;">Destination</div>
</th>
<th width="66px">
<div class="empty-cell" style="width:65px;">Protocol</div>
</th>
<th width="50px">
<div class="empty-cell" style="width:49px;">Length</div>
</th>
<th class="last-cell" width="866px">
<div class="empty-cell" style="width:865px;">Info</div>
</th>
</tr>
</thead>
</table>
</div>
<div class="fht_table_body" style="width: 920px; height: 140px; overflow: auto;">
<table id="wiresharkTop" style="width: 920px; margin-top: -29px;">
<thead>
<tr>
<th class="first-cell" width="26px">
<div class="empty-cell" style="width:25px">No.</div>
</th>
<th width="66px">
<div class="empty-cell" style="width:65px;">Time</div>
</th>
<th width="114px">
<div class="empty-cell" style="width:113px;">Source</div>
</th>
<th width="114px">
<div class="empty-cell" style="width:113px;">Destination</div>
</th>
<th width="66px">
<div class="empty-cell" style="width:65px;">Protocol</div>
</th>
<th width="50px">
<div class="empty-cell" style="width:49px;">Length</div>
</th>
<th class="last-cell" width="866px">
<div class="empty-cell" style="width:865px;">Info</div>
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="detail-div" class="pane" style="height: auto; bottom: 89.25px;">
<ul id="wiresharkMiddle">
</ul>
</div>
<div id="wiresharkBottom">
</div>
</div>
<script src="static/js/jquery.js"></script>
<script src="static/js/require.js"></script>
<script>
$(document).ready( function()
{
require(['static/js/pcap', 'static/js/packetDissector', 'static/js/ipv4', 'static/js/ipv6', 'static/js/utils', 'static/js/protocole', 'static/js/wireshark', 'static/js/http'], function(pcap)
{
var xhr = new XMLHttpRequest();
function jsTest()
{
$('#form').hide();
$('#loader').show();
if(xhr)
{
xhr.open('POST', 'scripts/index.php', true);
xhr.onreadystatechange = handler;
var formData = new FormData(document.getElementById('form'))
xhr.send(formData);
}
else
{
console.log('fail');
}
return false;
}
function handler(evtXHR)
{
if(xhr.readyState == 4)
{
if(xhr.status == 200)
{
if(xhr.response==0)
{
xhr.open('GET', 'http://'+$('input[name="clientHost"]').val()+':'+$('input[name="clientPort"]').val()+'/', true);
xhr.onreadystatechange = handlePcap;
xhr.send();
}
}
}
}
function handlePcap(evtXHR)
{
if(xhr.readyState == 4)
{
if(xhr.status == 200)
{
handlePcapFile(hexToStr(pairHex(xhr.responseText)));
$('#downloadLink').attr('href', 'scripts/downloadTrace.php?clientHost='+$('input[name="clientHost"]').val()+'&clientPort='+$('input[name="clientPort"]').val()+'&fileName='+$('input[name="fileName"]').val());
$('#loader').hide();
$('#wrapper').show();
}
}
}
$('#submit').click(jsTest);
});
});
</script>
</body>
</html>