core

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package core contains some generic helper functions for the package github.com/bestateless/go-tc. Depending on the actual hardware in use, parameters to filters and qdiscs can vary to achieve the same behaviour.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHandle

func BuildHandle(maj, min uint32) uint32

BuildHandle is a simple helper function to construct the handle for the Tcmsg struct

func Ktime2Time

func Ktime2Time(ktime uint32) uint32

Ktime2Time implements iproute2/tc/tc_core:tc_core_ktime2time().

func SplitHandle

func SplitHandle(handle uint32) (major, minor uint32)

SplitHandle extracts the major and minor part from a given handle

func Tick2Time

func Tick2Time(tick uint32) uint32

Tick2Time implements iproute2/tc/tc_core:tc_core_tick2time(). It returns a time in usec for a given number of CPU ticks.

func Time2Ktime

func Time2Ktime(time uint32) uint32

Time2Ktime implements iproute2/tc/tc_core:tc_core_time2ktime().

func Time2Tick

func Time2Tick(time uint32) uint32

Time2Tick implements iproute2/tc/tc_core:tc_core_time2tick(). It returns the number of CPU ticks for a given time in usec.

func XmitSize

func XmitSize(rate uint64, ticks uint32) uint32

XmitSize implements iproute2/tc/tc_core:tc_calc_xmitsize(). It returns the size that can be transmitted at a given rate during a given time.

func XmitTime

func XmitTime(rate uint64, size uint32) uint32

XmitTime implements iproute2/tc/tc_core:tc_calc_xmittime(). It returns the time, that is needed to transmit a given size for a given rate.

Types

This section is empty.

Jump to

Keyboard shortcuts

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