Skip to content

Commit

Permalink
Merge pull request #769 from imobachgs/network-docs
Browse files Browse the repository at this point in the history
Update D-Bus documentation
  • Loading branch information
imobachgs authored Sep 27, 2023
2 parents 1bbd9c2 + 199fa6f commit db9cd78
Show file tree
Hide file tree
Showing 23 changed files with 274 additions and 270 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.opensuse.Agama.Network1.Connection">
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama1.Network.Connection">
<!--
Connection ID.
Expand All @@ -16,41 +45,73 @@
now), it uses the original ID but appending a number in case the ID is duplicated.
-->
<property name="Id" type="s" access="read"/>
<property name="Interface" type="s" access="readwrite"/>
</interface>
<interface name="org.opensuse.Agama.Network1.Connection.IPv4">
<interface name="org.opensuse.Agama1.Network.Connection.IP">
<!--
List of IP addresses.
When the method is 'auto', these addresses are used as additional addresses.
-->
<property name="Addresses" type="as" access="readwrite"/>
<!--
Network gateway.
Network gateway for IPv4.
An empty string removes the current value.
-->
<property name="Gateway4" type="s" access="readwrite"/>
<!--
Network gateway for IPv6.
An empty string removes the current value.
-->
<property name="Gateway6" type="s" access="readwrite"/>
<!--
IPv4 configuration method.
An empty string removes the current value. It is not possible to set a gateway if the
Addresses property is empty.
Possible values: "disabled", "auto", "manual" or "link-local".
See [crate::network::model::IpMethod].
-->
<property name="Gateway" type="s" access="readwrite"/>
<property name="Method4" type="s" access="readwrite"/>
<!--
IP configuration method.
IPv6 configuration method.
Possible values: "disabled", "auto", "manual" or "link-local".
See [crate::model::IpMethod].
See [crate::network::model::IpMethod].
-->
<property name="Method" type="s" access="readwrite"/>
<property name="Method6" type="s" access="readwrite"/>
<!--
Name server addresses.
-->
<property name="Nameservers" type="as" access="readwrite"/>
</interface>
<interface name="org.opensuse.Agama.Network1.Connection.Wireless">
<interface name="org.opensuse.Agama1.Network.Connection.Match">
<!--
List of driver names to match.
-->
<property name="Driver" type="as" access="readwrite"/>
<!--
List of interface names to match.
-->
<property name="Interface" type="as" access="readwrite"/>
<!--
List of kernel options to match.
-->
<property name="Kernel" type="as" access="readwrite"/>
<!--
List of paths to match against the ID_PATH udev property of devices.
-->
<property name="Path" type="as" access="readwrite"/>
</interface>
<interface name="org.opensuse.Agama1.Network.Connection.Wireless">
<!--
Wireless connection mode.
Possible values: "unknown", "adhoc", "infrastructure", "ap" or "mesh".
See [crate::model::WirelessMode].
See [crate::network::model::WirelessMode].
-->
<property name="Mode" type="s" access="readwrite"/>
<!--
Expand All @@ -67,40 +128,8 @@
Possible values: "none", "owe", "ieee8021x", "wpa-psk", "sae", "wpa-eap",
"wpa-eap-suite-b192".
See [crate::model::WirelessMode].
See [crate::network::model::SecurityProtocol].
-->
<property name="Security" type="s" access="readwrite"/>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
</node>

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
Expand Down Expand Up @@ -33,7 +36,7 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama.Network1.Connections">
<interface name="org.opensuse.Agama1.Network.Connections">
<!--
Returns the D-Bus paths of the network connections.
-->
Expand All @@ -43,8 +46,8 @@
<!--
Adds a new network connection.
* `name`: connection name.
* `ty`: connection type (see [crate::model::DeviceType]).
* `id`: connection name.
* `ty`: connection type (see [agama_lib::network::types::DeviceType]).
-->
<method name="AddConnection">
<arg name="id" type="s" direction="in"/>
Expand Down Expand Up @@ -74,11 +77,12 @@
-->
<method name="Apply">
</method>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
<!--
Notifies than a new interface has been added.
-->
<signal name="ConnectionAdded">
<arg name="id" type="s"/>
<arg name="path" type="o"/>
</signal>
</interface>
</node>

Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
Expand All @@ -38,7 +36,7 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama.Network1.Device">
<interface name="org.opensuse.Agama1.Network.Device">
<!--
Device name.
Expand All @@ -50,9 +48,8 @@
Possible values: 0 = loopback, 1 = ethernet, 2 = wireless.
See [crate::model::DeviceType].
See [agama_lib::network::types::DeviceType].
-->
<property name="Type" type="y" access="read"/>
</interface>
</node>

Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node>
<interface name="org.opensuse.Agama.Network1.Devices">
<!--
Returns the D-Bus paths of the network devices.
-->
<method name="GetDevices">
<arg type="ao" direction="out"/>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
Expand All @@ -17,11 +12,6 @@
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
Expand All @@ -46,5 +36,12 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama1.Network.Devices">
<!--
Returns the D-Bus paths of the network devices.
-->
<method name="GetDevices">
<arg type="ao" direction="out"/>
</method>
</interface>
</node>

54 changes: 53 additions & 1 deletion doc/dbus/bus/seed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ look Manager1
look Software1
look Software1.Proposal
look Storage1
look Users1

abusctl introspect --xml-interface \
${DD}1 \
Expand Down Expand Up @@ -64,3 +63,56 @@ abusctl introspect --xml-interface \
${SS}1/Questions/1 \
| cleanup \
> ${DD}1.Questions.WithPassword.bus.xml

# Network interfaces
abusctl call \
${DD}1 \
${SS}1/Network/connections \
${DD}1.Network.Connections \
AddConnection "sy" "wireless0" 2

OBJ=$(abusctl call \
${DD}1 \
${SS}1/Network/connections \
${DD}1.Network.Connections \
GetConnection "s" "wireless0" | cut -f2 -d\")

abusctl introspect --xml-interface \
${DD}1 \
${OBJ} \
${DD}1.Network.Connection \
| cleanup \
>${DD}1.Network.Connection.bus.xml

abusctl call \
${DD}1 \
${SS}1/Network/connections \
${DD}1.Network.Connections \
RemoveConnection "s" "wireless0"

abusctl introspect --xml-interface \
${DD}1 \
${SS}1/Network/connections \
${DD}1.Network.Connections \
| cleanup \
>${DD}1.Network.Connections.bus.xml

abusctl introspect --xml-interface \
${DD}1 \
${SS}1/Network/devices \
${DD}1.Network.Devices \
| cleanup \
>${DD}1.Network.Devices.bus.xml

abusctl introspect --xml-interface \
${DD}1 \
${SS}1/Network/devices/0 \
${DD}1.Network.Device \
| cleanup \
>${DD}1.Network.Device.bus.xml

abusctl introspect --xml-interface \
${DD}.Manager1 \
${SS}/Users1 \
| cleanup \
>${DD}.Users1.bus.xml
Loading

0 comments on commit db9cd78

Please sign in to comment.