localpackets.go 677 B

1234567891011121314151617181920212223242526272829
  1. // Copyright (C) 2014 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at http://mozilla.org/MPL/2.0/.
  6. //go:generate -command genxdr go run ../../vendor/github.com/calmh/xdr/cmd/genxdr/main.go
  7. //go:generate genxdr -o localpackets_xdr.go localpackets.go
  8. package discover
  9. const (
  10. AnnouncementMagic = 0x7D79BC40
  11. )
  12. type Announce struct {
  13. Magic uint32
  14. This Device
  15. Extra []Device // max:16
  16. }
  17. type Device struct {
  18. ID []byte // max:32
  19. Addresses []Address // max:16
  20. }
  21. type Address struct {
  22. URL string // max:2083
  23. }