Skip to content

Commit eb3d9ae

Browse files
committed
Add parts of custom oscur0 conn
1 parent 7747bc8 commit eb3d9ae

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

u_conn_oscur0.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package quic
2+
3+
import (
4+
"net"
5+
6+
"github.com/refraction-networking/uquic/internal/protocol"
7+
"github.com/refraction-networking/uquic/internal/utils"
8+
"github.com/refraction-networking/uquic/logging"
9+
)
10+
11+
func oscur0ServerConn(pconn net.PacketConn, remoteAddr net.Addr) (Connection, error) {
12+
c := &connection{}
13+
14+
c.handshakeDestConnID = protocol.ParseConnectionID([]uint8{38, 67, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})
15+
c.origDestConnID = protocol.ParseConnectionID([]uint8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})
16+
c.retrySrcConnID = nil
17+
c.srcConnIDLen = 4
18+
c.perspective = logging.PerspectiveServer
19+
c.version = Version1
20+
21+
rconn, err := wrapConn(pconn)
22+
if err != nil {
23+
return nil, err
24+
}
25+
c.conn = newSendConn(rconn, remoteAddr, packetInfo{}, utils.DefaultLogger)
26+
c.sendQueue = newSendQueue(c.conn)
27+
c.streamsMap = newStreamsMap(c, c.newFlowController, 100, 100, c.perspective)
28+
handlermap := newPacketHandlerMap(c.statelessReset)
29+
c.connIDManager = newConnIDManager(
30+
c.origDestConnID,
31+
func(token protocol.StatelessResetToken) { runner.AddResetToken(token, s) },
32+
runner.RemoveResetToken,
33+
s.queueControlFrame,
34+
)
35+
return c, nil
36+
}

0 commit comments

Comments
 (0)