Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/NullHypothesis/zoossh
/ functions
Functions
129 in github.com/NullHypothesis/zoossh
⨍
Functions
129
◇
Types & classes
16
↓ 13 callers
Method
Length
()
generic.go:24
↓ 12 callers
Function
SanitiseFingerprint
SanitiseFingerprint returns a sanitised version of the given fingerprint by making it upper case and removing leading and trailing white spaces.
util.go:226
↓ 11 callers
Method
Equals
Equals checks whether the two given annotations have the same content.
util.go:43
↓ 10 callers
Function
StringToPort
Convert the given port string to an unsigned 16-bit integer. If the conversion fails or the number cannot be represented in 16 bits, 0 is returned.
util.go:214
↓ 9 callers
Method
Get
Get returns the router status for the given fingerprint and a boolean value indicating if the status could be found in the consensus.
consensus.go:193
↓ 9 callers
Method
Iterate
(*ObjectFilter)
generic.go:25
↓ 9 callers
Function
NewConsensus
NewConsensus serves as a constructor and returns a pointer to a freshly allocated and empty Consensus.
consensus.go:170
↓ 9 callers
Method
String
()
generic.go:18
↓ 8 callers
Function
ParseRawStatus
ParseRawStatus parses a raw router status (in string format) and returns the router's fingerprint, a function which returns a RouterStatus, and an err
consensus.go:390
↓ 8 callers
Method
Set
Set adds a new fingerprint mapping to a function returning the router status to the consensus.
consensus.go:205
↓ 8 callers
Function
readAnnotation
readAnnotation reads and parses the first line of the the io.Reader, then returns the resulting *Annotation as well as a new io.Reader ready to read t
util.go:90
↓ 6 callers
Function
NewObjectFilter
NewObjectFilter returns a newly allocated object filter instance.
generic.go:83
↓ 5 callers
Function
Base64ToString
Base64ToString decodes the given Base64-encoded string and returns the resulting string. If there are errors during decoding, an error string is retur
util.go:71
↓ 5 callers
Function
CheckAnnotation
CheckAnnotation checks the type annotation in the given file. The Annotation struct determines what we want to see in the file. If we don't see the
util.go:155
↓ 5 callers
Method
HasIPAddr
HasIPAddr returns true if the given IP address is present in the object filter.
generic.go:47
↓ 5 callers
Function
ParseConsensusFile
ParseConsensusFile parses the given file and returns a network consensus if parsing was successful. If there were any errors, an error string is retu
consensus.go:706
↓ 5 callers
Function
parseAnnotation
parseAnnotation parses a type annotation string in the form "@type $descriptortype $major.$minor".
util.go:54
↓ 5 callers
Function
parseConsensusUnchecked
parseConsensusUnchecked parses a descriptor of type "network-status-consensus-3". The input should be without a type annotation; i.e., the type annot
consensus.go:599
↓ 4 callers
Method
GetFingerprint
()
generic.go:19
↓ 4 callers
Method
HasFingerprint
HasFingerprint returns true if the given fingerprint is present in the object filter.
generic.go:40
↓ 4 callers
Method
HasNickname
HasNickname returns true if the given nickname is present in the object filter.
generic.go:54
↓ 4 callers
Method
IsEmpty
IsEmpty returns true if the object filter is empty.
generic.go:75
↓ 4 callers
Function
LoadDescriptorFromDigest
LoadDescriptorFromDigest takes as input the descriptor directory, a descriptor's digest, and the date the digest was created. It then attempts to par
util.go:240
↓ 4 callers
Function
ParseDescriptorFile
ParseDescriptorFile parses the given file and returns a pointer to RouterDescriptors containing the router descriptors. If there were any errors, an
descriptor.go:491
↓ 4 callers
Function
ParseUnknownFile
ParseUnknownFile attempts to parse a file whose content we don't know. We try to use the right parser by looking at the file's annotation. An Object
generic.go:129
↓ 3 callers
Method
AddFingerprint
AddFingerprint adds the given fingerprint to the object filter.
generic.go:60
↓ 3 callers
Method
AddNickname
AddNickname adds the given nickname to the object filter.
generic.go:70
↓ 3 callers
Function
GetAnnotation
GetAnnotation obtains and returns the given file's annotation. If anything fails in the process, an error string is returned.
util.go:136
↓ 3 callers
Method
Length
Length implements the ObjectSet interface. It returns the length of the consensus.
consensus.go:123
↓ 3 callers
Function
NewRouterDescriptor
NewRouterDescriptor serves as a constructor and returns a pointer to a freshly allocated and empty RouterDescriptor struct.
descriptor.go:187
↓ 3 callers
Method
ToSlice
ToSlice converts the given consensus to a slice. Consensus meta information is lost.
consensus.go:177
↓ 3 callers
Function
extractMetaInfo
extractMetainfo extracts meta information of the open consensus document (such as its validity times) and writes it to the provided consensus struct.
consensus.go:491
↓ 3 callers
Function
parseDescriptorUnchecked
parseDescriptorUnchecked parses a descriptor of type "server-descriptor". The input should be without a type annotation; i.e., the type annotation sho
descriptor.go:404
↓ 2 callers
Method
AddIPAddr
AddIPAddr adds the given IP address to the object filter.
generic.go:65
↓ 2 callers
Function
DissectFile
Dissects the given file into string chunks by using the given string extraction function. The resulting string chunks are then written to the given q
util.go:194
↓ 2 callers
Method
Get
Get returns the router descriptor for the given fingerprint and a boolean value indicating if the descriptor could be found.
descriptor.go:209
↓ 2 callers
Method
GetObject
(Fingerprint)
generic.go:26
↓ 2 callers
Function
LazilyParseConsensusFile
LazilyParseConsensusFile parses the given file and returns a network consensus if parsing was successful. If there were any errors, an error string i
consensus.go:696
↓ 2 callers
Method
Merge
(ObjectSet)
generic.go:27
↓ 2 callers
Function
NewRouterDescriptors
NewRouterDescriptors serves as a constructor and returns a pointer to a freshly allocated and empty RouterDescriptors struct.
descriptor.go:180
↓ 2 callers
Function
ParseRawDescriptor
ParseRawDescriptor parses a raw router descriptor (in string format) and returns the descriptor's fingerprint, a function returning the descriptor, an
descriptor.go:263
↓ 2 callers
Function
parseConsensus
parseConsensus is a wrapper around parseConsensusUnchecked that first reads and checks the type annotation to make sure it belongs to consensusAnnotat
consensus.go:641
↓ 2 callers
Function
parseConsensusFile
parseConsensusFile is a wrapper around parseConsensus that opens the named file for parsing.
consensus.go:659
↓ 2 callers
Function
parseConsensusFileUnchecked
parseConsensusFileUnchecked is a wrapper around parseConsensusUnchecked that opens the named file for parsing.
consensus.go:672
↓ 2 callers
Function
parseDescriptorFile
parseDescriptorFile is a wrapper around parseDescriptor that opens the named file for parsing.
descriptor.go:452
↓ 2 callers
Function
parseDescriptorFileUnchecked
parseDescriptorFileUnchecked is a wrapper around parseDescriptorUnchecked that opens the named file for parsing.
descriptor.go:465
↓ 1 callers
Method
Intersect
Intersect determines the intersection between the given consensus b and consensus a. It returns a new consensus which is the intersection of both giv
consensus.go:233
↓ 1 callers
Method
Iterate
Iterate implements the ObjectSet interface. Using a channel, it iterates over and returns all router descriptors. The given object filter can be use
descriptor.go:141
↓ 1 callers
Method
Length
Length implements the ObjectSet interface. It returns the length of the router descriptors.
descriptor.go:133
↓ 1 callers
Method
MatchesRouterDescriptor
MatchesRouterDescriptor returns true if fields of the given router descriptor are present in the object filter, e.g., the descriptor's nickname is par
descriptor.go:380
↓ 1 callers
Method
MatchesRouterStatus
MatchesRouterStatus returns true if fields of the given router status are present in the object filter, e.g., the router's nickname is part of the obj
consensus.go:574
↓ 1 callers
Function
ParseRawConsensus
ParseRawConsensus parses a raw consensus (in string format) and returns a network consensus if parsing was successful.
consensus.go:685
↓ 1 callers
Function
ParseUnknown
ParseUnknown first reads a type annotation and passes it along with the rest of the input to parseWithAnnotation.
generic.go:116
↓ 1 callers
Method
Set
Set adds a new fingerprint mapping to a function returning the router descriptor.
descriptor.go:221
↓ 1 callers
Method
String
String implements the String as well as the Object interface. It returns the descriptor's string representation.
descriptor.go:101
↓ 1 callers
Method
String
()
util.go:37
↓ 1 callers
Function
parseDescriptor
parseDescriptor is a wrapper around parseDescriptorUnchecked that first reads and checks the type annotation to make sure it belongs to descriptorAnno
descriptor.go:440
↓ 1 callers
Function
parseIPv6AddressAndPort
(addressAndPort string)
consensus.go:352
↓ 1 callers
Function
parseRouterFlags
(flags []string)
consensus.go:316
↓ 1 callers
Function
parseWithAnnotation
parseWithAnnotation parses the input using a parser appropriate for the given annotation. The input should not have an annotation of its own (it shou
generic.go:96
↓ 1 callers
Function
readAndCheckAnnotation
Checks the type annotation in the given io.Reader. The Annotation struct determines what we want to see. If we don't see the expected annotation, an
util.go:117
Function
BenchmarkConsensusParsing
Benchmark the time it takes to parse a consensus file.
consensus_test.go:22
Function
BenchmarkConsensusParsingAndGetting
Benchmark the time it takes to parse a consensus file and get all its router statuses.
consensus_test.go:53
Function
BenchmarkDescriptorLookup
Benchmark the time it takes to look up a descriptor.
util_test.go:25
Function
BenchmarkDescriptorParsing
Benchmark the time it takes to parse a server descriptor file.
descriptor_test.go:19
Function
BenchmarkLConsensusParsing
Benchmark the time it takes to lazily parse a consensus file.
consensus_test.go:37
Function
BenchmarkLConsensusParsingAndGetting
Benchmark the time it takes to lazily parse a consensus file and get all its router statuses.
consensus_test.go:70
Function
BenchmarkParseAnnotation
Benchmark the function parseAnnotation().
util_test.go:156
Method
GetFingerprint
GetFingerprint implements the Object interface. It returns the router status' fingerprint.
consensus.go:116
Method
GetFingerprint
GetFingerprint implements the Object interface. It returns the descriptor's fingerprint.
descriptor.go:118
Method
GetObject
GetObject implements the ObjectSet interface. It returns the object identified by the given fingerprint. If the object is not present in the set, fa
consensus.go:151
Method
GetObject
GetObject implements the ObjectSet interface. It returns the object identified by the given fingerprint. If the object is not present in the set, fa
descriptor.go:161
Method
HasFamily
HasFamily returns true if the given relay identified by its fingerprint is part of this relay's family.
descriptor.go:125
Method
Iterate
Iterate implements the ObjectSet interface. Using a channel, it iterates over and returns all router statuses. The given object filter can be used t
consensus.go:131
Function
LazilyParseDescriptorFile
LazilyParseDescriptorFile parses the given file and returns a pointer to RouterDescriptors containing the router descriptors. If there were any error
descriptor.go:481
Function
LazilyParseUnsafeConsensusFile
LazilyParseUnsafeConsensusFile parses the given file without checking the annotations and returns a network consensus if parsing was successful. If th
consensus.go:726
Function
LazilyParseUnsafeDescriptorFile
LazilyParseDescriptorFile parses the given file without checking the annotations and returns a pointer to RouterDescriptors containing the router desc
descriptor.go:501
Function
LazyParseRawDescriptor
LazyParseRawDescriptor lazily parses a raw router descriptor (in string format) and returns the descriptor's fingerprint, a function returning the des
descriptor.go:232
Function
LazyParseRawStatus
LazyParseRawStatus parses a raw router status (in string format) and returns the router's fingerprint, a function which returns a RouterStatus, and an
consensus.go:365
Method
Merge
Merge merges the given object set with itself.
consensus.go:157
Method
Merge
Merge merges the given object set with itself.
descriptor.go:167
Function
ParseRawUnsafeConsensus
ParseRawUnsafeConsensus parses a raw consensus (in string format) and returns a network consensus if parsing was successful.
consensus.go:713
Function
ParseUnsafeConsensusFile
ParseUnsafeConsensusFile parses the given file without checking the annotations and returns a network consensus if parsing was successful. If there we
consensus.go:736
Function
ParseUnsafeDescriptorFile
ParseDescriptorFile parses the given file without checking the annotations and returns a pointer to RouterDescriptors containing the router descriptor
descriptor.go:511
Method
String
String implements the String as well as the Object interface. It returns the status' string representation.
consensus.go:103
Method
String
Implement the Stringer interface for pretty printing.
consensus.go:249
Method
String
Implement the Stringer interface for pretty printing.
consensus.go:272
Method
Subtract
Subtract removes all routers which are part of the given consensus b from consensus a. It returns a new consensus which is the result of the subtract
consensus.go:215
Function
TestAnnotationEquals
Test the function Equals().
util_test.go:96
Function
TestAnnotationString
Test the function String().
util_test.go:85
Function
TestBase64ToString
Test the function Base64ToString().
util_test.go:43
Function
TestCheckAnnotationConsensus
Test the function CheckAnnotation() on a network-status-consensus-3 input.
util_test.go:287
Function
TestCheckAnnotationDescriptor
Test the function CheckAnnotation() on a server-descriptor input.
util_test.go:257
Function
TestCheckAnnotationZero
Test the function CheckAnnotation() on the input /dev/zero.
util_test.go:244
Function
TestConsensusFiltering
(t *testing.T)
generic_test.go:170
Function
TestConsensusOperations
(t *testing.T)
consensus_test.go:85
Function
TestConsensusSetOperations
(t *testing.T)
consensus_test.go:127
Function
TestConsensusToSlice
(t *testing.T)
consensus_test.go:350
Function
TestDescriptorFiltering
(t *testing.T)
generic_test.go:209
Function
TestDescriptorParsing
Test the function ParseRawDescriptor().
descriptor_test.go:34
next →
1–100 of 129, ranked by callers