2018-07-11 14:35:24 +02:00
|
|
|
// Copyright 2018 Parity Technologies (UK) Ltd.
|
2017-12-13 12:08:40 +01:00
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
// copy of this software and associated documentation files (the "Software"),
|
|
|
|
// to deal in the Software without restriction, including without limitation
|
|
|
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
// and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
// Software is furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
// DEALINGS IN THE SOFTWARE.
|
|
|
|
|
2019-09-02 11:16:52 +02:00
|
|
|
//! Implementation of the [Identify] protocol.
|
2017-12-13 12:08:40 +01:00
|
|
|
//!
|
2019-09-02 11:16:52 +02:00
|
|
|
//! This implementation of the protocol periodically exchanges
|
|
|
|
//! [`IdentifyInfo`] messages between the peers on an established connection.
|
2018-03-07 10:49:11 +01:00
|
|
|
//!
|
2019-09-02 11:16:52 +02:00
|
|
|
//! At least one identification request is sent on a newly established
|
|
|
|
//! connection, beyond which the behaviour does not keep connections alive.
|
2018-03-07 10:49:11 +01:00
|
|
|
//!
|
2019-09-02 11:16:52 +02:00
|
|
|
//! # Usage
|
2018-03-07 10:49:11 +01:00
|
|
|
//!
|
2019-09-02 11:16:52 +02:00
|
|
|
//! The [`Identify`] struct implements a `NetworkBehaviour` that negotiates
|
|
|
|
//! and executes the protocol on every established connection, emitting
|
|
|
|
//! [`IdentifyEvent`]s.
|
2018-03-07 10:49:11 +01:00
|
|
|
//!
|
2019-09-02 11:16:52 +02:00
|
|
|
//! [Identify]: https://github.com/libp2p/specs/tree/master/identify
|
|
|
|
//! [`Identify`]: self::Identify
|
|
|
|
//! [`IdentifyEvent`]: self::IdentifyEvent
|
|
|
|
//! [`IdentifyInfo`]: self::IdentifyEvent
|
2017-12-13 12:08:40 +01:00
|
|
|
|
2018-12-07 10:23:38 +01:00
|
|
|
pub use self::identify::{Identify, IdentifyEvent};
|
2019-01-22 17:42:15 +01:00
|
|
|
pub use self::protocol::IdentifyInfo;
|
2018-12-05 17:04:25 +01:00
|
|
|
|
2019-09-02 11:16:52 +02:00
|
|
|
mod handler;
|
2018-12-07 10:23:38 +01:00
|
|
|
mod identify;
|
2019-09-02 11:16:52 +02:00
|
|
|
mod protocol;
|
2017-12-13 12:08:40 +01:00
|
|
|
mod structs_proto;
|