<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;color:#0b5394">Hi Thomas,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;color:#0b5394"><br></div><div class="gmail_default" style="color:rgb(11,83,148)"><font face="tahoma, sans-serif">I want to generate a NM.gir file, so I think it may require building NetworkManager from source. And I looked at the CONTRIBUTING.md at section </font><a href="https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md#building-from-source" style="font-family:tahoma,sans-serif">Building from source</a><font face="tahoma, sans-serif">. Which options I suppose to add for CONFIGURE_OPTIONS when doing this command?</font><br><pre class="gmail-code gmail-highlight" lang="plaintext" style="font-family:tahoma,sans-serif"><span lang="plaintext" class="gmail-line" id="gmail-LC1">meson build $CONFIGURE_OPTIONS</span>
<span lang="plaintext" class="gmail-line" id="gmail-LC2">ninja -C build</span>
<span lang="plaintext" class="gmail-line" id="gmail-LC3"># optional: sudo meson install -C build</span><br></pre><pre class="gmail-code gmail-highlight" lang="plaintext" style="font-family:tahoma,sans-serif"><span lang="plaintext" class="gmail-line"><br></span></pre><pre class="gmail-code gmail-highlight" lang="plaintext" style="font-family:tahoma,sans-serif"><span lang="plaintext" class="gmail-line">Because of this note "</span>Beware to set the correct <code>$CONFIGURE_OPTIONS</code><span style="font-family:tahoma,sans-serif">. In particular, you may not want the default installation prefix and not overwrite files in </span><code>/usr</code><span style="font-family:tahoma,sans-serif">." Therefore I don't want my system to crash. </span></pre><pre class="gmail-code gmail-highlight" lang="plaintext" style=""><font face="tahoma, sans-serif">I'm based on arch linux.</font></pre><pre class="gmail-code gmail-highlight" lang="plaintext" style=""><font face="tahoma, sans-serif"><br></font></pre><pre class="gmail-code gmail-highlight" lang="plaintext" style=""><font face="tahoma, sans-serif">Thank you.</font></pre>
<h3 dir="auto" style="font-family:tahoma,sans-serif">
<a aria-hidden="true" href="#fedora" class="gmail-anchor" id="gmail-user-content-fedora"></a></h3></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Vào Th 4, 6 thg 12, 2023 vào lúc 14:46 amidamaru rookie <<a href="mailto:ardtimeit@gmail.com">ardtimeit@gmail.com</a>> đã viết:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(11,83,148)">Thanks for your detailed guideline. I really appreciate it.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(11,83,148)">I'd like to implement it in Rust and I know it would be much more work. </div><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(11,83,148)">Cheers,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(11,83,148)">Thao.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Vào Th 4, 6 thg 12, 2023 vào lúc 01:17 Thomas Haller <<a href="mailto:thaller@redhat.com" target="_blank">thaller@redhat.com</a>> đã viết:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 2023-12-05 at 23:56 +0700, amidamaru rookie wrote:<br>
> Thanks for your advice. I will play some code first based on<br>
> your suggestion and check networkmanager code for adding new type<br>
> before submitting a MR.<br>
> <br>
> Cheers,<br>
<br>
to have a working VPN plugin, you need at least a file<br>
<br>
/usr/lib/NetworkManager/VPN/*.name<br>
<br>
and a executable <br>
<br>
[VPN Connection]<br>
program=/usr/libexec/nm-*-service<br>
<br>
And that executable is spawned by NetworkManager, and is expected to<br>
service the D-Bus interface for VPN plugins.<br>
<br>
Also, there is a client library that can provide meta-data (information<br>
about the plugin) to client applications (nmcli, nm-connection-editor).<br>
Those are<br>
<br>
[libnm]<br>
plugin=libnm-*.so<br>
<br>
These provide a nm_vpn_editor_plugin_factory() function, to load a<br>
NMVpnEditorPlugin. That API is in libnm (and implemented by the<br>
plugin).<br>
<br>
There is also a helper tool for requesting secrets<br>
<br>
[GNOME]<br>
auth-dialog=/usr/libexec/nm-openvpn-auth-dialog<br>
<br>
which again implements some API (being forked by nm-applet, and<br>
communicating via stdin/stdout).<br>
<br>
<br>
The legacy library you can ignore. It's no longer relevant:<br>
<br>
[GNOME]<br>
properties=libnm-*<br>
<br>
<br>
You at least need the first part.<br>
<br>
All these pieces can be implemented in any language. However, since all<br>
existing plugins are in C+glib, it's much easier to look at<br>
NetworkManager-openvpn and just duplicate that. If you need to<br>
implement that all in a new language, it's much more work.<br>
<br>
<br>
Good luck,<br>
Thomas<br>
<br>
<br>
> <br>
> Vào Th 3, 5 thg 12, 2023 vào lúc 23:38 Frédéric Martinsons<br>
> <<a href="mailto:frederic.martinsons@gmail.com" target="_blank">frederic.martinsons@gmail.com</a>> đã viết:<br>
> > I don't think it is possible without patching the networkmanager<br>
> > code itself. You should look at how these kind of type are defined<br>
> > in nmcli/libnm code base and possibly submit a merge request to add<br>
> > a new rosenpass one. <br>
> > <br>
> > Le mar. 5 déc. 2023, 17:33, amidamaru rookie <<a href="mailto:ardtimeit@gmail.com" target="_blank">ardtimeit@gmail.com</a>><br>
> > a écrit :<br>
> > > Thanks for your reference links, I will check them out.<br>
> > > For nmcli integration, the only thing I have no idea is the value<br>
> > > of type must be known. <br>
> > > So as my example above:<br>
> > > nmcli con import type rosenpass file /data/rp.conf<br>
> > > the value of type is "rosenpass". <br>
> > > Is there any way to add this new value ? <br>
> > > <br>
> > > Thank you,<br>
> > > <br>
> > > Vào Th 3, 5 thg 12, 2023 vào lúc 23:16 Frédéric Martinsons<br>
> > > <<a href="mailto:frederic.martinsons@gmail.com" target="_blank">frederic.martinsons@gmail.com</a>> đã viết:<br>
> > > > Maybe you can take a look<br>
> > > > at <a href="https://crates.io/crates/networkmanager" rel="noreferrer" target="_blank">https://crates.io/crates/networkmanager</a> which uses nm dbus<br>
> > > > api.<br>
> > > > <br>
> > > > You may also want to look at gtk-rs project<br>
> > > > (<a href="https://gtk-rs.org/" rel="noreferrer" target="_blank">https://gtk-rs.org/</a>) to find inspiration.<br>
> > > > <br>
> > > > <br>
> > > > <br>
> > > > On Tue, 5 Dec 2023 at 17:12, amidamaru rookie<br>
> > > > <<a href="mailto:ardtimeit@gmail.com" target="_blank">ardtimeit@gmail.com</a>> wrote:<br>
> > > > > Hi team,<br>
> > > > > <br>
> > > > > Currently I'm implementing a Rosenpass NM Plugin in Rust.<br>
> > > > > I cannot find much information about this except the VPN<br>
> > > > > support page - but most of the projects there were written in<br>
> > > > > C.<br>
> > > > > The only reference I can find is this repository. <br>
> > > > > But after all these years, the NetworkManager codebase won't<br>
> > > > > have this shared directory anymore.<br>
> > > > > So now, my question is where can I collect these files from<br>
> > > > > the current NM codebase? Also, <br>
> > > > > Besides the GUI (editor dialog) part, I want to integrate<br>
> > > > > Rosenpass into nmcli also.<br>
> > > > > For example, after integration, I can do something like this:<br>
> > > > > nmcli con import type rosenpass file /data/rp.conf<br>
> > > > > <br>
> > > > > Could you please give some advice on this?<br>
> > > > > <br>
> > > > > Thank you,<br>
> > > > > -- <br>
> > > > > Đinh Thảo_PTIT's student - <a href="mailto:ardtimeit@gmail.com" target="_blank">ardtimeit@gmail.com</a><br>
> > > <br>
> > > <br>
> > > -- <br>
> > > Đinh Thảo_PTIT's student - <a href="mailto:ardtimeit@gmail.com" target="_blank">ardtimeit@gmail.com</a><br>
> <br>
> <br>
> -- <br>
> Đinh Thảo_PTIT's student - <a href="mailto:ardtimeit@gmail.com" target="_blank">ardtimeit@gmail.com</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><font face="verdana, sans-serif">Đinh Thảo_PTIT's student - <i><a href="mailto:ardtimeit@gmail.com" target="_blank"><font color="#009900">ardtimeit@gmail.com</font></a></i></font></div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><font face="verdana, sans-serif">Đinh Thảo_PTIT's student - <i><a href="mailto:ardtimeit@gmail.com" target="_blank"><font color="#009900">ardtimeit@gmail.com</font></a></i></font></div>