github.com/braveheart12/insolar-09-08-19@v0.8.7/network/transport/packet/types/types.go (about)

     1  /*
     2   * The Clear BSD License
     3   *
     4   * Copyright (c) 2019 Insolar Technologies
     5   *
     6   * All rights reserved.
     7   *
     8   * Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
     9   *
    10   *  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    11   *  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    12   *  Neither the name of Insolar Technologies nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
    13   *
    14   * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    15   *
    16   */
    17  
    18  package types
    19  
    20  //go:generate stringer -type=PacketType
    21  type PacketType int
    22  
    23  const (
    24  	// Ping is packet type to ping remote node.
    25  	Ping PacketType = iota + 1
    26  	// RPC is packet type to execute RPC on a remote node.
    27  	RPC
    28  	// Cascade is packet type to send cascade message and execute RPC on each node of the cascade.
    29  	Cascade
    30  	// Pulse is packet type to receive Pulse from pulsard and resend it on remote nodes.
    31  	Pulse
    32  	// GetRandomHosts is packet type for pulsar daemon to get random hosts from insolar daemon.
    33  	GetRandomHosts
    34  	// Bootstrap is packet type for the node bootstrap process.
    35  	Bootstrap
    36  	// Authorize is packet type to authorize bootstrapping node on discovery node.
    37  	Authorize
    38  	// Register is packet type to connect node to discovery node and add join claim to consensus
    39  	Register
    40  	// Genesis is packet type for active list exchange between discovery nodes
    41  	Genesis
    42  	// Challenge1 is packet type for first phase of double challenge response
    43  	Challenge1
    44  	// Challenge2 is packet type for first phase of double challenge response
    45  	Challenge2
    46  	// Disconnect is packet type to gracefully disconnect from network.
    47  	Disconnect
    48  )