samtun

package
v0.0.0-...-afc8e46 Latest Latest
Warning

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

Go to latest
Published: May 7, 2017 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

config.go -- samtun configuration

link.go -- link level protocol

Index

Constants

View Source
const (
	NULL_METH = iota
	/*
	  client / server says that we are alive
	  param: 'pn' -> packet number for jitter calculation
	  return: no response needed
	*/
	ALIVE_PING
	/**
	  client says make new tunnel to inet address range
	  param: 'cidr' -> the cidr to access
	  return: tunnel id or 0 if rejected
	*/
	CLIENT_TUN_NEW
	/**
	  client says done with tunnel
	  param: 'tid' -> the tunnel id or 0 for all
	  return: always 0
	*/
	CLIENT_TUN_DEL
	/**
	  server says tunnel with tunnel id that we had is now gone
	  param: 'tid' -> the tunnel who is gone
	  return: no response needed
	*/
	SERVER_TUN_BAI
	/*
	  either client or server says "here are ip packets for tunnel with tid"
	  param: 'tid' -> the tunnel that we are sending on
	  param: 'pkts' -> bytes of link packets
	  return: no response needed
	*/
	RELAY_TUN_DATA
)

Variables

View Source
var K_CIDR = "cidr"
View Source
var K_PKTS = "pkts"
View Source
var K_PN = "pn"
View Source
var K_TID = "tid"

Functions

func BencodeReadList

func BencodeReadList(r io.Reader) ([]interface{}, error)

func BencodeReadMap

func BencodeReadMap(r io.Reader) (map[string]interface{}, error)

func BencodeReadString

func BencodeReadString(r io.Reader) ([]byte, error)

func BencodeWrite

func BencodeWrite(obj interface{}, w io.Writer) (err error)

func BencodeWriteInt

func BencodeWriteInt(i int64, w io.Writer) (err error)

func BencodeWriteList

func BencodeWriteList(ls []interface{}, w io.Writer) (err error)

func BencodeWriteMap

func BencodeWriteMap(m map[string]interface{}, w io.Writer) (err error)

func BencodeWriteString

func BencodeWriteString(str []byte, w io.Writer) (err error)

func RunClient

func RunClient(args []string)

func RunExit

func RunExit(args []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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