add: for sintel hlr case test

This commit is contained in:
2024-09-11 17:57:37 +08:00
parent 4cd125d77d
commit 81176226ae
6 changed files with 678 additions and 64 deletions

View File

@@ -7,6 +7,7 @@ import (
"net"
"os"
"os/exec"
"strconv"
"strings"
"sync"
"time"
@@ -17,6 +18,7 @@ import (
"be.ems/lib/mmlp"
"be.ems/sshsvc/config"
"be.ems/sshsvc/logmml"
"be.ems/sshsvc/snmp"
//"github.com/gliderlabs/ssh"
"golang.org/x/crypto/ssh"
@@ -124,6 +126,28 @@ func main() {
// }
go startTelnetServer(telnetUri)
snmpSvc := snmp.SNMPService{
ListenAddr: conf.SNMPServer.ListenAddr,
ListenPort: conf.SNMPServer.ListenPort,
UserName: conf.SNMPServer.UserName,
AuthPass: conf.SNMPServer.AuthPass,
AuthProto: conf.SNMPServer.AuthProto,
PrivPass: conf.SNMPServer.PrivPass,
PrivProto: conf.SNMPServer.PrivProto,
EngineID: conf.SNMPServer.EngineID,
TrapPort: conf.SNMPServer.TrapPort,
TrapTick: conf.SNMPServer.TrapTick,
TimeOut: conf.SNMPServer.TimeOut,
TrapTarget: conf.SNMPServer.TrapTarget,
ListenHost: conf.SNMPServer.ListenAddr + ":" + strconv.Itoa(int(conf.SNMPServer.ListenPort)),
TrapHost: conf.SNMPServer.ListenAddr + ":" + strconv.Itoa(int(conf.SNMPServer.TrapPort)),
SysDescr: "HLR server",
SysService: 0,
}
go snmpSvc.StartSNMPServer()
go snmpSvc.StartTrapServer()
for {
conn, err := listener.Accept()
@@ -133,7 +157,6 @@ func main() {
}
go handleSSHConnection(conn, serverConfig)
}
}