Add support for gaming.

This commit is contained in:
2022-02-09 15:13:22 +01:00
parent 5c02b40a7c
commit 64b991f599
9 changed files with 579 additions and 148 deletions

View File

@ -546,6 +546,9 @@ for _port in $vpn_local_net_ports ; do
vpn_local_net_port_arr+=("$_port")
done
declare -a vpn_out_port_arr
if [[ -z "$vpn_out_ports" ]] ; then
vpn_out_ports="$standard_vpn_port"
fi
for _port in $vpn_out_ports ; do
vpn_out_port_arr+=("$_port")
done
@ -608,6 +611,21 @@ done
# ---
# - Turn/Stun Ports
# ---
if $allow_outbound_streaming \
|| $allow_echo360_video_streaming \
|| $allow_bigbluebutton_video_conference_out \
|| $allow_ms_skype_teams_out \
|| $allow_webex_video_conference_out \
|| $allow_zoom_video_conference_out \
|| $allow_jitsi_video_conference_out \
|| $allow_alfaview_video_conference_out \
|| $allow_nc_talk_out ; then
allow_stun_turn_service_out=true
else
allow_stun_turn_service_out=false
fi
declare -a standard_turn_service_port_arr
CUR_IFS="$IFS"
IFS=',' ; for _port in $standard_turn_service_ports ; do
@ -750,6 +768,178 @@ IFS="$CUR_IFS"
# ---
# Gaming
# ---
if $allow_game_xbox_one_out \
|| $allow_game_xbox_360_out \
|| $allow_game_ps3_out \
|| $allow_game_ps4_out \
|| $allow_game_fifa21_out ; then
$allow_gaming_out=true
else
$allow_gaming_out=false
fi
declare -a game_ports_udp_arr
if $allow_game_xbox_360_out ; then
IFS=',' ; for _port in $standard_game_xbox_one_udp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif containsElement "${_port}" "${game_ports_udp_arr[@]}" ; then
continue
else
game_ports_udp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
if $standard_game_xbox_one_udp_ports ; then
IFS=',' ; for _port in $standard_game_xbox_one_udp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif containsElement "${_port}" "${game_ports_udp_arr[@]}" ; then
continue
else
game_ports_udp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
if $standard_game_ps3_udp_ports ; then
IFS=',' ; for _port in $standard_game_ps3_udp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif containsElement "${_port}" "${game_ports_udp_arr[@]}" ; then
continue
else
game_ports_udp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
if $standard_game_ps4_udp_ports ; then
IFS=',' ; for _port in $standard_game_ps4_udp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif containsElement "${_port}" "${game_ports_udp_arr[@]}" ; then
continue
else
game_ports_udp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
if $standard_game_fifa21_udp_ports ; then
IFS=',' ; for _port in $standard_game_fifa21_udp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif containsElement "${_port}" "${game_ports_udp_arr[@]}" ; then
continue
else
game_ports_udp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
allow_stun_turn_service_out allow_stun_turn_service_out
declare -a game_ports_tcp_arr
if $allow_game_xbox_360_out ; then
IFS=',' ; for _port in $standard_game_xbox_one_tcp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif $allow_http_request_out && containsElement "${_port}" "${standard_http_port_arr[@]}" ; then
continue
elif containsElement "${_port}" "${game_ports_tcp_arr[@]}" ; then
continue
else
game_ports_tcp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
if $standard_game_xbox_one_tcp_ports ; then
IFS=',' ; for _port in $standard_game_xbox_one_tcp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif $allow_http_request_out && containsElement "${_port}" "${standard_http_port_arr[@]}" ; then
continue
elif containsElement "${_port}" "${game_ports_tcp_arr[@]}" ; then
continue
else
game_ports_tcp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
if $standard_game_ps3_tcp_ports ; then
IFS=',' ; for _port in $standard_game_ps3_tcp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif $allow_http_request_out && containsElement "${_port}" "${standard_http_port_arr[@]}" ; then
continue
elif containsElement "${_port}" "${game_ports_tcp_arr[@]}" ; then
continue
else
game_ports_tcp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
if $standard_game_ps4_tcp_ports ; then
IFS=',' ; for _port in $standard_game_ps4_tcp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif $allow_http_request_out && containsElement "${_port}" "${standard_http_port_arr[@]}" ; then
continue
elif containsElement "${_port}" "${game_ports_tcp_arr[@]}" ; then
continue
else
game_ports_tcp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
if $standard_game_fifa21_tcp_ports ; then
IFS=',' ; for _port in $standard_game_fifa21_tcp_ports ; do
if $allow_stun_turn_service_out && containsElement "${_port}" "${standard_turn_service_port_arr}" ; then
continue
elif [[ "$_port" = "$standard_dns_port" ]] ; then
continue
elif $allow_http_request_out && containsElement "${_port}" "${standard_http_port_arr[@]}" ; then
continue
elif containsElement "${_port}" "${game_ports_tcp_arr[@]}" ; then
continue
else
game_ports_tcp_arr+==("$_port")
fi
done
IFS="$CUR_IFS"
fi
# ---
# - IPMI