libp2p_dcutr/lib.rs
1// Copyright 2021 Protocol Labs.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and associated documentation files (the "Software"),
5// to deal in the Software without restriction, including without limitation
6// the rights to use, copy, modify, merge, publish, distribute, sublicense,
7// and/or sell copies of the Software, and to permit persons to whom the
8// Software is furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19// DEALINGS IN THE SOFTWARE.
20
21//! Implementation of the [libp2p Direct Connection Upgrade through Relay
22//! specification](https://github.com/libp2p/specs/blob/master/relay/DCUtR.md).
23
24#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
25
26mod behaviour;
27mod handler;
28mod protocol;
29
30mod proto {
31 #![allow(unreachable_pub)]
32 include!("generated/mod.rs");
33 pub(crate) use self::holepunch::pb::{mod_HolePunch::*, HolePunch};
34}
35
36pub use behaviour::{Behaviour, Error, Event};
37pub use protocol::PROTOCOL_NAME;
38pub mod inbound {
39 pub use crate::protocol::inbound::ProtocolViolation;
40}
41pub mod outbound {
42 pub use crate::protocol::outbound::ProtocolViolation;
43}