Thursday, April 15, 2010

getservbyname programming


The getservbyname() function returns a servent structure for the entry from the database that matches the service name using protocol proto. If proto is NULL, any protocol will be matched. A connection is opened to the database if necessary.


getservbyname("ftp", "tcp") = 0x7fcc5248b8c0

The servent structure is defined in as follows:

struct servent {
char *s_name; /* official service name */
char **s_aliases; /* alias list */
int s_port; /* port number */
char *s_proto; /* protocol to use */
}




Stallman, Richard: The Realization
[audio:http://www.freeinfosociety.com/media/sounds/72.mp3]