Browse Source

Renamed btmsg to bttp.

Matthew Carr 1 year ago
parent
commit
43f461f7a9

+ 27 - 27
Cargo.lock

@@ -285,8 +285,8 @@ version = "0.1.0"
 dependencies = [
 dependencies = [
  "anyhow",
  "anyhow",
  "btlib",
  "btlib",
- "btmsg",
  "btserde",
  "btserde",
+ "bttp",
  "bytes",
  "bytes",
  "fuse-backend-rs",
  "fuse-backend-rs",
  "futures",
  "futures",
@@ -323,8 +323,8 @@ dependencies = [
  "btfproto",
  "btfproto",
  "btlib",
  "btlib",
  "btlib-tests",
  "btlib-tests",
- "btmsg",
  "btserde",
  "btserde",
+ "bttp",
  "ctor",
  "ctor",
  "env_logger",
  "env_logger",
  "figment",
  "figment",
@@ -345,8 +345,8 @@ dependencies = [
  "btfproto",
  "btfproto",
  "btfproto-tests",
  "btfproto-tests",
  "btlib",
  "btlib",
- "btmsg",
  "btserde",
  "btserde",
+ "bttp",
  "ctor",
  "ctor",
  "env_logger",
  "env_logger",
  "figment",
  "figment",
@@ -411,29 +411,6 @@ dependencies = [
  "tempdir",
  "tempdir",
 ]
 ]
 
 
-[[package]]
-name = "btmsg"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "btlib",
- "btserde",
- "bytes",
- "chrono",
- "ctor",
- "env_logger",
- "futures",
- "lazy_static",
- "log",
- "quinn",
- "rustls",
- "serde",
- "tokio",
- "tokio-stream",
- "tokio-util",
- "zerocopy",
-]
-
 [[package]]
 [[package]]
 name = "btprovision"
 name = "btprovision"
 version = "0.1.0"
 version = "0.1.0"
@@ -455,8 +432,8 @@ dependencies = [
  "anyhow",
  "anyhow",
  "btlib",
  "btlib",
  "btlib-tests",
  "btlib-tests",
- "btmsg",
  "btserde",
  "btserde",
+ "bttp",
  "bytes",
  "bytes",
  "ctor",
  "ctor",
  "env_logger",
  "env_logger",
@@ -478,6 +455,29 @@ dependencies = [
  "serde-big-array",
  "serde-big-array",
 ]
 ]
 
 
+[[package]]
+name = "bttp"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+ "btlib",
+ "btserde",
+ "bytes",
+ "chrono",
+ "ctor",
+ "env_logger",
+ "futures",
+ "lazy_static",
+ "log",
+ "quinn",
+ "rustls",
+ "serde",
+ "tokio",
+ "tokio-stream",
+ "tokio-util",
+ "zerocopy",
+]
+
 [[package]]
 [[package]]
 name = "bumpalo"
 name = "bumpalo"
 version = "3.11.1"
 version = "3.11.1"

+ 1 - 1
README.md

@@ -26,7 +26,7 @@ by the [tpm](./btlib/crypto/tpm/index.html) module.
 * [btrun](./btrun/index.html): Contains the actor runtime.
 * [btrun](./btrun/index.html): Contains the actor runtime.
 * [btserde](./btserde/index.html): Defines the serde compact binary serialization format used to
 * [btserde](./btserde/index.html): Defines the serde compact binary serialization format used to
 store data on disk and transmit over the network.
 store data on disk and transmit over the network.
-* [btmsg](./btmsg/index.html): Defines the message passing interface.
+* [bttp](./bttp/index.html): Defines the message passing interface.
 * [btfproto](./btfproto/index.html): Defines the message protocol used to communicate with file
 * [btfproto](./btfproto/index.html): Defines the message protocol used to communicate with file
 servers.
 servers.
 * [btfsd](./btfsd/index.html): Implements a file server daemon.
 * [btfsd](./btfsd/index.html): Implements a file server daemon.

+ 1 - 1
crates/btfproto/Cargo.toml

@@ -13,7 +13,7 @@ default = ["client", "server", "local-fs"]
 
 
 [dependencies]
 [dependencies]
 btlib = { path = "../btlib" }
 btlib = { path = "../btlib" }
-btmsg = { path = "../btmsg" }
+bttp = { path = "../bttp" }
 serde = { version = "^1.0.136", features = ["derive"] }
 serde = { version = "^1.0.136", features = ["derive"] }
 paste = "1.0.11"
 paste = "1.0.11"
 log = "0.4.17"
 log = "0.4.17"

+ 1 - 1
crates/btfproto/src/client.rs

@@ -3,7 +3,7 @@
 use crate::{msg::*, server::FsProvider, Handle, Inode};
 use crate::{msg::*, server::FsProvider, Handle, Inode};
 
 
 use btlib::{bterr, crypto::ConcretePub, BlockPath, IssuedProcRec, Result};
 use btlib::{bterr, crypto::ConcretePub, BlockPath, IssuedProcRec, Result};
-use btmsg::{DeserCallback, Transmitter};
+use bttp::{DeserCallback, Transmitter};
 
 
 use core::future::{ready, Future, Ready};
 use core::future::{ready, Future, Ready};
 use futures::FutureExt;
 use futures::FutureExt;

+ 1 - 1
crates/btfproto/src/msg.rs

@@ -5,7 +5,7 @@ use super::{Handle, Inode};
 use btlib::{
 use btlib::{
     bterr, crypto::ConcretePub, BlockMetaSecrets, DirEntry, DirEntryKind, Epoch, IssuedProcRec,
     bterr, crypto::ConcretePub, BlockMetaSecrets, DirEntry, DirEntryKind, Epoch, IssuedProcRec,
 };
 };
-use btmsg::CallMsg;
+use bttp::CallMsg;
 use core::time::Duration;
 use core::time::Duration;
 use paste::paste;
 use paste::paste;
 use serde::{Deserialize, Serialize};
 use serde::{Deserialize, Serialize};

+ 1 - 1
crates/btfproto/src/server.rs

@@ -7,7 +7,7 @@
 use crate::msg::{Read as ReadMsg, *};
 use crate::msg::{Read as ReadMsg, *};
 
 
 use btlib::{crypto::Creds, BlockPath, Result};
 use btlib::{crypto::Creds, BlockPath, Result};
-use btmsg::{MsgCallback, MsgReceived, Receiver};
+use bttp::{MsgCallback, MsgReceived, Receiver};
 use core::future::Future;
 use core::future::Future;
 use std::{net::IpAddr, ops::Deref, sync::Arc};
 use std::{net::IpAddr, ops::Deref, sync::Arc};
 
 

+ 1 - 1
crates/btfsd/Cargo.toml

@@ -7,7 +7,7 @@ edition = "2021"
 
 
 [dependencies]
 [dependencies]
 btlib = { path = "../btlib" }
 btlib = { path = "../btlib" }
-btmsg = { path = "../btmsg" }
+bttp = { path = "../bttp" }
 btfproto = { path = "../btfproto" }
 btfproto = { path = "../btfproto" }
 btconfig = { path = "../btconfig" }
 btconfig = { path = "../btconfig" }
 btconsole = { path = "../btconsole" }
 btconsole = { path = "../btconsole" }

+ 1 - 1
crates/btfsd/autobuild.sh

@@ -1,4 +1,4 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
 # Automatically builds btconsole and btconsole-client when files in their respective crates change.
 # Automatically builds btconsole and btconsole-client when files in their respective crates change.
 set -euo pipefail
 set -euo pipefail
-RUST_LOG=warn,btfsd=debug,btconsole=debug,btmsg=debug cargo watch -- sh -c 'cd ../btconsole-client && trunk build && cd - && cargo run'
+RUST_LOG=warn,btfsd=debug,btconsole=debug,bttp=debug cargo watch -- sh -c 'cd ../btconsole-client && trunk build && cd - && cargo run'

+ 3 - 3
crates/btfsd/src/main.rs

@@ -6,7 +6,7 @@ use btfproto::{
     server::{new_fs_server, FsProvider},
     server::{new_fs_server, FsProvider},
 };
 };
 use btlib::{bterr, crypto::Creds, error::DisplayErr, log::BuilderExt, Result};
 use btlib::{bterr, crypto::Creds, error::DisplayErr, log::BuilderExt, Result};
