aboutsummaryrefslogtreecommitdiff
path: root/inform/rx_messages.go
diff options
context:
space:
mode:
Diffstat (limited to 'inform/rx_messages.go')
-rw-r--r--inform/rx_messages.go99
1 files changed, 99 insertions, 0 deletions
diff --git a/inform/rx_messages.go b/inform/rx_messages.go
new file mode 100644
index 0000000..3f80fcd
--- /dev/null
+++ b/inform/rx_messages.go
@@ -0,0 +1,99 @@
1package inform
2
3// TODO: Convert string time to time.Time
4// Response packet
5type NoopMessage struct {
6 Type string `json:"_type"`
7 Interval int `json:"interval"`
8 ServerTimeUTC string `json:"server_time_in_utc"`
9}
10
11type AlarmEntry struct {
12 Tag string `json:"tag"`
13 Type string `json:"string"`
14 Value string `json:"val"` // float or int observed
15}
16
17type AlarmMessage struct {
18 Entries []*AlarmEntry `json:"entries"`
19 Index string `json:"index"`
20 Id string `json:"sId"`
21 Time int `json:"time"`
22}
23
24type InterfaceMessage struct {
25 IP string `json:"ip"`
26 MacAddress string `json:"mac"`
27 Name string `json:"name"`
28 Type string `json:"type"`
29 ReceivedBytes int `json:"rx_bytes"`
30 ReceivedDropped int `json:"rx_dropped"`
31 ReceivedErrors int `json:"rx_errors"`
32 ReceivedPackets int `json:"rx_packets"`
33 TransmittedBytes int `json:"tx_bytes"`
34 TransmittedDropped int `json:"tx_dropped"`
35 TransmittedErrors int `json:"tx_errors"`
36 TransmittedPackets int `json:"tx_packets"`
37}
38
39type RadioMessage struct {
40 Gain int `json:"builtin_ant_gain"`
41 BuiltinAntenna bool `json:"builtin_antenna"`
42 MaxTransmitPower int `json:"max_txpower"`
43 Name string `json:"name"`
44 RadioProfile string `json:"radio"`
45 // "scan_table": []
46}
47
48type AccessPointMessage struct {
49 BasicSSID string `json:"bssid"`
50 ExtendedSSID string `json:"essid"`
51 ClientConnectionQuality int `json:"ccq"`
52 Channel int `json:"channel"`
53 Id string `json:"id"`
54 Name string `json:"name"`
55 StationNumber string `json:"num_sta"` // int?
56 RadioProfile string `json:"radio"`
57 Usage string `json:"usage"`
58 ReceivedBytes int `json:"rx_bytes"`
59 ReceivedDropped int `json:"rx_dropped"`
60 ReceivedErrors int `json:"rx_errors"`
61 ReceivedPackets int `json:"rx_packets"`
62 ReceivedCrypts int `json:"rx_crypts"`
63 ReceivedFragments int `json:"rx_frags"`
64 ReceivedNetworkIDs int `json:"rx_nwids"`
65 TransmittedBytes int `json:"tx_bytes"`
66 TransmittedDropped int `json:"tx_dropped"`
67 TransmittedErrors int `json:"tx_errors"`
68 TransmittedPackets int `json:"tx_packets"`
69 TransmitPower int `json:"tx_power"`
70 TransmitRetries int `json:"tx_retries"`
71}
72
73// TODO: Convert time to time.Time
74type IncomingMessage struct {
75 Alarms []*AlarmMessage `json:"alarm"`
76 ConfigVersion string `json:"cfgversion"`
77 Default bool `json:"default"`
78 GuestToken string `json:"guest_token"`
79 Hostname string `json:"hostname"`
80 InformURL string `json:"inform_url"`
81 IP string `json:"ip"`
82 Isolated bool `json:"isolated"`
83 LocalVersion string `json:"localversion"`
84 Locating bool `json:"locating"`
85 MacAddress string `json:"mac"`
86 IsMfi string `json:"mfi"` // boolean as string
87 Model string `json:"model"`
88 ModelDisplay string `json:"model_display"`
89 PortVersion string `json:"portversion"`
90 Version string `json:"version"`
91 Serial string `json:"serial"`
92 Time int `json:"time"`
93 Trackable string `json:"trackable"` // boolean as string
94 Uplink string `json:"uplink"`
95 Uptime int `json:"uptime"`
96 Interfaces []*InterfaceMessage `json:"if_table"`
97 Radios []*RadioMessage `json:"radio_table"`
98 AccessPoints []*AccessPointMessage `json:"vap_table"`
99}