  {
    .name = NULL,
    .port = 0
  }
};

uint16_t
GNUNET_GNS_service_port_name_to_number (const char *name);

uint16_t
GNUNET_GNS_service_port_name_to_number (const char *name)
{
  int i = 0;
  while (NULL != GNUNET_GNS_ServicePorts[i].name)
  {
    if (0 == strcmp (name, GNUNET_GNS_ServicePorts[i].name))
      return GNUNET_GNS_ServicePorts[i].port;
    i++;
  }
  return 0;
}

const char*
GNUNET_GNS_service_port_number_to_name (uint16_t port);

const char*
GNUNET_GNS_service_port_number_to_name (uint16_t port)
{
  int i = 0;
  while (NULL != GNUNET_GNS_ServicePorts[i].name)
  {
    if (port == GNUNET_GNS_ServicePorts[i].port)
      return GNUNET_GNS_ServicePorts[i].name;
    i++;
  }
  return NULL;
}


#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
#ifdef __cplusplus
}
#endif

#endif
