13 lines
270 B
C
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;
|
|
}
|