Skip to content

Commit

Permalink
新增-q参数显示解密后的SuConfig.dat以便选择DHCP方式。
Browse files Browse the repository at this point in the history
  • Loading branch information
wallproxy committed Apr 22, 2010
1 parent 47f8385 commit 2f7df22
Show file tree
Hide file tree
Showing 22 changed files with 298 additions and 353 deletions.
5 changes: 1 addition & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ dist_doc_DATA = README

dist_man_MANS = mentohust.1

SPEC = mentohust.spec

EXTRA_DIST = @[email protected] m4 $(SPEC) debian/changelog debian/compat debian/control debian/copyright debian/rules debian/watch
EXTRA_DIST = @[email protected] m4 debian/changelog debian/compat debian/control debian/copyright debian/rules debian/watch

rpm: dist @[email protected]
rpmbuild -bb \
Expand All @@ -18,7 +16,6 @@ rpm: dist @[email protected]
--define "_rpmdir `pwd`" \
--define "_srcrpmdir `pwd`" \
@[email protected]


deb: debian/rules
dpkg-buildpackage -rfakeroot -uc -b -d
20 changes: 18 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,30 @@
#安装mentohust:建议Ubuntu用户使用Deb包安装,Fedora用户使用RPM包安装

#如果确定自己可以使用xrgsu认证成功,打开终端输入sudo mentohust运行即可
#如果不确定,切换到锐捷所在目录,然后输入以下命令:
如果不确定,切换到锐捷所在目录,然后输入以下命令:
sudo mkdir /etc/mentohust
sudo cp ./8021x.exe /etc/mentohust
#如果准确按以上步骤操作后还是认证失败,请下载MentoHUSTTool,在Windows下抓包并保存为data.mpf,
sudo cp ./W32N55.dll /etc/mentohust
然后打开终端输入sudo mentohust运行。如果认证失败,再切换到锐捷所在目录,输入以下命令:
sudo cp ./SuConfig.dat /etc/mentohust
然后打开终端输入sudo mentohust运行即可。
如果准确按以上步骤操作后还是认证失败,请下载MentoHUSTTool,在Windows下抓包并保存为data.mpf,
然后回到Linux,切换到data.mpf所在目录,输入以下命令:
sudo cp ./data.mpf /etc/mentohust
然后打开终端输入sudo mentohust -f/etc/mentohust/data.mpf -w运行即可。以后也只需输入sudo mentohust。

#您也可以按下面的方法操作:
1、静态IP用户请事先设置好IP;
2、打开终端,输入sudo mentohust,回车;
3、[正确]输入相应信息,如果认证成功,跳到第8步;如果提示“不允许使用的客户端类型”,按Ctrl+C结束认证;
4、打开终端,输入sudo mentohust -w -f'锐捷目录下任意文件路径',回车;
5、如果认证成功,跳到第8步;如果提示“客户端完整性被破坏”,按Ctrl+C结束认证;
6、将锐捷安装目录下的SuConfig.dat重命名为其他名字;
7、打开终端,输入sudo mentohust,回车;
8、如果是动态IP且不是Linux,打开相应设置去更新IP。
9、以后认证只需打开终端,输入sudo mentohust,回车。
10、要修改某些参数请输入mentohust -h查看帮助信息并据此修改,例如修改密码sudo mentohust -pNewPassword -w,要临时修改则不加-w参数。

#如何退出:不以后台模式运行mentohust时,按Ctrl+C即可退出;后台运行时使用sudo mentohust -k退出认证。

#查看帮助信息请输入:mentohust -h
Expand Down
2 changes: 1 addition & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ autopoint
aclocal
autoheader
automake --add-missing
autoconf
autoconf
25 changes: 10 additions & 15 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/myconfig.h])
AC_CONFIG_HEADERS([config.h])

m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

# Checks for programs.
AS_IF([test "x$prefix" = "xNONE"], [prefix="/usr"])
Expand Down Expand Up @@ -51,29 +50,25 @@ AC_ARG_ENABLE([notify], [AC_HELP_STRING([ --disable-notify], [Don't show notific
AS_IF([test "x$enable_notify" = "xno"],
[AC_DEFINE(NO_NOTIFY, [], [Define NO_NOTIFY to disable notification])],
[AC_CHECK_LIB([dl], [dlsym])])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# define GETTEXT_* variables
AS_IF([test -z "$enable_nls"], [enable_nls="yes"])

GETTEXT_PACKAGE="$PACKAGE_NAME"
AC_SUBST(GETTEXT_PACKAGE)
AC_SUBST(prefix)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.])

AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext.])
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.16.1)


# Checks for header files.
AC_CHECK_HEADERS([iconv.h arpa/inet.h fcntl.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])

AC_CHECK_HEADERS([iconv.h arpa/inet.h fcntl.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h libintl.h locale.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# Checks for library functions.
AC_CHECK_FUNCS([atexit memmove memset socket strrchr])
AC_CHECK_FUNCS([atexit memmove memset socket strrchr setlocale])

AC_CONFIG_FILES([Makefile po/Makefile.in src/Makefile mentohust.spec])
AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in mentohust.spec])

AC_MSG_RESULT([config result: host($host_os) pcap($with_pcap) notify($enable_notify) encode($enable_encodepass) arp($enable_arp)])
AC_MSG_RESULT([config result: host($host_os) pcap($with_pcap) notify($enable_notify) encode($enable_encodepass) arp($enable_arp) nls($enable_nls)])
AC_OUTPUT
3 changes: 1 addition & 2 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
zh_CN

