mtpd: Use PPTP implementation from upstream kernel

Add upstream kernel implementation of PPTP protocol. This code uses
pppopptp-android plugin, which was added to pppd project.

This patch changes the behavior of PPTP part of mtpd tool in a next way:
 - check if upstream kernel implementation of PPTP is enabled (in
   check_pptp() function)
    - if yes, use it:
      - create PX_PROTO_PPTP socket (in create_pppox_pptp() function)
      - and start pppd with pppopptp-android plugin (in
        start_pppd_pptp() function)
    - if no, fall back to use Android kernel implementation of PPTP
      - create PX_PROTO_OPNS socket (in create_pppox_opns() function)
      - and start pppd with pppox module (in start_pppd() function)

mtpd still handles PPTP control packets, while pppd handles PPP packets,
and kernel PPTP driver handles data packets.

After this patch, old implementation (PX_PROTO_OPNS) can be dropped from
Android kernel. After some transition time we can keep only PPTP support
in mtpd and drop OPNS support for good.

In order to use this PPTP implementation, next kernel option should be
enabled:

    CONFIG_PPTP=y

For more details see: [1].

[1] https://wiki.linaro.org/LMG/Kernel/PPP

Change-Id: Ia6d54ffe7748bd87424ea74250164b73eb4b6000
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
3 files changed
tree: 506b6ac5543c8381112c530bb5d282b3a02c1d1a
  1. Android.bp
  2. l2tp.c
  3. MODULE_LICENSE_APACHE2
  4. mtpd.c
  5. mtpd.h
  6. mtpd.rc
  7. NOTICE
  8. pptp.c