dnsproxy: Only one copy of the relevant buffers will be made to a TCP request
[framework/connectivity/connman.git] / doc / manager-api.txt
index c898935..3bd201d 100644 (file)
@@ -1,8 +1,8 @@
 Manager hierarchy
 =================
 
-Service                org.moblin.connman
-Interface      org.moblin.connman.Manager
+Service                net.connman
+Interface      net.connman.Manager
 Object path    /
 
 Methods                dict GetProperties()
@@ -22,149 +22,194 @@ Methods           dict GetProperties()
                        Possible Errors: [service].Error.InvalidArguments
                                         [service].Error.InvalidProperty
 
-               string GetState()
+               array{object,dict} GetTechnologies()
 
-                       Return global connection state of a system. The
-                       same value is return via the State property.
+                       Returns a list of tuples with technology object
+                       path and dictionary of technology properties.
 
                        Possible Errors: [service].Error.InvalidArguments
 
-               object CreateProfile(string name)
+               array{object,dict} GetServices()
 
-                       Create and add new profile with the specified
-                       identifier name.
+                       Returns a sorted list of tuples with service
+                       object path and dictionary of service properties.
 
-                       Possible Errors: [service].Error.InvalidArguments
+                       This list will not contain sensitive information
+                       like passphrases etc.
 
-               void RemoveProfile(object path)
+                       Possible Errors: [service].Error.InvalidArguments
 
-                       Remove profile with specified object path.
+               object ConnectProvider(dict provider)
 
-                       It is not possible to remove the current active
-                       profile. To remove the active profile a different
-                       one must be selected via ActiveProfile property
-                       first.
+                       Connect to a VPN specified by the given provider
+                       properties.
 
-                       At minimum one profile must be available all the time.
+                       When successful this method will return the object
+                       path of the VPN service object.
 
-                       Possible Errors: [service].Error.InvalidArguments
+                       This method can also be used to connect to an
+                       already existing VPN.
 
-               void RequestScan(string type)
+                       This method call will only return in case of an
+                       error or when the service is fully connected. So
+                       setting a longer D-Bus timeout might be a really
+                       good idea.
 
-                       Request to trigger a scan for the specified
-                       technology. The empty string "" triggers scanning
-                       on all technologies.
+                       When 'SessionMode' property is enabled, this method
+                       call is disallowed.
 
                        Possible Errors: [service].Error.InvalidArguments
 
-               void EnableTechnology(string type)
+               void RegisterAgent(object path)
 
-                       Enable specified type of technologies.
+                       Register new agent for handling user requests.
 
                        Possible Errors: [service].Error.InvalidArguments
 
-               void DisableTechnology(string type)
+               void UnregisterAgent(object path)
 
-                       Disable specified type of technologies.
+                       Unregister an existing agent.
 
                        Possible Errors: [service].Error.InvalidArguments
 
-               object ConnectService(dict network)
+               void RegisterCounter(object path, uint32 accuracy, uint32 period)  [experimental]
 
-                       Connect to a network specified by the given
-                       properties.
+                       Register a new counter for user notifications.
 
-                       For connecting to a hidden WiFi network for example
-                       it is required that Type = "wifi" and the SSID
-                       properties are provided.
+                       The accuracy is specified in kilo-bytes and defines
+                       a threshold for counter updates. Together with the
+                       period value it defines how often user space needs
+                       to be updated. The period value is in seconds.
 
-                       When successful this method will return object
-                       path of the service object.
+                       This interface is not meant for time tracking. If
+                       the time needs to be tracked down to the second, it
+                       is better to have a real timer running inside the
+                       application than using this interface.
 
-                       This method can also be used to connect to an
-                       already existing service. It works exactly the
-                       same as executing the Connect method from the
-                       service interface.
-
-                       This method call will only return in case of an
-                       error or when the service is fully connected. So
-                       setting a longer D-Bus timeout might be a really
-                       good idea.
+                       Also getting notified for every kilo-byte is a bad
+                       choice (even if the interface supports it). Something
+                       like 10 kilo-byte units or better 1 mega-byte seems
+                       to be a lot more reasonable and better for the user.
 
                        Possible Errors: [service].Error.InvalidArguments
 
-               void RegisterAgent(object path)
+               void UnregisterCounter(object path)  [experimental]
 
-                       Register new agent for handling user requests.
+                       Unregister an existing counter.
 
                        Possible Errors: [service].Error.InvalidArguments
 
-               void UnregisterAgent(object path)
+               object CreateSession(dict settings, object notifier)  [experimental]
 
-                       Unregister an existing agent.
+                       Create a new session for the application. Every
+                       application can create multiple session with
+                       different settings. The settings are described
+                       as part of the session interface.
 
-                       Possible Errors: [service].Error.InvalidArguments
+                       The notifier allows asynchronous notification about
+                       session specific changes. These changes can be
+                       for online/offline state or IP address changes or
+                       similar things the application is required to
+                       handle.
 
-               void RegisterCounter(object path, uint32 interval)
+                       Every application should at least create one session
+                       to inform about its requirements and it purpose.
 
-                       Register a new counter for user notifications.
+               void DestroySession(object session)  [experimental]
+
+                       Remove the previously created session.
+
+                       If an application exits unexpectatly the session
+                       will be automatically destroyed.
 
