Documentation ¶
Overview ¶
Package dscp provides helper functions to apply DSCP / ECN / CoS flags to sockets.
Index ¶
- func DialTCPTimeoutWithTOS(laddr, raddr *net.TCPAddr, tos byte, timeout time.Duration) (net.Conn, error)
- func DialTCPWithTOS(laddr, raddr *net.TCPAddr, tos byte) (*net.TCPConn, error)
- func DialTimeoutWithTOS(network, address string, timeout time.Duration, tos byte) (net.Conn, error)
- func ListenTCPWithTOS(address *net.TCPAddr, tos byte) (*net.TCPListener, error)
- func ListenTCPWithTOSLogger(address *net.TCPAddr, tos byte, l logger.Logger) (*net.TCPListener, error)
- func SetTOS(network string, c syscall.RawConn, tos byte) error
- func SetTOSLogger(network string, c syscall.RawConn, tos byte, l logger.Logger) error
- func SetsockoptTOS(fd uintptr, network string, tos byte, l logger.Logger)
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.