generator

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Nameserver string

Nameserver contains the address of a nameserver to use for resolving generated IP addresses to names. If it is empty, the operating system's default nameserver is used.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator generates random Hosts, checking them against blacklists and ensuring that the IP address resolves to a valid PTR (i.e. that the generated Host is likely to exist on the Internet).

func New

func New(icnt, ncnt int) (*Generator, error)

New creates a new Generator. iCnt is the number of goroutines to spawn for generating IP addresses wCnt is the number of goroutines to spawn for resolving and checking hostnames.

func (*Generator) AddrWorkerCount added in v0.3.0

func (gen *Generator) AddrWorkerCount() int

AddrWorkerCount returns the number of address generator workers.

func (*Generator) IsActive

func (gen *Generator) IsActive() bool

IsActive returns the Generator's active flag.

func (*Generator) NameWorkerCount added in v0.3.0

func (gen *Generator) NameWorkerCount() int

NameWorkerCount return the number name resolver workers.

func (*Generator) Start

func (gen *Generator) Start()

Start sets the Generator's active flag and spawns the worker goroutines.

func (*Generator) StartAddrWorker added in v0.4.0

func (gen *Generator) StartAddrWorker()

StartAddrWorker stars another address generation worker.

func (*Generator) StartNameWorker added in v0.4.0

func (gen *Generator) StartNameWorker()

StartNameWorker starts another name resolution worker.

func (*Generator) Stop

func (gen *Generator) Stop()

Stop clears the Generator's active flag.

func (*Generator) StopAddrWorker added in v0.4.0

func (gen *Generator) StopAddrWorker()

StopAddrWorker stops one address generation worker.

func (*Generator) StopNameWorker added in v0.4.0

func (gen *Generator) StopNameWorker()

StopNameWorker stops one name resolution worker.

func (*Generator) System added in v0.3.0

func (gen *Generator) System() subsystem.ID

System returns the ID of the subsystem, i.e. subsystem.Generator

func (*Generator) WorkerCount added in v0.3.0

func (gen *Generator) WorkerCount() int

WorkerCount returns the number of active workers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL