tc_identity module

This module is part of the nmeta suite running on top of Ryu SDN controller to provide network identity and flow (traffic classification) metadata

class tc_identity.IdentityInspect(config)

Bases: baseclass.BaseClass

This class is instantiated by tc_policy.py (class: TrafficClassificationPolicy) and provides methods to ingest identity updates and query identities

check_dns(dns_name, pkt, ident, is_regex=False)

Passed a DNS name, flows packet object, an instance of the identities class and a regex boolean (if true, DNS name is treated as regex). Return True or False based on whether or not the packet has a source or destination IP address that has been resolved from the DNS name. Uses methods of the Identities class to work this out. Returns boolean

check_identity(condition, pkt, ident)

Checks if a given packet matches a given identity match rule. Passed condition, flows packet and identities objects and update the condition match based on whether or not either of the packet IP addresses matches the identity attribute/value. Uses methods of the Identities class to work this out

check_lldp(host_name, pkt, ident, is_regex=False)

Passed a hostname, flows packet object, an instance of the identities class and a regex boolean (if true, hostname is treated as regex). Return True or False based on whether or not the packet has a source or destination IP address that matches the IP address registered to the given hostname (if one even exists). Uses methods of the Identities class to work this out. Returns boolean