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