tc_static 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_static.StaticInspect(config, policy)

Bases: baseclass.BaseClass

This class provides methods to check static traffic classification (TC) classifier matches

check_static(classifier_result, pkt)

Passed TCClassifierResult and Flow.Packet class objects Update the classifier_result match with boolean of result of match checks

is_valid_macaddress(value_to_check)

Passed a prospective MAC address and check that it is valid. Return 1 for is valid IP address and 0 for not valid

is_valid_ethertype(value_to_check)

Passed a prospective EtherType and check that it is valid. Can be hex (0x*) or decimal Return 1 for is valid IP address and 0 for not valid

is_valid_ip_space(value_to_check)

Passed a prospective IP address and check that it is valid. Can be IPv4 or IPv6 and can be range or have CIDR mask Return 1 for is valid IP address and 0 for not valid

is_valid_transport_port(value_to_check)

Passed a prospective TCP or UDP port number and check that it is an integer in the correct range. Return 1 for is valid port number and 0 for not valid port number

is_match_time_of_day(time_of_day_range, time_now=datetime.time(21, 47, 4, 30098))

Passed a time of day range (format HH:MM-HH:MM) and check to see if the current time is in that range. Return True if time is in range, otherwise False

is_match_macaddress(value_to_check1, value_to_check2)

Passed a two prospective MAC addresses and check to see if they are the same address. Return 1 for both the same MAC address and 0 for different

is_match_ethertype(value_to_check1, value_to_check2)

Passed a two prospective EtherTypes and check to see if they are the same. Return 1 for both the same EtherType and 0 for different Values can be hex or decimal and are 2 bytes in length

is_match_ip_space(ip_addr, ip_space)

Passed an IP address and an IP address space and check if the IP address belongs to the IP address space. If it does return 1 otherwise return 0