add communicator api

This commit is contained in:
hebo
2019-09-05 20:27:49 +08:00
parent d06ca1131e
commit c9f514feed
18 changed files with 1490 additions and 42 deletions

View File

@@ -1,16 +1,17 @@
package capture
import (
sd "github.com/zr-hebo/sniffer-agent/session-dealer"
log "github.com/sirupsen/logrus"
"sync"
sd "github.com/zr-hebo/sniffer-agent/session-dealer"
"math/rand"
"time"
)
var (
localIPAddr *string
sessionPool = make(map[string]sd.ConnSession)
sessionPoolLock sync.Mutex
// sessionPoolLock sync.Mutex
)
func init() {
@@ -21,4 +22,6 @@ func init() {
localIPAddr = &ipAddr
log.Infof("parsed local ip address:%s", *localIPAddr)
rand.Seed(time.Now().UnixNano())
}