summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-06-12 16:54:30 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-06-13 10:38:43 +0300
commit66dcdecbacf77d059a2df332262a4a3144aa68a0 (patch)
tree177defbb6cdebb5d9d0ef92cee0bd2af0f1c5eab /client
parent1ac86108dfc3d8e350bda9daf42496fabaa5a3d6 (diff)
downloadconnman-66dcdecbacf77d059a2df332262a4a3144aa68a0.tar.gz
connman-66dcdecbacf77d059a2df332262a4a3144aa68a0.tar.bz2
connman-66dcdecbacf77d059a2df332262a4a3144aa68a0.zip
client: Add vpnagent command to register and unregister VPN Agent
Diffstat (limited to 'client')
-rw-r--r--client/commands.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/client/commands.c b/client/commands.c
index 131a5ccf..557a8ffd 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -1344,6 +1344,34 @@ static int cmd_vpnconnections(char *args[], int num,
}
+static int cmd_vpnagent(char *args[], int num, struct connman_option *options)
+{
+ if (num > 2)
+ return -E2BIG;
+
+ if (num < 2)
+ return -EINVAL;
+
+ switch(parse_boolean(args[1])) {
+ case 0:
+ __connmanctl_vpn_agent_unregister(connection);
+ break;
+
+ case 1:
+ if (__connmanctl_vpn_agent_register(connection) ==
+ -EINPROGRESS)
+ return -EINPROGRESS;
+
+ break;
+
+ default:
+ return -EINVAL;
+ break;
+ }
+
+ return 0;
+}
+
static int cmd_exit(char *args[], int num, struct connman_option *options)
{
return 1;
@@ -1414,6 +1442,8 @@ static const struct {
"Agent mode" },
{"vpnconnections", "[<connection>]", NULL, cmd_vpnconnections,
"Display VPN connections" },
+ { "vpnagent", "on|off", NULL, cmd_vpnagent,
+ "VPN Agent mode" },
{ "help", NULL, NULL, cmd_help,
"Show help" },
{ "exit", NULL, NULL, cmd_exit,