make the protocol package internal

This commit is contained in:
Marten Seemann 2017-08-30 00:19:44 +07:00
parent 524ecb5827
commit f1ada87dcf
133 changed files with 185 additions and 123 deletions

View file

@ -3,8 +3,8 @@ package ackhandler
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
) )
// SentPacketHandler handles ACKs received for outgoing packets // SentPacketHandler handles ACKs received for outgoing packets

View file

@ -3,8 +3,8 @@ package ackhandler
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
) )
// A Packet is a packet // A Packet is a packet

View file

@ -4,8 +4,8 @@ import (
"errors" "errors"
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
) )
var errInvalidPacketNumber = errors.New("ReceivedPacketHandler: Invalid packet number") var errInvalidPacketNumber = errors.New("ReceivedPacketHandler: Invalid packet number")

View file

@ -3,8 +3,8 @@ package ackhandler
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -1,9 +1,9 @@
package ackhandler package ackhandler
import ( import (
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -1,9 +1,9 @@
package ackhandler package ackhandler
import ( import (
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -6,9 +6,9 @@ import (
"time" "time"
"github.com/lucas-clemente/quic-go/congestion" "github.com/lucas-clemente/quic-go/congestion"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -4,8 +4,8 @@ import (
"time" "time"
"github.com/lucas-clemente/quic-go/congestion" "github.com/lucas-clemente/quic-go/congestion"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -1,8 +1,8 @@
package ackhandler package ackhandler
import ( import (
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
) )
// This stopWaitingManager is not supposed to satisfy the StopWaitingManager interface, which is a remnant of the legacy AckHandler, and should be remove once we drop support for QUIC 33 // This stopWaitingManager is not supposed to satisfy the StopWaitingManager interface, which is a remnant of the legacy AckHandler, and should be remove once we drop support for QUIC 33

View file

@ -9,8 +9,8 @@ import (
"net" "net"
quic "github.com/lucas-clemente/quic-go" quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/testdata" "github.com/lucas-clemente/quic-go/internal/testdata"
"github.com/lucas-clemente/quic-go/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -3,7 +3,7 @@ package quic
import ( import (
"sync" "sync"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
var bufferPool sync.Pool var bufferPool sync.Pool

View file

@ -1,7 +1,7 @@
package quic package quic
import ( import (
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -10,9 +10,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -7,8 +7,8 @@ import (
"net" "net"
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"

View file

@ -3,7 +3,7 @@ package congestion
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// Bandwidth of a connection // Bandwidth of a connection

View file

@ -4,8 +4,8 @@ import (
"math" "math"
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
// This cubic implementation is based on the one found in Chromiums's QUIC // This cubic implementation is based on the one found in Chromiums's QUIC

View file

@ -3,8 +3,8 @@ package congestion
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
const ( const (

View file

@ -3,7 +3,7 @@ package congestion
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -4,7 +4,7 @@ import (
"math" "math"
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -3,8 +3,8 @@ package congestion
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
// Note(pwestin): the magic clamping numbers come from the original code in // Note(pwestin): the magic clamping numbers come from the original code in

View file

@ -3,7 +3,7 @@ package congestion
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -3,7 +3,7 @@ package congestion
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// A SendAlgorithm performs congestion control and calculates the congestion window // A SendAlgorithm performs congestion control and calculates the congestion window

View file

@ -3,8 +3,8 @@ package congestion
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
// PrrSender implements the Proportional Rate Reduction (PRR) per RFC 6937 // PrrSender implements the Proportional Rate Reduction (PRR) per RFC 6937

View file

@ -4,8 +4,8 @@ import (
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
var _ = Describe("PRR sender", func() { var _ = Describe("PRR sender", func() {

View file

@ -1,6 +1,6 @@
package congestion package congestion
import "github.com/lucas-clemente/quic-go/protocol" import "github.com/lucas-clemente/quic-go/internal/protocol"
type connectionStats struct { type connectionStats struct {
slowstartPacketsLost protocol.PacketNumber slowstartPacketsLost protocol.PacketNumber

View file

@ -1,6 +1,6 @@
package crypto package crypto
import "github.com/lucas-clemente/quic-go/protocol" import "github.com/lucas-clemente/quic-go/internal/protocol"
// An AEAD implements QUIC's authenticated encryption and associated data // An AEAD implements QUIC's authenticated encryption and associated data
type AEAD interface { type AEAD interface {

View file

@ -6,7 +6,7 @@ import (
"github.com/lucas-clemente/aes12" "github.com/lucas-clemente/aes12"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
type aeadAESGCM struct { type aeadAESGCM struct {

View file

@ -5,7 +5,7 @@ import (
"hash/fnv" "hash/fnv"
"github.com/hashicorp/golang-lru" "github.com/hashicorp/golang-lru"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
var ( var (

View file

@ -8,7 +8,7 @@ import (
"github.com/aead/chacha20" "github.com/aead/chacha20"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
type aeadChacha20Poly1305 struct { type aeadChacha20Poly1305 struct {

View file

@ -5,8 +5,8 @@ import (
"crypto/sha256" "crypto/sha256"
"io" "io"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"golang.org/x/crypto/hkdf" "golang.org/x/crypto/hkdf"
) )

View file

@ -1,7 +1,7 @@
package crypto package crypto
import ( import (
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -3,7 +3,7 @@ package crypto
import ( import (
"encoding/binary" "encoding/binary"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
func makeNonce(iv []byte, packetNumber protocol.PacketNumber) []byte { func makeNonce(iv []byte, packetNumber protocol.PacketNumber) []byte {

View file

@ -5,7 +5,7 @@ import (
"errors" "errors"
"github.com/lucas-clemente/fnv128a" "github.com/lucas-clemente/fnv128a"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// nullAEAD handles not-yet encrypted packets // nullAEAD handles not-yet encrypted packets

View file

@ -1,7 +1,7 @@
package crypto package crypto
import ( import (
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -7,8 +7,8 @@ import (
"github.com/lucas-clemente/quic-go/congestion" "github.com/lucas-clemente/quic-go/congestion"
"github.com/lucas-clemente/quic-go/handshake" "github.com/lucas-clemente/quic-go/handshake"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -5,7 +5,7 @@ import (
"github.com/lucas-clemente/quic-go/congestion" "github.com/lucas-clemente/quic-go/congestion"
"github.com/lucas-clemente/quic-go/internal/mocks" "github.com/lucas-clemente/quic-go/internal/mocks"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -6,8 +6,8 @@ import (
"github.com/lucas-clemente/quic-go/congestion" "github.com/lucas-clemente/quic-go/congestion"
"github.com/lucas-clemente/quic-go/handshake" "github.com/lucas-clemente/quic-go/handshake"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
type flowController struct { type flowController struct {

View file

@ -5,7 +5,7 @@ import (
"github.com/lucas-clemente/quic-go/congestion" "github.com/lucas-clemente/quic-go/congestion"
"github.com/lucas-clemente/quic-go/internal/mocks" "github.com/lucas-clemente/quic-go/internal/mocks"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -1,6 +1,6 @@
package flowcontrol package flowcontrol
import "github.com/lucas-clemente/quic-go/protocol" import "github.com/lucas-clemente/quic-go/internal/protocol"
// WindowUpdate provides the data for WindowUpdateFrames. // WindowUpdate provides the data for WindowUpdateFrames.
type WindowUpdate struct { type WindowUpdate struct {

View file

@ -15,8 +15,8 @@ import (
"golang.org/x/net/idna" "golang.org/x/net/idna"
quic "github.com/lucas-clemente/quic-go" quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -12,7 +12,7 @@ import (
"golang.org/x/net/http2/hpack" "golang.org/x/net/http2/hpack"
quic "github.com/lucas-clemente/quic-go" quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
"time" "time"

View file

@ -13,8 +13,8 @@ import (
"golang.org/x/net/lex/httplex" "golang.org/x/net/lex/httplex"
quic "github.com/lucas-clemente/quic-go" quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
type requestWriter struct { type requestWriter struct {

View file

@ -8,8 +8,8 @@ import (
"sync" "sync"
quic "github.com/lucas-clemente/quic-go" quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"golang.org/x/net/http2" "golang.org/x/net/http2"
"golang.org/x/net/http2/hpack" "golang.org/x/net/http2/hpack"
) )

View file

@ -11,7 +11,7 @@ import (
"golang.org/x/net/http2" "golang.org/x/net/http2"
"golang.org/x/net/http2/hpack" "golang.org/x/net/http2/hpack"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -13,8 +13,8 @@ import (
"time" "time"
quic "github.com/lucas-clemente/quic-go" quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
"golang.org/x/net/http2" "golang.org/x/net/http2"
"golang.org/x/net/http2/hpack" "golang.org/x/net/http2/hpack"

View file

@ -18,8 +18,8 @@ import (
"golang.org/x/net/http2/hpack" "golang.org/x/net/http2/hpack"
quic "github.com/lucas-clemente/quic-go" quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/testdata" "github.com/lucas-clemente/quic-go/internal/testdata"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"

View file

@ -5,8 +5,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -5,7 +5,7 @@ import (
"math" "math"
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -12,8 +12,8 @@ import (
"time" "time"
"github.com/lucas-clemente/quic-go/crypto" "github.com/lucas-clemente/quic-go/crypto"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -8,8 +8,8 @@ import (
"time" "time"
"github.com/lucas-clemente/quic-go/crypto" "github.com/lucas-clemente/quic-go/crypto"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -10,8 +10,8 @@ import (
"sync" "sync"
"github.com/lucas-clemente/quic-go/crypto" "github.com/lucas-clemente/quic-go/crypto"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -7,8 +7,8 @@ import (
"net" "net"
"github.com/lucas-clemente/quic-go/crypto" "github.com/lucas-clemente/quic-go/crypto"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"

View file

@ -5,8 +5,8 @@ import (
"time" "time"
"github.com/lucas-clemente/quic-go/crypto" "github.com/lucas-clemente/quic-go/crypto"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
var ( var (

View file

@ -4,7 +4,7 @@ import (
"time" "time"
"github.com/lucas-clemente/quic-go/crypto" "github.com/lucas-clemente/quic-go/crypto"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -7,8 +7,8 @@ import (
"io" "io"
"sort" "sort"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -1,6 +1,6 @@
package handshake package handshake
import "github.com/lucas-clemente/quic-go/protocol" import "github.com/lucas-clemente/quic-go/internal/protocol"
// Sealer seals a packet // Sealer seals a packet
type Sealer func(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) []byte type Sealer func(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) []byte

View file

@ -15,8 +15,8 @@ import (
"time" "time"
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver" "github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
_ "github.com/lucas-clemente/quic-go/integrationtests/tools/testlog" _ "github.com/lucas-clemente/quic-go/integrationtests/tools/testlog"

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
) )

View file

@ -9,7 +9,7 @@ import (
_ "github.com/lucas-clemente/quic-clients" // download clients _ "github.com/lucas-clemente/quic-clients" // download clients
"github.com/lucas-clemente/quic-go/integrationtests/tools/proxy" "github.com/lucas-clemente/quic-go/integrationtests/tools/proxy"
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver" "github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -8,7 +8,7 @@ import (
"sync" "sync"
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver" "github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
_ "github.com/lucas-clemente/quic-clients" // download clients _ "github.com/lucas-clemente/quic-clients" // download clients

View file

@ -11,7 +11,7 @@ import (
_ "github.com/lucas-clemente/quic-clients" // download clients _ "github.com/lucas-clemente/quic-clients" // download clients
"github.com/lucas-clemente/quic-go/integrationtests/tools/proxy" "github.com/lucas-clemente/quic-go/integrationtests/tools/proxy"
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver" "github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -10,7 +10,7 @@ import (
_ "github.com/lucas-clemente/quic-clients" // download clients _ "github.com/lucas-clemente/quic-clients" // download clients
"github.com/lucas-clemente/quic-go/integrationtests/tools/proxy" "github.com/lucas-clemente/quic-go/integrationtests/tools/proxy"
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver" "github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -11,7 +11,7 @@ import (
"github.com/lucas-clemente/quic-go/h2quic" "github.com/lucas-clemente/quic-go/h2quic"
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver" "github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gbytes"

View file

@ -8,8 +8,8 @@ import (
quic "github.com/lucas-clemente/quic-go" quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/integrationtests/tools/proxy" "github.com/lucas-clemente/quic-go/integrationtests/tools/proxy"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
"github.com/lucas-clemente/quic-go/internal/testdata" "github.com/lucas-clemente/quic-go/internal/testdata"

View file

@ -7,8 +7,8 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
) )
// Connection is a UDP connection // Connection is a UDP connection

View file

@ -9,8 +9,8 @@ import (
"fmt" "fmt"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/wire" "github.com/lucas-clemente/quic-go/internal/wire"
"github.com/lucas-clemente/quic-go/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -6,7 +6,7 @@ import (
"net" "net"
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// Stream is the interface implemented by QUIC streams // Stream is the interface implemented by QUIC streams

View file

@ -4,10 +4,11 @@
package mocks package mocks
import ( import (
time "time"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
handshake "github.com/lucas-clemente/quic-go/handshake" handshake "github.com/lucas-clemente/quic-go/handshake"
protocol "github.com/lucas-clemente/quic-go/protocol" protocol "github.com/lucas-clemente/quic-go/internal/protocol"
time "time"
) )
// Mock of ConnectionParametersManager interface // Mock of ConnectionParametersManager interface

View file

@ -6,7 +6,7 @@ package mocks_fc
import ( import (
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
flowcontrol "github.com/lucas-clemente/quic-go/flowcontrol" flowcontrol "github.com/lucas-clemente/quic-go/flowcontrol"
protocol "github.com/lucas-clemente/quic-go/protocol" protocol "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// Mock of FlowControlManager interface // Mock of FlowControlManager interface

View file

@ -0,0 +1,61 @@
package protocol
// VersionNumber is a version number as int
type VersionNumber int
// The version numbers, making grepping easier
const (
Version35 VersionNumber = 35 + iota
Version36
Version37
<<<<<<< Updated upstream
=======
Version38
>>>>>>> Stashed changes
Version39
VersionWhatever VersionNumber = 0 // for when the version doesn't matter
VersionUnsupported VersionNumber = -1
VersionUnknown VersionNumber = -2
)
// SupportedVersions lists the versions that the server supports
// must be in sorted descending order
var SupportedVersions = []VersionNumber{
Version39, //Version37, Version36, Version35,
}
// VersionNumberToTag maps version numbers ('32') to tags ('Q032')
func VersionNumberToTag(vn VersionNumber) uint32 {
v := uint32(vn)
return 'Q' + ((v/100%10)+'0')<<8 + ((v/10%10)+'0')<<16 + ((v%10)+'0')<<24
}
// VersionTagToNumber is built from VersionNumberToTag in init()
func VersionTagToNumber(v uint32) VersionNumber {
return VersionNumber(((v>>8)&0xff-'0')*100 + ((v>>16)&0xff-'0')*10 + ((v>>24)&0xff - '0'))
}
// IsSupportedVersion returns true if the server supports this version
func IsSupportedVersion(supported []VersionNumber, v VersionNumber) bool {
for _, t := range supported {
if t == v {
return true
}
}
return false
}
// ChooseSupportedVersion finds the best version in the overlap of ours and theirs
// ours is a slice of versions that we support, sorted by our preference (descending)
// theirs is a slice of versions offered by the peer. The order does not matter
// if no suitable version is found, it returns VersionUnsupported
func ChooseSupportedVersion(ours, theirs []VersionNumber) VersionNumber {
for _, ourVer := range ours {
for _, theirVer := range theirs {
if ourVer == theirVer {
return ourVer
}
}
}
return VersionUnsupported
}

View file

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"io" "io"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// A ByteOrder specifies how to convert byte sequences into 16-, 32-, or 64-bit unsigned integers. // A ByteOrder specifies how to convert byte sequences into 16-, 32-, or 64-bit unsigned integers.

View file

@ -1,7 +1,7 @@
package utils package utils
import ( import (
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -4,7 +4,7 @@ import (
"crypto/rand" "crypto/rand"
"encoding/binary" "encoding/binary"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// GenerateConnectionID generates a connection ID using cryptographic random // GenerateConnectionID generates a connection ID using cryptographic random

View file

@ -4,7 +4,7 @@ import (
"math" "math"
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// InfDuration is a duration of infinite length // InfDuration is a duration of infinite length

View file

@ -3,7 +3,7 @@ package utils
import ( import (
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -1,6 +1,6 @@
package utils package utils
import "github.com/lucas-clemente/quic-go/protocol" import "github.com/lucas-clemente/quic-go/internal/protocol"
// PacketInterval is an interval from one PacketNumber to the other // PacketInterval is an interval from one PacketNumber to the other
// +gen linkedlist // +gen linkedlist

View file

@ -1,6 +1,6 @@
package utils package utils
import "github.com/lucas-clemente/quic-go/protocol" import "github.com/lucas-clemente/quic-go/internal/protocol"
// ByteInterval is an interval from one ByteCount to the other // ByteInterval is an interval from one ByteCount to the other
// +gen linkedlist // +gen linkedlist

View file

@ -5,8 +5,8 @@ import (
"errors" "errors"
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
var ( var (

View file

@ -6,7 +6,7 @@ import (
"io" "io"
"time" "time"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -1,6 +1,6 @@
package wire package wire
import "github.com/lucas-clemente/quic-go/protocol" import "github.com/lucas-clemente/quic-go/internal/protocol"
// AckRange is an ACK range // AckRange is an ACK range
type AckRange struct { type AckRange struct {

View file

@ -3,8 +3,8 @@ package wire
import ( import (
"bytes" "bytes"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
) )
// A BlockedFrame in QUIC // A BlockedFrame in QUIC

View file

@ -3,7 +3,7 @@ package wire
import ( import (
"bytes" "bytes"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

View file

@ -6,8 +6,8 @@ import (
"io" "io"
"math" "math"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"strings" "strings"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -3,7 +3,7 @@ package wire
import ( import (
"bytes" "bytes"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// A Frame in QUIC // A Frame in QUIC

View file

@ -4,8 +4,8 @@ import (
"bytes" "bytes"
"io" "io"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
) )

View file

@ -3,7 +3,7 @@ package wire
import ( import (
"bytes" "bytes"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/qerr" "github.com/lucas-clemente/quic-go/qerr"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"

View file

@ -6,8 +6,8 @@ import (
"os" "os"
"time" "time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"

View file

@ -3,7 +3,7 @@ package wire
import ( import (
"bytes" "bytes"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
) )
// A PingFrame is a ping frame // A PingFrame is a ping frame

View file

@ -3,7 +3,7 @@ package wire
import ( import (
"bytes" "bytes"
"github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/internal/protocol"
. "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
) )

Some files were not shown because too many files have changed in this diff Show more