From: John Crispin Date: Sun, 24 Aug 2014 19:27:31 +0000 (+0200) Subject: add support for authproto/username/password X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7741d88cdfd36f0c4380f660a9ad7109df76b432;p=project%2Fumbim.git add support for authproto/username/password Signed-off-by: John Crispin --- 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(); }