-                       If the interval is zero then no timer for updates
-                       will be started. Only kernel events can then
-                       trigger updates. Otherwise the kernel will be
-                       polled every n seconds for an update.
+               object path, dict, fd RequestPrivateNetwork(dict options)
+                                                               [experimental]
+
+                       Request a new Private Network, which includes the
+                       creation of a tun/tap interface, and IP
+                       configuration, NAT and IP forwarding on that
+                       interface.
+                       An object path, a dictionnary and a file descriptor
+                       with IP settings are returned.
 
                        Possible Errors: [service].Error.InvalidArguments
+                                        [service].Error.NotSupported
 
-               void UnregisterCounter(object path)
+               void ReleasePrivateNetwork(object path) [experimental]
 
-                       Unregister an existing counter.
+                       Releases a private network.
 
                        Possible Errors: [service].Error.InvalidArguments
 
-Signals                PropertyChanged(string name, variant value)
+Signals                TechnologyAdded(object path, dict properties)
 
-                       This signal indicates a changed value of the given
-                       property.
+                       Signal that is sent when a new technology is added.
 
-               StateChanged(string state)
+                       It contains the object path of the technology and
+                       also its properties.
 
-                       This signal is similar to the PropertyChanged signal
-                       for the State property.
+               TechnologyRemoved(object path)
 
-                       It exists for application state only care about the
-                       current state and so can avoid to be woken up when
-                       other details changes.
+                       Signal that is sent when a modem has been removed.
 
-Properties     string State [readonly]
+                       The object path is no longer accessible after this
+                       signal and only emitted for reference.
 
-                       The global connection state of a system. Possible
-                       values are "online" if at least one connection exists
-                       and "offline" if no device is connected.
+               ServicesChanged(array{object, dict}, array{object})
+
+                       Signals a list of services that have been changed
+                       via the first array. And a list of service that
+                       have been removed via the second array.
+
+                       The list of added services is sorted. The dictionary
+                       with the properties might be empty in case none of
+                       the properties have changed. Or only contains the
+                       properties that have changed.
+
+                       For newly added services the whole set of properties
+                       will be present.
 
-                       In certain situations the state might change to
-                       the value "connected". This can only be seen if
-                       previously no connection was present.
+                       The list of removed services can be empty.
 
-               array{string} AvailableTechnologies [readonly]
+                       This signal will only be triggered when the sort
+                       order of the service list or the number of services
+                       changes. It will not be emitted if only a property
+                       of the service object changes. For that it is
+                       required to watch the PropertyChanged signal of
+                       the service object.
 
-                       The list of available technologies. The strings
-                       are the same as the ones from the service types.
+               PropertyChanged(string name, variant value)
 
-               array{string} EnabledTechnologies [readonly]
+                       This signal indicates a changed value of the given
+                       property.
 
-                       The list of enabled technologies. The strings
-                       are the same as the ones from the service types.
+Properties     string State [readonly]
 
-               array{string} ConnectedTechnologies [readonly]
+                       The global connection state of a system. Possible
+                       values are "offline", "idle", "ready" and "online".
 
-                       The list of connected technologies. The strings
-                       are the same as the ones from the service type.
+                       If the device is in offline mode, the value "offline"
+                       indicates this special global state. It can also be
+                       retrieved via the OfflineMode property, but is kept
+                       here for consistency and to differentiate from "idle".
 
-               string DefaultTechnology [readonly]
+                       However when OfflineMode property is true, the State
+                       property can still be "idle", "ready" or "online"
+                       since it is possible by the end user to re-enable
+                       individual technologies like WiFi and Bluetooth while
+                       in offline mode.
 
-                       The current connected technology which holds the
-                       default route.
+                       The states "idle", "ready" and "online" match to
+                       states from the services. If no service is in
+                       either "ready" or "online" state it will indicate
+                       the "idle" state.
+
+                       If at least one service is in "ready" state and no
+                       service is in "online" state, then it will indicate
+                       the "ready" state.
+
+                       When at least one service is in "online" state,
+                       this property will indicate "online" as well.
 
                boolean OfflineMode [readwrite]
 
@@ -179,30 +224,11 @@ Properties        string State [readonly]
                        the limited usage of WiFi or Bluetooth devices might
                        be allowed in some situations.
 
-               object ActiveProfile [readwrite]
-
-                       Object path of the current active profile.
-
-               array{object} Profiles [readonly]
-
-                       List of profile object paths.
-
-               array{object} Technologies [readonly]
-
-                       List of technology object paths.
-
-               array{object} Services [readonly]
-
-                       List of service object paths. The list is sorted
-                       internally to have the service with the default
-                       route always first and then the favorite services
-                       followed by scan results.
+               boolean SessionMode [readwrite]  [experminental]
 
-                       This list represents the available services for the
-                       current selected profile. If the profile gets changed
-                       then this list will be updated.
+                       This disables the auto connect feature. It should be
+                       enabled when the Session API is used. When SessionMode
+                       is enabled, 'ConnectService' and 'ConnectProvider'
+                       method calls are disallowed.
 
-                       The same list is available via the profile object
-                       itself. It is just provided here for convenience of
-                       applications only dealing with the current active
-                       profile.
+                       The default value is false.