-use btmsg::Receiver;
+use bttp::Receiver;
 use figment::{providers::Serialized, Figment};
 use figment::{providers::Serialized, Figment};
 use serde::{Deserialize, Serialize};
 use serde::{Deserialize, Serialize};
 use std::{net::IpAddr, path::PathBuf, sync::Arc};
 use std::{net::IpAddr, path::PathBuf, sync::Arc};
@@ -95,7 +95,7 @@ mod tests {
         AuthzAttrs, BlockMetaSecrets, Epoch, IssuedProcRec, Principaled, ProcRec,
         AuthzAttrs, BlockMetaSecrets, Epoch, IssuedProcRec, Principaled, ProcRec,
     };
     };
     use btlib_tests::{CredStoreTestingExt, TpmCredStoreHarness};
     use btlib_tests::{CredStoreTestingExt, TpmCredStoreHarness};
-    use btmsg::BlockAddr;
+    use bttp::BlockAddr;
     use btserde::from_slice;
     use btserde::from_slice;
     use std::net::{IpAddr, Ipv4Addr};
     use std::net::{IpAddr, Ipv4Addr};
     use std::{future::ready, net::Ipv6Addr, time::Duration};
     use std::{future::ready, net::Ipv6Addr, time::Duration};
@@ -896,7 +896,7 @@ mod tests {
         let node_creds = case.harness.cred_store().node_creds().unwrap();
         let node_creds = case.harness.cred_store().node_creds().unwrap();
         let bind_path = node_creds.writecap().unwrap().bind_path();
         let bind_path = node_creds.writecap().unwrap().bind_path();
         let block_addr = Arc::new(BlockAddr::new(LOCALHOST, Arc::new(bind_path)));
         let block_addr = Arc::new(BlockAddr::new(LOCALHOST, Arc::new(bind_path)));
-        let tx = btmsg::Transmitter::new(block_addr, Arc::new(user_creds))
+        let tx = bttp::Transmitter::new(block_addr, Arc::new(user_creds))
             .await
             .await
             .unwrap();
             .unwrap();
         let client = FsClient::new(tx);
         let client = FsClient::new(tx);

+ 1 - 1
crates/btfuse/Cargo.toml

@@ -11,7 +11,7 @@ btlib = { path = "../btlib" }
 btserde = { path = "../btserde" }
 btserde = { path = "../btserde" }
 swtpm-harness = { path = "../swtpm-harness" }
 swtpm-harness = { path = "../swtpm-harness" }
 btfproto = { path = "../btfproto" }
 btfproto = { path = "../btfproto" }
-btmsg = { path = "../btmsg" }
+bttp = { path = "../bttp" }
 btconfig = { path = "../btconfig" }
 btconfig = { path = "../btconfig" }
 tokio = { version = "1.24.2", features = ["rt", "rt-multi-thread"] }
 tokio = { version = "1.24.2", features = ["rt", "rt-multi-thread"] }
 fuse-backend-rs = { version = "0.9.6", features = ["async-io"] }
 fuse-backend-rs = { version = "0.9.6", features = ["async-io"] }

+ 3 - 3
crates/btfuse/src/main.rs

@@ -11,7 +11,7 @@ use btlib::{
     crypto::{Creds, CredsPriv},
     crypto::{Creds, CredsPriv},
     Result,
     Result,
 };
 };