en
4 changes: 2 additions & 2 deletions po/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ subdir = po
top_builddir = ..

# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8

# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
Expand All @@ -18,7 +18,7 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = Free Software Foundation, Inc.
COPYRIGHT_HOLDER = HustMoon Studio

# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
Expand Down
3 changes: 1 addition & 2 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# List of source files which contain translatable strings.
src/dlfunc.c
src/mentohust.c
src/mycheck.c
src/myconfig.c
src/myfunc.c
src/myini.c
src/mystate.c
77 changes: 0 additions & 77 deletions po/zh_CN.po

This file was deleted.

2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dist_sysconf_DATA = mentohust.conf

mentohust_SOURCES = myini.c md5.c mycheck.c dlfunc.c myfunc.c mystate.c myconfig.c mentohust.c

mentohust_SOURCES += types.h myini.h md5.h mycheck.h dlfunc.h myfunc.h mystate.h myconfig.h
mentohust_SOURCES += i18n.h types.h myini.h md5.h mycheck.h dlfunc.h myfunc.h mystate.h myconfig.h

mentohust_LDADD = $(LDADD)

23 changes: 6 additions & 17 deletions src/dlfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@
* 邮 箱:[email protected]
* 日 期:2009.11.11
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "i18n.h"
#include "dlfunc.h"
#include "i18n.h"

#ifndef NO_DYLOAD
#include <dlfcn.h>
Expand Down Expand Up @@ -47,8 +42,7 @@ int load_libpcap(void) {
error = dlerror();
}
if (libpcap == NULL) {
printf(_("!!Failed to open libpcap, please check its existence.\n"));
//printf("!! 打开libpcap失败,请检查是否已安装该库文件。\n");
printf(_("!! 打开libpcap失败,请检查是否已安装该库文件。\n"));
return -1;
}
if ((pcap_findalldevs = dlsym(libpcap, "pcap_findalldevs"), error = dlerror()) != NULL
Expand All @@ -62,8 +56,7 @@ int load_libpcap(void) {
|| (pcap_close = dlsym(libpcap, "pcap_close"), error = dlerror()) != NULL
|| (pcap_breakloop = dlsym(libpcap, "pcap_breakloop"), error = dlerror()) != NULL
|| (pcap_sendpacket = dlsym(libpcap, "pcap_sendpacket"), error = dlerror()) != NULL) {
printf(_("!! Failed To Get libpcap function : %s\n"), error);
//printf("!! 从libpcap获取函数失败: %s\n", error);
printf(_("!! 从libpcap获取函数失败: %s\n"), error);
free_libpcap();
return -1;
}
Expand Down Expand Up @@ -112,23 +105,20 @@ int load_libnotify(void) {
error = dlerror();
}
if (libnotify == NULL) {
printf(_("!! cannot load libnotify, please check its exitence.\n"));
//printf("!! 打开libnotify失败,请检查是否已安装该库文件。\n");
printf(_("!! 打开libnotify失败,请检查是否已安装该库文件。\n"));
return -1;
}
if ((notify_init = dlsym(libnotify, "notify_init"), error = dlerror()) != NULL
|| (notify_notification_new = dlsym(libnotify, "notify_notification_new"), error = dlerror()) != NULL
|| (notify_notification_show = dlsym(libnotify, "notify_notification_show"), error = dlerror()) != NULL
|| (notify_notification_update = dlsym(libnotify, "notify_notification_update"), error = dlerror()) != NULL
|| (notify_notification_set_timeout = dlsym(libnotify, "notify_notification_set_timeout"), error = dlerror()) != NULL) {
printf(_("!! Failed To Get libnotify function : %s\n"), error);
//printf("!! 从libnotify获取函数失败: %s\n", error);
printf(_("!! 从libnotify获取函数失败: %s\n"), error);
free_libnotify();
return -1;
}
if (!notify_init("mentohust")) {
printf(_("!! Uable to initlize libnotify.\n"));
//printf("!! 初始化libnotify失败。\n");
printf(_("!! 初始化libnotify失败。\n"));
free_libnotify();
return -1;
}
Expand Down Expand Up @@ -161,4 +151,3 @@ void show_notify(const char *summary, char *body) {
}

#endif /* NO_NOTIFY */

4 changes: 3 additions & 1 deletion src/dlfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#ifndef HUSTMOON_DLFUNC_H
#define HUSTMOON_DLFUNC_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <sys/time.h>

Expand Down Expand Up @@ -71,4 +74,3 @@ void show_notify(const char *summary, char *body); /* 显示通知:概要、正
#endif /* NO_NOTIFY */

#endif /* HUSTMOON_DLFUNC_H */

19 changes: 11 additions & 8 deletions src/i18n.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@

#ifndef I18N_H_
#define I18N_H_

#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#define GETTEXT_PACKAGE "mentohust"
#endif

#ifdef ENABLE_NLS
#include <libintl.h>
#include <locale.h>
#define _(String) gettext (String)
#define gettext_noop(String) String
#define N_(String) gettext_noop (String)
#define _(String) gettext(String)
#ifdef gettext_noop
#define N_(String) gettext_noop(String)
#else
#define N_(String) (String)
#endif
#else
#define _(String) (String)
#define N_(String) (String)
#define setlocale(x,y)
#define textdomain(x)
#define bindtextdomain(x,y)
#endif


#endif /* I18N_H_ */
Loading

0 comments on commit 2f7df22

Please sign in to comment.