aboutsummaryrefslogtreecommitdiff
path: root/gns-service-port-numbers/h.footer
blob: e2f02f9ba5560a835497b2872f7d54f9ae686b3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  {
    .name = NULL,
    .port = 0
  }
};

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)
{
  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