Documentation ¶
Index ¶
- Constants
- type CName
- type DNSMap
- type Domain
- type Filter
- type IPCache
- type IPMap
- type Pattern
- type Prefix
- type Service
- type ServiceID
- type ServiceMap
- func (sm *ServiceMap) ConfigServiceMap(services []Service) error
- func (sm *ServiceMap) GetId(name string) (ServiceID, bool)
- func (sm *ServiceMap) GetName(id ServiceID) (string, bool)
- func (sm *ServiceMap) GetService(id ServiceID) (*Service, bool)
- func (sm *ServiceMap) LookupIP(ip string) ([]ServiceID, bool)
- func (sm *ServiceMap) ParseDNSResponse(dns layers.DNS)
Constants ¶
const ( // NotFoundEntryTimeout is the expire time to recheck for IPs not found NotFoundEntryTimeout int64 = 60 * 60 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNSMap ¶
type DNSMap struct {
// contains filtered or unexported fields
}
DNSData contains the saved entries extracted from DNS queries
func (*DNSMap) ParseDNSResponseAllMatches ¶
func (dc *DNSMap) ParseDNSResponseAllMatches(dns layers.DNS, pTs int64) (string, []string, []ServiceID, bool, int64)
ParseDNSResponseAllMatches matches a DNS response to the configured services. Returns all matching entries. First tries to match by domain, then by regex, and finally by IP address.
func (*DNSMap) ParseDNSResponseFirstMatch ¶
func (dc *DNSMap) ParseDNSResponseFirstMatch(dns layers.DNS) (string, string, []ServiceID, bool, int64)
ParseDNSResponseFirstMatch matches a DNS response to the configured services. Returns the first matching entry. First tries to match by domain, then by regex, and finally by IP address.
type IPCache ¶
type IPCache struct {
IPCacheMap *cache.SimpleTimeCache
}
IPCache contains the saved entries extracted from DNS queries and IP prefix matches
type IPMap ¶
type IPMap struct {
// contains filtered or unexported fields
}
IPMap contains the saved entries extracted from DNS queries
type ServiceMap ¶
type ServiceMap struct {
// contains filtered or unexported fields
}
ServiceMap contains all the data structures required to support service mappings
func NewServiceMap ¶
func NewServiceMap(cleanupTime, evictTime time.Duration) (*ServiceMap, error)
NewServiceMap generates a new ServiceMap structure
func (*ServiceMap) ConfigServiceMap ¶
func (sm *ServiceMap) ConfigServiceMap(services []Service) error
func (*ServiceMap) GetService ¶
func (sm *ServiceMap) GetService(id ServiceID) (*Service, bool)
func (*ServiceMap) LookupIP ¶
func (sm *ServiceMap) LookupIP(ip string) ([]ServiceID, bool)
Lookup allows to lookup entries in the cache map
func (*ServiceMap) ParseDNSResponse ¶
func (sm *ServiceMap) ParseDNSResponse(dns layers.DNS)
ParseDNSResponse matches a DNS response to the configured services. First tries to match by domain, then by regex, and finally by IP address.