netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ip/iplink_virt_wifi: add support for virt_wifi
@ 2022-04-17 22:53 Baligh Gasmi
  2022-04-18  4:39 ` Benjamin Poirier
  2022-04-18 15:06 ` Stephen Hemminger
  0 siblings, 2 replies; 9+ messages in thread
From: Baligh Gasmi @ 2022-04-17 22:53 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, David Ahern, Baligh Gasmi

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>
---
 ip/Makefile           |  2 +-
 ip/iplink_virt_wifi.c | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 ip/iplink_virt_wifi.c

diff --git a/ip/Makefile b/ip/Makefile
index 0f14c609..e06a7c84 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -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
 
diff --git a/ip/iplink_virt_wifi.c b/ip/iplink_virt_wifi.c
new file mode 100644
index 00000000..28157d85
--- /dev/null
+++ b/ip/iplink_virt_wifi.c
@@ -0,0 +1,24 @@
+/*
+ * 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,
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ip/iplink_virt_wifi: add support for virt_wifi
  2022-04-17 22:53 [PATCH] ip/iplink_virt_wifi: add support for virt_wifi Baligh Gasmi
@ 2022-04-18  4:39 ` Benjamin Poirier
  2022-04-18 15:06 ` Stephen Hemminger
  1 sibling, 0 replies; 9+ messages in thread
From: Benjamin Poirier @ 2022-04-18  4:39 UTC (permalink / raw)
  To: Baligh Gasmi; +Cc: netdev, Stephen Hemminger, David Ahern

On 2022-04-18 00:53 +0200, Baligh Gasmi wrote:
> 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>
> ---
>  ip/Makefile           |  2 +-
>  ip/iplink_virt_wifi.c | 24 ++++++++++++++++++++++++

I think man/man8/ip-link.8.in should also be updated.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ip/iplink_virt_wifi: add support for virt_wifi
  2022-04-17 22:53 [PATCH] ip/iplink_virt_wifi: add support for virt_wifi Baligh Gasmi
  2022-04-18  4:39 ` Benjamin Poirier
@ 2022-04-18 15:06 ` Stephen Hemminger
  2022-04-18 22:18   ` [PATCH v2] " Baligh Gasmi
                     ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: Stephen Hemminger @ 2022-04-18 15:06 UTC (permalink / raw)
  To: Baligh Gasmi; +Cc: netdev, David Ahern

On Mon, 18 Apr 2022 00:53:18 +0200
Baligh Gasmi <gasmibal@gmail.com> wrote:

> diff --git a/ip/iplink_virt_wifi.c b/ip/iplink_virt_wifi.c
> new file mode 100644
> index 00000000..28157d85
> --- /dev/null
> +++ b/ip/iplink_virt_wifi.c
> @@ -0,0 +1,24 @@
> +/*
> + * 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>


Please add SPDX license header at start of file.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] ip/iplink_virt_wifi: add support for virt_wifi
  2022-04-18 15:06 ` Stephen Hemminger
@ 2022-04-18 22:18   ` Baligh Gasmi
  2022-04-18 23:15     ` Stephen Hemminger
  2022-04-18 22:28   ` [PATCH v3] " Baligh Gasmi
  2022-04-18 23:25   ` [PATCH v4] " Baligh Gasmi
  2 siblings, 1 reply; 9+ messages in thread
From: Baligh Gasmi @ 2022-04-18 22:18 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, David Ahern, Baligh Gasmi

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>
---
 ip/Makefile           |  2 +-
 ip/iplink.c           |  2 +-
 ip/iplink_virt_wifi.c | 26 ++++++++++++++++++++++++++
 man/man8/ip-link.8.in |  6 +++++-
 4 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 ip/iplink_virt_wifi.c

diff --git a/ip/Makefile b/ip/Makefile
index 0f14c609..e06a7c84 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -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
 
diff --git a/ip/iplink.c b/ip/iplink.c
index 7accd378..dc76a12b 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -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
index 00000000..dce14462
--- /dev/null
+++ b/ip/iplink_virt_wifi.c
@@ -0,0 +1,26 @@
+/*
+ * 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>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#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,
+};
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index ee189abc..5fb4dcd3 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -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
+.B virt_wifi
+- rtnetlink wifi simulation device
 .in -8
 
 .TP
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3] ip/iplink_virt_wifi: add support for virt_wifi
  2022-04-18 15:06 ` Stephen Hemminger
  2022-04-18 22:18   ` [PATCH v2] " Baligh Gasmi
@ 2022-04-18 22:28   ` Baligh Gasmi
  2022-04-18 23:25   ` [PATCH v4] " Baligh Gasmi
  2 siblings, 0 replies; 9+ messages in thread
From: Baligh Gasmi @ 2022-04-18 22:28 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, David Ahern, Baligh Gasmi

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>
---
 ip/Makefile           |  2 +-
 ip/iplink.c           |  2 +-
 ip/iplink_virt_wifi.c | 26 ++++++++++++++++++++++++++
 man/man8/ip-link.8.in |  6 +++++-
 4 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 ip/iplink_virt_wifi.c

diff --git a/ip/Makefile b/ip/Makefile
index 0f14c609..e06a7c84 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -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
 
diff --git a/ip/iplink.c b/ip/iplink.c
index 7accd378..dc76a12b 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -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
index 00000000..dce14462
--- /dev/null
+++ b/ip/iplink_virt_wifi.c
@@ -0,0 +1,26 @@
+/*
+ * 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>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#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,
+};
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index ee189abc..ec3cc429 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] ip/iplink_virt_wifi: add support for virt_wifi
  2022-04-18 22:18   ` [PATCH v2] " Baligh Gasmi
@ 2022-04-18 23:15     ` Stephen Hemminger
  2022-04-18 23:25       ` Baligh GASMI
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2022-04-18 23:15 UTC (permalink / raw)
  To: Baligh Gasmi; +Cc: netdev, David Ahern

On Tue, 19 Apr 2022 00:18:54 +0200
Baligh Gasmi <gasmibal@gmail.com> wrote:

> +/*
> + * 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>
> + *
> + * SPDX-License-Identifier: GPL-2.0
> + */

