<div dir="ltr"><div dir="ltr"><div><br></div></div><div dir="ltr"><div><div style="padding:0px 0px 0px 2px"><div style="color:rgb(0,0,0);font-family:monospace;font-size:10pt;white-space:pre"><div dir="ltr">Hello Mantas,<br><br>Thanks for the quick response, Here is what I get for GetLinkByName</div><div dir="ltr"><br>//busctl call org.freedesktop.network1 /org/freedesktop/network1 org.freedesktop.network1.Manager GetLinkByName s wlan0<br>//io 4 "/org/freedesktop/network1/link/_34"</div><div dir="ltr"><br>1. I am subscribing to signal like below, Does that work?</div><div>2. how can I add another like link "eth0" for signals? subscribe separately?</div><div dir="ltr"><br><div><div style="padding:0px 0px 0px 2px"><div style="font-size:10pt"><p style="margin:0px"><span style="color:rgb(63,127,95)"><br></span></p></div></div><div style="padding:0px 0px 0px 2px"><div style="font-size:10pt"><p style="margin:0px"><span style="text-decoration-line:underline;text-decoration-style:wavy;text-decoration-color:rgb(255,0,0)">g_dbus_connection_signal_subscribe</span> (connection,<span style="color:rgb(63,127,95)">// GDBusConnection</span></p><p style="margin:0px"><span style="font-size:10pt"> </span><span style="font-size:10pt;color:rgb(63,127,95)">/*"org.freedesktop.network1"*/</span><span style="font-size:10pt"> NULL,</span><span style="font-size:10pt;color:rgb(63,127,95)">//sender name to match on (unique or well-known name) or NULL to listen from all senders</span><br></p><p style="margin:0px"> <span style="color:rgb(42,0,255)">"org.freedesktop.DBus.Properties"</span>,<span style="color:rgb(63,127,95)">//D-Bus interface name to match on or NULL to match on all interfaces</span></p><p style="margin:0px"> <span style="color:rgb(42,0,255)">"PropertiesChanged"</span>,<span style="color:rgb(63,127,95)">//D-Bus signal name to match on or NULL to match on all signals</span></p><p style="margin:0px"> "<b><span style="font-size:13.3333px;color:rgb(63,127,95)">/</span><span style="font-size:13.3333px;text-decoration-line:underline;text-decoration-style:wavy;text-decoration-color:rgb(255,128,64);color:rgb(63,127,95)">org</span><span style="font-size:13.3333px;color:rgb(63,127,95)">/</span><span style="font-size:13.3333px;text-decoration-line:underline;text-decoration-style:wavy;text-decoration-color:rgb(255,128,64);color:rgb(63,127,95)">freedesktop</span></b><span style="font-size:13.3333px;color:rgb(63,127,95)"><b>/network1/link/_34</b>"</span>,<span style="color:rgb(63,127,95)">//object path to match on or NULL to match on all object paths</span></p><p style="margin:0px"> NULL,<span style="color:rgb(63,127,95)">//contents of first string argument to match on or NULL to match on all kinds of arguments</span></p><p style="margin:0px"> <span style="text-decoration-line:underline;text-decoration-style:wavy;text-decoration-color:rgb(255,0,0)">G_DBUS_SIGNAL_FLAGS_NONE</span>,<span style="color:rgb(63,127,95)">//GDBusSignalFlags describing how arg0 is used in subscribing to the signal</span></p><p style="margin:0px"> <span style="font-style:italic">linkStatusMonitorCallBack</span>,<span style="color:rgb(63,127,95)">//callback to invoke when there is a signal matching the requested data</span></p><p style="margin:0px"> <span style="color:rgb(127,0,85);font-weight:bold">nullptr</span>,<span style="color:rgb(63,127,95)">//user data to pass to callback</span></p><p style="margin:0px"> NULL);<span style="color:rgb(63,127,95)">//function to free user_data with when subscription is removed or NULL
</span></p><p style="margin:0px"><span style="color:rgb(63,127,95)">Thanks,</span></p><p style="margin:0px"><span style="color:rgb(63,127,95)">Ashok</span></p></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 6, 2024 at 5:11 PM Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>> wrote:<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>/org/freedesktop/network1 is the toplevel object that represents the networkd daemon as a whole. Interface-specific signals would be sent for the object paths of the individual interfaces, so you need to either:</div><div><br></div><div>a) call <b>GetLinkByName()</b> on the toplevel object to find the interface object, and then subscribe for signals on that;</div><div><br></div><div>or b) instead of filtering by path='/xx', filter by <b>path_namespace='/xx' </b>so that it will also match child objects.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 6, 2024 at 10:30 AM ashok athukuri <<a href="mailto:athukuriashok@gmail.com" target="_blank">athukuriashok@gmail.com</a>> wrote:<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">Hello All,<div><br><div><br></div><div>I'm trying to use DBUS signal "PropertiesChanged" of org.freedesktop.network1 /org/freedesktop/network1 <b>to detect network interface is up or down OR the speed of the interface is changed.</b></div><div><br>Is it possible? using a subscription to "PropertiesChanged" signal via the below interface or PATH ?<br>If yes, how to test those, Currently I don't see any anything on my dbus-monitor.<br><br>Here is how I am testing :</div><div><b># dbus-monitor --system "type='signal',path='/org/freede<br></b></div><div><b>sktop/network1'"<br><br>#ifconfig wlan0 down</b><br><br># busctl introspect org.freedesktop.network1 /org/freedesktop/network1 <br>NAME TYPE SIGNATURE RESULT/VALUE FLAGS<br>org.freedesktop.DBus.Introspectable interface - - -<br>.Introspect method - s -<br>org.freedesktop.DBus.Peer interface - - -<br>.GetMachineId method - s -<br>.Ping method - - -<br>org.freedesktop.DBus.Properties interface - - -<br>.Get method ss v -<br>.GetAll method s a{sv} -<br>.Set method ssv - -<br>.PropertiesChanged signal sa{sv}as - -<br>org.freedesktop.network1.Manager interface - - -<br>.Describe method - s -<br>.DescribeLink method i s -<br>.ForceRenewLink method i - -<br>.GetLinkByIndex method i so -<br>.GetLinkByName method s io -<br>.ListLinks method - a(iso) -<br>.ReconfigureLink method i - -<br>.Reload method - - -<br>.RenewLink method i - -<br>.RevertLinkDNS method i - -<br>.RevertLinkNTP method i - -<br>.SetLinkDNS method ia(iay) - -<br>.SetLinkDNSEx method ia(iayqs) - -<br>.SetLinkDNSOverTLS method is - -<br>.SetLinkDNSSEC method is - -<br>.SetLinkDNSSECNegativeTrustAnchors method ias - -<br>.SetLinkDefaultRoute method ib - -<br>.SetLinkDomains method ia(sb) - -<br>.SetLinkLLMNR method is - -<br>.SetLinkMulticastDNS method is - -<br>.SetLinkNTP method ias - -<br>.AddressState property s "routable" emits-change<br>.CarrierState property s "carrier" emits-change<br>.IPv4AddressState property s "routable" emits-change<br>.IPv6AddressState property s "routable" emits-change<br>.NamespaceId property t 4026531840 const<br>.OnlineState property s "partial" emits-change<br>.OperationalState property s "routable" emits-change<br>root@MK3AC-WS100269:/var/lib/evse/cache# <br><br>Thanks,</div><div>Ashok</div><div><br></div></div></div>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div>
</blockquote></div></div>