Logo Search packages:      
Sourcecode: libnl version File versions  Download package

struct addrinfo* nl_addr_info ( struct nl_addr *  addr  )  [read]

Call getaddrinfo() for an abstract address object.

  • addr Abstract address object.
Calls getaddrinfo() for the specified abstract address in AI_NUMERICHOST mode.

Note:
The caller is responsible for freeing the linked list using the interface provided by getaddrinfo(3).
Returns:
A linked list of addrinfo handles or NULL with an error message associated.

Definition at line 639 of file addr.c.

References nl_addr2str().

{
      int err;
      struct addrinfo *res;
      char buf[INET6_ADDRSTRLEN+5];
      struct addrinfo hint = {
            .ai_flags = AI_NUMERICHOST,
            .ai_family = addr->a_family,
      };

      nl_addr2str(addr, buf, sizeof(buf));

      err = getaddrinfo(buf, NULL, &hint, &res);
      if (err != 0) {
            nl_error(err, gai_strerror(err));
            return NULL;
      }

      return res;
}


Generated by  Doxygen 1.6.0   Back to index