Documentation ¶
Index ¶
- Constants
- func AllowAll(inet256.Addr) bool
- func INET256PrefixFromIPv6(x netip.Addr) ([]byte, int, error)
- func IPv6FromINET256(x inet256.Addr) netip.Addr
- func MineAddr(ctx context.Context, r io.Reader, goal int) (inet256.Addr, inet256.PrivateKey, error)
- func NetworkPrefix() netip.Prefix
- func NewIP6AddrCmd() *cobra.Command
- func NewIP6PortalCmd(newNode func(context.Context, inet256.PrivateKey) (inet256.Node, error)) *cobra.Command
- func RunPortal(ctx context.Context, params PortalParams) error
- type AllowFunc
- type IPv6Addr
- type NATTable
- type PortalParams
Constants ¶
View Source
const ( // WorthItBits is the number of leading 0s the address must have // for the encoding scheme to be better than just taking the prefix WorthItBits = 9 // PreImageResistance128Bits is the number of leading 0s the address must have // for the uncompressed prefix to have 128 bits of preimage resistance. PreImageResistance128Bits = 16 )
Variables ¶
This section is empty.
Functions ¶
func INET256PrefixFromIPv6 ¶ added in v0.0.3
INET256PrefixFromIPv6 returns the a prefix and nbits for passing to FindAddr
func IPv6FromINET256 ¶ added in v0.0.3
IPv6FromINET256 returns the IPv6 address corresponding to x. There is only 1 IPv6 per INET256
func MineAddr ¶
MineAddr repeatedly generates private-keys using entropy from r, derives INET256 addresses from them, and checks how well they compress into the IPv6 mapping. goal is the number of leading 0s to achieve in address before stopping.
func NetworkPrefix ¶ added in v0.0.3
NetworkPrefix returns the IPv6 prefix where all INET256 addresses are mapped.
func NewIP6AddrCmd ¶ added in v0.0.3
func NewIP6PortalCmd ¶ added in v0.0.3
Types ¶
type AllowFunc ¶
func ParseWhitelist ¶ added in v0.0.2
ParseWhitelist creates an AllowFunc which allows only the addresses listed in x. It expects newline separated base64 encoded INET256 addresses. One per line.
type NATTable ¶
type NATTable struct {
// contains filtered or unexported fields
}
func NewNATTable ¶
type PortalParams ¶
Click to show internal directories.
Click to hide internal directories.