将fetch pp cache改成使用vcir结构,跑通apnic全量同步
This commit is contained in:
@@ -5,6 +5,8 @@ use x509_parser::asn1_rs::{Class as Asn1Class, Tag as Asn1Tag};
|
||||
use x509_parser::extensions::ParsedExtension;
|
||||
use x509_parser::prelude::{FromDer, X509Certificate, X509Extension, X509Version};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::data_model::common::{
|
||||
Asn1TimeUtc, InvalidTimeEncodingError, UtcTime, X509NameDer, asn1_time_to_model,
|
||||
};
|
||||
@@ -183,7 +185,7 @@ pub struct AccessDescription {
|
||||
pub access_location: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
|
||||
pub enum Afi {
|
||||
Ipv4,
|
||||
Ipv6,
|
||||
@@ -205,7 +207,7 @@ impl Afi {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct IpResourceSet {
|
||||
pub families: Vec<IpAddressFamily>,
|
||||
}
|
||||
@@ -240,7 +242,7 @@ pub enum IpResourceSetDecodeError {
|
||||
InvalidEncoding,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct IpAddressFamily {
|
||||
pub afi: Afi,
|
||||
pub choice: IpAddressChoice,
|
||||
@@ -261,32 +263,32 @@ impl IpAddressFamily {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum IpAddressChoice {
|
||||
Inherit,
|
||||
AddressesOrRanges(Vec<IpAddressOrRange>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum IpAddressOrRange {
|
||||
Prefix(IpPrefix),
|
||||
Range(IpAddressRange),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct IpAddressRange {
|
||||
pub min: Vec<u8>,
|
||||
pub max: Vec<u8>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
||||
pub struct IpPrefix {
|
||||
pub afi: Afi,
|
||||
pub prefix_len: u16,
|
||||
pub addr: Vec<u8>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AsResourceSet {
|
||||
pub asnum: Option<AsIdentifierChoice>,
|
||||
pub rdi: Option<AsIdentifierChoice>,
|
||||
@@ -330,7 +332,7 @@ pub enum AsResourceSetDecodeError {
|
||||
InvalidEncoding,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum AsIdentifierChoice {
|
||||
Inherit,
|
||||
AsIdsOrRanges(Vec<AsIdOrRange>),
|
||||
@@ -347,7 +349,7 @@ impl AsIdentifierChoice {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum AsIdOrRange {
|
||||
Id(u32),
|
||||
Range { min: u32, max: u32 },
|
||||
|
||||
Reference in New Issue
Block a user