handshake.proto 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file documents the wire format the nebula handshake speaks. It is
  2. // not run through protoc; the encoder/decoder in payload.go is hand-written
  3. // against this shape directly to keep the parser narrow and panic-free.
  4. //
  5. // Any change to the wire format must be reflected here, and adding a new
  6. // field requires updating MarshalPayload / unmarshalPayloadDetails together
  7. // with the field-uniqueness and wire-type checks in those functions.
  8. syntax = "proto3";
  9. package nebula.handshake;
  10. message NebulaHandshake {
  11. NebulaHandshakeDetails Details = 1;
  12. bytes Hmac = 2;
  13. }
  14. message NebulaHandshakeDetails {
  15. bytes Cert = 1;
  16. uint32 InitiatorIndex = 2;
  17. uint32 ResponderIndex = 3;
  18. // Cookie was reserved for an anti-DoS mechanism that was never
  19. // implemented. No released version of nebula has ever populated it; the
  20. // hand-written parser silently skips it on read.
  21. uint64 Cookie = 4 [deprecated = true];
  22. uint64 Time = 5;
  23. // Multiport lane negotiation. Absent on hosts without multiport enabled;
  24. // vanilla nebula treats 6 and 7 as unknown fields and skips them.
  25. LaneDetails InitiatorLanes = 6;
  26. LaneDetails ResponderLanes = 7;
  27. uint32 CertVersion = 8;
  28. }
  29. // LaneDetails advertises a host's multiport lane capability. On a base
  30. // handshake LaneIndex is 0 and PortCount/BasePort describe the sender's
  31. // consecutively bound UDP ports. On a lane handshake the initiator sets
  32. // LaneIndex to its (nonzero) lane number.
  33. message LaneDetails {
  34. uint32 PortCount = 1;
  35. uint32 BasePort = 2;
  36. uint32 LaneIndex = 3;
  37. }