cs_epic_p2p/
lib.rs

1// Copyright 2019 The Grin Developers
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Networking code to connect to other peers and exchange block, transactions,
16//! etc.
17
18#![deny(non_upper_case_globals)]
19#![deny(non_camel_case_types)]
20#![deny(non_snake_case)]
21#![deny(unused_mut)]
22
23#[macro_use]
24extern crate bitflags;
25
26#[macro_use]
27extern crate enum_primitive;
28
29#[macro_use]
30extern crate epic_core as core;
31use epic_chain as chain;
32use epic_util as util;
33
34#[macro_use]
35extern crate serde_derive;
36#[macro_use]
37extern crate log;
38
39mod conn;
40pub mod handshake;
41pub mod msg;
42mod peer;
43mod peers;
44mod protocol;
45mod serv;
46mod store;
47pub mod types;
48
49pub use crate::conn::SEND_CHANNEL_CAP;
50pub use crate::peer::Peer;
51pub use crate::peers::Peers;
52pub use crate::serv::{DummyAdapter, Server};
53pub use crate::store::{PeerData, State};
54pub use crate::types::{
55	Capabilities, ChainAdapter, Direction, Error, P2PConfig, PeerAddr, PeerInfo, ReasonForBan,
56	Seeding, TxHashSetRead, MAX_BLOCK_HEADERS, MAX_LOCATORS, MAX_PEER_ADDRS,
57};