├── .gitignore ├── Config.in ├── Makefile ├── README.md ├── files └── etc │ ├── config │ └── easydrcom.conf │ └── init.d │ └── easydrcom └── patches └── 000-openwrt_makefile.patch /.gitignore: -------------------------------------------------------------------------------- 1 | *.hpp 2 | src/main.cpp 3 | *.c 4 | src/md5.h -------------------------------------------------------------------------------- /Config.in: -------------------------------------------------------------------------------- 1 | menu "Easydrcom configuration" 2 | depends on PACKAGE_easydrcom 3 | 4 | config EASYDRCOM_DEBUG 5 | bool "Enable Debug Output" 6 | default N 7 | 8 | endmenu 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2012-2014 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=easydrcom 10 | PKG_VERSION:=0.9 11 | PKG_RELEASE:=15 12 | 13 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) 14 | 15 | PKG_SOURCE:=master.zip 16 | PKG_SOURCE_URL:=https://github.com/presisco/EasyDrcom/archive 17 | PKG_MD5SUM:=d149d5aaca00879ce83cc4e1df7d9fcd 18 | 19 | PKG_CONFIG_DEPENDS := EASYDRCOM_DEBUG 20 | 21 | include $(INCLUDE_DIR)/package.mk 22 | 23 | define Package/easydrcom 24 | SECTION:=net 25 | CATEGORY:=Network 26 | DEPENDS:=+libpcap +libstdcpp +libpthread 27 | TITLE:=Dr.COM client 28 | MENU:=1 29 | endef 30 | 31 | define Package/easydrcom/description 32 | Dr.COM client v$PKG_VERSION r$PKG_RELEASE 33 | endef 34 | 35 | define Package/easydrcom/config 36 | source "$(SOURCE)/Config.in" 37 | endef 38 | 39 | define Build/Prepare 40 | mkdir -p $(PKG_BUILD_DIR) 41 | 42 | unzip $(DL_DIR)/$(PKG_SOURCE) -d $(PKG_BUILD_DIR)/ 43 | $(CP) $(PKG_BUILD_DIR)/EasyDrcom-master/EasyDrcom/* $(PKG_BUILD_DIR) 44 | 45 | rm -r $(PKG_BUILD_DIR)/EasyDrcom-master 46 | 47 | $(Build/Patch) 48 | endef 49 | 50 | TARGET_CFLAGS += 51 | TARGET_CXXFLAGS += -Wno-error=format-security -DOPENWRT $(if $(CONFIG_EASYDRCOM_DEBUG),-DEASYDRCOM_DEBUG, ) 52 | 53 | define Package/easydrcom/install 54 | $(INSTALL_DIR) $(1)/usr/bin 55 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/easydrcom $(1)/usr/bin 56 | $(CP) -a files/* $(1)/ 57 | chmod 755 $(1)/etc/init.d/easydrcom 58 | endef 59 | 60 | $(eval $(call BuildPackage,easydrcom)) 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EasyDrcom-OpenWRT 2 | EasyDrcom在OpenWRT上的移植版本 3 | 图形界面管理需再安装luci-app-easydrcom:https://github.com/presisco/luci-app-easydrcom 4 | 5 | 本项目可直接按package编译出ipk文件。如果需要查看详细调试信息请在menuconfig中开启Debug。 6 | EasyDrcom的设置文件在/etc/config下,启动脚本在/etc/init.d下。 7 | 8 | -------------------------------------------------------------------------------- /files/etc/config/easydrcom.conf: -------------------------------------------------------------------------------- 1 | ;EasyDrcom v0.9 配置文件 2 | 3 | [General] 4 | ;用户名 5 | UserName=130410000 6 | ;密码 7 | PassWord=19800101 8 | ;模式: 1 - 办公区(UDP only), 2 - 宿舍区模式2(推荐使用,802.1x+UDP), 0 - 宿舍区模式1(802.1x+UDP) 9 | Mode=2 10 | ;是否启动时自动上线,0 - 否,1 - 是 11 | AutoOnline=1 12 | ;是否断线自动重拨,0 - 否,1 - 是 13 | AutoRedial=1 14 | 15 | [Remote] 16 | ;以下三项一般情况下不需要修改 17 | ;认证服务器IP地址 18 | IP=172.25.8.4 19 | ;认证服务器端口 20 | Port=61440 21 | ;是否使用广播地址(广播地址兼容性更好) 22 | UseBroadcast=1 23 | ;如果使用多播地址,则下面的MAC地址将被忽略 24 | ;认证服务器MAC地址,用冒号隔开 25 | MAC=00:1a:a9:c3:3a:59 26 | 27 | [Local] 28 | ;网卡名 29 | NIC=eth0 30 | ;数据包超时时间(毫秒),一般不需要修改,若在极端网络环境下请修改 31 | ;802.1x认证超时时间(正常为1000ms) 32 | EAPTimeout=1000 33 | ;UDP数据包超时时间(正常为2000ms) 34 | UDPTimeout=2000 35 | ;以下两项一般情况不需要修改 36 | HostName=EasyDrcom for HITwh 37 | KernelVersion=0.7_mips_AR7xxx_AR9xxxx 38 | -------------------------------------------------------------------------------- /files/etc/init.d/easydrcom: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # easydrcom script 3 | 4 | START=96 5 | 6 | start(){ 7 | easydrcom -b -r -c /etc/config/easydrcom.conf & 8 | echo "easydrcom started" 9 | } 10 | 11 | stop(){ 12 | killall easydrcom 13 | echo "easydrcom stopped" 14 | } 15 | 16 | restart(){ 17 | stop 18 | start 19 | } 20 | -------------------------------------------------------------------------------- /patches/000-openwrt_makefile.patch: -------------------------------------------------------------------------------- 1 | --- /dev/null 2 | +++ b/Makefile 3 | @@ -0,0 +1,7 @@ 4 | + 5 | +easydrcom: 6 | + $(CXX) $(CXXFLAGS) $(LDFLAGS) -DLINUX -s -std=c++0x -o easydrcom md5.c main.cpp -lpcap -lpthread 7 | + 8 | +clean: 9 | + -rm -f *.o *.elf *.gbd 10 | + 11 | --------------------------------------------------------------------------------