The SPDX License Id must be first line of the file.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v4] ip/iplink_virt_wifi: add support for virt_wifi
  2022-04-18 15:06 ` Stephen Hemminger
  2022-04-18 22:18   ` [PATCH v2] " Baligh Gasmi
  2022-04-18 22:28   ` [PATCH v3] " Baligh Gasmi
@ 2022-04-18 23:25   ` Baligh Gasmi
  2022-04-20  2:40     ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 9+ messages in thread
From: Baligh Gasmi @ 2022-04-18 23:25 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, David Ahern, Baligh Gasmi

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>
---
 ip/Makefile           |  2 +-
 ip/iplink.c           |  2 +-
 ip/iplink_virt_wifi.c | 25 +++++++++++++++++++++++++
 man/man8/ip-link.8.in |  6 +++++-
 4 files changed, 32 insertions(+), 3 deletions(-)
 create mode 100644 ip/iplink_virt_wifi.c

diff --git a/ip/Makefile b/ip/Makefile
index 0f14c609..e06a7c84 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -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
 
diff --git a/ip/iplink.c b/ip/iplink.c
index 7accd378..dc76a12b 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -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
index 00000000..8d3054cd
--- /dev/null
+++ b/ip/iplink_virt_wifi.c
@@ -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,
+};
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index ee189abc..ec3cc429 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] ip/iplink_virt_wifi: add support for virt_wifi
  2022-04-18 23:15     ` Stephen Hemminger
@ 2022-04-18 23:25       ` Baligh GASMI
  0 siblings, 0 replies; 9+ messages in thread
From: Baligh GASMI @ 2022-04-18 23:25 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: open list:NETWORKING [GENERAL], David Ahern

Sorry, I didn't catch that !

Le mar. 19 avr. 2022 à 01:15, Stephen Hemminger
<stephen@networkplumber.org> a écrit :
>
> On Tue, 19 Apr 2022 00:18:54 +0200
> Baligh Gasmi <gasmibal@gmail.com> wrote:
>
> > +/*
> > + * 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>
> > + *
> > + * SPDX-License-Identifier: GPL-2.0
> > + */
>
> The SPDX License Id must be first line of the file.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v4] ip/iplink_virt_wifi: add support for virt_wifi
  2022-04-18 23:25   ` [PATCH v4] " Baligh Gasmi
@ 2022-04-20  2:40     ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-20  2:40 UTC (permalink / raw)
  To: Baligh GASMI; +Cc: netdev, stephen, dsahern

Hello:

This patch was applied to iproute2/iproute2-next.git (main)
by David Ahern <dsahern@kernel.org>:

On Tue, 19 Apr 2022 01:25:07 +0200 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [v4] ip/iplink_virt_wifi: add support for virt_wifi
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=ee53174bd977

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-04-20  2:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-17 22:53 [PATCH] ip/iplink_virt_wifi: add support for virt_wifi Baligh Gasmi
2022-04-18  4:39 ` Benjamin Poirier
2022-04-18 15:06 ` Stephen Hemminger
2022-04-18 22:18   ` [PATCH v2] " Baligh Gasmi
2022-04-18 23:15     ` Stephen Hemminger
2022-04-18 23:25       ` Baligh GASMI
2022-04-18 22:28   ` [PATCH v3] " Baligh Gasmi
2022-04-18 23:25   ` [PATCH v4] " Baligh Gasmi
2022-04-20  2:40     ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).