2 Package rudp implements the low-level Minetest protocol described at
3 https://dev.minetest.net/Network_Protocol#Low-level_protocol.
5 All exported functions and methods in this package are safe for concurrent use
6 by multiple goroutines.
10 // protoID must be at the start of every network packet.
11 const protoID uint32 = 0x4f457403
13 // PeerIDs aren't actually used to identify peers, network addresses are,
14 // these just exist for backward compatability.
18 // Used by clients before the server sets their ID.
19 PeerIDNil PeerID = iota
21 // The server always has this ID.
24 // Lowest ID the server can assign to a client.
28 // ChannelCount is the maximum channel number + 1.
29 const ChannelCount = 3
32 rawPkt.Data format (big endian):
40 // Tells peer you received a rawTypeRel
41 // and it doesn't need to resend it.
44 // Tells peer to send packets with this Src PeerID.
47 // Sent to prevent timeout.
49 // Tells peer that you disconnected.
54 // Packet larger than MaxNetPktSize split into smaller packets.
55 // Packets with I >= Count should be ignored.
56 // Once all Count chunks are recieved, they are sorted by I and
57 // concatenated to make a Pkt.(Data).
58 seqnum // Identifies split packet.
62 // Resent until a ctlAck with same seqnum is recieved.
63 // seqnums are sequencial and start at seqnumInit,
64 // These should be processed in seqnum order.
78 rawTypeCtl rawType = iota
99 // seqnums are sequence numbers used to maintain reliable packet order
100 // and to identify split packets.
103 const seqnumInit seqnum = 65500