def on_query_udpv4_interfaces(match, state): """It happens when it queries the interfaces.""" flags = { 0x01: "UP", 0x02: "BROADCAST", 0x04: "LOOPBACK", 0x08: "POINTOPOINT", 0x10: "MULTICAST", 0x20: "RUNNING" } addr = get_participant(hex2ip(match[0], True), state) flag = int(match[1], 16) flag_name = "" for bit in flags: if flag & bit != 0: flag_name += flags[bit] + "|" log_event("Interface: %s is %s" % (addr, flag_name[:-1]), state, 2)
def on_skipped_interface(match, state): """It happens when an interface is skipped.""" log_event("Skipped interface: %s" % match[0], state, 2)
def on_create_reader(match, state): """It happens for new DataReader.""" topic = get_topic_name(match[0], state) log_event("Created reader for topic '%s'" % topic, state)
def on_delete_reader(match, state): """It happens for deleted DataReaders.""" topic = get_topic_name(match[0], state) log_event("Deleted reader for topic '%s'" % topic, state)
def on_create_writer(match, state): """It happens for new DataWriters.""" topic = get_topic_name(match[0], state) log_event("Created writer for topic '%s'" % topic, state)
def on_delete_topic(match, state): """It happens for deleted topics.""" topic = get_topic_name(match[0], state) typ = get_type_name(match[1], state) log_event("Deleted topic, name: '%s', type: '%s'" % (topic, typ), state, 1)
def on_create_cft(match, state): """It happens for new CFT.""" topic = get_topic_name(match[0], state) log_event("Created ContentFilteredTopic, name: '%s'" % topic, state)
def on_delete_participant(match, state): """It happens for deleted participants.""" log_event( "Deleted participant, domain: %3s index: %s" % (match[0], match[1]), state)
def on_custom_log(match, state): """Parse a log with a custom prefix.""" log_event("[App] " + match[0], state)