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

int main() {
    struct netent *net;
    int type= 10;
    long number = 1;
    net = getnetbyaddr(number, type);
    printf("%s\n",net->n_name); /* net name */
    printf("%d\n",net->n_net);  /* net number */
    printf("%s\n",net->n_aliases[0]); /* net aliases */
    printf("%d\n",net->n_addrtype); /* the type of network number */
}
