github.com/kayoticsully/syncthing@v0.8.9-0.20140724133906-c45a2fdc03f8/discover/packets.go (about)

     1  // Copyright (C) 2014 Jakob Borg and Contributors (see the CONTRIBUTORS file).
     2  // All rights reserved. Use of this source code is governed by an MIT-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package discover
     6  
     7  const (
     8  	AnnouncementMagic = 0x9D79BC39
     9  	QueryMagic        = 0x2CA856F5
    10  )
    11  
    12  type Query struct {
    13  	Magic  uint32
    14  	NodeID []byte // max:32
    15  }
    16  
    17  type Announce struct {
    18  	Magic uint32
    19  	This  Node
    20  	Extra []Node // max:16
    21  }
    22  
    23  type Node struct {
    24  	ID        []byte    // max:32
    25  	Addresses []Address // max:16
    26  }
    27  
    28  type Address struct {
    29  	IP   []byte // max:16
    30  	Port uint16
    31  }