/*******************************************************************
 File:     IServices.h
 Purpose:  Internet services veneer
 Author:   Justin Fletcher
 Date:     02 Dec 1992
 ******************************************************************/

#ifndef __ISERVICES_H
#define __ISERVICES_H
#define Internet_GetServiceByPort 0x46440
#define Internet_GetServiceByName 0x46441
#define Internet_DecodeError      0x46442

typedef struct servent {
  char *servname;
  char **aliases;
  int  port;
  char *protocol; /* tcp or udp usually */
} servent;

/*********************************************** <c> Gerph *********
 Function:     getservbyport
 Description:  Reads the servent block for a service, given it's port
               This block is not guarenteed to remain constant, so
               copy it quickly.
 Parameters:   port = port number
               proto-> protocol name (tcp/udp), or 0 for default
 Returns:      pointer to servent block, or 0 if not known
 ******************************************************************/
servent *getservbyport(int port,char *proto);

/*********************************************** <c> Gerph *********
 Function:     getservbyname
 Description:  Reads the servent block for a service, given it's name
               This block is not guarenteed to remain constant, so
               copy it quickly.
 Parameters:   name-> name of the service (textual, or numeric)
               proto-> protocol name (tcp/udp), or 0 for default
 Returns:      pointer to servent block, or 0 if not known
 ******************************************************************/
servent *getservbyname(char *name,char *proto);

/*********************************************** <c> Gerph *********
 Function:     decodeerror
 Description:  Returns the textual version of the errno variable
               This should not be modified.
 Parameters:   errno = errno value
 Returns:      pointer to the textual version of the error, or 0
               if not known
 ******************************************************************/
   char *decodeerror(int errno);
#endif
