• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

external/ppp


Commit MetaInfo

Revision8ee7e4a55bdd79b5891e8f8326146639ef683935 (tree)
Zeit2009-05-08 15:34:29
AutorChia-chi Yeh <chiachi@andr...>
CommiterThe Android Open Source Project

Log Message

am a263473: 1. Add a new option \'pppox <n>\' to support PPPoX sockets. No

Merge commit 'a263473d0d18736659607a8f2e178ee94cf3f989'

* commit 'a263473d0d18736659607a8f2e178ee94cf3f989':

  1. Add a new option 'pppox <n>' to support PPPoX sockets. Note that using this

Ändern Zusammenfassung

Diff

--- a/pppd/Android.mk
+++ b/pppd/Android.mk
@@ -13,7 +13,6 @@ LOCAL_SRC_FILES:= \
1313 chap-new.c \
1414 ccp.c \
1515 ecp.c \
16- ipxcp.c \
1716 auth.c \
1817 options.c \
1918 sys-linux.c \
@@ -24,10 +23,11 @@ LOCAL_SRC_FILES:= \
2423 eap.c \
2524 chap-md5.c \
2625 pppcrypt.c \
27- openssl-hash.c
26+ openssl-hash.c \
27+ pppox.c
2828
2929 LOCAL_SHARED_LIBRARIES := \
30- libcutils libcrypto libssl
30+ libcutils libcrypto
3131
3232 LOCAL_C_INCLUDES := \
3333 $(LOCAL_PATH)/include
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -360,13 +360,20 @@ main(argc, argv)
360360 */
361361 tty_init();
362362
363+#ifdef ANDROID_CHANGES
364+ {
365+ extern void pppox_init();
366+ pppox_init();
367+ }
368+#endif
369+
363370 progname = *argv;
364371
365372 /*
366373 * Parse, in order, the system options file, the user's options file,
367374 * and the command line arguments.
368375 */
369-#ifdef ANDROID
376+#ifdef ANDROID_CHANGES
370377 /* Android: only take options from commandline */
371378 if (!parse_args(argc-1, argv+1))
372379 exit(EXIT_OPTION_ERROR);
--- /dev/null
+++ b/pppd/pppox.c
@@ -0,0 +1,67 @@
1+/*
2+ * Copyright (C) 2009 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 <unistd.h>
18+#include "pppd.h"
19+
20+static int pppox_set(char **);
21+static int pppox_connect();
22+static void pppox_disconnect();
23+
24+static option_t pppox_options[] = {
25+ {"pppox", o_special, pppox_set, "PPPoX socket", OPT_DEVNAM},
26+ {NULL},
27+};
28+
29+static struct channel pppox_channel = {
30+ .options = pppox_options,
31+ .process_extra_options = NULL,
32+ .check_options = NULL,
33+ .connect = pppox_connect,
34+ .disconnect = pppox_disconnect,
35+ .establish_ppp = generic_establish_ppp,
36+ .disestablish_ppp = generic_disestablish_ppp,
37+ .send_config = NULL,
38+ .recv_config = NULL,
39+ .cleanup = NULL,
40+ .close = NULL,
41+};
42+
43+static int pppox = -1;
44+
45+static int pppox_set(char **argv) {
46+ if (!int_option(*argv, &pppox)) {
47+ return 0;
48+ }
49+ info("Using PPPoX (socket = %d)", pppox);
50+ the_channel = &pppox_channel;
51+ return 1;
52+}
53+
54+static int pppox_connect() {
55+ return pppox;
56+}
57+
58+static void pppox_disconnect() {
59+ if (pppox != -1) {
60+ close(pppox);
61+ pppox = -1;
62+ }
63+}
64+
65+void pppox_init() {
66+ add_options(pppox_options);
67+}