Documentation ¶
Index ¶
- Constants
- Variables
- func CountAllSetBitsInArr(arr []uint8) int
- func CountSetBitsInArr(arr []uint8, bPos int) int
- func HTTPProber(urls string) bool
- func Htonl(i uint32) uint32
- func Htons(i uint16) uint16
- func IPtonl(ip net.IP) uint32
- func IsBitSetInArr(arr []uint8, bPos int) bool
- func L4ServiceProber(sType string, sName string) bool
- func LogIt(l LogLevelT, format string, v ...interface{})
- func LogItInit(logFile string, logLevel LogLevelT, toTTY bool)
- func NltoIP(addr uint32) net.IP
- func Ntohl(i uint32) uint32
- func Ntohs(i uint16) uint16
- func SetBitInArr(arr []uint8, bPos int)
- func UnSetBitInArr(arr []uint8, bPos int)
- type Counter
- type LogLevelT
- type TrieData
- type TrieIterIntf
- type TrieRoot
Constants ¶
const ( TrieSuccess = -iota TrieErrGeneric TrieErrExists TrieErrNoEnt TrieErrNoMem TrieErrUnknown TrieErrPrefix )
return codes
const ( TrieJmpLength = 8 PrefixArrLenfth = (1 << (TrieJmpLength + 1)) - 1 PrefixArrNbits = ((PrefixArrLenfth + TrieJmpLength) & ^TrieJmpLength) / TrieJmpLength PtrArrLength = (1 << TrieJmpLength) PtrArrNBits = ((PtrArrLength + TrieJmpLength) & ^TrieJmpLength) / TrieJmpLength )
constants
Variables ¶
var ( LogTTY bool CurrLogLevel LogLevelT LogItEmer *log.Logger LogItAlert *log.Logger LogItCrit *log.Logger LogItErr *log.Logger LogItWarn *log.Logger LogItNotice *log.Logger LogItInfo *log.Logger LogItDebug *log.Logger )
variables used
Functions ¶
func CountAllSetBitsInArr ¶
CountAllSetBitsInArr - count set bits in an array of uint8
func CountSetBitsInArr ¶
CountSetBitsInArr - count set bits in an array of uint8 from bPos
func HTTPProber ¶
HTTPProber - Do a http probe for given url returns true/false depending on whether probing was successful
func IsBitSetInArr ¶
IsBitSetInArr - check given bPos bit is set in the array
func L4ServiceProber ¶
L4ServiceProber - Do a probe for L4 service end-points sType is "tcp" or "udp" sName is end-point IP address in string format returns true/false depending on whether probing was successful
func LogItInit ¶
LogItInit - Initialize the logger logFile - name of the logfile logLevel - specify current loglevel toTTY - specify if logs need to be redirected to TTY as well or not
func UnSetBitInArr ¶
UnSetBitInArr - unset bPos bit in the array
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter - context container
func NewCounter ¶
NewCounter - Allocate a set of counters
func (*Counter) GetCounter ¶
GetCounter - Get next available counter
func (*Counter) PutCounter ¶
PutCounter - Return a counter to the available list
type TrieData ¶
type TrieData interface { }
TrieData - Any user data to be associated with a trie node
type TrieIterIntf ¶
TrieIterIntf - Interface implementation needed for trie users to traverse and convert data
type TrieRoot ¶
type TrieRoot struct {
// contains filtered or unexported fields
}
TrieRoot - root of a trie data structure
func (*TrieRoot) AddTrie ¶
AddTrie - Add a trie entry cidr is the route in cidr format and data is any user-defined data returns 0 on success or non-zero error code on error
func (*TrieRoot) DelTrie ¶
DelTrie - Delete a trie entry cidr is the route in cidr format returns 0 on success or non-zero error code on error
func (*TrieRoot) FindTrie ¶
FindTrie - Lookup matching route as per longest prefix match IP is the IP address in string format returns the following : 1. 0 on success or non-zero error code on error 2. matching route in *net.IPNet form 3. user-defined data associated with the trie entry
func (*TrieRoot) Trie2String ¶
func (t *TrieRoot) Trie2String(tf TrieIterIntf)
Trie2String - stringify the trie table