This includes the man page detailing how to use the new CLI, and updates
AUTHORS and TODO. The .gitignore is changed to support the new CLI name, and a
few connman functions are added to dbus.h to open dbus message containers with
different signatures.
---
 .gitignore     |    2 +-
 AUTHORS        |    2 +
 TODO           |    3 +-
 client/cmn.1   |  194 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/dbus.h |   19 ++++++
 5 files changed, 218 insertions(+), 2 deletions(-)
 create mode 100644 client/cmn.1

diff --git a/.gitignore b/.gitignore
index 1b6f74a..84a1fe6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,7 +36,7 @@ plugins/connman.policy
 scripts/connman
 scripts/openconnect-script
 scripts/openvpn-script
-client/cm
+client/cmn
 tools/wispr
 tools/dhcp-test
 tools/dhcp-server-test
diff --git a/AUTHORS b/AUTHORS
index dd8bc8e..390d58d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -47,3 +47,5 @@ Elena Tebesoi <[email protected]>
 Mikel Astiz <[email protected]>
 Paulo Pizarro <[email protected]>
 Ross Burton <[email protected]>
+Tudor Marcu <[email protected]>
+Ceara Chewning <[email protected]>
diff --git a/TODO b/TODO
index 28de1d2..b1d8e58 100644
--- a/TODO
+++ b/TODO
@@ -130,7 +130,8 @@ Tools
 
    Priority: Low
    Complexity: C4
-   Owner: Patrik Flykt <[email protected]>
+   Owner: Tudor Marcu <[email protected]>
+         Ceara Chewning <[email protected]>
 
    For platforms not running python, it could prove useful to provide them
    with a native single binary command line tool.