-use btmsg::{BlockAddr, Transmitter};
+use bttp::{BlockAddr, Transmitter};
 use serde::{Deserialize, Serialize};
 use serde::{Deserialize, Serialize};
 use std::{
 use std::{
     fs::{self},
     fs::{self},
@@ -191,7 +191,7 @@ mod test {
         log::BuilderExt,
         log::BuilderExt,
         Epoch, Principaled,
         Epoch, Principaled,
     };
     };
-    use btmsg::Receiver;
+    use bttp::Receiver;
     use ctor::ctor;
     use ctor::ctor;
     use std::{
     use std::{
         ffi::{OsStr, OsString},
         ffi::{OsStr, OsString},
@@ -858,7 +858,7 @@ mod config_tests {
 
 
     use btconfig::CredStoreConfig;
     use btconfig::CredStoreConfig;
     use btlib::BlockPath;
     use btlib::BlockPath;
-    use btmsg::BlockAddr;
+    use bttp::BlockAddr;
     use figment::Jail;
     use figment::Jail;
 
 
     #[test]
     #[test]

+ 1 - 1
crates/btrun/Cargo.toml

@@ -7,7 +7,7 @@ edition = "2021"
 
 
 [dependencies]
 [dependencies]
 btlib = { path = "../btlib" }
 btlib = { path = "../btlib" }
-btmsg = { path = "../btmsg" }
+bttp = { path = "../bttp" }
 btserde = { path = "../btserde" }
 btserde = { path = "../btserde" }
 tokio = { version = "1.23.0", features = ["rt-multi-thread"] }
 tokio = { version = "1.23.0", features = ["rt-multi-thread"] }
 futures = "0.3.25"
 futures = "0.3.25"

+ 5 - 5
crates/btrun/src/lib.rs

@@ -13,7 +13,7 @@ use std::{
 };
 };
 
 
 use btlib::{bterr, crypto::Creds, error::StringError, BlockPath, Result};
 use btlib::{bterr, crypto::Creds, error::StringError, BlockPath, Result};
-use btmsg::{DeserCallback, MsgCallback, Receiver, Replier, Transmitter};
+use bttp::{DeserCallback, MsgCallback, Receiver, Replier, Transmitter};
 use btserde::{field_helpers::smart_ptr, from_slice, to_vec, write_to};
 use btserde::{field_helpers::smart_ptr, from_slice, to_vec, write_to};
 use serde::{de::DeserializeOwned, Deserialize, Serialize};
 use serde::{de::DeserializeOwned, Deserialize, Serialize};
 use tokio::{
 use tokio::{
@@ -385,7 +385,7 @@ impl RuntimeCallback {
 impl MsgCallback for RuntimeCallback {
 impl MsgCallback for RuntimeCallback {
     type Arg<'de> = WireMsg<'de>;
     type Arg<'de> = WireMsg<'de>;
     type CallFut<'de> = impl 'de + Future<Output = Result<()>>;
     type CallFut<'de> = impl 'de + Future<Output = Result<()>>;
-    fn call<'de>(&'de self, arg: btmsg::MsgReceived<Self::Arg<'de>>) -> Self::CallFut<'de> {
+    fn call<'de>(&'de self, arg: bttp::MsgReceived<Self::Arg<'de>>) -> Self::CallFut<'de> {
         async move {
         async move {
             let (_, body, replier) = arg.into_parts();
             let (_, body, replier) = arg.into_parts();
             if body.to.path() == self.rt.path() {
             if body.to.path() == self.rt.path() {
@@ -477,11 +477,11 @@ struct WireMsg<'a> {
     payload: &'a [u8],
     payload: &'a [u8],
 }
 }
 
 
-impl<'a> btmsg::CallMsg<'a> for WireMsg<'a> {
+impl<'a> bttp::CallMsg<'a> for WireMsg<'a> {
     type Reply<'r> = WireReply<'r>;
     type Reply<'r> = WireReply<'r>;
 }
 }
 
 
-impl<'a> btmsg::SendMsg<'a> for WireMsg<'a> {}
+impl<'a> bttp::SendMsg<'a> for WireMsg<'a> {}
 
 
 #[derive(Serialize, Deserialize)]
 #[derive(Serialize, Deserialize)]
 enum WireReply<'a> {
 enum WireReply<'a> {
@@ -656,7 +656,7 @@ mod tests {
         log::BuilderExt,
         log::BuilderExt,
     };
     };
     use btlib_tests::TEST_STORE;
     use btlib_tests::TEST_STORE;
-    use btmsg::BlockAddr;
+    use bttp::BlockAddr;
     use btserde::to_vec;
     use btserde::to_vec;
     use ctor::ctor;
     use ctor::ctor;
     use lazy_static::lazy_static;
     use lazy_static::lazy_static;

+ 1 - 1
crates/btmsg/Cargo.lock → crates/bttp/Cargo.lock

@@ -206,7 +206,7 @@ dependencies = [
 ]
 ]
 
 
 [[package]]
 [[package]]
-name = "btmsg"
+name = "bttp"
 version = "0.1.0"
 version = "0.1.0"
 dependencies = [
 dependencies = [
  "btlib",
  "btlib",

+ 1 - 1
crates/btmsg/Cargo.toml → crates/bttp/Cargo.toml

@@ -1,5 +1,5 @@
 [package]
 [package]
-name = "btmsg"
+name = "bttp"
 version = "0.1.0"
 version = "0.1.0"
 edition = "2021"
 edition = "2021"
 
 

+ 0 - 0
crates/btmsg/src/common.rs → crates/bttp/src/common.rs


+ 0 - 0
crates/btmsg/src/lib.rs → crates/bttp/src/lib.rs


+ 0 - 0
crates/btmsg/src/receiver.rs → crates/bttp/src/receiver.rs


+ 0 - 0
crates/btmsg/src/serialization.rs → crates/bttp/src/serialization.rs


+ 0 - 0
crates/btmsg/src/tls.rs → crates/bttp/src/tls.rs


+ 0 - 0
crates/btmsg/src/transmitter.rs → crates/bttp/src/transmitter.rs


+ 1 - 1
crates/btmsg/tests/tests.rs → crates/bttp/tests/tests.rs

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: AGPL-3.0-or-later
 // SPDX-License-Identifier: AGPL-3.0-or-later
 #![feature(impl_trait_in_assoc_type)]
 #![feature(impl_trait_in_assoc_type)]
 
 
-use btmsg::*;
+use bttp::*;
 
 
 use btlib::{
 use btlib::{
     crypto::{ConcreteCreds, Creds, CredsPriv},
     crypto::{ConcreteCreds, Creds, CredsPriv},

+ 1 - 1
website/content/en/_index.html

@@ -41,7 +41,7 @@ Information in the filesystem secured with confidentiality and integrity protect
 Key management is handled by the platform.
 Key management is handled by the platform.
 {{% /blocks/feature %}}
 {{% /blocks/feature %}}
 
 
-{{% blocks/feature icon="fa-solid fa-envelope" title="Message Passing" url="./rustdoc/btmsg/index.html" %}}
+{{% blocks/feature icon="fa-solid fa-envelope" title="Message Passing" url="./rustdoc/bttp/index.html" %}}
 Apps are implemented as message passing actors.
 Apps are implemented as message passing actors.
 Messages are addressed using filesystem paths.
 Messages are addressed using filesystem paths.
 The platform uses mutual TLS authentication to ensure your messages are only seen by their intended
 The platform uses mutual TLS authentication to ensure your messages are only seen by their intended