Skip to content

Commit

Permalink
Merge pull request #35 from terassyi/fix-conflict
Browse files Browse the repository at this point in the history
fix conflict
  • Loading branch information
terassyi authored May 19, 2023
2 parents 6501de7 + 1c6c7f0 commit cec4ce5
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 8 deletions.
4 changes: 0 additions & 4 deletions sart/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions sartd/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 126 additions & 0 deletions sartd/src/proto/sart.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ pub mod get_neighbor_path_request {
Kind::Out => "OUT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"IN" => Some(Self::In),
"OUT" => Some(Self::Out),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -189,6 +198,15 @@ pub mod address_family {
Afi::Ip6 => "AFI_IP6",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"AFI_UNKNOWN" => Some(Self::Unknown),
"AFI_IP4" => Some(Self::Ip4),
"AFI_IP6" => Some(Self::Ip6),
_ => None,
}
}
}
#[derive(
Clone,
Expand Down Expand Up @@ -219,6 +237,15 @@ pub mod address_family {
Safi::Multicast => "SAFI_MULTICAST",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SAFI_UNKNOWN" => Some(Self::Unknown),
"SAFI_UNICAST" => Some(Self::Unicast),
"SAFI_MULTICAST" => Some(Self::Multicast),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -286,6 +313,19 @@ pub mod peer {
State::Established => "ESTABLISHED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"IDLE" => Some(Self::Idle),
"CONNECT" => Some(Self::Connect),
"ACTIVE" => Some(Self::Active),
"OPEN_SENT" => Some(Self::OpenSent),
"OPEN_CONFIRM" => Some(Self::OpenConfirm),
"ESTABLISHED" => Some(Self::Established),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -359,6 +399,15 @@ pub mod as_segment {
Type::AsSequence => "AS_SEQUENCE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"AS_SET" => Some(Self::AsSet),
"AS_SEQUENCE" => Some(Self::AsSequence),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -1510,6 +1559,19 @@ pub mod next_hop {
NextHopFlags::Unresolved => "UNRESOLVED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EMPTY" => Some(Self::Empty),
"DEAD" => Some(Self::Dead),
"PERVASIVE" => Some(Self::Pervasive),
"ONLINK" => Some(Self::Onlink),
"OFFLOAD" => Some(Self::Offload),
"LINKDOWN" => Some(Self::Linkdown),
"UNRESOLVED" => Some(Self::Unresolved),
_ => None,
}
}
}
}
/// message
Expand All @@ -1532,6 +1594,15 @@ impl IpVersion {
IpVersion::V6 => "V6",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Unkown" => Some(Self::Unkown),
"V4" => Some(Self::V4),
"V6" => Some(Self::V6),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
Expand All @@ -1558,6 +1629,18 @@ impl AdministrativeDistance {
AdministrativeDistance::Adibgp => "ADIBGP",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ADConnected" => Some(Self::AdConnected),
"ADStatic" => Some(Self::AdStatic),
"ADEBGP" => Some(Self::Adebgp),
"ADOSPF" => Some(Self::Adospf),
"ADRIP" => Some(Self::Adrip),
"ADIBGP" => Some(Self::Adibgp),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
Expand Down Expand Up @@ -1590,6 +1673,21 @@ impl Protocol {
Protocol::Rip => "Rip",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Unspec" => Some(Self::Unspec),
"Redirect" => Some(Self::Redirect),
"Kernel" => Some(Self::Kernel),
"Boot" => Some(Self::Boot),
"Static" => Some(Self::Static),
"Bgp" => Some(Self::Bgp),
"IsIs" => Some(Self::IsIs),
"Ospf" => Some(Self::Ospf),
"Rip" => Some(Self::Rip),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
Expand Down Expand Up @@ -1626,6 +1724,23 @@ impl Type {
Type::Nat => "Nat",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UnspecType" => Some(Self::UnspecType),
"Unicast" => Some(Self::Unicast),
"Local" => Some(Self::Local),
"Broadcast" => Some(Self::Broadcast),
"Anycast" => Some(Self::Anycast),
"Multicast" => Some(Self::Multicast),
"Blackhole" => Some(Self::Blackhole),
"Unreachable" => Some(Self::Unreachable),
"Prohibit" => Some(Self::Prohibit),
"Throw" => Some(Self::Throw),
"Nat" => Some(Self::Nat),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
Expand All @@ -1650,6 +1765,17 @@ impl Scope {
Scope::Nowhere => "Nowhere",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Universe" => Some(Self::Universe),
"Site" => Some(Self::Site),
"Link" => Some(Self::Link),
"Host" => Some(Self::Host),
"Nowhere" => Some(Self::Nowhere),
_ => None,
}
}
}
/// Generated client implementations.
pub mod fib_api_client {
Expand Down

0 comments on commit cec4ce5

Please sign in to comment.