├── .gitmodules ├── CMakeLists.txt ├── README.md ├── conf └── mobile.conf ├── doc ├── 5G.jpeg ├── Driver │ ├── ZTE │ ├── ZTE windows.7z │ └── 内核驱动 │ │ ├── Linux3.8及以上版本的USB驱动内核配置方法.pdf │ │ ├── Linux驱动安装与加载.pdf │ │ ├── Lte模块 │ │ └── Lte模块 驱动安装说明.pdf ├── Issue │ ├── MTU.docx │ ├── MTU相关.docx │ └── 改善弱网络.pdf ├── Modem │ ├── Android │ │ └── ril │ │ │ ├── Android.bp │ │ │ ├── CleanSpec.mk │ │ │ ├── OWNERS │ │ │ ├── include │ │ │ ├── libril │ │ │ │ └── ril_ex.h │ │ │ └── telephony │ │ │ │ ├── librilutils.h │ │ │ │ ├── record_stream.h │ │ │ │ ├── ril.h │ │ │ │ ├── ril_cdma_sms.h │ │ │ │ ├── ril_mcc.h │ │ │ │ ├── ril_mnc.h │ │ │ │ ├── ril_msim.h │ │ │ │ └── ril_nv_items.h │ │ │ ├── libril │ │ │ ├── Android.mk │ │ │ ├── MODULE_LICENSE_APACHE2 │ │ │ ├── NOTICE │ │ │ ├── RilSapSocket.cpp │ │ │ ├── RilSapSocket.h │ │ │ ├── RilSocket.h │ │ │ ├── ril.cpp │ │ │ ├── rilSocketQueue.h │ │ │ ├── ril_commands.h │ │ │ ├── ril_event.cpp │ │ │ ├── ril_event.h │ │ │ ├── ril_internal.h │ │ │ ├── ril_service.cpp │ │ │ ├── ril_service.h │ │ │ ├── ril_unsol_commands.h │ │ │ ├── sap_service.cpp │ │ │ └── sap_service.h │ │ │ ├── librilutils │ │ │ ├── Android.bp │ │ │ ├── librilutils.c │ │ │ ├── proto │ │ │ │ ├── sap-api.options │ │ │ │ └── sap-api.proto │ │ │ └── record_stream.c │ │ │ ├── reference-ril │ │ │ ├── Android.mk │ │ │ ├── MODULE_LICENSE_APACHE2 │ │ │ ├── NOTICE │ │ │ ├── OWNERS │ │ │ ├── at_tok.c │ │ │ ├── at_tok.h │ │ │ ├── atchannel.c │ │ │ ├── atchannel.h │ │ │ ├── misc.c │ │ │ ├── misc.h │ │ │ ├── reference-ril.c │ │ │ └── ril.h │ │ │ └── rild │ │ │ ├── Android.mk │ │ │ ├── MODULE_LICENSE_APACHE2 │ │ │ ├── NOTICE │ │ │ ├── rild.c │ │ │ ├── rild.legacy.rc │ │ │ └── rild.rc │ ├── B78 │ │ ├── B78_B_X0x │ │ ├── B78_B_X0x AT Command.pdf │ │ └── B78_B_X0x硬件接口手册.pdf │ ├── Nodecom │ │ ├── GobiNet驱动加载手册_08162016-0001.pdf │ │ ├── Nodecom_660_Linux_GobiNet_08182016-0001.zip │ │ ├── fastboot-9x07.zip │ │ ├── hostproxy.rar │ │ └── hostproxy使用说明.pdf │ ├── Simcom │ │ ├── SIM7500_SIM7600 │ │ └── SIM7500_SIM7600 Series_AT Command Manual_V1.01.pdf │ ├── ZTE │ │ ├── 中兴通讯 │ │ ├── 中兴通讯 ME3760 ZTE Linux操作系统驱动安装与加载.pdf │ │ ├── 中兴通讯 ME3760模块产品AT命令集_V1.0.pdf │ │ └── 中兴通讯 ME3760模块产品软件开发指导手册.pdf │ └── 创益 │ │ └── 专网模块03_LTE_Linux驱动安装与入网流程20160229.pdf ├── PPP │ ├── ppp-doc │ │ ├── 闲谈PPP协议(一) PPP数据帧的格式.doc │ │ ├── 闲谈PPP协议(三)LCP报文.doc │ │ └── 闲谈PPP协议(二)PPP的状态转移.doc │ ├── pppd-script-2.2 │ │ ├── README │ │ ├── chat │ │ ├── huawei-chat │ │ ├── huawei-ppp-off │ │ ├── huawei-ppp-on │ │ ├── huawei-ppp-status │ │ ├── ip-down │ │ ├── ip-up │ │ ├── log │ │ └── pppd │ ├── pppd.docx │ ├── pppd_daild │ │ ├── 4G_init.sh │ │ ├── chat │ │ ├── chat-connect │ │ └── pppd_param │ └── pppd_script │ │ ├── ppp.sh │ │ ├── pppdata_call.conf │ │ └── readme.txt └── VPDN │ ├── (5.2)运营商的VPDN服务【全业务组网砖家指引】.pdf │ ├── 2-4G-VPDN技术方案分析.ppt │ ├── 34G无线视频整体解决方案(完整版)20151108.pdf │ ├── 4G-LTE移动物联网实验室方案PPT.pptx │ ├── 4G-VPDN业务中终端不能上传账号的问题分析.docx │ ├── 4G无线视频传输系统方案.doc │ ├── 4G联网方案.pdf │ ├── CGIC简明教程目录(CGI篇).doc │ ├── H3C-4G路由器解决方案.pptx │ ├── LTE-EPC核心网组网及关键技术.pdf │ ├── LTE新技术-EPC网络架构及关键技术.pptx │ ├── LTE新技术培训-核心网专业第二部分.pdf │ ├── LTE核心网EPC专题.ppt │ ├── LTE核心网关键技术.pdf │ ├── LTE核心网网络架构及关键技术20110614.ppt │ ├── Linux下编译静态库和动态库.pdf │ ├── VPDN.docx │ ├── VPDN业务介绍.ppt │ ├── VPDN原理、实现及配置.ppt │ ├── VPN网络常见问题解答.ppt │ ├── 上海电信VPDN解决方案200503.ppt │ ├── 中国电信EPC承载方案V0.8.pdf │ ├── 中国电信无线宽带VPDN业务数据配置规范V1[1].0.doc │ ├── 中国移动4G车联网整体解决方案.pptx │ ├── 嵌入式C语言开发教程之用c写CGI-程序简要指南.pptx │ ├── 核心网基础知识简介.ppt │ ├── 法院检察院-4G高清移动执法、现场应急无线图传应用方案-v2.10.pdf │ ├── 物联网4G专网标准解决方案v3.docx │ ├── 电信M-VPDN多模块行业网关解决方案.ppt │ ├── 简单概述APN-VPDN实现GPRS-DTU无线数传方案.doc │ ├── 综合VPDN实现方案技术探讨.docx │ ├── 综治通-中兴N818-vpdn设置方法.doc │ ├── 运钞车视频监控系统方案.doc │ └── 远程视频监控系统系统方案.doc ├── src ├── channel.cc ├── channel.h ├── command.cc ├── command.h ├── dial.cc ├── dial.h ├── errno.cc ├── errno.h ├── huawei │ └── ModemHuawei.h ├── identify.h ├── mobile.cc ├── mobile.h ├── mobile.pb.cc ├── mobile.pb.h ├── mobile.proto ├── modem.cc ├── modem.h ├── service.cc ├── service.h ├── sms.cc ├── sms.h ├── token.cc ├── token.h ├── unicode.cc └── unicode.h └── tools ├── Makefile ├── bin ├── include │ └── pppd │ │ ├── ccp.h │ │ ├── chap-new.h │ │ ├── chap_ms.h │ │ ├── eap.h │ │ ├── ecp.h │ │ ├── eui64.h │ │ ├── fsm.h │ │ ├── ipcp.h │ │ ├── ipv6cp.h │ │ ├── ipxcp.h │ │ ├── lcp.h │ │ ├── magic.h │ │ ├── md4.h │ │ ├── md5.h │ │ ├── patchlevel.h │ │ ├── pathnames.h │ │ ├── pppcrypt.h │ │ ├── pppd.h │ │ ├── session.h │ │ ├── sha1.h │ │ ├── spinlock.h │ │ ├── tdb.h │ │ └── upap.h ├── lib │ └── pppd │ │ └── 2.4.7 │ │ ├── minconn.so │ │ ├── openl2tp.so │ │ ├── passprompt.so │ │ ├── passwordfd.so │ │ ├── pppol2tp.so │ │ ├── radattr.so │ │ ├── radius.so │ │ ├── radrealms.so │ │ └── winbind.so ├── sbin │ ├── chat │ ├── pppd │ ├── pppdump │ ├── pppoe-discovery │ └── pppstats └── share │ └── man │ └── man8 │ ├── chat.8 │ ├── pppd-radattr.8 │ ├── pppd-radius.8 │ ├── pppd.8 │ ├── pppdump.8 │ └── pppstats.8 └── src ├── 4G.zip ├── SocketTool2 ├── GPRSDTUDOC1.pdf ├── SocketTool.exe └── TCP&UDP Readme.doc ├── SpeedTestC ├── .gitignore ├── LICENSE ├── Makefile ├── README.md └── src │ ├── .cproject │ ├── .project │ ├── Speedtest.c │ ├── Speedtest.h │ ├── SpeedtestConfig.c │ ├── SpeedtestConfig.h │ ├── SpeedtestDownloadTest.c │ ├── SpeedtestDownloadTest.h │ ├── SpeedtestLatencyTest.c │ ├── SpeedtestLatencyTest.h │ ├── SpeedtestServers.c │ ├── SpeedtestServers.h │ ├── SpeedtestUploadTest.c │ ├── SpeedtestUploadTest.h │ ├── http.c │ ├── http.h │ ├── url.c │ └── url.h ├── network emulatot toolkit.zip ├── ppp-2.4.7 ├── .gitignore ├── Changes-2.3 ├── FAQ ├── PLUGINS ├── README ├── README.MPPE ├── README.MSCHAP80 ├── README.MSCHAP81 ├── README.cbcp ├── README.eap-srp ├── README.linux ├── README.pppoe ├── README.pppol2tp ├── README.pwfd ├── README.sol2 ├── SETUP ├── chat │ ├── .gitignore │ ├── Makefile.linux │ ├── Makefile.sol2 │ ├── bin │ │ └── share │ │ │ └── man │ │ │ └── man8 │ │ │ └── chat.8 │ ├── chat.8 │ └── chat.c ├── common │ ├── zlib.c │ └── zlib.h ├── configure ├── contrib │ └── pppgetpass │ │ ├── Makefile.linux │ │ ├── pppgetpass.8 │ │ ├── pppgetpass.gtk.c │ │ ├── pppgetpass.sh │ │ └── pppgetpass.vt.c ├── etc.ppp │ ├── chap-secrets │ ├── options │ └── pap-secrets ├── include │ ├── linux │ │ ├── if_ppp.h │ │ ├── ppp-comp.h │ │ └── ppp_defs.h │ └── net │ │ ├── if_ppp.h │ │ ├── ppp-comp.h │ │ ├── ppp_defs.h │ │ ├── pppio.h │ │ ├── slcompress.h │ │ └── vjcompress.h ├── linux │ └── Makefile.top ├── modules │ ├── bsd-comp.c │ ├── deflate.c │ ├── if_ppp.c │ ├── ppp.c │ ├── ppp_ahdlc.c │ ├── ppp_comp.c │ ├── ppp_mod.h │ └── vjcompress.c ├── pppd │ ├── .gitignore │ ├── Makefile.linux │ ├── Makefile.sol2 │ ├── auth.c │ ├── cbcp.c │ ├── cbcp.h │ ├── ccp.c │ ├── ccp.h │ ├── chap-md5.c │ ├── chap-md5.h │ ├── chap-new.c │ ├── chap-new.h │ ├── chap_ms.c │ ├── chap_ms.h │ ├── demand.c │ ├── eap.c │ ├── eap.h │ ├── ecp.c │ ├── ecp.h │ ├── eui64.c │ ├── eui64.h │ ├── fsm.c │ ├── fsm.h │ ├── ipcp.c │ ├── ipcp.h │ ├── ipv6cp.c │ ├── ipv6cp.h │ ├── ipxcp.c │ ├── ipxcp.h │ ├── lcp.c │ ├── lcp.h │ ├── magic.c │ ├── magic.h │ ├── main.c │ ├── md4.c │ ├── md4.h │ ├── md5.c │ ├── md5.h │ ├── mppe.h │ ├── multilink.c │ ├── options.c │ ├── patchlevel.h │ ├── pathnames.h │ ├── plugins │ │ ├── Makefile.linux │ │ ├── Makefile.sol2 │ │ ├── minconn.c │ │ ├── passprompt.c │ │ ├── passwordfd.c │ │ ├── pppoatm │ │ │ ├── COPYING │ │ │ ├── Makefile.linux │ │ │ ├── ans.c │ │ │ ├── atm.h │ │ │ ├── atmres.h │ │ │ ├── atmsap.h │ │ │ ├── misc.c │ │ │ ├── pppoatm.c │ │ │ ├── text2atm.c │ │ │ └── text2qos.c │ │ ├── pppol2tp │ │ │ ├── Makefile.linux │ │ │ ├── l2tp_event.h │ │ │ ├── openl2tp.c │ │ │ └── pppol2tp.c │ │ ├── radius │ │ │ ├── COPYRIGHT │ │ │ ├── Makefile.linux │ │ │ ├── avpair.c │ │ │ ├── buildreq.c │ │ │ ├── clientid.c │ │ │ ├── config.c │ │ │ ├── dict.c │ │ │ ├── etc │ │ │ │ ├── dictionary │ │ │ │ ├── dictionary.ascend │ │ │ │ ├── dictionary.compat │ │ │ │ ├── dictionary.merit │ │ │ │ ├── dictionary.microsoft │ │ │ │ ├── issue │ │ │ │ ├── port-id-map │ │ │ │ ├── radiusclient.conf │ │ │ │ ├── radiusclient.conf.in │ │ │ │ ├── realms │ │ │ │ └── servers │ │ │ ├── includes.h │ │ │ ├── ip_util.c │ │ │ ├── lock.c │ │ │ ├── md5.c │ │ │ ├── options.h │ │ │ ├── pathnames.h │ │ │ ├── pppd-radattr.8 │ │ │ ├── pppd-radius.8 │ │ │ ├── radattr.c │ │ │ ├── radius.c │ │ │ ├── radiusclient.h │ │ │ ├── radrealms.c │ │ │ ├── sendserver.c │ │ │ └── util.c │ │ ├── rp-pppoe │ │ │ ├── .gitignore │ │ │ ├── Makefile.linux │ │ │ ├── common.c │ │ │ ├── config.h │ │ │ ├── debug.c │ │ │ ├── discovery.c │ │ │ ├── if.c │ │ │ ├── plugin.c │ │ │ ├── pppoe-discovery.c │ │ │ └── pppoe.h │ │ └── winbind.c │ ├── ppp.pam │ ├── pppcrypt.c │ ├── pppcrypt.h │ ├── pppd.8 │ ├── pppd.h │ ├── session.c │ ├── session.h │ ├── sha1.c │ ├── sha1.h │ ├── spinlock.c │ ├── spinlock.h │ ├── srp-entry.8 │ ├── srp-entry.c │ ├── sys-linux.c │ ├── sys-solaris.c │ ├── tdb.c │ ├── tdb.h │ ├── tty.c │ ├── upap.c │ ├── upap.h │ └── utils.c ├── pppdump │ ├── .gitignore │ ├── Makefile.linux │ ├── Makefile.sol2 │ ├── bsd-comp.c │ ├── deflate.c │ ├── ppp-comp.h │ ├── pppdump.8 │ ├── pppdump.c │ ├── zlib.c │ └── zlib.h ├── pppstats │ ├── .gitignore │ ├── Makefile.linux │ ├── Makefile.sol2 │ ├── pppstats.8 │ └── pppstats.c ├── scripts │ ├── README │ ├── autopppd │ ├── callback │ ├── chat-callback │ ├── chatchat │ │ ├── README │ │ └── chatchat.c │ ├── ip-down.local.add │ ├── ip-up.local.add │ ├── ipv6-down.sample │ ├── ipv6-up.sample │ ├── options-rsh-loc │ ├── options-rsh-rem │ ├── options-ssh-loc │ ├── options-ssh-rem │ ├── plog │ ├── poff │ ├── pon │ ├── pon.1 │ ├── ppp-off │ ├── ppp-on │ ├── ppp-on-dialer │ ├── ppp-on-rsh │ ├── ppp-on-ssh │ ├── redialer │ └── secure-card └── solaris │ ├── Makedefs │ ├── Makedefs.gcc │ ├── Makedefs.sol2 │ ├── Makefile.sol2 │ ├── Makefile.sol2-64 │ ├── Makefile.sol2-64x │ ├── Makefile.sol2gcc │ ├── Makefile.sol2gcc-64 │ ├── Makefile.sol2gcc-64x │ ├── Makefile.top │ ├── ppp.c │ ├── ppp.conf │ ├── ppp_ahdlc.c │ ├── ppp_ahdlc_mod.c │ ├── ppp_comp.c │ ├── ppp_comp_mod.c │ ├── ppp_mod.c │ └── ppp_mod.h ├── serialCom ├── Makefile ├── serialCom └── serialCom.c ├── ttcp-master.zip └── ttcp ├── .gitignore ├── Makefile ├── README.md ├── ttcp.1 ├── ttcp.c └── 说明.txt /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tools/src/serial"] 2 | path = tools/src/serial 3 | url = https://github.com/wjwwood/serial.git 4 | [submodule "tools/src/ppp"] 5 | path = tools/src/ppp 6 | url = https://github.com/paulusmack/ppp.git 7 | [submodule "tools/src/TW_5G_open_linux"] 8 | path = tools/src/TW_5G_open_linux 9 | url = https://github.com/TWxa001/TW_5G_open_linux.git 10 | [submodule "tools/src/pdureader"] 11 | path = tools/src/pdureader 12 | url = https://github.com/mobrembski/pdureader.git 13 | [submodule "tools/src/ModemManager"] 14 | path = tools/src/ModemManager 15 | url = https://github.com/linux-mobile-broadband/ModemManager.git 16 | [submodule "tools/src/minicom"] 17 | path = tools/src/minicom 18 | url = https://github.com/dereknex/minicom.git 19 | [submodule "tools/src/libphonenumber"] 20 | path = tools/src/libphonenumber 21 | url = https://github.com/google/libphonenumber 22 | [submodule "tools/src/ofono"] 23 | path = tools/src/ofono 24 | url = https://git.kernel.org/pub/scm/network/ofono/ofono.git 25 | [submodule "tools/src/phonesim"] 26 | path = tools/src/phonesim 27 | url = https://git.kernel.org/pub/scm/network/ofono/phonesim.git 28 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(MOBILE_SERVER_VERSION 0.1) 2 | 3 | execute_process(COMMAND git log --pretty=format:%h -1 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GITVER) 4 | add_definitions(-DVERSION_TAG=${AGENT_SERVER_VERSION}-${GITVER}) 5 | 6 | # 设置debug版本信息 进程生成名字 7 | if(${CMAKE_BUILD_TYPE} MATCHES "debug") 8 | file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/Debug) 9 | if (CMAKE_SYSTEM_NAME MATCHES "Darwin") 10 | file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/Darwin) 11 | elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") 12 | file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/Linux) 13 | endif() 14 | else() 15 | file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/Release) 16 | if (CMAKE_SYSTEM_NAME MATCHES "Darwin") 17 | file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/Darwin) 18 | elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") 19 | file(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/Linux) 20 | endif() 21 | endif() 22 | set(EXECUTABLE_NAME "Mobile") 23 | 24 | include (${PROJECT_SOURCE_DIR}/../cmake/utils.cmake) 25 | #include (${PROJECT_SOURCE_DIR}/cmake/FindNUMA.cmake) 26 | add_cplusplus_standard_support() 27 | 28 | set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -fPIC -O0 -Wall -g -ggdb -DGFLAGS_NS=${GFLAGS_NS}") 29 | set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${DEFINE_CLOCK_GETTIME} -DGFLAGS_NS=${GFLAGS_NS}") 30 | 31 | #protobuf_generate_cpp(PROTO_SRC PROTO_HEADER Mobile.proto) 32 | 33 | # brpc.a 34 | # protobuf.a 35 | # protoc.a 36 | # gflags.a 37 | # leveldb.a 38 | # ssl.a 39 | # crypto.a 40 | # snappy.a 41 | # z.a 42 | # 设置依赖库 43 | set(COMMLIBS MSF 44 | numa.a 45 | uring.a 46 | protobuf.a 47 | protoc.a 48 | snappy.a 49 | z.a 50 | uuid 51 | pthread 52 | dl) 53 | 54 | # 设置源代码路径 55 | aux_source_directory (src DIR_SRCS) 56 | add_executable(${EXECUTABLE_NAME} ${DIR_SRCS}) 57 | add_definitions(-Wno-builtin-macro-redefined) 58 | msf_redefine_file(${EXECUTABLE_NAME}) 59 | #set_target_properties(${EXECUTABLE_NAME} PROPERTIES VERSION ${MOBILE_SERVER_VERSION}) 60 | target_link_libraries(${EXECUTABLE_NAME} ${COMMLIBS}) 61 | 62 | set(CMAKE_INSTALL_PREFIX /home/luotang.me) # 安装路径前缀 /home/xxx/usr 63 | install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION bin) # 二进制安装到 /home/luotang.me/bin 64 | 65 | set(MOBILE_CONF ${PROJECT_SOURCE_DIR}/mobile/conf/mobile.conf) 66 | install(FILES ${MOBILE_CONF} DESTINATION conf) 67 | -------------------------------------------------------------------------------- /conf/mobile.conf: -------------------------------------------------------------------------------- 1 | # Mobile Configuration 2 | Version = 0.1 3 | Process = Mobile 4 | 5 | [Logger] 6 | LogLevel = debug 7 | LogDir = /home/luotang.me/log/ 8 | 9 | [System] 10 | PidFile = /home/luotang.me/pid/Mobile.pid 11 | Daemon = false 12 | CoreDump = true 13 | 14 | [Plugins] 15 | Plugin = /home/luotang.me/plugins/sms_alarm.so 16 | Plugin = /home/luotang.me/plugins/sms_ctrl.so 17 | 18 | [Network] 19 | # tcp udp unix netlink muticast 20 | AgentEnable = false 21 | AgentNet = tcp 22 | AgentIP = 127.0.0.1 23 | AgentPort = 8888 24 | AgentUnixServer = /var/tmp/AgentServer.sock 25 | AgentUnixClient = /var/tmp/Mobile.sock 26 | AgentUnixClientMask = 0766 27 | AgentAuthChap = false 28 | AgentPackType = binary 29 | 30 | DialEnable = true 31 | DialType = auto 32 | DialNet = 4G 33 | DialPlans = 0 34 | DialApn = 0,ctlte 35 | DialApn = 1,cmnet 36 | AuthType = pap_chap 37 | DilaNumber = *98# 38 | AuthUser = user 39 | AuthPass = user -------------------------------------------------------------------------------- /doc/5G.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/5G.jpeg -------------------------------------------------------------------------------- /doc/Driver/ZTE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Driver/ZTE -------------------------------------------------------------------------------- /doc/Driver/ZTE windows.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Driver/ZTE windows.7z -------------------------------------------------------------------------------- /doc/Driver/内核驱动/Linux3.8及以上版本的USB驱动内核配置方法.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Driver/内核驱动/Linux3.8及以上版本的USB驱动内核配置方法.pdf -------------------------------------------------------------------------------- /doc/Driver/内核驱动/Linux驱动安装与加载.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Driver/内核驱动/Linux驱动安装与加载.pdf -------------------------------------------------------------------------------- /doc/Driver/内核驱动/Lte模块: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Driver/内核驱动/Lte模块 -------------------------------------------------------------------------------- /doc/Driver/内核驱动/Lte模块 驱动安装说明.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Driver/内核驱动/Lte模块 驱动安装说明.pdf -------------------------------------------------------------------------------- /doc/Issue/MTU.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Issue/MTU.docx -------------------------------------------------------------------------------- /doc/Issue/MTU相关.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Issue/MTU相关.docx -------------------------------------------------------------------------------- /doc/Issue/改善弱网络.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Issue/改善弱网络.pdf -------------------------------------------------------------------------------- /doc/Modem/Android/ril/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library_headers { 2 | name: "ril_headers", 3 | vendor: true, 4 | export_include_dirs: ["include"], 5 | } 6 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/OWNERS: -------------------------------------------------------------------------------- 1 | amitmahajan@google.com 2 | jackyu@google.com 3 | rgreenwalt@google.com 4 | fionaxu@google.com 5 | jminjie@google.com 6 | mpq@google.com 7 | shuoq@google.com 8 | refuhoo@google.com 9 | sarahchin@google.com 10 | dbright@google.com 11 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/include/libril/ril_ex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RIL_EX_H_INCLUDED 18 | #define RIL_EX_H_INCLUDED 19 | 20 | #include 21 | #include 22 | 23 | #define NUM_ELEMS_SOCKET(a) (sizeof (a) / sizeof (a)[0]) 24 | 25 | struct ril_event; 26 | 27 | void rilEventAddWakeup_helper(struct ril_event *ev); 28 | int blockingWrite_helper(int fd, void* data, size_t len); 29 | 30 | enum SocketWakeType {DONT_WAKE, WAKE_PARTIAL}; 31 | 32 | typedef enum { 33 | RIL_TELEPHONY_SOCKET, 34 | RIL_SAP_SOCKET 35 | } RIL_SOCKET_TYPE; 36 | 37 | typedef struct SocketListenParam { 38 | RIL_SOCKET_ID socket_id; 39 | int fdListen; 40 | int fdCommand; 41 | const char* processName; 42 | struct ril_event* commands_event; 43 | struct ril_event* listen_event; 44 | void (*processCommandsCallback)(int fd, short flags, void *param); 45 | RecordStream *p_rs; 46 | RIL_SOCKET_TYPE type; 47 | } SocketListenParam; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/include/telephony/librilutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef LIBRILUTILS_H 18 | #define LIBRILUTILS_H 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /** 27 | * Return system time in nanos. 28 | * 29 | * This is a monotonicly increasing clock and 30 | * return the same value as System.nanoTime in java. 31 | */ 32 | uint64_t ril_nano_time(); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif // LIBRILUTILS_H 39 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/include/telephony/record_stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * A simple utility for reading fixed records out of a stream fd 19 | */ 20 | 21 | #ifndef _LIBRIL_RECORD_STREAM_H 22 | #define _LIBRIL_RECORD_STREAM_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | 29 | typedef struct RecordStream RecordStream; 30 | 31 | extern RecordStream *record_stream_new(int fd, size_t maxRecordLen); 32 | extern void record_stream_free(RecordStream *p_rs); 33 | 34 | extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord, 35 | size_t *p_outRecordLen); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | 42 | #endif /*_LIBRIL_RECORD_STREAM_H*/ 43 | 44 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/include/telephony/ril_mcc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RIL_MCC_H 18 | #define RIL_MCC_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace ril { 25 | namespace util { 26 | namespace mcc { 27 | 28 | /** 29 | * Decode an integer mcc and encode as 3 digit string 30 | * 31 | * @param an integer mcc, its range should be in 0 to 999. 32 | * 33 | * @return string representation of an encoded MCC or an empty string 34 | * if the MCC is not a valid MCC value. 35 | */ 36 | static inline std::string decode(int mcc) { 37 | char mccStr[4] = {0}; 38 | if (mcc > 999 || mcc < 0) return ""; 39 | 40 | snprintf(mccStr, sizeof(mccStr), "%03d", mcc); 41 | return mccStr; 42 | } 43 | 44 | // echo -e "#include \"hardware/ril/include/telephony/ril_mcc.h\"\nint main()"\ 45 | // "{ return ril::util::mcc::test(); }" > ril_test.cpp \ 46 | // && g++ -o /tmp/ril_test -DTEST_RIL_MCC ril_test.cpp; \ 47 | // rm ril_test.cpp; /tmp/ril_test && [ $? ] && echo "passed" 48 | #ifdef TEST_RIL_MCC 49 | static int test() { 50 | const struct mcc_ints { const int in; const char * out; } legacy_mccs[] = { 51 | {INT_MAX, ""}, 52 | {1, "001"}, 53 | {11, "011"}, 54 | {111, "111"}, 55 | {0, "000"}, 56 | {9999, ""}, 57 | {-12, ""}, 58 | }; 59 | 60 | for (int i=0; i < sizeof(legacy_mccs) / sizeof(struct mcc_ints); i++) { 61 | if (decode(legacy_mccs[i].in).compare(legacy_mccs[i].out)) return 1; 62 | } 63 | 64 | return 0; 65 | } 66 | #endif 67 | 68 | } 69 | } 70 | } 71 | #endif /* !defined(RIL_MCC_H) */ 72 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/include/telephony/ril_msim.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef ANDROID_RIL_MSIM_H 19 | #define ANDROID_RIL_MSIM_H 1 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | typedef enum { 26 | RIL_UICC_SUBSCRIPTION_DEACTIVATE = 0, 27 | RIL_UICC_SUBSCRIPTION_ACTIVATE = 1 28 | } RIL_UiccSubActStatus; 29 | 30 | typedef enum { 31 | RIL_SUBSCRIPTION_1 = 0, 32 | RIL_SUBSCRIPTION_2 = 1, 33 | RIL_SUBSCRIPTION_3 = 2 34 | } RIL_SubscriptionType; 35 | 36 | typedef struct { 37 | int slot; /* 0, 1, ... etc. */ 38 | int app_index; /* array subscriptor from applications[RIL_CARD_MAX_APPS] in 39 | RIL_REQUEST_GET_SIM_STATUS */ 40 | RIL_SubscriptionType sub_type; /* Indicates subscription 1 or subscription 2 */ 41 | RIL_UiccSubActStatus act_status; 42 | } RIL_SelectUiccSub; 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif /*ANDROID_RIL_MSIM_H*/ 49 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/libril/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2006 The Android Open Source Project 2 | 3 | LOCAL_PATH:= $(call my-dir) 4 | include $(CLEAR_VARS) 5 | 6 | LOCAL_VENDOR_MODULE := true 7 | 8 | LOCAL_SRC_FILES:= \ 9 | ril.cpp \ 10 | ril_event.cpp\ 11 | RilSapSocket.cpp \ 12 | ril_service.cpp \ 13 | sap_service.cpp 14 | 15 | LOCAL_SHARED_LIBRARIES := \ 16 | liblog \ 17 | libutils \ 18 | libcutils \ 19 | libhardware_legacy \ 20 | librilutils \ 21 | android.hardware.radio@1.0 \ 22 | android.hardware.radio@1.1 \ 23 | android.hardware.radio.deprecated@1.0 \ 24 | libhidlbase \ 25 | 26 | LOCAL_STATIC_LIBRARIES := \ 27 | libprotobuf-c-nano-enable_malloc-32bit \ 28 | 29 | LOCAL_CFLAGS += -Wall -Wextra -Wno-unused-parameter -Werror 30 | LOCAL_CFLAGS += -DPB_FIELD_32BIT 31 | 32 | ifeq ($(SIM_COUNT), 2) 33 | LOCAL_CFLAGS += -DANDROID_MULTI_SIM -DDSDA_RILD1 34 | LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 35 | endif 36 | 37 | ifneq ($(DISABLE_RILD_OEM_HOOK),) 38 | LOCAL_CFLAGS += -DOEM_HOOK_DISABLED 39 | endif 40 | 41 | LOCAL_C_INCLUDES += external/nanopb-c 42 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../include 43 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include 44 | 45 | LOCAL_MODULE:= libril 46 | LOCAL_SANITIZE := integer 47 | 48 | include $(BUILD_SHARED_LIBRARY) 49 | 50 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/libril/MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Android/ril/libril/MODULE_LICENSE_APACHE2 -------------------------------------------------------------------------------- /doc/Modem/Android/ril/libril/RilSocket.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef RIL_SOCKET_H_INCLUDED 18 | #define RIL_SOCKET_H_INCLUDED 19 | #include 20 | #include "rilSocketQueue.h" 21 | #include 22 | 23 | /** 24 | * Abstract socket class representing sockets in rild. 25 | *

