| 204 | #define SETNUMPORTS(x,y) ((x) = ((x) & 0xffff0000) | (y)) |
| 205 | |
| 206 | static void |
| 207 | StrToAddr (const char* str, struct in_addr* addr) |
| 208 | { |
| 209 | struct hostent* hp; |
| 210 | |
| 211 | if (inet_aton (str, addr)) |
| 212 | return; |
| 213 | #ifdef FSTACK |
| 214 | else |
| 215 | errx (1, "invalid addr %d", addr->s_addr); |
| 216 | #else |
| 217 | |
| 218 | hp = gethostbyname (str); |
| 219 | if (!hp) |
| 220 | errx (1, "unknown host %s", str); |
| 221 | |
| 222 | memcpy (addr, hp->h_addr, sizeof (struct in_addr)); |
| 223 | #endif |
| 224 | } |
| 225 | |
| 226 | static int |
| 227 | StrToPortRange (const char* str, const char* proto, port_range *portRange) |
no test coverage detected