Practical.c 270 B

123456789101112
  1. #include <netdb.h>
  2. #include <stddef.h>
  3. #include "Practical.h"
  4. int proto_get_num(const char *name) {
  5. struct protoent *protoent = getprotobyname(name);
  6. if (protoent == NULL) {
  7. DieWithSystemMessage("getprotobyname");
  8. }
  9. return protoent->p_proto;
  10. }