Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.DS_Store
!/README.md
/*.md
*.patch
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"encoding/binary"
"fmt"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/internal/gtcpip/checksum"
"github.com/sagernet/sing-tun/gtcpip"
"github.com/sagernet/sing-tun/gtcpip/checksum"
)

// PseudoHeaderChecksum calculates the pseudo-header checksum for the given
Expand Down
2 changes: 1 addition & 1 deletion internal/gtcpip/header/eth.go → gtcpip/header/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package header
import (
"encoding/binary"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/gtcpip"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/gtcpip/header/icmpv4.go → gtcpip/header/icmpv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package header
import (
"encoding/binary"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/internal/gtcpip/checksum"
"github.com/sagernet/sing-tun/gtcpip"
"github.com/sagernet/sing-tun/gtcpip/checksum"
)

// ICMPv4 represents an ICMPv4 header stored in a byte array.
Expand Down
4 changes: 2 additions & 2 deletions internal/gtcpip/header/icmpv6.go → gtcpip/header/icmpv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package header
import (
"encoding/binary"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/internal/gtcpip/checksum"
"github.com/sagernet/sing-tun/gtcpip"
"github.com/sagernet/sing-tun/gtcpip/checksum"
)

// ICMPv6 represents an ICMPv6 header stored in a byte array.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package header
import (
"net/netip"

tcpip "github.com/sagernet/sing-tun/internal/gtcpip"
tcpip "github.com/sagernet/sing-tun/gtcpip"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/gtcpip/header/ipv4.go → gtcpip/header/ipv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"net/netip"
"time"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/internal/gtcpip/checksum"
"github.com/sagernet/sing-tun/gtcpip"
"github.com/sagernet/sing-tun/gtcpip/checksum"
"github.com/sagernet/sing/common"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/gtcpip/header/ipv6.go → gtcpip/header/ipv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"net/netip"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/gtcpip"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"math"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/gtcpip"
"github.com/sagernet/sing/common"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package header
import (
"encoding/binary"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/gtcpip"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package header

import "github.com/sagernet/sing-tun/internal/gtcpip"
import "github.com/sagernet/sing-tun/gtcpip"

// NDPNeighborAdvert is an NDP Neighbor Advertisement message. It will
// only contain the body of an ICMPv6 packet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package header

import "github.com/sagernet/sing-tun/internal/gtcpip"
import "github.com/sagernet/sing-tun/gtcpip"

// NDPNeighborSolicit is an NDP Neighbor Solicitation message. It will only
// contain the body of an ICMPv6 packet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"math"
"time"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/gtcpip"
"github.com/sagernet/sing/common"
)

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions internal/gtcpip/header/tcp.go → gtcpip/header/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package header
import (
"encoding/binary"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/internal/gtcpip/checksum"
"github.com/sagernet/sing-tun/internal/gtcpip/seqnum"
"github.com/sagernet/sing-tun/gtcpip"
"github.com/sagernet/sing-tun/gtcpip/checksum"
"github.com/sagernet/sing-tun/gtcpip/seqnum"

"github.com/google/btree"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/gtcpip/header/udp.go → gtcpip/header/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"encoding/binary"
"math"

"github.com/sagernet/sing-tun/internal/gtcpip"
"github.com/sagernet/sing-tun/internal/gtcpip/checksum"
"github.com/sagernet/sing-tun/gtcpip"
"github.com/sagernet/sing-tun/gtcpip/checksum"
)

const (
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/checksum_test/sum_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"crypto/rand"
"testing"

"github.com/sagernet/sing-tun/internal/gtcpip/checksum"
"github.com/sagernet/sing-tun/gtcpip/checksum"
"github.com/sagernet/sing-tun/internal/tschecksum"
)

Expand Down
2 changes: 1 addition & 1 deletion nfqueue_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"errors"
"sync/atomic"

"github.com/sagernet/sing-tun/internal/gtcpip/header"
"github.com/sagernet/sing-tun/gtcpip/header"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/common/logger"
M "github.com/sagernet/sing/common/metadata"
Expand Down
11 changes: 11 additions & 0 deletions ping/conn_interfaces.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package ping

import "net/netip"

type readMsgConn interface {
ReadMsg(b, oob []byte) (n, oobn int, addr netip.Addr, err error)
}

type ttlSetter interface {
SetTTL(ttl uint8)
}
Loading