From 7741d88cdfd36f0c4380f660a9ad7109df76b432 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 24 Aug 2014 21:27:31 +0200 Subject: [PATCH] add support for authproto/username/password Signed-off-by: John Crispin --- cli.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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(); } -- 2.25.1