diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 24f605400..000000000 --- a/.clang-format +++ /dev/null @@ -1,75 +0,0 @@ ---- -BasedOnStyle: LLVM -BreakBeforeBraces: Stroustrup -IndentWidth: 4 -TabWidth: 4 -AlignAfterOpenBracket: AlwaysBreak -AlignConsecutiveMacros: Consecutive -AlignConsecutiveAssignments: Consecutive -AlignConsecutiveDeclarations: None -AlignEscapedNewlines: Right -AlignOperands: true -AlignTrailingComments: true -AllowAllArgumentsOnNextLine: false -AllowAllConstructorInitializersOnNextLine: false -AllowAllParametersOfDeclarationOnNextLine: false -AllowShortBlocksOnASingleLine: Always -AllowShortCaseLabelsOnASingleLine: true -AllowShortFunctionsOnASingleLine: All -AllowShortIfStatementsOnASingleLine: Never -AlwaysBreakAfterReturnType: None -BinPackArguments: true -BinPackParameters: true -BreakBeforeBinaryOperators: NonAssignment -BreakBeforeTernaryOperators: true -BreakConstructorInitializers: BeforeComma -BreakInheritanceList: BeforeComma -CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: true -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 -Cpp11BracedListStyle: false -FixNamespaceComments: true -IncludeBlocks: Regroup -IndentCaseLabels: true -IndentPPDirectives: None -IndentWrappedFunctionNames: false -KeepEmptyLinesAtTheStartOfBlocks: false -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -PointerAlignment: Right -ReflowComments: true -SortIncludes: CaseInsensitive -SortUsingDeclarations: true -SpaceAfterCStyleCast: false -SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: true -SpaceBeforeAssignmentOperators: true -SpaceBeforeCpp11BracedList: true -SpaceBeforeCtorInitializerColon: true -SpaceBeforeInheritanceColon: true -SpaceBeforeParens: ControlStatements -SpaceBeforeRangeBasedForLoopColon: true -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 3 -SpacesInAngles: false -SpacesInCStyleCastParentheses: false -SpacesInContainerLiterals: true -SpacesInParentheses: false -SpacesInSquareBrackets: false -UseTab: Never - ---- -Language: Cpp -Standard: c++11 -ColumnLimit: 360 ---- -Language: ObjC -ColumnLimit: 360 ---- -Language: Java -ColumnLimit: 360 ---- -Language: CSharp -ColumnLimit: 360 -... diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 7623d04d7..000000000 --- a/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git/ -build/ -!build/zerotier diff --git a/.gitignore b/.gitignore index ed11ec7ac..e23eaf340 100644 --- a/.gitignore +++ b/.gitignore @@ -1,42 +1,8 @@ -/build -/cmake-build-debug -/cmake-build-release -/core/version.h -/.idea -/.ide-* -.DS_Store -.Trashes -*.swp -._* -*~ -*~.nib -*.secret -.Apple* -Thumbs.db -@eaDir -.vscode -__pycache__ -*.log -*.bak -*.opensdf -*.user -*.cache -*.obj -*.tlog -*.pid -*.pkg +/target +/**/target +.DS_* +.Icon* *.o -*.o-* -*.core -*.deb -*.rpm -*.autosave -*.tmp -.depend -node_modules -*.vcxproj.backup -/*.db -/*.opendb -/rust-zerotier-core/src/capi.rs -/service/src/osdep.rs -/*/target +*.so +*.dylib +*.a diff --git a/network-hypervisor/src/vl1/locator.rs b/network-hypervisor/src/vl1/locator.rs index bcc18ee3e..a1792775e 100644 --- a/network-hypervisor/src/vl1/locator.rs +++ b/network-hypervisor/src/vl1/locator.rs @@ -12,11 +12,11 @@ use crate::vl1::protocol::PACKET_SIZE_MAX; /// no involvement from a root at all. #[derive(Clone, PartialEq, Eq)] pub struct Locator { - subject: Address, - signer: Address, - timestamp: i64, - endpoints: Vec, - signature: Vec, + pub subject: Address, + pub signer: Address, + pub timestamp: i64, + pub endpoints: Vec, + pub signature: Vec, } impl Locator { @@ -62,21 +62,9 @@ impl Locator { } } - #[inline(always)] - pub fn subject(&self) -> Address { self.subject } - - #[inline(always)] - pub fn signer(&self) -> Address { self.signer } - #[inline(always)] pub fn is_proxy_signed(&self) -> bool { self.subject != self.signer } - #[inline(always)] - pub fn timestamp(&self) -> i64 { self.timestamp } - - #[inline(always)] - pub fn endpoints(&self) -> &[Endpoint] { self.endpoints.as_slice() } - pub fn verify_signature(&self, signer_identity: &Identity) -> bool { let mut buf: Buffer<{ PACKET_SIZE_MAX }> = Buffer::new(); if self.marshal_internal(&mut buf, true).is_ok() { diff --git a/network-hypervisor/src/vl1/node.rs b/network-hypervisor/src/vl1/node.rs index c0033dbe7..668d05410 100644 --- a/network-hypervisor/src/vl1/node.rs +++ b/network-hypervisor/src/vl1/node.rs @@ -276,7 +276,7 @@ impl Node { if peer.is_some() { peer.unwrap().receive(self, ci, ph, time_ticks, &path, &packet_header, data.as_ref(), &[]); } else { - self.whois.query(self, ci, source, Some(QueuedPacket::Singular(data))); + self.whois.query(self, ci, source, Some(QueuedPacket::Unfragmented(data))); } } } diff --git a/network-hypervisor/src/vl1/rootset.rs b/network-hypervisor/src/vl1/rootset.rs index 3b066ee55..8a256a74d 100644 --- a/network-hypervisor/src/vl1/rootset.rs +++ b/network-hypervisor/src/vl1/rootset.rs @@ -95,6 +95,8 @@ pub struct Root { /// A signed bundle of root nodes. /// +/// In v1 this was the "World" object. +/// /// This is how roots are normally specified to nodes. The embedded signing key allows the /// root set to be updated automatically. Updates can add, remove, or change the endpoints /// of roots, allowing infrastructure updates with automatic client configuration as long diff --git a/network-hypervisor/src/vl1/whois.rs b/network-hypervisor/src/vl1/whois.rs index 36f17f0c2..7e4e7388e 100644 --- a/network-hypervisor/src/vl1/whois.rs +++ b/network-hypervisor/src/vl1/whois.rs @@ -9,7 +9,7 @@ use crate::vl1::node::{Node, PacketBuffer, VL1CallerInterface}; use crate::vl1::protocol::{WHOIS_RETRY_INTERVAL, WHOIS_MAX_WAITING_PACKETS, WHOIS_RETRY_MAX}; pub(crate) enum QueuedPacket { - Singular(PacketBuffer), + Unfragmented(PacketBuffer), Fragmented(FragmentedPacket) } @@ -26,6 +26,7 @@ impl WhoisQueue { pub fn new() -> Self { Self(Mutex::new(HashMap::new())) } + /// Launch or renew a WHOIS query and enqueue a packet to be processed when (if) it is received. pub fn query(&self, node: &Node, ci: &CI, target: Address, packet: Option) { let mut q = self.0.lock();