#
# Patrick Marc Preuss, Refried Jello, Pavlo Skliarenko
# 2020-01-13 - Initial Version
# 2021-01-08 - Update for 6.2
# 2023-09-09 - Update for 6.4.2
# 2025-02-16 - Update for 7.4.0
#
# FG Version: 5.6, 6.0.7, 6.2, 6.4.2, 7.4.0
# HW        : varied
# HA        : AP
# VDOMS     : ENABLED
Value Required NAME (\S+)
Value MODE (\S+)
Value MANAGEMENT_IP (\d+?\.\d+?\.\d+?\.\d+?)
Value MANAGEMENT_NETMASK (\d+?\.\d+?\.\d+?\.\d+?)
Value IP_ADDRESS (\d+?\.\d+?\.\d+?\.\d+?)
Value NETMASK (\d+?\.\d+?\.\d+?\.\d+?)
Value STATUS (\S+)
Value NETBIOS_FORWARD (\S+)
Value TYPE (\S+)
Value RING_RX (\d+)
Value RING_TX (\d+)
Value NETFLOW_SAMPLER (\S+)
Value SFLOW_SAMPLER (\S+)
Value SCAN_BOTNET_CONNECTIONS (\S+)
Value SRC_CHECK (\S+)
Value EXPLICIT_WEB_PROXY (\S+)
Value EXPLICIT_FTP_PROXY (\S+)
Value PROXY_CAPTIVE_PORTAL (\S+)
Value SWITCH_CONTROLLER_FEATURE (\S+)
Value MTU_OVERRIDE (\S+)
Value WCCP (\S+)
Value DROP_OVERLAPPED_FRAGMENT (\S+)
Value DROP_FRAGMENT (\S+)

