1
0
Files
irix-657m-src/irix/cmd/netman/lib/protocols/ip_protoname.c
2022-09-29 17:59:04 +03:00

22 lines
410 B
C

/*
* Copyright 1988 Silicon Graphics, Inc. All rights reserved.
*
* Return a pointer to static store containing proto's name or decimal
* string representation.
*/
#include <netdb.h>
#include <stdio.h>
char *
ip_protoname(int proto)
{
struct protoent *pp;
static char buf[sizeof "ddd"];
pp = getprotobynumber(proto);
if (pp)
return pp->p_name;
(void) sprintf(buf, "%-3d", proto);
return buf;
}