voip

package
v0.0.0-...-c455b0d Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2015 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IMG_SIPP       = "mangalaman93/sipp"
	IMG_SNORT      = "mangalaman93/snort"
	IMG_CADVISOR   = "mangalaman93/cadvisor"
	IMG_MONCONT    = "mangalaman93/moncont"
	SIPP_BUFF_SIZE = "1048576"
	CPU_PERIOD     = 100000
	BUF_DURATION   = "5s"
)
View Source
const (
	RX_TABLE = iota
	TX_TABLE
	CPU_TABLE
	QUEUE_TABLE
)
View Source
const (
	OVS_BRIDGE  = "ovsbr"
	INET_PREFIX = "173.16.1."
	INET        = INET_PREFIX + "1"
	NETMASK     = "255.255.255.0"
)
View Source
const (
	ReqStartServer = iota
	ReqStartSnort
	ReqStartClient
	ReqStopCont
	ReqRouteCont
	ReqSetRate
)
View Source
const (
	OVSBR_OS = "br-int"
)
View Source
const (
	STOP_TIMEOUT = 5
)
View Source
const (
	WAIT_FOR_START = 10
)

Variables

View Source
var (
	ErrHostNotFound = errors.New("Host not found")
	ErrNoHosts      = errors.New("error while finding host list")
)
View Source
var (
	ErrKeyNotFound = errors.New("All required keys not found")
	ErrIdNotExists = errors.New("container id doesn't exists")
)
View Source
var (
	ErrUnknownReq     = errors.New("Unknown request")
	ErrUnknownManager = errors.New("Inavalid container manager type")
)
View Source
var (
	ErrOvsNotFound = errors.New("openvswitch is not installed")
)

Functions

This section is empty.

Types

type CManager

type CManager interface {
	Setup() error
	Destroy()
	StartServer(host string, shares int64) (*Node, error)
	StartSnort(host string, shares int64) (*Node, error)
	StartClient(host string, shares int64, serverip string) (*Node, error)
	StopCont(node *Node) error
	Route(cnode, rnode, snode *Node) error
	SetShares(node *Node, shares int64) error
}

type DockerCManager

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

func NewDockerCManager

func NewDockerCManager(config *goconfig.ConfigFile) (*DockerCManager, error)

func (*DockerCManager) Destroy

func (d *DockerCManager) Destroy()

func (*DockerCManager) Route

func (d *DockerCManager) Route(cnode, rnode, snode *Node) error

func (*DockerCManager) SetShares

func (d *DockerCManager) SetShares(node *Node, shares int64) error

func (*DockerCManager) Setup

func (d *DockerCManager) Setup() error

func (*DockerCManager) StartClient

func (d *DockerCManager) StartClient(host string, shares int64, serverip string) (*Node, error)

func (*DockerCManager) StartServer

func (d *DockerCManager) StartServer(host string, shares int64) (*Node, error)

func (*DockerCManager) StartSnort

func (d *DockerCManager) StartSnort(host string, shares int64) (*Node, error)

func (*DockerCManager) StopCont

func (d *DockerCManager) StopCont(node *Node) error

type MContainer

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

func NewMContainer

func NewMContainer(node *Node, step, wl, shares, ref int64, alpha float64) *MContainer

func (*MContainer) AddPoint

func (m *MContainer) AddPoint(table int, point models.Point)

func (*MContainer) Trigger

func (m *MContainer) Trigger() int64

type Node

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

func NewNode

func NewNode(id, ip, mac, host string) *Node

type OStackCManager

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

func NewOStackCManager

func NewOStackCManager(config *goconfig.ConfigFile) (*OStackCManager, error)

func (*OStackCManager) Destroy

func (o *OStackCManager) Destroy()

func (*OStackCManager) Route

func (o *OStackCManager) Route(cnode, rnode, snode *Node) error

func (*OStackCManager) SetShares

func (o *OStackCManager) SetShares(node *Node, shares int64) error

func (*OStackCManager) Setup

func (o *OStackCManager) Setup() error

func (*OStackCManager) StartClient

func (o *OStackCManager) StartClient(host string, shares int64, serverip string) (*Node, error)

func (*OStackCManager) StartServer

func (o *OStackCManager) StartServer(host string, shares int64) (*Node, error)

func (*OStackCManager) StartSnort

func (o *OStackCManager) StartSnort(host string, shares int64) (*Node, error)

func (*OStackCManager) StopCont

func (o *OStackCManager) StopCont(node *Node) error

type Request

type Request struct {
	Code   int
	KeyVal map[string]string
}

type Response

type Response struct {
	Result string
	Err    string
}

type TimeData

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

func NewTimeData

func NewTimeData(step int64, duration int64, bts time.Time) *TimeData

all data in ms

func (*TimeData) AddPoint

func (t *TimeData) AddPoint(ts time.Time, val int64)

func (*TimeData) AfterD

func (t *TimeData) AfterD() int64

func (*TimeData) Next

func (t *TimeData) Next() (int64, float64, bool)

type VoipHandler

type VoipHandler struct {
	sync.Mutex
	// contains filtered or unexported fields
}

TODO: more parallelization here

func NewVoipHandler

func NewVoipHandler(config *goconfig.ConfigFile) (*VoipHandler, error)

func (*VoipHandler) HandleRequest

func (vh *VoipHandler) HandleRequest(req *Request) *Response

func (*VoipHandler) Start

func (vh *VoipHandler) Start() error

func (*VoipHandler) Stop

func (vh *VoipHandler) Stop()

func (*VoipHandler) UpdatePoints

func (vh *VoipHandler) UpdatePoints(points models.Points)

type VoipLine

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

func NewVoipLine

func NewVoipLine(config *goconfig.ConfigFile) (*VoipLine, error)

func (*VoipLine) GetDB

func (v *VoipLine) GetDB() string

func (*VoipLine) Start

func (v *VoipLine) Start() error

func (*VoipLine) Stop

func (v *VoipLine) Stop()

func (*VoipLine) Update

func (v *VoipLine) Update(points models.Points)

handle concurrent calls to this function

Jump to

Keyboard shortcuts

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