Skip to content

Commit

Permalink
[ALL:CLI] 完整的注销
Browse files Browse the repository at this point in the history
- 实现对多个接口都尝试注销了
  • Loading branch information
leetking authored and leetking committed Oct 23, 2016
1 parent 84073e5 commit cdef475
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ IS_DEBUG := DEBUG
#如果是, 就取GUI,否则就是空
IS_GUI :=

VERSION := 0.0.3.3
VERSION := 0.0.3.4
CONFIG := ./drcomrc
ifneq "$(IS_GUI)" ""
RES := resource
Expand Down
2 changes: 1 addition & 1 deletion main_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int main(int argc, char **argv)
#endif

if (islogoff) {
eaplogoff();
try_smart_logoff();
return 0;
}

Expand Down
22 changes: 21 additions & 1 deletion wrap_eapol.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern int try_smart_login(char const *uname, char const *pwd)
if (0 >= getall_ifs(ifs, &ifs_max)) return -3;
int i;
for (i = 0; i < ifs_max; ++i) {
_M("%d. try interface (%s) to login\n", i,
_M("%d. try interface (%s) to login...\n", i,
#ifdef LINUX
ifs[i].name
#elif defined(WINDOWS)
Expand All @@ -30,3 +30,23 @@ extern int try_smart_login(char const *uname, char const *pwd)
}
return ret;
}

extern void try_smart_logoff(void)
{
iflist_t ifs[IFS_MAX];
int ifs_max = IFS_MAX;
int ret = -3;
if (0 >= getall_ifs(ifs, &ifs_max)) return;
int i;
for (i = 0; i < ifs_max; ++i) {
_M("%d. try interface (%s) to logoff...\n", i,
#ifdef LINUX
ifs[i].name
#elif defined(WINDOWS)
ifs[i].desc
#endif
);
setifname(ifs[i].name);
eaplogoff();
}
}
4 changes: 4 additions & 0 deletions wrap_eapol.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
* 自动选择网卡登录
*/
extern int try_smart_login(char const *uname, char const *pwd);
/*
* 自动选择网卡离线
*/
extern void try_smart_logoff(void);

#endif

0 comments on commit cdef475

Please sign in to comment.