Cleanup
This commit is contained in:
parent
70a3ddb8b0
commit
83ac8127c9
63
.github/workflows/docs.yml
vendored
63
.github/workflows/docs.yml
vendored
@ -1,63 +0,0 @@
|
|||||||
name: Documentation
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- ".github/workflows/docs.yml"
|
|
||||||
- "libs/**/README.md"
|
|
||||||
- "docs/book/**"
|
|
||||||
- "**/src/*"
|
|
||||||
- "book.toml"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build Docs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup mdBook
|
|
||||||
uses: peaceiris/actions-mdbook@v1
|
|
||||||
with:
|
|
||||||
mdbook-version: "latest"
|
|
||||||
|
|
||||||
- name: Build Book
|
|
||||||
run: mdbook build
|
|
||||||
|
|
||||||
- name: Build rustdoc
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: doc
|
|
||||||
args: --no-deps --workspace --document-private-items
|
|
||||||
|
|
||||||
- name: Combine Book and rustdoc
|
|
||||||
run: mkdir -p /tmp/combined && cp -rv target/book/ /tmp/combined/book && cp -rv target/doc/ /tmp/combined/rustdoc-master
|
|
||||||
|
|
||||||
- name: Write CNAME file
|
|
||||||
run: echo "docs.protomask.ewpratten.com" > /tmp/combined/CNAME
|
|
||||||
|
|
||||||
- name: Fix permissions
|
|
||||||
run: |
|
|
||||||
chmod -c -R +rX "/tmp/combined/" | while read line; do
|
|
||||||
echo "::warning title=Invalid file permissions automatically fixed::$line"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-pages-artifact@v2
|
|
||||||
with:
|
|
||||||
path: /tmp/combined
|
|
||||||
|
|
||||||
- name: Deploy
|
|
||||||
uses: actions/deploy-pages@v2
|
|
||||||
id: deployment
|
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/ewpratten/reorg2' }}
|
|
10
.vscode/tasks.json
vendored
10
.vscode/tasks.json
vendored
@ -41,16 +41,6 @@
|
|||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"label": "rust: cargo doc"
|
"label": "rust: cargo doc"
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "shell",
|
|
||||||
"command": "zola",
|
|
||||||
"args": [
|
|
||||||
"-r",
|
|
||||||
"docs/website",
|
|
||||||
"serve"
|
|
||||||
],
|
|
||||||
"label": "zola: serve website"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
31
README.md
31
README.md
@ -81,7 +81,7 @@ Then, install with:
|
|||||||
```sh
|
```sh
|
||||||
apt install /path/to/protomask_<version>_<arch>.deb
|
apt install /path/to/protomask_<version>_<arch>.deb
|
||||||
|
|
||||||
# You can also edit the config file in /etc/protomask.toml
|
# You can also edit the config file in /etc/protomask.json
|
||||||
# And once ready, start protomask with
|
# And once ready, start protomask with
|
||||||
systemctl start protomask
|
systemctl start protomask
|
||||||
```
|
```
|
||||||
@ -91,3 +91,32 @@ systemctl start protomask
|
|||||||
```bash
|
```bash
|
||||||
cargo install protomask
|
cargo install protomask
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
The `protomask` and `protomask-clat` binaries are mostly self-sufficient.
|
||||||
|
|
||||||
|
### Nat64
|
||||||
|
|
||||||
|
To start up a NAT64 server on the Well-Known Prefix (WKP), run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
protomask --pool-prefix <prefix>
|
||||||
|
```
|
||||||
|
|
||||||
|
Where `<prefix>` is some block of addresses that are routed to the machine running protomask.
|
||||||
|
|
||||||
|
For more information, run `protomask --help`. Configuration may also be supplied via a JSON file. See the [example config](./config/protomask.json) for more information.
|
||||||
|
|
||||||
|
|
||||||
|
### CLAT
|
||||||
|
|
||||||
|
To start up a CLAT server on the Well-Known Prefix (WKP), run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
protomask-clat --customer-prefix <prefix>
|
||||||
|
```
|
||||||
|
|
||||||
|
Where `<prefix>` is some block of addresses that are routed to the machine running protomask. This would generally be the address range of a home network when run on CPE. It may also be an individual client address if run on a client device instead of a router.
|
||||||
|
|
||||||
|
For more information, run `protomask-clat --help`. Configuration may also be supplied via a JSON file. See the [example config](./config/protomask-clat.json) for more information.
|
||||||
|
24
book.toml
24
book.toml
@ -1,24 +0,0 @@
|
|||||||
[book]
|
|
||||||
authors = ["Evan Pratten"]
|
|
||||||
language = "en"
|
|
||||||
multilingual = false
|
|
||||||
src = "docs/book"
|
|
||||||
title = "Protomask Documentation"
|
|
||||||
|
|
||||||
[rust]
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
[build]
|
|
||||||
build-dir = "target/book"
|
|
||||||
create-missing = true
|
|
||||||
|
|
||||||
[output.html]
|
|
||||||
mathjax-support = true
|
|
||||||
git-repository-url = "https://github.com/ewpratten/protomask"
|
|
||||||
site-url = "/book/"
|
|
||||||
additional-js = ["docs/book/mermaid/mermaid.min.js", "docs/book/mermaid/mermaid-init.js"]
|
|
||||||
|
|
||||||
[preprocessor]
|
|
||||||
|
|
||||||
[preprocessor.mermaid]
|
|
||||||
command = "mdbook-mermaid"
|
|
@ -1,11 +0,0 @@
|
|||||||
# Summary
|
|
||||||
|
|
||||||
# Getting Started
|
|
||||||
|
|
||||||
- [What is NAT64?](./learning/nat64.md)
|
|
||||||
|
|
||||||
# User Guides
|
|
||||||
|
|
||||||
- [Using `protomask`](./binaries/protomask.md)
|
|
||||||
- [Using `protomask-clat`](./binaries/protomask-clat.md)
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
# `protomask-clat` User Guide
|
|
@ -1,3 +0,0 @@
|
|||||||
# `protomask` User Guide
|
|
||||||
|
|
||||||
The `protomask` binary is a NAT64 implementation.
|
|
@ -1,23 +0,0 @@
|
|||||||
# What is NAT64?
|
|
||||||
|
|
||||||
IPv4 and IPv6 are two different versions of the Internet Protocol that, while being similar in many ways, are not directly compatible (largely due to their differing header structure).
|
|
||||||
|
|
||||||
|
|
||||||
## Addressing
|
|
||||||
|
|
||||||
IPv4 addresses are 32-bit numbers (represented as `xxx.xxx.xxx.xxx`), while IPv6 addresses are 128-bit numbers (represented as `xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx`).
|
|
||||||
|
|
||||||
When an IPv4 packet is sent from one host to another, the sender embeds both the sending and receiving address into the packet header (just like a destination and return address on physical mail). This means that a packet traveling from `192.0.2.1` to `192.0.2.2` would be marked as such in the packet header:
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
graph LR
|
|
||||||
HostA((Host A)) -->|src: 192.0.2.1\ndst: 192.0.2.2| HostB((Host B))
|
|
||||||
```
|
|
||||||
|
|
||||||
And a response to that packet would be marked with the opposite addresses:
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
graph RL
|
|
||||||
HostB((Host B)) -->|src: 192.0.2.2\ndst: 192.0.2.1| HostA((Host A))
|
|
||||||
```
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
mermaid.initialize({startOnLoad:true});
|
|
1282
docs/book/mermaid/mermaid.min.js
vendored
1282
docs/book/mermaid/mermaid.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,3 +0,0 @@
|
|||||||
/ https://github.com/ewpratten/protomask 302
|
|
||||||
/book https://docs.protomask.ewpratten.com/book
|
|
||||||
/rustdoc https://docs.protomask.ewpratten.com/rustdoc-master
|
|
@ -14,13 +14,13 @@ use std::net::{Ipv4Addr, Ipv6Addr};
|
|||||||
///
|
///
|
||||||
/// // An IPv4 address can be extracted from an IPv6 prefix of acceptable length
|
/// // An IPv4 address can be extracted from an IPv6 prefix of acceptable length
|
||||||
/// assert_eq!(
|
/// assert_eq!(
|
||||||
/// extract_ipv4_addr_unchecked("64:ff9b:c000:0201::".parse().unwrap(), 32),
|
/// extract_ipv4_addr("64:ff9b:c000:0201::".parse().unwrap(), 32),
|
||||||
/// Ok("192.0.2.1".parse::<Ipv4Addr>().unwrap())
|
/// Ok("192.0.2.1".parse::<Ipv4Addr>().unwrap())
|
||||||
/// );
|
/// );
|
||||||
///
|
///
|
||||||
/// // Using a prefix that is not an RFC-approved length (in this case 66) will fail
|
/// // Using a prefix that is not an RFC-approved length (in this case 66) will fail
|
||||||
/// assert_eq!(
|
/// assert_eq!(
|
||||||
/// extract_ipv4_addr_unchecked("64:ff9b:c000:0201::".parse().unwrap(), 66),
|
/// extract_ipv4_addr("64:ff9b:c000:0201::".parse().unwrap(), 66),
|
||||||
/// Err(rfc6052::Error::InvalidPrefixLength(66))
|
/// Err(rfc6052::Error::InvalidPrefixLength(66))
|
||||||
/// );
|
/// );
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user