# Log Parser for RTI Connext.
#
#   Copyright 2016 Real-Time Innovations, Inc.
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
"""Function helpers for log parsing.

The module contains useful functions to parse several fields from log messages.

Functions:
  + check_periodic: Check if the given event is periodic.
  + compare_times: Compare if the time clock times are equal.
  + add_statistics_packets: Add the given packet to the packet statistics.
  + add_statistics_bandwidth: Add the given packet to the bandwidth statistics.
  + obfuscate: Obfuscate the given text.
  + get_oid: Get a name for the entity ID in hexadecimal text format.
  + is_builtin_entity: Return if the OID hex number is for a built-in entity.
  + get_data_packet_name: Return the DATA packet name.
  + get_topic_name: Get the topic name, obfuscating if needed.
  + get_type_name: Get the type name, obfuscating if needed.
  + get_port_number: Get the port number, obfuscating if needed.
  + get_port_name: Get the domain ID and index of the port.
  + get_participant: Get the participant ID from the GUID.
  + get_locator: Parse the locator and convert to text.