Skip to content

Commit

Permalink
fix some typos, update example IPs to 400:/7 subnet
Browse files Browse the repository at this point in the history
  • Loading branch information
flokli committed Feb 26, 2024
1 parent 1940a41 commit f1b785c
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions docs/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ paths:
operationId: getPeers
responses:
'200':
description: Succes
description: Success
content:
application/json:
schema:
Expand All @@ -64,7 +64,7 @@ paths:
operationId: getSelectedRoutes
responses:
'200':
description: Succes
description: Success
content:
application/json:
schema:
Expand All @@ -84,7 +84,7 @@ paths:
operationId: getSelectedRoutes
responses:
'200':
description: Succes
description: Success
content:
application/json:
schema:
Expand Down Expand Up @@ -348,7 +348,7 @@ components:
description: Sender overlay IP address
type: string
format: ipv6
example: 249:abcd:0123:defa::1
example: 449:abcd:0123:defa::1
srcPk:
description: Sender public key, hex encoded
type: string
Expand Down Expand Up @@ -408,7 +408,7 @@ components:
ip:
description: The target IP of the message
format: ipv6
example: 249:abcd:0123:defa::1
example: 449:abcd:0123:defa::1
- description: The hex encoded public key of the receiver node
type: object
properties:
Expand All @@ -432,14 +432,14 @@ components:
example: 0123456789abcdef

MessageStatusResponse:
description: Information about an outobund message
description: Information about an outbound message
type: object
properties:
dst:
description: Ip address of the receiving node
description: IP address of the receiving node
type: string
format: ipv6
example: 249:abcd:0123:defa::1
example: 449:abcd:0123:defa::1
state:
$ref: '#/components/schemas/TransmissionState'
created:
Expand Down
2 changes: 1 addition & 1 deletion src/babel/ihu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::metric::Metric;

use super::{AE_IPV4, AE_IPV6, AE_IPV6_LL, AE_WILDCARD};

/// Base wire size of an [`Ihu`] without variable lenght address encoding.
/// Base wire size of an [`Ihu`] without variable length address encoding.
const IHU_BASE_WIRE_SIZE: u8 = 6;

/// IHU TLV body as defined in https://datatracker.ietf.org/doc/html/rfc8966#name-ihu.
Expand Down
2 changes: 1 addition & 1 deletion src/babel/route_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::subnet::Subnet;

use super::{AE_IPV4, AE_IPV6, AE_IPV6_LL, AE_WILDCARD};

/// Base wire size of a [`RouteRequest`] without variable lenght address encoding.
/// Base wire size of a [`RouteRequest`] without variable length address encoding.
const ROUTE_REQUEST_BASE_WIRE_SIZE: u8 = 2;

/// Seqno request TLV body as defined in https://datatracker.ietf.org/doc/html/rfc8966#name-route-request
Expand Down
2 changes: 1 addition & 1 deletion src/babel/seqno_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use super::{AE_IPV4, AE_IPV6, AE_IPV6_LL, AE_WILDCARD};
// SAFETY: value is not zero.
const DEFAULT_HOP_COUNT: NonZeroU8 = unsafe { NonZeroU8::new_unchecked(64) };

/// Base wire size of a [`SeqNoRequest`] without variable lenght address encoding.
/// Base wire size of a [`SeqNoRequest`] without variable length address encoding.
const SEQNO_REQUEST_BASE_WIRE_SIZE: u8 = 6 + RouterId::BYTE_SIZE as u8;

/// Seqno request TLV body as defined in https://datatracker.ietf.org/doc/html/rfc8966#name-seqno-request
Expand Down
2 changes: 1 addition & 1 deletion src/babel/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const UPDATE_FLAG_ROUTER_ID: u8 = 0x40;
/// Mask to apply to [`Update`] flags, leaving only valid flags.
const FLAG_MASK: u8 = 0b1100_0000;

/// Base wire size of an [`Update`] without variable lenght address encoding.
/// Base wire size of an [`Update`] without variable length address encoding.
const UPDATE_BASE_WIRE_SIZE: u8 = 10 + RouterId::BYTE_SIZE as u8;

/// Update TLV body as defined in https://datatracker.ietf.org/doc/html/rfc8966#name-update.
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod tun;

/// The prefix of the global subnet used.
pub const GLOBAL_SUBNET_ADDRESS: IpAddr = IpAddr::V6(Ipv6Addr::new(0x400, 0, 0, 0, 0, 0, 0, 0));
/// The prefix lenght of the global subnet used.
/// The prefix length of the global subnet used.
pub const GLOBAL_SUBNET_PREFIX_LEN: u8 = 7;

/// Config for a mycelium [`Stack`].
Expand Down Expand Up @@ -129,10 +129,10 @@ impl Stack {
let msg_sender = tokio_util::sync::PollSender::new(tx);

let data_plane = if config.no_tun {
warn!("Starting data plane witout TUN interface, L3 functionality disabled");
warn!("Starting data plane without TUN interface, L3 functionality disabled");
DataPlane::new(
router.clone(),
// No tun so create a dummy stream for l3 packets which never yields
// No tun so create a dummy stream for L3 packets which never yields
tokio_stream::pending(),
// Similarly, create a sink which just discards every packet we would receive
futures::sink::drain(),
Expand Down
4 changes: 2 additions & 2 deletions src/subnet.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! A dedicated subnet module.
//!
//! The standard library only exposes [`IpAddr`], and types related to
//! specific IPv4 and IPv6 addresses. It does not however, expose dedicated types to represents
//! specific IPv4 and IPv6 addresses. It does not however, expose dedicated types to represent
//! appropriate subnets.
//!
//! This code is not meant to fully support subnets, but rather only the subset as needed by the
Expand All @@ -21,7 +21,7 @@ pub struct Subnet {

/// An error returned when creating a new [`Subnet`] with an invalid prefix length.
///
/// For IPv4, the max prefix lenght is 32, and for IPv6 it is 128;
/// For IPv4, the max prefix length is 32, and for IPv6 it is 128;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct PrefixLenError;

Expand Down
2 changes: 1 addition & 1 deletion src/tun/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub async fn new(
),
Box<dyn std::error::Error>,
> {
// SAFETY: for now we assume a valid wintun.dll file exists in tehe root directory when we are
// SAFETY: for now we assume a valid wintun.dll file exists in the root directory when we are
// running this.
let wintun = unsafe { wintun::load() }?;
let wintun_version = match wintun::get_running_driver_version(&wintun) {
Expand Down

0 comments on commit f1b785c

Please sign in to comment.