android pppoe

android pppoe 调用路径
====
Y:\new_TW\vendors_R210\skyworth\apps\SkyEthernetServer\src\com\topway\service
通过广播接收请求

frameworks\base\ethernet\
EthernetManager.getEthernetMode() //ETHERNET_CONNECT_MODE_PPPOE, DHCP, MANUAL
 setEthernetMode(String mode, DhcpInfo dhcpInfo); //x
 setPppoeMode
 setDhcpOption60
 enableEthernet //Set Interface Up/Down
 getNetLinkStatus() //Link up?
 setWifiEthernetCoexist
 getDeviceNameList
--> NetworkUtils.enableInterface()/runDhcp
   frameworks/base/services/java/com/android/server/EthernetService.java : setEthernetState
--> frameworks/base/core/java/android/net/EthernetDataTracker.java :
  resetInterface/interfaceAdded/reconnect/runPppoe
--> frameworks/base/pppoe/java/android/net/pppoe/PppoeNative.java : connectPppoe
--> frameworks/base/core/jni/android_net_pppoe.cpp
--> system/core/libnetutils/pppoe_utils.c : pppoe_connect()
property_set pppoe.ifname/user/password
ctrl.start pppoe_conn_ifname
out/target/product/Hi3796MV100/root/init.bigfish.rc
-->
device/hisilicon/bigfish/etc/ppp/ppp.connect

Windows XP使用RASPPPOE搭建PPPoE服务器[1],建立用户test1,密码passwd。Linux上见[2]。
pppoe -d #发discovery包,检测pppoe server是否存在

pppd pty "pppoe -I eth0" user test1 password passwd debug
#logcat -v time -d -s pppd

#eth0 ip设置为无效,以便验证后面的数据是走ppp0。
busybox ifconfig eth0 192.168.88.128 netmask 255.255.255.0
ip route del  default
ip route add default dev ppp0
#busybox route add default gw 192.168.2.250 dev ppp0
busybox route
ping -I ppp0 112.80.248.73
curl -v --head http://112.80.248.73

wireshak filter: pppoe || pppoed || ppp

setprop net.eth0.dns1 172.28.0.2
ping baidu.com

[1] http://wenku.baidu.com/link?url=k7wvqWO_26DaMKmsPhP5XaydmjUX-X2PP8FnUnhPTHUiZ3XclEwgNUdyBoMCnmWSsFEQxgJ8wNl1Djk5inqLZ3Wb9F2Y_n1f11di9CtFUka
[2] http://www.howtodoityourself.org/pppoe-server-how-to-do-it-yourself.html

 

你可能感兴趣的:(android,网络)