forked from quic-go/quic-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packet_setting_config.go
48 lines (40 loc) · 1.88 KB
/
packet_setting_config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package packet_setting
import (
"net"
)
// TODO: how to make this prettier?
// define an interface with the needed methods to avoid import cycle
type QuicConnection interface {
// LocalAddr returns the local address.
LocalAddr() net.Addr
// RemoteAddr returns the address of the peer.
RemoteAddr() net.Addr
// PRIO_PACKS_TAG
// get the priority of a corresponding stream using the streamID
// GetPriority(StreamID) Priority
// PACKET_NUMBER_TAG
// SetPacketNumber sets the packet number for the next packet sent on the connection.
// This is needed if bpf porgrams are sending packets.
SetPacketNumber(int64)
// SetHighestSent sets the highest packet number sent on the connection.
// This is needed if bpf porgrams are sending packets.
SetHighestSent(int64)
// (Un-)Locking the packet number setting so that it is not changed during actively checking
// a packet number of a packet.
Lock()
Unlock()
}
var (
ALLOW_SETTING_PN bool = false
OMIT_CONN_ID_RETIREMENT bool = false
SET_ONLY_APP_DATA bool = true
PRINT_PACKET_RECEIVING_INFO bool = false
ConnectionRetirementBPFHandler func(id []byte, l uint8, conn QuicConnection) = nil
ConnectionInitiationBPFHandler func(id []byte, l uint8, conn QuicConnection) = nil
ConnectionUpdateBPFHandler func(id []byte, l uint8, conn QuicConnection) = nil
PacketNumberIncrementBPFHandler func(pn int64, conn QuicConnection) = nil
// Important note: this function should return "pn, err" in case of an error
AckTranslationBPFHandler func(pn int64, conn QuicConnection) (int64, error) = nil
// CheckIfAckShouldBeIgnored func(pn int64, conn QuicConnection) bool = nil // TODO: remove
SERVER_ADDR string = "192.168.10.1:4242"
)