MCPcopy Create free account

hub / github.com/NullHypothesis/zoossh / functions

Functions129 in github.com/NullHypothesis/zoossh

↓ 13 callersMethodLength
()
generic.go:24
↓ 12 callersFunctionSanitiseFingerprint
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 callersMethodEquals
Equals checks whether the two given annotations have the same content.
util.go:43
↓ 10 callersFunctionStringToPort
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 callersMethodGet
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 callersMethodIterate
(*ObjectFilter)
generic.go:25
↓ 9 callersFunctionNewConsensus
NewConsensus serves as a constructor and returns a pointer to a freshly allocated and empty Consensus.
consensus.go:170
↓ 9 callersMethodString
()
generic.go:18
↓ 8 callersFunctionParseRawStatus
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 callersMethodSet
Set adds a new fingerprint mapping to a function returning the router status to the consensus.
consensus.go:205
↓ 8 callersFunctionreadAnnotation
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 callersFunctionNewObjectFilter
NewObjectFilter returns a newly allocated object filter instance.
generic.go:83
↓ 5 callersFunctionBase64ToString
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 callersFunctionCheckAnnotation
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 callersMethodHasIPAddr
HasIPAddr returns true if the given IP address is present in the object filter.
generic.go:47
↓ 5 callersFunctionParseConsensusFile
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 callersFunctionparseAnnotation
parseAnnotation parses a type annotation string in the form "@type $descriptortype $major.$minor".
util.go:54
↓ 5 callersFunctionparseConsensusUnchecked
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 callersMethodGetFingerprint
()
generic.go:19
↓ 4 callersMethodHasFingerprint
HasFingerprint returns true if the given fingerprint is present in the object filter.
generic.go:40
↓ 4 callersMethodHasNickname
HasNickname returns true if the given nickname is present in the object filter.
generic.go:54
↓ 4 callersMethodIsEmpty
IsEmpty returns true if the object filter is empty.
generic.go:75
↓ 4 callersFunctionLoadDescriptorFromDigest
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 callersFunctionParseDescriptorFile
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 callersFunctionParseUnknownFile
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 callersMethodAddFingerprint
AddFingerprint adds the given fingerprint to the object filter.
generic.go:60
↓ 3 callersMethodAddNickname
AddNickname adds the given nickname to the object filter.
generic.go:70
↓ 3 callersFunctionGetAnnotation
GetAnnotation obtains and returns the given file's annotation. If anything fails in the process, an error string is returned.
util.go:136
↓ 3 callersMethodLength
Length implements the ObjectSet interface. It returns the length of the consensus.
consensus.go:123
↓ 3 callersFunctionNewRouterDescriptor
NewRouterDescriptor serves as a constructor and returns a pointer to a freshly allocated and empty RouterDescriptor struct.
descriptor.go:187
↓ 3 callersMethodToSlice
ToSlice converts the given consensus to a slice. Consensus meta information is lost.
consensus.go:177
↓ 3 callersFunctionextractMetaInfo
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 callersFunctionparseDescriptorUnchecked
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 callersMethodAddIPAddr
AddIPAddr adds the given IP address to the object filter.
generic.go:65
↓ 2 callersFunctionDissectFile
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 callersMethodGet
Get returns the router descriptor for the given fingerprint and a boolean value indicating if the descriptor could be found.
descriptor.go:209
↓ 2 callersMethodGetObject
(Fingerprint)
generic.go:26
↓ 2 callersFunctionLazilyParseConsensusFile
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 callersMethodMerge
(ObjectSet)
generic.go:27
↓ 2 callersFunctionNewRouterDescriptors
NewRouterDescriptors serves as a constructor and returns a pointer to a freshly allocated and empty RouterDescriptors struct.
descriptor.go:180
↓ 2 callersFunctionParseRawDescriptor
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 callersFunctionparseConsensus
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 callersFunctionparseConsensusFile
parseConsensusFile is a wrapper around parseConsensus that opens the named file for parsing.
consensus.go:659
↓ 2 callersFunctionparseConsensusFileUnchecked
parseConsensusFileUnchecked is a wrapper around parseConsensusUnchecked that opens the named file for parsing.
consensus.go:672
↓ 2 callersFunctionparseDescriptorFile
parseDescriptorFile is a wrapper around parseDescriptor that opens the named file for parsing.
descriptor.go:452
↓ 2 callersFunctionparseDescriptorFileUnchecked
parseDescriptorFileUnchecked is a wrapper around parseDescriptorUnchecked that opens the named file for parsing.
descriptor.go:465
↓ 1 callersMethodIntersect
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 callersMethodIterate
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 callersMethodLength
Length implements the ObjectSet interface. It returns the length of the router descriptors.
descriptor.go:133
↓ 1 callersMethodMatchesRouterDescriptor
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 callersMethodMatchesRouterStatus
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 callersFunctionParseRawConsensus
ParseRawConsensus parses a raw consensus (in string format) and returns a network consensus if parsing was successful.
consensus.go:685
↓ 1 callersFunctionParseUnknown
ParseUnknown first reads a type annotation and passes it along with the rest of the input to parseWithAnnotation.
generic.go:116
↓ 1 callersMethodSet
Set adds a new fingerprint mapping to a function returning the router descriptor.
descriptor.go:221
↓ 1 callersMethodString
String implements the String as well as the Object interface. It returns the descriptor's string representation.
descriptor.go:101
↓ 1 callersMethodString
()
util.go:37
↓ 1 callersFunctionparseDescriptor
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 callersFunctionparseIPv6AddressAndPort
(addressAndPort string)
consensus.go:352
↓ 1 callersFunctionparseRouterFlags
(flags []string)
consensus.go:316
↓ 1 callersFunctionparseWithAnnotation
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 callersFunctionreadAndCheckAnnotation
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
FunctionBenchmarkConsensusParsing
Benchmark the time it takes to parse a consensus file.
consensus_test.go:22
FunctionBenchmarkConsensusParsingAndGetting
Benchmark the time it takes to parse a consensus file and get all its router statuses.
consensus_test.go:53
FunctionBenchmarkDescriptorLookup
Benchmark the time it takes to look up a descriptor.
util_test.go:25
FunctionBenchmarkDescriptorParsing
Benchmark the time it takes to parse a server descriptor file.
descriptor_test.go:19
FunctionBenchmarkLConsensusParsing
Benchmark the time it takes to lazily parse a consensus file.
consensus_test.go:37
FunctionBenchmarkLConsensusParsingAndGetting
Benchmark the time it takes to lazily parse a consensus file and get all its router statuses.
consensus_test.go:70
FunctionBenchmarkParseAnnotation
Benchmark the function parseAnnotation().
util_test.go:156
MethodGetFingerprint
GetFingerprint implements the Object interface. It returns the router status' fingerprint.
consensus.go:116
MethodGetFingerprint
GetFingerprint implements the Object interface. It returns the descriptor's fingerprint.
descriptor.go:118
MethodGetObject
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
MethodGetObject
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
MethodHasFamily
HasFamily returns true if the given relay identified by its fingerprint is part of this relay's family.
descriptor.go:125
MethodIterate
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
FunctionLazilyParseDescriptorFile
LazilyParseDescriptorFile parses the given file and returns a pointer to RouterDescriptors containing the router descriptors. If there were any error
descriptor.go:481
FunctionLazilyParseUnsafeConsensusFile
LazilyParseUnsafeConsensusFile parses the given file without checking the annotations and returns a network consensus if parsing was successful. If th
consensus.go:726
FunctionLazilyParseUnsafeDescriptorFile
LazilyParseDescriptorFile parses the given file without checking the annotations and returns a pointer to RouterDescriptors containing the router desc
descriptor.go:501
FunctionLazyParseRawDescriptor
LazyParseRawDescriptor lazily parses a raw router descriptor (in string format) and returns the descriptor's fingerprint, a function returning the des
descriptor.go:232
FunctionLazyParseRawStatus
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
MethodMerge
Merge merges the given object set with itself.
consensus.go:157
MethodMerge
Merge merges the given object set with itself.
descriptor.go:167
FunctionParseRawUnsafeConsensus
ParseRawUnsafeConsensus parses a raw consensus (in string format) and returns a network consensus if parsing was successful.
consensus.go:713
FunctionParseUnsafeConsensusFile
ParseUnsafeConsensusFile parses the given file without checking the annotations and returns a network consensus if parsing was successful. If there we
consensus.go:736
FunctionParseUnsafeDescriptorFile
ParseDescriptorFile parses the given file without checking the annotations and returns a pointer to RouterDescriptors containing the router descriptor
descriptor.go:511
MethodString
String implements the String as well as the Object interface. It returns the status' string representation.
consensus.go:103
MethodString
Implement the Stringer interface for pretty printing.
consensus.go:249
MethodString
Implement the Stringer interface for pretty printing.
consensus.go:272
MethodSubtract
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
FunctionTestAnnotationEquals
Test the function Equals().
util_test.go:96
FunctionTestAnnotationString
Test the function String().
util_test.go:85
FunctionTestBase64ToString
Test the function Base64ToString().
util_test.go:43
FunctionTestCheckAnnotationConsensus
Test the function CheckAnnotation() on a network-status-consensus-3 input.
util_test.go:287
FunctionTestCheckAnnotationDescriptor
Test the function CheckAnnotation() on a server-descriptor input.
util_test.go:257
FunctionTestCheckAnnotationZero
Test the function CheckAnnotation() on the input /dev/zero.
util_test.go:244
FunctionTestConsensusFiltering
(t *testing.T)
generic_test.go:170
FunctionTestConsensusOperations
(t *testing.T)
consensus_test.go:85
FunctionTestConsensusSetOperations
(t *testing.T)
consensus_test.go:127
FunctionTestConsensusToSlice
(t *testing.T)
consensus_test.go:350
FunctionTestDescriptorFiltering
(t *testing.T)
generic_test.go:209
FunctionTestDescriptorParsing
Test the function ParseRawDescriptor().
descriptor_test.go:34
next →1–100 of 129, ranked by callers