ctl->af = DEFAULT_AF; // should this obey the cmd line option?
ctl->Hostname = gtk_entry_get_text(GTK_ENTRY(entry));
- if (get_hostent_from_name(ctl, &res, ctl->Hostname) == 0) {
+ if (get_addrinfo_from_name(ctl, &res, ctl->Hostname) == 0) {
net_reopen(ctl, res);
freeaddrinfo(res);
net_send_batch(ctl);
would be to use gethostbyname(). We'll use getaddrinfo() instead
to generate the hostent.
*/
-int get_hostent_from_name(
+int get_addrinfo_from_name(
struct mtr_ctl *ctl,
struct addrinfo **res,
const char *name)
{
- printf("get_hostent_from_name: %x %s\n", ctl->af, name);
int gai_error;
struct addrinfo hints;
}
struct addrinfo *res = NULL;
- if (get_hostent_from_name(&ctl, &res, ctl.Hostname) != 0) {
+ if (get_addrinfo_from_name(&ctl, &res, ctl.Hostname) != 0) {
if (ctl.Interactive)
exit(EXIT_FAILURE);
else {
#define running_as_root() (getuid() == 0)
#endif
-int get_hostent_from_name(
+int get_addrinfo_from_name(
struct mtr_ctl *ctl,
struct addrinfo **res,
const char *name);