| 62 | */ |
| 63 | #ifdef RADCLI |
| 64 | uint32_t rc_get_ipaddr (char *host) |
| 65 | { |
| 66 | const struct hostent* he; |
| 67 | struct in_addr** addr_list; |
| 68 | |
| 69 | he=resolvehost(host, 0/*do test if is ip*/); |
| 70 | if (!he) { |
| 71 | LM_ERR("Can't resolve host: %s\n", host); |
| 72 | return 0; |
| 73 | } |
| 74 | /* FIXME the function is not for IPV6 */ |
| 75 | addr_list = (struct in_addr **)he->h_addr_list; |
| 76 | if (addr_list[0]) |
| 77 | return addr_list[0]->s_addr; |
| 78 | |
| 79 | return 0; |
| 80 | |
| 81 | } |
| 82 | #endif |
| 83 | |
| 84 |
no test coverage detected