Start
  ^==\s+\[\s+\S+\s\]$$
  # mgmt
  # name:ip:status:netbios-forward:type:netflow-sampler:sflow-sampler:scan-botnet-connections:src-check:explicit-web-proxy:explicit-ftp-proxy:proxy-captive-portal:mtu-override:wccp:drop-overlapped-fragment:drop-fragment
  ^name:\s+${NAME}\s+ip:\s+${IP_ADDRESS}\s+${NETMASK}\s+status:\s+${STATUS}\s+netbios-forward:\s+${NETBIOS_FORWARD}\s+type:\s+${TYPE}\s+netflow-sampler:\s+${NETFLOW_SAMPLER}\s+sflow-sampler:\s+${SFLOW_SAMPLER}\s+scan-botnet-connections:\s+${SCAN_BOTNET_CONNECTIONS}\s+src-check:\s+${SRC_CHECK}\s+explicit-web-proxy:\s+${EXPLICIT_WEB_PROXY}\s+explicit-ftp-proxy:\s+${EXPLICIT_FTP_PROXY}\s+proxy-captive-portal:\s+${PROXY_CAPTIVE_PORTAL}\s+mtu-override:\s+${MTU_OVERRIDE}\s+wccp:\s+${WCCP}\s+drop-overlapped-fragment:\s+${DROP_OVERLAPPED_FRAGMENT}\s+drop-fragment:\s+${DROP_FRAGMENT}\s*$$ -> Record
  # modem
  # name:mode:management-ip:ip:netbios-forward:type:netflow-sampler:sflow-sampler:scan-botnet-connections?:src-check:proxy-captive-portal:switch-controller-feature?:mtu-override:wccp:drop-overlapped-fragment:drop-fragment
  ^name:\s+${NAME}\s+mode:\s+${MODE}\s+management-ip:\s+${MANAGEMENT_IP}\s+${MANAGEMENT_NETMASK}\s+ip:\s+${IP_ADDRESS}\s+${NETMASK}\s+netbios-forward:\s+${NETBIOS_FORWARD}\s+type:\s+${TYPE}\s+netflow-sampler:\s+${NETFLOW_SAMPLER}\s+sflow-sampler:\s+${SFLOW_SAMPLER}\s+(scan-botnet-connections:\s+${SCAN_BOTNET_CONNECTIONS}\s+)?src-check:\s+${SRC_CHECK}\s+proxy-captive-portal:\s+${PROXY_CAPTIVE_PORTAL}\s+(switch-controller-feature:\s+${SWITCH_CONTROLLER_FEATURE}\s+)?mtu-override:\s+${MTU_OVERRIDE}\s+wccp:\s+${WCCP}\s+drop-overlapped-fragment:\s+${DROP_OVERLAPPED_FRAGMENT}\s+drop-fragment:\s+${DROP_FRAGMENT}\s*$$ -> Record
  # type physical and vlan
  # name:mode:management-ip:ip:status:netbios-forward:type:netflow-sampler:sflow-sampler:scan-botnet-connections?:src-check:explicit-web-proxy:explicit-ftp-proxy:proxy-captive-portal:mtu-override:wccp:drop-overlapped-fragment:drop-fragment
  ^name:\s+${NAME}\s+mode:\s+${MODE}\s+management-ip:\s+${MANAGEMENT_IP}\s+${MANAGEMENT_NETMASK}\s+ip:\s+${IP_ADDRESS}\s+${NETMASK}\s+status:\s+${STATUS}\s+netbios-forward:\s+${NETBIOS_FORWARD}\s+type:\s+${TYPE}\s+netflow-sampler:\s+${NETFLOW_SAMPLER}\s+sflow-sampler:\s+${SFLOW_SAMPLER}\s+(scan-botnet-connections:\s+${SCAN_BOTNET_CONNECTIONS}\s+)?src-check:\s+${SRC_CHECK}\s+explicit-web-proxy:\s+${EXPLICIT_WEB_PROXY}\s+explicit-ftp-proxy:\s+${EXPLICIT_FTP_PROXY}\s+proxy-captive-portal:\s+${PROXY_CAPTIVE_PORTAL}\s+(switch-controller-feature:\s+${SWITCH_CONTROLLER_FEATURE}\s+)?mtu-override:\s+${MTU_OVERRIDE}\s+wccp:\s+${WCCP}\s+drop-overlapped-fragment:\s+${DROP_OVERLAPPED_FRAGMENT}\s+drop-fragment:\s+${DROP_FRAGMENT}\s*$$ -> Record
  # npu_vlink
  # name:mode:management-ip?:ip:status?:netbios-forward:type:ring-rx?:ring-tx?:netflow-sampler:sflow-sampler:src-check:explicit-web-proxy:explicit-ftp-proxy:proxy-captive-portal:switch-controller-feature?:mtu-override?:wccp?:drop-overlapped-fragment?:drop-fragment?
  ^name:\s+${NAME}\s+(mode:\s+${MODE}\s+)?(management-ip:\s+${MANAGEMENT_IP}\s+${MANAGEMENT_NETMASK}\s+)?ip:\s+${IP_ADDRESS}\s+${NETMASK}\s+(status:\s+${STATUS}\s+)?(netbios-forward:\s+${NETBIOS_FORWARD}\s+)?type:\s+${TYPE}\s+(ring-rx:\s+${RING_RX}\s+ring-tx:\s+${RING_TX}\s+)?netflow-sampler:\s+${NETFLOW_SAMPLER}\s+sflow-sampler:\s+${SFLOW_SAMPLER}\s+src-check:\s+${SRC_CHECK}\s+(explicit-web-proxy:\s+${EXPLICIT_WEB_PROXY}\s+explicit-ftp-proxy:\s+${EXPLICIT_FTP_PROXY}\s+)?proxy-captive-portal:\s+${PROXY_CAPTIVE_PORTAL}\s+(switch-controller-feature:\s+${SWITCH_CONTROLLER_FEATURE}\s+)?(mtu-override:\s+${MTU_OVERRIDE}\s+)?(wccp:\s+${WCCP}\s*)?(drop-overlapped-fragment:\s+${DROP_OVERLAPPED_FRAGMENT}\s+drop-fragment:\s+${DROP_FRAGMENT})?\s*$$ -> Record
  # vw1 - vwire
  # name:status:type:netflow-sampler:sflow-sampler:src-check:mtu-override:wccp:drop-overlapped-fragment:drop-fragment
  ^name:\s+${NAME}\s+status:\s+${STATUS}\s+type:\s+${TYPE}\s+netflow-sampler:\s+${NETFLOW_SAMPLER}\s+sflow-sampler:\s+${SFLOW_SAMPLER}\s+src-check:\s+${SRC_CHECK}\s+mtu-override:\s+${MTU_OVERRIDE}\s+wccp:\s+${WCCP}\s+drop-overlapped-fragment:\s+${DROP_OVERLAPPED_FRAGMENT}\s+drop-fragment:\s+${DROP_FRAGMENT}\s*$$ -> Record
  # ssl
  # name:ip:status:netbios-forward:type:netflow-sampler:sflow-sampler:scan-botnet-connections?:src-check:explicit-web-proxy:explicit-ftp-proxy:proxy-captive-portal:wccp
  ^name:\s+${NAME}\s+ip:\s+${IP_ADDRESS}\s+${NETMASK}\s+status:\s+${STATUS}\s+netbios-forward:\s+${NETBIOS_FORWARD}\s+type:\s+${TYPE}\s+netflow-sampler:\s+${NETFLOW_SAMPLER}\s+sflow-sampler:\s+${SFLOW_SAMPLER}\s+(scan-botnet-connections:\s+${SCAN_BOTNET_CONNECTIONS}\s+)?src-check:\s+${SRC_CHECK}\s+(explicit-web-proxy:\s+${EXPLICIT_WEB_PROXY}\s+explicit-ftp-proxy:\s+${EXPLICIT_FTP_PROXY}\s+proxy-captive-portal:\s+${PROXY_CAPTIVE_PORTAL}\s+)?wccp:\s+${WCCP}\s*$$ -> Record
  # type loopback
  # name:management-ip:ip:status:type:netflow-sampler:sflow-sampler:scan-botnet-connections?:src-check:explicit-web-proxy:explicit-ftp-proxy:proxy-captive-portal
  ^name:\s+${NAME}\s+(management-ip:\s+${MANAGEMENT_IP}\s+${MANAGEMENT_NETMASK}\s+)?ip:\s+${IP_ADDRESS}\s+${NETMASK}\s+status:\s+${STATUS}\s+type:\s+${TYPE}\s+netflow-sampler:\s+${NETFLOW_SAMPLER}\s+sflow-sampler:\s+${SFLOW_SAMPLER}\s+(scan-botnet-connections:\s+${SCAN_BOTNET_CONNECTIONS}\s+)?src-check:\s+${SRC_CHECK}\s+explicit-web-proxy:\s+${EXPLICIT_WEB_PROXY}\s+explicit-ftp-proxy:\s+${EXPLICIT_FTP_PROXY}\s+proxy-captive-portal:\s+${PROXY_CAPTIVE_PORTAL}\s*$$ -> Record
  # name:status:type
  ^name:\s+${NAME}\s+status:\s+${STATUS}\s+type:\s+${TYPE}\s*$$ -> Record
  ^\s*$$
  ^. -> Error
