+ if (!strlen(host))
+ goto bad_host;
+
+ modep = NULL;
+ portp = sep;
+ sep = strchr(portp, '/');
+ if (sep) {
+ *sep = '\0';
+ modep = sep + 1;
+ }
+
+ port = strtol(portp, NULL, 10);
+ if (!port || port > 65535)
+ goto bad_host;
+
+ if (modep) {
+ if (!strncmp("tcp", modep, strlen(modep)) ||
+ !strncmp("TCP", modep, strlen(modep)))
+ nd->net_protocol = IPPROTO_TCP;
+ else if (!strncmp("udp", modep, strlen(modep)) ||
+ !strncmp("UDP", modep, strlen(modep)))
+ nd->net_protocol = IPPROTO_UDP;
+ else
+ goto bad_host;
+ } else
+ nd->net_protocol = IPPROTO_TCP;