#include <cat/catutil.h>
catnet_serv *catnet_servbyname(const char *name, const char *proto);
typedef struct catnet_serv { char **names; /* name, alias, ..., NULL */ int port; /* port number */ } catnet_serv;
The names parameter will contain any aliases for the service, and port will contain the port number for the service.
The returned pointer points to dynamically allocated memory that needs to be freed by the caller with a call to free().