-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathprudp_packet_interface.go
56 lines (53 loc) · 1.6 KB
/
prudp_packet_interface.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
49
50
51
52
53
54
55
56
package nex
import (
"net"
"time"
"github.com/PretendoNetwork/nex-go/v2/constants"
)
// PRUDPPacketInterface defines all the methods a PRUDP packet should have
type PRUDPPacketInterface interface {
Copy() PRUDPPacketInterface
Version() int
Bytes() []byte
SetSender(sender ConnectionInterface)
Sender() ConnectionInterface
Flags() uint16
HasFlag(flag uint16) bool
AddFlag(flag uint16)
SetType(packetType uint16)
Type() uint16
SetSourceVirtualPortStreamType(streamType constants.StreamType)
SourceVirtualPortStreamType() constants.StreamType
SetSourceVirtualPortStreamID(port uint8)
SourceVirtualPortStreamID() uint8
SetDestinationVirtualPortStreamType(streamType constants.StreamType)
DestinationVirtualPortStreamType() constants.StreamType
SetDestinationVirtualPortStreamID(port uint8)
DestinationVirtualPortStreamID() uint8
SessionID() uint8
SetSessionID(sessionID uint8)
SubstreamID() uint8
SetSubstreamID(substreamID uint8)
SequenceID() uint16
SetSequenceID(sequenceID uint16)
Payload() []byte
SetPayload(payload []byte)
RMCMessage() *RMCMessage
SetRMCMessage(message *RMCMessage)
SendCount() uint32
incrementSendCount()
SentAt() time.Time
setSentAt(time time.Time)
getTimeout() *Timeout
setTimeout(timeout *Timeout)
decode() error
setSignature(signature []byte)
calculateConnectionSignature(addr net.Addr) ([]byte, error)
calculateSignature(sessionKey, connectionSignature []byte) []byte
decryptPayload() []byte
getConnectionSignature() []byte
setConnectionSignature(connectionSignature []byte)
getFragmentID() uint8
setFragmentID(fragmentID uint8)
processUnreliableCrypto() []byte
}