udprxlib

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package udprxlib is the driver for udprx

Package udprxlib is the driver for udprx

Package udprxlib is the driver for udprx

Index

Constants

This section is empty.

Variables

View Source
var ConnTimeoutVal float64 = 10

ConnTimeoutVal is a variable controlling how long to wait (in seconds) before a connection is considered by us to be 'timed out'

View Source
var ForwardMap map[string]int

ForwardMap should be set to not nil if debug is on

View Source
var RemoteTLSPort = ":55554"

RemoteTLSPort is the port of the remote TLS server (also the port of the local TLS server)

View Source
var TCPSocketListener net.Listener

TCPSocketListener is the tls socket listener

View Source
var UDPSocketListener *net.UDPConn

UDPSocketListener is the udp socket listener

Functions

func ConfigureRootCAs

func ConfigureRootCAs(caCertPathFlag *string) *x509.CertPool

ConfigureRootCAs creats a new systemcertpool and adds a cert from a pem encoded cert file to it

func CreateUDPSocket

func CreateUDPSocket() error

CreateUDPSocket creates a UDP socket and returns the filedescriptor (int) or an error

func EnableCPUProfiling

func EnableCPUProfiling(numPackets int, profileFilePath *string)

EnableCPUProfiling turns on cpu profiling

func EnableNetProfiling

func EnableNetProfiling(numPackets int)

EnableNetProfiling turns on network profiling features

func ParseIps

func ParseIps(srcipstr string, destipstr string) (net.IP, net.IP, error)

ParseIps parses ip address string and returns them as net objects

func SendUDP

func SendUDP(srcipstr string, destipstr string, srcprt uint, destprt uint, data []byte, counter int) error

SendUDP takes in the associated data and puts a UDP packet on the wire

func StopThreads

func StopThreads()

StopThreads stops the TCP and UDP listeners and closes all connections

func TCPListener

func TCPListener(listenAddrFlag *string, serverConf *tls.Config, done chan error)

TCPListener is the tcp socket loop for udprx inbound connections

func UDPListener

func UDPListener(listenAddrFlag *string, clientConf *tls.Config, done chan error)

UDPListener is the udp local listener for outbound connections

Types

type ConfFile

type ConfFile struct {
	ListenAddr string `json:"listenAddr"`
	KeyPath    string `json:"keyPath"`
	CertPath   string `json:"certPath"`
	CaCertPath string `json:"caCertPath"`
}

ConfFile represents the config file struct

func ParseConfig

func ParseConfig(path string) (ConfFile, error)

ParseConfig parses a ConfFile into it's struct

type Iphdr

type Iphdr struct {
	// contains filtered or unexported fields
}

Iphdr is the IP header struct

func (*Iphdr) Checksum

func (h *Iphdr) Checksum()

Checksum - sets checksum for an IP header

type Udphdr

type Udphdr struct {
	// contains filtered or unexported fields
}

Udphdr is the UDP header struct

func (*Udphdr) Checksum

func (u *Udphdr) Checksum(ip *Iphdr, payload []byte)

Checksum - sets checksum for an UDP header

Jump to

Keyboard shortcuts

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