avalanche_types/message/
mod.rs1pub mod accepted;
3pub mod accepted_frontier;
4pub mod accepted_state_summary;
5pub mod ancestors;
6pub mod app_gossip;
7pub mod app_request;
8pub mod app_response;
9pub mod chits;
10pub mod compress;
11pub mod get;
12pub mod get_accepted;
13pub mod get_accepted_frontier;
14pub mod get_accepted_state_summary;
15pub mod get_ancestors;
16pub mod get_state_summary_frontier;
17pub mod peerlist;
18pub mod ping;
19pub mod pong;
20pub mod pull_query;
21pub mod push_query;
22pub mod put;
23pub mod state_summary_frontier;
24
25pub fn ip_addr_to_bytes(ip_addr: std::net::IpAddr) -> Vec<u8> {
26 match ip_addr {
27 std::net::IpAddr::V4(v) => {
28 let octets = v.octets();
31 vec![
32 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, octets[0], octets[1], octets[2], octets[3],
33 ]
34 }
35 std::net::IpAddr::V6(v) => v.octets().to_vec(),
36 }
37}