Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
9d46ce3d
Commit
9d46ce3d
authored
3 years ago
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
morw ork on the interface
parent
50f2a890
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!510
Release
,
!207
WIP: Client Restructure
,
!203
Symmetric broadcast
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
interfaces/networkManager.go
+34
-11
34 additions, 11 deletions
interfaces/networkManager.go
with
34 additions
and
11 deletions
interfaces/networkManager.go
+
34
−
11
View file @
9d46ce3d
...
@@ -24,17 +24,21 @@ import (
...
@@ -24,17 +24,21 @@ import (
)
)
type
NetworkManager
interface
{
type
NetworkManager
interface
{
// The stoppable can be nil.
/* Process contol */
SendCMIX
(
message
format
.
Message
,
recipient
*
id
.
ID
,
p
params
.
CMIX
)
(
id
.
Round
,
ephemeral
.
Id
,
error
)
Follow
(
report
ClientErrorReport
)
(
stoppable
.
Stoppable
,
error
)
SendManyCMIX
(
messages
[]
message
.
TargetedCmixMessage
,
p
params
.
CMIX
)
(
id
.
Round
,
[]
ephemeral
.
Id
,
error
)
// GetSender - Object that all gateway I/O goes though. It handles
// selecting gateways and proxying messages through them
GetSender
()
*
gateway
.
Sender
/* Parameters and events */
GetInstance
()
*
network
.
Instance
GetInstance
()
*
network
.
Instance
GetHealthTracker
()
HealthTracker
GetHealthTracker
()
HealthTracker
GetEventManager
()
EventManager
GetEventManager
()
EventManager
GetSender
()
*
gateway
.
Sender
Follow
(
report
ClientErrorReport
)
(
stoppable
.
Stoppable
,
error
)
CheckGarbledMessages
()
InProgressRegistrations
()
int
InProgressRegistrations
()
int
CheckGarbledMessages
()
// GetAddressSize returns the current address size of IDs. Blocks until an
// GetAddressSize returns the current address size of IDs. Blocks until an
// address size is known.
// address size is known.
GetAddressSize
()
uint8
GetAddressSize
()
uint8
...
@@ -52,8 +56,16 @@ type NetworkManager interface {
...
@@ -52,8 +56,16 @@ type NetworkManager interface {
UnregisterAddressSizeNotification
(
tag
string
)
UnregisterAddressSizeNotification
(
tag
string
)
// SetPoolFilter sets the filter used to filter gateway IDs.
// SetPoolFilter sets the filter used to filter gateway IDs.
// allows you to disable proxying through certain gateways
SetPoolFilter
(
f
gateway
.
Filter
)
SetPoolFilter
(
f
gateway
.
Filter
)
/* Message Sending */
SendCMIX
(
message
format
.
Message
,
recipient
*
id
.
ID
,
p
params
.
CMIX
)
(
id
.
Round
,
ephemeral
.
Id
,
error
)
SendManyCMIX
(
messages
[]
message
.
TargetedCmixMessage
,
p
params
.
CMIX
)
(
id
.
Round
,
[]
ephemeral
.
Id
,
error
)
/* Message Receiving */
/* Identities are all network identites which the client is currently
/* Identities are all network identites which the client is currently
trying to pick up message on. Each identity has a default trigger
trying to pick up message on. Each identity has a default trigger
pickup that it will receive on, but this default is generally
pickup that it will receive on, but this default is generally
...
@@ -62,15 +74,26 @@ type NetworkManager interface {
...
@@ -62,15 +74,26 @@ type NetworkManager interface {
if none are present. */
if none are present. */
// AddIdentity adds an identity to be tracked
// AddIdentity adds an identity to be tracked
// and Identity is Defined by a source ID and a current EphemeralID
// In its IdentityParams, paremeters describing the properties
// of the identity as well as how long it will last are described
AddIdentity
(
Identity
,
IdentityParams
)
AddIdentity
(
Identity
,
IdentityParams
)
// RemoveIdentity removes a currently tracked identity.
// RemoveIdentity removes a currently tracked identity.
RemoveIdentity
(
Identity
)
RemoveIdentity
(
Identity
)
//fingerprints
/* Fingerprints are the primary mechanisim of identifying a picked up message over
AddFingerprint
(
fp
format
.
Fingerprint
,
processor
MessageProcessorFP
)
cMix. They are a unique one time use 255 bit vector generally
AddFingerprints
(
map
[
format
.
Fingerprint
]
MessageProcessorFP
)
assoceated with a specific encryption key, but can be used for an alternative proptocol.
When registering a fingeprprint, a MessageProcessorFP is registered to handle the message.
The */
//AddFingerprint - Adds a fingerprint which will be handled by a specific processor
AddFingerprint
(
fingerprint
format
.
Fingerprint
,
processor
MessageProcessorFP
)
AddFingerprints
(
fingerprints
map
[
format
.
Fingerprint
]
MessageProcessorFP
)
RemoveFingerprint
(
fingerprint
format
.
Fingerprint
)
RemoveFingerprints
(
fingerprints
[]
format
.
Fingerprint
)
CheckFingerprint
(
fingerprint
format
.
Fingerprint
)
bool
CheckFingerprint
(
fingerprint
format
.
Fingerprint
)
bool
RemoveFingerprint
(
fingerprint
format
.
Fingerprint
)
bool
/* trigger - predefined hash based tags appended to all cmix messages
/* trigger - predefined hash based tags appended to all cmix messages
which, though trial hashing, are used to determine if a message applies
which, though trial hashing, are used to determine if a message applies
...
@@ -141,7 +164,7 @@ type Trigger struct {
...
@@ -141,7 +164,7 @@ type Trigger struct {
}
}
type
MessageProcessorFP
interface
{
type
MessageProcessorFP
interface
{
Process
(
message
format
.
Message
)
Process
(
message
format
.
Message
,
fingerprint
format
.
Fingerprint
)
error
}
}
type
MessageProcessorTrigger
interface
{
type
MessageProcessorTrigger
interface
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment