]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
macsec_linux: Add driver status information
authorJouni Malinen <j@w1.fi>
Mon, 24 Dec 2018 22:53:52 +0000 (00:53 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 24 Dec 2018 22:54:51 +0000 (00:54 +0200)
wpa_supplicant STATUS-DRIVER control interface command can now be used
to fetch the macsec_linux driver status information like parent
interface name.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/drivers/driver_macsec_linux.c

index 9a2643696236b2988a770c41e92c379f710a526a..4605ee64a1d635f104eaaf8d4aa9e16c7c60760e 100644 (file)
@@ -1331,6 +1331,30 @@ static int macsec_drv_disable_transmit_sa(void *priv, struct transmit_sa *sa)
 }
 
 
+static int macsec_drv_status(void *priv, char *buf, size_t buflen)
+{
+       struct macsec_drv_data *drv = priv;
+       int res;
+       char *pos, *end;
+
+       pos = buf;
+       end = buf + buflen;
+
+       res = os_snprintf(pos, end - pos,
+                         "ifname=%s\n"
+                         "ifi=%d\n"
+                         "parent_ifname=%s\n"
+                         "parent_ifi=%d\n",
+                         drv->common.ifname, drv->ifi,
+                         drv->ifname, drv->parent_ifi);
+       if (os_snprintf_error(end - pos, res))
+               return pos - buf;
+       pos += res;
+
+       return pos - buf;
+}
+
+
 const struct wpa_driver_ops wpa_driver_macsec_linux_ops = {
        .name = "macsec_linux",
        .desc = "MACsec Ethernet driver for Linux",
@@ -1363,4 +1387,6 @@ const struct wpa_driver_ops wpa_driver_macsec_linux_ops = {
        .delete_transmit_sa = macsec_drv_delete_transmit_sa,
        .enable_transmit_sa = macsec_drv_enable_transmit_sa,
        .disable_transmit_sa = macsec_drv_disable_transmit_sa,
+
+       .status = macsec_drv_status,
 };