From 36fbb5ca0c1df2bac4c1a45dd21a8bd94ee07cd9 Mon Sep 17 00:00:00 2001 From: Prajwal Mohan Date: Fri, 27 Apr 2012 15:46:04 -0700 Subject: [PATCH] Initial Import --- AUTHORS | 34 + COPYING | 340 ++ ChangeLog | 648 +++ HACKING | 144 + INSTALL | 236 + Makefile.am | 267 + Makefile.plugins | 330 ++ NEWS | 0 README | 95 + TODO | 156 + acinclude.m4 | 61 + bootstrap | 7 + bootstrap-configure | 33 + client/main.c | 244 + configure.ac | 470 ++ connman.pc.in | 14 + doc/Makefile.am | 38 + doc/advanced-configuration.txt | 61 + doc/agent-api.txt | 189 + doc/backtrace.txt | 28 + doc/behavior-api.txt | 11 + doc/clock-api.txt | 87 + doc/config-format.txt | 92 + doc/connman-docs.xml | 121 + doc/connman-introduction.xml | 15 + doc/counter-api.txt | 70 + doc/gtk-doc.make | 173 + doc/ipconfig-api.txt | 41 + doc/manager-api.txt | 304 + doc/overview-api.txt | 408 ++ doc/plugin-api.txt | 24 + doc/rfc1035.txt | 3077 +++++++++++ doc/rfc2131.txt | 2523 +++++++++ doc/rfc2132.txt | 1907 +++++++ doc/service-api.txt | 482 ++ doc/session-api.txt | 296 + doc/session-overview.txt | 141 + doc/technology-api.txt | 59 + doc/version.xml.in | 1 + gdbus/gdbus.h | 177 + gdbus/mainloop.c | 383 ++ gdbus/object.c | 868 +++ gdbus/polkit.c | 202 + gdbus/watch.c | 748 +++ gdhcp/client.c | 1545 ++++++ gdhcp/common.c | 489 ++ gdhcp/common.h | 179 + gdhcp/gdhcp.h | 144 + gdhcp/ipv4ll.c | 139 + gdhcp/ipv4ll.h | 55 + gdhcp/server.c | 903 +++ gsupplicant/dbus.c | 556 ++ gsupplicant/dbus.h | 133 + gsupplicant/gsupplicant.h | 248 + gsupplicant/supplicant.c | 3477 ++++++++++++ gweb/giognutls.c | 464 ++ gweb/giognutls.h | 24 + gweb/gionotls.c | 31 + gweb/gresolv.c | 1055 ++++ gweb/gresolv.h | 76 + gweb/gweb.c | 1435 +++++ gweb/gweb.h | 103 + include/dbus.h | 159 + include/device.h | 121 + include/inet.h | 86 + include/ipconfig.h | 108 + include/log.h | 81 + include/network.h | 156 + include/notifier.h | 67 + include/option.h | 35 + include/plugin.h | 107 + include/provider.h | 112 + include/proxy.h | 67 + include/resolver.h | 52 + include/rtnl.h | 65 + include/service.h | 111 + include/setting.h | 35 + include/storage.h | 38 + include/task.h | 67 + include/technology.h | 70 + include/timeserver.h | 58 + include/types.h | 45 + include/utsname.h | 52 + include/version.h.in | 35 + packaging/connman.changes | 467 ++ packaging/connman.spec | 146 + packaging/settings | 18 + ...oid-NULL-pointer-dereference-in-table_cle.patch | 26 + plugins/bluetooth.c | 1274 +++++ plugins/connman-nmcompat.conf | 14 + plugins/ethernet.c | 346 ++ plugins/fake.c | 110 + plugins/google.c | 48 + plugins/hh2serial-gps.c | 112 + plugins/iospm.c | 111 + plugins/iwmx.c | 588 ++ plugins/iwmx.h | 187 + plugins/iwmxsdk.c | 1044 ++++ plugins/l2tp.c | 530 ++ plugins/loopback.c | 267 + plugins/mcc.h | 475 ++ plugins/meego.c | 43 + plugins/nmcompat.c | 223 + plugins/ntpd.c | 325 ++ plugins/ofono.c | 2589 +++++++++ plugins/openconnect.c | 281 + plugins/openvpn.c | 308 ++ plugins/pacrunner.c | 476 ++ plugins/polkit.c | 55 + plugins/polkit.policy | 29 + plugins/pptp.c | 336 ++ plugins/tist.c | 609 ++ plugins/vpn.c | 514 ++ plugins/vpn.h | 48 + plugins/vpnc.c | 332 ++ plugins/wifi.c | 1449 +++++ scripts/connman.in | 46 + scripts/libppp-plugin.c | 317 ++ scripts/openconnect-script.c | 134 + scripts/openvpn-script.c | 123 + src/6to4.c | 565 ++ src/agent.c | 587 ++ src/clock.c | 355 ++ src/config.c | 883 +++ src/connection.c | 818 +++ src/connman-dbus.conf | 17 + src/connman-polkit.conf | 11 + src/connman.h | 651 +++ src/connman.service.in | 11 + src/connman.ver | 7 + src/counter.c | 197 + src/dbus.c | 387 ++ src/detect.c | 134 + src/device.c | 1240 +++++ src/dhcp.c | 505 ++ src/dnsproxy.c | 1612 ++++++ src/error.c | 185 + src/genbuiltin | 17 + src/inet.c | 1722 ++++++ src/ipconfig.c | 2319 ++++++++ src/iptables.c | 1868 +++++++ src/log.c | 353 ++ src/main.c | 419 ++ src/main.conf | 7 + src/manager.c | 648 +++ src/network.c | 1815 ++++++ src/notifier.c | 635 +++ src/ntp.c | 382 ++ src/plugin.c | 221 + src/provider.c | 1053 ++++ src/proxy.c | 250 + src/resolver.c | 520 ++ src/rfkill.c | 237 + src/rtnl.c | 1649 ++++++ src/service.c | 5822 ++++++++++++++++++++ src/session.c | 1872 +++++++ src/stats.c | 825 +++ src/storage.c | 456 ++ src/task.c | 499 ++ src/technology.c | 1162 ++++ src/tethering.c | 634 +++ src/timeserver.c | 173 + src/timezone.c | 441 ++ src/utsname.c | 139 + src/wispr.c | 777 +++ src/wpad.c | 212 + test/backtrace | 57 + test/connect-service | 32 + test/connect-vpn | 73 + test/disable-tethering | 40 + test/disconnect-vpn | 21 + test/enable-tethering | 55 + test/find-service | 17 + test/get-global-timeservers | 12 + test/get-proxy-autoconfig | 37 + test/get-services | 58 + test/get-state | 12 + test/list-profiles | 34 + test/list-services | 63 + test/monitor-connman | 88 + test/monitor-manager | 38 + test/monitor-services | 59 + test/provision-service | 28 + test/service-move-before | 27 + test/set-address | 45 + test/set-domains | 20 + test/set-global-timeservers | 18 + test/set-ipv4-method | 34 + test/set-ipv6-method | 37 + test/set-nameservers | 20 + test/set-proxy | 44 + test/show-introspection | 21 + test/simple-agent | 159 + test/test-clock | 19 + test/test-compat | 15 + test/test-connman | 205 + test/test-counter | 79 + test/test-manager | 122 + test/test-new-supplicant | 14 + test/test-session | 345 ++ test/test-supplicant | 71 + tools/addr-test.c | 66 + tools/alg-test.c | 131 + tools/dbus-test.c | 85 + tools/dhcp-server-test.c | 123 + tools/dhcp-test.c | 189 + tools/iptables-test.c | 1753 ++++++ tools/polkit-test.c | 184 + tools/private-network-test.c | 268 + tools/resolv-test.c | 166 + tools/stats-tool.c | 911 +++ tools/supplicant-dbus.c | 411 ++ tools/supplicant-dbus.h | 93 + tools/supplicant-test.c | 198 + tools/supplicant.c | 1946 +++++++ tools/supplicant.h | 139 + tools/tap-test.c | 198 + tools/web-test.c | 172 + tools/wispr.c | 710 +++ tools/wpad-test.c | 200 + unit/manager-api.c | 262 + unit/session-api.c | 408 ++ unit/test-connman.h | 155 + unit/test-session.c | 585 ++ unit/utils.c | 261 + 225 files changed, 89313 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 HACKING create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 Makefile.plugins create mode 100644 NEWS create mode 100644 README create mode 100644 TODO create mode 100644 acinclude.m4 create mode 100755 bootstrap create mode 100755 bootstrap-configure create mode 100644 client/main.c create mode 100644 configure.ac create mode 100644 connman.pc.in create mode 100644 doc/Makefile.am create mode 100644 doc/advanced-configuration.txt create mode 100644 doc/agent-api.txt create mode 100644 doc/backtrace.txt create mode 100644 doc/behavior-api.txt create mode 100644 doc/clock-api.txt create mode 100644 doc/config-format.txt create mode 100644 doc/connman-docs.xml create mode 100644 doc/connman-introduction.xml create mode 100644 doc/counter-api.txt create mode 100644 doc/gtk-doc.make create mode 100644 doc/ipconfig-api.txt create mode 100644 doc/manager-api.txt create mode 100644 doc/overview-api.txt create mode 100644 doc/plugin-api.txt create mode 100644 doc/rfc1035.txt create mode 100644 doc/rfc2131.txt create mode 100644 doc/rfc2132.txt create mode 100644 doc/service-api.txt create mode 100644 doc/session-api.txt create mode 100644 doc/session-overview.txt create mode 100644 doc/technology-api.txt create mode 100644 doc/version.xml.in create mode 100644 gdbus/gdbus.h create mode 100644 gdbus/mainloop.c create mode 100644 gdbus/object.c create mode 100644 gdbus/polkit.c create mode 100644 gdbus/watch.c create mode 100644 gdhcp/client.c create mode 100644 gdhcp/common.c create mode 100644 gdhcp/common.h create mode 100644 gdhcp/gdhcp.h create mode 100644 gdhcp/ipv4ll.c create mode 100644 gdhcp/ipv4ll.h create mode 100644 gdhcp/server.c create mode 100644 gsupplicant/dbus.c create mode 100644 gsupplicant/dbus.h create mode 100644 gsupplicant/gsupplicant.h create mode 100644 gsupplicant/supplicant.c create mode 100644 gweb/giognutls.c create mode 100644 gweb/giognutls.h create mode 100644 gweb/gionotls.c create mode 100644 gweb/gresolv.c create mode 100644 gweb/gresolv.h create mode 100644 gweb/gweb.c create mode 100644 gweb/gweb.h create mode 100644 include/dbus.h create mode 100644 include/device.h create mode 100644 include/inet.h create mode 100644 include/ipconfig.h create mode 100644 include/log.h create mode 100644 include/network.h create mode 100644 include/notifier.h create mode 100644 include/option.h create mode 100644 include/plugin.h create mode 100644 include/provider.h create mode 100644 include/proxy.h create mode 100644 include/resolver.h create mode 100644 include/rtnl.h create mode 100644 include/service.h create mode 100644 include/setting.h create mode 100644 include/storage.h create mode 100644 include/task.h create mode 100644 include/technology.h create mode 100644 include/timeserver.h create mode 100644 include/types.h create mode 100644 include/utsname.h create mode 100644 include/version.h.in create mode 100644 packaging/connman.changes create mode 100644 packaging/connman.spec create mode 100644 packaging/settings create mode 100644 patches/0001-iptables-Avoid-NULL-pointer-dereference-in-table_cle.patch create mode 100644 plugins/bluetooth.c create mode 100644 plugins/connman-nmcompat.conf create mode 100644 plugins/ethernet.c create mode 100644 plugins/fake.c create mode 100644 plugins/google.c create mode 100644 plugins/hh2serial-gps.c create mode 100644 plugins/iospm.c create mode 100644 plugins/iwmx.c create mode 100644 plugins/iwmx.h create mode 100644 plugins/iwmxsdk.c create mode 100644 plugins/l2tp.c create mode 100644 plugins/loopback.c create mode 100644 plugins/mcc.h create mode 100644 plugins/meego.c create mode 100644 plugins/nmcompat.c create mode 100644 plugins/ntpd.c create mode 100644 plugins/ofono.c create mode 100644 plugins/openconnect.c create mode 100644 plugins/openvpn.c create mode 100644 plugins/pacrunner.c create mode 100644 plugins/polkit.c create mode 100644 plugins/polkit.policy create mode 100644 plugins/pptp.c create mode 100644 plugins/tist.c create mode 100644 plugins/vpn.c create mode 100644 plugins/vpn.h create mode 100644 plugins/vpnc.c create mode 100644 plugins/wifi.c create mode 100644 scripts/connman.in create mode 100644 scripts/libppp-plugin.c create mode 100644 scripts/openconnect-script.c create mode 100644 scripts/openvpn-script.c create mode 100644 src/6to4.c create mode 100644 src/agent.c create mode 100644 src/clock.c create mode 100644 src/config.c create mode 100644 src/connection.c create mode 100644 src/connman-dbus.conf create mode 100644 src/connman-polkit.conf create mode 100644 src/connman.h create mode 100644 src/connman.service.in create mode 100644 src/connman.ver create mode 100644 src/counter.c create mode 100644 src/dbus.c create mode 100644 src/detect.c create mode 100644 src/device.c create mode 100644 src/dhcp.c create mode 100644 src/dnsproxy.c create mode 100644 src/error.c create mode 100755 src/genbuiltin create mode 100644 src/inet.c create mode 100644 src/ipconfig.c create mode 100644 src/iptables.c create mode 100644 src/log.c create mode 100644 src/main.c create mode 100644 src/main.conf create mode 100644 src/manager.c create mode 100644 src/network.c create mode 100644 src/notifier.c create mode 100644 src/ntp.c create mode 100644 src/plugin.c create mode 100644 src/provider.c create mode 100644 src/proxy.c create mode 100644 src/resolver.c create mode 100644 src/rfkill.c create mode 100644 src/rtnl.c create mode 100644 src/service.c create mode 100644 src/session.c create mode 100644 src/stats.c create mode 100644 src/storage.c create mode 100644 src/task.c create mode 100644 src/technology.c create mode 100644 src/tethering.c create mode 100644 src/timeserver.c create mode 100644 src/timezone.c create mode 100644 src/utsname.c create mode 100644 src/wispr.c create mode 100644 src/wpad.c create mode 100755 test/backtrace create mode 100755 test/connect-service create mode 100755 test/connect-vpn create mode 100755 test/disable-tethering create mode 100755 test/disconnect-vpn create mode 100755 test/enable-tethering create mode 100755 test/find-service create mode 100755 test/get-global-timeservers create mode 100755 test/get-proxy-autoconfig create mode 100755 test/get-services create mode 100755 test/get-state create mode 100755 test/list-profiles create mode 100755 test/list-services create mode 100755 test/monitor-connman create mode 100755 test/monitor-manager create mode 100755 test/monitor-services create mode 100755 test/provision-service create mode 100755 test/service-move-before create mode 100755 test/set-address create mode 100755 test/set-domains create mode 100755 test/set-global-timeservers create mode 100755 test/set-ipv4-method create mode 100755 test/set-ipv6-method create mode 100755 test/set-nameservers create mode 100755 test/set-proxy create mode 100755 test/show-introspection create mode 100755 test/simple-agent create mode 100755 test/test-clock create mode 100755 test/test-compat create mode 100755 test/test-connman create mode 100755 test/test-counter create mode 100755 test/test-manager create mode 100755 test/test-new-supplicant create mode 100755 test/test-session create mode 100755 test/test-supplicant create mode 100644 tools/addr-test.c create mode 100644 tools/alg-test.c create mode 100644 tools/dbus-test.c create mode 100644 tools/dhcp-server-test.c create mode 100644 tools/dhcp-test.c create mode 100644 tools/iptables-test.c create mode 100644 tools/polkit-test.c create mode 100644 tools/private-network-test.c create mode 100644 tools/resolv-test.c create mode 100644 tools/stats-tool.c create mode 100644 tools/supplicant-dbus.c create mode 100644 tools/supplicant-dbus.h create mode 100644 tools/supplicant-test.c create mode 100644 tools/supplicant.c create mode 100644 tools/supplicant.h create mode 100644 tools/tap-test.c create mode 100644 tools/web-test.c create mode 100644 tools/wispr.c create mode 100644 tools/wpad-test.c create mode 100644 unit/manager-api.c create mode 100644 unit/session-api.c create mode 100644 unit/test-connman.h create mode 100644 unit/test-session.c create mode 100644 unit/utils.c diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..002fa6b --- /dev/null +++ b/AUTHORS @@ -0,0 +1,34 @@ +Marcel Holtmann +Inaky Perez-Gonzalez +Samuel Ortiz +Joshua Lock +Richard Purdie +Gustavo Sverzut Barbieri +Martin Xu +Sam Leffler +Daniel Wagner +Forest Bond +Kalle Valo +Fabien Marotte +Pekka Pessi +Tomasz Bursztyka +Cristiano Fernandes +Joey Lee +Leena Gunda +Patrik Flykt +David Woodhouse +Gustavo F. Padovan +Julien Massot +Jukka Rissanen +Grant Erickson +Guillaume Lucas +Henri Bragge +Alok Barsode +Sébastien Bianti +Yu A Wang +Thierry Boureille +Paolo Pellegrino +Bertrand Aygon +Jeff Zheng +Philippe Nunes +Danny Jeongseok Seo diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..6d45519 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..8a8ee7d --- /dev/null +++ b/ChangeLog @@ -0,0 +1,648 @@ +ver 0.78.2: + Backport ofono with CDMA support + +ver 0.78.1: + Rebased for connman-stable + +ver 0.78: + Fix multiple issues with service connection states. + Fix multiple issues with technology handling. + Fix issue with DHCP file descriptor leakage. + Fix issue with open access points and WPS. + Fix issue with handling of cellular devices. + Fix issue with DNS proxy hostname resolving. + Add support for PPTP and L2TP VPN tunneling. + Add support for organized settings storage. + Add support for WiFi fast connect handling. + Add support for better WiFi error handling. + Add support for integrated WISPr handling. + +ver 0.77: + Fix issue with iptables API breakage. + Fix issue with agent input handling. + Fix issue with empty cellular operator name. + Fix issue with reference counting for network objects. + Fix issue with missing D-Bus signals for proxy changes. + Fix issue with group identifier and hidden WiFi networks. + Fix issue with setting wrong gateway for PPP connections. + Fix issue with mismatch of stored IP configuration settings. + Fix issue with not stopping DHCP for IPv4 configuration. + Add support for remembering last IP address from DHCP. + Add support for EAP-GTC authentication method. + +ver 0.76: + Fix issue with loopback interface setup. + Fix issue with /etc/localtime being a symlink. + Fix issue with not handling dummy network devices. + Fix issue with not provisioning existing services. + Fix issue with running WPAD on IPv6 connections. + Fix issue with client certificate for TTLS/PEAP. + Remove internal element infrastructure. + +ver 0.75: + Fix issue with 3G connect timeout handling. + Fix issue with WiFi raw key PSK handling. + Fix issue with DHCP renewal timeout handling. + Fix issue with DHCP and empty nameserver list. + Add support for unit testing. + +ver 0.74: + Fix issue with race condition in ready/online handling. + Fix issue with DHCP release callback handling. + Fix multiple issues with session API handling. + Add support for using DNS proxy for Tethering. + Add support for Private Network API. + Add support for Clock API. + +ver 0.73: + Update support for session API handling. + Add support for more advanced roaming policies. + Add support for EAP identity and passphrase queries. + Add support for IPv6 handling with cellular bearer. + Add support for main configuration file. + Remove deprecated profile interface. + +ver 0.72: + Fix issue with overwriting DNS servers from DHCP. + Fix issue with DHCP renewal with same configuration. + Fix issue with multiple memory leaks. + Add support for 6to4 tunneling. + +ver 0.71: + Fix issue with not storing IPv6 privacy settings. + Fix issue with storing fixed and manual IP settings. + Fix issue with service state when PAN connection fails. + Fix issue with tethering and WiFi bridge handling. + Fix issue with autonomously activated contexts. + Fix issue with nameserver array for PACrunner. + Fix issue with network information memory leak. + Fix issue with double-free in statistics handling. + Fix issue with handling malformed profiles. + Fix issue with pending DHCP client requests. + Add initial support for TI shared transport handling. + +ver 0.70: + Add support for reporting invalid WiFi passphrases. + Add support for IPv6 privacy extension. + Add support for IPv6 advanced features. + Add support for IPv6 nameserver settings. + Remove deprecated APN service settings. + +ver 0.69: + Fix issue with not handling DNS proxy failures gracefully. + Fix issue with double free in statistics handling. + Fix issue with early tethering bridge creation. + Add support for tethering property per technology. + Add support for initial WiFi tethering feature. + Add support for using PACrunner as proxy driver. + Add support for WPS as part of the security property. + +ver 0.68: + Fix issue with wrong name of PolicyKit configuration file. + Fix issue with inconsistency of WiFi scan states. + Fix issue with missing auto-reconnect and oFono. + Add support for vpnc based private networks. + Add support for WiFi Protected Setup handling. + Remove legacy WiFi plugin. + +ver 0.67: + Fix issue with oFono plugin and multiple online calls. + Fix issue with checking for AutoConnect service property. + Remove deprecated MCC and MNC service properties. + +ver 0.66: + Fix multiple set of memory leaks. + Fix issue with WPA supplicant phase2 values. + Fix issue with WiFi access points after kill/restart. + Fix issue with correct PACrunner configuration loading. + Add support for loading provision files at runtime. + Add support for setting proxy auto-configuration. + Add support for IPv6 auto-configured addresses. + +ver 0.65: + Use new WiFi plugin by default. + Fix issue with handling already powered devices. + Fix issue with handling proxy PAC option from DHCP. + Add support for handling regulatory domain settings. + Add support for handling IPv6 router advertisements. + Add support for handling IPv6 nameservers. + Add support for handling multiple search domains. + Add support for handling oFono modem lockdown. + Add support for handling IPv6 DNS connections. + Add support for IPv4 Link-Local negotiation. + Add support for USB CDC Tethering functionality. + +ver 0.64: + Update service name to net.connman domain. + Fix issue with disabling a technology twice. + Fix issue with using wrong string for Proxy.Method. + Fix issue with TCP connection lookup and DNS proxy. + Fix issue with TCP receive busy waits and DNS proxy. + Fix various issues with WPA Supplicant interaction. + Add support for chunk encoding to HTTP client. + Add support for internal HTTP client for portal detection. + Add support for internal DHCP server setup. + Add support for internal NAT and IP forwarding setup. + Add support for Bluetooth Tethering functionality. + Remove deprecated device and network D-Bus interfaces. + Remove support for dhclient plugin. + +ver 0.63: + Change to use nl80211/cfg80211 WiFi management by default. + Fix various issues with new WPA Supplicant interface. + Fix issue with not connecting failed networks at boot. + Fix issue with properly tracking RFKILL blocked state. + Fix issue with missing signals for IPv4/IPv6 gateway details. + Add support for using RTNL for setting IPv4/IPv6 details. + Add support for using PHONET_PIPE GPRS interfaces. + Add support for setting manual proxy configurations. + Add support for exporting proxy configurations to PACrunner. + Add support for combined home and roaming statistics. + Add support for OpenVPN connections. + Remove dependency on udev. + +ver 0.62: + Fix crash with non-existent or extra DHCP result options. + Fix crash when doing PEAP/TTLS authentication. + Fix issue with handling multiple data counters. + Fix issue with Bluetooth adapters without address. + Fix issue with multiple scanning attempts after disconnects. + Fix issue with VPN services when switching into offline mode. + Add support for storing statistics information in separate files. + Add support for verification of configuration file parameters. + Add support for handling time server values from DHCP. + Add support for allowing DNS over TCP within the DNS proxy. + Add support for loading proxy configurations into PACrunner. + Add support for WiFi plugin using new WPA Supplicant D-Bus API. + Add support for requesting passphrases via agents. + Remove default support for EDNS0 option. + +ver 0.61: + Add support for using the internal DHCP client by default. + Add support for latest PolicyKit framework. + Add support for new oFono D-Bus interfaces. + +ver 0.60: + Fix issue with missing reset of proxy settings. + Fix issue with missing Ethernet property changed signal. + Fix issue with offline operation on already blocked devices. + Fix issue with offline mode and device powered changes. + Fix issue with portal detection and DHCP renewals. + Fix issue with connection attempts for removed networks. + Fix issue with stale pointers of networks. + +ver 0.59: + Fix issue with D-Bus object paths of VPN providers. + +ver 0.58: + Fix various issues around offline mode. + Fix various issues with VPN nameserver handling. + Add support for home/roaming network statistics. + Add support for EAP-TTLS WiFi configuration. + Add support for creating backtraces. + +ver 0.57: + Fix missing default profile creation. + Fix missing service integration of VPN providers. + Fix missing export of PAC information retrieved from DHCP. + Fix issue with detection of new Bluetooth devices. + Fix issue with offline mode handling. + Fix issue with device power handling. + +ver 0.56: + Fix issues with offline mode handling. + Fix service integration with VPN providers. + Add internal asynchronous resolver library. + Add internal DHCP client library. + Add support for using internal DHCP client. + Add support for WPAD proxy auto-configuration. + Add support for static IPv6 configuration. + Add support for DHCP provided domain names. + Add initial support for on-demand connections. + Remove uDHCP and resolvconf plugins. + +ver 0.55: + Fix issue with 3G roaming status indication. + Fix issue with using -H option with dhclient. + Fix issue with loading WiFi SSID details for scanning. + Add support for setting host routes for DNS servers. + Add support for more detailed statistics counters. + Add support for internal DHCP client library. + +ver 0.54: + Fix issue with root requests and EDNS0 OPT records. + Fix issue with default gateway when route deletion fails. + Fix issue with group identifiers for cellular networks. + Fix issue with fixed IP settings from cellular networks. + Fix issue with nameserver settings and manual configuration. + Add support for cellular network name changes. + Add support for cellular signal strength changes. + Add support for actively scanning for hidden networks. + Add support for ASCII based WEP keys. + Add support for NTP timeserver updates. + Add support for PPP default route settings. + +ver 0.53: + Fix issue with supplicant and device scanning state cleaning. + Fix issue with Bluetooth PAN networks stay in connected state. + Fix issue with reference counting and connected state. + Fix issue with technology disabling on device removal. + Fix issue with two default gateways when using VPN. + Fix issue with static IPv4 configuration and signals. + Add support for splitting DHCP provided nameserver results. + Add support multiple nameservers in /etc/resolv.conf. + Add support for setting manual DNS server configuration. + Add support for exporting IPv4 gateway information. + Add support for newer versions of oFono API. + +ver 0.52: + Fix issue with new "connected" states. + Fix issue with hidden networks and PSK. + Fix issue with DHCP and Bluetooth PAN. + Fix issue when disconnecting PAN networks. + Add support for application sessions. + Add plugin for hh2serial GPS support. + +ver 0.51: + Fix issue with missing device power toggling. + Fix issue with D-Bus object path on device removal. + Add support for WiFi portal detection. + Add support for configuring static gateways. + Remove unneeded plugin for Option HSO support. + Remove unneeded plugin for Ericsson MBM support. + +ver 0.50: + Fix configuration loading for unknown services. + Fix IP method setting of Ethernet plugin. + +ver 0.49: + Fix issue with WiFi power changes. + Fix issue with Bluetooth device startup. + Fix issue with host route settings for VPN. + Fix issue with processing of RFKILL events. + Fix some WPA Enterprise privacy issues. + Add support for basic Ethernet information. + Add support for static IP settings. + +ver 0.48: + Fix signal strength calculation when quality is not provided. + Fix issues with wpa_supplicant state tracking. + Fix faulty removal of IP address from interface. + Fix permissions of newly created /etc/resolv.conf file. + Fix DNS proxy handling when in offline mode. + Add support for EDNS0 resolver option. + Add workaround for large EDNS0 queries. + Add workaround for DHCP startup failures with WiFi networks. + Add support for handling hostnames and domainnames. + Add support for IPv4 configuration via service interface. + Add support for fixed and manual IPv4 configuration. + Add support for default service changed notifier. + Add support for clearing failure state via service removal. + Add support for OpenConnect VPN connections. + Add support for IEEE 802.1x WiFi networks. + Add support for roaming between WPA and WPA2 networks. + Add various generic D-Bus helpers and use them. + Remove special handling of Ethernet devices. + +ver 0.47: + Fix segmentation fault on resolver shutdown. + Fix issue with adding nameserver that doesn't exist. + Fix issue when no broadcast address is given. + Fix issue with missing property changed signal. + Add checks for invalid supplicant state transitions. + Add initial version of oFono GPRS support. + Add support for dynamic debug framework. + +ver 0.46: + Fix reconnect issue when power off or disabling the device. + Remove problematic retry on failure code path. + +ver 0.45: + Fix crash with connect timeout and second connect attempt. + Fix reconnect issues after suspend or roaming attempt. + +ver 0.44: + Fix command line options for device filtering. + Fix issue with network reference in MBM support. + Fix handling when losing network access in MBM plugin. + Fix broken libiWmxSDK callback parameter handling. + Add work around Intel WiMAX SDK API breakage. + +ver 0.43: + Fix issue with missing scanning after power up. + Fix issue with udev versus /dev/rfkill event processing. + Fix issue with powered down device on connection attempt. + Add support for multiple connection attempts. + Add support for tracking the operation state. + Add full support for Ericsson MBM cellular devices. + +ver 0.42: + Fix issue with switching between hidden WiFi networks. + Fix issue with missing scanning after disconnect. + Fix issue with not triggering auto-connect in some cases. + +ver 0.41: + Fix race condition with WiFi devices and RFKILL. + Fix issue with WiFi connect/disconnect and some drivers. + Fix issue with WEP encryption and staging drivers. + Fix issue with wrong setup of loopback interfaces. + +ver 0.40: + Fix issue with wrong setting of initial AutoConnect value. + Fix issue with IP configuration and loopback devices. + Fix issue with build system and include directory. + Fix wrong variable for dhclient-script location. + Fix disconnect race condition with Bluetooth service. + Add support for ignoring bonding Ethernet interfaces. + +ver 0.39: + Fix file permissions for profile storage. + Fix service resorting when they are in different states. + Fix support for handling Bluetooth PAN devices. + Add support for AutoConnect property of services. + Add support for creating, modifying and removing profiles. + Add support for fully flexible task handling framework. + Add support for more generic RTNL handling and notifications. + Add support for full non-recursive build. + +ver 0.38: + Fix broken check for security modes. + Fix requirement of inotify when loopback support is disabled. + +ver 0.37: + Fix missing update of signal strength from scan results. + Fix error handling in case when passphrase is required. + Add support for PassphraseRequired property. + Add missing check for WiFi security modes. + +ver 0.36: + Fix missing reset of network reference when disconnecting. + Fix wrong variable reference when sending technology replies. + Fix wrong identifiers of D-Bus error names. + +ver 0.35: + Fix missing auto-connect trigger on Ethernet device removal. + Fix availability listing for devices without attached drivers. + Fix signals for connected and default technologies. + Fix notification to use service types instead of device types. + Fix potential pending scan result reply messages after removal. + Add support for blocking enable and disable technology changes. + +ver 0.34: + Fix setup of udev context before loading any plugins. + Fix rearming the scan trigger if a device got disabled. + Fix device power state changes tracking with RFKILL notifications. + Fix wrong usage of device types instead of service types. + Fix connect method to handle non-WiFi services. + +ver 0.33: + Add support for RFKILL changes of the WiFi subsystem. + Fix state value of Network Manager compatibility support. + +ver 0.32: + Fix broken device unregistration on removal. + Fix WiMAX device detection handling. + +ver 0.31: + Fix missing enforcement of offline mode for new devices. + Add support for persistent storage of offline mode. + Add support for persistent storage of device power state. + Remove deprecated and unused network storage callbacks. + +ver 0.30: + Fix issue where hidden network could show up in service list. + Fix issue with asynchronous notification of scan requests. + Fix message reference leak when adding interface fails. + Fix problem when removing network during inactive state. + Remove broken and unused callback for joining networks. + Remove deprecated device and network interface methods. + Remove test scripts for deprecated interface methods. + +ver 0.29: + Fix missing signal emission for offline mode changes. + Fix signal emission for changes in technology properties. + Rename Technologies property to AvailableTechnologies. + +ver 0.28: + Fix another reference counting imbalance when adding networks. + Revert supplicant change to always reset scanning after results. + +ver 0.27: + Fix missing disarming of the connection timeout. + Fix handling of multiple supplicant disconnect attempts. + Fix simultaneous connects from different technologies limitation. + +ver 0.26: + Fix broken handling of auto-connect logic. + Fix handling of out-of-range access points. + Fix support for connecting to hidden networks. + Fix reference counting for networks with same SSID. + Fix issue with WiFi interfaces not getting switched off. + Fix problems with delayed service list updates. + Fix disconnect/abort of connection attempts. + +ver 0.25: + Fix showing of WiFi networks with less than 25% signal strength. + Fix potential segmentation fault with network passphrases. + +ver 0.24: + Fix handling of initial device powered state. + Fix missing Powered property changed signals. + Fix canceling of a network connection attempt. + Fix stalled configuration issue with supplicant. + Fix detection of association errors from supplicant. + Fix issue with wrong scanning state information. + Fix hidden SSID detection routines. + Fix visible Ethernet services even without carrier. + Add global method call to request scanning. + Add support for global technologies list. + Add support for delaying service list updates. + Update the overall D-Bus API documentation. + +ver 0.23: + Fix dhclient probe/remove race condition. + Fix handling of disconnected services during auto-connect. + Add support for proper group name of hidden networks. + Add support for storing SSID details of hidden networks. + +ver 0.22: + Fix wrong auto-connect procedure after user connection. + Fix invalid update of already connected network. + Fix idle state handling after disconnecting device. + Fix disconnect race condition in WiFi supplicant. + Fix WiFi signal strength reporting. + +ver 0.21: + Add udev based network device detection. + Add support for global auto-connect feature. + Add support for basic service drag and drop. + Fix missing passphrase cleanup on service removal. + Fix potential duplicate network creation. + Fix handling of WEP shared keys. + +ver 0.20: + Add plugin for Intel WiMAX SDK support. + Add special handling for default vendor SSIDs. + Add support for default gateway in different network. + Add support for automatic switching of default gateway. + Add support for asynchronous handling of Powered property. + Add support for connecting/disconnecting Ethernet services. + Add support for more detailed error states of services. + Add support for clearing error state via ClearProperty. + Fix error code for invalid or unknown properties. + Fix various timeout handling issues. + Remove Policy and Priority device and network properties. + +ver 0.19: + Add hidden networks to the service list. + Add support for storing the service name. + Fix service list sorting for connected services. + Fix missing cancel command when operation times out. + Fix various issues with service favorite handling. + Remove Available and Remember network properties. + +ver 0.18: + Add support for asynchronous service connect method. + Fix broken storage of service favorite details. + +ver 0.17: + Add AT chat library implementation. + Fix service lookup for WiFi and WiMAX devices. + Fix service state signal emission and error handling. + Fix storing and loading of configured passphrases for services. + +ver 0.16: + Update Intel OSPM support to latest specification. + Add initial support for new service interface. + Add support for builtin plugins. + Add extra warning if no nameserver is defined. + Add error reporting for state and storage directory creation. + Add error message for network and device storing failures + Fix stale entry in gateway list after connection changes. + Fix handling of DHCP results with no nameserver. + Fix infinite loop for service lookup. + Fix various format string warnings. + +ver 0.15: + Detect VMware network interface and ignore them. + Fix setting of scan_ssid for hidden networks. + Fix empty network name property. + +ver 0.14: + Add support for detecting DHCP failures. + Add support for joining hidden WiFi networks. + Add support for device and network address property. + Add support for default /etc/resolv.conf generation. + Fix issue with wrong address setting for loopback. + Fix detection of WiFi access point changes. + Fix crash with blob properties. + +ver 0.13: + Add support for notification infrastructure. + Add fully dynamic property storage capabilities. + Fix broken loading of last network on bootup. + Fix crash when unplugging WiFi devices. + Rename OSPM plugin to Intel OSPM plugin. + Rename WiMAX plugin to Intel WiMAX SDK plugin. + +ver 0.12: + Fix connection state change handling. + Fix network list enumeration. + Fix broken driver matching for devices. + Fix issue with network identifier lookup. + +ver 0.11: + Add plugin priority handling. + Add network type for WiMAX. + Fix network protocol selection for Bluetooth PAN. + Fix parameters for Bluetooth PAN disconnect method. + +ver 0.10: + Fix races with connection signals. + Fix automatic switching of default connection. + +ver 0.9: + Rename FlightMode to OfflineMode. + Add static IPv4 setting support for Ethernet devices. + Add extra options to exclude devices and plugins. + Add support for toggling debug output. + Add support for ScanInterval property. + Fix handling of disconnect commands from applications. + Fix detection of networks that are out of range. + Fix setting network remember status. + Fix argument type checking of properties. + +ver 0.8: + Add Device and Network property to connection interface. + Add option to disable installation of data files. + Add command line option to show version number. + Fix signal emission for network changes. + +ver 0.7: + Add basic support for flight mode. + Add support for multiple storage drivers. + Add support for RTNL newlink watch API. + Add support for different security privileges. + Add support for device and network priorities. + Add functions for setting network properties. + Fix issue with listing devices without a driver. + Fix issue with WiFi scanning indication. + Fix detection of WiFi security changes. + Update WiFi driver to use new network helpers. + Install different D-Bus configuration for PolicyKit. + +ver 0.6: + Add CONNMAN_API_SUBJECT_TO_CHANGE definition. + Add detailed configuration options. + Add various D-Bus helper functions. + Add generic device driver infrastructure. + Add generic network driver infrastructure. + Add property for WiFi network mode. + Add property for network interface name. + Add property for global connection policy. + Add support for verbose compiler warnings. + Add support for device detection via udev. + Add support for systems with udhcpc. + Add support for Bluetooth PAN networks. + Fix WiFi issue with DHCP restart after handshake. + Fix exported symbols list creation. + Remove deprecated and unused plugins. + +ver 0.5: + Add support for handling Bluetooth adapters. + Add support for activating wpa_supplicant on demand. + Add Device property to network objects. + Add Scanning property to device objects. + Fix Name property of device objects. + Fix WiFi SSID to object path conversion. + Fix duplicate wireless scan results. + Fix built issue with libudev and uClibc. + Fix issues with element registration failures. + +ver 0.4: + Add DNS proxy resolver plugin. + Add support for default connections. + Add support for gateway change notifications. + Add signal strength property for connections. + Add property for connection type. + Fix issue with carrier detection. + Fix broken resolvconf plugin. + +ver 0.3: + Add support for automatically connecting known networks. + Add improved framework for handling resolver details. + Add generic signal strength property. + Fix bridge and WiMAX device detection. + Fix network listing for Ethernet devices. + +ver 0.2: + Add support for indicating network changes. + Add support for signal strength property. + Add support for unique device names. + Fix broken device enumeration. + Fix issue with device removal callback. + Fix issue with wpa_supplicant disconnecting. + Fix D-Bus access policy configuration. + +ver 0.1: + Initial public release. diff --git a/HACKING b/HACKING new file mode 100644 index 0000000..05fb69c --- /dev/null +++ b/HACKING @@ -0,0 +1,144 @@ +Hacking on Connection Manager +***************************** + + +Build tools requirements +======================== + +When building and testing directly from the repository it is important to +have at least automake version 1.10 or later installed. All modern +distributions should default to the latest version, but it seems that +Debian's default is still an earlier version: + + Check version + # dpkg -l '*automake*' + + Install new version + # apt-get install automake1.10 + # update-alternatives --config automake + + +Working with the source code repository +======================================= + +The repository contains two extra scripts that accomplish the bootstrap +process. One is called "bootstrap" which is the basic scripts that uses the +autotools scripts to create the needed files for building and installing. +It makes sure to call the right programs depending on the usage of shared or +static libraries or translations etc. + +The second program is called "bootstrap-configure". This program will make +sure to properly clean the repository, call the "bootstrap" script and then +call configure with proper settings for development. It will use the best +options and pass them over to configure. These options normally include +the enabling the maintainer mode and the debugging features. + +So while in a normal source project the call "./configure ..." is used to +configure the project with its settings like prefix and extra options. In +case of bare repositories call "./bootstrap-configure" and it will bootstrap +the repository and calls configure with all the correct options to make +development easier. + +In case of preparing for a release with "make distcheck", don't use +bootstrap-configure since it could export development specific settings. + +So the normal steps to checkout, build and install such a repository is +like this: + + Checkout repository + # git clone git://git.kernel.org/pub/scm/network/connman/connman.git + # cd connman + + Configure and build + # ./bootstrap-configure + # make + + Check installation + # make install DESTDIR=$PWD/x + # find x + # rm -rf x + + Check distribution + # make distcheck + + Final installation + # sudo make install + + Remove autogenerated files + # make maintainer-clean + + +Running from within the source code repository +============================================== + +When using "./configure --enable-maintainer-mode" the automake scripts will +use the plugins directly from within the repository. This removes the need +to use "make install" when testing "connmand". The "bootstrap-configure" +automatically includes this option. + + Run daemon in foreground with debugging + # sudo ./src/connmand -n -d 'plugins/*' + +The debugging option -d takes an argument. This argument can be a comma +separated list of file names like 'plugins/wifi.c,plugins/ethernet.c' to +enable debugs in these files. Simple glob style pattern matching is +supported in this list. + +For production installations or distribution packaging it is important that +the "--enable-maintainer-mode" option is NOT used. + +Some times it is important to restrict the available interfaces. For example +in cases where testing happens over a network connection. The "-i" command +line switch allows to specify a glob pattern for the interface names. + + Run daemon for wireless interfaces + # sudo ./src/connmand -n -i wlan* + + +Debugging the D-Bus interface during runtime +============================================ + +Running the daemon with debugging information in the foreground is quite +verbose and sometimes not really helpful. The "monitor-connman" script +allows to monitor "PropertyChanged" D-Bus signals from various interfaces. + +Every "PropertyChanged" signal will generate a line of output. Some of them +can get very complex. The first detail inside "{ ... }" is the interface +name (without its service name prefix). The second detail inside "[ ... ]" +is the object path. And after that it is followed by a key and value of +the property that changed. + + +Generating source code documentation +==================================== + +The source code is annotated using the gtk-doc style documentation. This +allows an easy way of generating API documentation. The "bootstrap-configure" +script will use the "--enable-gtk-doc" configure to enable the generation of +the documentation. + +To make the gtk-doc process work, the gtk-doc tools need to be installed. +Every distribution should provide a package for this, but the naming of the +package might be different: + + Debian + # apt-get install gtk-doc-tools + + Ubuntu + # apt-get install gtk-doc-utils + + Fedora + # yum install gtk-doc + +In case "bootstrap-configure" is not used, the manual steps for generating +the documentation files are like this: + + Configuring the repository + # ./configure --enable-gtk-doc + + Generate the documentation + # cd doc && make + + View documentation + # firefox doc/html/index.html + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..56b077d --- /dev/null +++ b/INSTALL @@ -0,0 +1,236 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PREFIX', the package will +use PREFIX as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..d5a76f9 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,267 @@ + +AM_MAKEFLAGS = --no-print-directory + +includedir = @includedir@/connman + +include_HEADERS = include/types.h include/log.h include/plugin.h \ + include/notifier.h include/service.h \ + include/resolver.h include/ipconfig.h \ + include/device.h include/network.h include/inet.h \ + include/storage.h + +nodist_include_HEADERS = include/version.h + +noinst_HEADERS = include/rtnl.h include/task.h \ + include/dbus.h include/option.h \ + include/provider.h \ + include/utsname.h include/timeserver.h include/proxy.h \ + include/technology.h include/setting.h + +local_headers = $(foreach file,$(include_HEADERS) $(nodist_include_HEADERS) \ + $(noinst_HEADERS), include/connman/$(notdir $(file))) + + +gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \ + gdbus/object.c gdbus/polkit.c + +gdhcp_sources = gdhcp/gdhcp.h gdhcp/common.h gdhcp/common.c gdhcp/client.c \ + gdhcp/server.c gdhcp/ipv4ll.h gdhcp/ipv4ll.c + +gweb_sources = gweb/gweb.h gweb/gweb.c gweb/gresolv.h gweb/gresolv.c \ + gweb/giognutls.h gweb/giognutls.c + +if DATAFILES + +if NMCOMPAT +nmcompat_conf = plugins/connman-nmcompat.conf +endif + +dbusconfdir = @DBUS_CONFDIR@ + +dbusconf_DATA = src/connman.conf $(nmcompat_conf) + +if SYSTEMD +systemdunitdir = @SYSTEMD_UNITDIR@ + +systemdunit_DATA = src/connman.service +endif +endif + +plugin_LTLIBRARIES = + +plugin_objects = + +builtin_modules = +builtin_sources = +builtin_libadd = +builtin_cflags = + +noinst_PROGRAMS = + +unit_objects = + +sbin_PROGRAMS = src/connmand + +src_connmand_SOURCES = $(gdbus_sources) $(gdhcp_sources) \ + gweb/gweb.h gweb/gweb.c \ + gweb/gresolv.h gweb/gresolv.c \ + gweb/giognutls.h gweb/gionotls.c \ + $(builtin_sources) src/connman.ver \ + src/main.c src/connman.h src/log.c \ + src/error.c src/plugin.c src/task.c \ + src/device.c src/network.c src/connection.c \ + src/manager.c src/service.c \ + src/clock.c src/timezone.c \ + src/agent.c src/notifier.c src/provider.c \ + src/resolver.c src/ipconfig.c src/detect.c src/inet.c \ + src/dhcp.c src/rtnl.c src/proxy.c \ + src/utsname.c src/timeserver.c src/rfkill.c \ + src/storage.c src/dbus.c src/config.c \ + src/technology.c src/counter.c src/ntp.c \ + src/session.c src/tethering.c src/wpad.c src/wispr.c \ + src/stats.c src/iptables.c src/dnsproxy.c src/6to4.c + +src_connmand_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \ + @CAPNG_LIBS@ @XTABLES_LIBS@ -lresolv -ldl + +src_connmand_LDFLAGS = -Wl,--export-dynamic \ + -Wl,--version-script=$(srcdir)/src/connman.ver + +BUILT_SOURCES = $(local_headers) src/builtin.h + +CLEANFILES = src/connman.conf $(BUILT_SOURCES) + +statedir = $(localstatedir)/run/connman + +plugindir = $(libdir)/connman/plugins + +scriptdir = $(libdir)/connman/scripts + +storagedir = $(localstatedir)/lib/connman + +configdir = ${sysconfdir}/connman + +if MAINTAINER_MODE +build_plugindir = $(abs_top_srcdir)/plugins/.libs +build_scriptdir = $(abs_top_srcdir)/scripts +else +build_plugindir = $(plugindir) +build_scriptdir = $(scriptdir) +endif + +AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ @XTABLES_CFLAGS@ \ + @GNUTLS_CFLAGS@ $(builtin_cflags) \ + -DCONNMAN_PLUGIN_BUILTIN \ + -DSTATEDIR=\""$(statedir)"\" \ + -DPLUGINDIR=\""$(build_plugindir)"\" \ + -DSCRIPTDIR=\""$(build_scriptdir)"\" \ + -DSTORAGEDIR=\""$(storagedir)\"" \ + -DCONFIGDIR=\""$(configdir)\"" + +INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus + +EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf \ + plugins/connman-nmcompat.conf + + +script_DATA = +script_PROGRAMS = +script_LTLIBRARIES = + +include Makefile.plugins + +if CLIENT +noinst_PROGRAMS += client/cm + +client_cm_SOURCES = client/main.c +client_cm_LDADD = @DBUS_LIBS@ +endif + +if TOOLS +noinst_PROGRAMS += tools/wispr tools/supplicant-test \ + tools/dhcp-test tools/dhcp-server-test \ + tools/addr-test tools/web-test tools/resolv-test \ + tools/dbus-test tools/polkit-test \ + tools/iptables-test tools/tap-test tools/wpad-test \ + tools/stats-tool tools/private-network-test \ + tools/alg-test unit/test-session + +tools_wispr_SOURCES = $(gweb_sources) tools/wispr.c +tools_wispr_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv + +tools_supplicant_test_SOURCES = $(gdbus_sources) tools/supplicant-test.c \ + tools/supplicant-dbus.h tools/supplicant-dbus.c \ + tools/supplicant.h tools/supplicant.c +tools_supplicant_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ + +tools_web_test_SOURCES = $(gweb_sources) tools/web-test.c +tools_web_test_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv + +tools_resolv_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/resolv-test.c +tools_resolv_test_LDADD = @GLIB_LIBS@ -lresolv + +tools_wpad_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/wpad-test.c +tools_wpad_test_LDADD = @GLIB_LIBS@ -lresolv + +tools_stats_tool_LDADD = @GLIB_LIBS@ + +tools_dhcp_test_SOURCES = $(gdhcp_sources) tools/dhcp-test.c +tools_dhcp_test_LDADD = @GLIB_LIBS@ + +tools_dhcp_server_test_SOURCES = $(gdhcp_sources) tools/dhcp-server-test.c +tools_dhcp_server_test_LDADD = @GLIB_LIBS@ + +tools_dbus_test_SOURCES = $(gdbus_sources) tools/dbus-test.c +tools_dbus_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ + +tools_polkit_test_LDADD = @DBUS_LIBS@ + +tools_iptables_test_LDADD = @GLIB_LIBS@ @XTABLES_LIBS@ + +tools_private_network_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ + +tools_alg_test_LDADD = @GLIB_LIBS@ + +unit_test_session_SOURCES = $(gdbus_sources) src/log.c src/dbus.c \ + unit/test-session.c unit/utils.c unit/manager-api.c \ + unit/session-api.c unit/test-connman.h +unit_test_session_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ -ldl +unit_objects += $(unit_test_session_OBJECTS) +endif + +test_scripts = test/get-state test/list-profiles test/list-services \ + test/connect-service test/monitor-services test/set-address \ + test/simple-agent test/show-introspection test/test-compat \ + test/test-manager test/test-connman test/monitor-connman \ + test/connect-vpn test/disconnect-vpn test/monitor-manager \ + test/test-counter test/set-ipv4-method test/set-ipv6-method \ + test/set-nameservers test/set-domains test/find-service \ + test/get-services test/get-proxy-autoconfig test/set-proxy \ + test/enable-tethering test/disable-tethering test/backtrace \ + test/test-session test/provision-service test/test-supplicant \ + test/test-new-supplicant test/service-move-before \ + test/set-global-timeservers test/get-global-timeservers \ + test/test-clock + +if TEST +testdir = $(pkglibdir)/test +test_SCRIPTS = $(test_scripts) +endif + +EXTRA_DIST += $(test_scripts) + +EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \ + doc/ipconfig-api.txt doc/plugin-api.txt \ + doc/manager-api.txt doc/agent-api.txt \ + doc/service-api.txt doc/technology-api.txt \ + doc/counter-api.txt doc/config-format.txt \ + doc/advanced-configuration.txt + + +pkgconfigdir = $(libdir)/pkgconfig + +pkgconfig_DATA = connman.pc + +DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \ + --disable-datafiles \ + --enable-loopback \ + --enable-ethernet \ + --enable-wifi \ + --enable-bluetooth \ + --enable-ofono \ + --enable-pacrunner \ + --enable-google \ + --enable-meego \ + --enable-client \ + --enable-hh2serial-gps \ + --enable-ntpd \ + --enable-openconnect \ + --enable-tools + +DISTCLEANFILES = $(pkgconfig_DATA) + +MAINTAINERCLEANFILES = Makefile.in \ + aclocal.m4 configure config.h.in config.sub config.guess \ + ltmain.sh depcomp compile missing install-sh mkinstalldirs + + +src/builtin.h: src/genbuiltin $(builtin_sources) + $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@ + +src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf +if POLKIT + $(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@ +else + $(AM_V_GEN)cp $(srcdir)/src/connman-dbus.conf $@ +endif + +include/connman/version.h: include/version.h + $(AM_V_at)$(MKDIR_P) include/connman + $(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@ + +include/connman/%.h: $(abs_top_srcdir)/include/%.h + $(AM_V_at)$(MKDIR_P) include/connman + $(AM_V_GEN)$(LN_S) $< $@ + +clean-local: + @$(RM) -rf include/connman diff --git a/Makefile.plugins b/Makefile.plugins new file mode 100644 index 0000000..58b0494 --- /dev/null +++ b/Makefile.plugins @@ -0,0 +1,330 @@ + +plugin_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \ + @DBUS_CFLAGS@ @GLIB_CFLAGS@ +plugin_ldflags = -no-undefined -module -avoid-version + +script_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \ + @DBUS_CFLAGS@ + +if LOOPBACK +if LOOPBACK_BUILTIN +builtin_modules += loopback +builtin_sources += plugins/loopback.c +else +plugin_LTLIBRARIES += plugins/loopback.la +plugin_objects += $(plugins_loopback_la_OBJECTS) +plugins_loopback_la_CFLAGS = $(plugin_cflags) +plugins_loopback_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if ETHERNET +if ETHERNET_BUILTIN +builtin_modules += ethernet +builtin_sources += plugins/ethernet.c +else +plugin_LTLIBRARIES += plugins/ethernet.la +plugin_objects += $(plugins_ethernet_la_OBJECTS) +plugins_ethernet_la_CFLAGS = $(plugin_cflags) +plugins_ethernet_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +gsupplicant_sources = gsupplicant/gsupplicant.h gsupplicant/dbus.h \ + gsupplicant/supplicant.c gsupplicant/dbus.c + +if WIFI +if WIFI_BUILTIN +builtin_modules += wifi +builtin_sources += plugins/wifi.c $(gsupplicant_sources) + +else +plugin_LTLIBRARIES += plugins/wifi.la +plugin_objects += $(plugins_wifi_la_OBJECTS) +plugins_wifi_la_SOURCES = plugins/wifi.c $(gsupplicant_sources) +plugins_wifi_la_CFLAGS = $(plugin_cflags) +plugins_wifi_la_LDFLAGS = $(plugin_ldflags) + +endif +endif + +if BLUETOOTH +if BLUETOOTH_BUILTIN +builtin_modules += bluetooth +builtin_sources += plugins/bluetooth.c +else +plugin_LTLIBRARIES += plugins/bluetooth.la +plugin_objects += $(plugins_bluetooth_la_OBJECTS) +plugins_bluetooth_la_CFLAGS = $(plugin_cflags) +plugins_bluetooth_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if HH2SERIAL_GPS +if HH2SERIAL_GPS_BUILTIN +builtin_modules += hh2serial_gps +builtin_sources += plugins/hh2serial-gps.c +else +plugin_LTLIBRARIES += plugins/hh2serial-gps.la +plugin_objects += $(plugins_hh2serial_gps_la_OBJECTS) +plugins_hh2serial_gps_la_CFLAGS = $(plugin_cflags) +plugins_hh2serial_gps_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if OFONO +if OFONO_BUILTIN +builtin_modules += ofono +builtin_sources += plugins/mcc.h plugins/ofono.c +else +plugin_LTLIBRARIES += plugins/ofono.la +plugin_objects += $(plugins_ofono_la_OBJECTS) +plugins_ofono_la_SOURCES = plugins/mcc.h plugins/ofono.c +plugins_ofono_la_CFLAGS = $(plugin_cflags) +plugins_ofono_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if OPENCONNECT +if OPENCONNECT_BUILTIN +builtin_modules += openconnect +builtin_sources += plugins/openconnect.c +builtin_vpn_sources = plugins/vpn.c plugins/vpn.h +builtin_cflags += -DOPENCONNECT=\"@OPENCONNECT@\" +else +plugin_LTLIBRARIES += plugins/openconnect.la +plugin_objects += $(plugins_openconnect_la_OBJECTS) +plugins_openconnect_la_SOURCES = plugins/vpn.h plugins/vpn.c \ + plugins/openconnect.c +plugins_openconnect_la_CFLAGS = $(plugin_cflags) -DOPENCONNECT=\"@OPENCONNECT@\" \ + -DSTATEDIR=\""$(statedir)"\" \ + -DSCRIPTDIR=\""$(build_scriptdir)"\" +plugins_openconnect_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if OPENVPN +if OPENVPN_BUILTIN +builtin_modules += openvpn +builtin_sources += plugins/openvpn.c +builtin_vpn_sources = plugins/vpn.c plugins/vpn.h +builtin_cflags += -DOPENVPN=\"@OPENVPN@\" +else +plugin_LTLIBRARIES += plugins/openvpn.la +plugin_objects += $(plugins_openvpn_la_OBJECTS) +plugins_openvpn_la_SOURCES = plugins/vpn.h plugins/vpn.c \ + plugins/openvpn.c +plugins_openvpn_la_CFLAGS = $(plugin_cflags) -DOPENVPN=\"@OPENVPN@\" \ + -DSTATEDIR=\""$(statedir)"\" \ + -DSCRIPTDIR=\""$(build_scriptdir)"\" +plugins_openvpn_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if VPNC +if VPNC_BUILTIN +builtin_modules += vpnc +builtin_sources += plugins/vpnc.c +builtin_vpn_sources = plugins/vpn.c plugins/vpn.h +builtin_cflags += -DVPNC=\"@VPNC@\" +else +plugin_LTLIBRARIES += plugins/vpnc.la +plugin_objects += $(plugins_vpnc_la_OBJECTS) +plugins_vpnc_la_SOURCES = plugins/vpn.h plugins/vpn.c \ + plugins/vpnc.c +plugins_vpnc_la_CFLAGS = $(plugin_cflags) -DVPNC=\"@VPNC@\" \ + -DSTATEDIR=\""$(statedir)"\" \ + -DSCRIPTDIR=\""$(build_scriptdir)"\" +plugins_vpnc_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if L2TP +if L2TP_BUILTIN +builtin_modules += l2tp +builtin_sources += plugins/l2tp.c +builtin_vpn_sources = plugins/vpn.c plugins/vpn.h +builtin_cflags += -DL2TP=\"@L2TP@\" +else +plugin_LTLIBRARIES += plugins/l2tp.la +plugin_objects += $(plugins_l2tp_la_OBJECTS) +plugins_l2tp_la_SOURCES = plugins/vpn.h plugins/vpn.c \ + plugins/l2tp.c +plugins_l2tp_la_CFLAGS = $(plugin_cflags) -DL2TP=\"@L2TP@\" \ + -DSTATEDIR=\""$(statedir)"\" \ + -DSCRIPTDIR=\""$(build_scriptdir)"\" +plugins_l2tp_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if PPTP +if PPTP_BUILTIN +builtin_modules += pptp +builtin_sources += plugins/pptp.c +builtin_vpn_sources = plugins/vpn.c plugins/vpn.h +builtin_cflags += -DPPPD=\"@PPPD@\" -DPPTP=\"@PPTP@\" +else +plugin_LTLIBRARIES += plugins/pptp.la +plugin_objects += $(plugins_pptp_la_OBJECTS) +plugins_pptp_la_SOURCES = plugins/vpn.h plugins/vpn.c \ + plugins/pptp.c +plugins_pptp_la_CFLAGS = $(plugin_cflags) -DPPPD=\"@PPPD@\" \ + -DPPTP=\"@PPTP@\" \ + -DSTATEDIR=\""$(statedir)"\" \ + -DSCRIPTDIR=\""$(build_scriptdir)"\" +plugins_pptp_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if PPTP +script_LTLIBRARIES += scripts/libppp-plugin.la +scripts_libppp_plugin_la_LDFLAGS = $(script_cflags) @DBUS_CFLAGS@ +scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@ +else +if L2TP +script_LTLIBRARIES += scripts/libppp-plugin.la +scripts_libppp_plugin_la_LDFLAGS = $(script_cflags) @DBUS_CFLAGS@ +scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@ +endif +endif + +builtin_sources += $(builtin_vpn_sources) + +if PACRUNNER +if PACRUNNER_BUILTIN +builtin_modules += pacrunner +builtin_sources += plugins/pacrunner.c +else +plugin_LTLIBRARIES += plugins/pacrunner.la +plugin_objects += $(plugins_pacrunner_la_OBJECTS) +plugins_pacrunner_la_CFLAGS = $(plugin_cflags) +plugins_pacrunner_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if GOOGLE +if GOOGLE_BUILTIN +builtin_modules += google +builtin_sources += plugins/google.c +else +plugin_LTLIBRARIES += plugins/google.la +plugin_objects += $(plugins_google_la_OBJECTS) +plugins_google_la_CFLAGS = $(plugin_cflags) +plugins_google_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if MEEGO +if MEEGO_BUILTIN +builtin_modules += meego +builtin_sources += plugins/meego.c +else +plugin_LTLIBRARIES += plugins/meego.la +plugin_objects += $(plugins_meego_la_OBJECTS) +plugins_meego_la_CFLAGS = $(plugin_cflags) +plugins_meego_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if POLKIT +if POLKIT_BUILTIN +builtin_modules += polkit +builtin_sources += plugins/polkit.c +else +plugin_LTLIBRARIES += plugins/polkit.la +plugin_objects += $(plugins_polkit_la_OBJECTS) +plugins_polkit_la_CFLAGS = $(plugin_cflags) +plugins_polkit_la_LDFLAGS = $(plugin_ldflags) +endif + +if DATAFILES +policydir = @POLKIT_DATADIR@ + +policy_DATA = plugins/net.connman.policy +endif +endif + +if IWMX +plugin_LTLIBRARIES += plugins/iwmxsdk.la +plugin_objects += $(plugins_iwmxsdk_la_OBJECTS) +plugins_iwmxsdk_la_SOURCES = plugins/iwmx.h plugins/iwmx.c plugins/iwmxsdk.c +plugins_iwmxsdk_la_CFLAGS = $(plugin_cflags) @IWMXSDK_CFLAGS@ +plugins_iwmxsdk_la_LIBADD = @IWMXSDK_LIBS@ @GLIB_LIBS@ +plugins_iwmxsdk_la_LDFLAGS = $(plugin_ldflags) +endif + +if IOSPM +plugin_LTLIBRARIES += plugins/iospm.la +plugin_objects += $(plugins_iospm_la_OBJECTS) +plugins_iospm_la_CFLAGS = $(plugin_cflags) +plugins_iospm_la_LDFLAGS = $(plugin_ldflags) +endif + +if FAKE +plugin_LTLIBRARIES += plugins/fake.la +plugin_objects += $(plugins_fake_la_OBJECTS) +plugins_fake_la_CFLAGS = $(plugin_cflags) +plugins_fake_la_LDFLAGS = $(plugin_ldflags) +endif + +if OPENCONNECT +script_PROGRAMS += scripts/openconnect-script + +scripts_openconnect_script_LDADD = @DBUS_LIBS@ +else +if VPNC +script_PROGRAMS += scripts/openconnect-script + +scripts_openconnect_script_LDADD = @DBUS_LIBS@ +endif +endif + +if OPENVPN +script_PROGRAMS += scripts/openvpn-script + +scripts_openvpn_script_LDADD = @DBUS_LIBS@ +endif + +if NTPD +if NTPD_BUILTIN +builtin_modules += ntpd +builtin_sources += plugins/ntpd.c +builtin_cflags += -DNTPD=\"@NTPD@\" +else +plugin_LTLIBRARIES += plugins/ntpd.la +plugin_objects += $(plugins_ntpd_la_OBJECTS) +plugins_ntpd_la_CFLAGS = $(plugin_cflags) -DNTPD=\"@NTPD@\" +plugins_ntpd_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if NMCOMPAT +if NMCOMPAT_BUILTIN +builtin_modules += nmcompat +builtin_sources += plugins/nmcompat.c +else +plugin_LTLIBRARIES += plugins/nmcompat.la +plugin_objects += $(plugins_nmcompat_la_OBJECTS) +plugins_nmcompat_la_CFLAGS = $(plugin_cflags) +plugins_nmcompat_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +if TIST +if TIST_BUILTIN +builtin_modules += tist +builtin_sources += plugins/tist.c +else +plugin_LTLIBRARIES += plugins/tist.la +plugin_objects += $(plugins_tist_la_OBJECTS) +plugins_tist_la_CFLAGS = $(plugin_cflags) +plugins_tist_la_LDFLAGS = $(plugin_ldflags) +endif +endif + +EXTRA_DIST += plugins/polkit.policy + +plugins/net.connman.policy: plugins/polkit.policy +if POLKIT + $(AM_V_GEN)cp $< $@ +endif diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..532e327 --- /dev/null +++ b/README @@ -0,0 +1,95 @@ +Connection Manager +****************** + +Copyright (C) 2007-2010 Intel Corporation. All rights reserved. + + +Functionality and features +========================== + +The following features are built-in into Connection Manager: + - Generic plugin infrastructure + - Device and network abstraction (with basic storage support) + - IPv4, routing and DNS configuration + - DNS Proxy + +Various plugins can be enabled for networking support: + - Ethernet plugin + - WiFi plugin with WEP40/WEP128 and WPA/WPA2 (personal only) support + - Bluetooth plugin + +Also plugins with additional features are available: + - Loopback setup + - PolicyKit support + + +Compilation and installation +============================ + +In order to compile Connection Manager you need following software packages: + - GCC compiler + - GLib library + - D-Bus library + - PolicyKit (optional) + +To configure run: + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var + +Configure automatically searches for all required components and packages. + +To compile and install run: + make && make install + + +VPN +=== + +In order to compile pptp and l2tp VPN plugins, you need ppp development +package. + +To run l2tp you will need + - xl2tpd, http://www.xelerance.com/services/software/xl2tpd + +To run pptp you will need + - pptp client, http://pptpclient.sourceforge.net + +Both l2tp and pptp also need pppd. + + +Configuration and options +========================= + +For a working system, certain configuration options need to be enabled: + + --enable-ethernet + + Enable support for Ethernet network cards + + --enable-wifi + + Enable support for WiFi devices (requires wpa_supplicant) + + + --enable-bluetooth + + Enable support for Bluetooth devices (requires BlueZ) + + --enable-loopback + + Enable setup of loopback device + + For distributions with a really minimal init system and no + networking scripts this can take care of setting up the + loopback device and enabling it. + + It is safe to select this option even if networking scripts + are in place. It detects an already configured loopback + device and leaves it as it is. + + --enable-polkit + + Enable support for PolicyKit authorization + + This allows to check every D-Bus access against a security + policy and so restrict access to certain functionality. + diff --git a/TODO b/TODO new file mode 100644 index 0000000..74bbcdc --- /dev/null +++ b/TODO @@ -0,0 +1,156 @@ +Background +========== + +- Priority scale: High, Medium and Low + +- Complexity scale: C1, C2, C4 and C8. + The complexity scale is exponential, with complexity 1 being the + lowest complexity. Complexity is a function of both task 'complexity' + and task 'scope'. + +Core +==== + +- Session API implementation + + Priority: High + Complexity: C4 + Owner: Daniel Wagner + Owner: Samuel Ortiz + + The session API should provide a connection abstraction in order to + prioritize applications network accesses, prevent or allow network + and bearer roaming, or provide applications with a way to request + for periodic network connections. On-demand connections will be + implemented through this API as well. + See http://www.mail-archive.com/connman@connman.net/msg01653.html + + +- DNS caching + + Priority: Low + Complexity: C4 + + A simple initial implementation would see ConnMan's dnsproxy + caching the DNS record based on their TTL. + + +- Power management + + Priority: Medium + Complexity: C4 + Owner: Samuel Ortiz + + Implement a simple device pm hook that ConnMan's core code would + use whenever it decides to put devices in power save mode. Although + the kernel runtime power management code should take care of that, + not all driver (especially WiFi ones) implement runtime PM hooks. + + +- IP ranges allocation and check + + Priority: High + Complexity: C2 + + For both tethering and private networks, but also to detect invalid + static IP configurations, we need to have a core IP range layer + that manages all currently used IP blocks. + + +- Personal firewall + + Priority: Low + Complexity: C8 + Owner: Tomasz Bursztyka + + Discuss and implement a basic and safe firewalling strategy into + Connman. Provide a D-Bus API for personal firewalling. + + +- PACRunner extensions + + Priority: Low + Complexity: C4 + + Support more URI schemes, support multiple connections, tighter + security integration. + + + +WiFi +==== + +- Ad-Hoc support + + Priority: Medium + Complexity: C2 + Owner: Samuel Ortiz + + +- Fast Connect + + Priority: Low + Complexity: C4 + Owner: Samuel Ortiz + + +- EAP-AKA/SIM + + Priority: Medium + Complexity: C2 + Owner: Samuel Ortiz + + This EAP is needed for SIM card based network authentication. + ConnMan here plays a minor role: Once wpa_supplicant is set up for + starting and EAP-AKA/SIM authentication, it will talk to a SIM card + through its pcsc-lite API. + + +- EAP-FAST + + Priority: Low + Complexity: C1 + + +- WiFi p2p + + Priority: Medium + Complexity: C2 + + + +Bluetooth +========= + +- DUN client + + Priority: Low + Complexity: C4 + Owner: Mario Tokarz + + + +Cellular +======== + + +VPN +=== + +- IPsec + + Priority: Low + Complexity: C4 + + +- Split tunnelling + + Priority: Low + Complexity: C8 + Dependencies: Core:Private networks + + The current VPN support puts the VPN interface at the top of the + service list, giving VPNs the default route. When doing split + tunneling, the system routes packet to the VPN interface for + private IPs, while going through the default interface for the rest + of the traffic. diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..0a59871 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,61 @@ +AC_DEFUN([AC_PROG_CC_PIE], [ + AC_CACHE_CHECK([whether ${CC-cc} accepts -fPIE], ac_cv_prog_cc_pie, [ + echo 'void f(){}' > conftest.c + if test -z "`${CC-cc} -fPIE -pie -c conftest.c 2>&1`"; then + ac_cv_prog_cc_pie=yes + else + ac_cv_prog_cc_pie=no + fi + rm -rf conftest* + ]) +]) + +AC_DEFUN([COMPILER_FLAGS], [ + if (test "${CFLAGS}" = ""); then + CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2" + fi + if (test "$USE_MAINTAINER_MODE" = "yes"); then + CFLAGS+=" -Werror -Wextra" + CFLAGS+=" -Wno-unused-parameter" + CFLAGS+=" -Wno-missing-field-initializers" + CFLAGS+=" -Wdeclaration-after-statement" + CFLAGS+=" -Wmissing-declarations" + CFLAGS+=" -Wredundant-decls" + CFLAGS+=" -Wcast-align" + CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED" + fi +]) + +AC_DEFUN([GTK_DOC_CHECK], +[ + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + dnl for overriding the documentation installation directory + AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) + HTML_DIR="$with_html_dir" + AC_SUBST([HTML_DIR]) + + dnl enable/disable documentation building + AC_ARG_ENABLE([gtk-doc], + AS_HELP_STRING([--enable-gtk-doc], + [use gtk-doc to build documentation [[default=no]]]),, + [enable_gtk_doc=no]) + + if test x$enable_gtk_doc = xyes; then + ifelse([$1],[], + [PKG_CHECK_EXISTS([gtk-doc],, + AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], + [PKG_CHECK_EXISTS([gtk-doc >= $1],, + AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build gtk-doc]))]) + fi + + AC_MSG_CHECKING([whether to build gtk-doc documentation]) + AC_MSG_RESULT($enable_gtk_doc) + + AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,) + + AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) +]) diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..0dd71d9 --- /dev/null +++ b/bootstrap @@ -0,0 +1,7 @@ +#!/bin/sh + +aclocal && \ + autoheader && \ + libtoolize --automake --copy --force && \ + automake --add-missing --copy && \ + autoconf diff --git a/bootstrap-configure b/bootstrap-configure new file mode 100755 index 0000000..12646a2 --- /dev/null +++ b/bootstrap-configure @@ -0,0 +1,33 @@ +#!/bin/sh + +if [ -f config.status ]; then + make maintainer-clean +fi + +if [ ! -f doc/gtk-doc.make ]; then + gtkdocize --copy --docdir doc +fi + +./bootstrap && \ + ./configure --enable-maintainer-mode \ + --enable-debug \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --disable-datafiles \ + --enable-loopback=builtin \ + --enable-ethernet=builtin \ + --enable-wifi=builtin \ + --enable-bluetooth=builtin \ + --enable-ofono=builtin \ + --enable-openconnect=builtin \ + --enable-openvpn=builtin \ + --enable-pacrunner=builtin \ + --enable-google=builtin \ + --enable-meego=builtin \ + --enable-nmcompat=builtin \ + --enable-polkit=builtin \ + --enable-capng \ + --enable-client \ + --enable-tools $* diff --git a/client/main.c b/client/main.c new file mode 100644 index 0000000..6719436 --- /dev/null +++ b/client/main.c @@ -0,0 +1,244 @@ +/* + * + * Connection Manager + * + * Copyright (C) 2007-2010 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include + +#define CONNMAN_SERVICE "net.connman" + +#define CONNMAN_MANAGER_INTERFACE CONNMAN_SERVICE ".Manager" +#define CONNMAN_MANAGER_PATH "/" + +struct service_data { + const char *path; + const char *name; + dbus_bool_t favorite; +}; + +static DBusMessage *get_services(DBusConnection *connection) +{ + DBusMessage *message, *reply; + DBusError error; + + message = dbus_message_new_method_call(CONNMAN_SERVICE, + CONNMAN_MANAGER_PATH, + CONNMAN_MANAGER_INTERFACE, + "GetServices"); + if (message == NULL) + return NULL; + + dbus_error_init(&error); + + reply = dbus_connection_send_with_reply_and_block(connection, + message, -1, &error); + if (reply == NULL) { + if (dbus_error_is_set(&error) == TRUE) { + fprintf(stderr, "%s\n", error.message); + dbus_error_free(&error); + } else + fprintf(stderr, "Failed to get properties\n"); + dbus_message_unref(message); + return NULL; + } + + dbus_message_unref(message); + + return reply; +} + +static DBusMessage *lookup_service(DBusConnection *connection, + const char *pattern) +{ + DBusMessage *message, *reply; + DBusError error; + + message = dbus_message_new_method_call(CONNMAN_SERVICE, + CONNMAN_MANAGER_PATH, + CONNMAN_MANAGER_INTERFACE, + "LookupService"); + if (message == NULL) + return NULL; + + dbus_message_append_args(message, DBUS_TYPE_STRING, &pattern, + DBUS_TYPE_INVALID); + + dbus_error_init(&error); + + reply = dbus_connection_send_with_reply_and_block(connection, + message, -1, &error); + if (reply == NULL) { + if (dbus_error_is_set(&error) == TRUE) { + fprintf(stderr, "%s\n", error.message); + dbus_error_free(&error); + } else + fprintf(stderr, "Failed to get properties\n"); + dbus_message_unref(message); + return NULL; + } + + dbus_message_unref(message); + + return reply; +} + +static void extract_properties(DBusMessageIter *dict, + struct service_data *service) +{ + while (dbus_message_iter_get_arg_type(dict) == DBUS_TYPE_DICT_ENTRY) { + DBusMessageIter entry, value; + const char *key; + + dbus_message_iter_recurse(dict, &entry); + dbus_message_iter_get_basic(&entry, &key); + + dbus_message_iter_next(&entry); + + dbus_message_iter_recurse(&entry, &value); + + //type = dbus_message_iter_get_arg_type(&value); + //dbus_message_iter_get_basic(&value, &val); + + if (strcmp(key, "Name") == 0) + dbus_message_iter_get_basic(&value, &service->name); + else if (strcmp(key, "Favorite") == 0) + dbus_message_iter_get_basic(&value, &service->favorite); + + dbus_message_iter_next(dict); + } +} + +static void extract_services(DBusMessage *message) +{ + DBusMessageIter iter, array; + + dbus_message_iter_init(message, &iter); + dbus_message_iter_recurse(&iter, &array); + + while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRUCT) { + DBusMessageIter entry, dict; + struct service_data service; + const char *path; + + dbus_message_iter_recurse(&array, &entry); + dbus_message_iter_get_basic(&entry, &path); + + service.path = strrchr(path, '/') + 1; + + dbus_message_iter_next(&entry); + + dbus_message_iter_recurse(&entry, &dict); + extract_properties(&dict, &service); + + printf("%c %-20s { %-50s }\n", + service.favorite == TRUE ? '*' : ' ', + service.name, service.path); + + dbus_message_iter_next(&array); + } +} + +static int cmd_list_services(DBusConnection *connection) +{ + DBusMessage *message; + + message = get_services(connection); + if (message == NULL) + return -1; + + extract_services(message); + + dbus_message_unref(message); + + return 0; +} + +static int cmd_show_service(DBusConnection *connection, const char *pattern) +{ + DBusMessage *message; + const char *path; + + message = lookup_service(connection, pattern); + if (message == NULL) + return -1; + + dbus_message_get_args(message, NULL, DBUS_TYPE_OBJECT_PATH, &path, + DBUS_TYPE_INVALID); + + printf("Service: %s\n", path); + + dbus_message_unref(message); + + return 0; +} + +static void usage(const char *program) +{ + printf("ConnMan utility ver %s\n\n", VERSION); + + printf("Usage:\n" + "\t%s [options]\n\n", program); + + printf("Commands:\n" + "\thelp\n" + "\tlist\n" + "\tshow \n" + "\n"); +} + +int main(int argc, char *argv[]) +{ + DBusConnection *conn; + + if (argc > 1 && strcmp(argv[1], "help") == 0) { + usage(argv[0]); + exit(0); + } + + conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); + if (!conn) { + fprintf(stderr, "Can't get on system bus\n"); + exit(1); + } + + if (argc > 1) { + if (strcmp(argv[1], "list") == 0) + cmd_list_services(conn); + else if (strcmp(argv[1], "show") == 0) { + if (argc > 2) + cmd_show_service(conn, argv[2]); + else + usage(argv[0]); + } + } else + usage(argv[0]); + + dbus_connection_unref(conn); + + return 0; +} diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..cc1924b --- /dev/null +++ b/configure.ac @@ -0,0 +1,470 @@ +AC_PREREQ(2.60) +AC_INIT(connman, 0.78.2) + +AM_INIT_AUTOMAKE([foreign subdir-objects color-tests]) +AM_CONFIG_HEADER(config.h) + +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +AM_MAINTAINER_MODE + +AC_PREFIX_DEFAULT(/usr/local) + +PKG_PROG_PKG_CONFIG + +COMPILER_FLAGS + +AC_SUBST(abs_top_srcdir) +AC_SUBST(abs_top_builddir) + +AC_LANG_C + +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_CC_PIE +AC_PROG_INSTALL +AM_PROG_MKDIR_P + +m4_define([_LT_AC_TAGCONFIG], []) +m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])]) + +AC_DISABLE_STATIC +AC_PROG_LIBTOOL + +AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization], + [disable code optimization through compiler]), [ + if (test "${enableval}" = "no"); then + CFLAGS="$CFLAGS -O0" + fi +]) + +GTK_DOC_CHECK + +AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], + [enable compiling with debugging information]), [ + if (test "${enableval}" = "yes" && + test "${ac_cv_prog_cc_g}" = "yes"); then + CFLAGS="$CFLAGS -g" + fi +]) + +AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie], + [enable position independent executables flag]), [ + if (test "${enableval}" = "yes" && + test "${ac_cv_prog_cc_pie}" = "yes"); then + CFLAGS="$CFLAGS -fPIE" + LDFLAGS="$LDFLAGS -pie" + fi +]) + +AC_ARG_ENABLE(threads, + AC_HELP_STRING([--enable-threads], [enable threading support]), + [enable_threads=${enableval}], [enable_threads="no"]) + +AC_ARG_ENABLE(ethernet, + AC_HELP_STRING([--enable-ethernet], [enable Ethernet support]), + [enable_ethernet=${enableval}], [enable_ethernet="no"]) +AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no") +AM_CONDITIONAL(ETHERNET_BUILTIN, test "${enable_ethernet}" = "builtin") + +AC_ARG_ENABLE(wifi, + AC_HELP_STRING([--enable-wifi], [enable WiFi support]), + [enable_wifi=${enableval}], [enable_wifi="no"]) +if (test "${enable_wifi}" != "no"); then + AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [], + $PATH:/sbin:/usr/sbin) +fi +AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no") +AM_CONDITIONAL(WIFI_BUILTIN, test "${enable_wifi}" = "builtin") + +AC_ARG_ENABLE(bluetooth, + AC_HELP_STRING([--enable-bluetooth], [enable Bluetooth support]), + [enable_bluetooth=${enableval}], [enable_bluetooth="no"]) +AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no") +AM_CONDITIONAL(BLUETOOTH_BUILTIN, test "${enable_bluetooth}" = "builtin") + +AC_ARG_ENABLE(hh2serial-gps, + AC_HELP_STRING([--enable-hh2serial-gps], [enable hh2serial GPS support]), + [enable_hh2serial_gps=${enableval}], [enable_hh2serial_gps="no"]) +AM_CONDITIONAL(HH2SERIAL_GPS, test "${enable_hh2serial_gps}" != "no") +AM_CONDITIONAL(HH2SERIAL_GPS_BUILTIN, test "${enable_hh2serial_gps}" = "builtin") + +AC_ARG_ENABLE(ofono, + AC_HELP_STRING([--enable-ofono], [enable oFono support]), + [enable_ofono=${enableval}], [enable_ofono="no"]) +AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no") +AM_CONDITIONAL(OFONO_BUILTIN, test "${enable_ofono}" = "builtin") + +AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM], + [specify location of openconnect binary]), [path_openconnect=${withval}]) + +AC_ARG_ENABLE(openconnect, + AC_HELP_STRING([--enable-openconnect], [enable openconnect support]), + [enable_openconnect=${enableval}], [enable_openconnect="no"]) +if (test "${enable_openconnect}" != "no"); then + if (test -z "${path_openconnect}"); then + AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/sbin:/usr/sbin) + if (test -z "${OPENCONNECT}"); then + AC_MSG_ERROR(openconnect binary not found) + fi + else + OPENCONNECT="${path_openconnect}" + AC_SUBST(OPENCONNECT) + fi +fi +AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no") +AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin") + +AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM], + [specify location of openvpn binary]), [path_openvpn=${withval}]) + +AC_ARG_ENABLE(openvpn, + AC_HELP_STRING([--enable-openvpn], [enable openvpn support]), + [enable_openvpn=${enableval}], [enable_openvpn="no"]) +if (test "${enable_openvpn}" != "no"); then + if (test -z "${path_openvpn}"); then + AC_PATH_PROG(OPENVPN, [openvpn], [], $PATH:/sbin:/usr/sbin) + if (test -z "${OPENVPN}"); then + AC_MSG_ERROR(openvpn binary not found) + fi + else + OPENVPN="${path_openvpn}" + AC_SUBST(OPENVPN) + fi +fi +AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no") +AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin") + +AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM], + [specify location of vpnc binary]), [path_vpnc=${withval}]) + +AC_ARG_ENABLE(vpnc, + AC_HELP_STRING([--enable-vpnc], [enable vpnc support]), + [enable_vpnc=${enableval}], [enable_vpnc="no"]) +if (test "${enable_vpnc}" != "no"); then + if (test -z "${path_vpnc}"); then + AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/sbin:/usr/sbin) + if (test -z "${VPNC}"); then + AC_MSG_ERROR(vpnc binary not found) + fi + else + VPNC="${path_vpnc}" + AC_SUBST(VPNC) + fi +fi +AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no") +AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin") + +AC_ARG_ENABLE(l2tp, + AC_HELP_STRING([--enable-l2tp], [enable l2tp support]), + [enable_l2tp=${enableval}], [enable_l2tp="no"]) +if (test "${enable_l2tp}" != "no"); then + if (test -z "${path_pppd}"); then + AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin) + else + PPPD="${path_pppd}" + AC_SUBST(PPPD) + fi + AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes, + AC_MSG_ERROR(ppp header files are required)) + if (test -z "${path_l2tp}"); then + AC_PATH_PROG(L2TP, [xl2tpd], [/usr/sbin/xl2tpd], $PATH:/sbin:/usr/sbin) + else + L2TP="${path_l2tp}" + AC_SUBST(L2TP) + fi +fi +AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no") +AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin") + +AC_ARG_ENABLE(pptp, + AC_HELP_STRING([--enable-pptp], [enable pptp support]), + [enable_pptp=${enableval}], [enable_pptp="no"]) +if (test "${enable_pptp}" != "no"); then + if (test -z "${path_pppd}"); then + AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin) + else + PPPD="${path_pppd}" + AC_SUBST(PPPD) + fi + AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes, + AC_MSG_ERROR(ppp header files are required)) + if (test -z "${path_pptp}"); then + AC_PATH_PROG(PPTP, [pptp], [/usr/sbin/pptp], $PATH:/sbin:/usr/sbin) + else + PPTP="${path_pptp}" + AC_SUBST(PPTP) + fi +fi +AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no") +AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin") + +AC_ARG_ENABLE(loopback, + AC_HELP_STRING([--enable-loopback], [enable loopback support]), + [enable_loopback=${enableval}], [enable_loopback="no"]) +if (test "${enable_loopback}" != "no"); then + AC_CHECK_HEADERS(sys/inotify.h, dummy=yes, + AC_MSG_ERROR(inotify header files are required)) + + AC_CHECK_LIB(c, inotify_init, dummy=yes, + AC_MSG_ERROR(inotify library support is required)) +fi +AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no") +AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin") + +AC_ARG_ENABLE(pacrunner, + AC_HELP_STRING([--enable-pacrunner], [enable PAC runner support]), + [enable_pacrunner=${enableval}], [enable_pacrunner="no"]) + +AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no") +AM_CONDITIONAL(PACRUNNER_BUILTIN, test "${enable_pacrunner}" = "builtin") + +AC_ARG_ENABLE(google, + AC_HELP_STRING([--enable-google], [enable Google Public DNS support]), + [enable_google=${enableval}], [enable_google="no"]) +AM_CONDITIONAL(GOOGLE, test "${enable_google}" != "no") +AM_CONDITIONAL(GOOGLE_BUILTIN, test "${enable_google}" = "builtin") + +AC_ARG_ENABLE(meego, + AC_HELP_STRING([--enable-meego], [enable MeeGo features support]), + [enable_meego=${enableval}], [enable_meego="no"]) +AM_CONDITIONAL(MEEGO, test "${enable_meego}" != "no") +AM_CONDITIONAL(MEEGO_BUILTIN, test "${enable_meego}" = "builtin") + +AC_CHECK_HEADERS(resolv.h, dummy=yes, + AC_MSG_ERROR(resolver header files are required)) +AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [ + AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes, + AC_MSG_ERROR(resolver library support is required)) +]) + +AC_CHECK_FUNC(signalfd, dummy=yes, + AC_MSG_ERROR(signalfd support is required)) + +AC_CHECK_LIB(dl, dlopen, dummy=yes, + AC_MSG_ERROR(dynamic linking loader is required)) + +AC_ARG_WITH(iwmxsdk, AC_HELP_STRING([--with-iwmxsdk=PATH], + [path to Intel WiMAX SDK]), + [pkgconfig_iwmxsdk=${withval}/lib/pkgconfig]) + +AC_ARG_ENABLE(iwmx, AC_HELP_STRING([--enable-iwmx], + [enable Intel WiMAX support]), [enable_iwmx=${enableval}]) +if (test "${enable_iwmx}" = "yes"); then + enable_threads="yes" + export PKG_CONFIG_PATH="${pkgconfig_iwmxsdk}" + PKG_CHECK_MODULES(IWMXSDK, libiWmxSdk-0, dummy=yes, + AC_MSG_ERROR(Intel WiMAX SDK is required)) + PKG_CONFIG_PATH="" + AC_SUBST(IWMXSDK_CFLAGS) + AC_SUBST(IWMXSDK_LIBS) + + # Fix API compat breakage from 1.4 to 1.5... + CPPFLAGS_save=$CPPFLAGS + CPPFLAGS="$IWMXSDK_CFLAGS $CPPFLAGS" + AH_TEMPLATE([HAVE_IWMXSDK_STATUS_IDLE], + [WIMAX_API_DEVICE_STATUS_Connection_Idle is present]) + AC_CHECK_DECL(WIMAX_API_DEVICE_STATUS_Connection_Idle, + [AC_DEFINE([HAVE_IWMXSDK_STATUS_IDLE], [1], [])], + [], + [[#include ]]) + + AH_TEMPLATE([HAVE_WIMAX_API_DEVICE_ID], + [WIMAX_API_DEVICE_ID is present]) + AC_CHECK_TYPE(WIMAX_API_DEVICE_ID, + [AC_DEFINE([HAVE_WIMAX_API_DEVICE_ID], [1], [])], + [], + [[#include ]]) + + AH_TEMPLATE([HAVE_WIMAX_API_HW_DEVICE_ID], + [WIMAX_API_HW_DEVICE_ID is present]) + AC_CHECK_TYPE(WIMAX_API_HW_DEVICE_ID, + [AC_DEFINE([HAVE_WIMAX_API_HW_DEVICE_ID], [1], [])], + [], + [[#include ]]) + + AH_TEMPLATE([HAVE_WIMAX_API_NSP_INFO_EX], + [WIMAX_API_NSP_INFO_EX is present]) + AC_CHECK_TYPE(WIMAX_API_NSP_INFO_EX, + [AC_DEFINE([HAVE_WIMAX_API_NSP_INFO_EX], [1], [])], + [], + [[#include ] + [#include ]]) + + AH_TEMPLATE([HAVE_WIMAX_API_CONNECTED_NSP_INFO], + [WIMAX_API_CONNECTED_NSP_INFO is present]) + AC_CHECK_TYPE(WIMAX_API_CONNECTED_NSP_INFO, + [AC_DEFINE([HAVE_WIMAX_API_CONNECTED_NSP_INFO], [1], [])], + [], + [[#include ]]) + + CPPFLAGS=$CPPFLAGS_save +fi +AM_CONDITIONAL(IWMX, test "${enable_iwmx}" = "yes") + +AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm], + [enable Intel OSPM support]), [enable_iospm=${enableval}]) +AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes") + +AC_ARG_WITH(ntpd, AC_HELP_STRING([--with-ntpd=PROGRAM], + [specify ntpd binary location]), [path_ntpd=${withval}]) + +AC_ARG_ENABLE(ntpd, + AC_HELP_STRING([--enable-ntpd], [enable ntpd support]), + [enable_ntpd=${enableval}], [enable_ntpd="no"]) + +if (test "${enable_ntpd}" != "no"); then + if (test -z "${path_ntpd}"); then + AC_PATH_PROG(NTPD, [ntpd], [], $PATH:/sbin:/usr/sbin) + else + NTPD="${path_ntpd}" + AC_SUBST(NTPD) + fi +fi +AM_CONDITIONAL(NTPD, test "${enable_ntpd}" != "no") +AM_CONDITIONAL(NTPD_BUILTIN, test "${enable_ntpd}" = "builtin") + +AC_ARG_ENABLE(nmcompat, + AC_HELP_STRING([--enable-nmcompat], [enable nmcompat support]), + [enable_nmcompat=${enableval}], [enable_nmcompat="no"]) +AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no") +AM_CONDITIONAL(NMCOMPAT_BUILTIN, test "${enable_nmcompat}" = "builtin") + +AC_ARG_ENABLE(tist, + AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]), + [enable_tist=${enableval}], [enable_tist="no"]) +AM_CONDITIONAL(TIST, test "${enable_tist}" != "no") +AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin") + +AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE], + [Maximal size of a statistics round robin file]), + [stats_max_file_size=${withval}]) + +if (test -z "${stats_max_file_size}"); then + # default size is 16 kByte + stats_max_file_size="16 * 8 * 128" +fi + +AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file]) + +PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.22, dummy=yes, + AC_MSG_ERROR(GLib >= 2.22 is required)) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(GLIB_LIBS) + +if (test "${enable_threads}" = "yes"); then + AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required]) + PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, + AC_MSG_ERROR(GThread >= 2.16 is required)) + GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" + GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" +fi + +PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes, + AC_MSG_ERROR(D-Bus >= 1.0 is required)) +saved_CFLAGS="$CFLAGS" +saved_LIBS="$LIBS" +CFLAGS="$CFLAGS $DBUS_CFLAGS" +LIBS="$LIBS $DBUS_LIBS" +AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes, + AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1, + [Define to 1 if you need the dbus_watch_get_unix_fd() function.])) +AC_CHECK_LIB(dbus-1, dbus_connection_can_send_type, dummy=yes, + AC_DEFINE(NEED_DBUS_CONNECTION_CAN_SEND_TYPE, 1, + [Define to 1 if you need the dbus_connection_can_send_type() function.] +)) +CFLAGS="$saved_CFLAGS" +LIBS="$saved_LIBS" +AC_SUBST(DBUS_CFLAGS) +AC_SUBST(DBUS_LIBS) + +AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH], + [path to D-Bus config directory]), [path_dbusconf=${withval}], + [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"]) +if (test -z "${path_dbusconf}"); then + DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d" +else + DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d" +fi +AC_SUBST(DBUS_CONFDIR) + +AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH], + [path to D-Bus data directory]), [path_dbusdata=${withval}], + [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"]) +if (test -z "${path_dbusdata}"); then + DBUS_DATADIR="${datadir}/dbus-1/system-services" +else + DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services" +fi +AC_SUBST(DBUS_DATADIR) + +AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR], + [path to systemd service directory]), [path_systemdunit=${withval}], + [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"]) +if (test -n "${path_systemdunit}"); then + SYSTEMD_UNITDIR="${path_systemdunit}" + AC_SUBST(SYSTEMD_UNITDIR) +fi +AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}") + +PKG_CHECK_MODULES(XTABLES, xtables, dummy=yes, + AC_MSG_ERROR(Xtables library is required)) +AC_SUBST(XTABLES_CFLAGS) +AC_SUBST(XTABLES_LIBS) + +AC_ARG_ENABLE(polkit, + AC_HELP_STRING([--enable-polkit], [enable PolicyKit support]), + [enable_polkit=${enableval}], [enable_polkit="no"]) +if (test "${enable_polkit}" != "no"); then + POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`" + POLKIT_DATADIR="" + if (test -z "${POLKIT_DATADIR}"); then + POLKIT_DATADIR="${datadir}/polkit-1/actions" + fi + AC_SUBST(POLKIT_DATADIR) +fi +AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no") +AM_CONDITIONAL(POLKIT_BUILTIN, test "${enable_polkit}" = "builtin") + +AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client], + [enable command line client]), [enable_client=${enableval}]) +AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes") + +AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools], + [enable testing tools]), [enable_tools=${enableval}]) +if (test "${enable_tools}" = "yes"); then + PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes, + AC_MSG_ERROR(GnuTLS library is required)) + AC_SUBST(GNUTLS_CFLAGS) + AC_SUBST(GNUTLS_LIBS) + + AC_CHECK_HEADERS(linux/if_alg.h, dummy=yes, + AC_MSG_ERROR(User-space algorithm header files are required)) +fi +AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes") + +AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test], + [enable test/example scripts]), [enable_test=${enableval}]) +AM_CONDITIONAL(TEST, test "${enable_test}" = "yes") + +AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake], + [enable fake device support]), [enable_fake=${enableval}]) +AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes") + +AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng], + [enable capabilities support]), [enable_capng=${enableval}]) +if (test "${enable_capng}" = "yes"); then + PKG_CHECK_MODULES(CAPNG, libcap-ng, dummy=yes, + AC_MSG_ERROR(Capabilities library is required)) + AC_SUBST(CAPNG_CFLAGS) + AC_SUBST(CAPNG_LIBS) + AC_DEFINE(HAVE_CAPNG, 1, [Define to 1 if you have capabilities library.]) +fi + +AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles], + [don't install configuration and data files]), + [enable_datafiles=${enableval}]) +AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no") + +AC_OUTPUT(Makefile include/version.h src/connman.service + scripts/connman doc/version.xml connman.pc) diff --git a/connman.pc.in b/connman.pc.in new file mode 100644 index 0000000..2af3c2b --- /dev/null +++ b/connman.pc.in @@ -0,0 +1,14 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +plugindir=${libdir}/connman/plugins +scriptdir=${libdir}/connman/scripts + +Name: connman +Description: Connection Manager +Requires: glib-2.0 dbus-1 +Version: @VERSION@ +Libs: -module -avoid-version -export-symbols-regex connman_plugin_desc +Cflags: -I${includedir} diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..ce3e433 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,38 @@ + +DOC_MODULE = connman + +DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml + +DOC_SOURCE_DIR = ../src + +SCAN_OPTIONS = --rebuild-sections --source-dir=../include + +MKDB_OPTIONS = --sgml-mode --output-format=xml --tmpl-dir=. \ + --ignore-files=connman \ + --source-dir=../include \ + --source-suffixes=c,h + +MKTMPL_OPTIONS = --output-dir=. + +HFILE_GLOB = $(top_srcdir)/include/*.h +CFILE_GLOB = $(top_srcdir)/src/*.c $(top_srcdir)/src/*.h + +IGNORE_HFILES = connman connman.h + +HTML_IMAGES = + +content_files = connman-introduction.xml + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/gdbus \ + $(GTHREAD_CFLAGS) $(GMODULE_CFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) + +GTKDOC_LIBS = $(DBUS_LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) $(GTHREAD_LIBS) + +MAINTAINERCLEANFILES = Makefile.in \ + $(DOC_MODULE).types $(DOC_MODULE)-*.txt *.sgml *.bak + +if ENABLE_GTK_DOC +include $(top_srcdir)/doc/gtk-doc.make +else +EXTRA_DIST = $(DOC_MAIN_SGML_FILE) connman-introduction.xml +endif diff --git a/doc/advanced-configuration.txt b/doc/advanced-configuration.txt new file mode 100644 index 0000000..3c08c8f --- /dev/null +++ b/doc/advanced-configuration.txt @@ -0,0 +1,61 @@ +Advanced configuration interface +******************************** + + +Configuration basics +==================== + +The default configuration method for all servers is automatic or something +like DHCP. In almost every case that should be just good enough, but if it +is not, Connection Manager supports manual configuration for Ethernet and +IP settings. + + +Configuration interface +======================= + +Every service contains two properties. One represents the current active +configuration and the other one allows manual configuration via the user. + +For IPv4 they are named "IPv4" and IPv4.Configuration". + +[ /profile/default/wifi_001122334455_42696720696e204a6170616e_managed_psk ] + Type = wifi + Name = Big in Japan + Mode = managed + Strength = 82 + Security = rsn + Favorite = true + State = ready + IPv4.Configuration = { Method=dhcp } + IPv4 = { Netmask=255.255.255.0 Method=dhcp Address=192.168.1.198 } + +The above WiFi network shows how the default configuration would look like +with a connected service. The configuration method is DHCP and the current +IP address is 192.168.1.198. + +The "IPv4" property is read-only and will emit PropertyChanged signals in +case the IP address of this interface changes. The "IPv4.Configuration" +property is read-write and allows changes. For example to use a static IP +configuration this call could be used: + + service.SetProperty("IPv4.Configuration", { "Method": "manual", + "Address": "192.168.1.100", + "Netmask": "255.255.255.0" }) + +The configuration itself is a dictionary with various fields. Not all of +them need to present. A lot of combinations are valid. + +For example the "Method" field has valid settings of "off", "fixed", "manual" +and "dhcp". The "fixed" value however can not be set by any user program. It +is an internal value that some 3G cards require. Switching to "off" will +remove and IP configuration from the interface. The "manual" method allows +for static address configuration. And "dhcp" will use DHCP to retrieve all +required information automatically. + +With a manual configuration, the fields "Address" and "Netmask" should be +given. In case "Netmask" is left out, the best netmask will be calculated. + +The "Gateway" field can be used to indicate the default route/gateway for +this interface. + diff --git a/doc/agent-api.txt b/doc/agent-api.txt new file mode 100644 index 0000000..14b2e50 --- /dev/null +++ b/doc/agent-api.txt @@ -0,0 +1,189 @@ +Agent hierarchy +=============== + +Service unique name +Interface net.connman.Agent +Object path freely definable + +Methods void Release() + + This method gets called when the service daemon + unregisters the agent. An agent can use it to do + cleanup tasks. There is no need to unregister the + agent, because when this method gets called it has + already been unregistered. + + void ReportError(object service, string error) + + This method gets called when an error has to be + reported to the user. + + A special return value can be used to trigger a + retry of the failed transaction. + + Possible Errors: net.connman.Agent.Error.Retry + + dict RequestInput(object service, dict fields) + + This method gets called when trying to connect to + a service and some extra input is required. For + example a passphrase or the name of a hidden network. + + The return value should be a dictionary where the + keys are the field names and the values are the + actual fields. Alternatively an error indicating that + the request got canceled can be returned. + + Most common return field names are "Name" and of + course "Passphrase". + + The dictionary arguments contains field names with + their input parameters. + + Possible Errors: net.connman.Agent.Error.Canceled + + void Cancel() + + This method gets called to indicate that the agent + request failed before a reply was returned. + +Fields string Name + + The name of a network. This field will be requested + when trying to connect to a hidden network. + + array{byte} SSID + + This field is an alternative to "Name" for WiFi + networks and can be used to return the exact binary + representation of a network name. + + Normally returning the "Name" field is the better + option here. + + string Identity + + Identity (username) for EAP authentication methods. + + string Passphrase + + The passphrase for authentication. For example a WEP + key, a PSK passphrase or a passphrase for EAP + authentication methods. + + string WPS + + This field requests the use of WPS to get associated. + This is an alternate choice against Passphrase when + requested service supports WPS. The reply can contain + either empty pin, if user wants to use push-button + method, or a pin code if user wants to use the pin + method. + + string Username + + Username for WISPr authentication. This field will be + requested when connecting to a WISPr-enabled hotspot. + + string Password + + Password for WISPr authentication. This field will be + requested when connecting to a WISPr-enabled hotspot. + +Arguments string Type + + Contains the type of a field. For example "psk", "wep" + "passphrase", "response", "ssid", "wpspin" or plain + "string". + + string Requirement + + Contains the requirement option. Valid values are + "mandatory", "optional" or "alternate". + + The "alternate" value specifies that this field can be + returned as an alternative to another one. An example + would be the network name or SSID. + + All "mandatory" fields must be returned, while the + "optional" can be returned if available. + + array{string} Alternates + + Contains the list of alternate field names this + field can be represented by. + +Examples Requesting a passphrase for WPA2 network + + RequestInput("/service1", + { "Passphrase" : { "Type" : "psk", + "Requirement" : "mandatory" + } + } + ==> { "Passphrase" : "secret123" } + + Requesting name for hidden network + + RequestInput("/service2", + { "Name" : { "Type" : "string", + "Requirement" : "mandatory", + "Alternates" : [ "SSID" ] + }, + "SSID" : { "Type" : "ssid", + "Requirement" : "alternate" + } + } + ==> { "Name" : "My hidden network" } + + Requesting a passphrase for a WPA2 network with WPS alternative: + + RequestInput("/service3", + { "Passphrase" : { "Type" : "psk", + "Requirement" : "mandatory", + "Alternates" : [ "WPS" ] + }, + "WPS" : { "Type" : "wpspin", + "Requirement" : "alternate" + } + } + + ==> { "WPS" : "123456" } + + Requesting passphrase for a WPA-Enterprise network: + + RequestInput("/service4", + { "Identity" : { "Type" : "string", + "Requirement" : "mandatory" + }, + "Passphrase" : { "Type" : "passphrase", + "Requirement" : "mandatory" + } + } + + ==> { "Identity" : "alice", "Passphrase": "secret123" } + + Requesting challenge response for a WPA-Enterprise network: + + RequestInput("/service4", + { "Identity" : { "Type" : "string", + "Requirement" : "mandatory" + }, + "Passphrase" : { "Type" : "response", + "Requirement" : "mandatory" + } + } + + ==> { "Identity" : "bob", "Passphrase": "secret123" } + + Requesting username and password for a WISPr-enabled hotspot: + + RequestInput("/service5", + { "Username" : { "Type" : "string", + "Requirement" : "mandatory" + }, + "Password" : { "Type" : "passphrase", + "Requirement" : "mandatory" + } + } + + ==> { "Username" : "foo", "Password": "secret" } diff --git a/doc/backtrace.txt b/doc/backtrace.txt new file mode 100644 index 0000000..ac8472c --- /dev/null +++ b/doc/backtrace.txt @@ -0,0 +1,28 @@ +ConnMan backtraces +****************** + +ConnMan dumps backtraces upon segmentation faults, bus errors and other +crashing signals. Regardless of the debug level you started connmand with, the +backtrace will be dumped to syslog. + +The ConnMan backtraces start with the following line: + -------- backtrace -------- +and will try to display function names if those can be resolved from the stack +addresses. All static functions name will not appear for example. + +For a more complete and useful stack frame output you can use the +test/backtrace script. It takes the actual binary that crashed and the +connmand logs. The logs can contain any connman debug strings on top of the +backtrace. + +Here is an example of the backtrace script usage: + +me@localhost:[~]$ backtrace /sbin/connmand connman.log +-------- backtrace -------- +[0]: __connman_debug_list_available() [log.c:117] +[1]: connman_driver_register() [element.c:515] +[2]: __connman_driver_rescan() [element.c:490] +[3]: disable_technology() [manager.c:391] +[4]: generic_message() [object.c:262] +----------------------------------- + diff --git a/doc/behavior-api.txt b/doc/behavior-api.txt new file mode 100644 index 0000000..5feea76 --- /dev/null +++ b/doc/behavior-api.txt @@ -0,0 +1,11 @@ +Interface behavior description +****************************** + + +Ethernet service +================ + +The Ethernet based service is a special case since it has no children, but +still can be manually connected and disconnected while also has an implicit +behavior when physically plugging in or removing an Ethernet cable. + diff --git a/doc/clock-api.txt b/doc/clock-api.txt new file mode 100644 index 0000000..4ec3160 --- /dev/null +++ b/doc/clock-api.txt @@ -0,0 +1,87 @@ +Clock hierarchy +=============== + +Service net.connman +Interface net.connman.Clock +Object path / + +Methods dict GetProperties() + + Returns all system clock properties. See the + properties section for available properties. + + Possible Errors: [service].Error.InvalidArguments + + void SetProperty(string name, variant value) + + Changes the value of the specified property. Only + properties that are listed as read-write are + changeable. On success a PropertyChanged signal + will be emitted. + + Possible Errors: [service].Error.InvalidArguments + [service].Error.InvalidProperty + +Signals PropertyChanged(string name, variant value) + + This signal indicates a changed value of the given + property. + + +Properties uint64 Time [readonly or readwrite] + + Current system time in seconds since epoch. + + This value is present for changing the system time + if TimeUpdates is set to manual. + + It is not present for driving an updated display + of the system time. PropertyChanged signal for this + value are only send out if it gets changed or jumps + unexpectedly. + + In general application interested in the current + time should be using gettimeofday() and related + system calls. + + string TimeUpdates [readwrite] + + Possible values are "manual" and "auto" to indicate + time update policy. + + With the "auto" setting the system tries to use as + many sources as possible to determine the correct + and updated time. + + string Timezone [readonly or readwrite] + + Current system timezone string. Allowed values + are from the standard timezone data (tzdata) + package under /usr/share/zoneinfo. For example + strings like "America/Vancouver" or "Europe/Berlin". + + This value is present for changing the timezone + if TimezoneUpdates is set to manual. + + When the timezone gets changed a PropertyChanged + signal will be send out. + + string TimezoneUpdates [readwrite] + + Possible values are "manual" and "auto" to indicate + timezone update policy. + + With the "auto" setting the system tries to use as + many sources as possible to determine the correct + timezone. + + array{string} Timeservers [readwrite] + + List of global default NTP servers. The list should + be sorted in order of preference. + + If a service configuration provides NTP servers, + then they are preferred over the global ones. + + This list of servers is used when TimeUpdates is set + to auto. diff --git a/doc/config-format.txt b/doc/config-format.txt new file mode 100644 index 0000000..cf89c09 --- /dev/null +++ b/doc/config-format.txt @@ -0,0 +1,92 @@ +Connman configuration file format +********************************* + +Connman uses configuration files to provision existing services. Connman will +be looking for its configuration files at STORAGEDIR which by default points +to /var/lib/connman/. Configuration file names must not include other +characters than letters or numbers and must have a .config suffix. +Those configuration files are text files with a simple format and we typically +have one file per provisioned network. + + +Global entry [global] +===================== + +These files can have an optional global entry describing the actual file. +The 2 allowed fields for that entry are: +- Name: Name of the network. +- Description: Description of the network. +- Protected: Configuration protection against being removed, modified or +overwritten by a Manager.ProvisionService() call. If unset, this value defaults +to TRUE, i.e. configs are protected by default. + + +Service entry [service_*] +========================= + +Each provisioned service must start with the [service_*] tag. Replace * with +your service identifier. +The service identifier can be anything and will be used internally by connman +to store the different services into an hash table. + +Allowed fields: +- Type: Service type. We currently only support wifi. +- SSID: An hexadecimal or a string representation of a 802.11 SSID. +- EAP: EAP type. We currently only support tls, ttls or peap. +- CACertFile: File path to CA certificate file (PEM/DER). +- ClientCertFile: File path to client certificate file (PEM/DER). +- PrivateKeyFile: File path to client private key file (PEM/DER/PFX). +- PrivateKeyPassphrase: Password/passphrase for private key file. +- PrivateKeyPassphraseType: We only support the fsid passphrase type for now. +This is for private keys generated by using their own filesystem UUID as the +passphrase. The PrivateKeyPassphrase field is ignored when this field is set +to fsid. +- Identity: Identity string for EAP. +- Phase2: Phase2 (inner authentication with TLS tunnel) authentication method. +Prefix the value with "EAP-" to indicate the usage of an EAP-based inner +authentication method (should only be used with EAP = TTLS). +- Passphrase: RSN/WPA/WPA2 Passphrase + + +Example +======= + +This is a configuration file for a network providing EAP-TLS, EAP-TTLS and +EAP-PEAP services. +The respective SSIDs are tls_ssid, ttls_ssid and peap_ssid and the file name +is example.config. +Please note that the SSID entry is for hexadecimal encoded SSID (e.g. "SSID = +746c735f73736964"). If your SSID does not contain any exotic character then +you should use the Name entry instead (e.g. "Name = tls_ssid"). + + +example@example:[~]$ cat /var/lib/connman/example.config +[global] +Name = Example +Description = Example network configuration + +[service_tls] +Type = wifi +SSID = 746c735f73736964 +EAP = tls +CACertFile = /home/user/.certs/ca.pem +ClientCertFile = /home/user/devlp/.certs/client.pem +PrivateKeyFile = /home/user/.certs/client.fsid.pem +PrivateKeyPassphraseType = fsid +Identity = user + +[service_ttls] +Type = wifi +Name = ttls_ssid +EAP = ttls +CACertFile = /home/user/.cert/ca.pem +Phase2 = MSCHAPV2 +Identity = user + +[service_peap] +Type = wifi +Name = peap_ssid +EAP = peap +CACertFile = /home/user/.cert/ca.pem +Phase2 = MSCHAPV2 +Identity = user diff --git a/doc/connman-docs.xml b/doc/connman-docs.xml new file mode 100644 index 0000000..d4059a4 --- /dev/null +++ b/doc/connman-docs.xml @@ -0,0 +1,121 @@ + + +]> + + + Connection Manager Reference Manual + Version &version; + + + Marcel + Holtmann + +
+ marcel@holtmann.org +
+
+
+
+ + + 2007-2008 + Intel Corporation. All rights reserved. + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free + Documentation License, Version 1.1 or any later + version published by the Free Software Foundation with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. You may obtain a copy of the GNU Free + Documentation License from the Free Software + Foundation by visiting their Web site or by writing + to: + +
+ The Free Software Foundation, Inc., + 59 Temple Place - Suite 330, + Boston, MA 02111-1307, + USA +
+
+
+
+ + + Design Overview + + + This part presents the design documentation for Connection Manager. + + + + + + + Manager interface + + + + + + + Device interface + + + + + + + Network interface + + + + + + + Service interface + + + + + + + Connection interface + + + + + + + Plugin API Reference + + + This part presents the function reference for Connection Manager. + + + + + + + + + + + + + License + + + + + + + Index + +
diff --git a/doc/connman-introduction.xml b/doc/connman-introduction.xml new file mode 100644 index 0000000..4672c2c --- /dev/null +++ b/doc/connman-introduction.xml @@ -0,0 +1,15 @@ + + + + + Introduction + + + About + + + + + + diff --git a/doc/counter-api.txt b/doc/counter-api.txt new file mode 100644 index 0000000..32411d5 --- /dev/null +++ b/doc/counter-api.txt @@ -0,0 +1,70 @@ +Counter hierarchy +================= + +Service unique name +Interface net.connman.Counter +Object path freely definable + +Methods void Release() + + This method gets called when the service daemon + unregisters the counter. A counter can use it to do + cleanup tasks. There is no need to unregister the + counter, because when this method gets called it has + already been unregistered. + + void Usage(object service, dict home, dict roaming) + + This signal indicates a change in the counter values + for the service object. The counter is reset by calling + the service ResetCounters method. + + When registering a new counter this method will be + called once with all details for "home" and "roaming" + counters filled in. Every further method call will + only include the changed values. + + When "home" counter is active, then "roaming" counter + will contain an empty dictionary and vise-versa. + + The dictionary argument contains the following entries: + + RX.Packets + + Total number of packets received. + + TX.Bytes + + Total number of packets sent. + + RX.Bytes + + Total number of bytes received. + + TX.Bytes + + Total number of bytes sent. + + RX.Errors + + Total number of erronous packets + received. + + TX.Errors + + Total number of erronous packets + sent. + + RX.Dropped + + Total number of dropped packets + while receiving. + + TX.Dropped + + Total number of dropped packets + while sending. + + Time + + Total number of seconds online. diff --git a/doc/gtk-doc.make b/doc/gtk-doc.make new file mode 100644 index 0000000..354ffb7 --- /dev/null +++ b/doc/gtk-doc.make @@ -0,0 +1,173 @@ +# -*- mode: makefile -*- + +#################################### +# Everything below here is generic # +#################################### + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +else +GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +EXTRA_DIST = \ + $(content_files) \ + $(HTML_IMAGES) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ + $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) + +if ENABLE_GTK_DOC +all-local: html-build.stamp +else +all-local: +endif + +docs: html-build.stamp + +#### scan #### + +scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) + @echo 'gtk-doc: Scanning header files' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && \ + gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) + if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ + else \ + cd $(srcdir) ; \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### templates #### + +tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt + @echo 'gtk-doc: Rebuilding template files' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + touch tmpl-build.stamp + +tmpl.stamp: tmpl-build.stamp + @true + +tmpl/*.sgml: + @true + + +#### xml #### + +sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) + @echo 'gtk-doc: Building XML' + @-chmod -R u+w $(srcdir) + cd $(srcdir) && \ + gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) + touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +#### html #### + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) + @echo 'gtk-doc: Building HTML' + @-chmod -R u+w $(srcdir) + rm -rf $(srcdir)/html + mkdir $(srcdir)/html + cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) + @echo 'gtk-doc: Fixing cross-references' + cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + touch html-build.stamp + +############## + +clean-local: + rm -f *~ *.bak + rm -rf .libs + +distclean-local: + cd $(srcdir) && \ + rm -rf xml $(REPORT_FILES) \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + +maintainer-clean-local: clean + cd $(srcdir) && rm -rf xml html + +install-data-local: + -installfiles=`echo $(srcdir)/html/*`; \ + if test "$$installfiles" = '$(srcdir)/html/*'; \ + then echo '-- Nothing to install' ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ + for i in $$installfiles; do \ + echo '-- Installing '$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ + done; \ + echo '-- Installing $(srcdir)/html/index.sgml' ; \ + $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ + which gtkdoc-rebase >/dev/null && \ + gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \ + fi + + +uninstall-local: + rm -f $(DESTDIR)$(TARGET_DIR)/* + +# +# Require gtk-doc when making dist +# +if ENABLE_GTK_DOC +dist-check-gtkdoc: +else +dist-check-gtkdoc: + @echo "*** gtk-doc must be installed and enabled in order to make dist" + @false +endif + +dist-hook: dist-check-gtkdoc dist-hook-local + mkdir $(distdir)/tmpl + mkdir $(distdir)/xml + mkdir $(distdir)/html + -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl + -cp $(srcdir)/xml/*.xml $(distdir)/xml + cp $(srcdir)/html/* $(distdir)/html + -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ + -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ + cd $(distdir) && rm -f $(DISTCLEANFILES) + -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs diff --git a/doc/ipconfig-api.txt b/doc/ipconfig-api.txt new file mode 100644 index 0000000..080fdac --- /dev/null +++ b/doc/ipconfig-api.txt @@ -0,0 +1,41 @@ +IP configuration handling +************************* + + +IP basics +========= + +The core IP handling is designed around network interfaces or more precisely +what the Linux kernel handles as struct net_device. Via RTNL every interface +is tracked and an IP device created for it. + + +--------+ +---- eth0 -----+ + | | | | + | RTNL +-----+---->| IP device | + | | | | | + +--------+ | +---------------+ + | + | +---- wlan0 ----+ + | | | + +---->| IP device | + | | + +---------------+ + +The IP device tracks link configuration, IP address setting and routing +information for that interface. Every IP device also contains a configuration +element. That element contains an operation table for callbacks based on +different events. + + struct connman_ipconfig_ops { + void (*up) (struct connman_ipconfig *); + void (*down) (struct connman_ipconfig *); + void (*lower_up) (struct connman_ipconfig *); + void (*lower_down) (struct connman_ipconfig *); + void (*ip_bound) (struct connman_ipconfig *); + void (*ip_release) (struct connman_ipconfig *); + }; + +All configuration objects created directly by RTNL are tightly bound to the +IP device. They will trigger DHCP or other configuration helpers. + + diff --git a/doc/manager-api.txt b/doc/manager-api.txt new file mode 100644 index 0000000..a6c852f --- /dev/null +++ b/doc/manager-api.txt @@ -0,0 +1,304 @@ +Manager hierarchy +================= + +Service net.connman +Interface net.connman.Manager +Object path / + +Methods dict GetProperties() + + Returns all global system properties. See the + properties section for available properties. + + Possible Errors: [service].Error.InvalidArguments + + void SetProperty(string name, variant value) + + Changes the value of the specified property. Only + properties that are listed as read-write are + changeable. On success a PropertyChanged signal + will be emitted. + + Possible Errors: [service].Error.InvalidArguments + [service].Error.InvalidProperty + + string GetState() + + Return global connection state of a system. The + same value is return via the State property. + + Possible Errors: [service].Error.InvalidArguments + + void RequestScan(string type) + + Request to trigger a scan for the specified + technology. The empty string "" triggers scanning + on all technologies. + + Possible Errors: [service].Error.InvalidArguments + + void EnableTechnology(string type) + + Enable specified type of technologies. + + Possible Errors: [service].Error.InvalidArguments + + void DisableTechnology(string type) + + Disable specified type of technologies. + + Possible Errors: [service].Error.InvalidArguments + + array{object,dict} GetServices() + + Returns a sorted list of tuples with service + object path and dictionary of service properties. + + This list will not contain sensitive information + like passphrases etc. + + Possible Errors: [service].Error.InvalidArguments + + object LookupService(string pattern) + + Lookup a service matching the specific pattern. + + Examples are interface names like "eth0", "wlan0" + etc. or service names like "hotspot" etc. + + In case of multiple services match the the pattern + an error is returned. + + Possible Errors: [service].Error.InvalidArguments + [service].Error.NotUnique + [service].Error.NotFound + + object ConnectService(dict network) + + Connect to a network specified by the given + properties. + + For connecting to a hidden WiFi network for example + it is required that Type = "wifi" and the SSID + properties are provided. + + When successful this method will return object + path of the service object. + + 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. + + When 'SessionMode' property is enabled, this method + call is disallowed. + + Possible Errors: [service].Error.InvalidArguments + + void ProvisionService(string configuration) + + Provide a configuration for services. + + Service configuration is provided as a single string + that follows the same format as configuration files, + see config-format.txt. An exception to this format + is that only one service can be provisioned per call. + + Possible Errors: [service].Error.InvalidArguments + + object ConnectProvider(dict provider) + + Connect to a VPN specified by the given provider + properties. + + When successful this method will return the object + path of the VPN service object. + + This method can also be used to connect to an + already existing VPN. + + 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. + + When 'SessionMode' property is enabled, this method + call is disallowed. + + Possible Errors: [service].Error.InvalidArguments + + void RegisterAgent(object path) + + Register new agent for handling user requests. + + Possible Errors: [service].Error.InvalidArguments + + void UnregisterAgent(object path) + + Unregister an existing agent. + + Possible Errors: [service].Error.InvalidArguments + + void RegisterCounter(object path, uint32 accuracy, uint32 period) + + Register a new counter for user notifications. + + 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. + + 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. + + 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 UnregisterCounter(object path) + + Unregister an existing counter. + + Possible Errors: [service].Error.InvalidArguments + + object CreateSession(dict settings, object notifier) + + 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. + + 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. + + Every application should at least create one session + to inform about its requirements and it purpose. + + void DestroySession(object session) + + Remove the previously created session. + + If an application exits unexpectatly the session + will be automatically destroyed. + + 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 ReleasePrivateNetwork(object path) [experimental] + + Releases a private network. + + Possible Errors: [service].Error.InvalidArguments + +Signals PropertyChanged(string name, variant value) + + This signal indicates a changed value of the given + property. + + StateChanged(string state) + + This signal is similar to the PropertyChanged signal + for the State property. + + It exists for application state only care about the + current state and so can avoid to be woken up when + other details changes. + +Properties string State [readonly] + + The global connection state of a system. Possible + values are "online" if at least one connection exists + and "offline" if no device is connected. + + In certain situations the state might change to + the value "connected". This can only be seen if + previously no connection was present. + + array{string} AvailableTechnologies [readonly] + + The list of available technologies. The strings + are the same as the ones from the service types. + + array{string} EnabledTechnologies [readonly] + + The list of enabled technologies. The strings + are the same as the ones from the service types. + + array{string} ConnectedTechnologies [readonly] + + The list of connected technologies. The strings + are the same as the ones from the service type. + + string DefaultTechnology [readonly] + + The current connected technology which holds the + default route. + + boolean OfflineMode [readwrite] + + The offline mode indicates the global setting for + switching all radios on or off. Changing offline mode + to true results in powering down all devices. When + leaving offline mode the individual policy of each + device decides to switch the radio back on or not. + + During offline mode, it is still possible to switch + certain technologies manually back on. For example + 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} 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. + + This list represents the available services for the + current selected profile. If the profile gets changed + then this list will be updated. + + 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. + + boolean SessionMode [readwrite] + + 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 default value is false. diff --git a/doc/overview-api.txt b/doc/overview-api.txt new file mode 100644 index 0000000..92ce2b9 --- /dev/null +++ b/doc/overview-api.txt @@ -0,0 +1,408 @@ +Application programming interface +********************************* + + +Service basics +============== + +Inside Connection Manager there exists one advanced interface to allow the +user interface an easy access to networking details and user chosen +preferences. This is the service list and interface. + +The basic idea is that Connection Manager maintains a single flat and sorted +list of all available, preferred or previously used services. A service here +can be either a Ethernet device, a WiFi network, a WiMAX service provider +or a remote Bluetooth device (for example a mobile phone). + +This list of service is sorted by Connection Manager and there is no need +for the user interface to implement its own sorting. User decisions will +need to be done via Connection Manager and it is then responsible to update +the order of services in this list. + + +---------------------------------------+ + | Ethernet | + +---------------------------------------+ + | Bluetooth phone | + +---------------------------------------+ + | Guest (strength 90, none) | + +---------------------------------------+ + | My WiFi AP (strength 80, rsn) | + +---------------------------------------+ + | Clear WiMAX (strength 70) | + +---------------------------------------+ + | Other AP (strength 70, rsn) | + +---------------------------------------+ + | Friends AP (strength 70, wep) | + +---------------------------------------+ + | Other WiMAX (strength 50) | + +---------------------------------------+ + +If none of the services has been used before the sorting order will be done +with these priorities: + + 1. Ethernet (lower index numbers first) + 2. Bluetooth (last used devices first) + 3. GSM/UTMS/3G (if SIM card is present, activated and not roaming) + 3. WiFi/WiMAX (signal strength first, then prefer WiMAX over WiFi, + then more secure network first) + +The Ethernet devices are always sorted first since they are physically built +into the system and will be always present. In cases they are switched off +manually they will not be showing in this list. + +Since every Bluetooth device has to be configured/paired first, the user +already made a choice here that these are important. Connection Manager will +only show devices with PAN or DUN profile support. While Bluetooth devices +do have a signal strength, it is mostly unknown since background scanning +in Bluetooth is too expensive. The choice here is to sort the last used +Bluetooth device before the others. + +The WiFi and WiMAX networks are treated equally since both provide signal +strength information and networks closer in the proximity should be shown +before others since it is more likely they are selected first. The signal +strength value is normalized to 0-100 (effectively a percentage) and allows +an easy sorting. + +If the signal strength is identical then the WiMAX network should be shown +first since it is a licensed spectrum and more reliable. Also the number +of WiMAX networks will be smaller than the number of WiFi since that operates +in an unlicensed spectrum. + +WiFi networks with the same signal strength are then sorted by their security +setting. WPA2 encrypted networks should be preferred over WPA/WEP and also +unencrypted ones. After that they will be sorted by the SSID in alphabetical +order. + +In the case the WiFi network uses WPS for setup and it is clearly detectable +that a network waits for Connection Manager to connect to it (for example via +a push-to-connect button press on the AP), then this network should be shown +first before any other WiFi or WiMAX network. The reason here is that the +user already made a choice via the access point. However this depends on +technical details if it is possible to detect these situations. + + +Service order +============= + +All unused services will have the internal order number of 0 and then will +be sorted according to the rules above. For Bluetooth the user already made +the decision to setup their device and by that means select it. However +until the first connection attempt it might have been setup for total +different reason (like audio usage) and thus it still counts as unused from +a networking point of view. + +Selecting the "My WiFi AP" and successfully connecting to it makes it a +favorite device and it will become an order number bigger than 0. All +order numbers are internally. They are given only to service that are marked +as favorite. For WiFi, WiMAX and Bluetooth a successful connection attempt +makes these services automatically a favorite. For Ethernet the plugging +of a cable makes it a favorite. Disconnecting from a network doesn't remove +the favorite setting. It is a manual operation and is equal to users pressing +delete/remove button. + + +---------------------------------------+ + | My WiFi AP (strength 80, rsn) | order=1 - favorite=yes + +---------------------------------------+ + | Ethernet | order=0 + +---------------------------------------+ + | Guest (strength 90, none) | order=0 + +---------------------------------------+ + | | + +Ethernet is special here since the unplugging of the network cable will +remove the favorite selection. + + +---------------------------------------+ + | Ethernet with cable | order=1 - favorite=yes + +---------------------------------------+ + | Ethernet without cable | order=0 - favorite=no + +---------------------------------------+ + | Guest (strength 90, none) | order=0 + +---------------------------------------+ + | | + +This means that all services with an order > 0 have favorite=yes and all +others have favorite=no setting. The favorite setting is exposed via a +property over the service interface. As mentioned above, the order number +is only used internally. + +Within Connection Manager many services can be connected at the same time and +also have an IP assignment. However only one can have the default route. The +service with the default route will always be sorted at the top of the +list. + + +---------------------------------------+ + | Ethernet | order=2 - connected=yes + +---------------------------------------+ + | My WiFi AP (strength 80, rsn) | order=1 - connected=yes + +---------------------------------------+ + | Guest (strength 90, none) | order=0 + +---------------------------------------+ + | | + +To change the default connection to your access point, the user needs to +manually drag the access point service to the top of the list. Connection +Manager will not take down default routes if there is no reason to do so. +A working connection is considered top priority. + + +---------------------------------------+ + | My WiFi AP (strength 80, rsn) | order=2 - connected=yes + +---------------------------------------+ + | Ethernet | order=1 - connected=yes + +---------------------------------------+ + | Guest (strength 90, none) | order=0 + +---------------------------------------+ + | | + +Another possible user interaction would be to unplug the Ethernet cable and +in this case the favorite setting will be removed and the service falls back +down in the list. + + +---------------------------------------+ + | My WiFi AP (strength 80, rsn) | order=1 - connected=yes + +---------------------------------------+ + | Ethernet | order=0 + +---------------------------------------+ + | Guest (strength 90, none) | order=0 + +---------------------------------------+ + | | + +If the service on the top of the list changes the default route will be +automatically adjusted as needed. The user can trigger this by disconnecting +from a network, if the network becomes unavailable (out of range) or if the +cable gets unplugged. + +As described above, the pure case of disconnecting from a network will not +remove the favorite setting. So previously selected networks are still present +and are sorted above all others. + + +---------------------------------------+ + | Ethernet | order=2 - connected=yes + +---------------------------------------+ + | My WiFi AP (strength 80, rsn) | order=1 - connected=no + +---------------------------------------+ + | Guest (strength 90, none) | order=0 + +---------------------------------------+ + | | + +Unplugging the Ethernet cable will remove the favorite setting, but due to +the basic ordering of services it will be at the top of the services with an +order number of 0 (directly after all favorite services). + + +---------------------------------------+ + | My WiFi AP (strength 80, rsn) | order=1 - connected=no + +---------------------------------------+ + | Ethernet | order=0 - connected=no + +---------------------------------------+ + | Guest (strength 90, none) | order=0 + +---------------------------------------+ + | | + + +Service tweaks +============== + +The interfaces of Connection Manager will always export all services that are +currently known. The Ethernet devices with no cable plugged are actually not +included in this list. They will only show up once a carrier is detected. + +The service interface is not meant for basic device configuration task. So +switching a device on and off (via RFKILL for example) should be done via +the device interface. + +Due to limited screen size of small devices and the big amount of WiFi +access points that are deployed right now it might be sensible to not show +certain WiFi networks in the user interface. + +The choice to hide a WiFi network from the user interface should be purely +done by the signal strength. The optimal cut-off value here still has to be +determined, but in the end that is a user interface policy. + + +Service naming +============== + +Every service will have a name property that allows the user interface to +display them directly. All names will be already converted into UTF-8. It +derives from the netork details. + +In case of WiFi this will be the SSID value. The SSID is a binary array and +will be converted into printable form. Unprintable characters are replaced +with spaces. + +For WiMAX networks the provider name like Clear or X-OHM will be used. This +name either comes directly from the network itself or from a provisioning +database of the WiMAX service. + +For Bluetooth the device alias is used. The alias is different since it +can be overwritten by the user via the Bluetooth service. The identification +is still done based on its address, but the display name might change. In +most cases the alias is equal to the Bluetooth remote friendly name. + +For Ethernet device no name will be provided. The type property will indicate +that this service is Ethernet and then it is up to the user interface to +provide a proper localized name for it. + + +Service states +============== + +Every service can have multiple states that indicate what is currently +going on with it. The choice to have multiple states instead of a simple +connected yes/no value comes from the fact that it is important to let the +user interface name if a service is in process of connecting/disconnecting. + +The basic state of every service is "idle". This means that this service +is not in use at all at the moment. It also is not attempting to connect +or do anything else. + +The "association" state indicates that this service tries to establish a +low-level connection to the network. For example associating/connecting +with a WiFi access point. + +With the "configuration" state the service indicates that it is trying +to retrieve/configure IP settings. + +The "ready" state signals a successful connected device. This doesn't mean +it has the default route, but basic IP operations will succeed. + +With the "disconnect" state a service indicates that it is going to terminate +the current connection and will return to the "idle" state. + +In addition a "failure" state indicates a wrong behavior. It is similar to +the "idle" state since the service is not connected. + + +---------------+ + | idle |<-------------------------------+ + +---------------+ | + | | + | +-------------+ | + +----------------------| failure | | + | service.Connect() +-------------+ | + V A | + +---------------+ | | + | association |-----------------+ | + +---------------+ error | | + | | | + | success | | + V | | + +---------------+ | | + | configuration |-----------------+ | + +---------------+ error | + | | + | success | + V | + +---------------+ | + | ready | | + +---------------+ | + | | + | success | + | | + V | + +---------------+ | + | online |<----------------+ | + +---------------+ | | + | | | + | service.Disconnect() | | + V | | + +---------------+ | | + | disconnect |-----------------+ | + +---------------+ error | + | | + +------------------------------------------+ + +The different states should no be used by the user interface to trigger +advanced actions. The state transitions are provided for the sole purpose +to give the user feedback on what is currently going on. Especially in +cases where networks are flaky or DHCP servers take a long time these +information are helpful for the user. + +Some services might require special authentication procedure like a web +based confirmation. The LoginRequired property should be used to check +for this. + + +Application basics +================== + +All applications should use D-Bus to communicate with Connection Manager. The +main entry point is the manager object. Currently the manager object is +located at "/", but this might change to allow full namespacing of the API +in the future. The manager interface is documented in manager-api.txt and +contains a set of global properties and methods. + +A simple way to retrieve all global properties looks like this: + + bus = dbus.SystemBus() + + manager = dbus.Interface(bus.get_object("net.connman", "/"), + "net.connman.Manager") + + properties = manager.GetProperties() + +Changing a global property is also pretty simple. For example enabling the +so called offline mode (aka flight mode) it is enough to just set that +property: + + manager.SetProperty("OfflineMode", dbus.Boolean(1)) + +The manager object contains references to profiles, devices, services and +connections. All these references represent other interfaces that allow +detailed control of Connection Manager. The profiles and devices interfaces +are more for advanced features and most applications don't need them at all. + +The services are represented as a list of object paths. Every of these object +paths contains a service interface. A service is a global collection for +Ethernet devices, WiFi networks, Bluetooth services, WiMAX providers etc. and +all these different types are treated equally. + +Every local Ethernet card will show up as exactly one service. WiFi networks +will be grouped by SSID, mode and security setting. Bluetooth PAN and DUN +service will show up per remote device. For WiMAX the provider name will +be used for grouping different base stations and access providers. This +creates a simple list that can be directly displayed to the users since these +are the exact details users should care about. + + properties = manager.GetProperties() + + for path in properties["Services"]: + service = dbus.Interface(bus.get_object("net.connman", path), + "net.connman.Service") + + service_properties = service.GetProperties() + +The service interface is documented in service-api.txt and contains common +properties valid for all services. It also contains method to connect or +disconnect a specific service. This allows users to select a specific service. +Connection Manager can also auto-connect services based on his policies or +via external events (like plugging in an Ethernet cable). + +Connecting (or disconnecting) a specific service manually is as simple as +just telling it to actually connect: + + service.Connect() or service.Disconnect() + +It is possible to connect multiple services if the underlying technology +allows it. For example it would be possible to connect to a WiFi network +and a Bluetooth service at the same time. Trying to connect to a second WiFi +network with the same WiFi hardware would result in an automatic disconnect +of the currently connected network. Connection Manager handles all of this +for the applications in the background. Trying to connect an Ethernet service +will result in an error if no cable is plugged in. All connection attempts +can fail for one reason or another. Application should be able to handle +such errors and will also be notified of changes via signals. + +In future versions Connection Manager will interact with an agent to confirm +certain transactions with the user. This functionality is currently not +implemented. + +To monitor the current status of a service the state property can be used. It +gives detailed information about the current progress. + + properties = service.GetProperties() + + print properties["State"] + +All state changes are also sent via the PropertyChanged signal on the +service interface. This allows asynchronous monitoring without having to poll +Connection Manager for changes. diff --git a/doc/plugin-api.txt b/doc/plugin-api.txt new file mode 100644 index 0000000..b39c043 --- /dev/null +++ b/doc/plugin-api.txt @@ -0,0 +1,24 @@ +Plugin programming interface +**************************** + + +Plugin basics +============= + +The Connection Manager supports plugins for various actions. The basic plugin +contains of plugin description via CONNMAN_PLUGIN_DEFINE and also init/exit +callbacks defined through that description. + +#include + +static int example_init(void) +{ + return 0; +} + +static void example_exit(void) +{ +} + +CONNMAN_PLUGIN_DEFINE(example, "Example plugin", CONNMAN_VERSION, + example_init, example_exit) diff --git a/doc/rfc1035.txt b/doc/rfc1035.txt new file mode 100644 index 0000000..b1a9bf5 --- /dev/null +++ b/doc/rfc1035.txt @@ -0,0 +1,3077 @@ +Network Working Group P. Mockapetris +Request for Comments: 1035 ISI + November 1987 +Obsoletes: RFCs 882, 883, 973 + + DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION + + +1. STATUS OF THIS MEMO + +This RFC describes the details of the domain system and protocol, and +assumes that the reader is familiar with the concepts discussed in a +companion RFC, "Domain Names - Concepts and Facilities" [RFC-1034]. + +The domain system is a mixture of functions and data types which are an +official protocol and functions and data types which are still +experimental. Since the domain system is intentionally extensible, new +data types and experimental behavior should always be expected in parts +of the system beyond the official protocol. The official protocol parts +include standard queries, responses and the Internet class RR data +formats (e.g., host addresses). Since the previous RFC set, several +definitions have changed, so some previous definitions are obsolete. + +Experimental or obsolete features are clearly marked in these RFCs, and +such information should be used with caution. + +The reader is especially cautioned not to depend on the values which +appear in examples to be current or complete, since their purpose is +primarily pedagogical. Distribution of this memo is unlimited. + + Table of Contents + + 1. STATUS OF THIS MEMO 1 + 2. INTRODUCTION 3 + 2.1. Overview 3 + 2.2. Common configurations 4 + 2.3. Conventions 7 + 2.3.1. Preferred name syntax 7 + 2.3.2. Data Transmission Order 8 + 2.3.3. Character Case 9 + 2.3.4. Size limits 10 + 3. DOMAIN NAME SPACE AND RR DEFINITIONS 10 + 3.1. Name space definitions 10 + 3.2. RR definitions 11 + 3.2.1. Format 11 + 3.2.2. TYPE values 12 + 3.2.3. QTYPE values 12 + 3.2.4. CLASS values 13 + + + +Mockapetris [Page 1] + +RFC 1035 Domain Implementation and Specification November 1987 + + + 3.2.5. QCLASS values 13 + 3.3. Standard RRs 13 + 3.3.1. CNAME RDATA format 14 + 3.3.2. HINFO RDATA format 14 + 3.3.3. MB RDATA format (EXPERIMENTAL) 14 + 3.3.4. MD RDATA format (Obsolete) 15 + 3.3.5. MF RDATA format (Obsolete) 15 + 3.3.6. MG RDATA format (EXPERIMENTAL) 16 + 3.3.7. MINFO RDATA format (EXPERIMENTAL) 16 + 3.3.8. MR RDATA format (EXPERIMENTAL) 17 + 3.3.9. MX RDATA format 17 + 3.3.10. NULL RDATA format (EXPERIMENTAL) 17 + 3.3.11. NS RDATA format 18 + 3.3.12. PTR RDATA format 18 + 3.3.13. SOA RDATA format 19 + 3.3.14. TXT RDATA format 20 + 3.4. ARPA Internet specific RRs 20 + 3.4.1. A RDATA format 20 + 3.4.2. WKS RDATA format 21 + 3.5. IN-ADDR.ARPA domain 22 + 3.6. Defining new types, classes, and special namespaces 24 + 4. MESSAGES 25 + 4.1. Format 25 + 4.1.1. Header section format 26 + 4.1.2. Question section format 28 + 4.1.3. Resource record format 29 + 4.1.4. Message compression 30 + 4.2. Transport 32 + 4.2.1. UDP usage 32 + 4.2.2. TCP usage 32 + 5. MASTER FILES 33 + 5.1. Format 33 + 5.2. Use of master files to define zones 35 + 5.3. Master file example 36 + 6. NAME SERVER IMPLEMENTATION 37 + 6.1. Architecture 37 + 6.1.1. Control 37 + 6.1.2. Database 37 + 6.1.3. Time 39 + 6.2. Standard query processing 39 + 6.3. Zone refresh and reload processing 39 + 6.4. Inverse queries (Optional) 40 + 6.4.1. The contents of inverse queries and responses 40 + 6.4.2. Inverse query and response example 41 + 6.4.3. Inverse query processing 42 + + + + + + +Mockapetris [Page 2] + +RFC 1035 Domain Implementation and Specification November 1987 + + + 6.5. Completion queries and responses 42 + 7. RESOLVER IMPLEMENTATION 43 + 7.1. Transforming a user request into a query 43 + 7.2. Sending the queries 44 + 7.3. Processing responses 46 + 7.4. Using the cache 47 + 8. MAIL SUPPORT 47 + 8.1. Mail exchange binding 48 + 8.2. Mailbox binding (Experimental) 48 + 9. REFERENCES and BIBLIOGRAPHY 50 + Index 54 + +2. INTRODUCTION + +2.1. Overview + +The goal of domain names is to provide a mechanism for naming resources +in such a way that the names are usable in different hosts, networks, +protocol families, internets, and administrative organizations. + +From the user's point of view, domain names are useful as arguments to a +local agent, called a resolver, which retrieves information associated +with the domain name. Thus a user might ask for the host address or +mail information associated with a particular domain name. To enable +the user to request a particular type of information, an appropriate +query type is passed to the resolver with the domain name. To the user, +the domain tree is a single information space; the resolver is +responsible for hiding the distribution of data among name servers from +the user. + +From the resolver's point of view, the database that makes up the domain +space is distributed among various name servers. Different parts of the +domain space are stored in different name servers, although a particular +data item will be stored redundantly in two or more name servers. The +resolver starts with knowledge of at least one name server. When the +resolver processes a user query it asks a known name server for the +information; in return, the resolver either receives the desired +information or a referral to another name server. Using these +referrals, resolvers learn the identities and contents of other name +servers. Resolvers are responsible for dealing with the distribution of +the domain space and dealing with the effects of name server failure by +consulting redundant databases in other servers. + +Name servers manage two kinds of data. The first kind of data held in +sets called zones; each zone is the complete database for a particular +"pruned" subtree of the domain space. This data is called +authoritative. A name server periodically checks to make sure that its +zones are up to date, and if not, obtains a new copy of updated zones + + + +Mockapetris [Page 3] + +RFC 1035 Domain Implementation and Specification November 1987 + + +from master files stored locally or in another name server. The second +kind of data is cached data which was acquired by a local resolver. +This data may be incomplete, but improves the performance of the +retrieval process when non-local data is repeatedly accessed. Cached +data is eventually discarded by a timeout mechanism. + +This functional structure isolates the problems of user interface, +failure recovery, and distribution in the resolvers and isolates the +database update and refresh problems in the name servers. + +2.2. Common configurations + +A host can participate in the domain name system in a number of ways, +depending on whether the host runs programs that retrieve information +from the domain system, name servers that answer queries from other +hosts, or various combinations of both functions. The simplest, and +perhaps most typical, configuration is shown below: + + Local Host | Foreign + | + +---------+ +----------+ | +--------+ + | | user queries | |queries | | | + | User |-------------->| |---------|->|Foreign | + | Program | | Resolver | | | Name | + | |<--------------| |<--------|--| Server | + | | user responses| |responses| | | + +---------+ +----------+ | +--------+ + | A | + cache additions | | references | + V | | + +----------+ | + | cache | | + +----------+ | + +User programs interact with the domain name space through resolvers; the +format of user queries and user responses is specific to the host and +its operating system. User queries will typically be operating system +calls, and the resolver and its cache will be part of the host operating +system. Less capable hosts may choose to implement the resolver as a +subroutine to be linked in with every program that needs its services. +Resolvers answer user queries with information they acquire via queries +to foreign name servers and the local cache. + +Note that the resolver may have to make several queries to several +different foreign name servers to answer a particular user query, and +hence the resolution of a user query may involve several network +accesses and an arbitrary amount of time. The queries to foreign name +servers and the corresponding responses have a standard format described + + + +Mockapetris [Page 4] + +RFC 1035 Domain Implementation and Specification November 1987 + + +in this memo, and may be datagrams. + +Depending on its capabilities, a name server could be a stand alone +program on a dedicated machine or a process or processes on a large +timeshared host. A simple configuration might be: + + Local Host | Foreign + | + +---------+ | + / /| | + +---------+ | +----------+ | +--------+ + | | | | |responses| | | + | | | | Name |---------|->|Foreign | + | Master |-------------->| Server | | |Resolver| + | files | | | |<--------|--| | + | |/ | | queries | +--------+ + +---------+ +----------+ | + +Here a primary name server acquires information about one or more zones +by reading master files from its local file system, and answers queries +about those zones that arrive from foreign resolvers. + +The DNS requires that all zones be redundantly supported by more than +one name server. Designated secondary servers can acquire zones and +check for updates from the primary server using the zone transfer +protocol of the DNS. This configuration is shown below: + + Local Host | Foreign + | + +---------+ | + / /| | + +---------+ | +----------+ | +--------+ + | | | | |responses| | | + | | | | Name |---------|->|Foreign | + | Master |-------------->| Server | | |Resolver| + | files | | | |<--------|--| | + | |/ | | queries | +--------+ + +---------+ +----------+ | + A |maintenance | +--------+ + | +------------|->| | + | queries | |Foreign | + | | | Name | + +------------------|--| Server | + maintenance responses | +--------+ + +In this configuration, the name server periodically establishes a +virtual circuit to a foreign name server to acquire a copy of a zone or +to check that an existing copy has not changed. The messages sent for + + + +Mockapetris [Page 5] + +RFC 1035 Domain Implementation and Specification November 1987 + + +these maintenance activities follow the same form as queries and +responses, but the message sequences are somewhat different. + +The information flow in a host that supports all aspects of the domain +name system is shown below: + + Local Host | Foreign + | + +---------+ +----------+ | +--------+ + | | user queries | |queries | | | + | User |-------------->| |---------|->|Foreign | + | Program | | Resolver | | | Name | + | |<--------------| |<--------|--| Server | + | | user responses| |responses| | | + +---------+ +----------+ | +--------+ + | A | + cache additions | | references | + V | | + +----------+ | + | Shared | | + | database | | + +----------+ | + A | | + +---------+ refreshes | | references | + / /| | V | + +---------+ | +----------+ | +--------+ + | | | | |responses| | | + | | | | Name |---------|->|Foreign | + | Master |-------------->| Server | | |Resolver| + | files | | | |<--------|--| | + | |/ | | queries | +--------+ + +---------+ +----------+ | + A |maintenance | +--------+ + | +------------|->| | + | queries | |Foreign | + | | | Name | + +------------------|--| Server | + maintenance responses | +--------+ + +The shared database holds domain space data for the local name server +and resolver. The contents of the shared database will typically be a +mixture of authoritative data maintained by the periodic refresh +operations of the name server and cached data from previous resolver +requests. The structure of the domain data and the necessity for +synchronization between name servers and resolvers imply the general +characteristics of this database, but the actual format is up to the +local implementor. + + + + +Mockapetris [Page 6] + +RFC 1035 Domain Implementation and Specification November 1987 + + +Information flow can also be tailored so that a group of hosts act +together to optimize activities. Sometimes this is done to offload less +capable hosts so that they do not have to implement a full resolver. +This can be appropriate for PCs or hosts which want to minimize the +amount of new network code which is required. This scheme can also +allow a group of hosts can share a small number of caches rather than +maintaining a large number of separate caches, on the premise that the +centralized caches will have a higher hit ratio. In either case, +resolvers are replaced with stub resolvers which act as front ends to +resolvers located in a recursive server in one or more name servers +known to perform that service: + + Local Hosts | Foreign + | + +---------+ | + | | responses | + | Stub |<--------------------+ | + | Resolver| | | + | |----------------+ | | + +---------+ recursive | | | + queries | | | + V | | + +---------+ recursive +----------+ | +--------+ + | | queries | |queries | | | + | Stub |-------------->| Recursive|---------|->|Foreign | + | Resolver| | Server | | | Name | + | |<--------------| |<--------|--| Server | + +---------+ responses | |responses| | | + +----------+ | +--------+ + | Central | | + | cache | | + +----------+ | + +In any case, note that domain components are always replicated for +reliability whenever possible. + +2.3. Conventions + +The domain system has several conventions dealing with low-level, but +fundamental, issues. While the implementor is free to violate these +conventions WITHIN HIS OWN SYSTEM, he must observe these conventions in +ALL behavior observed from other hosts. + +2.3.1. Preferred name syntax + +The DNS specifications attempt to be as general as possible in the rules +for constructing domain names. The idea is that the name of any +existing object can be expressed as a domain name with minimal changes. + + + +Mockapetris [Page 7] + +RFC 1035 Domain Implementation and Specification November 1987 + + +However, when assigning a domain name for an object, the prudent user +will select a name which satisfies both the rules of the domain system +and any existing rules for the object, whether these rules are published +or implied by existing programs. + +For example, when naming a mail domain, the user should satisfy both the +rules of this memo and those in RFC-822. When creating a new host name, +the old rules for HOSTS.TXT should be followed. This avoids problems +when old software is converted to use domain names. + +The following syntax will result in fewer problems with many + +applications that use domain names (e.g., mail, TELNET). + + ::= | " " + + ::=