Files
sniffer-agent/capture/config.go
2019-09-05 20:27:49 +08:00

28 lines
443 B
Go

package capture
import (
log "github.com/sirupsen/logrus"
sd "github.com/zr-hebo/sniffer-agent/session-dealer"
"math/rand"
"time"
)
var (
localIPAddr *string
sessionPool = make(map[string]sd.ConnSession)
// sessionPoolLock sync.Mutex
)
func init() {
ipAddr, err := getLocalIPAddr()
if err != nil {
panic(err)
}
localIPAddr = &ipAddr
log.Infof("parsed local ip address:%s", *localIPAddr)
rand.Seed(time.Now().UnixNano())
}