nbns

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: MIT Imports: 11 Imported by: 0

README

nbns

Netbios listener

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GoroutinePool = &goroutinePool{name: "default", stopping: 0, StopChannel: make(chan struct{}), stoppedChannel: make(chan *goroutine)}

GoroutinePool tracks background goroutines and enable termination.

Usage:

go {
    h := GoroutinePool.Begin("name")
    defer h.End()}

    for {
     select {
     case <-GoroutinePool.StopChannel:
       return
     }
    }
 }()

GoroutinePool.Stop()

View Source
var LogAll bool

LogAll tells the package to log Info and lower messages Default is to log only Error and Warning; set it to true to log other messages

Functions

This section is empty.

Types

type Entry

type Entry struct {
	IP   net.IP
	Name string
}

Entry holds a NBNS name entry

type Handler

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

Handler create a new NBNS handler

func NewHandler

func NewHandler(network net.IPNet) (handler *Handler, err error)

NewHandler create a NBNS handler

func (*Handler) AddNotificationChannel

func (h *Handler) AddNotificationChannel(notification chan<- Entry)

AddNotificationChannel set the notification channel for new names

func (*Handler) ListenAndServe

func (h *Handler) ListenAndServe(interval time.Duration) error

ListenAndServe main listening loop

func (*Handler) SendQuery

func (h *Handler) SendQuery(ip net.IP) (err error)

SendQuery send NBNS node status request query

func (*Handler) Stop

func (h *Handler) Stop()

Stop all goroutines

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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