package asaModels import "regexp" var PROXYARPRE = regexp.MustCompile(`(?i)(no|)(\s+|)sysopt\s+noproxyarp\s+(\S+)`) type ( SysOpt struct { ProxyARP []*ProxyARP `json:"proxyArp"` } ProxyARP struct { Interface string `json:"interface"` Enabled bool `json:"enabled"` } ) func (s *SysOpt) Parse(c string) { s.ProxyARP = ParseProxyARP(c) } func ParseProxyARP(c string) (pa []*ProxyARP) { for _, v := range PROXYARPRE.FindAllStringSubmatch(c, -1) { switch v[1] { case "no": pa = append(pa, &ProxyARP{ Interface: v[3], Enabled: true, }) default: pa = append(pa, &ProxyARP{ Interface: v[3], }) } } return }