Re: Porting dbus-glib code for NM 0.8.6 to NM 1.4.2


On Tue, 2016-11-22 at 20:52 +0100, W. Martin Borgert wrote:

I need to port old non-GUI C code using the dbus-glib based API of
NM 0.8.6 to whatever is the best option today. According to Dans
blog post┬╣ some months ago, GDBus is the way to go.

Is there a porting guide available? Or are there nice examples?

Well, the choice of the D-Bus library is not really a NetworkManager
issue -- use whichever library works well for you.

dbus-glib, while not recommended for new code, might still make sense
when porting old code with minimal effort. We chose GDBus because it's
readily available in glib's gio and includes a tool that generates C
code that interoperates well with GObject.

This part of GDBus manual seems like a good place to start. It applies
to NetworkManager pretty well; just generate the code from XMLs you
find in the introspection/ tree: [1].


If you prefer a minimal library or avoid generating code from the
introspection data, sd-bus library might also be a good choice.
See [2] and sd-bus(3) manual


Another option would be to avoid speaking D-Bus directly and use libnm
instead. However, it might be an overkill for a simple project.

When it comes to the NetworkManager D-Bus API itself, the 0.9 porting
guide might come handy: [3]. Since 0.9 we are careful not to ever do
incompatible API changes. The full API reference is at [4].


Many thanks in advance!




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]