author | kejun.gao <kejun.gao@amlogic.com> | 2012-03-07 05:37:54 (GMT) |
---|---|---|
committer | kejun.gao <kejun.gao@amlogic.com> | 2012-03-07 05:37:54 (GMT) |
commit | f63a58b9757eb2403b5115621a7245fe834db609 (patch) | |
tree | 8c17c8bbca756146aafde0b23cfbf84813483ba3 | |
parent | 94369f9d84d969e464b10a8ed18f76600f78600d (diff) | |
download | pppoe-f63a58b9757eb2403b5115621a7245fe834db609.zip pppoe-f63a58b9757eb2403b5115621a7245fe834db609.tar.gz pppoe-f63a58b9757eb2403b5115621a7245fe834db609.tar.bz2 |
Save ppp/pppoe configure in /data/misc/etc/ppp,
rather than in /system/etc/ppp.
See also in external/ppp git commit: 91f86eebc1d87910c92fea79e970b5502568507b
-rwxr-xr-x | jni/pppoe_jni.cpp | 7 | ||||
-rwxr-xr-x | jni/src/pppoe_cli.c | 4 | ||||
-rwxr-xr-x | jni/src/pppoe_status.h | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/jni/pppoe_jni.cpp b/jni/pppoe_jni.cpp index 50d51cb..0fecc10 100755 --- a/jni/pppoe_jni.cpp +++ b/jni/pppoe_jni.cpp @@ -82,7 +82,8 @@ static char* create_pppoe_connect_cmd return pppoe_connect_cmd; } -#define CONFIG_FILE "/system/etc/ppp/pppd_options.conf" +#include "../../ppp/pppd/pathnames.h" +#define CONFIG_FILE _ROOT_PATH "/etc/ppp/pppd_options.conf" @@ -159,7 +160,7 @@ static jboolean com_amlogic_PppoeOperation_connect __android_log_print(ANDROID_LOG_ERROR, LOCAL_TAG,"ppp.connect\n"); - ctrl = netwrapper_ctrl_open("/etc/ppp/pppoe", PPPOE_WRAPPER_SERVER_PATH); + ctrl = netwrapper_ctrl_open(PPPOE_WRAPPER_CLIENT_PATH, PPPOE_WRAPPER_SERVER_PATH); if (ctrl == NULL) { __android_log_print(ANDROID_LOG_ERROR, LOCAL_TAG, "Failed to connect to pppd\n"); return -1; @@ -184,7 +185,7 @@ jboolean com_amlogic_PppoeOperation_disconnect __android_log_print(ANDROID_LOG_ERROR, LOCAL_TAG,"ppp.disconnect\n"); - ctrl = netwrapper_ctrl_open("/etc/ppp/pppoe", PPPOE_WRAPPER_SERVER_PATH); + ctrl = netwrapper_ctrl_open(PPPOE_WRAPPER_CLIENT_PATH, PPPOE_WRAPPER_SERVER_PATH); if (ctrl == NULL) { __android_log_print(ANDROID_LOG_ERROR, LOCAL_TAG, "Failed to connect to pppd\n"); return -1; diff --git a/jni/src/pppoe_cli.c b/jni/src/pppoe_cli.c index 939a1ec..9c23af5 100755 --- a/jni/src/pppoe_cli.c +++ b/jni/src/pppoe_cli.c @@ -17,7 +17,7 @@ #include "pppoe_status.h" static char pppd_connect_cmd[512]; -static char pppoe_plugin_cmd[] = {"'pppoe -p /system/etc/ppp/pppoe.pid -I eth0 -T 80 -U -m 1412'" }; +static char pppoe_plugin_cmd[] = {"'pppoe -p " _ROOT_PATH "/etc/ppp/pppoe.pid" " -I eth0 -T 80 -U -m 1412'" }; static char pppd_options[] = {"debug logfd 1 noipdefault noauth default-asyncmap defaultroute nodetach mtu 1492 mru 1492 noaccomp nodeflate nopcomp novj novjccomp lcp-echo-interval 20 lcp-echo-failure 3"}; static int usage() @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) return -2; } - ctrl = netwrapper_ctrl_open("/etc/ppp/pppcli", PPPOE_WRAPPER_SERVER_PATH); + ctrl = netwrapper_ctrl_open(_ROOT_PATH "/etc/ppp/pppcli", PPPOE_WRAPPER_SERVER_PATH); if (ctrl == NULL) { printf("Failed to connect to pppd\n"); return -1; diff --git a/jni/src/pppoe_status.h b/jni/src/pppoe_status.h index c85846a..8762614 100755 --- a/jni/src/pppoe_status.h +++ b/jni/src/pppoe_status.h @@ -5,7 +5,9 @@ #define PPP_STATUS_DISCONNECTED 0x20 #define PPP_STATUS_CONNECTING 0x40 -#define PPPOE_PIDFILE "/system/etc/ppp/pppoe.pid" +#include "../../../ppp/pppd/pathnames.h" +#define PPPOE_PIDFILE _ROOT_PATH "/etc/ppp/pppoe.pid" +#define PPPOE_WRAPPER_CLIENT_PATH _ROOT_PATH "/etc/ppp/pppoe" #define PPPOE_WRAPPER_SERVER_PATH "/dev/socket/pppoe_wrapper" #ifdef __cplusplus |