diff --git a/client/cmn.1 b/client/cmn.1
new file mode 100644
index 0000000..c9797bf
--- /dev/null
+++ b/client/cmn.1
@@ -0,0 +1,194 @@
+.TH cmn 1 07/31/2012 "" "User Commands for Connamn CLI"
+.SH
+NAME
+cmn \- Connman CLI
+.SH
+SYNOPSIS
+.BR cmn " ["
+.BR enable " <technology> | \-\-offlinemode] ["
+.BR disable " <technology> | \-\-offlinemode] ["
+.BR tech "] ["
+.BR state "] ["
+.BR services " [\-\-properties <service>]] ["
+.BR scan "] ["
+.BR connect " <service>] ["
+.BR config " <service> \-\-<option> ARGS...] ["
+.BR help " | \-\-help]"
+.PP
+.SH
+DESCRIPTION
+Cmn is a Connman command line interface which can be run in two modes:
+a plain synchronous command input, and an interactive shell.
+To run a specific command the user may enter cmn <command> [options]
+[args], or enter cmn interactive; in this case, the program will
+drop into the interactive shell.
+.PP
+Cmn can handle most simple network connections. It is able to enable/
+disable any technology that exists on the system, display a list of
+services available, connect to/disconnect from any unsecured networks,
+show properties of the system, the technologies, and any individual
+service, and configure many of the properties. It is also able to monitor
+changes in the properties of the services, technologies, and the system.
+.PP
+In the interactive shell, most of the same commands can be used. It
+provides quicker but more limited usage.
+.SH
+COMMANDS AND OPTIONS
+.TP
+.B interactive
+Drops into the interactive shell. Most of the commands are the
+same; there will be a help menu displayed automatically with the
+available commands.
+.PP
+.TP
+.BR "help | \-\-help | " "(no arguments)"
+Shows the abbreviated help menu in the terminal.
+.PP
+.TP
+.BR enable " <technology>"
+Enables the given technology type (e.g. ethernet, wifi, 3g, etc.)
+Turns power on to the technology, but doesn't connect unless
+there is a service with autoconnect set to True.
+.PP
+.TP
+.BR disable " <technology>"
+Disables the given technology type. Turns power off to the
+technology and disconnects if it is already connected.
+.PP
+.TP
+.B enable \-\-offlinemode
+Enables offline mode. Disconnects and powers down all
+technologies system-wide, however each technology can be powered
+back on individually.
+.PP
+.TP
+.B disable \-\-offlinemode
+Disables offline mode. Technologies are powered back on according
+to their individual policies.
+.PP
+.TP
+.B tech
+Shows a list of all technology types existing on the system and
+their properties. See the properties section of the Technology
+API for explanations of each property.
+.PP
+.TP
+.B state
+Shows the system properties. Includes ths online state of the
+system, offline mode, and session mode.
+.PP
+.TP
+.B services
+Shows a list of all available service names. This includes the
+names of wifi networks, the wired ethernet connection, names of
+bluetooth devices, etc. These are the names used when a
+<service> command is called for. The service name
+(e.g. Joes-wifi), the service path (e.g.
+wifi_6834534139723_managed_none), or the full service path (e.g.
+/net/connman/Service/wifi_5467631...) are all accepted as valid
+input. An asterisk in front of the service indicates that the
+service is favorited, and a "C" indicates a service that is
+already connected.
+.PP
+.TP
+.B scan
+Scans for new services.
+.PP
+.TP
+.BR "services \-\-properties" " <service>"
+Shows a list of all properties for that service. See the
+properties section of the Service API for explanations of each
+property.
+.PP
+.TP
+.BR connect " <service>"
+Connects to the given service if it is unsecured.
+.PP
+.TP
+.BR disconnect " <service>"
+Disconnects from the given service.
+.PP
+.TP
+.BR config " <service> " \-\-<option>
+Configures a writable property of the given service to the
+value(s) entered after --<option>.
+.PP
+.TP
+.BR monitor " [\-\-<option>]"
+Listens for and displays DBus signals sent by Connman. The option indicates
+which signals you want to subscribe to. If no option is entered, it displays
+signals from all interfaces.
+.PP
+.SS
+Config Options:
+.PP
+.TP
+.B \-\-autoconnect=y/n
+Sets the autoconnect property of the service.
+.PP
+.TP
+.B \-\-ipv4
+Configures the IPv4 settings for the service. Enter the settings
+in the order "Method", "Address", "Netmask", then "Gateway"
+after the argument. See the properties section of the Service
+API for more information on these settings and the values
+accepted for them. It also displays a list of changes to both the
+IPv4 settings, and incidental changes to other values related to
+it.
+.PP
+.TP
+.B \-\-ipv6
+Configures the IPv6 settings for the service. Enter the settings
+in the order "Method", "Address", "PrefixLength", "Gateway", then
+"Privacy". See the properties section of the Service API for more
+information on these settings and the values accepted for them.
+It also displays a list of entered changes to the IPv6 settings,
+and incidental changes to other values related to it.
+.PP
+.TP
+.B \-\-nameservers
+Adds to the list of manually configured domain name servers.
+Enter the name servers after the argument separated by spaces.
+.PP
+.TP
+.B \-\-timeservers
+Adds to the list of manually configured time servers. Enter the
+time servers after the argument separated by spaces.
+.PP
+.TP
+.B \-\-domains
+Adds to the list of manually configured search domains. Enter
+the domains after the argument, separated by spaces.
+.PP
+.TP
+.B \-\-proxy
+Configures the IPv6 settings for the service. Enter the settings
+in the order "Method", "URL". If the Method is set to "direct", no
+other arguments are taken. If the Method is set to "auto", the URL is
+optional. To set the Servers and Excludes manually, enter "manual"
+with no other arguments. The CLI will ask for the lists of Servers
+and Excludes; enter them after the prompt separated by spaces.
+.PP
+.SS
+Monitor Options:
+.PP
+.TP
+.B \-\-services
+Listens for and displays the PropertyChanged signal from the Service interface.
+Also displays the service name (e.g. Joes-wifi) that the property is part of.
+More information, including a list of possible properties can be found in the
+Service API.
+.PP
+.TP
+.B \-\-tech
+Listens for and displays the PropertyChanged signal from the Technology
+interface. More information, including a list of possible properties can be
+found in the Technology API.
+.PP
+.TP
+.B \-\-manager
+Listens for and displays the PropertyChanged, TechnologyAdded, and
+TechnologyRemoved signals from the Manager interface. More information on
+these signals and a list of possible properties can be found in the Manager 
API.
+.PP
+
diff --git a/include/dbus.h b/include/dbus.h
index 3f8dbad..bf5f8c1 100644
--- a/include/dbus.h
+++ b/include/dbus.h
@@ -96,6 +96,25 @@ static inline void connman_dbus_dict_open(DBusMessageIter 
*iter,
                        DBUS_DICT_ENTRY_END_CHAR_AS_STRING, dict);
 }
 
+static inline void connman_dbus_dict_open_variant(DBusMessageIter *iter,
+                                                       DBusMessageIter *dict)
+{
+       dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
+                       DBUS_TYPE_ARRAY_AS_STRING
+                       DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                       DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
+                       DBUS_DICT_ENTRY_END_CHAR_AS_STRING, dict);
+}
+
+static inline void connman_dbus_array_open(DBusMessageIter *iter,
+                                                       DBusMessageIter *dict)
+{
+       dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
+                       DBUS_TYPE_ARRAY_AS_STRING
+                       DBUS_TYPE_STRING_AS_STRING,
+                       dict);
+}
+
 static inline void connman_dbus_dict_close(DBusMessageIter *iter,
                                                        DBusMessageIter *dict)
 {
-- 
1.7.9.5

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to