MCPcopy Create free account
hub / github.com/Adminisme/ServerScan / parseProbeInfo

Method parseProbeInfo

ServerScan Air/package/vscan/vscan.go:80–96  ·  view source on GitHub ↗
(probeStr string)

Source from the content-addressed store, hash-verified

78}
79
80func (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
98func (p *Probe) fromString(data string) error {
99 var err error

Callers 1

fromStringMethod · 0.95

Calls 1

getDirectiveSyntaxMethod · 0.95

Tested by

no test coverage detected