(probeStr string)
| 78 | } |
| 79 | |
| 80 | func (p *Probe) parseProbeInfo(probeStr string) { |
| 81 | proto := probeStr[:4] |
| 82 | other := probeStr[4:] |
| 83 | |
| 84 | if !(proto == "TCP " || proto == "UDP ") { |
| 85 | panic("Probe <protocol>must be either TCP or UDP.") |
| 86 | } |
| 87 | if len(other) == 0 { |
| 88 | panic("nmap-service-probes - bad probe name") |
| 89 | } |
| 90 | |
| 91 | directive := p.getDirectiveSyntax(other) |
| 92 | |
| 93 | p.Name = directive.DirectiveName |
| 94 | p.Data = strings.Split(directive.DirectiveStr, directive.Delimiter)[0] |
| 95 | p.Protocol = strings.ToLower(strings.TrimSpace(proto)) |
| 96 | } |
| 97 | |
| 98 | func (p *Probe) fromString(data string) error { |
| 99 | var err error |
no test coverage detected