packets.go 384 B

123456789101112131415161718192021222324252627
  1. package discover
  2. const (
  3. AnnouncementMagicV2 = 0x029E4C77
  4. QueryMagicV2 = 0x23D63A9A
  5. )
  6. type QueryV2 struct {
  7. Magic uint32
  8. NodeID string // max:64
  9. }
  10. type AnnounceV2 struct {
  11. Magic uint32
  12. This Node
  13. Extra []Node // max:16
  14. }
  15. type Node struct {
  16. ID string // max:64
  17. Addresses []Address // max:16
  18. }
  19. type Address struct {
  20. IP []byte // max:16
  21. Port uint16
  22. }