// Copyright 2016 Mikio Hara. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tcpinfo import ( "errors" "time" "unsafe" "github.com/mikioh/tcpopt" ) var options = [soMax]option{ soInfo: {ianaProtocolTCP, sysTCP_CONNECTION_INFO, parseInfo}, } // Marshal implements the Marshal method of tcpopt.Option interface. func (i *Info) Marshal() ([]byte, error) { return (*[sizeofTCPConnectionInfo]byte)(unsafe.Pointer(i))[:], nil } type SysFlags uint func (f SysFlags) String() string { s := "" for i, name := range []string{ "loss recovery", "reordering detected", } { if f&(1< sizeofTCPConnectionInfoV15 { i.Sys.RetransSegs = uint64(tci.Txretransmitpackets) } return i, nil } func parseCCAlgorithmInfo(name string, b []byte) (CCAlgorithmInfo, error) { return nil, errors.New("operation not supported") }