Crate rustbond

Crate rustbond 

Source
Expand description

Rust implementation of the MetalBond route distribution protocol.

MetalBond distributes virtual network routes across hypervisors over TCP/IPv6.

§Quick Start

§Server

let server = MetalBondServer::start("[::]:4711", ServerConfig::default()).await?;
// ... server.shutdown().await?;

§Client

use rustbond::{MetalBondClient, RouteHandler, Route, Vni};

struct MyHandler;
impl RouteHandler for MyHandler {
    fn add_route(&self, vni: Vni, route: Route) { /* handle add */ }
    fn remove_route(&self, vni: Vni, route: Route) { /* handle remove */ }
}

let client = MetalBondClient::connect(&["[::1]:4711"], MyHandler);
client.wait_established().await?;
client.subscribe(Vni(100)).await?;

§Multi-Server (HA)

For high availability, connect to multiple servers simultaneously:

let client = MetalBondClient::connect(&["[::1]:4711", "[::1]:4712"], MyHandler);
client.wait_any_established().await?;
// Routes are deduplicated across servers; ECMP supported

§Features

  • Async client/server with Tokio
  • Automatic reconnection
  • VNI-based subscriptions
  • Multi-server HA with ECMP support
  • Standard, NAT, and LoadBalancer route types

Enable the netlink feature to install routes directly into the Linux kernel:

[dependencies]
rustbond = { version = "0.1", features = ["netlink"] }

Structs§

Destination
Route destination (IP prefix).
LoggingHandler
A logging route handler for debugging.
MetalBondClient
A MetalBond client for connecting to one or more MetalBond servers.
MetalBondServer
A MetalBond server.
NextHop
Next hop for a route.
NoOpHandler
A no-op route handler for testing.
Route
A route consisting of a destination and next hop.
RouteTable
A route table without internal synchronization.
ServerConfig
Server configuration.
ServerId
Unique identifier for each server connection.
ServerState
Shared server state.
Vni
Virtual Network Identifier (VNI).

Enums§

Action
Route update action.
ClientState
Connection state when using multiple servers.
ConnectionState
Connection state.
Error
Errors that can occur in MetalBond operations.
IpVersion
IP version for route destinations.
NextHopType
Next hop type.

Traits§

RouteHandler
Handler trait for receiving route updates.

Type Aliases§

Result
Result type for MetalBond operations.