github.com/inazumav/sing-box@v0.0.0-20230926072359-ab51429a14f1/common/badtls/link.go (about) 1 //go:build go1.20 && !go.1.21 2 3 package badtls 4 5 import ( 6 "reflect" 7 _ "unsafe" 8 ) 9 10 const ( 11 maxPlaintext = 16384 // maximum plaintext payload length 12 recordHeaderLen = 5 // record header length 13 ) 14 15 //go:linkname errShutdown crypto/tls.errShutdown 16 var errShutdown error 17 18 //go:linkname incSeq crypto/tls.(*halfConn).incSeq 19 func incSeq(conn uintptr) 20 21 //go:linkname valueInterface reflect.valueInterface 22 func valueInterface(v reflect.Value, safe bool) any