diff options
author | David Zeuthen <davidz@redhat.com> | 2008-10-28 00:52:45 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2008-10-28 00:52:45 -0400 |
commit | 11fcb246e6c18efa5e393be728318f1bd65e13ab (patch) | |
tree | 97adf57b2d97b7f9111c85fba7acf093bb33911c /data |
initial commit
Diffstat (limited to 'data')
-rw-r--r-- | data/Makefile.am | 24 | ||||
-rw-r--r-- | data/org.freedesktop.Hostname1.conf.in | 10 | ||||
-rw-r--r-- | data/org.freedesktop.Hostname1.service.in | 4 | ||||
-rw-r--r-- | data/org.freedesktop.Hostname1.xml | 627 |
4 files changed, 665 insertions, 0 deletions
diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..beec0cf --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,24 @@ +## Process this file with automake to produce Makefile.in + +servicedir = $(datadir)/dbus-1/system-services +service_in_files = org.freedesktop.Hostname1.service.in +service_DATA = $(service_in_files:.service.in=.service) + +$(service_DATA): $(service_in_files) Makefile + @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ + +dbusconfdir = $(sysconfdir)/dbus-1/system.d +dbusconf_in_files = org.freedesktop.Hostname1.conf.in +dbusconf_DATA = $(dbusconf_in_files:.conf.in=.conf) + +$(dbusconf_DATA): $(dbusconf_in_files) Makefile + cat $< > $@ + +# @sed -e "s|\@polkituser\@|$(POLKIT_USER)|" $< > $@ + +CLEANFILES = $(BUILT_SOURCES) + +EXTRA_DIST = org.freedesktop.Hostname1.xml $(service_in_files) $(dbusconf_in_files) + +clean-local : + rm -f *~ $(service_DATA) $(dbusconf_DATA) diff --git a/data/org.freedesktop.Hostname1.conf.in b/data/org.freedesktop.Hostname1.conf.in new file mode 100644 index 0000000..04ffb62 --- /dev/null +++ b/data/org.freedesktop.Hostname1.conf.in @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- --> + +<!DOCTYPE busconfig PUBLIC + "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy user="root"> + <allow own="org.freedesktop.Hostname1"/> + </policy> +</busconfig> diff --git a/data/org.freedesktop.Hostname1.service.in b/data/org.freedesktop.Hostname1.service.in new file mode 100644 index 0000000..48c8b59 --- /dev/null +++ b/data/org.freedesktop.Hostname1.service.in @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=org.freedesktop.Hostname +Exec=@libexecdir@/xdg-hostname-daemon-1 +User=root diff --git a/data/org.freedesktop.Hostname1.xml b/data/org.freedesktop.Hostname1.xml new file mode 100644 index 0000000..312ddde --- /dev/null +++ b/data/org.freedesktop.Hostname1.xml @@ -0,0 +1,627 @@ +<!DOCTYPE node PUBLIC +"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" +"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" [ + <!ENTITY ERROR_PERMISSION_DENIED "org.freedesktop.Hostname1.Error.PermissionDenied"> + <!ENTITY ERROR_INVALID_DATA "org.freedesktop.Hostname1.Error.InvalidData"> + <!ENTITY ERROR_FAILED "org.freedesktop.Hostname1.Error.Failed"> + <!ENTITY ERROR_HAS_TRANSIENT_DATA_PROVIDER "org.freedesktop.Hostname1.Error.HasTransientDataProvider"> +]> +<node name="/hostname1" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"> + + <interface name="org.freedesktop.Hostname1"> + <doc:doc> + <doc:description> + <doc:para> + This interface is usually implemented by the object + <doc:tt>/org/freedesktop/hostname1</doc:tt> + exported by a system D-Bus service with the well-known name + <doc:tt>org.freedesktop.Hostname1</doc:tt>. + </doc:para> + </doc:description> + </doc:doc> + + <!-- ******************************************************************************** --> + + <method name="SetDisplayHostname"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <doc:doc> + <doc:description> + <doc:para> + Sets the + <doc:ref type="property" to="Hostname1:configured-display-hostname">configured-display-hostname</doc:ref> + property. + Typically only user interface applications will call this method in response to an user initiated action. + </doc:para> + </doc:description> + <doc:permission> + The caller will need the following PolicyKit authorization: + <doc:list> + <doc:item> + <doc:term>org.freedesktop.hostname1.change</doc:term> + </doc:item> + </doc:list> + </doc:permission> + <doc:errors> + <doc:error name="&ERROR_PERMISSION_DENIED;">if the caller is not authorized</doc:error> + <doc:error name="&ERROR_INVALID_DATA;">if invalid data is passed</doc:error> + <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error> + </doc:errors> + </doc:doc> + + <arg name="display_hostname" direction="in" type="s"> + <doc:doc> + <doc:summary> + The value for the display host name. + The passed in value is subject to the same format and limitations as the + <doc:ref type="property" to="Hostname1:display-hostname">display-hostname</doc:ref> + property. + </doc:summary> + </doc:doc> + </arg> + </method> + + <!-- ******************************************************************************** --> + + <method name="SetHostname"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <doc:doc> + <doc:description> + <doc:para> + Sets the + <doc:ref type="property" to="Hostname1:configured-hostname">configured-hostname</doc:ref> + property. + Typically only user interface applications will call this method in response to an user initiated action. + </doc:para> + </doc:description> + <doc:permission> + The caller will need the following PolicyKit authorization: + <doc:list> + <doc:item> + <doc:term>org.freedesktop.hostname1.change</doc:term> + </doc:item> + </doc:list> + </doc:permission> + <doc:errors> + <doc:error name="&ERROR_PERMISSION_DENIED;">if the caller is not authorized</doc:error> + <doc:error name="&ERROR_INVALID_DATA;">if invalid data is passed</doc:error> + <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error> + </doc:errors> + </doc:doc> + + <arg name="hostname" direction="in" type="s"> + <doc:doc> + <doc:summary> + The value for the host name. + The passed in value is subject to the same format and limitations as the + <doc:ref type="property" to="Hostname1:hostname">hostname</doc:ref> + property. + </doc:summary> + </doc:doc> + </arg> + </method> + + <!-- ******************************************************************************** --> + + <method name="SetIconName"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <doc:doc> + <doc:description> + <doc:para> + Sets the + <doc:ref type="property" to="Hostname1:configured-icon-name">configured-icon-name</doc:ref> + property. + Typically only user interface applications will call this method in response to an user initiated action. + </doc:para> + </doc:description> + <doc:permission> + The caller will need the following PolicyKit authorization: + <doc:list> + <doc:item> + <doc:term>org.freedesktop.hostname1.change</doc:term> + </doc:item> + </doc:list> + </doc:permission> + <doc:errors> + <doc:error name="&ERROR_PERMISSION_DENIED;">if the caller is not authorized</doc:error> + <doc:error name="&ERROR_INVALID_DATA;">if invalid data is passed</doc:error> + <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error> + </doc:errors> + </doc:doc> + + <arg name="icon_name" direction="in" type="s"> + <doc:doc> + <doc:summary> + The name for the host icon. + The passed in value is subject to the same format and limitations as the + <doc:ref type="property" to="Hostname1:icon-name">icon-name</doc:ref> + property. + </doc:summary> + </doc:doc> + </arg> + </method> + + <!-- ******************************************************************************** --> + + <method name="SetUseTransientData"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <doc:doc> + <doc:description> + <doc:para> + Sets the + <doc:ref type="property" to="Hostname1:use-transient-data">use-transient-data</doc:ref> + property. + Typically only user interface applications will call this method in response to an user initiated action. + </doc:para> + </doc:description> + <doc:permission> + The caller will need the following PolicyKit authorization: + <doc:list> + <doc:item> + <doc:term>org.freedesktop.hostname1.change</doc:term> + </doc:item> + </doc:list> + </doc:permission> + <doc:errors> + <doc:error name="&ERROR_PERMISSION_DENIED;">if the caller is not authorized</doc:error> + <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error> + </doc:errors> + </doc:doc> + + <arg name="use_transient_data" direction="in" type="b"> + <doc:doc> + <doc:summary> + Whether transient data should be used if available. See the + <doc:ref type="property" to="Hostname1:use-transient-data">use-transient</doc:ref> + property for details. + </doc:summary> + </doc:doc> + </arg> + </method> + + <!-- ******************************************************************************** --> + + <method name="RegisterTransientDataProvider"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <doc:doc> + <doc:description> + <doc:para> + Registers a provider for transient hostname data. A cookie + is returned that the provider can use for invoking methods like + <doc:ref type="method" to="Hostname1.SetTransientHostname">SetTransientHostname()</doc:ref> + to set transient data. The data is kept in memory and will be purged + when the provider calls + <doc:ref type="method" to="Hostname1.UnregisterTransientDataProvider">UnregisterTransientDataProvider()</doc:ref> + or disconnects from the system message bus. + Only a single client can provide transient hostname data at a time. + Typically only network configuration tools will need to + call this method. + </doc:para> + </doc:description> + <doc:permission> + Only the super user (<doc:tt>uid 0</doc:tt>) can invoke this method. + </doc:permission> + <doc:errors> + <doc:error name="&ERROR_HAS_TRANSIENT_DATA_PROVIDER;">if another client has already registered for providing transient data</doc:error> + <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error> + </doc:errors> + </doc:doc> + + <arg name="cookie" direction="out" type="s"> + <doc:doc> + <doc:summary> + A cookie to be used for providing transient data via methods such as + <doc:ref type="method" to="Hostname1.SetTransientHostname">SetTransientHostname()</doc:ref> + and to unregister as a transient data provider via the + <doc:ref type="method" to="Hostname1.UnregisterTransientDataProvider">UnregisterTransientDataProvider()</doc:ref> + method. + </doc:summary> + </doc:doc> + </arg> + </method> + + <!-- ******************************************************************************** --> + + <method name="UnregisterTransientDataProvider"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <doc:doc> + <doc:description> + <doc:para> + Unregisters a transient data provider previously registered with + <doc:ref type="method" to="Hostname1.RegisterTransientDataProvider">RegisterTransientDataProvider()</doc:ref>. + </doc:para> + </doc:description> + <doc:permission> + Only the super user (<doc:tt>uid 0</doc:tt>) can invoke this method. + </doc:permission> + <doc:errors> + <doc:error name="&ERROR_INVALID_DATA;">if an invalid cookie is passed</doc:error> + <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error> + </doc:errors> + </doc:doc> + + <arg name="cookie" direction="in" type="s"> + <doc:doc> + <doc:summary> + A cookie obtained from the + <doc:ref type="method" to="Hostname1.RegisterTransientDataProvider">RegisterTransientDataProvider()</doc:ref> + method. + </doc:summary> + </doc:doc> + </arg> + </method> + + <!-- ******************************************************************************** --> + + <method name="SetTransientDisplayHostname"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <doc:doc> + <doc:description> + <doc:para> + Sets the + <doc:ref type="property" to="Hostname1:transient-display-hostname">transient-display-hostname</doc:ref> + property. + Typically only network configuration tools will need to + call this method. + </doc:para> + </doc:description> + <doc:permission> + Only the super user (<doc:tt>uid 0</doc:tt>) can invoke this method. + </doc:permission> + <doc:errors> + <doc:error name="&ERROR_INVALID_DATA;">if invalid data is passed</doc:error> + <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error> + </doc:errors> + </doc:doc> + + <arg name="cookie" direction="in" type="s"> + <doc:doc> + <doc:summary> + A cookie obtained from the + <doc:ref type="method" to="Hostname1.RegisterTransientDataProvider">RegisterTransientDataProvider()</doc:ref> + method. + </doc:summary> + </doc:doc> + </arg> + + <arg name="display_hostname" direction="in" type="s"> + <doc:doc> + <doc:summary> + The value for the display host name. Any valid UTF-8 string can be used. + </doc:summary> + </doc:doc> + </arg> + </method> + + <!-- ******************************************************************************** --> + + <method name="SetTransientHostname"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <doc:doc> + <doc:description> + <doc:para> + Sets the + <doc:ref type="property" to="Hostname1:transient-hostname">transient-hostname</doc:ref> + property. + Typically only network configuration tools will need to + call this method. + </doc:para> + </doc:description> + <doc:permission> + Only the super user (<doc:tt>uid 0</doc:tt>) can invoke this method. + </doc:permission> + <doc:errors> + <doc:error name="&ERROR_INVALID_DATA;">if invalid data is passed</doc:error> + <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error> + </doc:errors> + </doc:doc> + + <arg name="cookie" direction="in" type="s"> + <doc:doc> + <doc:summary> + A cookie obtained from the + <doc:ref type="method" to="Hostname1.RegisterTransientDataProvider">RegisterTransientDataProvider()</doc:ref> + method. + </doc:summary> + </doc:doc> + </arg> + + <arg name="hostname" direction="in" type="s"> + <doc:doc> + <doc:summary> + The value for the host name. Can't be an empty string. Must conform to + limitations and constraints as described for the + <doc:ref type="property" to="Hostname1:hostname">hostname</doc:ref> + property. + </doc:summary> + </doc:doc> + </arg> + </method> + + <!-- ******************************************************************************** --> + + <method name="SetTransientIconName"> + <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> + <doc:doc> + <doc:description> + <doc:para> + Sets the + <doc:ref type="property" to="Hostname1:transient-icon-name">transient-icon-name</doc:ref> + property. + Typically only network configuration tools will need to + call this method. + </doc:para> + </doc:description> + <doc:permission> + Only the super user (<doc:tt>uid 0</doc:tt>) can invoke this method. + </doc:permission> + <doc:errors> + <doc:error name="&ERROR_INVALID_DATA;">if invalid data is passed</doc:error> + <doc:error name="&ERROR_FAILED;">if the operation failed</doc:error> + </doc:errors> + </doc:doc> + + <arg name="cookie" direction="in" type="s"> + <doc:doc> + <doc:summary> + A cookie obtained from the + <doc:ref type="method" to="Hostname1.RegisterTransientDataProvider">RegisterTransientDataProvider()</doc:ref> + method. + </doc:summary> + </doc:doc> + </arg> + + <arg name="icon_name" direction="in" type="s"> + <doc:doc> + <doc:summary> + The name for the host icon. Must be an empty string to unset the icon, otherwise a themed + icon name conforming to + the freedesktop.org + <doc:ulink url="http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html">Icon Theme Specification</doc:ulink> + and + <doc:ulink url="http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html">Icon Naming Specification</doc:ulink> + specifications. + </doc:summary> + </doc:doc> + </arg> + </method> + + <!-- ******************************************************************************** --> + + <signal name="Changed"> + <doc:doc> + <doc:description> + <doc:para> + Emitted when one or more properties change. + </doc:para> + </doc:description> + </doc:doc> + </signal> + + <!-- ******************************************************************************** --> + + <property name="display-hostname" type="s" access="read"> + <doc:doc> + <doc:description> + <doc:para> + The display hostname of the system. If empty, it means no display hostname + has been chosen for the system. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="hostname" type="s" access="read"> + <doc:doc> + <doc:description> + <doc:para> + The hostname of the system. Is never the empty string. Conforms to section 3.5 of + <doc:ulink url="http://www.ietf.org/rfc/rfc1034.txt">RFC 1034</doc:ulink> + with the hostname being a label: 7 bit ASCII without special characters, + whitespace or dots. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="icon-name" type="s" access="read"> + <doc:doc> + <doc:description> + <doc:para> + The name icon to use for the system. Is either an empty string if no icon is set, otherwise + a themed icon name conforming to + the freedesktop.org + <doc:ulink url="http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html">Icon Theme Specification</doc:ulink> + and + <doc:ulink url="http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html">Icon Naming Specification</doc:ulink> + specifications. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="configured-display-hostname" type="s" access="read"> + <doc:doc> + <doc:description> + <doc:para> + The configured display hostname of the system. This is a user preference and can be changed with the + <doc:ref type="method" to="Hostname1.SetDisplayHostname">SetDisplayHostname()</doc:ref> + method. + This property is subject to the same format and limitations as the + <doc:ref type="property" to="Hostname1:display-hostname">display-hostname</doc:ref> + property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="configured-hostname" type="s" access="read"> + <doc:doc> + <doc:description> + <doc:para> + The configured hostname of the system. This is a user preference and can be changed with the + <doc:ref type="method" to="Hostname1.SetHostname">SetHostname()</doc:ref> + method. + This property is subject to the same format and limitations as the + <doc:ref type="property" to="Hostname1:hostname">hostname</doc:ref> + property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="configured-icon-name" type="s" access="read"> + <doc:doc> + <doc:description> + <doc:para> + The configured icon name of the system. This is a user preference and can be changed with the + <doc:ref type="method" to="Hostname1.SetIconName">SetIconName()</doc:ref> + method. + This property is subject to the same format and limitations as the + <doc:ref type="property" to="Hostname1:icon-name">icon-name</doc:ref> + property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="use-transient-data" type="b" access="read"> + <doc:doc> + <doc:description> + <doc:para> + If <doc:tt>FALSE</doc:tt>, then transient data will be ignored when + computing the value of the + <doc:ref type="property" to="Hostname1:hostname">hostname</doc:ref>, + <doc:ref type="property" to="Hostname1:display-hostname">display-hostname</doc:ref> and + <doc:ref type="property" to="Hostname1:icon-name">icon-name</doc:ref> + properties. + This is a user preference and can be changed with the + <doc:ref type="method" to="Hostname1.SetIconName">SetUseTransientData()</doc:ref> + method. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="transient-display-hostname" type="s" access="read"> + <doc:doc> + <doc:description> + <doc:para> + If not blank, the display hostname currently provided by a registered transient data provider. + This property is subject to the same format and limitations as the + <doc:ref type="property" to="Hostname1:display-hostname">display-hostname</doc:ref> + property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="transient-hostname" type="s" access="read"> + <doc:doc> + <doc:description> + <doc:para> + If not blank, the hostname currently provided by a registered transient data provider. + This property is subject to the same format and limitations as the + <doc:ref type="property" to="Hostname1:hostname">hostname</doc:ref> + property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="transient-icon-name" type="s" access="read"> + <doc:doc> + <doc:description> + <doc:para> + If not blank, the icon name currently provided by a registered transient data provider. + This property is subject to the same format and limitations as the + <doc:ref type="property" to="Hostname1:icon-name">icon-name</doc:ref> + property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + <property name="can-set-hostname" type="b" access="read"> + <doc:doc> + <doc:description> + <doc:para> + Whether the + <doc:ref type="property" to="Hostname1:configured-hostname">configured-hostname</doc:ref> + property can be set using + <doc:ref type="method" to="Hostname1.SetHostname">SetHostname()</doc:ref>. + Note that even if this property has the value <doc:tt>TRUE</doc:tt>, authorization checks may + prevent any random client from changing the given property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <property name="can-set-display-hostname" type="b" access="read"> + <doc:doc> + <doc:description> + <doc:para> + Whether the + <doc:ref type="property" to="Hostname1:configured-display-hostname">configured-display-hostname</doc:ref> + property can be set using + <doc:ref type="method" to="Hostname1.SetDisplayHostname">SetDisplayHostname()</doc:ref>. + Note that even if this property has the value <doc:tt>TRUE</doc:tt>, authorization checks may + prevent any random client from changing the given property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <property name="can-set-icon-name" type="b" access="read"> + <doc:doc> + <doc:description> + <doc:para> + Whether the + <doc:ref type="property" to="Hostname1:configured-icon-name">configured-icon-name</doc:ref> + property can be set using + <doc:ref type="method" to="Hostname1.SetIconName">SetIconName()</doc:ref>. + Note that even if this property has the value <doc:tt>TRUE</doc:tt>, authorization checks may + prevent any random client from changing the given property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <property name="can-set-use-transient-data" type="b" access="read"> + <doc:doc> + <doc:description> + <doc:para> + Whether the + <doc:ref type="property" to="Hostname1:use-transient-data">use-transient-data</doc:ref> + property can be set using + <doc:ref type="method" to="Hostname1.SetUseTransientData">SetUseTransientData()</doc:ref>. + Note that even if this property has the value <doc:tt>TRUE</doc:tt>, authorization checks may + prevent any random client from changing the given property. + </doc:para> + </doc:description> + </doc:doc> + </property> + + <!-- ******************************************************************************** --> + + </interface> +</node> |