-
Notifications
You must be signed in to change notification settings - Fork 0
/
xml.go
57 lines (49 loc) · 1.16 KB
/
xml.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// SPDX-FileCopyrightText: (c) Mauve Mailorder Software GmbH & Co. KG, 2020. Licensed under [MIT](LICENSE) license
//
// SPDX-License-Identifier: MIT
package main
type NmapRun struct {
Hosts []HostResult `xml:"host"`
}
type HostResult struct {
Address struct {
Addr string `xml:"addr,attr"`
} `xml:"address"`
HostNames struct {
Names []struct {
Name string `xml:"name,attr"`
} `xml:"hostname"`
} `xml:"hostnames"`
Ports PortsResult `xml:"ports"`
Status struct {
State string `xml:"state,attr"`
} `xml:"status"`
}
type PortsResult struct {
Ports []PortResult `xml:"port"`
}
type PortResult struct {
Protocol string `xml:"protocol,attr"`
Number string `xml:"portid,attr"`
State struct {
State string `xml:"state,attr"`
} `xml:"state"`
Service struct {
Name string `xml:"name,attr"`
Method string `xml:"method,attr"`
} `xml:"service"`
Script ScriptResult `xml:"script"`
}
type ScriptResult struct {
ID string `xml:"id,attr"`
Table struct {
Tables []Table `xml:"table"`
} `xml:"table"`
}
type Table struct {
Elements []TableElement `xml:"elem"`
}
type TableElement struct {
Key string `xml:"key,attr"`
Text string `xml:",chardata"`
}