Documentation ¶
Index ¶
- type IPTypes
- type MNEDCServer
- type NetPacket
- type NetPacketIP
- type Server
- func (s *Server) AcceptRoutine()
- func (s *Server) Close() error
- func (s *Server) CreateServer(address, port string, isSecure bool) (*Server, error)
- func (s *Server) DispatchRoutine()
- func (s *Server) GetClientIPMap() map[string]IPTypes
- func (s *Server) GetVirtualIP() string
- func (s *Server) HandleConnection(conn net.Conn)
- func (s *Server) RemoveClient(deviceID string)
- func (s *Server) Route(pkt *NetPacket)
- func (s *Server) Run()
- func (s *Server) SetClientAddress(deviceID string, addr string)
- func (s *Server) SetClientIP(deviceID, privateIP, virtualIP string)
- func (s *Server) SetVirtualIP(deviceID string) string
- func (s *Server) TunReadRoutine()
- func (s *Server) TunWriteRoutine()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MNEDCServer ¶
type MNEDCServer interface { CreateServer(string, string, bool) (*Server, error) Run() AcceptRoutine() HandleConnection(net.Conn) SetVirtualIP(string) string DispatchRoutine() Route(*NetPacket) SetClientAddress(string, string) SetClientIP(string, string, string) RemoveClient(string) GetClientIPMap() map[string]IPTypes TunReadRoutine() TunWriteRoutine() Close() error GetVirtualIP() string }
MNEDCServer declares methods related to MNEDC server
type NetPacketIP ¶
NetPacketIP defines the IP packet struct
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server defines MNEDC server struct
func (*Server) AcceptRoutine ¶
func (s *Server) AcceptRoutine()
AcceptRoutine accepts client connections
func (*Server) CreateServer ¶
CreateServer creates a Server structure and returns it
func (*Server) DispatchRoutine ¶
func (s *Server) DispatchRoutine()
DispatchRoutine sends packets from inboundIPPkts/inboundDevPkts to client/TUN.
func (*Server) GetClientIPMap ¶
GetClientIPMap returns clientIPInfoByDeviceID map to proxy server
func (*Server) GetVirtualIP ¶
GetVirtualIP returns the server virtualIP
func (*Server) HandleConnection ¶
HandleConnection handles new client registration
func (*Server) RemoveClient ¶
RemoveClient removes a client connection
func (*Server) SetClientAddress ¶
SetClientAddress puts the device ID in the map
func (*Server) SetClientIP ¶
SetClientIP saves new device ipInfo from broadcast server
func (*Server) SetVirtualIP ¶
SetVirtualIP builds the parameters to be sent to client
func (*Server) TunReadRoutine ¶
func (s *Server) TunReadRoutine()
TunReadRoutine reads from tun virtual interface and sends the packet to server
func (*Server) TunWriteRoutine ¶
func (s *Server) TunWriteRoutine()
TunWriteRoutine reads the outgoing packets from server and writes on tun virtual Interface