dscp

package
v0.0.0-...-a8d7af0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package dscp provides helper functions to apply DSCP / ECN / CoS flags to sockets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialTCPTimeoutWithTOS

func DialTCPTimeoutWithTOS(laddr, raddr *net.TCPAddr, tos byte, timeout time.Duration) (net.Conn,
	error)

DialTCPTimeoutWithTOS is same as DialTimeoutWithTOS except for enforcing "tcp" and providing an option to specify local address (source)

func DialTCPWithTOS

func DialTCPWithTOS(laddr, raddr *net.TCPAddr, tos byte) (*net.TCPConn, error)

DialTCPWithTOS is similar to net.DialTCP but with the socket configured to the use the given ToS (Type of Service), to specify DSCP / ECN / class of service flags to use for incoming connections.

func DialTimeoutWithTOS

func DialTimeoutWithTOS(network, address string, timeout time.Duration, tos byte) (net.Conn,
	error)

DialTimeoutWithTOS is similar to net.DialTimeout but with the socket configured to the use the given ToS (Type of Service), to specify DSCP / ECN / class of service flags to use for incoming connections.

func ListenTCPWithTOS

func ListenTCPWithTOS(address *net.TCPAddr, tos byte) (*net.TCPListener, error)

ListenTCPWithTOS is similar to net.ListenTCP but with the socket configured to the use the given ToS (Type of Service), to specify DSCP / ECN / class of service flags to use for incoming connections.

func ListenTCPWithTOSLogger

func ListenTCPWithTOSLogger(address *net.TCPAddr, tos byte, l logger.Logger) (*net.TCPListener,
	error)

ListenTCPWithTOSLogger is similar to net.ListenTCP but with the socket configured to the use the given ToS (Type of Service), to specify DSCP / ECN / class of service flags to use for incoming connections. Allows passing in a Logger.

func SetTOS

func SetTOS(network string, c syscall.RawConn, tos byte) error

SetTOS will set the TOS byte on a unix system. It's intended to be used in a net.Dialer's Control function.

func SetTOSLogger

func SetTOSLogger(network string, c syscall.RawConn, tos byte, l logger.Logger) error

SetTOSLogger will set the TOS byte on a unix system. It's intended to be used in a net.Dialer's Control function. Allows passing in a Logger.

Types

This section is empty.

Jump to

Keyboard shortcuts

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