summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-08-24 21:27:31 +0200
committerJohn Crispin <blogic@openwrt.org>2014-08-24 21:27:31 +0200
commit7741d88cdfd36f0c4380f660a9ad7109df76b432 (patch)
treeacb142bc93ee363c9b34cf7f428af2bd05700a70
parent7f620b45fedfa4bde2f75f9bb9ced49272d1a5d1 (diff)
add support for authproto/username/password
Signed-off-by: John Crispin <blogic@openwrt.org>
-rw-r--r--cli.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/cli.c b/cli.c
index 86fe726..d3c11d3 100644
--- a/cli.c
+++ b/cli.c
@@ -316,7 +316,19 @@ mbim_connect_request(void)
memcpy(c->contexttype, uuid_context_type_internet, 16);
if (_argc > 0)
mbim_encode_string(&c->accessstring, *_argv);
-
+ if (_argc > 3) {
+ if (!strcmp(_argv[1], "pap"))
+ c->authprotocol = htole32(MBIM_AUTH_PROTOCOL_PAP);
+ else if (!strcmp(_argv[1], "chap"))
+ c->authprotocol = htole32(MBIM_AUTH_PROTOCOL_CHAP);
+ else if (!strcmp(_argv[1], "mschapv2"))
+ c->authprotocol = htole32(MBIM_AUTH_PROTOCOL_MSCHAPV2);
+ else
+ return -1;
+
+ mbim_encode_string(&c->username, _argv[2]);
+ mbim_encode_string(&c->password, _argv[3]);
+ }
return mbim_send_command_msg();
}