Documentation ¶
Index ¶
- func AddDeviceEntry(key net.HardwareAddr, field string, value interface{}) error
- func AddEntry(table string, key interface{}, field string, value interface{}) error
- func AddHostEntry(key net.IP, field string, value interface{}) error
- func AddSessionEntry(key uint32, field string, value interface{}) error
- func AddUserEntry(key string, field string, value interface{}) error
- func DeleteDevice(key net.HardwareAddr) error
- func DeleteDictionary(table string, key interface{}) error
- func DeleteHost(key net.IP) error
- func DeleteSession(key uint32) error
- func DeleteUser(key string) error
- func Disable()
- func GetSessions() (map[uint32]map[string]interface{}, error)
- func Shutdown()
- func Startup()
- type Entry
- func GetAllEntries() ([]Entry, error)
- func GetDeviceEntry(key net.HardwareAddr, field string) (Entry, error)
- func GetDictionary(table string, key interface{}) ([]Entry, error)
- func GetEntry(table string, key interface{}, field string) (Entry, error)
- func GetHostEntry(key net.IP, field string) (Entry, error)
- func GetSessionEntry(key uint32, field string) (Entry, error)
- func GetTable(table string) ([]Entry, error)
- func GetUserEntry(key string, field string) (Entry, error)
- func (p Entry) GetBool() (bool, error)
- func (p Entry) GetIP() (net.IP, error)
- func (p Entry) GetInt() (uint32, error)
- func (p Entry) GetInt64() (uint64, error)
- func (p Entry) GetMac() (net.HardwareAddr, error)
- func (p Entry) GetString() (string, error)
- func (p Entry) GetValue() interface{}
- func (p Entry) Print()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDeviceEntry ¶
func AddDeviceEntry(key net.HardwareAddr, field string, value interface{}) error
AddDeviceEntry adds a field/value entry for the supplied mac key in the device table This is a convenience wrapper for AddEntry
func AddHostEntry ¶
AddHostEntry adds a field/value entry for the supplied ip key in the host table This is a convenience wrapper for AddEntry
func AddSessionEntry ¶
AddSessionEntry adds a field/value entry for the supplied int key in the session table This is a convenience wrapper for AddEntry
func AddUserEntry ¶
AddUserEntry adds a field/value entry for the supplied string key in the user table This is a convenience wrapper for AddEntry
func DeleteDevice ¶
func DeleteDevice(key net.HardwareAddr) error
DeleteDevice removes a dictionary from the device table This is a convenience wrapper for DeleteDictionary
func DeleteDictionary ¶
DeleteDictionary removes a dictionary with the supplied key in the supplied table
func DeleteHost ¶
DeleteHost removes a dictionary from the host table This is a convenience wrapper for DeleteDictionary
func DeleteSession ¶
DeleteSession removes a dictionary from the session table This is a convenience wrapper for DeleteDictionary
func DeleteUser ¶
DeleteUser removes a dictionary from the user table This is a convenience wrapper for DeleteDictionary
func GetSessions ¶ added in v0.1.2
GetSessions returns the session table
Types ¶
type Entry ¶
Entry holds a dictionary entry Table is the string name of the table the entry's dictionary is in Key is the key of this entry's dictionary in the table Field is the string name of the field for this entry in the dictionary Value is the value for this field stored in the dictionary
func GetAllEntries ¶
GetAllEntries gets all of entries for all known dictionaries This function returns an error if it cannot open or read /proc/net/dict/all
func GetDeviceEntry ¶
func GetDeviceEntry(key net.HardwareAddr, field string) (Entry, error)
GetDeviceEntry gets the dictionary entry from the device table with the specified key and field This is a convenience wrapper for GetEntry
func GetDictionary ¶
GetDictionary gets all of the dictionary entries for the supplied key This function will return an error if it cannot open or read /proc/net/dict/read
func GetEntry ¶
GetEntry gets the dictionary entry for the specified table, key and field This function returns an error if the requested entry cannot be found
func GetHostEntry ¶
GetHostEntry gets the dictionary entry from the host table with the specified key and field This is a convenience wrapper for GetEntry
func GetSessionEntry ¶
GetSessionEntry gets the dictionary entry from the session table with the specified key and field This is a convenience wrapper for GetEntry
func GetTable ¶ added in v0.1.2
GetTable gets all of the dictionary entries in the supplied table This function will return an error if it cannot open or read /proc/net/dict/read
func GetUserEntry ¶
GetUserEntry gets the dictionary entry from the user table with the specified key and field This is a convenience wrapper for GetEntry
func (Entry) GetBool ¶
GetBool gets an entry's bool value Given a dictionary Entry, return the entry's value field as a bool. If the entry's value is not a bool, return an error
func (Entry) GetIP ¶
GetIP gets an entry's IP value Given a dictionary Entry, return the entry's value field as a IP address. If the entry's value is not a IP address, return an error
func (Entry) GetInt ¶
GetInt gets an entry's integer value Given a dictionary Entry, return the entry's value field as a 32bit integer. If the entry's value is not a 32bit integer, return an error
func (Entry) GetInt64 ¶
GetInt64 gets an entry's 64 bit integer value Given a dictionary Entry, return the entry's value field as a 64bit integer. If the entry's value is not a 64bit integer, return an error
func (Entry) GetMac ¶
func (p Entry) GetMac() (net.HardwareAddr, error)
GetMac gets an entry's mac value Given a dictionary Entry, return the entry's value field as a MAC address. If the entry's value is not a MAC address, return an error
func (Entry) GetString ¶
GetString gets an entry's string value Given a dictionary Entry, return the entry's value field as a string. If the entry's value is not a string, return an error