forked from packethost/goflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packet.go
69 lines (57 loc) · 1.2 KB
/
packet.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
58
59
60
61
62
63
64
65
66
67
68
69
package sflow
type Packet struct {
Version uint32
IPVersion uint32
AgentIP []byte
SubAgentId uint32
SequenceNumber uint32
Uptime uint32
SamplesCount uint32
Samples []interface{}
}
type SampleHeader struct {
Format uint32
Length uint32
SampleSequenceNumber uint32
SourceIdType uint32
SourceIdValue uint32
}
type FlowSample struct {
Header SampleHeader
SamplingRate uint32
SamplePool uint32
Drops uint32
Input uint32
Output uint32
FlowRecordsCount uint32
Records []FlowRecord
}
type CounterSample struct {
Header SampleHeader
CounterRecordsCount uint32
Records []CounterRecord
}
type ExpandedFlowSample struct {
Header SampleHeader
SamplingRate uint32
SamplePool uint32
Drops uint32
InputIfFormat uint32
InputIfValue uint32
OutputIfFormat uint32
OutputIfValue uint32
FlowRecordsCount uint32
Records []FlowRecord
}
type RecordHeader struct {
DataFormat uint32
Length uint32
}
type FlowRecord struct {
Header RecordHeader
Data interface{}
}
type CounterRecord struct {
Header RecordHeader
Data interface{}
}