Hi Sagun,

Today, the libwlan APIs implementation uses heavily the ioctls sent to the 
wlan links. For example:

static int
open_link(const char *link)
{
         char    linkname[MAXPATHLEN];
         int     fd;

         if (link == NULL)
                 return (-1);

         (void) snprintf(linkname, MAXPATHLEN, "/dev/%s", link);
         if ((fd = open(linkname, O_RDWR)) < 0)
                 return (-1);
        ...
}

dladm_status_t
dladm_wlan_connect(const char *link, ...)
{
         int                     fd;

         if ((fd = open_link(link)) < 0)
                 return (DLADM_STATUS_LINKINVAL);

        ...

         if (do_get_linkstatus(fd, gbuf) < 0) {         <----
                 status = DLADM_STATUS_FAILED;
                 goto done;
         }
        ...
}

and do_get_linkstatus() function sends WLAN_GET_PARAM ioctl to the specific 
link.

I would think that this should be use libdlpi functions, especially after 
vanity naming, it should open the /dev/net nodes instead of /dev nodes. But 
it seems that today libdlpi doesn't seem to have routines to send M_IOCTL 
messages.

Should I just use dlpi_fd() to get fd and send ioctl instead?

Thanks
- Cathy

Reply via email to