2 * Copyright (C) 2014 SDN Hub
4 * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.
5 * You may not use this file except in compliance with this License.
6 * You may obtain a copy of the License at
8 * http://www.gnu.org/licenses/gpl-3.0.txt
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16 var ethertypeToString = function(type) {
18 case 0x800: return "IPv4";
19 case 0x806: return "LLDP";
20 case 0x88cc: return "LLDP";
21 case 0x86dd: return "IPv6";
22 default: return "Unknown";
26 var nwprotoToString = function(type) {
28 case 0x1: return "IPv4";
29 case 0x6: return "TCP";
30 case 0x11: return "UDP";
31 case 0x84: return "SCTP";
32 default: return "Unknown";
36 var removeAllChildren = function(node) {
37 while (node.firstChild) {
38 node.removeChild(node.firstChild);