Documentation ¶
Overview ¶
Package deviceio contains types that handle I/O against devices; UDP, CoAP and so on.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NetworkToUint64 ¶
NetworkToUint64 converts the net.IPNet structure into a single 64-bit integer. The high 32 bits contains the IPv4 address and the lower 32 bits contains the mask bits.
func Uint64ToNetwork ¶
Uint64ToNetwork converts an uint64 value with the IPv4 and mask bits into a net.IPNet structure
Types ¶
type CoAPParameters ¶
type CoAPParameters struct { Endpoint string `param:"desc=CoAP server endpoint;default=127.0.0.1:5683"` Protocol string `param:"desc=CoAP server protocol;default=udp"` APNID int `param:"desc=APN ID for the CoAP server"` NASID string `param:"desc=NAS ID list for the CoAP server;default=0"` AuditLog bool `param:"desc=Audit log for data in/out of the service;default=false"` }
CoAPParameters holds the parameters for the CoAP transceivers, ie the
func (*CoAPParameters) NASList ¶
func (c *CoAPParameters) NASList() []int
NASList returns an array of NAS identifiers
type CoAPServer ¶
type CoAPServer struct {
// contains filtered or unexported fields
}
CoAPServer is the CoAP listener and server. It proxies requests to the gRPC upstream service. The upstream service handles all logic.
func NewCoAPServer ¶
func NewCoAPServer(client rxtx.RxtxClient, config CoAPParameters) *CoAPServer
NewCoAPServer creates a new CoAP listener service. The service exposes a (single) CoAP endpoint to devices.
func (*CoAPServer) Start ¶
func (c *CoAPServer) Start() error
Start the server. It can only be started once.
type RADIUSServer ¶
type RADIUSServer struct {
// contains filtered or unexported fields
}
RADIUSServer is a gRPC-backed RADIUS server
func NewRADIUSServer ¶
func NewRADIUSServer(client rxtx.RADIUSClient, config radius.ServerParameters) *RADIUSServer
NewRADIUSServer creates a new gRPC-backed RADIUS server
type UDPListener ¶
type UDPListener struct {
// contains filtered or unexported fields
}
UDPListener is used to listen for UDP packets from devices and to send UDP packets back. It is supposed to run close to the APN IPSec tunnel (or equivalent). The listeners might have different routes set up so they work like proxies into Horde proper.
func NewUDPListener ¶
func NewUDPListener(rxtxClient rxtx.RxtxClient, config UDPParameters) *UDPListener
NewUDPListener creates a new UDP listener instance.
type UDPParameters ¶
type UDPParameters struct { Ports string `param:"desc=Comma-separated list of ports to listen to;default=31415"` ListenAddress string `param:"desc=Listen address for UDP;default=127.0.0.1"` APNID int `param:"desc=APN ID for listener;default=0"` NASID string `param:"desc=NAS ID list for listener;default=0"` AuditLog bool `param:"desc=Audit log of traffic to and from devices;default=false"` }
UDPParameters holds the command line parameters for the rxtxudp service
func (*UDPParameters) NASList ¶
func (u *UDPParameters) NASList() []int
NASList returns an array of NAS identifiers
func (*UDPParameters) PortList ¶
func (u *UDPParameters) PortList() ([]int, error)
PortList decodes the port parameter into separate port numbers.