Development discussion of WireGuard
 help / color / mirror / Atom feed
* Python Wrapper for wireguard-tools
@ 2020-08-21 14:04 Andrew Roth
  2020-08-22 19:05 ` Jason A. Donenfeld
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andrew Roth @ 2020-08-21 14:04 UTC (permalink / raw)
  To: wireguard

Hello,

Recently joined the list, but reviewed the archives as best I could.
I figured before I get too far in writing this, I should ask here.

I'm looking for a way to create and configure WireGaurd interfaces
programmatically using Python.  Has anyone created a Python wrapper
for the wireguard-tools?  If not, could I try my hand at it?

In my research, I was not able to find any true libraries supporting
configuring a WireGuard implementation.  Since wireguard-tools [1] is
cross-platform, and Python is cross-platform, I wanted a
cross-platform library to configure WireGuard interfaces.  This would
help application programmers or tool developers who want to utilize
WireGuard as part of the application or tool written in Python,
potentially cross-platform.

I did see wgnlpy [2], but don't think it is a fit since it relies on
Netlink (Linux kernel interface), so it's not cross-platform.  I also
found a few other packages on Pypi, but none of them seemed to
interface with the WireGuard module interfaces.

In the wireguard-tools repository, I noticed the embeddable-wg-library
[3] with C source and header.  Python (using CFFI) supports creating
an extension module that is compiled from C sources to directly invoke
the target C function [4].  It claims to be fast, simple, and
platform-agnostic (by that, I mean it can be compiled for any
platform).  I am planning on writing a python module to expose the C
functions from the embeddable-wg-library using CFFI.

Does this make sense?  Any comments, gotchas, or limitations?

Thanks for your time,
Andrew

[1]:  https://git.zx2c4.com/wireguard-tools/about/
[2]:  https://github.com/ArgosyLabs/wgnlpy
[3]:  https://git.zx2c4.com/wireguard-tools/tree/contrib/embeddable-wg-library
[4]:  https://cffi.readthedocs.io/en/latest/overview.html#api-mode-calling-c-sources-instead-of-a-compiled-library

--

~Andrew Roth
http://www.andrewjroth.com

"Our greatest glory is not in never falling, but in getting up every
time we do." -Confucius

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

end of thread, other threads:[~2020-08-31 20:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 14:04 Python Wrapper for wireguard-tools Andrew Roth
2020-08-22 19:05 ` Jason A. Donenfeld
2020-08-22 21:14   ` Derrick Lyndon Pallas
2020-08-31 20:40   ` Matt Layher
2020-08-24 14:37 ` Arti Zirk
2020-08-24 18:57 ` Ryan Whelan
     [not found]   ` <CAKmhVko10JYo__SfNGujkeVV_YCPVLtBkLzcXoMfo7X3qjD5pA@mail.gmail.com>
2020-08-24 19:38     ` Mo Balaa
2020-08-27  8:34       ` Jason A. Donenfeld
2020-08-27  8:59         ` Mo Balaa

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).