1pptp called as:
2 pptp hostname [[pptp options] --] [pppd options]
3
4The pptp program does:
5
6gethostbyname([hostname]) to get ip number.
7
8Try to open unix domain socket at /var/run/pptp/ip.num.ber.here.  
9If not found, launch call manager for that ip address.
10
11Call manager opens unix domain socket at /var/run/pptp/ip.num.ber.here, does:
12  1) Open connection to the ip address using port 1723 protocol.
13  2) accept unix domain socket connection. 
14     [wait for any pptp call request to this ip]
15  3)  On receiving a connection, open CALL to ip.address using port 1723. 
16  2)  send callID over unix domain socket for gre encapsulation.
17  3)  Keepalive the socket.  When either side closes socket, send
18      call-close message to ip.address using port 1723.
19  4)  on close of last call, send connection close using port 1723, 
20      close the unix domain socket at /var/run/pptp/ip.num.ber.here,
21      and exit.
22
23Once call manager is opened (fork when done to return status to parent),
24the main process forks.
25   Parent) launch gre-copy task. Holds call manager socket.  
26   Child)  launch pppd with command-line options.
27
28Killing any of the three threads should cleanly shutdown system. HOW?
29Send pid of parent and child to call manager after fork over 
30Unix-domain socket.
31
32Alternatively pptp may be launched by pppd. One advantage is that
33many existing tools for managing serial ppp connections can be used with
34pptp connections as well. Another is some pppd options can only be used 
35this way. In particular the options "persist" and "demand" may be of use.
36
37Add the following option to your pppd options script:
38
39pty "<insert.path.to>/pptp hostname --nolaunchpppd [--phone phone-nr]"
40
41and start the connection like any other pppd connection. Note that
42old versions of pppd may not support the pty option.
43
44The following options are understood by pptp:
45
46--phone phone-number
47        Specify the phone number for the connection. This is required 
48        by a number of ADSL services.
49
50--nolaunchpppd
51        Needed if pptp is to be launched by pppd. See above
52        
53        
54