提交 b6a12687 编写于 作者: K Kozlov Dmitry

project cleanup and prepare to release

上级 5cf93f33
*.o
*.lo
*.la
kernel/driver/.pptp.o.flags
pppd_plugin/Makefile
pppd_plugin/config.h
pppd_plugin/config.log
pppd_plugin/config.status
pppd_plugin/libtool
pppd_plugin/src/.deps/
pppd_plugin/src/.libs/
pppd_plugin/src/Makefile
pppd_plugin/stamp-h1
pptpd-1.3.3/Makefile
pptpd-1.3.3/bcrelay
pptpd-1.3.3/config.h
pptpd-1.3.3/config.log
pptpd-1.3.3/config.status
pptpd-1.3.3/plugins/pptpd-logwtmp.so
pptpd-1.3.3/pptpctrl
pptpd-1.3.3/pptpd
pptpd-1.3.3/stamp-h1
build
*.swp
PROJECT (accel-pptpd)
cmake_minimum_required(VERSION 2.6)
ADD_SUBDIRECTORY(accel-pptpd)
if (BUILD_DRIVER)
ADD_SUBDIRECTORY(driver)
endif (BUILD_DRIVER)
------------------------------------------------------------------------
r9 | xebd | 2007-10-16 16:59:50 +0400 (Tue, 16 Oct 2007) | 2 lines
0.7.11 release
* fixed bug of receiving packets
------------------------------------------------------------------------
r8 | xebd | 2007-10-16 11:00:39 +0400 (Tue, 16 Oct 2007) | 2 lines
0.7.10 release
* only minor fixes for 0.7.9
------------------------------------------------------------------------
r7 | xebd | 2007-10-16 10:55:06 +0400 (Tue, 16 Oct 2007) | 1 line
* updated gentoo ebuild
------------------------------------------------------------------------
r6 | xebd | 2007-10-16 10:54:09 +0400 (Tue, 16 Oct 2007) | 2 lines
* fixed compilation bug for kernels <2.6.20
* reverted receive method
------------------------------------------------------------------------
r5 | xebd | 2007-10-15 13:21:22 +0400 (Mon, 15 Oct 2007) | 1 line
fixed Makefile
------------------------------------------------------------------------
r4 | xebd | 2007-10-15 11:12:26 +0400 (Mon, 15 Oct 2007) | 6 lines
0.7.9 release
* fixed bug which causes kernel panic when network is under heavy load
* added keep option which informs pptpd daemon to do not terminate pptpctrl processes after exit
* added some statistics collection (/proc/net/pptp/stat)
* client can setup multiple connections to same server now
* some cleanups
------------------------------------------------------------------------
r3 | xebd | 2007-07-12 10:08:38 +0400 (Thu, 12 Jul 2007) | 1 line
changed makefile rules for installation
------------------------------------------------------------------------
r2 | xebd | 2007-07-11 16:39:59 +0400 (Wed, 11 Jul 2007) | 1 line
added support for kernel 2.6.22
------------------------------------------------------------------------
r1 | xebd | 2007-04-23 16:16:06 +0400 (Mon, 23 Apr 2007) | 1 line
initial import
------------------------------------------------------------------------
Overview
--------
The ACCEL-PPTP is PPTP client/server based on POPTOP (http://www.poptop.org) and PPTPCLIENT (http://pptpclient.sourceforge.net).
The ACCEL-PPTP v1.0 is completly new implementation of PPTP which was written from null.
Userspace daemon has its own PPP implementation, so it does not uses pppd and one process (multi-threaded) manages all connections.
ACCEL-PPTP uses kernel module to increase performance and decrease system usage.
For more documentation about PPTP visit POPTOP web site.
ACCEL-PPTP was successfully tested on about 1200 connections and system usage has been decreased by ~50% on comparisons with the
original poptop server.
It is not fully tested yet so not recomended to use in production.
Also v1.0 is oriented for servers and does not containes client part, if you need client please use v0.8.x
Features
--------
1. Modular architecture
2. PPP controlling connection (PPTP) implemented as module and its possible to implement PPPoE/L2TP as modules too in the future
3. High-performance multi-threaded IO core
4. Radius authentication/accounting
5. Radius DM/CoA extention
6. Supported authentication types: PAP, CHAP (md5), Microsoft CHAP Extentions (including version 2), not supported - EAP
7. Supported MPPE, other compression types are not supported
8. Extensible logging engine with per session logging support, implemented log to file and log to PostgreSQL targets
9. Extensible user/password database, implemented only Radius target
10. Extensible IP pool, implemented Radius and static pools
11. Supported pppd compatible ip-up/ip-down scripts
Requirment
----------
1. modern linux distribution
1. kernel-2.6.15 or later with PPPoX support or kernel-2.4.x patched for PPPoX support (2.4.x not fully tested)
2. pppd-2.4.2 or later
2. kernel-2.6.15 or later with PPPoX support
3. cmake-2.6 or later
Compilation
-----------
Make sure you have configured kernel headers in /usr/src/linux or /lib/modules/`uname -r`/build,
or specify other location via KDIR environment variable
make client - compiles only client's part of package
make server - full compilation
make - full compilation
Insallation
-----------
Do make client_install for installing pptp client.
Do make server_install for installing pptp server.
Do make install for installing pptp server.
Configuration
-------------
If you are beginner in PPTP please read documentation available on POPTOP web site.
Configuration is same as original pptpd and pptp.
Exception in configuration of client is:
replace line in peer config file (for instance, /etc/ppp/peers/my_vpn):
pty "pptp x.x.x.x ...."
to
plugin "pptp.so"
pptp_server x.x.x.x
pptp_phone xxxx (optional)
pptp_window xxx (optional) - this is sliding window size (at current time automatic algorithm is not implemented),
set it to 3-10 for low-speed connections,
to >10 for hi-speed connections.
Remove lock option in /etc/ppp/options.pptp, /etc/ppp/options.pptpd or similar if it exists.
See configuration example in example directory.
read man accel-pptp.conf
Warning !!!
......@@ -61,58 +57,14 @@ Kernel module is available as separated module and as patch for kernel.
You can use either separated module or patch for kernel.
There is only patch for 2.6.18 kernel now. If you wish patch for other kernels please mail me.
ppp_generic_smp
---------------
This driver is replacement of kernel's ppp_generic for better smp performance.
It is disables by default, to enable you should uncomment "#obj-m += ppp_generic_smp.o" in kernel/driver/Makefile.
Thanks
------
Thanks to Kirill Yushkov for debug support and donations.
Contacts
--------
http://accel-pptp.sourceforge.net/
mail: xeb@mail.ru, xeb@linux.vsi.ru
mail: xeb@mail.ru
ICQ: 337258064
Jabber: xeb@city.veganet.ru, xeb@linux.vsi.ru
MDIR = extra
KDIR ?= $(shell sh find_kernel_headers)
obj-m += pptp.o
CURRENT = $(shell uname -r)
ifndef MAKING_MODULES
all: kernel_headers
make -C $(KDIR) SUBDIRS=$(PWD) modules
endif
ifneq (,$(findstring 2.4.,$(CURRENT)))
install:
@if test ! -d /lib/modules/$(CURRENT)/extra; then \
mkdir /lib/modules/$(CURRENT)/extra; \
fi; \
cp -v $(TARGET).o /lib/modules/$(CURRENT)/extra/$(TARGET).o && /sbin/depmod -a
else
install:
make -C $(KDIR) SUBDIRS=$(PWD) modules_install
endif
kernel_headers:
@if test -z "$(KDIR)"; then \
echo "kernel headers not found"; \
exit 1; \
else \
echo "using \"$(KDIR)\" kernel headers"; \
fi
clean:
-rm -f *.o *.ko .*.cmd .*.flags *.mod.c
ifneq (,$(findstring 2.4.,$(CURRENT)))
include $(KDIR)/Rules.make
endif
Jabber: xeb@xeb.homelinux.net
PROJECT (pptpd)
cmake_minimum_required(VERSION 2.6)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fvisibility=hidden -D_GNU_SOURCE -DGCC_SPINLOCK -DMEMDEBUG")
INCLUDE_DIRECTORIES(include)
......@@ -33,13 +30,27 @@ ADD_EXECUTABLE(accel-pptpd
iprange.c
utils.c
sigchld.c
log.c
main.c
memdebug.c
)
SET( FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
TARGET_LINK_LIBRARIES(accel-pptpd triton rt pthread ssl)
set_property(TARGET accel-pptpd PROPERTY CMAKE_SKIP_BUILD_RPATH FALSE)
set_property(TARGET accel-pptpd PROPERTY CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set_property(TARGET accel-pptpd PROPERTY INSTALL_RPATH_USE_LINK_PATH FALSE)
set_property(TARGET accel-pptpd PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/usr/lib/accel-pptp)
INSTALL(TARGETS accel-pptpd
RUNTIME DESTINATION usr/sbin
)
INSTALL(FILES accel-pptp.conf DESTINATION /etc)
INSTALL(FILES accel-pptp.conf.5 DESTINATION usr/share/man/man5)
ADD_LIBRARY(ippool SHARED ippool.c)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p /var/log/accel-pptp)")
[modules]
#path=/usr/local/lib/accel-pptp
log_file
#log_pgsql
pptp
......@@ -6,12 +7,13 @@ auth_pap
auth_chap_md5
auth_mschap_v1
auth_mschap_v2
libradius.so
pppd_compat
radius
ippool
sigchld
pppd_compat
[core]
log-error=/dev/stderr
log-error=/var/log/accel-pptp/core.log
thread-count=4
[ppp]
......@@ -28,40 +30,38 @@ echo-failure=3
echo-interval=30
verbose=1
[dns]
#dns1=172.16.0.1
#dns2=172.16.1.1
[radius]
dictionary=../radius/dict/dictionary
nas-identifier=pptp
#dictionary=/usr/local/share/accel-pptp/dictionary
nas-identifier=accel-pptp
nas-ip-address=127.0.0.1
gw-ip-address=192.168.100.100
gw-ip-address=192.168.100.1
auth_server=127.0.0.1:1812,testing123
acct_server=127.0.0.1:1813,testing123
dm_coa_secret=testing123
verbose=1
[client-ip-range]
192.168.10.20-30
192.168.10.6/32
192.168.10.1/24
192.168.11.0/24
192.168.0.0/24
10.0.0.0/8
[ip-pool]
gw-ip-address=192.168.100.1
#gw=192.168.100.210-211
#tunnel=192.168.100.200-201
192.168.100.2-255
192.168.101.1-255
192.168.102.1-255
192.168.103.1-255
gw-ip-address=192.168.0.1
192.168.0.2-255
192.168.1.1-255
192.168.2.1-255
192.168.3.1-255
[log]
log-file=general.log
log-emerg=/dev/stderr
log-debug=/dev/stdout
log-file=/var/log/accel-pptp/accel-pptp.log
log-emerg=/var/log/accel-pptp/emerg.log
#log-debug=/dev/stdout
copy=1
#color=1
#per-user-dir=per_user
per-session-dir=per_session
#per-session-dir=per_session
#per-session=1
level=3
......@@ -70,8 +70,8 @@ conninfo=user=log
log-table=log
[pppd-compat]
ip-up=./ip-up.sh
ip-down=./ip-down.sh
ip-change=./ip-change.sh
radattr-prefix=./radattr
ip-up=/etc/ppp/ip-up
ip-down=/etc/ppp/ip-down
ip-change=/etc/ppp/ip-change
radattr-prefix=/var/run/radattr
verbose=1
.TH ACCEL-PPTP.CONF 5 "6 October 2010"
.SH NAME
.B accel-pptp.conf
- ACCEL-PPTP VPN daemon configuration
.SH DESCRIPTION
.BR accel-pptpd (8)
reads options from this file, usually
.IR /etc/accel-pptp.conf
.TP
Configuration file consists of sections in form:
.TP
[section1]
.br
name1=val1
.br
name2=val2
.br
name3
.TP
[section2]
.br
....
.br
.SH SECTIONS
.TP
.SH [modules]
containes list of modules to load
.TP
.BI log_file
This is logging target which logs messages to files. It support per-session/per-user features.
.TP
.BI log_pgsql
This is logging target which logs messages to PostgreSQL.
.TP
.BI pptp
.br
PPTP controlling connection handling module.
.TP
.BI auth_pap
PAP authentication module.
.TP
.BI auth_chap
CHAP (md5) authentication module.
.TP
.BI auth_mschap_v1
Microsoft CHAP (version 1) authentication module.
.TP
.BI auth_mschap_v2
Microsoft CHAP (version 2) authentication module.
.TP
.BI radius
.br
RADIUS interaction module.
.TP
.BI ippool
.br
IP address assigning module.
.TP
.BI sigchld
Helper module to manage child processes, required by pppd_compat
.TP
.BI pppd_compat
This module starts pppd compatible ip-up/ip-down scripts and ip-change to handle RADIUS CoA request.
.TP
.SH [core]
Configuration of core module
.TP
.BI "log-error=" path
Path to file for core module error logging.
.TP
.BI "thread-count=" n
number of working threads, optimal - number of processors/cores
.TP
.SH [ppp]
.br
PPP module configuration.
.TP
.BI "verbose=" n
If n is not zero ppp module will produce verbose logging.
.TP
.BI "min-mtu=" n
Minimum acceptable MTU. If client will try to negotiate less then specified MTU then it will be NAKed or disconnected if rejects greater MTU.
.TP
.BI "mtu=" n
MTU which will be negotiated if client's MRU will be not acceptable.
.TP
.BI "mru=" n
Prefered MRU.
.TP
.SH [lcp]
.br
PPP LCP module configuration
.TP
.BI "echo-interval=" n
If this option is given and greater then 0 then lcp module will send echo-request every
.B n
seconds.
.TP
.BI "echo-failure=" n
Specifies maximum number of echo-requests may be sent without valid echo-reply, if exceeds connection will be terminated.
.TP
.SH [dns]
.TP
.BI "dns1=" x.x.x.x
Specifies primary DNS to be sent to peer.
.TP
.BI "dns2=" x.x.x.x
Specifies secondary DNS to be sent to peer.
.TP
.SH [client-ip-range]
You have to explicitly specify range of ip address from which clients can connect to server in form:
.br
.B x.x.x.x/mask
(for example 10.0.0.0/8)
.br
.B x.x.x.x-y
(for example 10.0.0.1-254)
.TP
.SH [pptp]
.br
Configuration of PPTP module.
.TP
.BI "bind=" x.x.x.x
If this option is given then pptp server will bind to specified IP address.
.TP
.BI "verbose=" n
If this option is given and
.B n
is greater of zero then pptp module will produce verbose logging.
.TP
.BI "echo-interval=" n
If this option is given and greater then zero then pptp module will send echo-request every
.B n
seconds.
.TP
.BI "echo-failure=" n
Specifies maximum number of echo-requests may be sent without valid echo-reply, if exceeds connection will be terminated.
.TP
.BI "timeout=" n
Timeout waiting reply from client in seconds (default 5).
.TP
.SH [radius]
.br
Configuration of RADIUS module.
.TP
.BI "nas-identifier=" identifier
Specifies value to send to RADIUS server in NAS-Identifier attribute and to be matched in DM/CoA requests.
.TP
.BI "nas-ip-address=" x.x.x.x
Specifies value to send to RADIUS server in NAS-IP-Address attribute and to be matched in DM/CoA requests.
Also DM/CoA server will bind to that address.
.TP
.BI "gw-ip-address=" x.x.x.x
Specifies address to use as local address of ppp interfaces if Framed-IP-Address received from RADIUS server.
.TP
.BI "auth_server=" x.x.x.x:port,secret
Specifies IP address, port and secret of authentication RADIUS server.
.TP
.BI "acct_server=" x.x.x.x:port,secret
Specifies IP address, port and secret of accounting RADIUS server.
.TP
.BI "dm_coa_secret=" secret
Specifies secret to use in DM/CoA communication.
.TP
.SH [log]
.br
Configuration of log and log_file modules.
.TP
.BI "log-file=" file
Path to file to write general log.
.TP
.BI "log-emerg=" file
Path to file to write emergency messages.
.TP
.BI "copy=" n
If this options is given and greater then zero logging engine will duplicate session log in general log.
(Useful when per-session/per-user logs are not used)
.TP
.BI "per-session-dir=" dir
Directory for session logs. If specified each session will be logged separately to file which name is unique session identifier.
.TP
.BI "per-user-dir=" dir
Directory for user logs. If specified all sessions of same user will be logged to file which name is user name.
.TP
.BI "per-session=" n
If specified and n is greater then zero each session of same user will be logger separately to directory specified by "per-user-dir"
and subdirectory which name is user name and to file which name os unique session identifier.
.TP
.BI "level=" n
Specifies log level which values are:
.br
.B 0
turn off all logging
.br
.B 1
log only error messages
.br
.B 2
log error and warning messages
.br
.B 3
log error, warning and information messages (use this level in conjuction with verbose option of other modules if you need verbose logging)
.br
.B 4
log all messages including debug messages
.TP
.SH [log-pgsql]
.br
Configuration of log_pgsql module.
.TP
.BI "conninfo=" conninfo
Conninfo to connect to PostgreSQL server.
.TP
.BI "log-table=" table
Table to send log messages. Table must contain following field:
.br
.B timestamp
timestamp
.br
.B username
text
.br
.B sessionid
text
.br
.B msg
text
.TP
.SH [pppd_compat]
.br
Configuration of pppd_compat module.
.TP
.BI "ip-up=" file
Path to ip-up script which is executed when ppp interfaces is completly configured and started.
.TP
.BI "ip-down=" file
Path to ip-down script which is executed when session is about to terminate.
.TP
.BI "ip-change=" file
Path to ip-change script which is executed for RADIUS CoA handling.
.TP
.BI "radattr=" prefix
Prefix of radattr files (for example /var/run/radattr, resulting files will be /var/run/radattr.pppX)
.TP
.BI "verbose=" n
If specified and greated then zero pppd_module will produce verbose logging.
.TP
.SH [ip-pool]
.br
Configuration of ippool module.
.TP
.BI "gw-ip-address=" x.x.x.x
Specifies single IP address to be used as local address of ppp interfaces.
.TP
.BI "gw=" range
Specifies range of local address of ppp interfaces if form:
.br
.B x.x.x.x/mask
(for example 10.0.0.0/8)
.br
.B x.x.x.x-y
(for example 10.0.0.1-254)
.TP
.BI "tunnel=" range
Specifies range of remote address of ppp interfaces if form:
.br
.B x.x.x.x/mask
.br
.B x.x.x.x-y
.TP
.BI "x.x.x.x/mask or x.x.x.x-y"
Also specifies range of remote address of ppp interfaces.
......@@ -3,3 +3,7 @@ ADD_LIBRARY(auth_chap_md5 SHARED auth_chap_md5.c)
ADD_LIBRARY(auth_mschap_v1 SHARED auth_mschap_v1.c)
ADD_LIBRARY(auth_mschap_v2 SHARED auth_mschap_v2.c)
INSTALL(TARGETS auth_pap auth_chap_md5 auth_mschap_v1 auth_mschap_v2
LIBRARY DESTINATION usr/lib/accel-pptp
)
......@@ -2,3 +2,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
ADD_LIBRARY(pptp SHARED pptp.c)
INSTALL(TARGETS pptp
LIBRARY DESTINATION usr/lib/accel-pptp
)
......@@ -677,14 +677,19 @@ static void __init pptp_init(void)
struct sockaddr_in addr;
char *opt;
serv.hnd.fd = socket (PF_INET, SOCK_STREAM, 0);
serv.hnd.fd = socket(PF_INET, SOCK_STREAM, 0);
if (serv.hnd.fd < 0) {
log_emerg("pptp: failed to create server socket: %s\n", strerror(errno));
return;
}
addr.sin_family = AF_INET;
addr.sin_port = htons (PPTP_PORT);
addr.sin_addr.s_addr = htonl (INADDR_ANY);
addr.sin_port = htons(PPTP_PORT);
opt = conf_get_opt("pptp", "bind");
if (opt)
addr.sin_addr.s_addr = inet_addr(opt);
else
addr.sin_addr.s_addr = htonl(INADDR_ANY);
setsockopt(serv.hnd.fd, SOL_SOCKET, SO_REUSEADDR, &serv.hnd.fd, 4);
if (bind (serv.hnd.fd, (struct sockaddr *) &addr, sizeof (addr)) < 0) {
......
ADD_LIBRARY(pppd_compat SHARED pppd_compat.c)
ADD_LIBRARY(ippool SHARED ippool.c)
ADD_LIBRARY(sigchld SHARED sigchld.c)
INSTALL(TARGETS pppd_compat ippool sigchld
LIBRARY DESTINATION usr/lib/accel-pptp
)
......@@ -7,7 +7,7 @@
#include "ipdb.h"
#include "list.h"
#include "triton/spinlock.h"
#include "spinlock.h"
#include "memdebug.h"
......
......@@ -48,7 +48,7 @@ static void ip_up_handler(struct sigchld_handler_t *h, int status)
struct pppd_compat_pd_t *pd = container_of(h, typeof(*pd), ip_up_hnd);
if (conf_verbose) {
log_switch(NULL, pd->ppp);
log_ppp_debug("pppd_compat: ip-up finished (%i)\n", status);
log_ppp_info("pppd_compat: ip-up finished (%i)\n", status);
}
}
......@@ -57,7 +57,7 @@ static void ip_down_handler(struct sigchld_handler_t *h, int status)
struct pppd_compat_pd_t *pd = container_of(h, typeof(*pd), ip_down_hnd);
if (conf_verbose) {
log_switch(NULL, pd->ppp);
log_ppp_debug("pppd_compat: ip-down finished (%i)\n", status);
log_ppp_info("pppd_compat: ip-down finished (%i)\n", status);
}
sched_yield();
triton_context_wakeup(pd->ppp->ctrl->ctx);
......@@ -68,7 +68,7 @@ static void ip_change_handler(struct sigchld_handler_t *h, int status)
struct pppd_compat_pd_t *pd = container_of(h, typeof(*pd), ip_change_hnd);
if (conf_verbose) {
log_switch(NULL, pd->ppp);
log_ppp_debug("pppd_compat: ip-change finished (%i)\n", status);
log_ppp_info("pppd_compat: ip-change finished (%i)\n", status);
}
sched_yield();
pd->ip_change_res = status;
......@@ -113,7 +113,7 @@ static void ev_ppp_started(struct ppp_t *ppp)
pd->ip_up_hnd.pid = pid;
sigchld_register_handler(&pd->ip_up_hnd);
if (conf_verbose)
log_ppp_debug("pppd_compat: ip-up started (pid %i)\n", pid);
log_ppp_info("pppd_compat: ip-up started (pid %i)\n", pid);
sigchld_unlock();
} else if (pid == 0) {
execv(conf_ip_up, argv);
......@@ -156,7 +156,7 @@ static void ev_ppp_finished(struct ppp_t *ppp)
pd->ip_down_hnd.pid = pid;
sigchld_register_handler(&pd->ip_down_hnd);
if (conf_verbose)
log_ppp_debug("pppd_compat: ip-down started (pid %i)\n", pid);
log_ppp_info("pppd_compat: ip-down started (pid %i)\n", pid);
sigchld_unlock();
triton_context_schedule(pd->ppp->ctrl->ctx);
pthread_mutex_lock(&pd->ip_down_hnd.lock);
......
......@@ -113,5 +113,5 @@ void __export sigchld_unlock()
static void __init init(void)
{
if (pthread_create(&sigchld_thr, NULL, sigchld_thread, NULL))
fprintf(stderr, "sigchld: pthread_create: %s\n", strerror(errno));
log_emerg("sigchld: pthread_create: %s\n", strerror(errno));
}
#ifndef PPP_FSM_H
#define PPP_FSM_H
typedef enum {FSM_Initial=0,FSM_Starting,FSM_Closed,FSM_Stopped,FSM_Closing,FSM_Stopping,FSM_Req_Sent,FSM_Ack_Rcvd,FSM_Ack_Sent,FSM_Opened} FSM_STATE;
/*
* CP (LCP, IPCP, etc.) codes.
*/
#define CONFREQ 1 /* Configuration Request */
#define CONFACK 2 /* Configuration Ack */
#define CONFNAK 3 /* Configuration Nak */
#define CONFREJ 4 /* Configuration Reject */
#define TERMREQ 5 /* Termination Request */
#define TERMACK 6 /* Termination Ack */
#define CODEREJ 7 /* Code Reject */
#define PROTOREJ 8 /* Code Reject */
#define ECHOREQ 9 /* Echo Request */
#define ECHOREP 10 /* Echo Reply */
struct ppp_t;
struct ppp_fsm_t
{
struct ppp_t *ppp;
FSM_STATE fsm_state;
uint16_t proto;
struct triton_timer_t restart_timer;
int restart_counter;
int max_terminate;
int max_configure;
int max_failure;
int timeout;
int conf_failure;
int id;
int recv_id;
//fsm handling
void (*layer_up)(struct ppp_fsm_t*);
void (*layer_down)(struct ppp_fsm_t*);
void (*layer_started)(struct ppp_fsm_t*);
void (*layer_finished)(struct ppp_fsm_t*);
int (*send_conf_req)(struct ppp_fsm_t*);
void (*send_conf_ack)(struct ppp_fsm_t*);
void (*send_conf_nak)(struct ppp_fsm_t*);
void (*send_conf_rej)(struct ppp_fsm_t*);
void (*send_code_rej)(struct ppp_fsm_t*);
};
void ppp_fsm_init(struct ppp_fsm_t*);
void ppp_fsm_free(struct ppp_fsm_t*);
int ppp_fsm_lower_up(struct ppp_fsm_t*);
void ppp_fsm_lower_down(struct ppp_fsm_t*);
int ppp_fsm_open(struct ppp_fsm_t*);
void ppp_fsm_close(struct ppp_fsm_t*);
void ppp_fsm_timeout0(struct ppp_fsm_t *layer);
void ppp_fsm_timeout1(struct ppp_fsm_t *layer);
void ppp_fsm_recv_conf_req_ack(struct ppp_fsm_t *layer);
void ppp_fsm_recv_conf_req_nak(struct ppp_fsm_t *layer);
void ppp_fsm_recv_conf_req_rej(struct ppp_fsm_t *layer);
void ppp_fsm_recv_conf_ack(struct ppp_fsm_t *layer);
void ppp_fsm_recv_conf_rej(struct ppp_fsm_t *layer);
void ppp_fsm_recv_term_req(struct ppp_fsm_t *layer);
void ppp_fsm_recv_term_ack(struct ppp_fsm_t *layer);
void ppp_fsm_recv_unk(struct ppp_fsm_t *layer);
void ppp_fsm_recv_code_rej_bad(struct ppp_fsm_t *layer);
#endif
../ppp/ppp_fsm.h
\ No newline at end of file
../sigchld.h
\ No newline at end of file
../extra/sigchld.h
\ No newline at end of file
ADD_LIBRARY(log_file SHARED log_file.c)
ADD_LIBRARY(log_pgsql SHARED log_pgsql.c)
TARGET_LINK_LIBRARIES(log_pgsql pq)
INSTALL(TARGETS log_file
LIBRARY DESTINATION usr/lib/accel-pptp
)
IF(LOG_PGSQL)
ADD_LIBRARY(log_pgsql SHARED log_pgsql.c)
TARGET_LINK_LIBRARIES(log_pgsql pq)
INSTALL(TARGETS log_pgsql
LIBRARY DESTINATION usr/lib/accel-pptp
)
ENDIF(LOG_PGSQL)
......@@ -9,6 +9,7 @@
#include "triton/triton.h"
#include "memdebug.h"
#include "log.h"
static int goto_daemon;
static char *pid_file;
......@@ -85,11 +86,8 @@ int main(int argc, char **argv)
sigset_t set;
int sig;
if (triton_load_modules("modules"))
return EXIT_FAILURE;
if (goto_daemon) {
pid_t pid = fork();
/*pid_t pid = fork();
if (pid > 0)
_exit(EXIT_SUCCESS);
if (pid < 0) {
......@@ -105,7 +103,8 @@ int main(int argc, char **argv)
chdir("/");
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
close(STDERR_FILENO);*/
daemon(0, 0);
}
if (pid_file) {
......@@ -119,6 +118,9 @@ int main(int argc, char **argv)
//signal(SIGTERM, sigterm);
//signal(SIGPIPE, sigterm);
if (triton_load_modules("modules"))
return EXIT_FAILURE;
triton_run();
sigfillset(&set);
......@@ -144,7 +146,7 @@ int main(int argc, char **argv)
sigaddset(&set, SIGBUS);
sigwait(&set, &sig);
printf("terminate, sig = %i\n", sig);
log_info("terminate, sig = %i\n", sig);
triton_terminate();
......
SET(target radius)
SET(sources
radius.c
dict.c
......@@ -9,5 +8,13 @@ SET(sources
dm_coa.c
)
ADD_DEFINITIONS(-DDICT_PATH="${CMAKE_INSTALL_PREFIX}/usr/share/accel-pptp/dictionary")
ADD_LIBRARY(radius SHARED ${sources})
INSTALL(TARGETS radius
LIBRARY DESTINATION usr/lib/accel-pptp
)
FILE(GLOB dict "${CMAKE_CURRENT_SOURCE_DIR}/dict/*")
INSTALL(FILES ${dict} DESTINATION usr/share/accel-pptp)
......@@ -246,11 +246,11 @@ static struct dm_coa_serv_t serv = {
static void __init init(void)
{
struct sockaddr_in addr;
struct sockaddr_in addr;
serv.hnd.fd = socket (PF_INET, SOCK_DGRAM, 0);
if (serv.hnd.fd < 0) {
log_error("radius:dm_coa: socket: %s\n", strerror(errno));
log_emerg("radius:dm_coa: socket: %s\n", strerror(errno));
return;
}
addr.sin_family = AF_INET;
......@@ -260,13 +260,13 @@ static void __init init(void)
else
addr.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (serv.hnd.fd, (struct sockaddr *) &addr, sizeof (addr)) < 0) {
log_error("radius:dm_coa: bind: %s\n", strerror(errno));
log_emerg("radius:dm_coa: bind: %s\n", strerror(errno));
close(serv.hnd.fd);
return;
}
if (fcntl(serv.hnd.fd, F_SETFL, O_NONBLOCK)) {
log_error("radius:dm_coa: failed to set nonblocking mode: %s\n", strerror(errno));
log_emerg("radius:dm_coa: failed to set nonblocking mode: %s\n", strerror(errno));
close(serv.hnd.fd);
return;
}
......
......@@ -309,6 +309,7 @@ static int parse_server(const char *opt, char **name, int *port, char **secret)
static void __init radius_init(void)
{
char *opt;
char *dict = DICT_PATH;
rpd_pool = mempool_create(sizeof(struct radius_pd_t));
......@@ -338,16 +339,16 @@ static void __init radius_init(void)
opt = conf_get_opt("radius", "auth_server");
if (!opt) {
log_error("radius: auth_server not specified\n");
log_emerg("radius: auth_server not specified\n");
_exit(EXIT_FAILURE);
} else if (parse_server(opt, &conf_auth_server, &conf_auth_server_port, &conf_auth_secret)) {
log_error("radius: failed to parse auth_server\n");
log_emerg("radius: failed to parse auth_server\n");
_exit(EXIT_FAILURE);
}
opt = conf_get_opt("radius", "acct_server");
if (opt && parse_server(opt, &conf_acct_server, &conf_acct_server_port, &conf_acct_secret)) {
log_error("radius: failed to parse acct_server\n");
log_emerg("radius: failed to parse acct_server\n");
_exit(EXIT_FAILURE);
}
......@@ -356,11 +357,10 @@ static void __init radius_init(void)
conf_dm_coa_secret = opt;
opt = conf_get_opt("radius", "dictionary");
if (!opt) {
fprintf(stderr, "radius: dictionary not specified\n");
_exit(EXIT_FAILURE);
}
if (rad_dict_load(opt))
if (opt)
dict = opt;
if (rad_dict_load(dict))
_exit(EXIT_FAILURE);
pwdb_register(&pwdb);
......@@ -371,4 +371,3 @@ static void __init radius_init(void)
triton_event_register_handler(EV_PPP_FINISHING, (triton_event_func)ppp_finishing);
triton_event_register_handler(EV_PPP_FINISHED, (triton_event_func)ppp_finished);
}
......@@ -236,7 +236,7 @@ void __init req_init(void)
{
urandom_fd = open("/dev/urandom", O_RDONLY);
if (!urandom_fd) {
perror("radius:req: open /dev/urandom");
log_emerg("radius:req: open /dev/urandom: %s\n", strerror(errno));
_exit(EXIT_FAILURE);
}
}
SET(target triton)
SET(sources_c
md.c
timer.c
......@@ -9,7 +8,13 @@ SET(sources_c
mempool.c
event.c
)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
ADD_LIBRARY(${target} SHARED ${sources_c})
ADD_DEFINITIONS(-DMODULE_PATH="${CMAKE_INSTALL_PREFIX}/usr/lib/accel-pptp")
ADD_LIBRARY(triton SHARED ${sources_c})
INSTALL(TARGETS triton
LIBRARY DESTINATION usr/lib/accel-pptp
)
......@@ -15,7 +15,7 @@ int load_modules(const char *name)
struct conf_sect_t *sect;
struct conf_option_t *opt;
char *fname;
char *path=".";
char *path = MODULE_PATH;
sect = conf_get_section(name);
if (!sect) {
......
......@@ -46,6 +46,8 @@ static void do_log(FILE *f, const char *fmt, va_list ap)
fprintf(f, "[%s.%i]", date, (int)tv.tv_usec / 1000);
vfprintf(f, fmt,ap);
pthread_mutex_unlock(&lock);
fflush(f);
}
void triton_log_error(const char *fmt,...)
{
......
......@@ -177,4 +177,3 @@ static void __init init(void)
{
signal(35, sigclean);
}
pppd-allow-mppe.patch
---------------------
This patch allows pppd conditionaly This patch allows you to include mppe when
the client requires. To do this you need to replace the option require-mppe-128
to allow-mppe-128.
diff --git a/pppd/ccp.c b/pppd/ccp.c
index 5814f35..377c733 100644
--- a/pppd/ccp.c
+++ b/pppd/ccp.c
@@ -139,6 +139,9 @@ static option_t ccp_option_list[] = {
{ "require-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
"require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
&ccp_wantoptions[0].mppe },
+ { "allow-mppe-128", o_bool, &ccp_allowoptions[0].allow_mppe,
+ "require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
+ &ccp_wantoptions[0].allow_mppe },
{ "+mppe-128", o_bool, &ccp_allowoptions[0].mppe,
"require MPPE 128-bit encryption",
OPT_ALIAS | OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
@@ -397,7 +400,7 @@ ccp_open(unit)
* deciding whether to open in silent mode.
*/
ccp_resetci(f);
- if (!ANY_COMPRESS(ccp_gotoptions[unit]))
+ if (!ANY_COMPRESS(ccp_gotoptions[unit]) || ccp_gotoptions[unit].allow_mppe)
f->flags |= OPT_SILENT;
fsm_open(f);
@@ -1077,6 +1080,8 @@ ccp_reqci(f, p, lenp, dont_nak)
int len, clen, type, nb;
ccp_options *ho = &ccp_hisoptions[f->unit];
ccp_options *ao = &ccp_allowoptions[f->unit];
+ ccp_options *go = &ccp_gotoptions[f->unit];
+ ccp_options *wo = &ccp_wantoptions[f->unit];
#ifdef MPPE
bool rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */
/* CI_MPPE, or due to other options? */
@@ -1103,11 +1108,22 @@ ccp_reqci(f, p, lenp, dont_nak)
switch (type) {
#ifdef MPPE
case CI_MPPE:
- if (!ao->mppe || clen != CILEN_MPPE) {
+ if (!(ao->mppe||ao->allow_mppe) || clen != CILEN_MPPE) {
newret = CONFREJ;
break;
}
+
MPPE_CI_TO_OPTS(&p[2], ho->mppe);
+
+ if (ao->allow_mppe && !ao->mppe && (ho->mppe&MPPE_OPT_128)){
+ ao->mppe=ao->allow_mppe;
+ go->mppe=go->allow_mppe;
+ wo->mppe=wo->allow_mppe;
+ ccp_resetci(f);
+ /*ccp_down(f);
+ ccp_up(f);
+ return CONFACK;*/
+ }
/* Nak if anything unsupported or unknown are set. */
if (ho->mppe & MPPE_OPT_UNSUPPORTED) {
diff --git a/pppd/ccp.h b/pppd/ccp.h
index 6f4a2fe..7211c74 100644
--- a/pppd/ccp.h
+++ b/pppd/ccp.h
@@ -38,6 +38,7 @@ typedef struct ccp_options {
bool deflate_correct; /* use correct code for deflate? */
bool deflate_draft; /* use draft RFC code for deflate? */
bool mppe; /* do MPPE? */
+ bool allow_mppe; /* do MPPE? */
u_short bsd_bits; /* # bits/code for BSD Compress */
u_short deflate_size; /* lg(window size) for Deflate */
short method; /* code for chosen compression method */
diff --git a/pppd/fsm.c b/pppd/fsm.c
index c200cc3..782dd0e 100644
--- a/pppd/fsm.c
+++ b/pppd/fsm.c
@@ -435,11 +435,11 @@ fsm_rconfreq(f, id, inp, len)
f->state = REQSENT;
break;
- case STOPPED:
- /* Negotiation started by our peer */
- fsm_sconfreq(f, 0); /* Send initial Configure-Request */
- f->state = REQSENT;
- break;
+// case STOPPED:
+// /* Negotiation started by our peer */
+// fsm_sconfreq(f, 0); /* Send initial Configure-Request */
+// f->state = REQSENT;
+// break;
}
/*
@@ -454,6 +454,11 @@ fsm_rconfreq(f, id, inp, len)
else
code = CONFACK;
+ if (f->state==STOPPED){
+ fsm_sconfreq(f, 0); /* Send initial Configure-Request */
+ f->state = REQSENT;
+ }
+
/* send the Ack, Nak or Rej to the peer */
fsm_sdata(f, code, id, inp, len);
if (NOT DEFINED KDIR)
set(KDIR "/usr/src/linux")
endif (NOT DEFINED KDIR)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/driver/pptp.ko
COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/driver &> /dev/null
COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/* ${CMAKE_CURRENT_BINARY_DIR}/driver
COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/driver modules
# COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/pptp.ko ${CMAKE_CURRENT_BINARY_DIR}/pptp.ko
# COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_SOURCE_DIR} clean
)
ADD_CUSTOM_TARGET(pptp_drv ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/driver/pptp.ko
)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/driver modules_install)")
obj-m += pptp.o
# Secrets for authentication using CHAP
# client server secret IP addresses
test pptp test *
test2 pptp test2 *
###############################################################################
# $Id: options.pptp,v 1.2 2005/08/20 13:16:38 quozl Exp $
#
# Sample PPTP PPP options file /etc/ppp/options.pptp
# Options used by PPP when a connection is made by a PPTP client.
# This file can be referred to by an /etc/ppp/peers file for the tunnel.
# Changes are effective on the next connection. See "man pppd".
#
# You are expected to change this file to suit your system. As
# packaged, it requires PPP 2.4.2 or later from http://ppp.samba.org/
# and the kernel MPPE module available from the CVS repository also on
# http://ppp.samba.org/, which is packaged for DKMS as kernel_ppp_mppe.
###############################################################################
# Lock the port
#lock
# Authentication
# We don't need the tunnel server to authenticate itself
noauth
# We won't do EAP, CHAP, or MSCHAP, but we will accept MSCHAP-V2
refuse-eap
refuse-chap
refuse-mschap
# Compression
# Turn off compression protocols we know won't be used
nobsdcomp
nodeflate
novj
novjccomp
# Encryption
# (There have been multiple versions of PPP with encryption support,
# choose with of the following sections you will use. Note that MPPE
# requires the use of MSCHAP-V2 during authentication)
# http://ppp.samba.org/ the PPP project version of PPP by Paul Mackarras
# ppp-2.4.2 or later with MPPE only, kernel module ppp_mppe.o
# {{{
# Require MPPE 128-bit encryption
require-mppe-128
# }}}
# http://polbox.com/h/hs001/ fork from PPP project by Jan Dubiec
# ppp-2.4.2 or later with MPPE and MPPC, kernel module ppp_mppe_mppc.o
# {{{
# Require MPPE 128-bit encryption
#mppe required,stateless
# }}}
###############################################################################
# $Id: options.pptpd,v 1.11 2005/12/29 01:21:09 quozl Exp $
#
# Sample Poptop PPP options file /etc/ppp/options.pptpd
# Options used by PPP when a connection arrives from a client.
# This file is pointed to by /etc/pptpd.conf option keyword.
# Changes are effective on the next connection. See "man pppd".
#
# You are expected to change this file to suit your system. As
# packaged, it requires PPP 2.4.2 and the kernel MPPE module.
###############################################################################
# Authentication
# Name of the local system for authentication purposes
# (must match the second field in /etc/ppp/chap-secrets entries)
name pptpd
# Strip the domain prefix from the username before authentication.
# (applies if you use pppd with chapms-strip-domain patch)
#chapms-strip-domain
# Encryption
# (There have been multiple versions of PPP with encryption support,
# choose with of the following sections you will use.)
# BSD licensed ppp-2.4.2 upstream with MPPE only, kernel module ppp_mppe.o
# {{{
refuse-pap
refuse-chap
refuse-mschap
# Require the peer to authenticate itself using MS-CHAPv2 [Microsoft
# Challenge Handshake Authentication Protocol, Version 2] authentication.
require-mschap-v2
# Require MPPE 128-bit encryption
# (note that MPPE requires the use of MSCHAP-V2 during authentication)
require-mppe-128
# }}}
# OpenSSL licensed ppp-2.4.1 fork with MPPE only, kernel module mppe.o
# {{{
#-chap
#-chapms
# Require the peer to authenticate itself using MS-CHAPv2 [Microsoft
# Challenge Handshake Authentication Protocol, Version 2] authentication.
#+chapms-v2
# Require MPPE encryption
# (note that MPPE requires the use of MSCHAP-V2 during authentication)
#mppe-40 # enable either 40-bit or 128-bit, not both
#mppe-128
#mppe-stateless
# }}}
# Network and Routing
# If pppd is acting as a server for Microsoft Windows clients, this
# option allows pppd to supply one or two DNS (Domain Name Server)
# addresses to the clients. The first instance of this option
# specifies the primary DNS address; the second instance (if given)
# specifies the secondary DNS address.
#ms-dns 10.0.0.1
#ms-dns 10.0.0.2
# If pppd is acting as a server for Microsoft Windows or "Samba"
# clients, this option allows pppd to supply one or two WINS (Windows
# Internet Name Services) server addresses to the clients. The first
# instance of this option specifies the primary WINS address; the
# second instance (if given) specifies the secondary WINS address.
#ms-wins 10.0.0.3
#ms-wins 10.0.0.4
# Add an entry to this system's ARP [Address Resolution Protocol]
# table with the IP address of the peer and the Ethernet address of this
# system. This will have the effect of making the peer appear to other
# systems to be on the local ethernet.
# (you do not need this if your PPTP server is responsible for routing
# packets to the clients -- James Cameron)
proxyarp
# Normally pptpd passes the IP address to pppd, but if pptpd has been
# given the delegate option in pptpd.conf or the --delegate command line
# option, then pppd will use chap-secrets or radius to allocate the
# client IP address. The default local IP address used at the server
# end is often the same as the address of the server. To override this,
# specify the local IP address here.
# (you must not use this unless you have used the delegate option)
#10.8.0.100
# Logging
# Enable connection debugging facilities.
# (see your syslog configuration for where pppd sends to)
#debug
# Print out all the option values which have been set.
# (often requested by mailing list to verify options)
#dump
# Miscellaneous
# Create a UUCP-style lock file for the pseudo-tty to ensure exclusive
# access.
#lock
# Disable BSD-Compress compression
nobsdcomp
nodeflate
# Disable Van Jacobson compression
# (needed on some networks with Windows 9x/ME/XP clients, see posting to
# poptop-server on 14th April 2005 by Pawel Pokrywka and followups,
# http://marc.theaimsgroup.com/?t=111343175400006&r=1&w=2 )
novj
novjccomp
# turn off logging to stderr, since this may be redirected to pptpd,
# which may trigger a loopback
nologfd
# put plugins here
# (putting them higher up may cause them to sent messages to the pty)
plugin "pptp.so"
pptp_server 192.168.10.10
#pptp_phone 12345
name test
remotename pptp
file /etc/ppp/options.pptp
ipparam test
#debug
#dump
mtu 1436
mru 1436
lcp-echo-interval 20
lcp-echo-failure 3
###############################################################################
# $Id: pptpd.conf,v 1.8 2004/04/28 11:36:07 quozl Exp $
#
# Sample Poptop configuration file /etc/pptpd.conf
#
# Changes are effective when pptpd is restarted.
###############################################################################
# TAG: ppp
# Path to the pppd program, default '/usr/sbin/pppd' on Linux
#
#ppp /usr/sbin/pppd
# TAG: option
# Specifies the location of the PPP options file.
# By default PPP looks in '/etc/ppp/options'
#
option /etc/ppp/options.pptpd
# TAG: debug
# Turns on (more) debugging to syslog
#
#debug
# TAG: stimeout
# Specifies timeout (in seconds) on starting ctrl connection
#
# stimeout 10
# TAG: noipparam
# Suppress the passing of the client's IP address to PPP, which is
# done by default otherwise.
#
#noipparam
# TAG: logwtmp
# Use wtmp(5) to record client connections and disconnections.
#
logwtmp
# TAG: bcrelay <if>
# Turns on broadcast relay to clients from interface <if>
#
#bcrelay eth1
# TAG: localip
# TAG: remoteip
# Specifies the local and remote IP address ranges.
#
# Any addresses work as long as the local machine takes care of the
# routing. But if you want to use MS-Windows networking, you should
# use IP addresses out of the LAN address space and use the proxyarp
# option in the pppd options file, or run bcrelay.
#
# You can specify single IP addresses seperated by commas or you can
# specify ranges, or both. For example:
#
# 192.168.0.234,192.168.0.245-249,192.168.0.254
#
# IMPORTANT RESTRICTIONS:
#
# 1. No spaces are permitted between commas or within addresses.
#
# 2. If you give more IP addresses than MAX_CONNECTIONS, it will
# start at the beginning of the list and go until it gets
# MAX_CONNECTIONS IPs. Others will be ignored.
#
# 3. No shortcuts in ranges! ie. 234-8 does not mean 234 to 238,
# you must type 234-238 if you mean this.
#
# 4. If you give a single localIP, that's ok - all local IPs will
# be set to the given one. You MUST still give at least one remote
# IP for each simultaneous client.
#
# (Recommended)
localip 192.168.0.1-4
remoteip 192.168.0.234-238
# or
#localip 192.168.0.234-238,192.168.0.245
#remoteip 192.168.1.234-238,192.168.1.245
#speed 4800
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
# Doxyfile 1.4.1-KDevelop
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = pptp.kdevelop
PROJECT_NUMBER = 0.1
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH = /home/dima/Projects/bg2/sectrr/
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = /home/dima/Projects/pptp/pptp
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.C \
*.CC \
*.C++ \
*.II \
*.I++ \
*.H \
*.HH \
*.H++ \
*.CS \
*.PHP \
*.PHP3 \
*.M \
*.MM \
*.C \
*.H \
*.tlh \
*.diff \
*.patch \
*.moc \
*.xpm \
*.dox
RECURSIVE = yes
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = yes
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = pptp.tag
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes a while. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Type `make install' to install the programs and any data files and
documentation.
4. You can remove the program binaries and object files from the
source code directory by typing `make clean'.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made.
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
MDIR = extra
KDIR ?= $(shell sh find_kernel_headers)
obj-m += pptp.o
#obj-m += gre.o
CURRENT = $(shell uname -r)
ifndef MAKING_MODULES
all: kernel_headers
make -C $(KDIR) SUBDIRS=$(PWD) modules
endif
ifneq (,$(findstring 2.4.,$(CURRENT)))
install:
@if test ! -d /lib/modules/$(CURRENT)/extra; then \
mkdir /lib/modules/$(CURRENT)/extra; \
fi; \
cp -v $(TARGET).o /lib/modules/$(CURRENT)/extra/$(TARGET).o && /sbin/depmod -a
else
install:
make -C $(KDIR) M=$(PWD) modules_install
endif
kernel_headers:
@if test -z "$(KDIR)"; then \
echo "kernel headers not found"; \
exit 1; \
else \
echo "using \"$(KDIR)\" kernel headers"; \
fi
default: all
clean:
-rm -f *.o *.ko .*.cmd .*.flags *.mod.c
ifneq (,$(findstring 2.4.,$(CURRENT)))
include $(KDIR)/Rules.make
endif
#!/bin/bash
if test -n "${KDIR}"; then
if test -f ${KDIR}/include/linux/version.h; then
echo ${KDIR}
exit 0
else
exit 1
fi
else
if test -f /usr/src/linux/include/linux/version.h; then
echo /usr/src/linux
exit 0
elif test -f /lib/modules/`uname -r`/build/include/linux/version.h; then
echo /lib/modules/`uname -r`/build
exit 0
else
exit 1
fi
fi
\ No newline at end of file
此差异已折叠。
--- a/drivers/net/ppp_generic.c 2008-07-14 01:51:29.000000000 +0400
+++ b/drivers/net/ppp_generic.c 2009-03-01 00:17:03.000000000 +0300
@@ -44,6 +44,7 @@
#include <linux/stddef.h>
#include <linux/device.h>
#include <linux/mutex.h>
+#include <linux/workqueue.h>
#include <net/slhc_vj.h>
#include <asm/atomic.h>
@@ -114,7 +115,8 @@
void *rc_state; /* its internal state 98 */
unsigned long last_xmit; /* jiffies when last pkt sent 9c */
unsigned long last_recv; /* jiffies when last pkt rcvd a0 */
- struct net_device *dev; /* network interface device a4 */
+ struct net_device *dev; /* network interface device a4 */
+ struct work_struct xmit_work;
#ifdef CONFIG_PPP_MULTILINK
int nxchan; /* next channel to send something on */
u32 nxseq; /* next sequence number to send */
@@ -154,6 +156,10 @@
struct ppp *ppp; /* ppp unit we're connected to */
struct list_head clist; /* link in list of channels per unit */
rwlock_t upl; /* protects `ppp' */
+
+ struct work_struct recv_work;
+ struct sk_buff_head rq; /* receive queue for pppd */
+
#ifdef CONFIG_PPP_MULTILINK
u8 avail; /* flag used in multilink stuff */
u8 had_frag; /* >= 1 fragments have been sent */
@@ -270,6 +276,7 @@
static void ppp_destroy_channel(struct channel *pch);
static struct class *ppp_class;
+static struct workqueue_struct *kpppd_workqueue;
/* Translates a PPP protocol number to a NP index (NP == network protocol) */
static inline int proto_to_npindex(int proto)
@@ -849,6 +856,13 @@
int err;
printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n");
+
+ kpppd_workqueue = create_workqueue("kpppd");
+ if (!kpppd_workqueue){
+ printk(KERN_ERR "failed to create workqueue\n");
+ return -1;
+ }
+
err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
if (!err) {
ppp_class = class_create(THIS_MODULE, "ppp");
@@ -858,10 +872,12 @@
}
device_create(ppp_class, NULL, MKDEV(PPP_MAJOR, 0), "ppp");
}
-
+
out:
- if (err)
+ if (err) {
+ destroy_workqueue(kpppd_workqueue);
printk(KERN_ERR "failed to register PPP device (%d)\n", err);
+ }
return err;
out_chrdev:
@@ -869,6 +885,12 @@
goto out;
}
+static void ppp_xmit_work(struct work_struct *work)
+{
+ struct ppp *ppp=container_of(work,typeof(*ppp),xmit_work);
+ ppp_xmit_process(ppp);
+}
+
/*
* Network interface unit routines.
*/
@@ -908,7 +930,7 @@
netif_stop_queue(dev);
skb_queue_tail(&ppp->file.xq, skb);
- ppp_xmit_process(ppp);
+ queue_work(kpppd_workqueue,&ppp->xmit_work);
return 0;
outf:
@@ -1453,13 +1475,29 @@
{
ppp_recv_lock(ppp);
/* ppp->dev == 0 means interface is closing down */
- if (ppp->dev)
- ppp_receive_frame(ppp, skb, pch);
- else
+ if (ppp->dev) {
+ skb_queue_tail(&pch->rq, skb);
+ queue_work(kpppd_workqueue,&pch->recv_work);
+ } else
kfree_skb(skb);
ppp_recv_unlock(ppp);
}
+static void ppp_recv_work(struct work_struct *work)
+{
+ struct channel *pch=container_of(work,typeof(*pch),recv_work);
+ struct sk_buff *skb;
+
+ ppp_recv_lock(pch->ppp);
+
+ while((skb=skb_dequeue(&pch->rq))){
+ if (pch->ppp->dev)
+ ppp_receive_frame(pch->ppp, skb, pch);
+ }
+
+ ppp_recv_unlock(pch->ppp);
+}
+
void
ppp_input(struct ppp_channel *chan, struct sk_buff *skb)
{
@@ -2000,6 +2038,8 @@
chan->ppp = pch;
init_ppp_file(&pch->file, CHANNEL);
pch->file.hdrlen = chan->hdrlen;
+ INIT_WORK(&pch->recv_work,ppp_recv_work);
+ skb_queue_head_init(&pch->rq);
#ifdef CONFIG_PPP_MULTILINK
pch->lastseq = -1;
#endif /* CONFIG_PPP_MULTILINK */
@@ -2419,6 +2459,7 @@
INIT_LIST_HEAD(&ppp->channels);
spin_lock_init(&ppp->rlock);
spin_lock_init(&ppp->wlock);
+ INIT_WORK(&ppp->xmit_work,ppp_xmit_work);
#ifdef CONFIG_PPP_MULTILINK
ppp->minseq = -1;
skb_queue_head_init(&ppp->mrq);
@@ -2529,6 +2570,7 @@
slhc_free(ppp->vj);
ppp->vj = NULL;
}
+ cancel_work_sync(&ppp->xmit_work);
skb_queue_purge(&ppp->file.xq);
skb_queue_purge(&ppp->file.rq);
#ifdef CONFIG_PPP_MULTILINK
@@ -2664,6 +2706,8 @@
}
skb_queue_purge(&pch->file.xq);
skb_queue_purge(&pch->file.rq);
+ cancel_work_sync(&pch->recv_work);
+ skb_queue_purge(&pch->rq);
kfree(pch);
}
@@ -2676,6 +2720,7 @@
unregister_chrdev(PPP_MAJOR, "ppp");
device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
class_destroy(ppp_class);
+ destroy_workqueue(kpppd_workqueue);
}
/*
--- a/drivers/net/ppp_generic.c 2008-12-25 02:26:37.000000000 +0300
+++ b/drivers/net/ppp_generic.c 2009-03-01 14:54:45.000000000 +0300
@@ -45,6 +45,7 @@
#include <linux/stddef.h>
#include <linux/device.h>
#include <linux/mutex.h>
+#include <linux/workqueue.h>
#include <net/slhc_vj.h>
#include <asm/atomic.h>
@@ -117,6 +118,7 @@
unsigned long last_recv; /* jiffies when last pkt rcvd a0 */
struct net_device *dev; /* network interface device a4 */
int closing; /* is device closing down? a8 */
+ struct work_struct xmit_work;
#ifdef CONFIG_PPP_MULTILINK
int nxchan; /* next channel to send something on */
u32 nxseq; /* next sequence number to send */
@@ -156,6 +158,10 @@
struct ppp *ppp; /* ppp unit we're connected to */
struct list_head clist; /* link in list of channels per unit */
rwlock_t upl; /* protects `ppp' */
+
+ struct work_struct recv_work;
+ struct sk_buff_head rq; /* receive queue for pppd */
+
#ifdef CONFIG_PPP_MULTILINK
u8 avail; /* flag used in multilink stuff */
u8 had_frag; /* >= 1 fragments have been sent */
@@ -272,6 +278,7 @@
static void ppp_destroy_channel(struct channel *pch);
static struct class *ppp_class;
+static struct workqueue_struct *kpppd_workqueue;
/* Translates a PPP protocol number to a NP index (NP == network protocol) */
static inline int proto_to_npindex(int proto)
@@ -860,6 +867,13 @@
int err;
printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n");
+
+ kpppd_workqueue = create_workqueue("kpppd");
+ if (!kpppd_workqueue){
+ printk(KERN_ERR "failed to create workqueue\n");
+ return -1;
+ }
+
err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
if (!err) {
ppp_class = class_create(THIS_MODULE, "ppp");
@@ -870,10 +884,12 @@
device_create(ppp_class, NULL, MKDEV(PPP_MAJOR, 0), NULL,
"ppp");
}
-
+
out:
- if (err)
+ if (err) {
+ destroy_workqueue(kpppd_workqueue);
printk(KERN_ERR "failed to register PPP device (%d)\n", err);
+ }
return err;
out_chrdev:
@@ -881,6 +897,12 @@
goto out;
}
+static void ppp_xmit_work(struct work_struct *work)
+{
+ struct ppp *ppp=container_of(work,typeof(*ppp),xmit_work);
+ ppp_xmit_process(ppp);
+}
+
/*
* Network interface unit routines.
*/
@@ -920,7 +942,7 @@
netif_stop_queue(dev);
skb_queue_tail(&ppp->file.xq, skb);
- ppp_xmit_process(ppp);
+ queue_work(kpppd_workqueue,&ppp->xmit_work);
return 0;
outf:
@@ -1464,13 +1486,29 @@
ppp_do_recv(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
{
ppp_recv_lock(ppp);
- if (!ppp->closing)
- ppp_receive_frame(ppp, skb, pch);
- else
+ if (!ppp->closing){
+ skb_queue_tail(&pch->rq, skb);
+ queue_work(kpppd_workqueue,&pch->recv_work);
+ }else
kfree_skb(skb);
ppp_recv_unlock(ppp);
}
+static void ppp_recv_work(struct work_struct *work)
+{
+ struct channel *pch=container_of(work,typeof(*pch),recv_work);
+ struct sk_buff *skb;
+
+ ppp_recv_lock(pch->ppp);
+
+ while((skb=skb_dequeue(&pch->rq))){
+ if (pch->ppp->dev)
+ ppp_receive_frame(pch->ppp, skb, pch);
+ }
+
+ ppp_recv_unlock(pch->ppp);
+}
+
void
ppp_input(struct ppp_channel *chan, struct sk_buff *skb)
{
@@ -2014,6 +2052,8 @@
chan->ppp = pch;
init_ppp_file(&pch->file, CHANNEL);
pch->file.hdrlen = chan->hdrlen;
+ INIT_WORK(&pch->recv_work,ppp_recv_work);
+ skb_queue_head_init(&pch->rq);
#ifdef CONFIG_PPP_MULTILINK
pch->lastseq = -1;
#endif /* CONFIG_PPP_MULTILINK */
@@ -2429,6 +2469,7 @@
INIT_LIST_HEAD(&ppp->channels);
spin_lock_init(&ppp->rlock);
spin_lock_init(&ppp->wlock);
+ INIT_WORK(&ppp->xmit_work,ppp_xmit_work);
#ifdef CONFIG_PPP_MULTILINK
ppp->minseq = -1;
skb_queue_head_init(&ppp->mrq);
@@ -2537,6 +2578,7 @@
slhc_free(ppp->vj);
ppp->vj = NULL;
}
+ cancel_work_sync(&ppp->xmit_work);
skb_queue_purge(&ppp->file.xq);
skb_queue_purge(&ppp->file.rq);
#ifdef CONFIG_PPP_MULTILINK
@@ -2672,6 +2714,8 @@
}
skb_queue_purge(&pch->file.xq);
skb_queue_purge(&pch->file.rq);
+ cancel_work_sync(&pch->recv_work);
+ skb_queue_purge(&pch->rq);
kfree(pch);
}
@@ -2684,6 +2728,7 @@
unregister_chrdev(PPP_MAJOR, "ppp");
device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
class_destroy(ppp_class);
+ destroy_workqueue(kpppd_workqueue);
}
/*
Kozlov D. <xeb@mail.ru>
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
# Doxyfile 1.4.1-KDevelop
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = pptp.kdevelop
PROJECT_NUMBER = 0.1
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = /home/dima/
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = /home/dima/Projects/pptp/pptp
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.C \
*.CC \
*.C++ \
*.II \
*.I++ \
*.H \
*.HH \
*.H++ \
*.CS \
*.PHP \
*.PHP3 \
*.M \
*.MM \
*.C \
*.H \
*.tlh \
*.diff \
*.patch \
*.moc \
*.xpm \
*.dox
RECURSIVE = yes
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = yes
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = pptp.tag
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes a while. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Type `make install' to install the programs and any data files and
documentation.
4. You can remove the program binaries and object files from the
source code directory by typing `make clean'.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made.
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
# not a GNU package. You can remove this line, if
# have all needed files, that a GNU package needs
AUTOMAKE_OPTIONS = foreign 1.4
SUBDIRS = src
default: all
all:
aclocal
autoheader
automake
autoconf
此差异已折叠。
此差异已折叠。
此差异已折叠。
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* "kernel version" */
#undef KERNELVERSION
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* "PPPD version" */
#undef PPPD_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
此差异已折叠。
此差异已折叠。
AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(pptp,0.8.4)
AC_LANG_C
AC_PROG_CC
AM_PROG_LIBTOOL
AC_DEFINE(PPPD_VERSION,[],"PPPD version")
AC_DEFINE(KERNELVERSION,[],"kernel version")
CFLAGS="${CFLAGS:=}"
dnl check linux headers
AC_MSG_CHECKING([for linux kernel herders])
if test -n "${KDIR}"; then
if test -f ${KDIR}/include/linux/version.h; then
header=${KDIR}/include
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Could not find linux kernel headers)
fi
else
kernel=`uname -r`
if test -f /usr/src/linux/include/linux/version.h; then
header=/usr/src/linux/include
elif test -f /lib/modules/${kernel}/build/include/linux/version.h; then
header=/lib/modules/${kernel}/build/include
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Could not find linux kernel headers)
fi
fi
VERSION=$(cat ${header/include}Makefile | grep '^VERSION = ' | awk '{print $3}')
PATCHLEVEL=$(cat ${header/include}Makefile | grep '^PATCHLEVEL = ' | awk '{print $3}')
SUBLEVEL=$(cat ${header/include}Makefile | grep '^SUBLEVEL = ' | awk '{print $3}')
EXTRAVERSION=$(cat ${header/include}Makefile | grep '^EXTRAVERSION = ' | awk '{print $3}')
KERNELVERSION=$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION
AC_MSG_RESULT(found ($KERNELVERSION at ${header/include}))
AC_DEFINE_UNQUOTED(KERNELVERSION,"$KERNELVERSION")
CFLAGS="${CFLAGS} -I. -I${header}"
AC_MSG_CHECKING([for pppd])
pppd=`which pppd 2>&1`
if test $? -eq 1; then
pppd=""
for path in /usr/sbin /usr/local/sbin /usr/bin /usr/local/bin /sbin; do
if test -x ${path}/pppd; then
pppd=${path}/pppd
break;
fi
done
fi
if test -z "${pppd}"; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Could not find pppd)
fi
pppd_ver=`${pppd} --version 2>&1 | grep version | sed 's/pppd version //'`
AC_MSG_RESULT($pppd ($pppd_ver))
AC_DEFINE_UNQUOTED(PPPD_VERSION,"${pppd_ver}")
echo '==============================================================================='
echo 'Configuration chosen:'
echo ' PPPD: '${pppd_ver}
echo ' linux kernel : '$KERNELVERSION at ${header/include}
AC_OUTPUT(Makefile src/Makefile)
\ No newline at end of file
此差异已折叠。
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd=$cpprog
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "$0: no input file specified" >&2
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "$0: $src does not exist" >&2
exit 1
fi
if [ x"$dst" = x ]
then
echo "$0: no destination specified" >&2
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d "$dst" ]
then
dst=$dst/`basename "$src"`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp=$pathcomp$1
shift
if [ ! -d "$pathcomp" ] ;
then
$mkdirprog "$pathcomp"
else
:
fi
pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd "$dst" &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename "$dst"`
else
dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename "$dst"`
else
:
fi
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$#
rmtmp=$dstdir/#rm.$$#
# Trap to clean up temp files at exit.
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
# Move or copy the file name to the temp name
$doit $instcmd "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
# Now remove or move aside any old file at destination location. We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons. In this case, the final cleanup
# might fail but the new file should still install successfully.
{
if [ -f "$dstdir/$dstfile" ]
then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
{
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit
}
此差异已折叠。
此差异已折叠。
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here
# set the include path found by configure
INCLUDES = $(all_includes)
# the library search path.
lib_LTLIBRARIES = pptp.la
pptp_la_LDFLAGS = -module
pptp_la_SOURCES = pptp.c pptp_callmgr.c pptp_ctrl.c util.c vector.c \
dirutil.c pptp_quirks.c orckit_quirks.c
noinst_HEADERS = pptp_callmgr.h pptp_ctrl.h util.h vector.h pptp_options.h \
dirutil.h pptp_quirks.h orckit_quirks.h if_pppox.h
AM_CFLAGS = -Wall
man_MANS = pppd-pptp.8
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册