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

int main() {
    struct protoent result;
    char buffer[128];
    
    while((getprotoent_r(&result,buffer,128)) != NULL) {
       printf("%s\n",result.p_name);  
    }
}

