#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; }