-
Notifications
You must be signed in to change notification settings - Fork 47
/
nflow_spike.go
45 lines (42 loc) · 1.02 KB
/
nflow_spike.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
package main
//import "fmt"
//Generate a netflow packet w/ user-defined record count
func GenerateSpike() Netflow {
data := new(Netflow)
header := CreateNFlowHeader(1)
records := []NetflowPayload{}
records = spikeFlowPayload()
data.Header = header
data.Records = records
return *data
}
func spikeFlowPayload() []NetflowPayload {
payload := make([]NetflowPayload, 1)
switch opts.SpikeProto {
case "ssh":
payload[0] = CreateSshFlow()
case "ftp":
payload[0] = CreateFTPFlow()
case "http":
payload[0] = CreateHttpFlow()
case "https":
payload[0] = CreateHttpsFlow()
case "ntp":
payload[0] = CreateNtpFlow()
case "snmp":
payload[0] = CreateSnmpFlow()
case "imaps":
payload[0] = CreateImapsFlow()
case "mysql":
payload[0] = CreateMySqlFlow()
case "https_alt":
payload[0] = CreateHttpAltFlow()
case "p2p":
payload[0] = CreateP2pFlow()
case "bittorrent":
payload[0] = CreateBitorrentFlow()
default:
log.Fatalf("protocol option %s is not valid, see --help for options", opts.SpikeProto)
}
return payload
}