Files
tcp-ip-sockets-in-c/common/Practical.c
2026-09-06 17:43:06 +03:00

13 lines
270 B
C

#include <netdb.h>
#include <stddef.h>
#include "Practical.h"
int proto_get_num(const char *name) {
struct protoent *protoent = getprotobyname(name);
if (protoent == NULL) {
DieWithSystemMessage("getprotobyname");
}
return protoent->p_proto;
}