deviceio

package
v0.0.0-...-7c66ffc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

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

func NetworkToUint64(net *net.IPNet) uint64

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

func Uint64ToNetwork(val uint64) net.IPNet

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.

func (*CoAPServer) Stop

func (c *CoAPServer) Stop()

Stop shuts down the CoAP transceiver service.

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

func (*RADIUSServer) Start

func (r *RADIUSServer) Start() error

Start launches the RADIUS service

func (*RADIUSServer) Stop

func (r *RADIUSServer) Stop()

Stop stops the RADIUS service

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.

func (*UDPListener) Start

func (ut *UDPListener) Start() error

Start starts the UDP listener

func (*UDPListener) Stop

func (ut *UDPListener) Stop()

Stop stops the listeners.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL