extra.struct.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Meta information
  2. meta:
  3. # Document name and ID
  4. id: extra
  5. name: Extra Structs
  6. # References used by the structs
  7. references:
  8. # A random nonce
  9. nonce: &nonce b24
  10. # Virtual namespace, just containing the below docstring
  11. index: &index
  12. _doc: |-
  13. # Extra Structures
  14. Structs defined here are not a mandatory part of any protocol but can be
  15. used with any of them.
  16. # General crypto-related structs
  17. crypto: &crypto
  18. encrypted-data-with-nonce-ahead:
  19. _doc: |-
  20. ## Crypto
  21. Contains encrypted data, prefixed with a 24 byte nonce.
  22. Note: This can be used for all ciphers using a 24 byte nonce, e.g.
  23. XSalsa20-Poly1305 and ChaCha20-Poly1305.
  24. fields:
  25. - _doc: |-
  26. Nonce used for encrypting the data.
  27. name: nonce
  28. type: *nonce
  29. - _doc: |-
  30. The encrypted data.
  31. name: data
  32. type: b*
  33. # Monitoring structs
  34. monitoring: &monitoring
  35. _doc: |-
  36. ## Monitoring
  37. These structs can be used to monitor a network connection.
  38. rtt-measurement:
  39. _doc: |-
  40. Contains a timestamp for RTT measurement by reflection.
  41. fields:
  42. - _doc: |-
  43. A Unix-ish timestamp in milliseconds (for start reference).
  44. name: timestamp
  45. type: u64-le
  46. # Transport structs
  47. transport: &transport
  48. _doc: |-
  49. ## Transport
  50. These structs are helpful for network transports.
  51. frame:
  52. _doc: |-
  53. A fixed-length frame for stream-like transports.
  54. fields:
  55. - _doc: |-
  56. Length of the `data` field.
  57. name: length
  58. type: u32-le
  59. - _doc: |-
  60. The data.
  61. name: data
  62. type: b{length}
  63. # Parsed struct namespaces (mapped into separate files)
  64. namespaces:
  65. index: *index
  66. crypto: *crypto
  67. monitoring: *monitoring
  68. transport: *transport