示例#1
0
def print_oessfvd(fvd):
    """
        Print FVD fields
        Args:
            fvd: OessFvd class
    """
    timestamp = str(datetime.fromtimestamp(fvd.timestamp))
    print('OESS FVD: %s:%s -> %s:%s time: %s' %
          (red(fvd.side_a), blue(fvd.port_a), red(fvd.side_z), blue(
              fvd.port_z), blue(timestamp)))
示例#2
0
def print_layer3(ip_addr):
    """
        Prints IP headers
    Args:
        ip: IP class
    """
    print(('IP Version: %d IP Header Length: %d TTL: %d Protocol: %d '
           'Source Address: %s Destination Address: %s') %
          (ip_addr.version, ip_addr.length, ip_addr.ttl, ip_addr.protocol,
           blue(ip_addr.s_addr), blue(ip_addr.d_addr)))