From 9b0978282d90d83ecd2743be5009cb2c4dc652a0 Mon Sep 17 00:00:00 2001 From: joseangelgm Date: Wed, 28 Nov 2018 14:25:21 +0100 Subject: [PATCH] B #2580 Sunstone is not showing well security groups for ICMP6 (cherry picked from commit 1e218aa021b98643780c8ff4896298c972409e93) --- .../app/tabs/secgroups-tab/utils/common.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/sunstone/public/app/tabs/secgroups-tab/utils/common.js b/src/sunstone/public/app/tabs/secgroups-tab/utils/common.js index dfb7ec8903..6883eadb6b 100644 --- a/src/sunstone/public/app/tabs/secgroups-tab/utils/common.js +++ b/src/sunstone/public/app/tabs/secgroups-tab/utils/common.js @@ -49,6 +49,9 @@ define(function(require) { case "ICMP": text["PROTOCOL"] = Locale.tr("ICMP"); break; + case "ICMPV6": + text["PROTOCOL"] = Locale.tr("ICMPv6") + break; case "IPSEC": text["PROTOCOL"] = Locale.tr("IPsec"); break; @@ -83,6 +86,12 @@ define(function(require) { text["ICMP_TYPE"] = ""; } + if(rule.ICMPv6_TYPE != undefined){ + text["ICMPv6_TYPE"] = _icmpv6ToSt(rule.ICMPv6_TYPE); + } else { + text["ICMPv6_TYPE"] = ""; + } + if(rule.RANGE != undefined && rule.RANGE != ""){ text["RANGE"] = rule.RANGE; } else { @@ -155,6 +164,19 @@ define(function(require) { } } + function _icmpv6ToSt(icmpv6_type){ + switch( icmpv6_type){ + case "": return Locale.tr("All"); + case "1": return "1: Destination Unreachable"; + case "2": return "2/0: Packet too long"; + case "3": return "3: Time exceeded"; + case "4": return "4: Parameter problem"; + case "128": return "128/0: Echo request (ping)"; + case "129": return "129/0: Echo reply (pong)"; + default: return "" + icmpv6_type; + } + } + /* @param {Object} info Object representing the Security Group as returned by OpenNebula */