Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Stargateur committed Mar 26, 2024
1 parent 7424e65 commit 5c110fb
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 100 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Continuous integration

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: check
args: --all-features

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --all-features

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D -warnings
14 changes: 3 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "binator_network"
authors = ["Stargateur"]
version = "0.0.0"
version = "0.0.1"
description = "binator network"
license = "Zlib"
repository = "https://github.com/binator/network"
Expand All @@ -19,11 +19,7 @@ include = [
]

[dependencies]
binator_core = "0.0.2"
binator_utils = "0.0.0"
binator_base = "0.0.0"
binator_context = "0.0.0"
binator_number = "0.0.0"
binator = "0.3.0"
serde = { version = "1.0", optional = true, features = ["derive"] }
const_format = { version = "0.2", features = ["const_generics"] }
paste = "1"
Expand All @@ -37,11 +33,7 @@ pretty_assertions = "1"
derive-new = "0.5"
derive_more = "0.99"

binator_core = { version = "0.0.2", features = ["tracing"]}
binator_utils = { version = "0.0.0", features = ["tracing"]}
binator_base = { version = "0.0.0", features = ["tracing"]}
binator_context = { version = "0.0.0", features = ["tracing"]}
binator_number = { version = "0.0.0", features = ["tracing"]}
binator = { version = "0.3.0", features = ["tracing"]}

tracing = "0.1"
tracing-subscriber = {version = "0.3", features = ["env-filter", "fmt"]}
Expand Down
18 changes: 10 additions & 8 deletions src/ether_type.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use binator_base::octet;
use binator_core::{
use binator::{
base::octet,
utils::{
Utils,
UtilsAtom,
},
Contexting,
CoreAtom,
Parse,
Parsed,
Streaming,
};
use binator_utils::{
Utils,
UtilsAtom,
};

use crate::struct_variants;

Expand Down Expand Up @@ -128,8 +128,10 @@ where

#[cfg(test)]
mod tests {
use binator_context::Ignore;
use binator_core::Parsed;
use binator::{
context::Ignore,
Parsed,
};

use super::EtherType;

Expand Down
18 changes: 10 additions & 8 deletions src/ethernet.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//! Handles parsing of Ethernet headers
use binator_base::octet;
use binator_core::{
use binator::{
base::octet,
utils::{
Utils,
UtilsAtom,
},
Contexting,
CoreAtom,
Parse,
Parsed,
Streaming,
Success,
};
use binator_utils::{
Utils,
UtilsAtom,
};

use crate::ether_type::{
ether_type,
Expand Down Expand Up @@ -94,8 +94,10 @@ where

#[cfg(test)]
mod tests {
use binator_context::Ignore;
use binator_core::Parsed;
use binator::{
context::Ignore,
Parsed,
};

use super::{
EtherType,
Expand Down
31 changes: 24 additions & 7 deletions src/ip_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,25 @@ use std::net::{
Ipv6Addr,
};

use binator_base::*;
use binator_core::*;
use binator_number::*;
use binator_utils::*;
use binator::{
base::{
is,
to_digit,
uint_radix,
BaseAtom,
IntRadixAtom,
Radix,
},
utils::{
Utils,
UtilsAtom,
},
Contexting,
CoreAtom,
Parse,
Parsed,
Streaming,
};

/// Atom of ip_addr parser
#[derive(Debug, Clone, PartialEq, Eq)]
Expand Down Expand Up @@ -453,9 +468,11 @@ mod tests {
str::FromStr,
};

use binator_base::*;
use binator_context::Tree;
use binator_core::*;
use binator::{
base::*,
context::Tree,
*,
};
use derive_more::{
Display,
From,
Expand Down
12 changes: 7 additions & 5 deletions src/ip_protocol.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//! Handles parsing of Internet Protocol fields (shared between ipv4 and ipv6)
use binator_base::octet;
use binator_core::{
use binator::{
base::octet,
utils::Utils,
Contexting,
CoreAtom,
Parse,
Parsed,
Streaming,
};
use binator_utils::Utils;

use crate::struct_variants;

Expand Down Expand Up @@ -313,8 +313,10 @@ where

#[cfg(test)]
mod tests {
use binator_context::Ignore;
use binator_core::Parsed;
use binator::{
context::Ignore,
Parsed,
};

use super::IPProtocol;

Expand Down
30 changes: 16 additions & 14 deletions src/ipv4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ use std::{
net::Ipv4Addr,
};

use binator_base::{
any,
nbit,
octet,
NBit,
};
use binator_core::{
Acc,
use binator::{
base::{
any,
nbit,
octet,
NBit,
},
utils::{
Acc,
Utils,
UtilsAtom,
},
Contexting,
CoreAtom,
Parse,
Parsed,
Streaming,
Success,
};
use binator_utils::{
Utils,
UtilsAtom,
};

use crate::ip_protocol::{
self,
Expand Down Expand Up @@ -274,8 +274,10 @@ where
mod tests {
use std::net::Ipv4Addr;

use binator_context::Ignore;
use binator_core::Parsed;
use binator::{
context::Ignore,
Parsed,
};

use super::{
IPProtocol,
Expand Down
26 changes: 14 additions & 12 deletions src/ipv6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ use std::{
net::Ipv6Addr,
};

use binator_base::{
nbit,
octet,
NBit,
};
use binator_core::{
use binator::{
base::{
nbit,
octet,
NBit,
},
utils::{
Utils,
UtilsAtom,
},
Contexting,
CoreAtom,
Parse,
Parsed,
Streaming,
Success,
};
use binator_utils::{
Utils,
UtilsAtom,
};

use crate::ip_protocol::{
self,
Expand Down Expand Up @@ -178,8 +178,10 @@ where
mod tests {
use std::net::Ipv6Addr;

use binator_context::Ignore;
use binator_core::Parsed;
use binator::{
context::Ignore,
Parsed,
};
use pretty_assertions::assert_eq;

use super::{
Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,19 @@ pub(crate) use struct_variants;
mod tests {
use core::fmt::Debug;

use binator_base::{
all,
BaseAtom,
};
use binator_context::Tree;
use binator_core::{
use binator::{
base::{
all,
BaseAtom,
IntRadixAtom,
},
context::Tree,
utils::UtilsAtom,
CoreAtom,
Parse,
Streaming,
Success,
};
use binator_number::IntRadixAtom;
use binator_utils::UtilsAtom;
use derive_more::{
Display,
From,
Expand Down
Loading

0 comments on commit 5c110fb

Please sign in to comment.