/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that prints the name of protocol. */
#include <stdlib.h>
#include <stdio.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>

int main() {
    struct protoent *protocol;
    int number = 17;  /* udp number */

    protocol = getprotobynumber(number);
    printf("%s\n",protocol->p_name); /* protocol name */
    printf("%d\n",protocol->p_proto);  /*protocol number */
    printf("%s\n",protocol->p_aliases[0]); /*protocol aliases */
}
