forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
49 lines (42 loc) · 1.25 KB
/
config.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
package config
import (
"time"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/common/droppriv"
"github.com/elastic/beats/packetbeat/procs"
)
type Config struct {
Interfaces InterfacesConfig `config:"interfaces"`
Flows *Flows `config:"flows"`
Protocols map[string]*common.Config `config:"protocols"`
Procs procs.ProcsConfig `config:"procs"`
IgnoreOutgoing bool `config:"ignore_outgoing"`
RunOptions droppriv.RunOptions
}
type InterfacesConfig struct {
Device string
Type string
File string
WithVlans bool
BpfFilter string
Snaplen int
BufferSizeMb int
TopSpeed bool
Dumpfile string
OneAtATime bool
Loop int
}
type Flows struct {
Enabled *bool `config:"enabled"`
Timeout string `config:"timeout"`
Period string `config:"period"`
}
type ProtocolCommon struct {
Ports []int `config:"ports"`
SendRequest bool `config:"send_request"`
SendResponse bool `config:"send_response"`
TransactionTimeout time.Duration `config:"transaction_timeout"`
}
func (f *Flows) IsEnabled() bool {
return f != nil && (f.Enabled == nil || *f.Enabled)
}