Skip to content

Commit be3c02a

Browse files
committed
make OPTE public (#128)
1 parent 5321d89 commit be3c02a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+777
-0
lines changed

CONTRIBUTING.adoc

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
== OPTE status and open source
2+
3+
The OPTE repo is public because:
4+
5+
1. It has always been our intention to make this open-source.
6+
7+
2. We figured it's best to err on the side of doing this early instead
8+
of late.
9+
10+
However, OPTE is not finished, or even ready.
11+
12+
And so, we thought it was important to explain where we're currently
13+
at, and manage your expectations.
14+
15+
- We are a small company.
16+
17+
- Our current goal is to get our first generation products finished
18+
and in customers' hands.
19+
20+
- We're writing OPTE in support of that goal, not as its own thing.
21+
We're all working on the products, and tool development is a side
22+
effect. That said, OPTE will be more generally useful if you are
23+
looking for a packet transformation engine to implement network
24+
functions in an illumos-based environment; it's just the current
25+
focus is solely on supporting Oxide and the Oxide Rack.
26+
27+
- OPTE may have dependencies on other Oxide repositories, which
28+
themselves may be undergoing similar churn.
29+
30+
- These points together mean that we may not have enough bandwidth to
31+
review and integrate outside PRs right now. We hope this will change
32+
in the future.
33+
34+
You're welcome to send PRs, but we want to set expectations right: if
35+
we have time, or if the PRs are very small or fix bugs, we may
36+
integrate them in the near future. But we might also not get to any PR
37+
for a while, by which time it might no longer be relevant. Also keep
38+
in mind that some aspects of the code which have obvious flaws or
39+
TODOs may already be scheduled for change, but there are other more
40+
pressing matters to attend to first. If you feel compelled to write a
41+
PR, it would be best to first reach out before starting any work in
42+
earnest, as there may already been planned changes that would obsolete
43+
such work.
44+
45+
We've all dealt with those open source projects that feel open in name
46+
only, and have big patches and history-free source drops appearing
47+
from behind the walls of some large organization. We don't like that,
48+
and we're not going to do that. But it will take some time for us to
49+
scale up -- please bear with us.
50+
51+
Thanks!

LICENSE

+373
Large diffs are not rendered by default.

README.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
= Oxide Packet Transformation Engine
22

3+
== Contributing
4+
5+
Please see the xref:CONTRIBUTING.adoc[CONTRIBUTING] doc if you are
6+
interested in contributing to the project.
7+
38
== Relevant RFDs and Inspiration
49

510
* https://rfd.shared.oxide.computer/rfd/0009[RFD 9: Networking Considerations]

illumos-ddi-dki/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
// This is a "sys" (raw interface) crate for the illumos DDI/DKI
28
// interfaces. It contains definitions of C macros, opaque types, 9F
39
// prototypes, and 9S structures which are required for proper use of

illumos-sys-hdrs/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
#![allow(non_camel_case_types)]
28
#![no_std]
39

opte-drv/src/ioctl.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use alloc::string::String;
28
use alloc::vec::Vec;
39
use core::fmt::Debug;

opte-drv/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
//! OPTE - Oxide Packet Transformation Engine
28
//!
39
//! This driver is used as a way to interface the OPTE implementation

opte-ioctl/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use opte::api::{
28
CmdOk, MacAddr, NoResp, OpteCmd, OpteCmdIoctl, OpteError,
39
SetXdeUnderlayReq, Vni, API_VERSION, XDE_DLD_OPTE_CMD,

opte/src/api/cmd.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use super::API_VERSION;
28
use illumos_sys_hdrs::{c_int, size_t};
39
use serde::{Deserialize, Serialize};

opte/src/api/encap.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::fmt::{self, Display};
28

39
use serde::{Deserialize, Serialize};

opte/src/api/ip.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use super::mac::MacAddr;
28
use core::fmt::{self, Debug, Display};
39
use core::result;

opte/src/api/mac.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::fmt::{self, Display};
28
use serde::{Deserialize, Serialize};
39

opte/src/api/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
pub mod cmd;
28
pub mod encap;
39
pub mod ip;

opte/src/api/ulp.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
/// Port 0 is reserved by the sockets layer. It is used by clients to
28
/// indicate they want the operating system to choose a port on their
39
/// behalf.

opte/src/engine/arp.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
/// Address Resolution Protocol
28
///
39
/// Relevant Docs

opte/src/engine/checksum.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
pub struct HeaderChecksum {
28
inner: [u8; 2],
39
}

opte/src/engine/dhcp.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::fmt::{self, Display};
28

39
cfg_if! {

opte/src/engine/ether.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::convert::TryFrom;
28
use core::fmt::{self, Debug, Display};
39
use core::mem;

opte/src/engine/flow_table.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::fmt;
28

39
cfg_if! {

opte/src/engine/geneve.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::convert::TryFrom;
28
use core::mem;
39

opte/src/engine/headers.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::fmt;
28

39
cfg_if! {

opte/src/engine/icmp.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
//! ICMP headers.
28
use core::fmt::{self, Display};
39

opte/src/engine/int_test.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
//! Integration tests.
28
//!
39
//! The idea behind these tests is to use actual packet captures to

opte/src/engine/ioctl.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
//! The ioctl interface.
28
use core::fmt::Debug;
39

opte/src/engine/ip4.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::convert::TryFrom;
28
use core::fmt::{self, Debug, Display};
39
use core::mem;

opte/src/engine/ip6.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::convert::TryFrom;
28
use core::fmt;
39
use core::mem::size_of;

opte/src/engine/layer.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::fmt::{self, Display};
28
use core::mem;
39
use core::result;

opte/src/engine/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
//! The engine in OPTE.
28
//!
39
//! All code under this namespace is guarded by the `engine` feature flag.

opte/src/engine/nat.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::fmt;
28
use core::ops::Range;
39

opte/src/engine/packet.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
//! Types for creating, reading, and writing network packets.
28
//!
39
//! TODO

opte/src/engine/port.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
/// A virtual switch port.
28
use core::result;
39

opte/src/engine/rule.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::fmt::{self, Display};
28

39
cfg_if! {

opte/src/engine/sync.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
//! Safe abstractions for synchronization primitives.
28
//!
39
//! TODO: This should be in its own crate, wrapping the illumos-ddi-dki

opte/src/engine/tcp.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::convert::TryFrom;
28
use core::fmt::{self, Display};
39
use core::mem;

opte/src/engine/tcp_state.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
use core::fmt::{self, Display};
28

39
cfg_if! {

opte/src/engine/time.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
// Copyright 2022 Oxide Computer Company
6+
17
//! Moments, periodics, etc.
28
use core::ops::Add;
39
use core::time::Duration;

0 commit comments

Comments
 (0)