26 | * This class performs the following functions : 27 | *

    28 | *
  • Start socket listen. 29 | *
  • Handle socket listen and command callbacks. 30 | *
31 | */ 32 | class RilSocket { 33 | protected: 34 | 35 | /** 36 | * Socket name. 37 | */ 38 | const char* name; 39 | 40 | /** 41 | * Socket id. 42 | */ 43 | RIL_SOCKET_ID id; 44 | 45 | public: 46 | 47 | /** 48 | * Constructor. 49 | * 50 | * @param Socket name. 51 | * @param Socket id. 52 | */ 53 | RilSocket(const char* socketName, RIL_SOCKET_ID socketId) { 54 | name = socketName; 55 | id = socketId; 56 | } 57 | 58 | /** 59 | * Get socket id. 60 | * 61 | * @return RIL_SOCKET_ID socket id. 62 | */ 63 | RIL_SOCKET_ID getSocketId(void) { 64 | return id; 65 | } 66 | 67 | virtual ~RilSocket(){} 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/libril/ril_event.h: -------------------------------------------------------------------------------- 1 | /* //device/libs/telephony/ril_event.h 2 | ** 3 | ** Copyright 2008, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | 18 | // Max number of fd's we watch at any one time. Increase if necessary. 19 | #define MAX_FD_EVENTS 8 20 | 21 | typedef void (*ril_event_cb)(int fd, short events, void *userdata); 22 | 23 | struct ril_event { 24 | struct ril_event *next; 25 | struct ril_event *prev; 26 | 27 | int fd; 28 | int index; 29 | bool persist; 30 | struct timeval timeout; 31 | ril_event_cb func; 32 | void *param; 33 | }; 34 | 35 | // Initialize internal data structs 36 | void ril_event_init(); 37 | 38 | // Initialize an event 39 | void ril_event_set(struct ril_event * ev, int fd, bool persist, ril_event_cb func, void * param); 40 | 41 | // Add event to watch list 42 | void ril_event_add(struct ril_event * ev); 43 | 44 | // Add timer event 45 | void ril_timer_add(struct ril_event * ev, struct timeval * tv); 46 | 47 | // Remove event from watch list 48 | void ril_event_del(struct ril_event * ev); 49 | 50 | // Event loop 51 | void ril_event_loop(); 52 | 53 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/libril/sap_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SAP_SERVICE_H 18 | #define SAP_SERVICE_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace sap { 26 | 27 | void registerService(const RIL_RadioFunctions *callbacks); 28 | void processResponse(MsgHeader *rsp, RilSapSocket *sapSocket); 29 | void processUnsolResponse(MsgHeader *rsp, RilSapSocket *sapSocket); 30 | 31 | } // namespace android 32 | 33 | #endif // RIL_SERVICE_H 34 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/librilutils/Android.bp: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Android Open Source Project 2 | 3 | cc_library { 4 | name: "librilutils", 5 | 6 | srcs: [ 7 | "librilutils.c", 8 | "record_stream.c", 9 | "proto/sap-api.proto", 10 | ], 11 | 12 | header_libs: ["ril_headers"], 13 | export_header_lib_headers: ["ril_headers"], 14 | 15 | cflags: [ 16 | "-Wall", 17 | "-Wextra", 18 | "-Werror", 19 | "-DPB_FIELD_32BIT" 20 | ], 21 | 22 | proto: { 23 | type: "nanopb-c-enable_malloc-32bit", 24 | export_proto_headers: true, 25 | }, 26 | 27 | vendor: true, 28 | } 29 | 30 | // Create java protobuf code 31 | java_library { 32 | name: "sap-api-java-static", 33 | srcs: ["proto/sap-api.proto"], 34 | proto: { 35 | type: "micro", 36 | }, 37 | } 38 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/librilutils/librilutils.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | uint64_t ril_nano_time() { 21 | struct timespec now; 22 | clock_gettime(CLOCK_MONOTONIC, &now); 23 | return now.tv_sec * 1000000000LL + now.tv_nsec; 24 | } 25 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/librilutils/proto/sap-api.options: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | MsgHeader.payload type:FT_POINTER 18 | RIL_SIM_SAP_APDU_REQ.command type:FT_POINTER 19 | RIL_SIM_SAP_APDU_RSP.apduResponse type:FT_POINTER 20 | RIL_SIM_SAP_TRANSFER_ATR_RSP.atr type:FT_POINTER 21 | 22 | #RIL_SIM_SAP_REQUEST.apdu type:FT_POINTER 23 | #RIL_SIM_SAP_RESPONSE.apdu type:FT_POINTER 24 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/reference-ril/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2006 The Android Open Source Project 2 | 3 | # XXX using libutils for simulator build only... 4 | # 5 | LOCAL_PATH:= $(call my-dir) 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_SRC_FILES:= \ 9 | reference-ril.c \ 10 | atchannel.c \ 11 | misc.c \ 12 | at_tok.c 13 | 14 | LOCAL_SHARED_LIBRARIES := \ 15 | liblog libcutils libutils libril librilutils 16 | 17 | LOCAL_STATIC_LIBRARIES := libqemu_pipe libbase 18 | 19 | # for asprinf 20 | LOCAL_CFLAGS := -D_GNU_SOURCE 21 | LOCAL_CFLAGS += -Wall -Wextra -Wno-unused-variable -Wno-unused-function -Werror 22 | 23 | LOCAL_C_INCLUDES := 24 | 25 | ifeq ($(TARGET_DEVICE),sooner) 26 | LOCAL_CFLAGS += -DUSE_TI_COMMANDS 27 | endif 28 | 29 | ifeq ($(TARGET_DEVICE),surf) 30 | LOCAL_CFLAGS += -DPOLL_CALL_STATE -DUSE_QMI 31 | endif 32 | 33 | ifeq ($(TARGET_DEVICE),dream) 34 | LOCAL_CFLAGS += -DPOLL_CALL_STATE -DUSE_QMI 35 | endif 36 | 37 | LOCAL_VENDOR_MODULE:= true 38 | 39 | ifeq (foo,foo) 40 | #build shared library 41 | LOCAL_SHARED_LIBRARIES += \ 42 | libcutils libutils 43 | LOCAL_CFLAGS += -DRIL_SHLIB 44 | LOCAL_MODULE:= libreference-ril 45 | include $(BUILD_SHARED_LIBRARY) 46 | else 47 | #build executable 48 | LOCAL_SHARED_LIBRARIES += \ 49 | libril 50 | LOCAL_MODULE:= reference-ril 51 | include $(BUILD_EXECUTABLE) 52 | endif 53 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/reference-ril/MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Android/ril/reference-ril/MODULE_LICENSE_APACHE2 -------------------------------------------------------------------------------- /doc/Modem/Android/ril/reference-ril/OWNERS: -------------------------------------------------------------------------------- 1 | amitmahajan@google.com 2 | jackyu@google.com 3 | rgreenwalt@google.com 4 | fionaxu@google.com 5 | jminjie@google.com 6 | mpq@google.com 7 | shuoq@google.com 8 | refuhoo@google.com 9 | bohu@google.com 10 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/reference-ril/at_tok.h: -------------------------------------------------------------------------------- 1 | /* //device/system/reference-ril/at_tok.h 2 | ** 3 | ** Copyright 2006, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | 18 | #ifndef AT_TOK_H 19 | #define AT_TOK_H 1 20 | 21 | int at_tok_start(char **p_cur); 22 | int at_tok_nextint(char **p_cur, int *p_out); 23 | int at_tok_nexthexint(char **p_cur, int *p_out); 24 | 25 | int at_tok_nextbool(char **p_cur, char *p_out); 26 | int at_tok_nextstr(char **p_cur, char **out); 27 | 28 | int at_tok_hasmore(char **p_cur); 29 | 30 | #endif /*AT_TOK_H */ 31 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/reference-ril/misc.c: -------------------------------------------------------------------------------- 1 | /* //device/system/reference-ril/misc.c 2 | ** 3 | ** Copyright 2006, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | #include 18 | 19 | #include "misc.h" 20 | /** returns 1 if line starts with prefix, 0 if it does not */ 21 | int strStartsWith(const char *line, const char *prefix) 22 | { 23 | for ( ; *line != '\0' && *prefix != '\0' ; line++, prefix++) { 24 | if (*line != *prefix) { 25 | return 0; 26 | } 27 | } 28 | 29 | return *prefix == '\0'; 30 | } 31 | 32 | // Returns true iff running this process in an emulator VM 33 | bool isInEmulator(void) { 34 | static int inQemu = -1; 35 | if (inQemu < 0) { 36 | char propValue[PROP_VALUE_MAX]; 37 | inQemu = (__system_property_get("ro.kernel.qemu", propValue) != 0); 38 | } 39 | return inQemu == 1; 40 | } 41 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/reference-ril/misc.h: -------------------------------------------------------------------------------- 1 | /* //device/system/reference-ril/misc.h 2 | ** 3 | ** Copyright 2006, The Android Open Source Project 4 | ** 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); 6 | ** you may not use this file except in compliance with the License. 7 | ** You may obtain a copy of the License at 8 | ** 9 | ** http://www.apache.org/licenses/LICENSE-2.0 10 | ** 11 | ** Unless required by applicable law or agreed to in writing, software 12 | ** distributed under the License is distributed on an "AS IS" BASIS, 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ** See the License for the specific language governing permissions and 15 | ** limitations under the License. 16 | */ 17 | #include 18 | 19 | /** returns 1 if line starts with prefix, 0 if it does not */ 20 | int strStartsWith(const char *line, const char *prefix); 21 | /** Returns true iff running this process in an emulator VM */ 22 | bool isInEmulator(void); -------------------------------------------------------------------------------- /doc/Modem/Android/ril/reference-ril/ril.h: -------------------------------------------------------------------------------- 1 | ../include/telephony/ril.h -------------------------------------------------------------------------------- /doc/Modem/Android/ril/rild/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2006 The Android Open Source Project 2 | 3 | ifndef ENABLE_VENDOR_RIL_SERVICE 4 | 5 | LOCAL_PATH:= $(call my-dir) 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_SRC_FILES:= \ 9 | rild.c 10 | 11 | LOCAL_SHARED_LIBRARIES := \ 12 | libcutils \ 13 | libdl \ 14 | liblog \ 15 | libril 16 | 17 | # Temporary hack for broken vendor RILs. 18 | LOCAL_WHOLE_STATIC_LIBRARIES := \ 19 | librilutils 20 | 21 | LOCAL_CFLAGS := -DRIL_SHLIB 22 | LOCAL_CFLAGS += -Wall -Wextra -Werror 23 | 24 | ifeq ($(SIM_COUNT), 2) 25 | LOCAL_CFLAGS += -DANDROID_MULTI_SIM 26 | LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 27 | endif 28 | 29 | LOCAL_MODULE_RELATIVE_PATH := hw 30 | LOCAL_PROPRIETARY_MODULE := true 31 | LOCAL_MODULE:= rild 32 | ifeq ($(PRODUCT_COMPATIBLE_PROPERTY),true) 33 | LOCAL_INIT_RC := rild.rc 34 | LOCAL_CFLAGS += -DPRODUCT_COMPATIBLE_PROPERTY 35 | else 36 | LOCAL_INIT_RC := rild.legacy.rc 37 | endif 38 | 39 | include $(BUILD_EXECUTABLE) 40 | 41 | endif 42 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/rild/MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Android/ril/rild/MODULE_LICENSE_APACHE2 -------------------------------------------------------------------------------- /doc/Modem/Android/ril/rild/rild.legacy.rc: -------------------------------------------------------------------------------- 1 | service ril-daemon /vendor/bin/hw/rild 2 | class main 3 | user radio 4 | group radio cache inet misc audio log readproc wakelock 5 | capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW 6 | -------------------------------------------------------------------------------- /doc/Modem/Android/ril/rild/rild.rc: -------------------------------------------------------------------------------- 1 | service vendor.ril-daemon /vendor/bin/hw/rild 2 | class main 3 | user radio 4 | group radio cache inet misc audio log readproc wakelock 5 | capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW 6 | -------------------------------------------------------------------------------- /doc/Modem/B78/B78_B_X0x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/B78/B78_B_X0x -------------------------------------------------------------------------------- /doc/Modem/B78/B78_B_X0x AT Command.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/B78/B78_B_X0x AT Command.pdf -------------------------------------------------------------------------------- /doc/Modem/B78/B78_B_X0x硬件接口手册.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/B78/B78_B_X0x硬件接口手册.pdf -------------------------------------------------------------------------------- /doc/Modem/Nodecom/GobiNet驱动加载手册_08162016-0001.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Nodecom/GobiNet驱动加载手册_08162016-0001.pdf -------------------------------------------------------------------------------- /doc/Modem/Nodecom/Nodecom_660_Linux_GobiNet_08182016-0001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Nodecom/Nodecom_660_Linux_GobiNet_08182016-0001.zip -------------------------------------------------------------------------------- /doc/Modem/Nodecom/fastboot-9x07.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Nodecom/fastboot-9x07.zip -------------------------------------------------------------------------------- /doc/Modem/Nodecom/hostproxy.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Nodecom/hostproxy.rar -------------------------------------------------------------------------------- /doc/Modem/Nodecom/hostproxy使用说明.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Nodecom/hostproxy使用说明.pdf -------------------------------------------------------------------------------- /doc/Modem/Simcom/SIM7500_SIM7600: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Simcom/SIM7500_SIM7600 -------------------------------------------------------------------------------- /doc/Modem/Simcom/SIM7500_SIM7600 Series_AT Command Manual_V1.01.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/Simcom/SIM7500_SIM7600 Series_AT Command Manual_V1.01.pdf -------------------------------------------------------------------------------- /doc/Modem/ZTE/中兴通讯: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/ZTE/中兴通讯 -------------------------------------------------------------------------------- /doc/Modem/ZTE/中兴通讯 ME3760 ZTE Linux操作系统驱动安装与加载.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/ZTE/中兴通讯 ME3760 ZTE Linux操作系统驱动安装与加载.pdf -------------------------------------------------------------------------------- /doc/Modem/ZTE/中兴通讯 ME3760模块产品AT命令集_V1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/ZTE/中兴通讯 ME3760模块产品AT命令集_V1.0.pdf -------------------------------------------------------------------------------- /doc/Modem/ZTE/中兴通讯 ME3760模块产品软件开发指导手册.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/ZTE/中兴通讯 ME3760模块产品软件开发指导手册.pdf -------------------------------------------------------------------------------- /doc/Modem/创益/专网模块03_LTE_Linux驱动安装与入网流程20160229.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/Modem/创益/专网模块03_LTE_Linux驱动安装与入网流程20160229.pdf -------------------------------------------------------------------------------- /doc/PPP/ppp-doc/闲谈PPP协议(一) PPP数据帧的格式.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/PPP/ppp-doc/闲谈PPP协议(一) PPP数据帧的格式.doc -------------------------------------------------------------------------------- /doc/PPP/ppp-doc/闲谈PPP协议(三)LCP报文.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/PPP/ppp-doc/闲谈PPP协议(三)LCP报文.doc -------------------------------------------------------------------------------- /doc/PPP/ppp-doc/闲谈PPP协议(二)PPP的状态转移.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/PPP/ppp-doc/闲谈PPP协议(二)PPP的状态转移.doc -------------------------------------------------------------------------------- /doc/PPP/pppd-script-2.2/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/PPP/pppd-script-2.2/README -------------------------------------------------------------------------------- /doc/PPP/pppd-script-2.2/chat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/PPP/pppd-script-2.2/chat -------------------------------------------------------------------------------- /doc/PPP/pppd-script-2.2/huawei-chat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/PPP/pppd-script-2.2/huawei-chat -------------------------------------------------------------------------------- /doc/PPP/pppd-script-2.2/huawei-ppp-off: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ###################################################################### 3 | # 4 | # Determine the device to be terminated. 5 | # Author: jiangyanfeng@gmail.com 6 | # Date: Apr-7,2008 7 | # 8 | #if [ "$1" = "" ]; then 9 | # echo "ERROR: Parameter error" 10 | # echo "eg: $0 /dev/ttyUSB0" 11 | # exit 1 12 | #else 13 | # DEVICE=$1 14 | #fi 15 | ###################################################################### 16 | # 17 | PID=`ps -ef | grep -v grep | grep "huawei-dial" | grep "pppd" | awk '{ print $2; exit }'` 18 | 19 | if test $PID; then 20 | kill -KILL $PID 21 | 22 | if [ ! "$?" = "0" ]; then 23 | echo "ERROR: Terminated ppp link to $DEVICE failed" 24 | exit 3 25 | fi 26 | # 27 | # Success. wait 3 seconds to let pppd clean up its own junk. 28 | echo "PPP link to $DEVICE terminated" 29 | exit 0 30 | fi 31 | # 32 | echo "ERROR: PPP link is not active on $DEVICE" 33 | exit 2 34 | -------------------------------------------------------------------------------- /doc/PPP/pppd-script-2.2/huawei-ppp-status: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # author: jiangyanfeng@gmail.com 3 | # date: 2008-05-07 4 | export LANG="en_US.UTF-8" 5 | if [ "$1" = "" ]; then 6 | DEVICE=/dev/ttyUSB0 7 | # echo "parameter error" 8 | # exit 1 9 | else 10 | DEVICE=$1 11 | fi 12 | 13 | PID=`ps -ef | grep -v grep | grep "huawei-dial" | grep "pppd" | awk '{ print $2; exit }'` 14 | 15 | if test $PID; then 16 | for P2P in `ifconfig | grep "Link encap" | awk '{ print $1 }'` 17 | do 18 | if test -e /var/run/$P2P.pid; then 19 | if test `cat /var/run/$P2P.pid` = $PID; then 20 | echo "connected" 21 | exit 0 22 | fi 23 | fi 24 | done 25 | echo "connecting" 26 | exit 3 27 | else 28 | echo "not connected" 29 | exit 2 30 | fi 31 | -------------------------------------------------------------------------------- /doc/PPP/pppd-script-2.2/ip-down: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # author:jiangyanfeng@gmail.com 3 | # data: 2007-08-04 4 | cp -f /etc/resolv.conf.local /etc/resolv.conf 5 | rm -f /etc/ppp/resolv.conf 6 | -------------------------------------------------------------------------------- /doc/PPP/pppd-script-2.2/ip-up: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # author:jiangyanfeng@gmail.com 3 | # data: 2007-08-04 4 | cp -f /etc/resolv.conf /etc/resolv.conf.local 5 | cp -f /etc/ppp/resolv.conf /etc/resolv.conf 6 | cat /etc/resolv.conf.local >> /etc/resolv.conf 7 | -------------------------------------------------------------------------------- /doc/PPP/pppd-script-2.2/log: -------------------------------------------------------------------------------- 1 | --pn*--pn=#777 2 | abort on (NO CARRIER) 3 | abort on (NO DIALTONE) 4 | abort on (ERROR) 5 | abort on (NO ANSWER) 6 | abort on (BUSY) 7 | timeout set to 120 seconds 8 | abort on (Username/Password Incorrect) 9 | send (AT^M) 10 | -- write timed out 11 | Failed 12 | Script /usr/sbin/chat -s -v -f /etc/ppp/huawei-chat finished (pid 23968), status = 0x1 13 | Connect script failed 14 | -------------------------------------------------------------------------------- /doc/PPP/pppd-script-2.2/pppd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/PPP/pppd-script-2.2/pppd -------------------------------------------------------------------------------- /doc/PPP/pppd.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/PPP/pppd.docx -------------------------------------------------------------------------------- /doc/PPP/pppd_daild/4G_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "init 4G...." 4 | #insmod /dav/usbserial.ko 5 | #insmod /dav/usb_wwan.ko 6 | #insmod /dav/option.ko 7 | mkdir -p /home/peers 8 | mv /home/DIALD /home/peers 9 | #mv /home/chat /bin/ 10 | cp chat /sbin/ 11 | cp chat /bin/ 12 | cp DIALD /home/peers/ 13 | cp chat-connect /home/ 14 | pppd call pppd_param & -------------------------------------------------------------------------------- /doc/PPP/pppd_daild/chat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/PPP/pppd_daild/chat -------------------------------------------------------------------------------- /doc/PPP/pppd_daild/chat-connect: -------------------------------------------------------------------------------- 1 | ABORT "NO CARRIER" 2 | ABORT "NO DIALTONE" 3 | ABORT "ERROR" 4 | ABORT "NO ANSWER" 5 | ABORT "BUSY" 6 | TIMEOUT 120 7 | ""at 8 | #目前基线支持配置了自动APN,在专网情况下把自动APN关闭。 9 | OK AT+NVRW=1,50058,"00" 10 | #如果是专网/VPDN则都设置为专网/VPDN的APN,但有时需要将第一个设置为公网的,第二个设置为专网的APN。 11 | #OK AT+CGDCONT=1,"IP","cmnet" 12 | #OK AT+CGDCONT=2,"IP","cmnet" 13 | #第二个数字代表当前使用的chap还是pap,如果pap填1,chap填2 14 | #OK AT$QCPDPP=1,2,"card","card" 15 | #OK AT$QCPDPP=1,2,"card","card" 16 | #拨号号码,如果是专网,在客户没有特殊的情况下,4G模式拨号号码填*99***2#,电信3G填#777 17 | OK atd*98*1# 18 | CONNECT -------------------------------------------------------------------------------- /doc/PPP/pppd_daild/pppd_param: -------------------------------------------------------------------------------- 1 | debug 2 | nodetach 3 | /dev/ttyUSB2 4 | 115200 5 | crtscts 6 | show-password 7 | usepeerdns 8 | #refuse-pap 9 | #refuse-eap 10 | #auth 11 | #require-chap 12 | refuse-pap 13 | refuse-eap 14 | auth 15 | require-chap 16 | user "user" 17 | password "user" 18 | noauth 19 | noipdefault 20 | novj 21 | novjccomp 22 | noccp 23 | defaultroute 24 | ipcp-accept-local 25 | ipcp-accept-remote 26 | connect 'chat -s -v -f /home/chat-connect' 27 | disconnect 'chat -s -v -f /home/chat-disconnect' -------------------------------------------------------------------------------- /doc/PPP/pppd_script/ppp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # An unforunate wrapper script 3 | # so that the exit code of pppd may be retrieved 4 | 5 | 6 | # this is a workaround for issue #651747 7 | #trap "/system/bin/sleep 1;exit 0" TERM 8 | 9 | 10 | PPPD_PID= 11 | 12 | #/system/bin/setprop "net.gprs.ppp-exit" "" 13 | 14 | #/system/bin/log -t pppd "Starting pppd" 15 | 16 | #/system/xbin/pppd $* 17 | # pppd was put into /system/bin instead of /system/xbin after SDK1.6 18 | /bin/pppd connect 'chat -v -s -r "/var/log/chat.log" -f "/etc/ppp/pppdata_call.conf"' disconnect 'chat -r "/var/log/chat.log" -t 30 -e -v "" +++ATH "NO CARRIER"' /dev/ttyUSB2 115200 mru 1280 mtu 1280 nodetach debug dump defaultroute usepeerdns novj novjccomp noipdefault ipcp-accept-local ipcp-accept-remote connect-delay 5000 linkname ppp0 19 | 20 | PPPD_EXIT=$? 21 | PPPD_PID=$! 22 | 23 | #/bin/log -t pppd "pppd exited with $PPPD_EXIT" 24 | 25 | #/system/bin/setprop "net.gprs.ppp-exit" "$PPPD_EXIT" 26 | -------------------------------------------------------------------------------- /doc/PPP/pppd_script/pppdata_call.conf: -------------------------------------------------------------------------------- 1 | ABORT 'BUSY' 2 | ABORT 'NO CARRIER' 3 | ABORT 'ERROR' 4 | ABORT '+CME ERROR: 100' 5 | TIMEOUT 8 6 | "" AT 7 | OK 'ATD*98*1#' 8 | CONNECT -------------------------------------------------------------------------------- /doc/PPP/pppd_script/readme.txt: -------------------------------------------------------------------------------- 1 | put the file pppdata_call.conf to the directory /etc/ppp/ 2 | running ppp.sh -------------------------------------------------------------------------------- /doc/VPDN/(5.2)运营商的VPDN服务【全业务组网砖家指引】.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/(5.2)运营商的VPDN服务【全业务组网砖家指引】.pdf -------------------------------------------------------------------------------- /doc/VPDN/2-4G-VPDN技术方案分析.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/2-4G-VPDN技术方案分析.ppt -------------------------------------------------------------------------------- /doc/VPDN/34G无线视频整体解决方案(完整版)20151108.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/34G无线视频整体解决方案(完整版)20151108.pdf -------------------------------------------------------------------------------- /doc/VPDN/4G-LTE移动物联网实验室方案PPT.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/4G-LTE移动物联网实验室方案PPT.pptx -------------------------------------------------------------------------------- /doc/VPDN/4G-VPDN业务中终端不能上传账号的问题分析.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/4G-VPDN业务中终端不能上传账号的问题分析.docx -------------------------------------------------------------------------------- /doc/VPDN/4G无线视频传输系统方案.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/4G无线视频传输系统方案.doc -------------------------------------------------------------------------------- /doc/VPDN/4G联网方案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/4G联网方案.pdf -------------------------------------------------------------------------------- /doc/VPDN/CGIC简明教程目录(CGI篇).doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/CGIC简明教程目录(CGI篇).doc -------------------------------------------------------------------------------- /doc/VPDN/H3C-4G路由器解决方案.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/H3C-4G路由器解决方案.pptx -------------------------------------------------------------------------------- /doc/VPDN/LTE-EPC核心网组网及关键技术.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/LTE-EPC核心网组网及关键技术.pdf -------------------------------------------------------------------------------- /doc/VPDN/LTE新技术-EPC网络架构及关键技术.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/LTE新技术-EPC网络架构及关键技术.pptx -------------------------------------------------------------------------------- /doc/VPDN/LTE新技术培训-核心网专业第二部分.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/LTE新技术培训-核心网专业第二部分.pdf -------------------------------------------------------------------------------- /doc/VPDN/LTE核心网EPC专题.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/LTE核心网EPC专题.ppt -------------------------------------------------------------------------------- /doc/VPDN/LTE核心网关键技术.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/LTE核心网关键技术.pdf -------------------------------------------------------------------------------- /doc/VPDN/LTE核心网网络架构及关键技术20110614.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/LTE核心网网络架构及关键技术20110614.ppt -------------------------------------------------------------------------------- /doc/VPDN/Linux下编译静态库和动态库.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/Linux下编译静态库和动态库.pdf -------------------------------------------------------------------------------- /doc/VPDN/VPDN.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/VPDN.docx -------------------------------------------------------------------------------- /doc/VPDN/VPDN业务介绍.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/VPDN业务介绍.ppt -------------------------------------------------------------------------------- /doc/VPDN/VPDN原理、实现及配置.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/VPDN原理、实现及配置.ppt -------------------------------------------------------------------------------- /doc/VPDN/VPN网络常见问题解答.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/VPN网络常见问题解答.ppt -------------------------------------------------------------------------------- /doc/VPDN/上海电信VPDN解决方案200503.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/上海电信VPDN解决方案200503.ppt -------------------------------------------------------------------------------- /doc/VPDN/中国电信EPC承载方案V0.8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/中国电信EPC承载方案V0.8.pdf -------------------------------------------------------------------------------- /doc/VPDN/中国电信无线宽带VPDN业务数据配置规范V1[1].0.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/中国电信无线宽带VPDN业务数据配置规范V1[1].0.doc -------------------------------------------------------------------------------- /doc/VPDN/中国移动4G车联网整体解决方案.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/中国移动4G车联网整体解决方案.pptx -------------------------------------------------------------------------------- /doc/VPDN/嵌入式C语言开发教程之用c写CGI-程序简要指南.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/嵌入式C语言开发教程之用c写CGI-程序简要指南.pptx -------------------------------------------------------------------------------- /doc/VPDN/核心网基础知识简介.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/核心网基础知识简介.ppt -------------------------------------------------------------------------------- /doc/VPDN/法院检察院-4G高清移动执法、现场应急无线图传应用方案-v2.10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/法院检察院-4G高清移动执法、现场应急无线图传应用方案-v2.10.pdf -------------------------------------------------------------------------------- /doc/VPDN/物联网4G专网标准解决方案v3.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/物联网4G专网标准解决方案v3.docx -------------------------------------------------------------------------------- /doc/VPDN/电信M-VPDN多模块行业网关解决方案.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/电信M-VPDN多模块行业网关解决方案.ppt -------------------------------------------------------------------------------- /doc/VPDN/简单概述APN-VPDN实现GPRS-DTU无线数传方案.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/简单概述APN-VPDN实现GPRS-DTU无线数传方案.doc -------------------------------------------------------------------------------- /doc/VPDN/综合VPDN实现方案技术探讨.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/综合VPDN实现方案技术探讨.docx -------------------------------------------------------------------------------- /doc/VPDN/综治通-中兴N818-vpdn设置方法.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/综治通-中兴N818-vpdn设置方法.doc -------------------------------------------------------------------------------- /doc/VPDN/运钞车视频监控系统方案.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/运钞车视频监控系统方案.doc -------------------------------------------------------------------------------- /doc/VPDN/远程视频监控系统系统方案.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/doc/VPDN/远程视频监控系统系统方案.doc -------------------------------------------------------------------------------- /src/errno.cc: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright (c) 2017-2021, luotang.me , China. 4 | * All rights reserved. 5 | * 6 | * Distributed under the terms of the GNU General Public License v2. 7 | * 8 | * This software is provided 'as is' with no explicit or implied warranties 9 | * in respect of its properties, including, but not limited to, correctness 10 | * and/or fitness for purpose. 11 | * 12 | **************************************************************************/ 13 | #include "errno.h" 14 | 15 | namespace mobile { 16 | 17 | static const std::string kMobileErrnoString[] = { 18 | "MOBILE_STATE_INIT", /* mobile init state*/ 19 | "DRIVER_NOT_INSTALLED", /* lsmod driver in /proc/moudules not installed */ 20 | "DRIVER_ID_NOT_FOUND", /* lsusb show id file not found*/ 21 | "DRIVER_ID_NOT_SUPPORT", /* lsusb show id not supported for app*/ 22 | "TTYUSB_NOT_FOUND", /* ttyUSB not exist */ 23 | "TTYUSB_OPEN_FAIL", /* ttyUSB AT intf open failed */ 24 | "TTYUSB_UNAVAILABLE", /* ttyUSB can be opened, but at(AT+CGMM) is blocked*/ 25 | "TTYUSB_AVAILABLE", /* ttyUSB AT intf test successful*/ 26 | "SIM_NOT_RECOGNOSE", /* SIM is not supported*/ 27 | "SIM_NOT_INSERT", /* SIM is not inerted*/ 28 | "SIM_NOT_FASTED", /* SIM is not fasted*/ 29 | "SIM_COMES_READY", /* SIM is ready*/ 30 | "SIM_COMES_LOCKED", /* SIM need pin or puk */ 31 | "SIM_OPER_UNKNOWN", /* SIM operator unknown */ 32 | "SIM_RECOGNOSED", /* SIM is ready and operator is known*/ 33 | }; 34 | 35 | const std::string &StrMobileErrno(MobileErrno e) { 36 | return kMobileErrnoString[e]; 37 | } 38 | 39 | } // namespace mobile 40 | -------------------------------------------------------------------------------- /src/huawei/ModemHuawei.h: -------------------------------------------------------------------------------- 1 | /* Connect 3GPP */ 2 | 3 | typedef enum { 4 | CONNECT_3GPP_CONTEXT_STEP_FIRST = 0, 5 | CONNECT_3GPP_CONTEXT_STEP_NDISDUP, 6 | CONNECT_3GPP_CONTEXT_STEP_NDISSTATQRY, 7 | CONNECT_3GPP_CONTEXT_STEP_IP_CONFIG, 8 | CONNECT_3GPP_CONTEXT_STEP_LAST 9 | } Connect3gppContextStep; 10 | 11 | // ^DHCP -------------------------------------------------------------------------------- /src/mobile.proto: -------------------------------------------------------------------------------- 1 | syntax="proto3"; 2 | package mobile; 3 | 4 | option cc_generic_services = true; 5 | 6 | message MobileAPNRequest { 7 | uint32 cid = 2; 8 | }; 9 | 10 | message MobileAPNResponse { 11 | string apn = 1; 12 | uint32 cid = 2; 13 | uint32 type = 3; 14 | }; 15 | 16 | message MobileDialRequest { 17 | 18 | }; 19 | 20 | message MobileDialResponse { 21 | 22 | }; 23 | 24 | service GetMobileAPNService { 25 | rpc MobileDial(MobileDialRequest) returns (MobileDialResponse); 26 | rpc GetMobileAPN(MobileAPNRequest) returns (MobileAPNResponse); 27 | rpc SetMobileAPN(MobileAPNRequest) returns (MobileAPNResponse); 28 | }; 29 | -------------------------------------------------------------------------------- /src/service.cc: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright (c) 2017-2021, luotang.me , China. 4 | * All rights reserved. 5 | * 6 | * Distributed under the terms of the GNU General Public License v2. 7 | * 8 | * This software is provided 'as is' with no explicit or implied warranties 9 | * in respect of its properties, including, but not limited to, correctness 10 | * and/or fitness for purpose. 11 | * 12 | **************************************************************************/ 13 | #include "service.h" 14 | 15 | using namespace MSF; 16 | 17 | namespace mobile { 18 | 19 | MobileServiceImpl::MobileServiceImpl(int echo_delay, 20 | const std::string& fail_reason) 21 | : echo_delay_(echo_delay), fail_reason_(fail_reason) {} 22 | 23 | void MobileServiceImpl::GetMobileAPN( 24 | google::protobuf::RpcController* controller, 25 | const mobile::MobileAPNRequest* request, 26 | mobile::MobileAPNResponse* response, google::protobuf::Closure* done) { 27 | if (fail_reason_.empty()) { 28 | // response->set_response(request->message()); 29 | // Fill response. 30 | response->set_apn("public.vpdn.cn"); 31 | response->set_cid(request->cid()); 32 | response->set_type(1); 33 | } else { 34 | controller->SetFailed(fail_reason_); 35 | } 36 | 37 | if (echo_delay_ > 0) { 38 | // ::sleep(echo_delay_); 39 | } 40 | 41 | done->Run(); 42 | } 43 | } // namespace mobile -------------------------------------------------------------------------------- /src/service.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright (c) 2017-2021, luotang.me , China. 4 | * All rights reserved. 5 | * 6 | * Distributed under the terms of the GNU General Public License v2. 7 | * 8 | * This software is provided 'as is' with no explicit or implied warranties 9 | * in respect of its properties, including, but not limited to, correctness 10 | * and/or fitness for purpose. 11 | * 12 | **************************************************************************/ 13 | #ifndef ECHOTESTSERVER_HPP 14 | #define ECHOTESTSERVER_HPP 15 | 16 | #include 17 | 18 | #include 19 | 20 | #include "mobile.pb.h" 21 | 22 | using namespace MSF; 23 | 24 | namespace mobile { 25 | 26 | class MobileServiceImpl : public mobile::GetMobileAPNService { 27 | public: 28 | MobileServiceImpl(int echo_delay, 29 | const std::string& fail_reason = std::string()); 30 | virtual void GetMobileAPN(google::protobuf::RpcController* controller, 31 | const mobile::MobileAPNRequest* request, 32 | mobile::MobileAPNResponse* response, 33 | google::protobuf::Closure* done); 34 | 35 | private: 36 | // echo delay in seconds 37 | int echo_delay_; 38 | 39 | // if not empty, send an error response 40 | std::string fail_reason_; 41 | }; 42 | } // namespace mobile 43 | 44 | #endif /* ECHOTESTSERVER_HPP */ 45 | -------------------------------------------------------------------------------- /src/token.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright (c) 2017, luotang.me , China. 4 | * All rights reserved. 5 | * 6 | * Distributed under the terms of the GNU General Public License v2. 7 | * 8 | * This software is provided 'as is' with no explicit or implied warranties 9 | * in respect of its properties, including, but not limited to, correctness 10 | * and/or fitness for purpose. 11 | * 12 | **************************************************************************/ 13 | #ifndef MOBILE_APP_ATTOK_H 14 | #define MOBILE_APP_ATTOK_H 15 | 16 | namespace mobile { 17 | 18 | int AtTokStart(char **p_cur); 19 | int AtTokNextInt(char **p_cur, int *p_out); 20 | int AtTokNextHexInt(char **p_cur, int *p_out); 21 | int AtTokNextBool(char **p_cur, char *p_out); 22 | int AtTokNextStr(char **p_cur, char **out); 23 | int AtTokNextHasMore(char **p_cur); 24 | int AtStrStartWith(const char *line, const char *prefix); 25 | char *AtFindNextEOL(char *cur); 26 | 27 | } // namespace mobile 28 | #endif 29 | -------------------------------------------------------------------------------- /src/unicode.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Copyright (c) 2017-2021, luotang.me , China. 4 | * All rights reserved. 5 | * 6 | * Distributed under the terms of the GNU General Public License v2. 7 | * 8 | * This software is provided 'as is' with no explicit or implied warranties 9 | * in respect of its properties, including, but not limited to, correctness 10 | * and/or fitness for purpose. 11 | * 12 | **************************************************************************/ 13 | #ifndef MOBILE_SRC_UNICODE_H_ 14 | #define MOBILE_SRC_UNICODE_H_ 15 | 16 | #include 17 | 18 | namespace mobile { 19 | 20 | uint32_t StrUnicode2GB(const char *src, char *dst, uint32_t n); 21 | uint32_t StrGB2Unicode(const char *str, char *dst, uint32_t n); 22 | 23 | } // namespace mobile 24 | #endif -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | ############################# 2 | # Makefile for pppd chat process 3 | # by luotang 4 | # 2017.7.30 5 | ############################# 6 | ROOTDIR = ../../.. 7 | include $(ROOTDIR)/Rules.make 8 | 9 | DIR_ppp = src/ppp-2.4.7 10 | 11 | INCPATH =$(ROOTDIR)/inc 12 | LIBPATH =$(ROOTDIR)/lib 13 | 14 | all:make_ppp 15 | 16 | make_ppp: 17 | rm -rf bin/* 18 | cd $(DIR_ppp) && chmod -R 777 * && \ 19 | mkdir -p bin && \ 20 | ./configure --prefix="$(PWD)/bin" && \ 21 | make clean && \ 22 | make CC=$(CC) && \ 23 | make install 24 | #$(STRIP) -x -R .note -R .comment bin/sbin/pppd 25 | #$(STRIP) -x -R .note -R .comment bin/sbin/chat 26 | clean: 27 | cd $(DIR_ppp) && make clean 28 | rm -rf lib/* 29 | -------------------------------------------------------------------------------- /tools/bin/include/pppd/ccp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ccp.h - Definitions for PPP Compression Control Protocol. 3 | * 4 | * Copyright (c) 1994-2002 Paul Mackerras. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. The name(s) of the authors of this software must not be used to 14 | * endorse or promote products derived from this software without 15 | * prior written permission. 16 | * 17 | * 3. Redistributions of any form whatsoever must retain the following 18 | * acknowledgment: 19 | * "This product includes software developed by Paul Mackerras 20 | * ". 21 | * 22 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 23 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 24 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 25 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 26 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 27 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 28 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 29 | * 30 | * $Id: ccp.h,v 1.12 2004/11/04 10:02:26 paulus Exp $ 31 | */ 32 | 33 | typedef struct ccp_options { 34 | bool bsd_compress; /* do BSD Compress? */ 35 | bool deflate; /* do Deflate? */ 36 | bool predictor_1; /* do Predictor-1? */ 37 | bool predictor_2; /* do Predictor-2? */ 38 | bool deflate_correct; /* use correct code for deflate? */ 39 | bool deflate_draft; /* use draft RFC code for deflate? */ 40 | u_char mppe; /* MPPE bitfield */ 41 | u_short bsd_bits; /* # bits/code for BSD Compress */ 42 | u_short deflate_size; /* lg(window size) for Deflate */ 43 | short method; /* code for chosen compression method */ 44 | } ccp_options; 45 | 46 | extern fsm ccp_fsm[]; 47 | extern ccp_options ccp_wantoptions[]; 48 | extern ccp_options ccp_gotoptions[]; 49 | extern ccp_options ccp_allowoptions[]; 50 | extern ccp_options ccp_hisoptions[]; 51 | 52 | extern struct protent ccp_protent; 53 | -------------------------------------------------------------------------------- /tools/bin/include/pppd/ecp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ecp.h - Definitions for PPP Encryption Control Protocol. 3 | * 4 | * Copyright (c) 2002 Google, Inc. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in 16 | * the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * 3. The name(s) of the authors of this software must not be used to 20 | * endorse or promote products derived from this software without 21 | * prior written permission. 22 | * 23 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 24 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 25 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 26 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 27 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 28 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 29 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 30 | * 31 | * $Id: ecp.h,v 1.2 2003/01/10 07:12:36 fcusack Exp $ 32 | */ 33 | 34 | typedef struct ecp_options { 35 | bool required; /* Is ECP required? */ 36 | unsigned enctype; /* Encryption type */ 37 | } ecp_options; 38 | 39 | extern fsm ecp_fsm[]; 40 | extern ecp_options ecp_wantoptions[]; 41 | extern ecp_options ecp_gotoptions[]; 42 | extern ecp_options ecp_allowoptions[]; 43 | extern ecp_options ecp_hisoptions[]; 44 | 45 | extern struct protent ecp_protent; 46 | -------------------------------------------------------------------------------- /tools/bin/include/pppd/ipv6cp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/include/pppd/ipv6cp.h -------------------------------------------------------------------------------- /tools/bin/include/pppd/magic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * magic.h - PPP Magic Number definitions. 3 | * 4 | * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The name "Carnegie Mellon University" must not be used to 19 | * endorse or promote products derived from this software without 20 | * prior written permission. For permission or any legal 21 | * details, please contact 22 | * Office of Technology Transfer 23 | * Carnegie Mellon University 24 | * 5000 Forbes Avenue 25 | * Pittsburgh, PA 15213-3890 26 | * (412) 268-4387, fax: (412) 268-7395 27 | * tech-transfer@andrew.cmu.edu 28 | * 29 | * 4. Redistributions of any form whatsoever must retain the following 30 | * acknowledgment: 31 | * "This product includes software developed by Computing Services 32 | * at Carnegie Mellon University (http://www.cmu.edu/computing/)." 33 | * 34 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 35 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 36 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 37 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 38 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 39 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 40 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 41 | * 42 | * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $ 43 | */ 44 | 45 | void magic_init __P((void)); /* Initialize the magic number generator */ 46 | u_int32_t magic __P((void)); /* Returns the next magic number */ 47 | 48 | /* Fill buffer with random bytes */ 49 | void random_bytes __P((unsigned char *buf, int len)); 50 | -------------------------------------------------------------------------------- /tools/bin/include/pppd/md4.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | ** ******************************************************************** 4 | ** md4.h -- Header file for implementation of ** 5 | ** MD4 Message Digest Algorithm ** 6 | ** Updated: 2/13/90 by Ronald L. Rivest ** 7 | ** (C) 1990 RSA Data Security, Inc. ** 8 | ** ******************************************************************** 9 | */ 10 | 11 | #ifndef __P 12 | # if defined(__STDC__) || defined(__GNUC__) 13 | # define __P(x) x 14 | # else 15 | # define __P(x) () 16 | # endif 17 | #endif 18 | 19 | 20 | /* MDstruct is the data structure for a message digest computation. 21 | */ 22 | typedef struct { 23 | unsigned int buffer[4]; /* Holds 4-word result of MD computation */ 24 | unsigned char count[8]; /* Number of bits processed so far */ 25 | unsigned int done; /* Nonzero means MD computation finished */ 26 | } MD4_CTX; 27 | 28 | /* MD4Init(MD4_CTX *) 29 | ** Initialize the MD4_CTX prepatory to doing a message digest 30 | ** computation. 31 | */ 32 | extern void MD4Init __P((MD4_CTX *MD)); 33 | 34 | /* MD4Update(MD,X,count) 35 | ** Input: X -- a pointer to an array of unsigned characters. 36 | ** count -- the number of bits of X to use (an unsigned int). 37 | ** Updates MD using the first "count" bits of X. 38 | ** The array pointed to by X is not modified. 39 | ** If count is not a multiple of 8, MD4Update uses high bits of 40 | ** last byte. 41 | ** This is the basic input routine for a user. 42 | ** The routine terminates the MD computation when count < 512, so 43 | ** every MD computation should end with one call to MD4Update with a 44 | ** count less than 512. Zero is OK for a count. 45 | */ 46 | extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count)); 47 | 48 | /* MD4Print(MD) 49 | ** Prints message digest buffer MD as 32 hexadecimal digits. 50 | ** Order is from low-order byte of buffer[0] to high-order byte 51 | ** of buffer[3]. 52 | ** Each byte is printed with high-order hexadecimal digit first. 53 | */ 54 | extern void MD4Print __P((MD4_CTX *)); 55 | 56 | /* MD4Final(buf, MD) 57 | ** Returns message digest from MD and terminates the message 58 | ** digest computation. 59 | */ 60 | extern void MD4Final __P((unsigned char *, MD4_CTX *)); 61 | 62 | /* 63 | ** End of md4.h 64 | ****************************(cut)***********************************/ 65 | -------------------------------------------------------------------------------- /tools/bin/include/pppd/patchlevel.h: -------------------------------------------------------------------------------- 1 | #define VERSION "2.4.7" 2 | #define DATE "9 August 2014" 3 | -------------------------------------------------------------------------------- /tools/bin/include/pppd/pathnames.h: -------------------------------------------------------------------------------- 1 | /* 2 | * define path names 3 | * 4 | * $Id: pathnames.h,v 1.18 2005/08/25 23:59:34 paulus Exp $ 5 | */ 6 | 7 | #ifdef HAVE_PATHS_H 8 | #include 9 | 10 | #else /* HAVE_PATHS_H */ 11 | #ifndef _PATH_VARRUN 12 | #define _PATH_VARRUN "/etc/ppp/" 13 | #endif 14 | #define _PATH_DEVNULL "/dev/null" 15 | #endif /* HAVE_PATHS_H */ 16 | 17 | #ifndef _ROOT_PATH 18 | #define _ROOT_PATH 19 | #endif 20 | 21 | #define _PATH_UPAPFILE _ROOT_PATH "/etc/ppp/pap-secrets" 22 | #define _PATH_CHAPFILE _ROOT_PATH "/etc/ppp/chap-secrets" 23 | #define _PATH_SRPFILE _ROOT_PATH "/etc/ppp/srp-secrets" 24 | #define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options" 25 | #define _PATH_IPUP _ROOT_PATH "/etc/ppp/ip-up" 26 | #define _PATH_IPDOWN _ROOT_PATH "/etc/ppp/ip-down" 27 | #define _PATH_IPPREUP _ROOT_PATH "/etc/ppp/ip-pre-up" 28 | #define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up" 29 | #define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down" 30 | #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options." 31 | #define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors" 32 | #define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/" 33 | #define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf" 34 | 35 | #define _PATH_USEROPT ".ppprc" 36 | #define _PATH_PSEUDONYM ".ppp_pseudonym" 37 | 38 | #ifdef INET6 39 | #define _PATH_IPV6UP _ROOT_PATH "/etc/ppp/ipv6-up" 40 | #define _PATH_IPV6DOWN _ROOT_PATH "/etc/ppp/ipv6-down" 41 | #endif 42 | 43 | #ifdef IPX_CHANGE 44 | #define _PATH_IPXUP _ROOT_PATH "/etc/ppp/ipx-up" 45 | #define _PATH_IPXDOWN _ROOT_PATH "/etc/ppp/ipx-down" 46 | #endif /* IPX_CHANGE */ 47 | 48 | #ifdef __STDC__ 49 | #define _PATH_PPPDB _ROOT_PATH _PATH_VARRUN "pppd2.tdb" 50 | #else /* __STDC__ */ 51 | #ifdef HAVE_PATHS_H 52 | #define _PATH_PPPDB "/var/run/pppd2.tdb" 53 | #else 54 | #define _PATH_PPPDB "/etc/ppp/pppd2.tdb" 55 | #endif 56 | #endif /* __STDC__ */ 57 | 58 | #ifdef PLUGIN 59 | #ifdef __STDC__ 60 | #define _PATH_PLUGIN DESTDIR "/lib/pppd/" VERSION 61 | #else /* __STDC__ */ 62 | #define _PATH_PLUGIN "/usr/lib/pppd" 63 | #endif /* __STDC__ */ 64 | 65 | #endif /* PLUGIN */ 66 | -------------------------------------------------------------------------------- /tools/bin/include/pppd/pppcrypt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1 3 | * 4 | * Extracted from chap_ms.c by James Carlson. 5 | * 6 | * Copyright (c) 1995 Eric Rosenquist. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. The name(s) of the authors of this software must not be used to 21 | * endorse or promote products derived from this software without 22 | * prior written permission. 23 | * 24 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 25 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 26 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 27 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 28 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 29 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 30 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 31 | */ 32 | 33 | #ifndef PPPCRYPT_H 34 | #define PPPCRYPT_H 35 | 36 | #ifdef HAVE_CRYPT_H 37 | #include 38 | #endif 39 | 40 | #ifndef USE_CRYPT 41 | #include 42 | #endif 43 | 44 | extern bool DesSetkey __P((u_char *)); 45 | extern bool DesEncrypt __P((u_char *, u_char *)); 46 | extern bool DesDecrypt __P((u_char *, u_char *)); 47 | 48 | #endif /* PPPCRYPT_H */ 49 | -------------------------------------------------------------------------------- /tools/bin/include/pppd/sha1.h: -------------------------------------------------------------------------------- 1 | /* sha1.h */ 2 | 3 | /* If OpenSSL is in use, then use that version of SHA-1 */ 4 | #ifdef OPENSSL 5 | #include 6 | #define __SHA1_INCLUDE_ 7 | #endif 8 | 9 | #ifndef __SHA1_INCLUDE_ 10 | 11 | #ifndef SHA1_SIGNATURE_SIZE 12 | #ifdef SHA_DIGESTSIZE 13 | #define SHA1_SIGNATURE_SIZE SHA_DIGESTSIZE 14 | #else 15 | #define SHA1_SIGNATURE_SIZE 20 16 | #endif 17 | #endif 18 | 19 | typedef struct { 20 | u_int32_t state[5]; 21 | u_int32_t count[2]; 22 | unsigned char buffer[64]; 23 | } SHA1_CTX; 24 | 25 | extern void SHA1_Init(SHA1_CTX *); 26 | extern void SHA1_Update(SHA1_CTX *, const unsigned char *, unsigned int); 27 | extern void SHA1_Final(unsigned char[SHA1_SIGNATURE_SIZE], SHA1_CTX *); 28 | 29 | #define __SHA1_INCLUDE_ 30 | #endif /* __SHA1_INCLUDE_ */ 31 | 32 | -------------------------------------------------------------------------------- /tools/bin/include/pppd/spinlock.h: -------------------------------------------------------------------------------- 1 | #ifndef __SPINLOCK_H__ 2 | #define __SPINLOCK_H__ 3 | 4 | #ifdef HAVE_CONFIG_H 5 | #include 6 | #endif 7 | 8 | #include "tdb.h" 9 | 10 | #ifdef USE_SPINLOCKS 11 | 12 | #define RWLOCK_BIAS 0x1000UL 13 | 14 | /* OS SPECIFIC */ 15 | #define MAX_BUSY_LOOPS 1000 16 | #undef USE_SCHED_YIELD 17 | 18 | /* ARCH SPECIFIC */ 19 | /* We should make sure these are padded to a cache line */ 20 | #if defined(SPARC_SPINLOCKS) 21 | typedef volatile char spinlock_t; 22 | #elif defined(POWERPC_SPINLOCKS) 23 | typedef volatile unsigned long spinlock_t; 24 | #elif defined(INTEL_SPINLOCKS) 25 | typedef volatile int spinlock_t; 26 | #elif defined(MIPS_SPINLOCKS) 27 | typedef volatile unsigned long spinlock_t; 28 | #else 29 | #error Need to implement spinlock code in spinlock.h 30 | #endif 31 | 32 | typedef struct { 33 | spinlock_t lock; 34 | volatile int count; 35 | } tdb_rwlock_t; 36 | 37 | int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type); 38 | int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type); 39 | int tdb_create_rwlocks(int fd, unsigned int hash_size); 40 | int tdb_clear_spinlocks(TDB_CONTEXT *tdb); 41 | 42 | #define TDB_SPINLOCK_SIZE(hash_size) (((hash_size) + 1) * sizeof(tdb_rwlock_t)) 43 | 44 | #else /* !USE_SPINLOCKS */ 45 | #if 0 46 | #define tdb_create_rwlocks(fd, hash_size) 0 47 | #define tdb_spinlock(tdb, list, rw_type) (-1) 48 | #define tdb_spinunlock(tdb, list, rw_type) (-1) 49 | #else 50 | int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type); 51 | int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type); 52 | int tdb_create_rwlocks(int fd, unsigned int hash_size); 53 | #endif 54 | int tdb_clear_spinlocks(TDB_CONTEXT *tdb); 55 | #define TDB_SPINLOCK_SIZE(hash_size) 0 56 | 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /tools/bin/lib/pppd/2.4.7/minconn.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/lib/pppd/2.4.7/minconn.so -------------------------------------------------------------------------------- /tools/bin/lib/pppd/2.4.7/openl2tp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/lib/pppd/2.4.7/openl2tp.so -------------------------------------------------------------------------------- /tools/bin/lib/pppd/2.4.7/passprompt.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/lib/pppd/2.4.7/passprompt.so -------------------------------------------------------------------------------- /tools/bin/lib/pppd/2.4.7/passwordfd.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/lib/pppd/2.4.7/passwordfd.so -------------------------------------------------------------------------------- /tools/bin/lib/pppd/2.4.7/pppol2tp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/lib/pppd/2.4.7/pppol2tp.so -------------------------------------------------------------------------------- /tools/bin/lib/pppd/2.4.7/radattr.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/lib/pppd/2.4.7/radattr.so -------------------------------------------------------------------------------- /tools/bin/lib/pppd/2.4.7/radius.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/lib/pppd/2.4.7/radius.so -------------------------------------------------------------------------------- /tools/bin/lib/pppd/2.4.7/radrealms.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/lib/pppd/2.4.7/radrealms.so -------------------------------------------------------------------------------- /tools/bin/lib/pppd/2.4.7/winbind.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/lib/pppd/2.4.7/winbind.so -------------------------------------------------------------------------------- /tools/bin/sbin/chat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/sbin/chat -------------------------------------------------------------------------------- /tools/bin/sbin/pppd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/sbin/pppd -------------------------------------------------------------------------------- /tools/bin/sbin/pppdump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/sbin/pppdump -------------------------------------------------------------------------------- /tools/bin/sbin/pppoe-discovery: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/sbin/pppoe-discovery -------------------------------------------------------------------------------- /tools/bin/sbin/pppstats: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/bin/sbin/pppstats -------------------------------------------------------------------------------- /tools/bin/share/man/man8/pppd-radattr.8: -------------------------------------------------------------------------------- 1 | .\" manual page [] for RADATTR plugin for pppd 2.4 2 | .\" $Id: pppd-radattr.8,v 1.2 2003/04/25 07:33:20 fcusack Exp $ 3 | .\" SH section heading 4 | .\" SS subsection heading 5 | .\" LP paragraph 6 | .\" IP indented paragraph 7 | .\" TP hanging label 8 | .TH PPPD-RADATTR 8 9 | .SH NAME 10 | radattr.so \- RADIUS utility plugin for 11 | .BR pppd (8) 12 | .SH SYNOPSIS 13 | .B pppd 14 | [ 15 | .I options 16 | ] 17 | plugin radius.so plugin radattr.so 18 | .SH DESCRIPTION 19 | .LP 20 | The radattr plugin for pppd causes all radius attributes returned by 21 | the RADIUS server at authentication time to be stored in the file 22 | .I /var/run/radattr.pppN 23 | where 24 | .I pppN 25 | is the name of the PPP interface. The RADIUS attributes are stored 26 | one per line in the format "Attribute-Name Attribute-Value". This 27 | format is convenient for use in /etc/ppp/ip-up and /etc/ppp/ip-down 28 | scripts. 29 | .LP 30 | Note that you 31 | .I must 32 | load the radius.so plugin before loading the radattr.so plugin; 33 | radattr.so depends on symbols defined in radius.so. 34 | 35 | .SH USAGE 36 | To use the plugin, simply supply the 37 | .B plugin radius.so plugin radattr.so 38 | options to pppd. 39 | 40 | .SH SEE ALSO 41 | .BR pppd (8) " pppd-radius" (8) 42 | 43 | .SH AUTHOR 44 | David F. Skoll 45 | -------------------------------------------------------------------------------- /tools/bin/share/man/man8/pppd-radius.8: -------------------------------------------------------------------------------- 1 | .\" manual page [] for RADIUS plugin for pppd 2.4 2 | .\" $Id: pppd-radius.8,v 1.5 2004/03/26 13:27:17 kad Exp $ 3 | .\" SH section heading 4 | .\" SS subsection heading 5 | .\" LP paragraph 6 | .\" IP indented paragraph 7 | .\" TP hanging label 8 | .TH PPPD-RADIUS 8 9 | .SH NAME 10 | radius.so \- RADIUS authentication plugin for 11 | .BR pppd (8) 12 | .SH SYNOPSIS 13 | .B pppd 14 | [ 15 | .I options 16 | ] 17 | plugin radius.so 18 | .SH DESCRIPTION 19 | .LP 20 | The RADIUS plugin for pppd permits pppd to perform PAP, CHAP, MS-CHAP and 21 | MS-CHAPv2 authentication against a RADIUS server instead of the usual 22 | .I /etc/ppp/pap-secrets 23 | and 24 | .I /etc/ppp/chap-secrets 25 | files. 26 | .LP 27 | The RADIUS plugin is built on a library called 28 | .B radiusclient 29 | which has its own configuration files (usually in \fI/etc/radiusclient\fR), 30 | consult those files for more information on configuring the RADIUS 31 | plugin 32 | 33 | .SH OPTIONS 34 | The RADIUS plugin introduces one additional pppd option: 35 | .TP 36 | .BI "radius-config-file " filename 37 | The file 38 | .I filename 39 | is taken as the radiusclient configuration file. If this option is not 40 | used, then the plugin uses 41 | .I /etc/radiusclient/radiusclient.conf 42 | as the configuration file. 43 | .TP 44 | .BI "avpair " attribute=value 45 | Adds an Attribute-Value pair to be passed on to the RADIUS server on each request. 46 | .TP 47 | .BI map-to-ifname 48 | Sets Radius NAS-Port attribute to number equal to interface name (Default) 49 | .TP 50 | .BI map-to-ttyname 51 | Sets Radius NAS-Port attribute value via libradiusclient library 52 | 53 | .SH USAGE 54 | To use the plugin, simply supply the 55 | .B plugin radius.so 56 | option to pppd, and edit 57 | .I /etc/radiusclient/radiusclient.conf 58 | appropriately. If you use the RADIUS plugin, the normal pppd authentication 59 | schemes (login, checking the /etc/ppp/*-secrets files) are skipped. The 60 | RADIUS server should assign an IP address to the peer using the RADIUS 61 | Framed-IP-Address attribute. 62 | 63 | .SH SEE ALSO 64 | .BR pppd (8) " pppd-radattr" (8) 65 | 66 | .SH AUTHOR 67 | David F. Skoll 68 | -------------------------------------------------------------------------------- /tools/bin/share/man/man8/pppdump.8: -------------------------------------------------------------------------------- 1 | .\" @(#) $Id: pppdump.8,v 1.2 2004/11/13 12:22:49 paulus Exp $ 2 | .TH PPPDUMP 8 "1 April 1999" 3 | .SH NAME 4 | pppdump \- convert PPP record file to readable format 5 | .SH SYNOPSIS 6 | .B pppdump 7 | [ 8 | .B \-h 9 | | 10 | .B \-p 11 | [ 12 | .B \-d 13 | ]] [ 14 | .B \-r 15 | ] [ 16 | .B \-m \fImru 17 | ] [ 18 | .I file \fR... 19 | ] 20 | .ti 12 21 | .SH DESCRIPTION 22 | The 23 | .B pppdump 24 | utility converts the files written using the \fIrecord\fR option of 25 | .B pppd 26 | into a human-readable format. If one or more filenames are specified, 27 | .B pppdump 28 | will read each in turn; otherwise it will read its standard input. In 29 | each case the result is written to standard output. 30 | .PP 31 | The options are as follows: 32 | .TP 33 | .B \-h 34 | Prints the bytes sent and received in hexadecimal. If neither this 35 | option nor the \fB\-p\fR option is specified, the bytes are printed as 36 | the characters themselves, with non-printing and non-ASCII characters 37 | printed as escape sequences. 38 | .TP 39 | .B \-p 40 | Collects the bytes sent and received into PPP packets, interpreting 41 | the async HDLC framing and escape characters and checking the FCS 42 | (frame check sequence) of each packet. The packets are printed as hex 43 | values and as characters (non-printable characters are printed as 44 | `.'). 45 | .TP 46 | .B \-d 47 | With the \fB\-p\fR option, this option causes 48 | .B pppdump 49 | to decompress packets which have been compressed with the BSD-Compress 50 | or Deflate methods. 51 | .TP 52 | .B \-r 53 | Reverses the direction indicators, so that `sent' is printed for 54 | bytes or packets received, and `rcvd' is printed for bytes or packets 55 | sent. 56 | .TP 57 | .B \-m \fImru 58 | Use \fImru\fR as the MRU (maximum receive unit) for both directions of 59 | the link when checking for over-length PPP packets (with the \fB\-p\fR 60 | option). 61 | .SH SEE ALSO 62 | pppd(8) 63 | -------------------------------------------------------------------------------- /tools/src/4G.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/src/4G.zip -------------------------------------------------------------------------------- /tools/src/SocketTool2/GPRSDTUDOC1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/src/SocketTool2/GPRSDTUDOC1.pdf -------------------------------------------------------------------------------- /tools/src/SocketTool2/SocketTool.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/src/SocketTool2/SocketTool.exe -------------------------------------------------------------------------------- /tools/src/SocketTool2/TCP&UDP Readme.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/src/SocketTool2/TCP&UDP Readme.doc -------------------------------------------------------------------------------- /tools/src/SpeedTestC/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | # Libraries 5 | *.lib 6 | *.a 7 | # Shared objects (inc. Windows DLLs) 8 | *.dll 9 | *.so 10 | *.so.* 11 | *.dylib 12 | # Executables 13 | *.exe 14 | *.out 15 | *.app 16 | SpeedTestC 17 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/Makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | CFLAGS = -O0 -g -std=c99 -Wall 3 | LIBS = -lm -lpthread 4 | OBJS = src/Speedtest.c \ 5 | src/SpeedtestConfig.c \ 6 | src/SpeedtestServers.c \ 7 | src/SpeedtestLatencyTest.c \ 8 | src/SpeedtestDownloadTest.c \ 9 | src/SpeedtestUploadTest.c \ 10 | src/url.c \ 11 | src/http.c 12 | 13 | all: SpeedTestC 14 | 15 | SpeedTestC: $(OBJS) 16 | $(CC) -o $@ $^ $(CFLAGS) $(LIBS) 17 | 18 | test: SpeedTestC 19 | valgrind --leak-check=full --show-leak-kinds=all ./SpeedTestC --server http://speedtest.skynet.net.pl/speedtest/upload.php 20 | valgrind --leak-check=full --show-leak-kinds=all ./SpeedTestC 21 | 22 | clean: 23 | rm SpeedTestC 24 | 25 | .PHONY: all 26 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/README.md: -------------------------------------------------------------------------------- 1 | Client for SpeedTest.net infrastructure written in pure C99 standard using only POSIX libraries. 2 | 3 | Main purpose for this project was to deliver client for Speedtest.net 4 | infrastructure for embedded devices. 5 | 6 | All application is written in pure C99 standard (it should compile with C90 7 | too), without using any external libraries - only POSIX is used. 8 | 9 | Code is not perfect, and it has a few bugs, but it is stable and it works. 10 | 11 | Big thanks for Luke Graham for his http function. 12 | 13 | To compile, just type make. 14 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/Speedtest.h: -------------------------------------------------------------------------------- 1 | #ifndef _SPEEDTEST_ 2 | #define _SPEEDTEST_ 3 | 4 | #include 5 | #include 6 | 7 | #define SPEED_TEST_FILE_SIZE 31625365 8 | #define BUFFER_SIZE 1500 9 | SPEEDTESTCONFIG_T *speedTestConfig; 10 | SPEEDTESTSERVER_T **serverList; 11 | int serverCount; 12 | int i, size, sockId; 13 | unsigned totalDownloadTestCount; 14 | char buffer[BUFFER_SIZE]; 15 | char *downloadUrl; 16 | char *tmpUrl; 17 | char *uploadUrl; 18 | char *latencyUrl; 19 | unsigned long totalTransfered; 20 | unsigned long totalToBeTransfered; 21 | struct timeval tval_start; 22 | float elapsedSecs; 23 | int randomizeBestServers; 24 | typedef struct thread_args { 25 | pthread_t tid; 26 | char *url; 27 | unsigned int testCount; 28 | unsigned long transferedBytes; 29 | float elapsedSecs; 30 | } THREADARGS_T; 31 | 32 | float getElapsedTime(struct timeval tval_start); 33 | char *strdup(const char *str); 34 | #endif 35 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/SpeedtestConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef _SPEEDTEST_CONFIG_ 2 | #define _SPEEDTEST_CONFIG_ 3 | #include 4 | #define R 6371 5 | #define PI 3.1415926536 6 | #define TO_RAD (PI / 180) 7 | 8 | #ifndef ARRAY_SIZE 9 | #define ARRAY_SIZE(_x) \ 10 | (sizeof(_x) / sizeof(_x[0])) 11 | #endif /* ARRAY_SIZE */ 12 | 13 | typedef struct ThreadConfig { 14 | int threadsCount; /* number of threads */ 15 | int length; /* testlength? */ 16 | } THREADCONFIG_T; 17 | 18 | typedef struct speedtestConfig 19 | { 20 | char ip[16]; 21 | float lat; 22 | float lon; 23 | char isp[255]; 24 | THREADCONFIG_T uploadThreadConfig; 25 | THREADCONFIG_T downloadThreadConfig; 26 | } SPEEDTESTCONFIG_T; 27 | 28 | SPEEDTESTCONFIG_T *getConfig(); 29 | long haversineDistance(float lat1, float lon1, float lat2, float lon2); 30 | #endif 31 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/SpeedtestDownloadTest.c: -------------------------------------------------------------------------------- 1 | #include "SpeedtestDownloadTest.h" 2 | #include "SpeedtestConfig.h" 3 | #include "SpeedtestServers.h" 4 | #include "Speedtest.h" 5 | #include "http.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | static void *__downloadThread(void *arg) 13 | { 14 | THREADARGS_T *threadConfig = (THREADARGS_T*)arg; 15 | int testNum; 16 | char buffer[BUFFER_SIZE] = {0}; 17 | struct timeval tval_start; 18 | 19 | gettimeofday(&tval_start, NULL); 20 | for (testNum = 0; testNum < threadConfig->testCount; testNum++) 21 | { 22 | int size = -1; 23 | int sockId = httpGetRequestSocket(threadConfig->url); 24 | 25 | if(sockId == 0) 26 | { 27 | fprintf(stderr, "Unable to open socket for Download!"); 28 | pthread_exit(NULL); 29 | } 30 | 31 | while(size != 0) 32 | { 33 | size = httpRecv(sockId, buffer, BUFFER_SIZE); 34 | if (size != -1) 35 | { 36 | threadConfig->transferedBytes += size; 37 | } 38 | } 39 | httpClose(sockId); 40 | } 41 | threadConfig->elapsedSecs = getElapsedTime(tval_start); 42 | 43 | return NULL; 44 | } 45 | 46 | void testDownload(const char *url) 47 | { 48 | size_t numOfThreads = speedTestConfig->downloadThreadConfig.threadsCount; 49 | THREADARGS_T *param = (THREADARGS_T *)calloc(numOfThreads, sizeof(THREADARGS_T)); 50 | int i; 51 | float speed = 0; 52 | 53 | /* Initialize and start threads */ 54 | for (i = 0; i < numOfThreads; i++) { 55 | param[i].testCount = totalDownloadTestCount / numOfThreads; 56 | if (param[i].testCount == 0) { 57 | /* At least one test should be run */ 58 | param[i].testCount = 1; 59 | } 60 | param[i].url = strdup(url); 61 | if (param[i].url) { 62 | pthread_create(¶m[i].tid, NULL, &__downloadThread, ¶m[i]); 63 | } 64 | } 65 | /* Wait for all threads */ 66 | for (i = 0; i < numOfThreads; i++) { 67 | pthread_join(param[i].tid, NULL); 68 | if (param[i].transferedBytes) { 69 | /* There's no reason that we transfered nothing except error occured */ 70 | totalTransfered += param[i].transferedBytes; 71 | speed += (param[i].transferedBytes / param[i].elapsedSecs) / 1024; 72 | } 73 | /* Cleanup */ 74 | free(param[i].url); 75 | } 76 | free(param); 77 | 78 | /* Report */ 79 | printf("Bytes %lu downloaded with a speed %.2f kB/s (%.2f Mbit/s)\n", 80 | totalTransfered, speed, speed * 8 / 1024); 81 | } 82 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/SpeedtestDownloadTest.h: -------------------------------------------------------------------------------- 1 | #ifndef _SPEEDTEST_DOWNLOAD_TEST_ 2 | #define _SPEEDTEST_DOWNLOAD_TEST_ 3 | 4 | void testDownload(const char *url); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/SpeedtestLatencyTest.c: -------------------------------------------------------------------------------- 1 | #include "SpeedtestConfig.h" 2 | #include "SpeedtestServers.h" 3 | #include "Speedtest.h" 4 | #include "http.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | /* Latency test is just testing time taken to download single latency.txt file 11 | which contains 10 chars: "test=test\n"*/ 12 | #define LATENCY_SIZE 10 13 | 14 | void testLatency(const char *url) 15 | { 16 | char buffer[LATENCY_SIZE] = {0}; 17 | int sockId, size = -1; 18 | struct timeval tval_start; 19 | 20 | gettimeofday(&tval_start, NULL); 21 | sockId = httpGetRequestSocket(url); 22 | 23 | if(sockId == 0) 24 | { 25 | fprintf(stderr, "ERROR: Unable to open socket for testing latency!"); 26 | exit(1); 27 | } 28 | 29 | while(size != 0) 30 | { 31 | size = httpRecv(sockId, buffer, LATENCY_SIZE); 32 | if (size == -1) 33 | { 34 | fprintf(stderr, "ERROR: Cannot download latency!"); 35 | exit(1); 36 | } 37 | } 38 | httpClose(sockId); 39 | printf("Latency: %d ms\n", (int)(getElapsedTime(tval_start) * 1000.0f) ); 40 | } 41 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/SpeedtestLatencyTest.h: -------------------------------------------------------------------------------- 1 | #ifndef _SPEEDTEST_LATENCY_TEST_ 2 | #define _SPEEDTEST_LATENCY_TEST_ 3 | 4 | void testLatency(const char *url); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/SpeedtestServers.h: -------------------------------------------------------------------------------- 1 | #ifndef _SPEEDTEST_SERVERS_ 2 | #define _SPEEDTEST_SERVERS_ 3 | 4 | typedef struct speedtestServer 5 | { 6 | char *url; 7 | float lat; 8 | float lon; 9 | char *name; 10 | char *country; 11 | char *sponsor; 12 | long distance; 13 | 14 | } SPEEDTESTSERVER_T; 15 | SPEEDTESTSERVER_T **getServers(int *serverCount, const char *infraUrl); 16 | char *getServerDownloadUrl(char *serverUrl); 17 | char *getLatencyUrl(char *serverUrl); 18 | #endif 19 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/SpeedtestUploadTest.h: -------------------------------------------------------------------------------- 1 | #ifndef _SPEEDTEST_UPLOAD_TEST_ 2 | #define _SPEEDTEST_UPLOAD_TEST_ 3 | 4 | void testUpload(const char *url); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/http.h: -------------------------------------------------------------------------------- 1 | #ifndef HTTPH 2 | #define HTTPH 3 | 4 | int httpPut(char* pAddress, int pPort, char* pRequest, unsigned long contentSize); 5 | int httpGet(char* pAddress, int pPort, char* pRequest); 6 | int httpRecv(int pSockId, char* pOut, int pOutSize); 7 | int httpSend(int pSockId, char* pOut, int pOutSize); 8 | int httpLastError(); 9 | void httpClose(int pSockId); 10 | int httpGetRequestSocket(const char *urlToDownload); 11 | int httpPutRequestSocket(const char *urlToUpload, unsigned long contentSize); 12 | int recvLine(int pSockId, char* pOut, int pOutSize); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/url.c: -------------------------------------------------------------------------------- 1 | /* 2 | URL functions. 3 | 4 | Luke Graham (39ster@gmail.com) 5 | Michał Obrembski (byku@byku.com.pl) 6 | */ 7 | #include 8 | #include 9 | #include 10 | #include "url.h" 11 | 12 | /*Breaks apart a url into a port, address and request*/ 13 | void breakUrl(const char* pUrl, URLPARTS_T* pUrlStruct) 14 | { 15 | char url[2048]; 16 | char *ptr2, *ptr1 = url; 17 | strncpy(url, pUrl, sizeof(url)); 18 | pUrlStruct->port = 80; 19 | 20 | /*find protocol (like http:// or ftp://)*/ 21 | ptr2 = strstr(ptr1, "://"); 22 | if(ptr2 != 0) 23 | { 24 | *ptr2 = 0; 25 | if(pUrlStruct->protocolLen > 0) 26 | strncpy(pUrlStruct->protocol, ptr1, pUrlStruct->protocolLen); 27 | 28 | if(strcmp(ptr1, "ftp") == 0) 29 | pUrlStruct->port = 21; 30 | 31 | ptr1 = ptr2 + 3; 32 | } else if(pUrlStruct->protocolLen > 0) 33 | *pUrlStruct->protocol = 0; 34 | 35 | /*find request (the part starting at "/" after the address and port)*/ 36 | ptr2 = strchr(ptr1, '/'); 37 | if(ptr2 != 0) 38 | { 39 | if(pUrlStruct->requestLen > 0) 40 | strncpy(pUrlStruct->request, ptr2, pUrlStruct->requestLen); 41 | 42 | *ptr2 = 0; 43 | } else if(pUrlStruct->requestLen > 1) 44 | strncpy(pUrlStruct->request, "/", pUrlStruct->requestLen); 45 | 46 | /*find port (the part after ":")*/ 47 | ptr2 = strchr(ptr1, ':'); 48 | if(ptr2 != 0) 49 | { 50 | pUrlStruct->port = atoi(ptr2+1); 51 | *ptr2 = 0; 52 | } 53 | 54 | /*whats left should only be the address*/ 55 | if(pUrlStruct->addressLen > 0) 56 | strncpy(pUrlStruct->address, ptr1, pUrlStruct->addressLen); 57 | } 58 | 59 | int hexToAscii(char pHex) 60 | { 61 | if(pHex >= '0' && pHex <= '9') 62 | return pHex - '0'; 63 | if(pHex >= 'A' && pHex <= 'F') 64 | return pHex - 'A' + 10; 65 | if(pHex >= 'a' && pHex <= 'f') 66 | return pHex - 'a' + 10; 67 | return 0; 68 | } 69 | /*Decodes the hex parts of the request (e.g %20 is ' ')*/ 70 | void decodeRequest(const char* pRequest, char* pOut, int pOutSize) 71 | { 72 | char* ptr1 = (char*)pRequest; 73 | int i; 74 | memset(pOut, 0, pOutSize); 75 | for(i = 0; i < pOutSize-1; i++) 76 | { 77 | if(*ptr1 == 0) 78 | break; 79 | 80 | switch(*ptr1) 81 | { 82 | case '%': 83 | pOut[i] = hexToAscii(*++ptr1) << 4; 84 | pOut[i] += hexToAscii(*++ptr1); 85 | break; 86 | 87 | default: 88 | pOut[i] = *ptr1; 89 | break; 90 | } 91 | ptr1++; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /tools/src/SpeedTestC/src/url.h: -------------------------------------------------------------------------------- 1 | #ifndef URLDECODEH 2 | #define URLDECODEH 3 | 4 | typedef struct 5 | { 6 | char* address; 7 | int addressLen; 8 | char* request; 9 | int requestLen; 10 | char* protocol; 11 | int protocolLen; 12 | int port; 13 | } URLPARTS_T; 14 | 15 | void decodeRequest(const char* pRequest, char* pOut, int pOutSize); 16 | void breakUrl(const char* pUrl, URLPARTS_T* pUrlStruct); 17 | #endif 18 | -------------------------------------------------------------------------------- /tools/src/network emulatot toolkit.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/src/network emulatot toolkit.zip -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/.gitignore: -------------------------------------------------------------------------------- 1 | *.orig 2 | *~ 3 | *.o 4 | *.so 5 | *.a 6 | *.cat8 7 | Makefile 8 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/README.MSCHAP81: -------------------------------------------------------------------------------- 1 | PPP Support for Microsoft's CHAP-81 2 | =================================== 3 | 4 | Frank Cusack frank@google.com 5 | 6 | Some text verbatim from README.MSCHAP80, 7 | by Eric Rosenquist, rosenqui@strataware.com 8 | 9 | INTRODUCTION 10 | 11 | First, please read README.MSCHAP80; almost everything there applies here. 12 | MS-CHAP was basically devised by Microsoft because rather than store 13 | plaintext passwords, they (Microsoft) store the md4 hash of passwords. 14 | It provides no advantage over standard CHAP, since the hash is used 15 | as plaintext-equivalent. (Well, the Change-Password packet is arguably 16 | an advantage.) It does introduce a significant weakness if the LM hash 17 | is used. Additionally, the format of the failure packet potentially 18 | gives information to an attacker. The weakness of the LM hash is partly 19 | addressed in RFC 2433, which deprecates its use. 20 | 21 | MS-CHAPv2 adds 2 benefits to MS-CHAP. (1) The LM hash is no longer 22 | used. (2) Mutual authentication is required. Note that the mutual 23 | authentication in MS-CHAPv2 is different than the case where both PPP 24 | peers require authentication from the other; the former proves that 25 | the server has access to the client's password, the latter proves that 26 | the server has access to a secret which the client also has -- which 27 | may or may not be the same as the client's password (but should not be 28 | the same, per RFC 1994). Whether this provides any actual benefit is 29 | outside the scope of this document. The details of MS-CHAPv2 can be 30 | found in the document: 31 | 32 | 33 | 34 | 35 | BUILDING THE PPPD 36 | 37 | In addition to the requirements for MS-CHAP, MS-CHAPv2 uses the SHA-1 38 | hash algorithm. A public domain implementation is provided with pppd. 39 | 40 | 41 | TROUBLESHOOTING 42 | 43 | Assuming that everything else has been configured correctly for PPP and 44 | CHAP, the MS-CHAPv2-specific problems you're likely to encounter are mostly 45 | related to your Windows NT account and its settings. A Microsoft server 46 | returns error codes in its CHAP response. The following are extracted from 47 | RFC 2759: 48 | 49 | 646 ERROR_RESTRICTED_LOGON_HOURS 50 | 647 ERROR_ACCT_DISABLED 51 | 648 ERROR_PASSWD_EXPIRED 52 | 649 ERROR_NO_DIALIN_PERMISSION 53 | 691 ERROR_AUTHENTICATION_FAILURE 54 | 709 ERROR_CHANGING_PASSWORD 55 | 56 | You'll see these in your pppd log as a line similar to: 57 | 58 | Remote message: E=649 No dialin permission 59 | 60 | Previously, pppd would log this as: 61 | 62 | Remote message: E=649 R=0 63 | 64 | Now, the text message is logged (both for MS-CHAP and MS-CHAPv2). 65 | 66 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/README.cbcp: -------------------------------------------------------------------------------- 1 | Microsoft Call Back Configuration Protocol. 2 | by Pedro Roque Marques 3 | (updated by Paul Mackerras) 4 | 5 | The CBCP is a method by which the Microsoft Windows NT Server may 6 | implement additional security. It is possible to configure the server 7 | in such a manner so as to require that the client systems which 8 | connect with it are required that following a valid authentication to 9 | leave a method by which the number may be returned call. 10 | 11 | It is a requirement of servers to be so configured that the protocol be 12 | exchanged. 13 | 14 | So, this set of patches may be applied to the pppd process to enable 15 | the cbcp client *only* portion of the specification. It is primarily 16 | meant to permit connection with Windows NT Servers. 17 | 18 | The ietf-working specification may be obtained from ftp.microsoft.com 19 | in the developr/rfc directory. 20 | 21 | The ietf task group has decided to recommend that the LCP sequence be 22 | extended to permit the callback operation. For this reason, these 23 | patches are not 'part' of pppd but are an adjunct to the code. 24 | 25 | To enable CBCP support, all that is required is to uncomment the line 26 | in Makefile.linux that sets CBCP=y and recompile pppd. 27 | 28 | I use such script to make a callback: 29 | 30 | pppd debug nodetach /dev/modem 115200 crtscts modem \ 31 | callback 222222 name NAME remotename SERVER \ 32 | connect 'chat -v "" atz OK atdt111111 CONNECT ""' 33 | sleep 1 34 | pppd debug /dev/modem 115200 crtscts modem \ 35 | name NAME remotename SERVER defaultroute \ 36 | connect 'chat -v RING ATA CONNECT "\c"' 37 | 38 | First we invoke pppd with 'nodetach' option in order to not detach from 39 | the controlling terminal and 'callback NUMBER' option, then wait for 40 | 1 second and invoke pppd again which waits for a callback (RING) and 41 | then answers (ATA). Number 222222 is a callback number, i.e. server will 42 | call us back at this number, while number 111111 is the number we are 43 | calling to. 44 | 45 | You have to put in /etc/ppp/chap-secrets the following two lines: 46 | 47 | NAME SERVER PASSWORD 48 | SERVER NAME PASSWORD 49 | 50 | You have to use your real login name, remote server name and password. 51 | 52 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/README.pppol2tp: -------------------------------------------------------------------------------- 1 | PPPoL2TP plugin 2 | =============== 3 | 4 | The pppol2tp plugin lets pppd use the Linux kernel driver pppol2tp.ko 5 | to pass PPP frames in L2TP tunnels. The driver was integrated into the 6 | kernel in the 2.6.23 release. For kernels before 2.6.23, an 7 | out-of-tree kernel module is available from the pppol2tp-kmod package 8 | in the OpenL2TP project. 9 | 10 | Note that pppd receives only PPP control frames over the PPPoL2TP 11 | socket; data frames are handled entirely by the kernel. 12 | 13 | The pppol2tp plugin adds extra arguments to pppd and uses the Linux kernel 14 | PPP-over-L2TP driver to set up each session's data path. 15 | 16 | Arguments are:- 17 | 18 | pppol2tp - FD for PPPoL2TP socket 19 | pppol2tp_lns_mode - PPPoL2TP LNS behavior. Default off. 20 | pppol2tp_send_seq - PPPoL2TP enable sequence numbers in 21 | transmitted data packets. Default off. 22 | pppol2tp_recv_seq - PPPoL2TP enforce sequence numbers in 23 | received data packets. Default off. 24 | pppol2tp_reorderto - PPPoL2TP data packet reorder timeout. 25 | Default 0 (no reordering). 26 | pppol2tp_debug_mask - PPPoL2TP debug mask. Bitwise OR of 27 | 1 - verbose debug 28 | 2 - control 29 | 4 - kernel transport 30 | 8 - ppp packet data 31 | Default: 0 (no debug). 32 | pppol2tp_ifname - Name of PPP network interface visible 33 | to "ifconfig" and "ip link". 34 | Default: "pppN" 35 | pppol2tp_tunnel_id - L2TP tunnel_id tunneling this PPP 36 | session. 37 | pppol2tp_session_id - L2TP session_id of this PPP session. 38 | The tunnel_id/session_id pair is used 39 | when sending event messages to openl2tpd. 40 | 41 | pppd will typically be started by an L2TP daemon for each L2TP sesion, 42 | supplying one or more of the above arguments as required. The pppd 43 | user will usually have no visibility of these arguments. 44 | 45 | Two hooks are exported by this plugin. 46 | 47 | void (*pppol2tp_send_accm_hook)(int tunnel_id, int session_id, 48 | uint32_t send_accm, uint32_t recv_accm); 49 | void (*pppol2tp_ip_updown_hook)(int tunnel_id, int session_id, int up); 50 | 51 | Credits 52 | ======= 53 | 54 | This plugin was developed by Katalix Systems as part of the OpenL2TP 55 | project, http://openl2tp.sourceforge.net. OpenL2TP is a full-featured 56 | L2TP client-server, suitable for use as an enterprise L2TP VPN server 57 | or a VPN client. 58 | 59 | Please copy problems to the OpenL2TP mailing list: 60 | openl2tp-users@lists.sourceforge.net. 61 | 62 | Maintained by: 63 | James Chapman 64 | jchapman@katalix.com 65 | Katalix Systems Ltd 66 | http://www.katalix.com 67 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/chat/.gitignore: -------------------------------------------------------------------------------- 1 | chat 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/chat/Makefile.linux: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.linux,v 1.15 2006/06/04 05:07:46 paulus Exp $ 2 | 3 | DESTDIR = $(INSTROOT)@DESTDIR@ 4 | BINDIR = $(DESTDIR)/sbin 5 | MANDIR = $(DESTDIR)/share/man/man8 6 | 7 | CDEF1= -DTERMIOS # Use the termios structure 8 | CDEF2= -DSIGTYPE=void # Standard definition 9 | CDEF3= -UNO_SLEEP # Use the usleep function 10 | CDEF4= -DFNDELAY=O_NDELAY # Old name value 11 | CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4) 12 | 13 | COPTS= -O2 -g -pipe 14 | CFLAGS= $(COPTS) $(CDEFS) 15 | 16 | INSTALL= install 17 | 18 | all: chat 19 | 20 | chat: chat.o 21 | $(CC) -o chat chat.o 22 | 23 | chat.o: chat.c 24 | $(CC) -c $(CFLAGS) -o chat.o chat.c 25 | 26 | install: chat 27 | mkdir -p $(BINDIR) $(MANDIR) 28 | $(INSTALL) -s -c chat $(BINDIR) 29 | $(INSTALL) -c -m 644 chat.8 $(MANDIR) 30 | 31 | clean: 32 | rm -f chat.o chat *~ 33 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/chat/Makefile.sol2: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for chat on Solaris 2 3 | # 4 | 5 | include ../Makedefs.com 6 | 7 | CFLAGS = $(COPTS) -DNO_USLEEP -DSOL2 8 | 9 | all: chat 10 | 11 | chat: chat.o 12 | $(CC) -o chat chat.o 13 | 14 | install: chat 15 | $(INSTALL) -f $(BINDIR) chat 16 | $(INSTALL) -m 444 -f $(MANDIR)/man8 chat.8 17 | 18 | clean: 19 | rm -f *~ *.o chat 20 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/contrib/pppgetpass/Makefile.linux: -------------------------------------------------------------------------------- 1 | all: pppgetpass.vt pppgetpass.gtk 2 | 3 | pppgetpass.vt: pppgetpass.vt.o 4 | 5 | pppgetpass.gtk: pppgetpass.gtk.o 6 | $(CC) $(LDFLAGS) pppgetpass.gtk.o -o pppgetpass.gtk `pkg-config --libs glib-2.0 gtk+-2.0` 7 | pppgetpass.gtk.o: pppgetpass.gtk.c 8 | $(CC) $(CFLAGS) -c pppgetpass.gtk.c `pkg-config --cflags glib-2.0 gtk+-2.0` 9 | 10 | install: all 11 | install -m 755 pppgetpass.sh /usr/bin/pppgetpass 12 | install -m 4755 -o root -g root pppgetpass.vt /usr/bin/ 13 | install -m 755 -o root -g root pppgetpass.gtk /usr/X11/bin/ 14 | 15 | clean: 16 | rm -f *.o pppgetpass.gtk pppgetpass.vt core 17 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/contrib/pppgetpass/pppgetpass.8: -------------------------------------------------------------------------------- 1 | .TH PPPGETPASS 8 "26 Sep 1999" 2 | .SH NAME 3 | pppgetpass \- prompt for PAP password 4 | .SH SYNOPSIS 5 | .B pppgetpass 6 | .I client server fd 7 | .SH DESCRIPTION 8 | .B pppgetpass 9 | the outer half of a plugin for PAP password prompting in pppd. 10 | If the peer requires PAP, and the 11 | .B passprompt.so 12 | plugin is loaded into pppd, it will run 13 | .B /usr/sbin/pppgetpass 14 | (or another program specified by the 15 | .B promptprog 16 | option) to prompt the user for the password. 17 | .SH SEE ALSO 18 | pppd(8) 19 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/contrib/pppgetpass/pppgetpass.gtk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | int outfd; 18 | int err; 19 | 20 | static void okpressed(void *widget, void *clientdata) 21 | { 22 | GtkWidget *answer=clientdata; 23 | gchar *pass; 24 | int passlen; 25 | ssize_t wrote; 26 | (void)widget; 27 | 28 | pass=gtk_entry_get_text(GTK_ENTRY(answer)); 29 | 30 | passlen=strlen(pass); 31 | if(!passlen) 32 | return; 33 | 34 | if((wrote=write(outfd, pass, passlen))!=passlen) { 35 | if(wrote<0) 36 | syslog(LOG_ERR, "write error on outpipe: %m"); 37 | else 38 | syslog(LOG_ERR, "short write on outpipe"); 39 | err=1; 40 | } 41 | gtk_main_quit(); 42 | } 43 | 44 | int main(int argc, char **argv) 45 | { 46 | GtkWidget *mainwindow, *vbox, *question, *answer, *ok; 47 | char buf[1024]; 48 | gtk_init(&argc, &argv); 49 | 50 | openlog(argv[0], LOG_PID, LOG_DAEMON); 51 | if(argc!=4) { 52 | syslog(LOG_WARNING, "Usage error"); 53 | return 1; 54 | } 55 | outfd=atoi(argv[3]); 56 | mainwindow=gtk_window_new(GTK_WINDOW_TOPLEVEL); 57 | gtk_window_set_title(GTK_WINDOW(mainwindow), "pppgetpass"); 58 | gtk_signal_connect(GTK_OBJECT(mainwindow), "destroy", 59 | GTK_SIGNAL_FUNC(gtk_main_quit), 0); 60 | 61 | vbox=gtk_vbox_new(FALSE, 5); 62 | gtk_container_add(GTK_CONTAINER(mainwindow), vbox); 63 | gtk_widget_show(vbox); 64 | 65 | if(argv[1][0] && argv[2][0]) 66 | snprintf(buf, sizeof buf, "Password for PPP client %s on server %s: ", argv[1], argv[2]); 67 | else if(argv[1][0] && !argv[2][0]) 68 | snprintf(buf, sizeof buf, "Password for PPP client %s: ", argv[1]); 69 | else if(!argv[1][0] && argv[2][0]) 70 | snprintf(buf, sizeof buf, "Password for PPP on server %s: ", argv[2]); 71 | else 72 | snprintf(buf, sizeof buf, "Enter PPP password: "); 73 | question=gtk_label_new(buf); 74 | gtk_box_pack_start(GTK_BOX(vbox), question, FALSE, TRUE, 0); 75 | gtk_widget_show(question); 76 | 77 | answer=gtk_entry_new(); 78 | gtk_entry_set_visibility(GTK_ENTRY(answer), 0); 79 | gtk_box_pack_start(GTK_BOX(vbox), answer, FALSE, TRUE, 0); 80 | gtk_widget_show(answer); 81 | 82 | ok=gtk_button_new_with_label("OK"); 83 | gtk_box_pack_start(GTK_BOX(vbox), ok, FALSE, TRUE, 0); 84 | gtk_signal_connect(GTK_OBJECT(ok), "clicked", 85 | GTK_SIGNAL_FUNC(okpressed), answer); 86 | gtk_widget_show(ok); 87 | 88 | gtk_widget_show(mainwindow); 89 | gtk_main(); 90 | 91 | return err; 92 | } 93 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/contrib/pppgetpass/pppgetpass.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z "$DISPLAY" ]; then 4 | exec pppgetpass.vt "$@" 5 | else 6 | exec pppgetpass.gtk "$@" 7 | fi 8 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/etc.ppp/chap-secrets: -------------------------------------------------------------------------------- 1 | # Secrets for authentication using CHAP 2 | # client server secret IP addresses 3 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/etc.ppp/options: -------------------------------------------------------------------------------- 1 | lock 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/etc.ppp/pap-secrets: -------------------------------------------------------------------------------- 1 | # Secrets for authentication using PAP 2 | # client server secret IP addresses 3 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/linux/Makefile.top: -------------------------------------------------------------------------------- 1 | # PPP top-level Makefile for Linux. 2 | 3 | DESTDIR = $(INSTROOT)@DESTDIR@ 4 | BINDIR = $(DESTDIR)/sbin 5 | INCDIR = $(DESTDIR)/include 6 | MANDIR = $(DESTDIR)/share/man 7 | ETCDIR = $(INSTROOT)@SYSCONF@/ppp 8 | 9 | # uid 0 = root 10 | INSTALL= install 11 | 12 | all: 13 | cd chat; $(MAKE) $(MFLAGS) all 14 | cd pppd/plugins; $(MAKE) $(MFLAGS) all 15 | cd pppd; $(MAKE) $(MFLAGS) all 16 | cd pppstats; $(MAKE) $(MFLAGS) all 17 | cd pppdump; $(MAKE) $(MFLAGS) all 18 | 19 | install: $(BINDIR) $(MANDIR)/man8 install-progs install-devel 20 | 21 | install-progs: 22 | cd chat; $(MAKE) $(MFLAGS) install 23 | cd pppd/plugins; $(MAKE) $(MFLAGS) install 24 | cd pppd; $(MAKE) $(MFLAGS) install 25 | cd pppstats; $(MAKE) $(MFLAGS) install 26 | cd pppdump; $(MAKE) $(MFLAGS) install 27 | 28 | install-etcppp: $(ETCDIR) $(ETCDIR)/options $(ETCDIR)/pap-secrets \ 29 | $(ETCDIR)/chap-secrets 30 | 31 | install-devel: 32 | cd pppd; $(MAKE) $(MFLAGS) install-devel 33 | 34 | $(ETCDIR)/options: 35 | $(INSTALL) -c -m 644 etc.ppp/options $@ 36 | $(ETCDIR)/pap-secrets: 37 | $(INSTALL) -c -m 600 etc.ppp/pap-secrets $@ 38 | $(ETCDIR)/chap-secrets: 39 | $(INSTALL) -c -m 600 etc.ppp/chap-secrets $@ 40 | 41 | $(BINDIR): 42 | $(INSTALL) -d -m 755 $@ 43 | $(MANDIR)/man8: 44 | $(INSTALL) -d -m 755 $@ 45 | $(ETCDIR): 46 | $(INSTALL) -d -m 755 $@ 47 | 48 | clean: 49 | rm -f `find . -name '*.[oas]' -print` 50 | rm -f `find . -name 'core' -print` 51 | rm -f `find . -name '*~' -print` 52 | cd chat; $(MAKE) clean 53 | cd pppd/plugins; $(MAKE) clean 54 | cd pppd; $(MAKE) clean 55 | cd pppstats; $(MAKE) clean 56 | cd pppdump; $(MAKE) clean 57 | 58 | dist-clean: clean 59 | rm -f Makefile `find . -name Makefile -print` 60 | 61 | #kernel: 62 | # cd linux; ./kinstall.sh 63 | 64 | # no tests yet, one day... 65 | installcheck: 66 | true 67 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/.gitignore: -------------------------------------------------------------------------------- 1 | pppd 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/Makefile.sol2: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for pppd under Solaris 2. 3 | # $Id: Makefile.sol2,v 1.30 2008/01/30 14:26:52 carlsonj Exp $ 4 | # 5 | 6 | include ../Makedefs.com 7 | 8 | CFLAGS = -I../include -DSVR4 -DSOL2 $(COPTS) '-DDESTDIR="@DESTDIR@"' 9 | LIBS = -lsocket -lnsl 10 | 11 | OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o eap.o md5.o \ 12 | tty.o ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o \ 13 | chap-md5.o session.o 14 | 15 | # Solaris uses shadow passwords 16 | CFLAGS += -DHAS_SHADOW 17 | 18 | # 19 | # Comment the following out to disable plugins 20 | # 21 | CFLAGS += -DPLUGIN 22 | LIBS += -ldl 23 | 24 | # 25 | # Solaris 8 and above accomodates /var/run, so uncomment the 26 | # following to place pppd process IDs on that location 27 | # 28 | #CFLAGS += -D_PATH_VARRUN='"/var/run/"' 29 | 30 | # 31 | # uncomment the following to enable IPv6 32 | # 33 | # Solaris 8 and on includes support for IPv6 34 | # 35 | CFLAGS += -DINET6 36 | OBJS += ipv6cp.o eui64.o 37 | 38 | # Uncomment to enable MS-CHAP 39 | CFLAGS += -DUSE_CRYPT -DCHAPMS -DMSLANMAN -DHAVE_CRYPT_H 40 | OBJS += chap_ms.o pppcrypt.o md4.o sha1.o 41 | 42 | # Uncomment for CBCP 43 | #CFLAGS += -DCBCP_SUPPORT 44 | #OBJS += cbcp.o 45 | 46 | # Uncomment for PAM 47 | #CFLAGS += -DUSE_PAM 48 | #LIBS += -lpam 49 | 50 | # 51 | # Make targets 52 | # 53 | all: pppd 54 | 55 | pppd: $(OBJS) 56 | $(CC) -o pppd $(OBJS) $(LIBS) 57 | 58 | install: 59 | $(INSTALL) -f $(BINDIR) -m 4755 -u root pppd 60 | $(INSTALL) -f $(MANDIR)/man8 -m 444 pppd.8 61 | 62 | clean: 63 | rm -f $(OBJS) pppd *~ core y.tab.c y.tab.h 64 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/cbcp.h: -------------------------------------------------------------------------------- 1 | #ifndef CBCP_H 2 | #define CBCP_H 3 | 4 | typedef struct cbcp_state { 5 | int us_unit; /* Interface unit number */ 6 | u_char us_id; /* Current id */ 7 | u_char us_allowed; 8 | int us_type; 9 | char *us_number; /* Telefone Number */ 10 | } cbcp_state; 11 | 12 | extern cbcp_state cbcp[]; 13 | 14 | extern struct protent cbcp_protent; 15 | 16 | #define CBCP_MINLEN 4 17 | 18 | #define CBCP_REQ 1 19 | #define CBCP_RESP 2 20 | #define CBCP_ACK 3 21 | 22 | #define CB_CONF_NO 1 23 | #define CB_CONF_USER 2 24 | #define CB_CONF_ADMIN 3 25 | #define CB_CONF_LIST 4 26 | #endif 27 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/ccp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ccp.h - Definitions for PPP Compression Control Protocol. 3 | * 4 | * Copyright (c) 1994-2002 Paul Mackerras. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. The name(s) of the authors of this software must not be used to 14 | * endorse or promote products derived from this software without 15 | * prior written permission. 16 | * 17 | * 3. Redistributions of any form whatsoever must retain the following 18 | * acknowledgment: 19 | * "This product includes software developed by Paul Mackerras 20 | * ". 21 | * 22 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 23 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 24 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 25 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 26 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 27 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 28 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 29 | * 30 | * $Id: ccp.h,v 1.12 2004/11/04 10:02:26 paulus Exp $ 31 | */ 32 | 33 | typedef struct ccp_options { 34 | bool bsd_compress; /* do BSD Compress? */ 35 | bool deflate; /* do Deflate? */ 36 | bool predictor_1; /* do Predictor-1? */ 37 | bool predictor_2; /* do Predictor-2? */ 38 | bool deflate_correct; /* use correct code for deflate? */ 39 | bool deflate_draft; /* use draft RFC code for deflate? */ 40 | u_char mppe; /* MPPE bitfield */ 41 | u_short bsd_bits; /* # bits/code for BSD Compress */ 42 | u_short deflate_size; /* lg(window size) for Deflate */ 43 | short method; /* code for chosen compression method */ 44 | } ccp_options; 45 | 46 | extern fsm ccp_fsm[]; 47 | extern ccp_options ccp_wantoptions[]; 48 | extern ccp_options ccp_gotoptions[]; 49 | extern ccp_options ccp_allowoptions[]; 50 | extern ccp_options ccp_hisoptions[]; 51 | 52 | extern struct protent ccp_protent; 53 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/chap-md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * chap-md5.h - New CHAP/MD5 implementation. 3 | * 4 | * Copyright (c) 2003 Paul Mackerras. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. The name(s) of the authors of this software must not be used to 14 | * endorse or promote products derived from this software without 15 | * prior written permission. 16 | * 17 | * 3. Redistributions of any form whatsoever must retain the following 18 | * acknowledgment: 19 | * "This product includes software developed by Paul Mackerras 20 | * ". 21 | * 22 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 23 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 24 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 25 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 26 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 27 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 28 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 29 | */ 30 | 31 | extern void chap_md5_init(void); 32 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/ecp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ecp.h - Definitions for PPP Encryption Control Protocol. 3 | * 4 | * Copyright (c) 2002 Google, Inc. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in 16 | * the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * 3. The name(s) of the authors of this software must not be used to 20 | * endorse or promote products derived from this software without 21 | * prior written permission. 22 | * 23 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 24 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 25 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 26 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 27 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 28 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 29 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 30 | * 31 | * $Id: ecp.h,v 1.2 2003/01/10 07:12:36 fcusack Exp $ 32 | */ 33 | 34 | typedef struct ecp_options { 35 | bool required; /* Is ECP required? */ 36 | unsigned enctype; /* Encryption type */ 37 | } ecp_options; 38 | 39 | extern fsm ecp_fsm[]; 40 | extern ecp_options ecp_wantoptions[]; 41 | extern ecp_options ecp_gotoptions[]; 42 | extern ecp_options ecp_allowoptions[]; 43 | extern ecp_options ecp_hisoptions[]; 44 | 45 | extern struct protent ecp_protent; 46 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/eui64.c: -------------------------------------------------------------------------------- 1 | /* 2 | * eui64.c - EUI64 routines for IPv6CP. 3 | * 4 | * Copyright (c) 1999 Tommi Komulainen. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The name(s) of the authors of this software must not be used to 19 | * endorse or promote products derived from this software without 20 | * prior written permission. 21 | * 22 | * 4. Redistributions of any form whatsoever must retain the following 23 | * acknowledgment: 24 | * "This product includes software developed by Tommi Komulainen 25 | * ". 26 | * 27 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 28 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 29 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 30 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 31 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 32 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 33 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 34 | * 35 | * $Id: eui64.c,v 1.6 2002/12/04 23:03:32 paulus Exp $ 36 | */ 37 | 38 | #define RCSID "$Id: eui64.c,v 1.6 2002/12/04 23:03:32 paulus Exp $" 39 | 40 | #include "pppd.h" 41 | 42 | static const char rcsid[] = RCSID; 43 | 44 | /* 45 | * eui64_ntoa - Make an ascii representation of an interface identifier 46 | */ 47 | char * 48 | eui64_ntoa(e) 49 | eui64_t e; 50 | { 51 | static char buf[32]; 52 | 53 | snprintf(buf, 32, "%02x%02x:%02x%02x:%02x%02x:%02x%02x", 54 | e.e8[0], e.e8[1], e.e8[2], e.e8[3], 55 | e.e8[4], e.e8[5], e.e8[6], e.e8[7]); 56 | return buf; 57 | } 58 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/ipv6cp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/src/ppp-2.4.7/pppd/ipv6cp.c -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/ipv6cp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/src/ppp-2.4.7/pppd/ipv6cp.h -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/magic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * magic.h - PPP Magic Number definitions. 3 | * 4 | * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The name "Carnegie Mellon University" must not be used to 19 | * endorse or promote products derived from this software without 20 | * prior written permission. For permission or any legal 21 | * details, please contact 22 | * Office of Technology Transfer 23 | * Carnegie Mellon University 24 | * 5000 Forbes Avenue 25 | * Pittsburgh, PA 15213-3890 26 | * (412) 268-4387, fax: (412) 268-7395 27 | * tech-transfer@andrew.cmu.edu 28 | * 29 | * 4. Redistributions of any form whatsoever must retain the following 30 | * acknowledgment: 31 | * "This product includes software developed by Computing Services 32 | * at Carnegie Mellon University (http://www.cmu.edu/computing/)." 33 | * 34 | * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 35 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 36 | * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 37 | * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 38 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 39 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 40 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 41 | * 42 | * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $ 43 | */ 44 | 45 | void magic_init __P((void)); /* Initialize the magic number generator */ 46 | u_int32_t magic __P((void)); /* Returns the next magic number */ 47 | 48 | /* Fill buffer with random bytes */ 49 | void random_bytes __P((unsigned char *buf, int len)); 50 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/md4.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | ** ******************************************************************** 4 | ** md4.h -- Header file for implementation of ** 5 | ** MD4 Message Digest Algorithm ** 6 | ** Updated: 2/13/90 by Ronald L. Rivest ** 7 | ** (C) 1990 RSA Data Security, Inc. ** 8 | ** ******************************************************************** 9 | */ 10 | 11 | #ifndef __P 12 | # if defined(__STDC__) || defined(__GNUC__) 13 | # define __P(x) x 14 | # else 15 | # define __P(x) () 16 | # endif 17 | #endif 18 | 19 | 20 | /* MDstruct is the data structure for a message digest computation. 21 | */ 22 | typedef struct { 23 | unsigned int buffer[4]; /* Holds 4-word result of MD computation */ 24 | unsigned char count[8]; /* Number of bits processed so far */ 25 | unsigned int done; /* Nonzero means MD computation finished */ 26 | } MD4_CTX; 27 | 28 | /* MD4Init(MD4_CTX *) 29 | ** Initialize the MD4_CTX prepatory to doing a message digest 30 | ** computation. 31 | */ 32 | extern void MD4Init __P((MD4_CTX *MD)); 33 | 34 | /* MD4Update(MD,X,count) 35 | ** Input: X -- a pointer to an array of unsigned characters. 36 | ** count -- the number of bits of X to use (an unsigned int). 37 | ** Updates MD using the first "count" bits of X. 38 | ** The array pointed to by X is not modified. 39 | ** If count is not a multiple of 8, MD4Update uses high bits of 40 | ** last byte. 41 | ** This is the basic input routine for a user. 42 | ** The routine terminates the MD computation when count < 512, so 43 | ** every MD computation should end with one call to MD4Update with a 44 | ** count less than 512. Zero is OK for a count. 45 | */ 46 | extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count)); 47 | 48 | /* MD4Print(MD) 49 | ** Prints message digest buffer MD as 32 hexadecimal digits. 50 | ** Order is from low-order byte of buffer[0] to high-order byte 51 | ** of buffer[3]. 52 | ** Each byte is printed with high-order hexadecimal digit first. 53 | */ 54 | extern void MD4Print __P((MD4_CTX *)); 55 | 56 | /* MD4Final(buf, MD) 57 | ** Returns message digest from MD and terminates the message 58 | ** digest computation. 59 | */ 60 | extern void MD4Final __P((unsigned char *, MD4_CTX *)); 61 | 62 | /* 63 | ** End of md4.h 64 | ****************************(cut)***********************************/ 65 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/patchlevel.h: -------------------------------------------------------------------------------- 1 | #define VERSION "2.4.7" 2 | #define DATE "9 August 2014" 3 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/pathnames.h: -------------------------------------------------------------------------------- 1 | /* 2 | * define path names 3 | * 4 | * $Id: pathnames.h,v 1.18 2005/08/25 23:59:34 paulus Exp $ 5 | */ 6 | 7 | #ifdef HAVE_PATHS_H 8 | #include 9 | 10 | #else /* HAVE_PATHS_H */ 11 | #ifndef _PATH_VARRUN 12 | #define _PATH_VARRUN "/etc/ppp/" 13 | #endif 14 | #define _PATH_DEVNULL "/dev/null" 15 | #endif /* HAVE_PATHS_H */ 16 | 17 | #ifndef _ROOT_PATH 18 | #define _ROOT_PATH 19 | #endif 20 | 21 | #define _PATH_UPAPFILE _ROOT_PATH "/etc/ppp/pap-secrets" 22 | #define _PATH_CHAPFILE _ROOT_PATH "/etc/ppp/chap-secrets" 23 | #define _PATH_SRPFILE _ROOT_PATH "/etc/ppp/srp-secrets" 24 | #define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options" 25 | #define _PATH_IPUP _ROOT_PATH "/etc/ppp/ip-up" 26 | #define _PATH_IPDOWN _ROOT_PATH "/etc/ppp/ip-down" 27 | #define _PATH_IPPREUP _ROOT_PATH "/etc/ppp/ip-pre-up" 28 | #define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up" 29 | #define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down" 30 | #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options." 31 | #define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors" 32 | #define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/" 33 | #define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf" 34 | 35 | #define _PATH_USEROPT ".ppprc" 36 | #define _PATH_PSEUDONYM ".ppp_pseudonym" 37 | 38 | #ifdef INET6 39 | #define _PATH_IPV6UP _ROOT_PATH "/etc/ppp/ipv6-up" 40 | #define _PATH_IPV6DOWN _ROOT_PATH "/etc/ppp/ipv6-down" 41 | #endif 42 | 43 | #ifdef IPX_CHANGE 44 | #define _PATH_IPXUP _ROOT_PATH "/etc/ppp/ipx-up" 45 | #define _PATH_IPXDOWN _ROOT_PATH "/etc/ppp/ipx-down" 46 | #endif /* IPX_CHANGE */ 47 | 48 | #ifdef __STDC__ 49 | #define _PATH_PPPDB _ROOT_PATH _PATH_VARRUN "pppd2.tdb" 50 | #else /* __STDC__ */ 51 | #ifdef HAVE_PATHS_H 52 | #define _PATH_PPPDB "/var/run/pppd2.tdb" 53 | #else 54 | #define _PATH_PPPDB "/etc/ppp/pppd2.tdb" 55 | #endif 56 | #endif /* __STDC__ */ 57 | 58 | #ifdef PLUGIN 59 | #ifdef __STDC__ 60 | #define _PATH_PLUGIN DESTDIR "/lib/pppd/" VERSION 61 | #else /* __STDC__ */ 62 | #define _PATH_PLUGIN "/usr/lib/pppd" 63 | #endif /* __STDC__ */ 64 | 65 | #endif /* PLUGIN */ 66 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/Makefile.linux: -------------------------------------------------------------------------------- 1 | #CC = gcc 2 | COPTS = -O2 -g 3 | CFLAGS = $(COPTS) -I.. -I../../include -fPIC 4 | LDFLAGS = -shared 5 | INSTALL = install 6 | 7 | DESTDIR = $(INSTROOT)@DESTDIR@ 8 | BINDIR = $(DESTDIR)/sbin 9 | MANDIR = $(DESTDIR)/share/man/man8 10 | LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION) 11 | 12 | SUBDIRS := rp-pppoe pppoatm pppol2tp 13 | # Uncomment the next line to include the radius authentication plugin 14 | SUBDIRS += radius 15 | PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so 16 | 17 | # This setting should match the one in ../Makefile.linux 18 | MPPE=y 19 | 20 | ifdef MPPE 21 | CFLAGS += -DMPPE=1 22 | endif 23 | 24 | # include dependencies if present 25 | ifeq (.depend,$(wildcard .depend)) 26 | include .depend 27 | endif 28 | 29 | all: $(PLUGINS) 30 | for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit $$?; done 31 | 32 | %.so: %.c 33 | $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ 34 | 35 | VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h) 36 | 37 | install: $(PLUGINS) 38 | $(INSTALL) -d $(LIBDIR) 39 | $(INSTALL) $? $(LIBDIR) 40 | for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install || exit $$?; done 41 | 42 | clean: 43 | rm -f *.o *.so *.a 44 | for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean || exit $$?; done 45 | 46 | depend: 47 | $(CPP) -M $(CFLAGS) *.c >.depend 48 | for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend || exit $$?; done 49 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/Makefile.sol2: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for plugins on Solaris 2 3 | # 4 | # $Id: Makefile.sol2,v 1.3 2002/09/07 05:15:25 carlsonj Exp $ 5 | # 6 | 7 | include ../../Makedefs.com 8 | 9 | CFLAGS = -c -O -I.. -I../../include $(COPTS) 10 | LDFLAGS = -G 11 | 12 | all: minconn.so 13 | 14 | minconn.so: minconn.o 15 | ld -o $@ $(LDFLAGS) -h $@ minconn.o 16 | 17 | minconn.o: minconn.c 18 | $(CC) $(CFLAGS) -c $? 19 | 20 | passprompt.so: passprompt.o 21 | ld -o $@ $(LDFLAGS) -h $@ passprompt.o 22 | 23 | passprompt.o: passprompt.c 24 | $(CC) $(CFLAGS) -c $? 25 | 26 | clean: 27 | rm -f *.o *.so 28 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/minconn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * minconn.c - pppd plugin to implement a `minconnect' option. 3 | * 4 | * Copyright (c) 1999 Paul Mackerras. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The name(s) of the authors of this software must not be used to 19 | * endorse or promote products derived from this software without 20 | * prior written permission. 21 | * 22 | * 4. Redistributions of any form whatsoever must retain the following 23 | * acknowledgment: 24 | * "This product includes software developed by Paul Mackerras 25 | * ". 26 | * 27 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 28 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 29 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 30 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 31 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 32 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 33 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 34 | */ 35 | #include 36 | #include 37 | #include "pppd.h" 38 | 39 | char pppd_version[] = VERSION; 40 | 41 | static int minconnect = 0; 42 | 43 | static option_t my_options[] = { 44 | { "minconnect", o_int, &minconnect, 45 | "Set minimum connect time before idle timeout applies" }, 46 | { NULL } 47 | }; 48 | 49 | static int my_get_idle(struct ppp_idle *idle) 50 | { 51 | time_t t; 52 | 53 | if (idle == NULL) 54 | return minconnect? minconnect: idle_time_limit; 55 | t = idle->xmit_idle; 56 | if (idle->recv_idle < t) 57 | t = idle->recv_idle; 58 | return idle_time_limit - t; 59 | } 60 | 61 | void plugin_init(void) 62 | { 63 | info("plugin_init"); 64 | add_options(my_options); 65 | idle_time_hook = my_get_idle; 66 | } 67 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/passwordfd.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Author: Arvin Schnell 4 | * 5 | * This plugin let's you pass the password to the pppd via 6 | * a file descriptor. That's easy and secure - no fiddling 7 | * with pap- and chap-secrets files. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "pppd.h" 16 | 17 | char pppd_version[] = VERSION; 18 | 19 | static int passwdfd = -1; 20 | static char save_passwd[MAXSECRETLEN]; 21 | 22 | static option_t options[] = { 23 | { "passwordfd", o_int, &passwdfd, 24 | "Receive password on this file descriptor" }, 25 | { NULL } 26 | }; 27 | 28 | static int pwfd_check (void) 29 | { 30 | return 1; 31 | } 32 | 33 | static int pwfd_passwd (char *user, char *passwd) 34 | { 35 | int readgood, red; 36 | 37 | if (passwdfd == -1) 38 | return -1; 39 | 40 | if (passwd == NULL) 41 | return 1; 42 | 43 | if (passwdfd == -2) { 44 | strcpy (passwd, save_passwd); 45 | return 1; 46 | } 47 | 48 | readgood = 0; 49 | do { 50 | red = read (passwdfd, passwd + readgood, MAXSECRETLEN - 1 - readgood); 51 | if (red == 0) 52 | break; 53 | if (red < 0) { 54 | error ("Can't read secret from fd\n"); 55 | readgood = -1; 56 | break; 57 | } 58 | readgood += red; 59 | } while (readgood < MAXSECRETLEN - 1); 60 | 61 | close (passwdfd); 62 | 63 | if (readgood < 0) 64 | return 0; 65 | 66 | passwd[readgood] = 0; 67 | strcpy (save_passwd, passwd); 68 | passwdfd = -2; 69 | 70 | return 1; 71 | } 72 | 73 | void plugin_init (void) 74 | { 75 | add_options (options); 76 | 77 | pap_check_hook = pwfd_check; 78 | pap_passwd_hook = pwfd_passwd; 79 | 80 | chap_check_hook = pwfd_check; 81 | chap_passwd_hook = pwfd_passwd; 82 | } 83 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/pppoatm/COPYING: -------------------------------------------------------------------------------- 1 | The files ans.c, atm.h, atmres.h, atmsap.h, misc.c, text2atm.c and 2 | text2qos.c are taken from the linux-atm libraries. These are 3 | Copyright 1995-2000 EPFL-LRC/ICA, and are licensed under the GNU Lesser 4 | General Public License. 5 | 6 | The file pppoatm.c contains its own copyright notice, and is licensed 7 | under the GPL. 8 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/pppoatm/Makefile.linux: -------------------------------------------------------------------------------- 1 | #CC = gcc 2 | COPTS = -O2 -g 3 | CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC 4 | LDFLAGS = -shared 5 | INSTALL = install 6 | 7 | #*********************************************************************** 8 | 9 | DESTDIR = $(INSTROOT)@DESTDIR@ 10 | LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION) 11 | 12 | VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h) 13 | 14 | PLUGIN := pppoatm.so 15 | PLUGIN_OBJS := pppoatm.o 16 | 17 | #******* 18 | # Do we have the ATM libraries installed? Set HAVE_LIBATM to use them, 19 | # or leave it unset to build the few routines we actually _use_ into 20 | # the plugin directly. 21 | # 22 | #HAVE_LIBATM=yes 23 | 24 | ifdef HAVE_LIBATM 25 | LIBS := -latm 26 | else 27 | CFLAGS += -I. 28 | PLUGIN_OBJS += text2qos.o text2atm.o misc.o ans.o 29 | LIBS := -lresolv 30 | endif 31 | 32 | #********* 33 | all: $(PLUGIN) 34 | 35 | $(PLUGIN): $(PLUGIN_OBJS) 36 | $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS) 37 | 38 | install: all 39 | $(INSTALL) -d -m 755 $(LIBDIR) 40 | $(INSTALL) -c -m 4550 $(PLUGIN) $(LIBDIR) 41 | 42 | clean: 43 | rm -f *.o *.so 44 | 45 | %.o: %.c 46 | $(CC) $(CFLAGS) -c -o $@ $< 47 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/pppoatm/atmres.h: -------------------------------------------------------------------------------- 1 | /* atmres.h - Common definitions and prototypes for resolver functions */ 2 | 3 | /* Written 1996,1998 by Werner Almesberger, EPFL-LRC/ICA */ 4 | 5 | 6 | #ifndef _ATMRES_H 7 | #define _ATMRES_H 8 | 9 | #include 10 | #include 11 | 12 | 13 | /* Some #defines that may be needed if ANS isn't installed on that system */ 14 | 15 | #ifndef T_ATMA 16 | #define T_ATMA 34 17 | #endif 18 | #ifndef ATMA_AESA 19 | #define ATMA_AESA 0 20 | #endif 21 | #ifndef ATMA_E164 22 | #define ATMA_E164 1 23 | #endif 24 | 25 | /* Return codes for text2atm and atm2text */ 26 | 27 | #define TRY_OTHER -2 28 | #define FATAL -1 /* must be -1 */ 29 | 30 | 31 | int ans_byname(const char *text,struct sockaddr_atmsvc *addr,int length, 32 | int flags); 33 | int ans_byaddr(char *buffer,int length,const struct sockaddr_atmsvc *addr, 34 | int flags); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/pppoatm/atmsap.h: -------------------------------------------------------------------------------- 1 | /* atmsap.h - ATM Service Access Point addressing definitions */ 2 | 3 | /* Written 1996-1998 by Werner Almesberger, EPFL LRC/ICA */ 4 | 5 | 6 | #ifndef _ATMSAP_H 7 | #define _ATMSAP_H 8 | 9 | #include 10 | #include 11 | 12 | 13 | /* 14 | * Selected ISO/IEC TR 9577 Network Layer Protocol Identifiers (NLPID) 15 | */ 16 | 17 | #define NLPID_IEEE802_1_SNAP 0x80 /* IEEE 802.1 SNAP */ 18 | 19 | /* 20 | * Selected Organizationally Unique Identifiers (OUIs) 21 | */ 22 | 23 | #define ATM_FORUM_OUI "\x00\xA0\x3E" /* ATM Forum */ 24 | #define EPFL_OUI "\x00\x60\xD7" /* EPF Lausanne, CH */ 25 | 26 | /* 27 | * Selected vendor-specific application identifiers (for B-HLI). Such an 28 | * identifier consists of three bytes containing the OUI, followed by four 29 | * bytes assigned by the organization owning the OUI. 30 | */ 31 | 32 | #define ANS_HLT_VS_ID ATM_FORUM_OUI "\x00\x00\x00\x01" 33 | /* ATM Name System, af-saa-0069.000 */ 34 | #define VOD_HLT_VS_ID ATM_FORUM_OUI "\x00\x00\x00\x02" 35 | /* VoD, af-saa-0049.001 */ 36 | #define AREQUIPA_HLT_VS_ID EPFL_OUI "\x01\x00\x00\x01" /* Arequipa */ 37 | #define TTCP_HLT_VS_ID EPFL_OUI "\x01\x00\x00\x03" /* ttcp_atm */ 38 | 39 | 40 | /* Mapping of "well-known" TCP, UDP, etc. port numbers to ATM BHLIs. 41 | btd-saa-api-bhli-01.02 */ 42 | 43 | void atm_tcpip_port_mapping(char *vs_id,uint8_t protocol,uint16_t port); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/pppoatm/misc.c: -------------------------------------------------------------------------------- 1 | /* misc.c - Miscellaneous library functions */ 2 | 3 | /* Written 1997-2000 by Werner Almesberger, EPFL-ICA/ICA */ 4 | 5 | #if HAVE_CONFIG_H 6 | #include 7 | #endif 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include /* for htons */ 15 | 16 | #include 17 | #include 18 | 19 | 20 | int __atmlib_fetch(const char **pos,...) 21 | { 22 | const char *value; 23 | int ref_len,best_len,len; 24 | int i,best; 25 | va_list ap; 26 | 27 | va_start(ap,pos); 28 | ref_len = strlen(*pos); 29 | best_len = 0; 30 | best = -1; 31 | for (i = 0; (value = va_arg(ap,const char *)); i++) { 32 | len = strlen(value); 33 | if (*value != '!' && len <= ref_len && len > best_len && 34 | !strncasecmp(*pos,value,len)) { 35 | best = i; 36 | best_len = len; 37 | } 38 | } 39 | va_end(ap); 40 | if (best > -1) (*pos) += best_len; 41 | return best; 42 | } 43 | 44 | 45 | void atm_tcpip_port_mapping(char *vs_id,uint8_t protocol,uint16_t port) 46 | { 47 | memcpy(vs_id,ATM_FORUM_OUI "\x01",4); 48 | vs_id[4] = protocol; /* e.g. IP_TCP or IP_UDP; from netinet/protocols.h */ 49 | vs_id[5] = (htons(port) >> 8) & 255; 50 | vs_id[6] = htons(port) & 255; 51 | } 52 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/pppol2tp/Makefile.linux: -------------------------------------------------------------------------------- 1 | #CC = gcc 2 | COPTS = -O2 -g 3 | CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC 4 | LDFLAGS = -shared 5 | INSTALL = install 6 | 7 | #*********************************************************************** 8 | 9 | DESTDIR = @DESTDIR@ 10 | LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION) 11 | 12 | VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h) 13 | 14 | PLUGINS := pppol2tp.so openl2tp.so 15 | 16 | all: $(PLUGINS) 17 | 18 | %.so: %.o 19 | $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS) 20 | 21 | install: all 22 | $(INSTALL) -d -m 755 $(LIBDIR) 23 | $(INSTALL) -c -m 755 $(PLUGINS) $(LIBDIR) 24 | 25 | clean: 26 | rm -f *.o *.so 27 | 28 | %.o: %.c 29 | $(CC) $(CFLAGS) -c -o $@ $< 30 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/Makefile.linux: -------------------------------------------------------------------------------- 1 | # Makefile for RADIUS plugin 2 | # 3 | # Copyright 2002 Roaring Penguin Software Inc. 4 | # 5 | 6 | DESTDIR = $(INSTROOT)@DESTDIR@ 7 | MANDIR = $(DESTDIR)/share/man/man8 8 | LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION) 9 | 10 | VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h) 11 | 12 | INSTALL = install 13 | 14 | PLUGIN=radius.so radattr.so radrealms.so 15 | CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON 16 | 17 | # Uncomment the next line to include support for Microsoft's 18 | # MS-CHAP authentication protocol. 19 | CHAPMS=y 20 | # Uncomment the next line to include support for MPPE. 21 | MPPE=y 22 | # Uncomment the next lint to include support for traffic limiting 23 | MAXOCTETS=y 24 | 25 | ifdef CHAPMS 26 | CFLAGS += -DCHAPMS=1 27 | ifdef MPPE 28 | CFLAGS += -DMPPE=1 29 | endif 30 | endif 31 | ifdef MAXOCTETS 32 | CFLAGS += -DMAXOCTETS=1 33 | endif 34 | 35 | all: $(PLUGIN) 36 | 37 | install: all 38 | $(INSTALL) -d -m 755 $(LIBDIR) 39 | $(INSTALL) -s -c -m 755 radius.so $(LIBDIR) 40 | $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR) 41 | $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR) 42 | $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR) 43 | $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR) 44 | 45 | radius.so: radius.o libradiusclient.a 46 | $(CC) -o radius.so -shared radius.o libradiusclient.a 47 | 48 | radattr.so: radattr.o 49 | $(CC) -o radattr.so -shared radattr.o 50 | 51 | radrealms.so: radrealms.o 52 | $(CC) -o radrealms.so -shared radrealms.o 53 | 54 | CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \ 55 | clientid.o sendserver.o lock.o util.o md5.o 56 | libradiusclient.a: $(CLIENTOBJS) 57 | $(AR) rv $@ $? 58 | 59 | clean: 60 | rm -f *.o *.so *.a 61 | 62 | distclean: 63 | rm -f *.o *.so *.a 64 | 65 | dist-clean: distclean 66 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/clientid.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: clientid.c,v 1.1 2004/11/14 07:26:26 paulus Exp $ 3 | * 4 | * Copyright (C) 1995,1996,1997 Lars Fenneberg 5 | * 6 | * See the file COPYRIGHT for the respective terms and conditions. 7 | * If the file is missing contact me at lf@elemental.net 8 | * and I'll send you a copy. 9 | * 10 | */ 11 | 12 | #include 13 | #include 14 | 15 | struct map2id_s { 16 | char *name; 17 | UINT4 id; 18 | 19 | struct map2id_s *next; 20 | }; 21 | 22 | static struct map2id_s *map2id_list = NULL; 23 | 24 | /* 25 | * Function: rc_read_mapfile 26 | * 27 | * Purpose: Read in the ttyname to port id map file 28 | * 29 | * Arguments: the file name of the map file 30 | * 31 | * Returns: zero on success, negative integer on failure 32 | */ 33 | 34 | int rc_read_mapfile(char *filename) 35 | { 36 | char buffer[1024]; 37 | FILE *mapfd; 38 | char *c, *name, *id, *q; 39 | struct map2id_s *p; 40 | int lnr = 0; 41 | 42 | if ((mapfd = fopen(filename,"r")) == NULL) 43 | { 44 | error("rc_read_mapfile: can't read %s: %s", filename, strerror(errno)); 45 | return (-1); 46 | } 47 | 48 | #define SKIP(p) while(*p && isspace(*p)) p++; 49 | 50 | while (fgets(buffer, sizeof(buffer), mapfd) != NULL) 51 | { 52 | lnr++; 53 | 54 | q = buffer; 55 | 56 | SKIP(q); 57 | 58 | if ((*q == '\n') || (*q == '#') || (*q == '\0')) 59 | continue; 60 | 61 | if (( c = strchr(q, ' ')) || (c = strchr(q,'\t'))) { 62 | 63 | *c = '\0'; c++; 64 | SKIP(c); 65 | 66 | name = q; 67 | id = c; 68 | 69 | if ((p = (struct map2id_s *)malloc(sizeof(*p))) == NULL) { 70 | novm("rc_read_mapfile"); 71 | return (-1); 72 | } 73 | 74 | p->name = strdup(name); 75 | p->id = atoi(id); 76 | p->next = map2id_list; 77 | map2id_list = p; 78 | 79 | } else { 80 | 81 | error("rc_read_mapfile: malformed line in %s, line %d", filename, lnr); 82 | return (-1); 83 | 84 | } 85 | } 86 | 87 | #undef SKIP 88 | 89 | fclose(mapfd); 90 | 91 | return 0; 92 | } 93 | 94 | /* 95 | * Function: rc_map2id 96 | * 97 | * Purpose: Map ttyname to port id 98 | * 99 | * Arguments: full pathname of the tty 100 | * 101 | * Returns: port id, zero if no entry found 102 | */ 103 | 104 | UINT4 rc_map2id(char *name) 105 | { 106 | struct map2id_s *p; 107 | char ttyname[PATH_MAX]; 108 | 109 | *ttyname = '\0'; 110 | if (*name != '/') 111 | strcpy(ttyname, "/dev/"); 112 | 113 | strncat(ttyname, name, sizeof(ttyname)); 114 | 115 | for(p = map2id_list; p; p = p->next) 116 | if (!strcmp(ttyname, p->name)) return p->id; 117 | 118 | warn("rc_map2id: can't find tty %s in map database", ttyname); 119 | 120 | return 0; 121 | } 122 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/etc/dictionary.compat: -------------------------------------------------------------------------------- 1 | # 2 | # Obsolete names for backwards compatibility with older users files. 3 | # 4 | ATTRIBUTE Client-Id 4 ipaddr 5 | ATTRIBUTE Client-Port-Id 5 integer 6 | ATTRIBUTE User-Service-Type 6 integer 7 | ATTRIBUTE Framed-Address 8 ipaddr 8 | ATTRIBUTE Framed-Netmask 9 ipaddr 9 | ATTRIBUTE Framed-Filter-Id 11 string 10 | ATTRIBUTE Login-Host 14 ipaddr 11 | ATTRIBUTE Login-Port 16 integer 12 | ATTRIBUTE Old-Password 17 string 13 | ATTRIBUTE Port-Message 18 string 14 | ATTRIBUTE Dialback-No 19 string 15 | ATTRIBUTE Dialback-Name 20 string 16 | ATTRIBUTE Challenge-State 24 string 17 | VALUE Framed-Compression Van-Jacobsen-TCP-IP 1 18 | VALUE Framed-Compression VJ-TCP-IP 1 19 | VALUE Service-Type Shell-User 6 20 | VALUE Auth-Type Unix 1 21 | VALUE Service-Type Dialback-Login-User 3 22 | VALUE Service-Type Dialback-Framed-User 4 23 | 24 | # 25 | # For compatibility with MERIT users files. 26 | # 27 | ATTRIBUTE NAS-Port 5 integer 28 | ATTRIBUTE Login-Host 14 ipaddr 29 | ATTRIBUTE Login-Callback-Number 19 string 30 | ATTRIBUTE Framed-Callback-Id 20 string 31 | ATTRIBUTE Client-Port-DNIS 30 string 32 | ATTRIBUTE Caller-ID 31 string 33 | VALUE Service-Type Login 1 34 | VALUE Service-Type Framed 2 35 | VALUE Service-Type Callback-Login 3 36 | VALUE Service-Type Callback-Framed 4 37 | VALUE Service-Type Exec-User 7 38 | 39 | # 40 | # For compatibility with ESVA RADIUS, Old Cistron RADIUS 41 | # 42 | ATTRIBUTE Session 1034 integer 43 | ATTRIBUTE User-Name-Is-Star 1035 integer 44 | VALUE User-Name-Is-Star No 0 45 | VALUE User-Name-Is-Star Yes 1 46 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/etc/dictionary.merit: -------------------------------------------------------------------------------- 1 | # 2 | # Experimental extensions, configuration only (for check-items) 3 | # Names/numbers as per the MERIT extensions (if possible). 4 | # 5 | ATTRIBUTE NAS-Identifier 32 string 6 | ATTRIBUTE Proxy-State 33 string 7 | ATTRIBUTE Login-LAT-Service 34 string 8 | ATTRIBUTE Login-LAT-Node 35 string 9 | ATTRIBUTE Login-LAT-Group 36 string 10 | ATTRIBUTE Framed-AppleTalk-Link 37 integer 11 | ATTRIBUTE Framed-AppleTalk-Network 38 integer 12 | ATTRIBUTE Framed-AppleTalk-Zone 39 string 13 | ATTRIBUTE Acct-Input-Packets 47 integer 14 | ATTRIBUTE Acct-Output-Packets 48 integer 15 | # 8 is a MERIT extension. 16 | VALUE Service-Type Authenticate-Only 8 17 | 18 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/etc/issue: -------------------------------------------------------------------------------- 1 | (\I) 2 | ----------------------------------------------------- 3 | \S \R (\N) (port \L) 4 | ----------------------------------------------------- 5 | 6 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/etc/port-id-map: -------------------------------------------------------------------------------- 1 | # 2 | # port-id-map 3 | # 4 | # This file describes the ttyname to port id mapping. The port id 5 | # is reported as part of a RADIUS authentication or accouting request. 6 | # 7 | #ttyname (as returned by ttyname(3)) port-id 8 | /dev/tty1 1 9 | /dev/tty2 2 10 | /dev/tty3 3 11 | /dev/tty4 4 12 | /dev/tty5 5 13 | /dev/tty6 6 14 | /dev/tty7 7 15 | /dev/tty8 8 16 | /dev/ttyS0 9 17 | /dev/ttyS1 10 18 | /dev/ttyS2 11 19 | /dev/ttyS3 12 20 | /dev/ttyS4 13 21 | /dev/ttyS5 14 22 | /dev/ttyS6 15 23 | /dev/ttyS7 16 24 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/etc/realms: -------------------------------------------------------------------------------- 1 | # /etc/radiusclient/realms 2 | # 3 | # Handle realm @netservers.co.uk on an internal RADIUS server 4 | # (note the server must be told to strip the realm) 5 | 6 | #authserver netservers.co.uk 192.168.1.1:1812 7 | #acctserver netservers.co.uk 192.168.1.1:1813 8 | 9 | # users in realm @example.com are handled by separate servers 10 | 11 | #authserver example.com 10.0.0.1:1812 12 | #acctserver example.com 10.0.0.2:1813 13 | 14 | # the DEFAULT realm matches users that do not supply a realm 15 | 16 | #authserver DEFAULT 192.168.1.1:1812 17 | #acctserver DEFAULT 192.168.1.1:1813 18 | 19 | # Any realms that do not match in the realms file automatically fall 20 | # through to the standard radius plugin which uses the servers in the 21 | # radiusclient.conf file. Note that this is different than the 22 | # DEFAULT realm match, above. 23 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/etc/servers: -------------------------------------------------------------------------------- 1 | #Server Name or Client/Server pair Key 2 | #---------------- --------------- 3 | #portmaster.elemental.net hardlyasecret 4 | #portmaster2.elemental.net donttellanyone 5 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/includes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: includes.h,v 1.1 2004/11/14 07:26:26 paulus Exp $ 3 | * 4 | * Copyright (C) 1997 Lars Fenneberg 5 | * 6 | * Copyright 1992 Livingston Enterprises, Inc. 7 | * 8 | * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 9 | * and Merit Network, Inc. All Rights Reserved 10 | * 11 | * See the file COPYRIGHT for the respective terms and conditions. 12 | * If the file is missing contact me at lf@elemental.net 13 | * and I'll send you a copy. 14 | * 15 | */ 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | 35 | #ifndef PATH_MAX 36 | #define PATH_MAX 1024 37 | #endif 38 | 39 | #ifndef UCHAR_MAX 40 | # define UCHAR_MAX 255 41 | #endif 42 | 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #include 49 | 50 | #include "magic.h" 51 | 52 | /* rlib/lock.c */ 53 | int do_lock_exclusive(int); 54 | int do_unlock(int); 55 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/lock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: lock.c,v 1.1 2004/11/14 07:26:26 paulus Exp $ 3 | * 4 | * Copyright (C) 1997 Lars Fenneberg 5 | * 6 | * See the file COPYRIGHT for the respective terms and conditions. 7 | * If the file is missing contact me at lf@elemental.net 8 | * and I'll send you a copy. 9 | * 10 | */ 11 | 12 | #include "includes.h" 13 | #include 14 | #include 15 | 16 | int do_lock_exclusive(int fd) 17 | { 18 | struct flock fl; 19 | int res; 20 | 21 | memset((void *)&fl, 0, sizeof(fl)); 22 | 23 | fl.l_type = F_WRLCK; 24 | fl.l_whence = fl.l_start = 0; 25 | fl.l_len = 0; /* 0 means "to end of file" */ 26 | 27 | res = fcntl(fd, F_SETLK, &fl); 28 | 29 | if ((res == -1) && (errno == EAGAIN)) 30 | errno = EWOULDBLOCK; 31 | 32 | return res; 33 | } 34 | 35 | int do_unlock(int fd) 36 | { 37 | struct flock fl; 38 | 39 | memset((void *)&fl, 0, sizeof(fl)); 40 | 41 | fl.l_type = F_UNLCK; 42 | fl.l_whence = fl.l_start = 0; 43 | fl.l_len = 0; /* 0 means "to end of file" */ 44 | 45 | return fcntl(fd, F_SETLK, &fl); 46 | } 47 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/md5.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: md5.c,v 1.1 2004/11/14 07:26:26 paulus Exp $ 3 | */ 4 | #include "md5.h" 5 | 6 | void rc_md5_calc (unsigned char *output, unsigned char *input, unsigned int inlen) 7 | { 8 | MD5_CTX context; 9 | 10 | MD5_Init (&context); 11 | MD5_Update (&context, input, inlen); 12 | MD5_Final (output, &context); 13 | } 14 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/options.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: options.h,v 1.1 2004/11/14 07:26:26 paulus Exp $ 3 | * 4 | * Copyright (C) 1996 Lars Fenneberg 5 | * 6 | * See the file COPYRIGHT for the respective terms and conditions. 7 | * If the file is missing contact me at lf@elemental.net 8 | * and I'll send you a copy. 9 | * 10 | */ 11 | 12 | #define OPTION_LEN 64 13 | 14 | /* ids for different option types */ 15 | #define OT_STR (1<<0) /* string */ 16 | #define OT_INT (1<<1) /* integer */ 17 | #define OT_SRV (1<<2) /* server list */ 18 | #define OT_AUO (1<<3) /* authentication order */ 19 | 20 | #define OT_ANY ((unsigned int)~0) /* used internally */ 21 | 22 | /* status types */ 23 | #define ST_UNDEF (1<<0) /* option is undefined */ 24 | 25 | typedef struct _option { 26 | char name[OPTION_LEN]; /* name of the option */ 27 | int type, status; /* type and status */ 28 | void *val; /* pointer to option value */ 29 | } OPTION; 30 | 31 | static SERVER acctserver = {0}; 32 | static SERVER authserver = {0}; 33 | 34 | int default_tries = 4; 35 | int default_timeout = 60; 36 | 37 | static OPTION config_options[] = { 38 | /* internally used options */ 39 | {"config_file", OT_STR, ST_UNDEF, NULL}, 40 | /* General options */ 41 | {"auth_order", OT_AUO, ST_UNDEF, NULL}, 42 | {"login_tries", OT_INT, ST_UNDEF, &default_tries}, 43 | {"login_timeout", OT_INT, ST_UNDEF, &default_timeout}, 44 | {"nologin", OT_STR, ST_UNDEF, "/etc/nologin"}, 45 | {"issue", OT_STR, ST_UNDEF, "/etc/radiusclient/issue"}, 46 | /* RADIUS specific options */ 47 | {"authserver", OT_SRV, ST_UNDEF, &authserver}, 48 | {"acctserver", OT_SRV, ST_UNDEF, &acctserver}, 49 | {"servers", OT_STR, ST_UNDEF, NULL}, 50 | {"dictionary", OT_STR, ST_UNDEF, NULL}, 51 | {"login_radius", OT_STR, ST_UNDEF, "/usr/sbin/login.radius"}, 52 | {"seqfile", OT_STR, ST_UNDEF, NULL}, 53 | {"mapfile", OT_STR, ST_UNDEF, NULL}, 54 | {"default_realm", OT_STR, ST_UNDEF, NULL}, 55 | {"radius_timeout", OT_INT, ST_UNDEF, NULL}, 56 | {"radius_retries", OT_INT, ST_UNDEF, NULL}, 57 | {"nas_identifier", OT_STR, ST_UNDEF, ""}, 58 | {"bindaddr", OT_STR, ST_UNDEF, NULL}, 59 | /* local options */ 60 | {"login_local", OT_STR, ST_UNDEF, NULL}, 61 | }; 62 | 63 | static int num_options = ((sizeof(config_options))/(sizeof(config_options[0]))); 64 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/pathnames.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: pathnames.h,v 1.1 2004/11/14 07:26:26 paulus Exp $ 3 | * 4 | * Copyright (C) 1995,1996 Lars Fenneberg 5 | * 6 | * Copyright 1992 Livingston Enterprises, Inc. 7 | * 8 | * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 9 | * and Merit Network, Inc. All Rights Reserved 10 | * 11 | * See the file COPYRIGHT for the respective terms and conditions. 12 | * If the file is missing contact me at lf@elemental.net 13 | * and I'll send you a copy. 14 | * 15 | */ 16 | 17 | #ifndef PATHNAMES_H 18 | #define PATHNAMES_H 19 | 20 | #define _PATH_DEV_URANDOM "/dev/urandom" /* Linux only */ 21 | #define _PATH_ETC_ISSUE "/etc/issue" 22 | 23 | /* normally defined in the Makefile */ 24 | #ifndef _PATH_ETC_RADIUSCLIENT_CONF 25 | #define _PATH_ETC_RADIUSCLIENT_CONF "/etc/radiusclient.conf" 26 | #endif 27 | 28 | #endif /* PATHNAMES_H */ 29 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/pppd-radattr.8: -------------------------------------------------------------------------------- 1 | .\" manual page [] for RADATTR plugin for pppd 2.4 2 | .\" $Id: pppd-radattr.8,v 1.2 2003/04/25 07:33:20 fcusack Exp $ 3 | .\" SH section heading 4 | .\" SS subsection heading 5 | .\" LP paragraph 6 | .\" IP indented paragraph 7 | .\" TP hanging label 8 | .TH PPPD-RADATTR 8 9 | .SH NAME 10 | radattr.so \- RADIUS utility plugin for 11 | .BR pppd (8) 12 | .SH SYNOPSIS 13 | .B pppd 14 | [ 15 | .I options 16 | ] 17 | plugin radius.so plugin radattr.so 18 | .SH DESCRIPTION 19 | .LP 20 | The radattr plugin for pppd causes all radius attributes returned by 21 | the RADIUS server at authentication time to be stored in the file 22 | .I /var/run/radattr.pppN 23 | where 24 | .I pppN 25 | is the name of the PPP interface. The RADIUS attributes are stored 26 | one per line in the format "Attribute-Name Attribute-Value". This 27 | format is convenient for use in /etc/ppp/ip-up and /etc/ppp/ip-down 28 | scripts. 29 | .LP 30 | Note that you 31 | .I must 32 | load the radius.so plugin before loading the radattr.so plugin; 33 | radattr.so depends on symbols defined in radius.so. 34 | 35 | .SH USAGE 36 | To use the plugin, simply supply the 37 | .B plugin radius.so plugin radattr.so 38 | options to pppd. 39 | 40 | .SH SEE ALSO 41 | .BR pppd (8) " pppd-radius" (8) 42 | 43 | .SH AUTHOR 44 | David F. Skoll 45 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/pppd-radius.8: -------------------------------------------------------------------------------- 1 | .\" manual page [] for RADIUS plugin for pppd 2.4 2 | .\" $Id: pppd-radius.8,v 1.5 2004/03/26 13:27:17 kad Exp $ 3 | .\" SH section heading 4 | .\" SS subsection heading 5 | .\" LP paragraph 6 | .\" IP indented paragraph 7 | .\" TP hanging label 8 | .TH PPPD-RADIUS 8 9 | .SH NAME 10 | radius.so \- RADIUS authentication plugin for 11 | .BR pppd (8) 12 | .SH SYNOPSIS 13 | .B pppd 14 | [ 15 | .I options 16 | ] 17 | plugin radius.so 18 | .SH DESCRIPTION 19 | .LP 20 | The RADIUS plugin for pppd permits pppd to perform PAP, CHAP, MS-CHAP and 21 | MS-CHAPv2 authentication against a RADIUS server instead of the usual 22 | .I /etc/ppp/pap-secrets 23 | and 24 | .I /etc/ppp/chap-secrets 25 | files. 26 | .LP 27 | The RADIUS plugin is built on a library called 28 | .B radiusclient 29 | which has its own configuration files (usually in \fI/etc/radiusclient\fR), 30 | consult those files for more information on configuring the RADIUS 31 | plugin 32 | 33 | .SH OPTIONS 34 | The RADIUS plugin introduces one additional pppd option: 35 | .TP 36 | .BI "radius-config-file " filename 37 | The file 38 | .I filename 39 | is taken as the radiusclient configuration file. If this option is not 40 | used, then the plugin uses 41 | .I /etc/radiusclient/radiusclient.conf 42 | as the configuration file. 43 | .TP 44 | .BI "avpair " attribute=value 45 | Adds an Attribute-Value pair to be passed on to the RADIUS server on each request. 46 | .TP 47 | .BI map-to-ifname 48 | Sets Radius NAS-Port attribute to number equal to interface name (Default) 49 | .TP 50 | .BI map-to-ttyname 51 | Sets Radius NAS-Port attribute value via libradiusclient library 52 | 53 | .SH USAGE 54 | To use the plugin, simply supply the 55 | .B plugin radius.so 56 | option to pppd, and edit 57 | .I /etc/radiusclient/radiusclient.conf 58 | appropriately. If you use the RADIUS plugin, the normal pppd authentication 59 | schemes (login, checking the /etc/ppp/*-secrets files) are skipped. The 60 | RADIUS server should assign an IP address to the peer using the RADIUS 61 | Framed-IP-Address attribute. 62 | 63 | .SH SEE ALSO 64 | .BR pppd (8) " pppd-radattr" (8) 65 | 66 | .SH AUTHOR 67 | David F. Skoll 68 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/radius/util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: util.c,v 1.1 2004/11/14 07:26:26 paulus Exp $ 3 | * 4 | * Copyright (C) 1995,1996,1997 Lars Fenneberg 5 | * 6 | * Copyright 1992 Livingston Enterprises, Inc. 7 | * 8 | * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 9 | * and Merit Network, Inc. All Rights Reserved 10 | * 11 | * See the file COPYRIGHT for the respective terms and conditions. 12 | * If the file is missing contact me at lf@elemental.net 13 | * and I'll send you a copy. 14 | * 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | /* 21 | * Function: rc_str2tm 22 | * 23 | * Purpose: Turns printable string into correct tm struct entries. 24 | * 25 | */ 26 | 27 | static const char * months[] = 28 | { 29 | "Jan", "Feb", "Mar", "Apr", "May", "Jun", 30 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" 31 | }; 32 | 33 | void rc_str2tm (char *valstr, struct tm *tm) 34 | { 35 | int i; 36 | 37 | /* Get the month */ 38 | for (i = 0; i < 12; i++) 39 | { 40 | if (strncmp (months[i], valstr, 3) == 0) 41 | { 42 | tm->tm_mon = i; 43 | i = 13; 44 | } 45 | } 46 | 47 | /* Get the Day */ 48 | tm->tm_mday = atoi (&valstr[4]); 49 | 50 | /* Now the year */ 51 | tm->tm_year = atoi (&valstr[7]) - 1900; 52 | } 53 | 54 | void rc_mdelay(int msecs) 55 | { 56 | struct timeval tv; 57 | 58 | tv.tv_sec = (int) msecs / 1000; 59 | tv.tv_usec = (msecs % 1000) * 1000; 60 | 61 | select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL, &tv); 62 | } 63 | 64 | /* 65 | * Function: rc_mksid 66 | * 67 | * Purpose: generate a quite unique string 68 | * 69 | * Remarks: not that unique at all... 70 | * 71 | */ 72 | 73 | char * 74 | rc_mksid (void) 75 | { 76 | static char buf[15]; 77 | static unsigned short int cnt = 0; 78 | sprintf (buf, "%08lX%04X%02hX", 79 | (unsigned long int) time (NULL), 80 | (unsigned int) getpid (), 81 | cnt & 0xFF); 82 | cnt++; 83 | return buf; 84 | } 85 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/rp-pppoe/.gitignore: -------------------------------------------------------------------------------- 1 | pppoe-discovery 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/plugins/rp-pppoe/Makefile.linux: -------------------------------------------------------------------------------- 1 | # Generated automatically from Makefile.in by configure. 2 | #*********************************************************************** 3 | # 4 | # Makefile 5 | # 6 | # Makefile for Roaring Penguin's Linux PPPoE plugin. 7 | # Modified for integration with pppd sources by Paul Mackerras. 8 | # 9 | # Copyright (C) 2001 Roaring Penguin Software Inc. 10 | # 11 | # This program may be distributed according to the terms of the GNU 12 | # General Public License, version 2 or (at your option) any later version. 13 | # 14 | # $Id: Makefile.linux,v 1.8 2008/06/09 08:34:23 paulus Exp $ 15 | #*********************************************************************** 16 | 17 | DESTDIR = $(INSTROOT)@DESTDIR@ 18 | BINDIR = $(DESTDIR)/sbin 19 | LIBDIR = $(DESTDIR)/lib/pppd/$(PPPDVERSION) 20 | 21 | PPPDVERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h) 22 | 23 | INSTALL = install 24 | 25 | # Version is set ONLY IN THE MAKEFILE! Don't delete this! 26 | RP_VERSION=3.8p 27 | 28 | COPTS=-O2 -g 29 | CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"' 30 | all: rp-pppoe.so pppoe-discovery 31 | 32 | pppoe-discovery: pppoe-discovery.o debug.o 33 | $(CC) -o pppoe-discovery pppoe-discovery.o debug.o 34 | 35 | pppoe-discovery.o: pppoe-discovery.c 36 | $(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c 37 | 38 | debug.o: debug.c 39 | $(CC) $(CFLAGS) -c -o debug.o debug.c 40 | 41 | rp-pppoe.so: plugin.o discovery.o if.o common.o 42 | $(CC) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o 43 | 44 | install: all 45 | $(INSTALL) -d -m 755 $(LIBDIR) 46 | $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR) 47 | $(INSTALL) -d -m 755 $(BINDIR) 48 | $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR) 49 | 50 | clean: 51 | rm -f *.o *.so pppoe-discovery 52 | 53 | plugin.o: plugin.c 54 | $(CC) $(CFLAGS) -I../../.. -c -o plugin.o -fPIC plugin.c 55 | 56 | discovery.o: discovery.c 57 | $(CC) $(CFLAGS) -I../../.. -c -o discovery.o -fPIC discovery.c 58 | 59 | if.o: if.c 60 | $(CC) $(CFLAGS) -I../../.. -c -o if.o -fPIC if.c 61 | 62 | common.o: common.c 63 | $(CC) $(CFLAGS) -I../../.. -c -o common.o -fPIC common.c 64 | 65 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/ppp.pam: -------------------------------------------------------------------------------- 1 | #%PAM-1.0 2 | # Information for the PPPD process with the 'login' option. 3 | auth required pam_nologin.so 4 | auth required pam_unix.so 5 | account required pam_unix.so 6 | session required pam_unix.so 7 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/pppcrypt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1 3 | * 4 | * Extracted from chap_ms.c by James Carlson. 5 | * 6 | * Copyright (c) 1995 Eric Rosenquist. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. The name(s) of the authors of this software must not be used to 21 | * endorse or promote products derived from this software without 22 | * prior written permission. 23 | * 24 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 25 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 26 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 27 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 28 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 29 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 30 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 31 | */ 32 | 33 | #ifndef PPPCRYPT_H 34 | #define PPPCRYPT_H 35 | 36 | #ifdef HAVE_CRYPT_H 37 | #include 38 | #endif 39 | 40 | #ifndef USE_CRYPT 41 | #include 42 | #endif 43 | 44 | extern bool DesSetkey __P((u_char *)); 45 | extern bool DesEncrypt __P((u_char *, u_char *)); 46 | extern bool DesDecrypt __P((u_char *, u_char *)); 47 | 48 | #endif /* PPPCRYPT_H */ 49 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/sha1.h: -------------------------------------------------------------------------------- 1 | /* sha1.h */ 2 | 3 | /* If OpenSSL is in use, then use that version of SHA-1 */ 4 | #ifdef OPENSSL 5 | #include 6 | #define __SHA1_INCLUDE_ 7 | #endif 8 | 9 | #ifndef __SHA1_INCLUDE_ 10 | 11 | #ifndef SHA1_SIGNATURE_SIZE 12 | #ifdef SHA_DIGESTSIZE 13 | #define SHA1_SIGNATURE_SIZE SHA_DIGESTSIZE 14 | #else 15 | #define SHA1_SIGNATURE_SIZE 20 16 | #endif 17 | #endif 18 | 19 | typedef struct { 20 | u_int32_t state[5]; 21 | u_int32_t count[2]; 22 | unsigned char buffer[64]; 23 | } SHA1_CTX; 24 | 25 | extern void SHA1_Init(SHA1_CTX *); 26 | extern void SHA1_Update(SHA1_CTX *, const unsigned char *, unsigned int); 27 | extern void SHA1_Final(unsigned char[SHA1_SIGNATURE_SIZE], SHA1_CTX *); 28 | 29 | #define __SHA1_INCLUDE_ 30 | #endif /* __SHA1_INCLUDE_ */ 31 | 32 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppd/spinlock.h: -------------------------------------------------------------------------------- 1 | #ifndef __SPINLOCK_H__ 2 | #define __SPINLOCK_H__ 3 | 4 | #ifdef HAVE_CONFIG_H 5 | #include 6 | #endif 7 | 8 | #include "tdb.h" 9 | 10 | #ifdef USE_SPINLOCKS 11 | 12 | #define RWLOCK_BIAS 0x1000UL 13 | 14 | /* OS SPECIFIC */ 15 | #define MAX_BUSY_LOOPS 1000 16 | #undef USE_SCHED_YIELD 17 | 18 | /* ARCH SPECIFIC */ 19 | /* We should make sure these are padded to a cache line */ 20 | #if defined(SPARC_SPINLOCKS) 21 | typedef volatile char spinlock_t; 22 | #elif defined(POWERPC_SPINLOCKS) 23 | typedef volatile unsigned long spinlock_t; 24 | #elif defined(INTEL_SPINLOCKS) 25 | typedef volatile int spinlock_t; 26 | #elif defined(MIPS_SPINLOCKS) 27 | typedef volatile unsigned long spinlock_t; 28 | #else 29 | #error Need to implement spinlock code in spinlock.h 30 | #endif 31 | 32 | typedef struct { 33 | spinlock_t lock; 34 | volatile int count; 35 | } tdb_rwlock_t; 36 | 37 | int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type); 38 | int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type); 39 | int tdb_create_rwlocks(int fd, unsigned int hash_size); 40 | int tdb_clear_spinlocks(TDB_CONTEXT *tdb); 41 | 42 | #define TDB_SPINLOCK_SIZE(hash_size) (((hash_size) + 1) * sizeof(tdb_rwlock_t)) 43 | 44 | #else /* !USE_SPINLOCKS */ 45 | #if 0 46 | #define tdb_create_rwlocks(fd, hash_size) 0 47 | #define tdb_spinlock(tdb, list, rw_type) (-1) 48 | #define tdb_spinunlock(tdb, list, rw_type) (-1) 49 | #else 50 | int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type); 51 | int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type); 52 | int tdb_create_rwlocks(int fd, unsigned int hash_size); 53 | #endif 54 | int tdb_clear_spinlocks(TDB_CONTEXT *tdb); 55 | #define TDB_SPINLOCK_SIZE(hash_size) 0 56 | 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppdump/.gitignore: -------------------------------------------------------------------------------- 1 | pppdump 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppdump/Makefile.linux: -------------------------------------------------------------------------------- 1 | DESTDIR = $(INSTROOT)@DESTDIR@ 2 | BINDIR = $(DESTDIR)/sbin 3 | MANDIR = $(DESTDIR)/share/man/man8 4 | 5 | CFLAGS= -O -I../include/net 6 | OBJS = pppdump.o bsd-comp.o deflate.o zlib.o 7 | 8 | INSTALL= install 9 | 10 | all: pppdump 11 | 12 | pppdump: $(OBJS) 13 | $(CC) -o pppdump $(OBJS) 14 | 15 | clean: 16 | rm -f pppdump $(OBJS) *~ 17 | 18 | install: 19 | mkdir -p $(BINDIR) $(MANDIR) 20 | $(INSTALL) -s -c pppdump $(BINDIR) 21 | $(INSTALL) -c -m 444 pppdump.8 $(MANDIR) 22 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppdump/Makefile.sol2: -------------------------------------------------------------------------------- 1 | # 2 | # pppdump Makefile for SVR4 systems 3 | # $Id: Makefile.sol2,v 1.4 2002/09/07 05:15:25 carlsonj Exp $ 4 | # 5 | 6 | include ../Makedefs.com 7 | 8 | CFLAGS= $(COPTS) -I../include/net 9 | OBJS = pppdump.o bsd-comp.o deflate.o zlib.o 10 | 11 | all: pppdump 12 | 13 | pppdump: $(OBJS) 14 | $(CC) -o pppdump $(OBJS) 15 | 16 | clean: 17 | rm -f $(OBJS) pppdump *~ 18 | 19 | install: 20 | $(INSTALL) -f $(BINDIR) pppdump 21 | $(INSTALL) -m 444 -f $(MANDIR)/man8 pppdump.8 22 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppdump/pppdump.8: -------------------------------------------------------------------------------- 1 | .\" @(#) $Id: pppdump.8,v 1.2 2004/11/13 12:22:49 paulus Exp $ 2 | .TH PPPDUMP 8 "1 April 1999" 3 | .SH NAME 4 | pppdump \- convert PPP record file to readable format 5 | .SH SYNOPSIS 6 | .B pppdump 7 | [ 8 | .B \-h 9 | | 10 | .B \-p 11 | [ 12 | .B \-d 13 | ]] [ 14 | .B \-r 15 | ] [ 16 | .B \-m \fImru 17 | ] [ 18 | .I file \fR... 19 | ] 20 | .ti 12 21 | .SH DESCRIPTION 22 | The 23 | .B pppdump 24 | utility converts the files written using the \fIrecord\fR option of 25 | .B pppd 26 | into a human-readable format. If one or more filenames are specified, 27 | .B pppdump 28 | will read each in turn; otherwise it will read its standard input. In 29 | each case the result is written to standard output. 30 | .PP 31 | The options are as follows: 32 | .TP 33 | .B \-h 34 | Prints the bytes sent and received in hexadecimal. If neither this 35 | option nor the \fB\-p\fR option is specified, the bytes are printed as 36 | the characters themselves, with non-printing and non-ASCII characters 37 | printed as escape sequences. 38 | .TP 39 | .B \-p 40 | Collects the bytes sent and received into PPP packets, interpreting 41 | the async HDLC framing and escape characters and checking the FCS 42 | (frame check sequence) of each packet. The packets are printed as hex 43 | values and as characters (non-printable characters are printed as 44 | `.'). 45 | .TP 46 | .B \-d 47 | With the \fB\-p\fR option, this option causes 48 | .B pppdump 49 | to decompress packets which have been compressed with the BSD-Compress 50 | or Deflate methods. 51 | .TP 52 | .B \-r 53 | Reverses the direction indicators, so that `sent' is printed for 54 | bytes or packets received, and `rcvd' is printed for bytes or packets 55 | sent. 56 | .TP 57 | .B \-m \fImru 58 | Use \fImru\fR as the MRU (maximum receive unit) for both directions of 59 | the link when checking for over-length PPP packets (with the \fB\-p\fR 60 | option). 61 | .SH SEE ALSO 62 | pppd(8) 63 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppstats/.gitignore: -------------------------------------------------------------------------------- 1 | pppstats 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppstats/Makefile.linux: -------------------------------------------------------------------------------- 1 | # 2 | # pppstats makefile 3 | # $Id: Makefile.linux,v 1.9 2006/06/04 05:07:46 paulus Exp $ 4 | # 5 | DESTDIR = $(INSTROOT)@DESTDIR@ 6 | BINDIR = $(DESTDIR)/sbin 7 | MANDIR = $(DESTDIR)/share/man/man8 8 | 9 | PPPSTATSRCS = pppstats.c 10 | PPPSTATOBJS = pppstats.o 11 | 12 | #CC = gcc 13 | COPTS = -O 14 | COMPILE_FLAGS = -I../include 15 | LIBS = 16 | 17 | INSTALL= install 18 | 19 | CFLAGS = $(COPTS) $(COMPILE_FLAGS) 20 | 21 | all: pppstats 22 | 23 | install: pppstats 24 | -mkdir -p $(MANDIR) 25 | $(INSTALL) -s -c pppstats $(BINDIR) 26 | $(INSTALL) -c -m 444 pppstats.8 $(MANDIR) 27 | 28 | pppstats: $(PPPSTATSRCS) 29 | $(CC) $(CFLAGS) -o pppstats pppstats.c $(LIBS) 30 | 31 | clean: 32 | rm -f pppstats *~ #* core 33 | 34 | depend: 35 | cpp -M $(CFLAGS) $(PPPSTATSRCS) >.depend 36 | # makedepend $(CFLAGS) $(PPPSTATSRCS) 37 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/pppstats/Makefile.sol2: -------------------------------------------------------------------------------- 1 | # 2 | # pppstats Makefile for SVR4 systems 3 | # $Id: Makefile.sol2,v 1.10 2002/09/07 05:15:25 carlsonj Exp $ 4 | # 5 | 6 | include ../Makedefs.com 7 | 8 | CFLAGS = -DSTREAMS -I../include $(COPTS) 9 | 10 | all: pppstats 11 | 12 | pppstats: pppstats.c 13 | $(CC) $(CFLAGS) -o pppstats pppstats.c 14 | 15 | install: pppstats 16 | $(INSTALL) -f $(BINDIR) pppstats 17 | $(INSTALL) -m 444 -f $(MANDIR)/man8 pppstats.8 18 | 19 | clean: 20 | rm -f pppstats *~ core 21 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/callback: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ################################################################### 3 | # 4 | # Script to dial the remote system, negotiate the connection, and send 5 | # it the id. Then wait for the modem to disconnect. Reset the modem 6 | # to answer mode and wait for the system to call back. 7 | # 8 | # The telephone number and modempass are used when establishing the 9 | # connection to the modem. 10 | # 11 | PHONE=555-1212 12 | MODEMPASS=modem_identifier 13 | # 14 | # Once the modem calls back, the account name and password are used for 15 | # a UNIX style login operation. 16 | # 17 | ACCOUNT=my_account_name 18 | PASSWORD=my_password 19 | 20 | ################################################################### 21 | # 22 | # Step 1. Dial the modem and negotiate the initial dialog. 23 | # note: the modem is configured to ignore loss of DCD at this point. 24 | # it is important that this be performed because the loss of DCD 25 | # will normally prevent system from working since 'modem' is used 26 | # for pppd. 27 | # 28 | # The script is terminated normally when the carrier is lost. 29 | # 30 | chat -v \ 31 | TIMEOUT 3 \ 32 | ABORT '\nBUSY\r' \ 33 | ABORT '\nNO ANSWER\r' \ 34 | ABORT '\nRINGING\r\n\r\nRINGING\r' \ 35 | '' AT \ 36 | 'OK-+++\c-OK' 'AT&C0&D2S0=0H0' \ 37 | TIMEOUT 30 \ 38 | OK ATDT$TELEPHONE \ 39 | CONNECT '' \ 40 | assword: $MODEMPASS \ 41 | "\nNO CARRIER\r" 42 | 43 | if [ "$?" = "0" ]; then 44 | 45 | ################################################################### 46 | # 47 | # Step 2. Wait for the call back from the remote. This will wait for at most 48 | # 30 seconds for the call back should the first attempt fail or 49 | # something happen with the callback logic at the remote. 50 | # 51 | # note: when the callback occurs, the DCD setting is re-enabled. 52 | # 53 | # If some voice call should happen during this period, the system will 54 | # answer the telephone and then hang up on them. I realize that this is 55 | # rude, but there is little that this script can do. 56 | # 57 | chat -v \ 58 | TIMEOUT 30 \ 59 | ABORT '\nVOICE\r' \ 60 | '\nRING\r' 'AT&C1A' \ 61 | CONNECT '' \ 62 | TIMEOUT 10 \ 63 | ogin:--ogin: $ACCOUNT \ 64 | TIMEOUT 45 \ 65 | assword: $PASSWORD 66 | 67 | if [ "$?" = "0" ]; then 68 | exit 0 69 | fi 70 | fi 71 | 72 | ################################################################### 73 | # 74 | # The script has failed. Terminate the connection mode. 75 | # 76 | chat -v TIMEOUT 3 "" AT 'OK-+++\c-OK' 'AT&C1&D2S0=0H0' OK 77 | exit 1 78 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/ip-down.local.add: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # This sample code shows you one way to modify your setup to allow automatic 4 | # configuration of your resolv.conf for peer supplied DNS addresses when using 5 | # the `usepeerdns' option. 6 | # 7 | # In my case I just added this to my /etc/ppp/ip-down.local script. You may need to 8 | # create an executable script if one does not exist. 9 | # 10 | # Nick Walker (nickwalker@email.com) 11 | # 12 | 13 | if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then 14 | if [ -f /etc/ppp/resolv.prev ]; then 15 | cp -f /etc/ppp/resolv.prev /etc/resolv.conf 16 | else 17 | rm -f /etc/resolv.conf 18 | fi 19 | fi 20 | 21 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/ip-up.local.add: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # This sample code shows you one way to modify your setup to allow automatic 4 | # configuration of your resolv.conf for peer supplied DNS addresses when using 5 | # the `usepeerdns' option. 6 | # 7 | # In my case I just added this to my /etc/ppp/ip-up.local script. You may need to 8 | # create an executable script if one does not exist. 9 | # 10 | # Nick Walker (nickwalker@email.com) 11 | # 12 | 13 | if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then 14 | rm -f /etc/ppp/resolv.prev 15 | if [ -f /etc/resolv.conf ]; then 16 | cp /etc/resolv.conf /etc/ppp/resolv.prev 17 | grep domain /etc/ppp/resolv.prev > /etc/resolv.conf 18 | grep search /etc/ppp/resolv.prev >> /etc/resolv.conf 19 | cat /etc/ppp/resolv.conf >> /etc/resolv.conf 20 | else 21 | cp /etc/ppp/resolv.conf /etc 22 | fi 23 | fi 24 | 25 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/ipv6-down.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This script is called with the following parameters: 4 | # interface tty speed local-address remote-address ipparam 5 | # 6 | 7 | 8 | # Kill the router advertisement daemon on this interface. 9 | # The killing procedure is copied from RedHat 6.0 initscripts. 10 | 11 | DEVICE="$1" 12 | 13 | PIDFILE="/var/run/radvd-$DEVICE.pid" 14 | 15 | [ -f "$PIDFILE" ] || exit 0 16 | 17 | PID="$(cat "$PIDFILE")" 18 | if [ "$PID" != "" ]; then 19 | if ps h "$PID" >/dev/null 2>&1; then 20 | kill -TERM "$PID" 21 | usleep 10000 22 | if ps h "$PID" >/dev/null 2>&1; then 23 | sleep 1 24 | if ps h "$PID" >/dev/null 2>&1; then 25 | kill -KILL "$PID" 26 | fi 27 | fi 28 | fi 29 | fi 30 | 31 | rm -f "$PIDFILE" 32 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/ipv6-up.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This script is called with the following parameters: 4 | # interface tty speed local-address remote-address ipparam 5 | # 6 | 7 | 8 | # Start router advertisements on this link. 9 | # Based on radvd 0.5.0 behaviour 10 | 11 | DEVICE="$1" 12 | 13 | CFGFILE="/etc/radvd.conf-$DEVICE" 14 | PIDFILE="/var/run/radvd-$DEVICE.pid" 15 | EXEFILE="/usr/sbin/radvd" 16 | 17 | if [ -x "$EXEFILE" -a -f "$CFGFILE" ]; then 18 | touch "$PIDFILE" 19 | if [ ! -f "$PIDFILE" ]; then 20 | echo "error: $PIDFILE is not a regular file. Aborting" 21 | exit 0 22 | fi 23 | 24 | PID="$(cat "$PIDFILE")" 25 | if [ -n "$PID" ]; then 26 | ps h "$PID" >/dev/null 2>&1 && exit 0 27 | fi 28 | 29 | # radvd 0.5.0 doesn't write a pid-file so we do it here 30 | # enabling debugging keeps radvd in foreground, putting it 31 | # on background gives us the PID. 32 | "$EXEFILE" -d 1 -C "$CFGFILE" & 33 | echo $! >"$PIDFILE" 34 | fi 35 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/options-rsh-loc: -------------------------------------------------------------------------------- 1 | debug asyncmap FFFFFFFF escape FF kdebug 0 noipdefault nodefaultroute noauth mtu 1460 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/options-rsh-rem: -------------------------------------------------------------------------------- 1 | notty debug asyncmap FFFFFFFF escape FF kdebug 0 noipdefault nodefaultroute noauth mtu 1460 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/options-ssh-loc: -------------------------------------------------------------------------------- 1 | debug asyncmap FFFFFFFF escape FF kdebug 0 noipdefault nodefaultroute noauth mtu 1400 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/options-ssh-rem: -------------------------------------------------------------------------------- 1 | notty debug asyncmap FFFFFFFF escape FF kdebug 0 noipdefault nodefaultroute noauth mtu 1400 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/plog: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -s /var/log/ppp.log ]; then 4 | exec tail "$@" /var/log/ppp.log 5 | else 6 | exec grep ' \(pppd\|chat\)\[' /var/log/syslog | tail "$@" 7 | fi 8 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/pon: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PPP_ON_BOOT=/etc/ppp/ppp_on_boot 4 | 5 | case "$1" in 6 | -*) echo " 7 | Usage: pon [provider] [arguments] 8 | 9 | If pon is invoked without arguments, $PPP_ON_BOOT file will be 10 | run, presuming it exists and is executable. Otherwise, a PPP connection 11 | will be started using settings from /etc/ppp/peers/provider. 12 | If you specify one argument, a PPP connection will be started using 13 | settings from the appropriate file in the /etc/ppp/peers/ directory, and 14 | any additional arguments supplied will be passed as extra arguments to 15 | pppd. 16 | " 17 | exit 0 18 | ;; 19 | esac 20 | 21 | if [ -z "$1" -a -x "$PPP_ON_BOOT" ]; then 22 | exec "$PPP_ON_BOOT" 23 | fi 24 | 25 | if [ -z "$1" -a ! -f /etc/ppp/peers/provider ]; then 26 | echo " 27 | Please configure /etc/ppp/peers/provider or use a command line argument to 28 | use another file in /etc/ppp/peers/ directory. 29 | " 30 | exit 1 31 | fi 32 | 33 | if [ "$1" -a ! -f "/etc/ppp/peers/$1" ]; then 34 | echo " 35 | The file /etc/ppp/peers/$1 does not exist. 36 | " 37 | exit 1 38 | fi 39 | 40 | exec /usr/sbin/pppd call ${@:-provider} 41 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/ppp-off: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ###################################################################### 3 | # 4 | # Determine the device to be terminated. 5 | # 6 | if [ "$1" = "" ]; then 7 | DEVICE=ppp0 8 | else 9 | DEVICE=$1 10 | fi 11 | 12 | ###################################################################### 13 | # 14 | # If the ppp0 pid file is present then the program is running. Stop it. 15 | if [ -r /var/run/$DEVICE.pid ]; then 16 | kill -INT `cat /var/run/$DEVICE.pid` 17 | # 18 | # If the kill did not work then there is no process running for this 19 | # pid. It may also mean that the lock file will be left. You may wish 20 | # to delete the lock file at the same time. 21 | if [ ! "$?" = "0" ]; then 22 | rm -f /var/run/$DEVICE.pid 23 | echo "ERROR: Removed stale pid file" 24 | exit 1 25 | fi 26 | # 27 | # Success. Let pppd clean up its own junk. 28 | echo "PPP link to $DEVICE terminated." 29 | exit 0 30 | fi 31 | # 32 | # The ppp process is not running for ppp0 33 | echo "ERROR: PPP link is not active on $DEVICE" 34 | exit 1 35 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/ppp-on: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Script to initiate a ppp connection. This is the first part of the 4 | # pair of scripts. This is not a secure pair of scripts as the codes 5 | # are visible with the 'ps' command. However, it is simple. 6 | # 7 | # These are the parameters. Change as needed. 8 | TELEPHONE=555-1212 # The telephone number for the connection 9 | ACCOUNT=george # The account name for logon (as in 'George Burns') 10 | PASSWORD=gracie # The password for this account (and 'Gracie Allen') 11 | LOCAL_IP=0.0.0.0 # Local IP address if known. Dynamic = 0.0.0.0 12 | REMOTE_IP=0.0.0.0 # Remote IP address if desired. Normally 0.0.0.0 13 | NETMASK=255.255.255.0 # The proper netmask if needed 14 | # 15 | # Export them so that they will be available at 'ppp-on-dialer' time. 16 | export TELEPHONE ACCOUNT PASSWORD 17 | # 18 | # This is the location of the script which dials the phone and logs 19 | # in. Please use the absolute file name as the $PATH variable is not 20 | # used on the connect option. (To do so on a 'root' account would be 21 | # a security hole so don't ask.) 22 | # 23 | DIALER_SCRIPT=/etc/ppp/ppp-on-dialer 24 | # 25 | # Initiate the connection 26 | # 27 | # I put most of the common options on this command. Please, don't 28 | # forget the 'lock' option or some programs such as mgetty will not 29 | # work. The asyncmap and escape will permit the PPP link to work with 30 | # a telnet or rlogin connection. You are welcome to make any changes 31 | # as desired. Don't use the 'defaultroute' option if you currently 32 | # have a default route to an ethernet gateway. 33 | # 34 | exec /usr/sbin/pppd debug lock modem crtscts /dev/ttyS0 38400 \ 35 | asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \ 36 | noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT 37 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/ppp-on-dialer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This is part 2 of the ppp-on script. It will perform the connection 4 | # protocol for the desired connection. 5 | # 6 | exec chat -v \ 7 | TIMEOUT 3 \ 8 | ABORT '\nBUSY\r' \ 9 | ABORT '\nNO ANSWER\r' \ 10 | ABORT '\nRINGING\r\n\r\nRINGING\r' \ 11 | '' \rAT \ 12 | 'OK-+++\c-OK' ATH0 \ 13 | TIMEOUT 30 \ 14 | OK ATDT$TELEPHONE \ 15 | CONNECT '' \ 16 | ogin:--ogin: $ACCOUNT \ 17 | assword: $PASSWORD 18 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/ppp-on-rsh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # A sample script to establish PPP session(s) via rsh 4 | # 5 | # Adi Masputra 6 | # Jan 24, 2000 7 | # 8 | 9 | # 10 | # You'd definitely want to change the following addresses to suit 11 | # your network configuration 12 | # 13 | LOC_IP=10.0.0.1 14 | REM_IP=10.0.0.2 15 | NETMASK=255.255.0.0 16 | 17 | export LOC_IP REM_IP 18 | 19 | # 20 | # This is the remote peer where in.rshd is running, either 21 | # its hostname or IP address 22 | # 23 | PPPD_RHOST=myremotehost 24 | 25 | # 26 | # For this example, we assume that pppd on both local and remote 27 | # machines reside in the same place, /usr/local/bin/pppd 28 | # 29 | PPPD_LOC=/usr/local/bin/pppd 30 | 31 | # 32 | # The location of local options file (where rsh client is running). 33 | # Note that the sample options file included in the distribution 34 | # may need further customizations, depending on your needs. The 'noauth' 35 | # option specified in the file is there to simplify the example. In 36 | # reality, you'd probably want to remove such option. 37 | # 38 | PPPD_LOC_OPT=/etc/ppp/options-rsh-loc 39 | 40 | # 41 | # The location of remote options file (where in.rshd daemon is running). 42 | # Note that the sample options file included in the distribution 43 | # may need further customizations, depending on your needs. The 'noauth' 44 | # option specified in the file is there to simplify the example. In 45 | # reality, you'd probably want to remove such option. Also note that 46 | # the remote options file need to include the 'notty' option for this 47 | # to work 48 | # 49 | PPPD_REM_OPT=/etc/ppp/options-rsh-rem 50 | 51 | # 52 | # The location of rsh client on the local machine 53 | # 54 | RSH_LOC=/bin/rsh 55 | 56 | export PPPD_LOC PPPD_LOC_OPT PPPD_REM_OPT PPPD_RHOST RSH_LOC 57 | 58 | # 59 | # Uncomment the following to enable IPv6, note that the IPv6 support 60 | # needs to be enabled during compilation 61 | # 62 | # PPPD_IPV6='+ipv6 ipv6cp-use-ipaddr' 63 | export PPPD_IPV6 64 | 65 | # 66 | # And execute pppd with the pty option, specifying rsh client as the 67 | # slave side of the pseduo-tty master/slave pair. 68 | # 69 | exec $PPPD_LOC \ 70 | pty '$RSH_LOC $PPPD_RHOST $PPPD_LOC $REM_IP:$LOC_IP $PPPD_IPV6 file $PPPD_REM_OPT' \ 71 | $LOC_IP:$REM_IP netmask $NETMASK $PPPD_IPV6 file $PPPD_LOC_OPT 72 | 73 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/ppp-on-ssh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # A sample script to establish PPP session(s) via SSH 1.x 4 | # 5 | # Adi Masputra 6 | # Jan 24, 2000 7 | # 8 | 9 | # 10 | # You'd definitely want to change the following addresses to suit 11 | # your network configuration 12 | # 13 | LOC_IP=10.0.0.1 14 | REM_IP=10.0.0.2 15 | NETMASK=255.255.0.0 16 | 17 | export LOC_IP REM_IP 18 | 19 | # 20 | # This is the remote peer where sshd is running, either 21 | # its hostname or IP address 22 | # 23 | PPPD_RHOST=myremotehost 24 | 25 | # 26 | # For this example, we assume that pppd on both local and remote 27 | # machines reside in the same place, /usr/local/bin/pppd 28 | # 29 | PPPD_LOC=/usr/local/bin/pppd 30 | 31 | # 32 | # The location of local options file (where ssh client is running). 33 | # Note that the sample options file included in the distribution 34 | # may need further customizations, depending on your needs. The 'noauth' 35 | # option specified in the file is there to simplify the example, although 36 | # some may choose to have it there and rely on ssh authentication 37 | # instead. 38 | # 39 | PPPD_LOC_OPT=/etc/ppp/options-ssh-loc 40 | 41 | # 42 | # The location of remote options file (where sshd daemon is running) 43 | # Note that the sample options file included in the distribution 44 | # may need further customizations, depending on your needs. The 'noauth' 45 | # option specified in the file is there to simplify the example, although 46 | # some may choose to have it there and rely on ssh authentication 47 | # instead. Also note that the remote options file need to include the 'notty' 48 | # options for this to work. 49 | # 50 | PPPD_REM_OPT=/etc/ppp/options-ssh-rem 51 | 52 | # 53 | # The location of ssh client on the local machine 54 | # 55 | SSH_LOC=/usr/local/bin/ssh 56 | 57 | export PPPD_LOC PPPD_LOC_OPT PPPD_REM_OPT PPPD_RHOST SSH_LOC 58 | 59 | # 60 | # Uncomment the following to enable IPv6, note that the IPv6 support 61 | # needs to be enabled during compilation 62 | # 63 | # PPPD_IPV6='+ipv6 ipv6cp-use-ipaddr' 64 | export PPPD_IPV6 65 | 66 | # 67 | # And execute pppd with the pty option, specifying ssh client as the 68 | # slave side of the pseudo-tty master/slave pair. Note that on this example, 69 | # ssh has been compiled to allow NULL encryption (thus the '-c none' option), 70 | # but in reality, you'd probably want to specify the encryption algorithm. 71 | # See the man page of ssh(1) for details. 72 | # 73 | exec $PPPD_LOC \ 74 | pty '$SSH_LOC -c none $PPPD_RHOST $PPPD_LOC $REM_IP:$LOC_IP $PPPD_IPV6 file $PPPD_REM_OPT' \ 75 | $LOC_IP:$REM_IP netmask $NETMASK $PPPD_IPV6 file $PPPD_LOC_OPT 76 | 77 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/scripts/redialer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ################################################################### 3 | # 4 | # These parameters control the attack dialing sequence. 5 | # 6 | # Maximum number of attempts to reach the telephone number(s) 7 | MAX_ATTEMPTS=10 8 | 9 | # Delay between each of the attempts. This is a parameter to sleep 10 | # so use "15s" for 15 seconds, "1m" for 1 minute, etc. 11 | SLEEP_DELAY=15s 12 | 13 | ################################################################### 14 | # 15 | # This is a list of telephone numbers. Add new numbers if you wish 16 | # and see the function 'callall' below for the dial process. 17 | PHONE1=555-1212 18 | PHONE2=411 19 | 20 | ################################################################### 21 | # 22 | # If you use the ppp-on script, then these are passed to this routine 23 | # automatically. There is no need to define them here. If not, then 24 | # you will need to set the values. 25 | # 26 | ACCOUNT=my_account_name 27 | PASSWORD=my_password 28 | 29 | ################################################################### 30 | # 31 | # Function to initialize the modem and ensure that it is in command 32 | # state. This may not be needed, but it doesn't hurt. 33 | # 34 | function initialize 35 | { 36 | chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK' 37 | return 38 | } 39 | 40 | ################################################################### 41 | # 42 | # Script to dial a telephone 43 | # 44 | function callnumber 45 | { 46 | chat -v \ 47 | ABORT '\nBUSY\r' \ 48 | ABORT '\nNO ANSWER\r' \ 49 | ABORT '\nRINGING\r\n\r\nRINGING\r' \ 50 | '' ATDT$1 \ 51 | CONNECT '' \ 52 | ogin:--ogin: $ACCOUNT \ 53 | assword: $PASSWORD 54 | # 55 | # If the connection was successful then end the whole script with a 56 | # success. 57 | # 58 | if [ "$?" = "0" ]; then 59 | exit 0 60 | fi 61 | 62 | return 63 | } 64 | 65 | ################################################################### 66 | # 67 | # Script to dial any telephone number 68 | # 69 | function callall 70 | { 71 | # echo "dialing attempt number: $1" >/dev/console 72 | callnumber $PHONE1 73 | # callnumber $PHONE2 74 | } 75 | 76 | ################################################################### 77 | # 78 | # Initialize the modem to ensure that it is in the command state 79 | # 80 | initialize 81 | if [ ! "$?" = "0" ]; then 82 | exit 1 83 | fi 84 | 85 | # 86 | # Dial telephone numbers until one answers 87 | # 88 | attempt=0 89 | while : ; do 90 | attempt=`expr $attempt + 1` 91 | callall $attempt 92 | if [ "$attempt" = "$MAX_ATTEMPTS" ]; then 93 | exit 1 94 | fi 95 | sleep "$SLEEP_DELAY" 96 | done 97 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/solaris/Makedefs: -------------------------------------------------------------------------------- 1 | # 2 | # defines common to several Makefiles 3 | # 4 | 5 | INSTALL= /usr/sbin/install 6 | 7 | BINDIR = @DESTDIR@/bin 8 | MANDIR = @DESTDIR@/man 9 | ETCDIR = @SYSCONF@/ppp 10 | 11 | CC = /opt/SUNWspro/bin/cc 12 | COPTS = -O -Xa 13 | 14 | LD = /usr/ccs/bin/ld 15 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/solaris/Makedefs.gcc: -------------------------------------------------------------------------------- 1 | # 2 | # defines common to several Makefiles 3 | # 4 | 5 | INSTALL= /usr/sbin/install 6 | 7 | BINDIR = @DESTDIR@/bin 8 | MANDIR = @DESTDIR@/man 9 | ETCDIR = @SYSCONF@/ppp 10 | 11 | CC = gcc 12 | COPTS = -O2 13 | 14 | LD = /usr/ccs/bin/ld 15 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/solaris/Makedefs.sol2: -------------------------------------------------------------------------------- 1 | # 2 | # Generic make definitions for Solaris 2 3 | # 4 | # $Id: Makedefs.sol2,v 1.2 2002/09/07 05:15:25 carlsonj Exp $ 5 | # 6 | 7 | include ../Makedefs.com 8 | 9 | CPPFLAGS = -D_KERNEL -DSVR4 -DSOL2 -DPRIOQ -DDEBUG -I../include 10 | CFLAGS = $(CPPFLAGS) $(COPTS) 11 | 12 | # lint-specific variables 13 | LINT = lint 14 | LINT_OPT_32 = 15 | LINT_OPT_64 = -Xarch=v9 -errchk=longptr64 16 | 17 | LINT_32 = 18 | LINT_32 += -erroff=E_BAD_PTR_CAST_ALIGN 19 | LINT_32 += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 20 | LINT_32 += -erroff=E_SUSPICIOUS_COMPARISON 21 | LINT_32 += -erroff=E_CAST_UINT_TO_SIGNED_INT 22 | LINT_32 += -erroff=E_PASS_UINT_TO_SIGNED_INT 23 | LINT_32 += -erroff=E_INVALID_ANNOTATION_NAME 24 | LINT_32 += -erroff=E_FUNC_ARG_UNUSED 25 | # This might be needed, but zlib.c and vjcompress.c will squawk 26 | # when not ignored 27 | LINT_32 += -erroff=E_CASE_FALLTHRU 28 | LINT_32 += -erroff=E_RET_INT_IMPLICITLY 29 | LINT_32 += -erroff=E_FUNC_NO_RET_VAL 30 | # Some STREAMS macros will be noisy too when this isn't ignored 31 | LINT_32 += -erroff=E_CONSTANT_CONDITION 32 | LINT_32 += -erroff=E_CONST_EXPR 33 | 34 | # Extra noise suppressant for 64-bit 35 | EXTRA_OFF = 36 | EXTRA_OFF += -erroff=E_CAST_INT_TO_SMALL_INT 37 | EXTRA_OFF += -erroff=E_CAST_INT_CONST_TO_SMALL_INT 38 | EXTRA_OFF += -erroff=E_CAST_TO_PTR_FROM_INT 39 | EXTRA_OFF += -erroff=E_ASSIGN_INT_TO_SMALL_INT 40 | EXTRA_OFF += -erroff=E_ASSIGN_INT_FROM_BIG_CONST 41 | EXTRA_OFF += -erroff=E_CONST_PROMOTED_UNSIGNED_LL 42 | EXTRA_OFF += -erroff=E_CONST_PROMOTED_LONG_LONG 43 | EXTRA_OFF += -erroff=E_CONST_TRUNCATED_BY_ASSIGN 44 | EXTRA_OFF += -erroff=E_PASS_INT_FROM_BIG_CONST 45 | EXTRA_OFF += -erroff=E_COMP_INT_WITH_LARGE_INT 46 | EXTRA_OFF += -erroff=E_ASSIGN_UINT_TO_SIGNED_INT 47 | EXTRA_OFF += -erroff=E_ASSIGN_NARROW_CONV 48 | EXTRA_OFF += -erroff=E_PASS_INT_TO_SMALL_INT 49 | EXTRA_OFF += -erroff=E_PTR_CONV_LOSES_BITS 50 | 51 | LINT_64 = $(LINT_32) 52 | LINT_64 += $(EXTRA_OFF) 53 | 54 | LINTFLAGS64 = -Xa -nsxmuF -errtags=yes $(LINT_OPT_64) $(LINT_64) 55 | LINT64 = $(LINT) -c $(LINTFLAGS64) $(CPPFLAGS) 56 | 57 | LINTFLAGS32 = -Xa -nsxmuF -errtags=yes $(LINT_OPT_32) $(LINT_32) 58 | LINT32 = $(LINT) -c $(LINTFLAGS32) $(CPPFLAGS) 59 | 60 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/solaris/Makefile.sol2: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for STREAMS modules for Solaris 2. 3 | # 4 | # $Id: Makefile.sol2,v 1.3 2004/11/15 00:57:54 carlsonj Exp $ 5 | # 6 | 7 | include Makedefs.sol2 8 | 9 | COPTS += -xO2 -xspace -W0,-Lt 10 | 11 | COMP_OBJS = ppp_comp.o bsd-comp.o deflate.o zlib.o vjcompress.o \ 12 | ppp_comp_mod.o 13 | 14 | all: ppp ppp_ahdl ppp_comp 15 | 16 | ppp: ppp.o ppp_mod.o 17 | $(LD) -r -o $@ ppp.o ppp_mod.o 18 | chmod +x $@ 19 | 20 | ppp_ahdl: ppp_ahdlc.o ppp_ahdlc_mod.o 21 | $(LD) -r -o $@ ppp_ahdlc.o ppp_ahdlc_mod.o 22 | chmod +x $@ 23 | 24 | ppp_comp: $(COMP_OBJS) 25 | $(LD) -r -o $@ $(COMP_OBJS) 26 | chmod +x $@ 27 | 28 | bsd-comp.o: ../modules/bsd-comp.c 29 | $(CC) $(CFLAGS) -c $? 30 | deflate.o: ../modules/deflate.c 31 | $(CC) $(CFLAGS) -c $? 32 | ppp.o: ppp.c 33 | $(CC) $(CFLAGS) -c $? 34 | ppp_mod.o: ppp_mod.c 35 | $(CC) $(CFLAGS) -c $? 36 | ppp_ahdlc_mod.o: ppp_ahdlc_mod.c 37 | $(CC) $(CFLAGS) -c $? 38 | ppp_ahdlc.o: ppp_ahdlc.c 39 | $(CC) $(CFLAGS) -c $? 40 | ppp_comp.o: ppp_comp.c 41 | $(CC) $(CFLAGS) -c $? 42 | ppp_comp_mod.o: ppp_comp_mod.c 43 | $(CC) $(CFLAGS) -c $? 44 | vjcompress.o: ../modules/vjcompress.c 45 | $(CC) $(CFLAGS) -c $? 46 | zlib.o: ../common/zlib.c 47 | $(CC) $(CFLAGS) -c $? 48 | 49 | install: 50 | /usr/sbin/modunload -i 0 51 | cp ppp ppp.conf /kernel/drv 52 | cp ppp_comp ppp_ahdl /kernel/strmod 53 | if grep clone:ppp /etc/minor_perm; then :; else \ 54 | echo clone:ppp 0644 root sys >>/etc/minor_perm; fi 55 | /usr/sbin/rem_drv ppp 2>/dev/null || true 56 | /usr/sbin/modunload -i 0 57 | /usr/sbin/add_drv ppp 58 | 59 | SRCS = ppp.c ppp_mod.c ppp_ahdlc.c ppp_ahdlc_mod.c \ 60 | ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \ 61 | ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c 62 | 63 | lint: 64 | $(LINT32) $(SRCS) 65 | 66 | clean: 67 | rm -f ppp ppp_comp ppp_ahdl *.o *~ core 68 | rm -f *.ln 69 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/solaris/Makefile.sol2gcc: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for STREAMS modules for Solaris 2. 3 | # 4 | # $Id: Makefile.sol2gcc,v 1.4 2004/11/15 00:57:54 carlsonj Exp $ 5 | # 6 | 7 | include Makedefs.sol2 8 | 9 | COPTS += -fno-builtin 10 | 11 | COMP_OBJS = ppp_comp.o bsd-comp.o deflate.o zlib.o vjcompress.o \ 12 | ppp_comp_mod.o 13 | 14 | all: ppp ppp_ahdl ppp_comp 15 | 16 | ppp: ppp.o ppp_mod.o 17 | $(LD) -r -o $@ ppp.o ppp_mod.o 18 | chmod +x $@ 19 | 20 | ppp_ahdl: ppp_ahdlc.o ppp_ahdlc_mod.o 21 | $(LD) -r -o $@ ppp_ahdlc.o ppp_ahdlc_mod.o 22 | chmod +x $@ 23 | 24 | ppp_comp: $(COMP_OBJS) 25 | $(LD) -r -o $@ $(COMP_OBJS) 26 | chmod +x $@ 27 | 28 | bsd-comp.o: ../modules/bsd-comp.c 29 | $(CC) $(CFLAGS) -c $? 30 | deflate.o: ../modules/deflate.c 31 | $(CC) $(CFLAGS) -c $? 32 | ppp.o: ppp.c 33 | $(CC) $(CFLAGS) -c $? 34 | ppp_mod.o: ppp_mod.c 35 | $(CC) $(CFLAGS) -c $? 36 | ppp_ahdlc_mod.o: ppp_ahdlc_mod.c 37 | $(CC) $(CFLAGS) -c $? 38 | ppp_ahdlc.o: ppp_ahdlc.c 39 | $(CC) $(CFLAGS) -c $? 40 | ppp_comp.o: ppp_comp.c 41 | $(CC) $(CFLAGS) -c $? 42 | ppp_comp_mod.o: ppp_comp_mod.c 43 | $(CC) $(CFLAGS) -c $? 44 | vjcompress.o: ../modules/vjcompress.c 45 | $(CC) $(CFLAGS) -c $? 46 | zlib.o: ../common/zlib.c 47 | $(CC) $(CFLAGS) -c $? 48 | 49 | install: 50 | /usr/sbin/modunload -i 0 51 | cp ppp ppp.conf /kernel/drv 52 | cp ppp_comp ppp_ahdl /kernel/strmod 53 | if grep clone:ppp /etc/minor_perm; then :; else \ 54 | echo clone:ppp 0644 root sys >>/etc/minor_perm; fi 55 | /usr/sbin/rem_drv ppp 2>/dev/null || true 56 | /usr/sbin/modunload -i 0 57 | /usr/sbin/add_drv ppp 58 | 59 | SRCS = ppp.c ppp_mod.c ppp_ahdlc.c ppp_ahdlc_mod.c \ 60 | ppp_comp.c ../modules/bsd-comp.c ../modules/deflate.c \ 61 | ../common/zlib.c ../modules/vjcompress.c ppp_comp_mod.c 62 | 63 | lint: 64 | $(LINT32) $(SRCS) 65 | 66 | clean: 67 | rm -f ppp ppp_comp ppp_ahdl *.o *~ core 68 | rm -f *.ln 69 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/solaris/Makefile.top: -------------------------------------------------------------------------------- 1 | # 2 | # ppp top level makefile for SVR4 and Solaris 2 3 | # 4 | # $Id: Makefile.top,v 1.3 2004/11/01 09:31:07 paulus Exp $ 5 | # 6 | 7 | include Makedefs.com 8 | 9 | all: 10 | cd chat; $(MAKE) all 11 | cd pppd; $(MAKE) all 12 | cd pppstats; $(MAKE) all 13 | cd pppdump; $(MAKE) all 14 | cd solaris; $(MAKE) all 15 | 16 | install: $(BINDIR) $(MANDIR)/man8 install-progs 17 | 18 | install-progs: 19 | cd chat; $(MAKE) install 20 | cd pppd; $(MAKE) install 21 | cd pppstats; $(MAKE) install 22 | cd pppdump; $(MAKE) install 23 | 24 | install-etcppp: $(ETCDIR) $(ETCDIR)/options $(ETCDIR)/pap-secrets \ 25 | $(ETCDIR)/chap-secrets 26 | 27 | install-modules: 28 | cd solaris; $(MAKE) install 29 | 30 | $(ETCDIR)/options: 31 | cp etc.ppp/options $@ 32 | chmod go-w $@ 33 | $(ETCDIR)/pap-secrets: 34 | $(INSTALL) -f $(ETCDIR) -m 600 etc.ppp/pap-secrets 35 | $(ETCDIR)/chap-secrets: 36 | $(INSTALL) -f $(ETCDIR) -m 600 etc.ppp/chap-secrets 37 | 38 | $(BINDIR): 39 | mkdir -m 755 -p $@ 40 | $(MANDIR)/man8: 41 | mkdir -m 755 -p $@ 42 | $(ETCDIR): 43 | mkdir -m 755 -p $@ 44 | 45 | clean: 46 | rm -f *~ 47 | cd chat; $(MAKE) clean 48 | cd pppd; $(MAKE) clean 49 | cd pppstats; $(MAKE) clean 50 | cd pppdump; $(MAKE) clean 51 | cd solaris; $(MAKE) clean 52 | 53 | # no tests yet, one day... 54 | installcheck: 55 | true 56 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/solaris/ppp.conf: -------------------------------------------------------------------------------- 1 | name="ppp" parent="pseudo" instance=0; 2 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/solaris/ppp_ahdlc_mod.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | extern struct streamtab ppp_ahdlcinfo; 8 | 9 | static struct fmodsw fsw = { 10 | "ppp_ahdl", 11 | &ppp_ahdlcinfo, 12 | D_NEW | D_MP | D_MTQPAIR 13 | }; 14 | 15 | extern struct mod_ops mod_strmodops; 16 | 17 | static struct modlstrmod modlstrmod = { 18 | &mod_strmodops, 19 | "PPP async HDLC module", 20 | &fsw 21 | }; 22 | 23 | static struct modlinkage modlinkage = { 24 | MODREV_1, 25 | (void *) &modlstrmod, 26 | NULL 27 | }; 28 | 29 | /* 30 | * Entry points for modloading. 31 | */ 32 | int 33 | _init(void) 34 | { 35 | return mod_install(&modlinkage); 36 | } 37 | 38 | int 39 | _fini(void) 40 | { 41 | return mod_remove(&modlinkage); 42 | } 43 | 44 | int 45 | _info(mip) 46 | struct modinfo *mip; 47 | { 48 | return mod_info(&modlinkage, mip); 49 | } 50 | -------------------------------------------------------------------------------- /tools/src/ppp-2.4.7/solaris/ppp_comp_mod.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ppp_comp_mod.c - modload support for PPP compression STREAMS module. 3 | * 4 | * Copyright (c) 1994 Paul Mackerras. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The name(s) of the authors of this software must not be used to 19 | * endorse or promote products derived from this software without 20 | * prior written permission. 21 | * 22 | * 4. Redistributions of any form whatsoever must retain the following 23 | * acknowledgment: 24 | * "This product includes software developed by Paul Mackerras 25 | * ". 26 | * 27 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 28 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 29 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 30 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 31 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 32 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 33 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 34 | * 35 | * $Id: ppp_comp_mod.c,v 1.2 2002/12/06 09:49:16 paulus Exp $ 36 | */ 37 | 38 | /* 39 | * This file is used under Solaris 2. 40 | */ 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | extern struct streamtab ppp_compinfo; 48 | 49 | static struct fmodsw fsw = { 50 | "ppp_comp", 51 | &ppp_compinfo, 52 | D_NEW | D_MP | D_MTQPAIR 53 | }; 54 | 55 | extern struct mod_ops mod_strmodops; 56 | 57 | static struct modlstrmod modlstrmod = { 58 | &mod_strmodops, 59 | "PPP compression module", 60 | &fsw 61 | }; 62 | 63 | static struct modlinkage modlinkage = { 64 | MODREV_1, 65 | (void *) &modlstrmod, 66 | NULL 67 | }; 68 | 69 | /* 70 | * Entry points for modloading. 71 | */ 72 | int 73 | _init(void) 74 | { 75 | return mod_install(&modlinkage); 76 | } 77 | 78 | int 79 | _fini(void) 80 | { 81 | return mod_remove(&modlinkage); 82 | } 83 | 84 | int 85 | _info(mip) 86 | struct modinfo *mip; 87 | { 88 | return mod_info(&modlinkage, mip); 89 | } 90 | -------------------------------------------------------------------------------- /tools/src/serialCom/Makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | STRIP = strip 3 | all: serialCom 4 | 5 | serialCom: serialCom.o 6 | $(CC) -o serialCom serialCom.o -lpthread 7 | #$(STRIP) $@ 8 | $(STRIP) -x -R .note -R .comment $@ 9 | 10 | serialCom.o: serialCom.c 11 | $(CC) -c -o serialCom.o serialCom.c -lpthread 12 | 13 | clean: 14 | rm -f serialCom.o serialCom *~ 15 | -------------------------------------------------------------------------------- /tools/src/serialCom/serialCom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/src/serialCom/serialCom -------------------------------------------------------------------------------- /tools/src/ttcp-master.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wypx/mobile/6174dfbd6aec7eef70fa439cfbe317a6942f80e8/tools/src/ttcp-master.zip -------------------------------------------------------------------------------- /tools/src/ttcp/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | 9 | # Compiled Static libraries 10 | *.lai 11 | *.la 12 | *.a 13 | -------------------------------------------------------------------------------- /tools/src/ttcp/Makefile: -------------------------------------------------------------------------------- 1 | ttcp: ttcp.c 2 | $(CC) -o ttcp ttcp.c 3 | -------------------------------------------------------------------------------- /tools/src/ttcp/README.md: -------------------------------------------------------------------------------- 1 | ttcp 2 | ==== 3 | 4 | Test TCP, from: http://en.wikipedia.org/wiki/Ttcp -------------------------------------------------------------------------------- /tools/src/ttcp/说明.txt: -------------------------------------------------------------------------------- 1 | 能使用测试TCP程序 (TTCP)通过IP路径测量TCP吞吐量。使用它,发动接受器在路 径的一端,然后开始发射机在另一边。 传输端寄发TCP信息 包的指定的编号到接收端。在测试的末端,双方显示传输的 字节数并且时间流逝为了信息包能从一端消磨对其他。您在 链路能然后使用这些图计算实际吞吐量。关于概要关于TTCP ,参见 测试与TTCP的网络性能 。 2 | 3 | TTCP程序可以是有效的在确定一个特定的广域网或调制解调 器连接的实际比特率。 然而,您能也使用此功能测试连接速 率在任何二个设备之间带有他们的之间IP连通性。 4 | 5 | TTCP要求® Cisco IOS软件版本11.2 以上和功能集IP Plus (是 镜象)或服务提供商(p- 镜象)。 6 | 7 | 注 意: ttcp 命令是 一个隐藏的,不支持,特权模式命令。同样地,其可用性可 能从一个Cisco IOS 软件版本变化到另一个,这样在一些版本也许 不存在。 8 | 9 | 客户端的TTCP软件是可得到 从 http://renoir.csc.ncsu.edu/ttcp /; 下载 ttcpw.zip 为Windows客 户端。 --------------------------------------------------------------------------------