ICD Policy Plugins

(New page: == Information on the Internet Connectivity Daemon Policy Plugins == An Internet Connectivity Daemon policy plugin is a plugin used by the Internet Connectivity Daemon to decide different ...)
(wikify slightly)
 
Line 1: Line 1:
-
== Information on the Internet Connectivity Daemon Policy Plugins ==
+
An Internet Connectivity Daemon policy plugin is a plugin used by the [[Documentation/Maemo 5 Developer Guide/Using Connectivity Components/Maemo Connectivity#Internet Connectivity Daemon|Internet Connectivity Daemon]] to decide different things about an internet connection such as whether to connect or disconnect it.
-
An Internet Connectivity Daemon policy plugin is a plugin used by the Internet Connectivity Daemon to decide different things about an internet connection such as whether to connect or disconnect it.
+
By writing a new ICD policy plugin, it should be possible to do things like making one WiFi network take priority over another WiFi network (e.g. your home network taking priority over everything else)
By writing a new ICD policy plugin, it should be possible to do things like making one WiFi network take priority over another WiFi network (e.g. your home network taking priority over everything else)
-
The plugins included with Fremantle are (in priority order): (this information comes through gconf and can be changed via the normal gconf configuration-changing tools or tricks)
+
The plugins included with Fremantle are (in priority order): (this information comes through GConf and can be changed via the normal GConf configuration-changing tools or tricks)
-
*libicd_policy_merge.so (Merge a new request with an already existing one)
+
*<code>libicd_policy_merge.so</code> (Merge a new request with an already existing one)
-
*libicd_policy_ask.so (Request 'Select connection' dialog from UI)
+
*<code>libicd_policy_ask.so</code> (Request 'Select connection' dialog from UI)
-
*libicd_policy_any.so (Any connection)
+
*<code>libicd_policy_any.so</code> (Any connection)
-
*libicd_policy_change.so (Change to another connection)
+
*<code>libicd_policy_change.so</code> (Change to another connection)
-
*libicd_policy_add.so (New IAP creation)
+
*<code>libicd_policy_add.so</code> (New IAP creation)
-
*libicd_policy_always_online.so (Always online policy)
+
*<code>libicd_policy_always_online.so</code> (Always online policy)
-
*libicd_policy_one.so (One connection only)
+
*<code>libicd_policy_one.so</code> (One connection only)
-
*libicd_policy_restart.so (IAP restart policy)
+
*<code>libicd_policy_restart.so</code> (IAP restart policy)
-
*libicd_policy_nw_disconnect.so (Network disconnect reference count)
+
*<code>libicd_policy_nw_disconnect.so</code> (Network disconnect reference count)
-
ICD policy plugins all #include policy_api.h (the base API file for ICD policy plugins) and may optionally #include icd_dbus.h (header file for working with dbus) and/or icd_log.h (logging code for ICD2 policy plugins).
+
ICD policy plugins all <code>#include policy_api.h</code> (the base API file for ICD policy plugins) and may optionally <code>#include icd_dbus.h</code> (header file for working with D-Bus) and/or <code>icd_log.h</code> (logging code for ICD2 policy plugins).
-
All ICD policy plugins export a function called icd_policy_init. This function takes a variable of type icd_policy_api * plus a number of callbacks that can be saved for later use. Your plugin does whatever initialization it wishes to do (registering dbus handlers for example), saves any private data in the "private" field of the icd_policy_api structure (which may be a pointer to a data structure containing a bunch of data) and then fills in any appropriate function members of the icd_policy_api that this plugin wishes to listen for.
+
All ICD policy plugins export a function called <code>icd_policy_init</code>. This function takes a variable of type <code>icd_policy_api *</code> plus a number of callbacks that can be saved for later use. Your plugin does whatever initialization it wishes to do (registering D-Bus handlers for example), saves any private data in the "private" field of the <code>icd_policy_api</code> structure (which may be a pointer to a data structure containing a bunch of data) and then fills in any appropriate function members of the <code>icd_policy_api</code> that this plugin wishes to listen for.
Different callbacks have different prototypes but all of them get passed the private data stored earlier.
Different callbacks have different prototypes but all of them get passed the private data stored earlier.
-
The policy API header files plus reverse engineered code (that may not be 100% correct) for libicd_policy_one.so and libicd_policy_add.so can be found here:
+
I am hoping that this information will be useful to someone and that someone will take it and build new policy plugins with it.
-
http://code.google.com/p/icd-policy/source/browse/#svn%2Ftrunk
+
-
Documentation for all this stuff can be found here:
+
== External links ==
-
http://maemo.org/api_refs/5.0/5.0-final/icd2/index.html
+
-
I am hoping that this information will be usefull to someone and that someone will take it and build a new policy plugins with it.
+
The policy API header files plus reverse engineered code (that may not be 100% correct) for <code>libicd_policy_one.so</code> and <code>libicd_policy_add.so</code> can be found here: http://code.google.com/p/icd-policy/source/browse/#svn%2Ftrunk
 +
 
 +
Documentation for all this stuff can be found here: http://maemo.org/api_refs/5.0/5.0-final/icd2/index.html
 +
 
 +
[[Category:Development]]
 +
[[Category:Fremantle]]

Latest revision as of 08:50, 28 January 2011

An Internet Connectivity Daemon policy plugin is a plugin used by the Internet Connectivity Daemon to decide different things about an internet connection such as whether to connect or disconnect it.

By writing a new ICD policy plugin, it should be possible to do things like making one WiFi network take priority over another WiFi network (e.g. your home network taking priority over everything else)

The plugins included with Fremantle are (in priority order): (this information comes through GConf and can be changed via the normal GConf configuration-changing tools or tricks)

  • libicd_policy_merge.so (Merge a new request with an already existing one)
  • libicd_policy_ask.so (Request 'Select connection' dialog from UI)
  • libicd_policy_any.so (Any connection)
  • libicd_policy_change.so (Change to another connection)
  • libicd_policy_add.so (New IAP creation)
  • libicd_policy_always_online.so (Always online policy)
  • libicd_policy_one.so (One connection only)
  • libicd_policy_restart.so (IAP restart policy)
  • libicd_policy_nw_disconnect.so (Network disconnect reference count)

ICD policy plugins all #include policy_api.h (the base API file for ICD policy plugins) and may optionally #include icd_dbus.h (header file for working with D-Bus) and/or icd_log.h (logging code for ICD2 policy plugins).

All ICD policy plugins export a function called icd_policy_init. This function takes a variable of type icd_policy_api * plus a number of callbacks that can be saved for later use. Your plugin does whatever initialization it wishes to do (registering D-Bus handlers for example), saves any private data in the "private" field of the icd_policy_api structure (which may be a pointer to a data structure containing a bunch of data) and then fills in any appropriate function members of the icd_policy_api that this plugin wishes to listen for.

Different callbacks have different prototypes but all of them get passed the private data stored earlier.

I am hoping that this information will be useful to someone and that someone will take it and build new policy plugins with it.

[edit] External links

The policy API header files plus reverse engineered code (that may not be 100% correct) for libicd_policy_one.so and libicd_policy_add.so can be found here: http://code.google.com/p/icd-policy/source/browse/#svn%2Ftrunk

Documentation for all this stuff can be found here: http://maemo.org/api_refs/5.0/5.0-final/icd2/index.html