This commit is contained in:
Sudo-Ivan
2024-12-30 02:34:38 -06:00
parent 2e01fa565d
commit bfc75a2290
3 changed files with 10 additions and 11 deletions

View File

@@ -9,7 +9,7 @@ import (
type InterfaceMode byte
type InterfaceType byte
type PacketCallback func([]byte, interface{})
type PacketCallback = func([]byte, interface{})
// NetworkInterface combines both low-level and high-level interface requirements
type NetworkInterface interface {

View File

@@ -40,7 +40,7 @@ type TCPClientInterface struct {
maxReconnectTries int
packetBuffer []byte
packetType byte
packetCallback func([]byte, interface{})
packetCallback common.PacketCallback
}
func NewTCPClient(name string, targetAddr string, targetPort int, kissFraming bool, i2pTunneled bool) (*TCPClientInterface, error) {
@@ -273,7 +273,7 @@ func escapeKISS(data []byte) []byte {
return escaped
}
func (tc *TCPClientInterface) SetPacketCallback(cb func([]byte, interface{})) {
func (tc *TCPClientInterface) SetPacketCallback(cb common.PacketCallback) {
tc.packetCallback = cb
}