mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Uses new localization for icmp types and codes
This commit is contained in:
parent
141cbeb2bc
commit
0eb75bf884
10 changed files with 9 additions and 581 deletions
|
|
@ -2439,137 +2439,6 @@ function historicalProtoHostHref(ifId, host, l4_proto, ndpi_proto_id, info)
|
|||
end
|
||||
end
|
||||
|
||||
-- ##########################################
|
||||
|
||||
local _icmp_types = {
|
||||
{ 0, 0, "icmp_v4_types.type_0_0_echo_reply" },
|
||||
{ 3, 0, "icmp_v4_types.type_3_0_network_unreachable" },
|
||||
{ 3, 1, "icmp_v4_types.type_3_1_host_unreachable" },
|
||||
{ 3, 2, "icmp_v4_types.type_3_2_protocol_unreachable" },
|
||||
{ 3, 3, "icmp_v4_types.type_3_3_port_unreachable" },
|
||||
{ 3, 4, "icmp_v4_types.type_3_4_fragmentation_needed_but_no_fragment_bit_set" },
|
||||
{ 3, 5, "icmp_v4_types.type_3_5_source_routing_failed" },
|
||||
{ 3, 6, "icmp_v4_types.type_3_6_destination_network_unknown" },
|
||||
{ 3, 7, "icmp_v4_types.type_3_7_destination_host_unknown" },
|
||||
{ 3, 8, "icmp_v4_types.type_3_8_source_host_isolated" },
|
||||
{ 3, 9, "icmp_v4_types.type_3_9_destination_network_administratively_prohibited" },
|
||||
{ 3, 10, "icmp_v4_types.type_3_10_destination_host_administratively_prohibited" },
|
||||
{ 3, 11, "icmp_v4_types.type_3_11_network_unreachable_for_tos" },
|
||||
{ 3, 12, "icmp_v4_types.type_3_12_host_unreachable_for_tos" },
|
||||
{ 3, 13, "icmp_v4_types.type_3_13_communication_administratively_prohibited_by_filtering" },
|
||||
{ 3, 14, "icmp_v4_types.type_3_14_host_precedence_violation" },
|
||||
{ 3, 15, "icmp_v4_types.type_3_15_precedence_cutoff_in_effect" },
|
||||
{ 4, 0, "icmp_v4_types.type_4_0_source_quench" },
|
||||
{ 5, 0, "icmp_v4_types.type_5_0_redirect_for_network" },
|
||||
{ 5, 1, "icmp_v4_types.type_5_1_redirect_for_host" },
|
||||
{ 5, 2, "icmp_v4_types.type_5_2_redirect_for_tos_and_network" },
|
||||
{ 5, 3, "icmp_v4_types.type_5_3_redirect_for_tos_and_host" },
|
||||
{ 8, 0, "icmp_v4_types.type_8_0_echo_request" },
|
||||
{ 9, 0, "icmp_v4_types.type_9_0_router_advertisement" },
|
||||
{ 10, 0, "icmp_v4_types.type_10_0_route_solicitation" },
|
||||
{ 11, 0, "icmp_v4_types.type_11_0_ttl_equals_0_during_transit" },
|
||||
{ 11, 1, "icmp_v4_types.type_11_1_ttl_equals_0_during_reassembly" },
|
||||
{ 12, 0, "icmp_v4_types.type_12_0_ip_header_bad" },
|
||||
{ 12, 1, "icmp_v4_types.type_12_1_required_options_missing" },
|
||||
{ 13, 0, "icmp_v4_types.type_13_0_timestamp_request" },
|
||||
{ 14, 0, "icmp_v4_types.type_14_0_timestamp_reply" },
|
||||
{ 15, 0, "icmp_v4_types.type_15_0_information_request" },
|
||||
{ 16, 0, "icmp_v4_types.type_16_0_information_reply" },
|
||||
{ 17, 0, "icmp_v4_types.type_17_0_address_mask_request" },
|
||||
{ 18, 0, "icmp_v4_types.type_18_0_address_mask_reply" }
|
||||
}
|
||||
|
||||
-- Code is currently ignored on IVMPv6
|
||||
local _icmpv6_types = {
|
||||
{ 0, i18n("icmp_v6_types.type_0_reserved") },
|
||||
{ 1, i18n("icmp_v6_types.type_1_destination_unreachable") },
|
||||
{ 2, i18n("icmp_v6_types.type_2_packet_too_big") },
|
||||
{ 3, i18n("icmp_v6_types.type_3_time_exceeded") },
|
||||
{ 4, i18n("icmp_v6_types.type_4_parameter_problem") },
|
||||
{ 100, i18n("icmp_v6_types.type_100_private_experimentation") },
|
||||
{ 101, i18n("icmp_v6_types.type_101_private_experimentation") },
|
||||
--{ 102-126, i18n("icmp_v6_types.type_102-126_unassigned") },
|
||||
{ 127, i18n("icmp_v6_types.type_127_reserved_for_expansion_of_icmpv6_error_messages") },
|
||||
{ 128, i18n("icmp_v6_types.type_128_echo_request") },
|
||||
{ 129, i18n("icmp_v6_types.type_129_echo_reply") },
|
||||
{ 130, i18n("icmp_v6_types.type_130_multicast_listener_query") },
|
||||
{ 131, i18n("icmp_v6_types.type_131_multicast_listener_report") },
|
||||
{ 132, i18n("icmp_v6_types.type_132_multicast_listener_done") },
|
||||
{ 133, i18n("icmp_v6_types.type_133_router_solicitation") },
|
||||
{ 134, i18n("icmp_v6_types.type_134_router_advertisement") },
|
||||
{ 135, i18n("icmp_v6_types.type_135_neighbor_solicitation") },
|
||||
{ 136, i18n("icmp_v6_types.type_136_neighbor_advertisement") },
|
||||
{ 137, i18n("icmp_v6_types.type_137_redirect_message") },
|
||||
{ 138, i18n("icmp_v6_types.type_138_router_renumbering") },
|
||||
{ 139, i18n("icmp_v6_types.type_139_icmp_node_information_query") },
|
||||
{ 140, i18n("icmp_v6_types.type_140_icmp_node_information_response") },
|
||||
{ 141, i18n("icmp_v6_types.type_141_inverse_neighbor_discovery_solicitation_message") },
|
||||
{ 142, i18n("icmp_v6_types.type_142_inverse_neighbor_discovery_advertisement_message") },
|
||||
{ 143, i18n("icmp_v6_types.type_143_version_2_multicast_listener_report") },
|
||||
{ 144, i18n("icmp_v6_types.type_144_home_agent_address_discovery_request_message") },
|
||||
{ 145, i18n("icmp_v6_types.type_145_home_agent_address_discovery_reply_message") },
|
||||
{ 146, i18n("icmp_v6_types.type_146_mobile_prefix_solicitation") },
|
||||
{ 147, i18n("icmp_v6_types.type_147_mobile_prefix_advertisement") },
|
||||
{ 148, i18n("icmp_v6_types.type_148_certification_path_solicitation_message") },
|
||||
{ 149, i18n("icmp_v6_types.type_149_certification_path_advertisement_message") },
|
||||
{ 150, i18n("icmp_v6_types.type_150_icmp_messages_utilized_by_experimental_mobility_protocols") },
|
||||
{ 151, i18n("icmp_v6_types.type_151_multicast_router_advertisement") },
|
||||
{ 152, i18n("icmp_v6_types.type_152_multicast_router_solicitation") },
|
||||
{ 153, i18n("icmp_v6_types.type_153_multicast_router_termination") },
|
||||
{ 154, i18n("icmp_v6_types.type_154_fmipv6_messages") },
|
||||
{ 155, i18n("icmp_v6_types.type_155_rpl_control_message") },
|
||||
{ 156, i18n("icmp_v6_types.type_156_ilnpv6_locator_update_message") },
|
||||
{ 157, i18n("icmp_v6_types.type_157_duplicate_address_request") },
|
||||
{ 158, i18n("icmp_v6_types.type_158_duplicate_address_confirmation") },
|
||||
{ 159, i18n("icmp_v6_types.type_159_mpl_control_message") },
|
||||
--{ 160-199, i18n("icmp_v6_types.type_160-199_unassigned") },
|
||||
{ 200, i18n("icmp_v6_types.type_200_private_experimentation") },
|
||||
{ 201, i18n("icmp_v6_types.type_201_private_experimentation") },
|
||||
{ 255, i18n("icmp_v6_types.type_255_reserved_for_expansion_of_icmpv6_informational_messages") }
|
||||
}
|
||||
|
||||
-- #############################################
|
||||
|
||||
function getICMPV6TypeCode(icmp)
|
||||
local t = icmp.type
|
||||
local c = icmp.code
|
||||
|
||||
for _, _e in ipairs(_icmpv6_types) do
|
||||
if(_e[1] == t) then
|
||||
return(_e[2])
|
||||
end
|
||||
end
|
||||
|
||||
if t and c then
|
||||
return (t or '').."/"..(c or '')
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end
|
||||
|
||||
-- #############################################
|
||||
|
||||
function getICMPTypeCode(icmp)
|
||||
local t = icmp.type
|
||||
local c = icmp.code
|
||||
local extra = {src_port = '', dst_port = '', protocol = ''}
|
||||
|
||||
if icmp["unreach"] then
|
||||
extra["src_port"] = icmp["unreach"]["src_port"]..''
|
||||
extra["dst_port"] = icmp["unreach"]["dst_port"]..''
|
||||
extra["protocol"] = getL4ProtoName(icmp["unreach"]["protocol"])
|
||||
end
|
||||
|
||||
for _, _e in ipairs(_icmp_types) do
|
||||
if((_e[1] == t) and (_e[2] == c)) then
|
||||
local res = _e[3]
|
||||
return i18n(res, extra)
|
||||
end
|
||||
end
|
||||
|
||||
return(getICMPV6TypeCode(icmp))
|
||||
end
|
||||
|
||||
-- #############################################
|
||||
|
||||
-- Add here the icons you guess based on the Mac address
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue