Documentation
¶
Index ¶
- Constants
- func DestroyGetReasonS(reason uint8) string
- func IPLevel(ipStr string, asn uint32) (uint32, error)
- func ParsePortsLine(dst *Ports, s string) error
- func SetGlobalConsensus(c *Consensus)
- type BandWidthWeight
- type Consensus
- type Family
- type FamilyIDs
- type Microdesc
- type Ports
- type Proto
- type RouterStatus
- type VersionValue
Constants ¶
View Source
const ( FLAG_AUTHORITY uint8 = iota FLAG_BAD_EXIT FLAG_EXIT FLAG_FAST FLAG_GUARD FLAG_HIDDEN_SERVICE_DIR FLAG_MIDDLE_ONLY FLAG_NO_ED_CONSENSUS FLAG_STABLE FLAG_STALE_DESC FLAG_RUNNING FLAG_VALID FLAG_V2DIR FLAG_SYBIL FLAG_ARRAY_LENGTH )
View Source
const ( VERSION_1 uint8 = iota VERSION_2 VERSION_3 VERSION_4 VERSION_5 VERSION_6 )
View Source
const ( PARSER_STATE_HEADER uint8 = iota PARSER_STATE_DIRS PARSER_STATE_ROUTERS PARSER_STATE_FOOTER )
View Source
const ( LEVEL_ASN = 1 LEVEL_P24 = 2 LEVEL_P16 = 3 LEVEL_IPV6 = 4 )
View Source
const AUTH_DIR_NUM_AGREEMENTS uint8 = 9
View Source
const CONSENSUS_DATE_FORMAT string = "2006-01-02 15:04:05"
Variables ¶
This section is empty.
Functions ¶
func DestroyGetReasonS ¶
func ParsePortsLine ¶
ParsePortsLine needs to receive: "accept 20-21,23"
func SetGlobalConsensus ¶
func SetGlobalConsensus(c *Consensus)
Types ¶
type BandWidthWeight ¶
type Consensus ¶
type Consensus struct {
NetowrkStatusVersion uint8
ValidAfter time.Time
FreshUntil time.Time
ValidUntil time.Time
RelayInformation []RouterStatus
BandWidthWeight BandWidthWeight
// contains filtered or unexported fields
}
var GlobalConsensus *Consensus
func GetGlobalConsensus ¶
func GetGlobalConsensus() *Consensus
type Microdesc ¶
type Proto ¶
type Proto struct {
Link VersionValue
LinkAuth VersionValue
Relay VersionValue
DirCache VersionValue
HSDir VersionValue
HSIntro VersionValue
HSRend VersionValue
Desc VersionValue
Microdesc VersionValue
Cons VersionValue
Padding VersionValue
FlowCtrl VersionValue
Conflux VersionValue
}
type RouterStatus ¶
type RouterStatus struct {
Nickname string
NodeID [20]byte
Ipv4Addr string
ORPort uint16
IPLevel uint32
MicrodescriptorDigest string
DirPort uint16
BandWidth uint32
Ipv6Addr string // like [0000:00a:000:0000::000a]:8443 or empty string
ProtoVersions Proto
StatusFlags [FLAG_ARRAY_LENGTH + 1]bool
Ports Ports
OnionKey []byte
NTorOnionKey *ecdh.PublicKey
IdEd25519 []byte
Family []Family
Familys []*FamilyIDs
}
type VersionValue ¶
type VersionValue byte
func (*VersionValue) CheckIsTrue ¶
func (v *VersionValue) CheckIsTrue(n uint8) bool
func (*VersionValue) SetValue ¶
func (s *VersionValue) SetValue(n uint8, value bool)
Click to show internal directories.
Click to hide internal directories.