def ProtocolNameToNumber(protocols, proto_to_num, name_to_num_map):
  """Convert a protocol name to a numeric value.

  Args:
    protocols: list of protocol names to inspect
    proto_to_num: list of protocol names that should be converted to numbers
    name_to_num_map: map of protocol names to protocol numbers

  Returns:
    return_proto: list of protocol names, converted if applicable
  """
  return_proto = []

  for protocol in protocols:
    if protocol in proto_to_num:
      return_proto.append(name_to_num_map[protocol])
    else:
      return_proto.append(protocol)

  return return_proto