Skip to main content

ripestat_common/resources/
asn_neighbours.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
4pub struct AsnNeighboursRequest {
5    pub resource: String,
6    pub query_time: Option<String>,
7    pub lod: Option<i64>,
8}
9// TODO: lod enum
10// 0, 1
11
12#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
13pub struct AsnNeighboursResponse {
14    pub resource: String,
15    pub query_starttime: String,
16    pub query_endtime: String,
17    pub latest_time: String,
18    pub earliest_time: String,
19    pub neighbour_counts: NeighbourCounts,
20    pub neighbours: Vec<Neighbour>,
21}
22
23#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
24pub struct NeighbourCounts {
25    pub left: i64,
26    pub right: i64,
27    pub unique: i64,
28    pub uncertain: i64,
29}
30
31#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
32pub struct Neighbour {
33    pub asn: i64,
34    #[serde(rename = "type")]
35    pub type_field: String,
36    pub power: i64,
37    pub v4_peers: i64,
38    pub v6_peers: i64,
39}