From 1f8ef07e632ee0f596d509f35aacaa5fc48b7eaf Mon Sep 17 00:00:00 2001 From: Paul Tyng Date: Sun, 12 Jan 2020 10:29:28 -0500 Subject: [PATCH] Cleanup firewall rule names --- fields/main.go | 71 ++++++++++++++++++-------------- unifi/firewall_rule.generated.go | 30 +++++++------- unifi/port_conf.generated.go | 6 +-- unifi/setting_usg.generated.go | 2 +- 4 files changed, 60 insertions(+), 49 deletions(-) diff --git a/fields/main.go b/fields/main.go index c66f435..25b7380 100644 --- a/fields/main.go +++ b/fields/main.go @@ -20,43 +20,54 @@ type replacement struct { } var fieldReps = []replacement{ - {"Ipv6", "IPV6"}, - {"Pd", "PD"}, - {"Leasetime", "LeaseTime"}, - {"Networkgroup", "NetworkGroup"}, - {"Openvpn", "OpenVPN"}, - {"Nat", "NAT"}, - {"Wlangroup", "WLANGroup"}, - {"Dns", "DNS"}, - {"Tftp", "TFTP"}, {"Dhcpdv6", "DHCPDV6"}, + {"Dhcpd", "DHCPD"}, - {"Dhcp", "DHCP"}, - {"Wlan", "WLAN"}, {"Idx", "IDX"}, - {"Id", "ID"}, - {"Mac", "MAC"}, - {"Vlan", "VLAN"}, - {"Wep", "WEP"}, - {"Dtim", "DTIM"}, - {"Wpa", "WPA"}, - {"Usergroup", "UserGroup"}, - {"Mcastenhance", "MulticastEnhance"}, - {"Ssid", "SSID"}, - {"Dpi", "DPI"}, - {"Bc", "Broadcast"}, - {"Radius", "RADIUS"}, - {"Fixedip", "FixedIP"}, {"Ipsec", "IPSec"}, - {"Ip", "IP"}, - {"Pmf", "PMF"}, - {"Minrssi", "MinRSSI"}, - {"Qos", "QOS"}, - {"Wan", "WAN"}, - {"Vpn", "VPN"}, + {"Ipv6", "IPV6"}, + {"Openvpn", "OpenVPN"}, + {"Tftp", "TFTP"}, + {"Wlangroup", "WLANGroup"}, + + {"Bc", "Broadcast"}, + {"Dhcp", "DHCP"}, + {"Dns", "DNS"}, + {"Dpi", "DPI"}, + {"Dtim", "DTIM"}, + {"Firewallgroup", "FirewallGroup"}, + {"Fixedip", "FixedIP"}, + {"Icmp", "ICMP"}, + {"Id", "ID"}, {"Igmp", "IGMP"}, + {"Ip", "IP"}, + {"Leasetime", "LeaseTime"}, + {"Mac", "MAC"}, + {"Mcastenhance", "MulticastEnhance"}, + {"Minrssi", "MinRSSI"}, + {"Monthdays", "MonthDays"}, + {"Nat", "NAT"}, + {"Networkconf", "Network"}, + {"Networkgroup", "NetworkGroup"}, + {"Pd", "PD"}, + {"Pmf", "PMF"}, + {"Qos", "QOS"}, + {"Radius", "RADIUS"}, + {"Ssid", "SSID"}, + {"Startdate", "StartDate"}, + {"Starttime", "StartTime"}, + {"Stopdate", "StopDate"}, + {"Stoptime", "StopTime"}, {"Tcp", "TCP"}, {"Udp", "UDP"}, + {"Usergroup", "UserGroup"}, + {"Utc", "UTC"}, + {"Vlan", "VLAN"}, + {"Vpn", "VPN"}, + {"Wan", "WAN"}, + {"Wep", "WEP"}, + {"Wlan", "WLAN"}, + {"Wpa", "WPA"}, } var fileReps = []replacement{ diff --git a/unifi/firewall_rule.generated.go b/unifi/firewall_rule.generated.go index 07e9fbf..0257bb4 100644 --- a/unifi/firewall_rule.generated.go +++ b/unifi/firewall_rule.generated.go @@ -23,17 +23,17 @@ type FirewallRule struct { Contiguous bool `json:"contiguous"` DstAddress string `json:"dst_address,omitempty"` DstAddressIPV6 string `json:"dst_address_ipv6,omitempty"` - DstFirewallgroupIDs []string `json:"dst_firewallgroup_ids,omitempty"` // [\d\w]+ - DstNetworkconfID string `json:"dst_networkconf_id"` // [\d\w]+|^$ - DstNetworkconfType string `json:"dst_networkconf_type,omitempty"` // ADDRv4|NETv4 + DstFirewallGroupIDs []string `json:"dst_firewallgroup_ids,omitempty"` // [\d\w]+ + DstNetworkID string `json:"dst_networkconf_id"` // [\d\w]+|^$ + DstNetworkType string `json:"dst_networkconf_type,omitempty"` // ADDRv4|NETv4 DstPort string `json:"dst_port,omitempty"` Enabled bool `json:"enabled"` - IcmpTypename string `json:"icmp_typename"` // ^$|communication-prohibited|destination-unreachable|echo-reply|echo-request|fragmentation-needed|host-precedence-violation|host-prohibited|host-redirect|host-unknown|host-unreachable|ip-header-bad|network-prohibited|network-redirect|network-unknown|network-unreachable|parameter-problem|port-unreachable|protocol-unreachable|redirect|required-option-missing|router-advertisement|router-solicitation|source-route-failed|timestamp-reply|timestamp-request|TOS-host-redirect|TOS-host-unreachable|TOS-network-redirect|TOS-network-unreachable|ttl-exceeded|ttl-zero-during-reassembly|ttl-zero-during-transit - Icmpv6Typename string `json:"icmpv6_typename"` // ^$|address-unreachable|bad-header|communication-prohibited|destination-unreachable|echo-reply|echo-request|neighbor-advertisement|neighbor-solicitation|no-route|packet-too-big|parameter-problem|port-unreachable|redirect|router-advertisement|router-solicitation|time-exceeded|ttl-zero-during-reassembly|ttl-zero-during-transit|unknown-header-type|unknown-option + ICMPTypename string `json:"icmp_typename"` // ^$|communication-prohibited|destination-unreachable|echo-reply|echo-request|fragmentation-needed|host-precedence-violation|host-prohibited|host-redirect|host-unknown|host-unreachable|ip-header-bad|network-prohibited|network-redirect|network-unknown|network-unreachable|parameter-problem|port-unreachable|protocol-unreachable|redirect|required-option-missing|router-advertisement|router-solicitation|source-route-failed|timestamp-reply|timestamp-request|TOS-host-redirect|TOS-host-unreachable|TOS-network-redirect|TOS-network-unreachable|ttl-exceeded|ttl-zero-during-reassembly|ttl-zero-during-transit + ICMPv6Typename string `json:"icmpv6_typename"` // ^$|address-unreachable|bad-header|communication-prohibited|destination-unreachable|echo-reply|echo-request|neighbor-advertisement|neighbor-solicitation|no-route|packet-too-big|parameter-problem|port-unreachable|redirect|router-advertisement|router-solicitation|time-exceeded|ttl-zero-during-reassembly|ttl-zero-during-transit|unknown-header-type|unknown-option IPSec string `json:"ipsec"` // match-ipsec|match-none|^$ Logging bool `json:"logging"` - Monthdays string `json:"monthdays"` // ^$|^(([1-9]|[12][0-9]|3[01])(,([1-9]|[12][0-9]|3[01])){0,30})$ - MonthdaysNegate bool `json:"monthdays_negate"` + MonthDays string `json:"monthdays"` // ^$|^(([1-9]|[12][0-9]|3[01])(,([1-9]|[12][0-9]|3[01])){0,30})$ + MonthDaysNegate bool `json:"monthdays_negate"` Name string `json:"name,omitempty"` // .{1,128} Protocol string `json:"protocol"` // ^$|all|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|tcp_udp|ah|ax.25|dccp|ddp|egp|eigrp|encap|esp|etherip|fc|ggp|gre|hip|hmp|icmp|idpr-cmtp|idrp|igmp|igp|ip|ipcomp|ipencap|ipip|ipv6|ipv6-frag|ipv6-icmp|ipv6-nonxt|ipv6-opts|ipv6-route|isis|iso-tp4|l2tp|manet|mobility-header|mpls-in-ip|ospf|pim|pup|rdp|rohc|rspf|rsvp|sctp|shim6|skip|st|tcp|udp|udplite|vmtp|vrrp|wesp|xns-idp|xtp ProtocolMatchExcepted bool `json:"protocol_match_excepted"` @@ -42,20 +42,20 @@ type FirewallRule struct { Ruleset string `json:"ruleset,omitempty"` // WAN_IN|WAN_OUT|WAN_LOCAL|LAN_IN|LAN_OUT|LAN_LOCAL|GUEST_IN|GUEST_OUT|GUEST_LOCAL|WANv6_IN|WANv6_OUT|WANv6_LOCAL|LANv6_IN|LANv6_OUT|LANv6_LOCAL|GUESTv6_IN|GUESTv6_OUT|GUESTv6_LOCAL SrcAddress string `json:"src_address,omitempty"` SrcAddressIPV6 string `json:"src_address_ipv6,omitempty"` - SrcFirewallgroupIDs []string `json:"src_firewallgroup_ids,omitempty"` // [\d\w]+ + SrcFirewallGroupIDs []string `json:"src_firewallgroup_ids,omitempty"` // [\d\w]+ SrcMACAddress string `json:"src_mac_address"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$|^$ - SrcNetworkconfID string `json:"src_networkconf_id"` // [\d\w]+|^$ - SrcNetworkconfType string `json:"src_networkconf_type,omitempty"` // ADDRv4|NETv4 + SrcNetworkID string `json:"src_networkconf_id"` // [\d\w]+|^$ + SrcNetworkType string `json:"src_networkconf_type,omitempty"` // ADDRv4|NETv4 SrcPort string `json:"src_port,omitempty"` - Startdate string `json:"startdate"` // ^$|^(20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])$ - Starttime string `json:"starttime"` // ^$|^(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])$ + StartDate string `json:"startdate"` // ^$|^(20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])$ + StartTime string `json:"starttime"` // ^$|^(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])$ StateEstablished bool `json:"state_established"` StateInvalid bool `json:"state_invalid"` StateNew bool `json:"state_new"` StateRelated bool `json:"state_related"` - Stopdate string `json:"stopdate"` // ^$|^(20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])$ - Stoptime string `json:"stoptime"` // ^$|^(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])$ - Utc bool `json:"utc"` + StopDate string `json:"stopdate"` // ^$|^(20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])$ + StopTime string `json:"stoptime"` // ^$|^(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])$ + UTC bool `json:"utc"` Weekdays string `json:"weekdays"` // ^$|^((Mon|Tue|Wed|Thu|Fri|Sat|Sun)(,(Mon|Tue|Wed|Thu|Fri|Sat|Sun)){0,6})$ WeekdaysNegate bool `json:"weekdays_negate"` } diff --git a/unifi/port_conf.generated.go b/unifi/port_conf.generated.go index 5e4fd0f..54489e9 100644 --- a/unifi/port_conf.generated.go +++ b/unifi/port_conf.generated.go @@ -29,7 +29,7 @@ type PortConf struct { LldpmedEnabled bool `json:"lldpmed_enabled"` LldpmedNotifyEnabled bool `json:"lldpmed_notify_enabled"` Name string `json:"name,omitempty"` - NATiveNetworkconfID string `json:"native_networkconf_id"` + NATiveNetworkID string `json:"native_networkconf_id"` OpMode string `json:"op_mode,omitempty"` // switch PoeMode string `json:"poe_mode,omitempty"` // auto|pasv24|passthrough|off PortSecurityEnabled bool `json:"port_security_enabled"` @@ -50,8 +50,8 @@ type PortConf struct { StormctrlUcastLevel int `json:"stormctrl_ucast_level,omitempty"` // [0-9]|[1-9][0-9]|100 StormctrlUcastRate int `json:"stormctrl_ucast_rate,omitempty"` // [0-9]|[1-9][0-9]{1,6}|1[0-3][0-9]{6}|14[0-7][0-9]{5}|148[0-7][0-9]{4}|14880000 StpPortMode bool `json:"stp_port_mode"` - TaggedNetworkconfIDs []string `json:"tagged_networkconf_ids,omitempty"` - VoiceNetworkconfID string `json:"voice_networkconf_id"` + TaggedNetworkIDs []string `json:"tagged_networkconf_ids,omitempty"` + VoiceNetworkID string `json:"voice_networkconf_id"` } func (c *Client) listPortConf(site string) ([]PortConf, error) { diff --git a/unifi/setting_usg.generated.go b/unifi/setting_usg.generated.go index 6184fa3..97fd539 100644 --- a/unifi/setting_usg.generated.go +++ b/unifi/setting_usg.generated.go @@ -45,7 +45,7 @@ type SettingUsg struct { GeoIPFilteringTrafficDirection string `json:"geo_ip_filtering_traffic_direction,omitempty"` // ^(both|ingress|egress)$ GreModule bool `json:"gre_module"` H323Module bool `json:"h323_module"` - IcmpTimeout int `json:"icmp_timeout,omitempty"` + ICMPTimeout int `json:"icmp_timeout,omitempty"` LldpEnableAll bool `json:"lldp_enable_all"` MdnsEnabled bool `json:"mdns_enabled"` MssClamp string `json:"mss_clamp,omitempty"` // auto|custom|disabled