]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip/iplink_virt_wifi: add support for virt_wifi
authorBaligh Gasmi <gasmibal@gmail.com>
Mon, 18 Apr 2022 23:25:07 +0000 (01:25 +0200)
committerDavid Ahern <dsahern@kernel.org>
Wed, 20 Apr 2022 02:30:08 +0000 (20:30 -0600)
Add support for creating virt_wifi devices type.

Syntax:
$ ip link add link eth0 name wlan0 type virt_wifi

Signed-off-by: Baligh Gasmi <gasmibal@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/Makefile
ip/iplink.c
ip/iplink_virt_wifi.c [new file with mode: 0644]
man/man8/ip-link.8.in

index 0f14c609a4f0e2e3dc93b9609f1f11d140667545..e06a7c8460d43aa9e21a0c97a7462f1311c6cc5b 100644 (file)
@@ -12,7 +12,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
     iplink_geneve.o iplink_vrf.o iproute_lwtunnel.o ipmacsec.o ipila.o \
     ipvrf.o iplink_xstats.o ipseg6.o iplink_netdevsim.o iplink_rmnet.o \
     ipnexthop.o ipmptcp.o iplink_bareudp.o iplink_wwan.o ipioam6.o \
-    iplink_amt.o iplink_batadv.o iplink_gtp.o
+    iplink_amt.o iplink_batadv.o iplink_gtp.o iplink_virt_wifi.o
 
 RTMONOBJ=rtmon.o
 
index 7accd3786586b7a3125007c0bf7cd579351086d0..dc76a12b58eb2d041b4bf15189daf788f477e097 100644 (file)
@@ -57,7 +57,7 @@ void iplink_types_usage(void)
                "          macsec | macvlan | macvtap |\n"
                "          netdevsim | nlmon | rmnet | sit | team | team_slave |\n"
                "          vcan | veth | vlan | vrf | vti | vxcan | vxlan | wwan |\n"
-               "          xfrm }\n");
+               "          xfrm | virt_wifi }\n");
 }
 
 void iplink_usage(void)
diff --git a/ip/iplink_virt_wifi.c b/ip/iplink_virt_wifi.c
new file mode 100644 (file)
index 0000000..8d3054c
--- /dev/null
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * iplink_virt_wifi.c  A fake implementation of cfg80211_ops that can be tacked
+ *                     on to an ethernet net_device to make it appear as a
+ *                     wireless connection.
+ *
+ * Authors:            Baligh Gasmi <gasmibal@gmail.com>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "utils.h"
+#include "ip_common.h"
+
+static void virt_wifi_print_help(struct link_util *lu,
+               int argc, char **argv, FILE *f)
+{
+       fprintf(f, "Usage: ... virt_wifi \n");
+}
+
+struct link_util virt_wifi_link_util = {
+       .id             = "virt_wifi",
+       .print_help     = virt_wifi_print_help,
+};
index ee189abc371d7ed27dbbf1efe257af21e0b6fb28..ec3cc4297da5664385b3a97142d401bee20574f4 100644 (file)
@@ -244,7 +244,8 @@ ip-link \- network device configuration
 .BR netdevsim " |"
 .BR rmnet " |"
 .BR xfrm " |"
-.BR gtp " ]"
+.BR gtp " |"
+.BR virt_wifi " ]"
 
 .ti -8
 .IR ETYPE " := [ " TYPE " |"
@@ -396,6 +397,9 @@ Link types:
 .sp
 .BR gtp
 - GPRS Tunneling Protocol
+.sp
+.BR virt_wifi
+- rtnetlink wifi simulation device
 .in -8
 
 .TP