mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
More cleanup.
This commit is contained in:
parent
13e342d34e
commit
4f70873a46
7 changed files with 17 additions and 138 deletions
|
@ -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
|
|
||||||
...
|
|
|
@ -1,3 +0,0 @@
|
||||||
.git/
|
|
||||||
build/
|
|
||||||
!build/zerotier
|
|
48
.gitignore
vendored
48
.gitignore
vendored
|
@ -1,42 +1,8 @@
|
||||||
/build
|
/target
|
||||||
/cmake-build-debug
|
/**/target
|
||||||
/cmake-build-release
|
.DS_*
|
||||||
/core/version.h
|
.Icon*
|
||||||
/.idea
|
|
||||||
/.ide-*
|
|
||||||
.DS_Store
|
|
||||||
.Trashes
|
|
||||||
*.swp
|
|
||||||
._*
|
|
||||||
*~
|
|
||||||
*~.nib
|
|
||||||
*.secret
|
|
||||||
.Apple*
|
|
||||||
Thumbs.db
|
|
||||||
@eaDir
|
|
||||||
.vscode
|
|
||||||
__pycache__
|
|
||||||
*.log
|
|
||||||
*.bak
|
|
||||||
*.opensdf
|
|
||||||
*.user
|
|
||||||
*.cache
|
|
||||||
*.obj
|
|
||||||
*.tlog
|
|
||||||
*.pid
|
|
||||||
*.pkg
|
|
||||||
*.o
|
*.o
|
||||||
*.o-*
|
*.so
|
||||||
*.core
|
*.dylib
|
||||||
*.deb
|
*.a
|
||||||
*.rpm
|
|
||||||
*.autosave
|
|
||||||
*.tmp
|
|
||||||
.depend
|
|
||||||
node_modules
|
|
||||||
*.vcxproj.backup
|
|
||||||
/*.db
|
|
||||||
/*.opendb
|
|
||||||
/rust-zerotier-core/src/capi.rs
|
|
||||||
/service/src/osdep.rs
|
|
||||||
/*/target
|
|
||||||
|
|
|
@ -12,11 +12,11 @@ use crate::vl1::protocol::PACKET_SIZE_MAX;
|
||||||
/// no involvement from a root at all.
|
/// no involvement from a root at all.
|
||||||
#[derive(Clone, PartialEq, Eq)]
|
#[derive(Clone, PartialEq, Eq)]
|
||||||
pub struct Locator {
|
pub struct Locator {
|
||||||
subject: Address,
|
pub subject: Address,
|
||||||
signer: Address,
|
pub signer: Address,
|
||||||
timestamp: i64,
|
pub timestamp: i64,
|
||||||
endpoints: Vec<Endpoint>,
|
pub endpoints: Vec<Endpoint>,
|
||||||
signature: Vec<u8>,
|
pub signature: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Locator {
|
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)]
|
#[inline(always)]
|
||||||
pub fn is_proxy_signed(&self) -> bool { self.subject != self.signer }
|
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 {
|
pub fn verify_signature(&self, signer_identity: &Identity) -> bool {
|
||||||
let mut buf: Buffer<{ PACKET_SIZE_MAX }> = Buffer::new();
|
let mut buf: Buffer<{ PACKET_SIZE_MAX }> = Buffer::new();
|
||||||
if self.marshal_internal(&mut buf, true).is_ok() {
|
if self.marshal_internal(&mut buf, true).is_ok() {
|
||||||
|
|
|
@ -276,7 +276,7 @@ impl Node {
|
||||||
if peer.is_some() {
|
if peer.is_some() {
|
||||||
peer.unwrap().receive(self, ci, ph, time_ticks, &path, &packet_header, data.as_ref(), &[]);
|
peer.unwrap().receive(self, ci, ph, time_ticks, &path, &packet_header, data.as_ref(), &[]);
|
||||||
} else {
|
} else {
|
||||||
self.whois.query(self, ci, source, Some(QueuedPacket::Singular(data)));
|
self.whois.query(self, ci, source, Some(QueuedPacket::Unfragmented(data)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,8 @@ pub struct Root {
|
||||||
|
|
||||||
/// A signed bundle of root nodes.
|
/// 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
|
/// 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
|
/// 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
|
/// of roots, allowing infrastructure updates with automatic client configuration as long
|
||||||
|
|
|
@ -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};
|
use crate::vl1::protocol::{WHOIS_RETRY_INTERVAL, WHOIS_MAX_WAITING_PACKETS, WHOIS_RETRY_MAX};
|
||||||
|
|
||||||
pub(crate) enum QueuedPacket {
|
pub(crate) enum QueuedPacket {
|
||||||
Singular(PacketBuffer),
|
Unfragmented(PacketBuffer),
|
||||||
Fragmented(FragmentedPacket)
|
Fragmented(FragmentedPacket)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ impl WhoisQueue {
|
||||||
|
|
||||||
pub fn new() -> Self { Self(Mutex::new(HashMap::new())) }
|
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<CI: VL1CallerInterface>(&self, node: &Node, ci: &CI, target: Address, packet: Option<QueuedPacket>) {
|
pub fn query<CI: VL1CallerInterface>(&self, node: &Node, ci: &CI, target: Address, packet: Option<QueuedPacket>) {
|
||||||
let mut q = self.0.lock();
|
let mut q = self.0.lock();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue