Plain packet

Plain packet contains either the whole file, or file request (freq), or transition packet or exec message. It is called "plain", because it contains plaintext, but plain packets would never be stored on your hard drive.

XDR typeValue
Magic number8-byte, fixed length opaque dataN N C P P 0x00 0x00 0x03
Payload typeunsigned integer0 (file), 1 (freq), 2 (exec), 3 (transition)
Nicenessunsigned integer1-255, preferred packet niceness level
Path lengthunsigned integeractual length of path field’s payload
Path255 byte, fixed length opaque data
  • UTF-8 encoded destination path for file transfer
  • UTF-8 encoded source path for file request
  • UTF-8 encoded, zero byte separated, exec’s arguments
  • Node’s id the transition packet must be relayed on

Path has fixed size because of hiding its actual length – it is valuable metadata. Payload is appended to the header – it is not stored as XDR field, because most XDR libraries will store all that data in the memory.

Depending on the packet’s type, payload could store:

Also depending on packet’s type, niceness level means: