summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-10-06 16:55:05 +0400
committerKozlov Dmitry <dima@server>2010-10-06 16:55:05 +0400
commit45b3c9c5bdd896f51f47e29069e3c030ddb17d51 (patch)
treecbec5824ffb2eee20b98ad9892a357304384ff01
parentba3db9f17477ea4b49c266c5cb50f63f3b074db2 (diff)
parent01ccd98495c9da1e79f7867bf52416b23f20200d (diff)
downloadaccel-ppp-xebd-45b3c9c5bdd896f51f47e29069e3c030ddb17d51.tar.gz
accel-ppp-xebd-45b3c9c5bdd896f51f47e29069e3c030ddb17d51.zip
merged branch accel-pptpd
-rw-r--r--.gitignore24
-rw-r--r--CMakeLists.txt8
-rw-r--r--Changelog45
-rw-r--r--README100
-rw-r--r--accel-pptpd/CMakeLists.txt56
-rw-r--r--accel-pptpd/accel-pptp.conf77
-rw-r--r--accel-pptpd/accel-pptp.conf.5272
-rw-r--r--accel-pptpd/auth/CMakeLists.txt9
-rw-r--r--accel-pptpd/auth/auth_chap_md5.c398
-rw-r--r--accel-pptpd/auth/auth_mschap_v1.c453
-rw-r--r--accel-pptpd/auth/auth_mschap_v2.c529
-rw-r--r--accel-pptpd/auth/auth_pap.c259
-rw-r--r--accel-pptpd/ctrl/CMakeLists.txt8
-rw-r--r--accel-pptpd/ctrl/pptp.c736
-rw-r--r--accel-pptpd/ctrl/pptp_prot.h299
-rw-r--r--accel-pptpd/extra/CMakeLists.txt8
-rw-r--r--accel-pptpd/extra/ippool.c208
-rw-r--r--accel-pptpd/extra/pppd_compat.c379
-rw-r--r--accel-pptpd/extra/sigchld.c117
-rw-r--r--accel-pptpd/extra/sigchld.h21
-rw-r--r--accel-pptpd/include/events.h38
-rw-r--r--accel-pptpd/include/if_pppox.h227
l---------accel-pptpd/include/ipdb.h1
l---------accel-pptpd/include/iprange.h1
l---------accel-pptpd/include/list.h1
l---------accel-pptpd/include/log.h1
l---------accel-pptpd/include/memdebug.h1
l---------accel-pptpd/include/mempool.h1
l---------accel-pptpd/include/ppp.h1
l---------accel-pptpd/include/ppp_auth.h1
l---------accel-pptpd/include/ppp_fsm.h1
l---------accel-pptpd/include/ppp_lcp.h1
l---------accel-pptpd/include/pwdb.h1
l---------accel-pptpd/include/radius.h1
l---------accel-pptpd/include/sigchld.h1
l---------accel-pptpd/include/spinlock.h1
l---------accel-pptpd/include/triton.h1
l---------accel-pptpd/include/utils.h1
-rw-r--r--accel-pptpd/ipdb.c31
-rw-r--r--accel-pptpd/ipdb.h29
-rw-r--r--accel-pptpd/iprange.c136
-rw-r--r--accel-pptpd/iprange.h10
-rw-r--r--accel-pptpd/log.c452
-rw-r--r--accel-pptpd/log.h66
-rw-r--r--accel-pptpd/logs/CMakeLists.txt13
-rw-r--r--accel-pptpd/logs/log_file.c613
-rw-r--r--accel-pptpd/logs/log_pgsql.c320
-rw-r--r--accel-pptpd/main.c155
-rw-r--r--accel-pptpd/memdebug.c180
-rw-r--r--accel-pptpd/memdebug.h28
-rw-r--r--accel-pptpd/ppp/CMakeLists.txt19
-rw-r--r--accel-pptpd/ppp/ccp_mppe.c215
-rw-r--r--accel-pptpd/ppp/ipcp_opt_dns.c163
-rw-r--r--accel-pptpd/ppp/ipcp_opt_ipaddr.c177
-rw-r--r--accel-pptpd/ppp/lcp_opt_accomp.c106
-rw-r--r--accel-pptpd/ppp/lcp_opt_magic.c91
-rw-r--r--accel-pptpd/ppp/lcp_opt_mru.c159
-rw-r--r--accel-pptpd/ppp/lcp_opt_pcomp.c106
-rw-r--r--accel-pptpd/ppp/ppp.c537
-rw-r--r--accel-pptpd/ppp/ppp.h158
-rw-r--r--accel-pptpd/ppp/ppp_auth.c326
-rw-r--r--accel-pptpd/ppp/ppp_auth.h35
-rw-r--r--accel-pptpd/ppp/ppp_ccp.c724
-rw-r--r--accel-pptpd/ppp/ppp_ccp.h96
-rw-r--r--accel-pptpd/ppp/ppp_fsm.c525
-rw-r--r--accel-pptpd/ppp/ppp_fsm.h72
-rw-r--r--accel-pptpd/ppp/ppp_ipcp.c651
-rw-r--r--accel-pptpd/ppp/ppp_ipcp.h96
-rw-r--r--accel-pptpd/ppp/ppp_lcp.c821
-rw-r--r--accel-pptpd/ppp/ppp_lcp.h136
-rw-r--r--accel-pptpd/ppp/ppp_notify.c54
-rw-r--r--accel-pptpd/ppp/ppp_pd.c14
-rw-r--r--accel-pptpd/pwdb.c56
-rw-r--r--accel-pptpd/pwdb.h27
-rw-r--r--accel-pptpd/radius/CMakeLists.txt20
-rw-r--r--accel-pptpd/radius/acct.c208
-rw-r--r--accel-pptpd/radius/attr_defs.h287
-rw-r--r--accel-pptpd/radius/auth.c397
-rw-r--r--accel-pptpd/radius/dict.c356
-rw-r--r--accel-pptpd/radius/dict/dictionary78
-rw-r--r--accel-pptpd/radius/dict/dictionary.microsoft83
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc2865137
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc286657
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc286716
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc286854
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc286939
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc357630
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc358016
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc40729
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc43728
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc467528
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc467962
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc481811
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc48498
-rw-r--r--accel-pptpd/radius/dict/dictionary.rfc51769
-rw-r--r--accel-pptpd/radius/dict2c.py20
-rw-r--r--accel-pptpd/radius/dm_coa.c278
-rw-r--r--accel-pptpd/radius/packet.c607
-rw-r--r--accel-pptpd/radius/radius.c373
-rw-r--r--accel-pptpd/radius/radius.h107
-rw-r--r--accel-pptpd/radius/radius_p.h96
-rw-r--r--accel-pptpd/radius/req.c242
-rw-r--r--accel-pptpd/triton/CMakeLists.txt20
-rw-r--r--accel-pptpd/triton/conf_file.c187
-rw-r--r--accel-pptpd/triton/event.c105
-rw-r--r--accel-pptpd/triton/list.h249
-rw-r--r--accel-pptpd/triton/loader.c62
-rw-r--r--accel-pptpd/triton/log.c73
-rw-r--r--accel-pptpd/triton/md.c188
-rw-r--r--accel-pptpd/triton/mempool.c179
-rw-r--r--accel-pptpd/triton/mempool.h25
-rw-r--r--accel-pptpd/triton/options.c48
-rw-r--r--accel-pptpd/triton/spinlock.h20
-rw-r--r--accel-pptpd/triton/timer.c181
-rw-r--r--accel-pptpd/triton/triton.c472
-rw-r--r--accel-pptpd/triton/triton.h127
-rw-r--r--accel-pptpd/triton/triton_p.h105
-rw-r--r--accel-pptpd/utils.c11
-rw-r--r--accel-pptpd/utils.h8
-rw-r--r--contrib/README8
-rw-r--r--contrib/gentoo/net-dialup/accel-pptp/files/options.pptp (renamed from gentoo/net-dialup/accel-pptp/files/options.pptp)0
-rw-r--r--contrib/gentoo/net-dialup/accel-pptp/files/pptpd-confd (renamed from gentoo/net-dialup/accel-pptp/files/pptpd-confd)0
-rwxr-xr-xcontrib/gentoo/net-dialup/accel-pptp/files/pptpd-init (renamed from gentoo/net-dialup/accel-pptp/files/pptpd-init)0
-rw-r--r--contrib/pppd-allow-mppe.patch101
-rw-r--r--driver/CMakeLists.txt18
-rw-r--r--driver/Makefile1
-rw-r--r--driver/gre.c (renamed from kernel/driver/gre.c)0
-rw-r--r--driver/gre.h (renamed from kernel/driver/gre.h)0
-rw-r--r--driver/if_pppox.h (renamed from kernel/driver/if_pppox.h)0
-rw-r--r--driver/pptp.c (renamed from kernel/driver/pptp.c)0
-rw-r--r--example/etc/modprobe.conf1
-rw-r--r--example/etc/ppp/chap-secrets4
-rw-r--r--example/etc/ppp/options.pptp51
-rw-r--r--example/etc/ppp/options.pptpd129
-rw-r--r--example/etc/ppp/peers/pptp_test13
-rw-r--r--example/etc/pptpd.conf82
-rw-r--r--gentoo/net-dialup/accel-pptp/accel-pptp-0.8.5.ebuild112
-rw-r--r--kernel/driver/AUTHORS1
-rw-r--r--kernel/driver/COPYING340
-rw-r--r--kernel/driver/ChangeLog0
-rw-r--r--kernel/driver/Doxyfile275
-rw-r--r--kernel/driver/INSTALL167
-rw-r--r--kernel/driver/Makefile42
-rw-r--r--kernel/driver/NEWS0
-rw-r--r--kernel/driver/README0
-rw-r--r--kernel/driver/TODO0
-rwxr-xr-xkernel/driver/find_kernel_headers21
-rw-r--r--kernel/patch/patch-2.6.181110
-rw-r--r--kernel/patch/ppp-generic-smp-2.6.26.patch165
-rw-r--r--kernel/patch/ppp-generic-smp-2.6.28.patch163
-rw-r--r--pppd_plugin/AUTHORS1
-rw-r--r--pppd_plugin/COPYING340
-rw-r--r--pppd_plugin/ChangeLog0
-rw-r--r--pppd_plugin/Doxyfile275
-rw-r--r--pppd_plugin/INSTALL167
-rw-r--r--pppd_plugin/Makefile.am5
-rw-r--r--pppd_plugin/Makefile.cvs8
-rw-r--r--pppd_plugin/Makefile.in618
-rw-r--r--pppd_plugin/NEWS0
-rw-r--r--pppd_plugin/README0
-rw-r--r--pppd_plugin/TODO0
-rw-r--r--pppd_plugin/aclocal.m47483
-rwxr-xr-xpppd_plugin/config.guess1532
-rw-r--r--pppd_plugin/config.h.in61
-rwxr-xr-xpppd_plugin/config.sub1640
-rwxr-xr-xpppd_plugin/configure20887
-rw-r--r--pppd_plugin/configure.in73
-rwxr-xr-xpppd_plugin/depcomp441
-rwxr-xr-xpppd_plugin/install-sh276
-rw-r--r--pppd_plugin/ltmain.sh6997
-rwxr-xr-xpppd_plugin/missing337
-rwxr-xr-xpppd_plugin/mkinstalldirs111
-rw-r--r--pppd_plugin/src/Makefile.am13
-rw-r--r--pppd_plugin/src/Makefile.in528
-rw-r--r--pppd_plugin/src/dirutil.c68
-rw-r--r--pppd_plugin/src/dirutil.h14
l---------pppd_plugin/src/if_pppox.h1
-rw-r--r--pppd_plugin/src/orckit_quirks.c86
-rw-r--r--pppd_plugin/src/orckit_quirks.h27
-rw-r--r--pppd_plugin/src/pppd-pptp.871
-rw-r--r--pppd_plugin/src/pppd/cbcp.h26
-rw-r--r--pppd_plugin/src/pppd/ccp.h52
-rw-r--r--pppd_plugin/src/pppd/chap-md5.h31
-rw-r--r--pppd_plugin/src/pppd/chap-new.h130
-rw-r--r--pppd_plugin/src/pppd/chap_ms.h122
-rw-r--r--pppd_plugin/src/pppd/eap.h158
-rw-r--r--pppd_plugin/src/pppd/ecp.h45
-rw-r--r--pppd_plugin/src/pppd/eui64.h114
-rw-r--r--pppd_plugin/src/pppd/fsm.h168
-rw-r--r--pppd_plugin/src/pppd/ipcp.h96
-rw-r--r--pppd_plugin/src/pppd/ipv6cp.h171
-rw-r--r--pppd_plugin/src/pppd/ipxcp.h94
-rw-r--r--pppd_plugin/src/pppd/lcp.h119
-rw-r--r--pppd_plugin/src/pppd/magic.h49
-rw-r--r--pppd_plugin/src/pppd/md4.h64
-rw-r--r--pppd_plugin/src/pppd/md5.h65
-rw-r--r--pppd_plugin/src/pppd/pathnames.h59
-rw-r--r--pppd_plugin/src/pppd/pppcrypt.h48
-rw-r--r--pppd_plugin/src/pppd/pppd.h904
-rw-r--r--pppd_plugin/src/pppd/sha1.h31
-rw-r--r--pppd_plugin/src/pppd/spinlock.h59
-rw-r--r--pppd_plugin/src/pppd/tdb.h164
-rw-r--r--pppd_plugin/src/pppd/upap.h110
-rw-r--r--pppd_plugin/src/pptp.c344
-rw-r--r--pppd_plugin/src/pptp_callmgr.c403
-rw-r--r--pppd_plugin/src/pptp_callmgr.h13
-rw-r--r--pppd_plugin/src/pptp_ctrl.c1077
-rw-r--r--pppd_plugin/src/pptp_ctrl.h57
-rw-r--r--pppd_plugin/src/pptp_msg.h303
-rw-r--r--pppd_plugin/src/pptp_options.h41
-rw-r--r--pppd_plugin/src/pptp_quirks.c54
-rw-r--r--pppd_plugin/src/pptp_quirks.h59
-rw-r--r--pppd_plugin/src/util.c158
-rw-r--r--pppd_plugin/src/util.h54
-rw-r--r--pppd_plugin/src/vector.c209
-rw-r--r--pppd_plugin/src/vector.h31
-rw-r--r--pppd_plugin/templates/c19
-rw-r--r--pppd_plugin/templates/h19
-rw-r--r--pptpd-1.3.3/AUTHORS52
-rw-r--r--pptpd-1.3.3/COPYING339
-rw-r--r--pptpd-1.3.3/ChangeLog611
-rw-r--r--pptpd-1.3.3/INSTALL188
-rw-r--r--pptpd-1.3.3/Makefile.am102
-rw-r--r--pptpd-1.3.3/Makefile.in732
-rw-r--r--pptpd-1.3.3/Makefile.uClinux68
-rw-r--r--pptpd-1.3.3/NEWS0
-rw-r--r--pptpd-1.3.3/README30
-rw-r--r--pptpd-1.3.3/README.bcrelay72
-rw-r--r--pptpd-1.3.3/README.cvs28
-rw-r--r--pptpd-1.3.3/README.inetd45
-rw-r--r--pptpd-1.3.3/README.logwtmp36
-rw-r--r--pptpd-1.3.3/TODO2
-rw-r--r--pptpd-1.3.3/aclocal.m4862
-rw-r--r--pptpd-1.3.3/bcrelay.c1014
-rw-r--r--pptpd-1.3.3/compat.c129
-rw-r--r--pptpd-1.3.3/compat.h82
-rw-r--r--pptpd-1.3.3/config.embed.h15
-rw-r--r--pptpd-1.3.3/config.h.in148
-rw-r--r--pptpd-1.3.3/configfile.c160
-rw-r--r--pptpd-1.3.3/configfile.h14
-rwxr-xr-xpptpd-1.3.3/configure7670
-rw-r--r--pptpd-1.3.3/configure.in250
-rw-r--r--pptpd-1.3.3/ctrlpacket.c719
-rw-r--r--pptpd-1.3.3/ctrlpacket.h18
-rw-r--r--pptpd-1.3.3/debian/README.debian8
-rw-r--r--pptpd-1.3.3/debian/changelog175
-rw-r--r--pptpd-1.3.3/debian/conffiles3
-rw-r--r--pptpd-1.3.3/debian/config22
-rw-r--r--pptpd-1.3.3/debian/control15
-rw-r--r--pptpd-1.3.3/debian/copyright11
-rw-r--r--pptpd-1.3.3/debian/dirs4
-rw-r--r--pptpd-1.3.3/debian/docs8
-rw-r--r--pptpd-1.3.3/debian/examples3
-rw-r--r--pptpd-1.3.3/debian/po/POTFILES.in1
-rw-r--r--pptpd-1.3.3/debian/po/fr.po208
-rw-r--r--pptpd-1.3.3/debian/po/pt_BR.po204
-rw-r--r--pptpd-1.3.3/debian/po/templates.pot170
-rw-r--r--pptpd-1.3.3/debian/pptpd-options94
-rw-r--r--pptpd-1.3.3/debian/pptpd.conf80
-rw-r--r--pptpd-1.3.3/debian/pptpd.init56
-rw-r--r--pptpd-1.3.3/debian/pptpdconfig.pl81
-rwxr-xr-xpptpd-1.3.3/debian/rules78
-rw-r--r--pptpd-1.3.3/debian/templates75
-rw-r--r--pptpd-1.3.3/defaults.h80
-rw-r--r--pptpd-1.3.3/getopt.c1064
-rw-r--r--pptpd-1.3.3/getopt1.c199
-rw-r--r--pptpd-1.3.3/html/CVS/Entries3
-rw-r--r--pptpd-1.3.3/html/CVS/Repository1
-rw-r--r--pptpd-1.3.3/html/CVS/Root1
-rw-r--r--pptpd-1.3.3/html/HOWTO-PoPToP.txt873
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/CVS/Entries15
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/CVS/Repository1
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/CVS/Root1
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/diagram1.jpgbin14842 -> 0 bytes
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_1.htm123
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_10.htm87
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_11.htm83
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_12.htm70
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_2.htm46
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_3.htm58
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_4.htm56
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_5.htm66
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_6.htm93
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_7.htm93
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_8.htm91
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_9.htm52
-rw-r--r--pptpd-1.3.3/html/poptop_ads_howto/test.txt1
-rw-r--r--pptpd-1.3.3/html/setup_pptp_client.html89
l---------pptpd-1.3.3/if_pppox.h1
-rwxr-xr-xpptpd-1.3.3/install-sh251
-rw-r--r--pptpd-1.3.3/inststr.c51
-rw-r--r--pptpd-1.3.3/inststr.h17
-rwxr-xr-xpptpd-1.3.3/makepackage36
-rwxr-xr-xpptpd-1.3.3/missing361
-rwxr-xr-xpptpd-1.3.3/mkinstalldirs40
-rw-r--r--pptpd-1.3.3/our_getopt.h177
-rw-r--r--pptpd-1.3.3/our_syslog.h44
-rw-r--r--pptpd-1.3.3/plugins/Makefile34
-rw-r--r--pptpd-1.3.3/plugins/pppd.h881
-rw-r--r--pptpd-1.3.3/plugins/pptpd-logwtmp.c60
-rw-r--r--pptpd-1.3.3/pptpctrl.c701
-rw-r--r--pptpd-1.3.3/pptpctrl.h17
-rw-r--r--pptpd-1.3.3/pptpd.8205
-rw-r--r--pptpd-1.3.3/pptpd.c829
-rw-r--r--pptpd-1.3.3/pptpd.conf.5255
-rw-r--r--pptpd-1.3.3/pptpd.init58
-rw-r--r--pptpd-1.3.3/pptpd.spec157
-rw-r--r--pptpd-1.3.3/pptpdefs.h327
-rw-r--r--pptpd-1.3.3/pptpmanager.c556
-rw-r--r--pptpd-1.3.3/pptpmanager.h24
-rwxr-xr-xpptpd-1.3.3/reconf61
-rw-r--r--pptpd-1.3.3/samples/chap-secrets3
-rw-r--r--pptpd-1.3.3/samples/options.pptpd128
-rw-r--r--pptpd-1.3.3/samples/pptpd.conf100
-rwxr-xr-xpptpd-1.3.3/tools/pptp-portslave6
-rwxr-xr-xpptpd-1.3.3/tools/vpnstats55
-rwxr-xr-xpptpd-1.3.3/tools/vpnstats.pl125
-rwxr-xr-xpptpd-1.3.3/tools/vpnuser59
-rwxr-xr-xpptpd-1.3.3/version28
-rw-r--r--rfc/README15
-rw-r--r--rfc/README.Reference15
-rw-r--r--rfc/ms-chap.txt1139
-rw-r--r--rfc/pptp-draft.txt3472
-rw-r--r--rfc/rfc1172.txt (renamed from doc/rfc1172.txt)0
-rw-r--r--rfc/rfc1332.txt (renamed from doc/rfc1332.txt)0
-rw-r--r--rfc/rfc1334.txt (renamed from doc/rfc1334.txt)0
-rw-r--r--rfc/rfc1548.txt (renamed from doc/rfc1548.txt)0
-rw-r--r--rfc/rfc1570.txt (renamed from doc/rfc1570.txt)0
-rw-r--r--rfc/rfc1661.txt2976
-rw-r--r--rfc/rfc1662.txt1436
-rw-r--r--rfc/rfc1701.txt451
-rw-r--r--rfc/rfc1702.txt227
-rw-r--r--rfc/rfc1877.txt (renamed from doc/rfc1877.txt)0
-rw-r--r--rfc/rfc1962.txt (renamed from doc/rfc1962.txt)0
-rw-r--r--rfc/rfc1979.txt (renamed from doc/rfc1979.txt)0
-rw-r--r--rfc/rfc1990.txt1347
-rw-r--r--rfc/rfc1994.txt (renamed from doc/rfc1994.txt)0
-rw-r--r--rfc/rfc2138.txt3643
-rw-r--r--rfc/rfc2139.txt1403
-rw-r--r--rfc/rfc2284.txt (renamed from doc/rfc2284.txt)0
-rw-r--r--rfc/rfc2433.txt (renamed from doc/rfc2433.txt)0
-rw-r--r--rfc/rfc2548.txt2299
-rw-r--r--rfc/rfc2637.txt (renamed from doc/rfc2637.txt)0
-rw-r--r--rfc/rfc2716.txt (renamed from doc/rfc2716.txt)0
-rw-r--r--rfc/rfc2759.txt (renamed from doc/rfc2759.txt)0
-rw-r--r--rfc/rfc2865.txt4259
-rw-r--r--rfc/rfc2866.txt1571
-rw-r--r--rfc/rfc2869.txt2635
-rw-r--r--rfc/rfc3078.txt (renamed from doc/rfc3078.txt)0
-rw-r--r--rfc/rfc3079.txt1179
-rw-r--r--rfc/rfc3544.txt (renamed from doc/rfc3544.txt)0
-rw-r--r--rfc/rfc3576.txt1683
-rw-r--r--rfc/rfc3580.txt1683
-rw-r--r--rfc/rfc791.txt2887
-rw-r--r--rfc/rfc793.txt5247
355 files changed, 56825 insertions, 74281 deletions
diff --git a/.gitignore b/.gitignore
index 9ec4d67..89efb0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,22 +1,2 @@
-*.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
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..b785ec1
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,8 @@
+PROJECT (accel-pptpd)
+cmake_minimum_required(VERSION 2.6)
+
+ADD_SUBDIRECTORY(accel-pptpd)
+
+if (BUILD_DRIVER)
+ ADD_SUBDIRECTORY(driver)
+endif (BUILD_DRIVER)
diff --git a/Changelog b/Changelog
deleted file mode 100644
index 016529c..0000000
--- a/Changelog
+++ /dev/null
@@ -1,45 +0,0 @@
-------------------------------------------------------------------------
-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
-------------------------------------------------------------------------
diff --git a/README b/README
index ccc2628..91cc8be 100644
--- a/README
+++ b/README
@@ -1,49 +1,45 @@
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
diff --git a/accel-pptpd/CMakeLists.txt b/accel-pptpd/CMakeLists.txt
new file mode 100644
index 0000000..dd1b257
--- /dev/null
+++ b/accel-pptpd/CMakeLists.txt
@@ -0,0 +1,56 @@
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fvisibility=hidden -D_GNU_SOURCE -DGCC_SPINLOCK -DMEMDEBUG")
+
+INCLUDE_DIRECTORIES(include)
+
+ADD_SUBDIRECTORY(triton)
+ADD_SUBDIRECTORY(ctrl)
+ADD_SUBDIRECTORY(auth)
+ADD_SUBDIRECTORY(radius)
+ADD_SUBDIRECTORY(logs)
+ADD_SUBDIRECTORY(extra)
+
+ADD_EXECUTABLE(accel-pptpd
+ ppp/ppp.c
+ ppp/ppp_fsm.c
+ ppp/ppp_lcp.c
+ ppp/lcp_opt_mru.c
+ ppp/lcp_opt_magic.c
+ ppp/lcp_opt_pcomp.c
+ ppp/lcp_opt_accomp.c
+ ppp/ppp_auth.c
+ ppp/ppp_ipcp.c
+ ppp/ipcp_opt_ipaddr.c
+ ppp/ipcp_opt_dns.c
+ ppp/ppp_ccp.c
+ ppp/ccp_mppe.c
+
+ pwdb.c
+ ipdb.c
+
+ iprange.c
+
+ utils.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)
+
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p /var/log/accel-pptp)")
+
diff --git a/accel-pptpd/accel-pptp.conf b/accel-pptpd/accel-pptp.conf
new file mode 100644
index 0000000..62c0f89
--- /dev/null
+++ b/accel-pptpd/accel-pptp.conf
@@ -0,0 +1,77 @@
+[modules]
+#path=/usr/local/lib/accel-pptp
+log_file
+#log_pgsql
+pptp
+auth_pap
+auth_chap_md5
+auth_mschap_v1
+auth_mschap_v2
+radius
+ippool
+sigchld
+pppd_compat
+
+[core]
+log-error=/var/log/accel-pptp/core.log
+thread-count=4
+
+[ppp]
+verbose=1
+min-mtu=1000
+mtu=1200
+mru=1200
+
+[lcp]
+echo-interval=30
+echo-failure=3
+
+[pptp]
+echo-interval=30
+verbose=1
+
+[dns]
+#dns1=172.16.0.1
+#dns2=172.16.1.1
+
+[radius]
+#dictionary=/usr/local/share/accel-pptp/dictionary
+nas-identifier=accel-pptp
+nas-ip-address=127.0.0.1
+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]
+10.0.0.0/8
+
+[ip-pool]
+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=/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=1
+level=3
+
+[log-pgsql]
+conninfo=user=log
+log-table=log
+
+[pppd-compat]
+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
diff --git a/accel-pptpd/accel-pptp.conf.5 b/accel-pptpd/accel-pptp.conf.5
new file mode 100644
index 0000000..a983c7c
--- /dev/null
+++ b/accel-pptpd/accel-pptp.conf.5
@@ -0,0 +1,272 @@
+.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.
diff --git a/accel-pptpd/auth/CMakeLists.txt b/accel-pptpd/auth/CMakeLists.txt
new file mode 100644
index 0000000..69b18b7
--- /dev/null
+++ b/accel-pptpd/auth/CMakeLists.txt
@@ -0,0 +1,9 @@
+ADD_LIBRARY(auth_pap SHARED auth_pap.c)
+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
+)
+
diff --git a/accel-pptpd/auth/auth_chap_md5.c b/accel-pptpd/auth/auth_chap_md5.c
new file mode 100644
index 0000000..4031a9a
--- /dev/null
+++ b/accel-pptpd/auth/auth_chap_md5.c
@@ -0,0 +1,398 @@
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <arpa/inet.h>
+
+#include <openssl/md5.h>
+
+#include "log.h"
+#include "ppp.h"
+#include "ppp_auth.h"
+#include "ppp_lcp.h"
+#include "pwdb.h"
+
+#include "memdebug.h"
+
+#define CHAP_CHALLENGE 1
+#define CHAP_RESPONSE 2
+#define CHAP_SUCCESS 3
+#define CHAP_FAILURE 4
+
+#define CHAP_MD5 5
+
+#define VALUE_SIZE 16
+
+#define MSG_FAILURE "Authentication failed"
+#define MSG_SUCCESS "Authentication successed"
+
+#define HDR_LEN (sizeof(struct chap_hdr_t)-2)
+
+static int conf_timeout = 5;
+static int conf_interval = 0;
+static int conf_max_failure = 3;
+
+static int urandom_fd;
+
+struct chap_hdr_t
+{
+ uint16_t proto;
+ uint8_t code;
+ uint8_t id;
+ uint16_t len;
+} __attribute__((packed));
+
+struct chap_challenge_t
+{
+ struct chap_hdr_t hdr;
+ uint8_t val_size;
+ uint8_t val[VALUE_SIZE];
+ char name[0];
+} __attribute__((packed));
+
+struct chap_failure_t
+{
+ struct chap_hdr_t hdr;
+ char message[sizeof(MSG_FAILURE)];
+} __attribute__((packed));
+
+struct chap_success_t
+{
+ struct chap_hdr_t hdr;
+ char message[sizeof(MSG_SUCCESS)];
+} __attribute__((packed));
+
+
+struct chap_auth_data_t
+{
+ struct auth_data_t auth;
+ struct ppp_handler_t h;
+ struct ppp_t *ppp;
+ int id;
+ uint8_t val[VALUE_SIZE];
+ struct triton_timer_t timeout;
+ struct triton_timer_t interval;
+ int failure;
+ int started:1;
+};
+
+static void chap_send_challenge(struct chap_auth_data_t *ad);
+static void chap_recv(struct ppp_handler_t *h);
+static void chap_timeout(struct triton_timer_t *t);
+static void chap_restart(struct triton_timer_t *t);
+
+static void print_buf(const uint8_t *buf, int size)
+{
+ int i;
+ for (i=0; i < size; i++)
+ log_ppp_info("%x", buf[i]);
+}
+static void print_str(const char *buf, int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ log_ppp_info("%c", buf[i]);
+}
+
+static struct auth_data_t* auth_data_init(struct ppp_t *ppp)
+{
+ struct chap_auth_data_t *d = _malloc(sizeof(*d));
+
+ memset(d, 0, sizeof(*d));
+ d->auth.proto = PPP_CHAP;
+ d->ppp = ppp;
+
+ return &d->auth;
+}
+
+static void auth_data_free(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct chap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ _free(d);
+}
+
+static int chap_start(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct chap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ d->h.proto = PPP_CHAP;
+ d->h.recv = chap_recv;
+ d->timeout.expire = chap_timeout;
+ d->timeout.period = conf_timeout * 1000;
+ d->interval.expire = chap_restart;
+ d->interval.period = conf_interval * 1000;
+
+ ppp_register_chan_handler(ppp, &d->h);
+
+ chap_send_challenge(d);
+
+ return 0;
+}
+
+static int chap_finish(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct chap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ if (d->timeout.tpd)
+ triton_timer_del(&d->timeout);
+
+ if (d->interval.tpd)
+ triton_timer_del(&d->interval);
+
+ ppp_unregister_handler(ppp, &d->h);
+
+ return 0;
+}
+
+static void chap_timeout(struct triton_timer_t *t)
+{
+ struct chap_auth_data_t *d = container_of(t, typeof(*d), timeout);
+
+ if (conf_ppp_verbose)
+ log_ppp_warn("chap-md5: timeout\n");
+
+ if (++d->failure == conf_max_failure) {
+ if (d->started)
+ ppp_terminate(d->ppp, 0);
+ else
+ auth_failed(d->ppp);
+ } else {
+ --d->id;
+ chap_send_challenge(d);
+ }
+}
+
+static void chap_restart(struct triton_timer_t *t)
+{
+ struct chap_auth_data_t *d = container_of(t, typeof(*d), interval);
+
+ chap_send_challenge(d);
+}
+
+static int lcp_send_conf_req(struct ppp_t *ppp, struct auth_data_t *d, uint8_t *ptr)
+{
+ *ptr = CHAP_MD5;
+ return 1;
+}
+
+static int lcp_recv_conf_req(struct ppp_t *ppp, struct auth_data_t *d, uint8_t *ptr)
+{
+ if (*ptr == CHAP_MD5)
+ return LCP_OPT_ACK;
+ return LCP_OPT_NAK;
+}
+
+static void chap_send_failure(struct chap_auth_data_t *ad)
+{
+ struct chap_failure_t msg = {
+ .hdr.proto = htons(PPP_CHAP),
+ .hdr.code = CHAP_FAILURE,
+ .hdr.id = ad->id,
+ .hdr.len = htons(sizeof(msg) - 1 - 2),
+ .message = MSG_FAILURE,
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [CHAP Failure id=%x \"%s\"]\n", msg.hdr.id, MSG_FAILURE);
+
+ ppp_chan_send(ad->ppp, &msg, ntohs(msg.hdr.len) + 2);
+}
+
+static void chap_send_success(struct chap_auth_data_t *ad)
+{
+ struct chap_success_t msg = {
+ .hdr.proto = htons(PPP_CHAP),
+ .hdr.code = CHAP_SUCCESS,
+ .hdr.id = ad->id,
+ .hdr.len = htons(sizeof(msg)-1-2),
+ .message = MSG_SUCCESS,
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [CHAP Success id=%x \"%s\"]\n", msg.hdr.id, MSG_SUCCESS);
+
+ ppp_chan_send(ad->ppp, &msg, ntohs(msg.hdr.len) + 2);
+}
+
+static void chap_send_challenge(struct chap_auth_data_t *ad)
+{
+ struct chap_challenge_t msg = {
+ .hdr.proto = htons(PPP_CHAP),
+ .hdr.code = CHAP_CHALLENGE,
+ .hdr.id = ++ad->id,
+ .hdr.len = htons(sizeof(msg) - 2),
+ .val_size = VALUE_SIZE,
+ };
+
+ read(urandom_fd, ad->val, VALUE_SIZE);
+ memcpy(msg.val, ad->val, VALUE_SIZE);
+
+ if (conf_ppp_verbose) {
+ log_ppp_info("send [CHAP Challenge id=%x <", msg.hdr.id);
+ print_buf(msg.val, VALUE_SIZE);
+ log_ppp_info(">]\n");
+ }
+
+ ppp_chan_send(ad->ppp, &msg, ntohs(msg.hdr.len) + 2);
+
+ if (conf_timeout && !ad->timeout.tpd)
+ triton_timer_add(ad->ppp->ctrl->ctx, &ad->timeout, 0);
+}
+
+static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *hdr)
+{
+ MD5_CTX md5_ctx;
+ uint8_t md5[MD5_DIGEST_LENGTH];
+ char *passwd;
+ char *name;
+ int r;
+ struct chap_challenge_t *msg = (struct chap_challenge_t*)hdr;
+
+ if (ad->timeout.tpd)
+ triton_timer_del(&ad->timeout);
+
+ if (conf_ppp_verbose) {
+ log_ppp_info("recv [CHAP Response id=%x <", msg->hdr.id);
+ print_buf(msg->val, msg->val_size);
+ log_ppp_info(">, name=\"");
+ print_str(msg->name, ntohs(msg->hdr.len) - sizeof(*msg) + 2);
+ log_ppp_info("\"]\n");
+ }
+
+ if (msg->hdr.id != ad->id) {
+ if (conf_ppp_verbose)
+ log_ppp_error("chap-md5: id mismatch\n");
+ chap_send_failure(ad);
+ ppp_terminate(ad->ppp, 0);
+ }
+
+ if (msg->val_size != VALUE_SIZE) {
+ log_ppp_error("chap-md5: incorrect value-size (%i)\n", msg->val_size);
+ chap_send_failure(ad);
+ ppp_terminate(ad->ppp, 0);
+ }
+
+ name = _strndup(msg->name,ntohs(msg->hdr.len) - sizeof(*msg) + 2);
+
+ r = pwdb_check(ad->ppp, name, PPP_CHAP, CHAP_MD5, ad->id, ad->val, VALUE_SIZE, msg->val);
+
+ if (r == PWDB_NO_IMPL) {
+ passwd = pwdb_get_passwd(ad->ppp,name);
+ if (!passwd)
+ {
+ _free(name);
+ if (conf_ppp_verbose)
+ log_ppp_warn("chap-md5: user not found\n");
+ chap_send_failure(ad);
+ return;
+ }
+
+ MD5_Init(&md5_ctx);
+ MD5_Update(&md5_ctx,&msg->hdr.id,1);
+ MD5_Update(&md5_ctx,passwd,strlen(passwd));
+ MD5_Update(&md5_ctx,ad->val,VALUE_SIZE);
+ MD5_Final(md5,&md5_ctx);
+
+ if (memcmp(md5,msg->val,sizeof(md5)))
+ {
+ if (conf_ppp_verbose)
+ log_ppp_warn("chap-md5: challenge response mismatch\n");
+ chap_send_failure(ad);
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ }else
+ {
+ chap_send_success(ad);
+ if (!ad->started) {
+ ad->started = 1;
+ if (conf_interval)
+ triton_timer_add(ad->ppp->ctrl->ctx, &ad->interval, 0);
+ auth_successed(ad->ppp, name);
+ }
+ }
+ _free(name);
+ _free(passwd);
+ } else if (r == PWDB_DENIED) {
+ chap_send_failure(ad);
+ _free(name);
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ } else {
+ chap_send_success(ad);
+ if (!ad->started) {
+ ad->started = 1;
+ if (conf_interval)
+ triton_timer_add(ad->ppp->ctrl->ctx, &ad->interval, 0);
+ auth_successed(ad->ppp, name);
+ }
+ }
+}
+
+static int chap_check(uint8_t *ptr)
+{
+ return *ptr == CHAP_MD5;
+}
+
+static struct ppp_auth_handler_t chap=
+{
+ .name = "CHAP-md5",
+ .init = auth_data_init,
+ .free = auth_data_free,
+ .send_conf_req = lcp_send_conf_req,
+ .recv_conf_req = lcp_recv_conf_req,
+ .start = chap_start,
+ .finish = chap_finish,
+ .check = chap_check,
+};
+
+static void chap_recv(struct ppp_handler_t *h)
+{
+ struct chap_auth_data_t *d = container_of(h, typeof(*d), h);
+ struct chap_hdr_t *hdr = (struct chap_hdr_t *)d->ppp->chan_buf;
+
+ if (d->ppp->chan_buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) < d->ppp->chan_buf_size - 2) {
+ log_ppp_warn("chap-md5: short packet received\n");
+ return;
+ }
+
+ if (hdr->code == CHAP_RESPONSE)
+ chap_recv_response(d, hdr);
+ else
+ log_ppp_warn("chap-md5: unknown code received %x\n", hdr->code);
+}
+
+static void __init auth_chap_md5_init()
+{
+ char *opt;
+
+ opt = conf_get_opt("auth", "timeout");
+ if (opt && atoi(opt) > 0)
+ conf_timeout = atoi(opt);
+
+ opt = conf_get_opt("auth", "interval");
+ if (opt && atoi(opt) > 0)
+ conf_interval = atoi(opt);
+
+ opt = conf_get_opt("auth", "max-failure");
+ if (opt && atoi(opt) > 0)
+ conf_max_failure = atoi(opt);
+
+ urandom_fd=open("/dev/urandom", O_RDONLY);
+
+ if (urandom_fd < 0) {
+ log_emerg("chap-md5: failed to open /dev/urandom: %s\n", strerror(errno));
+ return;
+ }
+
+ if (ppp_auth_register_handler(&chap))
+ log_emerg("chap-md5: failed to register handler\n");
+}
+
diff --git a/accel-pptpd/auth/auth_mschap_v1.c b/accel-pptpd/auth/auth_mschap_v1.c
new file mode 100644
index 0000000..5b4935e
--- /dev/null
+++ b/accel-pptpd/auth/auth_mschap_v1.c
@@ -0,0 +1,453 @@
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <byteswap.h>
+#include <arpa/inet.h>
+
+#include <openssl/md4.h>
+#include <openssl/des.h>
+
+#include "log.h"
+#include "ppp.h"
+#include "ppp_auth.h"
+#include "ppp_lcp.h"
+#include "pwdb.h"
+
+#include "memdebug.h"
+
+#define MSCHAP_V1 0x80
+
+#define CHAP_CHALLENGE 1
+#define CHAP_RESPONSE 2
+#define CHAP_SUCCESS 3
+#define CHAP_FAILURE 4
+
+#define VALUE_SIZE 8
+#define RESPONSE_VALUE_SIZE (24+24+1)
+
+#define MSG_FAILURE "E=691 R=0"
+#define MSG_SUCCESS "Authentication successed"
+
+#define HDR_LEN (sizeof(struct chap_hdr_t)-2)
+
+static int conf_timeout = 5;
+static int conf_interval = 0;
+static int conf_max_failure = 3;
+
+static int urandom_fd;
+
+struct chap_hdr_t
+{
+ uint16_t proto;
+ uint8_t code;
+ uint8_t id;
+ uint16_t len;
+} __attribute__((packed));
+
+struct chap_challenge_t
+{
+ struct chap_hdr_t hdr;
+ uint8_t val_size;
+ uint8_t val[VALUE_SIZE];
+ char name[0];
+} __attribute__((packed));
+
+struct chap_response_t
+{
+ struct chap_hdr_t hdr;
+ uint8_t val_size;
+ uint8_t lm_hash[24];
+ uint8_t nt_hash[24];
+ uint8_t flags;
+ char name[0];
+} __attribute__((packed));
+
+struct chap_failure_t
+{
+ struct chap_hdr_t hdr;
+ char message[sizeof(MSG_FAILURE)];
+} __attribute__((packed));
+
+struct chap_success_t
+{
+ struct chap_hdr_t hdr;
+ char message[sizeof(MSG_SUCCESS)];
+} __attribute__((packed));
+
+
+struct chap_auth_data_t
+{
+ struct auth_data_t auth;
+ struct ppp_handler_t h;
+ struct ppp_t *ppp;
+ int id;
+ uint8_t val[VALUE_SIZE];
+ struct triton_timer_t timeout;
+ struct triton_timer_t interval;
+ int failure;
+ int started:1;
+};
+
+static void chap_send_challenge(struct chap_auth_data_t *ad);
+static void chap_recv(struct ppp_handler_t *h);
+static int chap_check_response(struct chap_auth_data_t *ad, struct chap_response_t *res, const char *name);
+static void chap_timeout(struct triton_timer_t *t);
+static void chap_restart(struct triton_timer_t *t);
+
+static void print_buf(const uint8_t *buf,int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ log_ppp_info("%x", buf[i]);
+}
+static void print_str(const char *buf, int size)
+{
+ int i;
+ for(i = 0; i < size; i++)
+ log_ppp_info("%c", buf[i]);
+}
+
+static struct auth_data_t* auth_data_init(struct ppp_t *ppp)
+{
+ struct chap_auth_data_t *d = _malloc(sizeof(*d));
+
+ memset(d, 0, sizeof(*d));
+ d->auth.proto = PPP_CHAP;
+ d->ppp = ppp;
+
+ return &d->auth;
+}
+
+static void auth_data_free(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct chap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ _free(d);
+}
+
+static int chap_start(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct chap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ d->h.proto = PPP_CHAP;
+ d->h.recv = chap_recv;
+ d->timeout.expire = chap_timeout;
+ d->timeout.period = conf_timeout * 1000;
+ d->interval.expire = chap_restart;
+ d->interval.period = conf_interval * 1000;
+
+ ppp_register_chan_handler(ppp, &d->h);
+
+ chap_send_challenge(d);
+
+ return 0;
+}
+
+static int chap_finish(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct chap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ if (d->timeout.tpd)
+ triton_timer_del(&d->timeout);
+
+ if (d->interval.tpd)
+ triton_timer_del(&d->interval);
+
+ ppp_unregister_handler(ppp, &d->h);
+
+ return 0;
+}
+
+static void chap_timeout(struct triton_timer_t *t)
+{
+ struct chap_auth_data_t *d = container_of(t, typeof(*d), timeout);
+
+ if (conf_ppp_verbose)
+ log_ppp_warn("mschap-v1: timeout\n");
+
+ if (++d->failure == conf_max_failure) {
+ if (d->started)
+ ppp_terminate(d->ppp, 0);
+ else
+ auth_failed(d->ppp);
+ } else {
+ --d->id;
+ chap_send_challenge(d);
+ }
+}
+
+static void chap_restart(struct triton_timer_t *t)
+{
+ struct chap_auth_data_t *d = container_of(t, typeof(*d), interval);
+
+ chap_send_challenge(d);
+}
+
+static int lcp_send_conf_req(struct ppp_t *ppp, struct auth_data_t *d, uint8_t *ptr)
+{
+ *ptr = MSCHAP_V1;
+ return 1;
+}
+
+static int lcp_recv_conf_req(struct ppp_t *ppp, struct auth_data_t *d, uint8_t *ptr)
+{
+ if (*ptr == MSCHAP_V1)
+ return LCP_OPT_ACK;
+ return LCP_OPT_NAK;
+}
+
+static void chap_send_failure(struct chap_auth_data_t *ad)
+{
+ struct chap_failure_t msg = {
+ .hdr.proto = htons(PPP_CHAP),
+ .hdr.code = CHAP_FAILURE,
+ .hdr.id = ad->id,
+ .hdr.len = htons(sizeof(msg)-1-2),
+ .message = MSG_FAILURE,
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [MSCHAP-v1 Failure id=%x \"%s\"]\n", msg.hdr.id, MSG_FAILURE);
+
+ ppp_chan_send(ad->ppp,&msg,ntohs(msg.hdr.len)+2);
+}
+
+static void chap_send_success(struct chap_auth_data_t *ad)
+{
+ struct chap_success_t msg = {
+ .hdr.proto = htons(PPP_CHAP),
+ .hdr.code = CHAP_SUCCESS,
+ .hdr.id = ad->id,
+ .hdr.len = htons(sizeof(msg)-1-2),
+ .message = MSG_SUCCESS,
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [MSCHAP-v1 Success id=%x \"%s\"]\n", msg.hdr.id, MSG_SUCCESS);
+
+ ppp_chan_send(ad->ppp, &msg, ntohs(msg.hdr.len) + 2);
+}
+
+static void chap_send_challenge(struct chap_auth_data_t *ad)
+{
+ struct chap_challenge_t msg = {
+ .hdr.proto = htons(PPP_CHAP),
+ .hdr.code = CHAP_CHALLENGE,
+ .hdr.id = ++ad->id,
+ .hdr.len = htons(sizeof(msg) - 2),
+ .val_size = VALUE_SIZE,
+ };
+
+ read(urandom_fd, ad->val, VALUE_SIZE);
+ memcpy(msg.val, ad->val, VALUE_SIZE);
+
+ if (conf_ppp_verbose) {
+ log_ppp_info("send [MSCHAP-v1 Challenge id=%x <", msg.hdr.id);
+ print_buf(msg.val, VALUE_SIZE);
+ log_ppp_info(">]\n");
+ }
+
+ ppp_chan_send(ad->ppp, &msg, ntohs(msg.hdr.len) + 2);
+
+ if (conf_timeout && !ad->timeout.tpd)
+ triton_timer_add(ad->ppp->ctrl->ctx, &ad->timeout, 0);
+}
+
+static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *hdr)
+{
+ struct chap_response_t *msg = (struct chap_response_t*)hdr;
+ char *name;
+ int r;
+
+ if (ad->timeout.tpd)
+ triton_timer_del(&ad->timeout);
+
+ if (conf_ppp_verbose) {
+ log_ppp_info("recv [MSCHAP-v1 Response id=%x <", msg->hdr.id);
+ print_buf(msg->lm_hash, 24);
+ log_ppp_info(">, <");
+ print_buf(msg->nt_hash, 24);
+ log_ppp_info(">, F=%i, name=\"", msg->flags);
+ print_str(msg->name, ntohs(msg->hdr.len) - sizeof(*msg) + 2);
+ log_ppp_info("\"]\n");
+ }
+
+ if (msg->hdr.id != ad->id) {
+ if (conf_ppp_verbose)
+ log_ppp_error("mschap-v1: id mismatch\n");
+ chap_send_failure(ad);
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ }
+
+ if (msg->val_size != RESPONSE_VALUE_SIZE) {
+ log_ppp_error("mschap-v1: incorrect value-size (%i)\n", msg->val_size);
+ chap_send_failure(ad);
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ }
+
+ name = _strndup(msg->name, ntohs(msg->hdr.len) - sizeof(*msg) + 2);
+ if (!name) {
+ log_emerg("mschap-v1: out of memory\n");
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ return;
+ }
+
+ r = pwdb_check(ad->ppp, name, PPP_CHAP, MSCHAP_V1, ad->id, ad->val, VALUE_SIZE, msg->lm_hash, msg->nt_hash, msg->flags);
+ if (r == PWDB_NO_IMPL)
+ r = chap_check_response(ad, msg, name);
+
+ if (r == PWDB_DENIED) {
+ chap_send_failure(ad);
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ _free(name);
+ } else {
+ chap_send_success(ad);
+ if (!ad->started) {
+ ad->started = 1;
+ if (conf_interval)
+ triton_timer_add(ad->ppp->ctrl->ctx, &ad->interval, 0);
+ auth_successed(ad->ppp, name);
+ }
+ }
+}
+
+static void des_encrypt(const uint8_t *input, const uint8_t *key, uint8_t *output)
+{
+ int i, j, parity;
+ union
+ {
+ uint64_t u64;
+ uint8_t buf[8];
+ } p_key;
+ DES_cblock cb;
+ DES_cblock res;
+ DES_key_schedule ks;
+
+ memcpy(p_key.buf, key, 7);
+ p_key.u64 = bswap_64(p_key.u64);
+
+ for (i = 0; i < 8; i++) {
+ cb[i] = (((p_key.u64 << (7 * i)) >> 56) & 0xfe);
+ for( j = 0, parity = 0; j < 7; j++)
+ if ((cb[i] >> (j + 1)) & 1)
+ parity++;
+ cb[i] |= (~parity) & 1;
+ }
+
+ DES_set_key_checked(&cb, &ks);
+ memcpy(cb, input, 8);
+ DES_ecb_encrypt(&cb, &res, &ks, DES_ENCRYPT);
+ memcpy(output, res, 8);
+}
+
+static int chap_check_response(struct chap_auth_data_t *ad, struct chap_response_t *msg, const char *name)
+{
+ MD4_CTX md4_ctx;
+ uint8_t z_hash[21];
+ uint8_t nt_hash[24];
+ char *passwd;
+ char *u_passwd;
+ int i;
+
+ passwd = pwdb_get_passwd(ad->ppp,name);
+ if (!passwd) {
+ if (conf_ppp_verbose)
+ log_ppp_warn("mschap-v1: user not found\n");
+ chap_send_failure(ad);
+ return PWDB_DENIED;
+ }
+
+ u_passwd = _malloc(strlen(passwd) * 2);
+ for (i = 0; i< strlen(passwd); i++) {
+ u_passwd[i * 2] = passwd[i];
+ u_passwd[i * 2 + 1] = 0;
+ }
+
+ memset(z_hash, 0, sizeof(z_hash));
+ MD4_Init(&md4_ctx);
+ MD4_Update(&md4_ctx, u_passwd, strlen(passwd) * 2);
+ MD4_Final(z_hash, &md4_ctx);
+
+ des_encrypt(ad->val, z_hash, nt_hash);
+ des_encrypt(ad->val, z_hash + 7, nt_hash + 8);
+ des_encrypt(ad->val, z_hash + 14, nt_hash + 16);
+
+ _free(passwd);
+ _free(u_passwd);
+
+ return memcmp(nt_hash, msg->nt_hash, 24) ? PWDB_DENIED : PWDB_SUCCESS;
+}
+
+static int chap_check(uint8_t *ptr)
+{
+ return *ptr == MSCHAP_V1;
+}
+
+static struct ppp_auth_handler_t chap = {
+ .name = "MSCHAP-v1",
+ .init = auth_data_init,
+ .free = auth_data_free,
+ .send_conf_req = lcp_send_conf_req,
+ .recv_conf_req = lcp_recv_conf_req,
+ .start = chap_start,
+ .finish = chap_finish,
+ .check = chap_check,
+};
+
+static void chap_recv(struct ppp_handler_t *h)
+{
+ struct chap_auth_data_t *d = container_of(h, typeof(*d), h);
+ struct chap_hdr_t *hdr = (struct chap_hdr_t *)d->ppp->chan_buf;
+
+ if (d->ppp->chan_buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) < d->ppp->chan_buf_size - 2) {
+ log_ppp_warn("mschap-v1: short packet received\n");
+ return;
+ }
+
+ if (hdr->code == CHAP_RESPONSE)
+ chap_recv_response(d, hdr);
+ else
+ log_ppp_warn("mschap-v1: unknown code received %x\n", hdr->code);
+}
+
+static void __init auth_mschap_v1_init()
+{
+ char *opt;
+
+ opt = conf_get_opt("auth", "timeout");
+ if (opt && atoi(opt) > 0)
+ conf_timeout = atoi(opt);
+
+ opt = conf_get_opt("auth", "interval");
+ if (opt && atoi(opt) > 0)
+ conf_interval = atoi(opt);
+
+ opt = conf_get_opt("auth", "max-failure");
+ if (opt && atoi(opt) > 0)
+ conf_max_failure = atoi(opt);
+
+ urandom_fd = open("/dev/urandom", O_RDONLY);
+ if (urandom_fd < 0) {
+ log_emerg("mschap-v1: failed to open /dev/urandom: %s\n", strerror(errno));
+ return;
+ }
+ if (ppp_auth_register_handler(&chap))
+ log_emerg("mschap-v1: failed to register handler\n");
+}
+
diff --git a/accel-pptpd/auth/auth_mschap_v2.c b/accel-pptpd/auth/auth_mschap_v2.c
new file mode 100644
index 0000000..a93fad6
--- /dev/null
+++ b/accel-pptpd/auth/auth_mschap_v2.c
@@ -0,0 +1,529 @@
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <byteswap.h>
+#include <arpa/inet.h>
+
+#include <openssl/md4.h>
+#include <openssl/des.h>
+#include <openssl/sha.h>
+
+#include "log.h"
+#include "ppp.h"
+#include "ppp_auth.h"
+#include "ppp_lcp.h"
+#include "pwdb.h"
+
+#include "memdebug.h"
+
+#define MSCHAP_V2 0x81
+
+#define CHAP_CHALLENGE 1
+#define CHAP_RESPONSE 2
+#define CHAP_SUCCESS 3
+#define CHAP_FAILURE 4
+
+#define VALUE_SIZE 16
+#define RESPONSE_VALUE_SIZE (16+8+24+1)
+
+#define MSG_FAILURE "E=691 R=0 C=cccccccccccccccccccccccccccccccc V=3 M=Authentication failure"
+#define MSG_SUCCESS "S=cccccccccccccccccccccccccccccccccccccccc M=Authentication successed"
+
+#define HDR_LEN (sizeof(struct chap_hdr_t)-2)
+
+static int conf_timeout = 5;
+static int conf_interval = 0;
+static int conf_max_failure = 3;
+
+static int urandom_fd;
+
+static uint8_t magic1[39] =
+ {0x4D, 0x61, 0x67, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76,
+ 0x65, 0x72, 0x20, 0x74, 0x6F, 0x20, 0x63, 0x6C, 0x69, 0x65,
+ 0x6E, 0x74, 0x20, 0x73, 0x69, 0x67, 0x6E, 0x69, 0x6E, 0x67,
+ 0x20, 0x63, 0x6F, 0x6E, 0x73, 0x74, 0x61, 0x6E, 0x74};
+static uint8_t magic2[41] =
+ {0x50, 0x61, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x6D, 0x61, 0x6B,
+ 0x65, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6F, 0x20, 0x6D, 0x6F,
+ 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6E, 0x20, 0x6F, 0x6E,
+ 0x65, 0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6F,
+ 0x6E};
+
+struct chap_hdr_t
+{
+ uint16_t proto;
+ uint8_t code;
+ uint8_t id;
+ uint16_t len;
+} __attribute__((packed));
+
+struct chap_challenge_t
+{
+ struct chap_hdr_t hdr;
+ uint8_t val_size;
+ uint8_t val[VALUE_SIZE];
+ char name[0];
+} __attribute__((packed));
+
+struct chap_response_t
+{
+ struct chap_hdr_t hdr;
+ uint8_t val_size;
+ uint8_t peer_challenge[16];
+ uint8_t reserved[8];
+ uint8_t nt_hash[24];
+ uint8_t flags;
+ char name[0];
+} __attribute__((packed));
+
+struct chap_failure_t
+{
+ struct chap_hdr_t hdr;
+ char message[sizeof(MSG_FAILURE)];
+} __attribute__((packed));
+
+struct chap_success_t
+{
+ struct chap_hdr_t hdr;
+ char message[sizeof(MSG_SUCCESS)];
+} __attribute__((packed));
+
+
+struct chap_auth_data_t
+{
+ struct auth_data_t auth;
+ struct ppp_handler_t h;
+ struct ppp_t *ppp;
+ int id;
+ uint8_t val[VALUE_SIZE];
+ struct triton_timer_t timeout;
+ struct triton_timer_t interval;
+ int failure;
+ int started:1;
+};
+
+static void chap_send_challenge(struct chap_auth_data_t *ad);
+static void chap_recv(struct ppp_handler_t *h);
+static int chap_check_response(struct chap_auth_data_t *ad, struct chap_response_t *msg, const char *name);
+static void chap_timeout(struct triton_timer_t *t);
+static void chap_restart(struct triton_timer_t *t);
+
+static void print_buf(const uint8_t *buf, int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ log_ppp_info("%x", buf[i]);
+}
+
+static void print_str(const char *buf, int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ log_ppp_info("%c", buf[i]);
+}
+
+static struct auth_data_t* auth_data_init(struct ppp_t *ppp)
+{
+ struct chap_auth_data_t *d = _malloc(sizeof(*d));
+
+ memset(d, 0, sizeof(*d));
+ d->auth.proto = PPP_CHAP;
+ d->ppp = ppp;
+
+ return &d->auth;
+}
+
+static void auth_data_free(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct chap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ _free(d);
+}
+
+static int chap_start(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct chap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ d->h.proto = PPP_CHAP;
+ d->h.recv = chap_recv;
+ d->timeout.expire = chap_timeout;
+ d->timeout.period = conf_timeout * 1000;
+ d->interval.expire = chap_restart;
+ d->interval.period = conf_interval * 1000;
+
+ ppp_register_chan_handler(ppp, &d->h);
+
+ chap_send_challenge(d);
+
+ return 0;
+}
+
+static int chap_finish(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct chap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ if (d->timeout.tpd)
+ triton_timer_del(&d->timeout);
+
+ if (d->interval.tpd)
+ triton_timer_del(&d->interval);
+
+ ppp_unregister_handler(ppp,&d->h);
+
+ return 0;
+}
+
+static void chap_timeout(struct triton_timer_t *t)
+{
+ struct chap_auth_data_t *d = container_of(t, typeof(*d), timeout);
+
+ if (conf_ppp_verbose)
+ log_ppp_warn("mschap-v2: timeout\n");
+
+ if (++d->failure == conf_max_failure) {
+ if (d->started)
+ ppp_terminate(d->ppp, 0);
+ else
+ auth_failed(d->ppp);
+ } else {
+ --d->id;
+ chap_send_challenge(d);
+ }
+}
+
+static void chap_restart(struct triton_timer_t *t)
+{
+ struct chap_auth_data_t *d = container_of(t, typeof(*d), interval);
+
+ chap_send_challenge(d);
+}
+
+static int lcp_send_conf_req(struct ppp_t *ppp, struct auth_data_t *d, uint8_t *ptr)
+{
+ *ptr = MSCHAP_V2;
+ return 1;
+}
+
+static int lcp_recv_conf_req(struct ppp_t *ppp, struct auth_data_t *d, uint8_t *ptr)
+{
+ if (*ptr == MSCHAP_V2)
+ return LCP_OPT_ACK;
+ return LCP_OPT_NAK;
+}
+
+static void chap_send_failure(struct chap_auth_data_t *ad)
+{
+ struct chap_failure_t msg = {
+ .hdr.proto = htons(PPP_CHAP),
+ .hdr.code = CHAP_FAILURE,
+ .hdr.id = ad->id,
+ .hdr.len = htons(sizeof(msg) - 1 - 2),
+ .message = MSG_FAILURE,
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [MSCHAP-v2 Failure id=%x \"%s\"]\n", msg.hdr.id, MSG_FAILURE);
+
+ ppp_chan_send(ad->ppp, &msg, ntohs(msg.hdr.len) + 2);
+}
+
+static int generate_response(struct chap_auth_data_t *ad, struct chap_response_t *msg, const char *name, char *authenticator)
+{
+ MD4_CTX md4_ctx;
+ SHA_CTX sha_ctx;
+ char *passwd;
+ char *u_passwd;
+ uint8_t pw_hash[MD4_DIGEST_LENGTH];
+ uint8_t c_hash[SHA_DIGEST_LENGTH];
+ uint8_t response[SHA_DIGEST_LENGTH];
+ int i;
+
+ passwd = pwdb_get_passwd(ad->ppp,name);
+ if (!passwd)
+ return -1;
+
+ u_passwd=_malloc(strlen(passwd)*2);
+ for(i=0; i<strlen(passwd); i++)
+ {
+ u_passwd[i*2]=passwd[i];
+ u_passwd[i*2+1]=0;
+ }
+
+ MD4_Init(&md4_ctx);
+ MD4_Update(&md4_ctx,u_passwd,strlen(passwd)*2);
+ MD4_Final(pw_hash,&md4_ctx);
+
+ MD4_Init(&md4_ctx);
+ MD4_Update(&md4_ctx,pw_hash,16);
+ MD4_Final(pw_hash,&md4_ctx);
+
+ SHA1_Init(&sha_ctx);
+ SHA1_Update(&sha_ctx,pw_hash,16);
+ SHA1_Update(&sha_ctx,msg->nt_hash,24);
+ SHA1_Update(&sha_ctx,magic1,39);
+ SHA1_Final(response,&sha_ctx);
+
+ SHA1_Init(&sha_ctx);
+ SHA1_Update(&sha_ctx,msg->peer_challenge,16);
+ SHA1_Update(&sha_ctx,ad->val,16);
+ SHA1_Update(&sha_ctx,name,strlen(name));
+ SHA1_Final(c_hash,&sha_ctx);
+
+ SHA1_Init(&sha_ctx);
+ SHA1_Update(&sha_ctx,response,20);
+ SHA1_Update(&sha_ctx,c_hash,8);
+ SHA1_Update(&sha_ctx,magic2,41);
+ SHA1_Final(response,&sha_ctx);
+
+ for(i=0; i<20; i++)
+ sprintf(authenticator+i*2,"%02X",response[i]);
+
+ _free(passwd);
+ _free(u_passwd);
+
+ return 0;
+}
+
+static void chap_send_success(struct chap_auth_data_t *ad, struct chap_response_t *res_msg, const char *authenticator)
+{
+ struct chap_success_t msg = {
+ .hdr.proto = htons(PPP_CHAP),
+ .hdr.code = CHAP_SUCCESS,
+ .hdr.id = ad->id,
+ .hdr.len = htons(sizeof(msg) - 1 - 2),
+ .message = MSG_SUCCESS,
+ };
+
+ memcpy(msg.message + 2, authenticator, 40);
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [MSCHAP-v2 Success id=%x \"%s\"]\n", msg.hdr.id, msg.message);
+
+ ppp_chan_send(ad->ppp, &msg, ntohs(msg.hdr.len) + 2);
+}
+
+static void chap_send_challenge(struct chap_auth_data_t *ad)
+{
+ struct chap_challenge_t msg = {
+ .hdr.proto = htons(PPP_CHAP),
+ .hdr.code = CHAP_CHALLENGE,
+ .hdr.id = ++ad->id,
+ .hdr.len = htons(sizeof(msg) - 2),
+ .val_size = VALUE_SIZE,
+ };
+
+ read(urandom_fd, ad->val, VALUE_SIZE);
+ memcpy(msg.val, ad->val, VALUE_SIZE);
+
+ if (conf_ppp_verbose) {
+ log_ppp_info("send [MSCHAP-v2 Challenge id=%x <", msg.hdr.id);
+ print_buf(msg.val, VALUE_SIZE);
+ log_ppp_info(">]\n");
+ }
+
+ ppp_chan_send(ad->ppp, &msg, ntohs(msg.hdr.len) + 2);
+
+ if (conf_timeout && !ad->timeout.tpd)
+ triton_timer_add(ad->ppp->ctrl->ctx, &ad->timeout, 0);
+}
+
+static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *hdr)
+{
+ struct chap_response_t *msg = (struct chap_response_t*)hdr;
+ char *name;
+ char authenticator[40];
+ int r;
+
+ if (ad->timeout.tpd)
+ triton_timer_del(&ad->timeout);
+
+ if (conf_ppp_verbose) {
+ log_ppp_info("recv [MSCHAP-v2 Response id=%x <", msg->hdr.id);
+ print_buf(msg->peer_challenge,16);
+ log_ppp_info(">, <");
+ print_buf(msg->nt_hash, 24);
+ log_ppp_info(">, F=%i, name=\"", msg->flags);
+ print_str(msg->name, ntohs(msg->hdr.len) - sizeof(*msg) + 2);
+ log_ppp_info("\"]\n");
+ }
+
+ if (msg->hdr.id != ad->id) {
+ if (conf_ppp_verbose)
+ log_ppp_error("mschap-v2: id mismatch\n");
+ chap_send_failure(ad);
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ }
+
+ if (msg->val_size != RESPONSE_VALUE_SIZE) {
+ log_ppp_error("mschap-v2: incorrect value-size (%i)\n", msg->val_size);
+ chap_send_failure(ad);
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ }
+
+ name = _strndup(msg->name, ntohs(msg->hdr.len) - sizeof(*msg) + 2);
+ if (!name) {
+ log_emerg("mschap-v2: out of memory\n");
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ return;
+ }
+
+ r = pwdb_check(ad->ppp, name, PPP_CHAP, MSCHAP_V2, ad->id, ad->val, msg->peer_challenge, msg->reserved, msg->nt_hash, msg->flags, authenticator);
+
+ if (r == PWDB_NO_IMPL) {
+ r = chap_check_response(ad, msg, name);
+ if (generate_response(ad, msg, name, authenticator))
+ r = PWDB_DENIED;
+ }
+
+ if (r == PWDB_DENIED) {
+ chap_send_failure(ad);
+ if (ad->started)
+ ppp_terminate(ad->ppp, 0);
+ else
+ auth_failed(ad->ppp);
+ _free(name);
+ } else {
+ chap_send_success(ad, msg, authenticator);
+ if (!ad->started) {
+ ad->started = 1;
+ if (conf_interval)
+ triton_timer_add(ad->ppp->ctrl->ctx, &ad->interval, 0);
+ auth_successed(ad->ppp, name);
+ }
+ }
+}
+
+static void des_encrypt(const uint8_t *input, const uint8_t *key, uint8_t *output)
+{
+ int i,j,parity;
+ union
+ {
+ uint64_t u64;
+ uint8_t buf[8];
+ } p_key;
+ DES_cblock cb;
+ DES_cblock res;
+ DES_key_schedule ks;
+
+ memcpy(p_key.buf,key,7);
+ p_key.u64=bswap_64(p_key.u64);
+
+ for(i=0;i<8;i++)
+ {
+ cb[i]=(((p_key.u64<<(7*i))>>56)&0xfe);
+ for(j=0, parity=0; j<7; j++)
+ if ((cb[i]>>(j+1))&1) parity++;
+ cb[i]|=(~parity)&1;
+ }
+
+ DES_set_key_checked(&cb, &ks);
+ memcpy(cb,input,8);
+ DES_ecb_encrypt(&cb,&res,&ks,DES_ENCRYPT);
+ memcpy(output,res,8);
+}
+
+static int chap_check_response(struct chap_auth_data_t *ad, struct chap_response_t *msg, const char *name)
+{
+ MD4_CTX md4_ctx;
+ SHA_CTX sha_ctx;
+ uint8_t z_hash[21];
+ uint8_t c_hash[SHA_DIGEST_LENGTH];
+ uint8_t nt_hash[24];
+ char *passwd;
+ char *u_passwd;
+ int i;
+
+ passwd = pwdb_get_passwd(ad->ppp, name);
+ if (!passwd) {
+ if (conf_ppp_verbose)
+ log_ppp_warn("mschap-v2: user not found\n");
+ chap_send_failure(ad);
+ return -1;
+ }
+
+ u_passwd=_malloc(strlen(passwd)*2);
+ for(i=0; i<strlen(passwd); i++)
+ {
+ u_passwd[i*2]=passwd[i];
+ u_passwd[i*2+1]=0;
+ }
+
+ SHA1_Init(&sha_ctx);
+ SHA1_Update(&sha_ctx,msg->peer_challenge,16);
+ SHA1_Update(&sha_ctx,ad->val,16);
+ SHA1_Update(&sha_ctx,name,strlen(name));
+ SHA1_Final(c_hash,&sha_ctx);
+
+ memset(z_hash,0,sizeof(z_hash));
+ MD4_Init(&md4_ctx);
+ MD4_Update(&md4_ctx,u_passwd,strlen(passwd)*2);
+ MD4_Final(z_hash,&md4_ctx);
+
+ des_encrypt(c_hash,z_hash,nt_hash);
+ des_encrypt(c_hash,z_hash+7,nt_hash+8);
+ des_encrypt(c_hash,z_hash+14,nt_hash+16);
+
+ _free(passwd);
+ _free(u_passwd);
+
+ return memcmp(nt_hash,msg->nt_hash,24);
+}
+
+static int chap_check(uint8_t *ptr)
+{
+ return *ptr == MSCHAP_V2;
+}
+
+static struct ppp_auth_handler_t chap=
+{
+ .name = "MSCHAP-v2",
+ .init = auth_data_init,
+ .free = auth_data_free,
+ .send_conf_req = lcp_send_conf_req,
+ .recv_conf_req = lcp_recv_conf_req,
+ .start = chap_start,
+ .finish = chap_finish,
+ .check = chap_check,
+};
+
+static void chap_recv(struct ppp_handler_t *h)
+{
+ struct chap_auth_data_t *d = container_of(h, typeof(*d), h);
+ struct chap_hdr_t *hdr = (struct chap_hdr_t *)d->ppp->chan_buf;
+
+ if (d->ppp->chan_buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) < d->ppp->chan_buf_size - 2) {
+ log_ppp_warn("mschap-v2: short packet received\n");
+ return;
+ }
+
+ if (hdr->code == CHAP_RESPONSE)
+ chap_recv_response(d, hdr);
+ else
+ log_ppp_warn("mschap-v2: unknown code received %x\n",hdr->code);
+}
+
+static void __init auth_mschap_v2_init()
+{
+ urandom_fd = open("/dev/urandom", O_RDONLY);
+ if (urandom_fd < 0) {
+ log_emerg("mschap-v2: failed to open /dev/urandom: %s\n", strerror(errno));
+ return;
+ }
+
+ if (ppp_auth_register_handler(&chap))
+ log_emerg("mschap-v2: failed to register handler\n");
+}
+
diff --git a/accel-pptpd/auth/auth_pap.c b/accel-pptpd/auth/auth_pap.c
new file mode 100644
index 0000000..b044f64
--- /dev/null
+++ b/accel-pptpd/auth/auth_pap.c
@@ -0,0 +1,259 @@
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+#include "log.h"
+#include "ppp.h"
+#include "ppp_auth.h"
+#include "ppp_lcp.h"
+#include "pwdb.h"
+
+#include "memdebug.h"
+
+#define MSG_FAILED "Authentication failed"
+#define MSG_SUCCESSED "Authentication successed"
+
+#define HDR_LEN (sizeof(struct pap_hdr_t)-2)
+
+#define PAP_REQ 1
+#define PAP_ACK 2
+#define PAP_NAK 3
+
+static int conf_timeout = 5;
+
+static struct auth_data_t* auth_data_init(struct ppp_t *ppp);
+static void auth_data_free(struct ppp_t*, struct auth_data_t*);
+static int lcp_send_conf_req(struct ppp_t*, struct auth_data_t*, uint8_t*);
+static int lcp_recv_conf_req(struct ppp_t*, struct auth_data_t*, uint8_t*);
+static int pap_start(struct ppp_t*, struct auth_data_t*);
+static int pap_finish(struct ppp_t*, struct auth_data_t*);
+static void pap_recv(struct ppp_handler_t*h);
+static void pap_timeout(struct triton_timer_t *t);
+
+struct pap_auth_data_t
+{
+ struct auth_data_t auth;
+ struct ppp_handler_t h;
+ struct ppp_t *ppp;
+ int started:1;
+ struct triton_timer_t timeout;
+};
+
+struct pap_hdr_t
+{
+ uint16_t proto;
+ uint8_t code;
+ uint8_t id;
+ uint16_t len;
+} __attribute__((packed));
+
+struct pap_ack_t
+{
+ struct pap_hdr_t hdr;
+ uint8_t msg_len;
+ char msg[0];
+} __attribute__((packed));
+
+static struct ppp_auth_handler_t pap=
+{
+ .name = "PAP",
+ .init = auth_data_init,
+ .free = auth_data_free,
+ .send_conf_req = lcp_send_conf_req,
+ .recv_conf_req = lcp_recv_conf_req,
+ .start = pap_start,
+ .finish = pap_finish,
+};
+
+static struct auth_data_t* auth_data_init(struct ppp_t *ppp)
+{
+ struct pap_auth_data_t *d = _malloc(sizeof(*d));
+
+ memset(d, 0, sizeof(*d));
+ d->auth.proto = PPP_PAP;
+ d->ppp = ppp;
+
+ return &d->auth;
+}
+
+static void auth_data_free(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct pap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ _free(d);
+}
+
+static int pap_start(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct pap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ d->h.proto = PPP_PAP;
+ d->h.recv = pap_recv;
+ d->timeout.expire = pap_timeout;
+ d->timeout.period = conf_timeout * 1000;
+
+ triton_timer_add(ppp->ctrl->ctx, &d->timeout, 0);
+
+ ppp_register_chan_handler(ppp, &d->h);
+
+ return 0;
+}
+static int pap_finish(struct ppp_t *ppp, struct auth_data_t *auth)
+{
+ struct pap_auth_data_t *d = container_of(auth, typeof(*d), auth);
+
+ if (d->timeout.tpd)
+ triton_timer_del(&d->timeout);
+
+ ppp_unregister_handler(ppp, &d->h);
+
+ return 0;
+}
+
+static void pap_timeout(struct triton_timer_t *t)
+{
+ struct pap_auth_data_t *d = container_of(t, typeof(*d), timeout);
+
+ if (conf_ppp_verbose)
+ log_ppp_warn("pap: timeout\n");
+
+ auth_failed(d->ppp);
+}
+
+static int lcp_send_conf_req(struct ppp_t *ppp, struct auth_data_t *d, uint8_t *ptr)
+{
+ return 0;
+}
+
+static int lcp_recv_conf_req(struct ppp_t *ppp, struct auth_data_t *d, uint8_t *ptr)
+{
+ return LCP_OPT_ACK;
+}
+
+static void pap_send_ack(struct pap_auth_data_t *p, int id)
+{
+ uint8_t buf[128];
+ struct pap_ack_t *msg = (struct pap_ack_t*)buf;
+ msg->hdr.proto = htons(PPP_PAP);
+ msg->hdr.code = PAP_ACK;
+ msg->hdr.id = id;
+ msg->hdr.len = htons(HDR_LEN + 1 + sizeof(MSG_SUCCESSED) - 1);
+ msg->msg_len = sizeof(MSG_SUCCESSED) - 1;
+ memcpy(msg->msg, MSG_SUCCESSED, sizeof(MSG_SUCCESSED));
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [PAP AuthAck id=%x \"%s\"]\n", id, MSG_SUCCESSED);
+
+ ppp_chan_send(p->ppp, msg, ntohs(msg->hdr.len) + 2);
+}
+
+static void pap_send_nak(struct pap_auth_data_t *p, int id)
+{
+ uint8_t buf[128];
+ struct pap_ack_t *msg = (struct pap_ack_t*)buf;
+ msg->hdr.proto = htons(PPP_PAP);
+ msg->hdr.code = PAP_NAK;
+ msg->hdr.id = id;
+ msg->hdr.len = htons(HDR_LEN + 1 + sizeof(MSG_FAILED) - 1);
+ msg->msg_len = sizeof(MSG_FAILED) - 1;
+ memcpy(msg->msg, MSG_FAILED, sizeof(MSG_FAILED));
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [PAP AuthNak id=%x \"%s\"]\n", id, MSG_FAILED);
+
+ ppp_chan_send(p->ppp, msg, ntohs(msg->hdr.len) + 2);
+}
+
+static int pap_recv_req(struct pap_auth_data_t *p, struct pap_hdr_t *hdr)
+{
+ int ret, r;
+ char *peer_id;
+ char *passwd;
+ const char *passwd2;
+ int peer_id_len;
+ int passwd_len;
+ uint8_t *ptr = (uint8_t*)(hdr + 1);
+
+ if (p->timeout.tpd)
+ triton_timer_del(&p->timeout);
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [PAP AuthReq id=%x]\n", hdr->id);
+
+ peer_id_len = *(uint8_t*)ptr; ptr++;
+ if (peer_id_len > ntohs(hdr->len) - sizeof(*hdr) + 2 - 1) {
+ log_ppp_warn("PAP: short packet received\n");
+ return -1;
+ }
+ peer_id = (char*)ptr; ptr += peer_id_len;
+
+ passwd_len = *(uint8_t*)ptr; ptr++;
+ if (passwd_len > ntohs(hdr->len) - sizeof(*hdr ) + 2 - 2 - peer_id_len) {
+ log_ppp_warn("PAP: short packet received\n");
+ return -1;
+ }
+
+ peer_id = _strndup((const char*)peer_id, peer_id_len);
+ passwd = _strndup((const char*)ptr, passwd_len);
+
+ r = pwdb_check(p->ppp, peer_id, PPP_PAP, passwd);
+ if (r == PWDB_NO_IMPL) {
+ passwd2 = pwdb_get_passwd(p->ppp, peer_id);
+ if (!passwd2 || strcmp(passwd2, passwd))
+ r = PWDB_DENIED;
+ else
+ r = PWDB_SUCCESS;
+ }
+ if (r == PWDB_DENIED) {
+ if (conf_ppp_verbose)
+ log_ppp_warn("PAP: authentication error\n");
+ pap_send_nak(p, hdr->id);
+ if (p->started)
+ ppp_terminate(p->ppp, 0);
+ else
+ auth_failed(p->ppp);
+ ret=-1;
+ _free(peer_id);
+ } else {
+ pap_send_ack(p, hdr->id);
+ if (!p->started) {
+ p->started = 1;
+ auth_successed(p->ppp, peer_id);
+ }
+ ret = 0;
+ }
+
+ _free(passwd);
+
+ return ret;
+}
+
+static void pap_recv(struct ppp_handler_t *h)
+{
+ struct pap_auth_data_t *d = container_of(h, typeof(*d), h);
+ struct pap_hdr_t *hdr = (struct pap_hdr_t *)d->ppp->chan_buf;
+
+ if (d->ppp->chan_buf_size < sizeof(*hdr) || ntohs(hdr->len) < HDR_LEN || ntohs(hdr->len) < d->ppp->chan_buf_size - 2) {
+ log_ppp_warn("PAP: short packet received\n");
+ return;
+ }
+
+ if (hdr->code == PAP_REQ)
+ pap_recv_req(d, hdr);
+ else {
+ log_ppp_warn("PAP: unknown code received %x\n",hdr->code);
+ }
+}
+
+static void __init auth_pap_init()
+{
+ char *opt;
+
+ opt = conf_get_opt("auth", "timeout");
+ if (opt && atoi(opt) > 0)
+ conf_timeout = atoi(opt);
+
+ ppp_auth_register_handler(&pap);
+}
+
diff --git a/accel-pptpd/ctrl/CMakeLists.txt b/accel-pptpd/ctrl/CMakeLists.txt
new file mode 100644
index 0000000..53b0dc1
--- /dev/null
+++ b/accel-pptpd/ctrl/CMakeLists.txt
@@ -0,0 +1,8 @@
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+
+ADD_LIBRARY(pptp SHARED pptp.c)
+
+INSTALL(TARGETS pptp
+ LIBRARY DESTINATION usr/lib/accel-pptp
+)
+
diff --git a/accel-pptpd/ctrl/pptp.c b/accel-pptpd/ctrl/pptp.c
new file mode 100644
index 0000000..1151dab
--- /dev/null
+++ b/accel-pptpd/ctrl/pptp.c
@@ -0,0 +1,736 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <time.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+
+#include "if_pppox.h"
+
+#include "events.h"
+#include "list.h"
+#include "pptp_prot.h"
+#include "triton.h"
+#include "log.h"
+#include "ppp.h"
+#include "mempool.h"
+#include "iprange.h"
+#include "utils.h"
+
+#include "memdebug.h"
+
+#define STATE_IDLE 0
+#define STATE_ESTB 1
+#define STATE_PPP 2
+#define STATE_FIN 3
+#define STATE_CLOSE 4
+
+struct pptp_conn_t
+{
+ struct triton_context_t ctx;
+ struct triton_md_handler_t hnd;
+ struct triton_timer_t timeout_timer;
+ struct triton_timer_t echo_timer;
+ int call_id;
+ int peer_call_id;
+ int state;
+ int echo_sent;
+
+ uint8_t *in_buf;
+ int in_size;
+ uint8_t *out_buf;
+ int out_size;
+ int out_pos;
+
+ struct ppp_ctrl_t ctrl;
+ struct ppp_t ppp;
+};
+
+static int conf_timeout = 5;
+static int conf_echo_interval = 0;
+static int conf_echo_failure = 3;
+static int conf_verbose = 0;
+
+static mempool_t conn_pool;
+
+static int pptp_read(struct triton_md_handler_t *h);
+static int pptp_write(struct triton_md_handler_t *h);
+static void pptp_timeout(struct triton_timer_t *);
+static void ppp_started(struct ppp_t *);
+static void ppp_finished(struct ppp_t *);
+
+static void disconnect(struct pptp_conn_t *conn)
+{
+ log_ppp_debug("pptp: disconnect\n");
+
+ triton_md_unregister_handler(&conn->hnd);
+ close(conn->hnd.fd);
+
+ if (conn->timeout_timer.tpd)
+ triton_timer_del(&conn->timeout_timer);
+
+ if (conn->echo_timer.tpd)
+ triton_timer_del(&conn->echo_timer);
+
+ if (conn->state == STATE_PPP) {
+ conn->state = STATE_CLOSE;
+ ppp_terminate(&conn->ppp, 1);
+ }
+
+ triton_event_fire(EV_CTRL_FINISHED, &conn->ppp);
+
+ if (conf_verbose)
+ log_ppp_info("disconnected\n");
+
+ triton_context_unregister(&conn->ctx);
+
+ if (conn->ppp.chan_name)
+ _free(conn->ppp.chan_name);
+
+ _free(conn->in_buf);
+ _free(conn->out_buf);
+ _free(conn->ctrl.calling_station_id);
+ _free(conn->ctrl.called_station_id);
+ mempool_free(conn);
+}
+
+static int post_msg(struct pptp_conn_t *conn, void *buf, int size)
+{
+ int n;
+ if (conn->out_size) {
+ log_error("pptp: buffer is not empty\n");
+ return -1;
+ }
+
+ n=write(conn->hnd.fd, buf, size);
+ if (n < 0) {
+ if (errno == EINTR || errno == EAGAIN)
+ n = 0;
+ else {
+ if (errno != EPIPE) {
+ if (conf_verbose)
+ log_ppp_info("pptp: write: %s\n", strerror(errno));
+ return -1;
+ }
+ }
+ }
+
+ if ( n<size ) {
+ memcpy(conn->out_buf, buf + n, size - n);
+ triton_md_enable_handler(&conn->hnd, MD_MODE_WRITE);
+ }
+
+ return 0;
+}
+
+static int send_pptp_stop_ctrl_conn_rqst(struct pptp_conn_t *conn, int reason)
+{
+ struct pptp_stop_ctrl_conn msg = {
+ .header = PPTP_HEADER_CTRL(PPTP_STOP_CTRL_CONN_RQST),
+ .reason_result = hton8(reason),
+ };
+
+ if (conf_verbose)
+ log_ppp_info("send [PPTP Stop-Ctrl-Conn-Request <Reason %i>]\n", reason);
+
+ return post_msg(conn, &msg, sizeof(msg));
+}
+
+static int send_pptp_stop_ctrl_conn_rply(struct pptp_conn_t *conn, int reason, int err_code)
+{
+ struct pptp_stop_ctrl_conn msg = {
+ .header = PPTP_HEADER_CTRL(PPTP_STOP_CTRL_CONN_RPLY),
+ .reason_result = hton8(reason),
+ .error_code = hton8(err_code),
+ };
+
+ if (conf_verbose)
+ log_ppp_info("send [PPTP Stop-Ctrl-Conn-Reply <Result %i> <Error %i>]\n", msg.reason_result, msg.error_code);
+
+ return post_msg(conn, &msg, sizeof(msg));
+}
+static int pptp_stop_ctrl_conn_rqst(struct pptp_conn_t *conn)
+{
+ struct pptp_stop_ctrl_conn *msg = (struct pptp_stop_ctrl_conn *)conn->in_buf;
+ if (conf_verbose)
+ log_ppp_info("recv [PPTP Stop-Ctrl-Conn-Request <Reason %i>]\n", msg->reason_result);
+
+ send_pptp_stop_ctrl_conn_rply(conn, PPTP_CONN_STOP_OK, 0);
+
+ return -1;
+}
+
+static int pptp_stop_ctrl_conn_rply(struct pptp_conn_t *conn)
+{
+ struct pptp_stop_ctrl_conn *msg = (struct pptp_stop_ctrl_conn*)conn->in_buf;
+ if (conf_verbose)
+ log_ppp_info("recv [PPTP Stop-Ctrl-Conn-Reply <Result %i> <Error %i>]\n", msg->reason_result, msg->error_code);
+ return -1;
+}
+
+static int send_pptp_start_ctrl_conn_rply(struct pptp_conn_t *conn, int res_code, int err_code)
+{
+ struct pptp_start_ctrl_conn msg = {
+ .header = PPTP_HEADER_CTRL(PPTP_START_CTRL_CONN_RPLY),
+ .version = htons(PPTP_VERSION),
+ .result_code = res_code,
+ .error_code = err_code,
+ .framing_cap = htonl(3),
+ .bearer_cap = htonl(3),
+ .max_channels = htons(1),
+ .firmware_rev = htons(PPTP_FIRMWARE_VERSION),
+ };
+
+ memset(msg.hostname, 0, sizeof(msg.hostname));
+ strcpy((char*)msg.hostname, PPTP_HOSTNAME);
+
+ memset(msg.vendor, 0, sizeof(msg.vendor));
+ strcpy((char*)msg.vendor, PPTP_VENDOR);
+
+ if (conf_verbose)
+ log_ppp_info("send [PPTP Start-Ctrl-Conn-Reply <Version %i> <Result %i> <Error %i> <Framing %x> <Bearer %x> <Max-Chan %i>]\n", msg.version, msg.result_code, msg.error_code, ntohl(msg.framing_cap), ntohl(msg.bearer_cap), ntohs(msg.max_channels));
+
+ return post_msg(conn, &msg, sizeof(msg));
+}
+
+static int pptp_start_ctrl_conn_rqst(struct pptp_conn_t *conn)
+{
+ struct pptp_start_ctrl_conn *msg = (struct pptp_start_ctrl_conn *)conn->in_buf;
+
+ if (conf_verbose)
+ log_ppp_info("recv [PPTP Start-Ctrl-Conn-Request <Version %i> <Framing %x> <Bearer %x> <Max-Chan %i>]\n", msg->version, ntohl(msg->framing_cap), ntohl(msg->bearer_cap), ntohs(msg->max_channels));
+
+ if (conn->state != STATE_IDLE) {
+ log_ppp_warn("unexpected PPTP_START_CTRL_CONN_RQST\n");
+ if (send_pptp_start_ctrl_conn_rply(conn, PPTP_CONN_RES_EXISTS, 0))
+ return -1;
+ return 0;
+ }
+
+ if (msg->version != htons(PPTP_VERSION)) {
+ log_ppp_warn("PPTP version mismatch: expecting %x, received %s\n", PPTP_VERSION, msg->version);
+ if (send_pptp_start_ctrl_conn_rply(conn, PPTP_CONN_RES_PROTOCOL, 0))
+ return -1;
+ return 0;
+ }
+ /*if (!(ntohl(msg->framing_cap) & PPTP_FRAME_SYNC)) {
+ log_ppp_warn("connection does not supports sync mode\n");
+ if (send_pptp_start_ctrl_conn_rply(conn, PPTP_CONN_RES_GE, 0))
+ return -1;
+ return 0;
+ }*/
+ if (send_pptp_start_ctrl_conn_rply(conn, PPTP_CONN_RES_SUCCESS, 0))
+ return -1;
+
+ triton_timer_mod(&conn->timeout_timer, 0);
+
+ conn->state = STATE_ESTB;
+
+ return 0;
+}
+
+static int send_pptp_out_call_rply(struct pptp_conn_t *conn, struct pptp_out_call_rqst *rqst, int call_id, int res_code, int err_code)
+{
+ struct pptp_out_call_rply msg = {
+ .header = PPTP_HEADER_CTRL(PPTP_OUT_CALL_RPLY),
+ .call_id = htons(call_id),
+ .call_id_peer = rqst->call_id,
+ .result_code = res_code,
+ .error_code = err_code,
+ .cause_code = 0,
+ .speed = rqst->bps_max,
+ .recv_size = rqst->recv_size,
+ .delay = 0,
+ .channel = 0,
+ };
+
+ if (conf_verbose)
+ log_ppp_info("send [PPTP Outgoing-Call-Reply <Call-ID %x> <Peer-Call-ID %x> <Result %i> <Error %i> <Cause %i> <Speed %i> <Window-Size %i> <Delay %i> <Channel %x>]\n", ntohs(msg.call_id), ntohs(msg.call_id_peer), msg.result_code, msg.error_code, ntohs(msg.cause_code), ntohl(msg.speed), ntohs(msg.recv_size), ntohs(msg.delay), ntohl(msg.channel));
+
+ return post_msg(conn, &msg, sizeof(msg));
+}
+
+static int pptp_out_call_rqst(struct pptp_conn_t *conn)
+{
+ struct pptp_out_call_rqst *msg = (struct pptp_out_call_rqst *)conn->in_buf;
+ struct sockaddr_pppox src_addr, dst_addr;
+ struct sockaddr_in addr;
+ socklen_t addrlen;
+ int pptp_sock;
+
+ if (conf_verbose)
+ log_ppp_info("recv [PPTP Outgoing-Call-Request <Call-ID %x> <Call-Serial %x> <Min-BPS %i> <Max-BPS %i> <Bearer %x> <Framing %x> <Window-Size %i> <Delay %i>]\n", ntohs(msg->call_id), ntohs(msg->call_sernum), ntohl(msg->bps_min), ntohl(msg->bps_max), ntohl(msg->bearer), ntohl(msg->framing), ntohs(msg->recv_size), ntohs(msg->delay));
+
+ if (conn->state != STATE_ESTB) {
+ log_ppp_warn("unexpected PPTP_OUT_CALL_RQST\n");
+ if (send_pptp_out_call_rply(conn, msg, 0, PPTP_CALL_RES_GE, PPTP_GE_NOCONN))
+ return -1;
+ return 0;
+ }
+
+ src_addr.sa_family = AF_PPPOX;
+ src_addr.sa_protocol = PX_PROTO_PPTP;
+ src_addr.sa_addr.pptp.call_id = 0;
+ addrlen = sizeof(addr);
+ getsockname(conn->hnd.fd, (struct sockaddr*)&addr, &addrlen);
+ src_addr.sa_addr.pptp.sin_addr = addr.sin_addr;
+
+ dst_addr.sa_family = AF_PPPOX;
+ dst_addr.sa_protocol = PX_PROTO_PPTP;
+ dst_addr.sa_addr.pptp.call_id = htons(msg->call_id);
+ addrlen = sizeof(addr);
+ getpeername(conn->hnd.fd, (struct sockaddr*)&addr, &addrlen);
+ dst_addr.sa_addr.pptp.sin_addr = addr.sin_addr;
+
+ pptp_sock = socket(AF_PPPOX, SOCK_STREAM, PX_PROTO_PPTP);
+ if (pptp_sock < 0) {
+ log_ppp_error("failed to create PPTP socket (%s)\n", strerror(errno));
+ return -1;
+ }
+ if (bind(pptp_sock, (struct sockaddr*)&src_addr, sizeof(src_addr))) {
+ log_ppp_error("failed to bind PPTP socket (%s)\n", strerror(errno));
+ close(pptp_sock);
+ return -1;
+ }
+ addrlen = sizeof(src_addr);
+ getsockname(pptp_sock, (struct sockaddr*)&src_addr, &addrlen);
+
+ if (connect(pptp_sock, (struct sockaddr*)&dst_addr, sizeof(dst_addr))) {
+ log_ppp_error("failed to connect PPTP socket (%s)\n", strerror(errno));
+ close(pptp_sock);
+ return -1;
+ }
+
+ if (send_pptp_out_call_rply(conn, msg, src_addr.sa_addr.pptp.call_id, PPTP_CALL_RES_OK, 0))
+ return -1;
+
+ conn->call_id = src_addr.sa_addr.pptp.call_id;
+ conn->peer_call_id = msg->call_id;
+ conn->ppp.fd = pptp_sock;
+ conn->ppp.chan_name = _strdup(inet_ntoa(dst_addr.sa_addr.pptp.sin_addr));
+
+ triton_event_fire(EV_CTRL_STARTED, &conn->ppp);
+
+ if (establish_ppp(&conn->ppp)) {
+ close(pptp_sock);
+ //if (send_pptp_stop_ctrl_conn_rqst(conn, 0, 0))
+ conn->state = STATE_FIN;
+ return -1;
+ }
+ conn->state = STATE_PPP;
+
+ if (conn->timeout_timer.tpd)
+ triton_timer_del(&conn->timeout_timer);
+
+ if (conf_echo_interval) {
+ conn->echo_timer.period = conf_echo_interval * 1000;
+ triton_timer_add(&conn->ctx, &conn->echo_timer, 0);
+ }
+
+ return 0;
+}
+
+static int send_pptp_call_disconnect_notify(struct pptp_conn_t *conn, int result)
+{
+ struct pptp_call_clear_ntfy msg = {
+ .header = PPTP_HEADER_CTRL(PPTP_CALL_CLEAR_NTFY),
+ .call_id = htons(conn->peer_call_id),
+ .result_code = result,
+ .error_code = 0,
+ .cause_code = 0,
+ };
+
+ if (conf_verbose)
+ log_ppp_info("send [PPTP Call-Disconnect-Notify <Call-ID %x> <Result %i> <Error %i> <Cause %i>]\n", ntohs(msg.call_id), msg.result_code, msg.error_code, msg.cause_code);
+
+ return post_msg(conn, &msg, sizeof(msg));
+}
+
+static int pptp_call_clear_rqst(struct pptp_conn_t *conn)
+{
+ struct pptp_call_clear_rqst *rqst = (struct pptp_call_clear_rqst *)conn->in_buf;
+
+ if (conf_verbose)
+ log_ppp_info("recv [PPTP Call-Clear-Request <Call-ID %x>]\n", ntohs(rqst->call_id));
+
+ if (conn->state == STATE_PPP) {
+ conn->state = STATE_CLOSE;
+ ppp_terminate(&conn->ppp, 1);
+ }
+
+ return send_pptp_call_disconnect_notify(conn, 4);
+}
+
+static int pptp_echo_rqst(struct pptp_conn_t *conn)
+{
+ struct pptp_echo_rqst *in_msg = (struct pptp_echo_rqst *)conn->in_buf;
+ struct pptp_echo_rply out_msg = {
+ .header = PPTP_HEADER_CTRL(PPTP_ECHO_RPLY),
+ .identifier = in_msg->identifier,
+ .result_code = 1,
+ };
+
+ if (conf_verbose) {
+ log_ppp_info("recv [PPTP Echo-Request <Identifier %x>]\n", in_msg->identifier);
+ log_ppp_info("send [PPTP Echo-Reply <Identifier %x>]\n", out_msg.identifier);
+ }
+
+ return post_msg(conn, &out_msg, sizeof(out_msg));
+}
+
+static int pptp_echo_rply(struct pptp_conn_t *conn)
+{
+ struct pptp_echo_rply *msg = (struct pptp_echo_rply *)conn->in_buf;
+
+ if (conf_verbose)
+ log_ppp_info("recv [PPTP Echo-Reply <Identifier %x>]\n", msg->identifier);
+
+ if (msg->identifier != conn->echo_sent) {
+ log_ppp_warn("pptp:echo: identifier mismatch\n");
+ //return -1;
+ }
+ conn->echo_sent = 0;
+ return 0;
+}
+static void pptp_send_echo(struct triton_timer_t *t)
+{
+ struct pptp_conn_t *conn = container_of(t, typeof(*conn), echo_timer);
+ struct pptp_echo_rqst msg = {
+ .header = PPTP_HEADER_CTRL(PPTP_ECHO_RQST),
+ };
+
+ if (++conn->echo_sent == conf_echo_failure) {
+ log_ppp_warn("pptp: no echo reply\n");
+ disconnect(conn);
+ return;
+ }
+
+ conn->echo_sent = random();
+ msg.identifier = conn->echo_sent;
+
+ if (conf_verbose)
+ log_ppp_info("send [PPTP Echo-Request <Identifier %x>]\n", msg.identifier);
+
+ if (post_msg(conn, &msg, sizeof(msg)))
+ disconnect(conn);
+}
+
+static int process_packet(struct pptp_conn_t *conn)
+{
+ struct pptp_header *hdr = (struct pptp_header *)conn->in_buf;
+ switch(ntohs(hdr->ctrl_type))
+ {
+ case PPTP_START_CTRL_CONN_RQST:
+ return pptp_start_ctrl_conn_rqst(conn);
+ case PPTP_STOP_CTRL_CONN_RQST:
+ return pptp_stop_ctrl_conn_rqst(conn);
+ case PPTP_STOP_CTRL_CONN_RPLY:
+ return pptp_stop_ctrl_conn_rply(conn);
+ case PPTP_OUT_CALL_RQST:
+ return pptp_out_call_rqst(conn);
+ case PPTP_ECHO_RQST:
+ return pptp_echo_rqst(conn);
+ case PPTP_ECHO_RPLY:
+ return pptp_echo_rply(conn);
+ case PPTP_CALL_CLEAR_RQST:
+ return pptp_call_clear_rqst(conn);
+ case PPTP_SET_LINK_INFO:
+ if (conf_verbose)
+ log_ppp_info("recv [PPTP Set-Link-Info]\n");
+ return 0;
+ default:
+ log_ppp_warn("recv [PPTP Unknown (%x)]\n", ntohs(hdr->ctrl_type));
+ }
+ return 0;
+}
+
+static int pptp_read(struct triton_md_handler_t *h)
+{
+ struct pptp_conn_t *conn=container_of(h,typeof(*conn),hnd);
+ struct pptp_header *hdr=(struct pptp_header *)conn->in_buf;
+ int n;
+
+ while(1) {
+ n = read(h->fd, conn->in_buf + conn->in_size, PPTP_CTRL_SIZE_MAX - conn->in_size);
+ if (n < 0) {
+ if (errno == EINTR)
+ continue;
+ if (errno == EAGAIN)
+ return 0;
+ log_ppp_error("pptp: read: %s\n",strerror(errno));
+ goto drop;
+ }
+ if (n == 0) {
+ if (conf_verbose)
+ log_ppp_info("pptp: disconnect by peer\n");
+ goto drop;
+ }
+ conn->in_size += n;
+ if (conn->in_size >= sizeof(*hdr)) {
+ if (hdr->magic != htonl(PPTP_MAGIC)) {
+ log_ppp_error("pptp: invalid magic\n");
+ goto drop;
+ }
+ if (ntohs(hdr->length) >= PPTP_CTRL_SIZE_MAX) {
+ log_ppp_error("pptp: message is too long\n");
+ goto drop;
+ }
+ if (ntohs(hdr->length) > conn->in_size)
+ continue;
+ if (ntohs(hdr->length) <= conn->in_size) {
+ if (ntohs(hdr->length) != PPTP_CTRL_SIZE(ntohs(hdr->ctrl_type))) {
+ log_ppp_error("pptp: invalid message length\n");
+ goto drop;
+ }
+ if (process_packet(conn))
+ goto drop;
+ conn->in_size -= ntohs(hdr->length);
+ if (conn->in_size)
+ memmove(conn->in_buf, conn->in_buf + ntohs(hdr->length), conn->in_size);
+ }
+ }
+ }
+drop:
+ disconnect(conn);
+ return 1;
+}
+static int pptp_write(struct triton_md_handler_t *h)
+{
+ struct pptp_conn_t *conn = container_of(h, typeof(*conn), hnd);
+ int n;
+
+ while (1) {
+ n = write(h->fd, conn->out_buf+conn->out_pos, conn->out_size-conn->out_pos);
+
+ if (n < 0) {
+ if (errno == EINTR)
+ continue;
+ if (errno == EAGAIN)
+ n = 0;
+ else {
+ if (errno != EPIPE) {
+ if (conf_verbose)
+ log_ppp_info("pptp: post_msg: %s\n", strerror(errno));
+ }
+ disconnect(conn);
+ return 1;
+ }
+ }
+
+ conn->out_pos += n;
+ if (conn->out_pos == conn->out_size) {
+ conn->out_pos = 0;
+ conn->out_size = 0;
+ triton_md_disable_handler(h, MD_MODE_WRITE);
+ return 0;
+ }
+ }
+}
+static void pptp_timeout(struct triton_timer_t *t)
+{
+ struct pptp_conn_t *conn = container_of(t, typeof(*conn), timeout_timer);
+ disconnect(conn);
+}
+static void pptp_close(struct triton_context_t *ctx)
+{
+ struct pptp_conn_t *conn = container_of(ctx, typeof(*conn), ctx);
+ if (conn->state == STATE_PPP) {
+ conn->state = STATE_CLOSE;
+ ppp_terminate(&conn->ppp, 1);
+ if (send_pptp_call_disconnect_notify(conn, 3)) {
+ triton_context_call(&conn->ctx, (void (*)(void*))disconnect, conn);
+ return;
+ }
+ } else {
+ if (send_pptp_stop_ctrl_conn_rqst(conn, 0)) {
+ triton_context_call(&conn->ctx, (void (*)(void*))disconnect, conn);
+ return;
+ }
+ }
+
+ if (conn->timeout_timer.tpd)
+ triton_timer_mod(&conn->timeout_timer, 0);
+ else
+ triton_timer_add(ctx, &conn->timeout_timer, 0);
+}
+static void ppp_started(struct ppp_t *ppp)
+{
+ log_ppp_debug("pptp: ppp started\n");
+}
+static void ppp_finished(struct ppp_t *ppp)
+{
+ struct pptp_conn_t *conn = container_of(ppp, typeof(*conn), ppp);
+
+ if (conn->state != STATE_CLOSE) {
+ log_ppp_debug("pptp: ppp finished\n");
+ conn->state = STATE_CLOSE;
+
+ if (send_pptp_call_disconnect_notify(conn, 3))
+ triton_context_call(&conn->ctx, (void (*)(void*))disconnect, conn);
+ else if (send_pptp_stop_ctrl_conn_rqst(conn, 0))
+ triton_context_call(&conn->ctx, (void (*)(void*))disconnect, conn);
+ else {
+ if (conn->timeout_timer.tpd)
+ triton_timer_mod(&conn->timeout_timer, 0);
+ else
+ triton_timer_add(&conn->ctx, &conn->timeout_timer, 0);
+ }
+ }
+}
+
+//==================================
+
+struct pptp_serv_t
+{
+ struct triton_context_t ctx;
+ struct triton_md_handler_t hnd;
+};
+
+static int pptp_connect(struct triton_md_handler_t *h)
+{
+ struct sockaddr_in addr;
+ socklen_t size = sizeof(addr);
+ int sock;
+ struct pptp_conn_t *conn;
+
+ while(1) {
+ sock = accept(h->fd, (struct sockaddr *)&addr, &size);
+ if (sock < 0) {
+ if (errno == EAGAIN)
+ return 0;
+ log_error("pptp: accept failed: %s\n", strerror(errno));
+ continue;
+ }
+
+ log_info("pptp: new connection from %s\n", inet_ntoa(addr.sin_addr));
+
+ if (iprange_client_check(addr.sin_addr.s_addr)) {
+ log_warn("pptp: IP is out of client-ip-range, droping connection...\n");
+ close(sock);
+ continue;
+ }
+
+ if (fcntl(sock, F_SETFL, O_NONBLOCK)) {
+ log_error("pptp: failed to set nonblocking mode: %s, closing connection...\n", strerror(errno));
+ close(sock);
+ continue;
+ }
+
+ conn = mempool_alloc(conn_pool);
+ memset(conn, 0, sizeof(*conn));
+ conn->hnd.fd = sock;
+ conn->hnd.read = pptp_read;
+ conn->hnd.write = pptp_write;
+ conn->ctx.close = pptp_close;
+ conn->ctx.before_switch = log_switch;
+ conn->in_buf = _malloc(PPTP_CTRL_SIZE_MAX);
+ conn->out_buf = _malloc(PPTP_CTRL_SIZE_MAX);
+ conn->timeout_timer.expire = pptp_timeout;
+ conn->timeout_timer.period = conf_timeout * 1000;
+ conn->echo_timer.expire = pptp_send_echo;
+ conn->ctrl.ctx = &conn->ctx;
+ conn->ctrl.started = ppp_started;
+ conn->ctrl.finished = ppp_finished;
+ conn->ctrl.max_mtu = PPTP_MAX_MTU;
+ conn->ctrl.name = "pptp";
+
+ conn->ctrl.calling_station_id = _malloc(17);
+ conn->ctrl.called_station_id = _malloc(17);
+ u_inet_ntoa(addr.sin_addr.s_addr, conn->ctrl.calling_station_id);
+ getsockname(sock, &addr, &size);
+ u_inet_ntoa(addr.sin_addr.s_addr, conn->ctrl.called_station_id);
+
+ ppp_init(&conn->ppp);
+ conn->ppp.ctrl = &conn->ctrl;
+
+ triton_context_register(&conn->ctx, &conn->ppp);
+ triton_md_register_handler(&conn->ctx, &conn->hnd);
+ triton_md_enable_handler(&conn->hnd,MD_MODE_READ);
+ triton_timer_add(&conn->ctx, &conn->timeout_timer, 0);
+ triton_context_wakeup(&conn->ctx);
+
+ triton_event_fire(EV_CTRL_STARTING, &conn->ppp);
+ }
+ return 0;
+}
+static void pptp_serv_close(struct triton_context_t *ctx)
+{
+ struct pptp_serv_t *s=container_of(ctx,typeof(*s),ctx);
+ triton_md_unregister_handler(&s->hnd);
+ close(s->hnd.fd);
+ triton_context_unregister(ctx);
+}
+
+static struct pptp_serv_t serv=
+{
+ .hnd.read=pptp_connect,
+ .ctx.close=pptp_serv_close,
+};
+
+static void __init pptp_init(void)
+{
+ struct sockaddr_in addr;
+ char *opt;
+
+ 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);
+
+ 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) {
+ log_emerg("pptp: failed to bind socket: %s\n", strerror(errno));
+ close(serv.hnd.fd);
+ return;
+ }
+
+ if (listen (serv.hnd.fd, 100) < 0) {
+ log_emerg("pptp: failed to listen socket: %s\n", strerror(errno));
+ close(serv.hnd.fd);
+ return;
+ }
+
+ if (fcntl(serv.hnd.fd, F_SETFL, O_NONBLOCK)) {
+ log_emerg("pptp: failed to set nonblocking mode: %s\n", strerror(errno));
+ close(serv.hnd.fd);
+ return;
+ }
+
+ opt = conf_get_opt("pptp", "timeout");
+ if (opt && atoi(opt) > 0)
+ conf_timeout = atoi(opt);
+
+ opt = conf_get_opt("pptp", "echo-interval");
+ if (opt && atoi(opt) >= 0)
+ conf_echo_interval = atoi(opt);
+
+ opt = conf_get_opt("pptp", "echo-failure");
+ if (opt && atoi(opt) > 0)
+ conf_echo_failure = atoi(opt);
+
+ opt = conf_get_opt("pptp", "verbose");
+ if (opt && atoi(opt) > 0)
+ conf_verbose = 1;
+
+ conn_pool = mempool_create(sizeof(struct pptp_conn_t));
+
+ triton_context_register(&serv.ctx, NULL);
+ triton_md_register_handler(&serv.ctx, &serv.hnd);
+ triton_md_enable_handler(&serv.hnd, MD_MODE_READ);
+ triton_context_wakeup(&serv.ctx);
+}
+
diff --git a/accel-pptpd/ctrl/pptp_prot.h b/accel-pptpd/ctrl/pptp_prot.h
new file mode 100644
index 0000000..ee8cb34
--- /dev/null
+++ b/accel-pptpd/ctrl/pptp_prot.h
@@ -0,0 +1,299 @@
+#ifndef PPTP_PROT_H
+#define PPTP_PROT_H
+
+#include <sys/types.h>
+
+#define PPTP_MAX_MTU 1436
+
+#define hton8(x) (x)
+#define ntoh8(x) (x)
+#define hton16(x) htons(x)
+#define ntoh16(x) ntohs(x)
+#define hton32(x) htonl(x)
+#define ntoh32(x) ntohl(x)
+
+/* PPTP magic numbers: ----------------------------------------- */
+
+#define PPTP_MAGIC 0x1A2B3C4D /* Magic cookie for PPTP datagrams */
+#define PPTP_PORT 1723 /* PPTP TCP port number */
+#define PPTP_PROTO 47 /* PPTP IP protocol number */
+
+/* PPTP result codes:---------------------------------------- */
+#define PPTP_CONN_RES_SUCCESS 1
+#define PPTP_CONN_RES_GE 2
+#define PPTP_CONN_RES_EXISTS 3
+#define PPTP_CONN_RES_AUTH 4
+#define PPTP_CONN_RES_PROTOCOL 5
+
+#define PPTP_CONN_STOP_OK 1
+#define PPTP_CONN_STOP_GE 2
+
+#define PPTP_CALL_RES_OK 1
+#define PPTP_CALL_RES_GE 2
+
+#define PPTP_GE_NOCONN 1
+
+/* Control Connection Message Types: --------------------------- */
+
+#define PPTP_MESSAGE_CONTROL 1
+#define PPTP_MESSAGE_MANAGE 2
+
+/* Control Message Types: -------------------------------------- */
+
+/* (Control Connection Management) */
+#define PPTP_START_CTRL_CONN_RQST 1
+#define PPTP_START_CTRL_CONN_RPLY 2
+#define PPTP_STOP_CTRL_CONN_RQST 3
+#define PPTP_STOP_CTRL_CONN_RPLY 4
+#define PPTP_ECHO_RQST 5
+#define PPTP_ECHO_RPLY 6
+
+/* (Call Management) */
+#define PPTP_OUT_CALL_RQST 7
+#define PPTP_OUT_CALL_RPLY 8
+#define PPTP_IN_CALL_RQST 9
+#define PPTP_IN_CALL_RPLY 10
+#define PPTP_IN_CALL_CONNECT 11
+#define PPTP_CALL_CLEAR_RQST 12
+#define PPTP_CALL_CLEAR_NTFY 13
+
+/* (Error Reporting) */
+#define PPTP_WAN_ERR_NTFY 14
+
+/* (PPP Session Control) */
+#define PPTP_SET_LINK_INFO 15
+
+/* PPTP version information: --------------------------------------*/
+#define PPTP_VERSION_STRING "1.00"
+#define PPTP_VERSION 0x100
+#define PPTP_FIRMWARE_STRING "0.01"
+#define PPTP_FIRMWARE_VERSION 0x001
+
+#define PPTP_HOSTNAME "local"
+#define PPTP_VENDOR "cananian"
+
+/* PPTP capabilities: ---------------------------------------------*/
+
+/* (Framing capabilities for msg sender) */
+#define PPTP_FRAME_ASYNC 1
+#define PPTP_FRAME_SYNC 2
+#define PPTP_FRAME_ANY 3
+
+/* (Bearer capabilities for msg sender) */
+#define PPTP_BEARER_ANALOG 1
+#define PPTP_BEARER_DIGITAL 2
+#define PPTP_BEARER_ANY 3
+
+#define PPTP_RESULT_GENERAL_ERROR 2
+
+/* (Reasons to close a connection) */
+#define PPTP_STOP_NONE 1 /* no good reason */
+#define PPTP_STOP_PROTOCOL 2 /* can't support peer's protocol version */
+#define PPTP_STOP_LOCAL_SHUTDOWN 3 /* requester is being shut down */
+
+/* PPTP datagram structures (all data in network byte order): ----------*/
+
+struct pptp_header
+{
+ uint16_t length; /* message length in octets, including header */
+ uint16_t pptp_type; /* PPTP message type. 1 for control message. */
+ uint32_t magic; /* this should be PPTP_MAGIC. */
+ uint16_t ctrl_type; /* Control message type (0-15) */
+ uint16_t reserved0; /* reserved. MUST BE ZERO. */
+}__attribute__((packed));
+
+struct pptp_start_ctrl_conn /* for control message types 1 and 2 */
+{
+ struct pptp_header header;
+
+ uint16_t version; /* PPTP protocol version. = PPTP_VERSION */
+ uint8_t result_code; /* these two fields should be zero on rqst msg*/
+ uint8_t error_code; /* 0 unless result_code==2 (General Error) */
+ uint32_t framing_cap; /* Framing capabilities */
+ uint32_t bearer_cap; /* Bearer Capabilities */
+ uint16_t max_channels; /* Maximum Channels (=0 for PNS, PAC ignores) */
+ uint16_t firmware_rev; /* Firmware or Software Revision */
+ uint8_t hostname[64]; /* Host Name (64 octets, zero terminated) */
+ uint8_t vendor[64]; /* Vendor string (64 octets, zero term.) */
+}__attribute__((packed));
+
+struct pptp_stop_ctrl_conn /* for control message types 3 and 4 */
+{
+ struct pptp_header header;
+
+ uint8_t reason_result; /* reason for rqst, result for rply */
+ uint8_t error_code; /* MUST be 0, unless rply result==2 (general err)*/
+ uint16_t reserved1; /* MUST be 0 */
+}__attribute__((packed));
+
+struct pptp_echo_rqst /* for control message type 5 */
+{
+ struct pptp_header header;
+ uint32_t identifier; /* arbitrary value set by sender which is used */
+ /* to match up reply and request */
+}__attribute__((packed));
+
+struct pptp_echo_rply /* for control message type 6 */
+{
+ struct pptp_header header;
+ uint32_t identifier; /* should correspond to id of rqst */
+ uint8_t result_code;
+ uint8_t error_code; /* =0, unless result_code==2 (general error) */
+ uint16_t reserved1; /* MUST BE ZERO */
+}__attribute__((packed));
+
+struct pptp_out_call_rqst /* for control message type 7 */
+{
+ struct pptp_header header;
+ uint16_t call_id; /* Call ID (unique id used to multiplex data) */
+ uint16_t call_sernum; /* Call Serial Number (used for logging) */
+ uint32_t bps_min; /* Minimum BPS (lowest acceptable line speed) */
+ uint32_t bps_max; /* Maximum BPS (highest acceptable line speed) */
+ uint32_t bearer; /* Bearer type */
+ uint32_t framing; /* Framing type */
+ uint16_t recv_size; /* Recv. Window Size (no. of buffered packets) */
+ uint16_t delay; /* Packet Processing Delay (in 1/10 sec) */
+ uint16_t phone_len; /* Phone Number Length (num. of valid digits) */
+ uint16_t reserved1; /* MUST BE ZERO */
+ uint8_t phone_num[64]; /* Phone Number (64 octets, null term.) */
+ uint8_t subaddress[64]; /* Subaddress (64 octets, null term.) */
+}__attribute__((packed));
+
+struct pptp_out_call_rply /* for control message type 8 */
+{
+ struct pptp_header header;
+ uint16_t call_id; /* Call ID (used to multiplex data over tunnel)*/
+ uint16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst)*/
+ uint8_t result_code; /* Result Code (1 is no errors) */
+ uint8_t error_code; /* Error Code (=0 unless result_code==2) */
+ uint16_t cause_code; /* Cause Code (addt'l failure information) */
+ uint32_t speed; /* Connect Speed (in BPS) */
+ uint16_t recv_size; /* Recv. Window Size (no. of buffered packets) */
+ uint16_t delay; /* Packet Processing Delay (in 1/10 sec) */
+ uint32_t channel; /* Physical Channel ID (for logging) */
+}__attribute__((packed));
+
+struct pptp_in_call_rqst /* for control message type 9 */
+{
+ struct pptp_header header;
+ uint16_t call_id; /* Call ID (unique id used to multiplex data) */
+ uint16_t call_sernum; /* Call Serial Number (used for logging) */
+ uint32_t bearer; /* Bearer type */
+ uint32_t channel; /* Physical Channel ID (for logging) */
+ uint16_t dialed_len; /* Dialed Number Length (# of valid digits) */
+ uint16_t dialing_len; /* Dialing Number Length (# of valid digits) */
+ uint8_t dialed_num[64]; /* Dialed Number (64 octets, zero term.) */
+ uint8_t dialing_num[64]; /* Dialing Number (64 octets, zero term.) */
+ uint8_t subaddress[64]; /* Subaddress (64 octets, zero term.) */
+}__attribute__((packed));
+
+struct pptp_in_call_rply /* for control message type 10 */
+{
+ struct pptp_header header;
+ uint16_t call_id; /* Call ID (used to multiplex data over tunnel)*/
+ uint16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst)*/
+ uint8_t result_code; /* Result Code (1 is no errors) */
+ uint8_t error_code; /* Error Code (=0 unless result_code==2) */
+ uint16_t recv_size; /* Recv. Window Size (no. of buffered packets) */
+ uint16_t delay; /* Packet Processing Delay (in 1/10 sec) */
+ uint16_t reserved1; /* MUST BE ZERO */
+}__attribute__((packed));
+
+struct pptp_in_call_connect /* for control message type 11 */
+{
+ struct pptp_header header;
+ uint16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst)*/
+ uint16_t reserved1; /* MUST BE ZERO */
+ uint32_t speed; /* Connect Speed (in BPS) */
+ uint16_t recv_size; /* Recv. Window Size (no. of buffered packets) */
+ uint16_t delay; /* Packet Processing Delay (in 1/10 sec) */
+ uint32_t framing; /* Framing type */
+}__attribute__((packed));
+
+struct pptp_call_clear_rqst /* for control message type 12 */
+{
+ struct pptp_header header;
+ uint16_t call_id; /* Call ID (used to multiplex data over tunnel)*/
+ uint16_t reserved1; /* MUST BE ZERO */
+}__attribute__((packed));
+
+struct pptp_call_clear_ntfy /* for control message type 13 */
+{
+ struct pptp_header header;
+ uint16_t call_id; /* Call ID (used to multiplex data over tunnel)*/
+ uint8_t result_code; /* Result Code */
+ uint8_t error_code; /* Error Code (=0 unless result_code==2) */
+ uint16_t cause_code; /* Cause Code (for ISDN, is Q.931 cause code) */
+ uint16_t reserved1; /* MUST BE ZERO */
+ uint8_t call_stats[128]; /* Call Statistics: 128 octets, ascii, 0-term */
+}__attribute__((packed));
+
+struct pptp_wan_err_ntfy /* for control message type 14 */
+{
+ struct pptp_header header;
+ uint16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst)*/
+ uint16_t reserved1; /* MUST BE ZERO */
+ uint32_t crc_errors; /* CRC errors */
+ uint32_t frame_errors; /* Framing errors */
+ uint32_t hard_errors; /* Hardware overruns */
+ uint32_t buff_errors; /* Buffer overruns */
+ uint32_t time_errors; /* Time-out errors */
+ uint32_t align_errors; /* Alignment errors */
+}__attribute__((packed));
+
+struct pptp_set_link_info /* for control message type 15 */
+{
+ struct pptp_header header;
+ uint16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst) */
+ uint16_t reserved1; /* MUST BE ZERO */
+ uint32_t send_accm; /* Send ACCM (for PPP packets; default 0xFFFFFFFF)*/
+ uint32_t recv_accm; /* Receive ACCM (for PPP pack.;default 0xFFFFFFFF)*/
+}__attribute__((packed));
+
+/* helpful #defines: -------------------------------------------- */
+#define pptp_isvalid_ctrl(header, type, length) \
+ (!( ( ntoh16(((struct pptp_header *)header)->length) < (length) ) || \
+ ( ntoh16(((struct pptp_header *)header)->pptp_type) !=(type) ) || \
+ ( ntoh32(((struct pptp_header *)header)->magic) !=PPTP_MAGIC) || \
+ ( ntoh16(((struct pptp_header *)header)->ctrl_type) > PPTP_SET_LINK_INFO) || \
+ ( ntoh16(((struct pptp_header *)header)->reserved0) !=0 ) ))
+
+#define PPTP_HEADER_CTRL(type) \
+{ hton16(PPTP_CTRL_SIZE(type)), \
+ hton16(PPTP_MESSAGE_CONTROL), \
+ hton32(PPTP_MAGIC), \
+ hton16(type), 0 }
+
+#define PPTP_CTRL_SIZE(type) ( \
+(type==PPTP_START_CTRL_CONN_RQST)?sizeof(struct pptp_start_ctrl_conn): \
+(type==PPTP_START_CTRL_CONN_RPLY)?sizeof(struct pptp_start_ctrl_conn): \
+(type==PPTP_STOP_CTRL_CONN_RQST )?sizeof(struct pptp_stop_ctrl_conn): \
+(type==PPTP_STOP_CTRL_CONN_RPLY )?sizeof(struct pptp_stop_ctrl_conn): \
+(type==PPTP_ECHO_RQST )?sizeof(struct pptp_echo_rqst): \
+(type==PPTP_ECHO_RPLY )?sizeof(struct pptp_echo_rply): \
+(type==PPTP_OUT_CALL_RQST )?sizeof(struct pptp_out_call_rqst): \
+(type==PPTP_OUT_CALL_RPLY )?sizeof(struct pptp_out_call_rply): \
+(type==PPTP_IN_CALL_RQST )?sizeof(struct pptp_in_call_rqst): \
+(type==PPTP_IN_CALL_RPLY )?sizeof(struct pptp_in_call_rply): \
+(type==PPTP_IN_CALL_CONNECT )?sizeof(struct pptp_in_call_connect): \
+(type==PPTP_CALL_CLEAR_RQST )?sizeof(struct pptp_call_clear_rqst): \
+(type==PPTP_CALL_CLEAR_NTFY )?sizeof(struct pptp_call_clear_ntfy): \
+(type==PPTP_WAN_ERR_NTFY )?sizeof(struct pptp_wan_err_ntfy): \
+(type==PPTP_SET_LINK_INFO )?sizeof(struct pptp_set_link_info): \
+0)
+#define max(a,b) (((a)>(b))?(a):(b))
+#define PPTP_CTRL_SIZE_MAX ( \
+max(sizeof(struct pptp_start_ctrl_conn), \
+max(sizeof(struct pptp_echo_rqst), \
+max(sizeof(struct pptp_echo_rply), \
+max(sizeof(struct pptp_out_call_rqst), \
+max(sizeof(struct pptp_out_call_rply), \
+max(sizeof(struct pptp_in_call_rqst), \
+max(sizeof(struct pptp_in_call_rply), \
+max(sizeof(struct pptp_in_call_connect), \
+max(sizeof(struct pptp_call_clear_rqst), \
+max(sizeof(struct pptp_call_clear_ntfy), \
+max(sizeof(struct pptp_wan_err_ntfy), \
+max(sizeof(struct pptp_set_link_info), 0)))))))))))))
+
+#endif
diff --git a/accel-pptpd/extra/CMakeLists.txt b/accel-pptpd/extra/CMakeLists.txt
new file mode 100644
index 0000000..a14a5a3
--- /dev/null
+++ b/accel-pptpd/extra/CMakeLists.txt
@@ -0,0 +1,8 @@
+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
+)
+
diff --git a/accel-pptpd/extra/ippool.c b/accel-pptpd/extra/ippool.c
new file mode 100644
index 0000000..5f90fe8
--- /dev/null
+++ b/accel-pptpd/extra/ippool.c
@@ -0,0 +1,208 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+#include "ipdb.h"
+#include "list.h"
+#include "spinlock.h"
+
+#include "memdebug.h"
+
+struct ippool_item_t
+{
+ struct list_head entry;
+ struct ipdb_item_t it;
+};
+
+struct ipaddr_t
+{
+ struct list_head entry;
+ in_addr_t addr;
+};
+
+static LIST_HEAD(gw_list);
+static LIST_HEAD(tunnel_list);
+static LIST_HEAD(ippool);
+static spinlock_t pool_lock = SPINLOCK_INITIALIZER;
+static struct ipdb_t ipdb;
+
+static in_addr_t conf_gw_ip_address;
+static int cnt;
+
+static void parse_gw_ip_address(const char *val)
+{
+ if (!val)
+ return;
+
+ conf_gw_ip_address = inet_addr(val);
+}
+
+//parses ranges like x.x.x.x/mask
+static int parse1(const char *str, uint32_t *begin, uint32_t *end)
+{
+ int n, f1, f2, f3, f4, m, mask = 0;
+
+ n = sscanf(str, "%u.%u.%u.%u/%u",&f1, &f2, &f3, &f4, &m);
+ if (n != 5)
+ return -1;
+ if (f1 > 255)
+ return -1;
+ if (f1 > 255)
+ return -1;
+ if (f1 > 255)
+ return -1;
+ if (f1 > 255)
+ return -1;
+ if (m == 0 || m > 32)
+ return -1;
+
+ for (n = 0; n < m ; n++)
+ mask |= 1 << n;
+
+ *begin = (f4 << 24) | (f3 << 16) | (f2 << 8) | f1;
+ *end = *begin | ~mask;
+
+ return 0;
+}
+
+//parses ranges like x.x.x.x-y
+static int parse2(const char *str, uint32_t *begin, uint32_t *end)
+{
+ int n, f1, f2, f3, f4, m;
+
+ n = sscanf(str, "%u.%u.%u.%u-%u",&f1, &f2, &f3, &f4, &m);
+ if (n != 5)
+ return -1;
+ if (f1 > 255)
+ return -1;
+ if (f2 > 255)
+ return -1;
+ if (f3 > 255)
+ return -1;
+ if (f4 > 255)
+ return -1;
+ if (m < f4 || m > 255)
+ return -1;
+
+ *begin = (f4 << 24) | (f3 << 16) | (f2 << 8) | f1;
+ *end = (m << 24) | (f3 << 16) | (f2 << 8) | f1;
+
+ return 0;
+}
+
+static void add_range(struct list_head *list, const char *name)
+{
+ uint32_t i,startip, endip;
+ struct ipaddr_t *ip;
+
+ if (parse1(name, &startip, &endip))
+ if (parse2(name, &startip, &endip)) {
+ fprintf(stderr, "ippool: cann't parse '%s'\n", name);
+ _exit(EXIT_FAILURE);
+ }
+
+ for (i = ntohl(startip); i <= ntohl(endip); i++) {
+ ip = malloc(sizeof(*ip));
+ ip->addr = htonl(i);
+ list_add_tail(&ip->entry, list);
+ cnt++;
+ }
+}
+
+static void generate_pool(void)
+{
+ struct ippool_item_t *it;
+ struct ipaddr_t *addr = NULL;
+ struct ipaddr_t *peer_addr;
+
+ while (1) {
+ if (list_empty(&tunnel_list))
+ break;
+ else {
+ peer_addr = list_entry(tunnel_list.next, typeof(*peer_addr), entry);
+ list_del(&peer_addr->entry);
+ }
+
+ if (!conf_gw_ip_address) {
+ if (list_empty(&gw_list))
+ break;
+ else {
+ addr = list_entry(gw_list.next, typeof(*addr), entry);
+ list_del(&addr->entry);
+ }
+ }
+
+ it = malloc(sizeof(*it));
+ if (!it) {
+ fprintf(stderr, "ippool: out of memory\n");
+ break;
+ }
+
+ it->it.owner = &ipdb;
+ if (conf_gw_ip_address)
+ it->it.addr = conf_gw_ip_address;
+ else
+ it->it.addr = addr->addr;
+
+ it->it.peer_addr = peer_addr->addr;
+
+ list_add_tail(&it->entry, &ippool);
+ }
+}
+
+static struct ipdb_item_t *get_ip(struct ppp_t *ppp)
+{
+ struct ippool_item_t *it;
+
+ spin_lock(&pool_lock);
+ if (!list_empty(&ippool)) {
+ it = list_entry(ippool.next, typeof(*it), entry);
+ list_del(&it->entry);
+ } else
+ it = NULL;
+ spin_unlock(&pool_lock);
+
+ return it ? &it->it : NULL;
+}
+
+static void put_ip(struct ppp_t *ppp, struct ipdb_item_t *it)
+{
+ struct ippool_item_t *pit = container_of(it, typeof(*pit), it);
+
+ spin_lock(&pool_lock);
+ list_add_tail(&pit->entry, &ippool);
+ spin_unlock(&pool_lock);
+}
+
+static struct ipdb_t ipdb = {
+ .get = get_ip,
+ .put = put_ip,
+};
+
+static void __init ipool_init(void)
+{
+ struct conf_sect_t *s = conf_get_section("ip-pool");
+ struct conf_option_t *opt;
+
+ if (!s)
+ return;
+
+ list_for_each_entry(opt, &s->items, entry) {
+ if (!strcmp(opt->name, "gw-ip-address"))
+ parse_gw_ip_address(opt->val);
+ else if (!strcmp(opt->name, "gw"))
+ add_range(&gw_list, opt->val);
+ else if (!strcmp(opt->name, "tunnel"))
+ add_range(&tunnel_list, opt->val);
+ else if (!opt->val)
+ add_range(&tunnel_list, opt->name);
+ }
+
+ generate_pool();
+
+ ipdb_register(&ipdb);
+}
+
diff --git a/accel-pptpd/extra/pppd_compat.c b/accel-pptpd/extra/pppd_compat.c
new file mode 100644
index 0000000..8dd3502
--- /dev/null
+++ b/accel-pptpd/extra/pppd_compat.c
@@ -0,0 +1,379 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+#include <sched.h>
+#include <limits.h>
+
+#include "triton.h"
+
+#include "events.h"
+#include "ppp.h"
+#include "log.h"
+#include "radius.h"
+#include "utils.h"
+#include "sigchld.h"
+
+#include "memdebug.h"
+
+static char *conf_ip_up = "/etc/ppp/ip-up";
+static char *conf_ip_down = "/etc/ppp/ip-down";
+static char *conf_ip_change = "/etc/ppp/ip-change";
+static char *conf_radattr_prefix = "/var/run/radattr.";
+static int conf_verbose = 0;
+
+static void *pd_key;
+
+struct pppd_compat_pd_t
+{
+ struct ppp_pd_t pd;
+ struct ppp_t *ppp;
+ struct sigchld_handler_t ip_up_hnd;
+ struct sigchld_handler_t ip_change_hnd;
+ struct sigchld_handler_t ip_down_hnd;
+ int radattr_saved:1;
+ int started:1;
+ int ip_change_res;
+};
+
+static void remove_radattr(struct ppp_t *ppp);
+static struct pppd_compat_pd_t *find_pd(struct ppp_t *ppp);
+static void fill_argv(char **argv, struct ppp_t *ppp, char *path);
+static void write_radattr(struct ppp_t *ppp, struct rad_packet_t *pack, int save_old);
+
+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_info("pppd_compat: ip-up finished (%i)\n", status);
+ }
+}
+
+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_info("pppd_compat: ip-down finished (%i)\n", status);
+ }
+ sched_yield();
+ triton_context_wakeup(pd->ppp->ctrl->ctx);
+}
+
+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_info("pppd_compat: ip-change finished (%i)\n", status);
+ }
+ sched_yield();
+ pd->ip_change_res = status;
+ triton_context_wakeup(pd->ppp->ctrl->ctx);
+}
+
+static void ev_ppp_starting(struct ppp_t *ppp)
+{
+ struct pppd_compat_pd_t *pd = _malloc(sizeof(*pd));
+
+ if (!pd) {
+ log_emerg("pppd_compat: out of memory\n");
+ return;
+ }
+
+ memset(pd, 0, sizeof(*pd));
+ pd->pd.key = &pd_key;
+ pd->ppp = ppp;
+ pd->ip_up_hnd.handler = ip_up_handler;
+ pd->ip_down_hnd.handler = ip_down_handler;
+ pd->ip_change_hnd.handler = ip_change_handler;
+ list_add_tail(&pd->pd.entry, &ppp->pd_list);
+}
+static void ev_ppp_started(struct ppp_t *ppp)
+{
+ pid_t pid;
+ char *argv[8];
+ char ipaddr[16];
+ char peer_ipaddr[16];
+ struct pppd_compat_pd_t *pd = find_pd(ppp);
+
+ if (!pd)
+ return;
+
+ argv[4] = ipaddr;
+ argv[5] = peer_ipaddr;
+ fill_argv(argv, ppp, conf_ip_up);
+
+ sigchld_lock();
+ pid = fork();
+ if (pid > 0) {
+ pd->ip_up_hnd.pid = pid;
+ sigchld_register_handler(&pd->ip_up_hnd);
+ if (conf_verbose)
+ log_ppp_info("pppd_compat: ip-up started (pid %i)\n", pid);
+ sigchld_unlock();
+ } else if (pid == 0) {
+ execv(conf_ip_up, argv);
+ log_emerg("pppd_compat: exec '%s': %s\n", conf_ip_up, strerror(errno));
+ _exit(EXIT_FAILURE);
+ } else
+ log_error("pppd_compat: fork: %s\n", strerror(errno));
+
+ pd->started = 1;
+}
+
+static void ev_ppp_finished(struct ppp_t *ppp)
+{
+ pid_t pid;
+ char *argv[8];
+ char ipaddr[16];
+ char peer_ipaddr[16];
+ struct pppd_compat_pd_t *pd = find_pd(ppp);
+
+ if (!pd)
+ return;
+
+ if (!pd->started)
+ goto skip;
+
+ pthread_mutex_lock(&pd->ip_up_hnd.lock);
+ if (pd->ip_up_hnd.pid) {
+ log_ppp_warn("pppd_compat: ip-up is not yet finished, terminating it ...\n");
+ kill(pd->ip_up_hnd.pid, SIGTERM);
+ }
+ pthread_mutex_unlock(&pd->ip_up_hnd.lock);
+
+ argv[4] = ipaddr;
+ argv[5] = peer_ipaddr;
+ fill_argv(argv, pd->ppp, conf_ip_down);
+
+ sigchld_lock();
+ pid = fork();
+ if (pid > 0) {
+ pd->ip_down_hnd.pid = pid;
+ sigchld_register_handler(&pd->ip_down_hnd);
+ if (conf_verbose)
+ 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);
+ pthread_mutex_unlock(&pd->ip_down_hnd.lock);
+ } else if (pid == 0) {
+ execv(conf_ip_down, argv);
+ log_emerg("pppd_compat: exec '%s': %s\n", conf_ip_change, strerror(errno));
+ _exit(EXIT_FAILURE);
+ } else
+ log_error("pppd_compat: fork: %s\n", strerror(errno));
+
+ pthread_mutex_lock(&pd->ip_up_hnd.lock);
+ if (pd->ip_up_hnd.pid) {
+ log_ppp_warn("pppd_compat: ip-up is not yet finished, killing it ...\n");
+ kill(pd->ip_up_hnd.pid, SIGKILL);
+ pthread_mutex_unlock(&pd->ip_up_hnd.lock);
+ sigchld_unregister_handler(&pd->ip_up_hnd);
+ } else
+ pthread_mutex_unlock(&pd->ip_up_hnd.lock);
+
+skip:
+ if (pd->radattr_saved)
+ remove_radattr(ppp);
+
+ list_del(&pd->pd.entry);
+ _free(pd);
+}
+
+static void ev_radius_access_accept(struct ev_radius_t *ev)
+{
+ struct pppd_compat_pd_t *pd = find_pd(ev->ppp);
+
+ write_radattr(ev->ppp, ev->reply, 0);
+
+ pd->radattr_saved = 1;
+}
+
+static void ev_radius_coa(struct ev_radius_t *ev)
+{
+ pid_t pid;
+ char *argv[8];
+ char ipaddr[16];
+ char peer_ipaddr[16];
+ struct pppd_compat_pd_t *pd = find_pd(ev->ppp);
+
+ if (!pd)
+ return;
+
+ write_radattr(ev->ppp, ev->request, 1);
+
+ argv[4] = ipaddr;
+ argv[5] = peer_ipaddr;
+ fill_argv(argv, pd->ppp, conf_ip_change);
+
+ sigchld_lock();
+ pid = fork();
+ if (pid > 0) {
+ pd->ip_change_hnd.pid = pid;
+ sigchld_register_handler(&pd->ip_change_hnd);
+ sigchld_unlock();
+ if (conf_verbose)
+ log_ppp_debug("pppd_compat: ip-change started (pid %i)\n", pid);
+ triton_context_schedule(pd->ppp->ctrl->ctx);
+ if (!ev->res)
+ ev->res = pd->ip_change_res;
+ } else if (pid == 0) {
+ execv(conf_ip_change, argv);
+ log_emerg("pppd_compat: exec '%s': %s\n", conf_ip_change, strerror(errno));
+ _exit(EXIT_FAILURE);
+ } else
+ log_error("pppd_compat: fork: %s\n", strerror(errno));
+}
+
+static void remove_radattr(struct ppp_t *ppp)
+{
+ char *fname;
+
+ fname = _malloc(PATH_MAX);
+ if (!fname) {
+ log_emerg("pppd_compat: out of memory\n");
+ return;
+ }
+
+ sprintf(fname, "%s.%s", conf_radattr_prefix, ppp->ifname);
+ if (unlink(fname)) {
+ log_ppp_warn("pppd_compat: failed to remove '%s': %s\n", fname, strerror(errno));
+ }
+ sprintf(fname, "%s_old.%s", conf_radattr_prefix, ppp->ifname);
+ unlink(fname);
+
+ _free(fname);
+}
+
+static void write_radattr(struct ppp_t *ppp, struct rad_packet_t *pack, int save_old)
+{
+ struct rad_attr_t *attr;
+ struct rad_dict_value_t *val;
+ FILE *f;
+ char *fname1, *fname2;
+ int i;
+
+ fname1 = _malloc(PATH_MAX);
+ if (!fname1) {
+ log_emerg("pppd_compat: out of memory\n");
+ return;
+ }
+
+ if (save_old) {
+ fname2 = _malloc(PATH_MAX);
+ if (!fname2) {
+ log_emerg("pppd_compat: out of memory\n");
+ _free(fname1);
+ return;
+ }
+ }
+
+ sprintf(fname1, "%s.%s", conf_radattr_prefix, ppp->ifname);
+ if (save_old) {
+ sprintf(fname2, "%s_old.%s", conf_radattr_prefix, ppp->ifname);
+ if (rename(fname1, fname2)) {
+ log_ppp_warn("pppd_compat: rename: %s\n", strerror(errno));
+ }
+ }
+
+ f = fopen(fname1, "w");
+ if (f) {
+ list_for_each_entry(attr, &pack->attrs, entry) {
+ fprintf(f, "%s ", attr->attr->name);
+ switch (attr->attr->type) {
+ case ATTR_TYPE_INTEGER:
+ val = rad_dict_find_val(attr->attr, attr->val);
+ if (val)
+ fprintf(f, "%s\n", val->name);
+ else
+ fprintf(f, "%i\n", attr->val.integer);
+ break;
+ case ATTR_TYPE_STRING:
+ fprintf(f, "%s\n", attr->val.string);
+ break;
+ case ATTR_TYPE_OCTETS:
+ for (i = 0; i < attr->len; i++)
+ fprintf(f, "%02X", attr->val.octets[i]);
+ fprintf(f, "\n");
+ break;
+ case ATTR_TYPE_IPADDR:
+ fprintf(f, "%i.%i.%i.%i\n", attr->val.ipaddr & 0xff, (attr->val.ipaddr >> 8) & 0xff, (attr->val.ipaddr >> 16) & 0xff, (attr->val.ipaddr >> 24) & 0xff);
+ break;
+ case ATTR_TYPE_DATE:
+ fprintf(f, "%lu\n", attr->val.date);
+ break;
+ }
+ }
+ fclose(f);
+ } else
+ log_ppp_warn("pppd_compat: failed to create '%s': %s\n", fname1, strerror(errno));
+
+ _free(fname1);
+ if (save_old)
+ _free(fname2);
+}
+
+static struct pppd_compat_pd_t *find_pd(struct ppp_t *ppp)
+{
+ struct ppp_pd_t *pd;
+ struct pppd_compat_pd_t *cpd;
+
+ list_for_each_entry(pd, &ppp->pd_list, entry) {
+ if (pd->key == &pd_key) {
+ cpd = container_of(pd, typeof(*cpd), pd);
+ return cpd;
+ }
+ }
+
+ log_ppp_warn("pppd_compat: pd not found\n");
+ return NULL;
+}
+
+static void fill_argv(char **argv, struct ppp_t *ppp, char *path)
+{
+ argv[0] = path;
+ argv[1] = ppp->ifname;
+ argv[2] = "none";
+ argv[3] = "0";
+ u_inet_ntoa(ppp->ipaddr, argv[4]);
+ u_inet_ntoa(ppp->peer_ipaddr, argv[5]);
+ argv[6] = "none";
+ argv[7] = NULL;
+}
+
+static void __init init(void)
+{
+ char *opt;
+
+ opt = conf_get_opt("pppd-compat", "ip-up");
+ if (opt)
+ conf_ip_up = opt;
+
+ opt = conf_get_opt("pppd-compat", "ip-down");
+ if (opt)
+ conf_ip_down = opt;
+
+ opt = conf_get_opt("pppd-compat", "ip-change");
+ if (opt)
+ conf_ip_change = opt;
+
+ opt = conf_get_opt("pppd-compat", "radattr-prefix");
+ if (opt)
+ conf_radattr_prefix = opt;
+
+ opt = conf_get_opt("pppd-compat", "verbose");
+ if (opt && atoi(opt) > 0)
+ conf_verbose = 1;
+
+ triton_event_register_handler(EV_PPP_STARTING, (triton_event_func)ev_ppp_starting);
+ triton_event_register_handler(EV_PPP_STARTED, (triton_event_func)ev_ppp_started);
+ triton_event_register_handler(EV_PPP_FINISHED, (triton_event_func)ev_ppp_finished);
+ triton_event_register_handler(EV_RADIUS_ACCESS_ACCEPT, (triton_event_func)ev_radius_access_accept);
+ triton_event_register_handler(EV_RADIUS_COA, (triton_event_func)ev_radius_coa);
+}
+
diff --git a/accel-pptpd/extra/sigchld.c b/accel-pptpd/extra/sigchld.c
new file mode 100644
index 0000000..49bcfd4
--- /dev/null
+++ b/accel-pptpd/extra/sigchld.c
@@ -0,0 +1,117 @@
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/signalfd.h>
+#include <sys/wait.h>
+
+#include "triton.h"
+#include "spinlock.h"
+#include "log.h"
+
+#include "sigchld.h"
+
+#include "memdebug.h"
+
+static LIST_HEAD(handlers);
+static int lock_refs;
+static pthread_mutex_t handlers_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t refs_cond = PTHREAD_COND_INITIALIZER;
+static pthread_t sigchld_thr;
+
+static void* sigchld_thread(void *arg)
+{
+ sigset_t set;
+ struct sigchld_handler_t *h, *h0;
+ pid_t pid;
+ int status, sig;
+
+ sigfillset(&set);
+ sigdelset(&set, SIGKILL);
+ sigdelset(&set, SIGSTOP);
+ pthread_sigmask(SIG_BLOCK, &set, NULL);
+
+ sigemptyset(&set);
+ sigaddset(&set, SIGCHLD);
+ sigaddset(&set, SIGQUIT);
+
+ while (1) {
+ pid = waitpid(0, &status, 0);
+ if (pid < 0) {
+ if (errno == EINTR)
+ continue;
+ if (errno == ECHILD) {
+ sigwait(&set, &sig);
+ if (sig == SIGQUIT)
+ break;
+ continue;
+ }
+ log_error("sigchld: waitpid: %s\n", strerror(errno));
+ continue;
+ }
+
+ pthread_mutex_lock(&handlers_lock);
+ while (lock_refs)
+ pthread_cond_wait(&refs_cond, &handlers_lock);
+
+ h0 = NULL;
+ list_for_each_entry(h, &handlers, entry) {
+ if (h->pid == pid) {
+ h0 = h;
+ pthread_mutex_lock(&h0->lock);
+ break;
+ }
+ }
+ pthread_mutex_unlock(&handlers_lock);
+ if (h0) {
+ list_del(&h0->entry);
+ h0->handler(h0, WEXITSTATUS(status));
+ h0->pid = 0;
+ pthread_mutex_unlock(&h0->lock);
+ }
+ }
+
+ return NULL;
+}
+
+void __export sigchld_register_handler(struct sigchld_handler_t *h)
+{
+ pthread_mutex_init(&h->lock, NULL);
+
+ pthread_mutex_lock(&handlers_lock);
+ list_add_tail(&h->entry, &handlers);
+ pthread_mutex_unlock(&handlers_lock);
+}
+
+void __export sigchld_unregister_handler(struct sigchld_handler_t *h)
+{
+ pthread_mutex_lock(&handlers_lock);
+ pthread_mutex_lock(&h->lock);
+ if (h->pid) {
+ list_del(&h->entry);
+ h->pid = 0;
+ }
+ pthread_mutex_unlock(&h->lock);
+ pthread_mutex_unlock(&handlers_lock);
+}
+
+void __export sigchld_lock()
+{
+ pthread_mutex_lock(&handlers_lock);
+ ++lock_refs;
+ pthread_mutex_unlock(&handlers_lock);
+}
+
+void __export sigchld_unlock()
+{
+ pthread_mutex_lock(&handlers_lock);
+ if (--lock_refs == 0)
+ pthread_cond_signal(&refs_cond);
+ pthread_mutex_unlock(&handlers_lock);
+}
+
+static void __init init(void)
+{
+ if (pthread_create(&sigchld_thr, NULL, sigchld_thread, NULL))
+ log_emerg("sigchld: pthread_create: %s\n", strerror(errno));
+}
diff --git a/accel-pptpd/extra/sigchld.h b/accel-pptpd/extra/sigchld.h
new file mode 100644
index 0000000..27d1adf
--- /dev/null
+++ b/accel-pptpd/extra/sigchld.h
@@ -0,0 +1,21 @@
+#ifndef __SIGCHLD_H
+#define __SIGCHLD_H
+
+#include <pthread.h>
+#include "list.h"
+
+struct sigchld_handler_t
+{
+ struct list_head entry;
+ pthread_mutex_t lock;
+ pid_t pid;
+ void (*handler)(struct sigchld_handler_t *, int status);
+};
+
+void sigchld_register_handler(struct sigchld_handler_t *);
+void sigchld_unregister_handler(struct sigchld_handler_t *);
+void sigchld_lock();
+void sigchld_unlock();
+
+#endif
+
diff --git a/accel-pptpd/include/events.h b/accel-pptpd/include/events.h
new file mode 100644
index 0000000..2f4c4e5
--- /dev/null
+++ b/accel-pptpd/include/events.h
@@ -0,0 +1,38 @@
+#ifndef __EVENTS_H
+#define __EVENTS_H
+
+#define EV_PPP_STARTING 1
+#define EV_PPP_STARTED 2
+#define EV_PPP_FINISHING 3
+#define EV_PPP_FINISHED 4
+#define EV_PPP_AUTHORIZED 5
+#define EV_CTRL_STARTING 6
+#define EV_CTRL_STARTED 7
+#define EV_CTRL_FINISHED 8
+#define EV_IP_CHANGED 100
+#define EV_SHAPE_CHANGED 101
+#define EV_MPPE_KEYS 102
+#define EV_RADIUS_ACCESS_ACCEPT 200
+#define EV_RADIUS_COA 201
+
+struct ppp_t;
+struct rad_packet_t;
+struct ev_radius_t
+{
+ struct ppp_t *ppp;
+ struct rad_packet_t *request;
+ struct rad_packet_t *reply;
+ int res;
+};
+
+struct ev_mppe_keys_t
+{
+ struct ppp_t *ppp;
+ uint8_t *recv_key;
+ uint8_t *send_key;
+ int policy;
+ int type;
+};
+
+#endif
+
diff --git a/accel-pptpd/include/if_pppox.h b/accel-pptpd/include/if_pppox.h
new file mode 100644
index 0000000..da327a1
--- /dev/null
+++ b/accel-pptpd/include/if_pppox.h
@@ -0,0 +1,227 @@
+/***************************************************************************
+ * Linux PPP over X - Generic PPP transport layer sockets
+ * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516)
+ *
+ * This file supplies definitions required by the PPP over Ethernet driver
+ * (pppox.c). All version information wrt this file is located in pppox.c
+ *
+ * License:
+ * 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.
+ *
+ */
+
+#ifndef __LINUX_IF_PPPOX_H
+#define __LINUX_IF_PPPOX_H
+
+
+#include <asm/types.h>
+#include <asm/byteorder.h>
+#include <linux/version.h>
+
+#ifdef __KERNEL__
+#include <linux/in.h>
+#include <linux/if_ether.h>
+#include <linux/if.h>
+#include <linux/netdevice.h>
+#include <linux/ppp_channel.h>
+#endif /* __KERNEL__ */
+
+/* For user-space programs to pick up these definitions
+ * which they wouldn't get otherwise without defining __KERNEL__
+ */
+#ifndef AF_PPPOX
+#define AF_PPPOX 24
+#define PF_PPPOX AF_PPPOX
+#endif /* !(AF_PPPOX) */
+
+struct pptp_addr{
+ __u16 call_id;
+ struct in_addr sin_addr;
+};
+/************************************************************************
+ * Protocols supported by AF_PPPOX
+ */
+#define PX_PROTO_OE 0 /* Currently just PPPoE */
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22)
+#define PX_PROTO_PPTP 1
+#define PX_MAX_PROTO 2
+#else
+#define PX_PROTO_PPTP 2
+#define PX_MAX_PROTO 3
+#endif
+
+struct sockaddr_pppox {
+ sa_family_t sa_family; /* address family, AF_PPPOX */
+ unsigned int sa_protocol; /* protocol identifier */
+ union{
+ struct pptp_addr pptp;
+ }sa_addr;
+}__attribute__ ((packed));
+
+
+/*********************************************************************
+ *
+ * ioctl interface for defining forwarding of connections
+ *
+ ********************************************************************/
+
+#define PPPOEIOCSFWD _IOW(0xB1 ,0, size_t)
+#define PPPOEIOCDFWD _IO(0xB1 ,1)
+/*#define PPPOEIOCGFWD _IOWR(0xB1,2, size_t)*/
+
+/* Codes to identify message types */
+#define PADI_CODE 0x09
+#define PADO_CODE 0x07
+#define PADR_CODE 0x19
+#define PADS_CODE 0x65
+#define PADT_CODE 0xa7
+struct pppoe_tag {
+ __u16 tag_type;
+ __u16 tag_len;
+ char tag_data[0];
+} __attribute ((packed));
+
+/* Tag identifiers */
+#define PTT_EOL __constant_htons(0x0000)
+#define PTT_SRV_NAME __constant_htons(0x0101)
+#define PTT_AC_NAME __constant_htons(0x0102)
+#define PTT_HOST_UNIQ __constant_htons(0x0103)
+#define PTT_AC_COOKIE __constant_htons(0x0104)
+#define PTT_VENDOR __constant_htons(0x0105)
+#define PTT_RELAY_SID __constant_htons(0x0110)
+#define PTT_SRV_ERR __constant_htons(0x0201)
+#define PTT_SYS_ERR __constant_htons(0x0202)
+#define PTT_GEN_ERR __constant_htons(0x0203)
+
+struct pppoe_hdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 ver : 4;
+ __u8 type : 4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 type : 4;
+ __u8 ver : 4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 code;
+ __u16 sid;
+ __u16 length;
+ struct pppoe_tag tag[0];
+} __attribute__ ((packed));
+
+
+/* Socket options */
+#define PPTP_SO_TIMEOUT 1
+
+
+#ifdef __KERNEL__
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+struct pppoe_opt {
+ struct net_device *dev; /* device associated with socket*/
+ struct pppoe_addr pa; /* what this socket is bound to*/
+ struct sockaddr_pppox relay; /* what socket data will be
+ relayed to (PPPoE relaying) */
+};
+#endif
+struct pptp_opt {
+ struct pptp_addr src_addr;
+ struct pptp_addr dst_addr;
+ int timeout;
+ __u32 ack_sent, ack_recv;
+ __u32 seq_sent, seq_recv;
+ int ppp_flags;
+ int flags;
+ struct sk_buff_head skb_buf;
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ struct tq_struct buf_work; //check bufferd packets work
+ struct timer_list buf_timer;
+ #else
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+ struct delayed_work buf_work; //check bufferd packets work
+ #else
+ struct work_struct buf_work; //check bufferd packets work
+ #endif
+ #endif
+ struct gre_statistics *stat;
+ spinlock_t xmit_lock;
+ spinlock_t rcv_lock;
+};
+#define PPTP_FLAG_PAUSE 0
+#define PPTP_FLAG_PROC 1
+
+#include <net/sock.h>
+
+struct pppox_sock {
+ /* struct sock must be the first member of pppox_sock */
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ struct ppp_channel chan;
+ struct sock *sk;
+ #else
+ struct sock sk;
+ struct ppp_channel chan;
+ #endif
+ struct pppox_sock *next; /* for hash table */
+ union {
+ struct pppoe_opt pppoe;
+ struct pptp_opt pptp;
+ } proto;
+ unsigned short num;
+};
+#define pppoe_dev proto.pppoe.dev
+#define pppoe_pa proto.pppoe.pa
+#define pppoe_relay proto.pppoe.relay
+
+static inline struct pppox_sock *pppox_sk(struct sock *sk)
+{
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ return (struct pppox_sock *)sk->protinfo.pppox;
+ #else
+ return (struct pppox_sock *)sk;
+ #endif
+}
+
+static inline struct sock *sk_pppox(struct pppox_sock *po)
+{
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ return po->sk;
+ #else
+ return (struct sock *)po;
+ #endif
+}
+
+struct module;
+
+struct pppox_proto {
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+ int (*create)(struct socket *sock);
+ #else
+ int (*create)(struct net *net, struct socket *sock);
+ #endif
+ int (*ioctl)(struct socket *sock, unsigned int cmd,
+ unsigned long arg);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
+ struct module *owner;
+ #endif
+};
+
+extern int register_pppox_proto(int proto_num, struct pppox_proto *pp);
+extern void unregister_pppox_proto(int proto_num);
+extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
+extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
+
+/* PPPoX socket states */
+enum {
+ PPPOX_NONE = 0, /* initial state */
+ PPPOX_CONNECTED = 1, /* connection established ==TCP_ESTABLISHED */
+ PPPOX_BOUND = 2, /* bound to ppp device */
+ PPPOX_RELAY = 4, /* forwarding is enabled */
+ PPPOX_ZOMBIE = 8, /* dead, but still bound to ppp device */
+ PPPOX_DEAD = 16 /* dead, useless, please clean me up!*/
+};
+
+#endif /* __KERNEL__ */
+
+#endif /* !(__LINUX_IF_PPPOX_H) */
diff --git a/accel-pptpd/include/ipdb.h b/accel-pptpd/include/ipdb.h
new file mode 120000
index 0000000..77ab85b
--- /dev/null
+++ b/accel-pptpd/include/ipdb.h
@@ -0,0 +1 @@
+../ipdb.h \ No newline at end of file
diff --git a/accel-pptpd/include/iprange.h b/accel-pptpd/include/iprange.h
new file mode 120000
index 0000000..b8c2c43
--- /dev/null
+++ b/accel-pptpd/include/iprange.h
@@ -0,0 +1 @@
+../iprange.h \ No newline at end of file
diff --git a/accel-pptpd/include/list.h b/accel-pptpd/include/list.h
new file mode 120000
index 0000000..4b6d9a9
--- /dev/null
+++ b/accel-pptpd/include/list.h
@@ -0,0 +1 @@
+../triton/list.h \ No newline at end of file
diff --git a/accel-pptpd/include/log.h b/accel-pptpd/include/log.h
new file mode 120000
index 0000000..49a04dd
--- /dev/null
+++ b/accel-pptpd/include/log.h
@@ -0,0 +1 @@
+../log.h \ No newline at end of file
diff --git a/accel-pptpd/include/memdebug.h b/accel-pptpd/include/memdebug.h
new file mode 120000
index 0000000..3ee61bc
--- /dev/null
+++ b/accel-pptpd/include/memdebug.h
@@ -0,0 +1 @@
+../memdebug.h \ No newline at end of file
diff --git a/accel-pptpd/include/mempool.h b/accel-pptpd/include/mempool.h
new file mode 120000
index 0000000..2637ab6
--- /dev/null
+++ b/accel-pptpd/include/mempool.h
@@ -0,0 +1 @@
+../triton/mempool.h \ No newline at end of file
diff --git a/accel-pptpd/include/ppp.h b/accel-pptpd/include/ppp.h
new file mode 120000
index 0000000..ae3fa2e
--- /dev/null
+++ b/accel-pptpd/include/ppp.h
@@ -0,0 +1 @@
+../ppp/ppp.h \ No newline at end of file
diff --git a/accel-pptpd/include/ppp_auth.h b/accel-pptpd/include/ppp_auth.h
new file mode 120000
index 0000000..527c853
--- /dev/null
+++ b/accel-pptpd/include/ppp_auth.h
@@ -0,0 +1 @@
+../ppp/ppp_auth.h \ No newline at end of file
diff --git a/accel-pptpd/include/ppp_fsm.h b/accel-pptpd/include/ppp_fsm.h
new file mode 120000
index 0000000..5c6b7f4
--- /dev/null
+++ b/accel-pptpd/include/ppp_fsm.h
@@ -0,0 +1 @@
+../ppp/ppp_fsm.h \ No newline at end of file
diff --git a/accel-pptpd/include/ppp_lcp.h b/accel-pptpd/include/ppp_lcp.h
new file mode 120000
index 0000000..4902752
--- /dev/null
+++ b/accel-pptpd/include/ppp_lcp.h
@@ -0,0 +1 @@
+../ppp/ppp_lcp.h \ No newline at end of file
diff --git a/accel-pptpd/include/pwdb.h b/accel-pptpd/include/pwdb.h
new file mode 120000
index 0000000..360efe4
--- /dev/null
+++ b/accel-pptpd/include/pwdb.h
@@ -0,0 +1 @@
+../pwdb.h \ No newline at end of file
diff --git a/accel-pptpd/include/radius.h b/accel-pptpd/include/radius.h
new file mode 120000
index 0000000..e1465f1
--- /dev/null
+++ b/accel-pptpd/include/radius.h
@@ -0,0 +1 @@
+../radius/radius.h \ No newline at end of file
diff --git a/accel-pptpd/include/sigchld.h b/accel-pptpd/include/sigchld.h
new file mode 120000
index 0000000..9b74ebd
--- /dev/null
+++ b/accel-pptpd/include/sigchld.h
@@ -0,0 +1 @@
+../extra/sigchld.h \ No newline at end of file
diff --git a/accel-pptpd/include/spinlock.h b/accel-pptpd/include/spinlock.h
new file mode 120000
index 0000000..09edcf6
--- /dev/null
+++ b/accel-pptpd/include/spinlock.h
@@ -0,0 +1 @@
+../triton/spinlock.h \ No newline at end of file
diff --git a/accel-pptpd/include/triton.h b/accel-pptpd/include/triton.h
new file mode 120000
index 0000000..6f35a2f
--- /dev/null
+++ b/accel-pptpd/include/triton.h
@@ -0,0 +1 @@
+../triton/triton.h \ No newline at end of file
diff --git a/accel-pptpd/include/utils.h b/accel-pptpd/include/utils.h
new file mode 120000
index 0000000..6cd5d4f
--- /dev/null
+++ b/accel-pptpd/include/utils.h
@@ -0,0 +1 @@
+../utils.h \ No newline at end of file
diff --git a/accel-pptpd/ipdb.c b/accel-pptpd/ipdb.c
new file mode 100644
index 0000000..a08d3be
--- /dev/null
+++ b/accel-pptpd/ipdb.c
@@ -0,0 +1,31 @@
+#include "triton.h"
+#include "ipdb.h"
+
+#include "memdebug.h"
+
+static LIST_HEAD(ipdb_handlers);
+
+__export struct ipdb_item_t *ipdb_get(struct ppp_t *ppp)
+{
+ struct ipdb_t *ipdb;
+ struct ipdb_item_t *it;
+
+ list_for_each_entry(ipdb, &ipdb_handlers, entry) {
+ it = ipdb->get(ppp);
+ if (it)
+ return it;
+ }
+
+ return NULL;
+}
+
+void __export ipdb_put(struct ppp_t *ppp, struct ipdb_item_t *it)
+{
+ if (it->owner->put)
+ it->owner->put(ppp, it);
+}
+
+void __export ipdb_register(struct ipdb_t *ipdb)
+{
+ list_add_tail(&ipdb->entry, &ipdb_handlers);
+}
diff --git a/accel-pptpd/ipdb.h b/accel-pptpd/ipdb.h
new file mode 100644
index 0000000..ebf3885
--- /dev/null
+++ b/accel-pptpd/ipdb.h
@@ -0,0 +1,29 @@
+#ifndef IPDB_H
+#define IPDB_H
+
+#include <netinet/in.h>
+
+#include "ppp.h"
+#include "list.h"
+
+struct ipdb_item_t
+{
+ struct ipdb_t *owner;
+ in_addr_t addr;
+ in_addr_t peer_addr;
+};
+
+struct ipdb_t
+{
+ struct list_head entry;
+ struct ipdb_item_t *(*get)(struct ppp_t *ppp);
+ void (*put)(struct ppp_t *ppp, struct ipdb_item_t *);
+};
+
+struct ipdb_item_t *ipdb_get(struct ppp_t *ppp);
+void ipdb_put(struct ppp_t *ppp, struct ipdb_item_t *);
+
+void ipdb_register(struct ipdb_t *);
+
+#endif
+
diff --git a/accel-pptpd/iprange.c b/accel-pptpd/iprange.c
new file mode 100644
index 0000000..0b1997e
--- /dev/null
+++ b/accel-pptpd/iprange.c
@@ -0,0 +1,136 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include "triton.h"
+#include "list.h"
+
+#include "iprange.h"
+
+#include "memdebug.h"
+
+struct iprange_t
+{
+ struct list_head entry;
+ uint32_t prefix;
+ uint32_t mask;
+ uint32_t end;
+};
+
+static LIST_HEAD(client_ranges);
+//static LIST_HEAD(tunnel_ranges);
+
+//parses ranges like x.x.x.x/mask
+static struct iprange_t *parse1(const char *str)
+{
+ int n,f1,f2,f3,f4,m;
+ struct iprange_t *r;
+
+ n = sscanf(str, "%u.%u.%u.%u/%u",&f1, &f2, &f3, &f4, &m);
+ if (n != 5)
+ return NULL;
+ if (f1 > 255)
+ return NULL;
+ if (f1 > 255)
+ return NULL;
+ if (f1 > 255)
+ return NULL;
+ if (f1 > 255)
+ return NULL;
+ if (m == 0 || m > 32)
+ return NULL;
+
+ r = _malloc(sizeof(*r));
+ r->prefix = (f4 << 24) | (f3 << 16) | (f2 << 8) | f1;
+ r->mask = 0;
+
+ for (n = 0; n < m ; n++)
+ r->mask |= 1 << n;
+
+ return r;
+}
+
+//parses ranges like x.x.x.x-y
+static struct iprange_t *parse2(const char *str)
+{
+ int n,f1,f2,f3,f4,m;
+ struct iprange_t *r;
+
+ n = sscanf(str, "%u.%u.%u.%u-%u",&f1, &f2, &f3, &f4, &m);
+ if (n != 5)
+ return NULL;
+ if (f1 > 255)
+ return NULL;
+ if (f2 > 255)
+ return NULL;
+ if (f3 > 255)
+ return NULL;
+ if (f4 > 255)
+ return NULL;
+ if (m < f4 || m > 255)
+ return NULL;
+
+ r = _malloc(sizeof(*r));
+ r->prefix = (f4 << 24) | (f3 << 16) | (f2 << 8) | f1;
+ r->end = (m << 24) | (f3 << 16) | (f2 << 8) | f1;
+ r->mask = 0;
+
+ return r;
+}
+
+static void load_ranges(struct list_head *list, const char *conf_sect)
+{
+ struct conf_sect_t *s = conf_get_section(conf_sect);
+ struct conf_option_t *opt;
+ struct iprange_t *r;
+
+ if (!s) {
+ fprintf(stderr, "iprange: section '%s' not found in config file, pptp and l2tp probably will not work...\n", conf_sect);
+ return;
+ }
+
+ list_for_each_entry(opt, &s->items, entry) {
+ r = parse1(opt->name);
+ if (!r)
+ r = parse2(opt->name);
+ if (!r) {
+ fprintf(stderr, "iprange: cann't parse '%s' in '%s'\n", opt->name, conf_sect);
+ _exit(EXIT_FAILURE);
+ }
+ list_add_tail(&r->entry, list);
+ }
+}
+
+static int check_range(struct list_head *list, in_addr_t ipaddr)
+{
+ struct iprange_t *r;
+
+ list_for_each_entry(r, list, entry) {
+ if (r->mask) {
+ if ((r->prefix & r->mask) == (ipaddr & r->mask))
+ return 0;
+ } else {
+ if (ipaddr >= r->prefix && ipaddr <= r->end)
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+int __export iprange_client_check(in_addr_t ipaddr)
+{
+ return check_range(&client_ranges, ipaddr);
+}
+/*int __export iprange_tunnel_check(in_addr_t ipaddr)
+{
+ return check_range(&tunnel_ranges, ipaddr);
+}*/
+
+static void __init iprange_init(void)
+{
+ load_ranges(&client_ranges, "client-ip-range");
+ //load_ranges(&tunnel_ranges, "tunnel-ip-range");
+}
+
diff --git a/accel-pptpd/iprange.h b/accel-pptpd/iprange.h
new file mode 100644
index 0000000..88a2486
--- /dev/null
+++ b/accel-pptpd/iprange.h
@@ -0,0 +1,10 @@
+#ifndef __IPRANGE_H
+#define __IPRANGE_H
+
+#include <netinet/in.h>
+
+int iprange_client_check(in_addr_t ipaddr);
+int iprange_tunnel_check(in_addr_t ipaddr);
+
+#endif
+
diff --git a/accel-pptpd/log.c b/accel-pptpd/log.c
new file mode 100644
index 0000000..476c077
--- /dev/null
+++ b/accel-pptpd/log.c
@@ -0,0 +1,452 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <string.h>
+#include <stdint.h>
+#include <signal.h>
+#include <sys/time.h>
+
+#include "triton/mempool.h"
+#include "events.h"
+#include "ppp.h"
+
+#include "log.h"
+
+#include "memdebug.h"
+
+struct log_pd_t
+{
+ struct ppp_pd_t pd;
+ struct ppp_t *ppp;
+ struct list_head msgs;
+ struct log_msg_t *msg;
+ int authorized:1;
+};
+
+struct _log_msg_t
+{
+ struct list_head entry;
+ int level;
+ struct timeval timestamp;
+ struct list_head chunks;
+ uint8_t refs;
+};
+
+static int log_level=10;
+
+static LIST_HEAD(targets);
+static mempool_t msg_pool;
+static mempool_t _msg_pool;
+static mempool_t chunk_pool;
+
+static __thread struct ppp_t *cur_ppp;
+static __thread struct _log_msg_t *cur_msg;
+static __thread char *stat_buf;
+
+static FILE *emerg_file;
+static FILE *debug_file;
+
+static void _log_free_msg(struct _log_msg_t *msg);
+static struct log_msg_t *clone_msg(struct _log_msg_t *msg);
+static int add_msg(struct _log_msg_t *msg, const char *buf);
+//static struct log_pd_t *find_pd(struct ppp_t *ppp);
+static void write_msg(FILE *f, struct _log_msg_t *msg, struct ppp_t *ppp);
+
+static void do_log(int level, const char *fmt, va_list ap, struct ppp_t *ppp)
+{
+ struct log_target_t *t;
+ struct log_msg_t *m;
+
+ if (!stat_buf)
+ stat_buf = _malloc(LOG_MAX_SIZE + 1);
+
+ vsnprintf(stat_buf, LOG_MAX_SIZE, fmt, ap);
+
+ if (!cur_msg) {
+ cur_msg = mempool_alloc(_msg_pool);
+ if (!cur_msg)
+ return;
+ INIT_LIST_HEAD(&cur_msg->chunks);
+ cur_msg->refs = 1;
+ cur_msg->level = level;
+ gettimeofday(&cur_msg->timestamp, NULL);
+ }
+
+ if (add_msg(cur_msg, stat_buf))
+ goto out;
+
+ if (stat_buf[strlen(stat_buf) - 1] != '\n')
+ return;
+
+ if (debug_file)
+ write_msg(debug_file, cur_msg, ppp);
+
+ list_for_each_entry(t, &targets, entry) {
+ m = clone_msg(cur_msg);
+ if (!m)
+ break;
+ t->log(m, ppp);
+ }
+
+out:
+ _log_free_msg(cur_msg);
+ cur_msg = NULL;
+}
+
+void __export log_error(const char *fmt,...)
+{
+ if (log_level >= LOG_ERROR) {
+ va_list ap;
+ va_start(ap,fmt);
+ do_log(LOG_ERROR, fmt, ap, NULL);
+ va_end(ap);
+ }
+}
+
+void __export log_warn(const char *fmt,...)
+{
+ if (log_level >= LOG_WARN) {
+ va_list ap;
+ va_start(ap,fmt);
+ do_log(LOG_WARN, fmt, ap, NULL);
+ va_end(ap);
+ }
+}
+
+void __export log_info(const char *fmt,...)
+{
+ if (log_level >= LOG_INFO) {
+ va_list ap;
+ va_start(ap, fmt);
+ do_log(LOG_INFO, fmt, ap, NULL);
+ va_end(ap);
+ }
+}
+
+void __export log_debug(const char *fmt,...)
+{
+ if (log_level >= LOG_DEBUG) {
+ va_list ap;
+ va_start(ap, fmt);
+ do_log(LOG_DEBUG, fmt, ap, NULL);
+ va_end(ap);
+ }
+}
+
+void __export log_msg(const char *fmt,...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ do_log(LOG_MSG, fmt, ap, NULL);
+ va_end(ap);
+}
+
+void __export log_ppp_error(const char *fmt,...)
+{
+ if (log_level >= LOG_ERROR) {
+ va_list ap;
+ va_start(ap, fmt);
+ do_log(LOG_ERROR, fmt, ap, cur_ppp);
+ va_end(ap);
+ }
+}
+
+void __export log_ppp_warn(const char *fmt,...)
+{
+ if (log_level >= LOG_WARN) {
+ va_list ap;
+ va_start(ap, fmt);
+ do_log(LOG_WARN, fmt, ap, cur_ppp);
+ va_end(ap);
+ }
+}
+
+void __export log_ppp_info(const char *fmt,...)
+{
+ if (log_level >= LOG_INFO) {
+ va_list ap;
+ va_start(ap, fmt);
+ do_log(LOG_INFO, fmt, ap, cur_ppp);
+ va_end(ap);
+ }
+}
+
+void __export log_ppp_debug(const char *fmt,...)
+{
+ if (log_level >= LOG_DEBUG) {
+ va_list ap;
+ va_start(ap, fmt);
+ do_log(LOG_DEBUG, fmt, ap, cur_ppp);
+ va_end(ap);
+ }
+}
+
+void __export log_ppp_msg(const char *fmt,...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ do_log(LOG_MSG, fmt, ap, cur_ppp);
+ va_end(ap);
+}
+
+void __export log_emerg(const char *fmt, ...)
+{
+ if (emerg_file) {
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(emerg_file, fmt, ap);
+ va_end(ap);
+ }
+}
+
+void __export log_free_msg(struct log_msg_t *m)
+{
+ struct _log_msg_t *msg = (struct _log_msg_t *)m->lpd;
+
+ //printf("free msg %p\n", m);
+
+ mempool_free(m->hdr);
+ _log_free_msg(msg);
+
+ mempool_free(m);
+}
+
+
+static void _log_free_msg(struct _log_msg_t *msg)
+{
+ struct log_chunk_t *chunk;
+
+ if (__sync_sub_and_fetch(&msg->refs, 1))
+ return;
+
+ while(!list_empty(&msg->chunks)) {
+ chunk = list_entry(msg->chunks.next, typeof(*chunk), entry);
+ list_del(&chunk->entry);
+ mempool_free(chunk);
+ }
+
+ mempool_free(msg);
+}
+
+static struct log_msg_t *clone_msg(struct _log_msg_t *msg)
+{
+ struct log_msg_t *m = mempool_alloc(msg_pool);
+ if (!m) {
+ log_emerg("log: out of memory\n");
+ return NULL;
+ }
+
+ m->hdr = mempool_alloc(chunk_pool);
+ if (!m->hdr) {
+ log_emerg("log: out of memory\n");
+ mempool_free(m);
+ return NULL;
+ }
+
+ m->hdr->len = 0;
+ m->lpd = msg;
+ m->chunks = &msg->chunks;
+ m->timestamp = msg->timestamp;
+ m->level = msg->level;
+
+ __sync_add_and_fetch(&msg->refs, 1);
+
+ //printf("clone msg %p\n", m);
+ return m;
+}
+
+static int add_msg(struct _log_msg_t *msg, const char *buf)
+{
+ struct log_chunk_t *chunk;
+ int i, len, chunk_cnt;
+
+ len = strlen(buf);
+ chunk_cnt = (len - 1)/LOG_CHUNK_SIZE + 1;
+
+ for (i = 0; i < chunk_cnt; i++) {
+ chunk = mempool_alloc(chunk_pool);
+ if (!chunk)
+ return -1;
+
+ chunk->len = i == chunk_cnt -1 ? len - i * LOG_CHUNK_SIZE : LOG_CHUNK_SIZE;
+ memcpy(chunk->msg, buf + i * LOG_CHUNK_SIZE, chunk->len);
+ chunk->msg[chunk->len] = 0;
+
+ list_add_tail(&chunk->entry, &msg->chunks);
+ }
+
+ return 0;
+}
+
+static void write_msg(FILE *f, struct _log_msg_t *msg, struct ppp_t *ppp)
+{
+ struct log_chunk_t *chunk;
+
+ if (ppp)
+ sprintf(stat_buf,"%s: %s: ", ppp->ifname, ppp->sessionid);
+ else
+ stat_buf[0] = 0;
+
+ list_for_each_entry(chunk, &msg->chunks, entry)
+ strcat(stat_buf, chunk->msg);
+
+ fwrite(stat_buf, strlen(stat_buf), 1, f);
+ fflush(f);
+}
+
+/*static struct log_pd_t *find_pd(struct ppp_t *ppp)
+{
+ struct ppp_pd_t *pd;
+ struct log_pd_t *lpd;
+
+ list_for_each_entry(pd, &ppp->pd_list, entry) {
+ if (pd->key == &pd_key) {
+ lpd = container_of(pd, typeof(*lpd), pd);
+ return lpd;
+ }
+ }
+ log_emerg("log:BUG: pd not found\n");
+ abort();
+}
+
+static void ev_ctrl_starting(struct ppp_t *ppp)
+{
+ struct log_pd_t *lpd = _malloc(sizeof(*lpd));
+ if (!lpd) {
+ log_emerg("log: out of memory\n");
+ return;
+ }
+
+ memset(lpd, 0, sizeof(*lpd));
+ lpd->pd.key = &pd_key;
+ lpd->ppp = ppp;
+ INIT_LIST_HEAD(&lpd->msgs);
+ list_add_tail(&lpd->pd.entry, &ppp->pd_list);
+}
+
+static void ev_ctrl_finished(struct ppp_t *ppp)
+{
+ struct log_pd_t *lpd = find_pd(ppp);
+ struct _log_msg_t *msg;
+ struct log_msg_t *m;
+ struct log_target_t *t;
+
+ if (lpd->msg) {
+ log_emerg("log:BUG: lpd->msg is not NULL\n");
+ abort();
+ }
+
+ if (lpd->authorized) {
+ if (!list_empty(&lpd->msgs)) {
+ log_emerg("log:BUG: lpd->msgs is not empty\n");
+ abort();
+ }
+ list_for_each_entry(t, &targets, entry)
+ if (t->session_stop)
+ t->session_stop(ppp);
+ }
+
+ while (!list_empty(&lpd->msgs)) {
+ msg = list_entry(lpd->msgs.next, typeof(*msg), entry);
+ list_del(&msg->entry);
+
+ list_for_each_entry(t, &targets, entry) {
+ if (!t->log)
+ continue;
+ m = clone_msg(msg);
+ if (!m)
+ break;
+ t->log(m);
+ }
+
+ _log_free_msg(msg);
+ }
+
+ list_del(&lpd->pd.entry);
+ _free(lpd);
+}
+
+static void ev_ppp_authorized(struct ppp_t *ppp)
+{
+ struct log_pd_t *lpd = find_pd(ppp);
+ struct _log_msg_t *msg;
+ struct log_msg_t *m;
+ struct log_target_t *t;
+
+ list_for_each_entry(t, &targets, entry)
+ if (t->session_start)
+ t->session_start(ppp);
+
+ while(!list_empty(&lpd->msgs)) {
+ msg = list_entry(lpd->msgs.next, typeof(*msg), entry);
+ list_del(&msg->entry);
+
+ list_for_each_entry(t, &targets, entry) {
+ if (!t->session_log)
+ continue;
+ m = clone_msg(msg);
+ if (!m)
+ break;
+ t->session_log(lpd->ppp, m);
+ }
+
+ _log_free_msg(msg);
+ }
+
+ lpd->authorized = 1;
+}*/
+
+void __export log_switch(struct triton_context_t *ctx, void *arg)
+{
+ cur_ppp = (struct ppp_t *)arg;
+}
+
+
+void __export log_register_target(struct log_target_t *t)
+{
+ list_add_tail(&t->entry, &targets);
+}
+
+static void sighup(int n)
+{
+ struct log_target_t *t;
+
+ list_for_each_entry(t, &targets, entry)
+ if (t->reopen)
+ t->reopen();
+}
+
+static void __init log_init(void)
+{
+ char *opt;
+ struct sigaction sa = {
+ .sa_handler = sighup,
+ };
+
+ opt = conf_get_opt("log", "level");
+ if (opt && atoi(opt) >= 0)
+ log_level = atoi(opt);
+
+ opt = conf_get_opt("log", "log-emerg");
+ if (opt) {
+ emerg_file = fopen(opt, "a");
+ if (!emerg_file)
+ fprintf(stderr, "log:open: %s\n", strerror(errno));
+ }
+
+ opt = conf_get_opt("log", "log-debug");
+ if (opt) {
+ debug_file = fopen(opt, "a");
+ if (!emerg_file)
+ fprintf(stderr, "log:open: %s\n", strerror(errno));
+ }
+
+ msg_pool = mempool_create(sizeof(struct log_msg_t));
+ _msg_pool = mempool_create(sizeof(struct _log_msg_t));
+ chunk_pool = mempool_create(sizeof(struct log_chunk_t) + LOG_CHUNK_SIZE + 1);
+
+ sigaction(SIGHUP, &sa, NULL);
+}
+
diff --git a/accel-pptpd/log.h b/accel-pptpd/log.h
new file mode 100644
index 0000000..140dad1
--- /dev/null
+++ b/accel-pptpd/log.h
@@ -0,0 +1,66 @@
+#ifndef __LOG_H
+#define __LOG_H
+
+#include <stdarg.h>
+#include <sys/time.h>
+#include "list.h"
+
+#define LOG_MSG 0
+#define LOG_ERROR 1
+#define LOG_WARN 2
+#define LOG_INFO 3
+#define LOG_DEBUG 4
+
+#define LOG_CHUNK_SIZE 128
+#define LOG_MAX_SIZE 4096
+
+struct ppp_t;
+struct triton_context_t;
+
+struct log_msg_t
+{
+ struct list_head entry;
+ void *lpd;
+ void *tpd;
+ struct timeval timestamp;
+ int level;
+ struct log_chunk_t *hdr;
+ struct list_head *chunks;
+};
+
+struct log_chunk_t
+{
+ struct list_head entry;
+ int len;
+ char msg[0];
+};
+
+struct log_target_t
+{
+ struct list_head entry;
+
+ void (*log)(struct log_msg_t *, struct ppp_t *ppp);
+ void (*reopen)(void);
+};
+
+void log_free_msg(struct log_msg_t *msg);
+
+void log_emerg(const char *fmt, ...);
+
+void log_error(const char *fmt,...);
+void log_warn(const char *fmt,...);
+void log_info(const char *fmt,...);
+void log_debug(const char *fmt,...);
+void log_msg(const char *fmt,...);
+
+void log_ppp_error(const char *fmt,...);
+void log_ppp_warn(const char *fmt,...);
+void log_ppp_info(const char *fmt,...);
+void log_ppp_debug(const char *fmt,...);
+void log_ppp_msg(const char *fmt,...);
+
+void log_switch(struct triton_context_t *ctx, void *arg);
+
+void log_register_target(struct log_target_t *t);
+
+#endif
diff --git a/accel-pptpd/logs/CMakeLists.txt b/accel-pptpd/logs/CMakeLists.txt
new file mode 100644
index 0000000..f1b09ca
--- /dev/null
+++ b/accel-pptpd/logs/CMakeLists.txt
@@ -0,0 +1,13 @@
+ADD_LIBRARY(log_file SHARED log_file.c)
+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)
+
diff --git a/accel-pptpd/logs/log_file.c b/accel-pptpd/logs/log_file.c
new file mode 100644
index 0000000..be615ad
--- /dev/null
+++ b/accel-pptpd/logs/log_file.c
@@ -0,0 +1,613 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <limits.h>
+#include <aio.h>
+#include <sys/signalfd.h>
+
+#include "log.h"
+#include "events.h"
+#include "ppp.h"
+#include "spinlock.h"
+#include "mempool.h"
+
+#include "memdebug.h"
+
+#define LOG_BUF_SIZE 16*1024
+
+#define RED_COLOR "\033[1;31m"
+#define GREEN_COLOR "\033[1;32m"
+#define YELLOW_COLOR "\033[1;33m"
+#define BLUE_COLOR "\033[1;34m"
+#define NORMAL_COLOR "\033[0;39m"
+
+struct log_file_t
+{
+ struct list_head entry;
+ struct list_head msgs;
+ spinlock_t lock;
+ int need_free:1;
+ int queued:1;
+ struct log_file_pd_t *lpd;
+
+ int fd;
+ int new_fd;
+ off_t offset;
+ unsigned long magic;
+};
+
+struct log_file_pd_t
+{
+ struct ppp_pd_t pd;
+ struct log_file_t lf;
+ unsigned long tmp;
+};
+
+static int conf_color;
+static int conf_per_session;
+static char *conf_per_user_dir;
+static char *conf_per_session_dir;
+static int conf_copy;
+
+static const char* level_name[]={" msg", "error", " warn", " info", "debug"};
+static const char* level_color[]={NORMAL_COLOR, RED_COLOR, YELLOW_COLOR, GREEN_COLOR, BLUE_COLOR};
+
+static void *pd_key1;
+static void *pd_key2;
+static struct log_file_t *log_file;
+
+static mempool_t lpd_pool;
+static char *log_buf;
+
+static struct aiocb aiocb = {
+ .aio_lio_opcode = LIO_WRITE,
+ .aio_sigevent.sigev_notify = SIGEV_SIGNAL,
+ .aio_sigevent.sigev_signo = SIGIO,
+};
+
+static LIST_HEAD(lf_queue);
+static spinlock_t lf_queue_lock = SPINLOCK_INITIALIZER;
+static int lf_queue_sleeping = 1;
+
+static unsigned long temp_seq;
+
+static void send_next_chunk();
+
+
+static void log_file_init(struct log_file_t *lf)
+{
+ spinlock_init(&lf->lock);
+ INIT_LIST_HEAD(&lf->msgs);
+ lf->fd = -1;
+ lf->new_fd = -1;
+}
+
+static int log_file_open(struct log_file_t *lf, const char *fname)
+{
+ lf->fd = open(fname, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
+ if (lf->fd < 0) {
+ log_emerg("log_file: open '%s': %s\n", fname, strerror(errno));
+ return -1;
+ }
+
+ lf->offset = lseek(lf->fd, 0, SEEK_END);
+
+ return 0;
+}
+
+static void sigio(int num, siginfo_t *si, void *uc)
+{
+ struct log_file_t *lf;
+ int n;
+
+ if (si->si_signo != SIGIO)
+ return;
+
+ if (si->si_code != SI_ASYNCIO) {
+ if (aio_write(&aiocb))
+ log_emerg("log_file: aio_write: %s\n", strerror(errno));
+ return;
+ }
+
+ lf = (struct log_file_t *)si->si_ptr;
+
+ n = aio_return(&aiocb);
+ if (n < 0)
+ log_emerg("log_file: %s\n", strerror(aio_error(&aiocb)));
+ else if (n != aiocb.aio_nbytes)
+ log_emerg("log_file: short write %p %i %lu\n", lf, n, aiocb.aio_nbytes);
+
+ spin_lock(&lf->lock);
+ lf->offset += n;
+ if (list_empty(&lf->msgs)) {
+ if (lf->need_free) {
+ spin_unlock(&lf->lock);
+ close(lf->fd);
+ mempool_free(lf->lpd);
+ } else {
+ lf->queued = 0;
+ spin_unlock(&lf->lock);
+ }
+ } else {
+ spin_unlock(&lf->lock);
+
+ spin_lock(&lf_queue_lock);
+ list_add_tail(&lf->entry, &lf_queue);
+ spin_unlock(&lf_queue_lock);
+ }
+
+ send_next_chunk();
+}
+
+static int dequeue_log(struct log_file_t *lf)
+{
+ int n, pos = 0;
+ struct log_msg_t *msg;
+ struct log_chunk_t *chunk;
+
+ while (1) {
+ spin_lock(&lf->lock);
+ if (list_empty(&lf->msgs)) {
+ spin_unlock(&lf->lock);
+ return pos;
+ }
+ msg = list_entry(lf->msgs.next, typeof(*msg), entry);
+ list_del(&msg->entry);
+ spin_unlock(&lf->lock);
+
+ if (pos + msg->hdr->len > LOG_BUF_SIZE)
+ goto overrun;
+ memcpy(log_buf + pos, msg->hdr->msg, msg->hdr->len);
+ n = msg->hdr->len;
+
+ list_for_each_entry(chunk, msg->chunks, entry) {
+ if (pos + n + chunk->len > LOG_BUF_SIZE)
+ goto overrun;
+ memcpy(log_buf + pos + n, chunk->msg, chunk->len);
+ n += chunk->len;
+ }
+
+ log_free_msg(msg);
+ pos += n;
+ }
+
+overrun:
+ spin_lock(&lf->lock);
+ list_add(&msg->entry, &lf->msgs);
+ spin_unlock(&lf->lock);
+
+ return pos;
+}
+
+static void send_next_chunk(void)
+{
+ struct log_file_t *lf;
+ int n;
+
+ spin_lock(&lf_queue_lock);
+ if (list_empty(&lf_queue)) {
+ lf_queue_sleeping = 1;
+ spin_unlock(&lf_queue_lock);
+ return;
+ }
+ lf = list_entry(lf_queue.next, typeof(*lf), entry);
+
+ n = log_file->entry.next == NULL;
+ list_del(&lf->entry);
+
+ spin_unlock(&lf_queue_lock);
+
+ if (lf->new_fd != -1) {
+ close(lf->fd);
+ lf->fd = lf->new_fd;
+ lf->new_fd = -1;
+ }
+
+ aiocb.aio_fildes = lf->fd;
+ aiocb.aio_offset = lf->offset;
+ aiocb.aio_sigevent.sigev_value.sival_ptr = lf;
+ aiocb.aio_nbytes = dequeue_log(lf);
+
+ if (aio_write(&aiocb))
+ log_emerg("log_file: aio_write: %s\n", strerror(errno));
+}
+
+static void queue_lf(struct log_file_t *lf)
+{
+ int r;
+
+ spin_lock(&lf_queue_lock);
+ list_add_tail(&lf->entry, &lf_queue);
+ r = lf_queue_sleeping;
+ lf_queue_sleeping = 0;
+ spin_unlock(&lf_queue_lock);
+
+ if (r)
+ send_next_chunk();
+}
+
+static void queue_log(struct log_file_t *lf, struct log_msg_t *msg)
+{
+ int r;
+
+ spin_lock(&lf->lock);
+ list_add_tail(&msg->entry, &lf->msgs);
+ if (lf->fd != -1) {
+ r = lf->queued;
+ lf->queued = 1;
+ } else
+ r = 1;
+ spin_unlock(&lf->lock);
+
+ if (!r)
+ queue_lf(lf);
+}
+
+static void set_hdr(struct log_msg_t *msg, struct ppp_t *ppp)
+{
+ struct tm tm;
+ char timestamp[32];
+
+ localtime_r(&msg->timestamp.tv_sec, &tm);
+
+ strftime(timestamp, sizeof(timestamp), "%Y-%m-%d %H:%M:%S", &tm);
+ sprintf(msg->hdr->msg, "%s[%s]: %s: %s%s%s", conf_color ? level_color[msg->level] : "",
+ timestamp, level_name[msg->level],
+ ppp ? ppp->ifname : "",
+ ppp ? ": " : "",
+ conf_color ? NORMAL_COLOR : "");
+ msg->hdr->len = strlen(msg->hdr->msg);
+}
+
+static void general_log(struct log_msg_t *msg, struct ppp_t *ppp)
+{
+ if (ppp && !conf_copy) {
+ log_free_msg(msg);
+ return;
+ }
+
+ set_hdr(msg, ppp);
+ queue_log(log_file, msg);
+}
+
+static struct log_file_pd_t *find_pd(struct ppp_t *ppp, void *pd_key)
+{
+ struct ppp_pd_t *pd;
+ struct log_file_pd_t *lpd;
+
+ list_for_each_entry(pd, &ppp->pd_list, entry) {
+ if (pd->key == pd_key) {
+ lpd = container_of(pd, typeof(*lpd), pd);
+ return lpd;
+ }
+ }
+ return NULL;
+}
+
+static void per_user_log(struct log_msg_t *msg, struct ppp_t *ppp)
+{
+ struct log_file_pd_t *lpd;
+
+ if (!ppp) {
+ log_free_msg(msg);
+ return;
+ }
+
+ lpd = find_pd(ppp, &pd_key1);
+
+ if (!lpd) {
+ log_free_msg(msg);
+ return;
+ }
+
+ set_hdr(msg, ppp);
+ queue_log(&lpd->lf, msg);
+}
+
+static void per_session_log(struct log_msg_t *msg, struct ppp_t *ppp)
+{
+ struct log_file_pd_t *lpd;
+
+ if (!ppp) {
+ log_free_msg(msg);
+ return;
+ }
+
+ lpd = find_pd(ppp, &pd_key2);
+
+ if (!lpd) {
+ log_free_msg(msg);
+ return;
+ }
+
+ set_hdr(msg, ppp);
+ queue_log(&lpd->lf, msg);
+}
+
+static void general_reopen(void)
+{
+ char *fname = conf_get_opt("log", "log-file");
+ int fd = open(fname, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ log_emerg("log_file: open '%s': %s\n", fname, strerror(errno));
+ return;
+ }
+ log_file->new_fd = fd;
+}
+
+static void free_lpd(struct log_file_pd_t *lpd)
+{
+ struct log_msg_t *msg;
+
+ spin_lock(&lpd->lf.lock);
+ list_del(&lpd->pd.entry);
+ lpd->lf.need_free = 1;
+ if (lpd->lf.queued)
+ spin_unlock(&lpd->lf.lock);
+ else {
+ while (!list_empty(&lpd->lf.msgs)) {
+ msg = list_entry(lpd->lf.msgs.next, typeof(*msg), entry);
+ list_del(&msg->entry);
+ log_free_msg(msg);
+ }
+ if (lpd->lf.fd != -1)
+ close(lpd->lf.fd);
+ spin_unlock(&lpd->lf.lock);
+ mempool_free(lpd);
+ }
+}
+
+static void ev_ctrl_started(struct ppp_t *ppp)
+{
+ struct log_file_pd_t *lpd;
+ char *fname;
+
+ if (conf_per_user_dir) {
+ lpd = mempool_alloc(lpd_pool);
+ if (!lpd) {
+ log_emerg("log_file: out of memory\n");
+ return;
+ }
+ memset(lpd, 0, sizeof(*lpd));
+ lpd->pd.key = &pd_key1;
+ log_file_init(&lpd->lf);
+ lpd->lf.lpd = lpd;
+ list_add_tail(&lpd->pd.entry, &ppp->pd_list);
+ }
+
+ if (conf_per_session_dir) {
+ lpd = mempool_alloc(lpd_pool);
+ if (!lpd) {
+ log_emerg("log_file: out of memory\n");
+ return;
+ }
+ memset(lpd, 0, sizeof(*lpd));
+ lpd->pd.key = &pd_key2;
+ log_file_init(&lpd->lf);
+ lpd->lf.lpd = lpd;
+
+ fname = _malloc(PATH_MAX);
+ if (!fname) {
+ mempool_free(lpd);
+ log_emerg("log_file: out of memory\n");
+ return;
+ }
+
+ lpd->tmp = __sync_fetch_and_add(&temp_seq, 1);
+ strcpy(fname, conf_per_session_dir);
+ strcat(fname, "/tmp");
+ sprintf(fname + strlen(fname), "%lu", lpd->tmp);
+
+ if (log_file_open(&lpd->lf, fname)) {
+ mempool_free(lpd);
+ _free(fname);
+ return;
+ }
+
+ _free(fname);
+
+ list_add_tail(&lpd->pd.entry, &ppp->pd_list);
+ }
+}
+
+static void ev_ctrl_finished(struct ppp_t *ppp)
+{
+ struct log_file_pd_t *lpd;
+ char *fname;
+
+ lpd = find_pd(ppp, &pd_key1);
+ if (lpd)
+ free_lpd(lpd);
+
+
+ lpd = find_pd(ppp, &pd_key2);
+ if (lpd) {
+ if (lpd->tmp) {
+ fname = _malloc(PATH_MAX);
+ if (fname) {
+ strcpy(fname, conf_per_session_dir);
+ strcat(fname, "/tmp");
+ sprintf(fname + strlen(fname), "%lu", lpd->tmp);
+ if (unlink(fname))
+ log_emerg("log_file: unlink '%s': %s\n", fname, strerror(errno));
+ _free(fname);
+ } else
+ log_emerg("log_file: out of memory\n");
+ }
+ free_lpd(lpd);
+ }
+}
+
+static void ev_ppp_starting(struct ppp_t *ppp)
+{
+ struct log_file_pd_t *lpd;
+ char *fname1, *fname2;
+
+ lpd = find_pd(ppp, &pd_key2);
+ if (!lpd)
+ return;
+
+ fname1 = _malloc(PATH_MAX);
+ if (!fname1) {
+ log_emerg("log_file: out of memory\n");
+ return;
+ }
+
+ fname2 = _malloc(PATH_MAX);
+ if (!fname2) {
+ log_emerg("log_file: out of memory\n");
+ _free(fname1);
+ return;
+ }
+
+ strcpy(fname1, conf_per_session_dir);
+ strcat(fname1, "/tmp");
+ sprintf(fname1 + strlen(fname1), "%lu", lpd->tmp);
+
+ strcpy(fname2, conf_per_session_dir);
+ strcat(fname2, "/");
+ strcat(fname2, ppp->sessionid);
+ strcat(fname2, ".log");
+
+ if (rename(fname1, fname2))
+ log_emerg("log_file: rename '%s' to '%s': %s\n", fname1, fname2, strerror(errno));
+
+ lpd->tmp = 0;
+
+ _free(fname1);
+ _free(fname2);
+}
+
+static void ev_ppp_authorized(struct ppp_t *ppp)
+{
+ struct log_file_pd_t *lpd;
+ char *fname;
+
+ lpd = find_pd(ppp, &pd_key1);
+ if (!lpd)
+ return;
+
+ fname = _malloc(PATH_MAX);
+ if (!fname) {
+ log_emerg("log_file: out of memory\n");
+ return;
+ }
+
+ strcpy(fname, conf_per_user_dir);
+ strcat(fname, "/");
+ strcat(fname, ppp->username);
+ if (conf_per_session) {
+ if (mkdir(fname, S_IRWXU) && errno != EEXIST) {
+ log_emerg("log_file: mkdir '%s': %s'\n", fname, strerror(errno));
+ goto out_err;
+ }
+ strcat(fname, "/");
+ strcat(fname, ppp->sessionid);
+ }
+ strcat(fname, ".log");
+
+ if (log_file_open(&lpd->lf, fname))
+ goto out_err;
+
+ _free(fname);
+
+ if (!list_empty(&lpd->lf.msgs)) {
+ lpd->lf.queued = 1;
+ queue_lf(&lpd->lf);
+ }
+
+ return;
+
+out_err:
+ _free(fname);
+ list_del(&lpd->pd.entry);
+ free_lpd(lpd);
+}
+
+static struct log_target_t general_target =
+{
+ .log = general_log,
+ .reopen = general_reopen,
+};
+
+static struct log_target_t per_user_target =
+{
+ .log = per_user_log,
+};
+
+static struct log_target_t per_session_target =
+{
+ .log = per_session_log,
+};
+
+static void __init init(void)
+{
+ char *opt;
+
+ sigset_t set;
+ sigemptyset(&set);
+ sigaddset(&set, SIGIO);
+
+ struct sigaction sa = {
+ .sa_sigaction = sigio,
+ .sa_flags = SA_SIGINFO,
+ .sa_mask = set,
+ };
+
+ lpd_pool = mempool_create(sizeof(struct log_file_pd_t));
+ log_buf = malloc(LOG_BUF_SIZE);
+ aiocb.aio_buf = log_buf;
+
+ if (sigaction(SIGIO, &sa, NULL)) {
+ log_emerg("log_file: sigaction: %s\n", strerror(errno));
+ return;
+ }
+
+ opt = conf_get_opt("log", "log-file");
+ if (opt) {
+ log_file = malloc(sizeof(*log_file));
+ memset(log_file, 0, sizeof(*log_file));
+ log_file_init(log_file);
+ if (log_file_open(log_file, opt)) {
+ free(log_file);
+ _exit(EXIT_FAILURE);
+ }
+ }
+
+ opt = conf_get_opt("log","color");
+ if (opt && atoi(opt) > 0)
+ conf_color = 1;
+
+ opt = conf_get_opt("log", "per-user-dir");
+ if (opt)
+ conf_per_user_dir = opt;
+
+ opt = conf_get_opt("log", "per-session-dir");
+ if (opt)
+ conf_per_session_dir = opt;
+
+ opt = conf_get_opt("log", "per-session");
+ if (opt && atoi(opt) > 0)
+ conf_per_session = 1;
+
+ opt = conf_get_opt("log", "copy");
+ if (opt && atoi(opt) > 0)
+ conf_copy = 1;
+
+ log_register_target(&general_target);
+
+ if (conf_per_user_dir)
+ log_register_target(&per_user_target);
+
+ if (conf_per_session_dir)
+ log_register_target(&per_session_target);
+
+ triton_event_register_handler(EV_CTRL_STARTED, (triton_event_func)ev_ctrl_started);
+ triton_event_register_handler(EV_CTRL_FINISHED, (triton_event_func)ev_ctrl_finished);
+ triton_event_register_handler(EV_PPP_STARTING, (triton_event_func)ev_ppp_starting);
+ triton_event_register_handler(EV_PPP_AUTHORIZED, (triton_event_func)ev_ppp_authorized);
+}
+
diff --git a/accel-pptpd/logs/log_pgsql.c b/accel-pptpd/logs/log_pgsql.c
new file mode 100644
index 0000000..0eed243
--- /dev/null
+++ b/accel-pptpd/logs/log_pgsql.c
@@ -0,0 +1,320 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <postgresql/libpq-fe.h>
+
+#include "triton.h"
+#include "spinlock.h"
+#include "log.h"
+#include "list.h"
+#include "ppp.h"
+
+#include "memdebug.h"
+
+static char *conf_conninfo;
+static int conf_queue_max = 1000;
+static char *conf_query;
+#define QUERY_TEMPLATE "insert into %s (timestamp, username, sessionid, msg) values ($1, $2, $3, $4)"
+
+static void start_connect(void);
+static void start_connect_timer(struct triton_timer_t *);
+static void pgsql_close(struct triton_context_t *ctx);
+
+static struct triton_context_t pgsql_ctx = {
+ .close = pgsql_close,
+};
+static struct triton_md_handler_t pgsql_hnd;
+static struct triton_timer_t connect_timer = {
+ .period = 5000,
+ .expire = start_connect_timer,
+};
+
+static PGconn *conn;
+
+static LIST_HEAD(msg_queue);
+static int queue_size;
+static int sleeping = 0;
+static spinlock_t queue_lock = SPINLOCK_INITIALIZER;
+static char *log_buf;
+static int need_close;
+
+static void unpack_msg(struct log_msg_t *msg)
+{
+ struct log_chunk_t *chunk;
+ int pos = 0;
+
+ list_for_each_entry(chunk, msg->chunks, entry) {
+ memcpy(log_buf + pos, chunk->msg, chunk->len);
+ pos += chunk->len;
+ }
+ if (pos > 1)
+ log_buf[pos - 1] = 0;
+ else
+ log_buf[0] = 0;
+}
+
+static void set_hdr(struct log_msg_t *msg, struct ppp_t *ppp)
+{
+ struct tm tm;
+
+ localtime_r(&msg->timestamp.tv_sec, &tm);
+
+ strftime(msg->hdr->msg, LOG_CHUNK_SIZE, "%Y-%m-%d %H:%M:%S", &tm);
+ msg->hdr->len = strlen(msg->hdr->msg) + 1;
+ if (ppp && ppp->username) {
+ strcpy(msg->hdr->msg + msg->hdr->len, ppp->username);
+ msg->hdr->len += strlen(ppp->username) + 1;
+ strcpy(msg->hdr->msg + msg->hdr->len, ppp->sessionid);
+ msg->hdr->len += strlen(ppp->sessionid) + 1;
+ } else
+ memset(msg->hdr->msg + msg->hdr->len, 0, 2);
+
+}
+
+static void write_next_msg(void)
+{
+ struct log_msg_t *msg;
+ const char *paramValues[4];
+ int paramFormats[4] = {0, 0, 0, 0};
+ char *ptr1, *ptr2;
+ int r;
+
+ spin_lock(&queue_lock);
+ if (list_empty(&msg_queue)) {
+ sleeping = 1;
+ spin_unlock(&queue_lock);
+ if (need_close) {
+ triton_md_unregister_handler(&pgsql_hnd);
+ PQfinish(conn);
+ conn = NULL;
+ triton_context_unregister(&pgsql_ctx);
+ }
+ return;
+ }
+
+ msg = list_entry(msg_queue.next, typeof(*msg), entry);
+ list_del(&msg->entry);
+ --queue_size;
+ spin_unlock(&queue_lock);
+
+ unpack_msg(msg);
+
+ ptr1 = strchr(msg->hdr->msg, 0);
+ ptr2 = strchr(ptr1 + 1, 0);
+
+ paramValues[1] = ptr1[1] ? ptr1 + 1 : NULL;
+ paramValues[2] = ptr2[1] ? ptr2 + 1 : NULL;
+ paramValues[0] = msg->hdr->msg;
+ paramValues[3] = log_buf;
+
+ if (!PQsendQueryParams(conn, conf_query, 4, NULL, paramValues, NULL, paramFormats, 0))
+ log_emerg("log_pgsql: %s\n", PQerrorMessage(conn));
+
+ log_free_msg(msg);
+
+ r = PQflush(conn);
+ if (r == -1)
+ log_emerg("log_pgsql: %s\n", PQerrorMessage(conn));
+ if (r == 0)
+ triton_md_enable_handler(&pgsql_hnd, MD_MODE_WRITE);
+}
+
+static int pgsql_check_ready(struct triton_md_handler_t *h)
+{
+ PGresult *res;
+
+ if (!PQconsumeInput(conn)) {
+ log_emerg("log_pgsql: %s\n", PQerrorMessage(conn));
+ if (PQstatus(conn) == CONNECTION_BAD) {
+ PQfinish(conn);
+ start_connect();
+ }
+ }
+
+ if (PQisBusy(conn))
+ return 0;
+
+ while (1) {
+ res = PQgetResult(conn);
+ if (!res)
+ break;
+ if (PQresultStatus(res) != PGRES_COMMAND_OK)
+ log_emerg("log_pgsql: %s\n", PQerrorMessage(conn));
+ PQclear(res);
+ }
+
+ write_next_msg();
+
+ return 0;
+}
+
+static int pgsql_flush(struct triton_md_handler_t *h)
+{
+ int r;
+
+ r = PQflush(conn);
+ if (r == -1)
+ log_emerg("log_pgsql: %s\n", PQerrorMessage(conn));
+ if (r == 1)
+ return 0;
+
+ triton_md_disable_handler(&pgsql_hnd, MD_MODE_WRITE);
+ return 0;
+}
+
+static void wakeup_log(void)
+{
+ write_next_msg();
+}
+
+static void queue_log(struct log_msg_t *msg)
+{
+ int r = 0, f = 0;
+ spin_lock(&queue_lock);
+ if (!conn) {
+ log_free_msg(msg);
+ spin_unlock(&queue_lock);
+ return;
+ }
+ if (queue_size < conf_queue_max) {
+ list_add_tail(&msg->entry, &msg_queue);
+ ++queue_size;
+ r = sleeping;
+ sleeping = 0;
+ } else
+ f = 1;
+ spin_unlock(&queue_lock);
+
+ if (r)
+ triton_context_call(&pgsql_ctx, (void (*)(void*))wakeup_log, NULL);
+ else if (f)
+ log_free_msg(msg);
+}
+
+
+static void general_log(struct log_msg_t *msg, struct ppp_t *ppp)
+{
+ set_hdr(msg, ppp);
+ queue_log(msg);
+}
+
+static int wait_connect(struct triton_md_handler_t *h)
+{
+ PostgresPollingStatusType status = PQconnectPoll(conn);
+ char *err_msg;
+
+ switch(status) {
+ case PGRES_POLLING_READING:
+ triton_md_enable_handler(h, MD_MODE_READ);
+ triton_md_disable_handler(h, MD_MODE_WRITE);
+ break;
+ case PGRES_POLLING_WRITING:
+ triton_md_enable_handler(h, MD_MODE_WRITE);
+ triton_md_disable_handler(h, MD_MODE_READ);
+ break;
+ case PGRES_POLLING_FAILED:
+ err_msg = PQerrorMessage(conn);
+ log_emerg("log_pgsql: %s\n", err_msg);
+ triton_md_disable_handler(h, MD_MODE_READ | MD_MODE_WRITE);
+ PQfinish(conn);
+ h->read = NULL;
+ h->write = NULL;
+ if (!connect_timer.tpd)
+ triton_timer_add(&pgsql_ctx, &connect_timer, 0);
+ break;
+ case PGRES_POLLING_OK:
+ //triton_md_disable_handler(h, MD_MODE_READ | MD_MODE_WRITE);
+ PQsetnonblocking(conn, 1);
+ h->write = pgsql_flush;
+ h->read = pgsql_check_ready;
+ triton_md_enable_handler(&pgsql_hnd, MD_MODE_READ);
+ wakeup_log();
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+static void start_connect(void)
+{
+ conn = PQconnectStart(conf_conninfo);
+ if (!conn) {
+ log_emerg("log_pgsql: out of memory\n");
+ return;
+ }
+
+ if (PQstatus(conn) == CONNECTION_BAD) {
+ log_emerg("log_pgsql: PQconnectStart failed\n");
+ }
+
+ pgsql_hnd.fd = PQsocket(conn);
+ pgsql_hnd.read = wait_connect;
+ pgsql_hnd.write = wait_connect;
+
+ wait_connect(&pgsql_hnd);
+}
+
+static void start_connect_timer(struct triton_timer_t *t)
+{
+ triton_timer_del(t);
+ start_connect();
+}
+
+static void pgsql_close(struct triton_context_t *ctx)
+{
+ spin_lock(&queue_lock);
+ if (sleeping) {
+ triton_md_unregister_handler(&pgsql_hnd);
+ PQfinish(conn);
+ conn = NULL;
+ triton_context_unregister(&pgsql_ctx);
+ } else
+ need_close = 1;
+ spin_unlock(&queue_lock);
+}
+
+static struct log_target_t target = {
+ .log = general_log,
+};
+
+static void __init init(void)
+{
+ char *opt;
+
+ opt = conf_get_opt("log-pgsql", "conninfo");
+ if (!opt)
+ return;
+ conf_conninfo = opt;
+
+ opt = conf_get_opt("log-pgsql", "connect-inteval");
+ if (opt && atoi(opt) > 0)
+ connect_timer.period = atoi(opt) * 1000;
+
+ opt = conf_get_opt("log-pgsql", "log-query");
+ if (opt)
+ conf_query = opt;
+ else {
+ opt = conf_get_opt("log-pgsql", "log-table");
+ if (!opt || strlen(opt) > 32)
+ opt = "log";
+ conf_query = _malloc(sizeof(QUERY_TEMPLATE) + strlen(opt));
+ sprintf(conf_query, QUERY_TEMPLATE, opt);
+ }
+
+ log_buf = _malloc(LOG_MAX_SIZE + 1);
+ if (!log_buf) {
+ log_emerg("log_pgsql: out of memory\n");
+ return;
+ }
+
+ triton_context_register(&pgsql_ctx, NULL);
+ triton_md_register_handler(&pgsql_ctx, &pgsql_hnd);
+ triton_md_set_trig(&pgsql_hnd, MD_TRIG_LEVEL);
+ triton_context_wakeup(&pgsql_ctx);
+
+ start_connect();
+
+ log_register_target(&target);
+}
diff --git a/accel-pptpd/main.c b/accel-pptpd/main.c
new file mode 100644
index 0000000..e261fbb
--- /dev/null
+++ b/accel-pptpd/main.c
@@ -0,0 +1,155 @@
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+
+#include "triton/triton.h"
+
+#include "memdebug.h"
+#include "log.h"
+
+static int goto_daemon;
+static char *pid_file;
+static char *conf_file;
+
+#define ARG_MAX 128
+static int parse_cmdline(char ***argv)
+{
+ FILE *f;
+ int i;
+ size_t len;
+
+ f = fopen("/proc/self/cmdline", "r");
+ if (!f) {
+ perror("open cmdline");
+ _exit(EXIT_FAILURE);
+ }
+
+ *argv = _malloc(ARG_MAX * sizeof(void *));
+ memset(*argv, 0, ARG_MAX * sizeof(void *));
+
+ for(i = 0; i < ARG_MAX; i++) {
+ len = 0;
+ if (getdelim(&(*argv)[i], &len, 0, f) < 0)
+ break;
+ }
+
+ fclose(f);
+
+ return i;
+}
+static void __init __main(void)
+{
+ int i,argc;
+ char **argv;
+
+ argc=parse_cmdline(&argv);
+
+ if (argc < 2)
+ goto usage;
+
+ for(i = 1; i < argc; i++) {
+ if (!strcmp(argv[i], "-d"))
+ goto_daemon = 1;
+ else if (!strcmp(argv[i], "-p")) {
+ if (i == argc - 1)
+ goto usage;
+ pid_file = argv[++i];
+ } else if (!strcmp(argv[i], "-c")) {
+ if (i == argc - 1)
+ goto usage;
+ conf_file = argv[++i];
+ }
+ }
+
+ if (!conf_file)
+ goto usage;
+
+ if (triton_init(conf_file))
+ _exit(EXIT_FAILURE);
+
+ return;
+
+usage:
+ printf("usage: pptpd [-d] [-p <file>] -c <file>\n\
+ where:\n\
+ -d - daemon mode\n\
+ -p - write pid to <file>\n\
+ -c - config file\n");
+ _exit(EXIT_FAILURE);
+}
+int main(int argc, char **argv)
+{
+ sigset_t set;
+ int sig;
+
+ if (goto_daemon) {
+ /*pid_t pid = fork();
+ if (pid > 0)
+ _exit(EXIT_SUCCESS);
+ if (pid < 0) {
+ perror("fork");
+ return EXIT_FAILURE;
+ }
+ if (setsid() < 0)
+ _exit(EXIT_FAILURE);
+ pid = fork();
+ if (pid)
+ _exit(0);
+ umask(0);
+ chdir("/");
+ close(STDIN_FILENO);
+ close(STDOUT_FILENO);
+ close(STDERR_FILENO);*/
+ daemon(0, 0);
+ }
+
+ if (pid_file) {
+ FILE *f = fopen(pid_file, "w");
+ if (f) {
+ fprintf(f, "%i", getpid());
+ fclose(f);
+ }
+ }
+
+ //signal(SIGTERM, sigterm);
+ //signal(SIGPIPE, sigterm);
+
+ if (triton_load_modules("modules"))
+ return EXIT_FAILURE;
+
+ triton_run();
+
+ sigfillset(&set);
+ sigdelset(&set, SIGKILL);
+ sigdelset(&set, SIGSTOP);
+ sigdelset(&set, SIGSEGV);
+ sigdelset(&set, SIGFPE);
+ sigdelset(&set, SIGILL);
+ sigdelset(&set, SIGBUS);
+ sigdelset(&set, SIGHUP);
+ sigdelset(&set, SIGIO);
+ sigdelset(&set, SIGINT);
+ sigdelset(&set, 35);
+ sigdelset(&set, 36);
+ pthread_sigmask(SIG_SETMASK, &set, NULL);
+
+ sigemptyset(&set);
+ //sigaddset(&set, SIGINT);
+ sigaddset(&set, SIGTERM);
+ sigaddset(&set, SIGSEGV);
+ sigaddset(&set, SIGILL);
+ sigaddset(&set, SIGFPE);
+ sigaddset(&set, SIGBUS);
+
+ sigwait(&set, &sig);
+ log_info("terminate, sig = %i\n", sig);
+
+ triton_terminate();
+
+ return EXIT_SUCCESS;
+}
+
diff --git a/accel-pptpd/memdebug.c b/accel-pptpd/memdebug.c
new file mode 100644
index 0000000..2acdc7a
--- /dev/null
+++ b/accel-pptpd/memdebug.c
@@ -0,0 +1,180 @@
+#undef MEMDEBUG
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <limits.h>
+#include <signal.h>
+
+#include "spinlock.h"
+#include "list.h"
+
+#define __init __attribute__((constructor))
+#define __export __attribute__((visibility("default")))
+
+#undef offsetof
+#ifdef __compiler_offsetof
+#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+
+
+#define MAGIC1 0x1122334455667788llu
+
+struct mem_t
+{
+ struct list_head entry;
+ char fname[PATH_MAX];
+ int line;
+ size_t size;
+ uint64_t magic2;
+ uint64_t magic1;
+ char data[0];
+};
+
+static LIST_HEAD(mem_list);
+static spinlock_t mem_list_lock;
+
+struct mem_t *_md_malloc(size_t size, const char *fname, int line)
+{
+ struct mem_t *mem = malloc(sizeof(*mem) + size + 8);
+ strcpy(mem->fname, fname);
+ mem->line = line;
+ mem->size = size;
+ mem->magic1 = MAGIC1;
+ mem->magic2 = (uint64_t)random() * (uint64_t)random();
+ *(uint64_t*)(mem->data + size) = mem->magic2;
+
+ spin_lock(&mem_list_lock);
+ list_add_tail(&mem->entry, &mem_list);
+ spin_unlock(&mem_list_lock);
+
+ return mem;
+}
+
+void __export *md_malloc(size_t size, const char *fname, int line)
+{
+ struct mem_t *mem = _md_malloc(size, fname, line);
+
+ return mem->data;
+}
+
+void __export md_free(void *ptr, const char *fname, int line)
+{
+ struct mem_t *mem = container_of(ptr, typeof(*mem), data);
+
+ if (!ptr) {
+ printf("free null pointer at %s:%i\n", fname, line);
+ abort();
+ }
+
+ if (mem->magic1 != MAGIC1) {
+ printf("memory corruption:\nfree at %s:%i\n", fname, line);
+ abort();
+ }
+
+ if (mem->magic2 != *(uint64_t*)(mem->data + mem->size)) {
+ printf("memory corruption:\nmalloc(%lu) at %s:%i\nfree at %s:%i\n", mem->size, mem->fname, mem->line, fname, line);
+ abort();
+ }
+
+ mem->magic1 = 0;
+ mem->magic2 = 0;
+
+ spin_lock(&mem_list_lock);
+ list_del(&mem->entry);
+ spin_unlock(&mem_list_lock);
+
+ free(mem);
+ return;
+}
+
+void __export *md_realloc(void *ptr, size_t size, const char *fname, int line)
+{
+ struct mem_t *mem = container_of(ptr, typeof(*mem), data);
+ struct mem_t *mem2;
+
+ if (mem->magic1 != MAGIC1) {
+ printf("memory corruption:\nfree at %s:%i\n", fname, line);
+ abort();
+ }
+
+ if (mem->magic2 != *(uint64_t*)(mem->data + mem->size)) {
+ printf("memory corruption:\nmalloc(%lu) at %s:%i\nfree at %s:%i\n", mem->size, mem->fname, mem->line, fname, line);
+ abort();
+ }
+
+ mem2 = _md_malloc(size, fname, line);
+ memcpy(mem2->data, mem->data, mem->size);
+
+ md_free(mem->data, fname, line);
+
+ return mem2->data;
+}
+
+char __export *md_strdup(const char *ptr, const char *fname, int line)
+{
+ struct mem_t *mem = _md_malloc(strlen(ptr) + 1, fname, line);
+ memcpy(mem->data, ptr, strlen(ptr) + 1);
+ return mem->data;
+}
+
+char __export *md_strndup(const char *ptr, size_t n, const char *fname, int line)
+{
+ struct mem_t *mem = _md_malloc(n + 1, fname, line);
+ memcpy(mem->data, ptr, n);
+ mem->data[n] = 0;
+ return mem->data;
+}
+
+static void siginfo(int num)
+{
+ struct mem_t *mem;
+ size_t total = 0;
+
+ spin_lock(&mem_list_lock);
+ list_for_each_entry(mem, &mem_list, entry) {
+ printf("%s:%i %lu\n", mem->fname, mem->line, mem->size);
+ total += mem->size;
+ }
+ spin_unlock(&mem_list_lock);
+ printf("total = %lu\n", total);
+}
+
+static void siginfo2(int num)
+{
+ struct mem_t *mem;
+
+ spin_lock(&mem_list_lock);
+ list_for_each_entry(mem, &mem_list, entry) {
+ if (mem->magic1 != MAGIC1 || mem->magic2 != *(uint64_t*)(mem->data + mem->size))
+ printf("%s:%i %lu\n", mem->fname, mem->line, mem->size);
+ }
+ spin_unlock(&mem_list_lock);
+}
+
+void __export md_check(void *ptr)
+{
+ struct mem_t *mem = container_of(ptr, typeof(*mem), data);
+
+ if (!ptr)
+ abort();
+
+ if (mem->magic1 != MAGIC1)
+ abort();
+
+ if (mem->magic2 != *(uint64_t*)(mem->data + mem->size))
+ abort();
+}
+
+static void __init init(void)
+{
+ signal(36, siginfo);
+ signal(37, siginfo2);
+}
diff --git a/accel-pptpd/memdebug.h b/accel-pptpd/memdebug.h
new file mode 100644
index 0000000..dc6b9ad
--- /dev/null
+++ b/accel-pptpd/memdebug.h
@@ -0,0 +1,28 @@
+#ifndef __MEMDEBUG_H
+#define __MEMDEBUG_H
+
+#ifdef MEMDEBUG
+
+#include <sys/types.h>
+
+#define _malloc(size) md_malloc(size, __FILE__, __LINE__)
+#define _realloc(ptr, size) md_realloc(ptr, size, __FILE__, __LINE__)
+#define _free(ptr) md_free(ptr, __FILE__, __LINE__)
+#define _strdup(str) md_strdup(str, __FILE__, __LINE__)
+#define _strndup(str, size) md_strndup(str, size, __FILE__, __LINE__)
+
+void *md_malloc(size_t size, const char *fname, int line);
+void *md_realloc(void *ptr, size_t size, const char *fname, int line);
+void md_free(void *ptr, const char *fname, int line);
+char* md_strdup(const char *ptr, const char *fname, int line);
+char* md_strndup(const char *ptr, size_t size, const char *fname, int line);
+void md_check(void *ptr);
+
+#else
+#define _malloc(size) malloc(size)
+#define _realloc(ptr, size) realloc(ptr, size)
+#define _free(ptr) free(ptr)
+#endif
+
+#endif
+
diff --git a/accel-pptpd/ppp/CMakeLists.txt b/accel-pptpd/ppp/CMakeLists.txt
new file mode 100644
index 0000000..f4c0f04
--- /dev/null
+++ b/accel-pptpd/ppp/CMakeLists.txt
@@ -0,0 +1,19 @@
+SET(target ppp)
+SET(sources_c
+ ppp.c
+ ppp_fsm.c
+ ppp_lcp.c
+ lcp_opt_mru.c
+ lcp_opt_magic.c
+ lcp_opt_pcomp.c
+ lcp_opt_accomp.c
+ ppp_auth.c
+ ppp_ipcp.c
+ ipcp_opt_ipaddr.c
+ ipcp_opt_dns.c
+ ppp_ccp.c
+)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+
+ADD_LIBRARY(${target} SHARED ${sources_c})
+
diff --git a/accel-pptpd/ppp/ccp_mppe.c b/accel-pptpd/ppp/ccp_mppe.c
new file mode 100644
index 0000000..3ac3ad6
--- /dev/null
+++ b/accel-pptpd/ppp/ccp_mppe.c
@@ -0,0 +1,215 @@
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+#include <linux/if_ppp.h>
+#include <net/if.h>
+
+#include "ppp.h"
+#include "ppp_ccp.h"
+#include "log.h"
+#include "events.h"
+
+#include "memdebug.h"
+
+#define MPPE_H (1 << 24)
+#define MPPE_M (1 << 7)
+#define MPPE_S (1 << 6)
+#define MPPE_L (1 << 5)
+#define MPPE_D (1 << 4)
+#define MPPE_C (1 << 0)
+
+#define MPPE_PAD 4
+
+static struct ccp_option_t *mppe_init(struct ppp_ccp_t *ccp);
+static void mppe_free(struct ppp_ccp_t *ccp, struct ccp_option_t *opt);
+static int mppe_send_conf_req(struct ppp_ccp_t *ccp, struct ccp_option_t *opt, uint8_t *ptr);
+static int mppe_recv_conf_req(struct ppp_ccp_t *ccp, struct ccp_option_t *opt, uint8_t *ptr);
+static void mppe_print(void (*print)(const char *fmt,...),struct ccp_option_t*, uint8_t *ptr);
+
+struct mppe_option_t
+{
+ struct ccp_option_t opt;
+ int mppe;
+ uint8_t recv_key[16];
+ uint8_t send_key[16];
+ int policy; // 1 - allowed, 2 - required
+};
+
+static struct ccp_option_handler_t mppe_opt_hnd = {
+ .init = mppe_init,
+ .send_conf_req = mppe_send_conf_req,
+ .send_conf_nak = mppe_send_conf_req,
+ .recv_conf_req = mppe_recv_conf_req,
+ .free = mppe_free,
+ .print = mppe_print,
+};
+
+static struct ccp_option_t *mppe_init(struct ppp_ccp_t *ccp)
+{
+ struct mppe_option_t *mppe_opt = _malloc(sizeof(*mppe_opt));
+ memset(mppe_opt, 0, sizeof(*mppe_opt));
+ mppe_opt->mppe = -1;
+ mppe_opt->opt.id = CI_MPPE;
+ mppe_opt->opt.len = 6;
+
+ return &mppe_opt->opt;
+}
+
+static void mppe_free(struct ppp_ccp_t *ccp, struct ccp_option_t *opt)
+{
+ struct mppe_option_t *mppe_opt = container_of(opt, typeof(*mppe_opt), opt);
+
+ _free(mppe_opt);
+}
+
+static int setup_mppe_key(int fd, int transmit, uint8_t *key)
+{
+ struct ppp_option_data data;
+ uint8_t buf[6 + 16];
+
+ memset(buf, 0, sizeof(buf));
+ buf[0] = CI_MPPE;
+ buf[1] = 6;
+ *(uint32_t*)(buf + 2) = htonl(MPPE_S | MPPE_H);
+ if (key)
+ memcpy(buf + 6, key, 16);
+
+ memset(&data, 0, sizeof(data));
+ data.ptr = buf;
+ data.length = sizeof(buf);
+ data.transmit = transmit;
+
+ if (ioctl(fd, PPPIOCSCOMPRESS, &data)) {
+ log_ppp_warn("mppe: MPPE requested but not supported by kernel\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+static int decrease_mtu(struct ppp_t *ppp)
+{
+ struct ifreq ifr;
+
+ strcpy(ifr.ifr_name, ppp->ifname);
+
+ if (ioctl(sock_fd, SIOCGIFMTU, &ifr)) {
+ log_ppp_error("mppe: failed to get MTU: %s\n", strerror(errno));
+ return -1;
+ }
+
+ ifr.ifr_mtu -= MPPE_PAD;
+
+ if (ioctl(sock_fd, SIOCSIFMTU, &ifr)) {
+ log_ppp_error("mppe: failed to set MTU: %s\n", strerror(errno));
+ return -1;
+ }
+
+ return 0;
+}
+
+static int mppe_send_conf_req(struct ppp_ccp_t *ccp, struct ccp_option_t *opt, uint8_t *ptr)
+{
+ struct mppe_option_t *mppe_opt = container_of(opt,typeof(*mppe_opt),opt);
+ struct ccp_opt32_t *opt32 = (struct ccp_opt32_t*)ptr;
+
+ if (mppe_opt->policy == 2 || mppe_opt->mppe != -1) {
+ opt32->hdr.id = CI_MPPE;
+ opt32->hdr.len = 6;
+ opt32->val = mppe_opt->mppe ? htonl(MPPE_S | MPPE_H) : 0;
+
+ if (mppe_opt->mppe && setup_mppe_key(ccp->ppp->unit_fd, 0, mppe_opt->recv_key))
+ return 0;
+
+ return 6;
+ }
+ return 0;
+}
+
+static int mppe_recv_conf_req(struct ppp_ccp_t *ccp, struct ccp_option_t *opt, uint8_t *ptr)
+{
+ struct mppe_option_t *mppe_opt = container_of(opt, typeof(*mppe_opt), opt);
+ struct ccp_opt32_t *opt32 = (struct ccp_opt32_t *)ptr;
+
+ /*if (!ptr) {
+ if (mppe_opt->policy == 2)
+ return CCP_OPT_NAK;
+ return CCP_OPT_ACK;
+ }*/
+
+ if (opt32->hdr.len != 6)
+ return CCP_OPT_REJ;
+
+ if (mppe_opt->policy == 2) {
+ if (ntohl(opt32->val) != (MPPE_S | MPPE_H))
+ return CCP_OPT_NAK;
+ } else if (mppe_opt->policy == 1) {
+ if (ntohl(opt32->val) == (MPPE_S | MPPE_H))
+ mppe_opt->mppe = 1;
+ else if ((ntohl(opt32->val) & (MPPE_S | MPPE_H)) == (MPPE_S | MPPE_H)) {
+ mppe_opt->mppe = 1;
+ return CCP_OPT_NAK;
+ } else if (opt32->val) {
+ mppe_opt->mppe = 0;
+ return CCP_OPT_NAK;
+ } else
+ mppe_opt->mppe = 0;
+ } else
+ return CCP_OPT_REJ;
+
+ if (setup_mppe_key(ccp->ppp->unit_fd, 1, mppe_opt->send_key))
+ return CCP_OPT_REJ;
+
+ decrease_mtu(ccp->ppp);
+
+ return CCP_OPT_ACK;
+}
+
+static void mppe_print(void (*print)(const char *fmt,...),struct ccp_option_t *opt, uint8_t *ptr)
+{
+ struct mppe_option_t *mppe_opt = container_of(opt, typeof(*mppe_opt), opt);
+ struct ccp_opt32_t *opt32 = (struct ccp_opt32_t *)ptr;
+ uint32_t bits;
+
+ if (ptr)
+ bits = ntohl(opt32->val);
+ else
+ if (mppe_opt->mppe)
+ bits = MPPE_S | MPPE_H;
+ else
+ bits = 0;
+
+ print("<mppe %sH %sM %sS %sL %sD %sC>",
+ bits & MPPE_H ? "+" : "-",
+ bits & MPPE_M ? "+" : "-",
+ bits & MPPE_S ? "+" : "-",
+ bits & MPPE_L ? "+" : "-",
+ bits & MPPE_D ? "+" : "-",
+ bits & MPPE_C ? "+" : "-"
+ );
+}
+
+static void ev_mppe_keys(struct ev_mppe_keys_t *ev)
+{
+ struct mppe_option_t *mppe_opt = container_of(ccp_find_option(ev->ppp, &mppe_opt_hnd), typeof(*mppe_opt), opt);
+
+ if ((ev->type & 0x04) == 0) {
+ log_ppp_warn("mppe: 128-bit session keys not allowed, disabling mppe ...\n");
+ return;
+ }
+
+ memcpy(mppe_opt->recv_key, ev->recv_key, 16);
+ memcpy(mppe_opt->send_key, ev->send_key, 16);
+ mppe_opt->policy = ev->policy;
+
+ if (ev->policy == 2)
+ mppe_opt->mppe = 1;
+}
+
+static void __init mppe_opt_init()
+{
+ ccp_option_register(&mppe_opt_hnd);
+ triton_event_register_handler(EV_MPPE_KEYS, (triton_event_func)ev_mppe_keys);
+}
+
diff --git a/accel-pptpd/ppp/ipcp_opt_dns.c b/accel-pptpd/ppp/ipcp_opt_dns.c
new file mode 100644
index 0000000..4c48fd4
--- /dev/null
+++ b/accel-pptpd/ppp/ipcp_opt_dns.c
@@ -0,0 +1,163 @@
+#include <stdlib.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+#include "ppp.h"
+#include "ppp_ipcp.h"
+#include "log.h"
+#include "ipdb.h"
+
+#include "memdebug.h"
+
+static in_addr_t conf_dns1;
+static in_addr_t conf_dns2;
+
+static struct ipcp_option_t *dns1_init(struct ppp_ipcp_t *ipcp);
+static struct ipcp_option_t *dns2_init(struct ppp_ipcp_t *ipcp);
+static void dns_free(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt);
+static int dns_send_conf_req(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr);
+static int dns_send_conf_nak(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr);
+static int dns_recv_conf_req(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr);
+static void dns1_print(void (*print)(const char *fmt,...),struct ipcp_option_t*, uint8_t *ptr);
+static void dns2_print(void (*print)(const char *fmt,...),struct ipcp_option_t*, uint8_t *ptr);
+
+struct dns_option_t
+{
+ struct ipcp_option_t opt;
+ in_addr_t addr;
+};
+
+static struct ipcp_option_handler_t dns1_opt_hnd=
+{
+ .init=dns1_init,
+ .send_conf_req=dns_send_conf_req,
+ .send_conf_nak=dns_send_conf_nak,
+ .recv_conf_req=dns_recv_conf_req,
+ .free=dns_free,
+ .print=dns1_print,
+};
+static struct ipcp_option_handler_t dns2_opt_hnd=
+{
+ .init=dns2_init,
+ .send_conf_req=dns_send_conf_req,
+ .send_conf_nak=dns_send_conf_nak,
+ .recv_conf_req=dns_recv_conf_req,
+ .free=dns_free,
+ .print=dns2_print,
+};
+
+static struct ipcp_option_t *dns1_init(struct ppp_ipcp_t *ipcp)
+{
+ struct dns_option_t *dns_opt=_malloc(sizeof(*dns_opt));
+ memset(dns_opt,0,sizeof(*dns_opt));
+ dns_opt->opt.id=CI_DNS1;
+ dns_opt->opt.len=6;
+
+ return &dns_opt->opt;
+}
+
+static struct ipcp_option_t *dns2_init(struct ppp_ipcp_t *ipcp)
+{
+ struct dns_option_t *dns_opt=_malloc(sizeof(*dns_opt));
+ memset(dns_opt,0,sizeof(*dns_opt));
+ dns_opt->opt.id=CI_DNS2;
+ dns_opt->opt.len=6;
+
+ return &dns_opt->opt;
+}
+
+static void dns_free(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt)
+{
+ struct dns_option_t *dns_opt=container_of(opt,typeof(*dns_opt),opt);
+
+ _free(dns_opt);
+}
+
+static int dns_send_conf_req(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr)
+{
+ struct dns_option_t *dns_opt=container_of(opt,typeof(*dns_opt),opt);
+ struct ipcp_opt32_t *opt32=(struct ipcp_opt32_t*)ptr;
+
+ if (!dns_opt->addr)
+ return 0;
+ opt32->hdr.id=dns_opt->opt.id;
+ opt32->hdr.len=6;
+ opt32->val=dns_opt->addr;
+ return 6;
+}
+
+static int dns_send_conf_nak(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr)
+{
+ struct dns_option_t *dns_opt=container_of(opt,typeof(*dns_opt),opt);
+ struct ipcp_opt32_t *opt32=(struct ipcp_opt32_t*)ptr;
+ opt32->hdr.id=dns_opt->opt.id;
+ opt32->hdr.len=6;
+ opt32->val=dns_opt->addr;
+ return 6;
+}
+
+static int dns_recv_conf_req(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr)
+{
+ struct dns_option_t *dns_opt=container_of(opt,typeof(*dns_opt),opt);
+ struct ipcp_opt32_t *opt32=(struct ipcp_opt32_t*)ptr;
+
+ if (opt32->hdr.len != 6)
+ return IPCP_OPT_REJ;
+
+ if (!dns_opt->addr)
+ {
+ if (dns_opt->opt.id == CI_DNS1 && conf_dns1) dns_opt->addr=conf_dns1;
+ else if (dns_opt->opt.id == CI_DNS2 && conf_dns2) dns_opt->addr=conf_dns2;
+
+ if (!dns_opt->addr)
+ {
+ dns_opt->addr=opt32->val;
+ return IPCP_OPT_ACK;
+ }
+ }
+
+ if (dns_opt->addr==opt32->val)
+ return IPCP_OPT_ACK;
+
+ return IPCP_OPT_NAK;
+}
+
+static void dns1_print(void (*print)(const char *fmt,...),struct ipcp_option_t *opt, uint8_t *ptr)
+{
+ struct dns_option_t *dns_opt=container_of(opt,typeof(*dns_opt),opt);
+ struct ipcp_opt32_t *opt32=(struct ipcp_opt32_t*)ptr;
+ struct in_addr in;
+
+ if (ptr) in.s_addr=opt32->val;
+ else in.s_addr=dns_opt->addr;
+
+ print("<dns1 %s>",inet_ntoa(in));
+}
+
+static void dns2_print(void (*print)(const char *fmt,...),struct ipcp_option_t *opt, uint8_t *ptr)
+{
+ struct dns_option_t *dns_opt=container_of(opt,typeof(*dns_opt),opt);
+ struct ipcp_opt32_t *opt32=(struct ipcp_opt32_t*)ptr;
+ struct in_addr in;
+
+ if (ptr) in.s_addr=opt32->val;
+ else in.s_addr=dns_opt->addr;
+
+ print("<dns2 %s>",inet_ntoa(in));
+}
+
+static void __init dns_opt_init()
+{
+ char *opt;
+
+ opt = conf_get_opt("dns", "dns1");
+ if (opt)
+ conf_dns1 = inet_addr(opt);
+
+ opt = conf_get_opt("dns", "dns2");
+ if (opt)
+ conf_dns2 = inet_addr(opt);
+
+ ipcp_option_register(&dns1_opt_hnd);
+ ipcp_option_register(&dns2_opt_hnd);
+}
diff --git a/accel-pptpd/ppp/ipcp_opt_ipaddr.c b/accel-pptpd/ppp/ipcp_opt_ipaddr.c
new file mode 100644
index 0000000..efbc41e
--- /dev/null
+++ b/accel-pptpd/ppp/ipcp_opt_ipaddr.c
@@ -0,0 +1,177 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <linux/if_ppp.h>
+
+#include "ppp.h"
+#include "ppp_ipcp.h"
+#include "log.h"
+#include "ipdb.h"
+#include "iprange.h"
+
+#include "memdebug.h"
+
+static struct ipcp_option_t *ipaddr_init(struct ppp_ipcp_t *ipcp);
+static void ipaddr_free(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt);
+static int ipaddr_send_conf_req(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr);
+static int ipaddr_send_conf_nak(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr);
+static int ipaddr_recv_conf_req(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr);
+//static int ipaddr_recv_conf_ack(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr);
+static void ipaddr_print(void (*print)(const char *fmt,...),struct ipcp_option_t*, uint8_t *ptr);
+
+struct ipaddr_option_t
+{
+ struct ipcp_option_t opt;
+ struct ipdb_item_t *ip;
+};
+
+static struct ipcp_option_handler_t ipaddr_opt_hnd=
+{
+ .init=ipaddr_init,
+ .send_conf_req=ipaddr_send_conf_req,
+ .send_conf_nak=ipaddr_send_conf_nak,
+ .recv_conf_req=ipaddr_recv_conf_req,
+ .free=ipaddr_free,
+ .print=ipaddr_print,
+};
+
+static struct ipcp_option_t *ipaddr_init(struct ppp_ipcp_t *ipcp)
+{
+ struct ipaddr_option_t *ipaddr_opt=_malloc(sizeof(*ipaddr_opt));
+ memset(ipaddr_opt,0,sizeof(*ipaddr_opt));
+ ipaddr_opt->opt.id=CI_ADDR;
+ ipaddr_opt->opt.len=6;
+
+ return &ipaddr_opt->opt;
+}
+
+static void ipaddr_free(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt)
+{
+ struct ipaddr_option_t *ipaddr_opt=container_of(opt,typeof(*ipaddr_opt),opt);
+
+ if (ipaddr_opt->ip)
+ ipdb_put(ipcp->ppp, ipaddr_opt->ip);
+
+ _free(ipaddr_opt);
+}
+
+static int ipaddr_send_conf_req(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr)
+{
+ struct ipaddr_option_t *ipaddr_opt=container_of(opt,typeof(*ipaddr_opt),opt);
+ struct ipcp_opt32_t *opt32=(struct ipcp_opt32_t*)ptr;
+
+ if (!ipaddr_opt->ip) {
+ ipaddr_opt->ip = ipdb_get(ipcp->ppp);
+ if (!ipaddr_opt->ip) {
+ log_ppp_warn("ppp:ipcp: no free IP address\n");
+ return -1;
+ }
+ }
+ if (!iprange_client_check(ipaddr_opt->ip->peer_addr)) {
+ log_ppp_warn("ppp:ipcp: to avoid hard loops requested IP cannot be assigned (%i.%i.%i.%i)\n",
+ ipaddr_opt->ip->peer_addr&0xff,
+ (ipaddr_opt->ip->peer_addr >> 8)&0xff,
+ (ipaddr_opt->ip->peer_addr >> 16)&0xff,
+ (ipaddr_opt->ip->peer_addr >> 24)&0xff);
+ return -1;
+ }
+
+ opt32->hdr.id=CI_ADDR;
+ opt32->hdr.len=6;
+ opt32->val=ipaddr_opt->ip->addr;
+ return 6;
+}
+
+static int ipaddr_send_conf_nak(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr)
+{
+ struct ipaddr_option_t *ipaddr_opt=container_of(opt,typeof(*ipaddr_opt),opt);
+ struct ipcp_opt32_t *opt32=(struct ipcp_opt32_t*)ptr;
+ opt32->hdr.id=CI_ADDR;
+ opt32->hdr.len=6;
+ opt32->val=ipaddr_opt->ip->peer_addr;
+ return 6;
+}
+
+static int ipaddr_recv_conf_req(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt, uint8_t *ptr)
+{
+ struct ipaddr_option_t *ipaddr_opt = container_of(opt,typeof(*ipaddr_opt), opt);
+ struct ipcp_opt32_t *opt32 = (struct ipcp_opt32_t*)ptr;
+ struct ifreq ifr;
+ struct sockaddr_in addr;
+ struct npioctl np;
+
+ if (opt32->hdr.len != 6)
+ return IPCP_OPT_REJ;
+
+ if (ipaddr_opt->ip->peer_addr == opt32->val)
+ goto ack;
+
+ /*if (!ipaddr_opt->peer_addr) {
+ ipaddr_opt->peer_addr = opt32->val;
+ goto ack;
+ }*/
+
+ return IPCP_OPT_NAK;
+
+ack:
+ ipcp->ppp->ipaddr = ipaddr_opt->ip->addr;
+ ipcp->ppp->peer_ipaddr = ipaddr_opt->ip->peer_addr;
+
+ memset(&ifr, 0, sizeof(ifr));
+ memset(&addr, 0, sizeof(addr));
+
+ strcpy(ifr.ifr_name, ipcp->ppp->ifname);
+
+ addr.sin_family = AF_INET;
+ addr.sin_addr.s_addr = ipaddr_opt->ip->addr;
+ memcpy(&ifr.ifr_addr,&addr,sizeof(addr));
+
+ if (ioctl(sock_fd, SIOCSIFADDR, &ifr))
+ log_ppp_error("ipcp: failed to set PA address: %s\n", strerror(errno));
+
+ addr.sin_addr.s_addr = ipaddr_opt->ip->peer_addr;
+ memcpy(&ifr.ifr_dstaddr,&addr,sizeof(addr));
+
+ if (ioctl(sock_fd, SIOCSIFDSTADDR, &ifr))
+ log_ppp_error("ipcp: failed to set remote PA address: %s\n", strerror(errno));
+
+ if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr))
+ log_ppp_error("ipcp: failed to get interface flags: %s\n", strerror(errno));
+
+ ifr.ifr_flags |= IFF_UP | IFF_POINTOPOINT;
+
+ if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr))
+ log_ppp_error("ipcp: failed to set interface flags: %s\n", strerror(errno));
+
+ np.protocol = PPP_IP;
+ np.mode = NPMODE_PASS;
+
+ if (ioctl(ipcp->ppp->unit_fd, PPPIOCSNPMODE, &np))
+ log_ppp_error("ipcp: failed to set NP mode: %s\n", strerror(errno));
+
+ return IPCP_OPT_ACK;
+}
+
+static void ipaddr_print(void (*print)(const char *fmt,...),struct ipcp_option_t *opt, uint8_t *ptr)
+{
+ struct ipaddr_option_t *ipaddr_opt=container_of(opt,typeof(*ipaddr_opt),opt);
+ struct ipcp_opt32_t *opt32=(struct ipcp_opt32_t*)ptr;
+ struct in_addr in = { .s_addr = 0, };
+
+ if (ptr)
+ in.s_addr = opt32->val;
+ else if (ipaddr_opt->ip)
+ in.s_addr = ipaddr_opt->ip->addr;
+
+ print("<addr %s>",inet_ntoa(in));
+}
+
+static void __init ipaddr_opt_init()
+{
+ ipcp_option_register(&ipaddr_opt_hnd);
+}
+
diff --git a/accel-pptpd/ppp/lcp_opt_accomp.c b/accel-pptpd/ppp/lcp_opt_accomp.c
new file mode 100644
index 0000000..241b0e0
--- /dev/null
+++ b/accel-pptpd/ppp/lcp_opt_accomp.c
@@ -0,0 +1,106 @@
+#include <stdlib.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+#include "ppp.h"
+#include "ppp_lcp.h"
+#include "log.h"
+
+#include "memdebug.h"
+
+static struct lcp_option_t *accomp_init(struct ppp_lcp_t *lcp);
+static void accomp_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt);
+static int accomp_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int accomp_send_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int accomp_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static void accomp_print(void (*print)(const char *fmt,...),struct lcp_option_t*, uint8_t *ptr);
+
+struct accomp_option_t
+{
+ struct lcp_option_t opt;
+ int accomp; // 0 - disabled, 1 - enabled, 2 - allow,disabled, 3 - allow,enabled
+ int require;
+};
+
+static struct lcp_option_handler_t accomp_opt_hnd=
+{
+ .init=accomp_init,
+ .send_conf_req=accomp_send_conf_req,
+ .send_conf_nak=accomp_send_conf_nak,
+ .recv_conf_req=accomp_recv_conf_req,
+ .free=accomp_free,
+ .print=accomp_print,
+};
+
+static struct lcp_option_t *accomp_init(struct ppp_lcp_t *lcp)
+{
+ struct accomp_option_t *accomp_opt=_malloc(sizeof(*accomp_opt));
+ memset(accomp_opt,0,sizeof(*accomp_opt));
+ accomp_opt->accomp=0;
+ accomp_opt->opt.id=CI_ACCOMP;
+ accomp_opt->opt.len=2;
+
+ return &accomp_opt->opt;
+}
+
+static void accomp_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt)
+{
+ struct accomp_option_t *accomp_opt=container_of(opt,typeof(*accomp_opt),opt);
+
+ _free(accomp_opt);
+}
+
+static int accomp_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct accomp_option_t *accomp_opt=container_of(opt,typeof(*accomp_opt),opt);
+ struct lcp_opt_hdr_t *opt0=(struct lcp_opt_hdr_t*)ptr;
+ if (accomp_opt->accomp==1 || accomp_opt->accomp==3)
+ {
+ opt0->id=CI_ACCOMP;
+ opt0->len=2;
+ return 2;
+ }
+ return 0;
+}
+
+static int accomp_send_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct accomp_option_t *accomp_opt=container_of(opt,typeof(*accomp_opt),opt);
+ struct lcp_opt_hdr_t *opt0=(struct lcp_opt_hdr_t*)ptr;
+ opt0->id=CI_ACCOMP;
+ opt0->len=2;
+ return 2;
+}
+
+static int accomp_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct accomp_option_t *accomp_opt=container_of(opt,typeof(*accomp_opt),opt);
+ struct lcp_opt_hdr_t *opt0=(struct lcp_opt_hdr_t*)ptr;
+
+ /*if (!ptr) {
+ if (accomp_opt->require)
+ return LCP_OPT_NAK;
+ accomp_opt->accomp=0;
+ return LCP_OPT_ACK;
+ }*/
+
+ if (opt0->len != 2)
+ return LCP_OPT_REJ;
+
+ if (accomp_opt->accomp>0)
+ {
+ accomp_opt->accomp=1;
+ return LCP_OPT_ACK;
+ }else return LCP_OPT_REJ;
+}
+
+static void accomp_print(void (*print)(const char *fmt,...),struct lcp_option_t *opt, uint8_t *ptr)
+{
+ print("<accomp>");
+}
+
+static void __init accomp_opt_init()
+{
+ lcp_option_register(&accomp_opt_hnd);
+}
+
diff --git a/accel-pptpd/ppp/lcp_opt_magic.c b/accel-pptpd/ppp/lcp_opt_magic.c
new file mode 100644
index 0000000..4a61ef9
--- /dev/null
+++ b/accel-pptpd/ppp/lcp_opt_magic.c
@@ -0,0 +1,91 @@
+#include <stdlib.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+#include "ppp.h"
+#include "ppp_lcp.h"
+#include "log.h"
+
+#include "memdebug.h"
+
+static struct lcp_option_t *magic_init(struct ppp_lcp_t *lcp);
+static void magic_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt);
+static int magic_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int magic_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static void magic_print(void (*print)(const char *fmt,...),struct lcp_option_t*, uint8_t *ptr);
+
+struct magic_option_t
+{
+ struct lcp_option_t opt;
+ int magic;
+};
+
+static struct lcp_option_handler_t magic_opt_hnd=
+{
+ .init=magic_init,
+ .send_conf_req=magic_send_conf_req,
+ .recv_conf_req=magic_recv_conf_req,
+ .free=magic_free,
+ .print=magic_print,
+};
+
+static struct lcp_option_t *magic_init(struct ppp_lcp_t *lcp)
+{
+ struct magic_option_t *magic_opt=_malloc(sizeof(*magic_opt));
+ memset(magic_opt,0,sizeof(*magic_opt));
+ magic_opt->magic=random();
+ magic_opt->opt.id=CI_MAGIC;
+ magic_opt->opt.len=6;
+
+ lcp->magic = magic_opt->magic;
+
+ return &magic_opt->opt;
+}
+
+static void magic_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt)
+{
+ struct magic_option_t *magic_opt=container_of(opt,typeof(*magic_opt),opt);
+
+ _free(magic_opt);
+}
+
+static int magic_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct magic_option_t *magic_opt=container_of(opt,typeof(*magic_opt),opt);
+ struct lcp_opt32_t *opt32=(struct lcp_opt32_t*)ptr;
+ opt32->hdr.id=CI_MAGIC;
+ opt32->hdr.len=6;
+ opt32->val=htonl(magic_opt->magic);
+ return 6;
+}
+
+static int magic_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct magic_option_t *magic_opt=container_of(opt,typeof(*magic_opt),opt);
+ struct lcp_opt32_t *opt32=(struct lcp_opt32_t*)ptr;
+
+ /*if (!ptr)
+ return LCP_OPT_NAK;*/
+
+ if (opt32->hdr.len != 6)
+ return LCP_OPT_REJ;
+
+ if (magic_opt->magic==ntohl(opt32->val))
+ {
+ log_ppp_error("loop detected");
+ return -1;
+ }
+ return LCP_OPT_ACK;
+}
+
+static void magic_print(void (*print)(const char *fmt,...),struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct magic_option_t *magic_opt=container_of(opt,typeof(*magic_opt),opt);
+
+ print("<magic %04x>",magic_opt->magic);
+}
+
+static void __init magic_opt_init()
+{
+ lcp_option_register(&magic_opt_hnd);
+}
diff --git a/accel-pptpd/ppp/lcp_opt_mru.c b/accel-pptpd/ppp/lcp_opt_mru.c
new file mode 100644
index 0000000..eab57b0
--- /dev/null
+++ b/accel-pptpd/ppp/lcp_opt_mru.c
@@ -0,0 +1,159 @@
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <linux/if_ppp.h>
+#include <sys/ioctl.h>
+
+#include "ppp.h"
+#include "ppp_lcp.h"
+#include "log.h"
+
+#include "memdebug.h"
+
+static int conf_mtu;
+static int conf_mru;
+static int conf_min_mtu = 100;
+static int conf_max_mtu = 1500;
+
+static struct lcp_option_t *mru_init(struct ppp_lcp_t *lcp);
+static void mru_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt);
+static int mru_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int mru_send_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int mru_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int mru_recv_conf_ack(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static void mru_print(void (*print)(const char *fmt,...),struct lcp_option_t*, uint8_t *ptr);
+
+struct mru_option_t
+{
+ struct lcp_option_t opt;
+ int mru;
+ int mtu;
+};
+
+static struct lcp_option_handler_t mru_opt_hnd=
+{
+ .init=mru_init,
+ .send_conf_req=mru_send_conf_req,
+ .send_conf_nak=mru_send_conf_nak,
+ .recv_conf_req=mru_recv_conf_req,
+ .recv_conf_ack=mru_recv_conf_ack,
+ .free=mru_free,
+ .print=mru_print,
+};
+
+static struct lcp_option_t *mru_init(struct ppp_lcp_t *lcp)
+{
+ struct mru_option_t *mru_opt=_malloc(sizeof(*mru_opt));
+ memset(mru_opt, 0, sizeof(*mru_opt));
+ mru_opt->mru = (conf_mru && conf_mru <= lcp->ppp->ctrl->max_mtu) ? conf_mru : lcp->ppp->ctrl->max_mtu;
+ if (mru_opt->mru > conf_max_mtu)
+ mru_opt->mru = conf_max_mtu;
+ mru_opt->mtu = (conf_mtu && conf_mtu <= lcp->ppp->ctrl->max_mtu) ? conf_mtu : lcp->ppp->ctrl->max_mtu;
+ if (mru_opt->mtu > conf_max_mtu)
+ mru_opt->mtu = conf_max_mtu;
+ mru_opt->opt.id = CI_MRU;
+ mru_opt->opt.len = 4;
+
+ return &mru_opt->opt;
+}
+
+static void mru_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt)
+{
+ struct mru_option_t *mru_opt = container_of(opt, typeof(*mru_opt), opt);
+
+ _free(mru_opt);
+}
+
+static int mru_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct mru_option_t *mru_opt = container_of(opt,typeof(*mru_opt),opt);
+ struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr;
+ opt16->hdr.id = CI_MRU;
+ opt16->hdr.len = 4;
+ opt16->val = htons(mru_opt->mru);
+ return 4;
+}
+
+static int mru_send_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct mru_option_t *mru_opt = container_of(opt,typeof(*mru_opt),opt);
+ struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr;
+ opt16->hdr.id = CI_MRU;
+ opt16->hdr.len = 4;
+ opt16->val = htons(mru_opt->mtu);
+ return 4;
+}
+
+static int mru_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct mru_option_t *mru_opt = container_of(opt,typeof(*mru_opt),opt);
+ struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr;
+
+ /*if (!ptr)
+ return LCP_OPT_NAK;*/
+
+ if (opt16->hdr.len != 4)
+ return LCP_OPT_REJ;
+
+ if (ntohs(opt16->val) < conf_min_mtu || ntohs(opt16->val) > lcp->ppp->ctrl->max_mtu || ntohs(opt16->val) > conf_max_mtu)
+ return LCP_OPT_NAK;
+
+ mru_opt->mtu = ntohs(opt16->val);
+ return LCP_OPT_ACK;
+}
+
+static int mru_recv_conf_ack(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct mru_option_t *mru_opt = container_of(opt,typeof(*mru_opt), opt);
+ struct ifreq ifr = {
+ .ifr_mtu = mru_opt->mtu,
+ };
+
+ strcpy(ifr.ifr_name, lcp->ppp->ifname);
+
+ if (ioctl(lcp->ppp->unit_fd, PPPIOCSMRU, &mru_opt->mru))
+ log_ppp_error("lcp:mru: failed to set MRU: %s\n", strerror(errno));
+
+ if (ioctl(sock_fd, SIOCSIFMTU, &ifr))
+ log_ppp_error("lcp:mru: failed to set MTU: %s\n", strerror(errno));
+
+ return 0;
+}
+
+static void mru_print(void (*print)(const char *fmt,...), struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct mru_option_t *mru_opt = container_of(opt, typeof(*mru_opt), opt);
+ struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr;
+
+ if (ptr)
+ print("<mru %i>",ntohs(opt16->val));
+ else
+ print("<mru %i>",mru_opt->mru);
+}
+
+static void __init mru_opt_init()
+{
+ char *opt;
+
+ opt = conf_get_opt("ppp", "mtu");
+ if (opt && atoi(opt) > 0)
+ conf_mtu = atoi(opt);
+
+ opt = conf_get_opt("ppp", "mru");
+ if (opt && atoi(opt) > 0)
+ conf_mru = atoi(opt);
+
+ opt = conf_get_opt("ppp", "min-mtu");
+ if (opt && atoi(opt) > 0)
+ conf_min_mtu = atoi(opt);
+
+ opt = conf_get_opt("ppp", "max-mtu");
+ if (opt && atoi(opt) > 0)
+ conf_max_mtu = atoi(opt);
+
+ lcp_option_register(&mru_opt_hnd);
+}
+
diff --git a/accel-pptpd/ppp/lcp_opt_pcomp.c b/accel-pptpd/ppp/lcp_opt_pcomp.c
new file mode 100644
index 0000000..1f8532b
--- /dev/null
+++ b/accel-pptpd/ppp/lcp_opt_pcomp.c
@@ -0,0 +1,106 @@
+#include <stdlib.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+#include "ppp.h"
+#include "ppp_lcp.h"
+#include "log.h"
+
+#include "memdebug.h"
+
+static struct lcp_option_t *pcomp_init(struct ppp_lcp_t *lcp);
+static void pcomp_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt);
+static int pcomp_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int pcomp_send_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int pcomp_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static void pcomp_print(void (*print)(const char *fmt,...),struct lcp_option_t*, uint8_t *ptr);
+
+struct pcomp_option_t
+{
+ struct lcp_option_t opt;
+ int pcomp; // 0 - disabled, 1 - enabled, 2 - allow,disabled, 3 - allow,enabled
+ int require;
+};
+
+static struct lcp_option_handler_t pcomp_opt_hnd=
+{
+ .init=pcomp_init,
+ .send_conf_req=pcomp_send_conf_req,
+ .send_conf_nak=pcomp_send_conf_nak,
+ .recv_conf_req=pcomp_recv_conf_req,
+ .free=pcomp_free,
+ .print=pcomp_print,
+};
+
+static struct lcp_option_t *pcomp_init(struct ppp_lcp_t *lcp)
+{
+ struct pcomp_option_t *pcomp_opt=_malloc(sizeof(*pcomp_opt));
+ memset(pcomp_opt,0,sizeof(*pcomp_opt));
+ pcomp_opt->pcomp=0;
+ pcomp_opt->opt.id=CI_PCOMP;
+ pcomp_opt->opt.len=2;
+
+ return &pcomp_opt->opt;
+}
+
+static void pcomp_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt)
+{
+ struct pcomp_option_t *pcomp_opt=container_of(opt,typeof(*pcomp_opt),opt);
+
+ _free(pcomp_opt);
+}
+
+static int pcomp_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct pcomp_option_t *pcomp_opt=container_of(opt,typeof(*pcomp_opt),opt);
+ struct lcp_opt_hdr_t *opt0=(struct lcp_opt_hdr_t*)ptr;
+ if (pcomp_opt->pcomp==1 || pcomp_opt->pcomp==3)
+ {
+ opt0->id=CI_PCOMP;
+ opt0->len=2;
+ return 2;
+ }
+ return 0;
+}
+
+static int pcomp_send_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct pcomp_option_t *pcomp_opt=container_of(opt,typeof(*pcomp_opt),opt);
+ struct lcp_opt_hdr_t *opt0=(struct lcp_opt_hdr_t*)ptr;
+ opt0->id=CI_PCOMP;
+ opt0->len=2;
+ return 2;
+}
+
+static int pcomp_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct pcomp_option_t *pcomp_opt=container_of(opt,typeof(*pcomp_opt),opt);
+ struct lcp_opt_hdr_t *opt0=(struct lcp_opt_hdr_t*)ptr;
+
+ /*if (!ptr) {
+ if (pcomp_opt->require)
+ return LCP_OPT_NAK;
+ pcomp_opt->pcomp=0;
+ return LCP_OPT_ACK;
+ }*/
+
+ if (opt0->len != 2)
+ return LCP_OPT_REJ;
+
+ if (pcomp_opt->pcomp>0)
+ {
+ pcomp_opt->pcomp=1;
+ return LCP_OPT_ACK;
+ }else return LCP_OPT_REJ;
+}
+
+static void pcomp_print(void (*print)(const char *fmt,...),struct lcp_option_t *opt, uint8_t *ptr)
+{
+ print("<pcomp>");
+}
+
+static void __init pcomp_opt_init()
+{
+ lcp_option_register(&pcomp_opt_hnd);
+}
+
diff --git a/accel-pptpd/ppp/ppp.c b/accel-pptpd/ppp/ppp.c
new file mode 100644
index 0000000..3e51ecb
--- /dev/null
+++ b/accel-pptpd/ppp/ppp.c
@@ -0,0 +1,537 @@
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+#include <arpa/inet.h>
+#include <linux/ppp_defs.h>
+#include <linux/if_ppp.h>
+#include <openssl/md5.h>
+
+#include "triton.h"
+
+#include "events.h"
+#include "ppp.h"
+#include "ppp_fsm.h"
+#include "log.h"
+
+#include "memdebug.h"
+
+int __export conf_ppp_verbose;
+
+static LIST_HEAD(layers);
+int __export sock_fd;
+
+struct layer_node_t
+{
+ struct list_head entry;
+ int order;
+ struct list_head items;
+};
+
+static int ppp_chan_read(struct triton_md_handler_t*);
+static int ppp_unit_read(struct triton_md_handler_t*);
+static void init_layers(struct ppp_t *);
+static void _free_layers(struct ppp_t *);
+static void start_first_layer(struct ppp_t *);
+
+void __export ppp_init(struct ppp_t *ppp)
+{
+ memset(ppp,0,sizeof(*ppp));
+ INIT_LIST_HEAD(&ppp->layers);
+ INIT_LIST_HEAD(&ppp->chan_handlers);
+ INIT_LIST_HEAD(&ppp->unit_handlers);
+ INIT_LIST_HEAD(&ppp->pd_list);
+}
+
+static void _free_ppp(struct ppp_t *ppp)
+{
+ _free(ppp->chan_buf);
+ _free(ppp->unit_buf);
+
+ if (ppp->username)
+ _free(ppp->username);
+}
+
+static void generate_sessionid(struct ppp_t *ppp)
+{
+ MD5_CTX ctx;
+ uint8_t md5[MD5_DIGEST_LENGTH];
+ int i;
+
+ MD5_Init(&ctx);
+ MD5_Update(&ctx,&ppp->unit_idx, 4);
+ MD5_Update(&ctx,&ppp->unit_fd, 4);
+ MD5_Update(&ctx,&ppp->chan_fd, 4);
+ MD5_Update(&ctx,&ppp->fd, 4);
+ MD5_Update(&ctx,&ppp->start_time, sizeof(time_t));
+ MD5_Update(&ctx,ppp->ctrl->ctx, sizeof(void *));
+ MD5_Final(md5,&ctx);
+
+ for( i = 0; i < 16; i++)
+ sprintf(ppp->sessionid + i*2, "%02X", md5[i]);
+}
+
+int __export establish_ppp(struct ppp_t *ppp)
+{
+ /* Open an instance of /dev/ppp and connect the channel to it */
+ if (ioctl(ppp->fd, PPPIOCGCHAN, &ppp->chan_idx) == -1) {
+ log_ppp_error("Couldn't get channel number\n");
+ return -1;
+ }
+
+ ppp->chan_fd = open("/dev/ppp", O_RDWR);
+ if (ppp->chan_fd < 0) {
+ log_ppp_error("Couldn't reopen /dev/ppp\n");
+ return -1;
+ }
+
+ if (ioctl(ppp->chan_fd, PPPIOCATTCHAN, &ppp->chan_idx) < 0) {
+ log_ppp_error("Couldn't attach to channel %d\n", ppp->chan_idx);
+ goto exit_close_chan;
+ }
+
+ ppp->unit_fd = open("/dev/ppp", O_RDWR);
+ if (ppp->unit_fd < 0) {
+ log_ppp_error("Couldn't reopen /dev/ppp\n");
+ goto exit_close_chan;
+ }
+
+ ppp->unit_idx = -1;
+ if (ioctl(ppp->unit_fd, PPPIOCNEWUNIT, &ppp->unit_idx) < 0) {
+ log_ppp_error("Couldn't create new ppp unit\n");
+ goto exit_close_unit;
+ }
+
+ if (ioctl(ppp->chan_fd, PPPIOCCONNECT, &ppp->unit_idx) < 0) {
+ log_ppp_error("Couldn't attach to PPP unit %d\n", ppp->unit_idx);
+ goto exit_close_unit;
+ }
+
+ if (fcntl(ppp->chan_fd, F_SETFL, O_NONBLOCK)) {
+ log_ppp_error("ppp: cann't to set nonblocking mode: %s\n", strerror(errno));
+ goto exit_close_unit;
+ }
+
+ if (fcntl(ppp->unit_fd, F_SETFL, O_NONBLOCK)) {
+ log_ppp_error("ppp: cann't to set nonblocking mode: %s\n", strerror(errno));
+ goto exit_close_unit;
+ }
+
+ ppp->start_time = time(NULL);
+ generate_sessionid(ppp);
+ sprintf(ppp->ifname, "ppp%i", ppp->unit_idx);
+
+ if (conf_ppp_verbose)
+ log_ppp_info("connect: %s <--> %s(%s)\n", ppp->ifname, ppp->ctrl->name, ppp->chan_name);
+
+ init_layers(ppp);
+
+ if (list_empty(&ppp->layers)) {
+ log_ppp_error("no layers to start\n");
+ goto exit_close_unit;
+ }
+
+ ppp->chan_buf = _malloc(PPP_MRU);
+ ppp->unit_buf = _malloc(PPP_MRU);
+
+ ppp->chan_hnd.fd = ppp->chan_fd;
+ ppp->chan_hnd.read = ppp_chan_read;
+ ppp->unit_hnd.fd = ppp->unit_fd;
+ ppp->unit_hnd.read = ppp_unit_read;
+ triton_md_register_handler(ppp->ctrl->ctx, &ppp->chan_hnd);
+ triton_md_register_handler(ppp->ctrl->ctx, &ppp->unit_hnd);
+
+ triton_md_enable_handler(&ppp->chan_hnd, MD_MODE_READ);
+ triton_md_enable_handler(&ppp->unit_hnd, MD_MODE_READ);
+
+ log_ppp_debug("ppp established\n");
+
+ triton_event_fire(EV_PPP_STARTING, ppp);
+
+ start_first_layer(ppp);
+
+ return 0;
+
+exit_close_unit:
+ close(ppp->unit_fd);
+exit_close_chan:
+ close(ppp->chan_fd);
+
+ _free_ppp(ppp);
+
+ return -1;
+}
+
+static void destablish_ppp(struct ppp_t *ppp)
+{
+ triton_md_unregister_handler(&ppp->chan_hnd);
+ triton_md_unregister_handler(&ppp->unit_hnd);
+
+ close(ppp->unit_fd);
+ close(ppp->chan_fd);
+ close(ppp->fd);
+
+ ppp->unit_fd = -1;
+ ppp->chan_fd = -1;
+
+ _free(ppp->unit_buf);
+ _free(ppp->chan_buf);
+
+ _free_layers(ppp);
+
+ log_ppp_debug("ppp destablished\n");
+
+ triton_event_fire(EV_PPP_FINISHED, ppp);
+ ppp->ctrl->finished(ppp);
+
+ if (ppp->username) {
+ _free(ppp->username);
+ ppp->username = NULL;
+ }
+}
+
+/*void print_buf(uint8_t *buf, int size)
+{
+ int i;
+ for(i=0;i<size;i++)
+ printf("%x ",buf[i]);
+ printf("\n");
+}*/
+
+int __export ppp_chan_send(struct ppp_t *ppp, void *data, int size)
+{
+ int n;
+
+ //printf("ppp_chan_send: ");
+ //print_buf((uint8_t*)data,size);
+
+ n = write(ppp->chan_fd,data,size);
+ if (n < size)
+ log_ppp_error("ppp_chan_send: short write %i, excpected %i\n", n, size);
+ return n;
+}
+
+int __export ppp_unit_send(struct ppp_t *ppp, void *data, int size)
+{
+ int n;
+
+ //printf("ppp_unit_send: ");
+ //print_buf((uint8_t*)data,size);
+
+ n=write(ppp->unit_fd, data, size);
+ if (n < size)
+ log_ppp_error("ppp_unit_send: short write %i, excpected %i\n",n,size);
+ return n;
+}
+
+static int ppp_chan_read(struct triton_md_handler_t *h)
+{
+ struct ppp_t *ppp = container_of(h, typeof(*ppp), chan_hnd);
+ struct ppp_handler_t *ppp_h;
+ uint16_t proto;
+
+ while(1) {
+cont:
+ ppp->chan_buf_size = read(h->fd, ppp->chan_buf, PPP_MRU);
+ if (ppp->chan_buf_size < 0) {
+ if (errno == EAGAIN)
+ return 0;
+ log_ppp_error("ppp_chan_read: %s\n", strerror(errno));
+ return 0;
+ }
+
+ //printf("ppp_chan_read: ");
+ //print_buf(ppp->chan_buf,ppp->chan_buf_size);
+
+ if (ppp->chan_buf_size < 2) {
+ log_ppp_error("ppp_chan_read: short read %i\n", ppp->chan_buf_size);
+ continue;
+ }
+
+ proto = ntohs(*(uint16_t*)ppp->chan_buf);
+ list_for_each_entry(ppp_h, &ppp->chan_handlers, entry) {
+ if (ppp_h->proto == proto) {
+ ppp_h->recv(ppp_h);
+ if (ppp->chan_fd == -1) {
+ ppp->ctrl->finished(ppp);
+ return 1;
+ }
+ goto cont;
+ }
+ }
+
+ lcp_send_proto_rej(ppp, proto);
+ //log_ppp_warn("ppp_chan_read: discarding unknown packet %x\n", proto);
+ }
+}
+
+static int ppp_unit_read(struct triton_md_handler_t *h)
+{
+ struct ppp_t *ppp = container_of(h, typeof(*ppp), unit_hnd);
+ struct ppp_handler_t *ppp_h;
+ uint16_t proto;
+
+ while (1) {
+cont:
+ ppp->unit_buf_size = read(h->fd, ppp->unit_buf, PPP_MRU);
+ if (ppp->unit_buf_size < 0) {
+ if (errno == EAGAIN)
+ return 0;
+ log_ppp_error("ppp_chan_read: %s\n",strerror(errno));
+ return 0;
+ }
+
+ md_check(ppp->unit_buf);
+ //printf("ppp_unit_read: ");
+ //print_buf(ppp->unit_buf,ppp->unit_buf_size);
+
+ if (ppp->unit_buf_size < 2) {
+ log_ppp_error("ppp_chan_read: short read %i\n", ppp->unit_buf_size);
+ continue;
+ }
+
+ proto=ntohs(*(uint16_t*)ppp->unit_buf);
+ list_for_each_entry(ppp_h, &ppp->unit_handlers, entry) {
+ if (ppp_h->proto == proto) {
+ ppp_h->recv(ppp_h);
+ if (ppp->unit_fd == -1) {
+ ppp->ctrl->finished(ppp);
+ return 1;
+ }
+ goto cont;
+ }
+ }
+ lcp_send_proto_rej(ppp, proto);
+ //log_ppp_warn("ppp_unit_read: discarding unknown packet %x\n", proto);
+ }
+}
+
+void __export ppp_layer_started(struct ppp_t *ppp, struct ppp_layer_data_t *d)
+{
+ struct layer_node_t *n = d->node;
+
+ if (d->started)
+ return;
+
+ d->started = 1;
+
+ list_for_each_entry(d, &n->items, entry)
+ if (!d->started) return;
+
+ if (n->entry.next == &ppp->layers) {
+ ppp->ctrl->started(ppp);
+ triton_event_fire(EV_PPP_STARTED, ppp);
+ } else {
+ n = list_entry(n->entry.next, typeof(*n), entry);
+ list_for_each_entry(d, &n->items, entry) {
+ d->starting = 1;
+ if (d->layer->start(d)) {
+ ppp_terminate(ppp, 0);
+ return;
+ }
+ }
+ }
+}
+
+void __export ppp_layer_finished(struct ppp_t *ppp, struct ppp_layer_data_t *d)
+{
+ struct layer_node_t *n = d->node;
+
+ d->finished = 1;
+ d->starting = 0;
+
+ list_for_each_entry(n, &ppp->layers, entry) {
+ list_for_each_entry(d, &n->items, entry) {
+ if (!d->finished)
+ return;
+ }
+ }
+
+ destablish_ppp(ppp);
+}
+
+void __export ppp_terminate(struct ppp_t *ppp, int hard)
+{
+ struct layer_node_t *n;
+ struct ppp_layer_data_t *d;
+ int s = 0;
+
+ if (ppp->terminating) {
+ if (hard)
+ destablish_ppp(ppp);
+ return;
+ }
+
+ ppp->terminating = 1;
+
+ log_ppp_debug("ppp_terminate\n");
+
+ triton_event_fire(EV_PPP_FINISHING, ppp);
+
+ if (hard) {
+ destablish_ppp(ppp);
+ return;
+ }
+
+ list_for_each_entry(n,&ppp->layers,entry) {
+ list_for_each_entry(d,&n->items,entry) {
+ if (d->starting) {
+ s = 1;
+ d->layer->finish(d);
+ }
+ }
+ }
+ if (s)
+ return;
+ destablish_ppp(ppp);
+}
+
+void __export ppp_register_chan_handler(struct ppp_t *ppp,struct ppp_handler_t *h)
+{
+ list_add_tail(&h->entry,&ppp->chan_handlers);
+}
+void __export ppp_register_unit_handler(struct ppp_t *ppp,struct ppp_handler_t *h)
+{
+ list_add_tail(&h->entry,&ppp->unit_handlers);
+}
+void __export ppp_unregister_handler(struct ppp_t *ppp,struct ppp_handler_t *h)
+{
+ list_del(&h->entry);
+}
+
+static int get_layer_order(const char *name)
+{
+ if (!strcmp(name,"lcp")) return 0;
+ if (!strcmp(name,"auth")) return 1;
+ if (!strcmp(name,"ccp")) return 2;
+ if (!strcmp(name,"ipcp")) return 3;
+ return -1;
+}
+
+int __export ppp_register_layer(const char *name, struct ppp_layer_t *layer)
+{
+ int order;
+ struct layer_node_t *n,*n1;
+
+ order = get_layer_order(name);
+
+ if (order < 0)
+ return order;
+
+ list_for_each_entry(n, &layers, entry) {
+ if (order > n->order)
+ continue;
+ if (order < n->order) {
+ n1 = _malloc(sizeof(*n1));
+ memset(n1, 0, sizeof(*n1));
+ n1->order = order;
+ INIT_LIST_HEAD(&n1->items);
+ list_add_tail(&n1->entry, &n->entry);
+ n = n1;
+ }
+ goto insert;
+ }
+ n1 = _malloc(sizeof(*n1));
+ memset(n1, 0, sizeof(*n1));
+ n1->order = order;
+ INIT_LIST_HEAD(&n1->items);
+ list_add_tail(&n1->entry, &layers);
+ n = n1;
+insert:
+ list_add_tail(&layer->entry, &n->items);
+
+ return 0;
+}
+void __export ppp_unregister_layer(struct ppp_layer_t *layer)
+{
+ list_del(&layer->entry);
+}
+
+static void init_layers(struct ppp_t *ppp)
+{
+ struct layer_node_t *n, *n1;
+ struct ppp_layer_t *l;
+ struct ppp_layer_data_t *d;
+
+ list_for_each_entry(n,&layers,entry) {
+ n1 = _malloc(sizeof(*n1));
+ memset(n1, 0, sizeof(*n1));
+ INIT_LIST_HEAD(&n1->items);
+ list_add_tail(&n1->entry, &ppp->layers);
+ list_for_each_entry(l, &n->items, entry) {
+ d = l->init(ppp);
+ d->layer = l;
+ d->started = 0;
+ d->node = n1;
+ list_add_tail(&d->entry, &n1->items);
+ }
+ }
+}
+
+static void _free_layers(struct ppp_t *ppp)
+{
+ struct layer_node_t *n;
+ struct ppp_layer_data_t *d;
+
+ while (!list_empty(&ppp->layers)) {
+ n = list_entry(ppp->layers.next, typeof(*n), entry);
+ while (!list_empty(&n->items)) {
+ d = list_entry(n->items.next, typeof(*d), entry);
+ list_del(&d->entry);
+ d->layer->free(d);
+ }
+ list_del(&n->entry);
+ _free(n);
+ }
+}
+
+static void start_first_layer(struct ppp_t *ppp)
+{
+ struct layer_node_t *n;
+ struct ppp_layer_data_t *d;
+
+ n = list_entry(ppp->layers.next, typeof(*n), entry);
+ list_for_each_entry(d, &n->items, entry) {
+ d->starting = 1;
+ if (d->layer->start(d)) {
+ ppp_terminate(ppp, 0);
+ return;
+ }
+ }
+}
+
+struct ppp_layer_data_t *ppp_find_layer_data(struct ppp_t *ppp, struct ppp_layer_t *layer)
+{
+ struct layer_node_t *n;
+ struct ppp_layer_data_t *d;
+
+ list_for_each_entry(n,&ppp->layers,entry) {
+ list_for_each_entry(d,&n->items,entry) {
+ if (d->layer == layer)
+ return d;
+ }
+ }
+
+ return NULL;
+}
+
+static void __init init(void)
+{
+ char *opt;
+
+ sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (sock_fd < 0) {
+ perror("socket");
+ _exit(EXIT_FAILURE);
+ }
+
+ opt = conf_get_opt("ppp", "verbose");
+ if (opt && atoi(opt) > 0)
+ conf_ppp_verbose = 1;
+}
+
diff --git a/accel-pptpd/ppp/ppp.h b/accel-pptpd/ppp/ppp.h
new file mode 100644
index 0000000..fb6b20f
--- /dev/null
+++ b/accel-pptpd/ppp/ppp.h
@@ -0,0 +1,158 @@
+#ifndef PPP_H
+#define PPP_H
+
+#include <sys/types.h>
+#include <time.h>
+#include <netinet/in.h>
+
+#include "triton.h"
+#include "list.h"
+
+/*
+ * Packet header = Code, id, length.
+ */
+#define PPP_HEADERLEN 4
+#define PPP_MTU 1500
+
+
+/*
+ * Protocol field values.
+ */
+#define PPP_IP 0x21 /* Internet Protocol */
+#define PPP_AT 0x29 /* AppleTalk Protocol */
+#define PPP_IPX 0x2b /* IPX protocol */
+#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */
+#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */
+#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */
+#define PPP_COMP 0xfd /* compressed packet */
+#define PPP_IPCP 0x8021 /* IP Control Protocol */
+#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */
+#define PPP_IPXCP 0x802b /* IPX Control Protocol */
+#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
+#define PPP_CCP 0x80fd /* Compression Control Protocol */
+#define PPP_ECP 0x8053 /* Encryption Control Protocol */
+#define PPP_LCP 0xc021 /* Link Control Protocol */
+#define PPP_PAP 0xc023 /* Password Authentication Protocol */
+#define PPP_LQR 0xc025 /* Link Quality Report protocol */
+#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */
+#define PPP_CBCP 0xc029 /* Callback Control Protocol */
+#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */
+
+#define PPP_LAYER_LCP 1
+#define PPP_LAYER_AUTH 2
+#define PPP_LAYER_CCP 3
+#define PPP_LAYER_IPCP 4
+
+#define PPP_SESSIONID_LEN 32
+#define PPP_IFNAME_LEN 10
+
+struct ppp_t;
+
+struct ppp_ctrl_t
+{
+ struct triton_context_t *ctx;
+ const char *name;
+ int max_mtu;
+ char *calling_station_id;
+ char *called_station_id;
+ void (*started)(struct ppp_t*);
+ void (*finished)(struct ppp_t*);
+};
+
+struct ppp_pd_t
+{
+ struct list_head entry;
+ void *key;
+};
+
+struct ppp_t
+{
+ struct triton_md_handler_t chan_hnd;
+ struct triton_md_handler_t unit_hnd;
+ int fd;
+ int chan_fd;
+ int unit_fd;
+
+ int chan_idx;
+ int unit_idx;
+
+ char *chan_name;
+ char ifname[PPP_IFNAME_LEN];
+ char sessionid[PPP_SESSIONID_LEN+1];
+ time_t start_time;
+ char *username;
+ in_addr_t ipaddr;
+ in_addr_t peer_ipaddr;
+
+ struct ppp_ctrl_t *ctrl;
+
+ int log:1;
+ int terminating:1;
+
+ void *chan_buf;
+ int chan_buf_size;
+ void *unit_buf;
+ int unit_buf_size;
+
+ struct list_head chan_handlers;
+ struct list_head unit_handlers;
+
+ struct list_head layers;
+
+ struct ppp_lcp_t *lcp;
+
+ struct list_head pd_list;
+};
+
+struct ppp_layer_t;
+struct layer_node_t;
+struct ppp_layer_data_t
+{
+ struct list_head entry;
+ struct ppp_layer_t *layer;
+ struct layer_node_t *node;
+ int starting:1;
+ int started:1;
+ int finished:1;
+};
+
+struct ppp_layer_t
+{
+ struct list_head entry;
+ struct ppp_layer_data_t *(*init)(struct ppp_t *);
+ int (*start)(struct ppp_layer_data_t*);
+ void (*finish)(struct ppp_layer_data_t*);
+ void (*free)(struct ppp_layer_data_t *);
+};
+
+struct ppp_handler_t
+{
+ struct list_head entry;
+ int proto;
+ void (*recv)(struct ppp_handler_t*);
+};
+
+struct ppp_t *alloc_ppp(void);
+void ppp_init(struct ppp_t *ppp);
+int establish_ppp(struct ppp_t *ppp);
+int ppp_chan_send(struct ppp_t *ppp, void *data, int size);
+int ppp_unit_send(struct ppp_t *ppp, void *data, int size);
+void lcp_send_proto_rej(struct ppp_t *ppp, uint16_t proto);
+
+struct ppp_fsm_t* ppp_lcp_init(struct ppp_t *ppp);
+void ppp_layer_started(struct ppp_t *ppp,struct ppp_layer_data_t*);
+void ppp_layer_finished(struct ppp_t *ppp,struct ppp_layer_data_t*);
+void ppp_terminate(struct ppp_t *ppp, int hard);
+
+void ppp_register_chan_handler(struct ppp_t *, struct ppp_handler_t *);
+void ppp_register_unit_handler(struct ppp_t * ,struct ppp_handler_t *);
+void ppp_unregister_handler(struct ppp_t *, struct ppp_handler_t *);
+
+int ppp_register_layer(const char *name, struct ppp_layer_t *);
+void ppp_unregister_layer(struct ppp_layer_t *);
+struct ppp_layer_data_t *ppp_find_layer_data(struct ppp_t *, struct ppp_layer_t *);
+
+extern int conf_ppp_verbose;
+
+extern int sock_fd; // internet socket for ioctls
+#endif
diff --git a/accel-pptpd/ppp/ppp_auth.c b/accel-pptpd/ppp/ppp_auth.c
new file mode 100644
index 0000000..65ca223
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_auth.c
@@ -0,0 +1,326 @@
+#include <stdlib.h>
+#include <string.h>
+#include <arpa/inet.h>
+
+#include "ppp.h"
+#include "events.h"
+#include "ppp_lcp.h"
+#include "log.h"
+
+#include "ppp_auth.h"
+
+#include "memdebug.h"
+
+static LIST_HEAD(auth_handlers);
+static int extra_opt_len = 0;
+
+static struct lcp_option_t *auth_init(struct ppp_lcp_t *lcp);
+static void auth_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt);
+static int auth_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int auth_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int auth_recv_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int auth_recv_conf_rej(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static int auth_recv_conf_ack(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr);
+static void auth_print(void (*print)(const char *fmt,...), struct lcp_option_t*, uint8_t *ptr);
+
+static struct ppp_layer_data_t *auth_layer_init(struct ppp_t*);
+static int auth_layer_start(struct ppp_layer_data_t *);
+static void auth_layer_finish(struct ppp_layer_data_t *);
+static void auth_layer_free(struct ppp_layer_data_t *);
+
+struct auth_option_t
+{
+ struct lcp_option_t opt;
+ struct list_head auth_list;
+ struct auth_data_t *auth;
+ struct auth_data_t *peer_auth;
+};
+
+struct auth_layer_data_t
+{
+ struct ppp_layer_data_t ld;
+ struct auth_option_t auth_opt;
+ struct ppp_t *ppp;
+ int started:1;
+};
+
+static struct lcp_option_handler_t auth_opt_hnd =
+{
+ .init = auth_init,
+ .send_conf_req = auth_send_conf_req,
+ .send_conf_nak = auth_send_conf_req,
+ .recv_conf_req = auth_recv_conf_req,
+ .recv_conf_nak = auth_recv_conf_nak,
+ .recv_conf_rej = auth_recv_conf_rej,
+ .recv_conf_ack = auth_recv_conf_ack,
+ .free = auth_free,
+ .print = auth_print,
+};
+
+static struct ppp_layer_t auth_layer =
+{
+ .init = auth_layer_init,
+ .start = auth_layer_start,
+ .finish = auth_layer_finish,
+ .free = auth_layer_free,
+};
+
+static struct lcp_option_t *auth_init(struct ppp_lcp_t *lcp)
+{
+ struct ppp_auth_handler_t *h;
+ struct auth_data_t *d;
+ struct auth_layer_data_t *ad;
+
+ ad = container_of(ppp_find_layer_data(lcp->ppp, &auth_layer), typeof(*ad), ld);
+
+ ad->auth_opt.opt.id = CI_AUTH;
+ ad->auth_opt.opt.len = 4 + extra_opt_len;
+
+ INIT_LIST_HEAD(&ad->auth_opt.auth_list);
+
+ list_for_each_entry(h, &auth_handlers, entry) {
+ d = h->init(lcp->ppp);
+ d->h = h;
+ list_add_tail(&d->entry, &ad->auth_opt.auth_list);
+ }
+
+ return &ad->auth_opt.opt;
+}
+
+static void auth_free(struct ppp_lcp_t *lcp, struct lcp_option_t *opt)
+{
+ struct auth_option_t *auth_opt = container_of(opt, typeof(*auth_opt), opt);
+ struct auth_data_t *d;
+
+ while(!list_empty(&auth_opt->auth_list)) {
+ d = list_entry(auth_opt->auth_list.next, typeof(*d), entry);
+ list_del(&d->entry);
+ d->h->free(lcp->ppp, d);
+ }
+}
+
+static int auth_send_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct auth_option_t *auth_opt = container_of(opt, typeof(*auth_opt), opt);
+ struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr;
+ struct auth_data_t *d;
+ int n;
+
+ if (list_empty(&auth_opt->auth_list))
+ return 0;
+
+ if (!auth_opt->auth || auth_opt->auth->state == LCP_OPT_NAK) {
+ list_for_each_entry(d, &auth_opt->auth_list, entry) {
+ if (d->state == LCP_OPT_NAK || d->state == LCP_OPT_REJ)
+ continue;
+ auth_opt->auth = d;
+ break;
+ }
+ }
+
+ opt16->hdr.id = CI_AUTH;
+ opt16->val = htons(auth_opt->auth->proto);
+ n = auth_opt->auth->h->send_conf_req(lcp->ppp, auth_opt->auth, (uint8_t*)(opt16 + 1));
+ opt16->hdr.len = 4 + n;
+
+ return 4 + n;
+}
+
+static int auth_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct auth_option_t *auth_opt = container_of(opt,typeof(*auth_opt),opt);
+ struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr;
+ struct auth_data_t *d;
+ int r;
+
+ if (list_empty(&auth_opt->auth_list))
+ return LCP_OPT_REJ;
+
+ if (!ptr)
+ return LCP_OPT_ACK;
+
+
+ list_for_each_entry(d, &auth_opt->auth_list, entry) {
+ if (d->proto == ntohs(opt16->val)) {
+ r = d->h->recv_conf_req(lcp->ppp, d, (uint8_t*)(opt16 + 1));
+ if (r == LCP_OPT_FAIL)
+ return LCP_OPT_FAIL;
+ if (r == LCP_OPT_REJ)
+ break;
+ auth_opt->peer_auth = d;
+ return r;
+ }
+ }
+
+ list_for_each_entry(d, &auth_opt->auth_list, entry) {
+ if (d->state != LCP_OPT_NAK) {
+ auth_opt->peer_auth = d;
+ return LCP_OPT_NAK;
+ }
+ }
+
+ log_ppp_error("cann't negotiate authentication type\n");
+ return LCP_OPT_FAIL;
+}
+
+static int auth_recv_conf_ack(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct auth_option_t *auth_opt = container_of(opt, typeof(*auth_opt), opt);
+
+ auth_opt->peer_auth = NULL;
+
+ return 0;
+}
+
+static int auth_recv_conf_nak(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct auth_option_t *auth_opt = container_of(opt, typeof(*auth_opt), opt);
+ struct auth_data_t *d;
+
+ if (!auth_opt->auth) {
+ log_ppp_error("auth: unexcepcted configure-nak\n");
+ return -1;
+ }
+ auth_opt->auth->state = LCP_OPT_NAK;
+ if (auth_opt->peer_auth)
+ auth_opt->auth = auth_opt->peer_auth;
+
+ list_for_each_entry(d, &auth_opt->auth_list, entry) {
+ if (d->state != LCP_OPT_NAK)
+ return 0;
+ }
+
+ log_ppp_error("cann't negotiate authentication type\n");
+ return -1;
+}
+
+static int auth_recv_conf_rej(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct auth_option_t *auth_opt = container_of(opt, typeof(*auth_opt), opt);
+ struct auth_data_t *d;
+
+ if (!auth_opt->auth) {
+ log_ppp_error("auth: unexcepcted configure-reject\n");
+ return -1;
+ }
+
+ auth_opt->auth->state = LCP_OPT_NAK;
+ if (auth_opt->peer_auth)
+ auth_opt->auth = auth_opt->peer_auth;
+
+ list_for_each_entry(d, &auth_opt->auth_list, entry) {
+ if (d->state != LCP_OPT_NAK)
+ return 0;
+ }
+
+ log_ppp_error("cann't negotiate authentication type\n");
+ return -1;
+}
+
+static void auth_print(void (*print)(const char *fmt,...), struct lcp_option_t *opt, uint8_t *ptr)
+{
+ struct auth_option_t *auth_opt = container_of(opt, typeof(*auth_opt), opt);
+ struct lcp_opt16_t *opt16 = (struct lcp_opt16_t*)ptr;
+ struct auth_data_t *d;
+
+ if (ptr) {
+ list_for_each_entry(d, &auth_opt->auth_list, entry) {
+ if (d->proto == ntohs(opt16->val) && (!d->h->check || d->h->check((uint8_t *)(opt16 + 1))))
+ goto print_d;
+ }
+
+ print("<auth %02x>", ntohs(opt16->val));
+ return;
+ } else if (auth_opt->auth)
+ d = auth_opt->auth;
+ else
+ return;
+
+print_d:
+ print("<auth %s>", d->h->name);
+}
+
+static struct ppp_layer_data_t *auth_layer_init(struct ppp_t *ppp)
+{
+ struct auth_layer_data_t *ad = _malloc(sizeof(*ad));
+
+ log_ppp_debug("auth_layer_init\n");
+
+ memset(ad, 0, sizeof(*ad));
+
+ ad->ppp = ppp;
+
+ return &ad->ld;
+}
+
+static int auth_layer_start(struct ppp_layer_data_t *ld)
+{
+ struct auth_layer_data_t *ad = container_of(ld,typeof(*ad),ld);
+
+ log_ppp_debug("auth_layer_start\n");
+
+ ad->started = 1;
+
+ if (ad->auth_opt.auth)
+ ad->auth_opt.auth->h->start(ad->ppp, ad->auth_opt.auth);
+ else {
+ log_ppp_debug("auth_layer_started\n");
+ ppp_layer_started(ad->ppp, ld);
+ }
+
+ return 0;
+}
+
+static void auth_layer_finish(struct ppp_layer_data_t *ld)
+{
+ struct auth_layer_data_t *ad = container_of(ld, typeof(*ad), ld);
+
+ log_ppp_debug("auth_layer_finish\n");
+
+ if (ad->auth_opt.auth)
+ ad->auth_opt.auth->h->finish(ad->ppp, ad->auth_opt.auth);
+
+ ad->started = 0;
+
+ log_ppp_debug("auth_layer_finished\n");
+ ppp_layer_finished(ad->ppp, ld);
+}
+
+static void auth_layer_free(struct ppp_layer_data_t *ld)
+{
+ struct auth_layer_data_t *ad = container_of(ld, typeof(*ad), ld);
+
+ log_ppp_debug("auth_layer_free\n");
+
+ if (ad->started && ad->auth_opt.auth)
+ ad->auth_opt.auth->h->finish(ad->ppp, ad->auth_opt.auth);
+
+ _free(ad);
+}
+
+void __export auth_successed(struct ppp_t *ppp, char *username)
+{
+ struct auth_layer_data_t *ad = container_of(ppp_find_layer_data(ppp, &auth_layer), typeof(*ad), ld);
+ log_ppp_debug("auth_layer_started\n");
+ ppp->username = username;
+ ppp_layer_started(ppp, &ad->ld);
+ triton_event_fire(EV_PPP_AUTHORIZED, ppp);
+}
+
+void __export auth_failed(struct ppp_t *ppp)
+{
+ ppp_terminate(ppp, 0);
+}
+
+int __export ppp_auth_register_handler(struct ppp_auth_handler_t *h)
+{
+ list_add_tail(&h->entry, &auth_handlers);
+ return 0;
+}
+
+static void __init ppp_auth_init()
+{
+ ppp_register_layer("auth", &auth_layer);
+ lcp_option_register(&auth_opt_hnd);
+}
+
diff --git a/accel-pptpd/ppp/ppp_auth.h b/accel-pptpd/ppp/ppp_auth.h
new file mode 100644
index 0000000..fbd2017
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_auth.h
@@ -0,0 +1,35 @@
+#ifndef PPP_AUTH_H
+#define PPP_AUTH_H
+
+#include "list.h"
+
+struct ppp_auth_handler_t;
+
+struct auth_data_t
+{
+ struct list_head entry;
+ int proto;
+ int state;
+ struct ppp_auth_handler_t *h;
+};
+
+struct ppp_auth_handler_t
+{
+ struct list_head entry;
+ const char *name;
+ struct auth_data_t* (*init)(struct ppp_t*);
+ int (*send_conf_req)(struct ppp_t*, struct auth_data_t*, uint8_t*);
+ int (*recv_conf_req)(struct ppp_t*, struct auth_data_t*, uint8_t*);
+ int (*start)(struct ppp_t*, struct auth_data_t*);
+ int (*finish)(struct ppp_t*, struct auth_data_t*);
+ void (*free)(struct ppp_t*,struct auth_data_t*);
+ int (*check)(uint8_t *);
+};
+
+int ppp_auth_register_handler(struct ppp_auth_handler_t*);
+
+void auth_successed(struct ppp_t *ppp, char *username);
+void auth_failed(struct ppp_t *ppp);
+
+#endif
+
diff --git a/accel-pptpd/ppp/ppp_ccp.c b/accel-pptpd/ppp/ppp_ccp.c
new file mode 100644
index 0000000..ae9e637
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_ccp.c
@@ -0,0 +1,724 @@
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <linux/ppp_defs.h>
+#include <linux/if_ppp.h>
+#include <sys/ioctl.h>
+
+#include "triton.h"
+
+#include "log.h"
+
+#include "ppp.h"
+#include "ppp_ccp.h"
+
+#include "memdebug.h"
+
+struct recv_opt_t
+{
+ struct list_head entry;
+ struct ccp_opt_hdr_t *hdr;
+ int len;
+ int state;
+ struct ccp_option_t *lopt;
+};
+
+static struct ppp_layer_t ccp_layer;
+static LIST_HEAD(option_handlers);
+
+static void ccp_layer_up(struct ppp_fsm_t*);
+static void ccp_layer_down(struct ppp_fsm_t*);
+static int send_conf_req(struct ppp_fsm_t*);
+static void send_conf_ack(struct ppp_fsm_t*);
+static void send_conf_nak(struct ppp_fsm_t*);
+static void send_conf_rej(struct ppp_fsm_t*);
+static void send_term_req(struct ppp_fsm_t *fsm);
+static void send_term_ack(struct ppp_fsm_t *fsm);
+static void ccp_recv(struct ppp_handler_t*);
+
+static void ccp_options_init(struct ppp_ccp_t *ccp)
+{
+ struct ccp_option_t *lopt;
+ struct ccp_option_handler_t *h;
+
+ ccp->conf_req_len = sizeof(struct ccp_hdr_t);
+
+ list_for_each_entry(h, &option_handlers, entry) {
+ lopt = h->init(ccp);
+ if (lopt) {
+ lopt->h = h;
+ list_add_tail(&lopt->entry, &ccp->options);
+ ccp->conf_req_len += lopt->len;
+ }
+ }
+}
+
+static void ccp_options_free(struct ppp_ccp_t *ccp)
+{
+ struct ccp_option_t *lopt;
+
+ while (!list_empty(&ccp->options)) {
+ lopt = list_entry(ccp->options.next, typeof(*lopt), entry);
+ list_del(&lopt->entry);
+ lopt->h->free(ccp, lopt);
+ }
+}
+
+static int ccp_set_flags(int fd, int isopen, int isup)
+{
+ int flags;
+
+ if (ioctl(fd, PPPIOCGFLAGS, &flags)) {
+ log_ppp_error("ccp: failed to get flags: %s\n", strerror(errno));
+ return -1;
+ }
+
+ flags &= ~(SC_CCP_OPEN | SC_CCP_UP);
+ flags |= (isopen ? SC_CCP_OPEN : 0) | (isup ? SC_CCP_UP : 0);
+
+ if (ioctl(fd, PPPIOCSFLAGS, &flags)) {
+ log_ppp_error("ccp: failed to set flags: %s\n", strerror(errno));
+ return -1;
+ }
+
+ return 0;
+}
+
+static struct ppp_layer_data_t *ccp_layer_init(struct ppp_t *ppp)
+{
+ struct ppp_ccp_t *ccp = _malloc(sizeof(*ccp));
+ memset(ccp, 0, sizeof(*ccp));
+
+ log_ppp_debug("ccp_layer_init\n");
+
+ ccp->ppp = ppp;
+ ccp->fsm.ppp = ppp;
+
+ ccp->hnd.proto = PPP_CCP;
+ ccp->hnd.recv = ccp_recv;
+
+ ppp_register_unit_handler(ppp, &ccp->hnd);
+
+ INIT_LIST_HEAD(&ccp->options);
+ ccp_options_init(ccp);
+
+ ccp->passive = 1;
+
+ ccp->fsm.proto = PPP_CCP;
+ ppp_fsm_init(&ccp->fsm);
+
+ ccp->fsm.layer_up = ccp_layer_up;
+ ccp->fsm.layer_finished = ccp_layer_down;
+ ccp->fsm.send_conf_req = send_conf_req;
+ ccp->fsm.send_conf_ack = send_conf_ack;
+ ccp->fsm.send_conf_nak = send_conf_nak;
+ ccp->fsm.send_conf_rej = send_conf_rej;
+ ccp->fsm.send_term_req = send_term_req;
+ ccp->fsm.send_term_ack = send_term_ack;
+
+ INIT_LIST_HEAD(&ccp->ropt_list);
+
+ return &ccp->ld;
+}
+
+int ccp_layer_start(struct ppp_layer_data_t *ld)
+{
+ struct ppp_ccp_t *ccp = container_of(ld, typeof(*ccp), ld);
+
+ log_ppp_debug("ccp_layer_start\n");
+
+ if (list_empty(&ccp->options)) {
+ ppp_layer_started(ccp->ppp, &ccp->ld);
+ return 0;
+ }
+
+ ppp_fsm_lower_up(&ccp->fsm);
+ if (ppp_fsm_open(&ccp->fsm))
+ return -1;
+
+ if (ccp_set_flags(ccp->ppp->unit_fd, 1, 0)) {
+ ppp_fsm_close(&ccp->fsm);
+ return -1;
+ }
+
+ return 0;
+}
+
+void ccp_layer_finish(struct ppp_layer_data_t *ld)
+{
+ struct ppp_ccp_t *ccp = container_of(ld, typeof(*ccp), ld);
+
+ log_ppp_debug("ccp_layer_finish\n");
+
+ ccp_set_flags(ccp->ppp->unit_fd, 0, 0);
+
+ ccp->fsm.fsm_state = FSM_Closed;
+ ppp_layer_finished(ccp->ppp, &ccp->ld);
+}
+
+void ccp_layer_free(struct ppp_layer_data_t *ld)
+{
+ struct ppp_ccp_t *ccp = container_of(ld, typeof(*ccp), ld);
+
+ log_ppp_debug("ccp_layer_free\n");
+
+ ppp_unregister_handler(ccp->ppp, &ccp->hnd);
+ ccp_options_free(ccp);
+ ppp_fsm_free(&ccp->fsm);
+
+ _free(ccp);
+}
+
+static void ccp_layer_up(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ccp_t *ccp = container_of(fsm, typeof(*ccp), fsm);
+
+ log_ppp_debug("ccp_layer_started\n");
+
+ if (!ccp->started) {
+ ccp->started = 1;
+ if (ccp_set_flags(ccp->ppp->unit_fd, 1, 1)) {
+ ppp_terminate(ccp->ppp, 0);
+ return;
+ }
+ ppp_layer_started(ccp->ppp, &ccp->ld);
+ }
+}
+
+static void ccp_layer_down(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ccp_t *ccp = container_of(fsm, typeof(*ccp), fsm);
+
+ log_ppp_debug("ccp_layer_finished\n");
+
+ if (!ccp->started)
+ ppp_layer_started(ccp->ppp, &ccp->ld);
+ ccp->started = 0;
+ ppp_layer_finished(ccp->ppp, &ccp->ld);
+}
+
+static void print_ropt(struct recv_opt_t *ropt)
+{
+ int i;
+ uint8_t *ptr = (uint8_t*)ropt->hdr;
+
+ log_ppp_info("<");
+ for (i = 0; i < ropt->len; i++) {
+ log_ppp_info(" %x", ptr[i]);
+ }
+ log_ppp_info(" >");
+}
+
+static int send_conf_req(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ccp_t *ccp = container_of(fsm, typeof(*ccp), fsm);
+ uint8_t *buf, *ptr;
+ struct ccp_hdr_t *ccp_hdr;
+ struct ccp_option_t *lopt;
+ int n;
+
+ ccp->need_req = 0;
+
+ if (ccp->passive)
+ return 0;
+
+ buf = _malloc(ccp->conf_req_len);
+ ccp_hdr = (struct ccp_hdr_t*)buf;
+
+ ccp_hdr->proto = htons(PPP_CCP);
+ ccp_hdr->code = CONFREQ;
+ ccp_hdr->id = ++ccp->fsm.id;
+ ccp_hdr->len = 0;
+
+ ptr = (uint8_t*)(ccp_hdr + 1);
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [CCP ConfReq id=%x", ccp_hdr->id);
+
+ list_for_each_entry(lopt, &ccp->options, entry) {
+ n = lopt->h->send_conf_req(ccp, lopt, ptr);
+ if (n < 0)
+ return -1;
+ if (n) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info, lopt, NULL);
+ }
+ }
+ ptr += n;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ ccp_hdr->len = htons(ptr - buf - 2);
+ ppp_unit_send(ccp->ppp, ccp_hdr, ptr - buf);
+
+ _free(buf);
+
+ return 0;
+}
+
+static void send_conf_ack(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ccp_t *ccp = container_of(fsm, typeof(*ccp), fsm);
+ struct ccp_hdr_t *hdr = (struct ccp_hdr_t*)ccp->ppp->unit_buf;
+
+ hdr->code = CONFACK;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [CCP ConfAck id=%x]\n", ccp->fsm.recv_id);
+
+ ppp_unit_send(ccp->ppp,hdr,ntohs(hdr->len)+2);
+}
+
+static void send_conf_nak(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ccp_t *ccp = container_of(fsm, typeof(*ccp), fsm);
+ uint8_t *buf = _malloc(ccp->conf_req_len), *ptr = buf;
+ struct ccp_hdr_t *ccp_hdr = (struct ccp_hdr_t*)ptr;
+ struct recv_opt_t *ropt;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [CCP ConfNak id=%x", ccp->fsm.recv_id);
+
+ ccp_hdr->proto = htons(PPP_CCP);
+ ccp_hdr->code = CONFNAK;
+ ccp_hdr->id = ccp->fsm.recv_id;
+ ccp_hdr->len = 0;
+
+ ptr += sizeof(*ccp_hdr);
+
+ list_for_each_entry(ropt, &ccp->ropt_list, entry) {
+ if (ropt->state == CCP_OPT_NAK) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ ropt->lopt->h->print(log_ppp_info, ropt->lopt, NULL);
+ }
+ ptr += ropt->lopt->h->send_conf_nak(ccp, ropt->lopt, ptr);
+ }
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ ccp_hdr->len = htons(ptr - buf - 2);
+ ppp_unit_send(ccp->ppp, ccp_hdr, ptr - buf);
+
+ _free(buf);
+}
+
+static void send_conf_rej(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ccp_t *ccp = container_of(fsm, typeof(*ccp), fsm);
+ uint8_t *buf = _malloc(ccp->ropt_len + sizeof(struct ccp_hdr_t)), *ptr = buf;
+ struct ccp_hdr_t *ccp_hdr = (struct ccp_hdr_t*)ptr;
+ struct recv_opt_t *ropt;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [CCP ConfRej id=%x", ccp->fsm.recv_id);
+
+ ccp_hdr->proto = htons(PPP_CCP);
+ ccp_hdr->code = CONFREJ;
+ ccp_hdr->id = ccp->fsm.recv_id;
+ ccp_hdr->len = 0;
+
+ ptr += sizeof(*ccp_hdr);
+
+ list_for_each_entry(ropt, &ccp->ropt_list, entry) {
+ if (ropt->state == CCP_OPT_REJ) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ if (ropt->lopt)
+ ropt->lopt->h->print(log_ppp_info, ropt->lopt, (uint8_t*)ropt->hdr);
+ else
+ print_ropt(ropt);
+ }
+ memcpy(ptr, ropt->hdr, ropt->len);
+ ptr += ropt->len;
+ }
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ ccp_hdr->len = htons(ptr - buf - 2);
+ ppp_unit_send(ccp->ppp, ccp_hdr, ptr-buf);
+
+ _free(buf);
+}
+
+static int ccp_recv_conf_req(struct ppp_ccp_t *ccp, uint8_t *data, int size)
+{
+ struct ccp_opt_hdr_t *hdr;
+ struct recv_opt_t *ropt;
+ struct ccp_option_t *lopt;
+ int r, ret = 1, ack = 0;
+
+ ccp->need_req = 0;
+ ccp->ropt_len = size;
+
+ while (size > 0) {
+ hdr = (struct ccp_opt_hdr_t *)data;
+
+ ropt = _malloc(sizeof(*ropt));
+ memset(ropt, 0, sizeof(*ropt));
+
+ if (hdr->len > size)
+ ropt->len = size;
+ else
+ ropt->len = hdr->len;
+
+ ropt->hdr = hdr;
+ ropt->state = CCP_OPT_NONE;
+ list_add_tail(&ropt->entry, &ccp->ropt_list);
+
+ data += ropt->len;
+ size -= ropt->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [CCP ConfReq id=%x", ccp->fsm.recv_id);
+
+ list_for_each_entry(ropt, &ccp->ropt_list, entry) {
+ list_for_each_entry(lopt, &ccp->options, entry) {
+ if (lopt->id == ropt->hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info, lopt, (uint8_t*)ropt->hdr);
+ }
+ r = lopt->h->recv_conf_req(ccp, lopt, (uint8_t*)ropt->hdr);
+ if (ack) {
+ lopt->state = CCP_OPT_REJ;
+ ropt->state = CCP_OPT_REJ;
+ } else {
+ if (lopt->state == CCP_OPT_NAK && r == CCP_OPT_ACK)
+ ccp->need_req = 1;
+ lopt->state = r;
+ ropt->state = r;
+ }
+ ropt->lopt = lopt;
+ if (r < ret)
+ ret = r;
+ break;
+ }
+ }
+ if (ropt->state == CCP_OPT_ACK || ropt->state == CCP_OPT_NAK)
+ ack = 1;
+ else if (!ropt->lopt) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ print_ropt(ropt);
+ }
+ ropt->state = CCP_OPT_REJ;
+ ret = CCP_OPT_REJ;
+ }
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ /*list_for_each_entry(lopt,&ccp->options,entry)
+ {
+ if (lopt->state==CCP_OPT_NONE)
+ {
+ r=lopt->h->recv_conf_req(ccp,lopt,NULL);
+ lopt->state=r;
+ if (r<ret) ret=r;
+ }
+ }*/
+
+ return ret;
+}
+
+static void ccp_free_conf_req(struct ppp_ccp_t *ccp)
+{
+ struct recv_opt_t *ropt;
+
+ while (!list_empty(&ccp->ropt_list)) {
+ ropt = list_entry(ccp->ropt_list.next, typeof(*ropt), entry);
+ list_del(&ropt->entry);
+ _free(ropt);
+ }
+}
+
+static int ccp_recv_conf_rej(struct ppp_ccp_t *ccp, uint8_t *data, int size)
+{
+ struct ccp_opt_hdr_t *hdr;
+ struct ccp_option_t *lopt;
+ int res = 0;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [CCP ConfRej id=%x", ccp->fsm.recv_id);
+
+ if (ccp->fsm.recv_id != ccp->fsm.id) {
+ if (conf_ppp_verbose)
+ log_ppp_info(": id mismatch ]\n");
+ return 0;
+ }
+
+ while (size > 0) {
+ hdr = (struct ccp_opt_hdr_t *)data;
+
+ list_for_each_entry(lopt, &ccp->options, entry) {
+ if (lopt->id == hdr->id) {
+ if (!lopt->h->recv_conf_rej)
+ res = -1;
+ else if (lopt->h->recv_conf_rej(ccp, lopt, data))
+ res = -1;
+ break;
+ }
+ }
+
+ data += hdr->len;
+ size -= hdr->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ return res;
+}
+
+static int ccp_recv_conf_nak(struct ppp_ccp_t *ccp, uint8_t *data, int size)
+{
+ struct ccp_opt_hdr_t *hdr;
+ struct ccp_option_t *lopt;
+ int res = 0;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [CCP ConfNak id=%x", ccp->fsm.recv_id);
+
+ if (ccp->fsm.recv_id != ccp->fsm.id) {
+ if (conf_ppp_verbose)
+ log_ppp_info(": id mismatch ]\n");
+ return 0;
+ }
+
+ while (size > 0) {
+ hdr = (struct ccp_opt_hdr_t *)data;
+
+ list_for_each_entry(lopt, &ccp->options, entry) {
+ if (lopt->id == hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info, lopt, data);
+ }
+ if (lopt->h->recv_conf_nak(ccp, lopt, data))
+ res = -1;
+ break;
+ }
+ }
+
+ data += hdr->len;
+ size -= hdr->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ return res;
+}
+
+static int ccp_recv_conf_ack(struct ppp_ccp_t *ccp, uint8_t *data, int size)
+{
+ struct ccp_opt_hdr_t *hdr;
+ struct ccp_option_t *lopt;
+ int res = 0;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [CCP ConfAck id=%x", ccp->fsm.recv_id);
+
+ if (ccp->fsm.recv_id != ccp->fsm.id) {
+ if (conf_ppp_verbose)
+ log_ppp_info(": id mismatch ]\n");
+ return 0;
+ }
+
+ while (size > 0) {
+ hdr = (struct ccp_opt_hdr_t *)data;
+
+ list_for_each_entry(lopt, &ccp->options, entry) {
+ if (lopt->id == hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info,lopt,data);
+ }
+ if (!lopt->h->recv_conf_ack)
+ break;
+ if (lopt->h->recv_conf_ack(ccp, lopt, data))
+ res = -1;
+ break;
+ }
+ }
+
+ data += hdr->len;
+ size -= hdr->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ return res;
+}
+
+static void send_term_req(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ccp_t *ccp = container_of(fsm, typeof(*ccp), fsm);
+ struct ccp_hdr_t hdr = {
+ .proto = htons(PPP_CCP),
+ .code = TERMREQ,
+ .id = ++ccp->fsm.id,
+ .len = htons(4),
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [CCP TermReq id=%i]\n", hdr.id);
+
+ ppp_chan_send(ccp->ppp, &hdr, 6);
+}
+
+static void send_term_ack(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ccp_t *ccp = container_of(fsm, typeof(*ccp), fsm);
+ struct ccp_hdr_t hdr = {
+ .proto = htons(PPP_CCP),
+ .code = TERMACK,
+ .id = ccp->fsm.recv_id,
+ .len = htons(4),
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [CCP TermAck id=%i]\n", hdr.id);
+
+ ppp_chan_send(ccp->ppp, &hdr, 6);
+}
+
+static void ccp_recv(struct ppp_handler_t*h)
+{
+ struct ccp_hdr_t *hdr;
+ struct ppp_ccp_t *ccp = container_of(h, typeof(*ccp), hnd);
+ int r;
+
+ if (ccp->fsm.fsm_state == FSM_Initial || ccp->fsm.fsm_state == FSM_Closed) {
+ if (conf_ppp_verbose)
+ log_ppp_warn("CCP: discaring packet\n");
+ lcp_send_proto_rej(ccp->ppp, htons(PPP_CCP));
+ return;
+ }
+
+ if (ccp->ppp->unit_buf_size < PPP_HEADERLEN + 2) {
+ log_ppp_warn("CCP: short packet received\n");
+ return;
+ }
+
+ hdr = (struct ccp_hdr_t *)ccp->ppp->unit_buf;
+ if (ntohs(hdr->len) < PPP_HEADERLEN) {
+ log_ppp_warn("CCP: short packet received\n");
+ return;
+ }
+
+ ccp->fsm.recv_id = hdr->id;
+ switch(hdr->code) {
+ case CONFREQ:
+ r = ccp_recv_conf_req(ccp, (uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN);
+ switch(r) {
+ case CCP_OPT_ACK:
+ ppp_fsm_recv_conf_req_ack(&ccp->fsm);
+ break;
+ case CCP_OPT_NAK:
+ ppp_fsm_recv_conf_req_nak(&ccp->fsm);
+ break;
+ case CCP_OPT_REJ:
+ ppp_fsm_recv_conf_req_rej(&ccp->fsm);
+ break;
+ }
+ ccp_free_conf_req(ccp);
+
+ if (r == CCP_OPT_ACK && ccp->passive) {
+ ccp->passive = 0;
+ send_conf_req(&ccp->fsm);
+ }
+ if (r == CCP_OPT_FAIL)
+ ppp_terminate(ccp->ppp, 0);
+ break;
+ case CONFACK:
+ if (ccp_recv_conf_ack(ccp, (uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN))
+ ppp_terminate(ccp->ppp, 0);
+ else {
+ ppp_fsm_recv_conf_ack(&ccp->fsm);
+ if (ccp->need_req)
+ send_conf_req(&ccp->fsm);
+ }
+ break;
+ case CONFNAK:
+ ccp_recv_conf_nak(ccp, (uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN);
+ ppp_fsm_recv_conf_rej(&ccp->fsm);
+ break;
+ case CONFREJ:
+ if (ccp_recv_conf_rej(ccp, (uint8_t*)(hdr + 1),ntohs(hdr->len) - PPP_HDRLEN))
+ ppp_terminate(ccp->ppp, 0);
+ else
+ ppp_fsm_recv_conf_rej(&ccp->fsm);
+ break;
+ case TERMREQ:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [CCP TermReq id=%x]\n", hdr->id);
+ ppp_fsm_recv_term_req(&ccp->fsm);
+ ppp_fsm_close(&ccp->fsm);
+ break;
+ case TERMACK:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [CCP TermAck id=%x]\n", hdr->id);
+ ppp_fsm_recv_term_ack(&ccp->fsm);
+ break;
+ case CODEREJ:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [CCP CodeRej id=%x]\n", hdr->id);
+ ppp_fsm_recv_code_rej_bad(&ccp->fsm);
+ break;
+ default:
+ ppp_fsm_recv_unk(&ccp->fsm);
+ break;
+ }
+}
+
+int ccp_option_register(struct ccp_option_handler_t *h)
+{
+ /*struct ccp_option_drv_t *p;
+
+ list_for_each_entry(p,option_drv_list,entry)
+ if (p->id==h->id)
+ return -1;*/
+
+ list_add_tail(&h->entry,&option_handlers);
+
+ return 0;
+}
+
+struct ccp_option_t *ccp_find_option(struct ppp_t *ppp, struct ccp_option_handler_t *h)
+{
+ struct ppp_ccp_t *ccp = container_of(ppp_find_layer_data(ppp, &ccp_layer), typeof(*ccp), ld);
+ struct ccp_option_t *opt;
+
+ list_for_each_entry(opt, &ccp->options, entry)
+ if (opt->h == h)
+ return opt;
+
+ log_emerg("ccp: BUG: option not found\n");
+ abort();
+}
+
+static struct ppp_layer_t ccp_layer=
+{
+ .init = ccp_layer_init,
+ .start = ccp_layer_start,
+ .finish = ccp_layer_finish,
+ .free = ccp_layer_free,
+};
+
+static void __init ccp_init(void)
+{
+ ppp_register_layer("ccp", &ccp_layer);
+}
+
diff --git a/accel-pptpd/ppp/ppp_ccp.h b/accel-pptpd/ppp/ppp_ccp.h
new file mode 100644
index 0000000..27b303e
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_ccp.h
@@ -0,0 +1,96 @@
+#ifndef PPP_CCP_H
+#define PPP_CCP_H
+
+#include <stdint.h>
+
+#include "triton.h"
+#include "ppp_fsm.h"
+/*
+ * Options.
+ */
+
+#define CI_MPPE 18 /* MPPE */
+
+struct ccp_hdr_t
+{
+ uint16_t proto;
+ uint8_t code;
+ uint8_t id;
+ uint16_t len;
+} __attribute__((packed));
+struct ccp_opt_hdr_t
+{
+ uint8_t id;
+ uint8_t len;
+} __attribute__((packed));
+struct ccp_opt8_t
+{
+ struct ccp_opt_hdr_t hdr;
+ uint8_t val;
+} __attribute__((packed));
+struct ccp_opt16_t
+{
+ struct ccp_opt_hdr_t hdr;
+ uint16_t val;
+} __attribute__((packed));
+struct ccp_opt32_t
+{
+ struct ccp_opt_hdr_t hdr;
+ uint32_t val;
+} __attribute__((packed));
+
+#define CCP_OPT_NONE 0
+#define CCP_OPT_ACK 1
+#define CCP_OPT_NAK -1
+#define CCP_OPT_REJ -2
+#define CCP_OPT_FAIL -3
+
+struct ppp_ccp_t;
+struct ccp_option_handler_t;
+
+struct ccp_option_t
+{
+ struct list_head entry;
+ int id;
+ int len;
+ int state;
+ struct ccp_option_handler_t *h;
+};
+
+struct ccp_option_handler_t
+{
+ struct list_head entry;
+ struct ccp_option_t* (*init)(struct ppp_ccp_t*);
+ int (*send_conf_req)(struct ppp_ccp_t*,struct ccp_option_t*,uint8_t*);
+ int (*send_conf_rej)(struct ppp_ccp_t*,struct ccp_option_t*,uint8_t*);
+ int (*send_conf_nak)(struct ppp_ccp_t*,struct ccp_option_t*,uint8_t*);
+ int (*recv_conf_req)(struct ppp_ccp_t*,struct ccp_option_t*,uint8_t*);
+ int (*recv_conf_rej)(struct ppp_ccp_t*,struct ccp_option_t*,uint8_t*);
+ int (*recv_conf_nak)(struct ppp_ccp_t*,struct ccp_option_t*,uint8_t*);
+ int (*recv_conf_ack)(struct ppp_ccp_t*,struct ccp_option_t*,uint8_t*);
+ void (*free)(struct ppp_ccp_t*,struct ccp_option_t*);
+ void (*print)(void (*print)(const char *fmt,...), struct ccp_option_t*,uint8_t*);
+};
+
+struct ppp_ccp_t
+{
+ struct ppp_layer_data_t ld;
+ struct ppp_handler_t hnd;
+ struct ppp_fsm_t fsm;
+ struct ppp_t *ppp;
+ struct list_head options;
+
+ struct list_head ropt_list; // last received ConfReq
+ int ropt_len;
+
+ int conf_req_len;
+ int started:1;
+ int passive:1;
+ int need_req:1;
+};
+
+int ccp_option_register(struct ccp_option_handler_t *h);
+struct ccp_option_t *ccp_find_option(struct ppp_t *ppp, struct ccp_option_handler_t *h);
+
+#endif
+
diff --git a/accel-pptpd/ppp/ppp_fsm.c b/accel-pptpd/ppp/ppp_fsm.c
new file mode 100644
index 0000000..4769dc8
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_fsm.c
@@ -0,0 +1,525 @@
+#include <arpa/inet.h>
+#include <stdlib.h>
+
+#include "triton.h"
+
+#include "ppp.h"
+#include "ppp_fsm.h"
+#include "ppp_lcp.h"
+#include "log.h"
+
+#include "memdebug.h"
+
+static int conf_max_terminate = 2;
+static int conf_max_configure = 5;
+static int conf_max_failure = 5;
+static int conf_timeout = 5;
+
+void send_term_req(struct ppp_fsm_t *layer);
+void send_term_ack(struct ppp_fsm_t *layer);
+void send_echo_reply(struct ppp_fsm_t *layer);
+
+static void init_req_counter(struct ppp_fsm_t *layer,int timeout);
+static void zero_req_counter(struct ppp_fsm_t *layer);
+static void restart_timer_func(struct triton_timer_t *t);
+static void stop_timer(struct ppp_fsm_t *fsm);
+
+void ppp_fsm_init(struct ppp_fsm_t *layer)
+{
+ layer->fsm_state = FSM_Initial;
+ layer->restart_timer.expire = restart_timer_func;
+ layer->restart_timer.period = conf_timeout * 1000;
+ layer->restart_counter = 0;
+
+ layer->max_terminate = conf_max_terminate;
+ layer->max_configure = conf_max_configure;
+ layer->max_failure = conf_max_failure;
+ layer->timeout = conf_timeout;
+}
+void ppp_fsm_free(struct ppp_fsm_t *layer)
+{
+ stop_timer(layer);
+}
+
+int ppp_fsm_lower_up(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Initial:
+ layer->fsm_state=FSM_Closed;
+ break;
+ case FSM_Starting:
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ init_req_counter(layer,layer->max_configure);
+ --layer->restart_counter;
+ if (layer->send_conf_req)
+ if (layer->send_conf_req(layer))
+ return -1;
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+void ppp_fsm_lower_down(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Closed:
+ case FSM_Closing:
+ layer->fsm_state=FSM_Initial;
+ break;
+ case FSM_Stopped:
+ if (layer->layer_started) layer->layer_started(layer);
+ layer->fsm_state=FSM_Starting;
+ break;
+ case FSM_Stopping:
+ case FSM_Req_Sent:
+ case FSM_Ack_Rcvd:
+ case FSM_Ack_Sent:
+ layer->fsm_state=FSM_Starting;
+ break;
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ layer->fsm_state=FSM_Starting;
+ break;
+ default:
+ break;
+ }
+}
+
+int ppp_fsm_open(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Initial:
+ if (layer->layer_started) layer->layer_started(layer);
+ layer->fsm_state=FSM_Starting;
+ break;
+ case FSM_Starting:
+ break;
+ case FSM_Closed:
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ init_req_counter(layer,layer->max_configure);
+ --layer->restart_counter;
+ if (layer->send_conf_req)
+ if (layer->send_conf_req(layer))
+ return -1;
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ case FSM_Closing:
+ case FSM_Stopping:
+ case FSM_Stopped:
+ case FSM_Opened:
+ ppp_fsm_lower_down(layer);
+ ppp_fsm_lower_up(layer);
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+void ppp_fsm_close(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Starting:
+ if (layer->layer_finished) layer->layer_finished(layer);
+ layer->fsm_state=FSM_Initial;
+ break;
+ case FSM_Stopped:
+ layer->fsm_state=FSM_Closed;
+ break;
+ case FSM_Stopping:
+ layer->fsm_state=FSM_Closing;
+ break;
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ case FSM_Req_Sent:
+ case FSM_Ack_Rcvd:
+ case FSM_Ack_Sent:
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ init_req_counter(layer,layer->max_terminate);
+ layer->send_term_req(layer);
+ layer->fsm_state=FSM_Closing;
+ break;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_timeout0(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Closing:
+ case FSM_Stopping:
+ layer->send_term_req(layer);
+ break;
+ case FSM_Ack_Rcvd:
+ layer->fsm_state=FSM_Req_Sent;
+ case FSM_Req_Sent:
+ case FSM_Ack_Sent:
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ break;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_timeout1(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Closing:
+ stop_timer(layer);
+ layer->fsm_state=FSM_Closed;
+ if (layer->layer_finished) layer->layer_finished(layer);
+ break;
+ case FSM_Stopping:
+ stop_timer(layer);
+ layer->fsm_state=FSM_Stopped;
+ if (layer->layer_finished) layer->layer_finished(layer);
+ break;
+ case FSM_Ack_Rcvd:
+ case FSM_Req_Sent:
+ case FSM_Ack_Sent:
+ stop_timer(layer);
+ if (layer->layer_finished) layer->layer_finished(layer);
+ layer->fsm_state=FSM_Stopped;
+ break;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_recv_conf_req_ack(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Closed:
+ layer->send_term_ack(layer);
+ break;
+ case FSM_Stopped:
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ init_req_counter(layer,layer->max_configure);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ case FSM_Req_Sent:
+ case FSM_Ack_Sent:
+ if (layer->send_conf_ack) layer->send_conf_ack(layer);
+ layer->fsm_state=FSM_Ack_Sent;
+ break;
+ case FSM_Ack_Rcvd:
+ if (layer->send_conf_ack) layer->send_conf_ack(layer);
+ stop_timer(layer);
+ if (layer->layer_up) layer->layer_up(layer);
+ layer->fsm_state=FSM_Opened;
+ break;
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ if (layer->send_conf_ack) layer->send_conf_ack(layer);
+ layer->fsm_state=FSM_Ack_Sent;
+ break;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_recv_conf_req_nak(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Closed:
+ layer->send_term_ack(layer);
+ break;
+ case FSM_Stopped:
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ init_req_counter(layer,layer->max_configure);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ case FSM_Ack_Sent:
+ if (layer->send_conf_nak) layer->send_conf_nak(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ case FSM_Req_Sent:
+ case FSM_Ack_Rcvd:
+ if (layer->send_conf_nak) layer->send_conf_nak(layer);
+ break;
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ if (layer->send_conf_nak) layer->send_conf_nak(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_recv_conf_req_rej(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Closed:
+ layer->send_term_ack(layer);
+ break;
+ case FSM_Stopped:
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ init_req_counter(layer,layer->max_configure);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ case FSM_Ack_Sent:
+ if (++layer->conf_failure == layer->max_failure) {
+ if (layer->layer_down) layer->layer_down(layer);
+ return;
+ }
+ if (layer->send_conf_rej) layer->send_conf_rej(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ case FSM_Req_Sent:
+ case FSM_Ack_Rcvd:
+ if (++layer->conf_failure == layer->max_failure) {
+ if (layer->layer_down) layer->layer_down(layer);
+ return;
+ }
+ if (layer->send_conf_rej) layer->send_conf_rej(layer);
+ break;
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ if (layer->send_conf_rej) layer->send_conf_rej(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_recv_conf_ack(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Closed:
+ case FSM_Stopped:
+ layer->send_term_ack(layer);
+ break;
+ case FSM_Req_Sent:
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ init_req_counter(layer,layer->max_configure);
+ layer->fsm_state=FSM_Ack_Rcvd;
+ break;
+ case FSM_Ack_Rcvd:
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ case FSM_Ack_Sent:
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ //init_req_counter(layer,layer->max_configure);
+ //tlu
+ stop_timer(layer);
+ if (layer->layer_up) layer->layer_up(layer);
+ layer->fsm_state=FSM_Opened;
+ break;
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_recv_conf_rej(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Closed:
+ case FSM_Stopped:
+ layer->send_term_ack(layer);
+ break;
+ case FSM_Req_Sent:
+ if (++layer->conf_failure == layer->max_failure) {
+ if (layer->layer_down) layer->layer_down(layer);
+ return;
+ }
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ init_req_counter(layer,layer->max_failure);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ break;
+ case FSM_Ack_Rcvd:
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ case FSM_Ack_Sent:
+ //if (layer->init_req_cnt) layer->init_req_cnt(layer);
+ init_req_counter(layer,layer->max_configure);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ break;
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_recv_term_req(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ //send_term_req(layer);
+ layer->send_term_ack(layer);
+ //if (layer->zero_req_cnt) layer->zero_req_cnt(layer);
+ zero_req_counter(layer);
+ layer->fsm_state=FSM_Stopping;
+ break;
+ case FSM_Req_Sent:
+ case FSM_Ack_Rcvd:
+ case FSM_Ack_Sent:
+ layer->send_term_ack(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ default:
+ layer->send_term_req(layer);
+ break;
+ }
+}
+
+void ppp_fsm_recv_term_ack(struct ppp_fsm_t *layer)
+{
+ stop_timer(layer);
+ switch(layer->fsm_state)
+ {
+ case FSM_Closing:
+ layer->fsm_state=FSM_Closed;
+ if (layer->layer_finished) layer->layer_finished(layer);
+ break;
+ case FSM_Stopping:
+ if (layer->layer_finished) layer->layer_finished(layer);
+ layer->fsm_state=FSM_Stopped;
+ break;
+ case FSM_Ack_Rcvd:
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ --layer->restart_counter;
+ if (layer->send_conf_req) layer->send_conf_req(layer);
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_recv_unk(struct ppp_fsm_t *layer)
+{
+ if (layer->send_code_rej) layer->send_code_rej(layer);
+}
+
+void ppp_fsm_recv_code_rej_perm(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Ack_Rcvd:
+ layer->fsm_state=FSM_Req_Sent;
+ break;
+ default:
+ break;
+ }
+}
+
+void ppp_fsm_recv_code_rej_bad(struct ppp_fsm_t *layer)
+{
+ switch(layer->fsm_state)
+ {
+ case FSM_Opened:
+ if (layer->layer_down) layer->layer_down(layer);
+ layer->send_term_req(layer);
+ layer->fsm_state=FSM_Stopping;
+ break;
+ case FSM_Closing:
+ if (layer->layer_finished) layer->layer_finished(layer);
+ layer->fsm_state=FSM_Closed;
+ break;
+ case FSM_Stopping:
+ case FSM_Req_Sent:
+ case FSM_Ack_Rcvd:
+ case FSM_Ack_Sent:
+ if (layer->layer_finished) layer->layer_finished(layer);
+ layer->fsm_state=FSM_Stopped;
+ break;
+ default:
+ break;
+ }
+}
+
+static void stop_timer(struct ppp_fsm_t *fsm)
+{
+ if (fsm->restart_timer.tpd)
+ triton_timer_del(&fsm->restart_timer);
+}
+static void init_req_counter(struct ppp_fsm_t *layer,int timeout)
+{
+ layer->restart_counter = timeout;
+
+ if (!layer->restart_timer.tpd)
+ triton_timer_add(layer->ppp->ctrl->ctx, &layer->restart_timer, 0);
+}
+static void zero_req_counter(struct ppp_fsm_t *layer)
+{
+ layer->restart_timer.expire_tv.tv_sec=0;
+ layer->restart_counter=0;
+}
+
+static void restart_timer_func(struct triton_timer_t *t)
+{
+ struct ppp_fsm_t *layer = container_of(t, typeof(*layer), restart_timer);
+
+ log_ppp_debug("fsm timeout\n");
+
+ if (layer->restart_counter>0)
+ ppp_fsm_timeout0(layer);
+ else
+ ppp_fsm_timeout1(layer);
+}
+
+void __init fsm_init(void)
+{
+ char *opt;
+
+ opt = conf_get_opt("lcp", "max-terminate");
+ if (opt && atoi(opt) > 0)
+ conf_max_terminate = atoi(opt);
+
+ opt = conf_get_opt("lcp", "max-configure");
+ if (opt && atoi(opt) > 0)
+ conf_max_configure = atoi(opt);
+
+ opt = conf_get_opt("lcp", "max-failure");
+ if (opt && atoi(opt) > 0)
+ conf_max_failure = atoi(opt);
+
+ opt = conf_get_opt("lcp", "timeout");
+ if (opt && atoi(opt) > 0)
+ conf_timeout = atoi(opt);
+}
diff --git a/accel-pptpd/ppp/ppp_fsm.h b/accel-pptpd/ppp/ppp_fsm.h
new file mode 100644
index 0000000..6010240
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_fsm.h
@@ -0,0 +1,72 @@
+#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 */
+#define IDENT 12 /* Identification */
+
+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 (*send_term_req)(struct ppp_fsm_t*);
+ void (*send_term_ack)(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
diff --git a/accel-pptpd/ppp/ppp_ipcp.c b/accel-pptpd/ppp/ppp_ipcp.c
new file mode 100644
index 0000000..c46b1bd
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_ipcp.c
@@ -0,0 +1,651 @@
+#include <stdlib.h>
+#include <string.h>
+#include <linux/ppp_defs.h>
+#include <linux/if_ppp.h>
+#include <arpa/inet.h>
+
+#include "triton.h"
+
+#include "log.h"
+
+#include "ppp.h"
+#include "ppp_ipcp.h"
+
+#include "memdebug.h"
+
+struct recv_opt_t
+{
+ struct list_head entry;
+ struct ipcp_opt_hdr_t *hdr;
+ int len;
+ int state;
+ struct ipcp_option_t *lopt;
+};
+
+static LIST_HEAD(option_handlers);
+
+static void ipcp_layer_up(struct ppp_fsm_t*);
+static void ipcp_layer_down(struct ppp_fsm_t*);
+static int send_conf_req(struct ppp_fsm_t*);
+static void send_conf_ack(struct ppp_fsm_t*);
+static void send_conf_nak(struct ppp_fsm_t*);
+static void send_conf_rej(struct ppp_fsm_t*);
+static void ipcp_recv(struct ppp_handler_t*);
+static void send_term_req(struct ppp_fsm_t *fsm);
+static void send_term_ack(struct ppp_fsm_t *fsm);
+
+static void ipcp_options_init(struct ppp_ipcp_t *ipcp)
+{
+ struct ipcp_option_t *lopt;
+ struct ipcp_option_handler_t *h;
+
+ ipcp->conf_req_len = sizeof(struct ipcp_hdr_t);
+
+ list_for_each_entry(h,&option_handlers,entry) {
+ lopt = h->init(ipcp);
+ if (lopt) {
+ lopt->h = h;
+ list_add_tail(&lopt->entry, &ipcp->options);
+ ipcp->conf_req_len += lopt->len;
+ }
+ }
+}
+
+static void ipcp_options_free(struct ppp_ipcp_t *ipcp)
+{
+ struct ipcp_option_t *lopt;
+
+ while (!list_empty(&ipcp->options)) {
+ lopt = list_entry(ipcp->options.next, typeof(*lopt), entry);
+ list_del(&lopt->entry);
+ lopt->h->free(ipcp, lopt);
+ }
+}
+
+static struct ppp_layer_data_t *ipcp_layer_init(struct ppp_t *ppp)
+{
+ struct ppp_ipcp_t *ipcp = _malloc(sizeof(*ipcp));
+ memset(ipcp, 0, sizeof(*ipcp));
+
+ log_ppp_debug("ipcp_layer_init\n");
+
+ ipcp->ppp = ppp;
+ ipcp->fsm.ppp = ppp;
+
+ ipcp->hnd.proto = PPP_IPCP;
+ ipcp->hnd.recv = ipcp_recv;
+
+ ppp_register_unit_handler(ppp, &ipcp->hnd);
+
+ ipcp->fsm.proto = PPP_IPCP;
+ ppp_fsm_init(&ipcp->fsm);
+
+ ipcp->fsm.layer_up = ipcp_layer_up;
+ ipcp->fsm.layer_finished = ipcp_layer_down;
+ ipcp->fsm.send_conf_req = send_conf_req;
+ ipcp->fsm.send_conf_ack = send_conf_ack;
+ ipcp->fsm.send_conf_nak = send_conf_nak;
+ ipcp->fsm.send_conf_rej = send_conf_rej;
+ ipcp->fsm.send_term_req = send_term_req;
+ ipcp->fsm.send_term_ack = send_term_ack;
+
+ INIT_LIST_HEAD(&ipcp->options);
+ INIT_LIST_HEAD(&ipcp->ropt_list);
+
+ return &ipcp->ld;
+}
+
+int ipcp_layer_start(struct ppp_layer_data_t *ld)
+{
+ struct ppp_ipcp_t *ipcp = container_of(ld, typeof(*ipcp), ld);
+
+ log_ppp_debug("ipcp_layer_start\n");
+
+ ipcp_options_init(ipcp);
+ ppp_fsm_lower_up(&ipcp->fsm);
+ if (ppp_fsm_open(&ipcp->fsm))
+ return -1;
+
+ return 0;
+}
+
+void ipcp_layer_finish(struct ppp_layer_data_t *ld)
+{
+ struct ppp_ipcp_t *ipcp = container_of(ld, typeof(*ipcp), ld);
+
+ log_ppp_debug("ipcp_layer_finish\n");
+
+ ipcp->fsm.fsm_state = FSM_Closed;
+ ppp_layer_finished(ipcp->ppp, &ipcp->ld);
+}
+
+void ipcp_layer_free(struct ppp_layer_data_t *ld)
+{
+ struct ppp_ipcp_t *ipcp = container_of(ld, typeof(*ipcp), ld);
+
+ log_ppp_debug("ipcp_layer_free\n");
+
+ ppp_unregister_handler(ipcp->ppp, &ipcp->hnd);
+ ipcp_options_free(ipcp);
+ ppp_fsm_free(&ipcp->fsm);
+
+ _free(ipcp);
+}
+
+static void ipcp_layer_up(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
+
+ log_ppp_debug("ipcp_layer_started\n");
+
+ if (!ipcp->started) {
+ ipcp->started = 1;
+ ppp_layer_started(ipcp->ppp, &ipcp->ld);
+ }
+}
+
+static void ipcp_layer_down(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
+
+ log_ppp_debug("ipcp_layer_finished\n");
+
+ ppp_layer_finished(ipcp->ppp, &ipcp->ld);
+ if (ipcp->started)
+ ipcp->started = 0;
+ else
+ ppp_terminate(ipcp->ppp, 1);
+}
+
+static void print_ropt(struct recv_opt_t *ropt)
+{
+ int i;
+ uint8_t *ptr = (uint8_t*)ropt->hdr;
+
+ log_ppp_info("<");
+ for (i = 0; i < ropt->len; i++) {
+ log_ppp_info(" %x", ptr[i]);
+ }
+ log_ppp_info(" >");
+}
+
+static int send_conf_req(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
+ uint8_t *buf = _malloc(ipcp->conf_req_len), *ptr = buf;
+ struct ipcp_hdr_t *ipcp_hdr = (struct ipcp_hdr_t*)ptr;
+ struct ipcp_option_t *lopt;
+ int n;
+
+ ipcp_hdr->proto = htons(PPP_IPCP);
+ ipcp_hdr->code = CONFREQ;
+ ipcp_hdr->id = ++ipcp->fsm.id;
+ ipcp_hdr->len = 0;
+
+ ptr += sizeof(*ipcp_hdr);
+
+ list_for_each_entry(lopt, &ipcp->options, entry) {
+ n = lopt->h->send_conf_req(ipcp, lopt, ptr);
+ if (n < 0)
+ return -1;
+ if (n) {
+ ptr += n;
+ lopt->print = 1;
+ } else
+ lopt->print = 0;
+ }
+
+ if (conf_ppp_verbose) {
+ log_ppp_info("send [IPCP ConfReq id=%x", ipcp_hdr->id);
+ list_for_each_entry(lopt,&ipcp->options,entry) {
+ if (lopt->print) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_debug, lopt, NULL);
+ }
+ }
+ log_ppp_info("]\n");
+ }
+
+ ipcp_hdr->len = htons(ptr - buf - 2);
+ ppp_unit_send(ipcp->ppp, ipcp_hdr, ptr - buf);
+
+ _free(buf);
+
+ return 0;
+}
+
+static void send_conf_ack(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
+ struct ipcp_hdr_t *hdr = (struct ipcp_hdr_t*)ipcp->ppp->unit_buf;
+
+ hdr->code = CONFACK;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [IPCP ConfAck id=%x]\n", ipcp->fsm.recv_id);
+
+ ppp_unit_send(ipcp->ppp, hdr, ntohs(hdr->len) + 2);
+}
+
+static void send_conf_nak(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
+ uint8_t *buf = _malloc(ipcp->conf_req_len), *ptr = buf;
+ struct ipcp_hdr_t *ipcp_hdr = (struct ipcp_hdr_t*)ptr;
+ struct recv_opt_t *ropt;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [IPCP ConfNak id=%x", ipcp->fsm.recv_id);
+
+ ipcp_hdr->proto = htons(PPP_IPCP);
+ ipcp_hdr->code = CONFNAK;
+ ipcp_hdr->id = ipcp->fsm.recv_id;
+ ipcp_hdr->len = 0;
+
+ ptr += sizeof(*ipcp_hdr);
+
+ list_for_each_entry(ropt, &ipcp->ropt_list, entry) {
+ if (ropt->state == IPCP_OPT_NAK) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ ropt->lopt->h->print(log_ppp_info, ropt->lopt, NULL);
+ }
+ ptr += ropt->lopt->h->send_conf_nak(ipcp, ropt->lopt, ptr);
+ }
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ ipcp_hdr->len = htons(ptr-buf-2);
+ ppp_unit_send(ipcp->ppp, ipcp_hdr, ptr - buf);
+
+ _free(buf);
+}
+
+static void send_conf_rej(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
+ uint8_t *buf = _malloc(ipcp->ropt_len + sizeof(struct ipcp_hdr_t)), *ptr = buf;
+ struct ipcp_hdr_t *ipcp_hdr = (struct ipcp_hdr_t*)ptr;
+ struct recv_opt_t *ropt;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [IPCP ConfRej id=%x", ipcp->fsm.recv_id);
+
+ ipcp_hdr->proto = htons(PPP_IPCP);
+ ipcp_hdr->code = CONFREJ;
+ ipcp_hdr->id = ipcp->fsm.recv_id;
+ ipcp_hdr->len = 0;
+
+ ptr += sizeof(*ipcp_hdr);
+
+ list_for_each_entry(ropt, &ipcp->ropt_list, entry) {
+ if (ropt->state == IPCP_OPT_REJ) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ if (ropt->lopt)
+ ropt->lopt->h->print(log_ppp_info, ropt->lopt, (uint8_t*)ropt->hdr);
+ else
+ print_ropt(ropt);
+ }
+ memcpy(ptr, ropt->hdr, ropt->len);
+ ptr += ropt->len;
+ }
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ ipcp_hdr->len = htons(ptr - buf - 2);
+ ppp_unit_send(ipcp->ppp, ipcp_hdr, ptr-buf);
+
+ _free(buf);
+}
+
+static int ipcp_recv_conf_req(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
+{
+ struct ipcp_opt_hdr_t *hdr;
+ struct recv_opt_t *ropt;
+ struct ipcp_option_t *lopt;
+ int r,ret = 1;
+
+ ipcp->ropt_len = size;
+
+ while (size > 0) {
+ hdr = (struct ipcp_opt_hdr_t *)data;
+
+ ropt = _malloc(sizeof(*ropt));
+ memset(ropt, 0, sizeof(*ropt));
+
+ if (hdr->len > size)
+ ropt->len = size;
+ else
+ ropt->len = hdr->len;
+ ropt->hdr = hdr;
+ ropt->state = IPCP_OPT_NONE;
+ list_add_tail(&ropt->entry, &ipcp->ropt_list);
+
+ data += ropt->len;
+ size -= ropt->len;
+ }
+
+ list_for_each_entry(lopt, &ipcp->options, entry)
+ lopt->state=IPCP_OPT_NONE;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [IPCP ConfReq id=%x", ipcp->fsm.recv_id);
+
+ list_for_each_entry(ropt, &ipcp->ropt_list, entry) {
+ list_for_each_entry(lopt, &ipcp->options, entry) {
+ if (lopt->id == ropt->hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info, lopt, (uint8_t*)ropt->hdr);
+ }
+ r = lopt->h->recv_conf_req(ipcp, lopt, (uint8_t*)ropt->hdr);
+ lopt->state = r;
+ ropt->state = r;
+ ropt->lopt = lopt;
+ if (r < ret)
+ ret = r;
+ break;
+ }
+ }
+ if (!ropt->lopt)
+ {
+ if (conf_ppp_verbose) {
+ log_ppp_debug(" ");
+ print_ropt(ropt);
+ }
+ ropt->state = IPCP_OPT_REJ;
+ ret = IPCP_OPT_REJ;
+ }
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ /*list_for_each_entry(lopt,&ipcp->options,entry)
+ {
+ if (lopt->state==IPCP_OPT_NONE)
+ {
+ r=lopt->h->recv_conf_req(ipcp,lopt,NULL);
+ lopt->state=r;
+ if (r<ret) ret=r;
+ }
+ }*/
+
+ return ret;
+}
+
+static void ipcp_free_conf_req(struct ppp_ipcp_t *ipcp)
+{
+ struct recv_opt_t *ropt;
+
+ while (!list_empty(&ipcp->ropt_list)) {
+ ropt = list_entry(ipcp->ropt_list.next, typeof(*ropt), entry);
+ list_del(&ropt->entry);
+ _free(ropt);
+ }
+}
+
+static int ipcp_recv_conf_rej(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
+{
+ struct ipcp_opt_hdr_t *hdr;
+ struct ipcp_option_t *lopt;
+ int res = 0;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [IPCP ConfRej id=%x", ipcp->fsm.recv_id);
+
+ if (ipcp->fsm.recv_id != ipcp->fsm.id) {
+ if (conf_ppp_verbose)
+ log_ppp_info(": id mismatch ]\n");
+ return 0;
+ }
+
+ while (size > 0) {
+ hdr = (struct ipcp_opt_hdr_t *)data;
+
+ list_for_each_entry(lopt, &ipcp->options, entry) {
+ if (lopt->id == hdr->id) {
+ if (!lopt->h->recv_conf_rej)
+ res = -1;
+ else if (lopt->h->recv_conf_rej(ipcp, lopt, data))
+ res = -1;
+ break;
+ }
+ }
+
+ data += hdr->len;
+ size -= hdr->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ return res;
+}
+
+static int ipcp_recv_conf_nak(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
+{
+ struct ipcp_opt_hdr_t *hdr;
+ struct ipcp_option_t *lopt;
+ int res = 0;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [IPCP ConfNak id=%x", ipcp->fsm.recv_id);
+
+ if (ipcp->fsm.recv_id != ipcp->fsm.id) {
+ if (conf_ppp_verbose)
+ log_ppp_info(": id mismatch ]\n");
+ return 0;
+ }
+
+ while (size > 0) {
+ hdr = (struct ipcp_opt_hdr_t *)data;
+
+ list_for_each_entry(lopt, &ipcp->options, entry) {
+ if (lopt->id == hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info,lopt,data);
+ }
+ if (lopt->h->recv_conf_nak(ipcp, lopt, data))
+ res =- 1;
+ break;
+ }
+ }
+
+ data += hdr->len;
+ size -= hdr->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ return res;
+}
+
+static int ipcp_recv_conf_ack(struct ppp_ipcp_t *ipcp, uint8_t *data, int size)
+{
+ struct ipcp_opt_hdr_t *hdr;
+ struct ipcp_option_t *lopt;
+ int res = 0;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [IPCP ConfAck id=%x", ipcp->fsm.recv_id);
+
+ if (ipcp->fsm.recv_id != ipcp->fsm.id) {
+ if (conf_ppp_verbose)
+ log_ppp_info(": id mismatch ]\n");
+ return 0;
+ }
+
+ while (size > 0) {
+ hdr = (struct ipcp_opt_hdr_t *)data;
+
+ list_for_each_entry(lopt, &ipcp->options, entry) {
+ if (lopt->id == hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info, lopt, data);
+ }
+ if (!lopt->h->recv_conf_ack)
+ break;
+ if (lopt->h->recv_conf_ack(ipcp, lopt, data))
+ res = -1;
+ break;
+ }
+ }
+
+ data += hdr->len;
+ size -= hdr->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ return res;
+}
+
+static void send_term_req(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
+ struct ipcp_hdr_t hdr = {
+ .proto = htons(PPP_IPCP),
+ .code = TERMREQ,
+ .id = ++ipcp->fsm.id,
+ .len = htons(4),
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [IPCP TermReq id=%i]\n", hdr.id);
+
+ ppp_unit_send(ipcp->ppp, &hdr, 6);
+}
+
+static void send_term_ack(struct ppp_fsm_t *fsm)
+{
+ struct ppp_ipcp_t *ipcp = container_of(fsm, typeof(*ipcp), fsm);
+ struct ipcp_hdr_t hdr = {
+ .proto = htons(PPP_IPCP),
+ .code = TERMACK,
+ .id = ipcp->fsm.recv_id,
+ .len = htons(4),
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [IPCP TermAck id=%i]\n", hdr.id);
+
+ ppp_unit_send(ipcp->ppp, &hdr, 6);
+}
+
+static void ipcp_recv(struct ppp_handler_t*h)
+{
+ struct ipcp_hdr_t *hdr;
+ struct ppp_ipcp_t *ipcp = container_of(h, typeof(*ipcp), hnd);
+ int r;
+
+ if (ipcp->fsm.fsm_state == FSM_Initial || ipcp->fsm.fsm_state == FSM_Closed) {
+ if (conf_ppp_verbose)
+ log_ppp_warn("IPCP: discaring packet\n");
+ return;
+ }
+
+ if (ipcp->ppp->unit_buf_size < PPP_HEADERLEN + 2) {
+ log_ppp_warn("IPCP: short packet received\n");
+ return;
+ }
+
+ hdr = (struct ipcp_hdr_t *)ipcp->ppp->unit_buf;
+ if (ntohs(hdr->len) < PPP_HEADERLEN) {
+ log_ppp_warn("IPCP: short packet received\n");
+ return;
+ }
+
+ ipcp->fsm.recv_id = hdr->id;
+ switch(hdr->code) {
+ case CONFREQ:
+ r = ipcp_recv_conf_req(ipcp,(uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN);
+ switch(r) {
+ case IPCP_OPT_ACK:
+ ppp_fsm_recv_conf_req_ack(&ipcp->fsm);
+ break;
+ case IPCP_OPT_NAK:
+ ppp_fsm_recv_conf_req_nak(&ipcp->fsm);
+ break;
+ case IPCP_OPT_REJ:
+ ppp_fsm_recv_conf_req_rej(&ipcp->fsm);
+ break;
+ }
+ ipcp_free_conf_req(ipcp);
+ if (r == IPCP_OPT_FAIL)
+ ppp_terminate(ipcp->ppp, 0);
+ break;
+ case CONFACK:
+ if (ipcp_recv_conf_ack(ipcp,(uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN))
+ ppp_terminate(ipcp->ppp, 0);
+ else
+ ppp_fsm_recv_conf_ack(&ipcp->fsm);
+ break;
+ case CONFNAK:
+ ipcp_recv_conf_nak(ipcp,(uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN);
+ ppp_fsm_recv_conf_rej(&ipcp->fsm);
+ break;
+ case CONFREJ:
+ if (ipcp_recv_conf_rej(ipcp, (uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN))
+ ppp_terminate(ipcp->ppp, 0);
+ else
+ ppp_fsm_recv_conf_rej(&ipcp->fsm);
+ break;
+ case TERMREQ:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [IPCP TermReq id=%x]\n", hdr->id);
+ ppp_fsm_recv_term_req(&ipcp->fsm);
+ ppp_terminate(ipcp->ppp, 0);
+ break;
+ case TERMACK:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [IPCP TermAck id=%x]\n", hdr->id);
+ ppp_fsm_recv_term_ack(&ipcp->fsm);
+ ppp_terminate(ipcp->ppp, 0);
+ break;
+ case CODEREJ:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [IPCP CodeRej id=%x]\n", hdr->id);
+ ppp_fsm_recv_code_rej_bad(&ipcp->fsm);
+ break;
+ default:
+ ppp_fsm_recv_unk(&ipcp->fsm);
+ break;
+ }
+}
+
+int ipcp_option_register(struct ipcp_option_handler_t *h)
+{
+ /*struct ipcp_option_drv_t *p;
+
+ list_for_each_entry(p,option_drv_list,entry)
+ if (p->id==h->id)
+ return -1;*/
+
+ list_add_tail(&h->entry, &option_handlers);
+
+ return 0;
+}
+
+static struct ppp_layer_t ipcp_layer =
+{
+ .init = ipcp_layer_init,
+ .start = ipcp_layer_start,
+ .finish = ipcp_layer_finish,
+ .free = ipcp_layer_free,
+};
+
+static void __init ipcp_init(void)
+{
+ ppp_register_layer("ipcp", &ipcp_layer);
+}
+
diff --git a/accel-pptpd/ppp/ppp_ipcp.h b/accel-pptpd/ppp/ppp_ipcp.h
new file mode 100644
index 0000000..c955987
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_ipcp.h
@@ -0,0 +1,96 @@
+#ifndef PPP_IPCP_H
+#define PPP_IPCP_H
+
+#include <stdint.h>
+
+#include "triton.h"
+#include "ppp_fsm.h"
+/*
+ * Options.
+ */
+#define CI_COMP 2 /* IP-Compress-Protocol */
+#define CI_ADDR 3 /* IP-Address */
+#define CI_DNS1 129 /* Primary-DNS-Address */
+#define CI_DNS2 131 /* Secondary-DNS-Address */
+
+struct ipcp_hdr_t
+{
+ uint16_t proto;
+ uint8_t code;
+ uint8_t id;
+ uint16_t len;
+} __attribute__((packed));
+struct ipcp_opt_hdr_t
+{
+ uint8_t id;
+ uint8_t len;
+} __attribute__((packed));
+struct ipcp_opt8_t
+{
+ struct ipcp_opt_hdr_t hdr;
+ uint8_t val;
+} __attribute__((packed));
+struct ipcp_opt16_t
+{
+ struct ipcp_opt_hdr_t hdr;
+ uint16_t val;
+} __attribute__((packed));
+struct ipcp_opt32_t
+{
+ struct ipcp_opt_hdr_t hdr;
+ uint32_t val;
+} __attribute__((packed));
+
+#define IPCP_OPT_NONE 0
+#define IPCP_OPT_ACK 1
+#define IPCP_OPT_NAK -1
+#define IPCP_OPT_REJ -2
+#define IPCP_OPT_FAIL -3
+
+struct ppp_ipcp_t;
+struct ipcp_option_handler_t;
+
+struct ipcp_option_t
+{
+ struct list_head entry;
+ int id;
+ int len;
+ int state;
+ int print:1;
+ struct ipcp_option_handler_t *h;
+};
+
+struct ipcp_option_handler_t
+{
+ struct list_head entry;
+ struct ipcp_option_t* (*init)(struct ppp_ipcp_t*);
+ int (*send_conf_req)(struct ppp_ipcp_t*,struct ipcp_option_t*,uint8_t*);
+ int (*send_conf_rej)(struct ppp_ipcp_t*,struct ipcp_option_t*,uint8_t*);
+ int (*send_conf_nak)(struct ppp_ipcp_t*,struct ipcp_option_t*,uint8_t*);
+ int (*recv_conf_req)(struct ppp_ipcp_t*,struct ipcp_option_t*,uint8_t*);
+ int (*recv_conf_rej)(struct ppp_ipcp_t*,struct ipcp_option_t*,uint8_t*);
+ int (*recv_conf_nak)(struct ppp_ipcp_t*,struct ipcp_option_t*,uint8_t*);
+ int (*recv_conf_ack)(struct ppp_ipcp_t*,struct ipcp_option_t*,uint8_t*);
+ void (*free)(struct ppp_ipcp_t*,struct ipcp_option_t*);
+ void (*print)(void (*print)(const char *fmt,...), struct ipcp_option_t*,uint8_t*);
+};
+
+struct ppp_ipcp_t
+{
+ struct ppp_layer_data_t ld;
+ struct ppp_handler_t hnd;
+ struct ppp_fsm_t fsm;
+ struct ppp_t *ppp;
+ struct list_head options;
+
+ struct list_head ropt_list; // last received ConfReq
+ int ropt_len;
+
+ int conf_req_len;
+ int started:1;
+};
+
+int ipcp_option_register(struct ipcp_option_handler_t *h);
+
+#endif
+
diff --git a/accel-pptpd/ppp/ppp_lcp.c b/accel-pptpd/ppp/ppp_lcp.c
new file mode 100644
index 0000000..08fd359
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_lcp.c
@@ -0,0 +1,821 @@
+#include <stdlib.h>
+#include <string.h>
+#include <linux/ppp_defs.h>
+#include <linux/if_ppp.h>
+#include <arpa/inet.h>
+
+#include "triton.h"
+
+#include "log.h"
+
+#include "ppp.h"
+#include "ppp_lcp.h"
+
+#include "memdebug.h"
+
+struct recv_opt_t
+{
+ struct list_head entry;
+ struct lcp_opt_hdr_t *hdr;
+ int len;
+ int state;
+ struct lcp_option_t *lopt;
+};
+
+static int conf_echo_interval = 0;
+static int conf_echo_failure = 3;
+
+static LIST_HEAD(option_handlers);
+static struct ppp_layer_t lcp_layer;
+
+static void lcp_layer_up(struct ppp_fsm_t*);
+static void lcp_layer_down(struct ppp_fsm_t*);
+static void lcp_layer_finished(struct ppp_fsm_t*);
+static int send_conf_req(struct ppp_fsm_t*);
+static void send_conf_ack(struct ppp_fsm_t*);
+static void send_conf_nak(struct ppp_fsm_t*);
+static void send_conf_rej(struct ppp_fsm_t*);
+static void send_code_rej(struct ppp_fsm_t*);
+static void start_echo(struct ppp_lcp_t *lcp);
+static void stop_echo(struct ppp_lcp_t *lcp);
+static void send_term_req(struct ppp_fsm_t *fsm);
+static void send_term_ack(struct ppp_fsm_t *fsm);
+static void lcp_recv(struct ppp_handler_t*);
+
+static void lcp_options_init(struct ppp_lcp_t *lcp)
+{
+ struct lcp_option_t *lopt;
+ struct lcp_option_handler_t *h;
+
+ INIT_LIST_HEAD(&lcp->options);
+
+ lcp->conf_req_len = sizeof(struct lcp_hdr_t);
+
+ list_for_each_entry(h, &option_handlers, entry) {
+ lopt = h->init(lcp);
+ if (lopt) {
+ lopt->h = h;
+ list_add_tail(&lopt->entry, &lcp->options);
+ lcp->conf_req_len += lopt->len;
+ }
+ }
+}
+
+static void lcp_options_free(struct ppp_lcp_t *lcp)
+{
+ struct lcp_option_t *lopt;
+
+ while (!list_empty(&lcp->options)) {
+ lopt = list_entry(lcp->options.next, typeof(*lopt), entry);
+ list_del(&lopt->entry);
+ lopt->h->free(lcp, lopt);
+ }
+}
+
+static struct ppp_layer_data_t *lcp_layer_init(struct ppp_t *ppp)
+{
+ struct ppp_lcp_t *lcp = _malloc(sizeof(*lcp));
+ memset(lcp, 0, sizeof(*lcp));
+
+ log_ppp_debug("lcp_layer_init\n");
+
+ lcp->ppp = ppp;
+ lcp->fsm.ppp = ppp;
+
+ lcp->hnd.proto = PPP_LCP;
+ lcp->hnd.recv = lcp_recv;
+
+ ppp_register_chan_handler(ppp, &lcp->hnd);
+
+ lcp->fsm.proto = PPP_LCP;
+ ppp_fsm_init(&lcp->fsm);
+
+ lcp->fsm.layer_up = lcp_layer_up;
+ lcp->fsm.layer_down = lcp_layer_down;
+ lcp->fsm.layer_finished = lcp_layer_finished;
+ lcp->fsm.send_conf_req = send_conf_req;
+ lcp->fsm.send_conf_ack = send_conf_ack;
+ lcp->fsm.send_conf_nak = send_conf_nak;
+ lcp->fsm.send_conf_rej = send_conf_rej;
+ lcp->fsm.send_code_rej = send_code_rej;
+ lcp->fsm.send_term_req = send_term_req;
+ lcp->fsm.send_term_ack = send_term_ack;
+
+ INIT_LIST_HEAD(&lcp->ropt_list);
+
+ return &lcp->ld;
+}
+
+int lcp_layer_start(struct ppp_layer_data_t *ld)
+{
+ struct ppp_lcp_t *lcp = container_of(ld, typeof(*lcp), ld);
+
+ log_ppp_debug("lcp_layer_start\n");
+
+ lcp_options_init(lcp);
+ ppp_fsm_lower_up(&lcp->fsm);
+ if (ppp_fsm_open(&lcp->fsm))
+ return -1;
+
+ return 0;
+}
+
+void lcp_layer_finish(struct ppp_layer_data_t *ld)
+{
+ struct ppp_lcp_t *lcp = container_of(ld,typeof(*lcp),ld);
+
+ log_ppp_debug("lcp_layer_finish\n");
+
+ stop_echo(lcp);
+
+ ppp_fsm_close(&lcp->fsm);
+}
+
+void lcp_layer_free(struct ppp_layer_data_t *ld)
+{
+ struct ppp_lcp_t *lcp = container_of(ld, typeof(*lcp), ld);
+
+ log_ppp_debug("lcp_layer_free\n");
+
+ stop_echo(lcp);
+ ppp_unregister_handler(lcp->ppp, &lcp->hnd);
+ lcp_options_free(lcp);
+ ppp_fsm_free(&lcp->fsm);
+
+ _free(lcp);
+}
+
+static void lcp_layer_up(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm);
+
+ log_ppp_debug("lcp_layer_started\n");
+
+ if (!lcp->started) {
+ lcp->started = 1;
+ ppp_layer_started(lcp->ppp, &lcp->ld);
+
+ start_echo(lcp);
+ }
+}
+
+static void lcp_layer_down(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm);
+ //ppp_fsm_close(&lcp->fsm);
+ stop_echo(lcp);
+ //ppp_layer_finished(lcp->ppp,&lcp->ld);
+}
+
+static void lcp_layer_finished(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm);
+
+ log_ppp_debug("lcp_layer_finished\n");
+
+ stop_echo(lcp);
+ ppp_layer_finished(lcp->ppp, &lcp->ld);
+ if (lcp->started)
+ lcp->started = 0;
+ else
+ ppp_terminate(lcp->ppp, 1);
+}
+
+static void print_ropt(struct recv_opt_t *ropt)
+{
+ int i;
+ uint8_t *ptr = (uint8_t*)ropt->hdr;
+
+ log_ppp_debug("<");
+ for (i = 0; i < ropt->len; i++) {
+ log_ppp_info(" %x", ptr[i]);
+ }
+ log_ppp_debug(" >");
+}
+
+static int send_conf_req(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm);
+ uint8_t *buf = _malloc(lcp->conf_req_len), *ptr = buf;
+ struct lcp_hdr_t *lcp_hdr = (struct lcp_hdr_t*)ptr;
+ struct lcp_option_t *lopt;
+ int n;
+
+ lcp_hdr->proto = htons(PPP_LCP);
+ lcp_hdr->code = CONFREQ;
+ lcp_hdr->id = ++lcp->fsm.id;
+ lcp_hdr->len = 0;
+
+ ptr += sizeof(*lcp_hdr);
+
+ list_for_each_entry(lopt, &lcp->options, entry) {
+ n = lopt->h->send_conf_req(lcp, lopt, ptr);
+ if (n < 0)
+ return -1;
+ if (n) {
+ ptr += n;
+ lopt->print = 1;
+ } else
+ lopt->print = 0;
+ }
+
+ if (conf_ppp_verbose) {
+ log_ppp_info("send [LCP ConfReq id=%x", lcp_hdr->id);
+ list_for_each_entry(lopt,&lcp->options,entry) {
+ if (lopt->print) {
+ log_ppp_debug(" ");
+ lopt->h->print(log_ppp_debug, lopt, NULL);
+ }
+ }
+ log_ppp_debug("]\n");
+ }
+
+ lcp_hdr->len = htons(ptr - buf - 2);
+ ppp_chan_send(lcp->ppp, lcp_hdr, ptr-buf);
+
+ _free(buf);
+
+ return 0;
+}
+
+static void send_conf_ack(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm);
+ struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->chan_buf;
+
+ hdr->code = CONFACK;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [LCP ConfAck id=%x ]\n", lcp->fsm.recv_id);
+
+ ppp_chan_send(lcp->ppp, hdr, ntohs(hdr->len) + 2);
+}
+
+static void send_code_rej(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm);
+ struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->chan_buf;
+
+ hdr->code = CONFACK;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [LCP CodeRej %x id=%x ]\n",hdr->code, lcp->fsm.recv_id);
+
+ ppp_chan_send(lcp->ppp, hdr, ntohs(hdr->len) + 2);
+}
+
+static void send_conf_nak(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm);
+ uint8_t *buf = _malloc(lcp->conf_req_len), *ptr = buf;
+ struct lcp_hdr_t *lcp_hdr = (struct lcp_hdr_t*)ptr;
+ struct lcp_option_t *lopt;
+
+ if (conf_ppp_verbose)
+ log_ppp_debug("send [LCP ConfNak id=%x", lcp->fsm.recv_id);
+
+ lcp_hdr->proto = htons(PPP_LCP);
+ lcp_hdr->code = CONFNAK;
+ lcp_hdr->id = lcp->fsm.recv_id;
+ lcp_hdr->len = 0;
+
+ ptr += sizeof(*lcp_hdr);
+
+ list_for_each_entry(lopt, &lcp->options, entry) {
+ if (lopt->state == LCP_OPT_NAK) {
+ ptr+=lopt->h->send_conf_nak(lcp,lopt,ptr);
+
+ if (conf_ppp_verbose) {
+ log_ppp_debug(" ");
+ lopt->h->print(log_ppp_info, lopt, NULL);
+ }
+ }
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ lcp_hdr->len = htons(ptr - buf - 2);
+ ppp_chan_send(lcp->ppp, lcp_hdr,ptr - buf);
+
+ _free(buf);
+}
+
+static void send_conf_rej(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm);
+ uint8_t *buf = _malloc(lcp->ropt_len + sizeof(struct lcp_hdr_t)), *ptr = buf;
+ struct lcp_hdr_t *lcp_hdr = (struct lcp_hdr_t*)ptr;
+ struct recv_opt_t *ropt;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [LCP ConfRej id=%x ", lcp->fsm.recv_id);
+
+ lcp_hdr->proto = htons(PPP_LCP);
+ lcp_hdr->code = CONFREJ;
+ lcp_hdr->id = lcp->fsm.recv_id;
+ lcp_hdr->len = 0;
+
+ ptr += sizeof(*lcp_hdr);
+
+ list_for_each_entry(ropt, &lcp->ropt_list, entry) {
+ if (ropt->state == LCP_OPT_REJ) {
+ memcpy(ptr, ropt->hdr, ropt->len);
+ ptr += ropt->len;
+
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ if (ropt->lopt)
+ ropt->lopt->h->print(log_ppp_info, ropt->lopt, (uint8_t*)ropt->hdr);
+ else
+ print_ropt(ropt);
+ }
+ }
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ lcp_hdr->len = htons(ptr - buf - 2);
+ ppp_chan_send(lcp->ppp, lcp_hdr, ptr - buf);
+
+ _free(buf);
+}
+
+static int lcp_recv_conf_req(struct ppp_lcp_t *lcp, uint8_t *data, int size)
+{
+ struct lcp_opt_hdr_t *hdr;
+ struct recv_opt_t *ropt;
+ struct lcp_option_t *lopt;
+ int r, ret = 1;
+
+ lcp->ropt_len = size;
+
+ while (size > 0) {
+ hdr = (struct lcp_opt_hdr_t *)data;
+
+ ropt = _malloc(sizeof(*ropt));
+ memset(ropt, 0, sizeof(*ropt));
+
+ if (hdr->len > size)
+ ropt->len = size;
+ else
+ ropt->len = hdr->len;
+
+ ropt->hdr = hdr;
+ ropt->state = LCP_OPT_NONE;
+ list_add_tail(&ropt->entry, &lcp->ropt_list);
+
+ data += ropt->len;
+ size -= ropt->len;
+ }
+
+ list_for_each_entry(lopt, &lcp->options, entry)
+ lopt->state = LCP_OPT_NONE;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP ConfReq id=%x", lcp->fsm.recv_id);
+
+ list_for_each_entry(ropt, &lcp->ropt_list, entry) {
+ list_for_each_entry(lopt, &lcp->options, entry) {
+ if (lopt->id == ropt->hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info, lopt, (uint8_t*)ropt->hdr);
+ }
+ r = lopt->h->recv_conf_req(lcp, lopt, (uint8_t*)ropt->hdr);
+ lopt->state = r;
+ ropt->state = r;
+ ropt->lopt = lopt;
+ if (r<ret)
+ ret = r;
+ break;
+ }
+ }
+ if (!ropt->lopt) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ print_ropt(ropt);
+ }
+ ropt->state=LCP_OPT_REJ;
+ ret=LCP_OPT_REJ;
+ }
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ /*list_for_each_entry(lopt,&lcp->options,entry)
+ {
+ if (lopt->state==LCP_OPT_NONE)
+ {
+ r=lopt->h->recv_conf_req(lcp,lopt,NULL);
+ lopt->state=r;
+ if (r<ret) ret=r;
+ }
+ }*/
+
+ return ret;
+}
+
+static void lcp_free_conf_req(struct ppp_lcp_t *lcp)
+{
+ struct recv_opt_t *ropt;
+
+ while (!list_empty(&lcp->ropt_list)) {
+ ropt = list_entry(lcp->ropt_list.next, typeof(*ropt), entry);
+ list_del(&ropt->entry);
+ _free(ropt);
+ }
+}
+
+static int lcp_recv_conf_rej(struct ppp_lcp_t *lcp, uint8_t *data, int size)
+{
+ struct lcp_opt_hdr_t *hdr;
+ struct lcp_option_t *lopt;
+ int res = 0;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP ConfRej id=%x", lcp->fsm.recv_id);
+
+ if (lcp->fsm.recv_id != lcp->fsm.id) {
+ if (conf_ppp_verbose)
+ log_ppp_info(": id mismatch ]\n");
+ return 0;
+ }
+
+ while (size > 0) {
+ hdr = (struct lcp_opt_hdr_t *)data;
+
+ list_for_each_entry(lopt, &lcp->options, entry) {
+ if (lopt->id == hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info, lopt, (uint8_t*)hdr);
+ }
+ if (!lopt->h->recv_conf_rej)
+ res = -1;
+ else if (lopt->h->recv_conf_rej(lcp, lopt, data))
+ res = -1;
+ break;
+ }
+ }
+
+ data += hdr->len;
+ size -= hdr->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ return res;
+}
+
+static int lcp_recv_conf_nak(struct ppp_lcp_t *lcp, uint8_t *data, int size)
+{
+ struct lcp_opt_hdr_t *hdr;
+ struct lcp_option_t *lopt;
+ int res = 0;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP ConfNak id=%x", lcp->fsm.recv_id);
+
+ if (lcp->fsm.recv_id != lcp->fsm.id) {
+ if (conf_ppp_verbose)
+ log_ppp_info(": id mismatch ]\n");
+ return 0;
+ }
+
+ while (size > 0) {
+ hdr = (struct lcp_opt_hdr_t *)data;
+
+ list_for_each_entry(lopt,&lcp->options,entry) {
+ if (lopt->id == hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info, lopt, data);
+ }
+ if (lopt->h->recv_conf_nak(lcp, lopt, data))
+ res = -1;
+ break;
+ }
+ }
+
+ data += hdr->len;
+ size -= hdr->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ return res;
+}
+
+static int lcp_recv_conf_ack(struct ppp_lcp_t *lcp, uint8_t *data, int size)
+{
+ struct lcp_opt_hdr_t *hdr;
+ struct lcp_option_t *lopt;
+ int res=0;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP ConfAck id=%x", lcp->fsm.recv_id);
+
+ if (lcp->fsm.recv_id != lcp->fsm.id) {
+ if (conf_ppp_verbose)
+ log_ppp_info(": id mismatch ]\n");
+ return 0;
+ }
+
+ while (size > 0) {
+ hdr = (struct lcp_opt_hdr_t *)data;
+
+ list_for_each_entry(lopt, &lcp->options, entry) {
+ if (lopt->id == hdr->id) {
+ if (conf_ppp_verbose) {
+ log_ppp_info(" ");
+ lopt->h->print(log_ppp_info, lopt, data);
+ }
+ if (!lopt->h->recv_conf_ack)
+ break;
+ if (lopt->h->recv_conf_ack(lcp, lopt, data))
+ res = -1;
+ break;
+ }
+ }
+
+ data += hdr->len;
+ size -= hdr->len;
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("]\n");
+
+ return res;
+}
+
+static void lcp_recv_echo_repl(struct ppp_lcp_t *lcp, uint8_t *data, int size)
+{
+ uint32_t magic = *(uint32_t *)data;
+
+ if (size != 4) {
+ log_ppp_error("lcp:echo: magic number size mismatch\n");
+ ppp_terminate(lcp->ppp, 0);
+ }
+
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP EchoRep id=%x <magic %x>]\n", lcp->fsm.recv_id, magic);
+
+ if (magic == lcp->magic) {
+ log_ppp_error("lcp: echo: loop-back detected\n");
+ ppp_terminate(lcp->ppp, 0);
+ }
+
+ lcp->echo_sent = 0;
+}
+
+static void send_echo_reply(struct ppp_lcp_t *lcp)
+{
+ struct lcp_hdr_t *hdr = (struct lcp_hdr_t*)lcp->ppp->chan_buf;
+ uint32_t magic = *(uint32_t *)(hdr + 1);
+
+ hdr->code = ECHOREP;
+ *(uint32_t *)(hdr + 1) = lcp->magic;
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [LCP EchoRep id=%x <magic %x>]\n", hdr->id, magic);
+
+ ppp_chan_send(lcp->ppp, hdr, ntohs(hdr->len) + 2);
+}
+
+static void send_echo_request(struct triton_timer_t *t)
+{
+ struct ppp_lcp_t *lcp = container_of(t, typeof(*lcp), echo_timer);
+ struct lcp_echo_req_t
+ {
+ struct lcp_hdr_t hdr;
+ uint32_t magic;
+ } __attribute__((packed)) msg = {
+ .hdr.proto = htons(PPP_LCP),
+ .hdr.code = ECHOREQ,
+ .hdr.id = ++lcp->fsm.id,
+ .hdr.len = htons(8),
+ .magic = lcp->magic,
+ };
+
+ if (++lcp->echo_sent > lcp->echo_failure) {
+ log_ppp_warn("lcp: no echo reply\n");
+ ppp_terminate(lcp->ppp, 0);
+ } else {
+ if (conf_ppp_verbose)
+ log_ppp_info("send [LCP EchoReq id=%x <magic %x>]\n", msg.hdr.id, msg.magic);
+ ppp_chan_send(lcp->ppp,&msg,ntohs(msg.hdr.len)+2);
+ }
+}
+
+static void start_echo(struct ppp_lcp_t *lcp)
+{
+ lcp->echo_interval = conf_echo_interval;
+ lcp->echo_failure = conf_echo_failure;
+
+ lcp->echo_timer.period = lcp->echo_interval * 1000;
+ lcp->echo_timer.expire = send_echo_request;
+ if (lcp->echo_timer.period)
+ triton_timer_add(lcp->ppp->ctrl->ctx, &lcp->echo_timer, 0);
+}
+static void stop_echo(struct ppp_lcp_t *lcp)
+{
+ if (lcp->echo_timer.tpd)
+ triton_timer_del(&lcp->echo_timer);
+}
+
+static void send_term_req(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp=container_of(fsm,typeof(*lcp),fsm);
+ struct lcp_hdr_t hdr = {
+ .proto = htons(PPP_LCP),
+ .code = TERMREQ,
+ .id = ++lcp->fsm.id,
+ .len = htons(4),
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [LCP TermReq id=%i]\n", hdr.id);
+
+ ppp_chan_send(lcp->ppp, &hdr, 6);
+}
+
+static void send_term_ack(struct ppp_fsm_t *fsm)
+{
+ struct ppp_lcp_t *lcp = container_of(fsm, typeof(*lcp), fsm);
+ struct lcp_hdr_t hdr = {
+ .proto = htons(PPP_LCP),
+ .code = TERMACK,
+ .id = lcp->fsm.recv_id,
+ .len = htons(4),
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [LCP TermAck id=%i]\n", hdr.id);
+
+ ppp_chan_send(lcp->ppp, &hdr, 6);
+}
+
+void lcp_send_proto_rej(struct ppp_t *ppp, uint16_t proto)
+{
+ struct ppp_lcp_t *lcp = container_of(ppp_find_layer_data(ppp, &lcp_layer), typeof(*lcp), ld);
+ struct rej_msg_t
+ {
+ struct lcp_hdr_t hdr;
+ uint16_t proto;
+ } __attribute__((packed)) msg = {
+ .hdr.proto = htons(PPP_LCP),
+ .hdr.code = PROTOREJ,
+ .hdr.id = ++lcp->fsm.id,
+ .hdr.len = htons(6),
+ .proto = proto,
+ };
+
+ if (conf_ppp_verbose)
+ log_ppp_info("send [LCP ProtoRej id=%i <%04x>]\n", msg.hdr.id, proto);
+
+ ppp_chan_send(lcp->ppp, &msg, sizeof(msg));
+}
+
+static void lcp_recv(struct ppp_handler_t*h)
+{
+ struct lcp_hdr_t *hdr;
+ struct ppp_lcp_t *lcp = container_of(h, typeof(*lcp), hnd);
+ int r;
+ char *term_msg;
+
+ if (lcp->ppp->chan_buf_size < PPP_HEADERLEN + 2) {
+ log_ppp_warn("LCP: short packet received\n");
+ return;
+ }
+
+ hdr = (struct lcp_hdr_t *)lcp->ppp->chan_buf;
+ if (ntohs(hdr->len) < PPP_HEADERLEN) {
+ log_ppp_warn("LCP: short packet received\n");
+ return;
+ }
+
+ lcp->fsm.recv_id = hdr->id;
+ switch(hdr->code) {
+ case CONFREQ:
+ r = lcp_recv_conf_req(lcp, (uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN);
+ switch(r) {
+ case LCP_OPT_ACK:
+ ppp_fsm_recv_conf_req_ack(&lcp->fsm);
+ break;
+ case LCP_OPT_NAK:
+ ppp_fsm_recv_conf_req_nak(&lcp->fsm);
+ break;
+ case LCP_OPT_REJ:
+ ppp_fsm_recv_conf_req_rej(&lcp->fsm);
+ break;
+ }
+ lcp_free_conf_req(lcp);
+ if (r == LCP_OPT_FAIL)
+ ppp_terminate(lcp->ppp, 0);
+ break;
+ case CONFACK:
+ if (lcp_recv_conf_ack(lcp,(uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN))
+ ppp_terminate(lcp->ppp, 0);
+ else
+ if (lcp->fsm.recv_id != lcp->fsm.id)
+ break;
+ ppp_fsm_recv_conf_ack(&lcp->fsm);
+ break;
+ case CONFNAK:
+ lcp_recv_conf_nak(lcp, (uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN);
+ if (lcp->fsm.recv_id != lcp->fsm.id)
+ break;
+ ppp_fsm_recv_conf_rej(&lcp->fsm);
+ break;
+ case CONFREJ:
+ if (lcp_recv_conf_rej(lcp,(uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN))
+ ppp_terminate(lcp->ppp, 0);
+ else
+ if (lcp->fsm.recv_id != lcp->fsm.id)
+ break;
+ ppp_fsm_recv_conf_rej(&lcp->fsm);
+ break;
+ case TERMREQ:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP TermReq id=%x]\n", hdr->id);
+ ppp_fsm_recv_term_req(&lcp->fsm);
+ ppp_terminate(lcp->ppp, 0);
+ break;
+ case TERMACK:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP TermAck id=%x]\n", hdr->id);
+ ppp_fsm_recv_term_ack(&lcp->fsm);
+ break;
+ case CODEREJ:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP CodeRej id=%x]\n", hdr->id);
+ ppp_fsm_recv_code_rej_bad(&lcp->fsm);
+ break;
+ case ECHOREQ:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP EchoReq id=%x <magic %x>]\n", hdr->id, *(uint32_t*)(hdr + 1));
+ send_echo_reply(lcp);
+ break;
+ case ECHOREP:
+ lcp_recv_echo_repl(lcp, (uint8_t*)(hdr + 1), ntohs(hdr->len) - PPP_HDRLEN);
+ break;
+ case PROTOREJ:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP ProtoRej id=%x <%x>]\n", hdr->code, hdr->id, *(uint16_t*)(hdr + 1));
+ break;
+ case IDENT:
+ if (conf_ppp_verbose) {
+ term_msg = _strndup((char*)(hdr + 1) + 4, ntohs(hdr->len) - 4 - 4);
+ log_ppp_info("recv [LCP Ident id=%x <%s>]\n", hdr->id, term_msg);
+ _free(term_msg);
+ }
+ break;
+ default:
+ if (conf_ppp_verbose)
+ log_ppp_info("recv [LCP Unknown %x]\n", hdr->code);
+ ppp_fsm_recv_unk(&lcp->fsm);
+ break;
+ }
+}
+
+int lcp_option_register(struct lcp_option_handler_t *h)
+{
+ /*struct lcp_option_drv_t *p;
+
+ list_for_each_entry(p,option_drv_list,entry)
+ if (p->id==h->id)
+ return -1;*/
+
+ list_add_tail(&h->entry, &option_handlers);
+
+ return 0;
+}
+
+static struct ppp_layer_t lcp_layer=
+{
+ .init = lcp_layer_init,
+ .start = lcp_layer_start,
+ .finish = lcp_layer_finish,
+ .free = lcp_layer_free,
+};
+
+static void __init lcp_init(void)
+{
+ char *opt;
+
+ ppp_register_layer("lcp", &lcp_layer);
+
+ opt = conf_get_opt("lcp", "echo-interval");
+ if (opt && atoi(opt) > 0)
+ conf_echo_interval = atoi(opt);
+
+ opt = conf_get_opt("lcp", "echo-failure");
+ if (opt && atoi(opt) > 0)
+ conf_echo_failure = atoi(opt);
+}
+
diff --git a/accel-pptpd/ppp/ppp_lcp.h b/accel-pptpd/ppp/ppp_lcp.h
new file mode 100644
index 0000000..6d67b69
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_lcp.h
@@ -0,0 +1,136 @@
+#ifndef PPP_LCP_H
+#define PPP_LCP_H
+
+#include <stdint.h>
+
+#include "triton.h"
+#include "ppp_fsm.h"
+/*
+ * Options.
+ */
+#define CI_VENDOR 0 /* Vendor Specific */
+#define CI_MRU 1 /* Maximum Receive Unit */
+#define CI_ASYNCMAP 2 /* Async Control Character Map */
+#define CI_AUTH 3 /* Authentication Type */
+#define CI_QUALITY 4 /* Quality Protocol */
+#define CI_MAGIC 5 /* Magic Number */
+#define CI_PCOMP 7 /* Protocol Field Compression */
+#define CI_ACCOMP 8 /* Address/Control Field Compression */
+#define CI_FCSALTERN 9 /* FCS-Alternatives */
+#define CI_SDP 10 /* Self-Describing-Pad */
+#define CI_NUMBERED 11 /* Numbered-Mode */
+#define CI_CALLBACK 13 /* callback */
+#define CI_MRRU 17 /* max reconstructed receive unit; multilink */
+#define CI_SSNHF 18 /* short sequence numbers for multilink */
+#define CI_EPDISC 19 /* endpoint discriminator */
+#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */
+#define CI_LDISC 23 /* Link-Discriminator */
+#define CI_LCPAUTH 24 /* LCP Authentication */
+#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */
+#define CI_PREFELIS 26 /* Prefix Elision */
+#define CI_MPHDRFMT 27 /* MP Header Format */
+#define CI_I18N 28 /* Internationalization */
+#define CI_SDL 29 /* Simple Data Link */
+
+struct lcp_hdr_t
+{
+ uint16_t proto;
+ uint8_t code;
+ uint8_t id;
+ uint16_t len;
+} __attribute__((packed));
+struct lcp_opt_hdr_t
+{
+ uint8_t id;
+ uint8_t len;
+} __attribute__((packed));
+struct lcp_opt8_t
+{
+ struct lcp_opt_hdr_t hdr;
+ uint8_t val;
+} __attribute__((packed));
+struct lcp_opt16_t
+{
+ struct lcp_opt_hdr_t hdr;
+ uint16_t val;
+} __attribute__((packed));
+struct lcp_opt32_t
+{
+ struct lcp_opt_hdr_t hdr;
+ uint32_t val;
+} __attribute__((packed));
+
+/*struct lcp_options_t
+{
+ int magic;
+ int mtu;
+ int mru;
+ int accomp; // 0 - disabled, 1 - enable, 2 - allow, disabled, 3 - allow,enabled
+ int pcomp; // 0 - disabled, 1 - enable, 2 - allow, disabled, 3 - allow,enabled
+ // negotiated options;
+ int neg_mru;
+ int neg_mtu;
+ int neg_accomp; // -1 - rejected
+ int neg_pcomp;
+ int neg_auth[AUTH_MAX];
+};*/
+
+#define LCP_OPT_NONE 0
+#define LCP_OPT_ACK 1
+#define LCP_OPT_NAK -1
+#define LCP_OPT_REJ -2
+#define LCP_OPT_FAIL -3
+
+struct ppp_lcp_t;
+struct lcp_option_handler_t;
+
+struct lcp_option_t
+{
+ struct list_head entry;
+ int id;
+ int len;
+ int state;
+ int print:1;
+ struct lcp_option_handler_t *h;
+};
+
+struct lcp_option_handler_t
+{
+ struct list_head entry;
+ struct lcp_option_t* (*init)(struct ppp_lcp_t*);
+ int (*send_conf_req)(struct ppp_lcp_t*,struct lcp_option_t*,uint8_t*);
+ int (*send_conf_rej)(struct ppp_lcp_t*,struct lcp_option_t*,uint8_t*);
+ int (*send_conf_nak)(struct ppp_lcp_t*,struct lcp_option_t*,uint8_t*);
+ int (*recv_conf_req)(struct ppp_lcp_t*,struct lcp_option_t*,uint8_t*);
+ int (*recv_conf_rej)(struct ppp_lcp_t*,struct lcp_option_t*,uint8_t*);
+ int (*recv_conf_nak)(struct ppp_lcp_t*,struct lcp_option_t*,uint8_t*);
+ int (*recv_conf_ack)(struct ppp_lcp_t*,struct lcp_option_t*,uint8_t*);
+ void (*free)(struct ppp_lcp_t*,struct lcp_option_t*);
+ void (*print)(void (*print)(const char *fmt,...), struct lcp_option_t*,uint8_t*);
+};
+
+struct ppp_lcp_t
+{
+ struct ppp_layer_data_t ld;
+ struct ppp_handler_t hnd;
+ struct ppp_fsm_t fsm;
+ struct ppp_t *ppp;
+ struct list_head options;
+
+ struct triton_timer_t echo_timer;
+ int echo_interval;
+ int echo_failure;
+ int echo_sent;
+ int magic;
+
+ struct list_head ropt_list; // last received ConfReq
+ int ropt_len;
+
+ int conf_req_len;
+ int started:1;
+};
+
+int lcp_option_register(struct lcp_option_handler_t *h);
+
+#endif
+
diff --git a/accel-pptpd/ppp/ppp_notify.c b/accel-pptpd/ppp/ppp_notify.c
new file mode 100644
index 0000000..ad9fd1f
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_notify.c
@@ -0,0 +1,54 @@
+#include "ppp.h"
+
+static LIST_HEAD(notified_list);
+
+void __export ppp_register_notified(struct ppp_notified_t *n)
+{
+ list_add_tail(&n->entry, &notified_list);
+}
+
+void __export ppp_unregister_notified(struct ppp_notified_t *n)
+{
+ list_del(&n->entry);
+}
+
+void ppp_notify_starting(struct ppp_t *ppp)
+{
+ struct ppp_notified_t *n;
+
+ list_for_each_entry(n, &notified_list, entry) {
+ if (n->starting)
+ n->starting(n, ppp);
+ }
+}
+
+void ppp_notify_started(struct ppp_t *ppp)
+{
+ struct ppp_notified_t *n;
+
+ list_for_each_entry(n, &notified_list, entry) {
+ if (n->started)
+ n->started(n, ppp);
+ }
+}
+
+void ppp_notify_finished(struct ppp_t *ppp)
+{
+ struct ppp_notified_t *n;
+
+ list_for_each_entry(n, &notified_list, entry) {
+ if (n->finished)
+ n->finished(n, ppp);
+ }
+}
+
+void ppp_notify_finishing(struct ppp_t *ppp)
+{
+ struct ppp_notified_t *n;
+
+ list_for_each_entry(n, &notified_list, entry) {
+ if (n->finishing)
+ n->finishing(n, ppp);
+ }
+}
+
diff --git a/accel-pptpd/ppp/ppp_pd.c b/accel-pptpd/ppp/ppp_pd.c
new file mode 100644
index 0000000..f770208
--- /dev/null
+++ b/accel-pptpd/ppp/ppp_pd.c
@@ -0,0 +1,14 @@
+#include "ppp.h"
+
+#include "memdebug.h"
+
+int ppp_store_pd(struct ppp_t *ppp, pd_key_t key, void *data)
+{
+ struct ppp_pd_t *pd;
+
+ list_for_each_entry(pd, &ppp->pd_list, entry)
+ if (pd->key == key)
+ return -1;
+
+
+}
diff --git a/accel-pptpd/pwdb.c b/accel-pptpd/pwdb.c
new file mode 100644
index 0000000..4c0ab02
--- /dev/null
+++ b/accel-pptpd/pwdb.c
@@ -0,0 +1,56 @@
+#include <stdlib.h>
+
+#include "triton.h"
+
+#include "pwdb.h"
+
+#include "memdebug.h"
+
+static LIST_HEAD(pwdb_handlers);
+
+int __export pwdb_check(struct ppp_t *ppp, const char *username, int type, ...)
+{
+ struct pwdb_t *pwdb;
+ int r, res = PWDB_NO_IMPL;
+ va_list args;
+
+ va_start(args, type);
+
+ list_for_each_entry(pwdb, &pwdb_handlers, entry) {
+ if (!pwdb->check)
+ continue;
+ r = pwdb->check(pwdb, ppp, username, type, args);
+ if (r == PWDB_NO_IMPL)
+ continue;
+ if (r == PWDB_SUCCESS)
+ return PWDB_SUCCESS;
+ res = r;
+ }
+
+ return res;
+}
+__export char *pwdb_get_passwd(struct ppp_t *ppp, const char *username)
+{
+ struct pwdb_t *pwdb;
+ char *r = NULL;
+
+ list_for_each_entry(pwdb, &pwdb_handlers, entry) {
+ if (!pwdb->get_passwd)
+ continue;
+ r = pwdb->get_passwd(pwdb, ppp, username);
+ if (r)
+ break;
+ }
+
+ return r;
+}
+
+void __export pwdb_register(struct pwdb_t *pwdb)
+{
+ list_add_tail(&pwdb->entry, &pwdb_handlers);
+}
+void __export pwdb_unregister(struct pwdb_t *pwdb)
+{
+ list_del(&pwdb->entry);
+}
+
diff --git a/accel-pptpd/pwdb.h b/accel-pptpd/pwdb.h
new file mode 100644
index 0000000..a1c2ced
--- /dev/null
+++ b/accel-pptpd/pwdb.h
@@ -0,0 +1,27 @@
+#ifndef PWDB_H
+#define PWDB_H
+
+#include <stdarg.h>
+#include "list.h"
+
+struct ppp_t;
+
+#define PWDB_SUCCESS 0
+#define PWDB_DENIED 1
+#define PWDB_NO_IMPL 2
+
+struct pwdb_t
+{
+ struct list_head entry;
+ int (*check)(struct pwdb_t *, struct ppp_t *, const char *username, int type, va_list args);
+ char* (*get_passwd)(struct pwdb_t *, struct ppp_t *, const char *username);
+};
+
+int pwdb_check(struct ppp_t *, const char *username, int type, ...);
+char *pwdb_get_passwd(struct ppp_t *, const char *username);
+
+void pwdb_register(struct pwdb_t *);
+void pwdb_unregister(struct pwdb_t *);
+
+#endif
+
diff --git a/accel-pptpd/radius/CMakeLists.txt b/accel-pptpd/radius/CMakeLists.txt
new file mode 100644
index 0000000..b82512e
--- /dev/null
+++ b/accel-pptpd/radius/CMakeLists.txt
@@ -0,0 +1,20 @@
+SET(sources
+ radius.c
+ dict.c
+ req.c
+ packet.c
+ auth.c
+ acct.c
+ 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)
+
diff --git a/accel-pptpd/radius/acct.c b/accel-pptpd/radius/acct.c
new file mode 100644
index 0000000..a8346ed
--- /dev/null
+++ b/accel-pptpd/radius/acct.c
@@ -0,0 +1,208 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <linux/if_ppp.h>
+#include <openssl/md5.h>
+
+#include "log.h"
+#include "radius_p.h"
+
+#include "memdebug.h"
+
+#define STAT_UPDATE_INTERVAL (10 * 60 * 1000)
+
+static int req_set_RA(struct rad_req_t *req, const char *secret)
+{
+ MD5_CTX ctx;
+
+ if (rad_packet_build(req->pack, req->RA))
+ return -1;
+
+ MD5_Init(&ctx);
+ MD5_Update(&ctx, req->pack->buf, req->pack->len);
+ MD5_Update(&ctx, secret, strlen(secret));
+ MD5_Final(req->pack->buf + 4, &ctx);
+
+ return 0;
+}
+
+static void req_set_stat(struct rad_req_t *req, struct ppp_t *ppp)
+{
+ struct ifpppstatsreq ifreq;
+
+ memset(&ifreq, 0, sizeof(ifreq));
+ ifreq.stats_ptr = (void *)&ifreq.stats;
+ strcpy(ifreq.ifr__name, ppp->ifname);
+
+ if (ioctl(sock_fd, SIOCGPPPSTATS, &ifreq)) {
+ log_ppp_error("radius: failed to get ppp statistics: %s\n", strerror(errno));
+ return;
+ }
+
+ if (ifreq.stats.p.ppp_ibytes < req->rpd->acct_input_octets)
+ req->rpd->acct_input_gigawords++;
+ req->rpd->acct_input_octets = ifreq.stats.p.ppp_ibytes;
+
+ if (ifreq.stats.p.ppp_obytes < req->rpd->acct_output_octets)
+ req->rpd->acct_output_gigawords++;
+ req->rpd->acct_output_octets = ifreq.stats.p.ppp_obytes;
+
+ rad_packet_change_int(req->pack, "Acct-Input-Octets", ifreq.stats.p.ppp_ibytes);
+ rad_packet_change_int(req->pack, "Acct-Output-Octets", ifreq.stats.p.ppp_obytes);
+ rad_packet_change_int(req->pack, "Acct-Input-Packets", ifreq.stats.p.ppp_ipackets);
+ rad_packet_change_int(req->pack, "Acct-Output-Packets", ifreq.stats.p.ppp_opackets);
+ rad_packet_change_int(req->pack, "Acct-Input-Gigawords", req->rpd->acct_input_gigawords);
+ rad_packet_change_int(req->pack, "Acct-Output-Gigawords", req->rpd->acct_output_gigawords);
+ rad_packet_change_int(req->pack, "Acct-Session-Time", time(NULL) - ppp->start_time);
+}
+
+static int rad_acct_read(struct triton_md_handler_t *h)
+{
+ struct rad_req_t *req = container_of(h, typeof(*req), hnd);
+
+ if (req->reply)
+ rad_packet_free(req->reply);
+
+ req->reply = rad_packet_recv(h->fd, NULL);
+ if (!req->reply)
+ return 0;
+
+ if (conf_verbose) {
+ log_ppp_info("recv ");
+ rad_packet_print(req->reply, log_ppp_info);
+ }
+
+ if (req->reply->code != CODE_ACCOUNTING_RESPONSE || req->reply->id != req->pack->id) {
+ rad_packet_free(req->reply);
+ req->reply = NULL;
+ } else {
+ req->pack->id++;
+ if (req->timeout.tpd)
+ triton_timer_del(&req->timeout);
+ }
+
+ return 0;
+}
+
+static void rad_acct_timeout(struct triton_timer_t *t)
+{
+ struct rad_req_t *req = container_of(t, typeof(*req), timeout);
+
+ rad_req_send(req);
+}
+
+static void rad_acct_interim_update(struct triton_timer_t *t)
+{
+ struct radius_pd_t *rpd = container_of(t, typeof(*rpd), acct_interim_timer);
+
+ if (rpd->acct_req->timeout.tpd)
+ return;
+
+ req_set_stat(rpd->acct_req, rpd->ppp);
+ if (!rpd->acct_interim_interval)
+ return;
+
+ rad_packet_change_val(rpd->acct_req->pack, "Acct-Status-Type", "Interim-Update");
+ req_set_RA(rpd->acct_req, conf_acct_secret);
+ rad_req_send(rpd->acct_req);
+ rpd->acct_req->timeout.period = conf_timeout * 1000;
+ triton_timer_add(rpd->ppp->ctrl->ctx, &rpd->acct_req->timeout, 0);
+}
+
+int rad_acct_start(struct radius_pd_t *rpd)
+{
+ rpd->acct_req = rad_req_alloc(rpd, CODE_ACCOUNTING_REQUEST, rpd->ppp->username);
+ if (!rpd->acct_req) {
+ log_emerg("radius: out of memory\n");
+ return -1;
+ }
+
+ if (rad_req_acct_fill(rpd->acct_req)) {
+ log_ppp_error("radius:acct: failed to fill accounting attributes\n");
+ goto out_err;
+ }
+
+ //if (rad_req_add_val(rpd->acct_req, "Acct-Status-Type", "Start", 4))
+ // goto out_err;
+ //if (rad_req_add_str(rpd->acct_req, "Acct-Session-Id", rpd->ppp->sessionid, PPP_SESSIONID_LEN, 1))
+ // goto out_err;
+
+ if (req_set_RA(rpd->acct_req, conf_acct_secret))
+ goto out_err;
+
+ if (rad_req_send(rpd->acct_req))
+ goto out_err;
+
+ rpd->acct_req->hnd.read = rad_acct_read;
+
+ triton_md_register_handler(rpd->ppp->ctrl->ctx, &rpd->acct_req->hnd);
+ if (triton_md_enable_handler(&rpd->acct_req->hnd, MD_MODE_READ))
+ goto out_err;
+
+ rpd->acct_req->timeout.expire = rad_acct_timeout;
+ rpd->acct_req->timeout.period = conf_timeout * 1000;
+ if (triton_timer_add(rpd->ppp->ctrl->ctx, &rpd->acct_req->timeout, 0)) {
+ triton_md_unregister_handler(&rpd->acct_req->hnd);
+ goto out_err;
+ }
+
+ rpd->acct_interim_timer.expire = rad_acct_interim_update;
+ rpd->acct_interim_timer.period = rpd->acct_interim_interval ? rpd->acct_interim_interval * 1000 : STAT_UPDATE_INTERVAL;
+ if (rpd->acct_interim_interval && triton_timer_add(rpd->ppp->ctrl->ctx, &rpd->acct_interim_timer, 0)) {
+ triton_md_unregister_handler(&rpd->acct_req->hnd);
+ triton_timer_del(&rpd->acct_req->timeout);
+ goto out_err;
+ }
+ return 0;
+
+out_err:
+ rad_req_free(rpd->acct_req);
+ rpd->acct_req = NULL;
+ return -1;
+}
+
+void rad_acct_stop(struct radius_pd_t *rpd)
+{
+ int i;
+
+ if (rpd->acct_interim_timer.tpd)
+ triton_timer_del(&rpd->acct_interim_timer);
+
+ if (rpd->acct_req) {
+ triton_md_unregister_handler(&rpd->acct_req->hnd);
+ if (rpd->acct_req->timeout.tpd)
+ triton_timer_del(&rpd->acct_req->timeout);
+
+ rad_packet_change_val(rpd->acct_req->pack, "Acct-Status-Type", "Stop");
+ req_set_stat(rpd->acct_req, rpd->ppp);
+ req_set_RA(rpd->acct_req, conf_acct_secret);
+ /// !!! rad_req_add_val(rpd->acct_req, "Acct-Terminate-Cause", "");
+
+ if (rpd->acct_req->reply) {
+ rad_packet_free(rpd->acct_req->reply);
+ rpd->acct_req->reply = NULL;
+ }
+
+ for(i = 0; i < conf_max_try; i++) {
+ if (rad_req_send(rpd->acct_req))
+ break;
+ rad_req_wait(rpd->acct_req, conf_timeout);
+ if (!rpd->acct_req->reply)
+ continue;
+ if (rpd->acct_req->reply->id != rpd->acct_req->pack->id || rpd->acct_req->reply->code != CODE_ACCOUNTING_RESPONSE) {
+ rad_packet_free(rpd->acct_req->reply);
+ rpd->acct_req->reply = NULL;
+ } else
+ break;
+ }
+ if (!rpd->acct_req->reply)
+ log_ppp_warn("radius:acct_stop: no response\n");
+
+ rad_req_free(rpd->acct_req);
+ rpd->acct_req = NULL;
+ }
+}
+
diff --git a/accel-pptpd/radius/attr_defs.h b/accel-pptpd/radius/attr_defs.h
new file mode 100644
index 0000000..e9b617e
--- /dev/null
+++ b/accel-pptpd/radius/attr_defs.h
@@ -0,0 +1,287 @@
+#define User_Name 1
+#define User_Password 2
+#define CHAP_Password 3
+#define NAS_IP_Address 4
+#define NAS_Port 5
+#define Service_Type 6
+#define Framed_Protocol 7
+#define Framed_IP_Address 8
+#define Framed_IP_Netmask 9
+#define Framed_Routing 10
+#define Filter_Id 11
+#define Framed_MTU 12
+#define Framed_Compression 13
+#define Login_IP_Host 14
+#define Login_Service 15
+#define Login_TCP_Port 16
+#define Reply_Message 18
+#define Callback_Number 19
+#define Callback_Id 20
+#define Framed_Route 22
+#define Framed_IPX_Network 23
+#define State 24
+#define Class 25
+#define Vendor_Specific 26
+#define Session_Timeout 27
+#define Idle_Timeout 28
+#define Termination_Action 29
+#define Called_Station_Id 30
+#define Calling_Station_Id 31
+#define NAS_Identifier 32
+#define Proxy_State 33
+#define Login_LAT_Service 34
+#define Login_LAT_Node 35
+#define Login_LAT_Group 36
+#define Framed_AppleTalk_Link 37
+#define Framed_AppleTalk_Network 38
+#define Framed_AppleTalk_Zone 39
+#define CHAP_Challenge 60
+#define NAS_Port_Type 61
+#define Port_Limit 62
+#define Login_LAT_Port 63
+#define Service_Type_Login_User 1
+#define Service_Type_Framed_User 2
+#define Service_Type_Callback_Login_User 3
+#define Service_Type_Callback_Framed_User 4
+#define Service_Type_Outbound_User 5
+#define Service_Type_Administrative_User 6
+#define Service_Type_NAS_Prompt_User 7
+#define Service_Type_Authenticate_Only 8
+#define Service_Type_Callback_NAS_Prompt 9
+#define Service_Type_Call_Check 10
+#define Service_Type_Callback_Administrative 11
+#define Framed_Protocol_PPP 1
+#define Framed_Protocol_SLIP 2
+#define Framed_Protocol_ARAP 3
+#define Framed_Protocol_Gandalf_SLML 4
+#define Framed_Protocol_Xylogics_IPX_SLIP 5
+#define Framed_Protocol_X_75_Synchronous 6
+#define Framed_Routing_None 0
+#define Framed_Routing_Broadcast 1
+#define Framed_Routing_Listen 2
+#define Framed_Routing_Broadcast_Listen 3
+#define Framed_Compression_None 0
+#define Framed_Compression_Van_Jacobson_TCP_IP 1
+#define Framed_Compression_IPX_Header_Compression 2
+#define Framed_Compression_Stac_LZS 3
+#define Login_Service_Telnet 0
+#define Login_Service_Rlogin 1
+#define Login_Service_TCP_Clear 2
+#define Login_Service_PortMaster 3
+#define Login_Service_LAT 4
+#define Login_Service_X25_PAD 5
+#define Login_Service_X25_T3POS 6
+#define Login_Service_TCP_Clear_Quiet 8
+#define Login_TCP_Port_Telnet 23
+#define Login_TCP_Port_Rlogin 513
+#define Login_TCP_Port_Rsh 514
+#define Termination_Action_Default 0
+#define Termination_Action_RADIUS_Request 1
+#define NAS_Port_Type_Async 0
+#define NAS_Port_Type_Sync 1
+#define NAS_Port_Type_ISDN 2
+#define NAS_Port_Type_ISDN_V120 3
+#define NAS_Port_Type_ISDN_V110 4
+#define NAS_Port_Type_Virtual 5
+#define NAS_Port_Type_PIAFS 6
+#define NAS_Port_Type_HDLC_Clear_Channel 7
+#define NAS_Port_Type_X_25 8
+#define NAS_Port_Type_X_75 9
+#define NAS_Port_Type_G_3_Fax 10
+#define NAS_Port_Type_SDSL 11
+#define NAS_Port_Type_ADSL_CAP 12
+#define NAS_Port_Type_ADSL_DMT 13
+#define NAS_Port_Type_IDSL 14
+#define NAS_Port_Type_Ethernet 15
+#define NAS_Port_Type_xDSL 16
+#define NAS_Port_Type_Cable 17
+#define NAS_Port_Type_Wireless_Other 18
+#define NAS_Port_Type_Wireless_802_11 19
+#define Acct_Status_Type 40
+#define Acct_Delay_Time 41
+#define Acct_Input_Octets 42
+#define Acct_Output_Octets 43
+#define Acct_Session_Id 44
+#define Acct_Authentic 45
+#define Acct_Session_Time 46
+#define Acct_Input_Packets 47
+#define Acct_Output_Packets 48
+#define Acct_Terminate_Cause 49
+#define Acct_Multi_Session_Id 50
+#define Acct_Link_Count 51
+#define Acct_Status_Type_Start 1
+#define Acct_Status_Type_Stop 2
+#define Acct_Status_Type_Alive 3
+#define Acct_Status_Type_Interim_Update 3
+#define Acct_Status_Type_Accounting_On 7
+#define Acct_Status_Type_Accounting_Off 8
+#define Acct_Status_Type_Failed 15
+#define Acct_Authentic_RADIUS 1
+#define Acct_Authentic_Local 2
+#define Acct_Authentic_Remote 3
+#define Acct_Authentic_Diameter 4
+#define Acct_Terminate_Cause_User_Request 1
+#define Acct_Terminate_Cause_Lost_Carrier 2
+#define Acct_Terminate_Cause_Lost_Service 3
+#define Acct_Terminate_Cause_Idle_Timeout 4
+#define Acct_Terminate_Cause_Session_Timeout 5
+#define Acct_Terminate_Cause_Admin_Reset 6
+#define Acct_Terminate_Cause_Admin_Reboot 7
+#define Acct_Terminate_Cause_Port_Error 8
+#define Acct_Terminate_Cause_NAS_Error 9
+#define Acct_Terminate_Cause_NAS_Request 10
+#define Acct_Terminate_Cause_NAS_Reboot 11
+#define Acct_Terminate_Cause_Port_Unneeded 12
+#define Acct_Terminate_Cause_Port_Preempted 13
+#define Acct_Terminate_Cause_Port_Suspended 14
+#define Acct_Terminate_Cause_Service_Unavailable 15
+#define Acct_Terminate_Cause_Callback 16
+#define Acct_Terminate_Cause_User_Error 17
+#define Acct_Terminate_Cause_Host_Request 18
+#define Acct_Tunnel_Connection 68
+#define Acct_Tunnel_Packets_Lost 86
+#define Acct_Status_Type_Tunnel_Start 9
+#define Acct_Status_Type_Tunnel_Stop 10
+#define Acct_Status_Type_Tunnel_Reject 11
+#define Acct_Status_Type_Tunnel_Link_Start 12
+#define Acct_Status_Type_Tunnel_Link_Stop 13
+#define Acct_Status_Type_Tunnel_Link_Reject 14
+#define Tunnel_Type 64
+#define Tunnel_Medium_Type 65
+#define Tunnel_Client_Endpoint 66
+#define Tunnel_Server_Endpoint 67
+#define Tunnel_Password 69
+#define Tunnel_Private_Group_Id 81
+#define Tunnel_Assignment_Id 82
+#define Tunnel_Preference 83
+#define Tunnel_Client_Auth_Id 90
+#define Tunnel_Server_Auth_Id 91
+#define Tunnel_Type_PPTP 1
+#define Tunnel_Type_L2F 2
+#define Tunnel_Type_L2TP 3
+#define Tunnel_Type_ATMP 4
+#define Tunnel_Type_VTP 5
+#define Tunnel_Type_AH 6
+#define Tunnel_Type_IP 7
+#define Tunnel_Type_MIN_IP 8
+#define Tunnel_Type_ESP 9
+#define Tunnel_Type_GRE 10
+#define Tunnel_Type_DVS 11
+#define Tunnel_Type_IP_in_IP 12
+#define Tunnel_Medium_Type_IP 1
+#define Tunnel_Medium_Type_IPv4 1
+#define Tunnel_Medium_Type_IPv6 2
+#define Tunnel_Medium_Type_NSAP 3
+#define Tunnel_Medium_Type_HDLC 4
+#define Tunnel_Medium_Type_BBN_1822 5
+#define Tunnel_Medium_Type_IEEE_802 6
+#define Tunnel_Medium_Type_E_163 7
+#define Tunnel_Medium_Type_E_164 8
+#define Tunnel_Medium_Type_F_69 9
+#define Tunnel_Medium_Type_X_121 10
+#define Tunnel_Medium_Type_IPX 11
+#define Tunnel_Medium_Type_Appletalk 12
+#define Tunnel_Medium_Type_DecNet_IV 13
+#define Tunnel_Medium_Type_Banyan_Vines 14
+#define Tunnel_Medium_Type_E_164_NSAP 15
+#define Acct_Input_Gigawords 52
+#define Acct_Output_Gigawords 53
+#define Event_Timestamp 55
+#define ARAP_Password 70
+#define ARAP_Features 71
+#define ARAP_Zone_Access 72
+#define ARAP_Security 73
+#define ARAP_Security_Data 74
+#define Password_Retry 75
+#define Prompt 76
+#define Connect_Info 77
+#define Configuration_Token 78
+#define EAP_Message 79
+#define Message_Authenticator 80
+#define ARAP_Challenge_Response 84
+#define Acct_Interim_Interval 85
+#define NAS_Port_Id 87
+#define Framed_Pool 88
+#define ARAP_Zone_Access_Default_Zone 1
+#define ARAP_Zone_Access_Zone_Filter_Inclusive 2
+#define ARAP_Zone_Access_Zone_Filter_Exclusive 4
+#define Prompt_No_Echo 0
+#define Prompt_Echo 1
+#define Error_Cause 101
+#define Service_Type_Authorize_Only 17
+#define Error_Cause_Residual_Context_Removed 201
+#define Error_Cause_Invalid_EAP_Packet 202
+#define Error_Cause_Unsupported_Attribute 401
+#define Error_Cause_Missing_Attribute 402
+#define Error_Cause_NAS_Identification_Mismatch 403
+#define Error_Cause_Invalid_Request 404
+#define Error_Cause_Unsupported_Service 405
+#define Error_Cause_Unsupported_Extension 406
+#define Error_Cause_Administratively_Prohibited 501
+#define Error_Cause_Proxy_Request_Not_Routable 502
+#define Error_Cause_Session_Context_Not_Found 503
+#define Error_Cause_Session_Context_Not_Removable 504
+#define Error_Cause_Proxy_Processing_Error 505
+#define Error_Cause_Resources_Unavailable 506
+#define Error_Cause_Request_Initiated 507
+#define Acct_Terminate_Cause_Supplicant_Restart 19
+#define Acct_Terminate_Cause_Reauthentication_Failure 20
+#define Acct_Terminate_Cause_Port_Reinit 21
+#define Acct_Terminate_Cause_Port_Disabled 22
+#define NAS_Port_Type_Token_Ring 20
+#define NAS_Port_Type_FDDI 21
+#define Tunnel_Type_VLAN 13
+#define EAP_Key_Name 102
+#define Chargeable_User_Identity 89
+#define Error_Cause_Invalid_Attribute_Value 407
+#define Error_Cause_Multiple_Session_Selection_Unsupported 508
+#define Vendor_Microsoft 311
+#define MS_CHAP_Response 1
+#define MS_CHAP_Error 2
+#define MS_CHAP_CPW_1 3
+#define MS_CHAP_CPW_2 4
+#define MS_CHAP_LM_Enc_PW 5
+#define MS_CHAP_NT_Enc_PW 6
+#define MS_MPPE_Encryption_Policy 7
+#define MS_MPPE_Encryption_Type 8
+#define MS_MPPE_Encryption_Types 8
+#define MS_RAS_Vendor 9
+#define MS_CHAP_Domain 10
+#define MS_CHAP_Challenge 11
+#define MS_CHAP_MPPE_Keys 12
+#define MS_BAP_Usage 13
+#define MS_Link_Utilization_Threshold 14
+#define MS_Link_Drop_Time_Limit 15
+#define MS_MPPE_Send_Key 16
+#define MS_MPPE_Recv_Key 17
+#define MS_RAS_Version 18
+#define MS_Old_ARAP_Password 19
+#define MS_New_ARAP_Password 20
+#define MS_ARAP_PW_Change_Reason 21
+#define MS_Filter 22
+#define MS_Acct_Auth_Type 23
+#define MS_Acct_EAP_Type 24
+#define MS_CHAP2_Response 25
+#define MS_CHAP2_Success 26
+#define MS_CHAP2_CPW 27
+#define MS_Primary_DNS_Server 28
+#define MS_Secondary_DNS_Server 29
+#define MS_Primary_NBNS_Server 30
+#define MS_Secondary_NBNS_Server 31
+#define MS_BAP_Usage_Not_Allowed 0
+#define MS_BAP_Usage_Allowed 1
+#define MS_BAP_Usage_Required 2
+#define MS_ARAP_PW_Change_Reason_Just_Change_Password 1
+#define MS_ARAP_PW_Change_Reason_Expired_Password 2
+#define MS_ARAP_PW_Change_Reason_Admin_Requires_Password_Change 3
+#define MS_ARAP_PW_Change_Reason_Password_Too_Short 4
+#define MS_Acct_Auth_Type_PAP 1
+#define MS_Acct_Auth_Type_CHAP 2
+#define MS_Acct_Auth_Type_MS_CHAP_1 3
+#define MS_Acct_Auth_Type_MS_CHAP_2 4
+#define MS_Acct_Auth_Type_EAP 5
+#define MS_Acct_EAP_Type_MD5 4
+#define MS_Acct_EAP_Type_OTP 5
+#define MS_Acct_EAP_Type_Generic_Token_Card 6
+#define MS_Acct_EAP_Type_TLS 13
+#define Traffic_Shape_in 231
diff --git a/accel-pptpd/radius/auth.c b/accel-pptpd/radius/auth.c
new file mode 100644
index 0000000..3be5825
--- /dev/null
+++ b/accel-pptpd/radius/auth.c
@@ -0,0 +1,397 @@
+#include <stdlib.h>
+#include <string.h>
+#include <openssl/md5.h>
+#include <openssl/sha.h>
+
+#include "triton.h"
+#include "events.h"
+#include "log.h"
+#include "pwdb.h"
+
+#include "radius_p.h"
+#include "attr_defs.h"
+
+#include "memdebug.h"
+
+static int decrypt_chap_mppe_keys(struct rad_req_t *req, struct rad_attr_t *attr, const uint8_t *challenge, uint8_t *key)
+{
+ MD5_CTX md5_ctx;
+ SHA_CTX sha1_ctx;
+ uint8_t md5[MD5_DIGEST_LENGTH];
+ uint8_t sha1[SHA_DIGEST_LENGTH];
+ uint8_t plain[32];
+ int i;
+
+ if (attr->len != 32) {
+ log_ppp_warn("radius: %s: incorrect attribute length (%i)\n", attr->attr->name, attr->len);
+ return -1;
+ }
+
+ memcpy(plain, attr->val.octets, 32);
+
+ MD5_Init(&md5_ctx);
+ MD5_Update(&md5_ctx, conf_auth_secret, strlen(conf_auth_secret));
+ MD5_Update(&md5_ctx, req->pack->buf + 4, 16);
+ MD5_Final(md5, &md5_ctx);
+
+ for (i = 0; i < 16; i++)
+ plain[i] ^= md5[i];
+
+ MD5_Init(&md5_ctx);
+ MD5_Update(&md5_ctx, conf_auth_secret, strlen(conf_auth_secret));
+ MD5_Update(&md5_ctx, attr->val.octets, 16);
+ MD5_Final(md5, &md5_ctx);
+
+ for (i = 0; i < 16; i++)
+ plain[i + 16] ^= md5[i];
+
+ SHA1_Init(&sha1_ctx);
+ SHA1_Update(&sha1_ctx, plain + 8, 16);
+ SHA1_Update(&sha1_ctx, plain + 8, 16);
+ SHA1_Update(&sha1_ctx, challenge, 8);
+ SHA1_Final(sha1, &sha1_ctx);
+
+ memcpy(key, sha1, 16);
+
+ return 0;
+}
+
+static int decrypt_mppe_key(struct rad_req_t *req, struct rad_attr_t *attr, uint8_t *key)
+{
+ MD5_CTX md5_ctx;
+ uint8_t md5[16];
+ uint8_t plain[32];
+ int i;
+
+ if (attr->len != 34) {
+ log_ppp_warn("radius: %s: incorrect attribute length (%i)\n", attr->attr->name, attr->len);
+ return -1;
+ }
+
+ if ((attr->val.octets[0] & 0x80) == 0) {
+ log_ppp_warn("radius: %s: incorrect salt value (%x)\n", attr->attr->name, attr->len);
+ return -1;
+ }
+
+ MD5_Init(&md5_ctx);
+ MD5_Update(&md5_ctx, conf_auth_secret, strlen(conf_auth_secret));
+ MD5_Update(&md5_ctx, req->pack->buf + 4, 16);
+ MD5_Update(&md5_ctx, attr->val.octets, 2);
+ MD5_Final(md5, &md5_ctx);
+
+ memcpy(plain, attr->val.octets + 2, 32);
+
+ for (i = 0; i < 16; i++)
+ plain[i] ^= md5[i];
+
+ if (plain[0] != 16) {
+ log_ppp_warn("radius: %s: incorrect key length (%i)\n", attr->attr->name, plain[0]);
+ return -1;
+ }
+
+ MD5_Init(&md5_ctx);
+ MD5_Update(&md5_ctx, conf_auth_secret, strlen(conf_auth_secret));
+ MD5_Update(&md5_ctx, attr->val.octets + 2, 16);
+ MD5_Final(md5, &md5_ctx);
+
+ plain[16] ^= md5[0];
+
+ memcpy(key, plain + 1, 16);
+
+ return 0;
+}
+
+
+static uint8_t* encrypt_password(const char *passwd, const char *secret, const uint8_t *RA, int *epasswd_len)
+{
+ uint8_t *epasswd;
+ int i, j, chunk_cnt;
+ uint8_t b[16], c[16];
+ MD5_CTX ctx;
+
+ chunk_cnt = (strlen(passwd) - 1) / 16 + 1;
+
+ epasswd = _malloc(chunk_cnt * 16);
+ if (!epasswd) {
+ log_emerg("radius: out of memory\n");
+ return NULL;
+ }
+
+ memset(epasswd, 0, chunk_cnt * 16);
+ memcpy(epasswd, passwd, strlen(passwd));
+ memcpy(c, RA, 16);
+
+ for (i = 0; i < chunk_cnt; i++) {
+ MD5_Init(&ctx);
+ MD5_Update(&ctx, secret, strlen(secret));
+ MD5_Update(&ctx, c, 16);
+ MD5_Final(b, &ctx);
+
+ for(j = 0; j < 16; j++)
+ epasswd[i * 16 + j] ^= b[j];
+
+ memcpy(c, epasswd + i * 16, 16);
+ }
+
+ *epasswd_len = chunk_cnt * 16;
+ return epasswd;
+}
+
+static int rad_auth_send(struct rad_req_t *req)
+{
+ int i;
+
+ for(i = 0; i < conf_max_try; i++) {
+ if (rad_req_send(req))
+ goto out;
+
+ rad_req_wait(req, conf_timeout);
+
+ if (req->reply) {
+ if (req->reply->id != req->pack->id) {
+ rad_packet_free(req->reply);
+ req->reply = NULL;
+ } else
+ break;
+ }
+ }
+
+ if (!req->reply)
+ log_ppp_warn("radius:auth: no response\n");
+ else if (req->reply->code == CODE_ACCESS_ACCEPT) {
+ rad_proc_attrs(req);
+ return PWDB_SUCCESS;
+}
+
+out:
+ return PWDB_DENIED;
+}
+
+int rad_auth_pap(struct radius_pd_t *rpd, const char *username, va_list args)
+{
+ struct rad_req_t *req;
+ int r = PWDB_DENIED;
+ //int id = va_arg(args, int);
+ const char *passwd = va_arg(args, const char *);
+ uint8_t *epasswd;
+ int epasswd_len;
+
+ req = rad_req_alloc(rpd, CODE_ACCESS_REQUEST, username);
+ if (!req)
+ return PWDB_DENIED;
+
+ epasswd = encrypt_password(passwd, conf_auth_secret, req->RA, &epasswd_len);
+ if (!epasswd)
+ goto out;
+
+ if (rad_packet_add_octets(req->pack, "User-Password", epasswd, epasswd_len)) {
+ _free(epasswd);
+ goto out;
+ }
+
+ _free(epasswd);
+
+ r = rad_auth_send(req);
+ if (r == PWDB_SUCCESS) {
+ struct ev_radius_t ev = {
+ .ppp = rpd->ppp,
+ .request = req->pack,
+ .reply = req->reply,
+ };
+ triton_event_fire(EV_RADIUS_ACCESS_ACCEPT, &ev);
+ }
+
+out:
+ rad_req_free(req);
+
+ return r;
+}
+
+int rad_auth_chap_md5(struct radius_pd_t *rpd, const char *username, va_list args)
+{
+ struct rad_req_t *req;
+ int r = PWDB_DENIED;
+ uint8_t chap_password[17];
+
+ int id = va_arg(args, int);
+ uint8_t *challenge = va_arg(args, uint8_t *);
+ int challenge_len = va_arg(args, int);
+ uint8_t *response = va_arg(args, uint8_t *);
+
+ chap_password[0] = id;
+ memcpy(chap_password + 1, response, 16);
+
+ req = rad_req_alloc(rpd, CODE_ACCESS_REQUEST, username);
+ if (!req)
+ return PWDB_DENIED;
+
+ if (challenge_len == 16)
+ memcpy(req->RA, challenge, 16);
+ else {
+ if (rad_packet_add_octets(req->pack, "CHAP-Challenge", challenge, challenge_len))
+ goto out;
+ }
+
+ if (rad_packet_add_octets(req->pack, "CHAP-Password", chap_password, 17))
+ goto out;
+
+ r = rad_auth_send(req);
+ if (r == PWDB_SUCCESS) {
+ struct ev_radius_t ev = {
+ .ppp = rpd->ppp,
+ .request = req->pack,
+ .reply = req->reply,
+ };
+ triton_event_fire(EV_RADIUS_ACCESS_ACCEPT, &ev);
+ }
+
+out:
+ rad_req_free(req);
+
+ return r;
+}
+
+static void setup_mppe(struct rad_req_t *req, const uint8_t *challenge)
+{
+ struct rad_attr_t *attr;
+ uint8_t mppe_recv_key[16];
+ uint8_t mppe_send_key[16];
+ struct ev_mppe_keys_t ev_mppe = {
+ .ppp = req->rpd->ppp,
+ };
+
+ list_for_each_entry(attr, &req->reply->attrs, entry) {
+ if (attr->vendor && attr->vendor->id == Vendor_Microsoft) {
+ switch (attr->attr->id) {
+ case MS_CHAP_MPPE_Keys:
+ if (decrypt_chap_mppe_keys(req, attr, challenge, mppe_recv_key))
+ continue;
+ ev_mppe.recv_key = mppe_recv_key;
+ ev_mppe.send_key = mppe_recv_key;
+ break;
+ case MS_MPPE_Recv_Key:
+ if (decrypt_mppe_key(req, attr, mppe_recv_key))
+ continue;
+ ev_mppe.recv_key = mppe_recv_key;
+ break;
+ case MS_MPPE_Send_Key:
+ if (decrypt_mppe_key(req, attr, mppe_send_key))
+ continue;
+ ev_mppe.send_key = mppe_send_key;
+ break;
+ case MS_MPPE_Encryption_Policy:
+ ev_mppe.policy = attr->val.integer;
+ break;
+ case MS_MPPE_Encryption_Type:
+ ev_mppe.type = attr->val.integer;
+ break;
+ }
+ }
+ }
+
+ if (ev_mppe.recv_key && ev_mppe.send_key)
+ triton_event_fire(EV_MPPE_KEYS, &ev_mppe);
+}
+
+int rad_auth_mschap_v1(struct radius_pd_t *rpd, const char *username, va_list args)
+{
+ int r;
+ struct rad_req_t *req;
+ uint8_t response[50];
+
+ int id = va_arg(args, int);
+ const uint8_t *challenge = va_arg(args, const uint8_t *);
+ int challenge_len = va_arg(args, int);
+ const uint8_t *lm_response = va_arg(args, const uint8_t *);
+ const uint8_t *nt_response = va_arg(args, const uint8_t *);
+ int flags = va_arg(args, int);
+
+ req = rad_req_alloc(rpd, CODE_ACCESS_REQUEST, username);
+ if (!req)
+ return PWDB_DENIED;
+
+ response[0] = id;
+ response[1] = flags;
+ memcpy(response + 2, lm_response, 24);
+ memcpy(response + 2 + 24, nt_response, 24);
+
+ if (rad_packet_add_vendor_octets(req->pack, "Microsoft", "MS-CHAP-Challenge", challenge, challenge_len))
+ goto out;
+
+ if (rad_packet_add_vendor_octets(req->pack, "Microsoft", "MS-CHAP-Response", response, sizeof(response)))
+ goto out;
+
+ r = rad_auth_send(req);
+ if (r == PWDB_SUCCESS) {
+ struct ev_radius_t ev = {
+ .ppp = rpd->ppp,
+ .request = req->pack,
+ .reply = req->reply,
+ };
+ triton_event_fire(EV_RADIUS_ACCESS_ACCEPT, &ev);
+ setup_mppe(req, challenge);
+ }
+
+out:
+ rad_req_free(req);
+
+ return r;
+}
+
+int rad_auth_mschap_v2(struct radius_pd_t *rpd, const char *username, va_list args)
+{
+ int r;
+ struct rad_req_t *req;
+ struct rad_attr_t *ra;
+ uint8_t mschap_response[50];
+
+ int id = va_arg(args, int);
+ const uint8_t *challenge = va_arg(args, const uint8_t *);
+ const uint8_t *peer_challenge = va_arg(args, const uint8_t *);
+ const uint8_t *reserved = va_arg(args, const uint8_t *);
+ const uint8_t *response = va_arg(args, const uint8_t *);
+ int flags = va_arg(args, int);
+ uint8_t *authenticator = va_arg(args, uint8_t *);
+
+ req = rad_req_alloc(rpd, CODE_ACCESS_REQUEST, username);
+ if (!req)
+ return PWDB_DENIED;
+
+ mschap_response[0] = id;
+ mschap_response[1] = flags;
+ memcpy(mschap_response + 2, peer_challenge, 16);
+ memcpy(mschap_response + 2 + 16, reserved, 8);
+ memcpy(mschap_response + 2 + 16 + 8, response, 24);
+
+ if (rad_packet_add_vendor_octets(req->pack, "Microsoft", "MS-CHAP-Challenge", challenge, 16))
+ goto out;
+
+ if (rad_packet_add_vendor_octets(req->pack, "Microsoft", "MS-CHAP2-Response", mschap_response, sizeof(mschap_response)))
+ goto out;
+
+ r = rad_auth_send(req);
+ if (r == PWDB_SUCCESS) {
+ ra = rad_packet_find_vendor_attr(req->reply, "Microsoft", "MS-CHAP2-Success");
+ if (!ra) {
+ log_error("radius:auth:mschap-v2: 'MS-CHAP-Success' not found in radius response\n");
+ r = PWDB_DENIED;
+ } else
+ memcpy(authenticator, ra->val.octets + 3, 40);
+ }
+ if (r == PWDB_SUCCESS) {
+ struct ev_radius_t ev = {
+ .ppp = rpd->ppp,
+ .request = req->pack,
+ .reply = req->reply,
+ };
+ triton_event_fire(EV_RADIUS_ACCESS_ACCEPT, &ev);
+ setup_mppe(req, NULL);
+ }
+
+out:
+ rad_req_free(req);
+
+ return r;
+}
+
+
diff --git a/accel-pptpd/radius/dict.c b/accel-pptpd/radius/dict.c
new file mode 100644
index 0000000..54cf895
--- /dev/null
+++ b/accel-pptpd/radius/dict.c
@@ -0,0 +1,356 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+
+#include "list.h"
+#include "radius_p.h"
+#include "log.h"
+
+#include "memdebug.h"
+
+static struct rad_dict_t *dict;
+
+static char *skip_word(char *ptr)
+{
+ for(; *ptr; ptr++)
+ if (*ptr == ' ' || *ptr == '\t' || *ptr == '\n')
+ break;
+ return ptr;
+}
+static char *skip_space(char *ptr)
+{
+ for(; *ptr; ptr++)
+ if (*ptr != ' ' && *ptr != '\t')
+ break;
+ return ptr;
+}
+static int split(char *buf, char **ptr)
+{
+ int i;
+
+ for (i = 0; i < 3; i++) {
+ buf = skip_word(buf);
+ if (!*buf)
+ return i;
+
+ *buf = 0;
+
+ buf = skip_space(buf + 1);
+ if (!*buf)
+ return i;
+
+ ptr[i] = buf;
+ }
+
+ buf = skip_word(buf);
+ //if (*buf == '\n')
+ *buf = 0;
+ //else if (*buf)
+ // return -1;
+
+ return i;
+}
+
+struct rad_dict_attr_t *find_attr(struct list_head *items, const char *name)
+{
+ struct rad_dict_attr_t *attr;
+
+ list_for_each_entry(attr, items, entry)
+ if (!strcmp(attr->name, name))
+ return attr;
+
+ return NULL;
+}
+
+#define BUF_SIZE 1024
+
+static char *path, *fname1, *buf;
+static int dict_load(const char *fname)
+{
+ FILE *f;
+ char *ptr[3], *endptr;
+ int r, n = 0;
+ struct rad_dict_attr_t *attr;
+ struct rad_dict_value_t *val;
+ struct rad_dict_vendor_t *vendor;
+ struct list_head *items;
+
+ f = fopen(fname, "r");
+ if (!f) {
+ log_error("radius: open dictioanary '%s': %s\n", fname, strerror(errno));
+ return -1;
+ }
+
+ items = &dict->items;
+
+ while (fgets(buf, BUF_SIZE, f)) {
+ n++;
+ if (buf[0] == '#' || buf[0] == '\n' || buf[0] == 0)
+ continue;
+ r = split(buf, ptr);
+ if (r == 1) {
+ if (!strcmp(buf, "BEGIN-VENDOR")) {
+ vendor = rad_dict_find_vendor_name(ptr[0]);
+ if (!vendor) {
+ log_error("radius:%s:%i: vendor not found\n", fname, n);
+ goto out_err;
+ }
+ items = &vendor->items;
+ } else if (!strcmp(buf, "END-VENDOR"))
+ items = &dict->items;
+ else if (!strcmp(buf, "$INCLUDE")) {
+ for (r = strlen(path) - 1; r; r--)
+ if (path[r] == '/') {
+ path[r + 1] = 0;
+ break;
+ }
+ strcpy(fname1, path);
+ strcat(fname1, ptr[0]);
+ if (dict_load(fname1))
+ goto out_err;
+ } else
+ goto out_err_syntax;
+ } else if (r == 2) {
+ if (!strcmp(buf, "VENDOR")) {
+ vendor = malloc(sizeof(*vendor));
+ if (!vendor) {
+ log_emerg("radius: out of memory\n");
+ goto out_err;
+ }
+ vendor->id = strtol(ptr[1], &endptr, 10);
+ if (*endptr != 0)
+ goto out_err_syntax;
+ vendor->name = strdup(ptr[0]);
+ if (!vendor->name) {
+ log_emerg("radius: out of memory\n");
+ goto out_err;
+ }
+ INIT_LIST_HEAD(&vendor->items);
+ list_add_tail(&vendor->entry, &dict->vendors);
+ } else
+ goto out_err_syntax;
+ } else if (r == 3) {
+ if (!strcmp(buf, "ATTRIBUTE")) {
+ attr = malloc(sizeof(*attr));
+ if (!attr) {
+ log_emerg("radius: out of memory\n");
+ goto out_err;
+ }
+ memset(attr, 0, sizeof(*attr));
+ INIT_LIST_HEAD(&attr->values);
+ list_add_tail(&attr->entry, items);
+ attr->name = strdup(ptr[0]);
+ attr->id = strtol(ptr[1], &endptr, 10);
+ if (*endptr != 0)
+ goto out_err_syntax;
+ if (!strcmp(ptr[2], "integer"))
+ attr->type = ATTR_TYPE_INTEGER;
+ else if (!strcmp(ptr[2], "string"))
+ attr->type = ATTR_TYPE_STRING;
+ else if (!strcmp(ptr[2], "date"))
+ attr->type = ATTR_TYPE_DATE;
+ else if (!strcmp(ptr[2], "ipaddr"))
+ attr->type = ATTR_TYPE_IPADDR;
+ else if (!strcmp(ptr[2], "octets"))
+ attr->type = ATTR_TYPE_OCTETS;
+ else {
+ log_error("radius:%s:%i: unknown attribute type\n", fname, n);
+ goto out_err;
+ }
+ } else if (!strcmp(buf, "VALUE")) {
+ attr = find_attr(items, ptr[0]);
+ if (!attr) {
+ log_error("radius:%s:%i: unknown attribute\n", fname, n);
+ goto out_err;
+ }
+ val = malloc(sizeof(*val));
+ if (!val) {
+ log_emerg("radius: out of memory\n");
+ goto out_err;
+ }
+ memset(val, 0, sizeof(*val));
+ list_add_tail(&val->entry, &attr->values);
+ val->name = strdup(ptr[1]);
+ switch (attr->type) {
+ case ATTR_TYPE_INTEGER:
+ val->val.integer = strtol(ptr[2], &endptr, 10);
+ if (*endptr != 0)
+ goto out_err_syntax;
+ break;
+ case ATTR_TYPE_STRING:
+ val->val.string = strdup(ptr[2]);
+ break;
+ case ATTR_TYPE_DATE:
+ log_warn("radius:%s:%i: VALUE of type 'date' is not implemented yet\n", fname, n);
+ break;
+ case ATTR_TYPE_IPADDR:
+ log_warn("radius:%s:%i: VALUE of type 'ipaddr' is not implemented yet\n", fname, n);
+ break;
+ }
+ } else
+ goto out_err_syntax;
+ } else
+ goto out_err_syntax;
+ }
+
+ fclose(f);
+
+ return 0;
+
+out_err_syntax:
+ log_error("radius:%s:%i: syntaxis error\n", fname, n);
+out_err:
+ fclose(f);
+ return -1;
+}
+
+int rad_dict_load(const char *fname)
+{
+ int r = -1;
+
+ dict = malloc(sizeof(*dict));
+ if (!dict) {
+ log_emerg("radius: out of memory\n");
+ return -1;
+ }
+ INIT_LIST_HEAD(&dict->items);
+ INIT_LIST_HEAD(&dict->vendors);
+
+ path = _malloc(PATH_MAX);
+ if (!path) {
+ log_emerg("radius: out of memory\n");
+ goto out_free_dict;
+ }
+
+ fname1 = _malloc(PATH_MAX);
+ if (!fname1) {
+ log_emerg("radius: out of memory\n");
+ goto out_free_path;
+ }
+
+ buf = _malloc(BUF_SIZE);
+ if (!buf) {
+ log_emerg("radius: out of memory\n");
+ goto out_free_fname1;
+ }
+
+ strcpy(path, fname);
+
+ r = dict_load(fname);
+
+out_free_fname1:
+ _free(fname1);
+out_free_path:
+ _free(path);
+out_free_dict:
+ if (r)
+ rad_dict_free(dict);
+ return r;
+}
+
+void rad_dict_free(struct rad_dict_t *dict)
+{
+ struct rad_dict_attr_t *attr;
+ struct rad_dict_value_t *val;
+
+ while (!list_empty(&dict->items)) {
+ attr = list_entry(dict->items.next, typeof(*attr), entry);
+ while (!list_empty(&attr->values)) {
+ val = list_entry(attr->values.next, typeof(*val), entry);
+ list_del(&val->entry);
+ _free((char*)val->name);
+ if (attr->type == ATTR_TYPE_STRING)
+ _free((char*)val->val.string);
+ _free(val);
+ }
+ list_del(&attr->entry);
+ _free((char*)attr->name);
+ _free(attr);
+ }
+ _free(dict);
+}
+
+static struct rad_dict_attr_t *dict_find_attr(struct list_head *items, const char *name)
+{
+ struct rad_dict_attr_t *attr;
+
+ list_for_each_entry(attr, items, entry)
+ if (!strcmp(attr->name, name))
+ return attr;
+
+ return NULL;
+}
+
+__export struct rad_dict_attr_t *rad_dict_find_attr(const char *name)
+{
+ return dict_find_attr(&dict->items, name);
+}
+
+__export struct rad_dict_attr_t *rad_dict_find_attr_id(struct rad_dict_vendor_t *vendor, int id)
+{
+ struct rad_dict_attr_t *attr;
+ struct list_head *items = vendor ? &vendor->items : &dict->items;
+
+ list_for_each_entry(attr, items, entry)
+ if (attr->id == id)
+ return attr;
+
+ return NULL;
+}
+
+__export struct rad_dict_value_t *rad_dict_find_val_name(struct rad_dict_attr_t *attr, const char *name)
+{
+ struct rad_dict_value_t *val;
+
+ list_for_each_entry(val, &attr->values, entry)
+ if (!strcmp(val->name, name))
+ return val;
+
+ return NULL;
+}
+
+__export struct rad_dict_value_t *rad_dict_find_val(struct rad_dict_attr_t *attr, rad_value_t v)
+{
+ struct rad_dict_value_t *val;
+
+ if (attr->type != ATTR_TYPE_INTEGER)
+ return NULL;
+
+ list_for_each_entry(val, &attr->values, entry)
+ if (val->val.integer == v.integer)
+ return val;
+
+ return NULL;
+}
+
+__export struct rad_dict_vendor_t *rad_dict_find_vendor_name(const char *name)
+{
+ struct rad_dict_vendor_t *vendor;
+
+ list_for_each_entry(vendor, &dict->vendors, entry) {
+ if (!strcmp(vendor->name, name))
+ return vendor;
+ }
+
+ return NULL;
+}
+
+__export struct rad_dict_vendor_t *rad_dict_find_vendor_id(int id)
+{
+ struct rad_dict_vendor_t *vendor;
+
+ list_for_each_entry(vendor, &dict->vendors, entry) {
+ if (vendor->id == id)
+ return vendor;
+ }
+
+ return NULL;
+}
+
+__export struct rad_dict_attr_t *rad_dict_find_vendor_attr(struct rad_dict_vendor_t *vendor, const char *name)
+{
+ return dict_find_attr(&vendor->items, name);
+}
+
diff --git a/accel-pptpd/radius/dict/dictionary b/accel-pptpd/radius/dict/dictionary
new file mode 100644
index 0000000..64db18f
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary
@@ -0,0 +1,78 @@
+# -*- text -*-
+#
+# Version $Id: dictionary,v 1.155 2008/04/20 14:47:55 aland Exp $
+#
+# DO NOT EDIT THE FILES IN THIS DIRECTORY
+#
+# The files in this directory are maintained and updated by
+# the FreeRADIUS project. Newer releases of software may update
+# or change these files.
+#
+# Use the main dictionary file (usually /etc/raddb/dictionary)
+# for local system attributes and $INCLUDEs.
+#
+#
+#
+# This file contains dictionary translations for parsing
+# requests and generating responses. All transactions are
+# composed of Attribute/Value Pairs. The value of each attribute
+# is specified as one of 4 data types. Valid data types are:
+#
+# text - printable, generally UTF-8 encoded (subset of 'string')
+# string - 0-253 octets
+# ipaddr - 4 octets in network byte order
+# integer - 32 bit value in big endian order (high byte first)
+# date - 32 bit value in big endian order - seconds since
+# 00:00:00 GMT, Jan. 1, 1970
+# ifid - 8 octets in network byte order
+# ipv6addr - 16 octets in network byte order
+# ipv6prefix - 18 octets in network byte order
+# ether - 6 octets of hh:hh:hh:hh:hh:hh
+# where 'h' is hex digits, upper or lowercase.
+#
+# FreeRADIUS includes extended data types which are not defined
+# in the RFC's. These data types are:
+#
+# abinary - Ascend's binary filter format.
+# octets - raw octets, printed and input as hex strings.
+# e.g.: 0x123456789abcdef
+#
+#
+# Enumerated values are stored in the user file with dictionary
+# VALUE translations for easy administration.
+#
+# Example:
+#
+# ATTRIBUTE VALUE
+# --------------- -----
+# Framed-Protocol = PPP
+# 7 = 1 (integer encoding)
+#
+
+#
+# Include compatibility dictionary for older users file. Move
+# this directive to the end of this file if you want to see the
+# old names in the logfiles, INSTEAD OF the new names.
+#
+#
+# Include the RFC dictionaries next.
+#
+# For a complete list of the standard attributes and values,
+# see:
+# http://www.iana.org/assignments/radius-types
+#
+$INCLUDE dictionary.rfc2865
+$INCLUDE dictionary.rfc2866
+$INCLUDE dictionary.rfc2867
+$INCLUDE dictionary.rfc2868
+$INCLUDE dictionary.rfc2869
+$INCLUDE dictionary.rfc3576
+$INCLUDE dictionary.rfc3580
+$INCLUDE dictionary.rfc4072
+$INCLUDE dictionary.rfc4372
+$INCLUDE dictionary.rfc5176
+
+
+$INCLUDE dictionary.microsoft
+
+ATTRIBUTE Traffic-Shape-in 231 integer
diff --git a/accel-pptpd/radius/dict/dictionary.microsoft b/accel-pptpd/radius/dict/dictionary.microsoft
new file mode 100644
index 0000000..9ca6b8e
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.microsoft
@@ -0,0 +1,83 @@
+# -*- text -*-
+#
+# Microsoft's VSA's, from RFC 2548
+#
+# $Id: dictionary.microsoft,v 1.8 2005/08/08 22:23:37 aland Exp $
+#
+
+VENDOR Microsoft 311
+
+BEGIN-VENDOR Microsoft
+ATTRIBUTE MS-CHAP-Response 1 octets
+ATTRIBUTE MS-CHAP-Error 2 string
+ATTRIBUTE MS-CHAP-CPW-1 3 octets
+ATTRIBUTE MS-CHAP-CPW-2 4 octets
+ATTRIBUTE MS-CHAP-LM-Enc-PW 5 octets
+ATTRIBUTE MS-CHAP-NT-Enc-PW 6 octets
+ATTRIBUTE MS-MPPE-Encryption-Policy 7 integer
+# This is referred to as both singular and plural in the RFC.
+# Plural seems to make more sense.
+ATTRIBUTE MS-MPPE-Encryption-Type 8 integer
+ATTRIBUTE MS-MPPE-Encryption-Types 8 integer
+ATTRIBUTE MS-RAS-Vendor 9 integer # content is Vendor-ID
+ATTRIBUTE MS-CHAP-Domain 10 string
+ATTRIBUTE MS-CHAP-Challenge 11 octets
+ATTRIBUTE MS-CHAP-MPPE-Keys 12 octets encrypt=1
+ATTRIBUTE MS-BAP-Usage 13 integer
+ATTRIBUTE MS-Link-Utilization-Threshold 14 integer # values are 1-100
+ATTRIBUTE MS-Link-Drop-Time-Limit 15 integer
+ATTRIBUTE MS-MPPE-Send-Key 16 octets encrypt=2
+ATTRIBUTE MS-MPPE-Recv-Key 17 octets encrypt=2
+ATTRIBUTE MS-RAS-Version 18 string
+ATTRIBUTE MS-Old-ARAP-Password 19 octets
+ATTRIBUTE MS-New-ARAP-Password 20 octets
+ATTRIBUTE MS-ARAP-PW-Change-Reason 21 integer
+
+ATTRIBUTE MS-Filter 22 octets
+ATTRIBUTE MS-Acct-Auth-Type 23 integer
+ATTRIBUTE MS-Acct-EAP-Type 24 integer
+
+ATTRIBUTE MS-CHAP2-Response 25 octets
+ATTRIBUTE MS-CHAP2-Success 26 octets
+ATTRIBUTE MS-CHAP2-CPW 27 octets
+
+ATTRIBUTE MS-Primary-DNS-Server 28 ipaddr
+ATTRIBUTE MS-Secondary-DNS-Server 29 ipaddr
+ATTRIBUTE MS-Primary-NBNS-Server 30 ipaddr
+ATTRIBUTE MS-Secondary-NBNS-Server 31 ipaddr
+
+#ATTRIBUTE MS-ARAP-Challenge 33 octets
+
+#
+# Integer Translations
+#
+
+# MS-BAP-Usage Values
+
+VALUE MS-BAP-Usage Not-Allowed 0
+VALUE MS-BAP-Usage Allowed 1
+VALUE MS-BAP-Usage Required 2
+
+# MS-ARAP-Password-Change-Reason Values
+
+VALUE MS-ARAP-PW-Change-Reason Just-Change-Password 1
+VALUE MS-ARAP-PW-Change-Reason Expired-Password 2
+VALUE MS-ARAP-PW-Change-Reason Admin-Requires-Password-Change 3
+VALUE MS-ARAP-PW-Change-Reason Password-Too-Short 4
+
+# MS-Acct-Auth-Type Values
+
+VALUE MS-Acct-Auth-Type PAP 1
+VALUE MS-Acct-Auth-Type CHAP 2
+VALUE MS-Acct-Auth-Type MS-CHAP-1 3
+VALUE MS-Acct-Auth-Type MS-CHAP-2 4
+VALUE MS-Acct-Auth-Type EAP 5
+
+# MS-Acct-EAP-Type Values
+
+VALUE MS-Acct-EAP-Type MD5 4
+VALUE MS-Acct-EAP-Type OTP 5
+VALUE MS-Acct-EAP-Type Generic-Token-Card 6
+VALUE MS-Acct-EAP-Type TLS 13
+
+END-VENDOR Microsoft
diff --git a/accel-pptpd/radius/dict/dictionary.rfc2865 b/accel-pptpd/radius/dict/dictionary.rfc2865
new file mode 100644
index 0000000..7e5bf58
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc2865
@@ -0,0 +1,137 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 2865.
+# http://www.ietf.org/rfc/rfc2865.txt
+#
+# $Id: dictionary.rfc2865,v 1.3 2005/08/10 20:59:40 aland Exp $
+#
+ATTRIBUTE User-Name 1 string
+ATTRIBUTE User-Password 2 octets
+ATTRIBUTE CHAP-Password 3 octets
+ATTRIBUTE NAS-IP-Address 4 ipaddr
+ATTRIBUTE NAS-Port 5 integer
+ATTRIBUTE Service-Type 6 integer
+ATTRIBUTE Framed-Protocol 7 integer
+ATTRIBUTE Framed-IP-Address 8 ipaddr
+ATTRIBUTE Framed-IP-Netmask 9 ipaddr
+ATTRIBUTE Framed-Routing 10 integer
+ATTRIBUTE Filter-Id 11 string
+ATTRIBUTE Framed-MTU 12 integer
+ATTRIBUTE Framed-Compression 13 integer
+ATTRIBUTE Login-IP-Host 14 ipaddr
+ATTRIBUTE Login-Service 15 integer
+ATTRIBUTE Login-TCP-Port 16 integer
+# Attribute 17 is undefined
+ATTRIBUTE Reply-Message 18 string
+ATTRIBUTE Callback-Number 19 string
+ATTRIBUTE Callback-Id 20 string
+# Attribute 21 is undefined
+ATTRIBUTE Framed-Route 22 string
+ATTRIBUTE Framed-IPX-Network 23 ipaddr
+ATTRIBUTE State 24 octets
+ATTRIBUTE Class 25 octets
+ATTRIBUTE Vendor-Specific 26 octets
+ATTRIBUTE Session-Timeout 27 integer
+ATTRIBUTE Idle-Timeout 28 integer
+ATTRIBUTE Termination-Action 29 integer
+ATTRIBUTE Called-Station-Id 30 string
+ATTRIBUTE Calling-Station-Id 31 string
+ATTRIBUTE NAS-Identifier 32 string
+ATTRIBUTE Proxy-State 33 octets
+ATTRIBUTE Login-LAT-Service 34 string
+ATTRIBUTE Login-LAT-Node 35 string
+ATTRIBUTE Login-LAT-Group 36 octets
+ATTRIBUTE Framed-AppleTalk-Link 37 integer
+ATTRIBUTE Framed-AppleTalk-Network 38 integer
+ATTRIBUTE Framed-AppleTalk-Zone 39 string
+
+ATTRIBUTE CHAP-Challenge 60 octets
+ATTRIBUTE NAS-Port-Type 61 integer
+ATTRIBUTE Port-Limit 62 integer
+ATTRIBUTE Login-LAT-Port 63 integer
+
+#
+# Integer Translations
+#
+
+# Service types
+
+VALUE Service-Type Login-User 1
+VALUE Service-Type Framed-User 2
+VALUE Service-Type Callback-Login-User 3
+VALUE Service-Type Callback-Framed-User 4
+VALUE Service-Type Outbound-User 5
+VALUE Service-Type Administrative-User 6
+VALUE Service-Type NAS-Prompt-User 7
+VALUE Service-Type Authenticate-Only 8
+VALUE Service-Type Callback-NAS-Prompt 9
+VALUE Service-Type Call-Check 10
+VALUE Service-Type Callback-Administrative 11
+
+# Framed Protocols
+
+VALUE Framed-Protocol PPP 1
+VALUE Framed-Protocol SLIP 2
+VALUE Framed-Protocol ARAP 3
+VALUE Framed-Protocol Gandalf-SLML 4
+VALUE Framed-Protocol Xylogics-IPX-SLIP 5
+VALUE Framed-Protocol X.75-Synchronous 6
+
+# Framed Routing Values
+
+VALUE Framed-Routing None 0
+VALUE Framed-Routing Broadcast 1
+VALUE Framed-Routing Listen 2
+VALUE Framed-Routing Broadcast-Listen 3
+
+# Framed Compression Types
+
+VALUE Framed-Compression None 0
+VALUE Framed-Compression Van-Jacobson-TCP-IP 1
+VALUE Framed-Compression IPX-Header-Compression 2
+VALUE Framed-Compression Stac-LZS 3
+
+# Login Services
+
+VALUE Login-Service Telnet 0
+VALUE Login-Service Rlogin 1
+VALUE Login-Service TCP-Clear 2
+VALUE Login-Service PortMaster 3
+VALUE Login-Service LAT 4
+VALUE Login-Service X25-PAD 5
+VALUE Login-Service X25-T3POS 6
+VALUE Login-Service TCP-Clear-Quiet 8
+
+# Login-TCP-Port (see /etc/services for more examples)
+
+VALUE Login-TCP-Port Telnet 23
+VALUE Login-TCP-Port Rlogin 513
+VALUE Login-TCP-Port Rsh 514
+
+# Termination Options
+
+VALUE Termination-Action Default 0
+VALUE Termination-Action RADIUS-Request 1
+
+# NAS Port Types
+
+VALUE NAS-Port-Type Async 0
+VALUE NAS-Port-Type Sync 1
+VALUE NAS-Port-Type ISDN 2
+VALUE NAS-Port-Type ISDN-V120 3
+VALUE NAS-Port-Type ISDN-V110 4
+VALUE NAS-Port-Type Virtual 5
+VALUE NAS-Port-Type PIAFS 6
+VALUE NAS-Port-Type HDLC-Clear-Channel 7
+VALUE NAS-Port-Type X.25 8
+VALUE NAS-Port-Type X.75 9
+VALUE NAS-Port-Type G.3-Fax 10
+VALUE NAS-Port-Type SDSL 11
+VALUE NAS-Port-Type ADSL-CAP 12
+VALUE NAS-Port-Type ADSL-DMT 13
+VALUE NAS-Port-Type IDSL 14
+VALUE NAS-Port-Type Ethernet 15
+VALUE NAS-Port-Type xDSL 16
+VALUE NAS-Port-Type Cable 17
+VALUE NAS-Port-Type Wireless-Other 18
+VALUE NAS-Port-Type Wireless-802.11 19
diff --git a/accel-pptpd/radius/dict/dictionary.rfc2866 b/accel-pptpd/radius/dict/dictionary.rfc2866
new file mode 100644
index 0000000..15472bd
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc2866
@@ -0,0 +1,57 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 2866.
+# http://www.ietf.org/rfc/rfc2866.txt
+#
+# $Id: dictionary.rfc2866,v 1.2 2005/08/08 22:23:38 aland Exp $
+#
+ATTRIBUTE Acct-Status-Type 40 integer
+ATTRIBUTE Acct-Delay-Time 41 integer
+ATTRIBUTE Acct-Input-Octets 42 integer
+ATTRIBUTE Acct-Output-Octets 43 integer
+ATTRIBUTE Acct-Session-Id 44 string
+ATTRIBUTE Acct-Authentic 45 integer
+ATTRIBUTE Acct-Session-Time 46 integer
+ATTRIBUTE Acct-Input-Packets 47 integer
+ATTRIBUTE Acct-Output-Packets 48 integer
+ATTRIBUTE Acct-Terminate-Cause 49 integer
+ATTRIBUTE Acct-Multi-Session-Id 50 string
+ATTRIBUTE Acct-Link-Count 51 integer
+
+# Accounting Status Types
+
+VALUE Acct-Status-Type Start 1
+VALUE Acct-Status-Type Stop 2
+VALUE Acct-Status-Type Alive 3 # dup
+VALUE Acct-Status-Type Interim-Update 3
+VALUE Acct-Status-Type Accounting-On 7
+VALUE Acct-Status-Type Accounting-Off 8
+VALUE Acct-Status-Type Failed 15
+
+# Authentication Types
+
+VALUE Acct-Authentic RADIUS 1
+VALUE Acct-Authentic Local 2
+VALUE Acct-Authentic Remote 3
+VALUE Acct-Authentic Diameter 4
+
+# Acct Terminate Causes
+
+VALUE Acct-Terminate-Cause User-Request 1
+VALUE Acct-Terminate-Cause Lost-Carrier 2
+VALUE Acct-Terminate-Cause Lost-Service 3
+VALUE Acct-Terminate-Cause Idle-Timeout 4
+VALUE Acct-Terminate-Cause Session-Timeout 5
+VALUE Acct-Terminate-Cause Admin-Reset 6
+VALUE Acct-Terminate-Cause Admin-Reboot 7
+VALUE Acct-Terminate-Cause Port-Error 8
+VALUE Acct-Terminate-Cause NAS-Error 9
+VALUE Acct-Terminate-Cause NAS-Request 10
+VALUE Acct-Terminate-Cause NAS-Reboot 11
+VALUE Acct-Terminate-Cause Port-Unneeded 12
+VALUE Acct-Terminate-Cause Port-Preempted 13
+VALUE Acct-Terminate-Cause Port-Suspended 14
+VALUE Acct-Terminate-Cause Service-Unavailable 15
+VALUE Acct-Terminate-Cause Callback 16
+VALUE Acct-Terminate-Cause User-Error 17
+VALUE Acct-Terminate-Cause Host-Request 18
diff --git a/accel-pptpd/radius/dict/dictionary.rfc2867 b/accel-pptpd/radius/dict/dictionary.rfc2867
new file mode 100644
index 0000000..b018aba
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc2867
@@ -0,0 +1,16 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 2867.
+# http://www.ietf.org/rfc/rfc2867.txt
+#
+# $Id: dictionary.rfc2867,v 1.2 2005/08/08 22:23:38 aland Exp $
+#
+ATTRIBUTE Acct-Tunnel-Connection 68 string
+ATTRIBUTE Acct-Tunnel-Packets-Lost 86 integer
+
+VALUE Acct-Status-Type Tunnel-Start 9
+VALUE Acct-Status-Type Tunnel-Stop 10
+VALUE Acct-Status-Type Tunnel-Reject 11
+VALUE Acct-Status-Type Tunnel-Link-Start 12
+VALUE Acct-Status-Type Tunnel-Link-Stop 13
+VALUE Acct-Status-Type Tunnel-Link-Reject 14
diff --git a/accel-pptpd/radius/dict/dictionary.rfc2868 b/accel-pptpd/radius/dict/dictionary.rfc2868
new file mode 100644
index 0000000..f6a4047
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc2868
@@ -0,0 +1,54 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 2868.
+# http://www.ietf.org/rfc/rfc2868.txt
+#
+# $Id: dictionary.rfc2868,v 1.4 2007/02/13 13:28:17 aland Exp $
+#
+ATTRIBUTE Tunnel-Type 64 integer has_tag
+ATTRIBUTE Tunnel-Medium-Type 65 integer has_tag
+ATTRIBUTE Tunnel-Client-Endpoint 66 string has_tag
+ATTRIBUTE Tunnel-Server-Endpoint 67 string has_tag
+
+ATTRIBUTE Tunnel-Password 69 string has_tag,encrypt=2
+
+ATTRIBUTE Tunnel-Private-Group-Id 81 string has_tag
+ATTRIBUTE Tunnel-Assignment-Id 82 string has_tag
+ATTRIBUTE Tunnel-Preference 83 integer has_tag
+
+ATTRIBUTE Tunnel-Client-Auth-Id 90 string has_tag
+ATTRIBUTE Tunnel-Server-Auth-Id 91 string has_tag
+
+# Tunnel Type
+
+VALUE Tunnel-Type PPTP 1
+VALUE Tunnel-Type L2F 2
+VALUE Tunnel-Type L2TP 3
+VALUE Tunnel-Type ATMP 4
+VALUE Tunnel-Type VTP 5
+VALUE Tunnel-Type AH 6
+VALUE Tunnel-Type IP 7
+VALUE Tunnel-Type MIN-IP 8
+VALUE Tunnel-Type ESP 9
+VALUE Tunnel-Type GRE 10
+VALUE Tunnel-Type DVS 11
+VALUE Tunnel-Type IP-in-IP 12
+
+# Tunnel Medium Type
+
+VALUE Tunnel-Medium-Type IP 1
+VALUE Tunnel-Medium-Type IPv4 1
+VALUE Tunnel-Medium-Type IPv6 2
+VALUE Tunnel-Medium-Type NSAP 3
+VALUE Tunnel-Medium-Type HDLC 4
+VALUE Tunnel-Medium-Type BBN-1822 5
+VALUE Tunnel-Medium-Type IEEE-802 6
+VALUE Tunnel-Medium-Type E.163 7
+VALUE Tunnel-Medium-Type E.164 8
+VALUE Tunnel-Medium-Type F.69 9
+VALUE Tunnel-Medium-Type X.121 10
+VALUE Tunnel-Medium-Type IPX 11
+VALUE Tunnel-Medium-Type Appletalk 12
+VALUE Tunnel-Medium-Type DecNet-IV 13
+VALUE Tunnel-Medium-Type Banyan-Vines 14
+VALUE Tunnel-Medium-Type E.164-NSAP 15
diff --git a/accel-pptpd/radius/dict/dictionary.rfc2869 b/accel-pptpd/radius/dict/dictionary.rfc2869
new file mode 100644
index 0000000..1a2631e
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc2869
@@ -0,0 +1,39 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 2869.
+# http://www.ietf.org/rfc/rfc2869.txt
+#
+# $Id: dictionary.rfc2869,v 1.2 2005/08/08 22:23:39 aland Exp $
+#
+ATTRIBUTE Acct-Input-Gigawords 52 integer
+ATTRIBUTE Acct-Output-Gigawords 53 integer
+
+ATTRIBUTE Event-Timestamp 55 date
+
+ATTRIBUTE ARAP-Password 70 octets # 16 octets of data
+ATTRIBUTE ARAP-Features 71 octets # 14 octets of data
+ATTRIBUTE ARAP-Zone-Access 72 integer
+ATTRIBUTE ARAP-Security 73 integer
+ATTRIBUTE ARAP-Security-Data 74 string
+ATTRIBUTE Password-Retry 75 integer
+ATTRIBUTE Prompt 76 integer
+ATTRIBUTE Connect-Info 77 string
+ATTRIBUTE Configuration-Token 78 string
+ATTRIBUTE EAP-Message 79 octets
+ATTRIBUTE Message-Authenticator 80 octets
+
+ATTRIBUTE ARAP-Challenge-Response 84 octets # 8 octets of data
+ATTRIBUTE Acct-Interim-Interval 85 integer
+# 86: RFC 2867
+ATTRIBUTE NAS-Port-Id 87 string
+ATTRIBUTE Framed-Pool 88 string
+
+# ARAP Zone Access
+
+VALUE ARAP-Zone-Access Default-Zone 1
+VALUE ARAP-Zone-Access Zone-Filter-Inclusive 2
+VALUE ARAP-Zone-Access Zone-Filter-Exclusive 4
+
+# Prompt
+VALUE Prompt No-Echo 0
+VALUE Prompt Echo 1
diff --git a/accel-pptpd/radius/dict/dictionary.rfc3576 b/accel-pptpd/radius/dict/dictionary.rfc3576
new file mode 100644
index 0000000..35aeb32
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc3576
@@ -0,0 +1,30 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 3576.
+# http://www.ietf.org/rfc/rfc3576.txt
+#
+# $Id: dictionary.rfc3576,v 1.2 2005/08/08 22:23:39 aland Exp $
+#
+ATTRIBUTE Error-Cause 101 integer
+
+# Service Types
+
+VALUE Service-Type Authorize-Only 17
+
+# Error causes
+
+VALUE Error-Cause Residual-Context-Removed 201
+VALUE Error-Cause Invalid-EAP-Packet 202
+VALUE Error-Cause Unsupported-Attribute 401
+VALUE Error-Cause Missing-Attribute 402
+VALUE Error-Cause NAS-Identification-Mismatch 403
+VALUE Error-Cause Invalid-Request 404
+VALUE Error-Cause Unsupported-Service 405
+VALUE Error-Cause Unsupported-Extension 406
+VALUE Error-Cause Administratively-Prohibited 501
+VALUE Error-Cause Proxy-Request-Not-Routable 502
+VALUE Error-Cause Session-Context-Not-Found 503
+VALUE Error-Cause Session-Context-Not-Removable 504
+VALUE Error-Cause Proxy-Processing-Error 505
+VALUE Error-Cause Resources-Unavailable 506
+VALUE Error-Cause Request-Initiated 507
diff --git a/accel-pptpd/radius/dict/dictionary.rfc3580 b/accel-pptpd/radius/dict/dictionary.rfc3580
new file mode 100644
index 0000000..1bd4ca3
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc3580
@@ -0,0 +1,16 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 3580.
+# http://www.ietf.org/rfc/rfc3580.txt
+#
+# $Id: dictionary.rfc3580,v 1.2 2005/08/08 22:23:39 aland Exp $
+#
+VALUE Acct-Terminate-Cause Supplicant-Restart 19
+VALUE Acct-Terminate-Cause Reauthentication-Failure 20
+VALUE Acct-Terminate-Cause Port-Reinit 21
+VALUE Acct-Terminate-Cause Port-Disabled 22
+
+VALUE NAS-Port-Type Token-Ring 20
+VALUE NAS-Port-Type FDDI 21
+
+VALUE Tunnel-Type VLAN 13
diff --git a/accel-pptpd/radius/dict/dictionary.rfc4072 b/accel-pptpd/radius/dict/dictionary.rfc4072
new file mode 100644
index 0000000..2280d07
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc4072
@@ -0,0 +1,9 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 4072
+# http://www.ietf.org/rfc/4072.txt
+#
+# $Id: dictionary.rfc4072,v 1.1 2007/11/14 09:00:25 aland Exp $
+#
+
+ATTRIBUTE EAP-Key-Name 102 string
diff --git a/accel-pptpd/radius/dict/dictionary.rfc4372 b/accel-pptpd/radius/dict/dictionary.rfc4372
new file mode 100644
index 0000000..b8af44a
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc4372
@@ -0,0 +1,8 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 4372.
+# http://www.ietf.org/rfc/4372.txt
+#
+# $Id: dictionary.rfc4372,v 1.1 2007/04/07 14:47:34 aland Exp $
+#
+ATTRIBUTE Chargeable-User-Identity 89 string
diff --git a/accel-pptpd/radius/dict/dictionary.rfc4675 b/accel-pptpd/radius/dict/dictionary.rfc4675
new file mode 100644
index 0000000..8d1187f
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc4675
@@ -0,0 +1,28 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 4675.
+# http://www.ietf.org/rfc/4675.txt
+#
+# $Id: dictionary.rfc4675,v 1.1 2007/04/07 14:54:14 aland Exp $
+#
+
+#
+# High byte = '1' (0x31) means the frames are tagged.
+# High byte = '2' (0x32) means the frames are untagged.
+#
+# Next 12 bits MUST be zero.
+#
+# Lower 12 bits is the IEEE-802.1Q VLAN VID.
+#
+ATTRIBUTE Egress-VLANID 56 integer
+ATTRIBUTE Ingress-Filters 57 integer
+
+#
+# First byte == '1' (0x31) means that the frames are tagged.
+# First byte == '2' (0x32) means that the frames are untagged.
+#
+ATTRIBUTE Egress-VLAN-Name 58 string
+ATTRIBUTE User-Priority-Table 59 octets # 8
+
+VALUE Ingress-Filters Enabled 1
+VALUE Ingress-Filters Disabled 2
diff --git a/accel-pptpd/radius/dict/dictionary.rfc4679 b/accel-pptpd/radius/dict/dictionary.rfc4679
new file mode 100644
index 0000000..39892a5
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc4679
@@ -0,0 +1,62 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 4679.
+# http://www.ietf.org/rfc/4679.txt
+#
+# $Id: dictionary.rfc4679,v 1.1 2007/04/08 14:18:01 aland Exp $
+#
+
+VENDOR ADSL-Forum 3561
+
+BEGIN-VENDOR ADSL-Forum
+
+#
+# The first two attributes are prefixed with "ADSL-" because of
+# conflicting names in dictionary.redback.
+#
+ATTRIBUTE ADSL-Agent-Circuit-Id 1 string
+ATTRIBUTE ADSL-Agent-Remote-Id 2 string
+ATTRIBUTE Actual-Data-Rate-Upstream 129 integer
+ATTRIBUTE Actual-Data-Rate-Downstream 130 integer
+ATTRIBUTE Minimum-Data-Rate-Upstream 131 integer
+ATTRIBUTE Minimum-Data-Rate-Downstream 132 integer
+ATTRIBUTE Attainable-Data-Rate-Upstream 133 integer
+ATTRIBUTE Attainable-Data-Rate-Downstream 134 integer
+ATTRIBUTE Maximum-Data-Rate-Upstream 135 integer
+ATTRIBUTE Maximum-Data-Rate-Downstream 136 integer
+ATTRIBUTE Minimum-Data-Rate-Upstream-Low-Power 137 integer
+ATTRIBUTE Minimum-Data-Rate-Downstream-Low-Power 138 integer
+ATTRIBUTE Maximum-Interleaving-Delay-Upstream 139 integer
+ATTRIBUTE Actual-Interleaving-Delay-Upstream 140 integer
+ATTRIBUTE Maximum-Interleaving-Delay-Downstream 141 integer
+ATTRIBUTE Actual-Interleaving-Delay-Downstream 142 integer
+
+#
+# This next attribute has a weird encoding.
+#
+# Octet[0] - 0x01 AAL5
+# Octet[0] - 0x02 Ethernet
+
+# Octet[1] - 0x00 Not Available
+# Octet[1] - 0x01 Untagged Ethernet
+# Octet[1] - 0x02 Single-Tagged Ethernet
+
+# Octet[2] - 0x00 Not available
+# Octet[2] - 0x01 PPPoA LLC
+# Octet[2] - 0x02 PPPoA Null
+# Octet[2] - 0x03 IPoA LLC
+# Octet[2] - 0x04 IPoA NULL
+# Octet[2] - 0x05 Ethernet over AAL5 LLC with FCS
+# Octet[2] - 0x06 Ethernet over AAL5 LLC without FCS
+# Octet[2] - 0x07 Ethernet over AAL5 Null with FCS
+# Octet[2] - 0x08 Ethernet over AAL5 Null without FCS
+#
+ATTRIBUTE Access-Loop-Encapsulation 144 octets # 3
+
+#
+# If this attribute exists, it means that IFW has been performed
+# for the subscribers session.
+#
+ATTRIBUTE IWF-Session 252 octets # 0
+
+END-VENDOR ADSL-Forum
diff --git a/accel-pptpd/radius/dict/dictionary.rfc4818 b/accel-pptpd/radius/dict/dictionary.rfc4818
new file mode 100644
index 0000000..4ea5945
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc4818
@@ -0,0 +1,11 @@
+# -*- text -*-
+##############################################################################
+#
+# Attributes and values defined in RFC 4818.
+# http://www.ietf.org/rfc/rfc4818.txt
+#
+# $Id: dictionary.rfc4818,v 1.1 2007/05/16 10:06:36 aland Exp $
+#
+##############################################################################
+
+ATTRIBUTE Delegated-IPv6-Prefix 123 ipv6prefix
diff --git a/accel-pptpd/radius/dict/dictionary.rfc4849 b/accel-pptpd/radius/dict/dictionary.rfc4849
new file mode 100644
index 0000000..1738eea
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc4849
@@ -0,0 +1,8 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 4849.
+# http://www.ietf.org/rfc/rfc4849.txt
+#
+# $Id: dictionary.rfc4849,v 1.2 2007/06/15 13:08:03 aland Exp $
+#
+ATTRIBUTE NAS-Filter-Rule 92 string
diff --git a/accel-pptpd/radius/dict/dictionary.rfc5176 b/accel-pptpd/radius/dict/dictionary.rfc5176
new file mode 100644
index 0000000..9308961
--- /dev/null
+++ b/accel-pptpd/radius/dict/dictionary.rfc5176
@@ -0,0 +1,9 @@
+# -*- text -*-
+#
+# Attributes and values defined in RFC 5176.
+# http://www.ietf.org/rfc/rfc5176.txt
+#
+# $Id: dictionary.rfc5176,v 1.1 2008/03/08 16:17:44 aland Exp $
+#
+VALUE Error-Cause Invalid-Attribute-Value 407
+VALUE Error-Cause Multiple-Session-Selection-Unsupported 508
diff --git a/accel-pptpd/radius/dict2c.py b/accel-pptpd/radius/dict2c.py
new file mode 100644
index 0000000..ff0961e
--- /dev/null
+++ b/accel-pptpd/radius/dict2c.py
@@ -0,0 +1,20 @@
+import sys,re
+
+hdr = file(sys.argv[2],'w')
+
+def process(fname, hdr):
+ for line in file(fname):
+ if line[:-1].strip() == '':
+ continue
+ if line[0] == '#':
+ continue
+ f = re.compile('[$.a-zA-Z0-9\-]+').findall(line)
+ if f[0] == 'ATTRIBUTE' or f[0] == 'VENDOR':
+ hdr.write('#define {0} {1}\n'.format(f[1].replace('-','_').replace('.','_'), f[2]))
+ elif f[0] == 'VALUE':
+ hdr.write('#define {0}_{1} {2}\n'.format(f[1].replace('-','_').replace('.','_'), f[2].replace('-','_'),f[3]))
+ elif f[0] == '$INCLUDE':
+ process(f[1], hdr)
+
+if __name__ == '__main__':
+ process(sys.argv[1], hdr)
diff --git a/accel-pptpd/radius/dm_coa.c b/accel-pptpd/radius/dm_coa.c
new file mode 100644
index 0000000..64fe97a
--- /dev/null
+++ b/accel-pptpd/radius/dm_coa.c
@@ -0,0 +1,278 @@
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <time.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <openssl/md5.h>
+
+#include "triton.h"
+#include "events.h"
+#include "log.h"
+
+#include "radius_p.h"
+
+#include "memdebug.h"
+
+#define PD_COA_PORT 3799
+
+struct dm_coa_serv_t
+{
+ struct triton_context_t ctx;
+ struct triton_md_handler_t hnd;
+};
+
+static struct dm_coa_serv_t serv;
+
+static int dm_coa_check_RA(struct rad_packet_t *pack, const char *secret)
+{
+ uint8_t RA[16];
+ MD5_CTX ctx;
+
+ memset(RA, 0, 16);
+
+ MD5_Init(&ctx);
+ MD5_Update(&ctx, pack->buf, 4);
+ MD5_Update(&ctx, RA, 16);
+ MD5_Update(&ctx, pack->buf + 20, pack->len - 20);
+ MD5_Update(&ctx, secret, strlen(secret));
+ MD5_Final(RA, &ctx);
+
+ return memcmp(RA, pack->buf + 4, 16);
+}
+
+static void dm_coa_set_RA(struct rad_packet_t *pack, const char *secret)
+{
+ MD5_CTX ctx;
+
+ MD5_Init(&ctx);
+ MD5_Update(&ctx, pack->buf, pack->len);
+ MD5_Update(&ctx, secret, strlen(secret));
+ MD5_Final(pack->buf + 4, &ctx);
+}
+
+static int dm_coa_send_ack(int fd, struct rad_packet_t *req, struct sockaddr_in *addr)
+{
+ struct rad_packet_t *reply;
+ uint8_t RA[16];
+
+ memcpy(RA, req->buf + 4, sizeof(RA));
+
+ reply = rad_packet_alloc(req->code == CODE_COA_REQUEST ? CODE_COA_ACK : CODE_DISCONNECT_ACK);
+ if (!reply)
+ return -1;
+
+ reply->id = req->id;
+
+ if (rad_packet_build(reply, RA)) {
+ rad_packet_free(reply);
+ return -1;
+ }
+
+ dm_coa_set_RA(reply, conf_dm_coa_secret);
+
+ if (conf_verbose) {
+ log_ppp_info("send ");
+ rad_packet_print(reply, log_ppp_info);
+ }
+
+ rad_packet_send(reply, fd, addr);
+
+ rad_packet_free(reply);
+
+ return 0;
+}
+
+static int dm_coa_send_nak(int fd, struct rad_packet_t *req, struct sockaddr_in *addr, int err_code)
+{
+ struct rad_packet_t *reply;
+ uint8_t RA[16];
+
+ memcpy(RA, req->buf + 4, sizeof(RA));
+
+ reply = rad_packet_alloc(req->code == CODE_COA_REQUEST ? CODE_COA_NAK : CODE_DISCONNECT_NAK);
+ if (!reply)
+ return -1;
+
+ reply->id = req->id;
+
+ if (err_code)
+ rad_packet_add_int(reply, "Error-Cause", err_code);
+
+ if (rad_packet_build(reply, RA)) {
+ rad_packet_free(reply);
+ return -1;
+ }
+
+ dm_coa_set_RA(reply, conf_dm_coa_secret);
+
+ if (conf_verbose) {
+ log_ppp_info("send ");
+ rad_packet_print(reply, log_ppp_info);
+ }
+
+ rad_packet_send(reply, fd, addr);
+
+ rad_packet_free(reply);
+
+ return 0;
+}
+
+
+static void disconnect_request(struct radius_pd_t *rpd)
+{
+ if (conf_verbose) {
+ log_ppp_info("recv ");
+ rad_packet_print(rpd->dm_coa_req, log_ppp_info);
+ }
+
+ dm_coa_send_ack(serv.hnd.fd, rpd->dm_coa_req, &rpd->dm_coa_addr);
+
+ rad_packet_free(rpd->dm_coa_req);
+ rpd->dm_coa_req = NULL;
+
+ ppp_terminate(rpd->ppp, 0);
+}
+
+static void coa_request(struct radius_pd_t *rpd)
+{
+ struct ev_radius_t ev = {
+ .ppp = rpd->ppp,
+ .request = rpd->dm_coa_req,
+ };
+
+ if (conf_verbose) {
+ log_ppp_info("recv ");
+ rad_packet_print(rpd->dm_coa_req, log_ppp_info);
+ }
+
+ triton_event_fire(EV_RADIUS_COA, &ev);
+
+ if (ev.res)
+ dm_coa_send_nak(serv.hnd.fd, rpd->dm_coa_req, &rpd->dm_coa_addr, 0);
+ else
+ dm_coa_send_ack(serv.hnd.fd, rpd->dm_coa_req, &rpd->dm_coa_addr);
+
+ rad_packet_free(rpd->dm_coa_req);
+
+ pthread_mutex_lock(&rpd->lock);
+ rpd->dm_coa_req = NULL;
+ pthread_mutex_unlock(&rpd->lock);
+}
+
+static int dm_coa_read(struct triton_md_handler_t *h)
+{
+ struct rad_packet_t *pack;
+ struct radius_pd_t *rpd;
+ int err_code;
+ struct sockaddr_in addr;
+
+
+ pack = rad_packet_recv(h->fd, &addr);
+ if (!pack)
+ return 0;
+
+ if (pack->code != CODE_DISCONNECT_REQUEST && pack->code != CODE_COA_REQUEST) {
+ log_warn("radius:dm_coa: unexpected code (%i) received\n", pack->code);
+ goto out_err_no_reply;
+ }
+
+ if (dm_coa_check_RA(pack, conf_dm_coa_secret)) {
+ log_warn("radius:dm_coa: RA validation failed\n");
+ goto out_err_no_reply;
+ }
+
+ if (conf_verbose) {
+ log_debug("recv ");
+ rad_packet_print(pack, log_debug);
+ }
+
+ if (rad_check_nas_pack(pack)) {
+ log_warn("radius:dm_coa: NAS identification failed\n");
+ err_code = 403;
+ goto out_err;
+ }
+
+ rpd = rad_find_session_pack(pack);
+ if (!rpd) {
+ log_warn("radius:dm_coa: session not found\n");
+ err_code = 503;
+ goto out_err;
+ }
+
+ if (rpd->dm_coa_req) {
+ pthread_mutex_unlock(&rpd->lock);
+ goto out_err_no_reply;
+ }
+
+ rpd->dm_coa_req = pack;
+ memcpy(&rpd->dm_coa_addr, &addr, sizeof(addr));
+
+ if (pack->code == CODE_DISCONNECT_REQUEST)
+ triton_context_call(rpd->ppp->ctrl->ctx, (void (*)(void *))disconnect_request, rpd);
+ else
+ triton_context_call(rpd->ppp->ctrl->ctx, (void (*)(void *))coa_request, rpd);
+
+ pthread_mutex_unlock(&rpd->lock);
+
+ return 0;
+
+out_err:
+ dm_coa_send_nak(h->fd, pack, &addr, err_code);
+
+out_err_no_reply:
+ rad_packet_free(pack);
+ return 0;
+}
+
+static void dm_coa_close(struct triton_context_t *ctx)
+{
+ struct dm_coa_serv_t *serv = container_of(ctx, typeof(*serv), ctx);
+ triton_md_unregister_handler(&serv->hnd);
+ close(serv->hnd.fd);
+ triton_context_unregister(ctx);
+}
+
+static struct dm_coa_serv_t serv = {
+ .ctx.close = dm_coa_close,
+ .ctx.before_switch = log_switch,
+ .hnd.read = dm_coa_read,
+};
+
+static void __init init(void)
+{
+ struct sockaddr_in addr;
+
+ serv.hnd.fd = socket (PF_INET, SOCK_DGRAM, 0);
+ if (serv.hnd.fd < 0) {
+ log_emerg("radius:dm_coa: socket: %s\n", strerror(errno));
+ return;
+ }
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons (PD_COA_PORT);
+ if (conf_nas_ip_address)
+ addr.sin_addr.s_addr = inet_addr(conf_nas_ip_address);
+ else
+ addr.sin_addr.s_addr = htonl (INADDR_ANY);
+ if (bind (serv.hnd.fd, (struct sockaddr *) &addr, sizeof (addr)) < 0) {
+ 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_emerg("radius:dm_coa: failed to set nonblocking mode: %s\n", strerror(errno));
+ close(serv.hnd.fd);
+ return;
+ }
+
+ triton_context_register(&serv.ctx, NULL);
+ triton_md_register_handler(&serv.ctx, &serv.hnd);
+ triton_md_enable_handler(&serv.hnd, MD_MODE_READ);
+ triton_context_wakeup(&serv.ctx);
+}
diff --git a/accel-pptpd/radius/packet.c b/accel-pptpd/radius/packet.c
new file mode 100644
index 0000000..e3d4cfc
--- /dev/null
+++ b/accel-pptpd/radius/packet.c
@@ -0,0 +1,607 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include "log.h"
+#include "mempool.h"
+
+#include "radius_p.h"
+
+#include "memdebug.h"
+
+static mempool_t packet_pool;
+static mempool_t attr_pool;
+
+struct rad_packet_t *rad_packet_alloc(int code)
+{
+ struct rad_packet_t *pack;
+
+ pack = mempool_alloc(packet_pool);
+ if (!pack) {
+ log_emerg("radius:packet: out of memory\n");
+ return NULL;
+ }
+
+ memset(pack, 0, sizeof(*pack));
+ pack->code = code;
+ pack->len = 20;
+ pack->id = 1;
+ INIT_LIST_HEAD(&pack->attrs);
+
+ return pack;
+}
+
+void print_buf(uint8_t *buf,int size)
+{
+ int i;
+ for(i=0;i<size;i++)
+ printf("%x ",buf[i]);
+ printf("\n");
+}
+
+int rad_packet_build(struct rad_packet_t *pack, uint8_t *RA)
+{
+ struct rad_attr_t *attr;
+ uint8_t *ptr;
+
+ if (pack->buf)
+ ptr = _realloc(pack->buf, pack->len);
+ else
+ ptr = _malloc(pack->len);
+
+ if (!ptr) {
+ log_emerg("radius:packet: out of memory\n");
+ return -1;
+ }
+
+ pack->buf = ptr;
+ *ptr = pack->code; ptr++;
+ *ptr = pack->id; ptr++;
+ *(uint16_t*)ptr = htons(pack->len); ptr+= 2;
+ memcpy(ptr, RA, 16); ptr+=16;
+
+ list_for_each_entry(attr, &pack->attrs, entry) {
+ if (attr->vendor) {
+ *ptr = 26; ptr++;
+ *ptr = attr->len + 2 + 6; ptr++;
+ *(uint32_t *)ptr = htonl(attr->vendor->id); ptr+=4;
+ }
+ *ptr = attr->attr->id; ptr++;
+ *ptr = attr->len + 2; ptr++;
+ switch(attr->attr->type) {
+ case ATTR_TYPE_INTEGER:
+ *(uint32_t*)ptr = htonl(attr->val.integer);
+ break;
+ case ATTR_TYPE_OCTETS:
+ case ATTR_TYPE_STRING:
+ memcpy(ptr, attr->val.string, attr->len);
+ break;
+ case ATTR_TYPE_IPADDR:
+ *(in_addr_t*)ptr = attr->val.ipaddr;
+ break;
+ case ATTR_TYPE_DATE:
+ *(uint32_t*)ptr = htonl(attr->val.date);
+ break;
+ default:
+ log_emerg("radius:packet:BUG: unknown attribute type\n");
+ abort();
+ }
+ ptr += attr->len;
+ }
+
+ //print_buf(pack->buf, pack->len);
+ return 0;
+}
+
+struct rad_packet_t *rad_packet_recv(int fd, struct sockaddr_in *addr)
+{
+ struct rad_packet_t *pack;
+ struct rad_attr_t *attr;
+ struct rad_dict_attr_t *da;
+ struct rad_dict_vendor_t *vendor;
+ uint8_t *ptr;
+ int n, id, len, vendor_id;
+ socklen_t addr_len = sizeof(*addr);
+
+ pack = rad_packet_alloc(0);
+ if (!pack)
+ return NULL;
+
+ pack->buf = _malloc(REQ_LENGTH_MAX);
+ if (!pack->buf) {
+ log_emerg("radius:packet: out of memory\n");
+ goto out_err;
+ }
+
+ while (1) {
+ if (addr)
+ n = recvfrom(fd, pack->buf, REQ_LENGTH_MAX, 0, addr, &addr_len);
+ else
+ n = read(fd, pack->buf, REQ_LENGTH_MAX);
+ if (n < 0) {
+ if (errno == EINTR)
+ continue;
+ log_ppp_error("radius:packet:read: %s\n", strerror(errno));
+ goto out_err;
+ }
+ break;
+ }
+
+ if (n < 20) {
+ log_ppp_warn("radius:packet: short packed received (%i)\n", n);
+ goto out_err;
+ }
+
+ ptr = (uint8_t *)pack->buf;
+
+ pack->code = *ptr; ptr++;
+ pack->id = *ptr; ptr++;
+ pack->len = ntohs(*(uint16_t*)ptr); ptr += 2;
+
+ if (pack->len > n) {
+ log_ppp_warn("radius:packet: short packet received %i, expected %i\n", pack->len, n);
+ goto out_err;
+ }
+
+ ptr += 16;
+ n -= 20;
+
+ while (n>0) {
+ id = *ptr; ptr++;
+ len = *ptr - 2; ptr++;
+ if (len < 0) {
+ log_ppp_warn("radius:packet short attribute len received\n");
+ goto out_err;
+ }
+ if (2 + len > n) {
+ log_ppp_warn("radius:packet: too long attribute received (%i, %i)\n", id, len);
+ goto out_err;
+ }
+ if (id == 26) {
+ vendor_id = ntohl(*(uint32_t *)ptr);
+ vendor = rad_dict_find_vendor_id(vendor_id);
+ if (vendor) {
+ ptr += 4;
+ id = *ptr; ptr++;
+ len = *ptr - 2; ptr++;
+ n -= 2 + 4;
+ } else
+ log_ppp_warn("radius:packet: vendor %i not found\n", id);
+ } else
+ vendor = NULL;
+ da = rad_dict_find_attr_id(vendor, id);
+ if (da) {
+ attr = mempool_alloc(attr_pool);
+ if (!attr) {
+ log_emerg("radius:packet: out of memory\n");
+ goto out_err;
+ }
+ memset(attr, 0, sizeof(*attr));
+ attr->vendor = vendor;
+ attr->attr = da;
+ attr->len = len;
+ switch (da->type) {
+ case ATTR_TYPE_STRING:
+ attr->val.string = _malloc(len+1);
+ if (!attr->val.string) {
+ log_emerg("radius:packet: out of memory\n");
+ _free(attr);
+ goto out_err;
+ }
+ memcpy(attr->val.string, ptr, len);
+ attr->val.string[len] = 0;
+ break;
+ case ATTR_TYPE_OCTETS:
+ attr->val.octets = _malloc(len);
+ if (!attr->val.octets) {
+ log_emerg("radius:packet: out of memory\n");
+ _free(attr);
+ goto out_err;
+ }
+ memcpy(attr->val.octets, ptr, len);
+ break;
+ case ATTR_TYPE_DATE:
+ case ATTR_TYPE_INTEGER:
+ attr->val.integer = ntohl(*(uint32_t*)ptr);
+ break;
+ case ATTR_TYPE_IPADDR:
+ attr->val.integer = *(uint32_t*)ptr;
+ break;
+ }
+ list_add_tail(&attr->entry, &pack->attrs);
+ } else
+ log_ppp_warn("radius:packet: unknown attribute received (%i)\n", id);
+ ptr += len;
+ n -= 2 + len;
+ }
+
+ return pack;
+
+out_err:
+ rad_packet_free(pack);
+ return NULL;
+}
+
+void rad_packet_free(struct rad_packet_t *pack)
+{
+ struct rad_attr_t *attr;
+
+ if (pack->buf)
+ _free(pack->buf);
+
+ while(!list_empty(&pack->attrs)) {
+ attr = list_entry(pack->attrs.next, typeof(*attr), entry);
+ list_del(&attr->entry);
+ if (attr->attr->type == ATTR_TYPE_STRING || attr->attr->type == ATTR_TYPE_OCTETS)
+ _free(attr->val.string);
+ mempool_free(attr);
+ }
+
+ mempool_free(pack);
+}
+
+void rad_packet_print(struct rad_packet_t *pack, void (*print)(const char *fmt, ...))
+{
+ struct rad_attr_t *attr;
+ struct rad_dict_value_t *val;
+
+ print("[RADIUS ");
+ switch(pack->code) {
+ case CODE_ACCESS_REQUEST:
+ print("Access-Request");
+ break;
+ case CODE_ACCESS_CHALLENGE:
+ print("Access-Challenge");
+ break;
+ case CODE_ACCESS_ACCEPT:
+ print("Access-Accept");
+ break;
+ case CODE_ACCESS_REJECT:
+ print("Access-Reject");
+ break;
+ case CODE_ACCOUNTING_REQUEST:
+ print("Accounting-Request");
+ break;
+ case CODE_ACCOUNTING_RESPONSE:
+ print("Accounting-Response");
+ break;
+ case CODE_DISCONNECT_REQUEST:
+ print("Disconnect-Request");
+ break;
+ case CODE_DISCONNECT_ACK:
+ print("Disconnect-ACK");
+ break;
+ case CODE_DISCONNECT_NAK:
+ print("Disconnect-NAK");
+ break;
+ case CODE_COA_REQUEST:
+ print("CoA-Request");
+ break;
+ case CODE_COA_ACK:
+ print("CoA-ACK");
+ break;
+ case CODE_COA_NAK:
+ print("CoA-NAK");
+ break;
+ default:
+ print("Unknown (%i)", pack->code);
+ }
+ print(" id=%x", pack->id);
+
+ list_for_each_entry(attr, &pack->attrs, entry) {
+ if (attr->vendor)
+ print("<%s %s ", attr->vendor->name, attr->attr->name);
+ else
+ print(" <%s ", attr->attr->name);
+ switch (attr->attr->type) {
+ case ATTR_TYPE_INTEGER:
+ val = rad_dict_find_val(attr->attr, attr->val);
+ if (val)
+ print("%s", val->name);
+ else
+ print("%i", attr->val.integer);
+ break;
+ case ATTR_TYPE_STRING:
+ print("\"%s\"", attr->val.string);
+ break;
+ case ATTR_TYPE_IPADDR:
+ print("%i.%i.%i.%i", attr->val.ipaddr & 0xff, (attr->val.ipaddr >> 8) & 0xff, (attr->val.ipaddr >> 16) & 0xff, (attr->val.ipaddr >> 24) & 0xff);
+ break;
+ }
+ print(">");
+ }
+ print("]\n");
+}
+
+int rad_packet_add_int(struct rad_packet_t *pack, const char *name, int val)
+{
+ struct rad_attr_t *ra;
+ struct rad_dict_attr_t *attr;
+
+ if (pack->len + 2 + 4 >= REQ_LENGTH_MAX)
+ return -1;
+
+ attr = rad_dict_find_attr(name);
+ if (!attr)
+ return -1;
+
+ ra = mempool_alloc(attr_pool);
+ if (!ra)
+ return -1;
+
+ memset(ra, 0, sizeof(*ra));
+ ra->attr = attr;
+ ra->len = 4;
+ ra->val.integer = val;
+ list_add_tail(&ra->entry, &pack->attrs);
+ pack->len += 2 + 4;
+
+ return 0;
+}
+
+int rad_packet_change_int(struct rad_packet_t *pack, const char *name, int val)
+{
+ struct rad_attr_t *ra;
+
+ ra = rad_packet_find_attr(pack, name);
+ if (!ra)
+ return -1;
+
+ ra->val.integer = val;
+
+ return 0;
+}
+
+int rad_packet_add_octets(struct rad_packet_t *pack, const char *name, uint8_t *val, int len)
+{
+ struct rad_attr_t *ra;
+ struct rad_dict_attr_t *attr;
+
+ if (pack->len + 2 + len >= REQ_LENGTH_MAX)
+ return -1;
+
+ attr = rad_dict_find_attr(name);
+ if (!attr)
+ return -1;
+
+ ra = mempool_alloc(attr_pool);
+ if (!ra) {
+ log_emerg("radius: out of memory\n");
+ return -1;
+ }
+
+ memset(ra, 0, sizeof(*ra));
+ ra->attr = attr;
+ ra->len = len;
+ ra->val.octets = _malloc(len);
+ if (!ra->val.octets) {
+ log_emerg("radius: out of memory\n");
+ _free(ra);
+ return -1;
+ }
+ memcpy(ra->val.octets, val, len);
+ list_add_tail(&ra->entry, &pack->attrs);
+ pack->len += 2 + len;
+
+ return 0;
+}
+int rad_packet_add_str(struct rad_packet_t *pack, const char *name, const char *val, int len)
+{
+ struct rad_attr_t *ra;
+ struct rad_dict_attr_t *attr;
+
+ if (pack->len + 2 + len >= REQ_LENGTH_MAX)
+ return -1;
+
+ attr = rad_dict_find_attr(name);
+ if (!attr)
+ return -1;
+
+ ra = mempool_alloc(attr_pool);
+ if (!ra) {
+ log_emerg("radius: out of memory\n");
+ return -1;
+ }
+
+ memset(ra, 0, sizeof(*ra));
+ ra->attr = attr;
+ ra->len = len;
+ ra->val.string = _malloc(len+1);
+ if (!ra->val.string) {
+ log_emerg("radius: out of memory\n");
+ _free(ra);
+ return -1;
+ }
+ memcpy(ra->val.string, val, len);
+ ra->val.string[len] = 0;
+ list_add_tail(&ra->entry, &pack->attrs);
+ pack->len += 2 + len;
+
+ return 0;
+}
+
+int rad_packet_change_str(struct rad_packet_t *pack, const char *name, const char *val, int len)
+{
+ struct rad_attr_t *ra;
+
+ ra = rad_packet_find_attr(pack, name);
+ if (!ra)
+ return -1;
+
+ if (ra->len != len) {
+ if (pack->len - ra->len + len >= REQ_LENGTH_MAX)
+ return -1;
+
+ ra->val.string = _realloc(ra->val.string, len + 1);
+ if (!ra->val.string) {
+ log_emerg("radius: out of memory\n");
+ return -1;
+ }
+
+ pack->len += len - ra->len;
+ ra->len = len;
+ }
+
+ memcpy(ra->val.string, val, len);
+ ra->val.string[len] = 0;
+
+ return 0;
+}
+
+int rad_packet_add_val(struct rad_packet_t *pack, const char *name, const char *val)
+{
+ struct rad_attr_t *ra;
+ struct rad_dict_attr_t *attr;
+ struct rad_dict_value_t *v;
+
+ if (pack->len + 2 + 4 >= REQ_LENGTH_MAX)
+ return -1;
+
+ attr = rad_dict_find_attr(name);
+ if (!attr)
+ return -1;
+
+ v = rad_dict_find_val_name(attr, val);
+ if (!v)
+ return -1;
+
+ ra = mempool_alloc(attr_pool);
+ if (!ra)
+ return -1;
+
+ memset(ra, 0, sizeof(*ra));
+ ra->attr = attr;
+ ra->len = 4;
+ ra->val = v->val;
+ list_add_tail(&ra->entry, &pack->attrs);
+ pack->len += 2 + 4;
+
+ return 0;
+}
+
+int rad_packet_change_val(struct rad_packet_t *pack, const char *name, const char *val)
+{
+ struct rad_attr_t *ra;
+ struct rad_dict_value_t *v;
+
+ ra = rad_packet_find_attr(pack, name);
+ if (!ra)
+ return -1;
+
+ v = rad_dict_find_val_name(ra->attr, val);
+ if (!v)
+ return -1;
+
+ ra->val = v->val;
+
+ return 0;
+}
+
+int rad_packet_add_ipaddr(struct rad_packet_t *pack, const char *name, in_addr_t ipaddr)
+{
+ return rad_packet_add_int(pack, name, ipaddr);
+}
+
+
+struct rad_attr_t *rad_packet_find_attr(struct rad_packet_t *pack, const char *name)
+{
+ struct rad_attr_t *ra;
+
+ list_for_each_entry(ra, &pack->attrs, entry)
+ if (!strcmp(ra->attr->name, name))
+ return ra;
+
+ return NULL;
+}
+
+int rad_packet_send(struct rad_packet_t *pack, int fd, struct sockaddr_in *addr)
+{
+ int n;
+
+ while (1) {
+ if (addr)
+ n = sendto(fd, pack->buf, pack->len, 0, addr, sizeof(*addr));
+ else
+ n = write(fd, pack->buf, pack->len);
+ if (n < 0) {
+ if (errno == EINTR)
+ continue;
+ log_ppp_error("radius:write: %s\n", strerror(errno));
+ return -1;
+ } else if (n != pack->len) {
+ log_ppp_error("radius:write: short write %i, excpected %i\n", n, pack->len);
+ return -1;
+ }
+ break;
+ }
+
+ return 0;
+}
+
+int rad_packet_add_vendor_octets(struct rad_packet_t *pack, const char *vendor_name, const char *name, const uint8_t *val, int len)
+{
+ struct rad_attr_t *ra;
+ struct rad_dict_attr_t *attr;
+ struct rad_dict_vendor_t *vendor;
+
+ if (pack->len + 6 + 2 + len >= REQ_LENGTH_MAX)
+ return -1;
+
+ vendor = rad_dict_find_vendor_name(vendor_name);
+ if (!vendor)
+ return -1;
+
+ attr = rad_dict_find_vendor_attr(vendor, name);
+ if (!attr)
+ return -1;
+
+ ra = mempool_alloc(attr_pool);
+ if (!ra) {
+ log_emerg("radius: out of memory\n");
+ return -1;
+ }
+
+ memset(ra, 0, sizeof(*ra));
+ ra->vendor = vendor;
+ ra->attr = attr;
+ ra->len = len;
+ ra->val.octets = _malloc(len);
+ if (!ra->val.octets) {
+ log_emerg("radius: out of memory\n");
+ _free(ra);
+ return -1;
+ }
+ memcpy(ra->val.octets, val, len);
+ list_add_tail(&ra->entry, &pack->attrs);
+ pack->len += 6 + 2 + len;
+
+ return 0;
+}
+
+struct rad_attr_t *rad_packet_find_vendor_attr(struct rad_packet_t *pack, const char *vendor_name, const char *name)
+{
+ struct rad_attr_t *ra;
+
+ list_for_each_entry(ra, &pack->attrs, entry) {
+ if (!ra->vendor)
+ continue;
+ if (strcmp(ra->vendor->name, vendor_name))
+ continue;
+ if (strcmp(ra->attr->name, name))
+ continue;
+
+ return ra;
+ }
+
+ return NULL;
+}
+
+static void __init init(void)
+{
+ attr_pool = mempool_create(sizeof(struct rad_attr_t));
+ packet_pool = mempool_create(sizeof(struct rad_packet_t));
+}
diff --git a/accel-pptpd/radius/radius.c b/accel-pptpd/radius/radius.c
new file mode 100644
index 0000000..9f5c7ff
--- /dev/null
+++ b/accel-pptpd/radius/radius.c
@@ -0,0 +1,373 @@
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+
+#include "mempool.h"
+#include "events.h"
+#include "log.h"
+#include "ppp.h"
+#include "pwdb.h"
+#include "ipdb.h"
+
+#include "radius_p.h"
+#include "attr_defs.h"
+
+#include "memdebug.h"
+
+#define CHAP_MD5 5
+#define MSCHAP_V1 0x80
+#define MSCHAP_V2 0x81
+
+int conf_max_try = 3;
+int conf_timeout = 3;
+char *conf_nas_identifier = "accel-pptpd";
+char *conf_nas_ip_address;
+char *conf_gw_ip_address;
+int conf_verbose = 0;
+
+char *conf_auth_server;
+int conf_auth_server_port = 1812;
+char *conf_auth_secret;
+
+char *conf_acct_server;
+int conf_acct_server_port = 1813;
+char *conf_acct_secret;
+char *conf_dm_coa_secret;
+
+static LIST_HEAD(sessions);
+static pthread_rwlock_t sessions_lock = PTHREAD_RWLOCK_INITIALIZER;
+
+static void *pd_key;
+static struct ipdb_t ipdb;
+
+static mempool_t rpd_pool;
+
+void rad_proc_attrs(struct rad_req_t *req)
+{
+ struct rad_attr_t *attr;
+
+ list_for_each_entry(attr, &req->reply->attrs, entry) {
+ if (attr->vendor)
+ continue;
+ switch(attr->attr->id) {
+ case Framed_IP_Address:
+ if (!conf_gw_ip_address)
+ log_ppp_warn("radius: gw-ip-address not specified, cann't assign IP address...\n");
+ else {
+ req->rpd->ipaddr.owner = &ipdb;
+ req->rpd->ipaddr.peer_addr = attr->val.ipaddr;
+ req->rpd->ipaddr.addr = inet_addr(conf_gw_ip_address);
+ }
+ break;
+ case Acct_Interim_Interval:
+ req->rpd->acct_interim_interval = attr->val.integer;
+ break;
+ case Session_Timeout:
+ req->rpd->session_timeout.expire_tv.tv_sec = attr->val.integer;
+ break;
+ }
+ }
+}
+
+static int check(struct pwdb_t *pwdb, struct ppp_t *ppp, const char *username, int type, va_list _args)
+{
+ int r = PWDB_NO_IMPL;
+ va_list args;
+ int chap_type;
+ struct radius_pd_t *rpd = find_pd(ppp);
+
+ va_copy(args, _args);
+
+ switch(type) {
+ case PPP_PAP:
+ r = rad_auth_pap(rpd, username, args);
+ break;
+ case PPP_CHAP:
+ chap_type = va_arg(args, int);
+ switch(chap_type) {
+ case CHAP_MD5:
+ r = rad_auth_chap_md5(rpd, username, args);
+ break;
+ case MSCHAP_V1:
+ r = rad_auth_mschap_v1(rpd, username, args);
+ break;
+ case MSCHAP_V2:
+ r = rad_auth_mschap_v2(rpd, username, args);
+ break;
+ }
+ break;
+ }
+
+ va_end(args);
+
+ return r;
+}
+
+static struct ipdb_item_t *get_ip(struct ppp_t *ppp)
+{
+ struct radius_pd_t *rpd = find_pd(ppp);
+
+ if (rpd->ipaddr.peer_addr)
+ return &rpd->ipaddr;
+ return NULL;
+}
+
+static void session_timeout(struct triton_timer_t *t)
+{
+ struct radius_pd_t *rpd = container_of(t, typeof(*rpd), session_timeout);
+
+ log_ppp_msg("radius: session timed out\n");
+ ppp_terminate(rpd->ppp, 0);
+}
+
+static void ppp_starting(struct ppp_t *ppp)
+{
+ struct radius_pd_t *rpd = mempool_alloc(rpd_pool);
+
+ memset(rpd, 0, sizeof(*rpd));
+ rpd->pd.key = &pd_key;
+ rpd->ppp = ppp;
+ pthread_mutex_init(&rpd->lock, NULL);
+ list_add_tail(&rpd->pd.entry, &ppp->pd_list);
+
+ pthread_rwlock_wrlock(&sessions_lock);
+ list_add_tail(&rpd->entry, &sessions);
+ pthread_rwlock_unlock(&sessions_lock);
+}
+
+static void ppp_started(struct ppp_t *ppp)
+{
+ struct radius_pd_t *rpd = find_pd(ppp);
+
+ if (rad_acct_start(rpd))
+ ppp_terminate(rpd->ppp, 0);
+
+ if (rpd->session_timeout.expire_tv.tv_sec) {
+ rpd->session_timeout.expire = session_timeout;
+ triton_timer_add(ppp->ctrl->ctx, &rpd->session_timeout, 0);
+ }
+}
+static void ppp_finishing(struct ppp_t *ppp)
+{
+ struct radius_pd_t *rpd = find_pd(ppp);
+
+ rad_acct_stop(rpd);
+}
+static void ppp_finished(struct ppp_t *ppp)
+{
+ struct radius_pd_t *rpd = find_pd(ppp);
+
+ pthread_rwlock_wrlock(&sessions_lock);
+ pthread_mutex_lock(&rpd->lock);
+ list_del(&rpd->entry);
+ pthread_mutex_unlock(&rpd->lock);
+ pthread_rwlock_unlock(&sessions_lock);
+
+ if (rpd->acct_req)
+ rad_req_free(rpd->acct_req);
+
+ if (rpd->dm_coa_req)
+ rad_packet_free(rpd->dm_coa_req);
+
+ if (rpd->session_timeout.tpd)
+ triton_timer_del(&rpd->session_timeout);
+
+ list_del(&rpd->pd.entry);
+
+ mempool_free(rpd);
+}
+
+struct radius_pd_t *find_pd(struct ppp_t *ppp)
+{
+ struct ppp_pd_t *pd;
+ struct radius_pd_t *rpd;
+
+ list_for_each_entry(pd, &ppp->pd_list, entry) {
+ if (pd->key == &pd_key) {
+ rpd = container_of(pd, typeof(*rpd), pd);
+ return rpd;
+ }
+ }
+ log_emerg("radius:BUG: rpd not found\n");
+ abort();
+}
+
+
+struct radius_pd_t *rad_find_session(const char *sessionid, const char *username, int port_id, in_addr_t ipaddr, const char *csid)
+{
+ struct radius_pd_t *rpd;
+
+ pthread_rwlock_rdlock(&sessions_lock);
+ list_for_each_entry(rpd, &sessions, entry) {
+ if (sessionid && strcmp(sessionid, rpd->ppp->sessionid))
+ continue;
+ if (username && strcmp(username, rpd->ppp->username))
+ continue;
+ if (port_id >= 0 && port_id != rpd->ppp->unit_idx)
+ continue;
+ if (ipaddr && ipaddr != rpd->ipaddr.peer_addr)
+ continue;
+ if (csid && rpd->ppp->ctrl->calling_station_id && strcmp(csid, rpd->ppp->ctrl->calling_station_id))
+ continue;
+ pthread_mutex_lock(&rpd->lock);
+ pthread_rwlock_unlock(&sessions_lock);
+ return rpd;
+ }
+ pthread_rwlock_unlock(&sessions_lock);
+ return NULL;
+}
+
+struct radius_pd_t *rad_find_session_pack(struct rad_packet_t *pack)
+{
+ struct rad_attr_t *attr;
+ const char *sessionid = NULL;
+ const char *username = NULL;
+ const char *csid = NULL;
+ int port_id = -1;
+ in_addr_t ipaddr = 0;
+
+ list_for_each_entry(attr, &pack->attrs, entry) {
+ if (!strcmp(attr->attr->name, "Acct-Session-Id"))
+ sessionid = attr->val.string;
+ else if (!strcmp(attr->attr->name, "User-Name"))
+ username = attr->val.string;
+ else if (!strcmp(attr->attr->name, "NAS-Port"))
+ port_id = attr->val.integer;
+ else if (!strcmp(attr->attr->name, "Framed-IP-Address"))
+ ipaddr = attr->val.ipaddr;
+ else if (!strcmp(attr->attr->name, "Calling-Station-Id"))
+ csid = attr->val.string;
+ }
+
+ if (!sessionid && !username && port_id == -1 && ipaddr == 0 && !csid)
+ return NULL;
+
+ if (username && !sessionid)
+ return NULL;
+
+ return rad_find_session(sessionid, username, port_id, ipaddr, csid);
+}
+
+int rad_check_nas_pack(struct rad_packet_t *pack)
+{
+ struct rad_attr_t *attr;
+ const char *ident = NULL;
+ in_addr_t ipaddr = 0;
+
+ list_for_each_entry(attr, &pack->attrs, entry) {
+ if (!strcmp(attr->attr->name, "NAS-Identifier"))
+ ident = attr->val.string;
+ else if (!strcmp(attr->attr->name, "NAS-IP-Address"))
+ ipaddr = attr->val.ipaddr;
+ }
+
+ if (conf_nas_identifier && (!ident || strcmp(conf_nas_identifier, ident)))
+ return -1;
+ if (conf_nas_ip_address && inet_addr(conf_nas_ip_address) != ipaddr)
+ return -1;
+
+ return 0;
+}
+
+static struct ipdb_t ipdb = {
+ .get = get_ip,
+};
+
+static struct pwdb_t pwdb = {
+ .check = check,
+};
+
+static int parse_server(const char *opt, char **name, int *port, char **secret)
+{
+ char *str = _strdup(opt);
+ char *p1, *p2;
+
+ p1 = strstr(str, ":");
+ p2 = strstr(str, ",");
+
+ if (p1)
+ *p1 = 0;
+ if (p2)
+ *p2 = 0;
+ else
+ return -1;
+
+ *name = str;
+ if (p1) {
+ *port = atoi(p1 + 1);
+ if (*port <=0 )
+ return -1;
+ }
+ *secret = p2 + 1;
+
+ return 0;
+}
+
+static void __init radius_init(void)
+{
+ char *opt;
+ char *dict = DICT_PATH;
+
+ rpd_pool = mempool_create(sizeof(struct radius_pd_t));
+
+ opt = conf_get_opt("radius", "max-try");
+ if (opt && atoi(opt) > 0)
+ conf_max_try = atoi(opt);
+
+ opt = conf_get_opt("radius", "timeout");
+ if (opt && atoi(opt) > 0)
+ conf_timeout = atoi(opt);
+
+ opt = conf_get_opt("radius", "verbose");
+ if (opt && atoi(opt) > 0)
+ conf_verbose = 1;
+
+ opt = conf_get_opt("radius", "nas-ip-address");
+ if (opt)
+ conf_nas_ip_address = opt;
+
+ opt = conf_get_opt("radius", "nas-identifier");
+ if (opt)
+ conf_nas_identifier = opt;
+
+ opt = conf_get_opt("radius", "gw-ip-address");
+ if (opt)
+ conf_gw_ip_address = opt;
+
+ opt = conf_get_opt("radius", "auth_server");
+ if (!opt) {
+ 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_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_emerg("radius: failed to parse acct_server\n");
+ _exit(EXIT_FAILURE);
+ }
+
+ opt = conf_get_opt("radius", "dm_coa_secret");
+ if (opt)
+ conf_dm_coa_secret = opt;
+
+ opt = conf_get_opt("radius", "dictionary");
+ if (opt)
+ dict = opt;
+
+ if (rad_dict_load(dict))
+ _exit(EXIT_FAILURE);
+
+ pwdb_register(&pwdb);
+ ipdb_register(&ipdb);
+
+ triton_event_register_handler(EV_PPP_STARTING, (triton_event_func)ppp_starting);
+ triton_event_register_handler(EV_PPP_STARTED, (triton_event_func)ppp_started);
+ triton_event_register_handler(EV_PPP_FINISHING, (triton_event_func)ppp_finishing);
+ triton_event_register_handler(EV_PPP_FINISHED, (triton_event_func)ppp_finished);
+}
diff --git a/accel-pptpd/radius/radius.h b/accel-pptpd/radius/radius.h
new file mode 100644
index 0000000..e202e26
--- /dev/null
+++ b/accel-pptpd/radius/radius.h
@@ -0,0 +1,107 @@
+#ifndef __RADIUS_H
+#define __RADIUS_H
+
+#include <stdint.h>
+
+#define REQ_LENGTH_MAX 4096
+
+#define ATTR_TYPE_INTEGER 0
+#define ATTR_TYPE_STRING 1
+#define ATTR_TYPE_OCTETS 2
+#define ATTR_TYPE_DATE 3
+#define ATTR_TYPE_IPADDR 4
+
+#define CODE_ACCESS_REQUEST 1
+#define CODE_ACCESS_ACCEPT 2
+#define CODE_ACCESS_REJECT 3
+#define CODE_ACCESS_CHALLENGE 11
+
+#define CODE_ACCOUNTING_REQUEST 4
+#define CODE_ACCOUNTING_RESPONSE 5
+
+#define CODE_DISCONNECT_REQUEST 40
+#define CODE_DISCONNECT_ACK 41
+#define CODE_DISCONNECT_NAK 42
+#define CODE_COA_REQUEST 43
+#define CODE_COA_ACK 44
+#define CODE_COA_NAK 45
+
+typedef union
+{
+ int integer;
+ char *string;
+ uint8_t *octets;
+ time_t date;
+ in_addr_t ipaddr;
+} rad_value_t;
+
+struct rad_dict_t
+{
+ struct list_head items;
+ struct list_head vendors;
+};
+
+struct rad_dict_vendor_t
+{
+ struct list_head entry;
+ int id;
+ const char *name;
+ struct list_head items;
+};
+
+struct rad_dict_value_t
+{
+ struct list_head entry;
+ rad_value_t val;
+ const char *name;
+};
+
+struct rad_dict_attr_t
+{
+ struct list_head entry;
+ const char *name;
+ int id;
+ int type;
+ struct list_head values;
+};
+
+struct rad_attr_t
+{
+ struct list_head entry;
+ struct rad_dict_attr_t *attr;
+ struct rad_dict_vendor_t *vendor;
+ //struct rad_dict_value_t *val;
+ rad_value_t val;
+ int len;
+};
+
+struct rad_packet_t
+{
+ int code;
+ int id;
+ int len;
+ struct list_head attrs;
+ void *buf;
+};
+
+struct rad_dict_attr_t *rad_dict_find_attr(const char *name);
+struct rad_dict_attr_t *rad_dict_find_attr_id(struct rad_dict_vendor_t *vendor, int type);
+struct rad_dict_value_t *rad_dict_find_val_name(struct rad_dict_attr_t *, const char *name);
+struct rad_dict_value_t *rad_dict_find_val(struct rad_dict_attr_t *, rad_value_t val);
+struct rad_dict_vendor_t *rad_dict_find_vendor_name(const char *name);
+struct rad_dict_vendor_t *rad_dict_find_vendor_id(int id);
+struct rad_dict_attr_t *rad_dict_find_vendor_attr(struct rad_dict_vendor_t *vendor, const char *name);
+
+struct rad_attr_t *rad_packet_find_attr(struct rad_packet_t *pack, const char *name);
+int rad_packet_add_int(struct rad_packet_t *pack, const char *name, int val);
+int rad_packet_add_val(struct rad_packet_t *pack, const char *name, const char *val);
+int rad_packet_add_str(struct rad_packet_t *pack, const char *name, const char *val, int len);
+int rad_packet_add_octets(struct rad_packet_t *pack, const char *name, uint8_t *val, int len);
+int rad_packet_change_int(struct rad_packet_t *pack, const char *name, int val);
+int rad_packet_change_val(struct rad_packet_t *pack, const char *name, const char *val);
+int rad_packet_add_ipaddr(struct rad_packet_t *pack, const char *name, in_addr_t ipaddr);
+int rad_packet_add_vendor_octets(struct rad_packet_t *pack, const char *vendor_name, const char *name, const uint8_t *val, int len);
+struct rad_attr_t *rad_packet_find_vendor_attr(struct rad_packet_t *pack, const char *vendor_name, const char *name);
+
+#endif
+
diff --git a/accel-pptpd/radius/radius_p.h b/accel-pptpd/radius/radius_p.h
new file mode 100644
index 0000000..9537641
--- /dev/null
+++ b/accel-pptpd/radius/radius_p.h
@@ -0,0 +1,96 @@
+#ifndef __RADIUS_P_H
+#define __RADIUS_P_H
+
+#include <netinet/in.h>
+#include <pthread.h>
+
+#include "triton.h"
+#include "radius.h"
+#include "ppp.h"
+#include "ipdb.h"
+
+struct radius_pd_t
+{
+ struct list_head entry;
+ struct ppp_pd_t pd;
+ struct ppp_t *ppp;
+ pthread_mutex_t lock;
+
+ struct rad_req_t *acct_req;
+ struct triton_timer_t acct_interim_timer;
+ uint32_t acct_input_octets;
+ uint32_t acct_output_octets;
+ uint32_t acct_input_gigawords;
+ uint32_t acct_output_gigawords;
+
+ struct triton_timer_t session_timeout;
+
+ struct rad_packet_t *dm_coa_req;
+ struct sockaddr_in dm_coa_addr;
+
+ struct ipdb_item_t ipaddr;
+ int acct_interim_interval;
+};
+
+struct rad_req_t
+{
+ struct triton_context_t ctx;
+ struct triton_md_handler_t hnd;
+ struct triton_timer_t timeout;
+ uint8_t RA[16];
+ struct rad_packet_t *pack;
+ struct rad_packet_t *reply;
+ const char *server_name;
+ int server_port;
+
+ struct radius_pd_t *rpd;
+};
+
+extern int conf_max_try;
+extern int conf_timeout;
+extern int conf_verbose;
+extern char *conf_nas_identifier;
+extern char *conf_nas_ip_address;
+extern char *conf_gw_ip_address;
+extern char *conf_auth_server;
+extern char *conf_auth_secret;
+extern int conf_auth_server_port;
+extern char *conf_acct_server;
+extern char *conf_acct_secret;
+extern int conf_acct_server_port;
+extern char *conf_dm_coa_secret;
+
+int rad_check_nas_pack(struct rad_packet_t *pack);
+struct radius_pd_t *rad_find_session(const char *sessionid, const char *username, int port_id, in_addr_t ipaddr, const char *csid);
+struct radius_pd_t *rad_find_session_pack(struct rad_packet_t *pack);
+
+int rad_dict_load(const char *fname);
+void rad_dict_free(struct rad_dict_t *dict);
+
+struct rad_req_t *rad_req_alloc(struct radius_pd_t *rpd, int code, const char *username);
+int rad_req_acct_fill(struct rad_req_t *);
+void rad_req_free(struct rad_req_t *);
+int rad_req_send(struct rad_req_t *);
+int rad_req_wait(struct rad_req_t *, int);
+
+struct radius_pd_t *find_pd(struct ppp_t *ppp);
+void rad_proc_attrs(struct rad_req_t *req);
+
+int rad_auth_pap(struct radius_pd_t *rpd, const char *username, va_list args);
+int rad_auth_chap_md5(struct radius_pd_t *rpd, const char *username, va_list args);
+int rad_auth_mschap_v1(struct radius_pd_t *rpd, const char *username, va_list args);
+int rad_auth_mschap_v2(struct radius_pd_t *rpd, const char *username, va_list args);
+
+int rad_acct_start(struct radius_pd_t *rpd);
+void rad_acct_stop(struct radius_pd_t *rpd);
+
+struct rad_packet_t *rad_packet_alloc(int code);
+int rad_packet_build(struct rad_packet_t *pack, uint8_t *RA);
+struct rad_packet_t *rad_packet_recv(int fd, struct sockaddr_in *addr);
+void rad_packet_free(struct rad_packet_t *);
+void rad_packet_print(struct rad_packet_t *pack, void (*print)(const char *fmt, ...));
+int rad_packet_send(struct rad_packet_t *pck, int fd, struct sockaddr_in *addr);
+
+
+#endif
+
diff --git a/accel-pptpd/radius/req.c b/accel-pptpd/radius/req.c
new file mode 100644
index 0000000..f3f4138
--- /dev/null
+++ b/accel-pptpd/radius/req.c
@@ -0,0 +1,242 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sched.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "log.h"
+#include "radius_p.h"
+
+#include "memdebug.h"
+
+static int urandom_fd;
+
+static int rad_req_read(struct triton_md_handler_t *h);
+static void rad_req_timeout(struct triton_timer_t *t);
+
+struct rad_req_t *rad_req_alloc(struct radius_pd_t *rpd, int code, const char *username)
+{
+ struct rad_req_t *req = _malloc(sizeof(*req));
+
+ if (!req)
+ return NULL;
+
+ memset(req, 0, sizeof(*req));
+ req->rpd = rpd;
+ req->hnd.fd = -1;
+ req->ctx.before_switch = log_switch;
+
+ req->server_name = conf_auth_server;
+ req->server_port = conf_auth_server_port;
+
+ while (1) {
+ if (read(urandom_fd, req->RA, 16) != 16) {
+ if (errno == EINTR)
+ continue;
+ log_ppp_error("radius:req:read urandom: %s\n", strerror(errno));
+ goto out_err;
+ }
+ break;
+ }
+
+ req->pack = rad_packet_alloc(code);
+ if (!req->pack)
+ goto out_err;
+
+ if (rad_packet_add_str(req->pack, "User-Name", username, strlen(username)))
+ goto out_err;
+ if (conf_nas_identifier)
+ if (rad_packet_add_str(req->pack, "NAS-Identifier", conf_nas_identifier, strlen(conf_nas_identifier)))
+ goto out_err;
+ if (conf_nas_ip_address)
+ if (rad_packet_add_ipaddr(req->pack, "NAS-IP-Address", inet_addr(conf_nas_ip_address)))
+ goto out_err;
+ if (rad_packet_add_int(req->pack, "NAS-Port", rpd->ppp->unit_idx))
+ goto out_err;
+ if (rad_packet_add_val(req->pack, "NAS-Port-Type", "Virtual"))
+ goto out_err;
+ if (rad_packet_add_val(req->pack, "Service-Type", "Framed-User"))
+ goto out_err;
+ if (rad_packet_add_val(req->pack, "Framed-Protocol", "PPP"))
+ goto out_err;
+ if (rpd->ppp->ctrl->calling_station_id)
+ if (rad_packet_add_str(req->pack, "Calling-Station-Id", rpd->ppp->ctrl->calling_station_id, strlen(rpd->ppp->ctrl->calling_station_id)))
+ goto out_err;
+ if (rpd->ppp->ctrl->called_station_id)
+ if (rad_packet_add_str(req->pack, "Called-Station-Id", rpd->ppp->ctrl->called_station_id, strlen(rpd->ppp->ctrl->called_station_id)))
+ goto out_err;
+
+ return req;
+
+out_err:
+ rad_req_free(req);
+ return NULL;
+}
+
+int rad_req_acct_fill(struct rad_req_t *req)
+{
+ req->server_name = conf_acct_server;
+ req->server_port = conf_acct_server_port;
+
+ memset(req->RA, 0, sizeof(req->RA));
+
+ if (rad_packet_add_val(req->pack, "Acct-Authentic", "RADIUS"))
+ return -1;
+ if (rad_packet_add_val(req->pack, "Acct-Status-Type", "Start"))
+ return -1;
+ if (rad_packet_add_str(req->pack, "Acct-Session-Id", req->rpd->ppp->sessionid, PPP_SESSIONID_LEN))
+ return -1;
+ if (rad_packet_add_int(req->pack, "Acct-Session-Time", 0))
+ return -1;
+ if (rad_packet_add_int(req->pack, "Acct-Input-Octets", 0))
+ return -1;
+ if (rad_packet_add_int(req->pack, "Acct-Output-Octets", 0))
+ return -1;
+ if (rad_packet_add_int(req->pack, "Acct-Input-Packets", 0))
+ return -1;
+ if (rad_packet_add_int(req->pack, "Acct-Output-Packets", 0))
+ return -1;
+ if (rad_packet_add_int(req->pack, "Acct-Input-Gigawords", 0))
+ return -1;
+ if (rad_packet_add_int(req->pack, "Acct-Output-Gigawords", 0))
+ return -1;
+
+ return 0;
+}
+
+void rad_req_free(struct rad_req_t *req)
+{
+ if (req->hnd.fd >= 0 )
+ close(req->hnd.fd);
+ if (req->pack)
+ rad_packet_free(req->pack);
+ if (req->reply)
+ rad_packet_free(req->reply);
+ _free(req);
+}
+
+static int make_socket(struct rad_req_t *req)
+{
+ struct sockaddr_in addr;
+
+ req->hnd.fd = socket(PF_INET, SOCK_DGRAM, 0);
+ if (req->hnd.fd < 0) {
+ log_ppp_error("radius:socket: %s\n", strerror(errno));
+ return -1;
+ }
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+
+ if (conf_nas_ip_address) {
+ addr.sin_addr.s_addr = inet_addr(conf_nas_ip_address);
+ if (bind(req->hnd.fd, (struct sockaddr *) &addr, sizeof(addr))) {
+ log_ppp_error("radius:bind: %s\n", strerror(errno));
+ goto out_err;
+ }
+ }
+
+ addr.sin_addr.s_addr = inet_addr(req->server_name);
+ addr.sin_port = htons(req->server_port);
+
+ if (connect(req->hnd.fd, (struct sockaddr *) &addr, sizeof(addr))) {
+ log_ppp_error("radius:connect: %s\n", strerror(errno));
+ goto out_err;
+ }
+
+ if (fcntl(req->hnd.fd, F_SETFL, O_NONBLOCK)) {
+ log_ppp_error("radius: failed to set nonblocking mode: %s\n", strerror(errno));
+ goto out_err;
+ }
+
+ return 0;
+
+out_err:
+ close(req->hnd.fd);
+ req->hnd.fd = -1;
+ return -1;
+}
+
+int rad_req_send(struct rad_req_t *req)
+{
+ if (req->hnd.fd == -1 && make_socket(req))
+ return -1;
+
+ if (!req->pack->buf && rad_packet_build(req->pack, req->RA))
+ goto out_err;
+
+ if (conf_verbose) {
+ log_ppp_info("send ");
+ rad_packet_print(req->pack, log_ppp_info);
+ }
+
+ rad_packet_send(req->pack, req->hnd.fd, NULL);
+
+ return 0;
+
+out_err:
+ close(req->hnd.fd);
+ req->hnd.fd = -1;
+ return -1;
+}
+
+static void req_wakeup(struct rad_req_t *req)
+{
+ struct triton_context_t *ctx = req->rpd->ppp->ctrl->ctx;
+ triton_timer_del(&req->timeout);
+ triton_md_unregister_handler(&req->hnd);
+ triton_context_unregister(&req->ctx);
+ triton_context_wakeup(ctx);
+}
+static int rad_req_read(struct triton_md_handler_t *h)
+{
+ struct rad_req_t *req = container_of(h, typeof(*req), hnd);
+
+ req->reply = rad_packet_recv(h->fd, NULL);
+ req_wakeup(req);
+
+ return 0;
+}
+static void rad_req_timeout(struct triton_timer_t *t)
+{
+ struct rad_req_t *req = container_of(t, typeof(*req), timeout);
+
+ req_wakeup(req);
+}
+
+int rad_req_wait(struct rad_req_t *req, int timeout)
+{
+ req->hnd.read = rad_req_read;
+ req->timeout.expire = rad_req_timeout;
+
+ triton_context_register(&req->ctx, req->rpd->ppp);
+ triton_md_register_handler(&req->ctx, &req->hnd);
+ triton_md_enable_handler(&req->hnd, MD_MODE_READ);
+
+ req->timeout.period = timeout * 1000;
+ triton_timer_add(&req->ctx, &req->timeout, 0);
+
+ triton_context_wakeup(&req->ctx);
+
+ triton_context_schedule(req->rpd->ppp->ctrl->ctx);
+
+ if (conf_verbose && req->reply) {
+ log_ppp_info("recv ");
+ rad_packet_print(req->reply, log_ppp_info);
+ }
+ return 0;
+}
+
+void __init req_init(void)
+{
+ urandom_fd = open("/dev/urandom", O_RDONLY);
+ if (!urandom_fd) {
+ log_emerg("radius:req: open /dev/urandom: %s\n", strerror(errno));
+ _exit(EXIT_FAILURE);
+ }
+}
diff --git a/accel-pptpd/triton/CMakeLists.txt b/accel-pptpd/triton/CMakeLists.txt
new file mode 100644
index 0000000..3e5e068
--- /dev/null
+++ b/accel-pptpd/triton/CMakeLists.txt
@@ -0,0 +1,20 @@
+SET(sources_c
+ md.c
+ timer.c
+ triton.c
+ conf_file.c
+ loader.c
+ log.c
+ mempool.c
+ event.c
+)
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+
+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
+)
diff --git a/accel-pptpd/triton/conf_file.c b/accel-pptpd/triton/conf_file.c
new file mode 100644
index 0000000..6eb2e7a
--- /dev/null
+++ b/accel-pptpd/triton/conf_file.c
@@ -0,0 +1,187 @@
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "triton_p.h"
+
+#include "memdebug.h"
+
+struct sect_t
+{
+ struct list_head entry;
+
+ struct conf_sect_t *sect;
+};
+
+static LIST_HEAD(sections);
+
+static char* skip_space(char *str);
+static char* skip_word(char *str);
+
+static struct conf_sect_t *find_sect(const char *name);
+static struct conf_sect_t *create_sect(const char *name);
+static void sect_add_item(struct conf_sect_t *sect, const char *name, const char *val);
+static struct conf_option_t *find_item(struct conf_sect_t *, const char *name);
+
+int conf_load(const char *fname)
+{
+ char *buf,*str,*str2;
+ char *path0,*path;
+ int cur_line = 0;
+ static struct conf_sect_t *cur_sect = NULL;
+
+ FILE *f = fopen(fname, "r");
+ if (!f) {
+ perror("conf_file:open");
+ return -1;
+ }
+
+ buf = _malloc(1024);
+ path0 = _malloc(4096);
+ path = _malloc(4096);
+
+ getcwd(path0, 1024);
+
+ while(!feof(f)) {
+ if (!fgets(buf, 1024, f))
+ break;
+ ++cur_line;
+ if (buf[strlen(buf) - 1] == '\n')
+ buf[strlen(buf) - 1] = 0;
+
+ str = skip_space(buf);
+ if (*str == '#' || *str == 0)
+ continue;
+ if (strncmp(str, "$include", 8) == 0) {
+ str = skip_word(str);
+ str = skip_space(str);
+ conf_load(str);
+ continue;
+ }
+ if (*str == '[') {
+ for (str2 = ++str; *str2 && *str2 != ']'; str2++);
+ if (*str2 != ']') {
+ fprintf(stderr, "conf_file:%s:%i: sintax error\n", fname, cur_line);
+ return -1;
+ }
+ *str2 = 0;
+ cur_sect = find_sect(str);
+ if (!cur_sect)
+ cur_sect = create_sect(str);
+ continue;
+ }
+ if (!cur_sect) {
+ fprintf(stderr, "conf_file:%s:%i: no section opened\n", fname, cur_line);
+ return -1;
+ }
+ str2 = skip_word(str);
+ if (*str2 == ' ') {
+ *str2 = 0;
+ ++str2;
+ }
+ str2 = skip_space(str2);
+ if (*str2 == '=' || *str2 == ',') {
+ *str2 = 0;
+ str2 = skip_space(str2 + 1);
+ if (*str2 && *(str2 + 1) && *str2 == '$' && *(str2 + 1) == '{') {
+ char *s;
+ struct conf_option_t *opt;
+ for (s = str2+2; *s && *s != '}'; s++);
+ if (*s == '}') {
+ *s = 0;
+ str2 += 2;
+ }
+ opt = find_item(cur_sect, str2);
+ if (!opt) {
+ fprintf(stderr, "conf_file:%s:%i: parent option not found\n", fname, cur_line);
+ return -1;
+ }
+ str2 = opt->val;
+ }
+ } else
+ str2 = NULL;
+ sect_add_item(cur_sect, str, str2);
+ }
+
+ _free(buf);
+ _free(path);
+ _free(path0);
+ fclose(f);
+
+ return 0;
+}
+
+static char* skip_space(char *str)
+{
+ for (; *str && *str == ' '; str++);
+ return str;
+}
+static char* skip_word(char *str)
+{
+ for (; *str && (*str != ' ' && *str != '='); str++);
+ return str;
+}
+
+static struct conf_sect_t *find_sect(const char *name)
+{
+ struct sect_t *s;
+ list_for_each_entry(s, &sections, entry)
+ if (strcmp(s->sect->name, name) == 0) return s->sect;
+ return NULL;
+}
+
+static struct conf_sect_t *create_sect(const char *name)
+{
+ struct sect_t *s = _malloc(sizeof(struct sect_t));
+
+ s->sect = _malloc(sizeof(struct conf_sect_t));
+ s->sect->name = (char*)strdup(name);
+ INIT_LIST_HEAD(&s->sect->items);
+
+ list_add_tail(&s->entry, &sections);
+
+ return s->sect;
+}
+
+static void sect_add_item(struct conf_sect_t *sect, const char *name, const char *val)
+{
+ struct conf_option_t *opt = _malloc(sizeof(struct conf_option_t));
+
+ opt->name = _strdup(name);
+ opt->val = val ? _strdup(val) : NULL;
+
+ list_add_tail(&opt->entry, &sect->items);
+}
+
+static struct conf_option_t *find_item(struct conf_sect_t *sect, const char *name)
+{
+ struct conf_option_t *opt;
+ list_for_each_entry(opt, &sect->items, entry) {
+ if (strcmp(opt->name, name) == 0)
+ return opt;
+ }
+
+ return NULL;
+}
+
+__export struct conf_sect_t * conf_get_section(const char *name)
+{
+ return find_sect(name);
+}
+
+__export char * conf_get_opt(const char *sect, const char *name)
+{
+ struct conf_option_t *opt;
+ struct conf_sect_t *s = conf_get_section(sect);
+
+ if (!s)
+ return NULL;
+
+ opt = find_item(s, name);
+ if (!opt)
+ return NULL;
+
+ return opt->val;
+}
+
diff --git a/accel-pptpd/triton/event.c b/accel-pptpd/triton/event.c
new file mode 100644
index 0000000..d45eca0
--- /dev/null
+++ b/accel-pptpd/triton/event.c
@@ -0,0 +1,105 @@
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "triton_p.h"
+
+#include "memdebug.h"
+
+static int max_events = 1024;
+static struct _triton_event_t **events;
+
+struct event_handler_t
+{
+ struct list_head entry;
+ triton_event_func func;
+};
+
+int event_init(void)
+{
+ events = malloc(max_events * sizeof(void *));
+ if (!events) {
+ fprintf(stderr,"event:cann't allocate memory\n");
+ return -1;
+ }
+
+ memset(events, 0, max_events * sizeof(void *));
+
+ return 0;
+}
+
+int __export triton_event_register_handler(int ev_id, triton_event_func func)
+{
+ struct _triton_event_t *ev;
+ struct event_handler_t *h;
+
+ if (ev_id >= max_events)
+ return -1;
+
+ ev = events[ev_id];
+ if (!ev) {
+ ev = malloc(sizeof(*ev));
+ if (!ev) {
+ triton_log_error("event: out of memory\n");
+ return -1;
+ }
+ INIT_LIST_HEAD(&ev->handlers);
+ events[ev_id] = ev;
+ }
+
+ h = malloc(sizeof(*h));
+ if (!h) {
+ triton_log_error("event: out of memory\n");
+ return -1;
+ }
+
+ h->func = func;
+ list_add_tail(&h->entry, &ev->handlers);
+
+ return 0;
+}
+
+/*int triton_event_unregister_handler(int ev_id, triton_event_func func)
+{
+ struct _triton_event_t *ev;
+ struct event_handler_t *h;
+
+ if (ev_id >= max_events)
+ return -1;
+
+ ev = events[ev_id];
+ if (!ev) {
+ return -1;
+ }
+
+ list_for_each_entry(h, &ev->handlers, entry) {
+ if (h->func == func) {
+ if (ev->in_progress)
+ h->func = NULL;
+ else {
+ list_del(&h->entry);
+ _free(h);
+ }
+ return 0;
+ }
+ }
+
+ return -1;
+}*/
+
+void __export triton_event_fire(int ev_id, void *arg)
+{
+ struct _triton_event_t *ev;
+ struct event_handler_t *h;
+
+ if (ev_id >= max_events)
+ return;
+
+ ev = events[ev_id];
+ if (!ev)
+ return;
+
+ list_for_each_entry(h, &ev->handlers, entry)
+ h->func(arg);
+}
+
diff --git a/accel-pptpd/triton/list.h b/accel-pptpd/triton/list.h
new file mode 100644
index 0000000..d95dd71
--- /dev/null
+++ b/accel-pptpd/triton/list.h
@@ -0,0 +1,249 @@
+#ifndef _LINUX_LIST_H
+#define _LINUX_LIST_H
+
+//#if defined(__KERNEL__) || defined(_LVM_H_INCLUDE)
+
+//#include <linux/prefetch.h>
+
+/*
+ * Simple doubly linked list implementation.
+ *
+ * Some of the internal functions ("__xxx") are useful when
+ * manipulating whole lists rather than single entries, as
+ * sometimes we already know the next/prev entries and we can
+ * generate better code by using them directly rather than
+ * using the generic single-entry routines.
+ */
+
+typedef struct list_head {
+ struct list_head *next, *prev;
+} list_t;
+
+#define LIST_HEAD_INIT(name) { &(name), &(name) }
+
+#define LIST_HEAD(name) \
+ struct list_head name = LIST_HEAD_INIT(name)
+
+#define INIT_LIST_HEAD(ptr) do { \
+ (ptr)->next = (ptr); (ptr)->prev = (ptr); \
+} while (0)
+
+/*
+ * Insert a new entry between two known consecutive entries.
+ *
+ * This is only for internal list manipulation where we know
+ * the prev/next entries already!
+ */
+
+static void inline prefetch(void *p){}
+
+static inline void __list_add(struct list_head *new,
+ struct list_head *prev,
+ struct list_head *next)
+{
+ next->prev = new;
+ new->next = next;
+ new->prev = prev;
+ prev->next = new;
+}
+
+/**
+ * list_add - add a new entry
+ * @new: new entry to be added
+ * @head: list head to add it after
+ *
+ * Insert a new entry after the specified head.
+ * This is good for implementing stacks.
+ */
+static inline void list_add(struct list_head *new, struct list_head *head)
+{
+ __list_add(new, head, head->next);
+}
+
+/**
+ * list_add_tail - add a new entry
+ * @new: new entry to be added
+ * @head: list head to add it before
+ *
+ * Insert a new entry before the specified head.
+ * This is useful for implementing queues.
+ */
+static inline void list_add_tail(struct list_head *new, struct list_head *head)
+{
+ __list_add(new, head->prev, head);
+}
+
+/*
+ * Delete a list entry by making the prev/next entries
+ * point to each other.
+ *
+ * This is only for internal list manipulation where we know
+ * the prev/next entries already!
+ */
+static inline void __list_del(struct list_head *prev, struct list_head *next)
+{
+ next->prev = prev;
+ prev->next = next;
+}
+
+/**
+ * list_del - deletes entry from list.
+ * @entry: the element to delete from the list.
+ * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
+ */
+static inline void list_del(struct list_head *entry)
+{
+ __list_del(entry->prev, entry->next);
+ entry->next = (void *) 0;
+ entry->prev = (void *) 0;
+}
+
+/**
+ * list_del_init - deletes entry from list and reinitialize it.
+ * @entry: the element to delete from the list.
+ */
+static inline void list_del_init(struct list_head *entry)
+{
+ __list_del(entry->prev, entry->next);
+ INIT_LIST_HEAD(entry);
+}
+
+/**
+ * list_move - delete from one list and add as another's head
+ * @list: the entry to move
+ * @head: the head that will precede our entry
+ */
+static inline void list_move(struct list_head *list, struct list_head *head)
+{
+ __list_del(list->prev, list->next);
+ list_add(list, head);
+}
+
+/**
+ * list_move_tail - delete from one list and add as another's tail
+ * @list: the entry to move
+ * @head: the head that will follow our entry
+ */
+static inline void list_move_tail(struct list_head *list,
+ struct list_head *head)
+{
+ __list_del(list->prev, list->next);
+ list_add_tail(list, head);
+}
+
+/**
+ * list_empty - tests whether a list is empty
+ * @head: the list to test.
+ */
+static inline int list_empty(struct list_head *head)
+{
+ return head->next == head;
+}
+
+static inline void __list_splice(struct list_head *list,
+ struct list_head *head)
+{
+ struct list_head *first = list->next;
+ struct list_head *last = list->prev;
+ struct list_head *at = head->next;
+
+ first->prev = head;
+ head->next = first;
+
+ last->next = at;
+ at->prev = last;
+}
+
+/**
+ * list_splice - join two lists
+ * @list: the new list to add.
+ * @head: the place to add it in the first list.
+ */
+static inline void list_splice(struct list_head *list, struct list_head *head)
+{
+ if (!list_empty(list))
+ __list_splice(list, head);
+}
+
+/**
+ * list_splice_init - join two lists and reinitialise the emptied list.
+ * @list: the new list to add.
+ * @head: the place to add it in the first list.
+ *
+ * The list at @list is reinitialised
+ */
+static inline void list_splice_init(struct list_head *list,
+ struct list_head *head)
+{
+ if (!list_empty(list)) {
+ __list_splice(list, head);
+ INIT_LIST_HEAD(list);
+ }
+}
+
+/**
+ * list_entry - get the struct for this entry
+ * @ptr: the &struct list_head pointer.
+ * @type: the type of the struct this is embedded in.
+ * @member: the name of the list_struct within the struct.
+ */
+#define list_entry(ptr, type, member) \
+ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+
+/**
+ * list_for_each - iterate over a list
+ * @pos: the &struct list_head to use as a loop counter.
+ * @head: the head for your list.
+ */
+#define list_for_each(pos, head) \
+ for (pos = (head)->next, prefetch(pos->next); pos != (head); \
+ pos = pos->next, prefetch(pos->next))
+
+/**
+ * __list_for_each - iterate over a list
+ * @pos: the &struct list_head to use as a loop counter.
+ * @head: the head for your list.
+ *
+ * This variant differs from list_for_each() in that it's the
+ * simplest possible list iteration code, no prefetching is done.
+ * Use this for code that knows the list to be very short (empty
+ * or 1 entry) most of the time.
+ */
+#define __list_for_each(pos, head) \
+ for (pos = (head)->next; pos != (head); pos = pos->next)
+
+/**
+ * list_for_each_prev - iterate over a list backwards
+ * @pos: the &struct list_head to use as a loop counter.
+ * @head: the head for your list.
+ */
+#define list_for_each_prev(pos, head) \
+ for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
+ pos = pos->prev, prefetch(pos->prev))
+
+/**
+ * list_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos: the &struct list_head to use as a loop counter.
+ * @n: another &struct list_head to use as temporary storage
+ * @head: the head for your list.
+ */
+#define list_for_each_safe(pos, n, head) \
+ for (pos = (head)->next, n = pos->next; pos != (head); \
+ pos = n, n = pos->next)
+
+/**
+ * list_for_each_entry - iterate over list of given type
+ * @pos: the type * to use as a loop counter.
+ * @head: the head for your list.
+ * @member: the name of the list_struct within the struct.
+ */
+#define list_for_each_entry(pos, head, member) \
+ for (pos = list_entry((head)->next, typeof(*pos), member), \
+ prefetch(pos->member.next); \
+ &pos->member != (head); \
+ pos = list_entry(pos->member.next, typeof(*pos), member), \
+ prefetch(pos->member.next))
+
+//#endif /* __KERNEL__ || _LVM_H_INCLUDE */
+
+#endif
diff --git a/accel-pptpd/triton/loader.c b/accel-pptpd/triton/loader.c
new file mode 100644
index 0000000..b6c1914
--- /dev/null
+++ b/accel-pptpd/triton/loader.c
@@ -0,0 +1,62 @@
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <dlfcn.h>
+#include <limits.h>
+
+#include "triton_p.h"
+
+#include "memdebug.h"
+
+int load_modules(const char *name)
+{
+ struct conf_sect_t *sect;
+ struct conf_option_t *opt;
+ char *fname;
+ char *path = MODULE_PATH;
+
+ sect = conf_get_section(name);
+ if (!sect) {
+ fprintf(stderr, "loader: section '%s' not found\n", name);
+ return -1;
+ }
+
+ fname = _malloc(PATH_MAX);
+
+ list_for_each_entry(opt, &sect->items, entry) {
+ if (!strcmp(opt->name,"path") && opt->val) {
+ path = opt->val;
+ continue;
+ }
+
+ strcpy(fname, path);
+ strcat(fname, "/");
+ strcat(fname, opt->name);
+ if (access(fname, F_OK)) {
+ strcpy(fname, path);
+ strcat(fname, "/lib");
+ strcat(fname, opt->name);
+ strcat(fname, ".so");
+ if (access(fname, F_OK)) {
+ strcpy(fname, opt->name);
+ if (access(opt->name, F_OK)) {
+ triton_log_error("loader: '%s' not found\n", opt->name);
+ continue;
+ }
+ }
+ }
+
+ if (!dlopen(fname, RTLD_NOW | RTLD_GLOBAL)) {
+ triton_log_error("loader: failed to load '%s': %s\n", opt->name, dlerror());
+ _free(fname);
+ return -1;
+ }
+ }
+
+ _free(fname);
+
+ return 0;
+}
+
diff --git a/accel-pptpd/triton/log.c b/accel-pptpd/triton/log.c
new file mode 100644
index 0000000..c7e6b7f
--- /dev/null
+++ b/accel-pptpd/triton/log.c
@@ -0,0 +1,73 @@
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "triton_p.h"
+
+#include "memdebug.h"
+
+static FILE *f_error;
+static FILE *f_debug;
+static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
+
+int log_init(void)
+{
+ char *log_error = conf_get_opt("core","log-error");
+ char *log_debug = conf_get_opt("core","log-debug");
+
+ if (log_error) {
+ f_error = fopen(log_error, "a");
+ if (!f_error) {
+ perror("log:log_error:open");
+ return -1;
+ }
+ }
+ if (log_debug) {
+ f_debug = fopen(log_debug, "a");
+ if (!f_debug) {
+ perror("log:log_debug:open");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+static void do_log(FILE *f, const char *fmt, va_list ap)
+{
+ struct timeval tv;
+ struct tm tm;
+ char date[64];
+
+ gettimeofday(&tv, NULL);
+ localtime_r(&tv.tv_sec, &tm);
+ strftime(date, sizeof(date), "%F %H:%M:%S", &tm);
+
+ pthread_mutex_lock(&lock);
+ 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,...)
+{
+ va_list ap;
+
+ if (!f_error)
+ return;
+
+ va_start(ap, fmt);
+ do_log(f_error, fmt, ap);
+}
+
+void triton_log_debug(const char *fmt,...)
+{
+ va_list ap;
+
+ if (!f_debug)
+ return;
+
+ va_start(ap, fmt);
+ do_log(f_debug, fmt, ap);
+}
+
diff --git a/accel-pptpd/triton/md.c b/accel-pptpd/triton/md.c
new file mode 100644
index 0000000..444aebf
--- /dev/null
+++ b/accel-pptpd/triton/md.c
@@ -0,0 +1,188 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#include <signal.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "triton_p.h"
+
+#include "memdebug.h"
+
+extern int max_events;
+
+static int epoll_fd;
+static struct epoll_event *epoll_events;
+
+static pthread_t md_thr;
+static void *md_thread(void *arg);
+
+static mempool_t *md_pool;
+
+int md_init(void)
+{
+ epoll_fd = epoll_create(1);
+ if (epoll_fd < 0) {
+ perror("md:epoll_create");
+ return -1;
+ }
+
+ epoll_events = _malloc(max_events * sizeof(struct epoll_event));
+ if (!epoll_events) {
+ fprintf(stderr,"md:cann't allocate memory\n");
+ return -1;
+ }
+
+ md_pool = mempool_create(sizeof(struct _triton_md_handler_t));
+
+ return 0;
+}
+void md_run(void)
+{
+ if (pthread_create(&md_thr, NULL, md_thread, NULL)) {
+ triton_log_error("md:pthread_create: %s", strerror(errno));
+ _exit(-1);
+ }
+}
+
+void md_terminate(void)
+{
+ pthread_cancel(md_thr);
+ pthread_join(md_thr, NULL);
+}
+
+static void *md_thread(void *arg)
+{
+ int i,n,r;
+ struct _triton_md_handler_t *h;
+ sigset_t set;
+
+ sigfillset(&set);
+ sigdelset(&set, SIGKILL);
+ sigdelset(&set, SIGSTOP);
+ pthread_sigmask(SIG_BLOCK, &set, NULL);
+
+ while(1) {
+ n = epoll_wait(epoll_fd, epoll_events, max_events, -1);
+ if (n < 0) {
+ if (errno == EINTR)
+ continue;
+ triton_log_error("md:epoll_wait: %s\n", strerror(errno));
+ _exit(-1);
+ }
+
+ for(i = 0; i < n; i++) {
+ h = (struct _triton_md_handler_t *)epoll_events[i].data.ptr;
+ spin_lock(&h->ctx->lock);
+ if (h->ud) {
+ h->trig_epoll_events |= epoll_events[i].events;
+ if (!h->pending) {
+ list_add_tail(&h->entry2, &h->ctx->pending_handlers);
+ h->pending = 1;
+ r = triton_queue_ctx(h->ctx);
+ } else
+ r = 0;
+ } else
+ r = 0;
+ spin_unlock(&h->ctx->lock);
+ if (r)
+ triton_thread_wakeup(h->ctx->thread);
+ }
+ }
+
+ return NULL;
+}
+
+void __export triton_md_register_handler(struct triton_context_t *ctx, struct triton_md_handler_t *ud)
+{
+ struct _triton_md_handler_t *h = mempool_alloc(md_pool);
+ memset(h, 0, sizeof(*h));
+ h->ud = ud;
+ h->epoll_event.data.ptr = h;
+ if (ctx)
+ h->ctx = (struct _triton_context_t *)ctx->tpd;
+ else
+ h->ctx = (struct _triton_context_t *)default_ctx->tpd;
+ ud->tpd = h;
+ spin_lock(&h->ctx->lock);
+ list_add_tail(&h->entry, &h->ctx->handlers);
+ spin_unlock(&h->ctx->lock);
+
+ __sync_fetch_and_add(&triton_stat.md_handler_count, 1);
+}
+void __export triton_md_unregister_handler(struct triton_md_handler_t *ud)
+{
+ struct _triton_md_handler_t *h = (struct _triton_md_handler_t *)ud->tpd;
+ triton_md_disable_handler(ud, MD_MODE_READ | MD_MODE_WRITE);
+ spin_lock(&h->ctx->lock);
+ list_del(&h->entry);
+ if (h->pending)
+ list_del(&h->entry2);
+ h->ud = NULL;
+ spin_unlock(&h->ctx->lock);
+ sched_yield();
+ mempool_free(h);
+
+ __sync_fetch_and_sub(&triton_stat.md_handler_count, 1);
+}
+int __export triton_md_enable_handler(struct triton_md_handler_t *ud, int mode)
+{
+ struct _triton_md_handler_t *h = (struct _triton_md_handler_t *)ud->tpd;
+ int r;
+ int events = h->epoll_event.events;
+
+ if (mode & MD_MODE_READ)
+ h->epoll_event.events |= EPOLLIN;
+ if (mode & MD_MODE_WRITE)
+ h->epoll_event.events |= EPOLLOUT;
+
+ if (!h->trig_level)
+ h->epoll_event.events |= EPOLLET;
+
+ if (events)
+ r = epoll_ctl(epoll_fd, EPOLL_CTL_MOD, h->ud->fd, &h->epoll_event);
+ else
+ r = epoll_ctl(epoll_fd, EPOLL_CTL_ADD, h->ud->fd, &h->epoll_event);
+
+ if (r) {
+ triton_log_error("md:epoll_ctl: %s\n",strerror(errno));
+ abort();
+ }
+
+ return r;
+}
+int __export triton_md_disable_handler(struct triton_md_handler_t *ud,int mode)
+{
+ struct _triton_md_handler_t *h = (struct _triton_md_handler_t *)ud->tpd;
+ int r=0;
+
+ if (!h->epoll_event.events)
+ return -1;
+
+ if (mode & MD_MODE_READ)
+ h->epoll_event.events &= ~EPOLLIN;
+ if (mode & MD_MODE_WRITE)
+ h->epoll_event.events &= ~EPOLLOUT;
+
+ if (h->epoll_event.events & (EPOLLIN | EPOLLOUT))
+ r = epoll_ctl(epoll_fd, EPOLL_CTL_MOD, h->ud->fd, &h->epoll_event);
+ else {
+ h->epoll_event.events = 0;
+ r = epoll_ctl(epoll_fd, EPOLL_CTL_DEL, h->ud->fd, NULL);
+ }
+
+ if (r) {
+ triton_log_error("md:epoll_ctl: %s\n",strerror(errno));
+ abort();
+ }
+
+ return r;
+}
+
+void __export triton_md_set_trig(struct triton_md_handler_t *ud, int mode)
+{
+ struct _triton_md_handler_t *h = (struct _triton_md_handler_t *)ud->tpd;
+ h->trig_level = mode;
+}
+
diff --git a/accel-pptpd/triton/mempool.c b/accel-pptpd/triton/mempool.c
new file mode 100644
index 0000000..c96c3ba
--- /dev/null
+++ b/accel-pptpd/triton/mempool.c
@@ -0,0 +1,179 @@
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+
+#include "triton_p.h"
+
+#include "memdebug.h"
+
+#define MAGIC1 0x2233445566778899llu
+
+struct _mempool_t
+{
+ struct list_head entry;
+ int size;
+ struct list_head items;
+ spinlock_t lock;
+ uint64_t magic;
+};
+
+struct _item_t
+{
+ struct _mempool_t *owner;
+ struct list_head entry;
+ uint64_t magic2;
+ uint64_t magic1;
+ char ptr[0];
+};
+
+static LIST_HEAD(pools);
+static spinlock_t pools_lock = SPINLOCK_INITIALIZER;
+
+__export mempool_t *mempool_create(int size)
+{
+ struct _mempool_t *p = _malloc(sizeof(*p));
+
+ memset(p, 0, sizeof(*p));
+ INIT_LIST_HEAD(&p->items);
+ spinlock_init(&p->lock);
+ p->size = size;
+ p->magic = (uint64_t)random() * (uint64_t)random();
+
+ spin_lock(&pools_lock);
+ list_add_tail(&p->entry, &pools);
+ spin_unlock(&pools_lock);
+
+ return (mempool_t *)p;
+}
+
+#ifndef MEMDEBUG
+__export void *mempool_alloc(mempool_t *pool)
+{
+ struct _mempool_t *p = (struct _mempool_t *)pool;
+ struct _item_t *it;
+ uint32_t size = sizeof(*it) + p->size + 8;
+
+ spin_lock(&p->lock);
+ if (!list_empty(&p->items)) {
+ it = list_entry(p->items.next, typeof(*it), entry);
+ list_del(&it->entry);
+ spin_unlock(&p->lock);
+
+ __sync_fetch_and_sub(&triton_stat.mempool_available, size);
+
+ it->magic1 = MAGIC1;
+
+ return it->ptr;
+ }
+ spin_unlock(&p->lock);
+
+ it = _malloc(size);
+ if (!it) {
+ triton_log_error("mempool: out of memory\n");
+ return NULL;
+ }
+ it->owner = p;
+ it->magic1 = MAGIC1;
+ it->magic2 = p->magic;
+ *(uint64_t*)(it->data + p->size) = it->magic2;
+
+ __sync_fetch_and_add(&triton_stat.mempool_allocated, size);
+
+ return it->ptr;
+}
+#endif
+
+void __export *mempool_alloc_md(mempool_t *pool, const char *fname, int line)
+{
+ struct _mempool_t *p = (struct _mempool_t *)pool;
+ struct _item_t *it;
+ uint32_t size = sizeof(*it) + p->size + 8;
+
+ spin_lock(&p->lock);
+ if (!list_empty(&p->items)) {
+ it = list_entry(p->items.next, typeof(*it), entry);
+ list_del(&it->entry);
+ spin_unlock(&p->lock);
+
+ __sync_fetch_and_sub(&triton_stat.mempool_available, size);
+
+ it->magic1 = MAGIC1;
+
+ return it->ptr;
+ }
+ spin_unlock(&p->lock);
+
+ it = md_malloc(size, fname, line);
+ if (!it) {
+ triton_log_error("mempool: out of memory\n");
+ return NULL;
+ }
+ it->owner = p;
+ it->magic2 = p->magic;
+ it->magic1 = MAGIC1;
+ *(uint64_t*)(it->ptr + p->size) = it->magic2;
+
+ __sync_fetch_and_add(&triton_stat.mempool_allocated, size);
+
+ return it->ptr;
+}
+
+
+__export void mempool_free(void *ptr)
+{
+ struct _item_t *it = container_of(ptr, typeof(*it), ptr);
+ uint32_t size = sizeof(*it) + it->owner->size + 8;
+
+ if (it->magic1 != MAGIC1) {
+ triton_log_error("mempool: memory corruption detected");
+ abort();
+ }
+
+ if (it->magic2 != it->owner->magic) {
+ triton_log_error("mempool: memory corruption detected");
+ abort();
+ }
+
+ if (it->magic2 != *(uint64_t*)(it->ptr + it->owner->size)) {
+ triton_log_error("mempool: memory corruption detected");
+ abort();
+ }
+
+ it->magic1 = 0;
+
+ spin_lock(&it->owner->lock);
+ list_add_tail(&it->entry,&it->owner->items);
+ spin_unlock(&it->owner->lock);
+
+ __sync_fetch_and_add(&triton_stat.mempool_available, size);
+}
+
+void sigclean(int num)
+{
+ struct _mempool_t *p;
+ struct _item_t *it;
+ uint32_t size;
+
+ triton_log_error("mempool: clean\n");
+
+ spin_lock(&pools_lock);
+ list_for_each_entry(p, &pools, entry) {
+ size = sizeof(*it) + p->size;
+ spin_lock(&p->lock);
+ while (!list_empty(&p->items)) {
+ it = list_entry(p->items.next, typeof(*it), entry);
+ list_del(&it->entry);
+ _free(it);
+ __sync_fetch_and_sub(&triton_stat.mempool_allocated, size);
+ __sync_fetch_and_sub(&triton_stat.mempool_available, size);
+ }
+ spin_unlock(&p->lock);
+ }
+ spin_unlock(&pools_lock);
+}
+
+static void __init init(void)
+{
+ signal(35, sigclean);
+}
diff --git a/accel-pptpd/triton/mempool.h b/accel-pptpd/triton/mempool.h
new file mode 100644
index 0000000..d353921
--- /dev/null
+++ b/accel-pptpd/triton/mempool.h
@@ -0,0 +1,25 @@
+#ifndef __TRITON_MEMPOOL_H
+#define __TRITON_MEMPOOL_H
+
+#include <stdint.h>
+
+struct mempool_stat_t
+{
+ uint32_t allocated;
+ uint32_t available;
+};
+
+typedef void * mempool_t;
+mempool_t *mempool_create(int size);
+void mempool_free(void*);
+struct mempool_stat_t mempool_get_stat(void);
+
+#ifdef MEMDEBUG
+void *mempool_alloc_md(mempool_t*, const char *fname, int line);
+#define mempool_alloc(pool) mempool_alloc_md(pool, __FILE__, __LINE__)
+#else
+void *mempool_alloc(mempool_t*);
+#endif
+
+#endif
+
diff --git a/accel-pptpd/triton/options.c b/accel-pptpd/triton/options.c
new file mode 100644
index 0000000..a5214e2
--- /dev/null
+++ b/accel-pptpd/triton/options.c
@@ -0,0 +1,48 @@
+#include <stdlib.h>
+#include <string.h>
+
+#include "triton_p.h"
+#include "conf_file.h"
+
+#include "memdebug.h"
+
+static struct conf_file_sect_t *sect=NULL;
+
+static const char* find_option(const char *name)
+{
+ struct option_t *opt;
+
+ if (!sect)
+ {
+ sect=conf_file_get_section("options");
+ if (!sect) return 0;
+ }
+
+ list_for_each_entry(opt,&sect->items,entry)
+ {
+ if (strcmp(opt->name,name)==0)
+ return opt->val;
+ }
+
+ return NULL;
+}
+int triton_get_int_option(const char *str)
+{
+ const char *val=find_option(str);
+ if (!val) return 0;
+
+ return atoi(val);
+}
+const char* triton_get_str_option(const char *str)
+{
+ const char *val=find_option(str);
+
+ return val;
+}
+double triton_get_double_option(const char *str)
+{
+ const char *val=find_option(str);
+ if (!val) return 0;
+
+ return atof(val);
+}
diff --git a/accel-pptpd/triton/spinlock.h b/accel-pptpd/triton/spinlock.h
new file mode 100644
index 0000000..b13cde6
--- /dev/null
+++ b/accel-pptpd/triton/spinlock.h
@@ -0,0 +1,20 @@
+#ifndef __TRITON_SPINLOCK_H
+#define __TRITON_SPINLOCK_H
+
+#ifdef GCC_SPINLOCK
+typedef volatile unsigned char spinlock_t;
+#define spin_lock(l) {while(__sync_lock_test_and_set(l,1));}
+#define spin_unlock(l) __sync_lock_release(l)
+#define SPINLOCK_INITIALIZER 0
+#define spinlock_init(l) {*(l)=0;}
+#else
+#include <pthread.h>
+typedef pthread_mutex_t spinlock_t;
+#define spin_lock(l) pthread_mutex_lock(l)
+#define spin_unlock(l) pthread_mutex_unlock(l)
+#define SPINLOCK_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+#define spinlock_init(l) pthread_mutex_init(l,NULL)
+#endif
+
+#endif
+
diff --git a/accel-pptpd/triton/timer.c b/accel-pptpd/triton/timer.c
new file mode 100644
index 0000000..cbf2b13
--- /dev/null
+++ b/accel-pptpd/triton/timer.c
@@ -0,0 +1,181 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#include <sys/epoll.h>
+#include <sys/timerfd.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "triton_p.h"
+
+#include "memdebug.h"
+
+extern int max_events;
+static int epoll_fd;
+static struct epoll_event *epoll_events;
+
+static pthread_t timer_thr;
+static void *timer_thread(void *arg);
+
+static mempool_t *timer_pool;
+
+int timer_init(void)
+{
+ epoll_fd = epoll_create(1);
+ if (epoll_fd < 0) {
+ perror("timer:epoll_create");
+ return -1;
+ }
+
+ epoll_events = _malloc(max_events * sizeof(struct epoll_event));
+ if (!epoll_events) {
+ fprintf(stderr,"timer:cann't allocate memory\n");
+ return -1;
+ }
+
+ timer_pool = mempool_create(sizeof(struct _triton_timer_t));
+
+ return 0;
+}
+
+void timer_run(void)
+{
+ if (pthread_create(&timer_thr, NULL, timer_thread, NULL)) {
+ triton_log_error("timer:pthread_create: %s",strerror(errno));
+ _exit(-1);
+ }
+}
+
+void timer_terminate(void)
+{
+ pthread_cancel(timer_thr);
+ pthread_join(timer_thr, NULL);
+}
+
+void *timer_thread(void *arg)
+{
+ int i,n,r;
+ struct _triton_timer_t *t;
+ sigset_t set;
+
+ sigfillset(&set);
+ sigdelset(&set, SIGKILL);
+ sigdelset(&set, SIGSTOP);
+ pthread_sigmask(SIG_BLOCK, &set, NULL);
+
+ while(1) {
+ n = epoll_wait(epoll_fd, epoll_events, max_events, -1);
+ if (n < 0) {
+ if (errno == EINTR)
+ continue;
+ triton_log_error("timer:epoll_wait: %s", strerror(errno));
+ _exit(-1);
+ }
+
+ for(i = 0; i < n; i++) {
+ t = (struct _triton_timer_t *)epoll_events[i].data.ptr;
+ spin_lock(&t->ctx->lock);
+ if (t->ud) {
+ if (!t->pending) {
+ list_add_tail(&t->entry2, &t->ctx->pending_timers);
+ t->pending = 1;
+ r = triton_queue_ctx(t->ctx);
+ } else
+ r = 0;
+ } else
+ r = 0;
+ spin_unlock(&t->ctx->lock);
+ if (r)
+ triton_thread_wakeup(t->ctx->thread);
+ }
+ }
+
+ return NULL;
+}
+
+int __export triton_timer_add(struct triton_context_t *ctx, struct triton_timer_t *ud, int abs_time)
+{
+ struct _triton_timer_t *t = mempool_alloc(timer_pool);
+
+ memset(t, 0, sizeof(*t));
+ t->ud = ud;
+ t->epoll_event.data.ptr = t;
+ t->epoll_event.events = EPOLLIN | EPOLLET;
+ if (ctx)
+ t->ctx = (struct _triton_context_t *)ctx->tpd;
+ else
+ t->ctx = (struct _triton_context_t *)default_ctx->tpd;
+ t->fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
+ if (t->fd < 0) {
+ triton_log_error("timer:timerfd_create: %s" ,strerror(errno));
+ mempool_free(t);
+ return -1;
+ }
+
+ ud->tpd = t;
+
+ if (triton_timer_mod(ud, abs_time)) {
+ close(t->fd);
+ mempool_free(t);
+ return -1;
+ }
+
+ spin_lock(&t->ctx->lock);
+ list_add_tail(&t->entry, &t->ctx->timers);
+ spin_unlock(&t->ctx->lock);
+
+ if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, t->fd, &t->epoll_event)) {
+ triton_log_error("timer:epoll_ctl: %s", strerror(errno));
+ spin_lock(&t->ctx->lock);
+ t->ud = NULL;
+ list_del(&t->entry);
+ spin_unlock(&t->ctx->lock);
+ close(t->fd);
+ mempool_free(t);
+ ud->tpd = NULL;
+ return -1;
+ }
+
+ __sync_fetch_and_add(&triton_stat.timer_count, 1);
+
+ return 0;
+}
+int __export triton_timer_mod(struct triton_timer_t *ud,int abs_time)
+{
+ struct _triton_timer_t *t = (struct _triton_timer_t *)ud->tpd;
+ struct itimerspec ts = {
+ .it_value.tv_sec = ud->expire_tv.tv_sec,
+ .it_value.tv_nsec = ud->expire_tv.tv_usec * 1000,
+ .it_interval.tv_sec = ud->period / 1000,
+ .it_interval.tv_nsec = (ud->period % 1000) * 1000,
+ };
+
+ if (ud->expire_tv.tv_sec == 0 && ud->expire_tv.tv_usec == 0)
+ ts.it_value = ts.it_interval;
+
+ if (timerfd_settime(t->fd, abs_time ? TFD_TIMER_ABSTIME : 0, &ts, NULL)) {
+ triton_log_error("timer:timerfd_settime: %s", strerror(errno));
+ return -1;
+ }
+
+ return 0;
+}
+void __export triton_timer_del(struct triton_timer_t *ud)
+{
+ struct _triton_timer_t *t = (struct _triton_timer_t *)ud->tpd;
+ epoll_ctl(epoll_fd, EPOLL_CTL_DEL, t->fd, &t->epoll_event);
+ close(t->fd);
+ spin_lock(&t->ctx->lock);
+ list_del(&t->entry);
+ if (t->pending)
+ list_del(&t->entry2);
+ t->ud = NULL;
+ spin_unlock(&t->ctx->lock);
+ sched_yield();
+ mempool_free(t);
+ ud->tpd = NULL;
+
+ __sync_fetch_and_sub(&triton_stat.timer_count, 1);
+}
+
diff --git a/accel-pptpd/triton/triton.c b/accel-pptpd/triton/triton.c
new file mode 100644
index 0000000..b2aaa7b
--- /dev/null
+++ b/accel-pptpd/triton/triton.c
@@ -0,0 +1,472 @@
+#include <signal.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "triton_p.h"
+#include "memdebug.h"
+
+int thread_count = 2;
+int max_events = 64;
+
+static spinlock_t threads_lock = SPINLOCK_INITIALIZER;
+static LIST_HEAD(threads);
+static LIST_HEAD(sleep_threads);
+
+static LIST_HEAD(ctx_queue);
+
+static spinlock_t ctx_list_lock = SPINLOCK_INITIALIZER;
+static LIST_HEAD(ctx_list);
+
+static int terminate;
+static int need_terminate;
+
+static mempool_t *ctx_pool;
+static mempool_t *call_pool;
+static mempool_t *ctx_stack_pool;
+
+__export struct triton_stat_t triton_stat;
+
+void triton_thread_wakeup(struct _triton_thread_t *thread)
+{
+ //printf("wake up thread %p\n", thread);
+ pthread_kill(thread->thread, SIGUSR1);
+}
+
+static void* triton_thread(struct _triton_thread_t *thread)
+{
+ sigset_t set;
+ int sig;
+
+ sigfillset(&set);
+ sigdelset(&set, SIGKILL);
+ sigdelset(&set, SIGSTOP);
+ pthread_sigmask(SIG_BLOCK, &set, NULL);
+
+ sigemptyset(&set);
+ sigaddset(&set, SIGUSR1);
+ sigaddset(&set, SIGQUIT);
+
+ while (1) {
+ spin_lock(&threads_lock);
+ if (!list_empty(&ctx_queue)) {
+ thread->ctx = list_entry(ctx_queue.next, typeof(*thread->ctx), entry2);
+ //printf("thread: %p: dequeued ctx %p\n", thread, thread->ctx);
+ list_del(&thread->ctx->entry2);
+ spin_unlock(&threads_lock);
+ spin_lock(&thread->ctx->lock);
+ thread->ctx->thread = thread;
+ thread->ctx->queued = 0;
+ spin_unlock(&thread->ctx->lock);
+ __sync_fetch_and_sub(&triton_stat.context_pending, 1);
+ } else {
+ //printf("thread: %p: sleeping\n", thread);
+ if (!terminate)
+ list_add(&thread->entry2, &sleep_threads);
+ spin_unlock(&threads_lock);
+ if (terminate)
+ return NULL;
+
+ __sync_fetch_and_sub(&triton_stat.thread_active, 1);
+ //printf("thread %p: enter sigwait\n", thread);
+ sigwait(&set, &sig);
+ //printf("thread %p: exit sigwait\n", thread);
+ __sync_fetch_and_add(&triton_stat.thread_active, 1);
+
+ if (!thread->ctx)
+ continue;
+ }
+
+cont:
+ //printf("thread %p: ctx=%p %p\n", thread, thread->ctx, thread->ctx ? thread->ctx->thread : NULL);
+ if (thread->ctx->ud->before_switch)
+ thread->ctx->ud->before_switch(thread->ctx->ud, thread->ctx->bf_arg);
+
+ //printf("thread %p: switch to %p\n", thread, thread->ctx);
+ while (1) {
+ if (swapcontext(&thread->uctx, &thread->ctx->uctx)) {
+ if (errno == EINTR)
+ continue;
+ triton_log_error("swapcontext: %s\n", strerror(errno));
+ } else
+ break;
+ }
+ //printf("thread %p: switch from %p %p\n", thread, thread->ctx, thread->ctx->thread);
+
+ if (thread->ctx->thread) {
+ spin_lock(&thread->ctx->lock);
+ if (thread->ctx->pending) {
+ spin_unlock(&thread->ctx->lock);
+ goto cont;
+ }
+ thread->ctx->thread = NULL;
+ spin_unlock(&thread->ctx->lock);
+
+ if (thread->ctx->need_free) {
+ //printf("- context %p removed\n", thread->ctx);
+ mempool_free(thread->ctx->uctx.uc_stack.ss_sp);
+ mempool_free(thread->ctx);
+ }
+ }
+
+ thread->ctx = NULL;
+ }
+}
+
+static void ctx_thread(struct _triton_context_t *ctx)
+{
+ struct _triton_md_handler_t *h;
+ struct _triton_timer_t *t;
+ struct _triton_ctx_call_t *call;
+ uint64_t tt;
+
+ while (1) {
+ //printf("ctx %p %p: enter\n", ctx, ctx->thread);
+ if (ctx->need_close) {
+ if (ctx->ud->close)
+ ctx->ud->close(ctx->ud);
+ ctx->need_close = 0;
+ }
+
+ while (1) {
+ spin_lock(&ctx->lock);
+ if (!list_empty(&ctx->pending_timers)) {
+ t = list_entry(ctx->pending_timers.next, typeof(*t), entry2);
+ list_del(&t->entry2);
+ t->pending = 0;
+ spin_unlock(&ctx->lock);
+ read(t->fd, &tt, sizeof(tt));
+ t->ud->expire(t->ud);
+ continue;
+ }
+ if (!list_empty(&ctx->pending_handlers)) {
+ h = list_entry(ctx->pending_handlers.next, typeof(*h), entry2);
+ list_del(&h->entry2);
+ h->pending = 0;
+ spin_unlock(&ctx->lock);
+ if (h->trig_epoll_events & (EPOLLIN | EPOLLERR | EPOLLHUP))
+ if (h->ud && h->ud->read)
+ h->ud->read(h->ud);
+ if (h->trig_epoll_events & (EPOLLOUT | EPOLLERR | EPOLLHUP))
+ if (h->ud && h->ud->write)
+ h->ud->write(h->ud);
+ h->trig_epoll_events = 0;
+ continue;
+ }
+ if (!list_empty(&ctx->pending_calls)) {
+ call = list_entry(ctx->pending_calls.next, typeof(*call), entry);
+ list_del(&call->entry);
+ spin_unlock(&ctx->lock);
+ call->func(call->arg);
+ mempool_free(call);
+ }
+ ctx->pending = 0;
+ spin_unlock(&ctx->lock);
+ break;
+ }
+
+ //printf("ctx %p %p: exit\n", ctx, ctx->thread);
+ while (1) {
+ if (swapcontext(&ctx->uctx, &ctx->thread->uctx)) {
+ if (errno == EINTR)
+ continue;
+ triton_log_error("swapcontext: %s\n", strerror(errno));
+ } else
+ break;
+ }
+ }
+}
+
+struct _triton_thread_t *create_thread()
+{
+ struct _triton_thread_t *thread = malloc(sizeof(*thread));
+ if (!thread)
+ return NULL;
+
+ memset(thread, 0, sizeof(*thread));
+ if (pthread_create(&thread->thread, NULL, (void*(*)(void*))triton_thread, thread)) {
+ triton_log_error("pthread_create: %s", strerror(errno));
+ return NULL;
+ }
+
+ triton_stat.thread_count++;
+ triton_stat.thread_active++;
+
+ return thread;
+}
+
+int triton_queue_ctx(struct _triton_context_t *ctx)
+{
+ ctx->pending = 1;
+ if (ctx->thread || ctx->queued || ctx->sleeping)
+ return 0;
+
+ spin_lock(&threads_lock);
+ if (list_empty(&sleep_threads)) {
+ list_add_tail(&ctx->entry2, &ctx_queue);
+ spin_unlock(&threads_lock);
+ ctx->queued = 1;
+ //printf("ctx %p: queued\n", ctx);
+ __sync_fetch_and_add(&triton_stat.context_pending, 1);
+ return 0;
+ }
+
+ ctx->thread = list_entry(sleep_threads.next, typeof(*ctx->thread), entry2);
+ ctx->thread->ctx = ctx;
+ //printf("ctx %p: assigned to thread %p\n", ctx, ctx->thread);
+ list_del(&ctx->thread->entry2);
+ spin_unlock(&threads_lock);
+
+ return 1;
+}
+
+int __export triton_context_register(struct triton_context_t *ud, void *bf_arg)
+{
+ struct _triton_context_t *ctx = mempool_alloc(ctx_pool);
+
+ if (!ctx)
+ return -1;
+
+ memset(ctx, 0, sizeof(*ctx));
+ ctx->ud = ud;
+ ctx->bf_arg = bf_arg;
+ ctx->sleeping = 1;
+ spinlock_init(&ctx->lock);
+ INIT_LIST_HEAD(&ctx->handlers);
+ INIT_LIST_HEAD(&ctx->timers);
+ INIT_LIST_HEAD(&ctx->pending_handlers);
+ INIT_LIST_HEAD(&ctx->pending_timers);
+ INIT_LIST_HEAD(&ctx->pending_calls);
+
+ if (getcontext(&ctx->uctx)) {
+ triton_log_error("getcontext: %s\n", strerror(errno));
+ _free(ctx);
+ return -1;
+ }
+
+ ctx->uctx.uc_stack.ss_size = CTX_STACK_SIZE;
+ ctx->uctx.uc_stack.ss_sp = mempool_alloc(ctx_stack_pool);
+ if (!ctx->uctx.uc_stack.ss_sp) {
+ triton_log_error("out of memory\n");
+ _free(ctx);
+ return -1;
+ }
+ sigfillset(&ctx->uctx.uc_sigmask);
+ makecontext(&ctx->uctx, (void (*)())ctx_thread, 1, ctx);
+
+ ud->tpd = ctx;
+
+ spin_lock(&ctx_list_lock);
+ list_add_tail(&ctx->entry, &ctx_list);
+ spin_unlock(&ctx_list_lock);
+
+ __sync_fetch_and_add(&triton_stat.context_sleeping, 1);
+ __sync_fetch_and_add(&triton_stat.context_count, 1);
+
+ return 0;
+}
+
+void __export triton_context_unregister(struct triton_context_t *ud)
+{
+ struct _triton_context_t *ctx = (struct _triton_context_t *)ud->tpd;
+ struct _triton_ctx_call_t *call;
+ struct _triton_thread_t *t;
+
+ while (!list_empty(&ctx->pending_calls)) {
+ call = list_entry(ctx->pending_calls.next, typeof(*call), entry);
+ list_del(&call->entry);
+ mempool_free(call);
+ }
+
+ if (!list_empty(&ctx->handlers)) {
+ triton_log_error("BUG:ctx:triton_unregister_ctx: handlers is not empty");
+ {
+ struct _triton_md_handler_t *h;
+ list_for_each_entry(h, &ctx->handlers, entry)
+ if (h->ud)
+ printf("%p\n", h->ud);
+ }
+ abort();
+ }
+ if (!list_empty(&ctx->pending_handlers)) {
+ triton_log_error("BUG:ctx:triton_unregister_ctx: pending_handlers is not empty");
+ abort();
+ }
+ if (!list_empty(&ctx->timers)) {
+ triton_log_error("BUG:ctx:triton_unregister_ctx: timers is not empty");
+ abort();
+ }
+ if (!list_empty(&ctx->pending_timers)) {
+ triton_log_error("BUG:ctx:triton_unregister_ctx: pending_timers is not empty");
+ abort();
+ }
+
+ ctx->need_free = 1;
+ spin_lock(&ctx_list_lock);
+ list_del(&ctx->entry);
+ if (need_terminate && list_empty(&ctx_list))
+ terminate = 1;
+ spin_unlock(&ctx_list_lock);
+
+ __sync_fetch_and_sub(&triton_stat.context_count, 1);
+
+ if (terminate) {
+ list_for_each_entry(t, &threads, entry)
+ triton_thread_wakeup(t);
+ }
+}
+void __export triton_context_schedule(struct triton_context_t *ud)
+{
+ struct _triton_context_t *ctx = (struct _triton_context_t *)ud->tpd;
+ ucontext_t *uctx = &ctx->thread->uctx;
+
+ spin_lock(&ctx->lock);
+ if (ctx->wakeup) {
+ ctx->wakeup = 0;
+ spin_unlock(&ctx->lock);
+ return;
+ }
+ ctx->sleeping = 1;
+ ctx->thread = NULL;
+ spin_unlock(&ctx->lock);
+
+ while (1) {
+ if (swapcontext(&ctx->uctx, uctx)) {
+ if (errno == EINTR)
+ continue;
+ triton_log_error("swaswpntext: %s\n", strerror(errno));
+ } else
+ break;
+ }
+
+ __sync_fetch_and_add(&triton_stat.context_sleeping, 1);
+}
+
+int __export triton_context_wakeup(struct triton_context_t *ud)
+{
+ struct _triton_context_t *ctx = (struct _triton_context_t *)ud->tpd;
+ int r;
+
+ spin_lock(&ctx->lock);
+ if (!ctx->sleeping) {
+ ctx->wakeup = 1;
+ spin_unlock(&ctx->lock);
+ return -1;
+ }
+ ctx->sleeping = 0;
+ r = triton_queue_ctx(ctx);
+ spin_unlock(&ctx->lock);
+
+ if (r)
+ triton_thread_wakeup(ctx->thread);
+
+ __sync_fetch_and_sub(&triton_stat.context_sleeping, 1);
+
+ return 0;
+}
+
+int __export triton_context_call(struct triton_context_t *ud, void (*func)(void *), void *arg)
+{
+ struct _triton_context_t *ctx = (struct _triton_context_t *)ud->tpd;
+ struct _triton_ctx_call_t *call = mempool_alloc(call_pool);
+ int r;
+
+ if (!call)
+ return -1;
+
+ call->func = func;
+ call->arg = arg;
+
+ spin_lock(&ctx->lock);
+ list_add_tail(&call->entry, &ctx->pending_calls);
+ r = triton_queue_ctx(ctx);
+ spin_unlock(&ctx->lock);
+
+ if (r)
+ triton_thread_wakeup(ctx->thread);
+
+ return 0;
+}
+
+int __export triton_init(const char *conf_file)
+{
+ ctx_pool = mempool_create(sizeof(struct _triton_context_t));
+ call_pool = mempool_create(sizeof(struct _triton_ctx_call_t));
+ ctx_stack_pool = mempool_create(CTX_STACK_SIZE);
+
+ if (conf_load(conf_file))
+ return -1;
+
+ if (log_init())
+ return -1;
+
+ if (md_init())
+ return -1;
+
+ if (timer_init())
+ return -1;
+
+ if (event_init())
+ return -1;
+
+ return 0;
+}
+
+int __export triton_load_modules(const char *mod_sect)
+{
+ if (load_modules(mod_sect))
+ return -1;
+
+ return 0;
+}
+
+void __export triton_run()
+{
+ struct _triton_thread_t *t;
+ int i;
+ char *opt;
+
+ opt = conf_get_opt("core", "thread-count");
+ if (opt && atoi(opt) > 0)
+ thread_count = atoi(opt);
+
+ for(i = 0; i < thread_count; i++) {
+ t = create_thread();
+ if (!t)
+ _exit(-1);
+
+ list_add_tail(&t->entry, &threads);
+ }
+
+ md_run();
+ timer_run();
+}
+
+void __export triton_terminate()
+{
+ struct _triton_context_t *ctx;
+ struct _triton_thread_t *t;
+ int r;
+
+ need_terminate = 1;
+
+ spin_lock(&ctx_list_lock);
+ list_for_each_entry(ctx, &ctx_list, entry) {
+ spin_lock(&ctx->lock);
+ ctx->need_close = 1;
+ r = triton_queue_ctx(ctx);
+ if (r)
+ triton_thread_wakeup(ctx->thread);
+ spin_unlock(&ctx->lock);
+ }
+ spin_unlock(&ctx_list_lock);
+
+ list_for_each_entry(t, &threads, entry)
+ pthread_join(t->thread, NULL);
+
+ md_terminate();
+ timer_terminate();
+}
+
diff --git a/accel-pptpd/triton/triton.h b/accel-pptpd/triton/triton.h
new file mode 100644
index 0000000..4b4d9c4
--- /dev/null
+++ b/accel-pptpd/triton/triton.h
@@ -0,0 +1,127 @@
+#ifndef TRITON_H
+#define TRITON_H
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "list.h"
+
+struct triton_context_t
+{
+ const void *tpd; // triton private data, don't touch
+ void (*close)(struct triton_context_t*);
+ void (*free)(struct triton_context_t*);
+ void (*before_switch)(struct triton_context_t *ctx, void *arg);
+};
+
+struct triton_md_handler_t
+{
+ const void *tpd; // triton private data, don't touch!
+ int fd;
+ int (*read)(struct triton_md_handler_t *);
+ int (*write)(struct triton_md_handler_t *);
+};
+
+struct triton_timer_t
+{
+ const void *tpd; // triton private data, don't touch!
+ struct timeval expire_tv;
+ int period;
+ void (*expire)(struct triton_timer_t *);
+};
+
+struct triton_sigchld_handler_t
+{
+ void *tpd;
+ int pid;
+ void (*handler)(struct triton_sigchld_handler_t *h, int status);
+};
+
+struct conf_option_t
+{
+ struct list_head entry;
+ char *name;
+ char *val;
+};
+
+struct conf_sect_t
+{
+ const char *name;
+ struct list_head items;
+};
+
+struct triton_stat_t
+{
+ uint32_t mempool_allocated;
+ uint32_t mempool_available;
+ uint32_t thread_count;
+ uint32_t thread_active;
+ uint32_t context_count;
+ uint32_t context_sleeping;
+ uint32_t context_pending;
+ uint32_t md_handler_count;
+ uint32_t md_handler_pending;
+ uint32_t timer_count;
+ uint32_t timer_pending;
+};
+
+extern struct triton_stat_t triton_stat;
+int triton_context_register(struct triton_context_t *, void *arg);
+void triton_context_unregister(struct triton_context_t *);
+void triton_context_schedule(struct triton_context_t *);
+int triton_context_wakeup(struct triton_context_t *);
+int triton_context_call(struct triton_context_t *, void (*func)(void *), void *arg);
+
+#define MD_MODE_READ 1
+#define MD_MODE_WRITE 2
+
+#define MD_TRIG_EDGE 0
+#define MD_TRIG_LEVEL 1
+
+void triton_md_register_handler(struct triton_context_t *, struct triton_md_handler_t *);
+void triton_md_unregister_handler(struct triton_md_handler_t *h);
+int triton_md_enable_handler(struct triton_md_handler_t *h, int mode);
+int triton_md_disable_handler(struct triton_md_handler_t *h,int mode);
+void triton_md_set_trig(struct triton_md_handler_t *h, int mode);
+
+int triton_timer_add(struct triton_context_t *ctx, struct triton_timer_t*,int abs_time);
+int triton_timer_mod(struct triton_timer_t *,int abs_time);
+void triton_timer_del(struct triton_timer_t *);
+
+typedef void (*triton_event_func)(void *);
+int triton_event_register_handler(int ev_id, triton_event_func func);
+void triton_event_fire(int ev_id, void *arg);
+
+struct conf_sect_t *conf_get_section(const char *name);
+char *conf_get_opt(const char *sect, const char *name);
+
+#define TRITON_OK 0
+#define TRITON_ERR_NOCOMP -1
+#define TRITON_ERR_NOSUPP -2
+#define TRITON_ERR_NOINTF -3
+#define TRITON_ERR_EXISTS -4
+#define TRITON_ERR_NOCHAN -5
+#define TRITON_ERR_NOMSG -6
+#define TRITON_ERR_BUSY -5
+
+int triton_init(const char *conf_file);
+int triton_load_modules(const char *md_sect);
+void triton_run(void);
+void triton_terminate(void);
+
+
+#define __init __attribute__((constructor))
+#define __export __attribute__((visibility("default")))
+
+#undef offsetof
+#ifdef __compiler_offsetof
+#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+
+#endif
diff --git a/accel-pptpd/triton/triton_p.h b/accel-pptpd/triton/triton_p.h
new file mode 100644
index 0000000..c685051
--- /dev/null
+++ b/accel-pptpd/triton/triton_p.h
@@ -0,0 +1,105 @@
+#ifndef TRITON_P_H
+#define TRITON_P_H
+
+#include <pthread.h>
+#include <sys/epoll.h>
+#include <ucontext.h>
+
+#include "triton.h"
+#include "list.h"
+#include "spinlock.h"
+#include "mempool.h"
+
+#define CTX_STACK_SIZE 8196
+
+struct _triton_thread_t
+{
+ struct list_head entry;
+ struct list_head entry2;
+ pthread_t thread;
+ int terminate:1;
+ struct _triton_context_t *ctx;
+ ucontext_t uctx;
+};
+
+struct _triton_context_t
+{
+ struct list_head entry;
+ struct list_head entry2;
+
+ spinlock_t lock;
+ struct _triton_thread_t *thread;
+
+ struct list_head handlers;
+ struct list_head timers;
+ struct list_head pending_handlers;
+ struct list_head pending_timers;
+ struct list_head pending_calls;
+
+ ucontext_t uctx;
+
+ int queued:1;
+ int sleeping:1;
+ int wakeup:1;
+ int need_close:1;
+ int need_free:1;
+ int pending:1;
+
+ struct triton_context_t *ud;
+ void *bf_arg;
+};
+
+struct _triton_md_handler_t
+{
+ struct list_head entry;
+ struct list_head entry2;
+ struct _triton_context_t *ctx;
+ struct epoll_event epoll_event;
+ uint32_t trig_epoll_events;
+ int pending:1;
+ int trig_level:1;
+ struct triton_md_handler_t *ud;
+};
+
+struct _triton_timer_t
+{
+ struct list_head entry;
+ struct list_head entry2;
+ struct epoll_event epoll_event;
+ struct _triton_context_t *ctx;
+ int fd;
+ int pending:1;
+ struct triton_timer_t *ud;
+};
+
+struct _triton_event_t
+{
+ struct list_head handlers;
+};
+
+struct _triton_ctx_call_t
+{
+ struct list_head entry;
+
+ void *arg;
+ void (*func)(void *);
+};
+
+int log_init(void);
+int md_init();
+int timer_init();
+int event_init();
+
+void md_run();
+void md_terminate();
+void timer_run();
+void timer_terminate();
+struct triton_context_t *default_ctx;
+int triton_queue_ctx(struct _triton_context_t*);
+void triton_thread_wakeup(struct _triton_thread_t*);
+int conf_load(const char *fname);
+void triton_log_error(const char *fmt,...);
+void triton_log_debug(const char *fmt,...);
+int load_modules(const char *name);
+
+#endif
diff --git a/accel-pptpd/utils.c b/accel-pptpd/utils.c
new file mode 100644
index 0000000..491e650
--- /dev/null
+++ b/accel-pptpd/utils.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+#include "triton.h"
+#include "utils.h"
+
+#include "memdebug.h"
+
+void __export u_inet_ntoa(in_addr_t addr, char *str)
+{
+ sprintf(str, "%i.%i.%i.%i", addr & 0xff, (addr >> 8) & 0xff, (addr >> 16) & 0xff, (addr >> 24) & 0xff);
+}
diff --git a/accel-pptpd/utils.h b/accel-pptpd/utils.h
new file mode 100644
index 0000000..27d4d05
--- /dev/null
+++ b/accel-pptpd/utils.h
@@ -0,0 +1,8 @@
+#ifndef __UTILS_H
+#define __UTILS_H
+
+#include <netinet/in.h>
+
+void u_inet_ntoa(in_addr_t, char *str);
+
+#endif
diff --git a/contrib/README b/contrib/README
deleted file mode 100644
index 259d8a5..0000000
--- a/contrib/README
+++ /dev/null
@@ -1,8 +0,0 @@
-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/gentoo/net-dialup/accel-pptp/files/options.pptp b/contrib/gentoo/net-dialup/accel-pptp/files/options.pptp
index d61ab80..d61ab80 100644
--- a/gentoo/net-dialup/accel-pptp/files/options.pptp
+++ b/contrib/gentoo/net-dialup/accel-pptp/files/options.pptp
diff --git a/gentoo/net-dialup/accel-pptp/files/pptpd-confd b/contrib/gentoo/net-dialup/accel-pptp/files/pptpd-confd
index 1169e57..1169e57 100644
--- a/gentoo/net-dialup/accel-pptp/files/pptpd-confd
+++ b/contrib/gentoo/net-dialup/accel-pptp/files/pptpd-confd
diff --git a/gentoo/net-dialup/accel-pptp/files/pptpd-init b/contrib/gentoo/net-dialup/accel-pptp/files/pptpd-init
index c053720..c053720 100755
--- a/gentoo/net-dialup/accel-pptp/files/pptpd-init
+++ b/contrib/gentoo/net-dialup/accel-pptp/files/pptpd-init
diff --git a/contrib/pppd-allow-mppe.patch b/contrib/pppd-allow-mppe.patch
deleted file mode 100644
index 618bec7..0000000
--- a/contrib/pppd-allow-mppe.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-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);
-
diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt
new file mode 100644
index 0000000..e9d511a
--- /dev/null
+++ b/driver/CMakeLists.txt
@@ -0,0 +1,18 @@
+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)")
+
diff --git a/driver/Makefile b/driver/Makefile
new file mode 100644
index 0000000..69dc74e
--- /dev/null
+++ b/driver/Makefile
@@ -0,0 +1 @@
+obj-m += pptp.o
diff --git a/kernel/driver/gre.c b/driver/gre.c
index 77886d5..77886d5 100644
--- a/kernel/driver/gre.c
+++ b/driver/gre.c
diff --git a/kernel/driver/gre.h b/driver/gre.h
index 2ca7f74..2ca7f74 100644
--- a/kernel/driver/gre.h
+++ b/driver/gre.h
diff --git a/kernel/driver/if_pppox.h b/driver/if_pppox.h
index bc05b53..bc05b53 100644
--- a/kernel/driver/if_pppox.h
+++ b/driver/if_pppox.h
diff --git a/kernel/driver/pptp.c b/driver/pptp.c
index 696d407..696d407 100644
--- a/kernel/driver/pptp.c
+++ b/driver/pptp.c
diff --git a/example/etc/modprobe.conf b/example/etc/modprobe.conf
deleted file mode 100644
index df0b014..0000000
--- a/example/etc/modprobe.conf
+++ /dev/null
@@ -1 +0,0 @@
-alias net-pf-24 pptp
diff --git a/example/etc/ppp/chap-secrets b/example/etc/ppp/chap-secrets
deleted file mode 100644
index 63fe628..0000000
--- a/example/etc/ppp/chap-secrets
+++ /dev/null
@@ -1,4 +0,0 @@
-# Secrets for authentication using CHAP
-# client server secret IP addresses
-test pptp test *
-test2 pptp test2 *
diff --git a/example/etc/ppp/options.pptp b/example/etc/ppp/options.pptp
deleted file mode 100644
index f153273..0000000
--- a/example/etc/ppp/options.pptp
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# $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
-# }}}
diff --git a/example/etc/ppp/options.pptpd b/example/etc/ppp/options.pptpd
deleted file mode 100644
index 67beac0..0000000
--- a/example/etc/ppp/options.pptpd
+++ /dev/null
@@ -1,129 +0,0 @@
-###############################################################################
-# $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)
-
diff --git a/example/etc/ppp/peers/pptp_test b/example/etc/ppp/peers/pptp_test
deleted file mode 100644
index 113dfa9..0000000
--- a/example/etc/ppp/peers/pptp_test
+++ /dev/null
@@ -1,13 +0,0 @@
-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
diff --git a/example/etc/pptpd.conf b/example/etc/pptpd.conf
deleted file mode 100644
index 8c1a445..0000000
--- a/example/etc/pptpd.conf
+++ /dev/null
@@ -1,82 +0,0 @@
-###############################################################################
-# $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
diff --git a/gentoo/net-dialup/accel-pptp/accel-pptp-0.8.5.ebuild b/gentoo/net-dialup/accel-pptp/accel-pptp-0.8.5.ebuild
deleted file mode 100644
index 7fe4f73..0000000
--- a/gentoo/net-dialup/accel-pptp/accel-pptp-0.8.5.ebuild
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/pptpd/pptpd-1.3.1.ebuild,v 1.1 2006/03/26 09:13:06 mrness Exp $
-
-inherit linux-mod eutils autotools
-
-DESCRIPTION="Point-to-Point Tunnelling Protocol Client/Server for Linux"
-SRC_URI="mirror://sourceforge/accel-pptp/${P}.tar.bz2"
-HOMEPAGE="http://accel-pptp.sourceforge.net/"
-
-SLOT="0"
-LICENSE="GPL"
-KEYWORDS="~amd64 ~x86"
-IUSE="tcpd server"
-
-DEPEND="server? ( !net-dialup/pptpd )
- >=net-dialup/ppp-2.4.2
- >=virtual/linux-sources-2.6.15
- tcpd? ( sys-apps/tcp-wrappers )"
-RDEPEND="virtual/modutils"
-
-MODULE_NAMES="pptp(misc:${S}/kernel/driver)"
-BUILD_TARGETS="default"
-BUILD_PARAMS="KDIR=${KERNEL_DIR}"
-CONFIG_CHECK="PPP PPPOE"
-MODULESD_PPTP_ALIASES=("net-pf-24 pptp")
-
-src_unpack() {
- unpack ${A}
-
- local PPPD_VER=`best_version net-dialup/ppp`
- PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
- PPPD_VER=${PPPD_VER%%[_-]*} # main version without beta/pre/patch/revision
- #Match pptpd-logwtmp.so's version with pppd's version (#89895)
- #sed -i -e "s:\\(#define[ \\t]*VERSION[ \\t]*\\)\".*\":\\1\"${PPPD_VER}\":" "${S}/pptpd-1.3.3/plugins/patchlevel.h"
- #sed -i -e "s:\\(#define[ \\t]*PPP_VERSION[ \\t]*\\)\".*\":\\1\"${PPPD_VER}\":" "${S}/pppd_plugin/src/pppd/patchlevel.h"
-
- convert_to_m ${S}/kernel/driver/Makefile
-
- cd ${S}/pppd_plugin
- eautoreconf
-
- if use server; then
- cd ${S}/pptpd-1.3.3
- eautoreconf
- fi
-}
-
-src_compile() {
-
- if use server; then
- cd ${S}/pptpd-1.3.3
- local myconf
- use tcpd && myconf="--with-libwrap"
- econf --with-bcrelay \
- ${myconf} || die "configure failed"
- emake COPTS="${CFLAGS}" || die "make failed"
- fi
-
- cd ${S}/pppd_plugin
- local myconf
- econf ${myconf} || die "configure failed"
- emake COPTS="${CFLAGS}" || die "make failed"
-
- cd ${S}/kernel/driver
- linux-mod_src_compile || die "failed to build driver"
-}
-
-src_install () {
- if use server; then
- cd ${S}/pptpd-1.3.3
- einstall || die "make install failed"
-
- insinto /etc
- doins samples/pptpd.conf
-
- insinto /etc/ppp
- doins samples/options.pptpd
-
- exeinto /etc/init.d
- newexe "${FILESDIR}/pptpd-init" pptpd
-
- insinto /etc/conf.d
- newins "${FILESDIR}/pptpd-confd" pptpd
- fi
-
- if use client; then
- cd ${S}/example
- insinto /etc/ppp
- doins ppp/options.pptp
- insinto /etc/ppp/peers
- doins ppp/peers/pptp_test
- fi
-
- cd ${S}/pppd_plugin/src/.libs
- local PPPD_VER=`best_version net-dialup/ppp`
- PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
- PPPD_VER=${PPPD_VER%%[_-]*} # main version without beta/pre/patch/revision
- insinto /usr/lib/pppd/${PPPD_VER}
- newins pptp.so.0.0.0 pptp.so
-
- cd ${S}/kernel/driver
- linux-mod_src_install
-
- cd ${S}
- dodoc README
- cp -R example "${D}/usr/share/doc/${P}/exmaple"
-}
-
-pkg_postinst () {
- modules-update
-}
diff --git a/kernel/driver/AUTHORS b/kernel/driver/AUTHORS
deleted file mode 100644
index b93df1d..0000000
--- a/kernel/driver/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Kozlov D. <xeb@mail.ru>
diff --git a/kernel/driver/COPYING b/kernel/driver/COPYING
deleted file mode 100644
index 5b6e7c6..0000000
--- a/kernel/driver/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- 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.
diff --git a/kernel/driver/ChangeLog b/kernel/driver/ChangeLog
deleted file mode 100644
index e69de29..0000000
--- a/kernel/driver/ChangeLog
+++ /dev/null
diff --git a/kernel/driver/Doxyfile b/kernel/driver/Doxyfile
deleted file mode 100644
index 1a7d258..0000000
--- a/kernel/driver/Doxyfile
+++ /dev/null
@@ -1,275 +0,0 @@
-# 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
diff --git a/kernel/driver/INSTALL b/kernel/driver/INSTALL
deleted file mode 100644
index 02a4a07..0000000
--- a/kernel/driver/INSTALL
+++ /dev/null
@@ -1,167 +0,0 @@
-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.
-
diff --git a/kernel/driver/Makefile b/kernel/driver/Makefile
deleted file mode 100644
index 8871216..0000000
--- a/kernel/driver/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-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
diff --git a/kernel/driver/NEWS b/kernel/driver/NEWS
deleted file mode 100644
index e69de29..0000000
--- a/kernel/driver/NEWS
+++ /dev/null
diff --git a/kernel/driver/README b/kernel/driver/README
deleted file mode 100644
index e69de29..0000000
--- a/kernel/driver/README
+++ /dev/null
diff --git a/kernel/driver/TODO b/kernel/driver/TODO
deleted file mode 100644
index e69de29..0000000
--- a/kernel/driver/TODO
+++ /dev/null
diff --git a/kernel/driver/find_kernel_headers b/kernel/driver/find_kernel_headers
deleted file mode 100755
index 3d0e505..0000000
--- a/kernel/driver/find_kernel_headers
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
diff --git a/kernel/patch/patch-2.6.18 b/kernel/patch/patch-2.6.18
deleted file mode 100644
index d38121d..0000000
--- a/kernel/patch/patch-2.6.18
+++ /dev/null
@@ -1,1110 +0,0 @@
-diff -uprN linux-2.6.18.orig/drivers/net/Kconfig linux-2.6.18.pptp/drivers/net/Kconfig
---- linux-2.6.18.orig/drivers/net/Kconfig 2006-10-30 13:20:24.000000000 +0300
-+++ linux-2.6.18.pptp/drivers/net/Kconfig 2006-10-30 13:21:45.000000000 +0300
-@@ -2687,6 +2687,15 @@ config PPPOE
- which contains instruction on how to use this driver (under
- the heading "Kernel mode PPPoE").
-
-+config PPTP
-+ tristate "PPTP (Point-to-Point Tunneling Protocol) (EXPERIMENTAL)"
-+ depends on EXPERIMENTAL && PPP
-+ help
-+ Support for Microsoft Point-to-Point Tunneling Protocol.
-+
-+ See http://accel-pptp.sourceforge.net/ for information on
-+ configuring PPTP clients and servers to utilize this driver.
-+
- config PPPOATM
- tristate "PPP over ATM"
- depends on ATM && PPP
-diff -uprN linux-2.6.18.orig/drivers/net/Makefile linux-2.6.18.pptp/drivers/net/Makefile
---- linux-2.6.18.orig/drivers/net/Makefile 2006-10-30 13:20:23.000000000 +0300
-+++ linux-2.6.18.pptp/drivers/net/Makefile 2006-10-30 13:21:45.000000000 +0300
-@@ -121,6 +121,7 @@ obj-$(CONFIG_PPP_DEFLATE) += ppp_deflate
- obj-$(CONFIG_PPP_BSDCOMP) += bsd_comp.o
- obj-$(CONFIG_PPP_MPPE) += ppp_mppe.o
- obj-$(CONFIG_PPPOE) += pppox.o pppoe.o
-+obj-$(CONFIG_PPTP) += pppox.o pptp.o
-
- obj-$(CONFIG_SLIP) += slip.o
- ifeq ($(CONFIG_SLIP_COMPRESSED),y)
-diff -uprN linux-2.6.18.orig/drivers/net/pptp.c linux-2.6.18.pptp/drivers/net/pptp.c
---- linux-2.6.18.orig/drivers/net/pptp.c 1970-01-01 03:00:00.000000000 +0300
-+++ linux-2.6.18.pptp/drivers/net/pptp.c 2006-10-30 13:31:37.000000000 +0300
-@@ -0,0 +1,941 @@
-+/*
-+ * Point-to-Point Tunneling Protocol for Linux
-+ *
-+ * Authors: Kozlov D. (xeb@mail.ru)
-+ *
-+ * 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.
-+ *
-+ */
-+
-+#include <linux/string.h>
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/slab.h>
-+#include <linux/errno.h>
-+#include <linux/netdevice.h>
-+#include <linux/net.h>
-+#include <linux/skbuff.h>
-+#include <linux/init.h>
-+#include <linux/ppp_channel.h>
-+#include <linux/ppp_defs.h>
-+#include <linux/if_ppp.h>
-+#include <linux/if_pppox.h>
-+#include <linux/notifier.h>
-+#include <linux/file.h>
-+#include <linux/proc_fs.h>
-+#include <linux/in.h>
-+#include <linux/ip.h>
-+#include <linux/netfilter.h>
-+#include <linux/netfilter_ipv4.h>
-+#include <linux/workqueue.h>
-+#include <linux/version.h>
-+
-+#include <net/sock.h>
-+#include <net/protocol.h>
-+#include <net/ip.h>
-+#include <net/icmp.h>
-+#include <net/route.h>
-+
-+#include <asm/uaccess.h>
-+
-+#define PPTP_DRIVER_VERSION "0.7"
-+
-+MODULE_DESCRIPTION("Point-to-Point Tunneling Protocol for Linux");
-+MODULE_AUTHOR("Kozlov D. (xeb@mail.ru)");
-+MODULE_LICENSE("GPL");
-+
-+static int log_level=0;
-+static int min_window=5;
-+static int max_window=100;
-+module_param(min_window,int,5);
-+MODULE_PARM_DESC(min_window,"Minimum sliding window size (default=3)");
-+module_param(max_window,int,100);
-+MODULE_PARM_DESC(max_window,"Maximum sliding window size (default=100)");
-+module_param(log_level,int,0);
-+
-+static struct proc_dir_entry* proc_dir;
-+
-+#define HASH_SIZE 16
-+#define HASH(addr) ((addr^(addr>>4))&0xF)
-+static DEFINE_RWLOCK(chan_lock);
-+static struct pppox_sock *chans[HASH_SIZE];
-+
-+static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb);
-+static int read_proc(char *page, char **start, off_t off,int count,
-+ int *eof, void *data);
-+static int __pptp_rcv(struct pppox_sock *po,struct sk_buff *skb,int new);
-+
-+static struct ppp_channel_ops pptp_chan_ops= {
-+ .start_xmit = pptp_xmit,
-+};
-+
-+
-+/* gre header structure: -------------------------------------------- */
-+
-+#define PPTP_GRE_PROTO 0x880B
-+#define PPTP_GRE_VER 0x1
-+
-+#define PPTP_GRE_FLAG_C 0x80
-+#define PPTP_GRE_FLAG_R 0x40
-+#define PPTP_GRE_FLAG_K 0x20
-+#define PPTP_GRE_FLAG_S 0x10
-+#define PPTP_GRE_FLAG_A 0x80
-+
-+#define PPTP_GRE_IS_C(f) ((f)&PPTP_GRE_FLAG_C)
-+#define PPTP_GRE_IS_R(f) ((f)&PPTP_GRE_FLAG_R)
-+#define PPTP_GRE_IS_K(f) ((f)&PPTP_GRE_FLAG_K)
-+#define PPTP_GRE_IS_S(f) ((f)&PPTP_GRE_FLAG_S)
-+#define PPTP_GRE_IS_A(f) ((f)&PPTP_GRE_FLAG_A)
-+
-+struct pptp_gre_header {
-+ u_int8_t flags; /* bitfield */
-+ u_int8_t ver; /* should be PPTP_GRE_VER (enhanced GRE) */
-+ u_int16_t protocol; /* should be PPTP_GRE_PROTO (ppp-encaps) */
-+ u_int16_t payload_len; /* size of ppp payload, not inc. gre header */
-+ u_int16_t call_id; /* peer's call_id for this session */
-+ u_int32_t seq; /* sequence number. Present if S==1 */
-+ u_int32_t ack; /* seq number of highest packet recieved by */
-+ /* sender in this session */
-+};
-+
-+struct gre_statistics {
-+ /* statistics for GRE receive */
-+ unsigned int rx_accepted; // data packet accepted
-+ unsigned int rx_lost; // data packet did not arrive before timeout
-+ unsigned int rx_underwin; // data packet was under window (arrived too late
-+ // or duplicate packet)
-+ unsigned int rx_buffered; // data packet arrived earlier than expected,
-+ // packet(s) before it were lost or reordered
-+ unsigned int rx_errors; // OS error on receive
-+ unsigned int rx_truncated; // truncated packet
-+ unsigned int rx_invalid; // wrong protocol or invalid flags
-+ unsigned int rx_acks; // acknowledgement only
-+
-+ /* statistics for GRE transmit */
-+ unsigned int tx_sent; // data packet sent
-+ unsigned int tx_failed; //
-+ unsigned int tx_acks; // sent packet with just ACK
-+
-+ __u32 pt_seq;
-+ struct timeval pt_time;
-+ unsigned int rtt;
-+};
-+
-+static struct pppox_sock * lookup_chan(__u16 call_id)
-+{
-+ struct pppox_sock *po;
-+ read_lock_bh(&chan_lock);
-+ for(po=chans[HASH(call_id)]; po; po=po->next)
-+ if (po->proto.pptp.src_addr.call_id==call_id)
-+ break;
-+ read_unlock_bh(&chan_lock);
-+ return po;
-+}
-+
-+static void add_chan(struct pppox_sock *po)
-+{
-+ write_lock_bh(&chan_lock);
-+ po->next=chans[HASH(po->proto.pptp.src_addr.call_id)];
-+ chans[HASH(po->proto.pptp.src_addr.call_id)]=po;
-+ write_unlock_bh(&chan_lock);
-+}
-+
-+static void add_free_chan(struct pppox_sock *po)
-+{
-+ __u16 call_id=1;
-+ struct pppox_sock *p;
-+
-+ write_lock_bh(&chan_lock);
-+ for(call_id=1; call_id<65535; call_id++) {
-+ for(p=chans[HASH(call_id)]; p; p=p->next)
-+ if (p->proto.pptp.src_addr.call_id==call_id)
-+ break;
-+ if (!p){
-+ po->proto.pptp.src_addr.call_id=call_id;
-+ po->next=chans[HASH(call_id)];
-+ chans[HASH(call_id)]=po;
-+ break;
-+ }
-+ }
-+ write_unlock_bh(&chan_lock);
-+}
-+
-+static void del_chan(struct pppox_sock *po)
-+{
-+ struct pppox_sock *p1,*p2;
-+ write_lock_bh(&chan_lock);
-+ for(p2=NULL,p1=chans[HASH(po->proto.pptp.src_addr.call_id)]; p1 && p1!=po;
-+ p2=p1,p1=p1->next);
-+ if (p2) p2->next=p1->next;
-+ else chans[HASH(po->proto.pptp.src_addr.call_id)]=p1->next;
-+ write_unlock_bh(&chan_lock);
-+}
-+
-+static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
-+{
-+ struct sock *sk = (struct sock *) chan->private;
-+ struct pppox_sock *po = pppox_sk(sk);
-+ struct pptp_opt *opt=&po->proto.pptp;
-+ struct pptp_gre_header *hdr;
-+ unsigned int header_len=sizeof(*hdr);
-+ int len=skb?skb->len:0;
-+ int err=0;
-+
-+ struct rtable *rt; /* Route to the other host */
-+ struct net_device *tdev; /* Device to other host */
-+ struct iphdr *iph; /* Our new IP header */
-+ int max_headroom; /* The extra header space needed */
-+
-+
-+ if (skb && opt->seq_sent-opt->ack_recv>opt->window){
-+ opt->pause=1;
-+ return 0;
-+ }
-+
-+ {
-+ struct flowi fl = { .oif = 0,
-+ .nl_u = { .ip4_u =
-+ { .daddr = opt->dst_addr.sin_addr.s_addr,
-+ .saddr = opt->src_addr.sin_addr.s_addr,
-+ .tos = RT_TOS(0) } },
-+ .proto = IPPROTO_GRE };
-+ if ((err=ip_route_output_key(&rt, &fl))) {
-+ goto tx_error;
-+ }
-+ }
-+ tdev = rt->u.dst.dev;
-+
-+ max_headroom = LL_RESERVED_SPACE(tdev) + sizeof(*iph)+sizeof(*hdr)+2;
-+
-+ if (!skb){
-+ skb=dev_alloc_skb(max_headroom);
-+ skb_reserve(skb,max_headroom-skb_headroom(skb));
-+ }else if (skb_headroom(skb) < max_headroom ||
-+ skb_cloned(skb) || skb_shared(skb)) {
-+ struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom);
-+ if (!new_skb) {
-+ ip_rt_put(rt);
-+ goto tx_error;
-+ }
-+ if (skb->sk)
-+ skb_set_owner_w(new_skb, skb->sk);
-+ dev_kfree_skb(skb);
-+ skb = new_skb;
-+ }
-+
-+ if (skb->len){
-+ int islcp;
-+ unsigned char *data=skb->data;
-+ islcp=((data[0] << 8) + data[1])== PPP_LCP && 1 <= data[2] && data[2] <= 7;
-+ if (islcp) {
-+ data=skb_push(skb,2);
-+ data[0]=0xff;
-+ data[1]=0x03;
-+ }
-+ }
-+ len=skb->len;
-+
-+ if (len==0) header_len-=sizeof(hdr->seq);
-+ if (opt->ack_sent == opt->seq_recv) header_len-=sizeof(hdr->ack);
-+
-+ skb->nh.raw = skb_push(skb, sizeof(*iph)+header_len);
-+ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
-+ IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
-+ IPSKB_REROUTED);
-+ #endif
-+ dst_release(skb->dst);
-+ skb->dst = &rt->u.dst;
-+
-+ /*
-+ * Push down and install the IP header.
-+ */
-+
-+ iph = skb->nh.iph;
-+ iph->version = 4;
-+ iph->ihl = sizeof(struct iphdr) >> 2;
-+ iph->frag_off = 0;//df;
-+ iph->protocol = IPPROTO_GRE;
-+ iph->tos = 0;
-+ iph->daddr = rt->rt_dst;
-+ iph->saddr = rt->rt_src;
-+ iph->ttl = dst_metric(&rt->u.dst, RTAX_HOPLIMIT);
-+
-+ hdr=(struct pptp_gre_header *)(iph+1);
-+ skb->h.raw = (char*)hdr;
-+
-+ hdr->flags = PPTP_GRE_FLAG_K;
-+ hdr->ver = PPTP_GRE_VER;
-+ hdr->protocol = htons(PPTP_GRE_PROTO);
-+ hdr->call_id = htons(opt->dst_addr.call_id);
-+
-+ if (!len){
-+ hdr->payload_len = 0;
-+ hdr->ver |= PPTP_GRE_FLAG_A;
-+ /* ack is in odd place because S == 0 */
-+ hdr->seq = htonl(opt->seq_recv);
-+ opt->ack_sent = opt->seq_recv;
-+ opt->stat->tx_acks++;
-+ }else {
-+ //if (!opt->seq_sent){
-+ //}
-+
-+ hdr->flags |= PPTP_GRE_FLAG_S;
-+ hdr->seq = htonl(opt->seq_sent++);
-+ if (log_level>=2)
-+ printk("PPTP: send packet: seq=%i",opt->seq_sent);
-+ if (opt->ack_sent != opt->seq_recv) {
-+ /* send ack with this message */
-+ hdr->ver |= PPTP_GRE_FLAG_A;
-+ hdr->ack = htonl(opt->seq_recv);
-+ opt->ack_sent = opt->seq_recv;
-+ if (log_level>=2)
-+ printk(" ack=%i",opt->seq_recv);
-+ }
-+ hdr->payload_len = htons(len);
-+ if (log_level>=2)
-+ printk("\n");
-+ }
-+
-+ nf_reset(skb);
-+
-+ skb->ip_summed = CHECKSUM_NONE;
-+ iph->tot_len = htons(skb->len);
-+ ip_select_ident(iph, &rt->u.dst, NULL);
-+ ip_send_check(iph);
-+
-+ err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, dst_output);
-+ if (err == NET_XMIT_SUCCESS || err == NET_XMIT_CN) {
-+ opt->stat->tx_sent++;
-+ if (!opt->stat->pt_seq){
-+ opt->stat->pt_seq = opt->seq_sent;
-+ do_gettimeofday(&opt->stat->pt_time);
-+ }
-+ }else goto tx_error;
-+
-+ return 1;
-+
-+tx_error:
-+ opt->stat->tx_failed++;
-+ if (!len) dev_kfree_skb(skb);
-+ return 1;
-+}
-+
-+static void ack_work(struct pppox_sock *po)
-+{
-+ struct pptp_opt *opt=&po->proto.pptp;
-+ if (opt->ack_sent != opt->seq_recv)
-+ pptp_xmit(&po->chan,0);
-+
-+ if (!opt->proc){
-+ char unit[10];
-+ opt->proc=1;
-+ sprintf(unit,"ppp%i",ppp_unit_number(&po->chan));
-+ create_proc_read_entry(unit,0,proc_dir,read_proc,po);
-+ }
-+}
-+
-+static int get_seq(struct sk_buff *skb)
-+{
-+ struct iphdr *iph;
-+ u8 *payload;
-+ struct pptp_gre_header *header;
-+
-+ iph = (struct iphdr*)skb->data;
-+ payload = skb->data + (iph->ihl << 2);
-+ header = (struct pptp_gre_header *)(payload);
-+
-+ return ntohl(header->seq);
-+}
-+static void buf_work(struct pppox_sock *po)
-+{
-+ struct timeval tv1,tv2;
-+ struct sk_buff *skb;
-+ struct pptp_opt *opt=&po->proto.pptp;
-+ unsigned int t;
-+
-+ do_gettimeofday(&tv1);
-+ spin_lock_bh(&opt->skb_buf_lock);
-+ while((skb=skb_dequeue(&opt->skb_buf))){
-+ if (!__pptp_rcv(po,skb,0)){
-+ skb_get_timestamp(skb,&tv2);
-+ t=(tv1.tv_sec-tv2.tv_sec)*1000000+(tv1.tv_usec-tv2.tv_usec);
-+ if (t<opt->stat->rtt){
-+ skb_queue_head(&opt->skb_buf,skb);
-+ schedule_delayed_work(&opt->buf_work,t/100*HZ/10000);
-+ goto exit;
-+ }
-+ t=get_seq(skb)-1;
-+ opt->stat->rx_lost+=t-opt->seq_recv;
-+ opt->seq_recv=t;
-+ __pptp_rcv(po,skb,0);
-+ }
-+ }
-+exit:
-+ spin_unlock_bh(&opt->skb_buf_lock);
-+}
-+
-+
-+#define MISSING_WINDOW 20
-+#define WRAPPED( curseq, lastseq) \
-+ ((((curseq) & 0xffffff00) == 0) && \
-+ (((lastseq) & 0xffffff00 ) == 0xffffff00))
-+static int __pptp_rcv(struct pppox_sock *po,struct sk_buff *skb,int new)
-+{
-+ struct pptp_opt *opt=&po->proto.pptp;
-+ int headersize,payload_len,seq;
-+ __u8 *payload;
-+ struct pptp_gre_header *header;
-+
-+ header = (struct pptp_gre_header *)(skb->data);
-+
-+ if (new){
-+ /* test if acknowledgement present */
-+ if (PPTP_GRE_IS_A(header->ver)){
-+ __u32 ack = (PPTP_GRE_IS_S(header->flags))?
-+ header->ack:header->seq; /* ack in different place if S = 0 */
-+ ack = ntohl( ack);
-+ if (ack > opt->ack_recv) opt->ack_recv = ack;
-+ /* also handle sequence number wrap-around */
-+ if (WRAPPED(ack,opt->ack_recv)) opt->ack_recv = ack;
-+ if (opt->stat->pt_seq && opt->ack_recv > opt->stat->pt_seq){
-+ struct timeval tv;
-+ unsigned int rtt;
-+ do_gettimeofday(&tv);
-+ rtt = (tv.tv_sec - opt->stat->pt_time.tv_sec)*1000000+
-+ tv.tv_usec-opt->stat->pt_time.tv_usec;
-+ opt->stat->rtt = (opt->stat->rtt + rtt) / 2;
-+ if (opt->stat->rtt>opt->timeout) opt->stat->rtt=opt->timeout;
-+ opt->stat->pt_seq=0;
-+ }
-+ if (opt->pause){
-+ opt->pause=0;
-+ ppp_output_wakeup(&po->chan);
-+ }
-+ }
-+
-+ /* test if payload present */
-+ if (!PPTP_GRE_IS_S(header->flags)){
-+ opt->stat->rx_acks++;
-+ goto drop;
-+ }
-+ }
-+
-+ headersize = sizeof(*header);
-+ payload_len = ntohs(header->payload_len);
-+ seq = ntohl(header->seq);
-+
-+ /* no ack present? */
-+ if (!PPTP_GRE_IS_A(header->ver)) headersize -= sizeof(header->ack);
-+ /* check for incomplete packet (length smaller than expected) */
-+ if (skb->len- headersize < payload_len){
-+ if (log_level>=1)
-+ printk("PPTP: discarding truncated packet (expected %d, got %d bytes)\n",
-+ payload_len, skb->len- headersize);
-+ opt->stat->rx_truncated++;
-+ goto drop;
-+ }
-+
-+ payload=skb->data+headersize;
-+ /* check for expected sequence number */
-+ if ((seq == opt->seq_recv + 1) || (!opt->timeout &&
-+ (seq > opt->seq_recv + 1 || WRAPPED(seq, opt->seq_recv)))){
-+ if ( log_level >= 2 )
-+ printk("PPTP: accepting packet %d size=%i (%02x %02x %02x %02x %02x %02x)\n", seq,payload_len,
-+ *(payload +0),
-+ *(payload +1),
-+ *(payload +2),
-+ *(payload +3),
-+ *(payload +4),
-+ *(payload +5));
-+ opt->stat->rx_accepted++;
-+ opt->stat->rx_lost+=seq-(opt->seq_recv + 1);
-+ opt->seq_recv = seq;
-+ schedule_work(&opt->ack_work);
-+
-+ skb_pull(skb,headersize);
-+
-+ if (payload[0] == PPP_ALLSTATIONS && payload[1] == PPP_UI){
-+ /* chop off address/control */
-+ if (skb->len < 3)
-+ goto drop;
-+ skb_pull(skb,2);
-+ }
-+
-+ if ((*skb->data) & 1){
-+ /* protocol is compressed */
-+ skb_push(skb, 1)[0] = 0;
-+ }
-+
-+ ppp_input(&po->chan,skb);
-+
-+ return 1;
-+ /* out of order, check if the number is too low and discard the packet.
-+ * (handle sequence number wrap-around, and try to do it right) */
-+ }else if ( seq < opt->seq_recv + 1 || WRAPPED(opt->seq_recv, seq) ){
-+ if ( log_level >= 1)
-+ printk("PPTP: discarding duplicate or old packet %d (expecting %d)\n",
-+ seq, opt->seq_recv + 1);
-+ opt->stat->rx_underwin++;
-+ /* sequence number too high, is it reasonably close? */
-+ }else if ( seq < opt->seq_recv + MISSING_WINDOW ||
-+ WRAPPED(seq, opt->seq_recv + MISSING_WINDOW) ){
-+ opt->stat->rx_buffered++;
-+ if ( log_level >= 1 && new )
-+ printk("PPTP: buffering packet %d (expecting %d, lost or reordered)\n",
-+ seq, opt->seq_recv+1);
-+ return 0;
-+ /* no, packet must be discarded */
-+ }else{
-+ if ( log_level >= 1 )
-+ printk("PPTP: discarding bogus packet %d (expecting %d)\n",
-+ seq, opt->seq_recv + 1);
-+ }
-+drop:
-+ kfree_skb(skb);
-+ return -1;
-+}
-+
-+
-+static int pptp_rcv(struct sk_buff *skb)
-+{
-+ struct pptp_gre_header *header;
-+ struct pppox_sock *po;
-+ struct pptp_opt *opt;
-+
-+ if (!pskb_may_pull(skb, 12))
-+ goto drop;
-+
-+ header = (struct pptp_gre_header *)skb->data;
-+
-+ if ( /* version should be 1 */
-+ ((header->ver & 0x7F) != PPTP_GRE_VER) ||
-+ /* PPTP-GRE protocol for PPTP */
-+ (ntohs(header->protocol) != PPTP_GRE_PROTO)||
-+ /* flag C should be clear */
-+ PPTP_GRE_IS_C(header->flags) ||
-+ /* flag R should be clear */
-+ PPTP_GRE_IS_R(header->flags) ||
-+ /* flag K should be set */
-+ (!PPTP_GRE_IS_K(header->flags)) ||
-+ /* routing and recursion ctrl = 0 */
-+ ((header->flags&0xF) != 0)){
-+ /* if invalid, discard this packet */
-+ if (log_level>=1)
-+ printk("PPTP: Discarding GRE: %X %X %X %X %X %X\n",
-+ header->ver&0x7F, ntohs(header->protocol),
-+ PPTP_GRE_IS_C(header->flags),
-+ PPTP_GRE_IS_R(header->flags),
-+ PPTP_GRE_IS_K(header->flags),
-+ header->flags & 0xF);
-+ goto drop;
-+ }
-+
-+ dst_release(skb->dst);
-+ skb->dst = NULL;
-+ nf_reset(skb);
-+
-+ if ((po=lookup_chan(htons(header->call_id)))) {
-+ if (!(sk_pppox(po)->sk_state&PPPOX_BOUND))
-+ goto drop;
-+ if (__pptp_rcv(po,skb,1))
-+ buf_work(po);
-+ else{
-+ struct timeval tv;
-+ do_gettimeofday(&tv);
-+ skb_set_timestamp(skb,&tv);
-+ opt=&po->proto.pptp;
-+ spin_lock(&opt->skb_buf_lock);
-+ skb_queue_tail(&opt->skb_buf, skb);
-+ spin_unlock(&opt->skb_buf_lock);
-+ schedule_delayed_work(&opt->buf_work,opt->stat->rtt/100*HZ/10000);
-+ }
-+ goto out;
-+ }else{
-+ if (log_level>=1)
-+ printk("PPTP: Discarding packet from unknown call_id %i\n",header->call_id);
-+ icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PROT_UNREACH, 0);
-+ }
-+
-+drop:
-+ kfree_skb(skb);
-+out:
-+ return 0;
-+}
-+
-+
-+
-+static int proc_output (struct pppox_sock *po,char *buf)
-+{
-+ struct gre_statistics *stat=po->proto.pptp.stat;
-+ char *p=buf;
-+ p+=sprintf(p,"rx accepted = %d\n",stat->rx_accepted);
-+ p+=sprintf(p,"rx lost = %d\n",stat->rx_lost);
-+ p+=sprintf(p,"rx under win = %d\n",stat->rx_underwin);
-+ p+=sprintf(p,"rx buffered = %d\n",stat->rx_buffered);
-+ p+=sprintf(p,"rx invalid = %d\n",stat->rx_invalid);
-+ p+=sprintf(p,"rx acks = %d\n",stat->rx_acks);
-+ p+=sprintf(p,"tx sent = %d\n",stat->tx_sent);
-+ p+=sprintf(p,"tx failed = %d\n",stat->tx_failed);
-+ p+=sprintf(p,"tx acks = %d\n",stat->tx_acks);
-+
-+ return p-buf;
-+}
-+static int read_proc(char *page, char **start, off_t off,int count, int *eof, void *data)
-+{
-+ struct pppox_sock *po = data;
-+ int len = proc_output (po,page);
-+ if (len <= off+count) *eof = 1;
-+ *start = page + off;
-+ len -= off;
-+ if (len>count) len = count;
-+ if (len<0) len = 0;
-+ return len;
-+}
-+
-+static int pptp_bind(struct socket *sock,struct sockaddr *uservaddr,int sockaddr_len)
-+{
-+ struct sock *sk = sock->sk;
-+ struct sockaddr_pppox *sp = (struct sockaddr_pppox *) uservaddr;
-+ struct pppox_sock *po = pppox_sk(sk);
-+ struct pptp_opt *opt=&po->proto.pptp;
-+ int error=0;
-+
-+ if (log_level>=1)
-+ printk("PPTP: bind: addr=%X call_id=%i\n",sp->sa_addr.pptp.sin_addr.s_addr,
-+ sp->sa_addr.pptp.call_id);
-+ lock_sock(sk);
-+
-+ opt->src_addr=sp->sa_addr.pptp;
-+ if (sp->sa_addr.pptp.call_id){
-+ if (lookup_chan(sp->sa_addr.pptp.call_id)){
-+ error=-EBUSY;
-+ goto end;
-+ }
-+ add_chan(po);
-+ }else{
-+ add_free_chan(po);
-+ if (!opt->src_addr.call_id)
-+ error=-EBUSY;
-+ if (log_level>=1)
-+ printk("PPTP: using call_id %i\n",opt->src_addr.call_id);
-+ }
-+
-+ end:
-+ release_sock(sk);
-+ return error;
-+}
-+
-+static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
-+ int sockaddr_len, int flags)
-+{
-+ struct sock *sk = sock->sk;
-+ struct sockaddr_pppox *sp = (struct sockaddr_pppox *) uservaddr;
-+ struct pppox_sock *po = pppox_sk(sk);
-+ struct pptp_opt *opt=&po->proto.pptp;
-+ int error=0;
-+
-+ if (log_level>=1)
-+ printk("PPTP: connect: addr=%X call_id=%i\n",
-+ sp->sa_addr.pptp.sin_addr.s_addr,sp->sa_addr.pptp.call_id);
-+
-+ lock_sock(sk);
-+
-+ if (sp->sa_protocol != PX_PROTO_PPTP){
-+ error = -EINVAL;
-+ goto end;
-+ }
-+
-+ /* Check for already bound sockets */
-+ if (sk->sk_state & PPPOX_CONNECTED){
-+ error = -EBUSY;
-+ goto end;
-+ }
-+
-+ /* Check for already disconnected sockets, on attempts to disconnect */
-+ if (sk->sk_state & PPPOX_DEAD){
-+ error = -EALREADY;
-+ goto end;
-+ }
-+
-+ if (!opt->src_addr.sin_addr.s_addr || !sp->sa_addr.pptp.sin_addr.s_addr){
-+ error = -EINVAL;
-+ goto end;
-+ }
-+
-+ po->chan.private=sk;
-+ po->chan.ops=&pptp_chan_ops;
-+ po->chan.mtu=PPP_MTU;
-+ po->chan.hdrlen=2+sizeof(struct pptp_gre_header);
-+ error = ppp_register_channel(&po->chan);
-+ if (error){
-+ printk(KERN_ERR "PPTP: failed to register PPP channel (%d)\n",error);
-+ goto end;
-+ }
-+
-+ opt->dst_addr=sp->sa_addr.pptp;
-+ sk->sk_state = PPPOX_CONNECTED;
-+
-+ end:
-+ release_sock(sk);
-+ return error;
-+}
-+
-+static int pptp_getname(struct socket *sock, struct sockaddr *uaddr,
-+ int *usockaddr_len, int peer)
-+{
-+ int len = sizeof(struct sockaddr_pppox);
-+ struct sockaddr_pppox sp;
-+
-+ sp.sa_family = AF_PPPOX;
-+ sp.sa_protocol = PX_PROTO_PPTP;
-+ sp.sa_addr.pptp=pppox_sk(sock->sk)->proto.pptp.src_addr;
-+
-+ memcpy(uaddr, &sp, len);
-+
-+ *usockaddr_len = len;
-+
-+ return 0;
-+}
-+
-+static int pptp_setsockopt(struct socket *sock, int level, int optname,
-+ char* optval, int optlen)
-+{
-+ struct sock *sk = sock->sk;
-+ struct pppox_sock *po = pppox_sk(sk);
-+ struct pptp_opt *opt=&po->proto.pptp;
-+ int val;
-+
-+ if (optlen!=sizeof(int))
-+ return -EINVAL;
-+
-+ if (get_user(val,(int __user*)optval))
-+ return -EFAULT;
-+
-+ switch(optname) {
-+ case PPTP_SO_TIMEOUT:
-+ opt->timeout=val;
-+ break;
-+ case PPTP_SO_WINDOW:
-+ opt->window=val;
-+ break;
-+ default:
-+ return -ENOPROTOOPT;
-+ }
-+
-+ return 0;
-+}
-+
-+static int pptp_getsockopt(struct socket *sock, int level, int optname,
-+ char* optval, int *optlen)
-+{
-+ struct sock *sk = sock->sk;
-+ struct pppox_sock *po = pppox_sk(sk);
-+ struct pptp_opt *opt=&po->proto.pptp;
-+ int len,val;
-+
-+ if (get_user(len,(int __user*)optlen))
-+ return -EFAULT;
-+
-+ if (len<sizeof(int))
-+ return -EINVAL;
-+
-+ switch(optname) {
-+ case PPTP_SO_TIMEOUT:
-+ val=opt->timeout;
-+ break;
-+ case PPTP_SO_WINDOW:
-+ val=opt->window;
-+ break;
-+ default:
-+ return -ENOPROTOOPT;
-+ }
-+
-+ if (put_user(sizeof(int),(int __user*)optlen))
-+ return -EFAULT;
-+
-+ if (put_user(val,(int __user*)optval))
-+ return -EFAULT;
-+
-+ return 0;
-+}
-+
-+static int pptp_release(struct socket *sock)
-+{
-+ struct sock *sk = sock->sk;
-+ struct pppox_sock *po;
-+ struct pptp_opt *opt;
-+ int error = 0;
-+
-+ if (!sk)
-+ return 0;
-+
-+ if (sock_flag(sk, SOCK_DEAD))
-+ return -EBADF;
-+
-+ po = pppox_sk(sk);
-+ opt=&po->proto.pptp;
-+ if (opt->src_addr.sin_addr.s_addr) {
-+ cancel_delayed_work(&opt->buf_work);
-+ flush_scheduled_work();
-+ del_chan(po);
-+ skb_queue_purge(&opt->skb_buf);
-+
-+ if (opt->proc){
-+ char unit[10];
-+ sprintf(unit,"ppp%i",ppp_unit_number(&po->chan));
-+ remove_proc_entry(unit,proc_dir);
-+ }
-+ }
-+
-+ pppox_unbind_sock(sk);
-+
-+ kfree(opt->stat);
-+
-+ /* Signal the death of the socket. */
-+ sk->sk_state = PPPOX_DEAD;
-+
-+ sock_orphan(sk);
-+ sock->sk = NULL;
-+
-+ skb_queue_purge(&sk->sk_receive_queue);
-+ sock_put(sk);
-+
-+ return error;
-+}
-+
-+
-+static struct proto pptp_sk_proto = {
-+ .name = "PPTP",
-+ .owner = THIS_MODULE,
-+ .obj_size = sizeof(struct pppox_sock),
-+};
-+
-+static const struct proto_ops pptp_ops = {
-+ .family = AF_PPPOX,
-+ .owner = THIS_MODULE,
-+ .release = pptp_release,
-+ .bind = pptp_bind,
-+ .connect = pptp_connect,
-+ .socketpair = sock_no_socketpair,
-+ .accept = sock_no_accept,
-+ .getname = pptp_getname,
-+ .poll = sock_no_poll,
-+ .listen = sock_no_listen,
-+ .shutdown = sock_no_shutdown,
-+ .setsockopt = pptp_setsockopt,
-+ .getsockopt = pptp_getsockopt,
-+ .sendmsg = sock_no_sendmsg,
-+ .recvmsg = sock_no_recvmsg,
-+ .mmap = sock_no_mmap,
-+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
-+ .ioctl = pppox_ioctl,
-+ #endif
-+};
-+
-+static int pptp_create(struct socket *sock)
-+{
-+ int error = -ENOMEM;
-+ struct sock *sk;
-+ struct pppox_sock *po;
-+ struct pptp_opt *opt;
-+
-+ sk = sk_alloc(PF_PPPOX, GFP_KERNEL, &pptp_sk_proto, 1);
-+ if (!sk)
-+ goto out;
-+
-+ sock_init_data(sock, sk);
-+
-+ sock->state = SS_UNCONNECTED;
-+ sock->ops = &pptp_ops;
-+
-+ //sk->sk_backlog_rcv = pppoe_rcv_core;
-+ sk->sk_state = PPPOX_NONE;
-+ sk->sk_type = SOCK_STREAM;
-+ sk->sk_family = PF_PPPOX;
-+ sk->sk_protocol = PX_PROTO_PPTP;
-+
-+ po = pppox_sk(sk);
-+ opt=&po->proto.pptp;
-+
-+ opt->window=min_window;
-+ opt->timeout=0;
-+ opt->seq_sent=0; opt->seq_recv=-1;
-+ opt->ack_recv=0; opt->ack_sent=-1;
-+ skb_queue_head_init(&opt->skb_buf);
-+ opt->skb_buf_lock=SPIN_LOCK_UNLOCKED;
-+ INIT_WORK(&opt->ack_work,(void(*)(void*))ack_work,sk);
-+ INIT_WORK(&opt->buf_work,(void(*)(void*))buf_work,sk);
-+ opt->stat=kzalloc(sizeof(*opt->stat),GFP_KERNEL);
-+
-+ error = 0;
-+out:
-+ return error;
-+}
-+
-+
-+static struct pppox_proto pppox_pptp_proto = {
-+ .create = pptp_create,
-+ //.ioctl = pptp_ioctl,
-+ .owner = THIS_MODULE,
-+};
-+
-+static struct net_protocol net_pptp_protocol = {
-+ .handler = pptp_rcv,
-+ //.err_handler = ipgre_err,
-+};
-+
-+
-+static int pptp_init_module(void)
-+{
-+ int err=0;
-+ printk(KERN_INFO "PPTP driver version " PPTP_DRIVER_VERSION "\n");
-+
-+ if (inet_add_protocol(&net_pptp_protocol, IPPROTO_GRE) < 0) {
-+ printk(KERN_INFO "PPTP: can't add protocol\n");
-+ goto out;
-+ }
-+
-+ err = proto_register(&pptp_sk_proto, 0);
-+ if (err){
-+ printk(KERN_INFO "PPTP: can't register sk_proto\n");
-+ goto out_inet_del_protocol;
-+ }
-+
-+ err = register_pppox_proto(PX_PROTO_PPTP, &pppox_pptp_proto);
-+ if (err){
-+ printk(KERN_INFO "PPTP: can't register pppox_proto\n");
-+ goto out_unregister_sk_proto;
-+ }
-+
-+ proc_dir=proc_mkdir("pptp",NULL);
-+ if (!proc_dir){
-+ printk(KERN_ERR "PPTP: failed to create proc dir\n");
-+ }
-+ //console_verbose();
-+
-+out:
-+ return err;
-+out_unregister_sk_proto:
-+ proto_unregister(&pptp_sk_proto);
-+out_inet_del_protocol:
-+ inet_del_protocol(&net_pptp_protocol, IPPROTO_GRE);
-+ goto out;
-+}
-+
-+static void pptp_exit_module(void)
-+{
-+ unregister_pppox_proto(PX_PROTO_PPTP);
-+ proto_unregister(&pptp_sk_proto);
-+ inet_del_protocol(&net_pptp_protocol, IPPROTO_GRE);
-+
-+ if (proc_dir)
-+ remove_proc_entry("pptp",NULL);
-+}
-+
-+
-+module_init(pptp_init_module);
-+module_exit(pptp_exit_module);
-diff -uprN linux-2.6.18.orig/include/linux/if_pppox.h linux-2.6.18.pptp/include/linux/if_pppox.h
---- linux-2.6.18.orig/include/linux/if_pppox.h 2006-10-30 13:20:48.000000000 +0300
-+++ linux-2.6.18.pptp/include/linux/if_pppox.h 2006-10-30 11:35:35.000000000 +0300
-@@ -1,6 +1,6 @@
- /***************************************************************************
- * Linux PPP over X - Generic PPP transport layer sockets
-- * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516)
-+ * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516)
- *
- * This file supplies definitions required by the PPP over Ethernet driver
- * (pppox.c). All version information wrt this file is located in pppox.c
-@@ -19,6 +19,7 @@
-
- #include <asm/types.h>
- #include <asm/byteorder.h>
-+#include <linux/in.h>
-
- #ifdef __KERNEL__
- #include <linux/if_ether.h>
-@@ -36,29 +37,35 @@
- #define PF_PPPOX AF_PPPOX
- #endif /* !(AF_PPPOX) */
-
--/************************************************************************
-- * PPPoE addressing definition
-- */
--typedef __u16 sid_t;
--struct pppoe_addr{
-- sid_t sid; /* Session identifier */
-- unsigned char remote[ETH_ALEN]; /* Remote address */
-- char dev[IFNAMSIZ]; /* Local device to use */
--};
--
--/************************************************************************
-- * Protocols supported by AF_PPPOX
-- */
-+/************************************************************************
-+ * PPPoE addressing definition
-+ */
-+typedef __u16 sid_t;
-+struct pppoe_addr{
-+ sid_t sid; /* Session identifier */
-+ unsigned char remote[ETH_ALEN]; /* Remote address */
-+ char dev[IFNAMSIZ]; /* Local device to use */
-+};
-+
-+struct pptp_addr{
-+ __u16 call_id;
-+ struct in_addr sin_addr;
-+};
-+/************************************************************************
-+ * Protocols supported by AF_PPPOX
-+ */
- #define PX_PROTO_OE 0 /* Currently just PPPoE */
--#define PX_MAX_PROTO 1
--
--struct sockaddr_pppox {
-- sa_family_t sa_family; /* address family, AF_PPPOX */
-- unsigned int sa_protocol; /* protocol identifier */
-- union{
-- struct pppoe_addr pppoe;
-- }sa_addr;
--}__attribute__ ((packed));
-+#define PX_PROTO_PPTP 1
-+#define PX_MAX_PROTO 2
-+
-+struct sockaddr_pppox {
-+ sa_family_t sa_family; /* address family, AF_PPPOX */
-+ unsigned int sa_protocol; /* protocol identifier */
-+ union{
-+ struct pppoe_addr pppoe;
-+ struct pptp_addr pptp;
-+ }sa_addr;
-+}__attribute__ ((packed));
-
-
- /*********************************************************************
-@@ -111,6 +118,12 @@ struct pppoe_hdr {
- struct pppoe_tag tag[0];
- } __attribute__ ((packed));
-
-+
-+/* Socket options */
-+#define PPTP_SO_TIMEOUT 1
-+#define PPTP_SO_WINDOW 2
-+
-+
- #ifdef __KERNEL__
- struct pppoe_opt {
- struct net_device *dev; /* device associated with socket*/
-@@ -118,6 +131,21 @@ struct pppoe_opt {
- struct sockaddr_pppox relay; /* what socket data will be
- relayed to (PPPoE relaying) */
- };
-+struct pptp_opt {
-+ struct pptp_addr src_addr;
-+ struct pptp_addr dst_addr;
-+ int timeout;
-+ int window;
-+ __u32 ack_sent, ack_recv;
-+ __u32 seq_sent, seq_recv;
-+ int pause:1;
-+ int proc:1;
-+ spinlock_t skb_buf_lock;
-+ struct sk_buff_head skb_buf;
-+ struct work_struct ack_work; //send ack work
-+ struct work_struct buf_work; //check bufferd packets work
-+ struct gre_statistics *stat;
-+};
-
- #include <net/sock.h>
-
-@@ -128,6 +156,7 @@ struct pppox_sock {
- struct pppox_sock *next; /* for hash table */
- union {
- struct pppoe_opt pppoe;
-+ struct pptp_opt pptp;
- } proto;
- unsigned short num;
- };
-diff -uprN linux-2.6.18.orig/MAINTAINERS linux-2.6.18.pptp/MAINTAINERS
---- linux-2.6.18.orig/MAINTAINERS 2006-10-30 13:20:47.000000000 +0300
-+++ linux-2.6.18.pptp/MAINTAINERS 2006-10-30 13:21:45.000000000 +0300
-@@ -2325,6 +2325,11 @@ P: Michal Ostrowski
- M: mostrows@speakeasy.net
- S: Maintained
-
-+PPTP
-+P: Dmitry Kozlov
-+M: xeb@mail.ru
-+S: Maintained
-+
- PREEMPTIBLE KERNEL
- P: Robert Love
- M: rml@tech9.net
diff --git a/kernel/patch/ppp-generic-smp-2.6.26.patch b/kernel/patch/ppp-generic-smp-2.6.26.patch
deleted file mode 100644
index 0354914..0000000
--- a/kernel/patch/ppp-generic-smp-2.6.26.patch
+++ /dev/null
@@ -1,165 +0,0 @@
---- 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);
- }
-
- /*
diff --git a/kernel/patch/ppp-generic-smp-2.6.28.patch b/kernel/patch/ppp-generic-smp-2.6.28.patch
deleted file mode 100644
index 65a218a..0000000
--- a/kernel/patch/ppp-generic-smp-2.6.28.patch
+++ /dev/null
@@ -1,163 +0,0 @@
---- 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);
- }
-
- /*
diff --git a/pppd_plugin/AUTHORS b/pppd_plugin/AUTHORS
deleted file mode 100644
index b93df1d..0000000
--- a/pppd_plugin/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Kozlov D. <xeb@mail.ru>
diff --git a/pppd_plugin/COPYING b/pppd_plugin/COPYING
deleted file mode 100644
index 5b6e7c6..0000000
--- a/pppd_plugin/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- 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.
diff --git a/pppd_plugin/ChangeLog b/pppd_plugin/ChangeLog
deleted file mode 100644
index e69de29..0000000
--- a/pppd_plugin/ChangeLog
+++ /dev/null
diff --git a/pppd_plugin/Doxyfile b/pppd_plugin/Doxyfile
deleted file mode 100644
index 8392c62..0000000
--- a/pppd_plugin/Doxyfile
+++ /dev/null
@@ -1,275 +0,0 @@
-# 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
diff --git a/pppd_plugin/INSTALL b/pppd_plugin/INSTALL
deleted file mode 100644
index 02a4a07..0000000
--- a/pppd_plugin/INSTALL
+++ /dev/null
@@ -1,167 +0,0 @@
-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.
-
diff --git a/pppd_plugin/Makefile.am b/pppd_plugin/Makefile.am
deleted file mode 100644
index 02520f2..0000000
--- a/pppd_plugin/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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
diff --git a/pppd_plugin/Makefile.cvs b/pppd_plugin/Makefile.cvs
deleted file mode 100644
index d160702..0000000
--- a/pppd_plugin/Makefile.cvs
+++ /dev/null
@@ -1,8 +0,0 @@
-default: all
-
-all:
- aclocal
- autoheader
- automake
- autoconf
-
diff --git a/pppd_plugin/Makefile.in b/pppd_plugin/Makefile.in
deleted file mode 100644
index 2a6d37b..0000000
--- a/pppd_plugin/Makefile.in
+++ /dev/null
@@ -1,618 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/config.h.in \
- $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
- TODO config.guess config.sub depcomp install-sh ltmain.sh \
- missing mkinstalldirs
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- { test ! -d $(distdir) \
- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr $(distdir); }; }
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-distuninstallcheck_listfiles = find . -type f -print
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-GREP = @GREP@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-
-# 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
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-am--refresh:
- @:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-
-config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
- else :; fi
-
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- mkdir $(distdir)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(mkdir_p) "$(distdir)/$$subdir" \
- || exit 1; \
- distdir=`$(am__cd) $(distdir) && pwd`; \
- top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
- (cd $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$top_distdir" \
- distdir="$$distdir/$$subdir" \
- distdir) \
- || exit 1; \
- fi; \
- done
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r $(distdir)
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
- $(am__remove_distdir)
-
-dist-tarZ: distdir
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__remove_distdir)
-
-dist-shar: distdir
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__remove_distdir)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__remove_distdir)
-
-dist dist-all: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
- chmod a-w $(distdir)
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && cd $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
- $(am__remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
-distuninstallcheck:
- @cd $(distuninstallcheck_dir) \
- && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
-check: check-recursive
-all-am: Makefile config.h
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-hdr \
- distclean-libtool distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-am clean clean-generic clean-libtool clean-recursive \
- ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
- dist-shar dist-tarZ dist-zip distcheck distclean \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-recursive distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am maintainer-clean maintainer-clean-generic \
- maintainer-clean-recursive mostlyclean mostlyclean-generic \
- mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
- tags tags-recursive uninstall uninstall-am uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/pppd_plugin/NEWS b/pppd_plugin/NEWS
deleted file mode 100644
index e69de29..0000000
--- a/pppd_plugin/NEWS
+++ /dev/null
diff --git a/pppd_plugin/README b/pppd_plugin/README
deleted file mode 100644
index e69de29..0000000
--- a/pppd_plugin/README
+++ /dev/null
diff --git a/pppd_plugin/TODO b/pppd_plugin/TODO
deleted file mode 100644
index e69de29..0000000
--- a/pppd_plugin/TODO
+++ /dev/null
diff --git a/pppd_plugin/aclocal.m4 b/pppd_plugin/aclocal.m4
deleted file mode 100644
index b7651b2..0000000
--- a/pppd_plugin/aclocal.m4
+++ /dev/null
@@ -1,7483 +0,0 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-
-# serial 51 AC_PROG_LIBTOOL
-
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
- [],
- [m4_define([AC_PROVIDE_IFELSE],
- [m4_ifdef([AC_PROVIDE_$1],
- [$2], [$3])])])
-
-
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
- AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [AC_LIBTOOL_CXX],
- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
- ])])
-dnl And a similar setup for Fortran 77 support
- AC_PROVIDE_IFELSE([AC_PROG_F77],
- [AC_LIBTOOL_F77],
- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
- AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [ifdef([AC_PROG_GCJ],
- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([A][M_PROG_GCJ],
- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([LT_AC_PROG_GCJ],
- [define([LT_AC_PROG_GCJ],
- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
-
-
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
-
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
-
-# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- AC_PATH_MAGIC
- fi
- ;;
-esac
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
- [AC_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
- [AC_HELP_STRING([--with-pic],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
- [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Check if we have a version mismatch between libtool.m4 and ltmain.sh.
-#
-# Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined.
-# We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually
-# calls AC_LIBTOOL_CONFIG and creates libtool.
-#
-_LT_VERSION_CHECK
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_VERSION_CHECK
-# -----------------
-AC_DEFUN([_LT_VERSION_CHECK],
-[AC_MSG_CHECKING([for correct ltmain.sh version])
-if test "x$ltmain" = "x" ; then
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([
-
-*** @<:@Gentoo@:>@ sanity check failed! ***
-*** \$ltmain is not defined, please check the patch for consistency! ***
-])
-fi
-gentoo_lt_version="1.5.24"
-gentoo_ltmain_version=`sed -n '/^[[ ]]*VERSION=/{s/^[[ ]]*VERSION=//;p;q;}' "$ltmain"`
-if test "x$gentoo_lt_version" != "x$gentoo_ltmain_version" ; then
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([
-
-*** @<:@Gentoo@:>@ sanity check failed! ***
-*** libtool.m4 and ltmain.sh have a version mismatch! ***
-*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) ***
-
-Please run:
-
- libtoolize --copy --force
-
-if appropriate, please contact the maintainer of this
-package (or your distribution) for help.
-])
-else
- AC_MSG_RESULT(yes)
-fi
-])# _LT_VERSION_CHECK
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_LINKER_BOILERPLATE
-
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
-
-
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
- [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
-
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
- ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X[$]1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-[$]*
-EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "[$]0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
- fi
- fi
- fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
-
-
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AC_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
- ])
-esac
-
-need_locks="$enable_libtool_lock"
-
-])# _LT_AC_LOCK
-
-
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$5], , :, [$5])
-else
- ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$4], , :, [$4])
-else
- ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
-
-# _LT_AC_CHECK_DLFCN
-# ------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
-
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ---------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}]
-EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-
-# AC_LIBTOOL_DLOPEN_SELF
-# ----------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
-
-
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
-
-hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-
-
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
-
-
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_AC_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_AC_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
-
-
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
-fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
-
-
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-m4_if($1,[],[
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
- else
- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[[lt_foo]]++; }
- if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
- sys_lib_search_path_spec=`echo $lt_search_path_spec`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[[123]]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- # Handle Gentoo/FreeBSD as it was Linux
- case $host_vendor in
- gentoo)
- version_type=linux ;;
- *)
- version_type=freebsd-$objformat ;;
- esac
-
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- linux)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- need_lib_prefix=no
- need_version=no
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[[3-9]]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_ARG_WITH([tags],
- [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
- [include additional configurations @<:@automatic@:>@])],
- [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- AC_MSG_WARN([output file `$ofile' does not exist])
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
- else
- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
- "") ;;
- *) AC_MSG_ERROR([invalid tag name: $tagname])
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- AC_MSG_ERROR([tag name \"$tagname\" already exists])
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_LIBTOOL_LANG_CXX_CONFIG
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
- AC_LIBTOOL_LANG_F77_CONFIG
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
- AC_LIBTOOL_LANG_GCJ_CONFIG
- else
- tagname=""
- fi
- ;;
-
- RC)
- AC_LIBTOOL_LANG_RC_CONFIG
- ;;
-
- *)
- AC_MSG_ERROR([Unsupported tag name: $tagname])
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- AC_MSG_ERROR([unable to update list of available tagged configurations.])
- fi
-fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
- [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-# set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
- [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
- [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognize shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognize a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# AC_PATH_MAGIC
-
-
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
- [AC_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- if ( file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[[3-9]]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-])# AC_DEPLIBS_CHECK_METHOD
-
-
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
-
-
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-])# AC_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# it is assumed to be `libltdl'. LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!). If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- case $enable_ltdl_convenience in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
- esac
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!). If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- AC_CHECK_LIB(ltdl, lt_dlinit,
- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
- [if test x"$enable_ltdl_install" = xno; then
- AC_MSG_WARN([libltdl not installed, but installation disabled])
- else
- enable_ltdl_install=yes
- fi
- ])
- if test x"$enable_ltdl_install" = x"yes"; then
- ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- else
- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
- LIBLTDL="-lltdl"
- LTDLINCL=
- fi
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ------------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# -------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF
-
-# Report which library types will actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- AC_PROG_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- freebsd[[12]]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- freebsd-elf*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*) ;;
- *)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- interix[[3-9]]*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
- _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
- _LT_AC_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
- _LT_AC_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-interix[[3-9]]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_AC_TAGVAR(predep_objects,$1)=
- _LT_AC_TAGVAR(postdep_objects,$1)=
- _LT_AC_TAGVAR(postdeps,$1)=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- #
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
- if test "$solaris_use_stlport4" != yes; then
- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
- program t
- end
-"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# -------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars. Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- _LT_AC_TAGVAR(compiler, $1) \
- _LT_AC_TAGVAR(CC, $1) \
- _LT_AC_TAGVAR(LD, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
- _LT_AC_TAGVAR(old_archive_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
- _LT_AC_TAGVAR(predep_objects, $1) \
- _LT_AC_TAGVAR(postdep_objects, $1) \
- _LT_AC_TAGVAR(predeps, $1) \
- _LT_AC_TAGVAR(postdeps, $1) \
- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
- _LT_AC_TAGVAR(archive_cmds, $1) \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
- _LT_AC_TAGVAR(postinstall_cmds, $1) \
- _LT_AC_TAGVAR(postuninstall_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
- _LT_AC_TAGVAR(allow_undefined_flag, $1) \
- _LT_AC_TAGVAR(no_undefined_flag, $1) \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
- _LT_AC_TAGVAR(hardcode_automatic, $1) \
- _LT_AC_TAGVAR(module_cmds, $1) \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) \
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
- _LT_AC_TAGVAR(fix_srcfile_path, $1) \
- _LT_AC_TAGVAR(exclude_expsyms, $1) \
- _LT_AC_TAGVAR(include_expsyms, $1); do
-
- case $var in
- _LT_AC_TAGVAR(old_archive_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
- _LT_AC_TAGVAR(archive_cmds, $1) | \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(module_cmds, $1) | \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\[$]0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
- ;;
- esac
-
-ifelse([$1], [],
- [cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- AC_MSG_NOTICE([creating $ofile])],
- [cfgfile="$ofile"])
-
- cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-])
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([LT_AC_PROG_SED])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux* | k*bsd*-gnu)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDGIRSTW]]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris*)
- symcode='[[BDRT]]'
- ;;
-sco3.2v5*)
- symcode='[[DT]]'
- ;;
-sysv4.2uw2*)
- symcode='[[DT]]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[[ABDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
- ;;
- esac
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- rdos*)
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-])
-
-
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
- ;;
- *)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-],[
- runpath_var=
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)=
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_AC_TAGVAR(hardcode_automatic, $1)=no
- _LT_AC_TAGVAR(module_cmds, $1)=
- _LT_AC_TAGVAR(module_expsym_cmds, $1)=
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_AC_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- _LT_CC_BASENAME([$compiler])
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- interix[[3-9]]*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- # see comment about different semantics on the GNU ld section
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- bsdi[[45]]*)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- freebsd1*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- os2*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_AC_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_MSG_CHECKING([whether -lc should be explicitly linked in])
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
- then
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
- ;;
- esac
- fi
- ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
-
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# # ifdef __CYGWIN32__
-# # define __CYGWIN__ __CYGWIN32__
-# # endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-# __hDllInstance_base = hInst;
-# return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
-
-
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
-
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)
-])
-
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
-
-
-# Cheap backport of AS_EXECUTABLE_P and required macros
-# from Autoconf 2.59; we should not use $as_executable_p directly.
-
-# _AS_TEST_PREPARE
-# ----------------
-m4_ifndef([_AS_TEST_PREPARE],
-[m4_defun([_AS_TEST_PREPARE],
-[if test -x / >/dev/null 2>&1; then
- as_executable_p='test -x'
-else
- as_executable_p='test -f'
-fi
-])])# _AS_TEST_PREPARE
-
-# AS_EXECUTABLE_P
-# ---------------
-# Check whether a file is executable.
-m4_ifndef([AS_EXECUTABLE_P],
-[m4_defun([AS_EXECUTABLE_P],
-[AS_REQUIRE([_AS_TEST_PREPARE])dnl
-$as_executable_p $1[]dnl
-])])# AS_EXECUTABLE_P
-
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])
-
-# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.9.6])])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 7
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 8
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 3
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 8
-
-# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 12
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $1 | $1:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake. There are at least two reasons why we must not
-# use `-m 0755':
-# - it causes special bits like SGID to be ignored,
-# - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out. Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
-AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-AC_SUBST([mkdir_p])])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
- [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
diff --git a/pppd_plugin/config.guess b/pppd_plugin/config.guess
deleted file mode 100755
index 6960a39..0000000
--- a/pppd_plugin/config.guess
+++ /dev/null
@@ -1,1532 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
-
-timestamp='2007-01-15'
-
-# This file 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
- eval $set_cc_for_build
- cat << EOF > $dummy.c
- #include <features.h>
- #ifdef __UCLIBC__
- # ifdef __UCLIBC_CONFIG_VERSION__
- LIBC=uclibc __UCLIBC_CONFIG_VERSION__
- # else
- LIBC=uclibc
- # endif
- #else
- LIBC=gnu
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
-fi
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- x86:Interix*:[3456]*)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T:Interix*:[3456]* | authenticamd:Interix*:[3456]*)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- cris:Linux:*:*)
- echo cris-axis-linux-${LIBC}
- exit ;;
- crisv32:Linux:*:*)
- echo crisv32-axis-linux-${LIBC}
- exit ;;
- frv:Linux:*:*)
- echo frv-unknown-linux-${LIBC}
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
- ;;
- or32:Linux:*:*)
- echo or32-unknown-linux-${LIBC}
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
- esac
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-${LIBC}
- exit ;;
- xtensa:Linux:*:*)
- echo xtensa-unknown-linux-${LIBC}
- exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
- exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
- exit ;;
- esac
- # This should get integrated into the C code below, but now we hack
- if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
-and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/pppd_plugin/config.h.in b/pppd_plugin/config.h.in
deleted file mode 100644
index 0d7a28a..0000000
--- a/pppd_plugin/config.h.in
+++ /dev/null
@@ -1,61 +0,0 @@
-/* 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
diff --git a/pppd_plugin/config.sub b/pppd_plugin/config.sub
deleted file mode 100755
index 2a4932e..0000000
--- a/pppd_plugin/config.sub
+++ /dev/null
@@ -1,1640 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
-
-timestamp='2007-01-18'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx | dvp \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | mt \
- | msp430 \
- | nios | nios2 \
- | ns16k | ns32k \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16c)
- basic_machine=cr16c-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mipsEE* | ee | ps2)
- basic_machine=mips64r5900el-scei
- case $os in
- -linux*)
- ;;
- *)
- os=-elf
- ;;
- esac
- ;;
- iop)
- basic_machine=mipsel-scei
- os=-irx
- ;;
- dvp)
- basic_machine=dvp-scei
- os=-elf
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/pppd_plugin/configure b/pppd_plugin/configure
deleted file mode 100755
index 74869a7..0000000
--- a/pppd_plugin/configure
+++ /dev/null
@@ -1,20887 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
-
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
-else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- case $as_dir in
- /*)
- for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
- done;;
- esac
-done
-IFS=$as_save_IFS
-
-
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
- ;;
-esac
-
-echo=${ECHO-echo}
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "$0" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL $0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL $0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "$0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
- fi
- fi
- fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
-
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
-
-exec 7<&0 </dev/null 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="configure.in"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-CYGPATH_W
-PACKAGE
-VERSION
-ACLOCAL
-AUTOCONF
-AUTOMAKE
-AUTOHEADER
-MAKEINFO
-install_sh
-STRIP
-INSTALL_STRIP_PROGRAM
-mkdir_p
-AWK
-SET_MAKE
-am__leading_dot
-AMTAR
-am__tar
-am__untar
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-DEPDIR
-am__include
-am__quote
-AMDEP_TRUE
-AMDEP_FALSE
-AMDEPBACKSLASH
-CCDEPMODE
-am__fastdepCC_TRUE
-am__fastdepCC_FALSE
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-SED
-GREP
-EGREP
-LN_S
-ECHO
-AR
-RANLIB
-CPP
-CXX
-CXXFLAGS
-ac_ct_CXX
-CXXDEPMODE
-am__fastdepCXX_TRUE
-am__fastdepCXX_FALSE
-CXXCPP
-F77
-FFLAGS
-ac_ct_F77
-LIBTOOL
-LIBOBJS
-LTLIBOBJS'
-ac_subst_files=''
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP
-CXX
-CXXFLAGS
-CCC
-CXXCPP
-F77
-FFLAGS'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute directory names.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --enable-shared[=PKGS] build shared libraries [default=yes]
- --enable-static[=PKGS] build static libraries [default=yes]
- --enable-fast-install[=PKGS]
- optimize for fast installation [default=yes]
- --disable-libtool-lock avoid locking (might break parallel builds)
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-pic try to use only PIC/non-PIC objects [default=use
- both]
- --with-tags[=TAGS] include additional configurations [automatic]
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- CXXCPP C++ preprocessor
- F77 Fortran 77 compiler command
- FFLAGS Fortran 77 compiler flags
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.61
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
-fi
-shift
-for ac_site_file
-do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-ac_config_headers="$ac_config_headers config.h"
-
-am__api_version="1.9"
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-IFS=$as_save_IFS
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
- { (exit 1); exit 1; }; }
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $. echo might interpret backslashes.
-# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm -f conftest.sed
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- SET_MAKE=
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=pptp
- VERSION=0.8.5
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { (ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-
-
-{ echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_shared=yes
-fi
-
-
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_static=yes
-fi
-
-
-# Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
- { (exit 1); exit 1; }; }
-
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
-if test "${lt_cv_path_SED+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-
-fi
-
-SED=$lt_cv_path_SED
-
-{ echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6; }
-
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
- # Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_GREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_GREP=$GREP
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
- # Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_EGREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
-
- fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
-else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_ld_reload_flag='-r'
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
-if test "${lt_cv_path_NM+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6; }
-NM="$lt_cv_path_NM"
-
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
-fi
-
-{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
-echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[45]*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- if ( file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[3-9]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '#line 4293 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- lt_cv_cc_needs_belf=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- lt_cv_cc_needs_belf=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-
-esac
-
-need_locks="$enable_libtool_lock"
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in dlfcn.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_CXX" && break
-done
-
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CXX=$ac_ct_CXX
- fi
-fi
-
- fi
-fi
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
-GXX=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cxx_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CXXFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cxx_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-depcc="$CXX" am_compiler_list=
-
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
-
-
-
-
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
-if test -z "$CXXCPP"; then
- if test "${ac_cv_prog_CXXCPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-fi
-
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$F77"; then
- ac_cv_prog_F77="$F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
- { echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$F77" && break
- done
-fi
-if test -z "$F77"; then
- ac_ct_F77=$F77
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_F77"; then
- ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_F77="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
- { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_F77" && break
-done
-
- if test "x$ac_ct_F77" = x; then
- F77=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- F77=$ac_ct_F77
- fi
-fi
-
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-rm -f a.out
-
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
- program main
-#ifndef __GNUC__
- choke me
-#endif
-
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_f77_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_f77_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_prog_f77_g=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
- FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-g -O2"
- else
- FFLAGS="-g"
- fi
-else
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-O2"
- else
- FFLAGS=
- fi
-fi
-
-G77=`test $ac_compiler_gnu = yes && echo yes`
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-
-# find the maximum length of command line arguments
-{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-
-fi
-
-if test -n $lt_cv_sys_max_cmd_len ; then
- { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
-else
- { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
-fi
-
-
-
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[ABCDEGRST]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux* | k*bsd*-gnu)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDGIRSTW]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
- ;;
-irix* | nonstopux*)
- symcode='[BCDEGRST]'
- ;;
-osf*)
- symcode='[BCDEGQRST]'
- ;;
-solaris*)
- symcode='[BDRT]'
- ;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
-sysv4)
- symcode='[DFNSTU]'
- ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
- (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&5
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
-else
- { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
-fi
-
-{ echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
-if test "${lt_cv_objdir+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_AR="ar"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-else
- AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/${ac_tool_prefix}file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- { echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- else
- MAGIC_CMD=:
- fi
-fi
-
- fi
- ;;
-esac
-
-enable_dlopen=no
-enable_win32_dll=no
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
- enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then
- withval=$with_pic; pic_mode="$withval"
-else
- pic_mode=default
-fi
-
-test -z "$pic_mode" && pic_mode=default
-
-# Check if we have a version mismatch between libtool.m4 and ltmain.sh.
-#
-# Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined.
-# We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually
-# calls AC_LIBTOOL_CONFIG and creates libtool.
-#
-{ echo "$as_me:$LINENO: checking for correct ltmain.sh version" >&5
-echo $ECHO_N "checking for correct ltmain.sh version... $ECHO_C" >&6; }
-if test "x$ltmain" = "x" ; then
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- { { echo "$as_me:$LINENO: error:
-
-*** [Gentoo] sanity check failed! ***
-*** \$ltmain is not defined, please check the patch for consistency! ***
-" >&5
-echo "$as_me: error:
-
-*** [Gentoo] sanity check failed! ***
-*** \$ltmain is not defined, please check the patch for consistency! ***
-" >&2;}
- { (exit 1); exit 1; }; }
-fi
-gentoo_lt_version="1.5.24"
-gentoo_ltmain_version=`sed -n '/^[ ]*VERSION=/{s/^[ ]*VERSION=//;p;q;}' "$ltmain"`
-if test "x$gentoo_lt_version" != "x$gentoo_ltmain_version" ; then
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- { { echo "$as_me:$LINENO: error:
-
-*** [Gentoo] sanity check failed! ***
-*** libtool.m4 and ltmain.sh have a version mismatch! ***
-*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) ***
-
-Please run:
-
- libtoolize --copy --force
-
-if appropriate, please contact the maintainer of this
-package (or your distribution) for help.
-" >&5
-echo "$as_me: error:
-
-*** [Gentoo] sanity check failed! ***
-*** libtool.m4 and ltmain.sh have a version mismatch! ***
-*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) ***
-
-Please run:
-
- libtoolize --copy --force
-
-if appropriate, please contact the maintainer of this
-package (or your distribution) for help.
-" >&2;}
- { (exit 1); exit 1; }; }
-else
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-fi
-
-
-# Use C for the default configuration in the libtool script
-tagname=
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag=' -fno-builtin'
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7092: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:7096: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_static='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- else
- lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic='-qnocommon'
- lt_prog_compiler_wl='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl=''
- ;;
- esac
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl='-Qoption ld ';;
- *)
- lt_prog_compiler_wl='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl='-Qoption ld '
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic='-Kconform_pic'
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_can_build_shared=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic='-pic'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7382: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:7386: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; }
-
-if test x"$lt_prog_compiler_pic_works" = xyes; then
- case $lt_prog_compiler_pic in
- "" | " "*) ;;
- *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
- esac
-else
- lt_prog_compiler_pic=
- lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
- fi
- else
- lt_prog_compiler_static_works=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; }
-
-if test x"$lt_prog_compiler_static_works" = xyes; then
- :
-else
- lt_prog_compiler_static=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7486: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:7490: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag=
- enable_shared_with_static_runtimes=no
- archive_cmds=
- archive_expsym_cmds=
- old_archive_From_new_cmds=
- old_archive_from_expsyms_cmds=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- thread_safe_flag_spec=
- hardcode_libdir_flag_spec=
- hardcode_libdir_flag_spec_ld=
- hardcode_libdir_separator=
- hardcode_direct=no
- hardcode_minus_L=no
- hardcode_shlibpath_var=unsupported
- link_all_deplibs=unknown
- hardcode_automatic=no
- module_cmds=
- module_expsym_cmds=
- always_export_symbols=no
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- allow_undefined_flag=unsupported
- always_export_symbols=no
- enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- interix[3-9]*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs" = no; then
- runpath_var=
- hardcode_libdir_flag_spec=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds=''
- hardcode_direct=yes
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag=' ${wl}-bernotok'
- allow_undefined_flag=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
- archive_cmds_need_lc=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- whole_archive_flag_spec=''
- link_all_deplibs=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- freebsd1*)
- ld_shlibs=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- export_dynamic_flag_spec='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- hardcode_direct=yes
- export_dynamic_flag_spec='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld='+b $libdir'
- hardcode_direct=no
- hardcode_shlibpath_var=no
- ;;
- *)
- hardcode_direct=yes
- export_dynamic_flag_spec='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- link_all_deplibs=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- newsos6)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_shlibpath_var=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- ld_shlibs=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- allow_undefined_flag=unsupported
- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- hardcode_libdir_separator=:
- ;;
-
- solaris*)
- no_undefined_flag=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_shlibpath_var=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds='$CC -r -o $output$reload_objs'
- hardcode_direct=no
- ;;
- motorola)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
- ;;
-
- sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag='${wl}-z,text'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag='${wl}-z,text'
- allow_undefined_flag='${wl}-z,nodefs'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- export_dynamic_flag_spec='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- *)
- ld_shlibs=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl
- pic_flag=$lt_prog_compiler_pic
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc=no
- else
- archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
- else
- lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[lt_foo]++; }
- if (lt_freq[lt_foo] == 1) { print lt_foo; }
-}'`
- sys_lib_search_path_spec=`echo $lt_search_path_spec`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- # Handle Gentoo/FreeBSD as it was Linux
- case $host_vendor in
- gentoo)
- version_type=linux ;;
- *)
- version_type=freebsd-$objformat ;;
- esac
-
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- linux)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- need_lib_prefix=no
- need_version=no
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[3-9]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
- test -n "$runpath_var" || \
- test "X$hardcode_automatic" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
- test "$hardcode_minus_L" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-striplib=
-old_striplib=
-{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
- ;;
- *)
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- ;;
- esac
-fi
-
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dl_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
-
-fi
-
- ;;
-
- *)
- { echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
-if test "${ac_cv_func_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char shl_load (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shl_load
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_shl_load || defined __stub___shl_load
-choke me
-#endif
-
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
-if test $ac_cv_func_shl_load = yes; then
- lt_cv_dlopen="shl_load"
-else
- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dld_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_shl_load=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
- { echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
-if test "${ac_cv_func_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define dlopen innocuous_dlopen
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dlopen (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef dlopen
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_dlopen || defined __stub___dlopen
-choke me
-#endif
-
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
-if test $ac_cv_func_dlopen = yes; then
- lt_cv_dlopen="dlopen"
-else
- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dl_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
- { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_svld_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_svld_dlopen=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
-if test $ac_cv_lib_svld_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
- { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_dld_dld_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_dld_dld_link=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
-if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
-if test "${lt_cv_dlopen_self+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 9848 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
-if test "${lt_cv_dlopen_self_static+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self_static=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 9948 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self_static=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-
-
-# Report which library types will actually be built
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler \
- CC \
- LD \
- lt_prog_compiler_wl \
- lt_prog_compiler_pic \
- lt_prog_compiler_static \
- lt_prog_compiler_no_builtin_flag \
- export_dynamic_flag_spec \
- thread_safe_flag_spec \
- whole_archive_flag_spec \
- enable_shared_with_static_runtimes \
- old_archive_cmds \
- old_archive_from_new_cmds \
- predep_objects \
- postdep_objects \
- predeps \
- postdeps \
- compiler_lib_search_path \
- archive_cmds \
- archive_expsym_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- old_archive_from_expsyms_cmds \
- allow_undefined_flag \
- no_undefined_flag \
- export_symbols_cmds \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
- hardcode_automatic \
- module_cmds \
- module_expsym_cmds \
- lt_cv_prog_compiler_c_o \
- fix_srcfile_path \
- exclude_expsyms \
- include_expsyms; do
-
- case $var in
- old_archive_cmds | \
- old_archive_from_new_cmds | \
- archive_cmds | \
- archive_expsym_cmds | \
- module_cmds | \
- module_expsym_cmds | \
- old_archive_from_expsyms_cmds | \
- export_symbols_cmds | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- { echo "$as_me:$LINENO: creating $ofile" >&5
-echo "$as_me: creating $ofile" >&6;}
-
- cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# ### END LIBTOOL CONFIG
-
-__EOF__
-
-
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-
-# Check whether --with-tags was given.
-if test "${with_tags+set}" = set; then
- withval=$with_tags; tagnames="$withval"
-fi
-
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
- else
- { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
- "") ;;
- *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
-echo "$as_me: error: invalid tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-else
- lt_prog_compiler_no_builtin_flag_CXX=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
-else
- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
- { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_CXX=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-ld_shlibs_CXX=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_CXX=''
- hardcode_direct_CXX=yes
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct_CXX=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_CXX=yes
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- hardcode_libdir_separator_CXX=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_CXX=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_CXX='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_CXX=' ${wl}-bernotok'
- allow_undefined_flag_CXX=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX='$convenience'
- archive_cmds_need_lc_CXX=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_CXX=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=no
- enable_shared_with_static_runtimes_CXX=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_direct_CXX=no
- hardcode_automatic_CXX=yes
- hardcode_shlibpath_var_CXX=unsupported
- whole_archive_flag_spec_CXX=''
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_CXX=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- freebsd[12]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- ld_shlibs_CXX=no
- ;;
- freebsd-elf*)
- archive_cmds_need_lc_CXX=no
- ;;
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- ld_shlibs_CXX=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- export_dynamic_flag_spec_CXX='${wl}-E'
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- case $host_cpu in
- hppa*64*|ia64*) ;;
- *)
- export_dynamic_flag_spec_CXX='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- ;;
- *)
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- interix[3-9]*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- link_all_deplibs_CXX=yes
- ;;
- esac
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- ld_shlibs_CXX=no
- ;;
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' -expect_unresolved \*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- archive_cmds_need_lc_CXX=yes
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_shlibpath_var_CXX=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
- ;;
- esac
- link_all_deplibs_CXX=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_CXX='${wl}-z,text'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- no_undefined_flag_CXX='${wl}-z,text'
- allow_undefined_flag_CXX='${wl}-z,nodefs'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- export_dynamic_flag_spec_CXX='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-GCC_CXX="$GXX"
-LD_CXX="$LD"
-
-
-cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_path_CXX="${prev}${p}"
- else
- compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$postdeps_CXX"; then
- postdeps_CXX="${prev}${p}"
- else
- postdeps_CXX="${postdeps_CXX} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$predep_objects_CXX"; then
- predep_objects_CXX="$p"
- else
- predep_objects_CXX="$predep_objects_CXX $p"
- fi
- else
- if test -z "$postdep_objects_CXX"; then
- postdep_objects_CXX="$p"
- else
- postdep_objects_CXX="$postdep_objects_CXX $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix[3-9]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- predep_objects_CXX=
- postdep_objects_CXX=
- postdeps_CXX=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- #
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
- if test "$solaris_use_stlport4" != yes; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
-
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- fi
- ;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_CXX='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- lt_prog_compiler_pic_CXX=
- ;;
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_CXX=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- else
- lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_CXX='-qnocommon'
- lt_prog_compiler_wl_CXX='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- lt_prog_compiler_pic_CXX='+Z'
- fi
- ;;
- aCC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_CXX='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fpic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- lt_prog_compiler_pic_CXX='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- lt_prog_compiler_wl_CXX='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- lt_prog_compiler_pic_CXX='-pic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- lcc*)
- # Lucid
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- lt_prog_compiler_can_build_shared_CXX=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works_CXX=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12368: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:12372: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_CXX=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
- case $lt_prog_compiler_pic_CXX in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
- esac
-else
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_CXX=
- ;;
- *)
- lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_CXX=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_CXX=yes
- fi
- else
- lt_prog_compiler_static_works_CXX=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
- :
-else
- lt_prog_compiler_static_CXX=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12472: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:12476: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- export_symbols_cmds_CXX="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_CXX=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_CXX in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_CXX
- pic_flag=$lt_prog_compiler_pic_CXX
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
- allow_undefined_flag_CXX=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_CXX=no
- else
- archive_cmds_need_lc_CXX=yes
- fi
- allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- # Handle Gentoo/FreeBSD as it was Linux
- case $host_vendor in
- gentoo)
- version_type=linux ;;
- *)
- version_type=freebsd-$objformat ;;
- esac
-
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- linux)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- need_lib_prefix=no
- need_version=no
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[3-9]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
- test -n "$runpath_var_CXX" || \
- test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_CXX" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
- test "$hardcode_minus_L_CXX" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_CXX=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_CXX=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_CXX=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_CXX \
- CC_CXX \
- LD_CXX \
- lt_prog_compiler_wl_CXX \
- lt_prog_compiler_pic_CXX \
- lt_prog_compiler_static_CXX \
- lt_prog_compiler_no_builtin_flag_CXX \
- export_dynamic_flag_spec_CXX \
- thread_safe_flag_spec_CXX \
- whole_archive_flag_spec_CXX \
- enable_shared_with_static_runtimes_CXX \
- old_archive_cmds_CXX \
- old_archive_from_new_cmds_CXX \
- predep_objects_CXX \
- postdep_objects_CXX \
- predeps_CXX \
- postdeps_CXX \
- compiler_lib_search_path_CXX \
- archive_cmds_CXX \
- archive_expsym_cmds_CXX \
- postinstall_cmds_CXX \
- postuninstall_cmds_CXX \
- old_archive_from_expsyms_cmds_CXX \
- allow_undefined_flag_CXX \
- no_undefined_flag_CXX \
- export_symbols_cmds_CXX \
- hardcode_libdir_flag_spec_CXX \
- hardcode_libdir_flag_spec_ld_CXX \
- hardcode_libdir_separator_CXX \
- hardcode_automatic_CXX \
- module_cmds_CXX \
- module_expsym_cmds_CXX \
- lt_cv_prog_compiler_c_o_CXX \
- fix_srcfile_path_CXX \
- exclude_expsyms_CXX \
- include_expsyms_CXX; do
-
- case $var in
- old_archive_cmds_CXX | \
- old_archive_from_new_cmds_CXX | \
- archive_cmds_CXX | \
- archive_expsym_cmds_CXX | \
- module_cmds_CXX | \
- module_expsym_cmds_CXX | \
- old_archive_from_expsyms_cmds_CXX | \
- export_symbols_cmds_CXX | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
- program t
- end
-"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-GCC_F77="$G77"
-LD_F77="$LD"
-
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_static_F77='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_F77='-fno-common'
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_F77=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_F77=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_F77='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- else
- lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_F77='-qnocommon'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_F77='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_F77='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-fpic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- lt_prog_compiler_wl_F77=''
- ;;
- esac
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_F77='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_F77='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_F77='-Qoption ld '
- lt_prog_compiler_pic_F77='-PIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_F77='-Kconform_pic'
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_can_build_shared_F77=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_F77='-pic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_F77=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works_F77=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_F77"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14047: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:14051: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_F77=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
- case $lt_prog_compiler_pic_F77 in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
- esac
-else
- lt_prog_compiler_pic_F77=
- lt_prog_compiler_can_build_shared_F77=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_F77=
- ;;
- *)
- lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_F77=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_F77=yes
- fi
- else
- lt_prog_compiler_static_works_F77=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
- :
-else
- lt_prog_compiler_static_F77=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_F77=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14151: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:14155: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_F77=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag_F77=
- enable_shared_with_static_runtimes_F77=no
- archive_cmds_F77=
- archive_expsym_cmds_F77=
- old_archive_From_new_cmds_F77=
- old_archive_from_expsyms_cmds_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- thread_safe_flag_spec_F77=
- hardcode_libdir_flag_spec_F77=
- hardcode_libdir_flag_spec_ld_F77=
- hardcode_libdir_separator_F77=
- hardcode_direct_F77=no
- hardcode_minus_L_F77=no
- hardcode_shlibpath_var_F77=unsupported
- link_all_deplibs_F77=unknown
- hardcode_automatic_F77=no
- module_cmds_F77=
- module_expsym_cmds_F77=
- always_export_symbols_F77=no
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_F77=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_F77=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_F77='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_F77=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_F77=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_F77=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_F77='-L$libdir'
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=no
- enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- interix[3-9]*)
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_F77=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_F77" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=yes
- archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_F77=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_F77=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_F77=''
- hardcode_direct_F77=yes
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct_F77=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_F77=yes
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_libdir_separator_F77=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_F77=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_F77='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_F77="-z nodefs"
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_f77_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_F77=' ${wl}-bernotok'
- allow_undefined_flag_F77=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_F77='$convenience'
- archive_cmds_need_lc_F77=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_F77=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_F77=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_F77=' '
- allow_undefined_flag_F77=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_F77='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_F77=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_F77=no
- hardcode_direct_F77=no
- hardcode_automatic_F77=yes
- hardcode_shlibpath_var_F77=unsupported
- whole_archive_flag_spec_F77=''
- link_all_deplibs_F77=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- freebsd1*)
- ld_shlibs_F77=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_direct_F77=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_F77='+b $libdir'
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- ;;
- *)
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- link_all_deplibs_F77=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- newsos6)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_shlibpath_var_F77=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- ;;
- *)
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- allow_undefined_flag_F77=unsupported
- archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_F77='-rpath $libdir'
- fi
- hardcode_libdir_separator_F77=:
- ;;
-
- solaris*)
- no_undefined_flag_F77=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_shlibpath_var_F77=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs_F77=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_F77='$CC -r -o $output$reload_objs'
- hardcode_direct_F77=no
- ;;
- motorola)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4.3*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- export_dynamic_flag_spec_F77='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_F77=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_F77='${wl}-z,text'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_F77='${wl}-z,text'
- allow_undefined_flag_F77='${wl}-z,nodefs'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
- export_dynamic_flag_spec_F77='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6; }
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_F77=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_F77 in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_F77
- pic_flag=$lt_prog_compiler_pic_F77
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_F77
- allow_undefined_flag_F77=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_F77=no
- else
- archive_cmds_need_lc_F77=yes
- fi
- allow_undefined_flag_F77=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- # Handle Gentoo/FreeBSD as it was Linux
- case $host_vendor in
- gentoo)
- version_type=linux ;;
- *)
- version_type=freebsd-$objformat ;;
- esac
-
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- linux)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- need_lib_prefix=no
- need_version=no
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[3-9]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
- test -n "$runpath_var_F77" || \
- test "X$hardcode_automatic_F77" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_F77" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
- test "$hardcode_minus_L_F77" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_F77=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_F77=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_F77=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6; }
-
-if test "$hardcode_action_F77" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_F77 \
- CC_F77 \
- LD_F77 \
- lt_prog_compiler_wl_F77 \
- lt_prog_compiler_pic_F77 \
- lt_prog_compiler_static_F77 \
- lt_prog_compiler_no_builtin_flag_F77 \
- export_dynamic_flag_spec_F77 \
- thread_safe_flag_spec_F77 \
- whole_archive_flag_spec_F77 \
- enable_shared_with_static_runtimes_F77 \
- old_archive_cmds_F77 \
- old_archive_from_new_cmds_F77 \
- predep_objects_F77 \
- postdep_objects_F77 \
- predeps_F77 \
- postdeps_F77 \
- compiler_lib_search_path_F77 \
- archive_cmds_F77 \
- archive_expsym_cmds_F77 \
- postinstall_cmds_F77 \
- postuninstall_cmds_F77 \
- old_archive_from_expsyms_cmds_F77 \
- allow_undefined_flag_F77 \
- no_undefined_flag_F77 \
- export_symbols_cmds_F77 \
- hardcode_libdir_flag_spec_F77 \
- hardcode_libdir_flag_spec_ld_F77 \
- hardcode_libdir_separator_F77 \
- hardcode_automatic_F77 \
- module_cmds_F77 \
- module_expsym_cmds_F77 \
- lt_cv_prog_compiler_c_o_F77 \
- fix_srcfile_path_F77 \
- exclude_expsyms_F77 \
- include_expsyms_F77; do
-
- case $var in
- old_archive_cmds_F77 | \
- old_archive_from_new_cmds_F77 | \
- archive_cmds_F77 | \
- archive_expsym_cmds_F77 | \
- module_cmds_F77 | \
- module_expsym_cmds_F77 | \
- old_archive_from_expsyms_cmds_F77 | \
- export_symbols_cmds_F77 | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_F77
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_F77
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_F77
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
-
-old_archive_cmds_GCJ=$old_archive_cmds
-
-
-lt_prog_compiler_no_builtin_flag_GCJ=
-
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16351: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:16355: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
- lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
- if test "$GCC" = yes; then
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_static_GCJ='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_GCJ='-fno-common'
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared_GCJ=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_GCJ=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- else
- lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_GCJ='-qnocommon'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_GCJ='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- linux* | k*bsd*-gnu)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-fpic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- lt_prog_compiler_wl_GCJ=''
- ;;
- esac
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_GCJ='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_GCJ='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_GCJ='-Qoption ld '
- lt_prog_compiler_pic_GCJ='-PIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_GCJ='-Kconform_pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_GCJ='-pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_pic_works_GCJ=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16641: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:16645: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_GCJ=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
- case $lt_prog_compiler_pic_GCJ in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
- esac
-else
- lt_prog_compiler_pic_GCJ=
- lt_prog_compiler_can_build_shared_GCJ=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_GCJ=
- ;;
- *)
- lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works_GCJ=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_GCJ=yes
- fi
- else
- lt_prog_compiler_static_works_GCJ=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
- :
-else
- lt_prog_compiler_static_GCJ=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_cv_prog_compiler_c_o_GCJ=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16745: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:16749: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_GCJ=yes
- fi
- fi
- chmod u+w . 2>&5
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
- if test "$hard_links" = no; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
- runpath_var=
- allow_undefined_flag_GCJ=
- enable_shared_with_static_runtimes_GCJ=no
- archive_cmds_GCJ=
- archive_expsym_cmds_GCJ=
- old_archive_From_new_cmds_GCJ=
- old_archive_from_expsyms_cmds_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- thread_safe_flag_spec_GCJ=
- hardcode_libdir_flag_spec_GCJ=
- hardcode_libdir_flag_spec_ld_GCJ=
- hardcode_libdir_separator_GCJ=
- hardcode_direct_GCJ=no
- hardcode_minus_L_GCJ=no
- hardcode_shlibpath_var_GCJ=unsupported
- link_all_deplibs_GCJ=unknown
- hardcode_automatic_GCJ=no
- module_cmds_GCJ=
- module_expsym_cmds_GCJ=
- always_export_symbols_GCJ=no
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_GCJ=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs_GCJ=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_GCJ=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_GCJ=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_GCJ=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=no
- enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- interix[3-9]*)
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | k*bsd*-gnu)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- *)
- tmp_sharedflag='-shared' ;;
- esac
- archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_GCJ=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_GCJ" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=yes
- archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L_GCJ=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct_GCJ=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_GCJ=''
- hardcode_direct_GCJ=yes
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct_GCJ=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_libdir_separator_GCJ=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols_GCJ=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_GCJ='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_GCJ="-z nodefs"
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_GCJ=' ${wl}-bernotok'
- allow_undefined_flag_GCJ=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_GCJ='$convenience'
- archive_cmds_need_lc_GCJ=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_GCJ=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_GCJ=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ=' '
- allow_undefined_flag_GCJ=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_GCJ='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_GCJ=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_GCJ=no
- hardcode_direct_GCJ=no
- hardcode_automatic_GCJ=yes
- hardcode_shlibpath_var_GCJ=unsupported
- whole_archive_flag_spec_GCJ=''
- link_all_deplibs_GCJ=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- freebsd1*)
- ld_shlibs_GCJ=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_direct_GCJ=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- ;;
- *)
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- link_all_deplibs_GCJ=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- newsos6)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- allow_undefined_flag_GCJ=unsupported
- archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_separator_GCJ=:
- ;;
-
- solaris*)
- no_undefined_flag_GCJ=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_shlibpath_var_GCJ=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs_GCJ=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_GCJ='$CC -r -o $output$reload_objs'
- hardcode_direct_GCJ=no
- ;;
- motorola)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4.3*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- export_dynamic_flag_spec_GCJ='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_GCJ=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_GCJ='${wl}-z,text'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_GCJ='${wl}-z,text'
- allow_undefined_flag_GCJ='${wl}-z,nodefs'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_GCJ=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_GCJ in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
- $rm conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_GCJ
- pic_flag=$lt_prog_compiler_pic_GCJ
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
- allow_undefined_flag_GCJ=
- if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
- (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- then
- archive_cmds_need_lc_GCJ=no
- else
- archive_cmds_need_lc_GCJ=yes
- fi
- allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[123]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- # Handle Gentoo/FreeBSD as it was Linux
- case $host_vendor in
- gentoo)
- version_type=linux ;;
- *)
- version_type=freebsd-$objformat ;;
- esac
-
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- linux)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- need_lib_prefix=no
- need_version=no
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[3-9]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
- test -n "$runpath_var_GCJ" || \
- test "X$hardcode_automatic_GCJ" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_GCJ" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
- test "$hardcode_minus_L_GCJ" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_GCJ=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_GCJ=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_GCJ=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
-
-if test "$hardcode_action_GCJ" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_GCJ \
- CC_GCJ \
- LD_GCJ \
- lt_prog_compiler_wl_GCJ \
- lt_prog_compiler_pic_GCJ \
- lt_prog_compiler_static_GCJ \
- lt_prog_compiler_no_builtin_flag_GCJ \
- export_dynamic_flag_spec_GCJ \
- thread_safe_flag_spec_GCJ \
- whole_archive_flag_spec_GCJ \
- enable_shared_with_static_runtimes_GCJ \
- old_archive_cmds_GCJ \
- old_archive_from_new_cmds_GCJ \
- predep_objects_GCJ \
- postdep_objects_GCJ \
- predeps_GCJ \
- postdeps_GCJ \
- compiler_lib_search_path_GCJ \
- archive_cmds_GCJ \
- archive_expsym_cmds_GCJ \
- postinstall_cmds_GCJ \
- postuninstall_cmds_GCJ \
- old_archive_from_expsyms_cmds_GCJ \
- allow_undefined_flag_GCJ \
- no_undefined_flag_GCJ \
- export_symbols_cmds_GCJ \
- hardcode_libdir_flag_spec_GCJ \
- hardcode_libdir_flag_spec_ld_GCJ \
- hardcode_libdir_separator_GCJ \
- hardcode_automatic_GCJ \
- module_cmds_GCJ \
- module_expsym_cmds_GCJ \
- lt_cv_prog_compiler_c_o_GCJ \
- fix_srcfile_path_GCJ \
- exclude_expsyms_GCJ \
- include_expsyms_GCJ; do
-
- case $var in
- old_archive_cmds_GCJ | \
- old_archive_from_new_cmds_GCJ | \
- archive_cmds_GCJ | \
- archive_expsym_cmds_GCJ | \
- module_cmds_GCJ | \
- module_expsym_cmds_GCJ | \
- old_archive_from_expsyms_cmds_GCJ | \
- export_symbols_cmds_GCJ | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_GCJ
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_GCJ
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- else
- tagname=""
- fi
- ;;
-
- RC)
-
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_RC \
- CC_RC \
- LD_RC \
- lt_prog_compiler_wl_RC \
- lt_prog_compiler_pic_RC \
- lt_prog_compiler_static_RC \
- lt_prog_compiler_no_builtin_flag_RC \
- export_dynamic_flag_spec_RC \
- thread_safe_flag_spec_RC \
- whole_archive_flag_spec_RC \
- enable_shared_with_static_runtimes_RC \
- old_archive_cmds_RC \
- old_archive_from_new_cmds_RC \
- predep_objects_RC \
- postdep_objects_RC \
- predeps_RC \
- postdeps_RC \
- compiler_lib_search_path_RC \
- archive_cmds_RC \
- archive_expsym_cmds_RC \
- postinstall_cmds_RC \
- postuninstall_cmds_RC \
- old_archive_from_expsyms_cmds_RC \
- allow_undefined_flag_RC \
- no_undefined_flag_RC \
- export_symbols_cmds_RC \
- hardcode_libdir_flag_spec_RC \
- hardcode_libdir_flag_spec_ld_RC \
- hardcode_libdir_separator_RC \
- hardcode_automatic_RC \
- module_cmds_RC \
- module_expsym_cmds_RC \
- lt_cv_prog_compiler_c_o_RC \
- fix_srcfile_path_RC \
- exclude_expsyms_RC \
- include_expsyms_RC; do
-
- case $var in
- old_archive_cmds_RC | \
- old_archive_from_new_cmds_RC | \
- archive_cmds_RC | \
- archive_expsym_cmds_RC | \
- module_cmds_RC | \
- module_expsym_cmds_RC | \
- old_archive_from_expsyms_cmds_RC | \
- export_symbols_cmds_RC | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_RC
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
- ;;
-
- *)
- { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
- { (exit 1); exit 1; }; }
- fi
-fi
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Prevent multiple expansion
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-cat >>confdefs.h <<\_ACEOF
-#define PPPD_VERSION
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define KERNELVERSION
-_ACEOF
-
-
-CFLAGS="${CFLAGS:=}"
-
-{ echo "$as_me:$LINENO: checking for linux kernel herders" >&5
-echo $ECHO_N "checking for linux kernel herders... $ECHO_C" >&6; }
-if test -n "${KDIR}"; then
- if test -f ${KDIR}/include/linux/version.h; then
- header=${KDIR}/include
- else
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- { { echo "$as_me:$LINENO: error: Could not find linux kernel headers" >&5
-echo "$as_me: error: Could not find linux kernel headers" >&2;}
- { (exit 1); exit 1; }; }
- 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
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- { { echo "$as_me:$LINENO: error: Could not find linux kernel headers" >&5
-echo "$as_me: error: Could not find linux kernel headers" >&2;}
- { (exit 1); exit 1; }; }
- 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
-{ echo "$as_me:$LINENO: result: found ($KERNELVERSION at ${header/include})" >&5
-echo "${ECHO_T}found ($KERNELVERSION at ${header/include})" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define KERNELVERSION "$KERNELVERSION"
-_ACEOF
-
-
-
-CFLAGS="${CFLAGS} -I. -I${header}"
-
-{ echo "$as_me:$LINENO: checking for pppd" >&5
-echo $ECHO_N "checking for pppd... $ECHO_C" >&6; }
-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
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- { { echo "$as_me:$LINENO: error: Could not find pppd" >&5
-echo "$as_me: error: Could not find pppd" >&2;}
- { (exit 1); exit 1; }; }
-fi
-pppd_ver=`${pppd} --version 2>&1 | grep version | sed 's/pppd version //'`
-{ echo "$as_me:$LINENO: result: $pppd ($pppd_ver)" >&5
-echo "${ECHO_T}$pppd ($pppd_ver)" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define PPPD_VERSION "${pppd_ver}"
-_ACEOF
-
-
-echo '==============================================================================='
-
-echo 'Configuration chosen:'
-echo ' PPPD: '${pppd_ver}
-echo ' linux kernel : '$KERNELVERSION at ${header/include}
-
-ac_config_files="$ac_config_files Makefile src/Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
- else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-
-# Save the log message, to keep $[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2006 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
- export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
-
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp=
- trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
-
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-CYGPATH_W!$CYGPATH_W$ac_delim
-PACKAGE!$PACKAGE$ac_delim
-VERSION!$VERSION$ac_delim
-ACLOCAL!$ACLOCAL$ac_delim
-AUTOCONF!$AUTOCONF$ac_delim
-AUTOMAKE!$AUTOMAKE$ac_delim
-AUTOHEADER!$AUTOHEADER$ac_delim
-MAKEINFO!$MAKEINFO$ac_delim
-install_sh!$install_sh$ac_delim
-STRIP!$STRIP$ac_delim
-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
-mkdir_p!$mkdir_p$ac_delim
-AWK!$AWK$ac_delim
-SET_MAKE!$SET_MAKE$ac_delim
-am__leading_dot!$am__leading_dot$ac_delim
-AMTAR!$AMTAR$ac_delim
-am__tar!$am__tar$ac_delim
-am__untar!$am__untar$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-DEPDIR!$DEPDIR$ac_delim
-am__include!$am__include$ac_delim
-am__quote!$am__quote$ac_delim
-AMDEP_TRUE!$AMDEP_TRUE$ac_delim
-AMDEP_FALSE!$AMDEP_FALSE$ac_delim
-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
-CCDEPMODE!$CCDEPMODE$ac_delim
-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-SED!$SED$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-LN_S!$LN_S$ac_delim
-ECHO!$ECHO$ac_delim
-AR!$AR$ac_delim
-RANLIB!$RANLIB$ac_delim
-CPP!$CPP$ac_delim
-CXX!$CXX$ac_delim
-CXXFLAGS!$CXXFLAGS$ac_delim
-ac_ct_CXX!$ac_ct_CXX$ac_delim
-CXXDEPMODE!$CXXDEPMODE$ac_delim
-am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
-am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
-CXXCPP!$CXXCPP$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
-_ACEOF
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-F77!$F77$ac_delim
-FFLAGS!$FFLAGS$ac_delim
-ac_ct_F77!$ac_ct_F77$ac_delim
-LIBTOOL!$LIBTOOL$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
-_ACEOF
-
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-fi # test -n "$CONFIG_FILES"
-
-
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
- esac
- ac_file_inputs="$ac_file_inputs $ac_f"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- fi
-
- case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
-
- rm -f "$tmp/stdin"
- case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
- if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f $ac_file
- mv "$tmp/config.h" $ac_file
- fi
- else
- echo "/* $configure_input */"
- cat "$ac_result"
- fi
- rm -f "$tmp/out12"
-# Compute $ac_file's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $ac_file | $ac_file:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X$ac_file : 'X\(//\)[^/]' \| \
- X$ac_file : 'X\(//\)$' \| \
- X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
-echo X$ac_file |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir=$dirpart/$fdir
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
- ;;
-
- esac
-done # for ac_tag
-
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
-
diff --git a/pppd_plugin/configure.in b/pppd_plugin/configure.in
deleted file mode 100644
index a9d4a44..0000000
--- a/pppd_plugin/configure.in
+++ /dev/null
@@ -1,73 +0,0 @@
-AC_INIT(configure.in)
-
-AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(pptp,0.8.5)
-
-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
diff --git a/pppd_plugin/depcomp b/pppd_plugin/depcomp
deleted file mode 100755
index 4c20c6c..0000000
--- a/pppd_plugin/depcomp
+++ /dev/null
@@ -1,441 +0,0 @@
-#! /bin/sh
-
-# depcomp - compile a program generating dependencies as side-effects
-# Copyright 1999, 2000 Free Software Foundation, Inc.
-
-# 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, 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.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-# `libtool' can also be set to `yes' or `no'.
-
-depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
- "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
- tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'. On the theory
-## that the space means something, we add a space to the output as
-## well.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
-
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like `#:fec' to the end of the
- # dependency line.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr '
-' ' ' >> $depfile
- echo >> $depfile
-
- # The second pass generates a dummy entry for each header file.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> $depfile
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. This file always lives in the current directory.
- # Also, the AIX compiler puts `$object:' at the start of each line;
- # $object doesn't have directory information.
- stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
- tmpdepfile="$stripped.u"
- outname="$stripped.o"
- if test "$libtool" = yes; then
- "$@" -Wc,-M
- else
- "$@" -M
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
-
- if test -f "$tmpdepfile"; then
- # Each line is of the form `foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-icc)
- # Must come before tru64.
-
- # Intel's C compiler understands `-MD -MF file'. However
- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want:
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
-
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-tru64)
- # The Tru64 AIX compiler uses -MD to generate dependencies as a side
- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in `foo.d' instead, so we check for that too.
- # Subdirectories are respected.
-
- tmpdepfile1="$object.d"
- tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
- if test "$libtool" = yes; then
- "$@" -Wc,-MD
- else
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- if test -f "$tmpdepfile1"; then
- tmpdepfile="$tmpdepfile1"
- else
- tmpdepfile="$tmpdepfile2"
- fi
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a space and a tab in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the proprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- test -z "$dashmflag" && dashmflag=-M
- ( IFS=" "
- case " $* " in
- *" --mode=compile "*) # this is libtool, let us make it quiet
- for arg
- do # cycle over the arguments
- case "$arg" in
- "--mode=compile")
- # insert --quiet before "--mode=compile"
- set fnord "$@" --quiet
- shift # fnord
- ;;
- esac
- set fnord "$@" "$arg"
- shift # fnord
- shift # "$arg"
- done
- ;;
- esac
- "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- # X makedepend
- (
- shift
- cleared=no
- for arg in "$@"; do
- case $cleared in no)
- set ""; shift
- cleared=yes
- esac
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift;;
- -*)
- ;;
- *)
- set fnord "$@" "$arg"; shift;;
- esac
- done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- tail +3 "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the proprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- ( IFS=" "
- case " $* " in
- *" --mode=compile "*)
- for arg
- do # cycle over the arguments
- case $arg in
- "--mode=compile")
- # insert --quiet before "--mode=compile"
- set fnord "$@" --quiet
- shift # fnord
- ;;
- esac
- set fnord "$@" "$arg"
- shift # fnord
- shift # "$arg"
- done
- ;;
- esac
- "$@" -E |
- sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the proprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- ( IFS=" "
- case " $* " in
- *" --mode=compile "*)
- for arg
- do # cycle over the arguments
- case $arg in
- "--mode=compile")
- # insert --quiet before "--mode=compile"
- set fnord "$@" --quiet
- shift # fnord
- ;;
- esac
- set fnord "$@" "$arg"
- shift # fnord
- shift # "$arg"
- done
- ;;
- esac
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
- echo " " >> "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/pppd_plugin/install-sh b/pppd_plugin/install-sh
deleted file mode 100755
index 36f96f3..0000000
--- a/pppd_plugin/install-sh
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/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
-}
diff --git a/pppd_plugin/ltmain.sh b/pppd_plugin/ltmain.sh
deleted file mode 100644
index d74b5a6..0000000
--- a/pppd_plugin/ltmain.sh
+++ /dev/null
@@ -1,6997 +0,0 @@
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun configure.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007 Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-basename="s,^.*/,,g"
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-# The name of this program:
-progname=`echo "$progpath" | $SED $basename`
-modename="$progname"
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION=1.5.24
-TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)"
-
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# Check that we have a working $echo.
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell, and then maybe $echo will work.
- exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit $EXIT_SUCCESS
-fi
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- SP2NL='tr \040 \012'
- NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- SP2NL='tr \100 \n'
- NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- $lt_var=C
- export $lt_var
- fi"
-done
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- $echo "$modename: not configured to build any kind of library" 1>&2
- $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
- exit $EXIT_FAILURE
-fi
-
-# Global variables.
-mode=$default_mode
-nonopt=
-prev=
-prevopt=
-run=
-show="$echo"
-show_help=
-execute_dlfiles=
-duplicate_deps=no
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
-
-#####################################
-# Shell function definitions:
-# This seems to be the best place for them
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
-
- if test "$run" = ":"; then
- # Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
- else
-
- # If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$my_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
-
- save_mktempdir_umask=`umask`
- umask 0077
- $mkdir "$my_tmpdir"
- umask $save_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || {
- $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
- exit $EXIT_FAILURE
- }
- fi
-
- $echo "X$my_tmpdir" | $Xsed
-}
-
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
-{
- win32_libid_type="unknown"
- win32_fileres=`file -L $1 2>/dev/null`
- case $win32_fileres in
- *ar\ archive\ import\ library*) # definitely import
- win32_libid_type="x86 archive import"
- ;;
- *ar\ archive*) # could be an import, or static
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
- $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
- win32_nmres=`eval $NM -f posix -A $1 | \
- $SED -n -e '1,100{
- / I /{
- s,.*,import,
- p
- q
- }
- }'`
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- esac
- fi
- ;;
- *DLL*)
- win32_libid_type="x86 DLL"
- ;;
- *executable*) # but shell scripts are "executable" too...
- case $win32_fileres in
- *MS\ Windows\ PE\ Intel*)
- win32_libid_type="x86 DLL"
- ;;
- esac
- ;;
- esac
- $echo $win32_libid_type
-}
-
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
- if test -n "$available_tags" && test -z "$tagname"; then
- CC_quoted=
- for arg in $CC; do
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- CC_quoted="$CC_quoted $arg"
- done
- case $@ in
- # Blanks in the command may have been stripped by the calling shell,
- # but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
- # Blanks at the start of $base_compile will cause this to fail
- # if we don't check for them as well.
- *)
- for z in $available_tags; do
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
- CC_quoted=
- for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- CC_quoted="$CC_quoted $arg"
- done
- # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
- trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
- # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
- extendcc=${host}-${CC}
- # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
- # (Gentoo-specific hack because we always export $CHOST)
- mungedcc=${CHOST-${host}}-${trimedcc}
- case "$@ " in
- "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
- "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
- tagname=CC
- break ;;
- "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
- "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
- "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
- " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
- ;;
- esac
- fi
- done
- # If $tagname still isn't set, then no tagged configuration
- # was found and let the user know that the "--tag" command
- # line option must be used.
- if test -z "$tagname"; then
- $echo "$modename: unable to infer tagged configuration"
- $echo "$modename: specify a tag with \`--tag'" 1>&2
- exit $EXIT_FAILURE
-# else
-# $echo "$modename: using $tagname tagged configuration"
- fi
- ;;
- esac
- fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
-
- $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
- $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
- if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
- exit $EXIT_FAILURE
- fi
-}
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
- my_gentop="$1"; shift
- my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
- my_status=""
-
- $show "${rm}r $my_gentop"
- $run ${rm}r "$my_gentop"
- $show "$mkdir $my_gentop"
- $run $mkdir "$my_gentop"
- my_status=$?
- if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
- exit $my_status
- fi
-
- for my_xlib in $my_oldlibs; do
- # Extract the objects.
- case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
- *) my_xabs=`pwd`"/$my_xlib" ;;
- esac
- my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
- my_xlib_u=$my_xlib
- while :; do
- case " $extracted_archives " in
- *" $my_xlib_u "*)
- extracted_serial=`expr $extracted_serial + 1`
- my_xlib_u=lt$extracted_serial-$my_xlib ;;
- *) break ;;
- esac
- done
- extracted_archives="$extracted_archives $my_xlib_u"
- my_xdir="$my_gentop/$my_xlib_u"
-
- $show "${rm}r $my_xdir"
- $run ${rm}r "$my_xdir"
- $show "$mkdir $my_xdir"
- $run $mkdir "$my_xdir"
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
- exit $exit_status
- fi
- case $host in
- *-darwin*)
- $show "Extracting $my_xabs"
- # Do not bother doing anything if just a dry run
- if test -z "$run"; then
- darwin_orig_dir=`pwd`
- cd $my_xdir || exit $?
- darwin_archive=$my_xabs
- darwin_curdir=`pwd`
- darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
- darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
- if test -n "$darwin_arches"; then
- darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
- darwin_arch=
- $show "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
- cd "$darwin_curdir"
- $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
- done # $darwin_arches
- ## Okay now we have a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
- darwin_file=
- darwin_files=
- for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
- lipo -create -output "$darwin_file" $darwin_files
- done # $darwin_filelist
- ${rm}r unfat-$$
- cd "$darwin_orig_dir"
- else
- cd "$darwin_orig_dir"
- func_extract_an_archive "$my_xdir" "$my_xabs"
- fi # $darwin_arches
- fi # $run
- ;;
- *)
- func_extract_an_archive "$my_xdir" "$my_xabs"
- ;;
- esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
- done
- func_extract_archives_result="$my_oldobjs"
-}
-# End of Shell function definitions
-#####################################
-
-# Darwin sucks
-eval std_shrext=\"$shrext_cmds\"
-
-disable_libs=no
-
-# Parse our command line options once, thoroughly.
-while test "$#" -gt 0
-do
- arg="$1"
- shift
-
- case $arg in
- -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
- *) optarg= ;;
- esac
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- execute_dlfiles)
- execute_dlfiles="$execute_dlfiles $arg"
- ;;
- tag)
- tagname="$arg"
- preserve_args="${preserve_args}=$arg"
-
- # Check whether tagname contains only valid characters
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- $echo "$progname: invalid tag name: $tagname" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $tagname in
- CC)
- # Don't test for the "default" C tag, as we know, it's there, but
- # not specially marked.
- ;;
- *)
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
- taglist="$taglist $tagname"
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
- else
- $echo "$progname: ignoring unknown tag $tagname" 1>&2
- fi
- ;;
- esac
- ;;
- *)
- eval "$prev=\$arg"
- ;;
- esac
-
- prev=
- prevopt=
- continue
- fi
-
- # Have we seen a non-optional argument yet?
- case $arg in
- --help)
- show_help=yes
- ;;
-
- --version)
- echo "\
-$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
-
-Copyright (C) 2007 Free Software Foundation, Inc.
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- exit $?
- ;;
-
- --config)
- ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
- # Now print the configurations for the tags.
- for tagname in $taglist; do
- ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
- done
- exit $?
- ;;
-
- --debug)
- $echo "$progname: enabling shell trace mode"
- set -x
- preserve_args="$preserve_args $arg"
- ;;
-
- --dry-run | -n)
- run=:
- ;;
-
- --features)
- $echo "host: $host"
- if test "$build_libtool_libs" = yes; then
- $echo "enable shared libraries"
- else
- $echo "disable shared libraries"
- fi
- if test "$build_old_libs" = yes; then
- $echo "enable static libraries"
- else
- $echo "disable static libraries"
- fi
- exit $?
- ;;
-
- --finish) mode="finish" ;;
-
- --mode) prevopt="--mode" prev=mode ;;
- --mode=*) mode="$optarg" ;;
-
- --preserve-dup-deps) duplicate_deps="yes" ;;
-
- --quiet | --silent)
- show=:
- preserve_args="$preserve_args $arg"
- ;;
-
- --tag)
- prevopt="--tag"
- prev=tag
- preserve_args="$preserve_args --tag"
- ;;
- --tag=*)
- set tag "$optarg" ${1+"$@"}
- shift
- prev=tag
- preserve_args="$preserve_args --tag"
- ;;
-
- -dlopen)
- prevopt="-dlopen"
- prev=execute_dlfiles
- ;;
-
- -*)
- $echo "$modename: unrecognized option \`$arg'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
-
- *)
- nonopt="$arg"
- break
- ;;
- esac
-done
-
-if test -n "$prevopt"; then
- $echo "$modename: option \`$prevopt' requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
-fi
-
-case $disable_libs in
-no)
- ;;
-shared)
- build_libtool_libs=no
- build_old_libs=yes
- ;;
-static)
- build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
- ;;
-esac
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-if test -z "$show_help"; then
-
- # Infer the operation mode.
- if test -z "$mode"; then
- $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
- $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
- case $nonopt in
- *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
- mode=link
- for arg
- do
- case $arg in
- -c)
- mode=compile
- break
- ;;
- esac
- done
- ;;
- *db | *dbx | *strace | *truss)
- mode=execute
- ;;
- *install*|cp|mv)
- mode=install
- ;;
- *rm)
- mode=uninstall
- ;;
- *)
- # If we have no mode, but dlfiles were specified, then do execute mode.
- test -n "$execute_dlfiles" && mode=execute
-
- # Just use the default operation mode.
- if test -z "$mode"; then
- if test -n "$nonopt"; then
- $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
- else
- $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
- fi
- fi
- ;;
- esac
- fi
-
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$execute_dlfiles" && test "$mode" != execute; then
- $echo "$modename: unrecognized option \`-dlopen'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$modename --help --mode=$mode' for more information."
-
- # These modes are in order of execution frequency so that they run quickly.
- case $mode in
- # libtool compile mode
- compile)
- modename="$modename: compile"
- # Get the compilation command and the source file.
- base_compile=
- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
- suppress_opt=yes
- suppress_output=
- arg_mode=normal
- libobj=
- later=
-
- for arg
- do
- case $arg_mode in
- arg )
- # do not "continue". Instead, add this to base_compile
- lastarg="$arg"
- arg_mode=normal
- ;;
-
- target )
- libobj="$arg"
- arg_mode=normal
- continue
- ;;
-
- normal )
- # Accept any command-line options.
- case $arg in
- -o)
- if test -n "$libobj" ; then
- $echo "$modename: you cannot specify \`-o' more than once" 1>&2
- exit $EXIT_FAILURE
- fi
- arg_mode=target
- continue
- ;;
-
- -static | -prefer-pic | -prefer-non-pic)
- later="$later $arg"
- continue
- ;;
-
- -no-suppress)
- suppress_opt=no
- continue
- ;;
-
- -Xcompiler)
- arg_mode=arg # the next one goes into the "base_compile" arg list
- continue # The current "srcfile" will either be retained or
- ;; # replaced later. I would guess that would be a bug.
-
- -Wc,*)
- args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
- lastarg=
- save_ifs="$IFS"; IFS=','
- for arg in $args; do
- IFS="$save_ifs"
-
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- lastarg="$lastarg $arg"
- done
- IFS="$save_ifs"
- lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
-
- # Add the arguments to base_compile.
- base_compile="$base_compile $lastarg"
- continue
- ;;
-
- * )
- # Accept the current argument as the source file.
- # The previous "srcfile" becomes the current argument.
- #
- lastarg="$srcfile"
- srcfile="$arg"
- ;;
- esac # case $arg
- ;;
- esac # case $arg_mode
-
- # Aesthetically quote the previous argument.
- lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
-
- case $lastarg in
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, and some SunOS ksh mistreat backslash-escaping
- # in scan sets (worked around with variable expansion),
- # and furthermore cannot handle '|' '&' '(' ')' in scan sets
- # at all, so we specify them separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- lastarg="\"$lastarg\""
- ;;
- esac
-
- base_compile="$base_compile $lastarg"
- done # for arg
-
- case $arg_mode in
- arg)
- $echo "$modename: you must specify an argument for -Xcompile"
- exit $EXIT_FAILURE
- ;;
- target)
- $echo "$modename: you must specify a target with \`-o'" 1>&2
- exit $EXIT_FAILURE
- ;;
- *)
- # Get the name of the library object.
- [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
- ;;
- esac
-
- # Recognize several different file suffixes.
- # If the user specifies -o file.o, it is replaced with file.lo
- xform='[cCFSifmso]'
- case $libobj in
- *.ada) xform=ada ;;
- *.adb) xform=adb ;;
- *.ads) xform=ads ;;
- *.asm) xform=asm ;;
- *.c++) xform=c++ ;;
- *.cc) xform=cc ;;
- *.ii) xform=ii ;;
- *.class) xform=class ;;
- *.cpp) xform=cpp ;;
- *.cxx) xform=cxx ;;
- *.[fF][09]?) xform=[fF][09]. ;;
- *.for) xform=for ;;
- *.java) xform=java ;;
- *.obj) xform=obj ;;
- esac
-
- libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
- case $libobj in
- *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
- *)
- $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- func_infer_tag $base_compile
-
- for arg in $later; do
- case $arg in
- -static)
- build_old_libs=yes
- continue
- ;;
-
- -prefer-pic)
- pic_mode=yes
- continue
- ;;
-
- -prefer-non-pic)
- pic_mode=no
- continue
- ;;
- esac
- done
-
- qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
- case $qlibobj in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qlibobj="\"$qlibobj\"" ;;
- esac
- test "X$libobj" != "X$qlibobj" \
- && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
- objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
- xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$obj"; then
- xdir=
- else
- xdir=$xdir/
- fi
- lobj=${xdir}$objdir/$objname
-
- if test -z "$base_compile"; then
- $echo "$modename: you must specify a compilation command" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Delete any leftover library objects.
- if test "$build_old_libs" = yes; then
- removelist="$obj $lobj $libobj ${libobj}T"
- else
- removelist="$lobj $libobj ${libobj}T"
- fi
-
- $run $rm $removelist
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
-
- # On Cygwin there's no "real" PIC flag so we must build both object types
- case $host_os in
- cygwin* | mingw* | pw32* | os2*)
- pic_mode=default
- ;;
- esac
- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
- # non-PIC code in shared libraries is not supported
- pic_mode=default
- fi
-
- # Calculate the filename of the output object if compiler does
- # not support -o with -c
- if test "$compiler_c_o" = no; then
- output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
- lockfile="$output_obj.lock"
- removelist="$removelist $output_obj $lockfile"
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
- else
- output_obj=
- need_locks=no
- lockfile=
- fi
-
- # Lock this critical section if it is needed
- # We use this script file to make the link, it avoids creating a new file
- if test "$need_locks" = yes; then
- until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
- $show "Waiting for $lockfile to be removed"
- sleep 2
- done
- elif test "$need_locks" = warn; then
- if test -f "$lockfile"; then
- $echo "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
- $echo "$srcfile" > "$lockfile"
- fi
-
- if test -n "$fix_srcfile_path"; then
- eval srcfile=\"$fix_srcfile_path\"
- fi
- qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
- case $qsrcfile in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qsrcfile="\"$qsrcfile\"" ;;
- esac
-
- $run $rm "$libobj" "${libobj}T"
-
- # Create a libtool object file (analogous to a ".la" file),
- # but don't create it if we're doing a dry run.
- test -z "$run" && cat > ${libobj}T <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-EOF
-
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- if test ! -d "${xdir}$objdir"; then
- $show "$mkdir ${xdir}$objdir"
- $run $mkdir ${xdir}$objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
- exit $exit_status
- fi
- fi
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- command="$command -o $lobj"
- fi
-
- $run $rm "$lobj" "$output_obj"
-
- $show "$command"
- if $run eval "$command"; then :
- else
- test -n "$output_obj" && $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed, then go on to compile the next one
- if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- $show "$mv $output_obj $lobj"
- if $run $mv $output_obj $lobj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
-
- # Append the name of the PIC object to the libtool object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object='$objdir/$objname'
-
-EOF
-
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- else
- # No PIC object so indicate it doesn't exist in the libtool
- # object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
-
-EOF
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
- $run $rm "$obj" "$output_obj"
- $show "$command"
- if $run eval "$command"; then :
- else
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed
- if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- $show "$mv $output_obj $obj"
- if $run $mv $output_obj $obj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
-
- # Append the name of the non-PIC object the libtool object file.
- # Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
-
-EOF
- else
- # Append the name of the non-PIC object the libtool object file.
- # Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
-
-EOF
- fi
-
- $run $mv "${libobj}T" "${libobj}"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- $run $rm "$lockfile"
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- # libtool link mode
- link | relink)
- modename="$modename: link"
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args="$nonopt"
- base_compile="$nonopt $@"
- compile_command="$nonopt"
- finalize_command="$nonopt"
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
-
- avoid_version=no
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- notinst_path= # paths that contain not-installed libtool libraries
- precious_files_regex=
- prefer_static_libs=no
- preload=no
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
-
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -all-static | -static | -static-libtool-libs)
- case $arg in
- -all-static)
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
- fi
- if test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- -static)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=built
- ;;
- -static-libtool-libs)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- esac
- build_libtool_libs=no
- build_old_libs=yes
- break
- ;;
- esac
- done
-
- # See if our shared archives depend on static archives.
- test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
- # Go through the arguments, transforming them on the way.
- while test "$#" -gt 0; do
- arg="$1"
- shift
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
- ;;
- *) qarg=$arg ;;
- esac
- libtool_args="$libtool_args $qarg"
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- output)
- compile_command="$compile_command @OUTPUT@"
- finalize_command="$finalize_command @OUTPUT@"
- ;;
- esac
-
- case $prev in
- dlfiles|dlprefiles)
- if test "$preload" = no; then
- # Add the symbol object into the linking commands.
- compile_command="$compile_command @SYMFILE@"
- finalize_command="$finalize_command @SYMFILE@"
- preload=yes
- fi
- case $arg in
- *.la | *.lo) ;; # We handle these cases below.
- force)
- if test "$dlself" = no; then
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- self)
- if test "$prev" = dlprefiles; then
- dlself=yes
- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
- dlself=yes
- else
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- *)
- if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $arg"
- else
- dlprefiles="$dlprefiles $arg"
- fi
- prev=
- continue
- ;;
- esac
- ;;
- expsyms)
- export_symbols="$arg"
- if test ! -f "$arg"; then
- $echo "$modename: symbol file \`$arg' does not exist"
- exit $EXIT_FAILURE
- fi
- prev=
- continue
- ;;
- expsyms_regex)
- export_symbols_regex="$arg"
- prev=
- continue
- ;;
- inst_prefix)
- inst_prefix_dir="$arg"
- prev=
- continue
- ;;
- precious_regex)
- precious_files_regex="$arg"
- prev=
- continue
- ;;
- release)
- release="-$arg"
- prev=
- continue
- ;;
- objectlist)
- if test -f "$arg"; then
- save_arg=$arg
- moreargs=
- for fil in `cat $save_arg`
- do
-# moreargs="$moreargs $fil"
- arg=$fil
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- # If there is no directory component, then add one.
- case $arg in
- */* | *\\*) . $arg ;;
- *) . ./$arg ;;
- esac
-
- if test -z "$pic_object" || \
- test -z "$non_pic_object" ||
- test "$pic_object" = none && \
- test "$non_pic_object" = none; then
- $echo "$modename: cannot find name of object for \`$arg'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- libobjs="$libobjs $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- non_pic_objects="$non_pic_objects $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if test -z "$run"; then
- $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
- exit $EXIT_FAILURE
- else
- # Dry-run case.
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- libobjs="$libobjs $pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- fi
- done
- else
- $echo "$modename: link input file \`$save_arg' does not exist"
- exit $EXIT_FAILURE
- fi
- arg=$save_arg
- prev=
- continue
- ;;
- rpath | xrpath)
- # We need an absolute path.
- case $arg in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- $echo "$modename: only absolute run-paths are allowed" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- if test "$prev" = rpath; then
- case "$rpath " in
- *" $arg "*) ;;
- *) rpath="$rpath $arg" ;;
- esac
- else
- case "$xrpath " in
- *" $arg "*) ;;
- *) xrpath="$xrpath $arg" ;;
- esac
- fi
- prev=
- continue
- ;;
- xcompiler)
- compiler_flags="$compiler_flags $qarg"
- prev=
- compile_command="$compile_command $qarg"
- finalize_command="$finalize_command $qarg"
- continue
- ;;
- xlinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $wl$qarg"
- prev=
- compile_command="$compile_command $wl$qarg"
- finalize_command="$finalize_command $wl$qarg"
- continue
- ;;
- xcclinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $qarg"
- prev=
- compile_command="$compile_command $qarg"
- finalize_command="$finalize_command $qarg"
- continue
- ;;
- shrext)
- shrext_cmds="$arg"
- prev=
- continue
- ;;
- darwin_framework|darwin_framework_skip)
- test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- prev=
- continue
- ;;
- *)
- eval "$prev=\"\$arg\""
- prev=
- continue
- ;;
- esac
- fi # test -n "$prev"
-
- prevarg="$arg"
-
- case $arg in
- -all-static)
- if test -n "$link_static_flag"; then
- compile_command="$compile_command $link_static_flag"
- finalize_command="$finalize_command $link_static_flag"
- fi
- continue
- ;;
-
- -allow-undefined)
- # FIXME: remove this flag sometime in the future.
- $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
- continue
- ;;
-
- -avoid-version)
- avoid_version=yes
- continue
- ;;
-
- -dlopen)
- prev=dlfiles
- continue
- ;;
-
- -dlpreopen)
- prev=dlprefiles
- continue
- ;;
-
- -export-dynamic)
- export_dynamic=yes
- continue
- ;;
-
- -export-symbols | -export-symbols-regex)
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: more than one -exported-symbols argument is not allowed"
- exit $EXIT_FAILURE
- fi
- if test "X$arg" = "X-export-symbols"; then
- prev=expsyms
- else
- prev=expsyms_regex
- fi
- continue
- ;;
-
- -framework|-arch|-isysroot)
- case " $CC " in
- *" ${arg} ${1} "* | *" ${arg} ${1} "*)
- prev=darwin_framework_skip ;;
- *) compiler_flags="$compiler_flags $arg"
- prev=darwin_framework ;;
- esac
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- continue
- ;;
-
- -inst-prefix-dir)
- prev=inst_prefix
- continue
- ;;
-
- # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- # so, if we see these flags be careful not to treat them like -L
- -L[A-Z][A-Z]*:*)
- case $with_gcc/$host in
- no/*-*-irix* | /*-*-irix*)
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- ;;
- esac
- continue
- ;;
-
- -L*)
- dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
- absdir="$dir"
- notinst_path="$notinst_path $dir"
- fi
- dir="$absdir"
- ;;
- esac
- case "$deplibs " in
- *" -L$dir "*) ;;
- *)
- deplibs="$deplibs -L$dir"
- lib_search_path="$lib_search_path $dir"
- ;;
- esac
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$dir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$dir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
- esac
- ;;
- esac
- continue
- ;;
-
- -l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
- # These systems don't actually have a C or math library (as such)
- continue
- ;;
- *-*-os2*)
- # These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C and math libraries are in the System framework
- deplibs="$deplibs -framework System"
- continue
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
- ;;
- esac
- elif test "X$arg" = "X-lc_r"; then
- case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc_r directly, use -pthread flag.
- continue
- ;;
- esac
- fi
- deplibs="$deplibs $arg"
- continue
- ;;
-
- # Tru64 UNIX uses -model [arg] to determine the layout of C++
- # classes, name mangling, and exception handling.
- -model)
- compile_command="$compile_command $arg"
- compiler_flags="$compiler_flags $arg"
- finalize_command="$finalize_command $arg"
- prev=xcompiler
- continue
- ;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- compiler_flags="$compiler_flags $arg"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- continue
- ;;
-
- -module)
- module=yes
- continue
- ;;
-
- # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
- # -r[0-9][0-9]* specifies the processor on the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
- # +DA*, +DD* enable 64-bit mode on the HP compiler
- # -q* pass through compiler args for the IBM compiler
- # -m* pass through architecture-specific compiler args for GCC
- # -m*, -t[45]*, -txscale* pass through architecture-specific
- # compiler args for GCC
- # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
- # -F/path gives path to uninstalled frameworks, gcc on darwin
- # @file GCC response files
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
-
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- compiler_flags="$compiler_flags $arg"
- continue
- ;;
-
- -shrext)
- prev=shrext
- continue
- ;;
-
- -no-fast-install)
- fast_install=no
- continue
- ;;
-
- -no-install)
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
- # The PATH hackery in wrapper scripts is required on Windows
- # and Darwin in order for the loader to find any dlls it needs.
- $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
- $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
- fast_install=no
- ;;
- *) no_install=yes ;;
- esac
- continue
- ;;
-
- -no-undefined)
- allow_undefined=no
- continue
- ;;
-
- -objectlist)
- prev=objectlist
- continue
- ;;
-
- -o) prev=output ;;
-
- -precious-files-regex)
- prev=precious_regex
- continue
- ;;
-
- -release)
- prev=release
- continue
- ;;
-
- -rpath)
- prev=rpath
- continue
- ;;
-
- -R)
- prev=xrpath
- continue
- ;;
-
- -R*)
- dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- $echo "$modename: only absolute run-paths are allowed" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- continue
- ;;
-
- -static | -static-libtool-libs)
- # The effects of -static are defined in a previous loop.
- # We used to do the same as -all-static on platforms that
- # didn't have a PIC flag, but the assumption that the effects
- # would be equivalent was wrong. It would break on at least
- # Digital Unix and AIX.
- continue
- ;;
-
- -thread-safe)
- thread_safe=yes
- continue
- ;;
-
- -version-info)
- prev=vinfo
- continue
- ;;
- -version-number)
- prev=vinfo
- vinfo_number=yes
- continue
- ;;
-
- -Wc,*)
- args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- case $flag in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- flag="\"$flag\""
- ;;
- esac
- arg="$arg $wl$flag"
- compiler_flags="$compiler_flags $flag"
- done
- IFS="$save_ifs"
- arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
- ;;
-
- -Wl,*)
- args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- case $flag in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- flag="\"$flag\""
- ;;
- esac
- arg="$arg $wl$flag"
- compiler_flags="$compiler_flags $wl$flag"
- linker_flags="$linker_flags $flag"
- done
- IFS="$save_ifs"
- arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
- ;;
-
- -Xcompiler)
- prev=xcompiler
- continue
- ;;
-
- -Xlinker)
- prev=xlinker
- continue
- ;;
-
- -XCClinker)
- prev=xcclinker
- continue
- ;;
-
- # Some other compiler flag.
- -* | +*)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- ;;
-
- *.$objext)
- # A standard object.
- objs="$objs $arg"
- ;;
-
- *.lo)
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- # If there is no directory component, then add one.
- case $arg in
- */* | *\\*) . $arg ;;
- *) . ./$arg ;;
- esac
-
- if test -z "$pic_object" || \
- test -z "$non_pic_object" ||
- test "$pic_object" = none && \
- test "$non_pic_object" = none; then
- $echo "$modename: cannot find name of object for \`$arg'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- libobjs="$libobjs $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- non_pic_objects="$non_pic_objects $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if test -z "$run"; then
- $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
- exit $EXIT_FAILURE
- else
- # Dry-run case.
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- libobjs="$libobjs $pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- fi
- ;;
-
- *.$libext)
- # An archive.
- deplibs="$deplibs $arg"
- old_deplibs="$old_deplibs $arg"
- continue
- ;;
-
- *.la)
- # A libtool-controlled library.
-
- if test "$prev" = dlfiles; then
- # This library was specified with -dlopen.
- dlfiles="$dlfiles $arg"
- prev=
- elif test "$prev" = dlprefiles; then
- # The library was specified with -dlpreopen.
- dlprefiles="$dlprefiles $arg"
- prev=
- else
- deplibs="$deplibs $arg"
- fi
- continue
- ;;
-
- # Some other compiler argument.
- *)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- ;;
- esac # arg
-
- # Now actually substitute the argument into the commands.
- if test -n "$arg"; then
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- fi
- done # argument parsing loop
-
- if test -n "$prev"; then
- $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- fi
-
- oldlibs=
- # calculate the name of the file, without its directory
- outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
- libobjs_save="$libobjs"
-
- if test -n "$shlibpath_var"; then
- # get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
- else
- shlib_search_path=
- fi
- eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
- output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$output_objdir" = "X$output"; then
- output_objdir="$objdir"
- else
- output_objdir="$output_objdir/$objdir"
- fi
- # Create the object directory.
- if test ! -d "$output_objdir"; then
- $show "$mkdir $output_objdir"
- $run $mkdir $output_objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
- exit $exit_status
- fi
- fi
-
- # Determine the type of output
- case $output in
- "")
- $echo "$modename: you must specify an output file" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- *.$libext) linkmode=oldlib ;;
- *.lo | *.$objext) linkmode=obj ;;
- *.la) linkmode=lib ;;
- *) linkmode=prog ;; # Anything else should be a program.
- esac
-
- case $host in
- *cygwin* | *mingw* | *pw32*)
- # don't eliminate duplications in $postdeps and $predeps
- duplicate_compiler_generated_deps=yes
- ;;
- *)
- duplicate_compiler_generated_deps=$duplicate_deps
- ;;
- esac
- specialdeplibs=
-
- libs=
- # Find all interdependent deplibs by searching for libraries
- # that are linked more than once (e.g. -la -lb -la)
- for deplib in $deplibs; do
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- libs="$libs $deplib"
- done
-
- if test "$linkmode" = lib; then
- libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
- # Compute libraries that are listed more than once in $predeps
- # $postdeps and mark them as special (i.e., whose duplicates are
- # not to be eliminated).
- pre_post_deps=
- if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
- for pre_post_dep in $predeps $postdeps; do
- case "$pre_post_deps " in
- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
- esac
- pre_post_deps="$pre_post_deps $pre_post_dep"
- done
- fi
- pre_post_deps=
- fi
-
- deplibs=
- newdependency_libs=
- newlib_search_path=
- need_relink=no # whether we're linking any uninstalled libtool libraries
- notinst_deplibs= # not-installed libtool libraries
- case $linkmode in
- lib)
- passes="conv link"
- for file in $dlfiles $dlprefiles; do
- case $file in
- *.la) ;;
- *)
- $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- done
- ;;
- prog)
- compile_deplibs=
- finalize_deplibs=
- alldeplibs=no
- newdlfiles=
- newdlprefiles=
- passes="conv scan dlopen dlpreopen link"
- ;;
- *) passes="conv"
- ;;
- esac
- for pass in $passes; do
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
- deplibs=
- fi
- if test "$linkmode" = prog; then
- case $pass in
- dlopen) libs="$dlfiles" ;;
- dlpreopen) libs="$dlprefiles" ;;
- link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
- esac
- fi
- if test "$pass" = dlopen; then
- # Collect dlpreopened libraries
- save_deplibs="$deplibs"
- deplibs=
- fi
- for deplib in $libs; do
- lib=
- found=no
- case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- compiler_flags="$compiler_flags $deplib"
- fi
- continue
- ;;
- -l*)
- if test "$linkmode" != lib && test "$linkmode" != prog; then
- $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
- continue
- fi
- name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
- for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
- for search_ext in .la $std_shrext .so .a; do
- # Search the libtool library
- lib="$searchdir/lib${name}${search_ext}"
- if test -f "$lib"; then
- if test "$search_ext" = ".la"; then
- found=yes
- else
- found=no
- fi
- break 2
- fi
- done
- done
- if test "$found" != yes; then
- # deplib doesn't seem to be a libtool library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- else # deplib is a libtool library
- # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- # We need to do some special things here, and not later.
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $deplib "*)
- if (${SED} -e '2q' $lib |
- grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- library_names=
- old_library=
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
- for l in $old_library $library_names; do
- ll="$l"
- done
- if test "X$ll" = "X$old_library" ; then # only static version available
- found=no
- ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$ladir" = "X$lib" && ladir="."
- lib=$ladir/$old_library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- fi
- fi
- ;;
- *) ;;
- esac
- fi
- fi
- ;; # -l
- -L*)
- case $linkmode in
- lib)
- deplibs="$deplib $deplibs"
- test "$pass" = conv && continue
- newdependency_libs="$deplib $newdependency_libs"
- newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
- ;;
- prog)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- if test "$pass" = scan; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
- ;;
- *)
- $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
- ;;
- esac # linkmode
- continue
- ;; # -L
- -R*)
- if test "$pass" = link; then
- dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
- # Make sure the xrpath contains only unique directories.
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- fi
- deplibs="$deplib $deplibs"
- continue
- ;;
- *.la) lib="$deplib" ;;
- *.$libext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- case $linkmode in
- lib)
- valid_a_lib=no
- case $deplibs_check_method in
- match_pattern*)
- set dummy $deplibs_check_method
- match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- if eval $echo \"$deplib\" 2>/dev/null \
- | $SED 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
- fi
- ;;
- pass_all)
- valid_a_lib=yes
- ;;
- esac
- if test "$valid_a_lib" != yes; then
- $echo
- $echo "*** Warning: Trying to link with static lib archive $deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because the file extensions .$libext of this argument makes me believe"
- $echo "*** that it is just a static archive that I should not used here."
- else
- $echo
- $echo "*** Warning: Linking the shared library $output against the"
- $echo "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
- fi
- continue
- ;;
- prog)
- if test "$pass" != link; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- continue
- ;;
- esac # linkmode
- ;; # *.$libext
- *.lo | *.$objext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- elif test "$linkmode" = prog; then
- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- newdlfiles="$newdlfiles $deplib"
- fi
- fi
- continue
- ;;
- %DEPLIBS%)
- alldeplibs=yes
- continue
- ;;
- esac # case $deplib
- if test "$found" = yes || test -f "$lib"; then :
- else
- $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
-
- ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$ladir" = "X$lib" && ladir="."
-
- dlname=
- dlopen=
- dlpreopen=
- libdir=
- library_names=
- old_library=
- # If the library was installed with an old release of libtool,
- # it will not redefine variables installed, or shouldnotlink
- installed=yes
- shouldnotlink=no
- avoidtemprpath=
-
-
- # Read the .la file
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
-
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan" ||
- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
- fi
-
- if test "$pass" = conv; then
- # Only check for convenience libraries
- deplibs="$lib $deplibs"
- if test -z "$libdir"; then
- if test -z "$old_library"; then
- $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- # It is a libtool convenience library, so add in its objects.
- convenience="$convenience $ladir/$objdir/$old_library"
- old_convenience="$old_convenience $ladir/$objdir/$old_library"
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- $echo "$modename: \`$lib' is not a convenience library" 1>&2
- exit $EXIT_FAILURE
- fi
- continue
- fi # $pass = conv
-
-
- # Get the name of the library we link against.
- linklib=
- for l in $old_library $library_names; do
- linklib="$l"
- done
- if test -z "$linklib"; then
- $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # This library was specified with -dlopen.
- if test "$pass" = dlopen; then
- if test -z "$libdir"; then
- $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- if test -z "$dlname" ||
- test "$dlopen_support" != yes ||
- test "$build_libtool_libs" = no; then
- # If there is no dlname, no dlopen support or we're linking
- # statically, we need to preload. We also need to preload any
- # dependent libraries so libltdl's deplib preloader doesn't
- # bomb out in the load deplibs phase.
- dlprefiles="$dlprefiles $lib $dependency_libs"
- else
- newdlfiles="$newdlfiles $lib"
- fi
- continue
- fi # $pass = dlopen
-
- # We need an absolute path.
- case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
- *)
- abs_ladir=`cd "$ladir" && pwd`
- if test -z "$abs_ladir"; then
- $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
- $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
- abs_ladir="$ladir"
- fi
- ;;
- esac
- laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-
- # Find the relevant object directory and library name.
- if test "X$installed" = Xyes; then
- if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- $echo "$modename: warning: library \`$lib' was moved." 1>&2
- dir="$ladir"
- absdir="$abs_ladir"
- libdir="$abs_ladir"
- else
- dir="$libdir"
- absdir="$libdir"
- fi
- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- else
- if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir="$ladir"
- absdir="$abs_ladir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- else
- dir="$ladir/$objdir"
- absdir="$abs_ladir/$objdir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- fi
- fi # $installed = yes
- name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-
- # This library was specified with -dlpreopen.
- if test "$pass" = dlpreopen; then
- if test -z "$libdir"; then
- $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- newdlprefiles="$newdlprefiles $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- newdlprefiles="$newdlprefiles $dir/$dlname"
- else
- newdlprefiles="$newdlprefiles $dir/$linklib"
- fi
- fi # $pass = dlpreopen
-
- if test -z "$libdir"; then
- # Link the convenience library
- if test "$linkmode" = lib; then
- deplibs="$dir/$old_library $deplibs"
- elif test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$dir/$old_library $compile_deplibs"
- finalize_deplibs="$dir/$old_library $finalize_deplibs"
- else
- deplibs="$lib $deplibs" # used for prog,scan pass
- fi
- continue
- fi
-
-
- if test "$linkmode" = prog && test "$pass" != link; then
- newlib_search_path="$newlib_search_path $ladir"
- deplibs="$lib $deplibs"
-
- linkalldeplibs=no
- if test "$link_all_deplibs" != no || test -z "$library_names" ||
- test "$build_libtool_libs" = no; then
- linkalldeplibs=yes
- fi
-
- tmp_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
- esac
- # Need to link against all dependency_libs?
- if test "$linkalldeplibs" = yes; then
- deplibs="$deplib $deplibs"
- else
- # Need to hardcode shared library paths
- # or/and link against static libraries
- newdependency_libs="$deplib $newdependency_libs"
- fi
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done # for deplib
- continue
- fi # $linkmode = prog...
-
- if test "$linkmode,$pass" = "prog,link"; then
- if test -n "$library_names" &&
- { { test "$prefer_static_libs" = no ||
- test "$prefer_static_libs,$installed" = "built,yes"; } ||
- test -z "$old_library"; }; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
- # Make sure the rpath contains only unique directories.
- case "$temp_rpath " in
- *" $dir "*) ;;
- *" $absdir "*) ;;
- *) temp_rpath="$temp_rpath $absdir" ;;
- esac
- fi
-
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi # $linkmode,$pass = prog,link...
-
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
- test -n "$library_names"; }; }; then
- # We only need to search for static libraries
- continue
- fi
- fi
-
- link_static=no # Whether the deplib will be linked statically
- use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes ; then
- use_static_libs=no
- fi
- if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
- if test "$installed" = no; then
- notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
- fi
- # This is a shared library
-
- # Warn about portability, can't link against -module's on
- # some systems (darwin)
- if test "$shouldnotlink" = yes && test "$pass" = link ; then
- $echo
- if test "$linkmode" = prog; then
- $echo "*** Warning: Linking the executable $output against the loadable module"
- else
- $echo "*** Warning: Linking the shared library $output against the loadable module"
- fi
- $echo "*** $linklib is not portable!"
- fi
- if test "$linkmode" = lib &&
- test "$hardcode_into_libs" = yes; then
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi
-
- if test -n "$old_archive_from_expsyms_cmds"; then
- # figure out the soname
- set dummy $library_names
- realname="$2"
- shift; shift
- libname=`eval \\$echo \"$libname_spec\"`
- # use dlname if we got it. it's perfectly good, no?
- if test -n "$dlname"; then
- soname="$dlname"
- elif test -n "$soname_spec"; then
- # bleh windows
- case $host in
- *cygwin* | mingw*)
- major=`expr $current - $age`
- versuffix="-$major"
- ;;
- esac
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
-
- # Make a new name for the extract_expsyms_cmds to use
- soroot="$soname"
- soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
- newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
-
- # If the library has no export list, then create one now
- if test -f "$output_objdir/$soname-def"; then :
- else
- $show "extracting exported symbol list from \`$soname'"
- save_ifs="$IFS"; IFS='~'
- cmds=$extract_expsyms_cmds
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
-
- # Create $newlib
- if test -f "$output_objdir/$newlib"; then :; else
- $show "generating import library for \`$soname'"
- save_ifs="$IFS"; IFS='~'
- cmds=$old_archive_from_expsyms_cmds
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
- # make sure the library variables are pointing to the new library
- dir=$output_objdir
- linklib=$newlib
- fi # test -n "$old_archive_from_expsyms_cmds"
-
- if test "$linkmode" = prog || test "$mode" != relink; then
- add_shlibpath=
- add_dir=
- add=
- lib_linked=yes
- case $hardcode_action in
- immediate | unsupported)
- if test "$hardcode_direct" = no; then
- add="$dir/$linklib"
- case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
- *-*-darwin* )
- # if the lib is a module then we can not link against
- # it, someone is ignoring the new warnings I added
- if /usr/bin/file -L $add 2> /dev/null |
- $EGREP ": [^:]* bundle" >/dev/null ; then
- $echo "** Warning, lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
- $echo
- $echo "** And there doesn't seem to be a static archive available"
- $echo "** The link will probably fail, sorry"
- else
- add="$dir/$old_library"
- fi
- fi
- esac
- elif test "$hardcode_minus_L" = no; then
- case $host in
- *-*-sunos*) add_shlibpath="$dir" ;;
- esac
- add_dir="-L$dir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = no; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- relink)
- if test "$hardcode_direct" = yes; then
- add="$dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$dir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- *) lib_linked=no ;;
- esac
-
- if test "$lib_linked" != yes; then
- $echo "$modename: configuration error: unsupported hardcode properties"
- exit $EXIT_FAILURE
- fi
-
- if test -n "$add_shlibpath"; then
- case :$compile_shlibpath: in
- *":$add_shlibpath:"*) ;;
- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
- esac
- fi
- if test "$linkmode" = prog; then
- test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- test -n "$add" && compile_deplibs="$add $compile_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- if test "$hardcode_direct" != yes && \
- test "$hardcode_minus_L" != yes && \
- test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- fi
- fi
- fi
-
- if test "$linkmode" = prog || test "$mode" = relink; then
- add_shlibpath=
- add_dir=
- add=
- # Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes; then
- add="$libdir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- add="-l$name"
- elif test "$hardcode_automatic" = yes; then
- if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
- else
- add="$libdir/$linklib"
- fi
- else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- fi
-
- if test "$linkmode" = prog; then
- test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- fi
- fi
- elif test "$linkmode" = prog; then
- # Here we assume that one of hardcode_direct or hardcode_minus_L
- # is not unsupported. This is valid on all known static and
- # shared platforms.
- if test "$hardcode_direct" != unsupported; then
- test -n "$old_library" && linklib="$old_library"
- compile_deplibs="$dir/$linklib $compile_deplibs"
- finalize_deplibs="$dir/$linklib $finalize_deplibs"
- else
- compile_deplibs="-l$name -L$dir $compile_deplibs"
- finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- fi
- elif test "$build_libtool_libs" = yes; then
- # Not a shared library
- if test "$deplibs_check_method" != pass_all; then
- # We're trying link a shared library against a static one
- # but the system doesn't support it.
-
- # Just print a warning and add the library to dependency_libs so
- # that the program can be linked against the static library.
- $echo
- $echo "*** Warning: This system can not link to static lib archive $lib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have."
- if test "$module" = yes; then
- $echo "*** But as you try to build a module library, libtool will still create "
- $echo "*** a static module, that should work as long as the dlopening application"
- $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
- if test -z "$global_symbol_pipe"; then
- $echo
- $echo "*** However, this would only work if libtool was able to extract symbol"
- $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $echo "*** not find such a program. So, this module is probably useless."
- $echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- else
- deplibs="$dir/$old_library $deplibs"
- link_static=yes
- fi
- fi # link shared/static library?
-
- if test "$linkmode" = lib; then
- if test -n "$dependency_libs" &&
- { test "$hardcode_into_libs" != yes ||
- test "$build_old_libs" = yes ||
- test "$link_static" = yes; }; then
- # Extract -R from dependency_libs
- temp_deplibs=
- for libdir in $dependency_libs; do
- case $libdir in
- -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
- case " $xrpath " in
- *" $temp_xrpath "*) ;;
- *) xrpath="$xrpath $temp_xrpath";;
- esac;;
- *) temp_deplibs="$temp_deplibs $libdir";;
- esac
- done
- dependency_libs="$temp_deplibs"
- fi
-
- newlib_search_path="$newlib_search_path $absdir"
- # Link against this library
- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- # ... and its dependency_libs
- tmp_libs=
- for deplib in $dependency_libs; do
- newdependency_libs="$deplib $newdependency_libs"
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done
-
- if test "$link_all_deplibs" != no; then
- # Add the search paths of all dependency libraries
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) path="$deplib" ;;
- *.la)
- dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$deplib" && dir="."
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
- absdir="$dir"
- fi
- ;;
- esac
- if grep "^installed=no" $deplib > /dev/null; then
- path="$absdir/$objdir"
- else
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- if test -z "$libdir"; then
- $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- if test "$absdir" != "$libdir"; then
- $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
- fi
- path="$absdir"
- fi
- depdepl=
- case $host in
- *-*-darwin*)
- # we do not want to link against static libs,
- # but need to link against shared
- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- if test -n "$deplibrary_names" ; then
- for tmp in $deplibrary_names ; do
- depdepl=$tmp
- done
- if test -f "$path/$depdepl" ; then
- depdepl="$path/$depdepl"
- fi
- # do not add paths which are already there
- case " $newlib_search_path " in
- *" $path "*) ;;
- *) newlib_search_path="$newlib_search_path $path";;
- esac
- fi
- path=""
- ;;
- *)
- path="-L$path"
- ;;
- esac
- ;;
- -l*)
- case $host in
- *-*-darwin*)
- # Again, we only want to link against shared libraries
- eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
- for tmp in $newlib_search_path ; do
- if test -f "$tmp/lib$tmp_libs.dylib" ; then
- eval depdepl="$tmp/lib$tmp_libs.dylib"
- break
- fi
- done
- path=""
- ;;
- *) continue ;;
- esac
- ;;
- *) continue ;;
- esac
- case " $deplibs " in
- *" $path "*) ;;
- *) deplibs="$path $deplibs" ;;
- esac
- case " $deplibs " in
- *" $depdepl "*) ;;
- *) deplibs="$depdepl $deplibs" ;;
- esac
- done
- fi # link_all_deplibs != no
- fi # linkmode = lib
- done # for deplib in $libs
- dependency_libs="$newdependency_libs"
- if test "$pass" = dlpreopen; then
- # Link the dlpreopened libraries before other libraries
- for deplib in $save_deplibs; do
- deplibs="$deplib $deplibs"
- done
- fi
- if test "$pass" != dlopen; then
- if test "$pass" != conv; then
- # Make sure lib_search_path contains only unique directories.
- lib_search_path=
- for dir in $newlib_search_path; do
- case "$lib_search_path " in
- *" $dir "*) ;;
- *) lib_search_path="$lib_search_path $dir" ;;
- esac
- done
- newlib_search_path=
- fi
-
- if test "$linkmode,$pass" != "prog,link"; then
- vars="deplibs"
- else
- vars="compile_deplibs finalize_deplibs"
- fi
- for var in $vars dependency_libs; do
- # Add libraries to $var in reverse order
- eval tmp_libs=\"\$$var\"
- new_libs=
- for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
- *)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
- esac
- ;;
- esac
- done
- tmp_libs=
- for deplib in $new_libs; do
- case $deplib in
- -L*)
- case " $tmp_libs " in
- *" $deplib "*) ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
- esac
- ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
- esac
- done
- eval $var=\"$tmp_libs\"
- done # for var
- fi
- # Last step: remove runtime libs from dependency_libs
- # (they stay in deplibs)
- tmp_libs=
- for i in $dependency_libs ; do
- case " $predeps $postdeps $compiler_lib_search_path " in
- *" $i "*)
- i=""
- ;;
- esac
- if test -n "$i" ; then
- tmp_libs="$tmp_libs $i"
- fi
- done
- dependency_libs=$tmp_libs
- done # for pass
- if test "$linkmode" = prog; then
- dlfiles="$newdlfiles"
- dlprefiles="$newdlprefiles"
- fi
-
- case $linkmode in
- oldlib)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
- fi
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
- fi
-
- if test -n "$rpath"; then
- $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
- fi
-
- if test -n "$xrpath"; then
- $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
- fi
-
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
- fi
-
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
- fi
-
- # Now set the variables for building old libraries.
- build_libtool_libs=no
- oldlibs="$output"
- objs="$objs$old_deplibs"
- ;;
-
- lib)
- # Make sure we only generate libraries of the form `libNAME.la'.
- case $outputname in
- lib*)
- name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- ;;
- *)
- if test "$module" = no; then
- $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
- if test "$need_lib_prefix" != no; then
- # Add the "lib" prefix for modules if required
- name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- else
- libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
- fi
- ;;
- esac
-
- if test -n "$objs"; then
- if test "$deplibs_check_method" != pass_all; then
- $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
- exit $EXIT_FAILURE
- else
- $echo
- $echo "*** Warning: Linking the shared library $output against the non-libtool"
- $echo "*** objects $objs is not portable!"
- libobjs="$libobjs $objs"
- fi
- fi
-
- if test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
- fi
-
- set dummy $rpath
- if test "$#" -gt 2; then
- $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
- fi
- install_libdir="$2"
-
- oldlibs=
- if test -z "$rpath"; then
- if test "$build_libtool_libs" = yes; then
- # Building a libtool convenience library.
- # Some compilers have problems with a `.al' extension so
- # convenience libraries should have the same extension an
- # archive normally would.
- oldlibs="$output_objdir/$libname.$libext $oldlibs"
- build_libtool_libs=convenience
- build_old_libs=yes
- fi
-
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
- fi
- else
-
- # Parse the version information argument.
- save_ifs="$IFS"; IFS=':'
- set dummy $vinfo 0 0 0
- IFS="$save_ifs"
-
- if test -n "$8"; then
- $echo "$modename: too many parameters to \`-version-info'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # convert absolute version numbers to libtool ages
- # this retains compatibility with .la files and attempts
- # to make the code below a bit more comprehensible
-
- case $vinfo_number in
- yes)
- number_major="$2"
- number_minor="$3"
- number_revision="$4"
- #
- # There are really only two kinds -- those that
- # use the current revision as the major version
- # and those that subtract age and use age as
- # a minor version. But, then there is irix
- # which has an extra 1 added just for fun
- #
- case $version_type in
- darwin|linux|osf|windows|none)
- current=`expr $number_major + $number_minor`
- age="$number_minor"
- revision="$number_revision"
- ;;
- freebsd-aout|freebsd-elf|sunos)
- current="$number_major"
- revision="$number_minor"
- age="0"
- ;;
- irix|nonstopux)
- current=`expr $number_major + $number_minor`
- age="$number_minor"
- revision="$number_minor"
- lt_irix_increment=no
- ;;
- esac
- ;;
- no)
- current="$2"
- revision="$3"
- age="$4"
- ;;
- esac
-
- # Check that each of the things are valid numbers.
- case $current in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $revision in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $age in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- if test "$age" -gt "$current"; then
- $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Calculate the version variables.
- major=
- versuffix=
- verstring=
- case $version_type in
- none) ;;
-
- darwin)
- # Like Linux, but with the current version available in
- # verstring for coding it into the library header
- major=.`expr $current - $age`
- versuffix="$major.$age.$revision"
- # Darwin ld doesn't like 0 for these options...
- minor_current=`expr $current + 1`
- xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
- verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
- ;;
-
- freebsd-aout)
- major=".$current"
- versuffix=".$current.$revision";
- ;;
-
- freebsd-elf)
- major=".$current"
- versuffix=".$current";
- ;;
-
- irix | nonstopux)
- if test "X$lt_irix_increment" = "Xno"; then
- major=`expr $current - $age`
- else
- major=`expr $current - $age + 1`
- fi
- case $version_type in
- nonstopux) verstring_prefix=nonstopux ;;
- *) verstring_prefix=sgi ;;
- esac
- verstring="$verstring_prefix$major.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$revision
- while test "$loop" -ne 0; do
- iface=`expr $revision - $loop`
- loop=`expr $loop - 1`
- verstring="$verstring_prefix$major.$iface:$verstring"
- done
-
- # Before this point, $major must not contain `.'.
- major=.$major
- versuffix="$major.$revision"
- ;;
-
- linux)
- major=.`expr $current - $age`
- versuffix="$major.$age.$revision"
- ;;
-
- osf)
- major=.`expr $current - $age`
- versuffix=".$current.$age.$revision"
- verstring="$current.$age.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$age
- while test "$loop" -ne 0; do
- iface=`expr $current - $loop`
- loop=`expr $loop - 1`
- verstring="$verstring:${iface}.0"
- done
-
- # Make executables depend on our current version.
- verstring="$verstring:${current}.0"
- ;;
-
- sunos)
- major=".$current"
- versuffix=".$current.$revision"
- ;;
-
- windows)
- # Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 filesystems.
- major=`expr $current - $age`
- versuffix="-$major"
- ;;
-
- *)
- $echo "$modename: unknown library version type \`$version_type'" 1>&2
- $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- # Clear the version info if we defaulted, and they specified a release.
- if test -z "$vinfo" && test -n "$release"; then
- major=
- case $version_type in
- darwin)
- # we can't check for "0.0" in archive_cmds due to quoting
- # problems, so we reset it completely
- verstring=
- ;;
- *)
- verstring="0.0"
- ;;
- esac
- if test "$need_version" = no; then
- versuffix=
- else
- versuffix=".0.0"
- fi
- fi
-
- # Remove version info from name if versioning should be avoided
- if test "$avoid_version" = yes && test "$need_version" = no; then
- major=
- versuffix=
- verstring=""
- fi
-
- # Check to see if the archive will have undefined symbols.
- if test "$allow_undefined" = yes; then
- if test "$allow_undefined_flag" = unsupported; then
- $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
- build_libtool_libs=no
- build_old_libs=yes
- fi
- else
- # Don't allow undefined symbols.
- allow_undefined_flag="$no_undefined_flag"
- fi
- fi
-
- if test "$mode" != relink; then
- # Remove our outputs, but don't remove object files since they
- # may have been created when compiling PIC objects.
- removelist=
- tempremovelist=`$echo "$output_objdir/*"`
- for p in $tempremovelist; do
- case $p in
- *.$objext)
- ;;
- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- if test "X$precious_files_regex" != "X"; then
- if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- then
- continue
- fi
- fi
- removelist="$removelist $p"
- ;;
- *) ;;
- esac
- done
- if test -n "$removelist"; then
- $show "${rm}r $removelist"
- $run ${rm}r $removelist
- fi
- fi
-
- # Now set the variables for building old libraries.
- if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- oldlibs="$oldlibs $output_objdir/$libname.$libext"
-
- # Transform .lo files to .o files.
- oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
- fi
-
- # Eliminate all temporary directories.
- #for path in $notinst_path; do
- # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
- # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
- # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
- #done
-
- if test -n "$xrpath"; then
- # If the user specified any rpath flags, then add them.
- temp_xrpath=
- for libdir in $xrpath; do
- temp_xrpath="$temp_xrpath -R$libdir"
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
- esac
- done
- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
- dependency_libs="$temp_xrpath $dependency_libs"
- fi
- fi
-
- # Make sure dlfiles contains only unique files that won't be dlpreopened
- old_dlfiles="$dlfiles"
- dlfiles=
- for lib in $old_dlfiles; do
- case " $dlprefiles $dlfiles " in
- *" $lib "*) ;;
- *) dlfiles="$dlfiles $lib" ;;
- esac
- done
-
- # Make sure dlprefiles contains only unique files
- old_dlprefiles="$dlprefiles"
- dlprefiles=
- for lib in $old_dlprefiles; do
- case "$dlprefiles " in
- *" $lib "*) ;;
- *) dlprefiles="$dlprefiles $lib" ;;
- esac
- done
-
- if test "$build_libtool_libs" = yes; then
- if test -n "$rpath"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
- # these systems don't actually have a c library (as such)!
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C library is in the System framework
- deplibs="$deplibs -framework System"
- ;;
- *-*-netbsd*)
- # Don't link with libc until the a.out ld.so is fixed.
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- ;;
- *)
- # Add libc to deplibs on all other systems if necessary.
- if test "$build_libtool_need_lc" = "yes"; then
- deplibs="$deplibs -lc"
- fi
- ;;
- esac
- fi
-
- # Transform deplibs into only deplibs that can be linked in shared.
- name_save=$name
- libname_save=$libname
- release_save=$release
- versuffix_save=$versuffix
- major_save=$major
- # I'm not sure if I'm treating the release correctly. I think
- # release should show up in the -l (ie -lgmp5) so we don't want to
- # add it in twice. Is that correct?
- release=""
- versuffix=""
- major=""
- newdeplibs=
- droppeddeps=no
- case $deplibs_check_method in
- pass_all)
- # Don't check for shared/static. Everything works.
- # This might be a little naive. We might want to check
- # whether the library exists or not. But this is on
- # osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behavior.
- newdeplibs=$deplibs
- ;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $rm conftest.c
- cat > conftest.c <<EOF
- int main() { return 0; }
-EOF
- $rm conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which I believe you do not have"
- $echo "*** because a test_compile did reveal that the linker did not use it for"
- $echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- $rm conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
- ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because a test_compile did reveal that the linker did not use this one"
- $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning! Library $i is needed by this library but I was not able to"
- $echo "*** make it link in! You will probably need to install it or some"
- $echo "*** library that it depends on before this library will be fully"
- $echo "*** functional. Installing it before continuing would be even better."
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- fi
- ;;
- file_magic*)
- set dummy $deplibs_check_method
- file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- for a_deplib in $deplibs; do
- name=`expr $a_deplib : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- # Follow soft links.
- if ls -lLd "$potent_lib" 2>/dev/null \
- | grep " -> " >/dev/null; then
- continue
- fi
- # The statement above tries to avoid entering an
- # endless loop below, in case of cyclic links.
- # We might still enter an endless loop, since a link
- # loop can be closed while we follow links,
- # but so what?
- potlib="$potent_lib"
- while test -h "$potlib" 2>/dev/null; do
- potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
- case $potliblink in
- [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
- esac
- done
- if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
- | ${SED} 10q \
- | $EGREP "$file_magic_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- $echo
- $echo "*** Warning: linker path does not have real file for library $a_deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $echo "*** with $libname but no candidates were found. (...for file magic test)"
- else
- $echo "*** with $libname and none of the candidates passed a file format test"
- $echo "*** using a file magic. Last file checked: $potlib"
- fi
- fi
- else
- # Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
- fi
- done # Gone through all deplibs.
- ;;
- match_pattern*)
- set dummy $deplibs_check_method
- match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- for a_deplib in $deplibs; do
- name=`expr $a_deplib : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test -n "$name" && test "$name" != "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- potlib="$potent_lib" # see symlink-check above in file_magic test
- if eval $echo \"$potent_lib\" 2>/dev/null \
- | ${SED} 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- $echo
- $echo "*** Warning: linker path does not have real file for library $a_deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
- else
- $echo "*** with $libname and none of the candidates passed a file format test"
- $echo "*** using a regex pattern. Last file checked: $potlib"
- fi
- fi
- else
- # Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
- fi
- done # Gone through all deplibs.
- ;;
- none | unknown | *)
- newdeplibs=""
- tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
- -e 's/ -[LR][^ ]*//g'`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- for i in $predeps $postdeps ; do
- # can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
- done
- fi
- if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
- | grep . >/dev/null; then
- $echo
- if test "X$deplibs_check_method" = "Xnone"; then
- $echo "*** Warning: inter-library dependencies are not supported in this platform."
- else
- $echo "*** Warning: inter-library dependencies are not known to be supported."
- fi
- $echo "*** All declared inter-library dependencies are being dropped."
- droppeddeps=yes
- fi
- ;;
- esac
- versuffix=$versuffix_save
- major=$major_save
- release=$release_save
- libname=$libname_save
- name=$name_save
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
- ;;
- esac
-
- if test "$droppeddeps" = yes; then
- if test "$module" = yes; then
- $echo
- $echo "*** Warning: libtool could not satisfy all declared inter-library"
- $echo "*** dependencies of module $libname. Therefore, libtool will create"
- $echo "*** a static module, that should work as long as the dlopening"
- $echo "*** application is linked with the -dlopen flag."
- if test -z "$global_symbol_pipe"; then
- $echo
- $echo "*** However, this would only work if libtool was able to extract symbol"
- $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $echo "*** not find such a program. So, this module is probably useless."
- $echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- else
- $echo "*** The inter-library dependencies that have been dropped here will be"
- $echo "*** automatically added whenever a program is linked with this library"
- $echo "*** or is declared to -dlopen it."
-
- if test "$allow_undefined" = no; then
- $echo
- $echo "*** Since this library must not contain undefined symbols,"
- $echo "*** because either the platform does not support them or"
- $echo "*** it was explicitly requested with -no-undefined,"
- $echo "*** libtool will only create a static version of it."
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- fi
- fi
- # Done checking deplibs!
- deplibs=$newdeplibs
- fi
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $deplibs " in
- *" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- done
- deplibs="$new_libs"
-
-
- # All the library-specific variables (install_libdir is set above).
- library_names=
- old_library=
- dlname=
-
- # Test again, we may have decided not to build it any more
- if test "$build_libtool_libs" = yes; then
- if test "$hardcode_into_libs" = yes; then
- # Hardcode the library paths
- hardcode_libdirs=
- dep_rpath=
- rpath="$finalize_rpath"
- test "$mode" != relink && rpath="$compile_rpath$rpath"
- for libdir in $rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- dep_rpath="$dep_rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- if test -n "$hardcode_libdir_flag_spec_ld"; then
- case $archive_cmds in
- *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
- *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
- esac
- else
- eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- fi
- fi
- if test -n "$runpath_var" && test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- rpath="$rpath$dir:"
- done
- eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- fi
- test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- fi
-
- shlibpath="$finalize_shlibpath"
- test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
- if test -n "$shlibpath"; then
- eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- fi
-
- # Get the real and link names of the library.
- eval shared_ext=\"$shrext_cmds\"
- eval library_names=\"$library_names_spec\"
- set dummy $library_names
- realname="$2"
- shift; shift
-
- if test -n "$soname_spec"; then
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
- if test -z "$dlname"; then
- dlname=$soname
- fi
-
- lib="$output_objdir/$realname"
- linknames=
- for link
- do
- linknames="$linknames $link"
- done
-
- # Use standard objects if they are pic
- test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- $show "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $run $rm $export_symbols
- cmds=$export_symbols_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- if len=`expr "X$cmd" : ".*"` &&
- test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- $show "$cmd"
- $run eval "$cmd" || exit $?
- skipped_export=false
- else
- # The command line is too long to execute in one step.
- $show "using reloadable object file for export list..."
- skipped_export=:
- # Break out early, otherwise skipped_export may be
- # set to false by a later but shorter cmd.
- break
- fi
- done
- IFS="$save_ifs"
- if test -n "$export_symbols_regex"; then
- $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
- $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- $show "$mv \"${export_symbols}T\" \"$export_symbols\""
- $run eval '$mv "${export_symbols}T" "$export_symbols"'
- fi
- fi
- fi
-
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
- fi
-
- tmp_deplibs=
- for test_deplib in $deplibs; do
- case " $convenience " in
- *" $test_deplib "*) ;;
- *)
- tmp_deplibs="$tmp_deplibs $test_deplib"
- ;;
- esac
- done
- deplibs="$tmp_deplibs"
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- else
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $convenience
- libobjs="$libobjs $func_extract_archives_result"
- fi
- fi
-
- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
- eval flag=\"$thread_safe_flag_spec\"
- linker_flags="$linker_flags $flag"
- fi
-
- # Make a backup of the uninstalled library when relinking
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
- fi
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- eval test_cmds=\"$module_expsym_cmds\"
- cmds=$module_expsym_cmds
- else
- eval test_cmds=\"$module_cmds\"
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- eval test_cmds=\"$archive_expsym_cmds\"
- cmds=$archive_expsym_cmds
- else
- eval test_cmds=\"$archive_cmds\"
- cmds=$archive_cmds
- fi
- fi
-
- if test "X$skipped_export" != "X:" &&
- len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- :
- else
- # The command line is too long to link in one step, link piecewise.
- $echo "creating reloadable object files..."
-
- # Save the value of $output and $libobjs because we want to
- # use them later. If we have whole_archive_flag_spec, we
- # want to use save_libobjs as it was before
- # whole_archive_flag_spec was expanded, because we can't
- # assume the linker understands whole_archive_flag_spec.
- # This may have to be revisited, in case too many
- # convenience libraries get linked in and end up exceeding
- # the spec.
- if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- fi
- save_output=$output
- output_la=`$echo "X$output" | $Xsed -e "$basename"`
-
- # Clear the reloadable object creation command queue and
- # initialize k to one.
- test_cmds=
- concat_cmds=
- objlist=
- delfiles=
- last_robj=
- k=1
- output=$output_objdir/$output_la-${k}.$objext
- # Loop over the list of objects to be linked.
- for obj in $save_libobjs
- do
- eval test_cmds=\"$reload_cmds $objlist $last_robj\"
- if test "X$objlist" = X ||
- { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- test "$len" -le "$max_cmd_len"; }; then
- objlist="$objlist $obj"
- else
- # The command $test_cmds is almost too long, add a
- # command to the queue.
- if test "$k" -eq 1 ; then
- # The first file doesn't have a previous command to add.
- eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
- else
- # All subsequent reloadable object files will link in
- # the last one created.
- eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
- fi
- last_robj=$output_objdir/$output_la-${k}.$objext
- k=`expr $k + 1`
- output=$output_objdir/$output_la-${k}.$objext
- objlist=$obj
- len=1
- fi
- done
- # Handle the remaining objects by creating one last
- # reloadable object file. All subsequent reloadable object
- # files will link in the last one created.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
-
- if ${skipped_export-false}; then
- $show "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $run $rm $export_symbols
- libobjs=$output
- # Append the command to create the export file.
- eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
- fi
-
- # Set up a command to remove the reloadable object files
- # after they are used.
- i=0
- while test "$i" -lt "$k"
- do
- i=`expr $i + 1`
- delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
- done
-
- $echo "creating a temporary reloadable object file: $output"
-
- # Loop through the commands generated above and execute them.
- save_ifs="$IFS"; IFS='~'
- for cmd in $concat_cmds; do
- IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
-
- libobjs=$output
- # Restore the value of output.
- output=$save_output
-
- if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- fi
- # Expand the library linking commands again to reset the
- # value of $libobjs for piecewise linking.
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- cmds=$module_expsym_cmds
- else
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- cmds=$archive_expsym_cmds
- else
- cmds=$archive_cmds
- fi
- fi
-
- # Append the command to remove the reloadable object files
- # to the just-reset $cmds.
- eval cmds=\"\$cmds~\$rm $delfiles\"
- fi
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
-
- if test -n "$convenience"; then
- if test -z "$whole_archive_flag_spec"; then
- $show "${rm}r $gentop"
- $run ${rm}r "$gentop"
- fi
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- # Create links to the real library.
- for linkname in $linknames; do
- if test "$realname" != "$linkname"; then
- $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
- $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
- fi
- done
-
- # If -module or -export-dynamic was specified, set the dlname.
- if test "$module" = yes || test "$export_dynamic" = yes; then
- # On all known operating systems, these are identical.
- dlname="$soname"
- fi
- fi
- ;;
-
- obj)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
- fi
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
- fi
-
- if test -n "$rpath"; then
- $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
- fi
-
- if test -n "$xrpath"; then
- $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
- fi
-
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
- fi
-
- case $output in
- *.lo)
- if test -n "$objs$old_deplibs"; then
- $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
- exit $EXIT_FAILURE
- fi
- libobj="$output"
- obj=`$echo "X$output" | $Xsed -e "$lo2o"`
- ;;
- *)
- libobj=
- obj="$output"
- ;;
- esac
-
- # Delete the old objects.
- $run $rm $obj $libobj
-
- # Objects from convenience libraries. This assumes
- # single-version convenience libraries. Whenever we create
- # different ones for PIC/non-PIC, this we'll have to duplicate
- # the extraction.
- reload_conv_objs=
- gentop=
- # reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec and hope we can get by with
- # turning comma into space..
- wl=
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
- else
- gentop="$output_objdir/${obj}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $convenience
- reload_conv_objs="$reload_objs $func_extract_archives_result"
- fi
- fi
-
- # Create the old-style object.
- reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
- output="$obj"
- cmds=$reload_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
-
- # Exit if we aren't doing a library object file.
- if test -z "$libobj"; then
- if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- if test "$build_libtool_libs" != yes; then
- if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
- fi
-
- # Create an invalid libtool object if no PIC, so that we don't
- # accidentally link it into a program.
- # $show "echo timestamp > $libobj"
- # $run eval "echo timestamp > $libobj" || exit $?
- exit $EXIT_SUCCESS
- fi
-
- if test -n "$pic_flag" || test "$pic_mode" != default; then
- # Only do commands if we really have different PIC objects.
- reload_objs="$libobjs $reload_conv_objs"
- output="$libobj"
- cmds=$reload_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
-
- if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- prog)
- case $host in
- *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
- esac
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
- fi
-
- if test "$preload" = yes; then
- if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
- test "$dlopen_self_static" = unknown; then
- $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
- fi
- fi
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
- finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
- ;;
- esac
-
- case $host in
- *darwin*)
- # Don't allow lazy linking, it breaks C++ global constructors
- if test "$tagname" = CXX ; then
- compile_command="$compile_command ${wl}-bind_at_load"
- finalize_command="$finalize_command ${wl}-bind_at_load"
- fi
- ;;
- esac
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $compile_deplibs " in
- *" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $compile_deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- done
- compile_deplibs="$new_libs"
-
-
- compile_command="$compile_command $compile_deplibs"
- finalize_command="$finalize_command $finalize_deplibs"
-
- if test -n "$rpath$xrpath"; then
- # If the user specified any rpath flags, then add them.
- for libdir in $rpath $xrpath; do
- # This is the magic to use -rpath.
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
- esac
- done
- fi
-
- # Now hardcode the library paths
- rpath=
- hardcode_libdirs=
- for libdir in $compile_rpath $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
- esac
- fi
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$libdir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$libdir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
- esac
- ;;
- esac
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- compile_rpath="$rpath"
-
- rpath=
- hardcode_libdirs=
- for libdir in $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$finalize_perm_rpath " in
- *" $libdir "*) ;;
- *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- finalize_rpath="$rpath"
-
- if test -n "$libobjs" && test "$build_old_libs" = yes; then
- # Transform all the library objects into standard objects.
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- fi
-
- dlsyms=
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- if test -n "$NM" && test -n "$global_symbol_pipe"; then
- dlsyms="${outputname}S.c"
- else
- $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
- fi
- fi
-
- if test -n "$dlsyms"; then
- case $dlsyms in
- "") ;;
- *.c)
- # Discover the nlist of each of the dlfiles.
- nlist="$output_objdir/${outputname}.nm"
-
- $show "$rm $nlist ${nlist}S ${nlist}T"
- $run $rm "$nlist" "${nlist}S" "${nlist}T"
-
- # Parse the name list into a source file.
- $show "creating $output_objdir/$dlsyms"
-
- test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
-/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
-/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-/* Prevent the only kind of declaration conflicts we can make. */
-#define lt_preloaded_symbols some_other_symbol
-
-/* External symbol declarations for the compiler. */\
-"
-
- if test "$dlself" = yes; then
- $show "generating symbol list for \`$output'"
-
- test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
-
- # Add our own program objects to the symbol list.
- progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- for arg in $progfiles; do
- $show "extracting global C symbols from \`$arg'"
- $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -n "$exclude_expsyms"; then
- $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- $run eval '$mv "$nlist"T "$nlist"'
- fi
-
- if test -n "$export_symbols_regex"; then
- $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- $run eval '$mv "$nlist"T "$nlist"'
- fi
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$outputname.exp"
- $run $rm $export_symbols
- $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- case $host in
- *cygwin* | *mingw* )
- $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- else
- $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
- $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
- $run eval 'mv "$nlist"T "$nlist"'
- case $host in
- *cygwin* | *mingw* )
- $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- fi
- fi
-
- for arg in $dlprefiles; do
- $show "extracting global C symbols from \`$arg'"
- name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
- $run eval '$echo ": $name " >> "$nlist"'
- $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -z "$run"; then
- # Make sure we have at least an empty file.
- test -f "$nlist" || : > "$nlist"
-
- if test -n "$exclude_expsyms"; then
- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
- $mv "$nlist"T "$nlist"
- fi
-
- # Try sorting and uniquifying the output.
- if grep -v "^: " < "$nlist" |
- if sort -k 3 </dev/null >/dev/null 2>&1; then
- sort -k 3
- else
- sort +2
- fi |
- uniq > "$nlist"S; then
- :
- else
- grep -v "^: " < "$nlist" > "$nlist"S
- fi
-
- if test -f "$nlist"S; then
- eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
- else
- $echo '/* NONE */' >> "$output_objdir/$dlsyms"
- fi
-
- $echo >> "$output_objdir/$dlsyms" "\
-
-#undef lt_preloaded_symbols
-
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-"
-
- case $host in
- *cygwin* | *mingw* )
- $echo >> "$output_objdir/$dlsyms" "\
-/* DATA imports from DLLs on WIN32 can't be const, because
- runtime relocations are performed -- see ld's documentation
- on pseudo-relocs */
-struct {
-"
- ;;
- * )
- $echo >> "$output_objdir/$dlsyms" "\
-const struct {
-"
- ;;
- esac
-
-
- $echo >> "$output_objdir/$dlsyms" "\
- const char *name;
- lt_ptr address;
-}
-lt_preloaded_symbols[] =
-{\
-"
-
- eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
-
- $echo >> "$output_objdir/$dlsyms" "\
- {0, (lt_ptr) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
- fi
-
- pic_flag_for_symtable=
- case $host in
- # compiling the symbol table file with pic_flag works around
- # a FreeBSD bug that causes programs to crash when -lm is
- # linked before any other PIC object. But we must not use
- # pic_flag when linking with -static. The problem exists in
- # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
- case "$compile_command " in
- *" -static "*) ;;
- *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
- esac;;
- *-*-hpux*)
- case "$compile_command " in
- *" -static "*) ;;
- *) pic_flag_for_symtable=" $pic_flag";;
- esac
- esac
-
- # Now compile the dynamic symbol file.
- $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
- $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
-
- # Clean up the generated files.
- $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
- $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
-
- # Transform the symbol file into the correct name.
- case $host in
- *cygwin* | *mingw* )
- if test -f "$output_objdir/${outputname}.def" ; then
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
- else
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
- fi
- ;;
- * )
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
- ;;
- esac
- ;;
- *)
- $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- else
- # We keep going just in case the user didn't refer to
- # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
- # really was required.
-
- # Nullify the symbol file.
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
- fi
-
- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- # Replace the output file specification.
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
- link_command="$compile_command$compile_rpath"
-
- # We have no uninstalled library dependencies, so finalize right now.
- $show "$link_command"
- $run eval "$link_command"
- exit_status=$?
-
- # Delete the generated files.
- if test -n "$dlsyms"; then
- $show "$rm $output_objdir/${outputname}S.${objext}"
- $run $rm "$output_objdir/${outputname}S.${objext}"
- fi
-
- exit $exit_status
- fi
-
- if test -n "$shlibpath_var"; then
- # We should set the shlibpath_var
- rpath=
- for dir in $temp_rpath; do
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*)
- # Absolute path.
- rpath="$rpath$dir:"
- ;;
- *)
- # Relative path: add a thisdir entry.
- rpath="$rpath\$thisdir/$dir:"
- ;;
- esac
- done
- temp_rpath="$rpath"
- fi
-
- if test -n "$compile_shlibpath$finalize_shlibpath"; then
- compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
- fi
- if test -n "$finalize_shlibpath"; then
- finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
- fi
-
- compile_var=
- finalize_var=
- if test -n "$runpath_var"; then
- if test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- rpath="$rpath$dir:"
- done
- compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- if test -n "$finalize_perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $finalize_perm_rpath; do
- rpath="$rpath$dir:"
- done
- finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- fi
-
- if test "$no_install" = yes; then
- # We don't need to create a wrapper script.
- link_command="$compile_var$compile_command$compile_rpath"
- # Replace the output file specification.
- link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- # Delete the old output file.
- $run $rm $output
- # Link the executable and exit
- $show "$link_command"
- $run eval "$link_command" || exit $?
- exit $EXIT_SUCCESS
- fi
-
- if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
-
- $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
- $echo "$modename: \`$output' will be relinked during installation" 1>&2
- else
- if test "$fast_install" != no; then
- link_command="$finalize_var$compile_command$finalize_rpath"
- if test "$fast_install" = yes; then
- relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
- else
- # fast_install is set to needless
- relink_command=
- fi
- else
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
- fi
- fi
-
- # Replace the output file specification.
- link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
- # Delete the old output files.
- $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
- $show "$link_command"
- $run eval "$link_command" || exit $?
-
- # Now create the wrapper script.
- $show "creating $output"
-
- # Quote the relink command for shipping.
- if test -n "$relink_command"; then
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
- relink_command="$var=\"$var_value\"; export $var; $relink_command"
- fi
- done
- relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
- fi
-
- # Quote $echo for shipping.
- if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
- case $progpath in
- [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
- *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
- esac
- qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
- else
- qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
- fi
-
- # Only actually do things if our run command is non-null.
- if test -z "$run"; then
- # win32 will think the script is a binary if it has
- # a .exe suffix, so we strip it off here.
- case $output in
- *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
- esac
- # test for cygwin because mv fails w/o .exe extensions
- case $host in
- *cygwin*)
- exeext=.exe
- outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
- *) exeext= ;;
- esac
- case $host in
- *cygwin* | *mingw* )
- output_name=`basename $output`
- output_path=`dirname $output`
- cwrappersource="$output_path/$objdir/lt-$output_name.c"
- cwrapper="$output_path/$output_name.exe"
- $rm $cwrappersource $cwrapper
- trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
- cat > $cwrappersource <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-
- The $output program cannot be directly executed until all the libtool
- libraries that it depends on are installed.
-
- This wrapper executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-
- Currently, it simply execs the wrapper *script* "/bin/sh $output",
- but could eventually absorb all of the scripts functionality and
- exec $objdir/$outputname directly.
-*/
-EOF
- cat >> $cwrappersource<<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# ifndef DIR_SEPARATOR_2
-# define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-# define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
- if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-/* -DDEBUG is fairly common in CFLAGS. */
-#undef DEBUG
-#if defined DEBUGWRAPPER
-# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
-#else
-# define DEBUG(format, ...)
-#endif
-
-const char *program_name = NULL;
-
-void * xmalloc (size_t num);
-char * xstrdup (const char *string);
-const char * base_name (const char *name);
-char * find_executable(const char *wrapper);
-int check_executable(const char *path);
-char * strendzap(char *str, const char *pat);
-void lt_fatal (const char *message, ...);
-
-int
-main (int argc, char *argv[])
-{
- char **newargz;
- int i;
-
- program_name = (char *) xstrdup (base_name (argv[0]));
- DEBUG("(main) argv[0] : %s\n",argv[0]);
- DEBUG("(main) program_name : %s\n",program_name);
- newargz = XMALLOC(char *, argc+2);
-EOF
-
- cat >> $cwrappersource <<EOF
- newargz[0] = (char *) xstrdup("$SHELL");
-EOF
-
- cat >> $cwrappersource <<"EOF"
- newargz[1] = find_executable(argv[0]);
- if (newargz[1] == NULL)
- lt_fatal("Couldn't find %s", argv[0]);
- DEBUG("(main) found exe at : %s\n",newargz[1]);
- /* we know the script has the same name, without the .exe */
- /* so make sure newargz[1] doesn't end in .exe */
- strendzap(newargz[1],".exe");
- for (i = 1; i < argc; i++)
- newargz[i+1] = xstrdup(argv[i]);
- newargz[argc+1] = NULL;
-
- for (i=0; i<argc+1; i++)
- {
- DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
- ;
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",(char const **)newargz);
-EOF
- ;;
- *)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",newargz);
-EOF
- ;;
- esac
-
- cat >> $cwrappersource <<"EOF"
- return 127;
-}
-
-void *
-xmalloc (size_t num)
-{
- void * p = (void *) malloc (num);
- if (!p)
- lt_fatal ("Memory exhausted");
-
- return p;
-}
-
-char *
-xstrdup (const char *string)
-{
- return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
-;
-}
-
-const char *
-base_name (const char *name)
-{
- const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Skip over the disk name in MSDOS pathnames. */
- if (isalpha ((unsigned char)name[0]) && name[1] == ':')
- name += 2;
-#endif
-
- for (base = name; *name; name++)
- if (IS_DIR_SEPARATOR (*name))
- base = name + 1;
- return base;
-}
-
-int
-check_executable(const char * path)
-{
- struct stat st;
-
- DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
- if ((!path) || (!*path))
- return 0;
-
- if ((stat (path, &st) >= 0) &&
- (
- /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
-#if defined (S_IXOTH)
- ((st.st_mode & S_IXOTH) == S_IXOTH) ||
-#endif
-#if defined (S_IXGRP)
- ((st.st_mode & S_IXGRP) == S_IXGRP) ||
-#endif
- ((st.st_mode & S_IXUSR) == S_IXUSR))
- )
- return 1;
- else
- return 0;
-}
-
-/* Searches for the full path of the wrapper. Returns
- newly allocated full path name if found, NULL otherwise */
-char *
-find_executable (const char* wrapper)
-{
- int has_slash = 0;
- const char* p;
- const char* p_next;
- /* static buffer for getcwd */
- char tmp[LT_PATHMAX + 1];
- int tmp_len;
- char* concat_name;
-
- DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
-
- if ((wrapper == NULL) || (*wrapper == '\0'))
- return NULL;
-
- /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
- {
- concat_name = xstrdup (wrapper);
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- }
- else
- {
-#endif
- if (IS_DIR_SEPARATOR (wrapper[0]))
- {
- concat_name = xstrdup (wrapper);
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- }
-#endif
-
- for (p = wrapper; *p; p++)
- if (*p == '/')
- {
- has_slash = 1;
- break;
- }
- if (!has_slash)
- {
- /* no slashes; search PATH */
- const char* path = getenv ("PATH");
- if (path != NULL)
- {
- for (p = path; *p; p = p_next)
- {
- const char* q;
- size_t p_len;
- for (q = p; *q; q++)
- if (IS_PATH_SEPARATOR(*q))
- break;
- p_len = q - p;
- p_next = (*q == '\0' ? q : q + 1);
- if (p_len == 0)
- {
- /* empty path: current directory */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
- tmp_len = strlen(tmp);
- concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
- }
- else
- {
- concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
- memcpy (concat_name, p, p_len);
- concat_name[p_len] = '/';
- strcpy (concat_name + p_len + 1, wrapper);
- }
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- }
- }
- /* not found in PATH; assume curdir */
- }
- /* Relative path | not found in path: prepend cwd */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
- tmp_len = strlen(tmp);
- concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
-
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- return NULL;
-}
-
-char *
-strendzap(char *str, const char *pat)
-{
- size_t len, patlen;
-
- assert(str != NULL);
- assert(pat != NULL);
-
- len = strlen(str);
- patlen = strlen(pat);
-
- if (patlen <= len)
- {
- str += len - patlen;
- if (strcmp(str, pat) == 0)
- *str = '\0';
- }
- return str;
-}
-
-static void
-lt_error_core (int exit_status, const char * mode,
- const char * message, va_list ap)
-{
- fprintf (stderr, "%s: %s: ", program_name, mode);
- vfprintf (stderr, message, ap);
- fprintf (stderr, ".\n");
-
- if (exit_status >= 0)
- exit (exit_status);
-}
-
-void
-lt_fatal (const char *message, ...)
-{
- va_list ap;
- va_start (ap, message);
- lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
- va_end (ap);
-}
-EOF
- # we should really use a build-platform specific compiler
- # here, but OTOH, the wrappers (shell script and this C one)
- # are only useful if you want to execute the "real" binary.
- # Since the "real" binary is built for $host, then this
- # wrapper might as well be built for $host, too.
- $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
- ;;
- esac
- $rm $output
- trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
-
- $echo > $output "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
- # install mode needs the following variable:
- notinst_deplibs='$notinst_deplibs'
-else
- # When we are sourced in execute mode, \$file and \$echo are already set.
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- echo=\"$qecho\"
- file=\"\$0\"
- # Make sure echo works.
- if test \"X\$1\" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
- elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
- # Yippee, \$echo works!
- :
- else
- # Restart under the correct shell, and then maybe \$echo will work.
- exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
- fi
- fi\
-"
- $echo >> $output "\
-
- # Find the directory that this script lives in.
- thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
- test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
- while test -n \"\$file\"; do
- destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
-
- # If there was a directory component, then change thisdir.
- if test \"x\$destdir\" != \"x\$file\"; then
- case \"\$destdir\" in
- [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- *) thisdir=\"\$thisdir/\$destdir\" ;;
- esac
- fi
-
- file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
- done
-
- # Try to get the absolute directory name.
- absdir=\`cd \"\$thisdir\" && pwd\`
- test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
- if test "$fast_install" = yes; then
- $echo >> $output "\
- program=lt-'$outputname'$exeext
- progdir=\"\$thisdir/$objdir\"
-
- if test ! -f \"\$progdir/\$program\" || \\
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
- test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
- file=\"\$\$-\$program\"
-
- if test ! -d \"\$progdir\"; then
- $mkdir \"\$progdir\"
- else
- $rm \"\$progdir/\$file\"
- fi"
-
- $echo >> $output "\
-
- # relink executable if necessary
- if test -n \"\$relink_command\"; then
- if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- else
- $echo \"\$relink_command_output\" >&2
- $rm \"\$progdir/\$file\"
- exit $EXIT_FAILURE
- fi
- fi
-
- $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- { $rm \"\$progdir/\$program\";
- $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- $rm \"\$progdir/\$file\"
- fi"
- else
- $echo >> $output "\
- program='$outputname'
- progdir=\"\$thisdir/$objdir\"
-"
- fi
-
- $echo >> $output "\
-
- if test -f \"\$progdir/\$program\"; then"
-
- # Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- $echo >> $output "\
- # Add our own library path to $shlibpath_var
- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
- # Some systems cannot cope with colon-terminated $shlibpath_var
- # The second colon is a workaround for a bug in BeOS R4 sed
- $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
-
- export $shlibpath_var
-"
- fi
-
- # fixup the dll searchpath if we need to.
- if test -n "$dllsearchpath"; then
- $echo >> $output "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
- $echo >> $output "\
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- # Run the actual program with our arguments.
-
- # Make sure env LD_LIBRARY_PATH does not mess us up
- if test -n \"\${LD_LIBRARY_PATH+set}\"; then
- export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
- fi
-"
- case $host in
- # Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2*)
- $echo >> $output "\
- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
- ;;
-
- *)
- $echo >> $output "\
- exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
- ;;
- esac
- $echo >> $output "\
- \$echo \"\$0: cannot exec \$program \$*\"
- exit $EXIT_FAILURE
- fi
- else
- # The program doesn't exist.
- \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
- \$echo \"This script is just a wrapper for \$program.\" 1>&2
- $echo \"See the $PACKAGE documentation for more information.\" 1>&2
- exit $EXIT_FAILURE
- fi
-fi\
-"
- chmod +x $output
- fi
- exit $EXIT_SUCCESS
- ;;
- esac
-
- # See if we need to build an old-fashioned archive.
- for oldlib in $oldlibs; do
-
- if test "$build_libtool_libs" = convenience; then
- oldobjs="$libobjs_save"
- addlibs="$convenience"
- build_libtool_libs=no
- else
- if test "$build_libtool_libs" = module; then
- oldobjs="$libobjs_save"
- build_libtool_libs=no
- else
- oldobjs="$old_deplibs $non_pic_objects"
- fi
- addlibs="$old_convenience"
- fi
-
- if test -n "$addlibs"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $addlibs
- oldobjs="$oldobjs $func_extract_archives_result"
- fi
-
- # Do each command in the archive commands.
- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
- cmds=$old_archive_from_new_cmds
- else
- # POSIX demands no paths to be encoded in archives. We have
- # to avoid creating archives with duplicate basenames if we
- # might have to extract them afterwards, e.g., when creating a
- # static archive out of a convenience library, or when linking
- # the entirety of a libtool archive into another (currently
- # not supported by libtool).
- if (for obj in $oldobjs
- do
- $echo "X$obj" | $Xsed -e 's%^.*/%%'
- done | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- $echo "copying selected object files to avoid basename conflicts..."
-
- if test -z "$gentop"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- $show "${rm}r $gentop"
- $run ${rm}r "$gentop"
- $show "$mkdir $gentop"
- $run $mkdir "$gentop"
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
- exit $exit_status
- fi
- fi
-
- save_oldobjs=$oldobjs
- oldobjs=
- counter=1
- for obj in $save_oldobjs
- do
- objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
- case " $oldobjs " in
- " ") oldobjs=$obj ;;
- *[\ /]"$objbase "*)
- while :; do
- # Make sure we don't pick an alternate name that also
- # overlaps.
- newobj=lt$counter-$objbase
- counter=`expr $counter + 1`
- case " $oldobjs " in
- *[\ /]"$newobj "*) ;;
- *) if test ! -f "$gentop/$newobj"; then break; fi ;;
- esac
- done
- $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- $run ln "$obj" "$gentop/$newobj" ||
- $run cp "$obj" "$gentop/$newobj"
- oldobjs="$oldobjs $gentop/$newobj"
- ;;
- *) oldobjs="$oldobjs $obj" ;;
- esac
- done
- fi
-
- eval cmds=\"$old_archive_cmds\"
-
- if len=`expr "X$cmds" : ".*"` &&
- test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- cmds=$old_archive_cmds
- else
- # the command line is too long to link in one step, link in parts
- $echo "using piecewise archive linking..."
- save_RANLIB=$RANLIB
- RANLIB=:
- objlist=
- concat_cmds=
- save_oldobjs=$oldobjs
-
- # Is there a better way of finding the last object in the list?
- for obj in $save_oldobjs
- do
- last_oldobj=$obj
- done
- for obj in $save_oldobjs
- do
- oldobjs="$objlist $obj"
- objlist="$objlist $obj"
- eval test_cmds=\"$old_archive_cmds\"
- if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- test "$len" -le "$max_cmd_len"; then
- :
- else
- # the above command should be used before it gets too long
- oldobjs=$objlist
- if test "$obj" = "$last_oldobj" ; then
- RANLIB=$save_RANLIB
- fi
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
- objlist=
- fi
- done
- RANLIB=$save_RANLIB
- oldobjs=$objlist
- if test "X$oldobjs" = "X" ; then
- eval cmds=\"\$concat_cmds\"
- else
- eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
- fi
- fi
- fi
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- eval cmd=\"$cmd\"
- IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- done
-
- if test -n "$generated"; then
- $show "${rm}r$generated"
- $run ${rm}r$generated
- fi
-
- # Now create the libtool archive.
- case $output in
- *.la)
- old_library=
- test "$build_old_libs" = yes && old_library="$libname.$libext"
- $show "creating $output"
-
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
- relink_command="$var=\"$var_value\"; export $var; $relink_command"
- fi
- done
- # Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
- if test "$hardcode_automatic" = yes ; then
- relink_command=
- fi
-
-
- # Only create the output if not a dry run.
- if test -z "$run"; then
- for installed in no yes; do
- if test "$installed" = yes; then
- if test -z "$install_libdir"; then
- break
- fi
- output="$output_objdir/$outputname"i
- # Replace all uninstalled libtool libraries with the installed ones
- newdependency_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- *.la)
- name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- if test -z "$libdir"; then
- $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- if test "X$EGREP" = X ; then
- EGREP=egrep
- fi
- # We do not want portage's install root ($D) present. Check only for
- # this if the .la is being installed.
- if test "$installed" = yes && test "$D"; then
- eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
- else
- mynewdependency_lib="$libdir/$name"
- fi
- # Do not add duplicates
- if test "$mynewdependency_lib"; then
- my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
- if test -z "$my_little_ninja_foo_1"; then
- newdependency_libs="$newdependency_libs $mynewdependency_lib"
- fi
- fi
- ;;
- *)
- if test "$installed" = yes; then
- # Rather use S=WORKDIR if our version of portage supports it.
- # This is because some ebuild (gcc) do not use $S as buildroot.
- if test "$PWORKDIR"; then
- S="$PWORKDIR"
- fi
- # We do not want portage's build root ($S) present.
- my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
- # We do not want portage's install root ($D) present.
- my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
- if test -n "$my_little_ninja_foo_2" && test "$S"; then
- mynewdependency_lib=""
- elif test -n "$my_little_ninja_foo_3" && test "$D"; then
- eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
- else
- mynewdependency_lib="$deplib"
- fi
- else
- mynewdependency_lib="$deplib"
- fi
- # Do not add duplicates
- if test "$mynewdependency_lib"; then
- my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
- if test -z "$my_little_ninja_foo_4"; then
- newdependency_libs="$newdependency_libs $mynewdependency_lib"
- fi
- fi
- ;;
- esac
- done
- dependency_libs="$newdependency_libs"
- newdlfiles=
- for lib in $dlfiles; do
- name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- if test -z "$libdir"; then
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- newdlfiles="$newdlfiles $libdir/$name"
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- if test -z "$libdir"; then
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- newdlprefiles="$newdlprefiles $libdir/$name"
- done
- dlprefiles="$newdlprefiles"
- else
- newdlfiles=
- for lib in $dlfiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- newdlfiles="$newdlfiles $abs"
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- newdlprefiles="$newdlprefiles $abs"
- done
- dlprefiles="$newdlprefiles"
- fi
- $rm $output
- # place dlname in correct position for cygwin
- tdlname=$dlname
- case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- esac
- # Do not add duplicates
- if test "$installed" = yes && test "$D"; then
- install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
- fi
- $echo > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
- if test "$installed" = no && test "$need_relink" = yes; then
- $echo >> $output "\
-relink_command=\"$relink_command\""
- fi
- done
- fi
-
- # Do a symbolic link so that the libtool archive can be found in
- # LD_LIBRARY_PATH before the program is installed.
- $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
- $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
- ;;
- esac
- exit $EXIT_SUCCESS
- ;;
-
- # libtool install mode
- install)
- modename="$modename: install"
-
- # There may be an optional sh(1) argument at the beginning of
- # install_prog (especially on Windows NT).
- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
- # Allow the use of GNU shtool's install command.
- $echo "X$nonopt" | grep shtool > /dev/null; then
- # Aesthetically quote it.
- arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- install_prog="$arg "
- arg="$1"
- shift
- else
- install_prog=
- arg=$nonopt
- fi
-
- # The real first argument should be the name of the installation program.
- # Aesthetically quote it.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- install_prog="$install_prog$arg"
-
- # We need to accept at least all the BSD install flags.
- dest=
- files=
- opts=
- prev=
- install_type=
- isdir=no
- stripme=
- for arg
- do
- if test -n "$dest"; then
- files="$files $dest"
- dest=$arg
- continue
- fi
-
- case $arg in
- -d) isdir=yes ;;
- -f)
- case " $install_prog " in
- *[\\\ /]cp\ *) ;;
- *) prev=$arg ;;
- esac
- ;;
- -g | -m | -o) prev=$arg ;;
- -s)
- stripme=" -s"
- continue
- ;;
- -*)
- ;;
- *)
- # If the previous option needed an argument, then skip it.
- if test -n "$prev"; then
- prev=
- else
- dest=$arg
- continue
- fi
- ;;
- esac
-
- # Aesthetically quote the argument.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- install_prog="$install_prog $arg"
- done
-
- if test -z "$install_prog"; then
- $echo "$modename: you must specify an install program" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test -n "$prev"; then
- $echo "$modename: the \`$prev' option requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test -z "$files"; then
- if test -z "$dest"; then
- $echo "$modename: no file or destination specified" 1>&2
- else
- $echo "$modename: you must specify a destination" 1>&2
- fi
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Strip any trailing slash from the destination.
- dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
-
- # Check to see that the destination is a directory.
- test -d "$dest" && isdir=yes
- if test "$isdir" = yes; then
- destdir="$dest"
- destname=
- else
- destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
- test "X$destdir" = "X$dest" && destdir=.
- destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
-
- # Not a directory, so check to see that there is only one file specified.
- set dummy $files
- if test "$#" -gt 2; then
- $echo "$modename: \`$dest' is not a directory" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
- fi
- case $destdir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- for file in $files; do
- case $file in
- *.lo) ;;
- *)
- $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- done
- ;;
- esac
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- staticlibs=
- future_libdirs=
- current_libdirs=
- for file in $files; do
-
- # Do each installation.
- case $file in
- *.$libext)
- # Do the static libraries later.
- staticlibs="$staticlibs $file"
- ;;
-
- *.la)
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- library_names=
- old_library=
- relink_command=
- # If there is no directory component, then add one.
- case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
- esac
-
- # Add the libdir to current_libdirs if it is the destination.
- if test "X$destdir" = "X$libdir"; then
- case "$current_libdirs " in
- *" $libdir "*) ;;
- *) current_libdirs="$current_libdirs $libdir" ;;
- esac
- else
- # Note the libdir as a future libdir.
- case "$future_libdirs " in
- *" $libdir "*) ;;
- *) future_libdirs="$future_libdirs $libdir" ;;
- esac
- fi
-
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
- test "X$dir" = "X$file/" && dir=
- dir="$dir$objdir"
-
- if test -n "$relink_command"; then
- # Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
-
- # Don't allow the user to place us outside of our expected
- # location b/c this prevents finding dependent libraries that
- # are installed to the same prefix.
- # At present, this check doesn't affect windows .dll's that
- # are installed into $libdir/../bin (currently, that works fine)
- # but it's something to keep an eye on.
- if test "$inst_prefix_dir" = "$destdir"; then
- $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test -n "$inst_prefix_dir"; then
- # Stick the inst_prefix_dir data into the link command.
- relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
- else
- relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
- fi
-
- $echo "$modename: warning: relinking \`$file'" 1>&2
- $show "$relink_command"
- if $run eval "$relink_command"; then :
- else
- $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
- exit $EXIT_FAILURE
- fi
- fi
-
- # See the names of the shared library.
- set dummy $library_names
- if test -n "$2"; then
- realname="$2"
- shift
- shift
-
- srcname="$realname"
- test -n "$relink_command" && srcname="$realname"T
-
- # Install the shared library and build the symlinks.
- $show "$install_prog $dir/$srcname $destdir/$realname"
- $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
- if test -n "$stripme" && test -n "$striplib"; then
- $show "$striplib $destdir/$realname"
- $run eval "$striplib $destdir/$realname" || exit $?
- fi
-
- if test "$#" -gt 0; then
- # Delete the old symlinks, and create new ones.
- # Try `ln -sf' first, because the `ln' binary might depend on
- # the symlink we replace! Solaris /bin/ln does not understand -f,
- # so we also need to try rm && ln -s.
- for linkname
- do
- if test "$linkname" != "$realname"; then
- $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
- $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
- fi
- done
- fi
-
- # Do each command in the postinstall commands.
- lib="$destdir/$realname"
- cmds=$postinstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
- fi
-
- # Install the pseudo-library for information purposes.
- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- instname="$dir/$name"i
- $show "$install_prog $instname $destdir/$name"
- $run eval "$install_prog $instname $destdir/$name" || exit $?
-
- # Maybe install the static library, too.
- test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
- ;;
-
- *.lo)
- # Install (i.e. copy) a libtool object.
-
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- destfile="$destdir/$destfile"
- fi
-
- # Deduce the name of the destination old-style object file.
- case $destfile in
- *.lo)
- staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
- ;;
- *.$objext)
- staticdest="$destfile"
- destfile=
- ;;
- *)
- $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- # Install the libtool object if requested.
- if test -n "$destfile"; then
- $show "$install_prog $file $destfile"
- $run eval "$install_prog $file $destfile" || exit $?
- fi
-
- # Install the old object if enabled.
- if test "$build_old_libs" = yes; then
- # Deduce the name of the old-style object file.
- staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
-
- $show "$install_prog $staticobj $staticdest"
- $run eval "$install_prog \$staticobj \$staticdest" || exit $?
- fi
- exit $EXIT_SUCCESS
- ;;
-
- *)
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- destfile="$destdir/$destfile"
- fi
-
- # If the file is missing, and there is a .exe on the end, strip it
- # because it is most likely a libtool script we actually want to
- # install
- stripped_ext=""
- case $file in
- *.exe)
- if test ! -f "$file"; then
- file=`$echo $file|${SED} 's,.exe$,,'`
- stripped_ext=".exe"
- fi
- ;;
- esac
-
- # Do a test to see if this is really a libtool program.
- case $host in
- *cygwin*|*mingw*)
- wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
- ;;
- *)
- wrapper=$file
- ;;
- esac
- if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
- notinst_deplibs=
- relink_command=
-
- # Note that it is not necessary on cygwin/mingw to append a dot to
- # foo even if both foo and FILE.exe exist: automatic-append-.exe
- # behavior happens only for exec(3), not for open(2)! Also, sourcing
- # `FILE.' does not work on cygwin managed mounts.
- #
- # If there is no directory component, then add one.
- case $wrapper in
- */* | *\\*) . ${wrapper} ;;
- *) . ./${wrapper} ;;
- esac
-
- # Check the variables that should have been set.
- if test -z "$notinst_deplibs"; then
- $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- finalize=yes
- for lib in $notinst_deplibs; do
- # Check to see that each library is installed.
- libdir=
- if test -f "$lib"; then
- # If there is no directory component, then add one.
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
- fi
- libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
- if test -n "$libdir" && test ! -f "$libfile"; then
- $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
- finalize=no
- fi
- done
-
- relink_command=
- # Note that it is not necessary on cygwin/mingw to append a dot to
- # foo even if both foo and FILE.exe exist: automatic-append-.exe
- # behavior happens only for exec(3), not for open(2)! Also, sourcing
- # `FILE.' does not work on cygwin managed mounts.
- #
- # If there is no directory component, then add one.
- case $wrapper in
- */* | *\\*) . ${wrapper} ;;
- *) . ./${wrapper} ;;
- esac
-
- outputname=
- if test "$fast_install" = no && test -n "$relink_command"; then
- if test "$finalize" = yes && test -z "$run"; then
- tmpdir=`func_mktempdir`
- file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
- outputname="$tmpdir/$file"
- # Replace the output file specification.
- relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
-
- $show "$relink_command"
- if $run eval "$relink_command"; then :
- else
- $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
- ${rm}r "$tmpdir"
- continue
- fi
- file="$outputname"
- else
- $echo "$modename: warning: cannot relink \`$file'" 1>&2
- fi
- else
- # Install the binary that we compiled earlier.
- file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
- fi
- fi
-
- # remove .exe since cygwin /usr/bin/install will append another
- # one anyway
- case $install_prog,$host in
- */usr/bin/install*,*cygwin*)
- case $file:$destfile in
- *.exe:*.exe)
- # this is ok
- ;;
- *.exe:*)
- destfile=$destfile.exe
- ;;
- *:*.exe)
- destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
- ;;
- esac
- ;;
- esac
- $show "$install_prog$stripme $file $destfile"
- $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
- test -n "$outputname" && ${rm}r "$tmpdir"
- ;;
- esac
- done
-
- for file in $staticlibs; do
- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-
- # Set up the ranlib parameters.
- oldlib="$destdir/$name"
-
- $show "$install_prog $file $oldlib"
- $run eval "$install_prog \$file \$oldlib" || exit $?
-
- if test -n "$stripme" && test -n "$old_striplib"; then
- $show "$old_striplib $oldlib"
- $run eval "$old_striplib $oldlib" || exit $?
- fi
-
- # Do each command in the postinstall commands.
- cmds=$old_postinstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- done
-
- if test -n "$future_libdirs"; then
- $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
- fi
-
- if test -n "$current_libdirs"; then
- # Maybe just do a dry run.
- test -n "$run" && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
- else
- exit $EXIT_SUCCESS
- fi
- ;;
-
- # libtool finish mode
- finish)
- modename="$modename: finish"
- libdirs="$nonopt"
- admincmds=
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for dir
- do
- libdirs="$libdirs $dir"
- done
-
- for libdir in $libdirs; do
- if test -n "$finish_cmds"; then
- # Do each command in the finish commands.
- cmds=$finish_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || admincmds="$admincmds
- $cmd"
- done
- IFS="$save_ifs"
- fi
- if test -n "$finish_eval"; then
- # Do the single finish_eval.
- eval cmds=\"$finish_eval\"
- $run eval "$cmds" || admincmds="$admincmds
- $cmds"
- fi
- done
- fi
-
- # Exit here if they wanted silent mode.
- test "$show" = : && exit $EXIT_SUCCESS
-
- $echo "X----------------------------------------------------------------------" | $Xsed
- $echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- $echo " $libdir"
- done
- $echo
- $echo "If you ever happen to want to link against installed libraries"
- $echo "in a given directory, LIBDIR, you must either use libtool, and"
- $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
- $echo "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
- $echo " during execution"
- fi
- if test -n "$runpath_var"; then
- $echo " - add LIBDIR to the \`$runpath_var' environment variable"
- $echo " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- $echo " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $echo " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- $echo
- $echo "See any operating system documentation about shared libraries for"
- $echo "more information, such as the ld(1) and ld.so(8) manual pages."
- $echo "X----------------------------------------------------------------------" | $Xsed
- exit $EXIT_SUCCESS
- ;;
-
- # libtool execute mode
- execute)
- modename="$modename: execute"
-
- # The first argument is the command name.
- cmd="$nonopt"
- if test -z "$cmd"; then
- $echo "$modename: you must specify a COMMAND" 1>&2
- $echo "$help"
- exit $EXIT_FAILURE
- fi
-
- # Handle -dlopen flags immediately.
- for file in $execute_dlfiles; do
- if test ! -f "$file"; then
- $echo "$modename: \`$file' is not a file" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- dir=
- case $file in
- *.la)
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Read the libtool library.
- dlname=
- library_names=
-
- # If there is no directory component, then add one.
- case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
- esac
-
- # Skip this library if it cannot be dlopened.
- if test -z "$dlname"; then
- # Warn if it was a shared library.
- test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
- continue
- fi
-
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$file" && dir=.
-
- if test -f "$dir/$objdir/$dlname"; then
- dir="$dir/$objdir"
- else
- if test ! -f "$dir/$dlname"; then
- $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
- exit $EXIT_FAILURE
- fi
- fi
- ;;
-
- *.lo)
- # Just add the directory containing the .lo file.
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$file" && dir=.
- ;;
-
- *)
- $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
- continue
- ;;
- esac
-
- # Get the absolute pathname.
- absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir="$absdir"
-
- # Now add the directory to shlibpath_var.
- if eval "test -z \"\$$shlibpath_var\""; then
- eval "$shlibpath_var=\"\$dir\""
- else
- eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
- fi
- done
-
- # This variable tells wrapper scripts just to set shlibpath_var
- # rather than running their programs.
- libtool_execute_magic="$magic"
-
- # Check if any of the arguments is a wrapper script.
- args=
- for file
- do
- case $file in
- -*) ;;
- *)
- # Do a test to see if this is really a libtool program.
- if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- # If there is no directory component, then add one.
- case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
- esac
-
- # Transform arg to wrapped name.
- file="$progdir/$program"
- fi
- ;;
- esac
- # Quote arguments (to preserve shell metacharacters).
- file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
- args="$args \"$file\""
- done
-
- if test -z "$run"; then
- if test -n "$shlibpath_var"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
- fi
-
- # Restore saved environment variables
- for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- do
- eval "if test \"\${save_$lt_var+set}\" = set; then
- $lt_var=\$save_$lt_var; export $lt_var
- fi"
- done
-
- # Now prepare to actually exec the command.
- exec_cmd="\$cmd$args"
- else
- # Display what would be done.
- if test -n "$shlibpath_var"; then
- eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
- $echo "export $shlibpath_var"
- fi
- $echo "$cmd$args"
- exit $EXIT_SUCCESS
- fi
- ;;
-
- # libtool clean and uninstall mode
- clean | uninstall)
- modename="$modename: $mode"
- rm="$nonopt"
- files=
- rmforce=
- exit_status=0
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- for arg
- do
- case $arg in
- -f) rm="$rm $arg"; rmforce=yes ;;
- -*) rm="$rm $arg" ;;
- *) files="$files $arg" ;;
- esac
- done
-
- if test -z "$rm"; then
- $echo "$modename: you must specify an RM program" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- rmdirs=
-
- origobjdir="$objdir"
- for file in $files; do
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$dir" = "X$file"; then
- dir=.
- objdir="$origobjdir"
- else
- objdir="$dir/$origobjdir"
- fi
- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- test "$mode" = uninstall && objdir="$dir"
-
- # Remember objdir for removal later, being careful to avoid duplicates
- if test "$mode" = clean; then
- case " $rmdirs " in
- *" $objdir "*) ;;
- *) rmdirs="$rmdirs $objdir" ;;
- esac
- fi
-
- # Don't error if the file doesn't exist and rm -f was used.
- if (test -L "$file") >/dev/null 2>&1 \
- || (test -h "$file") >/dev/null 2>&1 \
- || test -f "$file"; then
- :
- elif test -d "$file"; then
- exit_status=1
- continue
- elif test "$rmforce" = yes; then
- continue
- fi
-
- rmfiles="$file"
-
- case $name in
- *.la)
- # Possibly a libtool archive, so verify it.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- . $dir/$name
-
- # Delete the libtool libraries and symlinks.
- for n in $library_names; do
- rmfiles="$rmfiles $objdir/$n"
- done
- test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-
- case "$mode" in
- clean)
- case " $library_names " in
- # " " in the beginning catches empty $dlname
- *" $dlname "*) ;;
- *) rmfiles="$rmfiles $objdir/$dlname" ;;
- esac
- test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
- ;;
- uninstall)
- if test -n "$library_names"; then
- # Do each command in the postuninstall commands.
- cmds=$postuninstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd"
- if test "$?" -ne 0 && test "$rmforce" != yes; then
- exit_status=1
- fi
- done
- IFS="$save_ifs"
- fi
-
- if test -n "$old_library"; then
- # Do each command in the old_postuninstall commands.
- cmds=$old_postuninstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd"
- if test "$?" -ne 0 && test "$rmforce" != yes; then
- exit_status=1
- fi
- done
- IFS="$save_ifs"
- fi
- # FIXME: should reinstall the best remaining shared library.
- ;;
- esac
- fi
- ;;
-
- *.lo)
- # Possibly a libtool object, so verify it.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-
- # Read the .lo file
- . $dir/$name
-
- # Add PIC object to the list of files to remove.
- if test -n "$pic_object" \
- && test "$pic_object" != none; then
- rmfiles="$rmfiles $dir/$pic_object"
- fi
-
- # Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" \
- && test "$non_pic_object" != none; then
- rmfiles="$rmfiles $dir/$non_pic_object"
- fi
- fi
- ;;
-
- *)
- if test "$mode" = clean ; then
- noexename=$name
- case $file in
- *.exe)
- file=`$echo $file|${SED} 's,.exe$,,'`
- noexename=`$echo $name|${SED} 's,.exe$,,'`
- # $file with .exe has already been added to rmfiles,
- # add $file without .exe
- rmfiles="$rmfiles $file"
- ;;
- esac
- # Do a test to see if this is a libtool program.
- if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- relink_command=
- . $dir/$noexename
-
- # note $name still contains .exe if it was in $file originally
- # as does the version of $file that was added into $rmfiles
- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
- if test "$fast_install" = yes && test -n "$relink_command"; then
- rmfiles="$rmfiles $objdir/lt-$name"
- fi
- if test "X$noexename" != "X$name" ; then
- rmfiles="$rmfiles $objdir/lt-${noexename}.c"
- fi
- fi
- fi
- ;;
- esac
- $show "$rm $rmfiles"
- $run $rm $rmfiles || exit_status=1
- done
- objdir="$origobjdir"
-
- # Try to remove the ${objdir}s in the directories where we deleted files
- for dir in $rmdirs; do
- if test -d "$dir"; then
- $show "rmdir $dir"
- $run rmdir $dir >/dev/null 2>&1
- fi
- done
-
- exit $exit_status
- ;;
-
- "")
- $echo "$modename: you must specify a MODE" 1>&2
- $echo "$generic_help" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- if test -z "$exec_cmd"; then
- $echo "$modename: invalid operation mode \`$mode'" 1>&2
- $echo "$generic_help" 1>&2
- exit $EXIT_FAILURE
- fi
-fi # test -z "$show_help"
-
-if test -n "$exec_cmd"; then
- eval exec $exec_cmd
- exit $EXIT_FAILURE
-fi
-
-# We need to display help for each of the modes.
-case $mode in
-"") $echo \
-"Usage: $modename [OPTION]... [MODE-ARG]...
-
-Provide generalized library-building support services.
-
- --config show all configuration variables
- --debug enable verbose shell tracing
--n, --dry-run display commands without modifying any files
- --features display basic configuration information and exit
- --finish same as \`--mode=finish'
- --help display this help message and exit
- --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
- --quiet same as \`--silent'
- --silent don't print informational messages
- --tag=TAG use configuration variables from tag TAG
- --version print version information
-
-MODE must be one of the following:
-
- clean remove files from the build directory
- compile compile a source file into a libtool object
- execute automatically set library path, then run a program
- finish complete the installation of libtool libraries
- install install libraries or executables
- link create a library or an executable
- uninstall remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE.
-
-Report bugs to <bug-libtool@gnu.org>."
- exit $EXIT_SUCCESS
- ;;
-
-clean)
- $echo \
-"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
- ;;
-
-compile)
- $echo \
-"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
- -o OUTPUT-FILE set the output file name to OUTPUT-FILE
- -prefer-pic try to building PIC objects only
- -prefer-non-pic try to building non-PIC objects only
- -static always build a \`.o' file suitable for static linking
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
- ;;
-
-execute)
- $echo \
-"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
- -dlopen FILE add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
- ;;
-
-finish)
- $echo \
-"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges. Use
-the \`--dry-run' option if you just want to see what would be executed."
- ;;
-
-install)
- $echo \
-"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command. The first component should be
-either the \`install' or \`cp' program.
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
- ;;
-
-link)
- $echo \
-"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
- -all-static do not do any dynamic linking at all
- -avoid-version do not add a version suffix if possible
- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
- -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
- -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
- -export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
- -export-symbols-regex REGEX
- try to export only the symbols matching REGEX
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -module build a library that can dlopened
- -no-fast-install disable the fast-install mode
- -no-install link a not-installable executable
- -no-undefined declare that a library does not refer to external symbols
- -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
- -precious-files-regex REGEX
- don't remove output files matching REGEX
- -release RELEASE specify package release information
- -rpath LIBDIR the created library will eventually be installed in LIBDIR
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -static do not do any dynamic linking of uninstalled libtool libraries
- -static-libtool-libs
- do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename. Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
- ;;
-
-uninstall)
- $echo \
-"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
- ;;
-
-*)
- $echo "$modename: invalid operation mode \`$mode'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
-esac
-
-$echo
-$echo "Try \`$modename --help' for more information about other modes."
-
-exit $?
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries. Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them. This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration. But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-disable_libs=shared
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-disable_libs=static
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/pppd_plugin/missing b/pppd_plugin/missing
deleted file mode 100755
index 7f1c505..0000000
--- a/pppd_plugin/missing
+++ /dev/null
@@ -1,337 +0,0 @@
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# 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, 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.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-exit
-if test $# -eq 0; then
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
-fi
-
-run=:
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
-
-case "$1" in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
-
-Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- automake touch all \`Makefile.in' files
- bison create \`y.tab.[ch]', if possible, from existing .[ch]
- flex create \`lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create \`lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing 0.4 - GNU automake"
- ;;
-
- -*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
- ;;
-
- aclocal*)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acinclude.m4' or \`${configure_ac}'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`${configure_ac}'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acconfig.h' or \`${configure_ac}'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case "$f" in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
- echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
- system. You might have modified some files without having the
- proper tools for further handling them.
- You can get \`$1Help2man' as part of \`Autoconf' from any GNU
- archive site."
-
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison|yacc)
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if [ ! -f y.tab.h ]; then
- echo >y.tab.h
- fi
- if [ ! -f y.tab.c ]; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex|flex)
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified a \`.l' file. You may need the \`Flex' package
- in order for those modifications to take effect. You can get
- \`Flex' from any GNU archive site."
- rm -f lex.yy.c
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if [ ! -f lex.yy.c ]; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified a dependency of a manual page. You may need the
- \`Help2man' package in order for those modifications to take
- effect. You can get \`Help2man' from any GNU archive site."
-
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit 1
- fi
- ;;
-
- makeinfo)
- if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
- # We have makeinfo, but it failed.
- exit 1
- fi
-
- echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
- fi
- touch $file
- ;;
-
- tar)
- shift
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- fi
-
- # We have already tried tar in the generic part.
- # Look for gnutar/gtar before invocation to avoid ugly error
- # messages.
- if (gnutar --version > /dev/null 2>&1); then
- gnutar "$@" && exit 0
- fi
- if (gtar --version > /dev/null 2>&1); then
- gtar "$@" && exit 0
- fi
- firstarg="$1"
- if shift; then
- case "$firstarg" in
- *o*)
- firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- case "$firstarg" in
- *h*)
- firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- fi
-
- echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
- You may want to install GNU tar or Free paxutils, or check the
- command line arguments."
- exit 1
- ;;
-
- *)
- echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
- system. You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequirements for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/pppd_plugin/mkinstalldirs b/pppd_plugin/mkinstalldirs
deleted file mode 100755
index d2d5f21..0000000
--- a/pppd_plugin/mkinstalldirs
+++ /dev/null
@@ -1,111 +0,0 @@
-#! /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
diff --git a/pppd_plugin/src/Makefile.am b/pppd_plugin/src/Makefile.am
deleted file mode 100644
index 6c4282c..0000000
--- a/pppd_plugin/src/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-
-# 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
diff --git a/pppd_plugin/src/Makefile.in b/pppd_plugin/src/Makefile.in
deleted file mode 100644
index 79d6101..0000000
--- a/pppd_plugin/src/Makefile.in
+++ /dev/null
@@ -1,528 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = src
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man8dir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
-pptp_la_LIBADD =
-am_pptp_la_OBJECTS = pptp.lo pptp_callmgr.lo pptp_ctrl.lo util.lo \
- vector.lo dirutil.lo pptp_quirks.lo orckit_quirks.lo
-pptp_la_OBJECTS = $(am_pptp_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(pptp_la_SOURCES)
-DIST_SOURCES = $(pptp_la_SOURCES)
-man8dir = $(mandir)/man8
-NROFF = nroff
-MANS = $(man_MANS)
-HEADERS = $(noinst_HEADERS)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-GREP = @GREP@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-
-# 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
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- if test -f $$p; then \
- f=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
- else :; fi; \
- done
-
-uninstall-libLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- p=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
- $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
- done
-
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-pptp.la: $(pptp_la_OBJECTS) $(pptp_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(pptp_la_LDFLAGS) $(pptp_la_OBJECTS) $(pptp_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirutil.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orckit_quirks.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pptp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pptp_callmgr.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pptp_ctrl.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pptp_quirks.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-install-man8: $(man8_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)"
- @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.8*) list="$$list $$i" ;; \
- esac; \
- done; \
- for i in $$list; do \
- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
- else file=$$i; fi; \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 8*) ;; \
- *) ext='8' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \
- done
-uninstall-man8:
- @$(NORMAL_UNINSTALL)
- @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.8*) list="$$list $$i" ;; \
- esac; \
- done; \
- for i in $$list; do \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 8*) ;; \
- *) ext='8' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \
- rm -f "$(DESTDIR)$(man8dir)/$$inst"; \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS)
-installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man8dir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-exec-am: install-libLTLIBRARIES
-
-install-info: install-info-am
-
-install-man: install-man8
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES uninstall-man
-
-uninstall-man: uninstall-man8
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am \
- install-libLTLIBRARIES install-man install-man8 install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-libLTLIBRARIES uninstall-man uninstall-man8
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/pppd_plugin/src/dirutil.c b/pppd_plugin/src/dirutil.c
deleted file mode 100644
index e7b1a77..0000000
--- a/pppd_plugin/src/dirutil.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* dirutil.c ... directory utilities.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: dirutil.c,v 1.2 2003/06/17 17:25:47 reink Exp $
- */
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include "dirutil.h"
-
-/* Returned malloc'ed string representing basename */
-char *basenamex(char *pathname)
-{
- char *dup = strdup(pathname);
- char *ptr = strrchr(stripslash(dup), '/');
- if (ptr == NULL) return dup;
- ptr = strdup(ptr+1);
- free(dup);
- return ptr;
-}
-
-/* Return malloc'ed string representing directory name (no trailing slash) */
-char *dirnamex(char *pathname)
-{
- char *dup = strdup(pathname);
- char *ptr = strrchr(stripslash(dup), '/');
- if (ptr == NULL) { free(dup); return strdup("."); }
- if (ptr == dup && dup[0] == '/') ptr++;
- *ptr = '\0';
- return dup;
-}
-
-/* In-place modify a string to remove trailing slashes. Returns arg.
- * stripslash("/") returns "/";
- */
-char *stripslash(char *pathname) {
- int len = strlen(pathname);
- while (len > 1 && pathname[len - 1] == '/')
- pathname[--len] = '\0';
- return pathname;
-}
-
-/* ensure dirname exists, creating it if necessary. */
-int make_valid_path(char *dir, mode_t mode)
-{
- struct stat st;
- char *tmp = NULL, *path = stripslash(strdup(dir));
- int retval;
- if (stat(path, &st) == 0) { /* file exists */
- if (S_ISDIR(st.st_mode)) { retval = 1; goto end; }
- else { retval = 0; goto end; } /* not a directory. Oops. */
- }
- /* Directory doesn't exist. Let's make it. */
- /* Make parent first. */
- if (!make_valid_path(tmp = dirnamex(path), mode)) { retval = 0; goto end; }
- /* Now make this 'un. */
- if (mkdir(path, mode) < 0) { retval = 0; goto end; }
- /* Success. */
- retval = 1;
-
-end:
- if (tmp != NULL) free(tmp);
- if (path != NULL) free(path);
- return retval;
-}
diff --git a/pppd_plugin/src/dirutil.h b/pppd_plugin/src/dirutil.h
deleted file mode 100644
index 4c9aa87..0000000
--- a/pppd_plugin/src/dirutil.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* dirutil.h ... directory utilities.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: dirutil.h,v 1.1.1.1 2000/12/23 08:19:51 scott Exp $
- */
-
-/* Returned malloc'ed string representing basename */
-char *basenamex(char *pathname);
-/* Return malloc'ed string representing directory name (no trailing slash) */
-char *dirnamex(char *pathname);
-/* In-place modify a string to remove trailing slashes. Returns arg. */
-char *stripslash(char *pathname);
-/* ensure dirname exists, creating it if necessary. */
-int make_valid_path(char *dirname, mode_t mode);
diff --git a/pppd_plugin/src/if_pppox.h b/pppd_plugin/src/if_pppox.h
deleted file mode 120000
index 48a1663..0000000
--- a/pppd_plugin/src/if_pppox.h
+++ /dev/null
@@ -1 +0,0 @@
-../../kernel/driver/if_pppox.h \ No newline at end of file
diff --git a/pppd_plugin/src/orckit_quirks.c b/pppd_plugin/src/orckit_quirks.c
deleted file mode 100644
index 1d03737..0000000
--- a/pppd_plugin/src/orckit_quirks.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* orckit_quirks.c ...... fix quirks in orckit adsl modems
- * mulix <mulix@actcom.co.il>
- *
- * $Id: orckit_quirks.c,v 1.3 2002/03/01 01:23:36 quozl Exp $
- */
-
-#include <string.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include "pptp_msg.h"
-#include "pptp_options.h"
-#include "pptp_ctrl.h"
-#include "util.h"
-
-
-
-/* return 0 on success, non zero otherwise */
-int
-orckit_atur3_build_hook(struct pptp_out_call_rqst* packet)
-{
- unsigned int name_length = 10;
-
- struct pptp_out_call_rqst fixed_packet = {
- PPTP_HEADER_CTRL(PPTP_OUT_CALL_RQST),
- 0, /* hton16(call->callid) */
- 0, /* hton16(call->sernum) */
- hton32(PPTP_BPS_MIN), hton32(PPTP_BPS_MAX),
- hton32(PPTP_BEARER_DIGITAL), hton32(PPTP_FRAME_ANY),
- hton16(PPTP_WINDOW), 0, hton16(name_length), 0,
- {'R','E','L','A','Y','_','P','P','P','1',0}, {0}
- };
-
- if (!packet)
- return -1;
-
- memcpy(packet, &fixed_packet, sizeof(*packet));
-
- return 0;
-}
-
-/* return 0 on success, non zero otherwise */
-int
-orckit_atur3_set_link_hook(struct pptp_set_link_info* packet,
- int peer_call_id)
-{
- struct pptp_set_link_info fixed_packet = {
- PPTP_HEADER_CTRL(PPTP_SET_LINK_INFO),
- hton16(peer_call_id),
- 0,
- 0xffffffff,
- 0xffffffff};
-
- if (!packet)
- return -1;
-
- memcpy(packet, &fixed_packet, sizeof(*packet));
- return 0;
-}
-
-/* return 0 on success, non 0 otherwise */
-int
-orckit_atur3_start_ctrl_conn_hook(struct pptp_start_ctrl_conn* packet)
-{
- struct pptp_start_ctrl_conn fixed_packet = {
- {0}, /* we'll set the header later */
- hton16(PPTP_VERSION), 0, 0,
- hton32(PPTP_FRAME_ASYNC), hton32(PPTP_BEARER_ANALOG),
- hton16(0) /* max channels */,
- hton16(0x6021),
- {'R','E','L','A','Y','_','P','P','P','1',0}, /* hostname */
- {'M','S',' ','W','i','n',' ','N','T',0} /* vendor */
- };
-
- if (!packet)
- return -1;
-
- /* grab the header from the original packet, since we dont
- know if this is a request or a reply */
- memcpy(&fixed_packet.header, &packet->header, sizeof(struct pptp_header));
-
- /* and now overwrite the full packet, effectively preserving the header */
- memcpy(packet, &fixed_packet, sizeof(*packet));
- return 0;
-}
-
-
diff --git a/pppd_plugin/src/orckit_quirks.h b/pppd_plugin/src/orckit_quirks.h
deleted file mode 100644
index ad0193d..0000000
--- a/pppd_plugin/src/orckit_quirks.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* orckit_quirks.h ...... fix quirks in orckit adsl modems
- * mulix <mulix@actcom.co.il>
- *
- * $Id: orckit_quirks.h,v 1.2 2001/11/23 03:42:51 quozl Exp $
- */
-
-#ifndef INC_ORCKIT_QUIRKS_H_
-#define INC_ORCKIT_QUIRKS_H_
-
-#include "pptp_options.h"
-#include "pptp_ctrl.h"
-#include "pptp_msg.h"
-
-/* return 0 on success, non zero otherwise */
-int
-orckit_atur3_build_hook(struct pptp_out_call_rqst* packt);
-
-/* return 0 on success, non zero otherwise */
-int
-orckit_atur3_set_link_hook(struct pptp_set_link_info* packet,
- int peer_call_id);
-
-/* return 0 on success, non zero otherwise */
-int
-orckit_atur3_start_ctrl_conn_hook(struct pptp_start_ctrl_conn* packet);
-
-#endif /* INC_ORCKIT_QUIRKS_H_ */
diff --git a/pppd_plugin/src/pppd-pptp.8 b/pppd_plugin/src/pppd-pptp.8
deleted file mode 100644
index 85b31b2..0000000
--- a/pppd_plugin/src/pppd-pptp.8
+++ /dev/null
@@ -1,71 +0,0 @@
-.\" manual page [] for ACCEL-PPTP plugin for pppd 2.4
-.\" $Id: pppd-pptp.8,v 1.0 2007/10/17 13:27:17 kad Exp $
-.\" SH section heading
-.\" SS subsection heading
-.\" LP paragraph
-.\" IP indented paragraph
-.\" TP hanging label
-.TH PPPD-PPTP 8
-.SH NAME
-pptp.so \- PPTP VPN plugin for
-.BR pppd (8)
-.SH SYNOPSIS
-.B pppd
-[
-.I options
-]
-plugin pptp.so
-.SH DESCRIPTION
-.LP
-The PPTP plugin for pppd performs interaction with pptp kernel module
-and has built-in call manager (client part of PPTP).
-It pasees necessary paremeters from \fIoptions\fR into kernel module
-to configure ppp-pptp channel. If it runs in client mode, then additionally
-call manager starts up. PPTPD daemon automaticaly invokes this plugin
-in server mode and passes necessary options, so additional configuration
-is not needed.
-
-.SH OPTIONS for client mode
-The PPTP plugin introduces one additional pppd option:
-.TP
-.BI "pptp_server " server " (required)"
-Specifies ip address or hostname of pptp server.
-.TP
-.BI "pptp_window " packets " (optional)"
-The amount of sliding window size.
-Set to 0 to turn off sliding window.
- to 3-10 for low speed connections.
- to >10 for hi speed connections.
-.TP
-.BI "pptp_phone " phone " (optional)"
-The phone string that sended to pptp server.
-.TP
-.BI "pptp_timeout " miliseconds " (optional)"
-Specifies timeout for waiting "ack" packet from server.
-
-.SH USAGE
-Sample configuration file:
-.nf
-plugin "pptp.so"
-pptp_server 192.168.0.1
-pptp_window 50
-name myname
-remotename pptp
-noauth
-refuse-eap
-refuse-chap
-refuse-mschap
-nobsdcomp
-nodeflate
-novj
-novjccomp
-require-mppe-128
-lcp-echo-interval 20
-lcp-echo-failure 3
-.fi
-
-.SH SEE ALSO
-.BR pppd (8) " " pptpd (8) " " pptpd.conf (5)
-
-.SH AUTHOR
-xeb xeb@mail.ru
diff --git a/pppd_plugin/src/pppd/cbcp.h b/pppd_plugin/src/pppd/cbcp.h
deleted file mode 100644
index c2ab3f6..0000000
--- a/pppd_plugin/src/pppd/cbcp.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef CBCP_H
-#define CBCP_H
-
-typedef struct cbcp_state {
- int us_unit; /* Interface unit number */
- u_char us_id; /* Current id */
- u_char us_allowed;
- int us_type;
- char *us_number; /* Telefone Number */
-} cbcp_state;
-
-extern cbcp_state cbcp[];
-
-extern struct protent cbcp_protent;
-
-#define CBCP_MINLEN 4
-
-#define CBCP_REQ 1
-#define CBCP_RESP 2
-#define CBCP_ACK 3
-
-#define CB_CONF_NO 1
-#define CB_CONF_USER 2
-#define CB_CONF_ADMIN 3
-#define CB_CONF_LIST 4
-#endif
diff --git a/pppd_plugin/src/pppd/ccp.h b/pppd_plugin/src/pppd/ccp.h
deleted file mode 100644
index 6f4a2fe..0000000
--- a/pppd_plugin/src/pppd/ccp.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * ccp.h - Definitions for PPP Compression Control Protocol.
- *
- * Copyright (c) 1994-2002 Paul Mackerras. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. The name(s) of the authors of this software must not be used to
- * endorse or promote products derived from this software without
- * prior written permission.
- *
- * 3. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Paul Mackerras
- * <paulus@samba.org>".
- *
- * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: ccp.h,v 1.12 2004/11/04 10:02:26 paulus Exp $
- */
-
-typedef struct ccp_options {
- bool bsd_compress; /* do BSD Compress? */
- bool deflate; /* do Deflate? */
- bool predictor_1; /* do Predictor-1? */
- bool predictor_2; /* do Predictor-2? */
- bool deflate_correct; /* use correct code for deflate? */
- bool deflate_draft; /* use draft RFC code for deflate? */
- bool 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 */
-} ccp_options;
-
-extern fsm ccp_fsm[];
-extern ccp_options ccp_wantoptions[];
-extern ccp_options ccp_gotoptions[];
-extern ccp_options ccp_allowoptions[];
-extern ccp_options ccp_hisoptions[];
-
-extern struct protent ccp_protent;
diff --git a/pppd_plugin/src/pppd/chap-md5.h b/pppd_plugin/src/pppd/chap-md5.h
deleted file mode 100644
index 30d0658..0000000
--- a/pppd_plugin/src/pppd/chap-md5.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * chap-md5.h - New CHAP/MD5 implementation.
- *
- * Copyright (c) 2003 Paul Mackerras. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. The name(s) of the authors of this software must not be used to
- * endorse or promote products derived from this software without
- * prior written permission.
- *
- * 3. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Paul Mackerras
- * <paulus@samba.org>".
- *
- * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-extern void chap_md5_init(void);
diff --git a/pppd_plugin/src/pppd/chap-new.h b/pppd_plugin/src/pppd/chap-new.h
deleted file mode 100644
index 48235d4..0000000
--- a/pppd_plugin/src/pppd/chap-new.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * chap-new.c - New CHAP implementation.
- *
- * Copyright (c) 2003 Paul Mackerras. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. The name(s) of the authors of this software must not be used to
- * endorse or promote products derived from this software without
- * prior written permission.
- *
- * 3. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Paul Mackerras
- * <paulus@samba.org>".
- *
- * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * CHAP packets begin with a standard header with code, id, len (2 bytes).
- */
-#define CHAP_HDRLEN 4
-
-/*
- * Values for the code field.
- */
-#define CHAP_CHALLENGE 1
-#define CHAP_RESPONSE 2
-#define CHAP_SUCCESS 3
-#define CHAP_FAILURE 4
-
-/*
- * CHAP digest codes.
- */
-#define CHAP_MD5 5
-#define CHAP_MICROSOFT 0x80
-#define CHAP_MICROSOFT_V2 0x81
-
-/*
- * Semi-arbitrary limits on challenge and response fields.
- */
-#define MAX_CHALLENGE_LEN 64
-#define MAX_RESPONSE_LEN 64
-
-/* bitmask of supported algorithms */
-#define MDTYPE_MICROSOFT_V2 0x1
-#define MDTYPE_MICROSOFT 0x2
-#define MDTYPE_MD5 0x4
-#define MDTYPE_NONE 0
-
-/* hashes supported by this instance of pppd */
-extern int chap_mdtype_all;
-
-/* Return the digest alg. ID for the most preferred digest type. */
-#define CHAP_DIGEST(mdtype) \
- ((mdtype) & MDTYPE_MD5)? CHAP_MD5: \
- ((mdtype) & MDTYPE_MICROSOFT_V2)? CHAP_MICROSOFT_V2: \
- ((mdtype) & MDTYPE_MICROSOFT)? CHAP_MICROSOFT: \
- 0
-
-/* Return the bit flag (lsb set) for our most preferred digest type. */
-#define CHAP_MDTYPE(mdtype) ((mdtype) ^ ((mdtype) - 1)) & (mdtype)
-
-/* Return the bit flag for a given digest algorithm ID. */
-#define CHAP_MDTYPE_D(digest) \
- ((digest) == CHAP_MICROSOFT_V2)? MDTYPE_MICROSOFT_V2: \
- ((digest) == CHAP_MICROSOFT)? MDTYPE_MICROSOFT: \
- ((digest) == CHAP_MD5)? MDTYPE_MD5: \
- 0
-
-/* Can we do the requested digest? */
-#define CHAP_CANDIGEST(mdtype, digest) \
- ((digest) == CHAP_MICROSOFT_V2)? (mdtype) & MDTYPE_MICROSOFT_V2: \
- ((digest) == CHAP_MICROSOFT)? (mdtype) & MDTYPE_MICROSOFT: \
- ((digest) == CHAP_MD5)? (mdtype) & MDTYPE_MD5: \
- 0
-
-/*
- * The code for each digest type has to supply one of these.
- */
-struct chap_digest_type {
- int code;
-
- /*
- * Note: challenge and response arguments below are formatted as
- * a length byte followed by the actual challenge/response data.
- */
- void (*generate_challenge)(unsigned char *challenge);
- int (*verify_response)(int id, char *name,
- unsigned char *secret, int secret_len,
- unsigned char *challenge, unsigned char *response,
- char *message, int message_space);
- void (*make_response)(unsigned char *response, int id, char *our_name,
- unsigned char *challenge, char *secret, int secret_len,
- unsigned char *priv);
- int (*check_success)(unsigned char *pkt, int len, unsigned char *priv);
- void (*handle_failure)(unsigned char *pkt, int len);
-
- struct chap_digest_type *next;
-};
-
-/* Hook for a plugin to validate CHAP challenge */
-extern int (*chap_verify_hook)(char *name, char *ourname, int id,
- struct chap_digest_type *digest,
- unsigned char *challenge, unsigned char *response,
- char *message, int message_space);
-
-/* Called by digest code to register a digest type */
-extern void chap_register_digest(struct chap_digest_type *);
-
-/* Called by authentication code to start authenticating the peer. */
-extern void chap_auth_peer(int unit, char *our_name, int digest_code);
-
-/* Called by auth. code to start authenticating us to the peer. */
-extern void chap_auth_with_peer(int unit, char *our_name, int digest_code);
-
-/* Represents the CHAP protocol to the main pppd code */
-extern struct protent chap_protent;
diff --git a/pppd_plugin/src/pppd/chap_ms.h b/pppd_plugin/src/pppd/chap_ms.h
deleted file mode 100644
index 168c0be..0000000
--- a/pppd_plugin/src/pppd/chap_ms.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * chap_ms.h - Challenge Handshake Authentication Protocol definitions.
- *
- * Copyright (c) 1995 Eric Rosenquist. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name(s) of the authors of this software must not be used to
- * endorse or promote products derived from this software without
- * prior written permission.
- *
- * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: chap_ms.h,v 1.12 2004/11/09 22:49:05 paulus Exp $
- */
-
-#ifndef __CHAPMS_INCLUDE__
-
-#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */
-#define MAX_NT_PASSWORD 256 /* Max (Unicode) chars in an NT pass */
-
-#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */
-#define MS_CHAP2_RESPONSE_LEN 49 /* Response length for MS-CHAPv2 */
-#define MS_AUTH_RESPONSE_LENGTH 40 /* MS-CHAPv2 authenticator response, */
- /* as ASCII */
-
-/* E=eeeeeeeeee error codes for MS-CHAP failure messages. */
-#define MS_CHAP_ERROR_RESTRICTED_LOGON_HOURS 646
-#define MS_CHAP_ERROR_ACCT_DISABLED 647
-#define MS_CHAP_ERROR_PASSWD_EXPIRED 648
-#define MS_CHAP_ERROR_NO_DIALIN_PERMISSION 649
-#define MS_CHAP_ERROR_AUTHENTICATION_FAILURE 691
-#define MS_CHAP_ERROR_CHANGING_PASSWORD 709
-
-/*
- * Apparently gcc on ARM gives all structures 4-byte alignment
- * by default. This tells gcc that these structures may be
- * unaligned and may not have extra padding inside them.
- */
-#ifdef __GNUC__
-#define PACKED __attribute__((__packed__))
-#else
-#define PACKED
-#endif
-
-/*
- * Use MS_CHAP_RESPONSE_LEN, rather than sizeof(MS_ChapResponse),
- * in case this struct gets padded.
- */
-typedef struct {
- u_char LANManResp[24];
- u_char NTResp[24];
- u_char UseNT[1]; /* If 1, ignore the LANMan response field */
-} MS_ChapResponse PACKED;
-
-/*
- * Use MS_CHAP2_RESPONSE_LEN, rather than sizeof(MS_Chap2Response),
- * in case this struct gets padded.
- */
-typedef struct {
- u_char PeerChallenge[16];
- u_char Reserved[8]; /* Must be zero */
- u_char NTResp[24];
- u_char Flags[1]; /* Must be zero */
-} MS_Chap2Response PACKED;
-
-#ifdef MPPE
-#include <net/ppp-comp.h> /* MPPE_MAX_KEY_LEN */
-extern u_char mppe_send_key[MPPE_MAX_KEY_LEN];
-extern u_char mppe_recv_key[MPPE_MAX_KEY_LEN];
-extern int mppe_keys_set;
-
-/* These values are the RADIUS attribute values--see RFC 2548. */
-#define MPPE_ENC_POL_ENC_ALLOWED 1
-#define MPPE_ENC_POL_ENC_REQUIRED 2
-#define MPPE_ENC_TYPES_RC4_40 2
-#define MPPE_ENC_TYPES_RC4_128 4
-
-/* used by plugins (using above values) */
-extern void set_mppe_enc_types(int, int);
-#endif
-
-/* Are we the authenticator or authenticatee? For MS-CHAPv2 key derivation. */
-#define MS_CHAP2_AUTHENTICATEE 0
-#define MS_CHAP2_AUTHENTICATOR 1
-
-void ChapMS __P((u_char *, char *, int, MS_ChapResponse *));
-void ChapMS2 __P((u_char *, u_char *, char *, char *, int,
- MS_Chap2Response *, u_char[MS_AUTH_RESPONSE_LENGTH+1], int));
-#ifdef MPPE
-void mppe_set_keys __P((u_char *, u_char[MD4_SIGNATURE_SIZE]));
-void mppe_set_keys2(u_char PasswordHashHash[MD4_SIGNATURE_SIZE],
- u_char NTResponse[24], int IsServer);
-#endif
-
-void ChallengeHash __P((u_char[16], u_char *, char *, u_char[8]));
-
-void GenerateAuthenticatorResponse(u_char PasswordHashHash[MD4_SIGNATURE_SIZE],
- u_char NTResponse[24], u_char PeerChallenge[16],
- u_char *rchallenge, char *username,
- u_char authResponse[MS_AUTH_RESPONSE_LENGTH+1]);
-
-void chapms_init(void);
-
-#define __CHAPMS_INCLUDE__
-#endif /* __CHAPMS_INCLUDE__ */
diff --git a/pppd_plugin/src/pppd/eap.h b/pppd_plugin/src/pppd/eap.h
deleted file mode 100644
index 199d184..0000000
--- a/pppd_plugin/src/pppd/eap.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * eap.h - Extensible Authentication Protocol for PPP (RFC 2284)
- *
- * Copyright (c) 2001 by Sun Microsystems, Inc.
- * All rights reserved.
- *
- * Non-exclusive rights to redistribute, modify, translate, and use
- * this software in source and binary forms, in whole or in part, is
- * hereby granted, provided that the above copyright notice is
- * duplicated in any source form, and that neither the name of the
- * copyright holder nor the author is used to endorse or promote
- * products derived from this software.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Original version by James Carlson
- *
- * $Id: eap.h,v 1.2 2003/06/11 23:56:26 paulus Exp $
- */
-
-#ifndef PPP_EAP_H
-#define PPP_EAP_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Packet header = Code, id, length.
- */
-#define EAP_HEADERLEN 4
-
-
-/* EAP message codes. */
-#define EAP_REQUEST 1
-#define EAP_RESPONSE 2
-#define EAP_SUCCESS 3
-#define EAP_FAILURE 4
-
-/* EAP types */
-#define EAPT_IDENTITY 1
-#define EAPT_NOTIFICATION 2
-#define EAPT_NAK 3 /* (response only) */
-#define EAPT_MD5CHAP 4
-#define EAPT_OTP 5 /* One-Time Password; RFC 1938 */
-#define EAPT_TOKEN 6 /* Generic Token Card */
-/* 7 and 8 are unassigned. */
-#define EAPT_RSA 9 /* RSA Public Key Authentication */
-#define EAPT_DSS 10 /* DSS Unilateral */
-#define EAPT_KEA 11 /* KEA */
-#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE */
-#define EAPT_TLS 13 /* EAP-TLS */
-#define EAPT_DEFENDER 14 /* Defender Token (AXENT) */
-#define EAPT_W2K 15 /* Windows 2000 EAP */
-#define EAPT_ARCOT 16 /* Arcot Systems */
-#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */
-#define EAPT_NOKIACARD 18 /* Nokia IP smart card */
-#define EAPT_SRP 19 /* Secure Remote Password */
-/* 20 is deprecated */
-
-/* EAP SRP-SHA1 Subtypes */
-#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */
-#define EAPSRP_CKEY 1 /* Response 1 - Client Key */
-#define EAPSRP_SKEY 2 /* Request 2 - Server Key */
-#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */
-#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */
-#define EAPSRP_ACK 3 /* Response 3 - final ack */
-#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */
-
-#define SRPVAL_EBIT 0x00000001 /* Use shared key for ECP */
-
-#define SRP_PSEUDO_ID "pseudo_"
-#define SRP_PSEUDO_LEN 7
-
-#define MD5_SIGNATURE_SIZE 16
-#define MIN_CHALLENGE_LENGTH 16
-#define MAX_CHALLENGE_LENGTH 24
-
-enum eap_state_code {
- eapInitial = 0, /* No EAP authentication yet requested */
- eapPending, /* Waiting for LCP (no timer) */
- eapClosed, /* Authentication not in use */
- eapListen, /* Client ready (and timer running) */
- eapIdentify, /* EAP Identify sent */
- eapSRP1, /* Sent EAP SRP-SHA1 Subtype 1 */
- eapSRP2, /* Sent EAP SRP-SHA1 Subtype 2 */
- eapSRP3, /* Sent EAP SRP-SHA1 Subtype 3 */
- eapMD5Chall, /* Sent MD5-Challenge */
- eapOpen, /* Completed authentication */
- eapSRP4, /* Sent EAP SRP-SHA1 Subtype 4 */
- eapBadAuth /* Failed authentication */
-};
-
-#define EAP_STATES \
- "Initial", "Pending", "Closed", "Listen", "Identify", \
- "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth"
-
-#define eap_client_active(esp) ((esp)->es_client.ea_state == eapListen)
-#define eap_server_active(esp) \
- ((esp)->es_server.ea_state >= eapIdentify && \
- (esp)->es_server.ea_state <= eapMD5Chall)
-
-struct eap_auth {
- char *ea_name; /* Our name */
- char *ea_peer; /* Peer's name */
- void *ea_session; /* Authentication library linkage */
- u_char *ea_skey; /* Shared encryption key */
- int ea_timeout; /* Time to wait (for retransmit/fail) */
- int ea_maxrequests; /* Max Requests allowed */
- u_short ea_namelen; /* Length of our name */
- u_short ea_peerlen; /* Length of peer's name */
- enum eap_state_code ea_state;
- u_char ea_id; /* Current id */
- u_char ea_requests; /* Number of Requests sent/received */
- u_char ea_responses; /* Number of Responses */
- u_char ea_type; /* One of EAPT_* */
- u_int32_t ea_keyflags; /* SRP shared key usage flags */
-};
-
-/*
- * Complete EAP state for one PPP session.
- */
-typedef struct eap_state {
- int es_unit; /* Interface unit number */
- struct eap_auth es_client; /* Client (authenticatee) data */
- struct eap_auth es_server; /* Server (authenticator) data */
- int es_savedtime; /* Saved timeout */
- int es_rechallenge; /* EAP rechallenge interval */
- int es_lwrechallenge; /* SRP lightweight rechallenge inter */
- bool es_usepseudo; /* Use SRP Pseudonym if offered one */
- int es_usedpseudo; /* Set if we already sent PN */
- int es_challen; /* Length of challenge string */
- u_char es_challenge[MAX_CHALLENGE_LENGTH];
-} eap_state;
-
-/*
- * Timeouts.
- */
-#define EAP_DEFTIMEOUT 3 /* Timeout (seconds) for rexmit */
-#define EAP_DEFTRANSMITS 10 /* max # times to transmit */
-#define EAP_DEFREQTIME 20 /* Time to wait for peer request */
-#define EAP_DEFALLOWREQ 20 /* max # times to accept requests */
-
-extern eap_state eap_states[];
-
-void eap_authwithpeer __P((int unit, char *localname));
-void eap_authpeer __P((int unit, char *localname));
-
-extern struct protent eap_protent;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* PPP_EAP_H */
-
diff --git a/pppd_plugin/src/pppd/ecp.h b/pppd_plugin/src/pppd/ecp.h
deleted file mode 100644
index df6e3ca..0000000
--- a/pppd_plugin/src/pppd/ecp.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * ecp.h - Definitions for PPP Encryption Control Protocol.
- *
- * Copyright (c) 2002 Google, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name(s) of the authors of this software must not be used to
- * endorse or promote products derived from this software without
- * prior written permission.
- *
- * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: ecp.h,v 1.2 2003/01/10 07:12:36 fcusack Exp $
- */
-
-typedef struct ecp_options {
- bool required; /* Is ECP required? */
- unsigned enctype; /* Encryption type */
-} ecp_options;
-
-extern fsm ecp_fsm[];
-extern ecp_options ecp_wantoptions[];
-extern ecp_options ecp_gotoptions[];
-extern ecp_options ecp_allowoptions[];
-extern ecp_options ecp_hisoptions[];
-
-extern struct protent ecp_protent;
diff --git a/pppd_plugin/src/pppd/eui64.h b/pppd_plugin/src/pppd/eui64.h
deleted file mode 100644
index 0f6b6fd..0000000
--- a/pppd_plugin/src/pppd/eui64.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * eui64.h - EUI64 routines for IPv6CP.
- *
- * Copyright (c) 1999 Tommi Komulainen. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name(s) of the authors of this software must not be used to
- * endorse or promote products derived from this software without
- * prior written permission.
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Tommi Komulainen
- * <Tommi.Komulainen@iki.fi>".
- *
- * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: eui64.h,v 1.6 2002/12/04 23:03:32 paulus Exp $
-*/
-
-#ifndef __EUI64_H__
-#define __EUI64_H__
-
-#if !defined(INET6)
-#error "this file should only be included when INET6 is defined"
-#endif /* not defined(INET6) */
-
-#if defined(SOL2)
-#include <netinet/in.h>
-
-typedef union {
- uint8_t e8[8]; /* lower 64-bit IPv6 address */
- uint32_t e32[2]; /* lower 64-bit IPv6 address */
-} eui64_t;
-
-/*
- * Declare the two below, since in.h only defines them when _KERNEL
- * is declared - which shouldn't be true when dealing with user-land programs
- */
-#define s6_addr8 _S6_un._S6_u8
-#define s6_addr32 _S6_un._S6_u32
-
-#else /* else if not defined(SOL2) */
-
-/*
- * TODO:
- *
- * Maybe this should be done by processing struct in6_addr directly...
- */
-typedef union
-{
- u_int8_t e8[8];
- u_int16_t e16[4];
- u_int32_t e32[2];
-} eui64_t;
-
-#endif /* defined(SOL2) */
-
-#define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0)
-#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \
- ((e).e32[1] == (o).e32[1]))
-#define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0;
-
-#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t))
-
-#define eui64_magic(e) do { \
- (e).e32[0] = magic(); \
- (e).e32[1] = magic(); \
- (e).e8[0] &= ~2; \
- } while (0)
-#define eui64_magic_nz(x) do { \
- eui64_magic(x); \
- } while (eui64_iszero(x))
-#define eui64_magic_ne(x, y) do { \
- eui64_magic(x); \
- } while (eui64_equals(x, y))
-
-#define eui64_get(ll, cp) do { \
- eui64_copy((*cp), (ll)); \
- (cp) += sizeof(eui64_t); \
- } while (0)
-
-#define eui64_put(ll, cp) do { \
- eui64_copy((ll), (*cp)); \
- (cp) += sizeof(eui64_t); \
- } while (0)
-
-#define eui64_set32(e, l) do { \
- (e).e32[0] = 0; \
- (e).e32[1] = htonl(l); \
- } while (0)
-#define eui64_setlo32(e, l) eui64_set32(e, l)
-
-char *eui64_ntoa __P((eui64_t)); /* Returns ascii representation of id */
-
-#endif /* __EUI64_H__ */
-
diff --git a/pppd_plugin/src/pppd/fsm.h b/pppd_plugin/src/pppd/fsm.h
deleted file mode 100644
index 87a78d3..0000000
--- a/pppd_plugin/src/pppd/fsm.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * fsm.h - {Link, IP} Control Protocol Finite State Machine definitions.
- *
- * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name "Carnegie Mellon University" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For permission or any legal
- * details, please contact
- * Office of Technology Transfer
- * Carnegie Mellon University
- * 5000 Forbes Avenue
- * Pittsburgh, PA 15213-3890
- * (412) 268-4387, fax: (412) 268-7395
- * tech-transfer@andrew.cmu.edu
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Computing Services
- * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
- *
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: fsm.h,v 1.10 2004/11/13 02:28:15 paulus Exp $
- */
-
-/*
- * Packet header = Code, id, length.
- */
-#define HEADERLEN 4
-
-
-/*
- * 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 */
-
-
-/*
- * Each FSM is described by an fsm structure and fsm callbacks.
- */
-typedef struct fsm {
- int unit; /* Interface unit number */
- int protocol; /* Data Link Layer Protocol field value */
- int state; /* State */
- int flags; /* Contains option bits */
- u_char id; /* Current id */
- u_char reqid; /* Current request id */
- u_char seen_ack; /* Have received valid Ack/Nak/Rej to Req */
- int timeouttime; /* Timeout time in milliseconds */
- int maxconfreqtransmits; /* Maximum Configure-Request transmissions */
- int retransmits; /* Number of retransmissions left */
- int maxtermtransmits; /* Maximum Terminate-Request transmissions */
- int nakloops; /* Number of nak loops since last ack */
- int rnakloops; /* Number of naks received */
- int maxnakloops; /* Maximum number of nak loops tolerated */
- struct fsm_callbacks *callbacks; /* Callback routines */
- char *term_reason; /* Reason for closing protocol */
- int term_reason_len; /* Length of term_reason */
-} fsm;
-
-
-typedef struct fsm_callbacks {
- void (*resetci) /* Reset our Configuration Information */
- __P((fsm *));
- int (*cilen) /* Length of our Configuration Information */
- __P((fsm *));
- void (*addci) /* Add our Configuration Information */
- __P((fsm *, u_char *, int *));
- int (*ackci) /* ACK our Configuration Information */
- __P((fsm *, u_char *, int));
- int (*nakci) /* NAK our Configuration Information */
- __P((fsm *, u_char *, int, int));
- int (*rejci) /* Reject our Configuration Information */
- __P((fsm *, u_char *, int));
- int (*reqci) /* Request peer's Configuration Information */
- __P((fsm *, u_char *, int *, int));
- void (*up) /* Called when fsm reaches OPENED state */
- __P((fsm *));
- void (*down) /* Called when fsm leaves OPENED state */
- __P((fsm *));
- void (*starting) /* Called when we want the lower layer */
- __P((fsm *));
- void (*finished) /* Called when we don't want the lower layer */
- __P((fsm *));
- void (*protreject) /* Called when Protocol-Reject received */
- __P((int));
- void (*retransmit) /* Retransmission is necessary */
- __P((fsm *));
- int (*extcode) /* Called when unknown code received */
- __P((fsm *, int, int, u_char *, int));
- char *proto_name; /* String name for protocol (for messages) */
-} fsm_callbacks;
-
-
-/*
- * Link states.
- */
-#define INITIAL 0 /* Down, hasn't been opened */
-#define STARTING 1 /* Down, been opened */
-#define CLOSED 2 /* Up, hasn't been opened */
-#define STOPPED 3 /* Open, waiting for down event */
-#define CLOSING 4 /* Terminating the connection, not open */
-#define STOPPING 5 /* Terminating, but open */
-#define REQSENT 6 /* We've sent a Config Request */
-#define ACKRCVD 7 /* We've received a Config Ack */
-#define ACKSENT 8 /* We've sent a Config Ack */
-#define OPENED 9 /* Connection available */
-
-
-/*
- * Flags - indicate options controlling FSM operation
- */
-#define OPT_PASSIVE 1 /* Don't die if we don't get a response */
-#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */
-#define OPT_SILENT 4 /* Wait for peer to speak first */
-
-
-/*
- * Timeouts.
- */
-#define DEFTIMEOUT 3 /* Timeout time in seconds */
-#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */
-#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */
-#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */
-
-
-/*
- * Prototypes
- */
-void fsm_init __P((fsm *));
-void fsm_lowerup __P((fsm *));
-void fsm_lowerdown __P((fsm *));
-void fsm_open __P((fsm *));
-void fsm_close __P((fsm *, char *));
-void fsm_input __P((fsm *, u_char *, int));
-void fsm_protreject __P((fsm *));
-void fsm_sdata __P((fsm *, int, int, u_char *, int));
-
-
-/*
- * Variables
- */
-extern int peer_mru[]; /* currently negotiated peer MRU (per unit) */
diff --git a/pppd_plugin/src/pppd/ipcp.h b/pppd_plugin/src/pppd/ipcp.h
deleted file mode 100644
index 6cf14c9..0000000
--- a/pppd_plugin/src/pppd/ipcp.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * ipcp.h - IP Control Protocol definitions.
- *
- * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name "Carnegie Mellon University" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For permission or any legal
- * details, please contact
- * Office of Technology Transfer
- * Carnegie Mellon University
- * 5000 Forbes Avenue
- * Pittsburgh, PA 15213-3890
- * (412) 268-4387, fax: (412) 268-7395
- * tech-transfer@andrew.cmu.edu
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Computing Services
- * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
- *
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: ipcp.h,v 1.14 2002/12/04 23:03:32 paulus Exp $
- */
-
-/*
- * Options.
- */
-#define CI_ADDRS 1 /* IP Addresses */
-#define CI_COMPRESSTYPE 2 /* Compression Type */
-#define CI_ADDR 3
-
-#define CI_MS_DNS1 129 /* Primary DNS value */
-#define CI_MS_WINS1 130 /* Primary WINS value */
-#define CI_MS_DNS2 131 /* Secondary DNS value */
-#define CI_MS_WINS2 132 /* Secondary WINS value */
-
-#define MAX_STATES 16 /* from slcompress.h */
-
-#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */
-#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */
-#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */
- /* maxslot and slot number compression) */
-
-#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/
-#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */
- /* compression option*/
-
-typedef struct ipcp_options {
- bool neg_addr; /* Negotiate IP Address? */
- bool old_addrs; /* Use old (IP-Addresses) option? */
- bool req_addr; /* Ask peer to send IP address? */
- bool default_route; /* Assign default route through interface? */
- bool proxy_arp; /* Make proxy ARP entry for peer? */
- bool neg_vj; /* Van Jacobson Compression? */
- bool old_vj; /* use old (short) form of VJ option? */
- bool accept_local; /* accept peer's value for ouraddr */
- bool accept_remote; /* accept peer's value for hisaddr */
- bool req_dns1; /* Ask peer to send primary DNS address? */
- bool req_dns2; /* Ask peer to send secondary DNS address? */
- int vj_protocol; /* protocol value to use in VJ option */
- int maxslotindex; /* values for RFC1332 VJ compression neg. */
- bool cflag;
- u_int32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
- u_int32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
- u_int32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
-} ipcp_options;
-
-extern fsm ipcp_fsm[];
-extern ipcp_options ipcp_wantoptions[];
-extern ipcp_options ipcp_gotoptions[];
-extern ipcp_options ipcp_allowoptions[];
-extern ipcp_options ipcp_hisoptions[];
-
-char *ip_ntoa __P((u_int32_t));
-
-extern struct protent ipcp_protent;
diff --git a/pppd_plugin/src/pppd/ipv6cp.h b/pppd_plugin/src/pppd/ipv6cp.h
deleted file mode 100644
index cc4568d..0000000
--- a/pppd_plugin/src/pppd/ipv6cp.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * ipv6cp.h - PPP IPV6 Control Protocol.
- *
- * Copyright (c) 1999 Tommi Komulainen. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name(s) of the authors of this software must not be used to
- * endorse or promote products derived from this software without
- * prior written permission.
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Tommi Komulainen
- * <Tommi.Komulainen@iki.fi>".
- *
- * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/* Original version, based on RFC2023 :
-
- Copyright (c) 1995, 1996, 1997 Francis.Dupont@inria.fr, INRIA Rocquencourt,
- Alain.Durand@imag.fr, IMAG,
- Jean-Luc.Richier@imag.fr, IMAG-LSR.
-
- Copyright (c) 1998, 1999 Francis.Dupont@inria.fr, GIE DYADE,
- Alain.Durand@imag.fr, IMAG,
- Jean-Luc.Richier@imag.fr, IMAG-LSR.
-
- Ce travail a été fait au sein du GIE DYADE (Groupement d'Intérêt
- Économique ayant pour membres BULL S.A. et l'INRIA).
-
- Ce logiciel informatique est disponible aux conditions
- usuelles dans la recherche, c'est-à-dire qu'il peut
- être utilisé, copié, modifié, distribué à l'unique
- condition que ce texte soit conservé afin que
- l'origine de ce logiciel soit reconnue.
-
- Le nom de l'Institut National de Recherche en Informatique
- et en Automatique (INRIA), de l'IMAG, ou d'une personne morale
- ou physique ayant participé à l'élaboration de ce logiciel ne peut
- être utilisé sans son accord préalable explicite.
-
- Ce logiciel est fourni tel quel sans aucune garantie,
- support ou responsabilité d'aucune sorte.
- Ce logiciel est dérivé de sources d'origine
- "University of California at Berkeley" et
- "Digital Equipment Corporation" couvertes par des copyrights.
-
- L'Institut d'Informatique et de Mathématiques Appliquées de Grenoble (IMAG)
- est une fédération d'unités mixtes de recherche du CNRS, de l'Institut National
- Polytechnique de Grenoble et de l'Université Joseph Fourier regroupant
- sept laboratoires dont le laboratoire Logiciels, Systèmes, Réseaux (LSR).
-
- This work has been done in the context of GIE DYADE (joint R & D venture
- between BULL S.A. and INRIA).
-
- This software is available with usual "research" terms
- with the aim of retain credits of the software.
- Permission to use, copy, modify and distribute this software for any
- purpose and without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies,
- and the name of INRIA, IMAG, or any contributor not be used in advertising
- or publicity pertaining to this material without the prior explicit
- permission. The software is provided "as is" without any
- warranties, support or liabilities of any kind.
- This software is derived from source code from
- "University of California at Berkeley" and
- "Digital Equipment Corporation" protected by copyrights.
-
- Grenoble's Institute of Computer Science and Applied Mathematics (IMAG)
- is a federation of seven research units funded by the CNRS, National
- Polytechnic Institute of Grenoble and University Joseph Fourier.
- The research unit in Software, Systems, Networks (LSR) is member of IMAG.
-*/
-
-/*
- * Derived from :
- *
- *
- * ipcp.h - IP Control Protocol definitions.
- *
- * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name "Carnegie Mellon University" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For permission or any legal
- * details, please contact
- * Office of Technology Transfer
- * Carnegie Mellon University
- * 5000 Forbes Avenue
- * Pittsburgh, PA 15213-3890
- * (412) 268-4387, fax: (412) 268-7395
- * tech-transfer@andrew.cmu.edu
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Computing Services
- * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
- *
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: ipv6cp.h,v 1.7 2002/12/04 23:03:32 paulus Exp $
- */
-
-/*
- * Options.
- */
-#define CI_IFACEID 1 /* Interface Identifier */
-#define CI_COMPRESSTYPE 2 /* Compression Type */
-
-/* No compression types yet defined.
- *#define IPV6CP_COMP 0x004f
- */
-typedef struct ipv6cp_options {
- int neg_ifaceid; /* Negotiate interface identifier? */
- int req_ifaceid; /* Ask peer to send interface identifier? */
- int accept_local; /* accept peer's value for iface id? */
- int opt_local; /* ourtoken set by option */
- int opt_remote; /* histoken set by option */
- int use_ip; /* use IP as interface identifier */
-#if defined(SOL2) || defined(__linux__)
- int use_persistent; /* use uniquely persistent value for address */
-#endif /* defined(SOL2) */
- int neg_vj; /* Van Jacobson Compression? */
- u_short vj_protocol; /* protocol value to use in VJ option */
- eui64_t ourid, hisid; /* Interface identifiers */
-} ipv6cp_options;
-
-extern fsm ipv6cp_fsm[];
-extern ipv6cp_options ipv6cp_wantoptions[];
-extern ipv6cp_options ipv6cp_gotoptions[];
-extern ipv6cp_options ipv6cp_allowoptions[];
-extern ipv6cp_options ipv6cp_hisoptions[];
-
-extern struct protent ipv6cp_protent;
diff --git a/pppd_plugin/src/pppd/ipxcp.h b/pppd_plugin/src/pppd/ipxcp.h
deleted file mode 100644
index 396b6bb..0000000
--- a/pppd_plugin/src/pppd/ipxcp.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * ipxcp.h - IPX Control Protocol definitions.
- *
- * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name "Carnegie Mellon University" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For permission or any legal
- * details, please contact
- * Office of Technology Transfer
- * Carnegie Mellon University
- * 5000 Forbes Avenue
- * Pittsburgh, PA 15213-3890
- * (412) 268-4387, fax: (412) 268-7395
- * tech-transfer@andrew.cmu.edu
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Computing Services
- * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
- *
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: ipxcp.h,v 1.5 2002/12/04 23:03:32 paulus Exp $
- */
-
-/*
- * Options.
- */
-#define IPX_NETWORK_NUMBER 1 /* IPX Network Number */
-#define IPX_NODE_NUMBER 2
-#define IPX_COMPRESSION_PROTOCOL 3
-#define IPX_ROUTER_PROTOCOL 4
-#define IPX_ROUTER_NAME 5
-#define IPX_COMPLETE 6
-
-/* Values for the router protocol */
-#define IPX_NONE 0
-#define RIP_SAP 2
-#define NLSP 4
-
-typedef struct ipxcp_options {
- bool neg_node; /* Negotiate IPX node number? */
- bool req_node; /* Ask peer to send IPX node number? */
-
- bool neg_nn; /* Negotiate IPX network number? */
- bool req_nn; /* Ask peer to send IPX network number */
-
- bool neg_name; /* Negotiate IPX router name */
- bool neg_complete; /* Negotiate completion */
- bool neg_router; /* Negotiate IPX router number */
-
- bool accept_local; /* accept peer's value for ournode */
- bool accept_remote; /* accept peer's value for hisnode */
- bool accept_network; /* accept network number */
-
- bool tried_nlsp; /* I have suggested NLSP already */
- bool tried_rip; /* I have suggested RIP/SAP already */
-
- u_int32_t his_network; /* base network number */
- u_int32_t our_network; /* our value for network number */
- u_int32_t network; /* the final network number */
-
- u_char his_node[6]; /* peer's node number */
- u_char our_node[6]; /* our node number */
- u_char name [48]; /* name of the router */
- int router; /* routing protocol */
-} ipxcp_options;
-
-extern fsm ipxcp_fsm[];
-extern ipxcp_options ipxcp_wantoptions[];
-extern ipxcp_options ipxcp_gotoptions[];
-extern ipxcp_options ipxcp_allowoptions[];
-extern ipxcp_options ipxcp_hisoptions[];
-
-extern struct protent ipxcp_protent;
diff --git a/pppd_plugin/src/pppd/lcp.h b/pppd_plugin/src/pppd/lcp.h
deleted file mode 100644
index 23f3c84..0000000
--- a/pppd_plugin/src/pppd/lcp.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * lcp.h - Link Control Protocol definitions.
- *
- * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name "Carnegie Mellon University" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For permission or any legal
- * details, please contact
- * Office of Technology Transfer
- * Carnegie Mellon University
- * 5000 Forbes Avenue
- * Pittsburgh, PA 15213-3890
- * (412) 268-4387, fax: (412) 268-7395
- * tech-transfer@andrew.cmu.edu
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Computing Services
- * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
- *
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: lcp.h,v 1.19 2002/12/04 23:03:32 paulus Exp $
- */
-
-/*
- * Options.
- */
-#define CI_MRU 1 /* Maximum Receive Unit */
-#define CI_ASYNCMAP 2 /* Async Control Character Map */
-#define CI_AUTHTYPE 3 /* Authentication Type */
-#define CI_QUALITY 4 /* Quality Protocol */
-#define CI_MAGICNUMBER 5 /* Magic Number */
-#define CI_PCOMPRESSION 7 /* Protocol Field Compression */
-#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
-#define CI_CALLBACK 13 /* callback */
-#define CI_MRRU 17 /* max reconstructed receive unit; multilink */
-#define CI_SSNHF 18 /* short sequence numbers for multilink */
-#define CI_EPDISC 19 /* endpoint discriminator */
-
-/*
- * LCP-specific packet types.
- */
-#define PROTREJ 8 /* Protocol Reject */
-#define ECHOREQ 9 /* Echo Request */
-#define ECHOREP 10 /* Echo Reply */
-#define DISCREQ 11 /* Discard Request */
-#define CBCP_OPT 6 /* Use callback control protocol */
-
-/*
- * The state of options is described by an lcp_options structure.
- */
-typedef struct lcp_options {
- bool passive; /* Don't die if we don't get a response */
- bool silent; /* Wait for the other end to start first */
- bool restart; /* Restart vs. exit after close */
- bool neg_mru; /* Negotiate the MRU? */
- bool neg_asyncmap; /* Negotiate the async map? */
- bool neg_upap; /* Ask for UPAP authentication? */
- bool neg_chap; /* Ask for CHAP authentication? */
- bool neg_eap; /* Ask for EAP authentication? */
- bool neg_magicnumber; /* Ask for magic number? */
- bool neg_pcompression; /* HDLC Protocol Field Compression? */
- bool neg_accompression; /* HDLC Address/Control Field Compression? */
- bool neg_lqr; /* Negotiate use of Link Quality Reports */
- bool neg_cbcp; /* Negotiate use of CBCP */
- bool neg_mrru; /* negotiate multilink MRRU */
- bool neg_ssnhf; /* negotiate short sequence numbers */
- bool neg_endpoint; /* negotiate endpoint discriminator */
- int mru; /* Value of MRU */
- int mrru; /* Value of MRRU, and multilink enable */
- u_char chap_mdtype; /* which MD types (hashing algorithm) */
- u_int32_t asyncmap; /* Value of async map */
- u_int32_t magicnumber;
- int numloops; /* Number of loops during magic number neg. */
- u_int32_t lqr_period; /* Reporting period for LQR 1/100ths second */
- struct epdisc endpoint; /* endpoint discriminator */
-} lcp_options;
-
-extern fsm lcp_fsm[];
-extern lcp_options lcp_wantoptions[];
-extern lcp_options lcp_gotoptions[];
-extern lcp_options lcp_allowoptions[];
-extern lcp_options lcp_hisoptions[];
-
-#define DEFMRU 1500 /* Try for this */
-#define MINMRU 128 /* No MRUs below this */
-#define MAXMRU 16384 /* Normally limit MRU to this */
-
-void lcp_open __P((int));
-void lcp_close __P((int, char *));
-void lcp_lowerup __P((int));
-void lcp_lowerdown __P((int));
-void lcp_sprotrej __P((int, u_char *, int)); /* send protocol reject */
-
-extern struct protent lcp_protent;
-
-/* Default number of times we receive our magic number from the peer
- before deciding the link is looped-back. */
-#define DEFLOOPBACKFAIL 10
diff --git a/pppd_plugin/src/pppd/magic.h b/pppd_plugin/src/pppd/magic.h
deleted file mode 100644
index c81213b..0000000
--- a/pppd_plugin/src/pppd/magic.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * magic.h - PPP Magic Number definitions.
- *
- * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name "Carnegie Mellon University" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For permission or any legal
- * details, please contact
- * Office of Technology Transfer
- * Carnegie Mellon University
- * 5000 Forbes Avenue
- * Pittsburgh, PA 15213-3890
- * (412) 268-4387, fax: (412) 268-7395
- * tech-transfer@andrew.cmu.edu
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Computing Services
- * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
- *
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
- */
-
-void magic_init __P((void)); /* Initialize the magic number generator */
-u_int32_t magic __P((void)); /* Returns the next magic number */
-
-/* Fill buffer with random bytes */
-void random_bytes __P((unsigned char *buf, int len));
diff --git a/pppd_plugin/src/pppd/md4.h b/pppd_plugin/src/pppd/md4.h
deleted file mode 100644
index 80e8f9a..0000000
--- a/pppd_plugin/src/pppd/md4.h
+++ /dev/null
@@ -1,64 +0,0 @@
-
-/*
-** ********************************************************************
-** md4.h -- Header file for implementation of **
-** MD4 Message Digest Algorithm **
-** Updated: 2/13/90 by Ronald L. Rivest **
-** (C) 1990 RSA Data Security, Inc. **
-** ********************************************************************
-*/
-
-#ifndef __P
-# if defined(__STDC__) || defined(__GNUC__)
-# define __P(x) x
-# else
-# define __P(x) ()
-# endif
-#endif
-
-
-/* MDstruct is the data structure for a message digest computation.
-*/
-typedef struct {
- unsigned int buffer[4]; /* Holds 4-word result of MD computation */
- unsigned char count[8]; /* Number of bits processed so far */
- unsigned int done; /* Nonzero means MD computation finished */
-} MD4_CTX;
-
-/* MD4Init(MD4_CTX *)
-** Initialize the MD4_CTX prepatory to doing a message digest
-** computation.
-*/
-extern void MD4Init __P((MD4_CTX *MD));
-
-/* MD4Update(MD,X,count)
-** Input: X -- a pointer to an array of unsigned characters.
-** count -- the number of bits of X to use (an unsigned int).
-** Updates MD using the first "count" bits of X.
-** The array pointed to by X is not modified.
-** If count is not a multiple of 8, MD4Update uses high bits of
-** last byte.
-** This is the basic input routine for a user.
-** The routine terminates the MD computation when count < 512, so
-** every MD computation should end with one call to MD4Update with a
-** count less than 512. Zero is OK for a count.
-*/
-extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count));
-
-/* MD4Print(MD)
-** Prints message digest buffer MD as 32 hexadecimal digits.
-** Order is from low-order byte of buffer[0] to high-order byte
-** of buffer[3].
-** Each byte is printed with high-order hexadecimal digit first.
-*/
-extern void MD4Print __P((MD4_CTX *));
-
-/* MD4Final(buf, MD)
-** Returns message digest from MD and terminates the message
-** digest computation.
-*/
-extern void MD4Final __P((unsigned char *, MD4_CTX *));
-
-/*
-** End of md4.h
-****************************(cut)***********************************/
diff --git a/pppd_plugin/src/pppd/md5.h b/pppd_plugin/src/pppd/md5.h
deleted file mode 100644
index f7a0c96..0000000
--- a/pppd_plugin/src/pppd/md5.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- ***********************************************************************
- ** md5.h -- header file for implementation of MD5 **
- ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
- ** Created: 2/17/90 RLR **
- ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
- ** Revised (for MD5): RLR 4/27/91 **
- ** -- G modified to have y&~z instead of y&z **
- ** -- FF, GG, HH modified to add in last register done **
- ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
- ** -- distinct additive constant for each step **
- ** -- round 4 added, working mod 7 **
- ***********************************************************************
- */
-
-/*
- ***********************************************************************
- ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
- ** **
- ** License to copy and use this software is granted provided that **
- ** it is identified as the "RSA Data Security, Inc. MD5 Message- **
- ** Digest Algorithm" in all material mentioning or referencing this **
- ** software or this function. **
- ** **
- ** License is also granted to make and use derivative works **
- ** provided that such works are identified as "derived from the RSA **
- ** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
- ** material mentioning or referencing the derived work. **
- ** **
- ** RSA Data Security, Inc. makes no representations concerning **
- ** either the merchantability of this software or the suitability **
- ** of this software for any particular purpose. It is provided "as **
- ** is" without express or implied warranty of any kind. **
- ** **
- ** These notices must be retained in any copies of any part of this **
- ** documentation and/or software. **
- ***********************************************************************
- */
-
-#ifndef __MD5_INCLUDE__
-
-/* typedef a 32-bit type */
-#ifdef _LP64
-typedef unsigned int UINT4;
-typedef int INT4;
-#else
-typedef unsigned long UINT4;
-typedef long INT4;
-#endif
-#define _UINT4_T
-
-/* Data structure for MD5 (Message-Digest) computation */
-typedef struct {
- UINT4 i[2]; /* number of _bits_ handled mod 2^64 */
- UINT4 buf[4]; /* scratch buffer */
- unsigned char in[64]; /* input buffer */
- unsigned char digest[16]; /* actual digest after MD5Final call */
-} MD5_CTX;
-
-void MD5_Init ();
-void MD5_Update ();
-void MD5_Final ();
-
-#define __MD5_INCLUDE__
-#endif /* __MD5_INCLUDE__ */
diff --git a/pppd_plugin/src/pppd/pathnames.h b/pppd_plugin/src/pppd/pathnames.h
deleted file mode 100644
index 555f40f..0000000
--- a/pppd_plugin/src/pppd/pathnames.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * define path names
- *
- * $Id: pathnames.h,v 1.16 2004/11/13 12:02:22 paulus Exp $
- */
-
-#ifdef HAVE_PATHS_H
-#include <paths.h>
-
-#else /* HAVE_PATHS_H */
-#ifndef _PATH_VARRUN
-#define _PATH_VARRUN "/etc/ppp/"
-#endif
-#define _PATH_DEVNULL "/dev/null"
-#endif /* HAVE_PATHS_H */
-
-#ifndef _ROOT_PATH
-#define _ROOT_PATH
-#endif
-
-#define _PATH_UPAPFILE _ROOT_PATH "/etc/ppp/pap-secrets"
-#define _PATH_CHAPFILE _ROOT_PATH "/etc/ppp/chap-secrets"
-#define _PATH_SRPFILE _ROOT_PATH "/etc/ppp/srp-secrets"
-#define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options"
-#define _PATH_IPUP _ROOT_PATH "/etc/ppp/ip-up"
-#define _PATH_IPDOWN _ROOT_PATH "/etc/ppp/ip-down"
-#define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up"
-#define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down"
-#define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options."
-#define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors"
-#define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/"
-#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf"
-
-#define _PATH_USEROPT ".ppprc"
-#define _PATH_PSEUDONYM ".ppp_pseudonym"
-
-#ifdef INET6
-#define _PATH_IPV6UP _ROOT_PATH "/etc/ppp/ipv6-up"
-#define _PATH_IPV6DOWN _ROOT_PATH "/etc/ppp/ipv6-down"
-#endif
-
-#ifdef IPX_CHANGE
-#define _PATH_IPXUP _ROOT_PATH "/etc/ppp/ipx-up"
-#define _PATH_IPXDOWN _ROOT_PATH "/etc/ppp/ipx-down"
-#endif /* IPX_CHANGE */
-
-#ifdef __STDC__
-#define _PATH_PPPDB _ROOT_PATH _PATH_VARRUN "pppd2.tdb"
-#else /* __STDC__ */
-#ifdef HAVE_PATHS_H
-#define _PATH_PPPDB "/var/run/pppd2.tdb"
-#else
-#define _PATH_PPPDB "/etc/ppp/pppd2.tdb"
-#endif
-#endif /* __STDC__ */
-
-#ifdef PLUGIN
-#define _PATH_PLUGIN "/usr/lib/pppd/" VERSION
-#endif /* PLUGIN */
diff --git a/pppd_plugin/src/pppd/pppcrypt.h b/pppd_plugin/src/pppd/pppcrypt.h
deleted file mode 100644
index adcdcbc..0000000
--- a/pppd_plugin/src/pppd/pppcrypt.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1
- *
- * Extracted from chap_ms.c by James Carlson.
- *
- * Copyright (c) 1995 Eric Rosenquist. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name(s) of the authors of this software must not be used to
- * endorse or promote products derived from this software without
- * prior written permission.
- *
- * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef PPPCRYPT_H
-#define PPPCRYPT_H
-
-#ifdef HAVE_CRYPT_H
-#include <crypt.h>
-#endif
-
-#ifndef USE_CRYPT
-#include <des.h>
-#endif
-
-extern bool DesSetkey __P((u_char *));
-extern bool DesEncrypt __P((u_char *, u_char *));
-extern bool DesDecrypt __P((u_char *, u_char *));
-
-#endif /* PPPCRYPT_H */
diff --git a/pppd_plugin/src/pppd/pppd.h b/pppd_plugin/src/pppd/pppd.h
deleted file mode 100644
index 8866bc7..0000000
--- a/pppd_plugin/src/pppd/pppd.h
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- * pppd.h - PPP daemon global declarations.
- *
- * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name "Carnegie Mellon University" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For permission or any legal
- * details, please contact
- * Office of Technology Transfer
- * Carnegie Mellon University
- * 5000 Forbes Avenue
- * Pittsburgh, PA 15213-3890
- * (412) 268-4387, fax: (412) 268-7395
- * tech-transfer@andrew.cmu.edu
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Computing Services
- * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
- *
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: pppd.h,v 1.88 2004/11/13 12:02:22 paulus Exp $
- */
-
-/*
- * TODO:
- */
-
-#ifndef __PPPD_H__
-#define __PPPD_H__
-
-#include <stdio.h> /* for FILE */
-#include <limits.h> /* for NGROUPS_MAX */
-#include <sys/param.h> /* for MAXPATHLEN and BSD4_4, if defined */
-#include <sys/types.h> /* for u_int32_t, if defined */
-#include <sys/time.h> /* for struct timeval */
-#include <net/ppp_defs.h>
-
-#if defined(__STDC__)
-#include <stdarg.h>
-#define __V(x) x
-#else
-#include <varargs.h>
-#define __V(x) (va_alist) va_dcl
-#define const
-#define volatile
-#endif
-
-#ifdef INET6
-#include "eui64.h"
-#endif
-
-/*
- * Limits.
- */
-
-#define NUM_PPP 1 /* One PPP interface supported (per process) */
-#define MAXWORDLEN 1024 /* max length of word in file (incl null) */
-#define MAXARGS 1 /* max # args to a command */
-#define MAXNAMELEN 256 /* max length of hostname or name for auth */
-#define MAXSECRETLEN 256 /* max length of password or secret */
-
-/*
- * Option descriptor structure.
- */
-
-typedef unsigned char bool;
-
-enum opt_type {
- o_special_noarg = 0,
- o_special = 1,
- o_bool,
- o_int,
- o_uint32,
- o_string,
- o_wild
-};
-
-typedef struct {
- char *name; /* name of the option */
- enum opt_type type;
- void *addr;
- char *description;
- unsigned int flags;
- void *addr2;
- int upper_limit;
- int lower_limit;
- const char *source;
- short int priority;
- short int winner;
-} option_t;
-
-/* Values for flags */
-#define OPT_VALUE 0xff /* mask for presupplied value */
-#define OPT_HEX 0x100 /* int option is in hex */
-#define OPT_NOARG 0x200 /* option doesn't take argument */
-#define OPT_OR 0x400 /* OR in argument to value */
-#define OPT_INC 0x800 /* increment value */
-#define OPT_A2OR 0x800 /* for o_bool, OR arg to *(u_char *)addr2 */
-#define OPT_PRIV 0x1000 /* privileged option */
-#define OPT_STATIC 0x2000 /* string option goes into static array */
-#define OPT_LLIMIT 0x4000 /* check value against lower limit */
-#define OPT_ULIMIT 0x8000 /* check value against upper limit */
-#define OPT_LIMITS (OPT_LLIMIT|OPT_ULIMIT)
-#define OPT_ZEROOK 0x10000 /* 0 value is OK even if not within limits */
-#define OPT_HIDE 0x10000 /* for o_string, print value as ?????? */
-#define OPT_A2LIST 0x10000 /* for o_special, keep list of values */
-#define OPT_A2CLRB 0x10000 /* o_bool, clr val bits in *(u_char *)addr2 */
-#define OPT_NOINCR 0x20000 /* value mustn't be increased */
-#define OPT_ZEROINF 0x40000 /* with OPT_NOINCR, 0 == infinity */
-#define OPT_PRIO 0x80000 /* process option priorities for this option */
-#define OPT_PRIOSUB 0x100000 /* subsidiary member of priority group */
-#define OPT_ALIAS 0x200000 /* option is alias for previous option */
-#define OPT_A2COPY 0x400000 /* addr2 -> second location to rcv value */
-#define OPT_ENABLE 0x800000 /* use *addr2 as enable for option */
-#define OPT_A2CLR 0x1000000 /* clear *(bool *)addr2 */
-#define OPT_PRIVFIX 0x2000000 /* user can't override if set by root */
-#define OPT_INITONLY 0x4000000 /* option can only be set in init phase */
-#define OPT_DEVEQUIV 0x8000000 /* equiv to device name */
-#define OPT_DEVNAM (OPT_INITONLY | OPT_DEVEQUIV)
-#define OPT_A2PRINTER 0x10000000 /* *addr2 is a fn for printing option */
-#define OPT_A2STRVAL 0x20000000 /* *addr2 points to current string value */
-#define OPT_NOPRINT 0x40000000 /* don't print this option at all */
-
-#define OPT_VAL(x) ((x) & OPT_VALUE)
-
-/* Values for priority */
-#define OPRIO_DEFAULT 0 /* a default value */
-#define OPRIO_CFGFILE 1 /* value from a configuration file */
-#define OPRIO_CMDLINE 2 /* value from the command line */
-#define OPRIO_SECFILE 3 /* value from options in a secrets file */
-#define OPRIO_ROOT 100 /* added to priority if OPT_PRIVFIX && root */
-
-#ifndef GIDSET_TYPE
-#define GIDSET_TYPE gid_t
-#endif
-
-/* Structure representing a list of permitted IP addresses. */
-struct permitted_ip {
- int permit; /* 1 = permit, 0 = forbid */
- u_int32_t base; /* match if (addr & mask) == base */
- u_int32_t mask; /* base and mask are in network byte order */
-};
-
-/*
- * Unfortunately, the linux kernel driver uses a different structure
- * for statistics from the rest of the ports.
- * This structure serves as a common representation for the bits
- * pppd needs.
- */
-struct pppd_stats {
- unsigned int bytes_in;
- unsigned int bytes_out;
- unsigned int pkts_in;
- unsigned int pkts_out;
-};
-
-/* Used for storing a sequence of words. Usually malloced. */
-struct wordlist {
- struct wordlist *next;
- char *word;
-};
-
-/* An endpoint discriminator, used with multilink. */
-#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */
-struct epdisc {
- unsigned char class;
- unsigned char length;
- unsigned char value[MAX_ENDP_LEN];
-};
-
-/* values for epdisc.class */
-#define EPD_NULL 0 /* null discriminator, no data */
-#define EPD_LOCAL 1
-#define EPD_IP 2
-#define EPD_MAC 3
-#define EPD_MAGIC 4
-#define EPD_PHONENUM 5
-
-typedef void (*notify_func) __P((void *, int));
-
-struct notifier {
- struct notifier *next;
- notify_func func;
- void *arg;
-};
-
-/*
- * Global variables.
- */
-
-extern int hungup; /* Physical layer has disconnected */
-extern int ifunit; /* Interface unit number */
-extern char ifname[]; /* Interface name */
-extern char hostname[]; /* Our hostname */
-extern u_char outpacket_buf[]; /* Buffer for outgoing packets */
-extern int devfd; /* fd of underlying device */
-extern int fd_ppp; /* fd for talking PPP */
-extern int phase; /* Current state of link - see values below */
-extern int baud_rate; /* Current link speed in bits/sec */
-extern char *progname; /* Name of this program */
-extern int redirect_stderr;/* Connector's stderr should go to file */
-extern char peer_authname[];/* Authenticated name of peer */
-extern int auth_done[NUM_PPP]; /* Methods actually used for auth */
-extern int privileged; /* We were run by real-uid root */
-extern int need_holdoff; /* Need holdoff period after link terminates */
-extern char **script_env; /* Environment variables for scripts */
-extern int detached; /* Have detached from controlling tty */
-extern GIDSET_TYPE groups[NGROUPS_MAX]; /* groups the user is in */
-extern int ngroups; /* How many groups valid in groups */
-extern struct pppd_stats link_stats; /* byte/packet counts etc. for link */
-extern int link_stats_valid; /* set if link_stats is valid */
-extern unsigned link_connect_time; /* time the link was up for */
-extern int using_pty; /* using pty as device (notty or pty opt.) */
-extern int log_to_fd; /* logging to this fd as well as syslog */
-extern bool log_default; /* log_to_fd is default (stdout) */
-extern char *no_ppp_msg; /* message to print if ppp not in kernel */
-extern volatile int status; /* exit status for pppd */
-extern bool devnam_fixed; /* can no longer change devnam */
-extern int unsuccess; /* # unsuccessful connection attempts */
-extern int do_callback; /* set if we want to do callback next */
-extern int doing_callback; /* set if this is a callback */
-extern int error_count; /* # of times error() has been called */
-extern char ppp_devnam[MAXPATHLEN];
-extern char remote_number[MAXNAMELEN]; /* Remote telephone number, if avail. */
-extern int ppp_session_number; /* Session number (eg PPPoE session) */
-extern int fd_devnull; /* fd open to /dev/null */
-
-extern int listen_time; /* time to listen first (ms) */
-extern bool doing_multilink;
-extern bool multilink_master;
-extern bool bundle_eof;
-extern bool bundle_terminating;
-
-extern struct notifier *pidchange; /* for notifications of pid changing */
-extern struct notifier *phasechange; /* for notifications of phase changes */
-extern struct notifier *exitnotify; /* for notification that we're exiting */
-extern struct notifier *sigreceived; /* notification of received signal */
-extern struct notifier *ip_up_notifier; /* IPCP has come up */
-extern struct notifier *ip_down_notifier; /* IPCP has gone down */
-extern struct notifier *auth_up_notifier; /* peer has authenticated */
-extern struct notifier *link_down_notifier; /* link has gone down */
-extern struct notifier *fork_notifier; /* we are a new child process */
-
-/* Values for do_callback and doing_callback */
-#define CALLBACK_DIALIN 1 /* we are expecting the call back */
-#define CALLBACK_DIALOUT 2 /* we are dialling out to call back */
-
-/*
- * Variables set by command-line options.
- */
-
-extern int debug; /* Debug flag */
-extern int kdebugflag; /* Tell kernel to print debug messages */
-extern int default_device; /* Using /dev/tty or equivalent */
-extern char devnam[MAXPATHLEN]; /* Device name */
-extern int crtscts; /* Use hardware flow control */
-extern bool modem; /* Use modem control lines */
-extern int inspeed; /* Input/Output speed requested */
-extern u_int32_t netmask; /* IP netmask to set on interface */
-extern bool lockflag; /* Create lock file to lock the serial dev */
-extern bool nodetach; /* Don't detach from controlling tty */
-extern bool updetach; /* Detach from controlling tty when link up */
-extern char *initializer; /* Script to initialize physical link */
-extern char *connect_script; /* Script to establish physical link */
-extern char *disconnect_script; /* Script to disestablish physical link */
-extern char *welcomer; /* Script to welcome client after connection */
-extern char *ptycommand; /* Command to run on other side of pty */
-extern int maxconnect; /* Maximum connect time (seconds) */
-extern char user[MAXNAMELEN];/* Our name for authenticating ourselves */
-extern char passwd[MAXSECRETLEN]; /* Password for PAP or CHAP */
-extern bool auth_required; /* Peer is required to authenticate */
-extern bool persist; /* Reopen link after it goes down */
-extern bool uselogin; /* Use /etc/passwd for checking PAP */
-extern char our_name[MAXNAMELEN];/* Our name for authentication purposes */
-extern char remote_name[MAXNAMELEN]; /* Peer's name for authentication */
-extern bool explicit_remote;/* remote_name specified with remotename opt */
-extern bool demand; /* Do dial-on-demand */
-extern char *ipparam; /* Extra parameter for ip up/down scripts */
-extern bool cryptpap; /* Others' PAP passwords are encrypted */
-extern int idle_time_limit;/* Shut down link if idle for this long */
-extern int holdoff; /* Dead time before restarting */
-extern bool holdoff_specified; /* true if user gave a holdoff value */
-extern bool notty; /* Stdin/out is not a tty */
-extern char *pty_socket; /* Socket to connect to pty */
-extern char *record_file; /* File to record chars sent/received */
-extern bool sync_serial; /* Device is synchronous serial device */
-extern int maxfail; /* Max # of unsuccessful connection attempts */
-extern char linkname[MAXPATHLEN]; /* logical name for link */
-extern bool tune_kernel; /* May alter kernel settings as necessary */
-extern int connect_delay; /* Time to delay after connect script */
-extern int max_data_rate; /* max bytes/sec through charshunt */
-extern int req_unit; /* interface unit number to use */
-extern bool multilink; /* enable multilink operation */
-extern bool noendpoint; /* don't send or accept endpt. discrim. */
-extern char *bundle_name; /* bundle name for multilink */
-extern bool dump_options; /* print out option values */
-extern bool dryrun; /* check everything, print options, exit */
-extern int child_wait; /* # seconds to wait for children at end */
-
-#ifdef MAXOCTETS
-extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */
-extern int maxoctets_dir; /* Direction :
- 0 - in+out (default)
- 1 - in
- 2 - out
- 3 - max(in,out) */
-extern int maxoctets_timeout; /* Timeout for check of octets limit */
-#define PPP_OCTETS_DIRECTION_SUM 0
-#define PPP_OCTETS_DIRECTION_IN 1
-#define PPP_OCTETS_DIRECTION_OUT 2
-#define PPP_OCTETS_DIRECTION_MAXOVERAL 3
-/* same as previos, but little different on RADIUS side */
-#define PPP_OCTETS_DIRECTION_MAXSESSION 4
-#endif
-
-#ifdef PPP_FILTER
-extern struct bpf_program pass_filter; /* Filter for pkts to pass */
-extern struct bpf_program active_filter; /* Filter for link-active pkts */
-#endif
-
-#ifdef MSLANMAN
-extern bool ms_lanman; /* Use LanMan password instead of NT */
- /* Has meaning only with MS-CHAP challenges */
-#endif
-
-/* Values for auth_pending, auth_done */
-#define PAP_WITHPEER 0x1
-#define PAP_PEER 0x2
-#define CHAP_WITHPEER 0x4
-#define CHAP_PEER 0x8
-#define EAP_WITHPEER 0x10
-#define EAP_PEER 0x20
-
-/* Values for auth_done only */
-#define CHAP_MD5_WITHPEER 0x40
-#define CHAP_MD5_PEER 0x80
-#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */
-#define CHAP_MS_WITHPEER 0x100
-#define CHAP_MS_PEER 0x200
-#define CHAP_MS2_WITHPEER 0x400
-#define CHAP_MS2_PEER 0x800
-
-extern char *current_option; /* the name of the option being parsed */
-extern int privileged_option; /* set iff the current option came from root */
-extern char *option_source; /* string saying where the option came from */
-extern int option_priority; /* priority of current options */
-
-/*
- * Values for phase.
- */
-#define PHASE_DEAD 0
-#define PHASE_INITIALIZE 1
-#define PHASE_SERIALCONN 2
-#define PHASE_DORMANT 3
-#define PHASE_ESTABLISH 4
-#define PHASE_AUTHENTICATE 5
-#define PHASE_CALLBACK 6
-#define PHASE_NETWORK 7
-#define PHASE_RUNNING 8
-#define PHASE_TERMINATE 9
-#define PHASE_DISCONNECT 10
-#define PHASE_HOLDOFF 11
-#define PHASE_MASTER 12
-
-/*
- * The following struct gives the addresses of procedures to call
- * for a particular protocol.
- */
-struct protent {
- u_short protocol; /* PPP protocol number */
- /* Initialization procedure */
- void (*init) __P((int unit));
- /* Process a received packet */
- void (*input) __P((int unit, u_char *pkt, int len));
- /* Process a received protocol-reject */
- void (*protrej) __P((int unit));
- /* Lower layer has come up */
- void (*lowerup) __P((int unit));
- /* Lower layer has gone down */
- void (*lowerdown) __P((int unit));
- /* Open the protocol */
- void (*open) __P((int unit));
- /* Close the protocol */
- void (*close) __P((int unit, char *reason));
- /* Print a packet in readable form */
- int (*printpkt) __P((u_char *pkt, int len,
- void (*printer) __P((void *, char *, ...)),
- void *arg));
- /* Process a received data packet */
- void (*datainput) __P((int unit, u_char *pkt, int len));
- bool enabled_flag; /* 0 iff protocol is disabled */
- char *name; /* Text name of protocol */
- char *data_name; /* Text name of corresponding data protocol */
- option_t *options; /* List of command-line options */
- /* Check requested options, assign defaults */
- void (*check_options) __P((void));
- /* Configure interface for demand-dial */
- int (*demand_conf) __P((int unit));
- /* Say whether to bring up link for this pkt */
- int (*active_pkt) __P((u_char *pkt, int len));
-};
-
-/* Table of pointers to supported protocols */
-extern struct protent *protocols[];
-
-/*
- * This struct contains pointers to a set of procedures for
- * doing operations on a "channel". A channel provides a way
- * to send and receive PPP packets - the canonical example is
- * a serial port device in PPP line discipline (or equivalently
- * with PPP STREAMS modules pushed onto it).
- */
-struct channel {
- /* set of options for this channel */
- option_t *options;
- /* find and process a per-channel options file */
- void (*process_extra_options) __P((void));
- /* check all the options that have been given */
- void (*check_options) __P((void));
- /* get the channel ready to do PPP, return a file descriptor */
- int (*connect) __P((void));
- /* we're finished with the channel */
- void (*disconnect) __P((void));
- /* put the channel into PPP `mode' */
- int (*establish_ppp) __P((int));
- /* take the channel out of PPP `mode', restore loopback if demand */
- void (*disestablish_ppp) __P((int));
- /* set the transmit-side PPP parameters of the channel */
- void (*send_config) __P((int, u_int32_t, int, int));
- /* set the receive-side PPP parameters of the channel */
- void (*recv_config) __P((int, u_int32_t, int, int));
- /* cleanup on error or normal exit */
- void (*cleanup) __P((void));
- /* close the device, called in children after fork */
- void (*close) __P((void));
-};
-
-extern struct channel *the_channel;
-
-/*
- * Prototypes.
- */
-
-/* Procedures exported from main.c. */
-void set_ifunit __P((int)); /* set stuff that depends on ifunit */
-void detach __P((void)); /* Detach from controlling tty */
-void die __P((int)); /* Cleanup and exit */
-void quit __P((void)); /* like die(1) */
-void novm __P((char *)); /* Say we ran out of memory, and die */
-void timeout __P((void (*func)(void *), void *arg, int s, int us));
- /* Call func(arg) after s.us seconds */
-void untimeout __P((void (*func)(void *), void *arg));
- /* Cancel call to func(arg) */
-void record_child __P((int, char *, void (*) (void *), void *));
-pid_t safe_fork __P((int, int, int)); /* Fork & close stuff in child */
-int device_script __P((char *cmd, int in, int out, int dont_wait));
- /* Run `cmd' with given stdin and stdout */
-pid_t run_program __P((char *prog, char **args, int must_exist,
- void (*done)(void *), void *arg));
- /* Run program prog with args in child */
-void reopen_log __P((void)); /* (re)open the connection to syslog */
-void print_link_stats __P((void)); /* Print stats, if available */
-void reset_link_stats __P((int)); /* Reset (init) stats when link goes up */
-void update_link_stats __P((int)); /* Get stats at link termination */
-void script_setenv __P((char *, char *, int)); /* set script env var */
-void script_unsetenv __P((char *)); /* unset script env var */
-void new_phase __P((int)); /* signal start of new phase */
-void add_notifier __P((struct notifier **, notify_func, void *));
-void remove_notifier __P((struct notifier **, notify_func, void *));
-void notify __P((struct notifier *, int));
-int ppp_send_config __P((int, int, u_int32_t, int, int));
-int ppp_recv_config __P((int, int, u_int32_t, int, int));
-void remove_pidfiles __P((void));
-void lock_db __P((void));
-void unlock_db __P((void));
-
-/* Procedures exported from tty.c. */
-void tty_init __P((void));
-
-/* Procedures exported from utils.c. */
-void log_packet __P((u_char *, int, char *, int));
- /* Format a packet and log it with syslog */
-void print_string __P((char *, int, void (*) (void *, char *, ...),
- void *)); /* Format a string for output */
-int slprintf __P((char *, int, char *, ...)); /* sprintf++ */
-int vslprintf __P((char *, int, char *, va_list)); /* vsprintf++ */
-size_t strlcpy __P((char *, const char *, size_t)); /* safe strcpy */
-size_t strlcat __P((char *, const char *, size_t)); /* safe strncpy */
-void dbglog __P((char *, ...)); /* log a debug message */
-void info __P((char *, ...)); /* log an informational message */
-void notice __P((char *, ...)); /* log a notice-level message */
-void warn __P((char *, ...)); /* log a warning message */
-void error __P((char *, ...)); /* log an error message */
-void fatal __P((char *, ...)); /* log an error message and die(1) */
-void init_pr_log __P((char *, int)); /* initialize for using pr_log */
-void pr_log __P((void *, char *, ...)); /* printer fn, output to syslog */
-void end_pr_log __P((void)); /* finish up after using pr_log */
-void dump_packet __P((const char *, u_char *, int));
- /* dump packet to debug log if interesting */
-ssize_t complete_read __P((int, void *, size_t));
- /* read a complete buffer */
-
-/* Procedures exported from auth.c */
-void link_required __P((int)); /* we are starting to use the link */
-void link_terminated __P((int)); /* we are finished with the link */
-void link_down __P((int)); /* the LCP layer has left the Opened state */
-void upper_layers_down __P((int));/* take all NCPs down */
-void link_established __P((int)); /* the link is up; authenticate now */
-void start_networks __P((int)); /* start all the network control protos */
-void continue_networks __P((int)); /* start network [ip, etc] control protos */
-void np_up __P((int, int)); /* a network protocol has come up */
-void np_down __P((int, int)); /* a network protocol has gone down */
-void np_finished __P((int, int)); /* a network protocol no longer needs link */
-void auth_peer_fail __P((int, int));
- /* peer failed to authenticate itself */
-void auth_peer_success __P((int, int, int, char *, int));
- /* peer successfully authenticated itself */
-void auth_withpeer_fail __P((int, int));
- /* we failed to authenticate ourselves */
-void auth_withpeer_success __P((int, int, int));
- /* we successfully authenticated ourselves */
-void auth_check_options __P((void));
- /* check authentication options supplied */
-void auth_reset __P((int)); /* check what secrets we have */
-int check_passwd __P((int, char *, int, char *, int, char **));
- /* Check peer-supplied username/password */
-int get_secret __P((int, char *, char *, char *, int *, int));
- /* get "secret" for chap */
-int get_srp_secret __P((int unit, char *client, char *server, char *secret,
- int am_server));
-int auth_ip_addr __P((int, u_int32_t));
- /* check if IP address is authorized */
-int auth_number __P((void)); /* check if remote number is authorized */
-int bad_ip_adrs __P((u_int32_t));
- /* check if IP address is unreasonable */
-
-/* Procedures exported from demand.c */
-void demand_conf __P((void)); /* config interface(s) for demand-dial */
-void demand_block __P((void)); /* set all NPs to queue up packets */
-void demand_unblock __P((void)); /* set all NPs to pass packets */
-void demand_discard __P((void)); /* set all NPs to discard packets */
-void demand_rexmit __P((int)); /* retransmit saved frames for an NP */
-int loop_chars __P((unsigned char *, int)); /* process chars from loopback */
-int loop_frame __P((unsigned char *, int)); /* should we bring link up? */
-
-/* Procedures exported from multilink.c */
-#ifdef HAVE_MULTILINK
-void mp_check_options __P((void)); /* Check multilink-related options */
-int mp_join_bundle __P((void)); /* join our link to an appropriate bundle */
-void mp_exit_bundle __P((void)); /* have disconnected our link from bundle */
-void mp_bundle_terminated __P((void));
-char *epdisc_to_str __P((struct epdisc *)); /* string from endpoint discrim. */
-int str_to_epdisc __P((struct epdisc *, char *)); /* endpt disc. from str */
-#else
-#define mp_bundle_terminated() /* nothing */
-#define mp_exit_bundle() /* nothing */
-#define doing_multilink 0
-#define multilink_master 0
-#endif
-
-/* Procedures exported from sys-*.c */
-void sys_init __P((void)); /* Do system-dependent initialization */
-void sys_cleanup __P((void)); /* Restore system state before exiting */
-int sys_check_options __P((void)); /* Check options specified */
-void sys_close __P((void)); /* Clean up in a child before execing */
-int ppp_available __P((void)); /* Test whether ppp kernel support exists */
-int get_pty __P((int *, int *, char *, int)); /* Get pty master/slave */
-int open_ppp_loopback __P((void)); /* Open loopback for demand-dialling */
-int tty_establish_ppp __P((int)); /* Turn serial port into a ppp interface */
-void tty_disestablish_ppp __P((int)); /* Restore port to normal operation */
-void generic_disestablish_ppp __P((int dev_fd)); /* Restore device setting */
-int generic_establish_ppp __P((int dev_fd)); /* Make a ppp interface */
-void make_new_bundle __P((int, int, int, int)); /* Create new bundle */
-int bundle_attach __P((int)); /* Attach link to existing bundle */
-void cfg_bundle __P((int, int, int, int)); /* Configure existing bundle */
-void destroy_bundle __P((void)); /* Tell driver to destroy bundle */
-void clean_check __P((void)); /* Check if line was 8-bit clean */
-void set_up_tty __P((int, int)); /* Set up port's speed, parameters, etc. */
-void restore_tty __P((int)); /* Restore port's original parameters */
-void setdtr __P((int, int)); /* Raise or lower port's DTR line */
-void output __P((int, u_char *, int)); /* Output a PPP packet */
-void wait_input __P((struct timeval *));
- /* Wait for input, with timeout */
-void add_fd __P((int)); /* Add fd to set to wait for */
-void remove_fd __P((int)); /* Remove fd from set to wait for */
-int read_packet __P((u_char *)); /* Read PPP packet */
-int get_loop_output __P((void)); /* Read pkts from loopback */
-void tty_send_config __P((int, u_int32_t, int, int));
- /* Configure i/f transmit parameters */
-void tty_set_xaccm __P((ext_accm));
- /* Set extended transmit ACCM */
-void tty_recv_config __P((int, u_int32_t, int, int));
- /* Configure i/f receive parameters */
-int ccp_test __P((int, u_char *, int, int));
- /* Test support for compression scheme */
-void ccp_flags_set __P((int, int, int));
- /* Set kernel CCP state */
-int ccp_fatal_error __P((int)); /* Test for fatal decomp error in kernel */
-int get_idle_time __P((int, struct ppp_idle *));
- /* Find out how long link has been idle */
-int get_ppp_stats __P((int, struct pppd_stats *));
- /* Return link statistics */
-void netif_set_mtu __P((int, int)); /* Set PPP interface MTU */
-int netif_get_mtu __P((int)); /* Get PPP interface MTU */
-int sifvjcomp __P((int, int, int, int));
- /* Configure VJ TCP header compression */
-int sifup __P((int)); /* Configure i/f up for one protocol */
-int sifnpmode __P((int u, int proto, enum NPmode mode));
- /* Set mode for handling packets for proto */
-int sifdown __P((int)); /* Configure i/f down for one protocol */
-int sifaddr __P((int, u_int32_t, u_int32_t, u_int32_t));
- /* Configure IPv4 addresses for i/f */
-int cifaddr __P((int, u_int32_t, u_int32_t));
- /* Reset i/f IP addresses */
-#ifdef INET6
-int sif6addr __P((int, eui64_t, eui64_t));
- /* Configure IPv6 addresses for i/f */
-int cif6addr __P((int, eui64_t, eui64_t));
- /* Remove an IPv6 address from i/f */
-#endif
-int sifdefaultroute __P((int, u_int32_t, u_int32_t));
- /* Create default route through i/f */
-int cifdefaultroute __P((int, u_int32_t, u_int32_t));
- /* Delete default route through i/f */
-int sifproxyarp __P((int, u_int32_t));
- /* Add proxy ARP entry for peer */
-int cifproxyarp __P((int, u_int32_t));
- /* Delete proxy ARP entry for peer */
-u_int32_t GetMask __P((u_int32_t)); /* Get appropriate netmask for address */
-int lock __P((char *)); /* Create lock file for device */
-int relock __P((int)); /* Rewrite lock file with new pid */
-void unlock __P((void)); /* Delete previously-created lock file */
-void logwtmp __P((const char *, const char *, const char *));
- /* Write entry to wtmp file */
-int get_host_seed __P((void)); /* Get host-dependent random number seed */
-int have_route_to __P((u_int32_t)); /* Check if route to addr exists */
-#ifdef PPP_FILTER
-int set_filters __P((struct bpf_program *pass, struct bpf_program *active));
- /* Set filter programs in kernel */
-#endif
-#ifdef IPX_CHANGE
-int sipxfaddr __P((int, unsigned long, unsigned char *));
-int cipxfaddr __P((int));
-#endif
-int get_if_hwaddr __P((u_char *addr, char *name));
-char *get_first_ethernet __P((void));
-
-/* Procedures exported from options.c */
-int setipaddr __P((char *, char **, int)); /* Set local/remote ip addresses */
-int parse_args __P((int argc, char **argv));
- /* Parse options from arguments given */
-int options_from_file __P((char *filename, int must_exist, int check_prot,
- int privileged));
- /* Parse options from an options file */
-int options_from_user __P((void)); /* Parse options from user's .ppprc */
-int options_for_tty __P((void)); /* Parse options from /etc/ppp/options.tty */
-int options_from_list __P((struct wordlist *, int privileged));
- /* Parse options from a wordlist */
-int getword __P((FILE *f, char *word, int *newlinep, char *filename));
- /* Read a word from a file */
-void option_error __P((char *fmt, ...));
- /* Print an error message about an option */
-int int_option __P((char *, int *));
- /* Simplified number_option for decimal ints */
-void add_options __P((option_t *)); /* Add extra options */
-void check_options __P((void)); /* check values after all options parsed */
-int override_value __P((const char *, int, const char *));
- /* override value if permitted by priority */
-void print_options __P((void (*) __P((void *, char *, ...)), void *));
- /* print out values of all options */
-
-int parse_dotted_ip __P((char *, u_int32_t *));
-
-/*
- * Hooks to enable plugins to change various things.
- */
-extern int (*new_phase_hook) __P((int));
-extern int (*idle_time_hook) __P((struct ppp_idle *));
-extern int (*holdoff_hook) __P((void));
-extern int (*pap_check_hook) __P((void));
-extern int (*pap_auth_hook) __P((char *user, char *passwd, char **msgp,
- struct wordlist **paddrs,
- struct wordlist **popts));
-extern void (*pap_logout_hook) __P((void));
-extern int (*pap_passwd_hook) __P((char *user, char *passwd));
-extern int (*allowed_address_hook) __P((u_int32_t addr));
-extern void (*ip_up_hook) __P((void));
-extern void (*ip_down_hook) __P((void));
-extern void (*ip_choose_hook) __P((u_int32_t *));
-
-extern int (*chap_check_hook) __P((void));
-extern int (*chap_passwd_hook) __P((char *user, char *passwd));
-
-/* Let a plugin snoop sent and received packets. Useful for L2TP */
-extern void (*snoop_recv_hook) __P((unsigned char *p, int len));
-extern void (*snoop_send_hook) __P((unsigned char *p, int len));
-
-/*
- * Inline versions of get/put char/short/long.
- * Pointer is advanced; we assume that both arguments
- * are lvalues and will already be in registers.
- * cp MUST be u_char *.
- */
-#define GETCHAR(c, cp) { \
- (c) = *(cp)++; \
-}
-#define PUTCHAR(c, cp) { \
- *(cp)++ = (u_char) (c); \
-}
-
-
-#define GETSHORT(s, cp) { \
- (s) = *(cp)++ << 8; \
- (s) |= *(cp)++; \
-}
-#define PUTSHORT(s, cp) { \
- *(cp)++ = (u_char) ((s) >> 8); \
- *(cp)++ = (u_char) (s); \
-}
-
-#define GETLONG(l, cp) { \
- (l) = *(cp)++ << 8; \
- (l) |= *(cp)++; (l) <<= 8; \
- (l) |= *(cp)++; (l) <<= 8; \
- (l) |= *(cp)++; \
-}
-#define PUTLONG(l, cp) { \
- *(cp)++ = (u_char) ((l) >> 24); \
- *(cp)++ = (u_char) ((l) >> 16); \
- *(cp)++ = (u_char) ((l) >> 8); \
- *(cp)++ = (u_char) (l); \
-}
-
-#define INCPTR(n, cp) ((cp) += (n))
-#define DECPTR(n, cp) ((cp) -= (n))
-
-/*
- * System dependent definitions for user-level 4.3BSD UNIX implementation.
- */
-
-#define TIMEOUT(r, f, t) timeout((r), (f), (t), 0)
-#define UNTIMEOUT(r, f) untimeout((r), (f))
-
-#define BCOPY(s, d, l) memcpy(d, s, l)
-#define BZERO(s, n) memset(s, 0, n)
-#define BCMP(s1, s2, l) memcmp(s1, s2, l)
-
-#define PRINTMSG(m, l) { info("Remote message: %0.*v", l, m); }
-
-/*
- * MAKEHEADER - Add Header fields to a packet.
- */
-#define MAKEHEADER(p, t) { \
- PUTCHAR(PPP_ALLSTATIONS, p); \
- PUTCHAR(PPP_UI, p); \
- PUTSHORT(t, p); }
-
-/*
- * Exit status values.
- */
-#define EXIT_OK 0
-#define EXIT_FATAL_ERROR 1
-#define EXIT_OPTION_ERROR 2
-#define EXIT_NOT_ROOT 3
-#define EXIT_NO_KERNEL_SUPPORT 4
-#define EXIT_USER_REQUEST 5
-#define EXIT_LOCK_FAILED 6
-#define EXIT_OPEN_FAILED 7
-#define EXIT_CONNECT_FAILED 8
-#define EXIT_PTYCMD_FAILED 9
-#define EXIT_NEGOTIATION_FAILED 10
-#define EXIT_PEER_AUTH_FAILED 11
-#define EXIT_IDLE_TIMEOUT 12
-#define EXIT_CONNECT_TIME 13
-#define EXIT_CALLBACK 14
-#define EXIT_PEER_DEAD 15
-#define EXIT_HANGUP 16
-#define EXIT_LOOPBACK 17
-#define EXIT_INIT_FAILED 18
-#define EXIT_AUTH_TOPEER_FAILED 19
-#ifdef MAXOCTETS
-#define EXIT_TRAFFIC_LIMIT 20
-#endif
-#define EXIT_CNID_AUTH_FAILED 21
-
-/*
- * Debug macros. Slightly useful for finding bugs in pppd, not particularly
- * useful for finding out why your connection isn't being established.
- */
-#ifdef DEBUGALL
-#define DEBUGMAIN 1
-#define DEBUGFSM 1
-#define DEBUGLCP 1
-#define DEBUGIPCP 1
-#define DEBUGIPV6CP 1
-#define DEBUGUPAP 1
-#define DEBUGCHAP 1
-#endif
-
-#ifndef LOG_PPP /* we use LOG_LOCAL2 for syslog by default */
-#if defined(DEBUGMAIN) || defined(DEBUGFSM) || defined(DEBUGSYS) \
- || defined(DEBUGLCP) || defined(DEBUGIPCP) || defined(DEBUGUPAP) \
- || defined(DEBUGCHAP) || defined(DEBUG) || defined(DEBUGIPV6CP)
-#define LOG_PPP LOG_LOCAL2
-#else
-#define LOG_PPP LOG_DAEMON
-#endif
-#endif /* LOG_PPP */
-
-#ifdef DEBUGMAIN
-#define MAINDEBUG(x) if (debug) dbglog x
-#else
-#define MAINDEBUG(x)
-#endif
-
-#ifdef DEBUGSYS
-#define SYSDEBUG(x) if (debug) dbglog x
-#else
-#define SYSDEBUG(x)
-#endif
-
-#ifdef DEBUGFSM
-#define FSMDEBUG(x) if (debug) dbglog x
-#else
-#define FSMDEBUG(x)
-#endif
-
-#ifdef DEBUGLCP
-#define LCPDEBUG(x) if (debug) dbglog x
-#else
-#define LCPDEBUG(x)
-#endif
-
-#ifdef DEBUGIPCP
-#define IPCPDEBUG(x) if (debug) dbglog x
-#else
-#define IPCPDEBUG(x)
-#endif
-
-#ifdef DEBUGIPV6CP
-#define IPV6CPDEBUG(x) if (debug) dbglog x
-#else
-#define IPV6CPDEBUG(x)
-#endif
-
-#ifdef DEBUGUPAP
-#define UPAPDEBUG(x) if (debug) dbglog x
-#else
-#define UPAPDEBUG(x)
-#endif
-
-#ifdef DEBUGCHAP
-#define CHAPDEBUG(x) if (debug) dbglog x
-#else
-#define CHAPDEBUG(x)
-#endif
-
-#ifdef DEBUGIPXCP
-#define IPXCPDEBUG(x) if (debug) dbglog x
-#else
-#define IPXCPDEBUG(x)
-#endif
-
-#ifndef SIGTYPE
-#if defined(sun) || defined(SYSV) || defined(POSIX_SOURCE)
-#define SIGTYPE void
-#else
-#define SIGTYPE int
-#endif /* defined(sun) || defined(SYSV) || defined(POSIX_SOURCE) */
-#endif /* SIGTYPE */
-
-#ifndef MIN
-#define MIN(a, b) ((a) < (b)? (a): (b))
-#endif
-#ifndef MAX
-#define MAX(a, b) ((a) > (b)? (a): (b))
-#endif
-
-#ifndef offsetof
-#define offsetof(type, member) ((size_t) &((type *)0)->member)
-#endif
-
-#endif /* __PPP_H__ */
diff --git a/pppd_plugin/src/pppd/sha1.h b/pppd_plugin/src/pppd/sha1.h
deleted file mode 100644
index 83f64df..0000000
--- a/pppd_plugin/src/pppd/sha1.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* sha1.h */
-
-/* If OpenSSL is in use, then use that version of SHA-1 */
-#ifdef OPENSSL
-#include <t_sha.h>
-#define __SHA1_INCLUDE_
-#endif
-
-#ifndef __SHA1_INCLUDE_
-
-#ifndef SHA1_SIGNATURE_SIZE
-#ifdef SHA_DIGESTSIZE
-#define SHA1_SIGNATURE_SIZE SHA_DIGESTSIZE
-#else
-#define SHA1_SIGNATURE_SIZE 20
-#endif
-#endif
-
-typedef struct {
- u_int32_t state[5];
- u_int32_t count[2];
- unsigned char buffer[64];
-} SHA1_CTX;
-
-extern void SHA1_Init(SHA1_CTX *);
-extern void SHA1_Update(SHA1_CTX *, const unsigned char *, unsigned int);
-extern void SHA1_Final(unsigned char[SHA1_SIGNATURE_SIZE], SHA1_CTX *);
-
-#define __SHA1_INCLUDE_
-#endif /* __SHA1_INCLUDE_ */
-
diff --git a/pppd_plugin/src/pppd/spinlock.h b/pppd_plugin/src/pppd/spinlock.h
deleted file mode 100644
index 967fe37..0000000
--- a/pppd_plugin/src/pppd/spinlock.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef __SPINLOCK_H__
-#define __SPINLOCK_H__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "tdb.h"
-
-#ifdef USE_SPINLOCKS
-
-#define RWLOCK_BIAS 0x1000UL
-
-/* OS SPECIFIC */
-#define MAX_BUSY_LOOPS 1000
-#undef USE_SCHED_YIELD
-
-/* ARCH SPECIFIC */
-/* We should make sure these are padded to a cache line */
-#if defined(SPARC_SPINLOCKS)
-typedef volatile char spinlock_t;
-#elif defined(POWERPC_SPINLOCKS)
-typedef volatile unsigned long spinlock_t;
-#elif defined(INTEL_SPINLOCKS)
-typedef volatile int spinlock_t;
-#elif defined(MIPS_SPINLOCKS)
-typedef volatile unsigned long spinlock_t;
-#else
-#error Need to implement spinlock code in spinlock.h
-#endif
-
-typedef struct {
- spinlock_t lock;
- volatile int count;
-} tdb_rwlock_t;
-
-int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type);
-int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type);
-int tdb_create_rwlocks(int fd, unsigned int hash_size);
-int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
-
-#define TDB_SPINLOCK_SIZE(hash_size) (((hash_size) + 1) * sizeof(tdb_rwlock_t))
-
-#else /* !USE_SPINLOCKS */
-#if 0
-#define tdb_create_rwlocks(fd, hash_size) 0
-#define tdb_spinlock(tdb, list, rw_type) (-1)
-#define tdb_spinunlock(tdb, list, rw_type) (-1)
-#else
-int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type);
-int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type);
-int tdb_create_rwlocks(int fd, unsigned int hash_size);
-#endif
-int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
-#define TDB_SPINLOCK_SIZE(hash_size) 0
-
-#endif
-
-#endif
diff --git a/pppd_plugin/src/pppd/tdb.h b/pppd_plugin/src/pppd/tdb.h
deleted file mode 100644
index 153b6e9..0000000
--- a/pppd_plugin/src/pppd/tdb.h
+++ /dev/null
@@ -1,164 +0,0 @@
-#ifndef __TDB_H__
-#define __TDB_H__
-
-/*
- Unix SMB/CIFS implementation.
-
- trivial database library
-
- Copyright (C) Andrew Tridgell 1999-2004
-
- ** NOTE! The following LGPL license applies to the tdb
- ** library. This does NOT imply that all of Samba is released
- ** under the LGPL
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library 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
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef PRINTF_ATTRIBUTE
-/** Use gcc attribute to check printf fns. a1 is the 1-based index of
- * the parameter containing the format, and a2 the index of the first
- * argument. Note that some gcc 2.x versions don't handle this
- * properly **/
-#if (__GNUC__ >= 3)
-#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
-#else
-#define PRINTF_ATTRIBUTE(a1, a2)
-#endif
-#endif
-
-/* flags to tdb_store() */
-#define TDB_REPLACE 1
-#define TDB_INSERT 2
-#define TDB_MODIFY 3
-
-/* flags for tdb_open() */
-#define TDB_DEFAULT 0 /* just a readability place holder */
-#define TDB_CLEAR_IF_FIRST 1
-#define TDB_INTERNAL 2 /* don't store on disk */
-#define TDB_NOLOCK 4 /* don't do any locking */
-#define TDB_NOMMAP 8 /* don't use mmap */
-#define TDB_CONVERT 16 /* convert endian (internal use) */
-#define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */
-
-#define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret)
-
-/* error codes */
-enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK,
- TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOLOCK, TDB_ERR_LOCK_TIMEOUT,
- TDB_ERR_NOEXIST};
-
-#ifndef u32
-#define u32 unsigned
-#endif
-
-typedef struct {
- char *dptr;
- size_t dsize;
-} TDB_DATA;
-
-typedef u32 tdb_len;
-typedef u32 tdb_off;
-
-/* this is stored at the front of every database */
-struct tdb_header {
- char magic_food[32]; /* for /etc/magic */
- u32 version; /* version of the code */
- u32 hash_size; /* number of hash entries */
- tdb_off rwlocks;
- tdb_off reserved[31];
-};
-
-struct tdb_lock_type {
- u32 count;
- u32 ltype;
-};
-
-struct tdb_traverse_lock {
- struct tdb_traverse_lock *next;
- u32 off;
- u32 hash;
-};
-
-/* this is the context structure that is returned from a db open */
-typedef struct tdb_context {
- char *name; /* the name of the database */
- void *map_ptr; /* where it is currently mapped */
- int fd; /* open file descriptor for the database */
- tdb_len map_size; /* how much space has been mapped */
- int read_only; /* opened read-only */
- struct tdb_lock_type *locked; /* array of chain locks */
- enum TDB_ERROR ecode; /* error code for last tdb error */
- struct tdb_header header; /* a cached copy of the header */
- u32 flags; /* the flags passed to tdb_open */
- struct tdb_traverse_lock travlocks; /* current traversal locks */
- struct tdb_context *next; /* all tdbs to avoid multiple opens */
- dev_t device; /* uniquely identifies this tdb */
- ino_t inode; /* uniquely identifies this tdb */
- void (*log_fn)(struct tdb_context *tdb, int level, const char *, ...) PRINTF_ATTRIBUTE(3,4); /* logging function */
- u32 (*hash_fn)(TDB_DATA *key);
- int open_flags; /* flags used in the open - needed by reopen */
-} TDB_CONTEXT;
-
-typedef int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *);
-typedef void (*tdb_log_func)(TDB_CONTEXT *, int , const char *, ...);
-typedef u32 (*tdb_hash_func)(TDB_DATA *key);
-
-TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
- int open_flags, mode_t mode);
-TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
- int open_flags, mode_t mode,
- tdb_log_func log_fn,
- tdb_hash_func hash_fn);
-
-int tdb_reopen(TDB_CONTEXT *tdb);
-int tdb_reopen_all(void);
-void tdb_logging_function(TDB_CONTEXT *tdb, tdb_log_func);
-enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb);
-const char *tdb_errorstr(TDB_CONTEXT *tdb);
-TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_store(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, int flag);
-int tdb_append(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA new_dbuf);
-int tdb_close(TDB_CONTEXT *tdb);
-TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb);
-TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *);
-int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_lockkeys(TDB_CONTEXT *tdb, u32 number, TDB_DATA keys[]);
-void tdb_unlockkeys(TDB_CONTEXT *tdb);
-int tdb_lockall(TDB_CONTEXT *tdb);
-void tdb_unlockall(TDB_CONTEXT *tdb);
-
-/* Low level locking functions: use with care */
-void tdb_set_lock_alarm(sig_atomic_t *palarm);
-int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);
-
-/* Debug functions. Not used in production. */
-void tdb_dump_all(TDB_CONTEXT *tdb);
-int tdb_printfreelist(TDB_CONTEXT *tdb);
-
-extern TDB_DATA tdb_null;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* tdb.h */
diff --git a/pppd_plugin/src/pppd/upap.h b/pppd_plugin/src/pppd/upap.h
deleted file mode 100644
index 5cb59e9..0000000
--- a/pppd_plugin/src/pppd/upap.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * upap.h - User/Password Authentication Protocol definitions.
- *
- * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name "Carnegie Mellon University" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For permission or any legal
- * details, please contact
- * Office of Technology Transfer
- * Carnegie Mellon University
- * 5000 Forbes Avenue
- * Pittsburgh, PA 15213-3890
- * (412) 268-4387, fax: (412) 268-7395
- * tech-transfer@andrew.cmu.edu
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Computing Services
- * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
- *
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $Id: upap.h,v 1.8 2002/12/04 23:03:33 paulus Exp $
- */
-
-/*
- * Packet header = Code, id, length.
- */
-#define UPAP_HEADERLEN 4
-
-
-/*
- * UPAP codes.
- */
-#define UPAP_AUTHREQ 1 /* Authenticate-Request */
-#define UPAP_AUTHACK 2 /* Authenticate-Ack */
-#define UPAP_AUTHNAK 3 /* Authenticate-Nak */
-
-
-/*
- * Each interface is described by upap structure.
- */
-typedef struct upap_state {
- int us_unit; /* Interface unit number */
- char *us_user; /* User */
- int us_userlen; /* User length */
- char *us_passwd; /* Password */
- int us_passwdlen; /* Password length */
- int us_clientstate; /* Client state */
- int us_serverstate; /* Server state */
- u_char us_id; /* Current id */
- int us_timeouttime; /* Timeout (seconds) for auth-req retrans. */
- int us_transmits; /* Number of auth-reqs sent */
- int us_maxtransmits; /* Maximum number of auth-reqs to send */
- int us_reqtimeout; /* Time to wait for auth-req from peer */
-} upap_state;
-
-
-/*
- * Client states.
- */
-#define UPAPCS_INITIAL 0 /* Connection down */
-#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */
-#define UPAPCS_PENDING 2 /* Connection down, have requested auth */
-#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */
-#define UPAPCS_OPEN 4 /* We've received an Ack */
-#define UPAPCS_BADAUTH 5 /* We've received a Nak */
-
-/*
- * Server states.
- */
-#define UPAPSS_INITIAL 0 /* Connection down */
-#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */
-#define UPAPSS_PENDING 2 /* Connection down, have requested auth */
-#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */
-#define UPAPSS_OPEN 4 /* We've sent an Ack */
-#define UPAPSS_BADAUTH 5 /* We've sent a Nak */
-
-
-/*
- * Timeouts.
- */
-#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */
-#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */
-
-extern upap_state upap[];
-
-void upap_authwithpeer __P((int, char *, char *));
-void upap_authpeer __P((int));
-
-extern struct protent pap_protent;
diff --git a/pppd_plugin/src/pptp.c b/pppd_plugin/src/pptp.c
deleted file mode 100644
index 1522d19..0000000
--- a/pppd_plugin/src/pptp.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2006 by Kozlov D. *
- * xeb@mail.ru *
- * *
- * 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. *
- ***************************************************************************/
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/un.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <syslog.h>
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-
-#include "pppd/pppd.h"
-#include "pppd/fsm.h"
-#include "pppd/lcp.h"
-#include "pppd/ipcp.h"
-#include "pppd/ccp.h"
-#include "pppd/pathnames.h"
-
-#include "pptp_callmgr.h"
-#include <net/if.h>
-#include <net/ethernet.h>
-#include "if_pppox.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-
-
-extern char** environ;
-
-char pppd_version[] = PPPD_VERSION;
-extern int new_style_driver;
-
-
-char *pptp_server = NULL;
-char *pptp_client = NULL;
-char *pptp_phone = NULL;
-int pptp_sock=-1;
-int pptp_timeout=100000;
-struct in_addr localbind = { INADDR_NONE };
-
-static int callmgr_sock;
-static int pptp_fd;
-int call_ID;
-
-//static struct in_addr get_ip_address(char *name);
-static int open_callmgr(int call_id,struct in_addr inetaddr, char *phonenr,int window);
-static void launch_callmgr(int call_is,struct in_addr inetaddr, char *phonenr,int window);
-static int get_call_id(int sock, pid_t gre, pid_t pppd, u_int16_t *peer_call_id);
-
-//static int pptp_devname_hook(char *cmd, char **argv, int doit);
-static option_t Options[] =
-{
- { "pptp_server", o_string, &pptp_server,
- "PPTP Server" },
- { "pptp_client", o_string, &pptp_client,
- "PPTP Client" },
- { "pptp_sock",o_int, &pptp_sock,
- "PPTP socket" },
- { "pptp_phone", o_string, &pptp_phone,
- "PPTP Phone number" },
- { NULL }
-};
-
-static int pptp_connect(void);
-//static void pptp_send_config(int mtu,u_int32_t asyncmap,int pcomp,int accomp);
-//static void pptp_recv_config(int mru,u_int32_t asyncmap,int pcomp,int accomp);
-static void pptp_disconnect(void);
-
-struct channel pptp_channel = {
- options: Options,
- //process_extra_options: &PPPOEDeviceOptions,
- check_options: NULL,
- connect: &pptp_connect,
- disconnect: &pptp_disconnect,
- establish_ppp: &generic_establish_ppp,
- disestablish_ppp: &generic_disestablish_ppp,
- //send_config: &pptp_send_config,
- //recv_config: &pptp_recv_config,
- close: NULL,
- cleanup: NULL
-};
-
-static int pptp_start_server(void)
-{
- pptp_fd=pptp_sock;
- sprintf(ppp_devnam,"pptp (%s)",pptp_client);
-
- return pptp_fd;
-}
-static int pptp_start_client(void)
-{
- socklen_t len;
- struct sockaddr_pppox src_addr,dst_addr;
- struct hostent *hostinfo;
-
- hostinfo=gethostbyname(pptp_server);
- if (!hostinfo)
- {
- error("PPTP: Unknown host %s\n", pptp_server);
- return -1;
- }
- dst_addr.sa_addr.pptp.sin_addr=*(struct in_addr*)hostinfo->h_addr;
- {
- int sock;
- struct sockaddr_in addr;
- len=sizeof(addr);
- addr.sin_addr=dst_addr.sa_addr.pptp.sin_addr;
- addr.sin_family=AF_INET;
- addr.sin_port=htons(1700);
- sock=socket(AF_INET,SOCK_DGRAM,0);
- if (connect(sock,(struct sockaddr*)&addr,sizeof(addr)))
- {
- close(sock);
- error("PPTP: connect failed (%s)\n",strerror(errno));
- return -1;
- }
- getsockname(sock,(struct sockaddr*)&addr,&len);
- src_addr.sa_addr.pptp.sin_addr=addr.sin_addr;
- close(sock);
- }
- //info("PPTP: connect server=%s\n",inet_ntoa(conn.sin_addr));
- //conn.loc_addr.s_addr=INADDR_NONE;
- //conn.timeout=1;
- //conn.window=pptp_window;
-
- src_addr.sa_family=AF_PPPOX;
- src_addr.sa_protocol=PX_PROTO_PPTP;
- src_addr.sa_addr.pptp.call_id=0;
-
- dst_addr.sa_family=AF_PPPOX;
- dst_addr.sa_protocol=PX_PROTO_PPTP;
- dst_addr.sa_addr.pptp.call_id=0;
-
- pptp_fd=socket(AF_PPPOX,SOCK_STREAM,PX_PROTO_PPTP);
- if (pptp_fd<0)
- {
- error("PPTP: failed to create PPTP socket (%s)\n",strerror(errno));
- return -1;
- }
- if (bind(pptp_fd,(struct sockaddr*)&src_addr,sizeof(src_addr)))
- {
- close(pptp_fd);
- error("PPTP: failed to bind PPTP socket (%s)\n",strerror(errno));
- return -1;
- }
- len=sizeof(src_addr);
- getsockname(pptp_fd,(struct sockaddr*)&src_addr,&len);
- call_ID=src_addr.sa_addr.pptp.call_id;
-
- do {
- /*
- * Open connection to call manager (Launch call manager if necessary.)
- */
- callmgr_sock = open_callmgr(src_addr.sa_addr.pptp.call_id,dst_addr.sa_addr.pptp.sin_addr, pptp_phone,50);
- if (callmgr_sock<0)
- {
- close(pptp_fd);
- return -1;
- }
- /* Exchange PIDs, get call ID */
- } while (get_call_id(callmgr_sock, getpid(), getpid(), &dst_addr.sa_addr.pptp.call_id) < 0);
-
- if (connect(pptp_fd,(struct sockaddr*)&dst_addr,sizeof(dst_addr)))
- {
- close(callmgr_sock);
- close(pptp_fd);
- error("PPTP: failed to connect PPTP socket (%s)\n",strerror(errno));
- return -1;
- }
-
- sprintf(ppp_devnam,"pptp (%s)",pptp_server);
-
- return pptp_fd;
-}
-static int pptp_connect(void)
-{
- if ((!pptp_server && !pptp_client) || (pptp_server && pptp_client))
- {
- fatal("PPTP: unknown mode (you must specify pptp_server or pptp_client option)");
- return -1;
- }
-
- if (pptp_server) return pptp_start_client();
- return pptp_start_server();
-}
-
-static void pptp_disconnect(void)
-{
- if (pptp_server) close(callmgr_sock);
- close(pptp_fd);
-}
-
-static int open_callmgr(int call_id,struct in_addr inetaddr, char *phonenr,int window)
-{
- /* Try to open unix domain socket to call manager. */
- struct sockaddr_un where;
- const int NUM_TRIES = 3;
- int i, fd;
- pid_t pid;
- int status;
- /* Open socket */
- if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
- {
- fatal("Could not create unix domain socket: %s", strerror(errno));
- }
- /* Make address */
- callmgr_name_unixsock(&where, inetaddr, localbind);
- for (i = 0; i < NUM_TRIES; i++)
- {
- if (connect(fd, (struct sockaddr *) &where, sizeof(where)) < 0)
- {
- /* couldn't connect. We'll have to launch this guy. */
-
- unlink (where.sun_path);
-
- /* fork and launch call manager process */
- switch (pid = fork())
- {
- case -1: /* failure */
- fatal("fork() to launch call manager failed.");
- case 0: /* child */
- {
- close (fd);
- close(pptp_fd);
- /* close the pty and gre in the call manager */
- // close(pty_fd);
- //close(gre_fd);
- launch_callmgr(call_id,inetaddr, phonenr,window);
- }
- default: /* parent */
- waitpid(pid, &status, 0);
- if (status!= 0)
- {
- close(fd);
- error("Call manager exited with error %d", status);
- return -1;
- }
- break;
- }
- sleep(1);
- }
- else return fd;
- }
- close(fd);
- error("Could not launch call manager after %d tries.", i);
- return -1; /* make gcc happy */
-}
-
-/*** call the call manager main ***********************************************/
-static void launch_callmgr(int call_id,struct in_addr inetaddr, char *phonenr,int window)
-{
- char win[10];
- char call[10];
- char *my_argv[9] = { "pptp", inet_ntoa(inetaddr), "--call_id",call,"--phone",phonenr,"--window",win,NULL };
- char buf[128];
- sprintf(win,"%u",window);
- sprintf(call,"%u",call_id);
- snprintf(buf, sizeof(buf), "pptp: call manager for %s", my_argv[1]);
- //inststr(argc, argv, envp, buf);
- exit(callmgr_main(8, my_argv, environ));
-}
-
-/*** exchange data with the call manager *************************************/
-/* XXX need better error checking XXX */
-static int get_call_id(int sock, pid_t gre, pid_t pppd,
- u_int16_t *peer_call_id)
-{
- u_int16_t m_call_id, m_peer_call_id;
- /* write pid's to socket */
- /* don't bother with network byte order, because pid's are meaningless
- * outside the local host.
- */
- int rc;
- rc = write(sock, &gre, sizeof(gre));
- if (rc != sizeof(gre))
- return -1;
- rc = write(sock, &pppd, sizeof(pppd));
- if (rc != sizeof(pppd))
- return -1;
- rc = read(sock, &m_call_id, sizeof(m_call_id));
- if (rc != sizeof(m_call_id))
- return -1;
- rc = read(sock, &m_peer_call_id, sizeof(m_peer_call_id));
- if (rc != sizeof(m_peer_call_id))
- return -1;
- /*
- * XXX FIXME ... DO ERROR CHECKING & TIME-OUTS XXX
- * (Rhialto: I am assuming for now that timeouts are not relevant
- * here, because the read and write calls would return -1 (fail) when
- * the peer goes away during the process. We know it is (or was)
- * running because the connect() call succeeded.)
- * (James: on the other hand, if the route to the peer goes away, we
- * wouldn't get told by read() or write() for quite some time.)
- */
- *peer_call_id = m_peer_call_id;
- return 0;
-}
-
-void plugin_init(void)
-{
- /*if (!ppp_available() && !new_style_driver)
- {
- fatal("Linux kernel does not support PPP -- are you running 2.4.x?");
- }*/
-
- add_options(Options);
-
- info("PPTP plugin version %s compiled for pppd-%s, linux-%s",
- VERSION, PPPD_VERSION,KERNELVERSION);
-
- the_channel = &pptp_channel;
- modem = 0;
-}
-
diff --git a/pppd_plugin/src/pptp_callmgr.c b/pppd_plugin/src/pptp_callmgr.c
deleted file mode 100644
index 20bb736..0000000
--- a/pppd_plugin/src/pptp_callmgr.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/* pptp_callmgr.c ... Call manager for PPTP connections.
- * Handles TCP port 1723 protocol.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: pptp_callmgr.c,v 1.20 2005/03/31 07:42:39 quozl Exp $
- */
-#include <signal.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/un.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <setjmp.h>
-#include <stdio.h>
-#include <errno.h>
-#include "pptp_callmgr.h"
-#include "pptp_ctrl.h"
-#include "pptp_msg.h"
-#include "dirutil.h"
-#include "vector.h"
-#include "util.h"
-
-extern struct in_addr localbind; /* from pptp.c */
-extern int call_ID;
-
-int open_inetsock(struct in_addr inetaddr);
-int open_unixsock(struct in_addr inetaddr);
-void close_inetsock(int fd, struct in_addr inetaddr);
-void close_unixsock(int fd, struct in_addr inetaddr);
-
-sigjmp_buf callmgr_env;
-
-void callmgr_sighandler(int sig) {
- /* TODO: according to signal(2), siglongjmp() is unsafe used here */
- siglongjmp (callmgr_env, 1);
-}
-
-void callmgr_do_nothing(int sig) {
- /* do nothing signal handler */
-}
-
-struct local_callinfo {
- int unix_sock;
- pid_t pid[2];
-};
-
-struct local_conninfo {
- VECTOR * call_list;
- fd_set * call_set;
-};
-
-/* Call callback */
-void call_callback(PPTP_CONN *conn, PPTP_CALL *call, enum call_state state)
-{
- struct local_callinfo *lci;
- struct local_conninfo *conninfo;
- u_int16_t call_id[2];
- switch(state) {
- case CALL_OPEN_DONE:
- /* okey dokey. This means that the call_id and peer_call_id are
- * now valid, so lets send them on to our friends who requested
- * this call. */
- lci = pptp_call_closure_get(conn, call); assert(lci != NULL);
- pptp_call_get_ids(conn, call, &call_id[0], &call_id[1]);
- write(lci->unix_sock, &call_id, sizeof(call_id));
- /* Our duty to the fatherland is now complete. */
- break;
- case CALL_OPEN_FAIL:
- case CALL_CLOSE_RQST:
- case CALL_CLOSE_DONE:
- /* don't need to do anything here, except make sure tables
- * are sync'ed */
- log("Closing connection (call state)");
- conninfo = pptp_conn_closure_get(conn);
- lci = pptp_call_closure_get(conn, call);
- assert(lci != NULL && conninfo != NULL);
- if (vector_contains(conninfo->call_list, lci->unix_sock)) {
- vector_remove(conninfo->call_list, lci->unix_sock);
- close(lci->unix_sock);
- FD_CLR(lci->unix_sock, conninfo->call_set);
- //if(lci->pid[0] > 1) kill(lci->pid[0], SIGTERM);
- //if(lci->pid[1] > 1) kill(lci->pid[1], SIGTERM);
- }
- break;
- default:
- log("Unhandled call callback state [%d].", (int) state);
- break;
- }
-}
-
-/******************************************************************************
- * NOTE ABOUT 'VOLATILE':
- * several variables here get a volatile qualifier to silence warnings
- * from older (before 3.0) gccs. if the longjmp stuff is removed,
- * the volatile qualifiers should be removed as well.
- *****************************************************************************/
-
-/*** Call Manager *************************************************************/
-int callmgr_main(int argc, char **argv, char **envp)
-{
- struct in_addr inetaddr;
- int inet_sock, unix_sock;
- fd_set call_set;
- PPTP_CONN * conn;
- VECTOR * call_list;
- int max_fd = 0;
- volatile int first = 1;
- int retval;
- int i;
- char * volatile phonenr=NULL;
- int volatile window=10;
- //int volatile call_id=0;
- /* Step 0: Check arguments */
- if (argc < 2)
- fatal("Usage: %s ip.add.ress.here [--phone <phone number>]", argv[0]);
- //phonenr = argc == 3 ? argv[2] : NULL;
- for(i=2; i<argc; i++)
- {
- //log("%s",argv[i]);
- if (strcmp(argv[i],"--phone")==0 && i+1<argc) phonenr=argv[++i];
- else if (strcmp(argv[i],"--window")==0 && i+1<argc) window=atoi(argv[++i]);
- else if (strcmp(argv[i],"--call_id")==0 && i+1<argc) call_ID=atoi(argv[++i]);
- }
- if (inet_aton(argv[1], &inetaddr) == 0)
- fatal("Invalid IP address: %s", argv[1]);
- log("IP: %s\n",inet_ntoa(inetaddr));
- /* Step 1: Open sockets. */
- if ((inet_sock = open_inetsock(inetaddr)) < 0)
- fatal("Could not open control connection to %s", argv[1]);
- log("control connection");
- if ((unix_sock = open_unixsock(inetaddr)) < 0)
- fatal("Could not open unix socket for %s", argv[1]);
- /* Step 1b: FORK and return status to calling process. */
- log("unix_sock");
-
- switch (fork()) {
- case 0: /* child. stick around. */
- break;
- case -1: /* failure. Fatal. */
- fatal("Could not fork.");
- default: /* Parent. Return status to caller. */
- exit(0);
- }
- /* re-open stderr as /dev/null to release it */
- file2fd("/dev/null", "wb", STDERR_FILENO);
- /* Step 1c: Clean up unix socket on TERM */
- if (sigsetjmp(callmgr_env, 1) != 0)
- goto cleanup;
- signal(SIGINT, callmgr_sighandler);
- signal(SIGTERM, callmgr_sighandler);
- signal(SIGPIPE, callmgr_do_nothing);
- signal(SIGUSR1, callmgr_do_nothing); /* signal state change
- wake up accept */
- /* Step 2: Open control connection and register callback */
- if ((conn = pptp_conn_open(inet_sock, 1, NULL/* callback */)) == NULL) {
- close(unix_sock); close(inet_sock); fatal("Could not open connection.");
- }
- FD_ZERO(&call_set);
- call_list = vector_create();
- {
- struct local_conninfo *conninfo = malloc(sizeof(*conninfo));
- if (conninfo == NULL) {
- close(unix_sock); close(inet_sock); fatal("No memory.");
- }
- conninfo->call_list = call_list;
- conninfo->call_set = &call_set;
- pptp_conn_closure_put(conn, conninfo);
- }
- if (sigsetjmp(callmgr_env, 1) != 0) goto shutdown;
- /* Step 3: Get FD_SETs */
- max_fd = unix_sock;
- do {
- int rc;
- fd_set read_set = call_set, write_set;
- FD_ZERO (&write_set);
- if (pptp_conn_established(conn)) {
- FD_SET (unix_sock, &read_set);
- if (unix_sock > max_fd) max_fd = unix_sock;
- }
- pptp_fd_set(conn, &read_set, &write_set, &max_fd);
- for (; max_fd > 0 ; max_fd--) {
- if (FD_ISSET (max_fd, &read_set) ||
- FD_ISSET (max_fd, &write_set))
- break;
- }
- /* Step 4: Wait on INET or UNIX event */
- if ((rc = select(max_fd + 1, &read_set, &write_set, NULL, NULL)) <0) {
- if (errno == EBADF) break;
- /* a signal or somesuch. */
- continue;
- }
- /* Step 5a: Handle INET events */
- rc = pptp_dispatch(conn, &read_set, &write_set);
- if (rc < 0)
- break;
- /* Step 5b: Handle new connection to UNIX socket */
- if (FD_ISSET(unix_sock, &read_set)) {
- /* New call! */
- struct sockaddr_un from;
- int len = sizeof(from);
- PPTP_CALL * call;
- struct local_callinfo *lci;
- int s;
- /* Accept the socket */
- FD_CLR (unix_sock, &read_set);
- if ((s = accept(unix_sock, (struct sockaddr *) &from, &len)) < 0) {
- warn("Socket not accepted: %s", strerror(errno));
- goto skip_accept;
- }
- /* Allocate memory for local call information structure. */
- if ((lci = malloc(sizeof(*lci))) == NULL) {
- warn("Out of memory."); close(s); goto skip_accept;
- }
- lci->unix_sock = s;
- /* Give the initiator time to write the PIDs while we open
- * the call */
- call = pptp_call_open(conn, call_ID,call_callback, phonenr,window);
- /* Read and store the associated pids */
- read(s, &lci->pid[0], sizeof(lci->pid[0]));
- read(s, &lci->pid[1], sizeof(lci->pid[1]));
- /* associate the local information with the call */
- pptp_call_closure_put(conn, call, (void *) lci);
- /* The rest is done on callback. */
- /* Keep alive; wait for close */
- retval = vector_insert(call_list, s, call); assert(retval);
- if (s > max_fd) max_fd = s;
- FD_SET(s, &call_set);
- first = 0;
- }
-skip_accept: /* Step 5c: Handle socket close */
- for (i = 0; i < max_fd + 1; i++)
- if (FD_ISSET(i, &read_set)) {
- /* close it */
- PPTP_CALL * call;
- retval = vector_search(call_list, i, &call);
- if (retval) {
- struct local_callinfo *lci =
- pptp_call_closure_get(conn, call);
- log("Closing connection (unhandled)");
- //if(lci->pid[0] > 1) kill(lci->pid[0], SIGTERM);
- //if(lci->pid[1] > 1) kill(lci->pid[1], SIGTERM);
- free(lci);
- /* soft shutdown. Callback will do hard shutdown later */
- pptp_call_close(conn, call);
- vector_remove(call_list, i);
- }
- FD_CLR(i, &call_set);
- close(i);
- }
- } while (vector_size(call_list) > 0 || first);
-shutdown:
- {
- int rc;
- fd_set read_set, write_set;
- struct timeval tv;
- signal(SIGINT, callmgr_do_nothing);
- signal(SIGTERM, callmgr_do_nothing);
- /* warn("Shutdown"); */
- /* kill all open calls */
- for (i = 0; i < vector_size(call_list); i++) {
- PPTP_CALL *call = vector_get_Nth(call_list, i);
- //struct local_callinfo *lci = pptp_call_closure_get(conn, call);
- log("Closing connection (shutdown)");
- pptp_call_close(conn, call);
- //if(lci->pid[0] > 1) kill(lci->pid[0], SIGTERM);
- //if(lci->pid[1] > 1) kill(lci->pid[1], SIGTERM);
- }
- /* attempt to dispatch these messages */
- FD_ZERO(&read_set);
- FD_ZERO(&write_set);
- pptp_fd_set(conn, &read_set, &write_set, &max_fd);
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- select(max_fd + 1, &read_set, &write_set, NULL, &tv);
- rc = pptp_dispatch(conn, &read_set, &write_set);
- if (rc > 0) {
- /* wait for a respond, a timeout because there might not be one */
- FD_ZERO(&read_set);
- FD_ZERO(&write_set);
- pptp_fd_set(conn, &read_set, &write_set, &max_fd);
- tv.tv_sec = 2;
- tv.tv_usec = 0;
- select(max_fd + 1, &read_set, &write_set, NULL, &tv);
- rc = pptp_dispatch(conn, &read_set, &write_set);
- if (rc > 0) {
- if (i > 0) sleep(2);
- /* no more open calls. Close the connection. */
- pptp_conn_close(conn, PPTP_STOP_LOCAL_SHUTDOWN);
- /* wait for a respond, a timeout because there might not be one */
- FD_ZERO(&read_set);
- FD_ZERO(&write_set);
- pptp_fd_set(conn, &read_set, &write_set, &max_fd);
- tv.tv_sec = 2;
- tv.tv_usec = 0;
- select(max_fd + 1, &read_set, &write_set, NULL, &tv);
- pptp_dispatch(conn, &read_set, &write_set);
- if (rc > 0) sleep(2);
- }
- }
- /* with extreme prejudice */
- pptp_conn_destroy(conn);
- vector_destroy(call_list);
- }
-cleanup:
- signal(SIGINT, callmgr_do_nothing);
- signal(SIGTERM, callmgr_do_nothing);
- close_inetsock(inet_sock, inetaddr);
- close_unixsock(unix_sock, inetaddr);
- return 0;
-}
-
-/*** open_inetsock ************************************************************/
-int open_inetsock(struct in_addr inetaddr)
-{
- struct sockaddr_in dest, src;
- int s;
- dest.sin_family = AF_INET;
- dest.sin_port = htons(PPTP_PORT);
- dest.sin_addr = inetaddr;
- if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- warn("socket: %s", strerror(errno));
- return s;
- }
- if (localbind.s_addr != INADDR_NONE) {
- bzero(&src, sizeof(src));
- src.sin_family = AF_INET;
- src.sin_addr = localbind;
- if (bind(s, (struct sockaddr *) &src, sizeof(src)) != 0) {
- warn("bind: %s", strerror(errno));
- close(s); return -1;
- }
- }
- if (connect(s, (struct sockaddr *) &dest, sizeof(dest)) < 0) {
- warn("connect: %s", strerror(errno));
- close(s); return -1;
- }
- return s;
-}
-
-/*** open_unixsock ************************************************************/
-int open_unixsock(struct in_addr inetaddr)
-{
- struct sockaddr_un where;
- struct stat st;
- char *dir;
- int s;
- if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
- warn("socket: %s", strerror(errno));
- return s;
- }
- callmgr_name_unixsock( &where, inetaddr, localbind);
- if (stat(where.sun_path, &st) >= 0)
- {
- warn("Call manager for %s is already running.", inet_ntoa(inetaddr));
- close(s); return -1;
- }
- /* Make sure path is valid. */
- dir = dirnamex(where.sun_path);
- if (!make_valid_path(dir, 0770))
- fatal("Could not make path to %s: %s", where.sun_path, strerror(errno));
- free(dir);
- if (bind(s, (struct sockaddr *) &where, sizeof(where)) < 0) {
- warn("bind: %s", strerror(errno));
- close(s); return -1;
- }
- chmod(where.sun_path, 0777);
- listen(s, 127);
- return s;
-}
-
-/*** close_inetsock ***********************************************************/
-void close_inetsock(int fd, struct in_addr inetaddr)
-{
- close(fd);
-}
-
-/*** close_unixsock ***********************************************************/
-void close_unixsock(int fd, struct in_addr inetaddr)
-{
- struct sockaddr_un where;
- close(fd);
- callmgr_name_unixsock(&where, inetaddr, localbind);
- unlink(where.sun_path);
-}
-
-/*** make a unix socket address ***********************************************/
-void callmgr_name_unixsock(struct sockaddr_un *where,
- struct in_addr inetaddr,
- struct in_addr localbind)
-{
- char localaddr[16], remoteaddr[16];
- where->sun_family = AF_UNIX;
- strncpy(localaddr, inet_ntoa(localbind), 16);
- strncpy(remoteaddr, inet_ntoa(inetaddr), 16);
- snprintf(where->sun_path, sizeof(where->sun_path),
- PPTP_SOCKET_PREFIX "%s:%i", remoteaddr,call_ID);
-}
diff --git a/pppd_plugin/src/pptp_callmgr.h b/pppd_plugin/src/pptp_callmgr.h
deleted file mode 100644
index d7bc2d6..0000000
--- a/pppd_plugin/src/pptp_callmgr.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* pptp_callmgr.h ... Call manager for PPTP connections.
- * Handles TCP port 1723 protocol.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: pptp_callmgr.h,v 1.3 2003/02/17 00:22:17 quozl Exp $
- */
-
-#define PPTP_SOCKET_PREFIX "/var/run/pptp/"
-
-int callmgr_main(int argc, char**argv, char**envp);
-void callmgr_name_unixsock(struct sockaddr_un *where,
- struct in_addr inetaddr,
- struct in_addr localbind);
diff --git a/pppd_plugin/src/pptp_ctrl.c b/pppd_plugin/src/pptp_ctrl.c
deleted file mode 100644
index 1bab3f9..0000000
--- a/pppd_plugin/src/pptp_ctrl.c
+++ /dev/null
@@ -1,1077 +0,0 @@
-/* pptp_ctrl.c ... handle PPTP control connection.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: pptp_ctrl.c,v 1.31 2005/03/31 07:42:39 quozl Exp $
- */
-
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <signal.h>
-#include <string.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include "pptp_msg.h"
-#include "pptp_ctrl.h"
-#include "pptp_options.h"
-#include "vector.h"
-#include "util.h"
-#include "pptp_quirks.h"
-
-/* BECAUSE OF SIGNAL LIMITATIONS, EACH PROCESS CAN ONLY MANAGE ONE
- * CONNECTION. SO THIS 'PPTP_CONN' STRUCTURE IS A BIT MISLEADING.
- * WE'LL KEEP CONNECTION-SPECIFIC INFORMATION IN THERE ANYWAY (AS
- * OPPOSED TO USING GLOBAL VARIABLES), BUT BEWARE THAT THE ENTIRE
- * UNIX SIGNAL-HANDLING SEMANTICS WOULD HAVE TO CHANGE (OR THE
- * TIME-OUT CODE DRASTICALLY REWRITTEN) BEFORE YOU COULD DO A
- * PPTP_CONN_OPEN MORE THAN ONCE PER PROCESS AND GET AWAY WITH IT.
- */
-
-/* This structure contains connection-specific information that the
- * signal handler needs to see. Thus, it needs to be in a global
- * variable. If you end up using pthreads or something (why not
- * just processes?), this would have to be placed in a thread-specific
- * data area, using pthread_get|set_specific, etc., so I've
- * conveniently encapsulated it for you.
- * [linux threads will have to support thread-specific signals
- * before this would work at all, which, as of this writing
- * (linux-threads v0.6, linux kernel 2.1.72), it does not.]
- */
-
-/* Globals */
-
-/* control the number of times echo packets will be logged */
-static int nlogecho = 10;
-
-static struct thread_specific {
- struct sigaction old_sigaction; /* evil signals */
- PPTP_CONN * conn;
-} global;
-
-#define INITIAL_BUFSIZE 512 /* initial i/o buffer size. */
-
-struct PPTP_CONN {
- int inet_sock;
- /* Connection States */
- enum {
- CONN_IDLE, CONN_WAIT_CTL_REPLY, CONN_WAIT_STOP_REPLY, CONN_ESTABLISHED
- } conn_state; /* on startup: CONN_IDLE */
- /* Keep-alive states */
- enum {
- KA_NONE, KA_OUTSTANDING
- } ka_state; /* on startup: KA_NONE */
- /* Keep-alive ID; monotonically increasing (watch wrap-around!) */
- u_int32_t ka_id; /* on startup: 1 */
- /* Other properties. */
- u_int16_t version;
- u_int16_t firmware_rev;
- u_int8_t hostname[64], vendor[64];
- /* XXX these are only PNS properties, currently XXX */
- /* Call assignment information. */
- u_int16_t call_serial_number;
- VECTOR *call;
- void * closure;
- pptp_conn_cb callback;
- /******* IO buffers ******/
- char * read_buffer, *write_buffer;
- size_t read_alloc, write_alloc;
- size_t read_size, write_size;
-};
-
-struct PPTP_CALL {
- /* Call properties */
- enum {
- PPTP_CALL_PAC, PPTP_CALL_PNS
- } call_type;
- union {
- enum pptp_pac_state {
- PAC_IDLE, PAC_WAIT_REPLY, PAC_ESTABLISHED, PAC_WAIT_CS_ANS
- } pac;
- enum pptp_pns_state {
- PNS_IDLE, PNS_WAIT_REPLY, PNS_ESTABLISHED, PNS_WAIT_DISCONNECT
- } pns;
- } state;
- u_int16_t call_id, peer_call_id;
- u_int16_t sernum;
- u_int32_t speed;
- /* For user data: */
- pptp_call_cb callback;
- void * closure;
-};
-
-
-/* PPTP error codes: ----------------------------------------------*/
-
-/* (General Error Codes) */
-static const struct {
- const char *name, *desc;
-} pptp_general_errors[] = {
-#define PPTP_GENERAL_ERROR_NONE 0
- { "(None)", "No general error" },
-#define PPTP_GENERAL_ERROR_NOT_CONNECTED 1
- { "(Not-Connected)", "No control connection exists yet for this "
- "PAC-PNS pair" },
-#define PPTP_GENERAL_ERROR_BAD_FORMAT 2
- { "(Bad-Format)", "Length is wrong or Magic Cookie value is incorrect" },
-#define PPTP_GENERAL_ERROR_BAD_VALUE 3
- { "(Bad-Value)", "One of the field values was out of range or "
- "reserved field was non-zero" },
-#define PPTP_GENERAL_ERROR_NO_RESOURCE 4
- { "(No-Resource)", "Insufficient resources to handle this command now" },
-#define PPTP_GENERAL_ERROR_BAD_CALLID 5
- { "(Bad-Call ID)", "The Call ID is invalid in this context" },
-#define PPTP_GENERAL_ERROR_PAC_ERROR 6
- { "(PAC-Error)", "A generic vendor-specific error occured in the PAC" }
-};
-
-#define MAX_GENERAL_ERROR ( sizeof(pptp_general_errors) / \
- sizeof(pptp_general_errors[0]) - 1)
-
-/* Outgoing Call Reply Result Codes */
-static const char *pptp_out_call_reply_result[] = {
-/* 0 */ "Unknown Result Code",
-/* 1 */ "Connected",
-/* 2 */ "General Error",
-/* 3 */ "No Carrier Detected",
-/* 4 */ "Busy Signal",
-/* 5 */ "No Dial Tone",
-/* 6 */ "Time Out",
-/* 7 */ "Not Accepted, Call is administratively prohibited" };
-
-#define MAX_OUT_CALL_REPLY_RESULT 7
-
-/* Call Disconnect Notify Result Codes */
-static const char *pptp_call_disc_ntfy[] = {
-/* 0 */ "Unknown Result Code",
-/* 1 */ "Lost Carrier",
-/* 2 */ "General Error",
-/* 3 */ "Administrative Shutdown",
-/* 4 */ "(your) Request" };
-
-#define MAX_CALL_DISC_NTFY 4
-
-/* Call Disconnect Notify Result Codes */
-static const char *pptp_start_ctrl_conn_rply[] = {
-/* 0 */ "Unknown Result Code",
-/* 1 */ "Successful Channel Establishment",
-/* 2 */ "General Error",
-/* 3 */ "Command Channel Already Exists",
-/* 4 */ "Requester is not Authorized" };
-
-#define MAX_START_CTRL_CONN_REPLY 4
-
-/* timing options */
-int idle_wait = PPTP_TIMEOUT;
-int max_echo_wait = PPTP_TIMEOUT;
-
-/* Local prototypes */
-static void pptp_reset_timer(void);
-static void pptp_handle_timer();
-/* Write/read as much as we can without blocking. */
-int pptp_write_some(PPTP_CONN * conn);
-int pptp_read_some(PPTP_CONN * conn);
-/* Make valid packets from read_buffer */
-int pptp_make_packet(PPTP_CONN * conn, void **buf, size_t *size);
-/* Add packet to write_buffer */
-int pptp_send_ctrl_packet(PPTP_CONN * conn, void * buffer, size_t size);
-/* Dispatch packets (general) */
-int pptp_dispatch_packet(PPTP_CONN * conn, void * buffer, size_t size);
-/* Dispatch packets (control messages) */
-int ctrlp_disp(PPTP_CONN * conn, void * buffer, size_t size);
-/* Set link info, for pptp servers that need it.
- this is a noop, unless the user specified a quirk and
- there's a set_link hook defined in the quirks table
- for that quirk */
-void pptp_set_link(PPTP_CONN * conn, int peer_call_id);
-
-/*** log error information in control packets *********************************/
-static void ctrlp_error( int result, int error, int cause,
- const char *result_text[], int max_result)
-{
- if( cause >= 0)
- log("Result code is %d '%s'. Error code is %d, Cause code is %d",
- result, result_text[result <= max_result ? result : 0], error,
- cause );
- else
- log("Reply result code is %d '%s'. Error code is %d",
- result, result_text[result <= max_result ? result : 0], error);
- if ((error > 0) && (error <= MAX_GENERAL_ERROR)){
- if( result != PPTP_RESULT_GENERAL_ERROR )
- log("Result code is something else then \"general error\", "
- "so the following error is probably bogus.");
- log("Error is '%s', Error message: '%s'",
- pptp_general_errors[error].name,
- pptp_general_errors[error].desc);
- }
-}
-
-static const char *ctrl_msg_types[] = {
- "invalid control message type",
-/* (Control Connection Management) */
- "Start-Control-Connection-Request", /* 1 */
- "Start-Control-Connection-Reply", /* 2 */
- "Stop-Control-Connection-Request", /* 3 */
- "Stop-Control-Connection-Reply", /* 4 */
- "Echo-Request", /* 5 */
- "Echo-Reply", /* 6 */
-/* (Call Management) */
- "Outgoing-Call-Request", /* 7 */
- "Outgoing-Call-Reply", /* 8 */
- "Incoming-Call-Request", /* 9 */
- "Incoming-Call-Reply", /* 10 */
- "Incoming-Call-Connected", /* 11 */
- "Call-Clear-Request", /* 12 */
- "Call-Disconnect-Notify", /* 13 */
-/* (Error Reporting) */
- "WAN-Error-Notify", /* 14 */
-/* (PPP Session Control) */
- "Set-Link-Info" /* 15 */
-};
-#define MAX_CTRLMSG_TYPE 15
-
-/*** report a sent packet ****************************************************/
-static void ctrlp_rep( void * buffer, int size, int isbuff)
-{
- struct pptp_header *packet = buffer;
- unsigned int type;
- if(size < sizeof(struct pptp_header)) return;
- type = ntoh16(packet->ctrl_type);
- /* FIXME: do not report sending echo requests as long as they are
- * sent in a signal handler. This may dead lock as the syslog call
- * is not reentrant */
- if( type == PPTP_ECHO_RQST ) return;
- /* don't keep reporting sending of echo's */
- if( (type == PPTP_ECHO_RQST || type == PPTP_ECHO_RPLY) && nlogecho <= 0 ) return;
- log("%s control packet type is %d '%s'\n",isbuff ? "Buffered" : "Sent",
- type, ctrl_msg_types[type <= MAX_CTRLMSG_TYPE ? type : 0]);
-
-}
-
-
-
-/* Open new pptp_connection. Returns NULL on failure. */
-PPTP_CONN * pptp_conn_open(int inet_sock, int isclient, pptp_conn_cb callback)
-{
- PPTP_CONN *conn;
- /* Allocate structure */
- if ((conn = malloc(sizeof(*conn))) == NULL) return NULL;
- if ((conn->call = vector_create()) == NULL) { free(conn); return NULL; }
- /* Initialize */
- conn->inet_sock = inet_sock;
- conn->conn_state = CONN_IDLE;
- conn->ka_state = KA_NONE;
- conn->ka_id = 1;
- conn->call_serial_number = 0;
- conn->callback = callback;
- /* Create I/O buffers */
- conn->read_size = conn->write_size = 0;
- conn->read_alloc = conn->write_alloc = INITIAL_BUFSIZE;
- conn->read_buffer =
- malloc(sizeof(*(conn->read_buffer)) * conn->read_alloc);
- conn->write_buffer =
- malloc(sizeof(*(conn->write_buffer)) * conn->write_alloc);
- if (conn->read_buffer == NULL || conn->write_buffer == NULL) {
- if (conn->read_buffer != NULL) free(conn->read_buffer);
- if (conn->write_buffer != NULL) free(conn->write_buffer);
- vector_destroy(conn->call); free(conn); return NULL;
- }
- /* Make this socket non-blocking. */
- fcntl(conn->inet_sock, F_SETFL, O_NONBLOCK);
- /* Request connection from server, if this is a client */
- if (isclient) {
- struct pptp_start_ctrl_conn packet = {
- PPTP_HEADER_CTRL(PPTP_START_CTRL_CONN_RQST),
- hton16(PPTP_VERSION), 0, 0,
- hton32(PPTP_FRAME_CAP), hton32(PPTP_BEARER_CAP),
- hton16(PPTP_MAX_CHANNELS), hton16(PPTP_FIRMWARE_VERSION),
- PPTP_HOSTNAME, PPTP_VENDOR
- };
- /* fix this packet, if necessary */
- int idx, rc;
- idx = get_quirk_index();
- if (idx != -1 && pptp_fixups[idx].start_ctrl_conn) {
- if ((rc = pptp_fixups[idx].start_ctrl_conn(&packet)))
- warn("calling the start_ctrl_conn hook failed (%d)", rc);
- }
- if (pptp_send_ctrl_packet(conn, &packet, sizeof(packet)))
- conn->conn_state = CONN_WAIT_CTL_REPLY;
- else
- return NULL; /* could not send initial start request. */
- }
- /* Set up interval/keep-alive timer */
- /* First, register handler for SIGALRM */
- sigpipe_create();
- sigpipe_assign(SIGALRM);
- global.conn = conn;
- /* Reset event timer */
- pptp_reset_timer();
- /* all done. */
- return conn;
-}
-
-int pptp_conn_established(PPTP_CONN *conn) {
- return (conn->conn_state == CONN_ESTABLISHED);
-}
-
-/* This currently *only* works for client call requests.
- * We need to do something else to allocate calls for incoming requests.
- */
-PPTP_CALL * pptp_call_open(PPTP_CONN * conn, int call_id,pptp_call_cb callback,
- char *phonenr,int window)
-{
- PPTP_CALL * call;
- int idx, rc;
- /* Send off the call request */
- struct pptp_out_call_rqst packet = {
- PPTP_HEADER_CTRL(PPTP_OUT_CALL_RQST),
- 0,0, /*call_id, sernum */
- hton32(PPTP_BPS_MIN), hton32(PPTP_BPS_MAX),
- hton32(PPTP_BEARER_CAP), hton32(PPTP_FRAME_CAP),
- hton16(window), 0, 0, 0, {0}, {0}
- };
- assert(conn && conn->call);
- assert(conn->conn_state == CONN_ESTABLISHED);
- /* Assign call id */
- if (!call_id && !vector_scan(conn->call, 0, PPTP_MAX_CHANNELS - 1, &call_id))
- /* no more calls available! */
- return NULL;
- /* allocate structure. */
- if ((call = malloc(sizeof(*call))) == NULL) return NULL;
- /* Initialize call structure */
- call->call_type = PPTP_CALL_PNS;
- call->state.pns = PNS_IDLE;
- call->call_id = (u_int16_t) call_id;
- call->sernum = conn->call_serial_number++;
- call->callback = callback;
- call->closure = NULL;
- packet.call_id = htons(call->call_id);
- packet.call_sernum = htons(call->sernum);
- /* if we have a quirk, build a new packet to fit it */
- idx = get_quirk_index();
- if (idx != -1 && pptp_fixups[idx].out_call_rqst_hook) {
- if ((rc = pptp_fixups[idx].out_call_rqst_hook(&packet)))
- warn("calling the out_call_rqst hook failed (%d)", rc);
- }
- /* fill in the phone number if it was specified */
- if (phonenr) {
- strncpy(packet.phone_num, phonenr, sizeof(packet.phone_num));
- packet.phone_len = strlen(phonenr);
- if( packet.phone_len > sizeof(packet.phone_num))
- packet.phone_len = sizeof(packet.phone_num);
- packet.phone_len = hton16 (packet.phone_len);
- }
- if (pptp_send_ctrl_packet(conn, &packet, sizeof(packet))) {
- pptp_reset_timer();
- call->state.pns = PNS_WAIT_REPLY;
- /* and add it to the call vector */
- vector_insert(conn->call, call_id, call);
- return call;
- } else { /* oops, unsuccessful. Deallocate. */
- free(call);
- return NULL;
- }
-}
-
-/*** pptp_call_close **********************************************************/
-void pptp_call_close(PPTP_CONN * conn, PPTP_CALL * call)
-{
- struct pptp_call_clear_rqst rqst = {
- PPTP_HEADER_CTRL(PPTP_CALL_CLEAR_RQST), 0, 0
- };
- assert(conn && conn->call); assert(call);
- assert(vector_contains(conn->call, call->call_id));
- /* haven't thought about PAC yet */
- assert(call->call_type == PPTP_CALL_PNS);
- assert(call->state.pns != PNS_IDLE);
- rqst.call_id = hton16(call->call_id);
- /* don't check state against WAIT_DISCONNECT... allow multiple disconnect
- * requests to be made.
- */
- pptp_send_ctrl_packet(conn, &rqst, sizeof(rqst));
- pptp_reset_timer();
- call->state.pns = PNS_WAIT_DISCONNECT;
- /* call structure will be freed when we have confirmation of disconnect. */
-}
-
-/*** hard close ***************************************************************/
-void pptp_call_destroy(PPTP_CONN *conn, PPTP_CALL *call)
-{
- assert(conn && conn->call); assert(call);
- assert(vector_contains(conn->call, call->call_id));
- /* notify */
- if (call->callback != NULL) call->callback(conn, call, CALL_CLOSE_DONE);
- /* deallocate */
- vector_remove(conn->call, call->call_id);
- free(call);
-}
-
-/*** this is a soft close *****************************************************/
-void pptp_conn_close(PPTP_CONN * conn, u_int8_t close_reason)
-{
- struct pptp_stop_ctrl_conn rqst = {
- PPTP_HEADER_CTRL(PPTP_STOP_CTRL_CONN_RQST),
- hton8(close_reason), 0, 0
- };
- int i;
- assert(conn && conn->call);
- /* avoid repeated close attempts */
- if (conn->conn_state == CONN_IDLE || conn->conn_state == CONN_WAIT_STOP_REPLY)
- return;
- /* close open calls, if any */
- for (i = 0; i < vector_size(conn->call); i++)
- pptp_call_close(conn, vector_get_Nth(conn->call, i));
- /* now close connection */
- log("Closing PPTP connection");
- pptp_send_ctrl_packet(conn, &rqst, sizeof(rqst));
- pptp_reset_timer(); /* wait 60 seconds for reply */
- conn->conn_state = CONN_WAIT_STOP_REPLY;
- return;
-}
-
-/*** this is a hard close *****************************************************/
-void pptp_conn_destroy(PPTP_CONN * conn)
-{
- int i;
- assert(conn != NULL); assert(conn->call != NULL);
- /* destroy all open calls */
- for (i = 0; i < vector_size(conn->call); i++)
- pptp_call_destroy(conn, vector_get_Nth(conn->call, i));
- /* notify */
- if (conn->callback != NULL) conn->callback(conn, CONN_CLOSE_DONE);
- sigpipe_close();
- close(conn->inet_sock);
- /* deallocate */
- vector_destroy(conn->call);
- free(conn);
-}
-
-/*** Deal with messages, in a non-blocking manner
- * Add file descriptors used by pptp to fd_set.
- */
-void pptp_fd_set(PPTP_CONN * conn, fd_set * read_set, fd_set * write_set,
- int * max_fd)
-{
- assert(conn && conn->call);
- /* Add fd to write_set if there are outstanding writes. */
- if (conn->write_size > 0)
- FD_SET(conn->inet_sock, write_set);
- /* Always add fd to read_set. (always want something to read) */
- FD_SET(conn->inet_sock, read_set);
- if (*max_fd < conn->inet_sock) *max_fd = conn->inet_sock;
- /* Add signal pipe file descriptor to set */
- int sig_fd = sigpipe_fd();
- FD_SET(sig_fd, read_set);
- if (*max_fd < sig_fd) *max_fd = sig_fd;
-}
-
-/*** handle any pptp file descriptors set in fd_set, and clear them ***********/
-int pptp_dispatch(PPTP_CONN * conn, fd_set * read_set, fd_set * write_set)
-{
- int r = 0;
- assert(conn && conn->call);
- /* Check for signals */
- if (FD_ISSET(sigpipe_fd(), read_set)) {
- if (sigpipe_read() == SIGALRM) pptp_handle_timer();
- FD_CLR(sigpipe_fd(), read_set);
- }
- /* Check write_set could be set. */
- if (FD_ISSET(conn->inet_sock, write_set)) {
- FD_CLR(conn->inet_sock, write_set);
- if (conn->write_size > 0)
- r = pptp_write_some(conn);/* write as much as we can without blocking */
- }
- /* Check read_set */
- if (r >= 0 && FD_ISSET(conn->inet_sock, read_set)) {
- void *buffer; size_t size;
- FD_CLR(conn->inet_sock, read_set);
- r = pptp_read_some(conn); /* read as much as we can without blocking */
- if (r < 0)
- return r;
- /* make packets of the buffer, while we can. */
- while (r >= 0 && pptp_make_packet(conn, &buffer, &size)) {
- r = pptp_dispatch_packet(conn, buffer, size);
- free(buffer);
- }
- }
- /* That's all, folks. Simple, eh? */
- return r;
-}
-
-/*** Non-blocking write *******************************************************/
-int pptp_write_some(PPTP_CONN * conn) {
- ssize_t retval;
- assert(conn && conn->call);
- retval = write(conn->inet_sock, conn->write_buffer, conn->write_size);
- if (retval < 0) { /* error. */
- if (errno == EAGAIN || errno == EINTR) {
- return 0;
- } else { /* a real error */
- log("write error: %s", strerror(errno));
- return -1;
- }
- }
- assert(retval <= conn->write_size);
- conn->write_size -= retval;
- memmove(conn->write_buffer, conn->write_buffer + retval, conn->write_size);
- ctrlp_rep(conn->write_buffer, retval, 0);
- return 0;
-}
-
-/*** Non-blocking read ********************************************************/
-int pptp_read_some(PPTP_CONN * conn)
-{
- ssize_t retval;
- assert(conn && conn->call);
- if (conn->read_size == conn->read_alloc) { /* need to alloc more memory */
- char *new_buffer = realloc(conn->read_buffer,
- sizeof(*(conn->read_buffer)) * conn->read_alloc * 2);
- if (new_buffer == NULL) {
- log("Out of memory"); return -1;
- }
- conn->read_alloc *= 2;
- conn->read_buffer = new_buffer;
- }
- retval = read(conn->inet_sock, conn->read_buffer + conn->read_size,
- conn->read_alloc - conn->read_size);
- if (retval == 0) {
- log("read returned zero, peer has closed");
- return -1;
- }
- if (retval < 0) {
- if (errno == EINTR || errno == EAGAIN)
- return 0;
- else { /* a real error */
- log("read error: %s", strerror(errno));
- return -1;
- }
- }
- conn->read_size += retval;
- assert(conn->read_size <= conn->read_alloc);
- return 0;
-}
-
-/*** Packet formation *********************************************************/
-int pptp_make_packet(PPTP_CONN * conn, void **buf, size_t *size)
-{
- struct pptp_header *header;
- size_t bad_bytes = 0;
- assert(conn && conn->call); assert(buf != NULL); assert(size != NULL);
- /* Give up unless there are at least sizeof(pptp_header) bytes */
- while ((conn->read_size-bad_bytes) >= sizeof(struct pptp_header)) {
- /* Throw out bytes until we have a valid header. */
- header = (struct pptp_header *) (conn->read_buffer + bad_bytes);
- if (ntoh32(header->magic) != PPTP_MAGIC) goto throwitout;
- if (ntoh16(header->reserved0) != 0)
- log("reserved0 field is not zero! (0x%x) Cisco feature? \n",
- ntoh16(header->reserved0));
- if (ntoh16(header->length) < sizeof(struct pptp_header)) goto throwitout;
- if (ntoh16(header->length) > PPTP_CTRL_SIZE_MAX) goto throwitout;
- /* well. I guess it's good. Let's see if we've got it all. */
- if (ntoh16(header->length) > (conn->read_size-bad_bytes))
- /* nope. Let's wait until we've got it, then. */
- goto flushbadbytes;
- /* One last check: */
- if ((ntoh16(header->pptp_type) == PPTP_MESSAGE_CONTROL) &&
- (ntoh16(header->length) !=
- PPTP_CTRL_SIZE(ntoh16(header->ctrl_type))))
- goto throwitout;
- /* well, I guess we've got it. */
- *size = ntoh16(header->length);
- *buf = malloc(*size);
- if (*buf == NULL) { log("Out of memory."); return 0; /* ack! */ }
- memcpy(*buf, conn->read_buffer + bad_bytes, *size);
- /* Delete this packet from the read_buffer. */
- conn->read_size -= (bad_bytes + *size);
- memmove(conn->read_buffer, conn->read_buffer + bad_bytes + *size,
- conn->read_size);
- if (bad_bytes > 0)
- log("%lu bad bytes thrown away.", (unsigned long) bad_bytes);
- return 1;
-throwitout:
- bad_bytes++;
- }
-flushbadbytes:
- /* no more packets. Let's get rid of those bad bytes */
- conn->read_size -= bad_bytes;
- memmove(conn->read_buffer, conn->read_buffer + bad_bytes, conn->read_size);
- if (bad_bytes > 0)
- log("%lu bad bytes thrown away.", (unsigned long) bad_bytes);
- return 0;
-}
-
-/*** pptp_send_ctrl_packet ****************************************************/
-int pptp_send_ctrl_packet(PPTP_CONN * conn, void * buffer, size_t size)
-{
- assert(conn && conn->call); assert(buffer);
- if( conn->write_size > 0) pptp_write_some( conn);
- if( conn->write_size == 0) {
- ssize_t retval;
- retval = write(conn->inet_sock, buffer, size);
- if (retval < 0) { /* error. */
- if (errno == EAGAIN || errno == EINTR) {
- /* ignore */;
- retval = 0;
- } else { /* a real error */
- log("write error: %s", strerror(errno));
- pptp_conn_destroy(conn); /* shut down fast. */
- return 0;
- }
- }
- ctrlp_rep( buffer, retval, 0);
- size -= retval;
- if( size <= 0) return 1;
- }
- /* Shove anything not written into the write buffer */
- if (conn->write_size + size > conn->write_alloc) { /* need more memory */
- char *new_buffer = realloc(conn->write_buffer,
- sizeof(*(conn->write_buffer)) * conn->write_alloc * 2);
- if (new_buffer == NULL) {
- log("Out of memory"); return 0;
- }
- conn->write_alloc *= 2;
- conn->write_buffer = new_buffer;
- }
- memcpy(conn->write_buffer + conn->write_size, buffer, size);
- conn->write_size += size;
- ctrlp_rep( buffer,size,1);
- return 1;
-}
-
-/*** Packet Dispatch **********************************************************/
-int pptp_dispatch_packet(PPTP_CONN * conn, void * buffer, size_t size)
-{
- int r = 0;
- struct pptp_header *header = (struct pptp_header *)buffer;
- assert(conn && conn->call); assert(buffer);
- assert(ntoh32(header->magic) == PPTP_MAGIC);
- assert(ntoh16(header->length) == size);
- switch (ntoh16(header->pptp_type)) {
- case PPTP_MESSAGE_CONTROL:
- r = ctrlp_disp(conn, buffer, size);
- break;
- case PPTP_MESSAGE_MANAGE:
- /* MANAGEMENT messages aren't even part of the spec right now. */
- log("PPTP management message received, but not understood.");
- break;
- default:
- log("Unknown PPTP control message type received: %u",
- (unsigned int) ntoh16(header->pptp_type));
- break;
- }
- return r;
-}
-
-/*** log echo request/replies *************************************************/
-static void logecho( int type)
-{
- /* hack to stop flooding the log files (the most interesting part is right
- * after the connection built-up) */
- if( nlogecho > 0) {
- log( "Echo Re%s received.", type == PPTP_ECHO_RQST ? "quest" :"ply");
- if( --nlogecho == 0)
- log("no more Echo Reply/Request packets will be reported.");
- }
-}
-
-/*** pptp_dispatch_ctrl_packet ************************************************/
-int ctrlp_disp(PPTP_CONN * conn, void * buffer, size_t size)
-{
- struct pptp_header *header = (struct pptp_header *)buffer;
- u_int8_t close_reason = PPTP_STOP_NONE;
- assert(conn && conn->call); assert(buffer);
- assert(ntoh32(header->magic) == PPTP_MAGIC);
- assert(ntoh16(header->length) == size);
- assert(ntoh16(header->pptp_type) == PPTP_MESSAGE_CONTROL);
- if (size < PPTP_CTRL_SIZE(ntoh16(header->ctrl_type))) {
- log("Invalid packet received [type: %d; length: %d].",
- (int) ntoh16(header->ctrl_type), (int) size);
- return 0;
- }
- switch (ntoh16(header->ctrl_type)) {
- /* ----------- STANDARD Start-Session MESSAGES ------------ */
- case PPTP_START_CTRL_CONN_RQST:
- {
- struct pptp_start_ctrl_conn *packet =
- (struct pptp_start_ctrl_conn *) buffer;
- struct pptp_start_ctrl_conn reply = {
- PPTP_HEADER_CTRL(PPTP_START_CTRL_CONN_RPLY),
- hton16(PPTP_VERSION), 0, 0,
- hton32(PPTP_FRAME_CAP), hton32(PPTP_BEARER_CAP),
- hton16(PPTP_MAX_CHANNELS), hton16(PPTP_FIRMWARE_VERSION),
- PPTP_HOSTNAME, PPTP_VENDOR };
- int idx, rc;
- log("Received Start Control Connection Request");
- /* fix this packet, if necessary */
- idx = get_quirk_index();
- if (idx != -1 && pptp_fixups[idx].start_ctrl_conn) {
- if ((rc = pptp_fixups[idx].start_ctrl_conn(&reply)))
- warn("calling the start_ctrl_conn hook failed (%d)", rc);
- }
- if (conn->conn_state == CONN_IDLE) {
- if (ntoh16(packet->version) < PPTP_VERSION) {
- /* Can't support this (earlier) PPTP_VERSION */
- reply.version = packet->version;
- /* protocol version not supported */
- reply.result_code = hton8(5);
- pptp_send_ctrl_packet(conn, &reply, sizeof(reply));
- pptp_reset_timer(); /* give sender a chance for a retry */
- } else { /* same or greater version */
- if (pptp_send_ctrl_packet(conn, &reply, sizeof(reply))) {
- conn->conn_state = CONN_ESTABLISHED;
- log("server connection ESTABLISHED.");
- pptp_reset_timer();
- }
- }
- }
- break;
- }
- case PPTP_START_CTRL_CONN_RPLY:
- {
- struct pptp_start_ctrl_conn *packet =
- (struct pptp_start_ctrl_conn *) buffer;
- log("Received Start Control Connection Reply");
- if (conn->conn_state == CONN_WAIT_CTL_REPLY) {
- /* XXX handle collision XXX [see rfc] */
- if (ntoh16(packet->version) != PPTP_VERSION) {
- if (conn->callback != NULL)
- conn->callback(conn, CONN_OPEN_FAIL);
- close_reason = PPTP_STOP_PROTOCOL;
- goto pptp_conn_close;
- }
- if (ntoh8(packet->result_code) != 1 &&
- /* J'ai change le if () afin que la connection ne se ferme
- * pas pour un "rien" :p adel@cybercable.fr -
- *
- * Don't close the connection if the result code is zero
- * (feature found in certain ADSL modems)
- */
- ntoh8(packet->result_code) != 0) {
- log("Negative reply received to our Start Control "
- "Connection Request");
- ctrlp_error(packet->result_code, packet->error_code,
- -1, pptp_start_ctrl_conn_rply,
- MAX_START_CTRL_CONN_REPLY);
- if (conn->callback != NULL)
- conn->callback(conn, CONN_OPEN_FAIL);
- close_reason = PPTP_STOP_PROTOCOL;
- goto pptp_conn_close;
- }
- conn->conn_state = CONN_ESTABLISHED;
- /* log session properties */
- conn->version = ntoh16(packet->version);
- conn->firmware_rev = ntoh16(packet->firmware_rev);
- memcpy(conn->hostname, packet->hostname, sizeof(conn->hostname));
- memcpy(conn->vendor, packet->vendor, sizeof(conn->vendor));
- pptp_reset_timer(); /* 60 seconds until keep-alive */
- log("Client connection established.");
- if (conn->callback != NULL)
- conn->callback(conn, CONN_OPEN_DONE);
- } /* else goto pptp_conn_close; */
- break;
- }
- /* ----------- STANDARD Stop-Session MESSAGES ------------ */
- case PPTP_STOP_CTRL_CONN_RQST:
- {
- /* conn_state should be CONN_ESTABLISHED, but it could be
- * something else */
- struct pptp_stop_ctrl_conn reply = {
- PPTP_HEADER_CTRL(PPTP_STOP_CTRL_CONN_RPLY),
- hton8(1), hton8(PPTP_GENERAL_ERROR_NONE), 0
- };
- log("Received Stop Control Connection Request.");
- if (conn->conn_state == CONN_IDLE) break;
- if (pptp_send_ctrl_packet(conn, &reply, sizeof(reply))) {
- if (conn->callback != NULL)
- conn->callback(conn, CONN_CLOSE_RQST);
- conn->conn_state = CONN_IDLE;
- return -1;
- }
- break;
- }
- case PPTP_STOP_CTRL_CONN_RPLY:
- {
- log("Received Stop Control Connection Reply.");
- /* conn_state should be CONN_WAIT_STOP_REPLY, but it
- * could be something else */
- if (conn->conn_state == CONN_IDLE) break;
- conn->conn_state = CONN_IDLE;
- return -1;
- }
- /* ----------- STANDARD Echo/Keepalive MESSAGES ------------ */
- case PPTP_ECHO_RPLY:
- {
- struct pptp_echo_rply *packet =
- (struct pptp_echo_rply *) buffer;
- logecho( PPTP_ECHO_RPLY);
- if ((conn->ka_state == KA_OUTSTANDING) &&
- (ntoh32(packet->identifier) == conn->ka_id)) {
- conn->ka_id++;
- conn->ka_state = KA_NONE;
- pptp_reset_timer();
- }
- break;
- }
- case PPTP_ECHO_RQST:
- {
- struct pptp_echo_rqst *packet =
- (struct pptp_echo_rqst *) buffer;
- struct pptp_echo_rply reply = {
- PPTP_HEADER_CTRL(PPTP_ECHO_RPLY),
- packet->identifier, /* skip hton32(ntoh32(id)) */
- hton8(1), hton8(PPTP_GENERAL_ERROR_NONE), 0
- };
- logecho( PPTP_ECHO_RQST);
- pptp_send_ctrl_packet(conn, &reply, sizeof(reply));
- pptp_reset_timer();
- break;
- }
- /* ----------- OUTGOING CALL MESSAGES ------------ */
- case PPTP_OUT_CALL_RQST:
- {
- struct pptp_out_call_rqst *packet =
- (struct pptp_out_call_rqst *)buffer;
- struct pptp_out_call_rply reply = {
- PPTP_HEADER_CTRL(PPTP_OUT_CALL_RPLY),
- 0 /* callid */, packet->call_id, 1, PPTP_GENERAL_ERROR_NONE, 0,
- hton32(PPTP_CONNECT_SPEED),
- hton16(PPTP_WINDOW), hton16(PPTP_DELAY), 0
- };
- log("Received Outgoing Call Request.");
- /* XXX PAC: eventually this should make an outgoing call. XXX */
- reply.result_code = hton8(7); /* outgoing calls verboten */
- pptp_send_ctrl_packet(conn, &reply, sizeof(reply));
- break;
- }
- case PPTP_OUT_CALL_RPLY:
- {
- struct pptp_out_call_rply *packet =
- (struct pptp_out_call_rply *)buffer;
- PPTP_CALL * call;
- u_int16_t callid = ntoh16(packet->call_id_peer);
- log("Received Outgoing Call Reply.");
- if (!vector_search(conn->call, (int) callid, &call)) {
- log("PPTP_OUT_CALL_RPLY received for non-existant call: "
- "peer call ID (us) %d call ID (them) %d.",
- callid, ntoh16(packet->call_id));
- break;
- }
- if (call->call_type != PPTP_CALL_PNS) {
- log("Ack! How did this call_type get here?"); /* XXX? */
- break;
- }
- if (call->state.pns != PNS_WAIT_REPLY) {
- warn("Unexpected(?) Outgoing Call Reply will be ignored.");
- break;
- }
- /* check for errors */
- if (packet->result_code != 1) {
- /* An error. Log it verbosely. */
- log("Our outgoing call request [callid %d] has not been "
- "accepted.", (int) callid);
- ctrlp_error(packet->result_code, packet->error_code,
- packet->cause_code, pptp_out_call_reply_result,
- MAX_OUT_CALL_REPLY_RESULT);
- call->state.pns = PNS_IDLE;
- if (call->callback != NULL)
- call->callback(conn, call, CALL_OPEN_FAIL);
- pptp_call_destroy(conn, call);
- } else {
- /* connection established */
- call->state.pns = PNS_ESTABLISHED;
- call->peer_call_id = ntoh16(packet->call_id);
- call->speed = ntoh32(packet->speed);
- pptp_reset_timer();
- /* call pptp_set_link. unless the user specified a quirk
- and this quirk has a set_link hook, this is a noop */
- pptp_set_link(conn, call->peer_call_id);
- if (call->callback != NULL)
- call->callback(conn, call, CALL_OPEN_DONE);
- log("Outgoing call established (call ID %u, peer's "
- "call ID %u).\n", call->call_id, call->peer_call_id);
- }
- break;
- }
- /* ----------- INCOMING CALL MESSAGES ------------ */
- /* XXX write me XXX */
- /* ----------- CALL CONTROL MESSAGES ------------ */
- case PPTP_CALL_CLEAR_RQST:
- {
- struct pptp_call_clear_rqst *packet =
- (struct pptp_call_clear_rqst *)buffer;
- struct pptp_call_clear_ntfy reply = {
- PPTP_HEADER_CTRL(PPTP_CALL_CLEAR_NTFY), packet->call_id,
- 1, PPTP_GENERAL_ERROR_NONE, 0, 0, {0}
- };
- log("Received Call Clear Request.");
- if (vector_contains(conn->call, ntoh16(packet->call_id))) {
- PPTP_CALL * call;
- vector_search(conn->call, ntoh16(packet->call_id), &call);
- if (call->callback != NULL)
- call->callback(conn, call, CALL_CLOSE_RQST);
- pptp_send_ctrl_packet(conn, &reply, sizeof(reply));
- pptp_call_destroy(conn, call);
- log("Call closed (RQST) (call id %d)", (int) call->call_id);
- }
- break;
- }
- case PPTP_CALL_CLEAR_NTFY:
- {
- struct pptp_call_clear_ntfy *packet =
- (struct pptp_call_clear_ntfy *)buffer;
- log("Call disconnect notification received (call id %d)",
- ntoh16(packet->call_id));
- if (vector_contains(conn->call, ntoh16(packet->call_id))) {
- PPTP_CALL * call;
- ctrlp_error(packet->result_code, packet->error_code,
- packet->cause_code, pptp_call_disc_ntfy,
- MAX_CALL_DISC_NTFY);
- vector_search(conn->call, ntoh16(packet->call_id), &call);
- pptp_call_destroy(conn, call);
- }
- /* XXX we could log call stats here XXX */
- /* XXX not all servers send this XXX */
- break;
- }
- case PPTP_SET_LINK_INFO:
- {
- /* I HAVE NO CLUE WHAT TO DO IF send_accm IS NOT 0! */
- /* this is really dealt with in the HDLC deencapsulation, anyway. */
- struct pptp_set_link_info *packet =
- (struct pptp_set_link_info *)buffer;
- /* log it. */
- log("PPTP_SET_LINK_INFO received from peer_callid %u",
- (unsigned int) ntoh16(packet->call_id_peer));
- log(" send_accm is %08lX, recv_accm is %08lX",
- (unsigned long) ntoh32(packet->send_accm),
- (unsigned long) ntoh32(packet->recv_accm));
- if (!(ntoh32(packet->send_accm) == 0 &&
- ntoh32(packet->recv_accm) == 0))
- warn("Non-zero Async Control Character Maps are not supported!");
- break;
- }
- default:
- log("Unrecognized Packet %d received.",
- (int) ntoh16(((struct pptp_header *)buffer)->ctrl_type));
- /* goto pptp_conn_close; */
- break;
- }
- return 0;
-pptp_conn_close:
- warn("pptp_conn_close(%d)", (int) close_reason);
- pptp_conn_close(conn, close_reason);
- return 0;
-}
-
-/*** pptp_set_link **************************************************************/
-void pptp_set_link(PPTP_CONN* conn, int peer_call_id)
-{
- int idx, rc;
- /* if we need to send a set_link packet because of buggy
- hardware or pptp server, do it now */
- if ((idx = get_quirk_index()) != -1 && pptp_fixups[idx].set_link_hook) {
- struct pptp_set_link_info packet;
- if ((rc = pptp_fixups[idx].set_link_hook(&packet, peer_call_id)))
- warn("calling the set_link hook failed (%d)", rc);
- if (pptp_send_ctrl_packet(conn, &packet, sizeof(packet))) {
- pptp_reset_timer();
- }
- }
-}
-
-/*** Get info from call structure *********************************************/
-/* NOTE: The peer_call_id is undefined until we get a server response. */
-void pptp_call_get_ids(PPTP_CONN * conn, PPTP_CALL * call,
- u_int16_t * call_id, u_int16_t * peer_call_id)
-{
- assert(conn != NULL); assert(call != NULL);
- *call_id = call->call_id;
- *peer_call_id = call->peer_call_id;
-}
-
-/*** pptp_call_closure_put ****************************************************/
-void pptp_call_closure_put(PPTP_CONN * conn, PPTP_CALL * call, void *cl)
-{
- assert(conn != NULL); assert(call != NULL);
- call->closure = cl;
-}
-
-/*** pptp_call_closure_get ****************************************************/
-void * pptp_call_closure_get(PPTP_CONN * conn, PPTP_CALL * call)
-{
- assert(conn != NULL); assert(call != NULL);
- return call->closure;
-}
-
-/*** pptp_conn_closure_put ****************************************************/
-void pptp_conn_closure_put(PPTP_CONN * conn, void *cl)
-{
- assert(conn != NULL);
- conn->closure = cl;
-}
-
-/*** pptp_conn_closure_get ****************************************************/
-void * pptp_conn_closure_get(PPTP_CONN * conn)
-{
- assert(conn != NULL);
- return conn->closure;
-}
-
-/*** Reset keep-alive timer ***************************************************/
-static void pptp_reset_timer(void)
-{
- const struct itimerval tv = { { 0, 0 }, /* stop on time-out */
- { idle_wait, 0 } };
- if (idle_wait) setitimer(ITIMER_REAL, &tv, NULL);
-}
-
-
-/*** Handle keep-alive timer **************************************************/
-static void pptp_handle_timer()
-{
- int i;
- /* "Keep Alives and Timers, 1": check connection state */
- if (global.conn->conn_state != CONN_ESTABLISHED) {
- if (global.conn->conn_state == CONN_WAIT_STOP_REPLY)
- /* hard close. */
- pptp_conn_destroy(global.conn);
- else /* soft close */
- pptp_conn_close(global.conn, PPTP_STOP_NONE);
- }
- /* "Keep Alives and Timers, 2": check echo status */
- if (global.conn->ka_state == KA_OUTSTANDING) {
- /* no response to keep-alive */
- log ("closing control connection due to missing echo reply");
- pptp_conn_close(global.conn, PPTP_STOP_NONE);
- } else { /* ka_state == NONE */ /* send keep-alive */
- struct pptp_echo_rqst rqst = {
- PPTP_HEADER_CTRL(PPTP_ECHO_RQST), hton32(global.conn->ka_id) };
- pptp_send_ctrl_packet(global.conn, &rqst, sizeof(rqst));
- global.conn->ka_state = KA_OUTSTANDING;
- }
- /* check incoming/outgoing call states for !IDLE && !ESTABLISHED */
- for (i = 0; i < vector_size(global.conn->call); i++) {
- PPTP_CALL * call = vector_get_Nth(global.conn->call, i);
- if (call->call_type == PPTP_CALL_PNS) {
- if (call->state.pns == PNS_WAIT_REPLY) {
- /* send close request */
- pptp_call_close(global.conn, call);
- assert(call->state.pns == PNS_WAIT_DISCONNECT);
- } else if (call->state.pns == PNS_WAIT_DISCONNECT) {
- /* hard-close the call */
- pptp_call_destroy(global.conn, call);
- }
- } else if (call->call_type == PPTP_CALL_PAC) {
- if (call->state.pac == PAC_WAIT_REPLY) {
- /* XXX FIXME -- drop the PAC connection XXX */
- } else if (call->state.pac == PAC_WAIT_CS_ANS) {
- /* XXX FIXME -- drop the PAC connection XXX */
- }
- }
- }
- pptp_reset_timer();
-}
diff --git a/pppd_plugin/src/pptp_ctrl.h b/pppd_plugin/src/pptp_ctrl.h
deleted file mode 100644
index a7bb506..0000000
--- a/pppd_plugin/src/pptp_ctrl.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* pptp_ctrl.h ... handle PPTP control connection.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: pptp_ctrl.h,v 1.5 2004/11/09 01:42:32 quozl Exp $
- */
-
-#ifndef INC_PPTP_CTRL_H
-#define INC_PPTP_CTRL_H
-#include <sys/types.h>
-
-typedef struct PPTP_CONN PPTP_CONN;
-typedef struct PPTP_CALL PPTP_CALL;
-
-enum call_state { CALL_OPEN_RQST, CALL_OPEN_DONE, CALL_OPEN_FAIL,
- CALL_CLOSE_RQST, CALL_CLOSE_DONE };
-enum conn_state { CONN_OPEN_RQST, CONN_OPEN_DONE, CONN_OPEN_FAIL,
- CONN_CLOSE_RQST, CONN_CLOSE_DONE };
-
-typedef void (*pptp_call_cb)(PPTP_CONN*, PPTP_CALL*, enum call_state);
-typedef void (*pptp_conn_cb)(PPTP_CONN*, enum conn_state);
-
-/* if 'isclient' is true, then will send 'conn open' packet to other host.
- * not necessary if this is being opened by a server process after
- * receiving a conn_open packet from client.
- */
-PPTP_CONN * pptp_conn_open(int inet_sock, int isclient,
- pptp_conn_cb callback);
-PPTP_CALL * pptp_call_open(PPTP_CONN * conn, int call_id,
- pptp_call_cb callback, char *phonenr,int window);
-int pptp_conn_established(PPTP_CONN * conn);
-/* soft close. Will callback on completion. */
-void pptp_call_close(PPTP_CONN * conn, PPTP_CALL * call);
-/* hard close. */
-void pptp_call_destroy(PPTP_CONN *conn, PPTP_CALL *call);
-/* soft close. Will callback on completion. */
-void pptp_conn_close(PPTP_CONN * conn, u_int8_t close_reason);
-/* hard close */
-void pptp_conn_destroy(PPTP_CONN * conn);
-
-/* Add file descriptors used by pptp to fd_set. */
-void pptp_fd_set(PPTP_CONN * conn, fd_set * read_set, fd_set * write_set, int *max_fd);
-/* handle any pptp file descriptors set in fd_set, and clear them */
-int pptp_dispatch(PPTP_CONN * conn, fd_set * read_set, fd_set * write_set);
-
-/* Get info about connection, call */
-void pptp_call_get_ids(PPTP_CONN * conn, PPTP_CALL * call,
- u_int16_t * call_id, u_int16_t * peer_call_id);
-/* Arbitrary user data about this call/connection.
- * It is the caller's responsibility to free this data before calling
- * pptp_call|conn_close()
- */
-void * pptp_conn_closure_get(PPTP_CONN * conn);
-void pptp_conn_closure_put(PPTP_CONN * conn, void *cl);
-void * pptp_call_closure_get(PPTP_CONN * conn, PPTP_CALL * call);
-void pptp_call_closure_put(PPTP_CONN * conn, PPTP_CALL * call, void *cl);
-
-#endif /* INC_PPTP_CTRL_H */
diff --git a/pppd_plugin/src/pptp_msg.h b/pppd_plugin/src/pptp_msg.h
deleted file mode 100644
index e50ce0c..0000000
--- a/pppd_plugin/src/pptp_msg.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/* pptp.h: packet structures and magic constants for the PPTP protocol
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: pptp_msg.h,v 1.3 2003/02/15 10:37:21 quozl Exp $
- */
-
-#ifndef INC_PPTP_H
-#define INC_PPTP_H
-
-/* Grab definitions of int16, int32, etc. */
-#include <sys/types.h>
-/* define "portable" htons, etc. */
-#define hton8(x) (x)
-#define ntoh8(x) (x)
-#define hton16(x) htons(x)
-#define ntoh16(x) ntohs(x)
-#define hton32(x) htonl(x)
-#define ntoh32(x) ntohl(x)
-
-/* PPTP magic numbers: ----------------------------------------- */
-
-#define PPTP_MAGIC 0x1A2B3C4D /* Magic cookie for PPTP datagrams */
-#define PPTP_PORT 1723 /* PPTP TCP port number */
-#define PPTP_PROTO 47 /* PPTP IP protocol number */
-
-/* Control Connection Message Types: --------------------------- */
-
-#define PPTP_MESSAGE_CONTROL 1
-#define PPTP_MESSAGE_MANAGE 2
-
-/* Control Message Types: -------------------------------------- */
-
-/* (Control Connection Management) */
-#define PPTP_START_CTRL_CONN_RQST 1
-#define PPTP_START_CTRL_CONN_RPLY 2
-#define PPTP_STOP_CTRL_CONN_RQST 3
-#define PPTP_STOP_CTRL_CONN_RPLY 4
-#define PPTP_ECHO_RQST 5
-#define PPTP_ECHO_RPLY 6
-
-/* (Call Management) */
-#define PPTP_OUT_CALL_RQST 7
-#define PPTP_OUT_CALL_RPLY 8
-#define PPTP_IN_CALL_RQST 9
-#define PPTP_IN_CALL_RPLY 10
-#define PPTP_IN_CALL_CONNECT 11
-#define PPTP_CALL_CLEAR_RQST 12
-#define PPTP_CALL_CLEAR_NTFY 13
-
-/* (Error Reporting) */
-#define PPTP_WAN_ERR_NTFY 14
-
-/* (PPP Session Control) */
-#define PPTP_SET_LINK_INFO 15
-
-/* PPTP version information: --------------------------------------*/
-#define PPTP_VERSION_STRING "1.00"
-#define PPTP_VERSION 0x100
-#define PPTP_FIRMWARE_STRING "0.01"
-#define PPTP_FIRMWARE_VERSION 0x001
-
-/* PPTP capabilities: ---------------------------------------------*/
-
-/* (Framing capabilities for msg sender) */
-#define PPTP_FRAME_ASYNC 1
-#define PPTP_FRAME_SYNC 2
-#define PPTP_FRAME_ANY 3
-
-/* (Bearer capabilities for msg sender) */
-#define PPTP_BEARER_ANALOG 1
-#define PPTP_BEARER_DIGITAL 2
-#define PPTP_BEARER_ANY 3
-
-#define PPTP_RESULT_GENERAL_ERROR 2
-
-/* (Reasons to close a connection) */
-#define PPTP_STOP_NONE 1 /* no good reason */
-#define PPTP_STOP_PROTOCOL 2 /* can't support peer's protocol version */
-#define PPTP_STOP_LOCAL_SHUTDOWN 3 /* requester is being shut down */
-
-/* PPTP datagram structures (all data in network byte order): ----------*/
-
-struct pptp_header {
- u_int16_t length; /* message length in octets, including header */
- u_int16_t pptp_type; /* PPTP message type. 1 for control message. */
- u_int32_t magic; /* this should be PPTP_MAGIC. */
- u_int16_t ctrl_type; /* Control message type (0-15) */
- u_int16_t reserved0; /* reserved. MUST BE ZERO. */
-};
-
-struct pptp_start_ctrl_conn { /* for control message types 1 and 2 */
- struct pptp_header header;
-
- u_int16_t version; /* PPTP protocol version. = PPTP_VERSION */
- u_int8_t result_code; /* these two fields should be zero on rqst msg*/
- u_int8_t error_code; /* 0 unless result_code==2 (General Error) */
- u_int32_t framing_cap; /* Framing capabilities */
- u_int32_t bearer_cap; /* Bearer Capabilities */
- u_int16_t max_channels; /* Maximum Channels (=0 for PNS, PAC ignores) */
- u_int16_t firmware_rev; /* Firmware or Software Revision */
- u_int8_t hostname[64]; /* Host Name (64 octets, zero terminated) */
- u_int8_t vendor[64]; /* Vendor string (64 octets, zero term.) */
- /* MS says that end of hostname/vendor fields should be filled with */
- /* octets of value 0, but Win95 PPTP driver doesn't do this. */
-};
-
-struct pptp_stop_ctrl_conn { /* for control message types 3 and 4 */
- struct pptp_header header;
-
- u_int8_t reason_result; /* reason for rqst, result for rply */
- u_int8_t error_code; /* MUST be 0, unless rply result==2 (general err)*/
- u_int16_t reserved1; /* MUST be 0 */
-};
-
-struct pptp_echo_rqst { /* for control message type 5 */
- struct pptp_header header;
- u_int32_t identifier; /* arbitrary value set by sender which is used */
- /* to match up reply and request */
-};
-
-struct pptp_echo_rply { /* for control message type 6 */
- struct pptp_header header;
- u_int32_t identifier; /* should correspond to id of rqst */
- u_int8_t result_code;
- u_int8_t error_code; /* =0, unless result_code==2 (general error) */
- u_int16_t reserved1; /* MUST BE ZERO */
-};
-
-struct pptp_out_call_rqst { /* for control message type 7 */
- struct pptp_header header;
- u_int16_t call_id; /* Call ID (unique id used to multiplex data) */
- u_int16_t call_sernum; /* Call Serial Number (used for logging) */
- u_int32_t bps_min; /* Minimum BPS (lowest acceptable line speed) */
- u_int32_t bps_max; /* Maximum BPS (highest acceptable line speed) */
- u_int32_t bearer; /* Bearer type */
- u_int32_t framing; /* Framing type */
- u_int16_t recv_size; /* Recv. Window Size (no. of buffered packets) */
- u_int16_t delay; /* Packet Processing Delay (in 1/10 sec) */
- u_int16_t phone_len; /* Phone Number Length (num. of valid digits) */
- u_int16_t reserved1; /* MUST BE ZERO */
- u_int8_t phone_num[64]; /* Phone Number (64 octets, null term.) */
- u_int8_t subaddress[64]; /* Subaddress (64 octets, null term.) */
-};
-
-struct pptp_out_call_rply { /* for control message type 8 */
- struct pptp_header header;
- u_int16_t call_id; /* Call ID (used to multiplex data over tunnel)*/
- u_int16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst)*/
- u_int8_t result_code; /* Result Code (1 is no errors) */
- u_int8_t error_code; /* Error Code (=0 unless result_code==2) */
- u_int16_t cause_code; /* Cause Code (addt'l failure information) */
- u_int32_t speed; /* Connect Speed (in BPS) */
- u_int16_t recv_size; /* Recv. Window Size (no. of buffered packets) */
- u_int16_t delay; /* Packet Processing Delay (in 1/10 sec) */
- u_int32_t channel; /* Physical Channel ID (for logging) */
-};
-
-struct pptp_in_call_rqst { /* for control message type 9 */
- struct pptp_header header;
- u_int16_t call_id; /* Call ID (unique id used to multiplex data) */
- u_int16_t call_sernum; /* Call Serial Number (used for logging) */
- u_int32_t bearer; /* Bearer type */
- u_int32_t channel; /* Physical Channel ID (for logging) */
- u_int16_t dialed_len; /* Dialed Number Length (# of valid digits) */
- u_int16_t dialing_len; /* Dialing Number Length (# of valid digits) */
- u_int8_t dialed_num[64]; /* Dialed Number (64 octets, zero term.) */
- u_int8_t dialing_num[64]; /* Dialing Number (64 octets, zero term.) */
- u_int8_t subaddress[64]; /* Subaddress (64 octets, zero term.) */
-};
-
-struct pptp_in_call_rply { /* for control message type 10 */
- struct pptp_header header;
- u_int16_t call_id; /* Call ID (used to multiplex data over tunnel)*/
- u_int16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst)*/
- u_int8_t result_code; /* Result Code (1 is no errors) */
- u_int8_t error_code; /* Error Code (=0 unless result_code==2) */
- u_int16_t recv_size; /* Recv. Window Size (no. of buffered packets) */
- u_int16_t delay; /* Packet Processing Delay (in 1/10 sec) */
- u_int16_t reserved1; /* MUST BE ZERO */
-};
-
-struct pptp_in_call_connect { /* for control message type 11 */
- struct pptp_header header;
- u_int16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst)*/
- u_int16_t reserved1; /* MUST BE ZERO */
- u_int32_t speed; /* Connect Speed (in BPS) */
- u_int16_t recv_size; /* Recv. Window Size (no. of buffered packets) */
- u_int16_t delay; /* Packet Processing Delay (in 1/10 sec) */
- u_int32_t framing; /* Framing type */
-};
-
-struct pptp_call_clear_rqst { /* for control message type 12 */
- struct pptp_header header;
- u_int16_t call_id; /* Call ID (used to multiplex data over tunnel)*/
- u_int16_t reserved1; /* MUST BE ZERO */
-};
-
-struct pptp_call_clear_ntfy { /* for control message type 13 */
- struct pptp_header header;
- u_int16_t call_id; /* Call ID (used to multiplex data over tunnel)*/
- u_int8_t result_code; /* Result Code */
- u_int8_t error_code; /* Error Code (=0 unless result_code==2) */
- u_int16_t cause_code; /* Cause Code (for ISDN, is Q.931 cause code) */
- u_int16_t reserved1; /* MUST BE ZERO */
- u_int8_t call_stats[128]; /* Call Statistics: 128 octets, ascii, 0-term */
-};
-
-struct pptp_wan_err_ntfy { /* for control message type 14 */
- struct pptp_header header;
- u_int16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst)*/
- u_int16_t reserved1; /* MUST BE ZERO */
- u_int32_t crc_errors; /* CRC errors */
- u_int32_t frame_errors; /* Framing errors */
- u_int32_t hard_errors; /* Hardware overruns */
- u_int32_t buff_errors; /* Buffer overruns */
- u_int32_t time_errors; /* Time-out errors */
- u_int32_t align_errors; /* Alignment errors */
-};
-
-struct pptp_set_link_info { /* for control message type 15 */
- struct pptp_header header;
- u_int16_t call_id_peer; /* Peer's Call ID (call_id of pptp_out_call_rqst) */
- u_int16_t reserved1; /* MUST BE ZERO */
- u_int32_t send_accm; /* Send ACCM (for PPP packets; default 0xFFFFFFFF)*/
- u_int32_t recv_accm; /* Receive ACCM (for PPP pack.;default 0xFFFFFFFF)*/
-};
-
-/* helpful #defines: -------------------------------------------- */
-#define pptp_isvalid_ctrl(header, type, length) \
- (!( ( ntoh16(((struct pptp_header *)header)->length) < (length) ) || \
- ( ntoh16(((struct pptp_header *)header)->pptp_type) !=(type) ) || \
- ( ntoh32(((struct pptp_header *)header)->magic) !=PPTP_MAGIC) || \
- ( ntoh16(((struct pptp_header *)header)->ctrl_type) > PPTP_SET_LINK_INFO) || \
- ( ntoh16(((struct pptp_header *)header)->reserved0) !=0 ) ))
-
-#define PPTP_HEADER_CTRL(type) \
-{ hton16(PPTP_CTRL_SIZE(type)), \
- hton16(PPTP_MESSAGE_CONTROL), \
- hton32(PPTP_MAGIC), \
- hton16(type), 0 }
-
-#define PPTP_CTRL_SIZE(type) ( \
-(type==PPTP_START_CTRL_CONN_RQST)?sizeof(struct pptp_start_ctrl_conn): \
-(type==PPTP_START_CTRL_CONN_RPLY)?sizeof(struct pptp_start_ctrl_conn): \
-(type==PPTP_STOP_CTRL_CONN_RQST )?sizeof(struct pptp_stop_ctrl_conn): \
-(type==PPTP_STOP_CTRL_CONN_RPLY )?sizeof(struct pptp_stop_ctrl_conn): \
-(type==PPTP_ECHO_RQST )?sizeof(struct pptp_echo_rqst): \
-(type==PPTP_ECHO_RPLY )?sizeof(struct pptp_echo_rply): \
-(type==PPTP_OUT_CALL_RQST )?sizeof(struct pptp_out_call_rqst): \
-(type==PPTP_OUT_CALL_RPLY )?sizeof(struct pptp_out_call_rply): \
-(type==PPTP_IN_CALL_RQST )?sizeof(struct pptp_in_call_rqst): \
-(type==PPTP_IN_CALL_RPLY )?sizeof(struct pptp_in_call_rply): \
-(type==PPTP_IN_CALL_CONNECT )?sizeof(struct pptp_in_call_connect): \
-(type==PPTP_CALL_CLEAR_RQST )?sizeof(struct pptp_call_clear_rqst): \
-(type==PPTP_CALL_CLEAR_NTFY )?sizeof(struct pptp_call_clear_ntfy): \
-(type==PPTP_WAN_ERR_NTFY )?sizeof(struct pptp_wan_err_ntfy): \
-(type==PPTP_SET_LINK_INFO )?sizeof(struct pptp_set_link_info): \
-0)
-#define max(a,b) (((a)>(b))?(a):(b))
-#define PPTP_CTRL_SIZE_MAX ( \
-max(sizeof(struct pptp_start_ctrl_conn), \
-max(sizeof(struct pptp_echo_rqst), \
-max(sizeof(struct pptp_echo_rply), \
-max(sizeof(struct pptp_out_call_rqst), \
-max(sizeof(struct pptp_out_call_rply), \
-max(sizeof(struct pptp_in_call_rqst), \
-max(sizeof(struct pptp_in_call_rply), \
-max(sizeof(struct pptp_in_call_connect), \
-max(sizeof(struct pptp_call_clear_rqst), \
-max(sizeof(struct pptp_call_clear_ntfy), \
-max(sizeof(struct pptp_wan_err_ntfy), \
-max(sizeof(struct pptp_set_link_info), 0)))))))))))))
-
-
-/* gre header structure: -------------------------------------------- */
-
-#define PPTP_GRE_PROTO 0x880B
-#define PPTP_GRE_VER 0x1
-
-#define PPTP_GRE_FLAG_C 0x80
-#define PPTP_GRE_FLAG_R 0x40
-#define PPTP_GRE_FLAG_K 0x20
-#define PPTP_GRE_FLAG_S 0x10
-#define PPTP_GRE_FLAG_A 0x80
-
-#define PPTP_GRE_IS_C(f) ((f)&PPTP_GRE_FLAG_C)
-#define PPTP_GRE_IS_R(f) ((f)&PPTP_GRE_FLAG_R)
-#define PPTP_GRE_IS_K(f) ((f)&PPTP_GRE_FLAG_K)
-#define PPTP_GRE_IS_S(f) ((f)&PPTP_GRE_FLAG_S)
-#define PPTP_GRE_IS_A(f) ((f)&PPTP_GRE_FLAG_A)
-
-struct pptp_gre_header {
- u_int8_t flags; /* bitfield */
- u_int8_t ver; /* should be PPTP_GRE_VER (enhanced GRE) */
- u_int16_t protocol; /* should be PPTP_GRE_PROTO (ppp-encaps) */
- u_int16_t payload_len; /* size of ppp payload, not inc. gre header */
- u_int16_t call_id; /* peer's call_id for this session */
- u_int32_t seq; /* sequence number. Present if S==1 */
- u_int32_t ack; /* seq number of highest packet recieved by */
- /* sender in this session */
-};
-
-#endif /* INC_PPTP_H */
diff --git a/pppd_plugin/src/pptp_options.h b/pppd_plugin/src/pptp_options.h
deleted file mode 100644
index ebc1c31..0000000
--- a/pppd_plugin/src/pptp_options.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* pptp_options.h ...... various constants used in the PPTP protocol.
- * #define STANDARD to emulate NT 4.0 exactly.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: pptp_options.h,v 1.3 2004/11/09 01:42:32 quozl Exp $
- */
-
-#ifndef INC_PPTP_OPTIONS_H
-#define INC_PPTP_OPTIONS_H
-
-#undef PPTP_FIRMWARE_STRING
-#undef PPTP_FIRMWARE_VERSION
-#define PPTP_BUF_MAX 65536
-#define PPTP_TIMEOUT 60 /* seconds */
-extern int idle_wait;
-extern int max_echo_wait;
-#define PPTP_CONNECT_SPEED 1000000000
-#define PPTP_WINDOW 3
-#define PPTP_DELAY 0
-#define PPTP_BPS_MIN 2400
-#define PPTP_BPS_MAX 1000000000
-
-#ifndef STANDARD
-#define PPTP_MAX_CHANNELS 65535
-#define PPTP_FIRMWARE_STRING "0.01"
-#define PPTP_FIRMWARE_VERSION 0x001
-#define PPTP_HOSTNAME {'l','o','c','a','l',0}
-#define PPTP_VENDOR {'c','a','n','a','n','i','a','n',0}
-#define PPTP_FRAME_CAP PPTP_FRAME_ANY
-#define PPTP_BEARER_CAP PPTP_BEARER_ANY
-#else
-#define PPTP_MAX_CHANNELS 5
-#define PPTP_FIRMWARE_STRING "0.01"
-#define PPTP_FIRMWARE_VERSION 0
-#define PPTP_HOSTNAME {'l','o','c','a','l',0}
-#define PPTP_VENDOR {'N','T',0}
-#define PPTP_FRAME_CAP 2
-#define PPTP_BEARER_CAP 1
-#endif
-
-#endif /* INC_PPTP_OPTIONS_H */
diff --git a/pppd_plugin/src/pptp_quirks.c b/pppd_plugin/src/pptp_quirks.c
deleted file mode 100644
index e4c9013..0000000
--- a/pppd_plugin/src/pptp_quirks.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* pptp_quirks.c ...... various options to fix quirks found in buggy adsl modems
- * mulix <mulix@actcom.co.il>
- *
- * $Id: pptp_quirks.c,v 1.2 2001/11/23 03:42:51 quozl Exp $
- */
-
-#include <string.h>
-#include "orckit_quirks.h"
-#include "pptp_quirks.h"
-
-static int quirk_index = -1;
-
-struct pptp_fixup pptp_fixups[] = {
- {BEZEQ_ISRAEL, ORCKIT, ORCKIT_ATUR3,
- orckit_atur3_build_hook,
- orckit_atur3_start_ctrl_conn_hook,
- orckit_atur3_set_link_hook}
-};
-
-static int fixups_sz = sizeof(pptp_fixups)/sizeof(pptp_fixups[0]);
-
-/* return 0 on success, non 0 otherwise */
-int set_quirk_index(int index)
-{
- if (index >= 0 && index < fixups_sz) {
- quirk_index = index;
- return 0;
- }
-
- return -1;
-}
-
-int get_quirk_index()
-{
- return quirk_index;
-}
-
-/* return the index for this isp in the quirks table, -1 if not found */
-int find_quirk(const char* isp_name)
-{
- int i = 0;
- if (isp_name) {
- while (i < fixups_sz && pptp_fixups[i].isp) {
- if (!strcmp(pptp_fixups[i].isp, isp_name)) {
- return i;
- }
- ++i;
- }
- }
-
- return -1;
-}
-
-
diff --git a/pppd_plugin/src/pptp_quirks.h b/pppd_plugin/src/pptp_quirks.h
deleted file mode 100644
index 291f3d6..0000000
--- a/pppd_plugin/src/pptp_quirks.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* pptp_quirks.h ...... various options to fix quirks found in buggy adsl modems
- * mulix <mulix@actcom.co.il>
- *
- * $Id: pptp_quirks.h,v 1.1 2001/11/20 06:30:10 quozl Exp $
- */
-
-#ifndef INC_PPTP_QUIRKS_H
-#define INC_PPTP_QUIRKS_H
-
-/* isp defs - correspond to slots in the fixups table */
-#define BEZEQ_ISRAEL "BEZEQ_ISRAEL"
-
-/* vendor defs */
-
-#define ORCKIT 1
-#define ALCATEL 2
-
-/* device defs */
-
-#define ORCKIT_ATUR2 1
-#define ORCKIT_ATUR3 2
-
-#include "pptp_msg.h"
-#include "pptp_ctrl.h"
-
-struct pptp_fixup {
- const char* isp; /* which isp? e.g. Bezeq in Israel */
- int vendor; /* which vendor? e.g. Orckit */
- int device; /* which device? e.g. Orckit Atur3 */
-
- /* use this hook to build your own out call request packet */
- int (*out_call_rqst_hook)(struct pptp_out_call_rqst* packet);
-
- /* use this hook to build your own start control connection packet */
- /* note that this hook is called from two different places, depending
- on whether this is a request or reply */
- int (*start_ctrl_conn)(struct pptp_start_ctrl_conn* packet);
-
- /* use this hook if you need to send a 'set_link' packet once
- the connection is established */
- int (*set_link_hook)(struct pptp_set_link_info* packet,
- int peer_call_id);
-};
-
-extern struct pptp_fixup pptp_fixups[];
-
-/* find the index for this isp in the quirks table */
-/* return the index on success, -1 if not found */
-int find_quirk(const char* isp_name);
-
-/* set the global quirk index. return 0 on success, non 0 otherwise */
-int set_quirk_index(int index);
-
-/* get the global quirk index. return the index on success,
- -1 if no quirk is defined */
-int get_quirk_index();
-
-
-#endif /* INC_PPTP_QUIRKS_H */
diff --git a/pppd_plugin/src/util.c b/pppd_plugin/src/util.c
deleted file mode 100644
index dabddbe..0000000
--- a/pppd_plugin/src/util.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/* util.c ....... error message utilities.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: util.c,v 1.11 2005/08/22 00:49:48 quozl Exp $
- */
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <syslog.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include "util.h"
-
-#ifndef PROGRAM_NAME
-#define PROGRAM_NAME "pptp"
-#endif
-
-/* implementation of log_string, defined as extern in util.h */
-char *log_string = "anon";
-
-static void open_log(void) __attribute__ ((constructor));
-static void close_log(void) __attribute__ ((destructor));
-
-#define MAKE_STRING(label) \
-va_list ap; \
-char buf[256], string[256]; \
-va_start(ap, format); \
-vsnprintf(buf, sizeof(buf), format, ap); \
-snprintf(string, sizeof(string), "%s %s[%s:%s:%d]: %s", \
- log_string, label, func, file, line, buf); \
-va_end(ap)
-
-/*** open log *****************************************************************/
-static void open_log(void) {
- openlog(PROGRAM_NAME, LOG_PID, LOG_DAEMON);
-}
-
-/*** close log ****************************************************************/
-static void close_log(void)
-{
- closelog();
-}
-
-/*** print a message to syslog ************************************************/
-void _log(const char *func, const char *file, int line, const char *format, ...)
-{
- MAKE_STRING("log");
- open_log();
- syslog(LOG_NOTICE, "%s", string);
- close_log();
-}
-
-/*** print a warning to syslog ************************************************/
-void _warn(const char *func, const char *file, int line, const char *format, ...)
-{
- MAKE_STRING("warn");
- open_log();
- fprintf(stderr, "%s\n", string);
- syslog(LOG_WARNING, "%s", string);
- close_log();
-}
-
-/*** print a fatal warning to syslog and exit *********************************/
-void _fatal(const char *func, const char *file, int line, const char *format, ...)
-{
- MAKE_STRING("fatal");
- fprintf(stderr, "%s\n", string);
- syslog(LOG_CRIT, "%s", string);
- exit(1);
-}
-
-/*** connect a file to a file descriptor **************************************/
-int file2fd(const char *path, const char *mode, int fd)
-{
- int ok = 0;
- FILE *file = NULL;
- file = fopen(path, mode);
- if (file != NULL && dup2(fileno(file), fd) != -1)
- ok = 1;
- if (file) fclose(file);
- return ok;
-}
-
-/* signal to pipe delivery implementation */
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <string.h>
-
-/* pipe private to process */
-static int sigpipe[2];
-
-/* create a signal pipe, returns 0 for success, -1 with errno for failure */
-int sigpipe_create()
-{
- int rc;
-
- rc = pipe(sigpipe);
- if (rc < 0) return rc;
-
- fcntl(sigpipe[0], F_SETFD, FD_CLOEXEC);
- fcntl(sigpipe[1], F_SETFD, FD_CLOEXEC);
-
-#ifdef O_NONBLOCK
-#define FLAG_TO_SET O_NONBLOCK
-#else
-#ifdef SYSV
-#define FLAG_TO_SET O_NDELAY
-#else /* BSD */
-#define FLAG_TO_SET FNDELAY
-#endif
-#endif
-
- rc = fcntl(sigpipe[1], F_GETFL);
- if (rc != -1)
- rc = fcntl(sigpipe[1], F_SETFL, rc | FLAG_TO_SET);
- if (rc < 0) return rc;
- return 0;
-#undef FLAG_TO_SET
-}
-
-/* generic handler for signals, writes signal number to pipe */
-void sigpipe_handler(int signum)
-{
- write(sigpipe[1], &signum, sizeof(signum));
- signal(signum, sigpipe_handler);
-}
-
-/* assign a signal number to the pipe */
-void sigpipe_assign(int signum)
-{
- struct sigaction sa;
-
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = sigpipe_handler;
- sigaction(signum, &sa, NULL);
-}
-
-/* return the signal pipe read file descriptor for select(2) */
-int sigpipe_fd()
-{
- return sigpipe[0];
-}
-
-/* read and return the pending signal from the pipe */
-int sigpipe_read()
-{
- int signum;
- read(sigpipe[0], &signum, sizeof(signum));
- return signum;
-}
-
-void sigpipe_close()
-{
- close(sigpipe[0]);
- close(sigpipe[1]);
-}
-
diff --git a/pppd_plugin/src/util.h b/pppd_plugin/src/util.h
deleted file mode 100644
index 1ed5079..0000000
--- a/pppd_plugin/src/util.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* util.h ....... error message utilities.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: util.h,v 1.6 2005/03/10 01:18:20 quozl Exp $
- */
-
-#ifndef INC_UTIL_H
-#define INC_UTIL_H
-
-/* log_string is an identifier for this pptp process, passed from
- command line using --log-string=X, and included with every log message.
- Useful for people with multiple pptp sessions open at a time */
-extern char * log_string;
-
-/* log_level sets the logging verbosity. Values range from 0 (errors only)
- to 1 (errors and warnings) to 2 (high verbosity, for debugging) */
-extern int log_level;
-
-void _log(const char *func, const char *file, int line, const char *format, ...)
- __attribute__ ((format (printf, 4, 5)));
-void _warn(const char *func, const char *file, int line, const char *format, ...)
- __attribute__ ((format (printf, 4, 5)));
-void _fatal(const char *func, const char *file, int line, const char *format, ...)
- __attribute__ ((format (printf, 4, 5))) __attribute__ ((noreturn));
-
-#define log(format, args...) \
- _log(__FUNCTION__,__FILE__,__LINE__, format , ## args)
-#define warn(format, args...) \
- _warn(__FUNCTION__,__FILE__,__LINE__, format , ## args)
-#define fatal(format, args...) \
- _fatal(__FUNCTION__,__FILE__,__LINE__, format , ## args)
-
-int file2fd(const char *path, const char *mode, int fd);
-
-/* signal to pipe delivery implementation */
-
-/* create a signal pipe, returns 0 for success, -1 with errno for failure */
-int sigpipe_create();
-
-/* generic handler for signals, writes signal number to pipe */
-void sigpipe_handler(int signum);
-
-/* assign a signal number to the pipe */
-void sigpipe_assign(int signum);
-
-/* return the signal pipe read file descriptor for select(2) */
-int sigpipe_fd();
-
-/* read and return the pending signal from the pipe */
-int sigpipe_read();
-
-void sigpipe_close();
-
-#endif /* INC_UTIL_H */
diff --git a/pppd_plugin/src/vector.c b/pppd_plugin/src/vector.c
deleted file mode 100644
index a26c5de..0000000
--- a/pppd_plugin/src/vector.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* vector.c ..... store a vector of PPTP_CALL information and search it
- * efficiently.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: vector.c,v 1.3 2003/06/17 10:12:55 reink Exp $
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include "pptp_ctrl.h"
-#include "vector.h"
-/* #define VECTOR_DEBUG */
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-struct vector_item {
- int key;
- PPTP_CALL *call;
-};
-
-struct vector_struct {
- struct vector_item *item;
- int size;
- int alloc;
-#ifdef VECTOR_DEBUG
- int key_max;
-#endif
-};
-
-static struct vector_item *binary_search(VECTOR *v, int key);
-
-/*** vector_create ************************************************************/
-VECTOR *vector_create()
-{
- const int INITIAL_SIZE = 4;
-
- VECTOR *v = malloc(sizeof(*v));
- if (v == NULL) return v;
-
- v->size = 0;
- v->alloc = INITIAL_SIZE;
- v->item = malloc(sizeof(*(v->item)) * (v->alloc));
-#ifdef VECTOR_DEBUG
- v->key_max = -1;
-#endif
- if (v->item == NULL) { free(v); return NULL; }
- else return v;
-}
-
-/*** vector_destroy ***********************************************************/
-void vector_destroy(VECTOR *v)
-{
- free(v->item);
-#ifdef VECTOR_DEBUG
- v->item = NULL;
-#endif
- free(v);
-}
-
-/*** vector_size **************************************************************/
-int vector_size(VECTOR *v)
-{
- assert(v != NULL);
- return v->size;
-}
-
-/*** vector_insert*************************************************************
- * nice thing about file descriptors is that we are assured by POSIX
- * that they are monotonically increasing.
- */
-int vector_insert(VECTOR *v, int key, PPTP_CALL * call)
-{
- int i;
- assert(v != NULL && call != NULL);
- assert(!vector_contains(v, key));
-#ifdef VECTOR_DEBUG
- assert(v->key_max < key);
-#endif
- if (!(v->size < v->alloc)) {
- void *tmp = realloc(v->item, sizeof(*(v->item)) * 2 * v->alloc);
- if (tmp != NULL) {
- v->alloc *= 2;
- v->item = tmp;
- } else return FALSE; /* failed to alloc memory. */
- }
- assert(v->size < v->alloc);
- /* for safety, we make this work in the general case;
- * but this is optimized for adding call to the end of the vector.
- */
- for(i = v->size - 1; i >= 0; i--)
- if (v->item[i].key < key)
- break;
- /* insert after item i */
- memmove(&v->item[i + 2], &v->item[i + 1],
- (v->size - i - 1) * sizeof(*(v->item)));
- v->item[i + 1].key = key;
- v->item[i + 1].call = call;
- v->size++;
-#ifdef VECTOR_DEBUG
- if (v->key_max < key) /* ie, always. */
- v->key_max = key;
-#endif
- return TRUE;
-}
-
-/*** vector_remove ************************************************************/
-int vector_remove(VECTOR *v, int key)
-{
- struct vector_item *tmp;
- assert(v != NULL);
- if ((tmp =binary_search(v,key)) == NULL) return FALSE;
- assert(tmp >= v->item && tmp < v->item + v->size);
- memmove(tmp, tmp + 1, (v->size - (v->item - tmp) - 1) * sizeof(*(v->item)));
- v->size--;
- return TRUE;
-}
-
-/*** vector_search ************************************************************/
-int vector_search(VECTOR *v, int key, PPTP_CALL **call)
-{
- struct vector_item *tmp;
- assert(v != NULL);
- tmp = binary_search(v, key);
- if (tmp ==NULL) return FALSE;
- *call = tmp->call;
- return TRUE;
-}
-
-/*** vector_contains **********************************************************/
-int vector_contains(VECTOR *v, int key)
-{
- assert(v != NULL);
- return (binary_search(v, key) != NULL);
-}
-
-/*** vector_item **************************************************************/
-static struct vector_item *binary_search(VECTOR *v, int key)
-{
- int l,r,x;
- l = 0;
- r = v->size - 1;
- while (r >= l) {
- x = (l + r)/2;
- if (key < v->item[x].key) r = x - 1; else l = x + 1;
- if (key == v->item[x].key) return &(v->item[x]);
- }
- return NULL;
-}
-
-/*** vector_scan ***************************************************************
- * Hmm. Let's be fancy and use a binary search for the first
- * unused key, taking advantage of the list is stored sorted; ie
- * we can look at pointers and keys at two different locations,
- * and if (ptr1 - ptr2) = (key1 - key2) then all the slots
- * between ptr1 and ptr2 are filled. Note that ptr1-ptr2 should
- * never be greater than key1-key2 (no duplicate keys!)... we
- * check for this.
- */
-int vector_scan(VECTOR *v, int lo, int hi, int *key)
-{
- int l,r,x;
- assert(v != NULL);
- assert(key != NULL);
- if ((v->size<1) || (lo < v->item[0].key)) { *key = lo; return TRUE; }
- /* our array bounds */
- l = 0; r = v->size - 1;
- while (r > l) {
- /* check for a free spot right after l */
- if (v->item[l].key + 1 < v->item[l + 1].key) { /* found it! */
- *key = v->item[l].key + 1;
- return TRUE;
- }
- /* no dice. Let's see if the free spot is before or after the midpoint */
- x = (l + r)/2;
- /* Okay, we have right (r), left (l) and the probe (x). */
- assert(x - l <= v->item[x].key - v->item[l].key);
- assert(r - x <= v->item[r].key - v->item[x].key);
- if (x - l < v->item[x].key - v->item[l].key)
- /* room between l and x */
- r = x;
- else /* no room between l and x */
- if (r - x < v->item[r].key - v->item[x].key)
- /* room between x and r */
- l = x;
- else /* no room between x and r, either */
- break; /* game over, man. */
- }
- /* no room found in already allocated space. Check to see if
- * there's free space above allocated entries. */
- if (v->item[v->size - 1].key < hi) {
- *key = v->item[v->size - 1].key + 1;
- return TRUE;
- }
- /* outta luck */
- return FALSE;
-}
-
-/*** vector_get_Nth ***********************************************************/
-PPTP_CALL * vector_get_Nth(VECTOR *v, int n)
-{
- assert(v != NULL);
- assert(0 <= n && n < vector_size(v));
- return v->item[n].call;
-}
diff --git a/pppd_plugin/src/vector.h b/pppd_plugin/src/vector.h
deleted file mode 100644
index b18899f..0000000
--- a/pppd_plugin/src/vector.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* vector.h ..... store a vector of PPTP_CALL information and search it
- * efficiently.
- * C. Scott Ananian <cananian@alumni.princeton.edu>
- *
- * $Id: vector.h,v 1.1.1.1 2000/12/23 08:19:51 scott Exp $
- */
-
-#ifndef INC_VECTOR_H
-#define INC_VECTOR_H
-
-#include "pptp_ctrl.h" /* for definition of PPTP_CALL */
-
-typedef struct vector_struct VECTOR;
-
-VECTOR *vector_create();
-void vector_destroy(VECTOR *v);
-
-int vector_size(VECTOR *v);
-
-/* vector_insert and vector_search return TRUE on success, FALSE on failure. */
-int vector_insert(VECTOR *v, int key, PPTP_CALL * call);
-int vector_remove(VECTOR *v, int key);
-int vector_search(VECTOR *v, int key, PPTP_CALL ** call);
-/* vector_contains returns FALSE if not found, TRUE if found. */
-int vector_contains(VECTOR *v, int key);
-/* find first unused key. Returns TRUE on success, FALSE if no. */
-int vector_scan(VECTOR *v, int lo, int hi, int *key);
-/* get a specific PPTP_CALL ... useful only when iterating. */
-PPTP_CALL * vector_get_Nth(VECTOR *v, int n);
-
-#endif /* INC_VECTOR_H */
diff --git a/pppd_plugin/templates/c b/pppd_plugin/templates/c
deleted file mode 100644
index e0f44db..0000000
--- a/pppd_plugin/templates/c
+++ /dev/null
@@ -1,19 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2006 by Kozlov D. *
- * xeb@mail.ru *
- * *
- * 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. *
- ***************************************************************************/
diff --git a/pppd_plugin/templates/h b/pppd_plugin/templates/h
deleted file mode 100644
index e0f44db..0000000
--- a/pppd_plugin/templates/h
+++ /dev/null
@@ -1,19 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2006 by Kozlov D. *
- * xeb@mail.ru *
- * *
- * 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. *
- ***************************************************************************/
diff --git a/pptpd-1.3.3/AUTHORS b/pptpd-1.3.3/AUTHORS
deleted file mode 100644
index fff21a4..0000000
--- a/pptpd-1.3.3/AUTHORS
+++ /dev/null
@@ -1,52 +0,0 @@
-ACCEL-PPTP - The PPTP Client/Server
--------------------------
-
-Current Maintainer:
-Kozlov D. xeb@mail.ru
-
-Previous Maintainer:
-James Cameron <james.cameron at hp dot com>
-Richard de Vroede <r.devroede at linvision dot com>
-
-Original Authors:
-Matthew Ramsay <matthewr at lineo dot com>
-Kevin Thayer <tmk at netmagic.net>
-David Luyer <luyer at ucs.uwa.edu.au>
-Peter Galbavy <Peter.Galbavy at knowledge dot com>
-
-Other Contributors:
-Ron O'Hara <rono at sentuny dot com.au>
-Allan Clark <allanc at sco dot com>
-Harald Vogt <vogt at serc.nl>
-Bruno Lopes F. Cabral <bruno at openline dot com.br> [!3runo]
-Peter Stamfest <poptop at stamfest dot at>
-Sergio M. Ammirata
-Norbert van Bolhuis
-Visarion Mandzgaladze
-Hernan Otero
-Jan Dubiec
-Pawel Guraj
-Chris Wilson
-Anton Gorlov
-
-The Linux PPTP Server takes advantage of some Linux PPTP client code
-written by C. Scott Ananian <cananian at alumni.princeton.edu>
-
-Other Credits:
-Moreton Bay <http://www.moretonbay.com>
-Lineo <http://www.lineo.com>
-Snapgear <http://www.snapgear.com>
-Linvision <http://www.linvision.com>
-
-SourceForge <http://sourceforge.net> - Current host for the mailing
-list and CVS repository.
-
-Christopher Schulte <christopher at schulte.org> - Previous host for the
-PPTP Mailing List (sadly missed, in James' opinion).
-
-Peter Galbavy <Peter.Galbavy at knowledge dot com> - Previous host for the
-PPTP CVS server.
-
-Luc Richards <theycallmeluc at yahoo dot com.au> - The author of bcrelay.
-
-Wing Kwok <skwok at acnielsen dot com.au> - The author of ADS howto.
diff --git a/pptpd-1.3.3/COPYING b/pptpd-1.3.3/COPYING
deleted file mode 100644
index a43ea21..0000000
--- a/pptpd-1.3.3/COPYING
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, 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
-
- Appendix: 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) 19yy <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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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.
diff --git a/pptpd-1.3.3/ChangeLog b/pptpd-1.3.3/ChangeLog
deleted file mode 100644
index a17bd19..0000000
--- a/pptpd-1.3.3/ChangeLog
+++ /dev/null
@@ -1,611 +0,0 @@
-15.05.2006 xeb
- * accel-pptp forked from pptpd-1.3.2
-
-Tue Sep 5 09:42:46 2006 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.3.3.tar.gz: released.
-
-Tue Sep 5 09:25:25 2006 James Cameron <quozl@us.netrek.org>
-
- * defaults.h: remove MAX_CONNECTIONS reference.
-
- * samples/pptpd.conf: add connections clause, remove reference to
- MAX_CONNECTIONS.
-
-Tue Sep 5 09:10:55 2006 James Cameron <quozl@us.netrek.org>
-
- * pptpd.c (processIPStr): add new informational message to
- indicate when the number of connections is constrained by the
- configured IP address ranges.
-
-Tue Sep 5 08:52:20 2006 James Cameron <quozl@us.netrek.org>
-
- * pptpd.c: fix segfault on -C option, cause was option string
- didn't include argument flag for number of connections. Closes
- Gentoo Bug #132898 <http://bugs.gentoo.org/show_bug.cgi?id=132898>
- thanks to Alin Nastac (mrness at gentoo.org) and Peter Volkov.
-
-Thu Aug 3 12:02:02 2006 James Cameron <quozl@us.netrek.org>
-
- * plugins/Makefile (LIBDIR), Makefile.am (LIBDIR): support build
- of x86_64 mixed architecture. From: Anton Gorlov.
-
-Thu Aug 3 11:14:59 2006 James Cameron <quozl@us.netrek.org>
-
- * configure.in: rewrite use of AC_ARG_WITH and AC_ARG_ENABLE to
- more properly support the negative case. Reported by: Phil
- Oester.
-
-Thu Aug 3 09:55:25 2006 James Cameron <quozl@us.netrek.org>
-
- * plugins/Makefile: include libutil. From: Anton Gorlov.
-
-Thu Apr 20 16:18:26 2006 James Cameron <quozl@us.netrek.org>
-
- * pptpd.init: ensures the service is not enabled by default when
- installed, and adds a "condrestart" target that will restart the
- daemon if and only if it's already running. Reported by: Paul
- Howarth.
-
-Tue Apr 18 14:47:29 2006 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.3.2.tar.gz: released.
-
- * configure.in: fix --with flags to work --without, change
- --with-bcrelay to --enable-bcrelay.
-
-Mon Mar 27 11:42:36 2006 James Cameron <quozl@us.netrek.org>
-
- * pptpgre.c (decaps_gre, dequeue_gre): only report to LOG_DEBUG if
- the debug option is set. Reported by: Thomas Stein
- <thomas.stein@knowledgetools.de>
-
-Tue Feb 14 10:52:13 2006 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.3.1.tar.gz: released.
-
-Thu Dec 29 17:39:15 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpd.c, pptpmanager.c, pptpmanager.h, defaults.h: make
- connections limit a run-time option.
-
-Thu Dec 29 15:45:51 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpd.c (launch_bcrelay): insufficient space was allocated in
- the argv array for the number of elements used.
-
-Thu Dec 29 12:11:23 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpd: remove PPPD_IP_ALLOC in favour of a configuration option.
-
- * pptpd.8: add --delegate
-
- * pptpd.conf.5, samples/pptpd.conf: add delegate option
-
- * config.h.in, configure.in: remove --with-pppd-ip-alloc option
-
- * pptpmanager.c, defaults.h, pptpd.c: convert from conditional
- compilation to run-time checking.
-
- * samples/options.pptpd: describe how to force local IP for tunnel
- even in delegate mode.
-
- * INSTALL: remove build.sh reference.
-
-Thu Dec 29 11:04:13 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpgre.c (pptp_gre_init): prevent initial unwanted GRE ACK.
- From: Jonathan Barker <jabarker@itstrategic.ca>
-
-Mon Nov 21 10:53:09 2005 James Cameron <quozl@us.netrek.org>
-
- * bcrelay.c (mainloop): ignore ENOBUFS rather than fail.
- From: Rajkumar S <rajkumars@asianetindia.com>
-
-Mon Oct 31 09:21:11 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpctrl.c: change GETARG to GETARG_VALUE and add a GETARG_INT
- and GETARG_STRING macro, to improve readability.
-
-Mon Aug 22 10:45:14 2005 James Cameron <quozl@us.netrek.org>
-
- * compat.c (sigpipe_assign): remove superfluous sigset variable
- and calls; they served no purpose. Reported by: Pavol Gono.
-
-Wed Aug 3 19:04:07 2005 James Cameron <quozl@us.netrek.org>
-
- * plugins/pptpd-logwtmp.c: fix compilation warning by including
- string.h
-
- * ctrlpacket.c (read_pptp_packet): initialise return control
- message type, to fix compilation warnings.
-
- * pqueue.c: compilation fixes, use of log() and warn() replaced
- with syslog().
-
-Wed Aug 3 17:33:40 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.3.0.tar.gz: released.
-
-Tue Aug 2 21:31:25 2005 James Cameron <quozl@us.netrek.org>
-
- * samples/options.pptpd: disable Van Jacobson compression.
- Reported by Pawel Pokrywka.
-
-Tue Aug 2 21:27:11 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpgre.c: packet reordering implementation, contributed by Vijay
- Bharadwaj.
-
-Tue Aug 2 19:32:47 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpdefs.h (MAX_ECHO_WAIT, IDLE_WAIT): comply with RFC2637,
- reported by Tobias Brox, updates 20040811-0.
-
-Tue Aug 2 19:30:30 2005 James Cameron <quozl@us.netrek.org>
-
- * plugins/pptpd-logwtmp.c (ip_up): implement
- pptpd-logwtmp-strip-domain option, closes 20050401-1.
-
-Tue Aug 2 19:01:42 2005 James Cameron <quozl@us.netrek.org>
-
- * Makefile.am (EXTRA_DIST): add html directory, missing from
- distribution, closes 20050729-1.
-
-Fri Jul 29 22:56:08 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpdefs.h (PPP_WAIT): default ten seconds wait for PPP packets
- to begin to be sent.
-
- * pptpctrl.c (pptp_handle_ctrl_connection): wait for first packet
- from pppd before continuing, an experimental fix for bug
- 20040521-1.
-
-Tue Jul 12 16:33:23 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpmanager.c (pptpmanager): process initial packet header
- length field properly. Reported by: Alex Beregszaszi
-
-Thu Mar 3 16:19:17 2005 James Cameron <quozl@us.netrek.org>
-
- * bcrelay.c (mainloop): ignore ENETDOWN and ENXIO from sendto(2).
- Closes 20040428-0.
-
-Thu Feb 24 11:48:08 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpd.8: add section on debugging, contributed by Peter Mueller.
-
-Thu Feb 17 13:05:31 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.2.3.tar.gz: released.
-
-Thu Feb 17 13:01:22 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpd.c (showusage, showversion): change from poptop to pptpd.
-
-Tue Jan 25 09:01:49 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpctrl.c: perform error checking on dup2 calls, as on Linux
- they can fail under certain circumstances.
-
-Fri Jan 14 13:38:58 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpd.c, pptpctrl.c, bcrelay.c, configure.in, acconfig.h: add
- configure option --enable-facility to set syslog facility to use
- in logging. e.g. LOG_LOCAL0
-
-Mon Jan 10 09:51:05 2005 James Cameron <quozl@us.netrek.org>
-
- * config.h.in, configure.in, pptpgre.c (encaps_gre): uses writev()
- if available, to avoid a memcpy() of the GRE payload when sending
- off the packet. From: Marcus Sundberg.
-
-Thu Jan 6 10:07:39 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpmanager.c (pptp_manager): compilation fix for gcc < 3, a
- regression introduced in pptpd-1.2.2. Reported by: Peter Mueller.
-
-Wed Jan 5 22:12:38 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.2.2.tar.gz: released.
-
-Wed Jan 5 21:16:15 2005 James Cameron <quozl@us.netrek.org>
-
- * compat.h, compat.c (sigpipe_*): build a generalised signal pipe
- delivery ... thing, for use by pptpd and pptpctrl.
-
- * pptpctrl.c (main): use signal pipe delivery instead of calling
- syslog(3) in the SIGTERM handler, call the old handler bail() when
- SIGTERM is delivered via the pipe.
-
- * pptpd.c: kill bcrelay outside a signal handler in order to avoid
- deadlock.
-
- * pptpmanager.c (pptp_manager): use generalised signal pipe
- delivery, return to caller on SIGTERM.
-
-Wed Jan 5 17:30:50 2005 James Cameron <quozl@us.netrek.org>
-
- * pptpmanager.c: fix bug 2004-01-05-0, hang due to syslog(3)
- called by signal(2) handler. Derived from contributions to PPTP
- Client by Jean Wolter.
-
- * pptpmanager.c: add pipe for queueing SIGCHLD events.
-
- * pptpmanager.c (sigchld_handler): add safe handler for SIGCHLD.
-
- * pptpmanager.c (sigchld_responder): move old handler into
- non-signal context function called from main event loop.
-
- * pptpmanager.c (sigchld_setup): move SIGCHLD signal handling
- setup into own function.
-
- * pptpmanager.c (pptp_manager): call the new signal handling setup
- function, FD_ZERO each time around (it wasn't being reset), watch
- the signal handling pipe in the main event loop, handle EINTR
- return from select by ignoring it and restarting the select().
- Added code to handle signal pipe data. Removed code for blocking
- SIGCHLD on new connection, now that the signal handling is linear.
-
-Thu Dec 23 09:17:29 2004 James Cameron <quozl@us.netrek.org>
-
- * samples/options.pptpd: turn off logging to stderr by default, to
- prevent loopback detected. From: Andrew Hall
- <ahall@sportingstatz.com>
-
-Thu Nov 11 14:20:18 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd.spec: allows the RPM to be built on Red Hat Enterprise
- Linux systems that use an older version of autotools. From:
- Charlie Brady <charlieb-poptop-server@e-smith.com>
-
-Thu Jun 24 09:35:58 2004 Peter Mueller <pmueller@sidestep.com>
-
- * pptpd.init: avoid spitting garbage if no processes exist.
-
-Wed Jun 23 19:42:33 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.2.1.tar.gz: released.
-
- * plugins/patchlevel.h: update pppd version requirement, so that
- pptpd works with Paul Howarth's pppd 2.4.3 CVS packages.
-
-Fri Jun 4 13:56:20 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd.init: warn that restart may cause problems, provide
- restart-kill. From: Peter Mueller.
-
-Tue May 25 11:35:49 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.2.0-b4.tar.gz: released.
-
-Mon May 24 20:27:53 2004 James Cameron <quozl@us.netrek.org>
-
- * debian/copyright: fix spelling to fix lintian warning.
- * debian/changelog: remove emacs stuff to fix lintian warning.
- * pptpd.8: refer to pptpd.conf(5) early on, and remove EXAMPLES
- section, as it contributes nothing.
- * pptpd.conf.5: add documentation for firewall rules.
-
-Fri May 21 20:43:55 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd.spec: rework to build under rpm 4.0.4, depend on ppp >=
- 2.4.2, change description to match Debian package, add vendor,
- propogate changes since 1.1.4-b3 involving obsolete scripts and
- new plugin.
-
- * Makefile.am, plugins/Makefile: add missing pptpd.init, add
- debian packaging from downstream, propogate DESTDIR and prefix to
- plugins install target.
-
- * debian/changelog: change the version to -0 to avoid clobbering
- the later Debian package.
-
-Mon May 17 16:28:49 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd.c: bug fix, only check PPP options file readability if an
- options file has been given in the configuration file or command
- line. Reported by: Andrew Alexandrov
-
-Mon May 17 12:31:34 2004 James Cameron <quozl@us.netrek.org>
-
- * Makefile.am (EXTRA_DIST): remove html, as the documentation is
- out of date, explicitly name samples, tools and plugins files to
- prevent CVS in tarball.
-
-Mon May 17 12:31:09 2004 James Cameron <quozl@us.netrek.org>
-
- * debian: merge upstream Debian patches. From Rene Mayrhofer.
-
-Fri May 14 15:50:35 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd.c (killbcrelay): bug fix, pptpd catches SIGTERM to kill
- bcrelay, but doesn't kill itself. "This patch solves partially
- the problem. When there is a connection established klling the
- main pptpd process will not kill the control connection process."
- From: Pawel Guraj.
-
-Thu Apr 29 20:18:19 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd.8, pptpd.conf.5: adopt man page review suggestions.
- From: Chris Wilson.
-
-Thu Apr 29 19:49:59 2004 James Cameron <quozl@us.netrek.org>
-
- * plugins/pptpd-logwtmp.c (ip_up): use the username that was
- authenticated from the peer_authname variable rather than the
- local host name hiding in the user variable.
- Reported by: Pawel Guraj.
-
-Thu Apr 29 16:56:05 2004 James Cameron <quozl@us.netrek.org>
-
- * ctrlpacket.c (deal_out_call): print connection speed properly.
- From: Jan Dubiec.
-
-Thu Apr 29 16:49:03 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd.c: fix segfault if built --with-bcrelay but neither
- bcrelay config option nor --bcrelay command line flag used. From:
- Jan Dubiec, Pawel Guraj.
-
-Wed Apr 28 21:24:25 2004 James Cameron <quozl@us.netrek.org>
-
- * README.logwtmp: write up new feature to track user connections
- and disconnections using the standard wtmp(5) mechanism.
- * defaults.h, pptpd.8, pptpctrl.8, pptpctrl.c, pptpd.c,
- pptpmanager.c, samples/pptpd.conf: add --logwtmp option.
- * plugins/Makefile: derive from PPP CVS plugins example.
- * plugins/patchlevel.h, plugins/pppd.h: copy headers from PPP CVS.
- * plugins/pptpd-logwtmp.c: add plugin to update wtmp.
- * Makefile.am: add targets for plugins build and any future
- subdirectories.
- * tools/vpnwho.pl: mark as obsolete.
-
-Wed Apr 28 19:54:04 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpctrl.c (main): waitpid() rather than kill() the pppd, so
- that ip-down scripts get executed.
-
-Tue Apr 27 09:11:32 2004 James Cameron <quozl@us.netrek.org>
-
- * NEWS: change attribution on request from author.
-
- * Makefile.am (EXTRA_DIST): include README.portslave, re-order list.
-
-Sun Apr 25 20:31:52 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.2.0-b3.tar.gz: released.
-
-Sat Apr 24 20:51:54 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpgre.c (decaps_hdlc): add hint for EIO on read() of PTY,
- suggesting a look at option syntax and pppd logs. To address a
- FAQ seen on mailing lists.
-
- * pptpd.conf.5: add routing checklists for three different methods
- of allocating subnets and configuring pptpd.
-
- * pptpd.8, pptpd.conf.5: add noipparam option documentation. Move
- speed option to end of list. Rework text for simplicity. Cross
- check against pptpd.c.
-
- * pptpctrl.8: rework argument list, cross check against
- pptpctrl.c, remove examples because running from inetd(8) is
- unusual and not encouraged.
-
- * pptpd.c, pptpd.8, pptpmanager.c, pptpctrl.c, defaults.h: add
- --ppp option to specify PPP program to use in place of default
- PPP_BINARY, and pass the new parameter to pptpctrl. Also reworked
- option handling and validation to simplify code. Use access()
- instead of fopen() to verify that files can be read or executed.
-
- * pptpd.c: bug fix, --stimeout option was not working due to use
- of strdup() and a blind cast instead of atoi().
-
- * pptpd.c: bug fix, --noipparam option on command line was causing
- premature exit during option processing.
-
-Fri Apr 23 21:01:31 2004 James Cameron <quozl@us.netrek.org>
-
- * tools/pptp-portslave: add contribution from Russell Coker, on
- Debian Bug#126486.
-
-Fri Apr 23 20:34:28 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpctrl.c (main): fail if arguments insufficient, closes Debian
- Bug#107933.
-
- * .cvsignore: include config.h and stamp-h, to assist with CVS
- updates.
-
-Fri Apr 23 20:13:43 2004 James Cameron <quozl@us.netrek.org>
-
- * AUTHORS: hide author e-mails, add contributors since last release.
-
-Fri Apr 23 20:00:02 2004 James Cameron <quozl@us.netrek.org>
-
- * stamp-h, config.h: remove from CVS.
-
- * import: remove huge superfluous screen snapshot that was slowing
- CVS access.
-
- * .cvsignore: update for new build environment, include everything
- that might normally be in a user directory checked out from CVS.
-
- * samples/options: not relevant, removed.
-
- * tools/confmod.sh: mark as obsolete, relevant only for ppp-2.4.1
- forks.
-
- * reconf, version: adjust comments.
-
- * pptpd.spec: include vpnwho.pl (old version at this stage until
- Bruno finds me the latest version) in the RPM packaging.
-
- * pptpd.conf.5, pptpd.8: expand acronymn DOS.
-
- * pptpctrl.8: add note that speed is ineffective on Linux.
-
- * makepackage: use complete version, including beta release, as
- part of the packaging; don't hide the beta release version.
-
- * configure.in: remove warning about /usr/local/bin/pptpd, since
- /usr/local/bin is locally administered; we have no right to warn,
- we may have been responsible even in this version for placing the
- file there.
-
- * Anon-CVS-Root: obsolete, removed.
-
- * build.sh: obsolete build.sh
-
- * README.bcrelay: wrap to 80 columns.
-
- * README: rework for new release.
-
-Fri Apr 23 17:05:23 2004 James Cameron <quozl@us.netrek.org>
-
- * makerpm: remove from CVS in favour of makepackage per Richard's
- e-mail on 1st August 2003.
-
- * Makefile.am (EXTRA_DIST): add README.bcrelay, older ChangeLogs,
- tools, spec file, and makepackage script.
-
-Fri Apr 23 16:15:59 2004 James Cameron <quozl@us.netrek.org>
-
- * reconf: remove setting of pptpd.conf version.
-
- * samples/pptpd.conf: remove package version from file, use CVS
- revision header instead.
-
- * samples/options.pptpd: clarify comments, default to work with
- PPP 2.4.2.
-
-Thu Apr 22 16:38:01 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpctrl.c: remove report of connection speed for Linux pppd.
-
-Thu Apr 22 13:41:11 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd-1.2.0-b1.tar.gz: released to test team.
-
- * AUTHORS: adjust to reflect new maintainer.
-
- * bcrelay.c: when compiling without --with-bcrelay, fail
- immediately with an error message suggesting a rebuild.
-
- * bcrelay.c: adopt VERSION from main package, cause my_daemon() to
- be conditional on not HAVE_DAEMON.
-
- * pptpd.c (killbcrelay): avoid code when BCRELAY is not defined.
- Fixes compiler error when pptpd is configured using defaults.
-
- * Makefile.am (dist-hook, EXTRA_DIST): remove CVS from final
- source distribution.
-
- * samples/pptpd.conf: remove some whitespace and wrap.
-
- * Makefile.am: remove CVS from dist target.
-
- * RELEASING: new file of release instructions, for 1.2.0 release
- candidate.
-
- * configure.in: change version.
-
- * pptpd.spec: change version.
-
- * ChangeLog: adopt GNU format.
-
-Fri Feb 27 09:53:19 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpctrl.c (pptp_handle_ctrl_connection): on any CALL_CLR_RQST,
- terminate the call. From: "Bruno Lopes F. Cabral"
- <bruno@openline.com.br> 2004-01-08
- http://marc.theaimsgroup.com/?l=poptop-server&m=107359240120864&w=2
-
-Fri Feb 27 09:50:41 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpctrl.c (launch_pppd): make sure SIGCHLD is unblocked. The
- procmask gets inherited from the manager and usually has the
- SIGCHLD blocked. Actually pppd does not expect that somebody
- tampered with its signal mask, thus we just unblock all signals
- and leave them to be handled by pppd. This fixes the "ip-up
- zombie" bug. From: Peter Stamfest <poptop@stamfest.at> 2003-09-06
- http://marc.theaimsgroup.com/?l=poptop-server&m=106284825408104&w=2
-
-Thu Feb 26 15:17:37 2004 James Cameron <quozl@us.netrek.org>
-
- * pptpd.8, pptpd.conf.5 (speed): note that speed is ineffective on
- Linux, despite being accepted by pppd.
-
-Wed Dec 10 09:28:01 2003 James Cameron <quozl@us.netrek.org>
-
- * pptpctrl.c (launch_pppd): report program binary path.
-
-Tue Dec 9 10:22:01 2003 James Cameron <quozl@us.netrek.org>
-
- * pptpctrl.c (launch_pppd): report cause of failed execvp().
- * pptpctrl.c (startCall): better explain launch failure.
-
-poptop (1.1.4-b5) unstable; urgency=low
-
- * Added code to pass ipparam to pppd - By Sergio M. Ammirata
- * Added Debian packaging information (not included in .tar.gz)
- * Added bcrelay_v1 - By Norbert van Bolhuis
-
- -- R. de Vroede <richard@oip.tudelft.nl> Fri, 18 Jul 2003 11:34:05 +0200
-
-poptop (1.1.4-b4) unstable; urgency=low
-
- * Bugfix: First GRE packet always discarded - By: fghdgh (gcc111)
- * Bugfix: Console fds left open, ssh hangs - By: fghdgh (gcc111)
- * Bugfix: Pidfile option doesn't work - By: Visarion Mandzgaladze
-
- -- R. de Vroede <richard@oip.tudelft.nl> Fri, Jun 20 2003 11:34:05 +0200
-
-poptop (1.1.4-b3) unstable; urgency=low
-
- * Bugfix: Two buffer overflows in pptpctrl.c - By: Hernan Otero
-
- -- R. de Vroede <richard@oip.tudelft.nl> Tue, May 13 2003 11:34:05 +0200
-
-poptop (1.1.4-b2) unstable; urgency=low
-
- * Bugfix: Potential buffer-overflow in ctrlpacket.c
- * Callid enhancements. From: Ilguiz Latypov, Debian Bug#171831
-
- -- R. de Vroede <richard@oip.tudelft.nl> Wed, Apr 9 2003 11:34:05 +0200
-
-poptop (1.1.4-b1) unstable; urgency=low
-
- * Added BCrelay (Broadcast relay)
-
- -- R. de Vroede <richard@oip.tudelft.nl> Fri, Oct 11 2002 11:34:05 +0200
-
-Poptop ChangeLog
----------------------------------------------------------------------------
-v1.1.3
-* Wed Apr 9 2003 Richard de Vroede <r.devroede@linvision.com>
-- fixed a potential buffer-overflow in ctrlpacket.c
-
-* Thu Aug 22 2002 Richard de Vroede <richard@linvision.com>
-- added stimeout option to pptpd.conf manpage
-- updated the Changelog file ;-)
-
-* Tue Aug 20 2002 Richard de Vroede <richard@linvision.com>
-- removed debug commandline option from pptpd.init
-
-* Thu Aug 1 2002 Richard de Vroede <richard@linvision.com>
-- added config(noreplace) so old configs don't get replaced
-- fixed postscriptlet
-- adapted spec to cvs tree
-
-* Wed Jun 26 2002 Richard de Vroede <richard@linvision.com>
-- specfile now supports --with[out] options
-
----------------------------------------------------------------------------
-v0.9.13 -> v1.1.3
-* June 18 2002 Richard de Vroede <richard@linvision.com>
-- migrated to version higher than last poptop release
-- bugfixed
-
----------------------------------------------------------------------------
diff --git a/pptpd-1.3.3/INSTALL b/pptpd-1.3.3/INSTALL
deleted file mode 100644
index c2b65d2..0000000
--- a/pptpd-1.3.3/INSTALL
+++ /dev/null
@@ -1,188 +0,0 @@
-Note: logwtmp plugin source file patchlevel.h must match pppd version
-on system if it is used. Edit the file plugins/patchlevel.h
-accordingly.
-
---
-
-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 awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
-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.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- 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. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--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.
diff --git a/pptpd-1.3.3/Makefile.am b/pptpd-1.3.3/Makefile.am
deleted file mode 100644
index 91fd76c..0000000
--- a/pptpd-1.3.3/Makefile.am
+++ /dev/null
@@ -1,102 +0,0 @@
-# We have our own, simpler dependencies stuff in 'reconf'
-AUTOMAKE_OPTIONS = no-dependencies foreign
-
-@SET_MAKE@
-
-export LIBDIR=$(libdir)/pptpd
-INCLUDES = -I.
-## Change this if you don't have gcc
-## -pedantic removed for now (OpenBSD header files).
-## -Werror removed for now (getopt stuff on OSF/1 throws a
-## warning with -Wmissing-prototypes).
-## -Wmissing-prototypes removed (eg, Linux 2.2.6 headers
-## aren't up to it).
-CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -I$(kernel_headers)
-#CFLAGS = -O2 -fno-builtin -Wall -ansi -DSBINDIR='"$(sbindir)"'
-#CFLAGS = -O2 -fno-builtin -Wall -ansi -pedantic -Wmissing-prototypes -Werror -DSBINDIR='"$(sbindir)"'
-
-man_MANS = pptpd.8 pptpd.conf.5
-
-EXTRA_DIST = \
-html README* ChangeLog NEWS* TODO $(man_MANS) \
-samples/chap-secrets samples/options.pptpd samples/pptpd.conf \
-Makefile.uClinux config.embed.h version reconf \
-tools/pptp-portslave tools/vpnstats tools/vpnstats.pl tools/vpnuser \
-pptpd.init pptpd.spec makepackage \
-plugins/Makefile plugins/*.h plugins/*.c \
-debian/README.debian debian/changelog debian/conffiles debian/config \
-debian/control debian/copyright debian/dirs debian/docs \
-debian/examples debian/pptpd-options debian/pptpd.conf \
-debian/pptpd.init debian/pptpdconfig.pl debian/rules debian/templates \
-debian/po/POTFILES.in debian/po/fr.po debian/po/pt_BR.po \
-debian/po/templates.pot
-
-EXTRA_PROGRAMS =
-sbin_PROGRAMS = pptpd pptpctrl bcrelay
-
-# Header files are only used to determine what to put in a distribution, not
-# for dependencies, so just attribute them all to pptpd.
-
-pptpd_SOURCES = \
- pptpd.c configfile.c pptpmanager.c compat.c inststr.c getopt.c getopt1.c \
- compat.h configfile.h ctrlpacket.h defaults.h inststr.h our_getopt.h \
- our_syslog.h pptpdefs.h pptpmanager.h
-
-pptpctrl_SOURCES = \
- pptpctrl.c ctrlpacket.c inststr.c compat.c
-
-pptpd_LDADD = $(XTRALIBS_MGR)
-
-pptpctrl_LDADD = $(XTRALIBS_CTRL)
-
-bcrelay_SOURCES = bcrelay.c defaults.h our_syslog.h our_getopt.h
-
-subdirs = plugins
-
-all-local:
- for d in $(subdirs); do $(MAKE) $(MFLAGS) -C $$d all; done
-
-install-exec-local:
- for d in $(subdirs); do $(MAKE) $(MFLAGS) -C $$d prefix=$(prefix) DESTDIR=$(DESTDIR) install; done
-
-clean-local:
- for d in $(subdirs); do $(MAKE) $(MFLAGS) -C $$d clean; done
-
-uninstall-local:
- for d in $(subdirs); do $(MAKE) $(MFLAGS) -C $$d prefix=$(prefix) DESTDIR=$(DESTDIR) uninstall; done
-
-package: deb rpm
-
-deb:
- fakeroot dpkg-buildpackage -us -uc
-
-rpm:
- fakeroot rpmbuild -ta pptpd-$(VERSION).tar.gz
-
-##CLEANFILES =
-
-## DO NOT ADD BELOW THIS POINT, DEPS ARE AUTOMATICALLY ADDED
-bcrelay.o: bcrelay.c config.h defaults.h our_syslog.h our_getopt.h
-
-compat.o: compat.c config.h compat.h our_syslog.h inststr.h
-
-configfile.o: configfile.c config.h defaults.h configfile.h our_syslog.h
-
-ctrlpacket.o: ctrlpacket.c config.h our_syslog.h pptpdefs.h pptpctrl.h \
- ctrlpacket.h compat.h
-
-getopt.o: getopt.c config.h our_getopt.h
-
-getopt1.o: getopt1.c config.h our_getopt.h
-
-inststr.o: inststr.c config.h inststr.h compat.h
-
-pptpctrl.o: pptpctrl.c config.h our_syslog.h compat.h pptpctrl.h \
- pptpdefs.h ctrlpacket.h defaults.h
-
-pptpd.o: pptpd.c config.h our_syslog.h our_getopt.h configfile.h \
- defaults.h compat.h pptpmanager.h
-
-pptpmanager.o: pptpmanager.c config.h our_syslog.h configfile.h \
- defaults.h pptpctrl.h pptpdefs.h pptpmanager.h compat.h
-
diff --git a/pptpd-1.3.3/Makefile.in b/pptpd-1.3.3/Makefile.in
deleted file mode 100644
index 77f3ef2..0000000
--- a/pptpd-1.3.3/Makefile.in
+++ /dev/null
@@ -1,732 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-EXTRA_PROGRAMS =
-sbin_PROGRAMS = pptpd$(EXEEXT) pptpctrl$(EXEEXT) bcrelay$(EXEEXT)
-subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/config.h.in \
- $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
- TODO install-sh missing mkinstalldirs
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" \
- "$(DESTDIR)$(man8dir)"
-sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(sbin_PROGRAMS)
-am_bcrelay_OBJECTS = bcrelay.$(OBJEXT)
-bcrelay_OBJECTS = $(am_bcrelay_OBJECTS)
-bcrelay_LDADD = $(LDADD)
-am_pptpctrl_OBJECTS = pptpctrl.$(OBJEXT) ctrlpacket.$(OBJEXT) \
- inststr.$(OBJEXT) compat.$(OBJEXT)
-pptpctrl_OBJECTS = $(am_pptpctrl_OBJECTS)
-am__DEPENDENCIES_1 =
-pptpctrl_DEPENDENCIES = $(am__DEPENDENCIES_1)
-am_pptpd_OBJECTS = pptpd.$(OBJEXT) configfile.$(OBJEXT) \
- pptpmanager.$(OBJEXT) compat.$(OBJEXT) inststr.$(OBJEXT) \
- getopt.$(OBJEXT) getopt1.$(OBJEXT)
-pptpd_OBJECTS = $(am_pptpd_OBJECTS)
-pptpd_DEPENDENCIES = $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(bcrelay_SOURCES) $(pptpctrl_SOURCES) $(pptpd_SOURCES)
-DIST_SOURCES = $(bcrelay_SOURCES) $(pptpctrl_SOURCES) $(pptpd_SOURCES)
-man5dir = $(mandir)/man5
-man8dir = $(mandir)/man8
-NROFF = nroff
-MANS = $(man_MANS)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- { test ! -d $(distdir) \
- || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr $(distdir); }; }
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-distuninstallcheck_listfiles = find . -type f -print
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -I$(kernel_headers)
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GREP = @GREP@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XTRALIBS_CTRL = @XTRALIBS_CTRL@
-XTRALIBS_MGR = @XTRALIBS_MGR@
-XTRA_PROG = @XTRA_PROG@
-ac_ct_CC = @ac_ct_CC@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build_alias = @build_alias@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-kernel_headers = @kernel_headers@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-
-# We have our own, simpler dependencies stuff in 'reconf'
-AUTOMAKE_OPTIONS = no-dependencies foreign
-INCLUDES = -I.
-#CFLAGS = -O2 -fno-builtin -Wall -ansi -DSBINDIR='"$(sbindir)"'
-#CFLAGS = -O2 -fno-builtin -Wall -ansi -pedantic -Wmissing-prototypes -Werror -DSBINDIR='"$(sbindir)"'
-man_MANS = pptpd.8 pptpd.conf.5
-EXTRA_DIST = \
-html README* ChangeLog NEWS* TODO $(man_MANS) \
-samples/chap-secrets samples/options.pptpd samples/pptpd.conf \
-Makefile.uClinux config.embed.h version reconf \
-tools/pptp-portslave tools/vpnstats tools/vpnstats.pl tools/vpnuser \
-pptpd.init pptpd.spec makepackage \
-plugins/Makefile plugins/*.h plugins/*.c \
-debian/README.debian debian/changelog debian/conffiles debian/config \
-debian/control debian/copyright debian/dirs debian/docs \
-debian/examples debian/pptpd-options debian/pptpd.conf \
-debian/pptpd.init debian/pptpdconfig.pl debian/rules debian/templates \
-debian/po/POTFILES.in debian/po/fr.po debian/po/pt_BR.po \
-debian/po/templates.pot
-
-
-# Header files are only used to determine what to put in a distribution, not
-# for dependencies, so just attribute them all to pptpd.
-pptpd_SOURCES = \
- pptpd.c configfile.c pptpmanager.c compat.c inststr.c getopt.c getopt1.c \
- compat.h configfile.h ctrlpacket.h defaults.h inststr.h our_getopt.h \
- our_syslog.h pptpdefs.h pptpmanager.h
-
-pptpctrl_SOURCES = \
- pptpctrl.c ctrlpacket.c inststr.c compat.c
-
-pptpd_LDADD = $(XTRALIBS_MGR)
-pptpctrl_LDADD = $(XTRALIBS_CTRL)
-bcrelay_SOURCES = bcrelay.c defaults.h our_syslog.h our_getopt.h
-subdirs = plugins
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-am--refresh:
- @:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
- cd $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-
-config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
- else :; fi
-
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: $(am__configure_deps)
- cd $(top_srcdir) && $(AUTOHEADER)
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-install-sbinPROGRAMS: $(sbin_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-sbinPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
- rm -f "$(DESTDIR)$(sbindir)/$$f"; \
- done
-
-clean-sbinPROGRAMS:
- -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
-bcrelay$(EXEEXT): $(bcrelay_OBJECTS) $(bcrelay_DEPENDENCIES)
- @rm -f bcrelay$(EXEEXT)
- $(LINK) $(bcrelay_LDFLAGS) $(bcrelay_OBJECTS) $(bcrelay_LDADD) $(LIBS)
-pptpctrl$(EXEEXT): $(pptpctrl_OBJECTS) $(pptpctrl_DEPENDENCIES)
- @rm -f pptpctrl$(EXEEXT)
- $(LINK) $(pptpctrl_LDFLAGS) $(pptpctrl_OBJECTS) $(pptpctrl_LDADD) $(LIBS)
-pptpd$(EXEEXT): $(pptpd_OBJECTS) $(pptpd_DEPENDENCIES)
- @rm -f pptpd$(EXEEXT)
- $(LINK) $(pptpd_LDFLAGS) $(pptpd_OBJECTS) $(pptpd_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
-install-man5: $(man5_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)"
- @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.5*) list="$$list $$i" ;; \
- esac; \
- done; \
- for i in $$list; do \
- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
- else file=$$i; fi; \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 5*) ;; \
- *) ext='5' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \
- done
-uninstall-man5:
- @$(NORMAL_UNINSTALL)
- @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.5*) list="$$list $$i" ;; \
- esac; \
- done; \
- for i in $$list; do \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 5*) ;; \
- *) ext='5' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \
- rm -f "$(DESTDIR)$(man5dir)/$$inst"; \
- done
-install-man8: $(man8_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)"
- @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.8*) list="$$list $$i" ;; \
- esac; \
- done; \
- for i in $$list; do \
- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
- else file=$$i; fi; \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 8*) ;; \
- *) ext='8' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \
- done
-uninstall-man8:
- @$(NORMAL_UNINSTALL)
- @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.8*) list="$$list $$i" ;; \
- esac; \
- done; \
- for i in $$list; do \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 8*) ;; \
- *) ext='8' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \
- rm -f "$(DESTDIR)$(man8dir)/$$inst"; \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- mkdir $(distdir)
- $(mkdir_p) $(distdir)/debian $(distdir)/debian/po $(distdir)/plugins $(distdir)/samples $(distdir)/tools
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r $(distdir)
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
- $(am__remove_distdir)
-
-dist-tarZ: distdir
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__remove_distdir)
-
-dist-shar: distdir
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__remove_distdir)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__remove_distdir)
-
-dist dist-all: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
- chmod a-w $(distdir)
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && cd $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
- $(am__remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
-distuninstallcheck:
- @cd $(distuninstallcheck_dir) \
- && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS) $(MANS) config.h all-local
-installdirs:
- for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \
- test -z "$$dir" || $(mkdir_p) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-local clean-sbinPROGRAMS mostlyclean-am
-
-distclean: distclean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-hdr distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-exec-am: install-exec-local install-sbinPROGRAMS
-
-install-info: install-info-am
-
-install-man: install-man5 install-man8
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am uninstall-local uninstall-man \
- uninstall-sbinPROGRAMS
-
-uninstall-man: uninstall-man5 uninstall-man8
-
-.PHONY: CTAGS GTAGS all all-am all-local am--refresh check check-am \
- clean clean-generic clean-local clean-sbinPROGRAMS ctags dist \
- dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
- distcheck distclean distclean-compile distclean-generic \
- distclean-hdr distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-exec-local install-info \
- install-info-am install-man install-man5 install-man8 \
- install-sbinPROGRAMS install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am uninstall-local uninstall-man \
- uninstall-man5 uninstall-man8 uninstall-sbinPROGRAMS
-
-
-@SET_MAKE@
-
-export LIBDIR=$(libdir)/pptpd
-
-all-local:
- for d in $(subdirs); do $(MAKE) $(MFLAGS) -C $$d all; done
-
-install-exec-local:
- for d in $(subdirs); do $(MAKE) $(MFLAGS) -C $$d prefix=$(prefix) DESTDIR=$(DESTDIR) install; done
-
-clean-local:
- for d in $(subdirs); do $(MAKE) $(MFLAGS) -C $$d clean; done
-
-uninstall-local:
- for d in $(subdirs); do $(MAKE) $(MFLAGS) -C $$d prefix=$(prefix) DESTDIR=$(DESTDIR) uninstall; done
-
-package: deb rpm
-
-deb:
- fakeroot dpkg-buildpackage -us -uc
-
-rpm:
- fakeroot rpmbuild -ta pptpd-$(VERSION).tar.gz
-
-bcrelay.o: bcrelay.c config.h defaults.h our_syslog.h our_getopt.h
-
-compat.o: compat.c config.h compat.h our_syslog.h inststr.h
-
-configfile.o: configfile.c config.h defaults.h configfile.h our_syslog.h
-
-ctrlpacket.o: ctrlpacket.c config.h our_syslog.h pptpdefs.h pptpctrl.h \
- ctrlpacket.h compat.h
-
-getopt.o: getopt.c config.h our_getopt.h
-
-getopt1.o: getopt1.c config.h our_getopt.h
-
-inststr.o: inststr.c config.h inststr.h compat.h
-
-pptpctrl.o: pptpctrl.c config.h our_syslog.h compat.h pptpctrl.h \
- pptpdefs.h ctrlpacket.h defaults.h
-
-pptpd.o: pptpd.c config.h our_syslog.h our_getopt.h configfile.h \
- defaults.h compat.h pptpmanager.h
-
-pptpmanager.o: pptpmanager.c config.h our_syslog.h configfile.h \
- defaults.h pptpctrl.h pptpdefs.h pptpmanager.h compat.h
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/pptpd-1.3.3/Makefile.uClinux b/pptpd-1.3.3/Makefile.uClinux
deleted file mode 100644
index eb982e6..0000000
--- a/pptpd-1.3.3/Makefile.uClinux
+++ /dev/null
@@ -1,68 +0,0 @@
-
-PACKAGE = pptpd
-
-EXEC1 = pptpd
-OBJS1 = pptpd.o configfile.o pptpmanager.o compat.o getopt.o getopt1.o $(LIBRESOLV)
-
-EXEC2 = pptpctrl
-OBJS2 = pptpctrl.o ctrlpacket.o inststr.o compat.o pptpgre.o ppphdlc.o
-
-EXEC3 = bcrelay
-OBJS3 = bcrelay.o
-
-CFLAGS += -include config.embed.h -DPACKAGE='"$(PACKAGE)"' -DVERSION='"$(pptpd.VERSION).$(pptpd.PATCHLEVEL).$(pptpd.SUBLEVEL)"'
-FLTFLAGS += -s 8192
-
-ifdef BUILD_NETtel
-CFLAGS += -DCONFIG_NETtel
-endif
-
-
-all: $(EXEC1) $(EXEC2) $(EXEC3)
-
-
-$(EXEC1): $(OBJS1)
- $(CC) $(LDFLAGS) -o $@ $(OBJS1) $(LDLIBS)
-
-$(EXEC2): $(OBJS2)
- $(CC) $(LDFLAGS) -o $@ $(OBJS2) $(LDLIBS)
-
-$(EXEC3): $(OBJS3)
- $(CC) $(LDFLAGS) -o $@ $(OBJS3) $(LDLIBS)
-
-clean:
- -rm -f $(EXEC1) $(EXEC2) $(EXEC3) *.elf *.o
-
-## DO NOT ADD BELOW THIS POINT, DEPS ARE AUTOMATICALLY ADDED
-bcrelay.o: bcrelay.c config.embed.h defaults.h our_syslog.h our_getopt.h
-
-compat.o: compat.c config.embed.h compat.h our_syslog.h inststr.h
-
-configfile.o: configfile.c config.embed.h defaults.h configfile.h \
- our_syslog.h
-
-ctrlpacket.o: ctrlpacket.c config.embed.h our_syslog.h pptpdefs.h \
- pptpctrl.h ctrlpacket.h compat.h
-
-getopt.o: getopt.c config.embed.h our_getopt.h
-
-getopt1.o: getopt1.c config.embed.h our_getopt.h
-
-inststr.o: inststr.c config.embed.h inststr.h compat.h
-
-ppphdlc.o: ppphdlc.c config.embed.h ppphdlc.h
-
-pptpctrl.o: pptpctrl.c config.embed.h our_syslog.h compat.h pptpctrl.h \
- pptpgre.h pptpdefs.h ctrlpacket.h defaults.h
-
-pptpd.o: pptpd.c config.embed.h our_syslog.h our_getopt.h configfile.h \
- defaults.h compat.h pptpmanager.h
-
-pptpgre.o: pptpgre.c config.embed.h our_syslog.h ppphdlc.h pptpgre.h \
- pptpdefs.h pptpctrl.h defaults.h pqueue.h compat.h
-
-pptpmanager.o: pptpmanager.c config.embed.h our_syslog.h configfile.h \
- defaults.h pptpctrl.h pptpdefs.h pptpmanager.h compat.h
-
-pqueue.o: pqueue.c config.embed.h pqueue.h
-
diff --git a/pptpd-1.3.3/NEWS b/pptpd-1.3.3/NEWS
deleted file mode 100644
index e69de29..0000000
--- a/pptpd-1.3.3/NEWS
+++ /dev/null
diff --git a/pptpd-1.3.3/README b/pptpd-1.3.3/README
deleted file mode 100644
index 1c65cc4..0000000
--- a/pptpd-1.3.3/README
+++ /dev/null
@@ -1,30 +0,0 @@
-Poptop README
--------------
-
-You *must* do a 'make install' or Poptop will *NOT* find the binaries!
-See INSTALL for generic compile/install instructions, and run
-"./configure --help" for a list of valid options, or just type:
-
-./configure
-make
-make install
-
-(make install copies the binaries to /usr/local/sbin, so you better be root)
-
-To run Poptop simply type: 'pptpd' (or /usr/local/sbin/pptpd if you don't
-have /usr/local/sbin in your path).
-
-You may specify a number of options on the command line to change
-how Poptop launches PPP.
-
-Type: 'pptpd -h' for options you may specify on the command line.
-
-A sample config file is in samples/
-
-For more help look in html/
-or visit the Poptop web site at: http://accel-pptp.sourceforge.net/
-
-
-Good Luck!
-
-accel-pptp Development Team
diff --git a/pptpd-1.3.3/README.bcrelay b/pptpd-1.3.3/README.bcrelay
deleted file mode 100644
index ad97827..0000000
--- a/pptpd-1.3.3/README.bcrelay
+++ /dev/null
@@ -1,72 +0,0 @@
-BCrelay v0.5 by Richard de Vroede <r.devroede@linvision.com>
-Original program by: TheyCallMeLuc(at)yahoo.com.au
--------------------------------------------------------------------------------
-Index
-1. License
-2. What is it?
-3. Usage
-4. Contact
-
--------------------------------------------------------------------------------
-1. License
-
-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.
-Your copy is available at: http://www.gnu.org/licenses/gpl.html
-
--------------------------------------------------------------------------------
-2. What is it?
-
-A broadcast packet repeater. This packet repeater (currently designed
-for udp packets) will listen for broadcast packets. When it receives
-the packets on the incoming interface, it will then re-broadcast them
-to the outgoing interface.
-
--------------------------------------------------------------------------------
-3. Usage
-
-Usage: /usr/sbin/bcrelay [options], where options are:
-
- [-d] [--daemon] Run as daemon.
- [-h] [--help] Displays this help message.
- [-i] [--incoming] Defines from which interface broadcasts will be
- relayed.
- [-o] [--outgoing] Defines to which interface broadcasts will be
- relayed.
- [-s] [--ipsec] Defines an ipsec tunnel to be relayed to.
- Since ipsec tunnels terminate on the same
- interface, we need to define the broadcast
- address of the other end-point of the
- tunnel. This is done as ipsec0:x.x.x.255
- [-v] [--version] Displays the BCrelay version number.
-
-Logs and debugging go to syslog as DAEMON.
-
-Interfaces can be specified as regexpressions, ie. ppp[0-9]+
-
--------------------------------------------------------------------------------
-4. Contact
-
-All comments, patches, improvements can be mailed to me, or the
-mailing list. If it makes sense, I will update this package.
-
-Richard de Vroede : r.devroede@linvision.com
-Original author : TheyCallMeLuc@yahoo.com.au
-Poptop Mailinglist : poptop-server@lists.sourceforge.net
-Official Poptop website : http://www.poptop.org
-SourceForge Poptop website : http://sourgeforge.net/projects/poptop
-
--------------------------------------------------------------------------------
-
-
diff --git a/pptpd-1.3.3/README.cvs b/pptpd-1.3.3/README.cvs
deleted file mode 100644
index 211dd7c..0000000
--- a/pptpd-1.3.3/README.cvs
+++ /dev/null
@@ -1,28 +0,0 @@
-20040425
-
-a) the main CVS module "poptop" is no longer the stable version, it is
- all versions, and the HEAD is unstable.
-
-b) CVS tags have been added:
-
- poptop-1_1_3-a is the previous stable version tag.
- (before merging 1.1.4 changes with 1.1.3 head)
- pptpd-1_2_0-b1 is the first beta of the new release.
- pptpd-1_2_0-b2 is the second beta of the new release.
- pptpd-1_2_0-b3 is the third beta of the new release.
-
- See "man cvs" for how to check out or track a tag release.
-
-c) the secondary CVS module "poptop-1.1.3" is deprecated, but HEAD
- contains 1.1.4-b4.
-
-d) 1.1.4-b4 plus a few minor edits has been released to a small test
- team as 1.2.0-b2. Results will be published when known. Other
- testers welcome; write to me.
-
-CVS Tags (module poptop)
-
-cvs tag -F pptpd-1_2_0-b3
-cvs tag -F pptpd-1_2_0-b2
-cvs tag -F poptop-1_1_3-a (before merging 1.1.4 changes with 1.1.3 head)
-
diff --git a/pptpd-1.3.3/README.inetd b/pptpd-1.3.3/README.inetd
deleted file mode 100644
index 220c0d5..0000000
--- a/pptpd-1.3.3/README.inetd
+++ /dev/null
@@ -1,45 +0,0 @@
-It is possible to run from inetd but you must consider
-the following:
-
- You use pptpctrl not pptpd.
-
- You must put pptpctrl in /etc/services as port 1723.
-
- You must configure pppd to allocate IP addresses (eg,
- use /etc/options.ttyXX, the pppd erpcd hack and an erpcd,
- or some other modification to pppd).
-
- libwrap is not used in this mode - you should use tcp
- wrappers in inetd like with any other network service.
-
- The configuration file is ignored in this mode.
-
- An example command line is:
-
- pptpctrl 0 0 0 0 0
-
- This would be put in inetd.conf as (assuming Linux tcp
- wrappers):
-
- pptpctrl stream tcp nowait root /usr/sbin/tcpd /usr/local/sbin/pptpctrl 0 0 0 0 0 --buffer--
-
- Note the --buffer-- is just to make the process name
- longer so it can modify its name to something meaningful.
-
- First option: debugging (0 for off, 1 for on)
- Second option: PPP options file (0 for off, 1 followed
- by a file name for on)
- Third option: TTY speed (0 for default, 1 followed
- by a speed to set a speed)
- Fourth option: Local IP address (0 for pppd-determined,
- 1 followed by an address to set)
- Fifth option: Remote IP address (0 for pppd-determined,
- 1 followed by an address to set)
-
- Another example, debugging on, alternate config file,
- setting tty speed and specifying the local IP address:
-
- pptpctrl 1 1 /etc/ppp/options.PPTP 1 115200 1 192.168.0.1 0
-
-David Luyer, luyer@ucs.uwa.edu.au
-Tue Jun 15 16:06:05 WST 1999
diff --git a/pptpd-1.3.3/README.logwtmp b/pptpd-1.3.3/README.logwtmp
deleted file mode 100644
index efc3183..0000000
--- a/pptpd-1.3.3/README.logwtmp
+++ /dev/null
@@ -1,36 +0,0 @@
-$Id: README.logwtmp,v 1.1 2004/04/28 11:36:07 quozl Exp $
-pptpd 1.2.0 logwtmp feature, by James Cameron, 28th April 2004.
-
-The --logwtmp feature uses the standard wtmp feature to track users
-who have connections to the server. It works as follows.
-
-When a connection occurs, pptpd launches pppd with two additional
-options. The first option directs pppd to load the pptpd-logwtmp.so
-plugin. The second option is the IP address of the client.
-
- "plugin /usr/lib/pptpd/pptpd-logwtmp.so"
- "pptpd-original-ip 10.0.0.1"
-
-The plugin defines the pptpd-original-ip option so that pppd will
-accept it.
-
-If the plugin fails to load, pppd will fail in the usual manner. Such
-a failure will usually be related to a missing file in /usr/lib/pptpd.
-
-The plugin asks pppd to notify it when IP comes up or goes down.
-
-When IP comes up, the plugin's ip_up() function executes, calling
-logwtmp() to mark the user as logged in. Once this has happened,
-commands like "who" will show the user. The tty will be set to the
-PPP interface name.
-
-When IP goes down, the plugin's ip_down() function executes, removing
-the entry from wtmp. Note that a "kill -9" on the pppd will result in
-a user appearing to remain logged in. Don't use "kill -9", use an
-ordinary kill.
-
-If pppd debug mode is enabled, the plugin announces it's version when
-loaded, and reports the parameters it is handing over to the logwtmp
-call. See the plugins/pptpd-logwtmp.c source.
-
---
diff --git a/pptpd-1.3.3/TODO b/pptpd-1.3.3/TODO
deleted file mode 100644
index 1409fa1..0000000
--- a/pptpd-1.3.3/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the pptpd project TODO list.
-
diff --git a/pptpd-1.3.3/aclocal.m4 b/pptpd-1.3.3/aclocal.m4
deleted file mode 100644
index 7d473d5..0000000
--- a/pptpd-1.3.3/aclocal.m4
+++ /dev/null
@@ -1,862 +0,0 @@
-# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.9.6])])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 7
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 8
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 3
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 8
-
-# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 12
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $1 | $1:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-#
-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
-# created by `make install' are always world readable, even if the
-# installer happens to have an overly restrictive umask (e.g. 077).
-# This was a mistake. There are at least two reasons why we must not
-# use `-m 0755':
-# - it causes special bits like SGID to be ignored,
-# - it may be too restrictive (some setups expect 775 directories).
-#
-# Do not use -m 0755 and let people choose whatever they expect by
-# setting umask.
-#
-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
-# Some implementations (such as Solaris 8's) are not thread-safe: if a
-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
-# concurrently, both version can detect that a/ is missing, but only
-# one can create it and the other will error out. Consequently we
-# restrict ourselves to GNU make (using the --version option ensures
-# this.)
-AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-AC_SUBST([mkdir_p])])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 3
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
- [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
diff --git a/pptpd-1.3.3/bcrelay.c b/pptpd-1.3.3/bcrelay.c
deleted file mode 100644
index b345795..0000000
--- a/pptpd-1.3.3/bcrelay.c
+++ /dev/null
@@ -1,1014 +0,0 @@
-// A broadcast packet repeater. This packet repeater (currently designed for
-// udp packets) will listen for broadcast packets.
-// When it receives the packets, it will then re-broadcast the packet.
-//
-// Written by TheyCallMeLuc(at)yahoo.com.au
-// I accept no responsiblity for the function of this program if you
-// choose to use it.
-// Modified for Poptop by Richard de Vroede <r.devroede@linvision.com>
-// Ditto on the no responsibility.
-//
-// Rewritten by Norbert van Bolhuis <norbert@vanbolhuis.demon.nl> bcrelay (v1.0+)
-// now supports/does:
-// 1) Relaying from PPP (VPN tunnel) interfaces, hereby creating a virtual
-// LAN (w.r.t. UDP broadcasts) for VPN clients and ethernet PCs
-// belonging/matching the subnet portion of the VPN IP addresses.
-// So now broadcasting to/from all systems of the VPN has been implemented.
-// Note that bcrelay v0.5 only relayed from LAN to VPN clients.
-// It doesn't matter whether the systems on the VPN are on the LAN of the
-// VPN server or have a VPN/PPTP connection (over the internet) to the VPN
-// server. Broadcasts will always be relayed to/from all given interfaces. And
-// as long as the subnet portion of the IP addresses of the systems on the VPN
-// matches, the VPN server will be able to route properly. This means all
-// networking applications/games that rely on a UDP broadcast from one or
-// more PPP (VPN tunnel) interfaces will now see eachother and work over
-// the VPN.
-// Note that it depends on the networking application/game and whoever
-// acts as application/game server/host who is sending (UPD) broadcasts
-// and who is listening.
-// 2) UDP broadcasts received on a PPP interface (VPN tunnel) sometimes
-// don't carry the VPN IP address which pptpd provisioned. I've seen
-// this happening on a WinXP SP1 box, especially when the application
-// responsible for the UDP broadcasts isn't aware of the PPP interface.
-// In this case it just uses the LAN IP src address for the IP src
-// address of the inner (GRE encapsulated) IP packet. This breaks
-// the "virtual LAN" and therefore bcrelay, as of this version, changes
-// the src IP address to the VPN IP address (which pptpd provisioned)
-// before relaying.
-// 3) To avoid a UDP broadcast loop, bcrelay changes the IP TTL and the
-// UDP checksum (to 1 and 0 respectively) of the UDP broadcasts it relays.
-// No relaying will be done for UDP broadcasts with IP TTL=1 and UDP
-// checksum=0. Could also (mis)use IP identification for this, but IP TTL
-// and UDP chksum combination is expected to work fine.
-// 4) bcrelay v0.5 forgot to update IP/UDP checksum when it changed the
-// dest. IP address (e.g. from 192.168.1.255 to 255.255.255.255).
-// Of course as of this version bcrelay always updates the IP/UDP
-// checksum since the IP TTL and src IP address will change also.
-// 5) Enhanced the (syslog) debugging capabilities. By default bcrelay will
-// show what it is doing. Bcrelay will syslog the IP interfaces it tries
-// to read/relay UDP broadcasts from/to. These interfaces are called
-// the 'active interfaces', bcrelay will syslog the initial set of active
-// interfaces and whenever the set changes. Currently there is no difference
-// between an incoming interface (given with -i) and an outgoing interface
-// (given with -o), so bcrelay won't show this attribute. Also, bcrelay will
-// syslog a successfully relayed UDP broadcast, including the UDP port numbers,
-// the incoming interface and the interface(s) to which it was successfully
-// relayed. The (new) -n option allows to suppress syslog tracing.
-// If -n is given, bcrelay shows/syslogs nothing, except fatal error
-// messages.
-//
-// This software is completely free. You can use and/or modify this
-// software to your hearts content. You are free to redistribute it as
-// long as it is accompanied with the source and my credit is included.
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef __linux__
-#define _GNU_SOURCE 1 /* strdup() prototype, broken arpa/inet.h */
-#endif
-
-#ifdef __svr4__
-#define __EXTENSIONS__ 1 /* strdup() prototype */
-#endif
-
-#ifdef __sgi__
-#define _XOPEN_SOURCE 500 /* strdup() prototype */
-#endif
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <string.h>
-#include <libgen.h>
-#include <time.h>
-#include <sys/time.h>
-#include <regex.h>
-#include <net/if.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <netpacket/packet.h>
-#include <net/ethernet.h>
-#include <netinet/ip.h>
-#include <netinet/udp.h>
-#include <netinet/tcp.h>
-#include <dirent.h>
-
-#include "defaults.h"
-#include "our_syslog.h"
-#include "our_getopt.h"
-
-//#define VERSION "1.0"
-
-/* uncomment if you compile this without poptop's configure script */
-//#define HAVE_FORK
-
-/*
- * Value-return macros to fields in the IP PDU header
- */
-#define IP_IPPDU_IHL(ippdu) (*(unsigned char *)(ippdu) & 0x0F)
-#define IP_IPPDU_PROTO(ippdu) (*((unsigned char *)(ippdu) + 9) & 0xFF)
-
-/*
- * Pointer macros to fields in the IP PDU header
- */
-#define IP_IPPDU_CHECKSUM_MSB_PTR(ippdu) ((unsigned char *)(ippdu) + 10 )
-#define IP_IPPDU_CHECKSUM_LSB_PTR(ippdu) ((unsigned char *)(ippdu) + 11 )
-
-/*
- * Pointer macros to fields in the UDP PDU header
- */
-#define IP_UDPPDU_CHECKSUM_MSB_PTR(udppdu) ((unsigned char *)(udppdu) + 6 )
-#define IP_UDPPDU_CHECKSUM_LSB_PTR(udppdu) ((unsigned char *)(udppdu) + 7 )
-
-#define MAXIF 255 // Maximum interfaces to use
-#define MAX_SELECT_WAIT 3 // Maximum time (in secs) to wait for input on the socket/interfaces
- // A time-out triggers the discovery of new interfaces.
-#define MAX_NODISCOVER_IFS 12 // Maximum time (in secs) to elaps before a discovery of new
- // interfaces is triggered. Only when a packet keeps coming in
- // (this prevents a select time-out) a variable initialized with
- // this #define becomes 0 and a rediscovery of the interfaces is
- // triggered.
-#define MAX_IFLOGTOSTR 16
-
-/* Local function prototypes */
-static void showusage(char *prog);
-static void showversion();
-#ifndef HAVE_DAEMON
-static void my_daemon(int argc, char **argv);
-#endif
-static void mainloop(int argc, char **argv);
-
-struct packet {
- struct iphdr ip;
- struct udphdr udp;
- char data[ETHERMTU];
-};
-
-
-/*
- * struct that keeps track of the interfaces of the system
- * selected upon usage by bcrelay (with -i and -o option).
- * An array of this struct is returned by discoverActiveInterfaces.
- * This array is reset (filled from scratch) each time
- * discoverActiveInterfaces is called.
- */
-struct iflist {
-//Fix 3mar2003
- //char index;
- int index;
- u_int32_t bcast;
- char ifname[16+1];
- unsigned long ifaddr;
- unsigned long ifdstaddr;
- unsigned long flags1;
-};
-
-#define IFLIST_FLAGS1_IF_IS_ETH 0x00000001
-#define IFLIST_FLAGS1_IF_IS_PPP 0x00000002
-#define IFLIST_FLAGS1_IF_IS_UNKNOWN 0x00000004
-#define IFLIST_FLAGS1_CHANGED_INNER_SADDR 0x00010000
-
-
-/*
- * struct that keeps track of the socket fd's for every interface
- * that is in use (and thus present in iflist).
- * Two permanent arrays of this struct are used, one for the
- * previous/old list and one for the current list.
- */
-struct ifsnr {
- int sock_nr;
- int ifindex;
-};
-
-static void copy_ifsnr(struct ifsnr *from, struct ifsnr *to);
-static int find_sock_nr(struct ifsnr *l, int ifidx);
-struct iflist *discoverActiveInterfaces(int s);
-void ip_update_checksum(unsigned char *ippdu);
-static char *IpProtToString( unsigned char prot );
-static char *iflistToString( struct iflist *ifp );
-static char *iflistLogIToString( struct iflist *ifp, int idx, struct ifsnr *ifnr );
-static char *iflistLogRToString( struct iflist *ifp, int idx, struct ifsnr *ifnr );
-static void bind_to_iface(int fd, int ifindex);
-
-/*
- * This global variable determines whether NVBCR_PRINTF actually
- * displays something. While developping v1.0, NVBCR_PRINTF were
- * printf and a lot of tracing/logging/debugging was done with these.
- * Of course, by default these 'info' messages have been turned off
- * now. Enable by setting variable to 1. Note that output will only
- * appear in non-daemon mode (see also NVBCR_PRINTF).
- */
-static int do_org_info_printfs = 0;
-
-static int vnologging = 0;
-static int vdaemon = 0;
-
-#define NVBCR_PRINTF( args ) \
- if ((vdaemon == 0) && (do_org_info_printfs == 1)) printf args
-
-static char interfaces[32];
-static char log_interfaces[MAX_IFLOGTOSTR*MAXIF];
-static char log_relayed[(MAX_IFLOGTOSTR-1)*MAXIF+81];
-static char *ipsec = "";
-
-static void showusage(char *prog)
-{
- printf("\nBCrelay v%s\n\n", VERSION);
- printf("A broadcast packet repeater. This packet repeater (currently designed for udp packets) will listen\n");
- printf(" for broadcast packets. When it receives the packets, it will then re-broadcast the packet.\n\n");
- printf("Usage: %s [options], where options are:\n\n", prog);
- printf(" [-d] [--daemon] Run as daemon.\n");
- printf(" [-h] [--help] Displays this help message.\n");
- printf(" [-i] [--incoming <ifin>] Defines from which interface broadcasts will be relayed.\n");
- printf(" [-n] [--nolog] No logging/tracing to /var/log/messages.\n");
- printf(" [-o] [--outgoing <ifout>] Defines to which interface broadcasts will be relayed.\n");
- printf(" [-s] [--ipsec <arg>] Defines an ipsec tunnel to be relayed to.\n");
- printf(" Since ipsec tunnels terminate on the same interface, we need to define the broadcast\n");
- printf(" address of the other end-point of the tunnel. This is done as ipsec0:x.x.x.255\n");
- printf(" [-v] [--version] Displays the BCrelay version number.\n");
- printf("\nLog messages and debugging go to syslog as DAEMON.\n\n");
- printf("\nInterfaces can be specified as regexpressions, ie. ppp[0-9]+\n\n");
-}
-
-static void showversion()
-{
- printf("BCrelay v%s\n", VERSION);
-}
-
-#ifndef HAVE_DAEMON
-static void my_daemon(int argc, char **argv)
-{
- pid_t pid;
-#ifndef BCRELAY_BIN
-/* Need a smart way to locate the binary -rdv */
-#define BCRELAY_BIN argv[0]
-#endif
-#ifndef HAVE_FORK
- /* need to use vfork - eg, uClinux */
- char **new_argv;
- extern char **environ;
- int minusd=0;
- int i;
- int fdr;
-
- /* Strip -d option */
- new_argv = malloc((argc) * sizeof(char **));
- fdr = open("/dev/null", O_RDONLY);
- new_argv[0] = BCRELAY_BIN;
- for (i = 1; argv[i] != NULL; i++) {
- if (fdr != 0) { dup2(fdr, 0); close(fdr); }
- if ( (strcmp(argv[i],"-d")) == 0 ) {
- minusd=1;
- }
- if (minusd) {
- new_argv[i] = argv[i+1];
- } else {
- new_argv[i] = argv[i];
- }
- }
- syslog(LOG_DEBUG, "Option parse OK, re-execing as daemon");
- fflush(stderr);
- if ((pid = vfork()) == 0) {
- if (setsid() < 0) { /* shouldn't fail */
- syslog(LOG_ERR, "Setsid failed!");
- _exit(1);
- }
- chdir("/");
- umask(0);
- /* execve only returns on an error */
- execve(BCRELAY_BIN, new_argv, environ);
- exit(1);
- } else if (pid > 0) {
- syslog(LOG_DEBUG, "Success re-execing as daemon!");
- exit(0);
- } else {
- syslog(LOG_ERR, "Error vforking");
- exit(1);
- }
-#else
- pid=fork();
- if (pid<0) { syslog(LOG_ERR, "Error forking"); _exit(1); }
- if (pid>0) { syslog(LOG_DEBUG, "Parent exits"); _exit(0); }
- if (pid==0) { syslog(LOG_DEBUG, "Running as child"); }
- /* child (daemon) continues */
- if (setsid() < 0) { /* shouldn't fail */
- syslog(LOG_ERR, "Setsid failed!");
- _exit(1);
- }
- chdir("/");
-#endif
-}
-#endif
-
-int main(int argc, char **argv) {
- regex_t preg;
- /* command line options */
- int c;
- char *ifout = "";
- char *ifin = "";
-
-#ifndef BCRELAY
- fprintf(stderr,
- "bcrelay: pptpd was compiled without support for bcrelay, exiting.\n"
- " run configure --with-bcrelay, make, and install.\n");
- exit(1);
-#endif
-
- /* open a connection to the syslog daemon */
- openlog("bcrelay", LOG_PID, PPTP_FACILITY);
-
- while (1) {
- int option_index = 0;
-
- static struct option long_options[] =
- {
- {"nolog", 0, 0, 0},
- {"daemon", 0, 0, 0},
- {"help", 0, 0, 0},
- {"incoming", 1, 0, 0},
- {"outgoing", 1, 0, 0},
- {"ipsec", 1, 0, 0},
- {"version", 0, 0, 0},
- {0, 0, 0, 0}
- };
-
- c = getopt_long(argc, argv, "ndhi:o:s:v", long_options, &option_index);
- if (c == -1)
- break;
- /* convert long options to short form */
- if (c == 0)
- c = "ndhiosv"[option_index];
- switch (c) {
- case 'n':
- vnologging = 1;
- break;
- case 'd':
- vdaemon = 1;
- break;
- case 'h':
- showusage(argv[0]);
- return 0;
- case 'i':
- ifin = strdup(optarg);
- break;
- case 'o':
- ifout = strdup(optarg);
- break;
- case 's':
- ipsec = strdup(optarg);
- // Validate the ipsec parameters
- regcomp(&preg, "ipsec[0-9]+:[0-9]+.[0-9]+.[0-9]+.255", REG_EXTENDED);
- if (regexec(&preg, ipsec, 0, NULL, 0)) {
- syslog(LOG_INFO,"Bad syntax: %s", ipsec);
- fprintf(stderr, "\nBad syntax: %s\n", ipsec);
- showusage(argv[0]);
- return 0;
- } else {
- regfree(&preg);
- break;
- }
- case 'v':
- showversion();
- return 0;
- default:
- showusage(argv[0]);
- return 1;
- }
- }
- if (ifin == "") {
- syslog(LOG_INFO,"Incoming interface required!");
- showusage(argv[0]);
- _exit(1);
- }
- if (ifout == "" && ipsec == "") {
- syslog(LOG_INFO,"Listen-mode or outgoing or IPsec interface required!");
- showusage(argv[0]);
- _exit(1);
- } else {
- sprintf(interfaces,"%s|%s", ifin, ifout);
- }
-
- // If specified, become Daemon.
- if (vdaemon) {
-#if HAVE_DAEMON
- closelog();
- freopen("/dev/null", "r", stdin);
- /* set noclose, we want stdout/stderr still attached if we can */
- daemon(0, 1);
- /* returns to child only */
- /* pid will have changed */
- openlog("bcrelay", LOG_PID, PPTP_FACILITY);
-#else /* !HAVE_DAEMON */
- my_daemon(argc, argv);
- /* returns to child if !HAVE_FORK
- * never returns if HAVE_FORK (re-execs without -d)
- */
-#endif
- } else {
- syslog(LOG_INFO, "Running as child\n");
- }
- mainloop(argc,argv);
- _exit(0);
-}
-
-static void mainloop(int argc, char **argv)
-{
- socklen_t salen = sizeof(struct sockaddr_ll);
- int i, s, rcg, j, no_discifs_cntr, ifs_change;
- int logstr_cntr;
- struct iflist *iflist = NULL; // Initialised after the 1st packet
- struct sockaddr_ll sa;
- struct packet *ipp_p;
- char *udppdu; // FIXME: warning: pointer targets in assignment differ in signedness
- fd_set sock_set;
- struct timeval time_2_wait;
- static struct ifsnr old_ifsnr[MAXIF+1]; // Old iflist to socket fd's mapping list
- static struct ifsnr cur_ifsnr[MAXIF+1]; // Current iflist to socket fd's mapping list
- unsigned char buf[1518];
- char *logstr = "";
-
- no_discifs_cntr = MAX_NODISCOVER_IFS;
- ifs_change = 0;
-
- /*
- * Open general ethernet socket, only used to discover interfaces.
- */
- if ((s = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL))) < 0)
- syslog(LOG_INFO,"%s: Error creating socket", *argv);
-
-
- /*
- * Discover interfaces (initial set) and create a dedicated socket bound to the interface
- */
- memset(old_ifsnr, -1, sizeof(old_ifsnr));
- memset(cur_ifsnr, -1, sizeof(cur_ifsnr));
- iflist = discoverActiveInterfaces(s);
- for (i=0; iflist[i].index; ++i) {
- if ((cur_ifsnr[i].sock_nr = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL))) < 0) {
- syslog(LOG_ERR, "mainloop: Error, socket error! (rv=%d, errno=%d)", cur_ifsnr[i].sock_nr, errno);
- exit(1);
- }
- bind_to_iface(cur_ifsnr[i].sock_nr, iflist[i].index);
- cur_ifsnr[i].ifindex = iflist[i].index;
- }
- NVBCR_PRINTF(("Displaying INITIAL active interfaces..\n"));
- if (vnologging == 0) {
- logstr = log_interfaces;
- logstr_cntr = sprintf(logstr, "Initial active interfaces: ");
- logstr += logstr_cntr;
- }
- for (i = 0; iflist[i].index; i++)
- {
- NVBCR_PRINTF(("\t\tactive interface number: %d, if=(%s), sock_nr=%d\n", i, iflistToString(&(iflist[i])), cur_ifsnr[i].sock_nr));
- if (vnologging == 0) {
- logstr_cntr = sprintf(logstr, "%s ", iflistLogIToString(&(iflist[i]), i, &(cur_ifsnr[i])));
- logstr += logstr_cntr;
- }
- }
- if (vnologging == 0) syslog(LOG_INFO, "%s", log_interfaces);
-
- // Main loop
- while (1)
- {
-
- /*
- * Check all (interface) sockets for incoming packets
- */
- FD_ZERO(&sock_set);
- for (i=0; iflist[i].index; ++i)
- {
- if (cur_ifsnr[i].sock_nr >= 0) {
- FD_SET(cur_ifsnr[i].sock_nr, &sock_set);
- }
- }
-
- /*
- * Don't wait more than MAX_SELECT_WAIT seconds
- */
- time_2_wait.tv_sec = MAX_SELECT_WAIT;
- time_2_wait.tv_usec = 0L;
-
- /* select on sockets */
- rcg = select(MAXIF, &sock_set, (fd_set *) NULL,(fd_set *) NULL, &time_2_wait);
-
- if (rcg < 0)
- {
- syslog(LOG_ERR, "Error, select error! (rv=%d, errno=%d)", rcg, errno);
- exit(1);
- }
-
- if (rcg == 0)
- {
- /* TimeOut, rediscover interfaces */
- NVBCR_PRINTF(("Select timeout, rediscover interfaces\n"));
- copy_ifsnr(cur_ifsnr, old_ifsnr);
- memset(cur_ifsnr, -1, sizeof(cur_ifsnr));
- iflist = discoverActiveInterfaces(s);
- /*
- * Build new cur_ifsnr list.
- * Make iflist[i] correspond with cur_ifsnr[i], so iflist[i].index == cur_ifsnr[i].ifindex
- * The old list (old_ifsnr) is used to compare.
- */
- for (i=0; iflist[i].index; ++i) {
- /* check to see if it is a NEW interface */
- int fsnr = find_sock_nr(old_ifsnr, iflist[i].index);
- if (fsnr == -1) {
- /* found new interface, open dedicated socket and bind it to the interface */
- if ((cur_ifsnr[i].sock_nr = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL))) < 0) {
- syslog(LOG_ERR, "mainloop: Error, socket error! (rv=%d, errno=%d)", cur_ifsnr[i].sock_nr, errno);
- exit(1);
- }
- bind_to_iface(cur_ifsnr[i].sock_nr, iflist[i].index);
- ifs_change = 1;
- }
- else
- {
- /*
- * not a new interface, socket already openen, interface already
- * bound. Update cur_ifsnr.
- */
- cur_ifsnr[i].sock_nr = fsnr;
- }
- cur_ifsnr[i].ifindex = iflist[i].index;
- }
- /* Close disappeared interfaces */
- for (i=0; i<MAXIF; ++i)
- {
- if ((old_ifsnr[i].sock_nr != -1) && (old_ifsnr[i].ifindex != -1) &&
- (find_sock_nr(cur_ifsnr, old_ifsnr[i].ifindex) == -1)) {
- NVBCR_PRINTF(("Closing an interface (it disappeared), namely: (s_nr=%d, ifidx=%d)\n", old_ifsnr[i].sock_nr, old_ifsnr[i].ifindex));
- close(old_ifsnr[i].sock_nr);
- old_ifsnr[i].sock_nr = -1;
- old_ifsnr[i].ifindex = -1;
- ifs_change = 1;
- }
- }
- if (ifs_change == 1)
- {
- NVBCR_PRINTF(("Active interface set changed --> displaying current active interfaces..\n"));
- if (vnologging == 0) {
- logstr = log_interfaces;
- logstr_cntr = sprintf(logstr, "Active interface set changed to: ");
- logstr += logstr_cntr;
- }
- for (i = 0; iflist[i].index; i++)
- {
- NVBCR_PRINTF(("\t\tactive interface number: %d, if=(%s), sock_nr=%d\n", i, iflistToString(&(iflist[i])), cur_ifsnr[i].sock_nr));
- if (vnologging == 0) {
- logstr_cntr = sprintf(logstr, "%s ", iflistLogIToString(&(iflist[i]), i, &(cur_ifsnr[i])));
- logstr += logstr_cntr;
- }
- }
- if (vnologging == 0) syslog(LOG_INFO, "%s", log_interfaces);
- ifs_change = 0;
- }
- continue;
- }
-
- if (rcg > 0)
- {
- /* rcg interfaces have pending input */
- for (i=0; ((iflist[i].index != 0) && (rcg > 0)); ++i)
- {
- if ((cur_ifsnr[i].sock_nr != -1) && (FD_ISSET(cur_ifsnr[i].sock_nr,&sock_set)))
- {
- /* Valid socket number and pending input, let's read */
- int rlen = read(cur_ifsnr[i].sock_nr, buf, sizeof(buf));
- ipp_p = (struct packet *)&(buf[0]);
- NVBCR_PRINTF(("IP_Packet=(tot_len=%d, id=%02x%02x, ttl=%d, prot=%s, src_ip=%d.%d.%d.%d, dst_ip=%d.%d.%d.%d) (on if: %d/%d) ", ntohs(ipp_p->ip.tot_len), (ntohs(ipp_p->ip.id))>>8, (ntohs(ipp_p->ip.id))&0x00ff, ipp_p->ip.ttl, IpProtToString(ipp_p->ip.protocol), (ntohl(ipp_p->ip.saddr))>>24, ((ntohl(ipp_p->ip.saddr))&0x00ff0000)>>16, ((ntohl(ipp_p->ip.saddr))&0x0000ff00)>>8, (ntohl(ipp_p->ip.saddr))&0x000000ff, (ntohl(ipp_p->ip.daddr))>>24, ((ntohl(ipp_p->ip.daddr))&0x00ff0000)>>16, ((ntohl(ipp_p->ip.daddr))&0x0000ff00)>>8, (ntohl(ipp_p->ip.daddr))&0x000000ff, i, iflist[i].index));
- rcg -= 1;
-
- if ( (ipp_p->ip.protocol == IPPROTO_UDP) &&
- (((ntohl(ipp_p->ip.daddr)) & 0x000000ff) == 0x000000ff) &&
- (ipp_p->ip.ttl != 1) &&
- (!((*IP_UDPPDU_CHECKSUM_MSB_PTR((unsigned char *)ipp_p+(4*ipp_p->ip.ihl)) == 0) &&
- (*IP_UDPPDU_CHECKSUM_LSB_PTR((unsigned char *)ipp_p+(4*ipp_p->ip.ihl)) == 0))) )
- {
- int nrsent;
- int ifindex_to_exclude = iflist[i].index;
-
- NVBCR_PRINTF(("is an UDP BROADCAST (dstPort=%d, srcPort=%d) (with TTL!=1 and UDP_CHKSUM!=0)\n\n",
- ntohs(ipp_p->udp.dest), ntohs(ipp_p->udp.source)));
- if (vnologging == 0) {
- logstr = log_relayed;
- logstr_cntr = sprintf(logstr, "UDP_BroadCast(sp=%d,dp=%d) from: %s relayed to: ", ntohs(ipp_p->udp.source),
- ntohs(ipp_p->udp.dest), iflistLogRToString(&(iflist[i]), i, &(cur_ifsnr[i])));
- logstr += logstr_cntr;
- }
-
- /* going to relay a broadcast packet on all the other interfaces */
- for (j=0; iflist[j].index; ++j)
- {
- int prepare_ipp = 0; // Changing the incoming UDP broadcast needs to be done once
-
- if (iflist[j].index != ifindex_to_exclude)
- {
- NVBCR_PRINTF(("Going to sent UDP Broadcast on interface: %s, sock_nr=%d\n", iflistToString(&(iflist[j])), cur_ifsnr[j].sock_nr));
-
- memset(&sa, 0, salen);
-
- sa.sll_family = AF_PACKET;
- sa.sll_ifindex = iflist[j].index; /* Must be the SIOCGIFINDEX number */
- // Set the outgoing hardware address to 1's. True Broadcast
- sa.sll_addr[0] = sa.sll_addr[1] = sa.sll_addr[2] = sa.sll_addr[3] = 0xff;
- sa.sll_addr[4] = sa.sll_addr[5] = sa.sll_addr[6] = sa.sll_addr[7] = 0xff;
- sa.sll_halen = 6;
-
- /*
- * htons(ETH_P_IP) is necessary otherwise sendto will
- * succeed but no packet is actually sent on the wire (this
- * was the case for PPP interfaces, for ETH interfaces an unknown
- * LAN frame is sent if htons(ETH_P_IP) is not set as protocol).
- */
- sa.sll_protocol = htons(ETH_P_IP); /* ETH_P_PPP_MP */
-
- if (prepare_ipp == 0) {
- // change TimeToLive to 1, This is to avoid loops, bcrelay will *NOT* relay
- // anything with TTL==1.
- ipp_p->ip.ttl = 1;
-
- // The CRC gets broken here when sending over ipsec tunnels but that
- // should not matter as we reassemble the packet at the other end.
- ipp_p->ip.daddr = iflist[j].bcast;
-
- // check IP srcAddr (on some winXP boxes it is found to be
- // different from the configured ppp address).
- // Only do this for PPP interfaces.
- if ((iflist[i].flags1 & IFLIST_FLAGS1_IF_IS_PPP) &&
- (ntohl(ipp_p->ip.saddr) != iflist[i].ifdstaddr))
- {
- ipp_p->ip.saddr = htonl(iflist[i].ifdstaddr);
- iflist[i].flags1 |= IFLIST_FLAGS1_CHANGED_INNER_SADDR;
- }
-
- // Update IP checkSum (TTL and src/dest IP Address might have changed)
- ip_update_checksum((unsigned char *)ipp_p);
- /* Disable upper layer checksum */
- udppdu = (unsigned char *)ipp_p + (4 * ipp_p->ip.ihl);
- *IP_UDPPDU_CHECKSUM_MSB_PTR(udppdu) = (unsigned char)0;
- *IP_UDPPDU_CHECKSUM_LSB_PTR(udppdu) = (unsigned char)0;
-
- prepare_ipp = 1;
- }
-
- /*
- * The beauty of sending IP packets on a PACKET socket of type SOCK_DGRAM is that
- * there is no need to concern about the physical/link layer header because it is
- * filled in automatically (based on the contents of sa).
- */
- if ((nrsent = sendto(cur_ifsnr[j].sock_nr, ipp_p, rlen, MSG_DONTWAIT|MSG_TRYHARD, (struct sockaddr *)&sa, salen)) < 0)
- {
- if (errno == ENETDOWN) {
- syslog(LOG_NOTICE, "ignored ENETDOWN from sendto(), a network interface was going down?");
- } else if (errno == ENXIO) {
- syslog(LOG_NOTICE, "ignored ENXIO from sendto(), a network interface went down?");
- } else if (errno == ENOBUFS) {
- syslog(LOG_NOTICE, "ignored ENOBUFS from sendto(), temporary shortage of buffer memory");
- } else {
- syslog(LOG_ERR, "mainloop: Error, sendto failed! (rv=%d, errno=%d)", nrsent, errno);
- exit(1);
- }
- }
- NVBCR_PRINTF(("Successfully relayed %d bytes \n", nrsent));
- if (vnologging == 0) {
- logstr_cntr = sprintf(logstr, "%s ", iflistLogRToString(&(iflist[j]), j, &(cur_ifsnr[j])));
- logstr += logstr_cntr;
- }
- }
- }
- if (vnologging == 0) syslog(LOG_INFO, "%s", log_relayed);
- } else {
- NVBCR_PRINTF(("is NOT an UDP BROADCAST (with TTL!=1 and UDP_CHKSUM!=0)\n\n"));
- }
- }
- }
- /*
- * Don't forget to discover new interfaces if we keep getting
- * incoming packets (on an already discovered interface).
- */
- if (no_discifs_cntr == 0)
- {
- no_discifs_cntr = MAX_NODISCOVER_IFS;
-
- /* no_discifs_cntr became 0, rediscover interfaces */
- NVBCR_PRINTF(("no_discifs_cntr became 0, rediscover interfaces\n"));
- copy_ifsnr(cur_ifsnr, old_ifsnr);
- memset(cur_ifsnr, -1, sizeof(cur_ifsnr));
- iflist = discoverActiveInterfaces(s);
- /*
- * Build new cur_ifsnr list.
- * Make iflist[i] correspond with cur_ifsnr[i], so iflist[i].index == cur_ifsnr[i].ifindex
- * The old list (old_ifsnr) is used to compare.
- */
- for (i=0; iflist[i].index; ++i) {
- /* check to see if it is a NEW interface */
- int fsnr = find_sock_nr(old_ifsnr, iflist[i].index);
- if (fsnr == -1) {
- /* found new interface, open dedicated socket and bind it to the interface */
- if ((cur_ifsnr[i].sock_nr = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL))) < 0) {
- syslog(LOG_ERR, "mainloop: Error, socket error! (rv=%d, errno=%d)", cur_ifsnr[i].sock_nr, errno);
- exit(1);
- }
- bind_to_iface(cur_ifsnr[i].sock_nr, iflist[i].index);
- ifs_change = 1;
- }
- else
- {
- /*
- * not a new interface, socket already openen, interface already
- * bound. Update cur_ifsnr.
- */
- cur_ifsnr[i].sock_nr = fsnr;
- }
- cur_ifsnr[i].ifindex = iflist[i].index;
- }
- /* Close disappeared interfaces */
- for (i=0; i<MAXIF; ++i)
- {
- if ((old_ifsnr[i].sock_nr != -1) && (old_ifsnr[i].ifindex != -1) &&
- (find_sock_nr(cur_ifsnr, old_ifsnr[i].ifindex) == -1)) {
- NVBCR_PRINTF(("Closing an interface (it disappeared), namely: (s_nr=%d, ifidx=%d)\n", old_ifsnr[i].sock_nr, old_ifsnr[i].ifindex));
- close(old_ifsnr[i].sock_nr);
- old_ifsnr[i].sock_nr = -1;
- old_ifsnr[i].ifindex = -1;
- ifs_change = 1;
- }
- }
- if (ifs_change == 1)
- {
- NVBCR_PRINTF(("Active interface set changed --> displaying current active interfaces..\n"));
- if (vnologging == 0) {
- logstr = log_interfaces;
- logstr_cntr = sprintf(logstr, "Active interface set changed to: ");
- logstr += logstr_cntr;
- }
- for (i = 0; iflist[i].index; i++)
- {
- NVBCR_PRINTF(("\t\tactive interface number: %d, if=(%s), sock_nr=%d\n", i, iflistToString(&(iflist[i])), cur_ifsnr[i].sock_nr));
- if (vnologging == 0) {
- logstr_cntr = sprintf(logstr, "%s ", iflistLogIToString(&(iflist[i]), i, &(cur_ifsnr[i])));
- logstr += logstr_cntr;
- }
- }
- if (vnologging == 0) syslog(LOG_INFO, "%s", log_interfaces);
- ifs_change = 0;
- }
- }
- else
- {
- no_discifs_cntr -= MAX_SELECT_WAIT;
- }
- }
- }
-}
-
-// Discover active interfaces
-struct iflist *
-discoverActiveInterfaces(int s) {
- static struct iflist iflist[MAXIF+1]; // Allow for MAXIF interfaces
- static struct ifconf ifs;
- int i, j, cntr = 0;
- regex_t preg;
- struct ifreq ifrflags, ifr;
- struct sockaddr_in *sin;
-
- /* Reset iflist */
- memset(iflist, 0, sizeof(iflist));
- /* Reset ifs */
- memset(&ifs, 0, sizeof(ifs));
-
- //regcomp(&preg, argv[1], REG_ICASE|REG_EXTENDED);
- regcomp(&preg, interfaces, REG_ICASE|REG_EXTENDED);
- ifs.ifc_len = MAXIF*sizeof(struct ifreq);
- ifs.ifc_req = malloc(ifs.ifc_len);
- ioctl(s, SIOCGIFCONF, &ifs); // Discover active interfaces
- for (i = 0; i * sizeof(struct ifreq) < ifs.ifc_len && cntr < MAXIF; i++)
- {
- if (regexec(&preg, ifs.ifc_req[i].ifr_name, 0, NULL, 0) == 0) {
-
- /*
- * Get interface flags and check status and type.
- * Only if interface is up it will be used.
- */
- memset(&ifrflags, 0, sizeof(ifrflags));
- strncpy(ifrflags.ifr_name, ifs.ifc_req[i].ifr_name, strlen(ifs.ifc_req[i].ifr_name));
- if (ioctl(s, SIOCGIFFLAGS, &ifrflags) < 0) {
- syslog(LOG_ERR, "discoverActiveInterfaces: Error, SIOCGIFFLAGS Failed! (errno=%d)", errno);
- exit(1);
- }
-
- if (ifrflags.ifr_flags & IFF_UP)
- {
- /*
- * Get interface index
- */
- ioctl(s, SIOCGIFINDEX, &ifs.ifc_req[i]);
-//Fix 3mar2003
- //iflist[cntr].index = (char)ifs.ifc_req[i].ifr_ifindex;
- iflist[cntr].index = ifs.ifc_req[i].ifr_ifindex;
-
- /*
- * Get interface name
- */
- for (j=0; (j<sizeof(iflist[cntr].ifname) && j<strlen(ifs.ifc_req[i].ifr_ifrn.ifrn_name)); ++j)
- iflist[cntr].ifname[j] = ifs.ifc_req[i].ifr_ifrn.ifrn_name[j];
- iflist[cntr].ifname[j+1] = '\0';
-
- /*
- * Get local IP address
- */
- memset(&ifr, 0, sizeof(ifr));
- ifr.ifr_addr.sa_family = AF_INET;
- (void)strncpy(ifr.ifr_name, iflist[cntr].ifname, strlen(iflist[cntr].ifname)+1);
- if (ioctl(s, SIOCGIFADDR, (char *)&ifr) < 0) {
- syslog(LOG_ERR, "discoverActiveInterfaces: Error, SIOCGIFADDR Failed! (errno=%d)", errno);
- exit(1);
- }
- sin = (struct sockaddr_in *)&ifr.ifr_addr;
- iflist[cntr].ifaddr = ntohl(sin->sin_addr.s_addr);
-
- iflist[cntr].flags1 = 0;
-
- if (ifrflags.ifr_flags & IFF_POINTOPOINT) {
- /*
- * Get remote IP address (only for PPP interfaces)
- */
- memset(&ifr, 0, sizeof(ifr));
- ifr.ifr_addr.sa_family = AF_INET;
- (void)strncpy(ifr.ifr_name, iflist[cntr].ifname, strlen(iflist[cntr].ifname)+1);
- if (ioctl(s, SIOCGIFDSTADDR, (char *)&ifr) < 0) {
- syslog(LOG_ERR, "discoverActiveInterfaces: Error, SIOCGIFDSTADDR Failed! (errno=%d)", errno);
- exit(1);
- }
- sin = (struct sockaddr_in *)&ifr.ifr_addr;
- iflist[cntr].ifdstaddr = ntohl(sin->sin_addr.s_addr);
-
- iflist[cntr].flags1 |= IFLIST_FLAGS1_IF_IS_PPP;
- iflist[cntr].bcast = INADDR_BROADCAST;
- }
- else if (ifrflags.ifr_flags & IFF_BROADCAST)
- {
- iflist[cntr].ifdstaddr = 0;
- iflist[cntr].flags1 |= IFLIST_FLAGS1_IF_IS_ETH;
- iflist[cntr].bcast = INADDR_BROADCAST;
- }
- else
- {
- iflist[cntr].ifdstaddr = 0;
- iflist[cntr].flags1 |= IFLIST_FLAGS1_IF_IS_UNKNOWN;
- iflist[cntr].bcast = INADDR_BROADCAST;
- }
-
- cntr++;
- }
- // IPSEC tunnels are a fun one. We must change the destination address
- // so that it will be routed to the correct tunnel end point.
- // We can define several tunnel end points for the same ipsec interface.
- } else if (ipsec != "" && strncmp(ifs.ifc_req[i].ifr_name, "ipsec", 5) == 0) {
- if (strncmp(ifs.ifc_req[i].ifr_name, ipsec, 6) == 0) {
- struct hostent *hp = gethostbyname(ipsec+7);
- ioctl(s, SIOCGIFINDEX, &ifs.ifc_req[i]);
- iflist[cntr].index = ifs.ifc_req[i].ifr_ifindex; /* Store the SIOCGIFINDEX number */
- memcpy(&(iflist[cntr++].bcast), hp->h_addr, sizeof(u_int32_t));
- }
- }
- }
-
- iflist[cntr].index = 0; // Terminate list
- free(ifs.ifc_req); // Stop that leak.
- regfree(&preg);
-
- return iflist;
-}
-
-
-
-unsigned int ip_compute_checksum(unsigned char *ippdu, int hlen)
-{
- unsigned int sum = 0, temp;
- unsigned char *p;
- unsigned char cs_msb;
- unsigned char cs_lsb;
-
- /* Save original checksum */
- cs_msb = *IP_IPPDU_CHECKSUM_MSB_PTR(ippdu);
- cs_lsb = *IP_IPPDU_CHECKSUM_LSB_PTR(ippdu);
-
- *IP_IPPDU_CHECKSUM_MSB_PTR(ippdu) = 0;
- *IP_IPPDU_CHECKSUM_LSB_PTR(ippdu) = 0;
-
- p = ippdu;
- hlen /= 2; /* We'll compute taking two bytes a a time */
- while(hlen--) { sum += ((*p * 256) + *(p + 1)); p += 2; }
- while ((temp = (sum >> 16))) { sum = (temp + (sum & 0xFFFF)); }
-
- /* Restore original checksum */
- *IP_IPPDU_CHECKSUM_MSB_PTR(ippdu) = cs_msb;
- *IP_IPPDU_CHECKSUM_LSB_PTR(ippdu) = cs_lsb;
-
- return(~sum & 0xFFFF);
-}
-
-void ip_update_checksum(unsigned char *ippdu)
-{
- unsigned int cs;
-
- cs = ip_compute_checksum(ippdu, 4 * IP_IPPDU_IHL(ippdu));
-
- *IP_IPPDU_CHECKSUM_MSB_PTR(ippdu) = (unsigned char)((cs >> 8) & 0xFF);
- *IP_IPPDU_CHECKSUM_LSB_PTR(ippdu) = (unsigned char)(cs & 0xFF);
-}
-
-
-static char *IpProtToString( unsigned char prot )
-{
- switch( prot )
- {
- case 0x11:
- return "UDP";
- case 0x6:
- return "TCP";
- case 0x2f:
- return "GRE";
- case 0x1:
- return "ICMP";
- default:
- return "???";
- }
-}
-
-static char *iflistToString( struct iflist *ifp )
-{
- static char str_tr[80+1];
-
- sprintf(str_tr, "index=%d, ifname=%s, ifaddr=%ld.%ld.%ld.%ld, ifdstaddr=%ld.%ld.%ld.%ld, flags1=0x%04lx",
- ifp->index, ifp->ifname,
- (ifp->ifaddr)>>24, ((ifp->ifaddr)&0x00ff0000)>>16, ((ifp->ifaddr)&0x0000ff00)>>8, (ifp->ifaddr)&0x000000ff,
- (ifp->ifdstaddr)>>24, ((ifp->ifdstaddr)&0x00ff0000)>>16, ((ifp->ifdstaddr)&0x0000ff00)>>8,
- (ifp->ifdstaddr)&0x000000ff, ifp->flags1);
-
- return str_tr;
-}
-
-static char *iflistLogRToString( struct iflist *ifp, int idx, struct ifsnr *ifnr )
-{
- static char str_tr[MAX_IFLOGTOSTR]; /*
- * This makes function: 1) non-reentrant (doesn't matter).
- * 2) not useable multiple times by (s)printf.
- */
- sprintf(str_tr, "%s", ifp->ifname);
- return str_tr;
-}
-
-static char *iflistLogIToString( struct iflist *ifp, int idx, struct ifsnr *ifnr )
-{
- static char str_tr[MAX_IFLOGTOSTR]; /*
- * This makes function: 1) non-reentrant (doesn't matter).
- * 2) not useable multiple times by (s)printf.
- */
- sprintf(str_tr, "%s(%d/%d/%d)", ifp->ifname, idx, ifp->index, ifnr->sock_nr);
- return str_tr;
-}
-
-static void bind_to_iface(int fd, int ifindex)
-{
- struct sockaddr_ll sll;
-
- memset(&sll, 0, sizeof(sll));
- sll.sll_family = AF_PACKET;
- sll.sll_ifindex = ifindex;
- sll.sll_protocol = htons(ETH_P_ALL);
-
- if (bind(fd, (struct sockaddr *) &sll, sizeof(sll)) == -1) {
- syslog(LOG_ERR, "bind_to_iface: Error, bind failed! (rv=-1, errno=%d)", errno);
- exit(1);
- }
-}
-
-static void copy_ifsnr(struct ifsnr *from, struct ifsnr *to)
-{
- int i;
-
- for (i=0; i<MAXIF; ++i)
- {
- to[i].sock_nr = from[i].sock_nr;
- to[i].ifindex = from[i].ifindex;
- }
-}
-
-static int find_sock_nr(struct ifsnr *l, int ifidx)
-{
- int i;
-
- for (i=0; i<MAXIF; ++i)
- if (l[i].ifindex == ifidx) return l[i].sock_nr;
- /* not found */
- return -1;
-}
-
diff --git a/pptpd-1.3.3/compat.c b/pptpd-1.3.3/compat.c
deleted file mode 100644
index 4e57d6c..0000000
--- a/pptpd-1.3.3/compat.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * compat.c
- *
- * Compatibility functions for different OSes
- *
- * $Id: compat.c,v 1.6 2005/08/22 00:48:34 quozl Exp $
- */
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "compat.h"
-
-#ifndef HAVE_STRLCPY
-#include <string.h>
-#include <stdio.h>
-
-void strlcpy(char *dst, const char *src, size_t size)
-{
- strncpy(dst, src, size - 1);
- dst[size - 1] = '\0';
-}
-#endif
-
-#ifndef HAVE_MEMMOVE
-void *memmove(void *dst, const void *src, size_t size)
-{
- bcopy(src, dst, size);
- return dst;
-}
-#endif
-
-#ifndef HAVE_SETPROCTITLE
-#include "inststr.h"
-#endif
-
-#define __USE_BSD 1
-#include <stdarg.h>
-#include <stdio.h>
-
-void my_setproctitle(int argc, char **argv, const char *format, ...) {
- char proctitle[64];
- va_list parms;
- va_start(parms, format);
- vsnprintf(proctitle, sizeof(proctitle), format, parms);
-
-#ifndef HAVE_SETPROCTITLE
- inststr(argc, argv, proctitle);
-#else
- setproctitle(proctitle);
-#endif
- va_end(parms);
-}
-
-/* signal to pipe delivery implementation */
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-
-/* pipe private to process */
-static int sigpipe[2];
-
-/* create a signal pipe, returns 0 for success, -1 with errno for failure */
-int sigpipe_create()
-{
- int rc;
-
- rc = pipe(sigpipe);
- if (rc < 0) return rc;
-
- fcntl(sigpipe[0], F_SETFD, FD_CLOEXEC);
- fcntl(sigpipe[1], F_SETFD, FD_CLOEXEC);
-
-#ifdef O_NONBLOCK
-#define FLAG_TO_SET O_NONBLOCK
-#else
-#ifdef SYSV
-#define FLAG_TO_SET O_NDELAY
-#else /* BSD */
-#define FLAG_TO_SET FNDELAY
-#endif
-#endif
-
- rc = fcntl(sigpipe[1], F_GETFL);
- if (rc != -1)
- rc = fcntl(sigpipe[1], F_SETFL, rc | FLAG_TO_SET);
- if (rc < 0) return rc;
- return 0;
-#undef FLAG_TO_SET
-}
-
-/* generic handler for signals, writes signal number to pipe */
-void sigpipe_handler(int signum)
-{
- write(sigpipe[1], &signum, sizeof(signum));
- signal(signum, sigpipe_handler);
-}
-
-/* assign a signal number to the pipe */
-void sigpipe_assign(int signum)
-{
- struct sigaction sa;
-
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = sigpipe_handler;
- sigaction(signum, &sa, NULL);
-}
-
-/* return the signal pipe read file descriptor for select(2) */
-int sigpipe_fd()
-{
- return sigpipe[0];
-}
-
-/* read and return the pending signal from the pipe */
-int sigpipe_read()
-{
- int signum;
- read(sigpipe[0], &signum, sizeof(signum));
- return signum;
-}
-
-void sigpipe_close()
-{
- close(sigpipe[0]);
- close(sigpipe[1]);
-}
-
diff --git a/pptpd-1.3.3/compat.h b/pptpd-1.3.3/compat.h
deleted file mode 100644
index d176f98..0000000
--- a/pptpd-1.3.3/compat.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * compat.h
- *
- * Compatibility functions for different OSes (prototypes)
- *
- * $Id: compat.h,v 1.5 2005/01/05 11:01:51 quozl Exp $
- */
-
-#ifndef _PPTPD_COMPAT_H
-#define _PPTPD_COMPAT_H
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if HAVE_SETSID
-#define SETSIDPGRP setsid
-#else
-#define SETSIDPGRP setpgrp
-#endif
-
-#include <sys/types.h>
-
-#ifndef HAVE_STRLCPY
-/* void since to be fast and portable, we use strncpy, but this
- * means we don't know how many bytes were copied
- */
-extern void strlcpy(char *dst, const char *src, size_t size);
-#endif /* !HAVE_STRLCPY */
-
-#ifndef HAVE_MEMMOVE
-extern void *memmove(void *dst, const void *src, size_t size);
-#endif /* !HAVE_MEMMOVE */
-
-#ifndef HAVE_OPENPTY
-/* Originally from code by C. S. Ananian */
-
-/* These are the Linux values - and fairly sane defaults.
- * Since we search from the start and just skip errors, they'll do.
- * Note that Unix98 has an openpty() call so we don't need to worry
- * about the new pty names here.
- */
-#define PTYDEV "/dev/ptyxx"
-#define TTYDEV "/dev/ttyxx"
-#define PTYMAX 11
-#define TTYMAX 11
-#define PTYCHAR1 "pqrstuvwxyzabcde"
-#define PTYCHAR2 "0123456789abcdef"
-
-/* Dummy the last 2 args, so we don't have to find the right include
- * files on every OS to define the needed structures.
- */
-extern int openpty(int *, int *, char *, void *, void *);
-#endif /* !HAVE_OPENPTY */
-
-#ifndef HAVE_STRERROR
-extern char *strerror(int);
-#endif
-
-extern void my_setproctitle(int argc, char **argv, const char *format, ...)
- __attribute__ ((format (printf, 3, 4)));
-
-/* signal to pipe delivery implementation */
-
-/* create a signal pipe, returns 0 for success, -1 with errno for failure */
-int sigpipe_create();
-
-/* generic handler for signals, writes signal number to pipe */
-void sigpipe_handler(int signum);
-
-/* assign a signal number to the pipe */
-void sigpipe_assign(int signum);
-
-/* return the signal pipe read file descriptor for select(2) */
-int sigpipe_fd();
-
-/* read and return the pending signal from the pipe */
-int sigpipe_read();
-
-void sigpipe_close();
-
-#endif /* !_PPTPD_COMPAT_H */
diff --git a/pptpd-1.3.3/config.embed.h b/pptpd-1.3.3/config.embed.h
deleted file mode 100644
index ad09bf6..0000000
--- a/pptpd-1.3.3/config.embed.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * config.embed.h
- *
- * Dummy autoconf results for uClinux target.
- *
- * $Id: config.embed.h,v 1.4 2004/04/22 10:48:16 quozl Exp $
- */
-
-#define STDC_HEADERS 1
-#define HAVE_SETSID 1
-#define HAVE_MEMMOVE 1
-#define HAVE_STRING_H 1
-#define PPP_BINARY "/bin/pppd"
-#define BCRELAY_BIN "/bin/bcrelay"
-#define SBINDIR "/bin"
diff --git a/pptpd-1.3.3/config.h.in b/pptpd-1.3.3/config.h.in
deleted file mode 100644
index 2bc382e..0000000
--- a/pptpd-1.3.3/config.h.in
+++ /dev/null
@@ -1,148 +0,0 @@
-/* config.h.in. Generated from configure.in by autoheader. */
-
-/* "Enable Broadcast Relay" */
-#undef BCRELAY
-
-/* Define to 1 if you have the `daemon' function. */
-#undef HAVE_DAEMON
-
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
-/* Define to 1 if you have the `getservbyname' function. */
-#undef HAVE_GETSERVBYNAME
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `c' library (-lc). */
-#undef HAVE_LIBC
-
-/* Define to 1 if you have the `intl' library (-lintl). */
-#undef HAVE_LIBINTL
-
-/* Define to 1 if you have the <libintl.h> header file. */
-#undef HAVE_LIBINTL_H
-
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define to 1 if you have the `socket' library (-lsocket). */
-#undef HAVE_LIBSOCKET
-
-/* Define to 1 if you have the <libutil.h> header file. */
-#undef HAVE_LIBUTIL_H
-
-/* "use libwrap" */
-#undef HAVE_LIBWRAP
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `setproctitle' function. */
-#undef HAVE_SETPROCTITLE
-
-/* Define to 1 if you have the `setsid' function. */
-#undef HAVE_SETSID
-
-/* 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 `strerror' function. */
-#undef HAVE_STRERROR
-
-/* 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 `strlcpy' function. */
-#undef HAVE_STRLCPY
-
-/* Define to 1 if you have the <syslog.h> header file. */
-#undef HAVE_SYSLOG_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 <sys/uio.h> header file. */
-#undef HAVE_SYS_UIO_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `writev' function. */
-#undef HAVE_WRITEV
-
-/* "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
-
-/* "pppd binary" */
-#undef PPP_BINARY
-
-/* "syslog facility to use" */
-#undef PPTP_FACILITY
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#undef inline
-#endif
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* "" */
-#undef socklen_t
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef ssize_t
-
-/* Define to `unsigned short' if <sys/types.h> does not define. */
-#undef u_int16_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef u_int32_t
-
-/* Define to `unsigned char' if <sys/types.h> does not define. */
-#undef u_int8_t
diff --git a/pptpd-1.3.3/configfile.c b/pptpd-1.3.3/configfile.c
deleted file mode 100644
index 9a05bd7..0000000
--- a/pptpd-1.3.3/configfile.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * configfile.c
- *
- * Methods for accessing the PPTPD config file and searching for
- * PPTPD keywords.
- *
- * $Id: configfile.c,v 1.2 2004/04/22 10:48:16 quozl Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "defaults.h"
-#include "configfile.h"
-#include "our_syslog.h"
-
-/* Local function prototypes */
-static FILE *open_config_file(char *filename);
-static void close_config_file(FILE * file);
-
-/*
- * read_config_file
- *
- * This method opens up the file specified by 'filename' and searches
- * through the file for 'keyword'. If 'keyword' is found any string
- * following it is stored in 'value'.
- *
- * args: filename (IN) - config filename
- * keyword (IN) - word to search for in config file
- * value (OUT) - value of keyword
- *
- * retn: -1 on error, 0 if keyword not found, 1 on value success
- */
-int read_config_file(char *filename, char *keyword, char *value)
-{
- FILE *in;
- int len = 0, keyword_len = 0;
- int foundit = 0;
-
- char *buff_ptr;
- char buffer[MAX_CONFIG_STRING_SIZE];
-
- *value = '\0';
- buff_ptr = buffer;
- keyword_len = strlen(keyword);
-
- in = open_config_file(filename);
- if (in == NULL) {
- /* Couldn't find config file, or permission denied */
- return -1;
- }
- while ((fgets(buffer, MAX_CONFIG_STRING_SIZE - 1, in)) != NULL) {
- /* ignore long lines */
- if (buffer[(len = strlen(buffer)) - 1] != '\n') {
- syslog(LOG_ERR, "Long config file line ignored.");
- do
- if (!fgets(buffer, MAX_CONFIG_STRING_SIZE - 1, in)) break;
- while (buffer[strlen(buffer) - 1] != '\n');
- continue;
- }
-
- len--; /* For the NL at the end */
- while (--len >= 0)
- if (buffer[len] != ' ' && buffer[len] != '\t')
- break;
-
- len++;
- buffer[len] = '\0';
-
- buff_ptr = buffer;
-
- /* Short-circuit blank lines and comments */
- if (!len || *buff_ptr == '#')
- continue;
-
- /* Non-blank lines starting with a space are an error */
-
- if (*buff_ptr == ' ' || *buff_ptr == '\t') {
- syslog(LOG_ERR, "Config file line starts with a space: %s", buff_ptr);
- continue;
- }
-
- /* At this point we have a line trimmed for trailing spaces. */
- /* Now we need to check if the keyword matches, and if so */
- /* then get the value (if any). */
-
- /* Check if it's the right keyword */
-
- do {
- if (*buff_ptr == ' ' || *buff_ptr == '\t')
- break;
- } while (*++buff_ptr);
-
- len = buff_ptr - buffer;
- if (len == keyword_len && !strncmp(buffer, keyword, len)) {
- foundit++;
- break;
- }
- }
-
- close_config_file(in);
-
- if (foundit) {
- /* Right keyword, now get the value (if any) */
-
- do {
- if (*buff_ptr != ' ' && *buff_ptr != '\t')
- break;
-
- } while (*++buff_ptr);
-
- strcpy(value, buff_ptr);
- return 1;
- } else {
- /* didn't find it - better luck next time */
- return 0;
- }
-}
-
-/*
- * open_config_file
- *
- * Opens up the PPTPD config file for reading.
- *
- * args: filename - the config filename (eg. '/etc/pptpd.conf')
- *
- * retn: NULL on error, file descriptor on success
- *
- */
-static FILE *open_config_file(char *filename)
-{
- FILE *in;
- static int first = 1;
-
- if ((in = fopen(filename, "r")) == NULL) {
- /* Couldn't open config file */
- if (first) {
- perror(filename);
- first = 0;
- }
- return NULL;
- }
- return in;
-}
-
-/*
- * close_config_file
- *
- * Closes the PPTPD config file descriptor
- *
- */
-static void close_config_file(FILE * in)
-{
- fclose(in);
-}
diff --git a/pptpd-1.3.3/configfile.h b/pptpd-1.3.3/configfile.h
deleted file mode 100644
index 9a646e2..0000000
--- a/pptpd-1.3.3/configfile.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * configfile.h
- *
- * Function to read pptpd config file.
- *
- * $Id: configfile.h,v 1.1.1.1 2002/06/21 08:51:55 fenix_nl Exp $
- */
-
-#ifndef _PPTPD_CONFIGFILE_H
-#define _PPTPD_CONFIGFILE_H
-
-int read_config_file(char *filename, char *keyword, char *value);
-
-#endif /* !_PPTPD_CONFIGFILE_H */
diff --git a/pptpd-1.3.3/configure b/pptpd-1.3.3/configure
deleted file mode 100755
index 98dc1e8..0000000
--- a/pptpd-1.3.3/configure
+++ /dev/null
@@ -1,7670 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
-
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
-else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- case $as_dir in
- /*)
- for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
- done;;
- esac
-done
-IFS=$as_save_IFS
-
-
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-exec 7<&0 </dev/null 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_unique_file="configure.in"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-CYGPATH_W
-PACKAGE
-VERSION
-ACLOCAL
-AUTOCONF
-AUTOMAKE
-AUTOHEADER
-MAKEINFO
-install_sh
-STRIP
-INSTALL_STRIP_PROGRAM
-mkdir_p
-AWK
-SET_MAKE
-am__leading_dot
-AMTAR
-am__tar
-am__untar
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-DEPDIR
-am__include
-am__quote
-AMDEP_TRUE
-AMDEP_FALSE
-AMDEPBACKSLASH
-CCDEPMODE
-am__fastdepCC_TRUE
-am__fastdepCC_FALSE
-RANLIB
-LN_S
-CPP
-GREP
-EGREP
-XTRALIBS_CTRL
-XTRALIBS_MGR
-XTRA_PROG
-kernel_headers
-LIBOBJS
-LTLIBOBJS'
-ac_subst_files=''
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute directory names.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- cat <<\_ACEOF
-
-Optional Features:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-facility=name Use another syslog facility, default LOG_DAEMON
- --enable-bcrelay Enable broadcast relay function
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-libwrap Use libwrap (tcp wrappers)
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.61
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
- 2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
- ;;
- esac
- done
-done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
-_ASBOX
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
-_ASBOX
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
-_ASBOX
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
-fi
-shift
-for ac_site_file
-do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-ac_config_headers="$ac_config_headers config.h"
-
-am__api_version="1.9"
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-IFS=$as_save_IFS
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
-Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
-Check your system clock" >&2;}
- { (exit 1); exit 1; }; }
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $. echo might interpret backslashes.
-# By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm -f conftest.sed
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AWK="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- SET_MAKE=
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=pptpd
- VERSION=0.8.5
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_STRIP="strip"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
-
-
-cat >>confdefs.h <<\_ACEOF
-#define BCRELAY
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define PPPD_VERSION
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define PPTP_FACILITY
-_ACEOF
-
-#AC_DEFINE(socklen_t,[],"")
-# check common command line options early
-
-
-cat >>confdefs.h <<\_ACEOF
-#define PPP_BINARY "/usr/sbin/pppd"
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define KERNELVERSION
-_ACEOF
-
-
-
-{ echo "$as_me:$LINENO: checking command line for syslog facility name" >&5
-echo $ECHO_N "checking command line for syslog facility name... $ECHO_C" >&6; }
-# Check whether --enable-facility was given.
-if test "${enable_facility+set}" = set; then
- enableval=$enable_facility;
- { echo "$as_me:$LINENO: result: $enableval" >&5
-echo "${ECHO_T}$enableval" >&6; }
- cat >>confdefs.h <<_ACEOF
-#define PPTP_FACILITY $enableval
-_ACEOF
-
-
-else
-
- { echo "$as_me:$LINENO: result: default LOG_DAEMON" >&5
-echo "${ECHO_T}default LOG_DAEMON" >&6; }
- cat >>confdefs.h <<_ACEOF
-#define PPTP_FACILITY LOG_DAEMON
-_ACEOF
-
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking command line for bcrelay build" >&5
-echo $ECHO_N "checking command line for bcrelay build... $ECHO_C" >&6; }
-# Check whether --enable-bcrelay was given.
-if test "${enable_bcrelay+set}" = set; then
- enableval=$enable_bcrelay;
- case "$enableval" in
- yes)
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- cat >>confdefs.h <<\_ACEOF
-#define BCRELAY 1
-_ACEOF
-
- BCRELAY=$enableval
- break;
- ;;
- no)
- { echo "$as_me:$LINENO: result: explicit no" >&5
-echo "${ECHO_T}explicit no" >&6; }
- ;;
- *)
- # only yes or no are expected for this option
- { echo "$as_me:$LINENO: result: unrecognised... terminating" >&5
-echo "${ECHO_T}unrecognised... terminating" >&6; }
- exit 1
- ;;
- esac
-
-else
- { echo "$as_me:$LINENO: result: default no" >&5
-echo "${ECHO_T}default no" >&6; }
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { (ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
-fi
-
-ac_exeext=$ac_cv_exeext
-
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_compiler_gnu=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-fi
-
-
-{ echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- none) break ;;
- esac
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- done
- done
- ;;
-esac
-done
-IFS=$as_save_IFS
-
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
-fi
-
-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- SET_MAKE=
-else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-
-{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
-if test "${ac_cv_c_const+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
- typedef int charset[2];
- const charset cs;
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !cs[0] && !zero.x;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_c_const=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_c_const=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for inline" >&5
-echo $ECHO_N "checking for inline... $ECHO_C" >&6; }
-if test "${ac_cv_c_inline+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_c_inline=$ac_kw
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
-echo "${ECHO_T}$ac_cv_c_inline" >&6; }
-
-
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
- ;;
-esac
-
-
-
-
-{ echo "$as_me:$LINENO: checking whether #! works in shell scripts" >&5
-echo $ECHO_N "checking whether #! works in shell scripts... $ECHO_C" >&6; }
-if test "${ac_cv_sys_interpreter+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- echo '#! /bin/cat
-exit 69
-' >conftest
-chmod u+x conftest
-(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1)
-if test $? -ne 69; then
- ac_cv_sys_interpreter=yes
-else
- ac_cv_sys_interpreter=no
-fi
-rm -f conftest
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sys_interpreter" >&5
-echo "${ECHO_T}$ac_cv_sys_interpreter" >&6; }
-interpval=$ac_cv_sys_interpreter
-
-
-
-
-
-
-
-
-
-
-
-for ac_func in setsid daemon setproctitle getservbyname strlcpy fork memmove strerror writev
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
- # Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_GREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_GREP=$GREP
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
- # Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_EGREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
-
- fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_stdc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in string.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in syslog.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in libintl.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in libutil.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in sys/uio.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-{ echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_size_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef size_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_size_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_size_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
-if test $ac_cv_type_size_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for ssize_t" >&5
-echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_ssize_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef ssize_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_ssize_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_ssize_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
-echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; }
-if test $ac_cv_type_ssize_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define ssize_t int
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for u_int8_t" >&5
-echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_u_int8_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef u_int8_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_u_int8_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_u_int8_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6; }
-if test $ac_cv_type_u_int8_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define u_int8_t unsigned char
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for u_int16_t" >&5
-echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_u_int16_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef u_int16_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_u_int16_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_u_int16_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6; }
-if test $ac_cv_type_u_int16_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define u_int16_t unsigned short
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for u_int32_t" >&5
-echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_u_int32_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef u_int32_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_u_int32_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_u_int32_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6; }
-if test $ac_cv_type_u_int32_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define u_int32_t unsigned int
-_ACEOF
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for socklen_t" >&5
-echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_socklen_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/socket.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- ac_cv_type_socklen_t=yes
-else
- ac_cv_type_socklen_t=no
-fi
-rm -f conftest*
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
-echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; }
-if test $ac_cv_type_socklen_t = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define socklen_t int
-_ACEOF
-
-fi
-
-
-# Check whether --with-libwrap was given.
-if test "${with_libwrap+set}" = set; then
- withval=$with_libwrap;
- if test "$with_libwrap" = "yes"; then
- XYZZY_LIBS="$LIBS"
- { echo "$as_me:$LINENO: checking for libwrap alone" >&5
-echo $ECHO_N "checking for libwrap alone... $ECHO_C" >&6; }
- LIBS="$XYZZY_LIBS -lwrap"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
- int allow_severity, deny_severity;
-int
-main ()
-{
- hosts_access();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBWRAP
-_ACEOF
-
- LIBWRAP="yes"
- XTRALIBS_MGR="-lwrap"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
- LIBS="$XYZZY_LIBS -lwrap -lnsl"
- { echo "$as_me:$LINENO: checking for libwrap with libnsl" >&5
-echo $ECHO_N "checking for libwrap with libnsl... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
- int allow_severity, deny_severity;
-int
-main ()
-{
- hosts_access();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBWRAP 1
-_ACEOF
-
- LIBWRAP="yes"
- XTRALIBS_MGR="-lwrap -lnsl"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
- LIBS="$XYZZY_LIBS"
- fi
-
-fi
-
-
-XYZZY_LIBS="$LIBS"
-
-{ echo "$as_me:$LINENO: checking for accept in -lc" >&5
-echo $ECHO_N "checking for accept in -lc... $ECHO_C" >&6; }
-if test "${ac_cv_lib_c_accept+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char accept ();
-int
-main ()
-{
-return accept ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_c_accept=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_c_accept=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_accept" >&5
-echo "${ECHO_T}$ac_cv_lib_c_accept" >&6; }
-if test $ac_cv_lib_c_accept = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBC 1
-_ACEOF
-
- LIBS="-lc $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for gethostbyname in -lc" >&5
-echo $ECHO_N "checking for gethostbyname in -lc... $ECHO_C" >&6; }
-if test "${ac_cv_lib_c_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_c_gethostbyname=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_c_gethostbyname=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_c_gethostbyname" >&6; }
-if test $ac_cv_lib_c_gethostbyname = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBC 1
-_ACEOF
-
- LIBS="-lc $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for gettext in -lc" >&5
-echo $ECHO_N "checking for gettext in -lc... $ECHO_C" >&6; }
-if test "${ac_cv_lib_c_gettext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gettext ();
-int
-main ()
-{
-return gettext ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_c_gettext=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_c_gettext=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_gettext" >&5
-echo "${ECHO_T}$ac_cv_lib_c_gettext" >&6; }
-if test $ac_cv_lib_c_gettext = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBC 1
-_ACEOF
-
- LIBS="-lc $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for accept in -lsocket" >&5
-echo $ECHO_N "checking for accept in -lsocket... $ECHO_C" >&6; }
-if test "${ac_cv_lib_socket_accept+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char accept ();
-int
-main ()
-{
-return accept ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_socket_accept=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_socket_accept=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_accept" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_accept" >&6; }
-if test $ac_cv_lib_socket_accept = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
-_ACEOF
-
- LIBS="-lsocket $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
-echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_nsl_gethostbyname=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_nsl_gethostbyname=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test $ac_cv_lib_nsl_gethostbyname = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
- LIBS="-lnsl $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for gettext in -lintl" >&5
-echo $ECHO_N "checking for gettext in -lintl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_intl_gettext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gettext ();
-int
-main ()
-{
-return gettext ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_intl_gettext=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_intl_gettext=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_gettext" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_gettext" >&6; }
-if test $ac_cv_lib_intl_gettext = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBINTL 1
-_ACEOF
-
- LIBS="-lintl $LIBS"
-
-fi
-
-LIBS="$XYZZY_LIBS"
-if test "$ac_cv_lib_c_accept" = no; then
- if test "$ac_cv_lib_socket_accept" = yes; then
- LIBS="$LIBS -lsocket"
- else
- echo "Couldn't find a usable accept!" 1>&2
- exit 1
- fi
-fi
-if test "$ac_cv_lib_c_gethostbyname" = no; then
- if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
- LIBS="$LIBS -lnsl"
- if test "$XTRALIBS_MGR" = "-lwrap -lnsl"; then
- XTRALIBS_MGR="-lwrap"
- fi
- else
- echo "Couldn't find a usable gethostbyname!" 1>&2
- exit 1
- fi
-fi
-if test "$ac_cv_header_libintl_h" = yes; then
- if test "$ac_cv_lib_c_gettext" = no; then
- if test "$ac_cv_lib_intl_gettext" = yes; then
- XTRALIBS_MGR = "$XTRALIBS_MGR -lintl"
- else
- echo "Have libintl.h but no usable gettext!" 1>&2
- exit 1
- fi
- fi
-fi
-
-
-
-
-if test "$BCRELAY" = "yes"; then
- if test "$BCRELAY" = "yes"; then
- XTRA_PROG="bcrelay"
- true
- else
- echo "No BCrelay selected." 1>&2
- fi
-fi
-
-
-
-{ echo "$as_me:$LINENO: checking for linux kernel herders" >&5
-echo $ECHO_N "checking for linux kernel herders... $ECHO_C" >&6; }
-if test -n "${KDIR}"; then
- if test -f ${KDIR}/include/linux/version.h; then
- header=${KDIR}/include
- else
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- { { echo "$as_me:$LINENO: error: Could not find linux kernel headers" >&5
-echo "$as_me: error: Could not find linux kernel headers" >&2;}
- { (exit 1); exit 1; }; }
- 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
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- { { echo "$as_me:$LINENO: error: Could not find linux kernel headers" >&5
-echo "$as_me: error: Could not find linux kernel headers" >&2;}
- { (exit 1); exit 1; }; }
- 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
-cat >>confdefs.h <<_ACEOF
-#define KERNELVERSION "$KERNELVERSION"
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: result: found ($KERNELVERSION at ${header/include})" >&5
-echo "${ECHO_T}found ($KERNELVERSION at ${header/include})" >&6; }
-CFLAGS="${CFLAGS} -I. -I${header}"
-kernel_headers=${header}
-
-
-{ echo "$as_me:$LINENO: checking for pppd" >&5
-echo $ECHO_N "checking for pppd... $ECHO_C" >&6; }
-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
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- { { echo "$as_me:$LINENO: error: Could not find pppd" >&5
-echo "$as_me: error: Could not find pppd" >&2;}
- { (exit 1); exit 1; }; }
-fi
-pppd_ver=`${pppd} --version 2>&1 | grep version | sed 's/pppd version //'`
-{ echo "$as_me:$LINENO: result: $pppd ($pppd_ver)" >&5
-echo "${ECHO_T}$pppd ($pppd_ver)" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define PPPD_VERSION "${pppd_ver}"
-_ACEOF
-
-
-
-echo '==============================================================================='
-
-echo 'Configuration chosen:'
-
-echo ' PPPD: '${pppd_ver}
-
-echo -n ' LIBWRAP security: '
-if test "$LIBWRAP" = "yes"; then
- echo 'Yes.'
-else
- echo 'No.'
-fi
-
-echo -n ' Broadcast Relay: '
-if test "$BCRELAY" = "yes"; then
- echo 'Yes.'
-else
- echo 'No.'
-fi
-
-echo ' linux kernel: '$KERNELVERSION at ${header/include}
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
- else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-ac_config_files="$ac_config_files Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
- else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
-
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# CDPATH.
-$as_unset CDPATH
-
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
-else
- as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-
-# Save the log message, to keep $[0] and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bug-autoconf@gnu.org>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-
-Copyright (C) 2006 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
-
- *) ac_config_targets="$ac_config_targets $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
- export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp=
- trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
-
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
-
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-CYGPATH_W!$CYGPATH_W$ac_delim
-PACKAGE!$PACKAGE$ac_delim
-VERSION!$VERSION$ac_delim
-ACLOCAL!$ACLOCAL$ac_delim
-AUTOCONF!$AUTOCONF$ac_delim
-AUTOMAKE!$AUTOMAKE$ac_delim
-AUTOHEADER!$AUTOHEADER$ac_delim
-MAKEINFO!$MAKEINFO$ac_delim
-install_sh!$install_sh$ac_delim
-STRIP!$STRIP$ac_delim
-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
-mkdir_p!$mkdir_p$ac_delim
-AWK!$AWK$ac_delim
-SET_MAKE!$SET_MAKE$ac_delim
-am__leading_dot!$am__leading_dot$ac_delim
-AMTAR!$AMTAR$ac_delim
-am__tar!$am__tar$ac_delim
-am__untar!$am__untar$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-DEPDIR!$DEPDIR$ac_delim
-am__include!$am__include$ac_delim
-am__quote!$am__quote$ac_delim
-AMDEP_TRUE!$AMDEP_TRUE$ac_delim
-AMDEP_FALSE!$AMDEP_FALSE$ac_delim
-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
-CCDEPMODE!$CCDEPMODE$ac_delim
-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
-RANLIB!$RANLIB$ac_delim
-LN_S!$LN_S$ac_delim
-CPP!$CPP$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-XTRALIBS_CTRL!$XTRALIBS_CTRL$ac_delim
-XTRALIBS_MGR!$XTRALIBS_MGR$ac_delim
-XTRA_PROG!$XTRA_PROG$ac_delim
-kernel_headers!$kernel_headers$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 85; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
-_ACEOF
-
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-fi # test -n "$CONFIG_FILES"
-
-
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
- esac
- ac_file_inputs="$ac_file_inputs $ac_f"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- fi
-
- case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
-
- rm -f "$tmp/stdin"
- case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
- if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f $ac_file
- mv "$tmp/config.h" $ac_file
- fi
- else
- echo "/* $configure_input */"
- cat "$ac_result"
- fi
- rm -f "$tmp/out12"
-# Compute $ac_file's index in $config_headers.
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $ac_file | $ac_file:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X$ac_file : 'X\(//\)[^/]' \| \
- X$ac_file : 'X\(//\)$' \| \
- X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
-echo X$ac_file |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir=$dirpart/$fdir
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
-done
- ;;
-
- esac
-done # for ac_tag
-
-
-{ (exit 0); exit 0; }
-_ACEOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
-fi
-
-
diff --git a/pptpd-1.3.3/configure.in b/pptpd-1.3.3/configure.in
deleted file mode 100644
index 8c4e640..0000000
--- a/pptpd-1.3.3/configure.in
+++ /dev/null
@@ -1,250 +0,0 @@
-AC_INIT(configure.in)
-
-AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(pptpd,0.8.5)
-
-AC_DEFINE(BCRELAY,[],"Enable Broadcast Relay")
-AC_DEFINE(PPPD_VERSION,[],"PPPD version")
-AC_DEFINE(PPTP_FACILITY,[],"syslog facility to use")
-#AC_DEFINE(socklen_t,[],"")
-# check common command line options early
-
-AC_DEFINE(PPP_BINARY, "/usr/sbin/pppd","pppd binary")
-AC_DEFINE(KERNELVERSION,[],"kernel version")
-
-
-AC_MSG_CHECKING(command line for syslog facility name)
-AC_ARG_ENABLE(facility,
- [ --enable-facility=name Use another syslog facility, default LOG_DAEMON ],
- [
- AC_MSG_RESULT($enableval)
- AC_DEFINE_UNQUOTED(PPTP_FACILITY, $enableval)
- ],
- [
- AC_MSG_RESULT(default LOG_DAEMON)
- AC_DEFINE_UNQUOTED(PPTP_FACILITY, LOG_DAEMON)
- ])
-
-AC_MSG_CHECKING(command line for bcrelay build)
-AC_ARG_ENABLE(bcrelay,
- [ --enable-bcrelay Enable broadcast relay function ],
- [
- case "$enableval" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE(BCRELAY)
- BCRELAY=$enableval
- break;
- ;;
- no)
- AC_MSG_RESULT(explicit no)
- ;;
- *)
- # only yes or no are expected for this option
- AC_MSG_RESULT(unrecognised... terminating)
- exit 1
- ;;
- esac
- ], [AC_MSG_RESULT(default no)])
-
-AC_PROG_CC
-AC_PROG_RANLIB
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-
-AC_C_CONST
-AC_C_INLINE
-
-AC_EXEEXT
-AC_OBJEXT
-AC_SYS_INTERPRETER
-
-AC_CHECK_FUNCS(setsid daemon setproctitle getservbyname strlcpy fork memmove strerror writev)
-
-AC_CHECK_HEADERS(string.h)
-AC_CHECK_HEADERS(syslog.h)
-AC_CHECK_HEADERS(libintl.h)
-AC_CHECK_HEADERS(libutil.h)
-AC_CHECK_HEADERS(sys/uio.h)
-
-AC_CHECK_TYPE(size_t, unsigned int)
-AC_CHECK_TYPE(ssize_t, int)
-AC_CHECK_TYPE(u_int8_t, unsigned char)
-AC_CHECK_TYPE(u_int16_t, unsigned short)
-AC_CHECK_TYPE(u_int32_t, unsigned int)
-
-dnl Check for type in sys/socket.h - from Squid source (GPL)
-AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
- AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
-#include <sys/socket.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif],
- ac_cv_type_socklen_t=yes,
- ac_cv_type_socklen_t=no)
-])
-if test $ac_cv_type_socklen_t = no; then
- AC_DEFINE(socklen_t, int,"")
-fi
-
-dnl Check for libwrap (black magic check)
-AC_ARG_WITH(libwrap,
- [ --with-libwrap Use libwrap (tcp wrappers) ],
-[
- if test "$with_libwrap" = "yes"; then
- XYZZY_LIBS="$LIBS"
- AC_MSG_CHECKING(for libwrap alone)
- LIBS="$XYZZY_LIBS -lwrap"
- AC_TRY_LINK([ int allow_severity, deny_severity; ],
- [ hosts_access(); ],
- [ AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_LIBWRAP,[],"use libwrap")
- LIBWRAP="yes"
- XTRALIBS_MGR="-lwrap" ],
- [ AC_MSG_RESULT(no)
- LIBS="$XYZZY_LIBS -lwrap -lnsl"
- AC_MSG_CHECKING(for libwrap with libnsl)
- AC_TRY_LINK([ int allow_severity, deny_severity; ],
- [ hosts_access(); ],
- [ AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_LIBWRAP)
- LIBWRAP="yes"
- XTRALIBS_MGR="-lwrap -lnsl" ],
- [ AC_MSG_RESULT(no) ])
- ])
- LIBS="$XYZZY_LIBS"
- fi
-])
-
-dnl More ugliness; -lnsl, -lutil and -lsocket
-XYZZY_LIBS="$LIBS"
-AC_CHECK_LIB(c, accept)
-AC_CHECK_LIB(c, gethostbyname)
-AC_CHECK_LIB(c, gettext)
-AC_CHECK_LIB(socket, accept)
-AC_CHECK_LIB(nsl, gethostbyname)
-AC_CHECK_LIB(intl, gettext)
-LIBS="$XYZZY_LIBS"
-if test "$ac_cv_lib_c_accept" = no; then
- if test "$ac_cv_lib_socket_accept" = yes; then
- LIBS="$LIBS -lsocket"
- else
- echo "Couldn't find a usable accept!" 1>&2
- exit 1
- fi
-fi
-if test "$ac_cv_lib_c_gethostbyname" = no; then
- if test "$ac_cv_lib_nsl_gethostbyname" = yes; then
- LIBS="$LIBS -lnsl"
- if test "$XTRALIBS_MGR" = "-lwrap -lnsl"; then
- XTRALIBS_MGR="-lwrap"
- fi
- else
- echo "Couldn't find a usable gethostbyname!" 1>&2
- exit 1
- fi
-fi
-if test "$ac_cv_header_libintl_h" = yes; then
- if test "$ac_cv_lib_c_gettext" = no; then
- if test "$ac_cv_lib_intl_gettext" = yes; then
- XTRALIBS_MGR = "$XTRALIBS_MGR -lintl"
- else
- echo "Have libintl.h but no usable gettext!" 1>&2
- exit 1
- fi
- fi
-fi
-
-AC_SUBST(XTRALIBS_CTRL)
-AC_SUBST(XTRALIBS_MGR)
-
-if test "$BCRELAY" = "yes"; then
- if test "$BCRELAY" = "yes"; then
- XTRA_PROG="bcrelay"
- true
- else
- echo "No BCrelay selected." 1>&2
- fi
-fi
-
-AC_SUBST(XTRA_PROG)
-
-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_DEFINE_UNQUOTED(KERNELVERSION,"$KERNELVERSION")
-
-AC_MSG_RESULT(found ($KERNELVERSION at ${header/include}))
-CFLAGS="${CFLAGS} -I. -I${header}"
-AC_SUBST(kernel_headers,${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 -n ' LIBWRAP security: '
-if test "$LIBWRAP" = "yes"; then
- echo 'Yes.'
-else
- echo 'No.'
-fi
-
-echo -n ' Broadcast Relay: '
-if test "$BCRELAY" = "yes"; then
- echo 'Yes.'
-else
- echo 'No.'
-fi
-
-echo ' linux kernel: '$KERNELVERSION at ${header/include}
-
-AC_CACHE_SAVE
-AC_OUTPUT(Makefile)
- \ No newline at end of file
diff --git a/pptpd-1.3.3/ctrlpacket.c b/pptpd-1.3.3/ctrlpacket.c
deleted file mode 100644
index b463941..0000000
--- a/pptpd-1.3.3/ctrlpacket.c
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
- * ctrlpacket.c
- *
- * PPTP Control Message packet reading, formatting and writing.
- *
- * $Id: ctrlpacket.c,v 1.6 2005/08/03 09:10:59 quozl Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if HAVE_SYSLOG_H
-#include <syslog.h>
-#else
-#include "our_syslog.h"
-#endif
-
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <time.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#include "pptpdefs.h"
-#include "pptpctrl.h"
-#include "ctrlpacket.h"
-
-#include <net/if.h>
-#include <net/ethernet.h>
-#include "if_pppox.h"
-
-#ifndef HAVE_STRERROR
-#include "compat.h"
-#endif
-
-/* Local function prototypes */
-static ssize_t read_pptp_header(int clientFd, unsigned char *packet, int *ctrl_message_type);
-static void deal_start_ctrl_conn(unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size);
-static void deal_stop_ctrl_conn(unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size);
-static void deal_out_call(unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size);
-static void deal_echo(unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size);
-static void deal_call_clr(unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size);
-static void deal_set_link_info(unsigned char *packet);
-static u_int16_t getcall();
-static u_int16_t freecall();
-
-#if notyet
-static int make_out_call_rqst(unsigned char *rply_packet, ssize_t * rply_size);
-#endif
-
-/*
- * read_pptp_packet
- *
- * Sees if a packet can be read and if so what type of packet it is. The
- * method then calls the appropriate function to examine the details of the
- * packet and form a suitable reply packet.
- *
- * args: clientFd (IN) - Client socket to read from.
- * packet (OUT) - Packet read from the client.
- * rply_packet (OUT) - Reply packet for the client.
- * rply_size (OUT) - Size of the reply packet.
- *
- * retn: PPTP control message type of the packet on success.
- * -1 on retryable error.
- * 0 on error to abort on.
- */
-int read_pptp_packet(int clientFd, unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size)
-{
-
- size_t bytes_read;
- int pptp_ctrl_type = 0; /* Control Message Type */
-
- /* read a packet and parse header */
- if ((bytes_read = read_pptp_header(clientFd, packet, &pptp_ctrl_type)) <= 0) {
- /* error reading packet */
- syslog(LOG_ERR, "CTRL: couldn't read packet header (%s)", bytes_read ? "retry" : "exit");
- return bytes_read;
- }
-
- /* launch appropriate method to form suitable reply to the packet */
- switch (pptp_ctrl_type) {
- case START_CTRL_CONN_RQST: /* Start Control Connection Request */
- deal_start_ctrl_conn(packet, rply_packet, rply_size);
- break;
-
- case STOP_CTRL_CONN_RQST:
- deal_stop_ctrl_conn(packet, rply_packet, rply_size);
- break;
-
- case OUT_CALL_RQST: /* Outgoing Call Request */
- deal_out_call(packet, rply_packet, rply_size);
- break;
-
- case ECHO_RQST: /* Echo Request */
- deal_echo(packet, rply_packet, rply_size);
- break;
-
- case CALL_CLR_RQST: /* Call Clear Request (Disconnect Request) */
- deal_call_clr(packet, rply_packet, rply_size);
- break;
-
- case SET_LINK_INFO: /* Set Link Info */
- /* no reply packet but process it */
- deal_set_link_info(packet);
- break;
-
- case ECHO_RPLY: /* Echo Reply */
- case STOP_CTRL_CONN_RPLY: /* Stop Control Connection Reply */
- case CALL_DISCONN_NTFY: /* Call Disconnect Notify */
- /* no reply packet */
- break;
-
- default:
- syslog(LOG_ERR, "CTRL: PPTP Control Message type %d not supported.", pptp_ctrl_type);
- pptp_ctrl_type = -1;
- }
-
- return pptp_ctrl_type;
-}
-
-
-/*
- * send_pptp_packet
- *
- * Sends a PPTP packet to a file descriptor.
- *
- * args: clientFd (IN) - file descriptor to write the packet to.
- * packet (IN) - the packet data to write.
- * packet_size (IN) - the packet size.
- *
- * retn: Number of bytes written on success.
- * -1 on write failure.
- */
-size_t send_pptp_packet(int clientFd, unsigned char *packet, size_t packet_size)
-{
-
- size_t bytes_written;
-
- if ((bytes_written = write(clientFd, packet, packet_size)) == -1) {
- /* write failed */
- syslog(LOG_ERR, "CTRL: Couldn't write packet to client.");
- return -1;
-
- } else {
- /* debugging */
- if (pptpctrl_debug) {
- syslog(LOG_DEBUG, "CTRL: I wrote %i bytes to the client.", (int)packet_size);
- syslog(LOG_DEBUG, "CTRL: Sent packet to client");
- }
- return bytes_written;
- }
-}
-
-/*
- * ignoreErrno
- *
- * Check if an errno represents a read error which should be ignored, and
- * put back to be select()ed on again later.
- *
- * Very similar to the function in Squid by Duane Wessels (under GPL).
- *
- * args: an errno value
- *
- * retn: 1 if the error is unimportant
- * 0 if the error is important
- */
-static int ignoreErrno(int ierrno) {
- switch (ierrno) {
- case EAGAIN: /* nothing to read */
- case EINTR: /* signal received */
-#ifdef ERESTART
-#if ERESTART != EINTR
- case ERESTART: /* signal received, should restart syscall */
-#endif
-#endif
-#if EWOULDBLOCK != EAGAIN
- case EWOULDBLOCK: /* shouldn't get this one but anyway, just in case */
-#endif
- return 1;
- default:
- return 0;
- }
-}
-
-/*
- * read_pptp_header
- *
- * Reads a packet from a file descriptor and determines whether it is a
- * valid PPTP Control Message. If a valid PPTP Control Message is detected
- * it extracts the Control Message type from the packet header.
- *
- * args: clientFd (IN) - Clients file descriptor.
- * packet (OUT) - Packet we read from the client.
- * pptp_ctrl_type (OUT) - PPTP Control Message type of the packet.
- *
- * retn: Number of bytes read on success.
- * -1 on retryable error.
- * 0 on error to exit on.
- */
-ssize_t read_pptp_header(int clientFd, unsigned char *packet, int *pptp_ctrl_type)
-{
-
- ssize_t bytes_ttl, bytes_this; /* quantities read (total and this read) */
- u_int16_t length; /* length of this packet */
- struct pptp_header *header; /* the received header */
-
- static char *buffer = NULL; /* buffer between calls */
- static int buffered = 0; /* size of buffer */
-
- *pptp_ctrl_type = 0; /* initialise return arg */
-
- /* read any previously buffered data */
- if (buffered) {
- memcpy(packet, buffer, buffered);
- free(buffer);
- buffer = NULL;
- bytes_ttl = buffered;
- buffered = 0;
- if (pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Read in previous incomplete ctrl packet");
- } else
- bytes_ttl = 0;
-
- /* try and get the length in */
- if (bytes_ttl < 2) {
- bytes_this = read(clientFd, packet + bytes_ttl, 2 - bytes_ttl);
- switch (bytes_this) {
- case -1:
- if (ignoreErrno(errno)) {
- /* re-tryable error, re-buffer and return */
- if (bytes_ttl) {
- buffered = bytes_ttl;
- buffer = malloc(bytes_ttl);
- if (!buffer)
- return(0);
- memcpy(buffer, packet, bytes_ttl);
- }
- syslog(LOG_ERR, "CTRL: Error reading ctrl packet length (bytes_ttl=%i): %s", (int)bytes_ttl, strerror(errno));
- return -1;
- }
- /* FALLTHRU */
- case 0:
- syslog(LOG_ERR, "CTRL: EOF or bad error reading ctrl packet length.");
- return 0;
- default:
- bytes_ttl += bytes_this;
- /* Not enough data to proceed */
- if (bytes_ttl == 1) {
- buffered = bytes_ttl;
- buffer = malloc(bytes_ttl);
- if (!buffer)
- return(0);
- memcpy(buffer, packet, bytes_ttl);
- if (pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Incomplete ctrl packet length, retry later");
- return -1;
- }
- }
- }
- /* OK, we have (at least) the first 2 bytes, and there is data waiting
- *
- * length includes the header, so a length less than 2 is someone
- * trying to hack into us or a badly corrupted packet.
- * Why not require length to be at least 10? Since we later cast
- * packet to struct pptp_header and use at least the 10 first bytes..
- * Thanks to Timo Sirainen for mentioning this.
- */
- length = htons(*(u_int16_t *) packet);
- if (length <= 10 || length > PPTP_MAX_CTRL_PCKT_SIZE) {
- syslog(LOG_ERR, "CTRL: 11 < Control packet (length=%d) < "
- "PPTP_MAX_CTRL_PCKT_SIZE (%d)",
- length, PPTP_MAX_CTRL_PCKT_SIZE);
- /* we loose sync (unless we malloc something big, which isn't a good
- * idea - potential DoS) so we must close connection (draft states that
- * if you loose sync you must close the control connection immediately)
- */
- return 0;
- }
- /* Now read the actual control packet */
- bytes_this = read(clientFd, packet + bytes_ttl, length - bytes_ttl);
- switch (bytes_this) {
- case -1:
- if(ignoreErrno(errno)) {
- /* re-tryable error, re-buffer and return */
- if (bytes_ttl) {
- buffered = bytes_ttl;
- buffer = malloc(bytes_ttl);
- if (!buffer)
- return(0);
- memcpy(buffer, packet, bytes_ttl);
- }
- syslog(LOG_ERR, "CTRL: Error reading ctrl packet (bytes_ttl=%d,length=%d): %s", (int)bytes_ttl, (int)length, strerror(errno));
- return -1;
- }
- /* FALLTHRU */
- case 0:
- syslog(LOG_ERR, "CTRL: EOF or bad error reading ctrl packet.");
- return 0;
- default:
- bytes_ttl += bytes_this;
- /* not enough data to proceed */
- if (bytes_ttl != length) {
- buffered = bytes_ttl;
- buffer = malloc(bytes_ttl);
- if (!buffer)
- return(0);
- memcpy(buffer, packet, bytes_ttl);
- if (pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Incomplete ctrl packet, retry later");
- return -1;
- }
- }
-
- /* We got one :-) */
-
- /* Cast the packet into the PPTP Control Message format */
- header = (struct pptp_header *) packet;
-
- /* Packet sanity check on magic cookie */
- if (ntohl(header->magic) != PPTP_MAGIC_COOKIE) {
- /* Oops! Not a valid Control Message */
- syslog(LOG_ERR, "CTRL: Bad magic cookie - lost syncronization, closing control connection.");
- /* draft states loss of syncronization must result in
- * immediate closing of the control connection
- */
- return 0;
- }
- /* Woohoo! Looks like we got a valid PPTP packet */
- *pptp_ctrl_type = (int) (ntohs(header->ctrl_type));
- if (pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Received PPTP Control Message (type: %d)", *pptp_ctrl_type);
- return bytes_ttl;
-}
-
-/* Macros to use in making response packets */
-
-#define MAKE_CTRL_HEADER(where, what) \
- where.header.length = htons(sizeof(where)); \
- where.header.pptp_type = htons(PPTP_CTRL_MESSAGE); \
- where.header.magic = htonl(PPTP_MAGIC_COOKIE); \
- where.header.ctrl_type = htons(what); \
- where.header.reserved0 = htons(RESERVED)
-
-#define COPY_CTRL_PACKET(from, to, size) \
- memcpy(to, &from, ((*size) = sizeof(from)))
-
-#define DEBUG_PACKET(what) \
- if(pptpctrl_debug) \
- syslog(LOG_DEBUG, "CTRL: Made a " what " packet")
-
-/*
- * deal_start_ctrl_conn
- *
- * This method 'deals' with a START-CONTROL-CONNECTION-REQUEST. After
- * stripping down the connection request a suitable reply is formed and
- * stored in 'rply_packet' ready for sending.
- *
- * args: packet (IN) - the packet that we have to deal with (should be a
- * START-CONTROL-CONNECTION-REQUEST packet)
- * rply_packet (OUT) - suitable reply to the 'packet' we got.
- * rply_size (OUT) - size of the reply packet
- */
-void deal_start_ctrl_conn(unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size)
-{
- struct pptp_start_ctrl_conn_rqst *start_ctrl_conn_rqst;
- struct pptp_start_ctrl_conn_rply start_ctrl_conn_rply;
-
- start_ctrl_conn_rqst = (struct pptp_start_ctrl_conn_rqst *) packet;
-
- MAKE_CTRL_HEADER(start_ctrl_conn_rply, START_CTRL_CONN_RPLY);
- start_ctrl_conn_rply.version = htons(PPTP_VERSION);
- start_ctrl_conn_rply.result_code = CONNECTED;
- start_ctrl_conn_rply.error_code = NO_ERROR;
- start_ctrl_conn_rply.framing_cap = htons(OUR_FRAMING);
- start_ctrl_conn_rply.bearer_cap = htons(OUR_BEARER);
- start_ctrl_conn_rply.max_channels = htons(MAX_CHANNELS);
- start_ctrl_conn_rply.firmware_rev = htons(PPTP_FIRMWARE_VERSION);
- bzero(start_ctrl_conn_rply.hostname, MAX_HOSTNAME_SIZE);
- strncpy((char *)start_ctrl_conn_rply.hostname, PPTP_HOSTNAME, MAX_HOSTNAME_SIZE);
- bzero(start_ctrl_conn_rply.vendor, MAX_VENDOR_SIZE);
- strncpy((char *)start_ctrl_conn_rply.vendor, PPTP_VENDOR, MAX_VENDOR_SIZE);
- COPY_CTRL_PACKET(start_ctrl_conn_rply, rply_packet, rply_size);
- DEBUG_PACKET("START CTRL CONN RPLY");
-}
-
-/*
- * deal_stop_ctrl_conn
- *
- * This method response to a STOP-CONTROL-CONNECTION-REQUEST with a
- * STOP-CONTROL-CONNECTION-REPLY.
- */
-void deal_stop_ctrl_conn(unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size)
-{
- struct pptp_stop_ctrl_conn_rply stop_ctrl_conn_rply;
-
- MAKE_CTRL_HEADER(stop_ctrl_conn_rply, STOP_CTRL_CONN_RPLY);
- stop_ctrl_conn_rply.result_code = DISCONNECTED;
- stop_ctrl_conn_rply.error_code = NO_ERROR;
- stop_ctrl_conn_rply.reserved1 = htons(RESERVED);
- COPY_CTRL_PACKET(stop_ctrl_conn_rply, rply_packet, rply_size);
- DEBUG_PACKET("STOP CTRL CONN RPLY");
-}
-
-/*
- * deal_out_call
- *
- * This method 'deals' with a OUT-GOING-CALL-REQUEST. After
- * stripping down the request a suitable reply is formed and stored in
- * 'rply_packet' ready for sending.
- *
- * args: packet (IN) - the packet that we have to deal with (should be a
- * OUT-GOING-CALL-REQUEST packet)
- * rply_packet (OUT) - suitable reply to the 'packet' we got.
- * rply_size (OUT) - size of the reply packet
- *
- */
-void deal_out_call(unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size)
-{
- u_int16_t pac_call_id;
- struct pptp_out_call_rqst *out_call_rqst;
- struct pptp_out_call_rply out_call_rply;
-
- out_call_rqst = (struct pptp_out_call_rqst *) packet;
-
- if ((pac_call_id = getcall()) == htons(-1)) {
- /* XXX should reject call */
- syslog(LOG_ERR, "CTRL: No free Call IDs!");
- pac_call_id = 0;
- }
- MAKE_CTRL_HEADER(out_call_rply, OUT_CALL_RPLY);
- /* call_id is used for ctrl, call_id_peer is used for GRE
- * call_id_peer is what we were sent by the other end in ctrl initilization
- */
- out_call_rply.call_id = pac_call_id;
- out_call_rply.call_id_peer = out_call_rqst->call_id;
- out_call_rply.result_code = CONNECTED;
- out_call_rply.error_code = NO_ERROR;
- out_call_rply.cause_code = NO_ERROR;
- /* maybe limit to pppd speed? but pppd doesn't accept 10Mbps as a speed and yet
- * still performs at over 115200, eg, 60kbyte/sec and higher observed.
- */
- out_call_rply.speed = out_call_rqst->max_bps;
- /* lets match their window size for now... was htons(PCKT_RECV_WINDOW_SIZE)
- */
- out_call_rply.pckt_recv_size = out_call_rqst->pckt_recv_size;
- window=htons(out_call_rply.pckt_recv_size);
- if(pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Set parameters to %d maxbps, %d window size",
- ntohl(out_call_rply.speed), ntohs(out_call_rply.pckt_recv_size));
- out_call_rply.pckt_delay = htons(PCKT_PROCESS_DELAY);
- out_call_rply.channel_id = htonl(CHANNEL_ID);
- COPY_CTRL_PACKET(out_call_rply, rply_packet, rply_size);
- DEBUG_PACKET("OUT CALL RPLY");
-}
-
-
-/*
- * deal_echo
- *
- * This method 'deals' with a ECHO-REQUEST. After stripping down the
- * connection request a suitable reply is formed and stored in
- * 'rply_packet' ready for sending.
- *
- * args: packet (IN) - the packet that we have to deal with (should be a
- * ECHO-REQUEST packet)
- * rply_packet (OUT) - suitable reply to the 'packet' we got.
- * rply_size (OUT) - size of the reply packet
- *
- */
-void deal_echo(unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size)
-{
- struct pptp_echo_rqst *echo_rqst;
- struct pptp_echo_rply echo_rply;
-
- echo_rqst = (struct pptp_echo_rqst *) packet;
-
- MAKE_CTRL_HEADER(echo_rply, ECHO_RPLY);
- echo_rply.identifier = echo_rqst->identifier;
- echo_rply.result_code = CONNECTED;
- echo_rply.error_code = NO_ERROR;
- echo_rply.reserved1 = htons(RESERVED);
- COPY_CTRL_PACKET(echo_rply, rply_packet, rply_size);
- DEBUG_PACKET("ECHO RPLY");
-}
-
-/*
- * deal_call_clr
- *
- * This method 'deals' with a CALL-CLEAR-REQUEST. After stripping down the
- * connection request a suitable reply is formed and stored in
- * 'rply_packet' ready for sending.
- *
- * args: packet (IN) - the packet that we have to deal with (should be a
- * CALL-CLEAR-REQUEST packet)
- * rply_packet (OUT) - suitable reply to the 'packet' we got.
- * rply_size (OUT) - size of the reply packet
- *
- */
-void deal_call_clr(unsigned char *packet, unsigned char *rply_packet, ssize_t *rply_size)
-{
- struct pptp_call_disconn_ntfy call_disconn_ntfy;
- u_int16_t pac_call_id;
-
- /* Form a reply
- * The reply packet is a CALL-DISCONECT-NOTIFY
- * In single call mode we don't care what peer's call ID is, so don't even bother looking
- */
- if ((pac_call_id = freecall()) == htons(-1)) {
- /* XXX should return an error */
- syslog(LOG_ERR, "CTRL: Could not free Call ID [call clear]!");
- }
- MAKE_CTRL_HEADER(call_disconn_ntfy, CALL_DISCONN_NTFY);
- call_disconn_ntfy.call_id = pac_call_id;
- call_disconn_ntfy.result_code = CALL_CLEAR_REQUEST; /* disconnected by call_clr_rqst */
- call_disconn_ntfy.error_code = NO_ERROR;
- call_disconn_ntfy.cause_code = htons(NO_ERROR);
- call_disconn_ntfy.reserved1 = htons(RESERVED);
- memset(call_disconn_ntfy.call_stats, 0, 128);
- COPY_CTRL_PACKET(call_disconn_ntfy, rply_packet, rply_size);
- DEBUG_PACKET("CALL DISCONNECT RPLY");
-}
-
-/*
- * deal_set_link_info
- *
- * @FIXME This function is *not* completed
- *
- * This method 'deals' with a SET-LINK-INFO. After stripping down the
- * connection request a suitable reply is formed and stored in
- * 'rply_packet' ready for sending.
- *
- * args: packet (IN) - the packet that we have to deal with (should be a
- * SET-LINK-INFO packet)
- * rply_packet (OUT) - suitable reply to the 'packet' we got.
- * rply_size (OUT) - size of the reply packet
- *
- */
-void deal_set_link_info(unsigned char *packet)
-{
- struct pptp_set_link_info *set_link_info;
-
- set_link_info = (struct pptp_set_link_info *) packet;
- if(set_link_info->send_accm != 0xffffffff || set_link_info->recv_accm != 0xffffffff)
- syslog(LOG_ERR, "CTRL: Ignored a SET LINK INFO packet with real ACCMs!");
- else if(pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Got a SET LINK INFO packet with standard ACCMs");
-}
-
-void make_echo_req_packet(unsigned char *rply_packet, ssize_t * rply_size, u_int32_t echo_id)
-{
- struct pptp_echo_rqst echo_packet;
-
- MAKE_CTRL_HEADER(echo_packet, ECHO_RQST);
- echo_packet.identifier = echo_id;
- COPY_CTRL_PACKET(echo_packet, rply_packet, rply_size);
- DEBUG_PACKET("ECHO REQ");
-}
-
-void make_stop_ctrl_req(unsigned char *rply_packet, ssize_t * rply_size)
-{
- struct pptp_stop_ctrl_conn_rqst stop_ctrl;
-
- MAKE_CTRL_HEADER(stop_ctrl, STOP_CTRL_CONN_RQST);
- stop_ctrl.reason = GENERAL_STOP_CTRL;
- stop_ctrl.reserved1 = RESERVED;
- stop_ctrl.reserved2 = htons(RESERVED);
- COPY_CTRL_PACKET(stop_ctrl, rply_packet, rply_size);
- DEBUG_PACKET("STOP CTRL REQ");
-}
-
-void make_call_admin_shutdown(unsigned char *rply_packet, ssize_t * rply_size)
-{
- struct pptp_call_disconn_ntfy call_disconn_ntfy;
- u_int16_t pac_call_id;
-
- /* Form a reply
- * The reply packet is a CALL-DISCONECT-NOTIFY
- * In single call mode we don't care what peer's call ID is, so don't even bother looking
- */
- if ((pac_call_id = freecall()) == htons(-1)) {
- /* XXX should return an error */
- syslog(LOG_ERR, "CTRL: Could not free Call ID [admin shutdown]!");
- }
- MAKE_CTRL_HEADER(call_disconn_ntfy, CALL_DISCONN_NTFY);
- call_disconn_ntfy.call_id = pac_call_id;
- call_disconn_ntfy.result_code = ADMIN_SHUTDOWN; /* disconnected by admin shutdown */
- call_disconn_ntfy.error_code = NO_ERROR;
- call_disconn_ntfy.cause_code = htons(NO_ERROR);
- call_disconn_ntfy.reserved1 = htons(RESERVED);
- memset(call_disconn_ntfy.call_stats, 0, 128);
- COPY_CTRL_PACKET(call_disconn_ntfy, rply_packet, rply_size);
- DEBUG_PACKET("CALL DISCONNECT RPLY");
-}
-
-#if PNS_MODE
-/* out of date. really PNS isn't 'trivially different', it's quite different */
-
-#define C_BITS (sizeof(unsigned int) * 8)
-#define C_SEG(x) (x/C_BITS)
-#define C_BIT(x) ((1U)<<(x%C_BITS))
-static unsigned int activeCalls[(MAX_CALLS / C_BITS) + 1];
-
-/*
- * get_call_id
- *
- * Assigns a call ID and peer call ID to the session.
- *
- * args: call_id (OUT) - the call ID for the session
- * retn: 0 on success, -1 on failure
- */
-int get_call_id(u_int16_t * loc)
-{
- for (i = 0; i < MAX_CALLS; i++) {
- if (!(activeCalls[C_SEG(i)] & C_BIT(i))) {
- activeCalls[C_SEG(i)] |= C_BIT(i);
- *loc = i;
- return 0;
- }
- }
- return -1;
-}
-
-/*
- * free_call_id
- *
- * args: call_id (IN) - the call ID for a terminated session
- * retn: 0 on success, -1 on failure
- */
-int free_call_id(u_int16_t call_id)
-{
- if (!(activeCalls[C_SEG(i)] & C_BIT(i)))
- return -1;
- activeCalls[C_SEG(i)] &= ~C_BIT(i);
- return 0;
-}
-#else
-static int _pac_call_id;
-static u_int16_t _pac_init = 0;
-
-/*
- * getcall
- *
- * Assigns a call ID to the session and stores/returns it
- *
- * we only permit one call at a time, so the chance of wrapping 65k on one
- * control connection is zero to none...
- */
-u_int16_t getcall()
-{
- struct sockaddr_pppox src_addr;
- socklen_t addrlen;
-
- src_addr.sa_family=AF_PPPOX;
- src_addr.sa_protocol=PX_PROTO_PPTP;
- src_addr.sa_addr.pptp.call_id=0;
- src_addr.sa_addr.pptp.sin_addr=inetaddrs[0];
-
- if (pptp_sock!=-1) close(pptp_sock);
-
- pptp_sock=socket(AF_PPPOX,SOCK_STREAM,PX_PROTO_PPTP);
- if (pptp_sock<0)
- {
- syslog(LOG_ERR,"CTRL: failed to create PPTP socket (%s)\n",strerror(errno));
- exit(-1);
- }
- if (bind(pptp_sock,(struct sockaddr*)&src_addr,sizeof(src_addr)))
- {
- syslog(LOG_ERR,"CTRL: failed to bind PPTP socket (%s)\n",strerror(errno));
- close(pptp_sock);
- pptp_sock=-1;
- exit(-1);
- }
- addrlen=sizeof(src_addr);
- getsockname(pptp_sock,(struct sockaddr*)&src_addr,&addrlen);
-
- if(!_pac_init) {
- _pac_call_id = htons(-1);
- _pac_init = 1;
- }
- if(_pac_call_id != htons(-1))
- syslog(LOG_ERR, "CTRL: Asked to allocate call id when call open, not handled well");
-
- _pac_call_id = htons(src_addr.sa_addr.pptp.call_id) ;
- return _pac_call_id;
-}
-
-/*
- * freecall
- *
- * Notes termination of current call
- *
- * retn: -1 on failure, PAC call ID on success
- */
-u_int16_t freecall()
-{
- u_int16_t ret;
-
- if (pptp_sock!=-1){
- close(pptp_sock);
- pptp_sock=-1;
- }
-
- if(!_pac_init) {
- _pac_call_id = htons(-1);
- _pac_init = 1;
- }
- ret = _pac_call_id;
- if(_pac_call_id == htons(-1))
- syslog(LOG_ERR, "CTRL: Asked to free call when no call open, not handled well");
- _pac_call_id = htons(-1);
- return ret;
-}
-#endif
diff --git a/pptpd-1.3.3/ctrlpacket.h b/pptpd-1.3.3/ctrlpacket.h
deleted file mode 100644
index 39c2858..0000000
--- a/pptpd-1.3.3/ctrlpacket.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * ctrlpacket.h
- *
- * Functions to parse and send pptp control packets.
- *
- * $Id: ctrlpacket.h,v 1.1.1.1 2002/06/21 08:51:58 fenix_nl Exp $
- */
-
-#ifndef _PPTPD_CTRLPACKET_H
-#define _PPTPD_CTRLPACKET_H
-
-int read_pptp_packet(int clientFd, unsigned char *packet, unsigned char *rply_packet, ssize_t * rply_size);
-size_t send_pptp_packet(int clientFd, unsigned char *packet, size_t packet_size);
-void make_echo_req_packet(unsigned char *rply_packet, ssize_t * rply_size, u_int32_t echo_id);
-void make_call_admin_shutdown(unsigned char *rply_packet, ssize_t * rply_size);
-void make_stop_ctrl_req(unsigned char *rply_packet, ssize_t * rply_size);
-
-#endif /* !_PPTPD_CTRLPACKET_H */
diff --git a/pptpd-1.3.3/debian/README.debian b/pptpd-1.3.3/debian/README.debian
deleted file mode 100644
index 9a985af..0000000
--- a/pptpd-1.3.3/debian/README.debian
+++ /dev/null
@@ -1,8 +0,0 @@
-pptpd for DEBIAN
-----------------------
-
-Please note that, if you want to use pptpd to create host-to-site tunnels (e.g.
-typical road-warrior setups), then you will need to enable IP forwarding. This
-can be done by setting ip_forward=yes in /etc/network/options.
-
-Rene Mayrhofer <rene.mayrhofer@gibraltar.at>, Mon, 16 Aug 1999 11:27:43 +0200
diff --git a/pptpd-1.3.3/debian/changelog b/pptpd-1.3.3/debian/changelog
deleted file mode 100644
index cf41647..0000000
--- a/pptpd-1.3.3/debian/changelog
+++ /dev/null
@@ -1,175 +0,0 @@
-pptpd (1.3.3-0) unstable; urgency=low
-
- * Package built from upstream sources, not a Debian project package
- (Debian Developer expected to adjust this entry)
-
- -- James Cameron <quozl@us.netrek.org> Tue, 05 Sep 2006 10:51:43 +1100
-
-pptpd (1.2.0-0) unstable; urgency=low
-
- * Package built from upstream sources, not a Debian project package
- (Debian Developer expected to adjust this entry)
- Closes: #107933: pptpd: pptpd segfaults if called without arguments
- Closes: #126486: pptpd: wish it had better integration support with
- Portslave
-
- -- James Cameron <james.cameron@hp.com> Fri, 21 May 2004 20:13:51 +1000
-
-pptpd (1.1.4.0b4-1) unstable; urgency=low
-
- * Finally acknowledge the bugs fixed in the NMUs:
- Closes: #132819 (Build-Depends on devhelper)
- Closes: #126712 (Mark /etc/init.d/pptpd as conffile)
- Closes: #57849 (Remove recommends line)
- * Enable the MSCHAP and MPPE options again in the default config, but now
- changed for the new upstream pppd syntax.
- * Also include the new upstream source in the upload -
- dpkg-buildpackage was confused by the version number.
- * Enhance the init script to:
- - Include a "status" option.
- - Force pptpd to close its file descriptors.
- Closes: #189426: pptpd does not close/redirect stdout and stderr
- * Use po-debconf for debconf translations and add pt_BR and FR translations.
- However, debconf is still not used for autoconfig until I find time to
- implement the config script properly. It will come, soon ;)
- Also fix some english short descriptions - thanks for pointing that out.
- Closes: #191703: Update packaging to use the newer gettext-based debconf
- template translation system
- Closes: #208049: Please switch to gettext-based debconf templates
- Closes: #211273: French translation of gettext debconf template
- I will leave #209082 open until the config script works....
- * Also ship the README.bcrelay file in the binary package.
- * Move the HOWTO-IPX+PPTP.txt file from the html/ directory to the normal
- doc directory.
- Closes: #220707: CVS directory, and non-html in 'html' dir
- * Document that IP forwarding needs to be enabled, but refer to
- /etc/network/options instead of /proc/sys/net/ipv4/ip_forward.
- Closes: #168718: Documentation has no reference to
- /proc/sys/net/ipv4/ip_forward
-
- -- Rene Mayrhofer <rmayr@debian.org> Wed, 23 Apr 2003 13:34:50 +0200
-
-pptpd (1.1.4-0.b3.1) unstable; urgency=HIGH
-
- * New upstream release (to fix the security issue).
- Closes: #189363: pptpd: PoPToP versions earlier than 1.1.3 have a
- remotely exploitable buffer overflow
- Closes: #107933: pptpd: pptpd segfaults if called without arguments
- * Enabled the broadcast relay option.
- * The default pptpd-options no longer includes "+chapms"
- Closes: #179808: pptpd: Completely fails to work
- * Acknowledge bug report closed by NMUs:
- Closes: #132819
- Closes: #126712
- Closes: #57849
-
- -- Rene Mayrhofer <rmayr@debian.org> Wed, 23 Apr 2003 12:12:38 +0200
-
-pptpd (1.1.2-2) unstable; urgency=low
-
- * New upstream version
-
- -- Rene Mayrhofer <rene@mayrhofer.eu.org> Wed, 30 Jul 2003 22:36:01 +0200
-
-pptpd (1.1.2-1.3.woody.0) stable; urgency=HIGH
-
- * Security fix for the remotely exploitable buffer overflow.
-
- -- Rene Mayrhofer <rmayr@debian.org> Wed, 23 Apr 2003 13:10:05 +0200
-
-pptpd (1.1.2-1.2) unstable; urgency=low
-
- * Non-maintainer upload
- * Mark /etc/init.d/pptpd as a conffile, per policy (closes: #132819).
-
- -- Steve Langasek <vorlon@debian.org> Sat, 16 Feb 2002 12:09:44 -0600
-
-pptpd (1.1.2-1.1) unstable; urgency=low
-
- * NMU
- * Add build-depends: debhelper. Closes: #126712.
-
- -- LaMont Jones <lamont@debian.org> Mon, 14 Jan 2002 22:08:38 -0700
-
-pptpd (1.1.2-1) unstable; urgency=low
-
- * Updated to new upstream version (declared as development version, but it
- is around long enough to seem stable).
- Closes: #109908
- * Do not ship pptpdconfig.pl since it does not work correctly at the
- moment.
- Closes: #82385
- * Took out all MPPE options from pptpd-options (the options for pppd) as
- long as the default pppd package does not support it.
- Closes: #61651
- * Changed maintainer email to rmayr@debian.org
-
- -- Rene Mayrhofer <rene.mayrhofer@debian.org> Thu, 27 Dec 2001 11:17:51 +0100
-
-pptpd (1.0.1-2) unstable; urgency=low
-
- * Changed the dependency from perl to perl-base.
-
- -- Rene Mayrhofer <rene.mayrhofer@vianova.at> Tue, 26 Dec 2000 15:44:38 +0100
-
-pptpd (1.0.1-1) unstable; urgency=low
-
- * New upstream release.
- The debconf support is still disabled because I do not have time to
- write a perl script that can change the configuration files (only 2 files
- need to be changed) thet is really safe (i.e. it does not mess with manual
- configuration in those files). If anybody can contribute, I would be very
- happy.
-
- -- Rene Mayrhofer <rene.mayrhofer@vianova.at> Mon, 20 Nov 2000 17:38:35 +0100
-
-pptpd (1.0.0-5) unstable; urgency=low
-
- * First try with debconf support and postinst config script
-
- -- Rene Mayrhofer <rene.mayrhofer@vianova.at> Tue, 11 Jul 2000 17:06:10 +0200
-
-pptpd (1.0.0-4) frozen unstable; urgency=low
-
- * Added a config script to the postinst (now disabled because of problems
- with debconf perl support - next upload will include it)
- * Preliminary support for debconf (now disabled because of problems with
- (debconf perl support - next upload will include it)
- * Removed the debug option from /etc/pptpd.conf
- * Updated the HOWTO with a new version from the upstream maintainer
- * Removed the Recommend: ppp-pam (closes: #57849)
-
- -- Rene Mayrhofer <rmayr@vianova.at> Fri, 1 Oct 1999 11:06:39 +0200
-
-pptpd (1.0.0-3) unstable; urgency=low
-
- * The init script now uses the pidfile created by pptpd
-
- -- Rene Mayrhofer <rmayr@vianova.at> Thu, 30 Sep 1999 11:31:11 +0200
-
-pptpd (1.0.0-2) unstable; urgency=low
-
- * Enhanced the init script to recognize force-reload.
- * Moved manual pages to /usr/share/man
- * Added support for TCP wrappers
-
- -- Rene Mayrhofer <rmayr@vianova.at> Wed, 29 Sep 1999 13:35:05 +0200
-
-pptpd (1.0.0-1) unstable; urgency=low
-
- * New upstream release
-
- -- Rene Mayrhofer <rmayr@vianova.at> Tue, 28 Sep 1999 16:49:26 +0200
-
-pptpd (0.9.13-1) unstable; urgency=low
-
- * New upstream release
-
- -- Rene Mayrhofer <rmayr@vianova.at> Tue, 24 Aug 1999 08:05:29 +0200
-
-pptpd (0.9.12-1) unstable; urgency=low
-
- * Initial Release.
-
- -- Rene Mayrhofer <rmayr@vianova.at> Tue, 24 Aug 1999 08:05:10 +0200
-
diff --git a/pptpd-1.3.3/debian/conffiles b/pptpd-1.3.3/debian/conffiles
deleted file mode 100644
index a05023b..0000000
--- a/pptpd-1.3.3/debian/conffiles
+++ /dev/null
@@ -1,3 +0,0 @@
-/etc/pptpd.conf
-/etc/ppp/pptpd-options
-/etc/init.d/pptpd
diff --git a/pptpd-1.3.3/debian/config b/pptpd-1.3.3/debian/config
deleted file mode 100644
index b732934..0000000
--- a/pptpd-1.3.3/debian/config
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh -e
-# Rene Mayrhofer <rmayr@vianova.at>, Oct. 1999
-# I hereby put this script under the Artistic License.
-
-. /usr/share/debconf/confmodule.sh
-
-db_input high pptpd/localip
-db_input high pptpd/remoteip
-
-# ask if mppe encryption should be used
-db_input pptpd/mppe
-db_go
-
-# check the answer(s)
-db_get pptpd/mppe
-if [ "$RET" = "false" ]; then
- # display a warning
- db_input high pptpd/no-mppe
- db_go
-fi
-
-
diff --git a/pptpd-1.3.3/debian/control b/pptpd-1.3.3/debian/control
deleted file mode 100644
index 7823247..0000000
--- a/pptpd-1.3.3/debian/control
+++ /dev/null
@@ -1,15 +0,0 @@
-Source: pptpd
-Section: net
-Priority: optional
-Maintainer: Rene Mayrhofer <rmayr@debian.org>
-Standards-Version: 3.0.1.0
-Build-Depends: libwrap0-dev, debhelper (>= 4.1.16)
-
-Package: pptpd
-Architecture: any
-Depends: ${shlibs:Depends}, ppp (>=2.4.2+20030811-1), netbase, debconf, perl-base
-Build-Depends: debhelper
-Description: PoPToP Point to Point Tunneling Server
- This implements a Virtual Private Networking Server (VPN) that is compatible
- with Microsoft VPN clients. It allows windows users to connect to an
- internal firewalled network using their dialup.
diff --git a/pptpd-1.3.3/debian/copyright b/pptpd-1.3.3/debian/copyright
deleted file mode 100644
index 84477a4..0000000
--- a/pptpd-1.3.3/debian/copyright
+++ /dev/null
@@ -1,11 +0,0 @@
-This package was debianized by Rene Mayrhofer rene.mayrhofer@gibraltar.at on
-Mon, 16 Aug 1999 11:27:43 +0200.
-
-It was downloaded from 'http://www.moretonbay.com/vpn/pptp.html'
-
-Upstream Authors: Please look at file AUTHORS
-
-Copyright:
-
-PPTPd is released under the GPL. You should find a copy of the GPL in
-'/usr/share/common-licenses/GPL' on Debian systems.
diff --git a/pptpd-1.3.3/debian/dirs b/pptpd-1.3.3/debian/dirs
deleted file mode 100644
index 40d9d22..0000000
--- a/pptpd-1.3.3/debian/dirs
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/sbin
-etc
-etc/ppp
-etc/init.d
diff --git a/pptpd-1.3.3/debian/docs b/pptpd-1.3.3/debian/docs
deleted file mode 100644
index d4438d0..0000000
--- a/pptpd-1.3.3/debian/docs
+++ /dev/null
@@ -1,8 +0,0 @@
-AUTHORS
-ChangeLog-0.8
-ChangeLog-0.9
-README
-README.inetd
-README.slirp
-README.bcrelay
-TODO
diff --git a/pptpd-1.3.3/debian/examples b/pptpd-1.3.3/debian/examples
deleted file mode 100644
index fbb78fb..0000000
--- a/pptpd-1.3.3/debian/examples
+++ /dev/null
@@ -1,3 +0,0 @@
-samples/chap-secrets
-samples/options.pptpd
-samples/pptpd.conf
diff --git a/pptpd-1.3.3/debian/po/POTFILES.in b/pptpd-1.3.3/debian/po/POTFILES.in
deleted file mode 100644
index cef83a3..0000000
--- a/pptpd-1.3.3/debian/po/POTFILES.in
+++ /dev/null
@@ -1 +0,0 @@
-[type: gettext/rfc822deb] templates
diff --git a/pptpd-1.3.3/debian/po/fr.po b/pptpd-1.3.3/debian/po/fr.po
deleted file mode 100644
index 5b8706c..0000000
--- a/pptpd-1.3.3/debian/po/fr.po
+++ /dev/null
@@ -1,208 +0,0 @@
-#
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-# Developers do not need to manually edit POT or PO files.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: ddtpd 1.1.4-0.b3.2\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2003-09-07 13:05+0200\n"
-"PO-Revision-Date: 2003-09-07 18:20+0200\n"
-"Last-Translator: Nicolas Bertolissio <nico.bertol@free.fr>\n"
-"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-15\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Description
-#: ../templates:3
-msgid "The local IP address of the virtual connections"
-msgstr "Adresse IP locale pour les connexions virtuelles"
-
-#. Description
-#: ../templates:3
-msgid "Specify the local IP address for the virtual connections."
-msgstr "Veuillez indiquer l'adresse IP locale pour les connexions virtuelles."
-
-#. Description
-#: ../templates:3
-msgid ""
-"Please note that any address works as long as the local machine takes care "
-"of the routing. But if you want to use MS-Windows networking, you should use "
-"an IP address out of the LAN address space."
-msgstr ""
-"Veuillez noter que toute adresse convient tant que la machine locale "
-"s'occupe du routage. Mais si vous souhaitez utiliser un réseau MS-Windows, "
-"vous devriez utiliser une adresse IP hors de l'espace d'adressage du réseau "
-"local."
-
-#. Description
-#: ../templates:3
-msgid ""
-"You can give only one address or you can give multiple addresses if you want "
-"to, although they are really not needed. Multiple addresses can be given as "
-"either \"10.0.0.1,10.0.0.2,10.0.0.3\" or \"10.0.0.1-3\". No spaces should be "
-"used between commas or within addresses."
-msgstr ""
-"Vous pouvez ne fournir qu'une seule adresse, mais aussi plusieurs bien que "
-"cela ne soit pas nécessaire. Pour plusieurs adresses, vous pouvez utiliser "
-"soit « 10.0.0.1,10.0.0.2,10.0.0.3 » soit « 10.0.0.1-3 ». Aucun espace ne "
-"devrait figurer entre les virgules ou dans les adresses."
-
-#. Description
-#: ../templates:17
-msgid "A list of remote IP addresses for the virtual connections"
-msgstr "Liste d'adresses IP distantes pour les connexions virtuelles"
-
-#. Description
-#: ../templates:17
-msgid "Specify the remote IP addresses for the virtual connections."
-msgstr ""
-"Veuillez indiquer les adresses IP distantes pour les connexions virtuelles."
-
-#. Description
-#: ../templates:17
-msgid ""
-"Please note that 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."
-msgstr ""
-"Veuillez noter que toute adresse convient tant que la machine locale "
-"s'occupe du routage. Mais si vous souhaitez utiliser un réseau MS-Windows, "
-"vous devriez utiliser une adresse IP hors de l'espace d'adressage du réseau "
-"local."
-
-#. Description
-#: ../templates:17
-msgid ""
-"You have to give one address for every concurrent connection. This will "
-"depend on how many clients you expect to be online at the same time. "
-"Multiple addresses can be given as either \"10.0.0.1,10.0.0.2,10.0.0.3\" or "
-"\"10.0.0.1-3\". No spaces should be used between commas or within addresses."
-msgstr ""
-"Vous devez fournir une adresse pour chaque connexion autorisée. Cela dépend "
-"du nombre de clients attendus en même temps. Pour plusieurs adresses, vous "
-"pouvez utiliser soit « 10.0.0.1,10.0.0.2,10.0.0.3 » soit « 10.0.0.1-3 ». "
-"Aucun espace ne devrait figurer entre les virgules ou dans les adresses."
-
-#. Description
-#: ../templates:31
-msgid "The netmask used for virtual connections"
-msgstr "Masque de réseau pour les connexions virtuelles"
-
-#. Description
-#: ../templates:31
-msgid ""
-"If you use IP addresses from the LAN address space, please use the same "
-"netmask as on your LAN."
-msgstr ""
-"Si vous utilisez des adresses IP de l'espace d'adressage du réseau local, "
-"veuillez indiquer le même masque que pour votre réseau."
-
-#. Description
-#: ../templates:37
-msgid "The IP address of your WINS server"
-msgstr "Adresse IP de votre serveur WINS"
-
-#. Description
-#: ../templates:37
-msgid ""
-"A WINS server is used for browsing available Computers in MS-Windows "
-"networking. This address is transmitted to the clients,"
-msgstr ""
-"Un serveur WINS sert à trouver les ordinateurs disponibles sur un réseau MS-"
-"Windows. Cette adresse sera transmise aux clients."
-
-#. Description
-#: ../templates:43
-msgid "The IP address of your DNS server"
-msgstr "Adresse IP de votre serveur DNS"
-
-#. Description
-#: ../templates:43
-msgid "This address is transmitted to the clients."
-msgstr "Cette adresse sera transmise aux clients."
-
-#. Description
-#: ../templates:49
-msgid "Do you want to use MPPE data encryption ?"
-msgstr "Faut-il utiliser le chiffrement de données MPPE ?"
-
-#. Description
-#: ../templates:49
-msgid ""
-"The recommended way is to use the data encryption as it is one of the main "
-"benefits of a VPN. When you want to use MPPE (Microsoft Point-to-Point "
-"Encryption), you also have to use CHAPMSv2 for authentication."
-msgstr ""
-"Il est recommandé d'utiliser le chiffrement de données car il s'agit de l'un "
-"des principaux avantages d'un réseau privé virtuel. Si vous souhaitez "
-"utiliser MPPE (« Microsoft Point-to-Point Encryption », chiffrement point-à-"
-"point de Microsoft), vous devrez aussi utiliser CHAPMSv2 pour "
-"l'authentification."
-
-#. Description
-#: ../templates:49
-msgid ""
-"Note that you have to install the modified ppp packages if you want to use "
-"this data encryption."
-msgstr ""
-"Veuillez notez que vous devez installer les paquets de ppp modifiés si vous "
-"souhaitez utiliser ce chiffrement de données."
-
-#. Description
-#: ../templates:59
-msgid "Warning: data encryption is disabled"
-msgstr "Attention : le chiffrement de données est désactivé"
-
-#. Description
-#: ../templates:59
-msgid ""
-"All data transferred between the local network and the client will be "
-"transmitted without encryption ! This is a security hole."
-msgstr ""
-"Toutes les données transférées entre le réseau local et le client seront "
-"transmises sans chiffrement ! Il s'agit d'une faille de sécurité."
-
-#. Description
-#: ../templates:59
-msgid "You have been warned. Now you loose your product warranty :)"
-msgstr ""
-"Vous voilà prévenu. Vous perdez désormais la seule garantie de ce produit :)"
-
-#. Description
-#: ../templates:69
-msgid "Which authentication method do you want to use ?"
-msgstr "Méthode d'authentification à utiliser"
-
-#. Description
-#: ../templates:69
-msgid ""
-"Possible authentication methods are: - PAP - CHAP - CHAP with Microsoft "
-"extensions - CHAP with Microsoft extensions v2"
-msgstr ""
-"Les méthodes d'authentification disponibles sont : PAP, CHAP, CHAP avec des "
-"extensions de Microsoft et CHAP avec les extensions de Microsoft version 2."
-
-#. Description
-#: ../templates:69
-msgid ""
-"The recommended authentication method is one of the CHAP methods. However, "
-"you have to use a separate database (/etc/ppp/chap-secrets) if you want to "
-"use these. If you use PAP, you can use the standard system passwords when "
-"the ppp-pam package is installed."
-msgstr ""
-"Les méthodes d'authentification CHAP sont recommandées. Quoi qu'il en soit, "
-"vous devrez utiliser une base de données séparée (/etc/ppp/chap-secrets) si "
-"vous souhaitez les utiliser. Si vous choisissez PAP, vous pourrez utiliser "
-"les mots de passe standards du système après l'installation du paquet ppp-"
-"pam."
diff --git a/pptpd-1.3.3/debian/po/pt_BR.po b/pptpd-1.3.3/debian/po/pt_BR.po
deleted file mode 100644
index ce67da3..0000000
--- a/pptpd-1.3.3/debian/po/pt_BR.po
+++ /dev/null
@@ -1,204 +0,0 @@
-#
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-# Developers do not need to manually edit POT or PO files.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: pptpd_1.1.4-0.b3.2\n"
-"POT-Creation-Date: 2003-05-02 20:05-0300\n"
-"PO-Revision-Date: 2003-05-02 20:26-0300\n"
-"Last-Translator: André Luís Lopes <andrelop@ig.com.br>\n"
-"Language-Team: Debian-BR Project <debian-l10n-portuguese@lists.debian.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-1\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Description
-#: ../templates:3
-msgid "The local IP address of the virtual connections"
-msgstr "O endereço IP local das conexões virtuais"
-
-#. Description
-#: ../templates:3
-msgid "Specify the local IP address for the virtual connections."
-msgstr "Especifique o endereço IP local para as conexões virtuais."
-
-#. Description
-#: ../templates:3
-msgid ""
-"Please note that any address works as long as the local machine takes care "
-"of the routing. But if you want to use MS-Windows networking, you should use "
-"an IP address out of the LAN address space."
-msgstr ""
-"Por favor note que qualquer endereço funcionará contanto que o máquina "
-"local gerencie o roteamento. Mas caso você queira usar a rede "
-"MS-Windows você deverá usar um endereço IP fora do espaço de endereços "
-"da LAN."
-
-#. Description
-#: ../templates:3
-msgid ""
-"You can give only one address or you can give multiple addresses if you want "
-"to, although they are really not needed. Multiple addresses can be given as "
-"either \"10.0.0.1,10.0.0.2,10.0.0.3\" or \"10.0.0.1-3\". No spaces should be "
-"used between commas or within addresses."
-msgstr ""
-"Você pode fornecer somente um endereço ou você pode fornecer diversos "
-"endereços caso deseje, porém eles realmente não são necessários. "
-"Múltiplos endereços podem ser fornecidos informados como "
-"\"10.0.0.1,10.0.0.3\" ou \"10.0.0.1-3\". Nenhum espaço deve ser "
-"informado entre as vírgulas ou como parte dos endereços."
-
-#. Description
-#: ../templates:17
-msgid "A list of remote IP addresses for the virtual connections."
-msgstr "Uma lista de endereços IP remotos para as conexões virtuais."
-
-#. Description
-#: ../templates:17
-msgid "Specify the remote IP addresses for the virtual connections."
-msgstr "Especifique os endereços IP remotos para as conexões virtuais."
-
-#. Description
-#: ../templates:17
-msgid ""
-"Please note that 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."
-msgstr ""
-"Por favor note que qualquer endereço funcionará contanto que o máquina "
-"local gerencie o roteamento. Mas caso você queira usar a rede "
-"MS-Windows você deverá usar endereços IP fora do espaço de endereços "
-"da LAN."
-
-#. Description
-#: ../templates:17
-msgid ""
-"You have to give one address for every concurrent connection. This will "
-"depend on how many clients you expect to be online at the same time. "
-"Multiple addresses can be given as either \"10.0.0.1,10.0.0.2,10.0.0.3\" or "
-"\"10.0.0.1-3\". No spaces should be used between commas or within addresses."
-msgstr ""
-"Você precisa fornecer um endereço para cada conexão concorrente. Isso "
-"dependerá de quantos clientes você espera que estejam on-line ao mesmo "
-"tempo. Diversos endereços podem ser informados como "
-"\"10.0.0.1,10.0.0.2,10.0.0.3\" ou \"10.0.0.1-3\". Nenhum espaço deverá "
-"ser usado entre as vírgulas ou como parte dos endereços."
-
-#. Description
-#: ../templates:31
-msgid "The netmask used for virtual connections."
-msgstr "A máscara de rede usada para conexões virtuais."
-
-#. Description
-#: ../templates:31
-msgid ""
-"If you use IP addresses from the LAN address space, please use the same "
-"netmask as on your LAN."
-msgstr ""
-"Caso você utilize endereços IP do espaço de endereços da LAN por favor "
-"usae a mesma máscara de rede usada em sua LAN."
-
-#. Description
-#: ../templates:37
-msgid "The IP address of your WINS server."
-msgstr "O endereço IP de seu servidor WINS."
-
-#. Description
-#: ../templates:37
-msgid ""
-"A WINS server is used for browsing available Computers in MS-Windows "
-"networking. This address is transmitted to the clients,"
-msgstr ""
-"Um servidor WINS é usado para navegar pelos computadores disponíveis "
-"em rede MS-Windows. Esse endereço é transmitido para os clientes."
-
-#. Description
-#: ../templates:43
-msgid "The IP address of your DNS server."
-msgstr "O endereço IP de seu servidor DNS."
-
-#. Description
-#: ../templates:43
-msgid "This address is transmitted to the clients."
-msgstr "Esse endereço é transmitido para os clientes."
-
-#. Description
-#: ../templates:49
-msgid "Do you want to use MPPE data encryption ?"
-msgstr "Você deseja usar encriptação de dados MPPE ?"
-
-#. Description
-#: ../templates:49
-msgid ""
-"The recommended way is to use the data encryption as it is one of the main "
-"benefits of a VPN. When you want to use MPPE (Microsoft Point-to-Point "
-"Encryption), you also have to use CHAPMSv2 for authentication. . Note that "
-"you have to install the modified ppp packages if you want to use this data "
-"encryption."
-msgstr ""
-"A maneira recomendada é usar a encriptação de dados uma vez que esse é "
-"um dos principais benefícios de um VPN. Quando usar MPPE (Microsoft "
-"Point-to-Point Encryption) você terá também que usar CHAPMSv2 para "
-"autenticação. Note que você precisa instalar os pacotes ppp modificados "
-"caso você queira usar essa encriptação de dados."
-
-#. Description
-#: ../templates:58
-msgid "Warning: data encryption is disabled."
-msgstr "Aviso : a encriptação de dados está desabilitada."
-
-#. Description
-#: ../templates:58
-msgid ""
-"All data transferred between the local network and the client will be "
-"transmitted without encryption ! This is a security hole."
-msgstr ""
-"Todos os dados transferidos entre a rede local e o cliente serão "
-"transferidos sem encriptação ! Isto é uma falha de segurança."
-
-#. Description
-#: ../templates:58
-msgid "You have been warned. Now you loose your product warranty :)"
-msgstr "Você foi avisado. Agora você perdeu a garantia do produto :)"
-
-#. Choices
-#: ../templates:66
-msgid "pap, chap, chapms, chapms-v2"
-msgstr "pap, chap, chapms, chapms-v2"
-
-#. Description
-#: ../templates:68
-msgid "Which authentication method do you want to use ?"
-msgstr "Qual método de autenticação você deseja usar ?"
-
-#. Description
-#: ../templates:68
-msgid ""
-"Possible authentication methods are: - PAP - CHAP - CHAP with Microsoft "
-"extensions - CHAP with Microsoft extensions v2"
-msgstr ""
-"Os métodos de autenticação possíveis são : PAP - CHAP - CHAP com "
-"extensões Microsoft - CHAP com extensões Microsoft v2"
-
-#. Description
-#: ../templates:68
-msgid ""
-"The recommended authentication method is one of the CHAP methods. However, "
-"you have to use a separate database (/etc/ppp/chap-secrets) if you want to "
-"use these. If you use PAP, you can use the standard system passwords when "
-"the ppp-pam package is installed."
-msgstr ""
-"O método de autenticação recomendado é um dos métodos CHAP. Porém, você "
-"precisará usar uma base de dados separada (/etc/ppp/chap-secrets) caso "
-"você queira usá-los. Caso você use PAP, você poderá usar o sistema de "
-"senhas padrão quando o pacote ppp-pam for instalado."
diff --git a/pptpd-1.3.3/debian/po/templates.pot b/pptpd-1.3.3/debian/po/templates.pot
deleted file mode 100644
index 42c04d8..0000000
--- a/pptpd-1.3.3/debian/po/templates.pot
+++ /dev/null
@@ -1,170 +0,0 @@
-#
-# Translators, if you are not familiar with the PO format, gettext
-# documentation is worth reading, especially sections dedicated to
-# this format, e.g. by running:
-# info -n '(gettext)PO Files'
-# info -n '(gettext)Header Entry'
-#
-# Some information specific to po-debconf are available at
-# /usr/share/doc/po-debconf/README-trans
-# or http://www.debian.org/intl/l10n/po-debconf/README-trans
-#
-# Developers do not need to manually edit POT or PO files.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2003-05-02 20:05-0300\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. Description
-#: ../templates:3
-msgid "The local IP address of the virtual connections"
-msgstr ""
-
-#. Description
-#: ../templates:3
-msgid "Specify the local IP address for the virtual connections."
-msgstr ""
-
-#. Description
-#: ../templates:3
-msgid ""
-"Please note that any address works as long as the local machine takes care "
-"of the routing. But if you want to use MS-Windows networking, you should use "
-"an IP address out of the LAN address space."
-msgstr ""
-
-#. Description
-#: ../templates:3
-msgid ""
-"You can give only one address or you can give multiple addresses if you want "
-"to, although they are really not needed. Multiple addresses can be given as "
-"either \"10.0.0.1,10.0.0.2,10.0.0.3\" or \"10.0.0.1-3\". No spaces should be "
-"used between commas or within addresses."
-msgstr ""
-
-#. Description
-#: ../templates:17
-msgid "A list of remote IP addresses for the virtual connections."
-msgstr ""
-
-#. Description
-#: ../templates:17
-msgid "Specify the remote IP addresses for the virtual connections."
-msgstr ""
-
-#. Description
-#: ../templates:17
-msgid ""
-"Please note that 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."
-msgstr ""
-
-#. Description
-#: ../templates:17
-msgid ""
-"You have to give one address for every concurrent connection. This will "
-"depend on how many clients you expect to be online at the same time. "
-"Multiple addresses can be given as either \"10.0.0.1,10.0.0.2,10.0.0.3\" or "
-"\"10.0.0.1-3\". No spaces should be used between commas or within addresses."
-msgstr ""
-
-#. Description
-#: ../templates:31
-msgid "The netmask used for virtual connections."
-msgstr ""
-
-#. Description
-#: ../templates:31
-msgid ""
-"If you use IP addresses from the LAN address space, please use the same "
-"netmask as on your LAN."
-msgstr ""
-
-#. Description
-#: ../templates:37
-msgid "The IP address of your WINS server."
-msgstr ""
-
-#. Description
-#: ../templates:37
-msgid ""
-"A WINS server is used for browsing available Computers in MS-Windows "
-"networking. This address is transmitted to the clients,"
-msgstr ""
-
-#. Description
-#: ../templates:43
-msgid "The IP address of your DNS server."
-msgstr ""
-
-#. Description
-#: ../templates:43
-msgid "This address is transmitted to the clients."
-msgstr ""
-
-#. Description
-#: ../templates:49
-msgid "Do you want to use MPPE data encryption ?"
-msgstr ""
-
-#. Description
-#: ../templates:49
-msgid ""
-"The recommended way is to use the data encryption as it is one of the main "
-"benefits of a VPN. When you want to use MPPE (Microsoft Point-to-Point "
-"Encryption), you also have to use CHAPMSv2 for authentication. . Note that "
-"you have to install the modified ppp packages if you want to use this data "
-"encryption."
-msgstr ""
-
-#. Description
-#: ../templates:58
-msgid "Warning: data encryption is disabled."
-msgstr ""
-
-#. Description
-#: ../templates:58
-msgid ""
-"All data transferred between the local network and the client will be "
-"transmitted without encryption ! This is a security hole."
-msgstr ""
-
-#. Description
-#: ../templates:58
-msgid "You have been warned. Now you loose your product warranty :)"
-msgstr ""
-
-#. Choices
-#: ../templates:66
-msgid "pap, chap, chapms, chapms-v2"
-msgstr ""
-
-#. Description
-#: ../templates:68
-msgid "Which authentication method do you want to use ?"
-msgstr ""
-
-#. Description
-#: ../templates:68
-msgid ""
-"Possible authentication methods are: - PAP - CHAP - CHAP with Microsoft "
-"extensions - CHAP with Microsoft extensions v2"
-msgstr ""
-
-#. Description
-#: ../templates:68
-msgid ""
-"The recommended authentication method is one of the CHAP methods. However, "
-"you have to use a separate database (/etc/ppp/chap-secrets) if you want to "
-"use these. If you use PAP, you can use the standard system passwords when "
-"the ppp-pam package is installed."
-msgstr ""
diff --git a/pptpd-1.3.3/debian/pptpd-options b/pptpd-1.3.3/debian/pptpd-options
deleted file mode 100644
index e21093a..0000000
--- a/pptpd-1.3.3/debian/pptpd-options
+++ /dev/null
@@ -1,94 +0,0 @@
-###############################################################################
-# $Id: pptpd-options,v 1.1 2004/05/17 02:16:35 quozl Exp $
-#
-# Sample Poptop PPP options file /etc/ppp/pptpd-options
-# 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
-
-# Optional: domain name to use for authentication
-# domain mydomain.net
-
-# Strip the domain prefix from the username before authentication.
-# (applies if you use pppd with chapms-strip-domain patch)
-#chapms-strip-domain
-
-
-# Encryption
-# Debian: on systems with a kernel built with the package
-# kernel-patch-mppe >= 2.4.2 and using ppp >= 2.4.2, ...
-# {{{
-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
-# }}}
-
-
-
-
-# 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
-
-# Debian: do not replace the default route
-nodefaultroute
-
-
-# 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
diff --git a/pptpd-1.3.3/debian/pptpd.conf b/pptpd-1.3.3/debian/pptpd.conf
deleted file mode 100644
index 889f244..0000000
--- a/pptpd-1.3.3/debian/pptpd.conf
+++ /dev/null
@@ -1,80 +0,0 @@
-###############################################################################
-# $Id: pptpd.conf,v 1.1 2004/05/17 02:16:35 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/pptpd-options
-
-# 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
-#remoteip 192.168.0.234-238,192.168.0.245
-# or
-#localip 192.168.0.234-238,192.168.0.245
-#remoteip 192.168.1.234-238,192.168.1.245
diff --git a/pptpd-1.3.3/debian/pptpd.init b/pptpd-1.3.3/debian/pptpd.init
deleted file mode 100644
index 6f6938d..0000000
--- a/pptpd-1.3.3/debian/pptpd.init
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-# Copyright Rene Mayrhofer, ViaNova, 1999
-# This script is distibuted under the GPL
-
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-DAEMON=/usr/sbin/pptpd
-PIDFILE=/var/run/pptpd.pid
-FLAGS="defaults 50"
-
-case "$1" in
- start)
- echo -n "Starting PPTP Daemon: "
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
- -- < /dev/null > /dev/null
- echo "pptpd."
- ;;
- stop)
- echo -n "Stopping PPTP: "
- start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
- echo "pptpd."
- ;;
- reload)
- echo "Not implemented."
- ;;
- force-reload|restart)
- echo "Restarting PPTP: "
- sh $0 stop
- sh $0 start
- ;;
- status)
- if [ ! -r $PIDFILE ]; then
- # no pid file, process doesn't seem to be running correctly
- exit 3
- fi
- PID=`cat $PIDFILE | sed 's/ //g'`
- EXE=/proc/$PID/exe
- if [ -x "$EXE" ] &&
- [ "`ls -l \"$EXE\" | cut -d'>' -f2,2 | cut -d' ' -f2,2`" = \
- "$DAEMON" ]; then
- # ok, process seems to be running
- exit 0
- elif [ -r $PIDFILE ]; then
- # process not running, but pidfile exists
- exit 1
- else
- # no lock file to check for, so simply return the stopped status
- exit 3
- fi
- ;;
- *)
- echo "Usage: /etc/init.d/pptpd {start|stop|restart|force-reload|reload}"
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/pptpd-1.3.3/debian/pptpdconfig.pl b/pptpd-1.3.3/debian/pptpdconfig.pl
deleted file mode 100644
index 9d0452a..0000000
--- a/pptpd-1.3.3/debian/pptpdconfig.pl
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use Debian::DebConf::Client::ConfModule ':all';
-
-&pptpd("/etc/pptpd.conf", get("pptpd/localip"), get("pptpd/remoteip"));
-exit 0;
-
-sub pptpd ($$$) {
-
- my $line; # eine Zeile von IN
- my $xxx;
- my @lines;
- my $count;
- my $filename;
- my $localIp;
- my $remoteIp;
- my $spaces;
- my $foundlocal=0;
- my $foundremote=0;
- my $IDString="# generated by pptpdconfig";
-
- $filename=shift;
- $localIp=shift;
- $remoteIp=shift;
- print("Configuring pptpd to use localip(s) $localIp and remoteip(s) ");
- print("$remoteIp ...\n");
-
- open(IN, "<$filename") || die("$filename not found.\n");
- @lines=<IN>;
-
- open(OUT, ">${filename}.old");
- print OUT @lines;
- close OUT;
-
- $count=0;
- while ($count<=$#lines)
- {
- $line=$lines[$count];
- if ($line=~/^\s*localip/) {
- if ($line=~/$IDString/)
- {
- ($spaces)=($line=~/^(\s*)\S*.*/);
- $lines[$count]="${spaces}localip $localIp $IDString\n";
- $foundlocal=1;
- }
- else
- {
- $lines[$count]="# removed by pptpdconfig --- ".$lines[$count]."\n";
- }
- }
-
- if ($line=~/^\s*remoteip/) {
- if ($line=~/$IDString/)
- {
- ($spaces)=($line=~/^(\s*)\S*.*/);
- $lines[$count]="${spaces}remoteip $remoteIp $IDString\n";
- $foundremote=1;
- }
- else
- {
- $lines[$count]="# removed by pptpdconfig --- ".$lines[$count]."\n";
- }
- }
- $count++;
- }
- if ($foundlocal==0)
- {
- push(@lines, "localip $localIp $IDString\n");
- }
- if ($foundremote==0)
- {
- push(@lines, "remoteip $remoteIp $IDString\n");
- }
- close IN;
- print("done\n");
-
- open(OUT, ">$filename");
- print OUT @lines;
- close OUT;
-}
diff --git a/pptpd-1.3.3/debian/rules b/pptpd-1.3.3/debian/rules
deleted file mode 100755
index bca6b50..0000000
--- a/pptpd-1.3.3/debian/rules
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/make -f
-# MAde with the aid of dh_make, by Craig Small
-# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
-# Some lines taken from debmake, by Cristoph Lameter.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-build: build-stamp
-build-stamp:
- dh_testdir
-
- ./configure --prefix=/usr --mandir=/usr/share/man \
- --with-libwrap --with-bcrelay
- # Add here commands to compile the package.
- $(MAKE)
-
- touch build-stamp
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp install-stamp
-
- # Add here commands to clean up after the build process.
- -$(MAKE) distclean
-
- dh_clean
-
-install: install-stamp
-install-stamp: build-stamp
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Add here commands to install the package into debian/tmp.
- $(MAKE) install prefix=`pwd`/debian/tmp/usr mandir=`pwd`/debian/tmp/usr/share/man
- cp debian/pptpd.conf `pwd`/debian/tmp/etc
- cp debian/pptpd-options `pwd`/debian/tmp/etc/ppp
- #cp debian/pptpdconfig.pl `pwd`/debian/tmp/usr/sbin
- touch install-stamp
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-# dh_testversion
- dh_testdir
- dh_testroot
- dh_installdocs
-# mv `pwd`/debian/tmp/usr/share/doc/pptpd/html/*.txt `pwd`/debian/tmp/usr/share/doc/pptpd/
- dh_installexamples
-# dh_installmenu
-# dh_installemacsen
- dh_installinit
-# dh_installcron
- dh_installmanpages
-# dh_installdebconf
-# dh_undocumented
- dh_installchangelogs -k ChangeLog
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
-# dh_makeshlibs
- dh_md5sums
- dh_builddeb
-
-source diff:
- @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
diff --git a/pptpd-1.3.3/debian/templates b/pptpd-1.3.3/debian/templates
deleted file mode 100644
index e2a6b48..0000000
--- a/pptpd-1.3.3/debian/templates
+++ /dev/null
@@ -1,75 +0,0 @@
-Template: pptpd/localip
-Type: string
-_Description: Local IP address of the virtual connections
- Specify the local IP address for the virtual connections.
- .
- Please note that any address works as long as the local machine takes care
- of the routing. But if you want to use MS-Windows networking, you should
- use an IP address out of the LAN address space.
- .
- You can give only one address or you can give multiple addresses if you
- want to, although they are really not needed. Multiple addresses can be
- given as either "10.0.0.1,10.0.0.2,10.0.0.3" or "10.0.0.1-3". No spaces
- should be used between commas or within addresses.
-
-Template: pptpd/remoteip
-Type: string
-_Description: A list of remote IP addresses for the virtual connections.
- Specify the remote IP addresses for the virtual connections.
- .
- Please note that 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.
- .
- You have to give one address for every concurrent connection. This will
- depend on how many clients you expect to be online at the same time.
- Multiple addresses can be given as either "10.0.0.1,10.0.0.2,10.0.0.3" or
- "10.0.0.1-3". No spaces should be used between commas or within addresses.
-
-Template: pptpd/netmask
-Type: string
-_Description: Netmask used for virtual connections.
- If you use IP addresses from the LAN address space, please use the same
- netmask as on your LAN.
-
-Template: pptpd/wins
-Type: string
-_Description: IP address of your WINS server.
- A WINS server is used for browsing available Computers in MS-Windows
- networking. This address is transmitted to the clients,
-
-Template: pptpd/dns
-Type: string
-_Description: IP address of your DNS server.
- This address is transmitted to the clients.
-
-Template: pptpd/mppe
-Type: boolean
-Default: true
-_Description: Do you want to use MPPE data encryption ?
- The recommended way is to use the data encryption as it is one of the main
- benefits of a VPN. When you want to use MPPE (Microsoft Point-to-Point
- Encryption), you also have to use CHAPMSv2 for authentication. . Note
- that you have to install the modified ppp packages if you want to use this
- data encryption.
-
-Template: pptpd/no-mppe
-Type: note
-_Description: Warning: data encryption is disabled.
- All data transferred between the local network and the client will be
- transmitted without encryption ! This is a security hole.
- .
- You have been warned. Now you loose your product warranty :)
-
-Template: pptpd/authentication
-Type: select
-_Choices: pap, chap, chapms, chapms-v2
-Default: chap
-_Description: Which authentication method do you want to use ?
- Possible authentication methods are: - PAP - CHAP - CHAP with Microsoft
- extensions - CHAP with Microsoft extensions v2
- .
- The recommended authentication method is one of the CHAP methods. However,
- you have to use a separate database (/etc/ppp/chap-secrets) if you want to
- use these. If you use PAP, you can use the standard system passwords when
- the ppp-pam package is installed.
diff --git a/pptpd-1.3.3/defaults.h b/pptpd-1.3.3/defaults.h
deleted file mode 100644
index 19ff410..0000000
--- a/pptpd-1.3.3/defaults.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * defaults.h
- *
- * This file contains some tuneable parameters, most of which can be overriden
- * at run-time.
- *
- * $Id: defaults.h,v 1.9 2006/09/04 23:17:25 quozl Exp $
- */
-
-#ifndef _PPTPD_DEFAULTS_H
-#define _PPTPD_DEFAULTS_H
-
-/* Definitions for true and false */
-
-#ifndef FALSE
-#define FALSE 0
-#define TRUE !FALSE
-#endif
-
-/* String sizes for the config file */
-
-#define MAX_CONFIG_FILENAME_SIZE 256
-#define MAX_CONFIG_STRING_SIZE 512
-
-/* For IP parser */
-
-#define LOCAL 0
-#define REMOTE 1
-
-/* Default configuration values, mostly configurable */
-
-#define CONNECTIONS_DEFAULT 100
-#define DEFAULT_LOCAL_IP_LIST "192.168.0.1-100"
-#define DEFAULT_REMOTE_IP_LIST "192.168.1.1-100"
-
-#define MAX_CALLS_PER_TCP_LINK 128
-
-#ifdef PNS_MODE
-#define MAX_CALLS 60
-#endif
-
-#define PPP_SPEED_DEFAULT "115200"
-#if EMBED
-#define PPTPD_CONFIG_FILE_DEFAULT "/etc/config/pptpd.conf"
-#else
-#define PPTPD_CONFIG_FILE_DEFAULT "/etc/pptpd.conf"
-#endif
-#define PIDFILE_DEFAULT "/var/run/pptpd.pid"
-
-#define STIMEOUT_DEFAULT 10 /* seconds */
-#define PTIMEOUT_DEFAULT 1000 /* msec */
-
-/* Location of binaries */
-
-#define PPTP_CTRL_BIN SBINDIR "/pptpctrl"
-#define PPTPD_BIN SBINDIR "/pptpd"
-#define BCRELAY_BIN SBINDIR "/bcrelay"
-
-/* Parameters permitted in the config file */
-
-#define CONNECTIONS_KEYWORD "connections"
-#define SPEED_KEYWORD "speed"
-#define PPPD_OPTION_KEYWORD "option"
-#define DEBUG_KEYWORD "debug"
-#ifdef BCRELAY
-#define BCRELAY_KEYWORD "bcrelay"
-#endif
-#define LOCALIP_KEYWORD "localip"
-#define REMOTEIP_KEYWORD "remoteip"
-#define LISTEN_KEYWORD "listen"
-#define PIDFILE_KEYWORD "pidfile"
-#define STIMEOUT_KEYWORD "stimeout"
-#define PTIMEOUT_KEYWORD "ptimeout"
-#define NOIPPARAM_KEYWORD "noipparam"
-#define PPP_BINARY_KEYWORD "ppp"
-#define LOGWTMP_KEYWORD "logwtmp"
-#define DELEGATE_KEYWORD "delegate"
-#define KEEP_KEYWORD "keep"
-
-#endif /* !_PPTPD_DEFAULTS_H */
diff --git a/pptpd-1.3.3/getopt.c b/pptpd-1.3.3/getopt.c
deleted file mode 100644
index 0f0b1e3..0000000
--- a/pptpd-1.3.3/getopt.c
+++ /dev/null
@@ -1,1064 +0,0 @@
-/*
- * getopt.c
- *
- * Ripped from GLIBC - original copyright follows
- *
- * NOTE: Changed to make dependencies work better:
- * * <config.h> changed to "config.h"
- * * #include "our_getopt.h" near #define ELIDE_CODE
- *
- * $Id: getopt.c,v 1.1.1.1 2002/06/21 08:52:00 fenix_nl Exp $
- */
-
-/* Getopt for GNU.
- NOTE: getopt is now part of the C library, so if you don't know what
- "Keep this file name-space clean" means, talk to drepper@gnu.org
- before changing it!
-
- Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
- Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
- Ditto for AIX 3.2 and <stdlib.h>. */
-#ifndef _NO_PROTO
-# define _NO_PROTO
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-# ifndef const
-# define const
-# endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-# include <gnu-versions.h>
-# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-# define ELIDE_CODE
-# include "our_getopt.h" /* for dependency consistency */
-# endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
- contain conflicting prototypes for getopt. */
-# include <stdlib.h>
-# include <unistd.h>
-#endif /* GNU C library. */
-
-#ifdef VMS
-# include <unixlib.h>
-# if HAVE_STRING_H - 0
-# include <string.h>
-# endif
-#endif
-
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
- When compiling libc, the _ macro is predefined. */
-# ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# define _(msgid) gettext (msgid)
-# else
-# define _(msgid) (msgid)
-# endif
-#endif
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
- but it behaves differently for the user, since it allows the user
- to intersperse the options with the other arguments.
-
- As `getopt' works, it permutes the elements of ARGV so that,
- when it is done, all the options precede everything else. Thus
- all application programs are extended to handle flexible argument order.
-
- Setting the environment variable POSIXLY_CORRECT disables permutation.
- Then the behavior is completely standard.
-
- GNU application programs can use a third alternative mode in which
- they can distinguish the relative order of options and other arguments. */
-
-#include "our_getopt.h"
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-/* 1003.2 says this must be 1 before any call. */
-int optind = 1;
-
-/* Formerly, initialization of getopt depended on optind==0, which
- causes problems with re-calling getopt as programs generally don't
- know that. */
-
-int __getopt_initialized;
-
-/* The next char to be scanned in the option-element
- in which the last option character we returned was found.
- This allows us to pick up the scan where we left off.
-
- If this is zero, or a null string, it means resume the scan
- by advancing to the next ARGV-element. */
-
-static char *nextchar;
-
-/* Callers store zero here to inhibit the error message
- for unrecognized options. */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
- This must be initialized on some systems to avoid linking in the
- system's own getopt implementation. */
-
-int optopt = '?';
-
-/* Describe how to deal with options that follow non-option ARGV-elements.
-
- If the caller did not specify anything,
- the default is REQUIRE_ORDER if the environment variable
- POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options;
- stop option processing when the first non-option is seen.
- This is what Unix does.
- This mode of operation is selected by either setting the environment
- variable POSIXLY_CORRECT, or using `+' as the first character
- of the list of option characters.
-
- PERMUTE is the default. We permute the contents of ARGV as we scan,
- so that eventually all the non-options are at the end. This allows options
- to be given in any order, even with programs that were not written to
- expect this.
-
- RETURN_IN_ORDER is an option available to programs that were written
- to expect options and other ARGV-elements in any order and that care about
- the ordering of the two. We describe each non-option ARGV-element
- as if it were the argument of an option with character code 1.
- Using `-' as the first character of the list of option characters
- selects this mode of operation.
-
- The special argument `--' forces an end of option-scanning regardless
- of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return -1 with `optind' != ARGC. */
-
-static enum
-{
- REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-} ordering;
-
-/* Value of POSIXLY_CORRECT environment variable. */
-static char *posixly_correct;
-
-#ifdef __GNU_LIBRARY__
-/* We want to avoid inclusion of string.h with non-GNU libraries
- because there are many ways it can cause trouble.
- On some systems, it contains special magic macros that don't work
- in GCC. */
-# include <string.h>
-# define my_index strchr
-#else
-
-# if HAVE_STRING_H
-# include <string.h>
-# else
-# include <strings.h>
-# endif
-
-/* Avoid depending on library functions or files
- whose names are inconsistent. */
-
-#ifndef getenv
-extern char *getenv ();
-#endif
-
-static char *
-my_index (str, chr)
- const char *str;
- int chr;
-{
- while (*str)
- {
- if (*str == chr)
- return (char *) str;
- str++;
- }
- return 0;
-}
-
-/* If using GCC, we can safely declare strlen this way.
- If not using GCC, it is ok not to declare it. */
-#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
- That was relevant to code that was here before. */
-# if (!defined __STDC__ || !__STDC__) && !defined strlen
-/* gcc with -traditional declares the built-in strlen to return int,
- and has done so at least since version 2.4.5. -- rms. */
-extern int strlen (const char *);
-# endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
-
-/* Handle permutation of arguments. */
-
-/* Describe the part of ARGV that contains non-options that have
- been skipped. `first_nonopt' is the index in ARGV of the first of them;
- `last_nonopt' is the index after the last of them. */
-
-static int first_nonopt;
-static int last_nonopt;
-
-#ifdef _LIBC
-/* Bash 2.0 gives us an environment variable containing flags
- indicating ARGV elements that should not be considered arguments. */
-
-/* Defined in getopt_init.c */
-extern char *__getopt_nonoption_flags;
-
-static int nonoption_flags_max_len;
-static int nonoption_flags_len;
-
-static int original_argc;
-static char *const *original_argv;
-
-/* Make sure the environment variable bash 2.0 puts in the environment
- is valid for the getopt call we must make sure that the ARGV passed
- to getopt is that one passed to the process. */
-static void
-__attribute__ ((unused))
-store_args_and_env (int argc, char *const *argv)
-{
- /* XXX This is no good solution. We should rather copy the args so
- that we can compare them later. But we must not use malloc(3). */
- original_argc = argc;
- original_argv = argv;
-}
-# ifdef text_set_element
-text_set_element (__libc_subinit, store_args_and_env);
-# endif /* text_set_element */
-
-# define SWAP_FLAGS(ch1, ch2) \
- if (nonoption_flags_len > 0) \
- { \
- char __tmp = __getopt_nonoption_flags[ch1]; \
- __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
- __getopt_nonoption_flags[ch2] = __tmp; \
- }
-#else /* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif /* _LIBC */
-
-/* Exchange two adjacent subsequences of ARGV.
- One subsequence is elements [first_nonopt,last_nonopt)
- which contains all the non-options that have been skipped so far.
- The other is elements [last_nonopt,optind), which contains all
- the options processed since those non-options were skipped.
-
- `first_nonopt' and `last_nonopt' are relocated so that they describe
- the new indices of the non-options in ARGV after they are moved. */
-
-#if defined __STDC__ && __STDC__
-static void exchange (char **);
-#endif
-
-static void
-exchange (argv)
- char **argv;
-{
- int bottom = first_nonopt;
- int middle = last_nonopt;
- int top = optind;
- char *tem;
-
- /* Exchange the shorter segment with the far end of the longer segment.
- That puts the shorter segment into the right place.
- It leaves the longer segment in the right place overall,
- but it consists of two parts that need to be swapped next. */
-
-#ifdef _LIBC
- /* First make sure the handling of the `__getopt_nonoption_flags'
- string can work normally. Our top argument must be in the range
- of the string. */
- if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
- {
- /* We must extend the array. The user plays games with us and
- presents new arguments. */
- char *new_str = malloc (top + 1);
- if (new_str == NULL)
- nonoption_flags_len = nonoption_flags_max_len = 0;
- else
- {
- memset (__mempcpy (new_str, __getopt_nonoption_flags,
- nonoption_flags_max_len),
- '\0', top + 1 - nonoption_flags_max_len);
- nonoption_flags_max_len = top + 1;
- __getopt_nonoption_flags = new_str;
- }
- }
-#endif
-
- while (top > middle && middle > bottom)
- {
- if (top - middle > middle - bottom)
- {
- /* Bottom segment is the short one. */
- int len = middle - bottom;
- register int i;
-
- /* Swap it with the top part of the top segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[top - (middle - bottom) + i];
- argv[top - (middle - bottom) + i] = tem;
- SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
- }
- /* Exclude the moved bottom segment from further swapping. */
- top -= len;
- }
- else
- {
- /* Top segment is the short one. */
- int len = top - middle;
- register int i;
-
- /* Swap it with the bottom part of the bottom segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[middle + i];
- argv[middle + i] = tem;
- SWAP_FLAGS (bottom + i, middle + i);
- }
- /* Exclude the moved top segment from further swapping. */
- bottom += len;
- }
- }
-
- /* Update records for the slots the non-options now occupy. */
-
- first_nonopt += (optind - last_nonopt);
- last_nonopt = optind;
-}
-
-/* Initialize the internal data when the first call is made. */
-
-#if defined __STDC__ && __STDC__
-static const char *_getopt_initialize (int, char *const *, const char *);
-#endif
-static const char *
-_getopt_initialize (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- /* Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- first_nonopt = last_nonopt = optind;
-
- nextchar = NULL;
-
- posixly_correct = getenv ("POSIXLY_CORRECT");
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- {
- ordering = RETURN_IN_ORDER;
- ++optstring;
- }
- else if (optstring[0] == '+')
- {
- ordering = REQUIRE_ORDER;
- ++optstring;
- }
- else if (posixly_correct != NULL)
- ordering = REQUIRE_ORDER;
- else
- ordering = PERMUTE;
-
-#ifdef _LIBC
- if (posixly_correct == NULL
- && argc == original_argc && argv == original_argv)
- {
- if (nonoption_flags_max_len == 0)
- {
- if (__getopt_nonoption_flags == NULL
- || __getopt_nonoption_flags[0] == '\0')
- nonoption_flags_max_len = -1;
- else
- {
- const char *orig_str = __getopt_nonoption_flags;
- int len = nonoption_flags_max_len = strlen (orig_str);
- if (nonoption_flags_max_len < argc)
- nonoption_flags_max_len = argc;
- __getopt_nonoption_flags =
- (char *) malloc (nonoption_flags_max_len);
- if (__getopt_nonoption_flags == NULL)
- nonoption_flags_max_len = -1;
- else
- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
- '\0', nonoption_flags_max_len - len);
- }
- }
- nonoption_flags_len = nonoption_flags_max_len;
- }
- else
- nonoption_flags_len = 0;
-#endif
-
- return optstring;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
- given in OPTSTRING.
-
- If an element of ARGV starts with '-', and is not exactly "-" or "--",
- then it is an option element. The characters of this element
- (aside from the initial '-') are option characters. If `getopt'
- is called repeatedly, it returns successively each of the option characters
- from each of the option elements.
-
- If `getopt' finds another option character, it returns that character,
- updating `optind' and `nextchar' so that the next call to `getopt' can
- resume the scan with the following option character or ARGV-element.
-
- If there are no more option characters, `getopt' returns -1.
- Then `optind' is the index in ARGV of the first ARGV-element
- that is not an option. (The ARGV-elements have been permuted
- so that those that are not options now come last.)
-
- OPTSTRING is a string containing the legitimate option characters.
- If an option character is seen that is not listed in OPTSTRING,
- return '?' after printing an error message. If you set `opterr' to
- zero, the error message is suppressed but we still return '?'.
-
- If a char in OPTSTRING is followed by a colon, that means it wants an arg,
- so the following text in the same ARGV-element, or the text of the following
- ARGV-element, is returned in `optarg'. Two colons mean an option that
- wants an optional arg; if there is text in the current ARGV-element,
- it is returned in `optarg', otherwise `optarg' is set to zero.
-
- If OPTSTRING starts with `-' or `+', it requests different methods of
- handling the non-option ARGV-elements.
- See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
- Long-named options begin with `--' instead of `-'.
- Their names may be abbreviated as long as the abbreviation is unique
- or is an exact match for some defined option. If they have an
- argument, it follows the option name in the same ARGV-element, separated
- from the option name by a `=', or else the in next ARGV-element.
- When `getopt' finds a long-named option, it returns 0 if that option's
- `flag' field is nonzero, the value of the option's `val' field
- if the `flag' field is zero.
-
- The elements of ARGV aren't really const, because we permute them.
- But we pretend they're const in the prototype to be compatible
- with other systems.
-
- LONGOPTS is a vector of `struct option' terminated by an
- element containing a name which is zero.
-
- LONGIND returns the index in LONGOPT of the long-named option found.
- It is only valid when a long-named option has been found by the most
- recent call.
-
- If LONG_ONLY is nonzero, '-' as well as '--' can introduce
- long-named options. */
-
-int
-_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
- int argc;
- char *const *argv;
- const char *optstring;
- const struct option *longopts;
- int *longind;
- int long_only;
-{
- optarg = NULL;
-
- if (optind == 0 || !__getopt_initialized)
- {
- if (optind == 0)
- optind = 1; /* Don't scan ARGV[0], the program name. */
- optstring = _getopt_initialize (argc, argv, optstring);
- __getopt_initialized = 1;
- }
-
- /* Test whether ARGV[optind] points to a non-option argument.
- Either it does not have option syntax, or there is an environment flag
- from the shell indicating it is not an option. The later information
- is only used when the used in the GNU libc. */
-#ifdef _LIBC
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
- || (optind < nonoption_flags_len \
- && __getopt_nonoption_flags[optind] == '1'))
-#else
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
-#endif
-
- if (nextchar == NULL || *nextchar == '\0')
- {
- /* Advance to the next ARGV-element. */
-
- /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
- moved back by the user (who may also have changed the arguments). */
- if (last_nonopt > optind)
- last_nonopt = optind;
- if (first_nonopt > optind)
- first_nonopt = optind;
-
- if (ordering == PERMUTE)
- {
- /* If we have just processed some options following some non-options,
- exchange them so that the options come first. */
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (last_nonopt != optind)
- first_nonopt = optind;
-
- /* Skip any additional non-options
- and extend the range of non-options previously skipped. */
-
- while (optind < argc && NONOPTION_P)
- optind++;
- last_nonopt = optind;
- }
-
- /* The special ARGV-element `--' means premature end of options.
- Skip it like a null option,
- then exchange with previous non-options as if it were an option,
- then skip everything else like a non-option. */
-
- if (optind != argc && !strcmp (argv[optind], "--"))
- {
- optind++;
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (first_nonopt == last_nonopt)
- first_nonopt = optind;
- last_nonopt = argc;
-
- optind = argc;
- }
-
- /* If we have done all the ARGV-elements, stop the scan
- and back over any non-options that we skipped and permuted. */
-
- if (optind == argc)
- {
- /* Set the next-arg-index to point at the non-options
- that we previously skipped, so the caller will digest them. */
- if (first_nonopt != last_nonopt)
- optind = first_nonopt;
- return -1;
- }
-
- /* If we have come to a non-option and did not permute it,
- either stop the scan or describe it to the caller and pass it by. */
-
- if (NONOPTION_P)
- {
- if (ordering == REQUIRE_ORDER)
- return -1;
- optarg = argv[optind++];
- return 1;
- }
-
- /* We have found another option-ARGV-element.
- Skip the initial punctuation. */
-
- nextchar = (argv[optind] + 1
- + (longopts != NULL && argv[optind][1] == '-'));
- }
-
- /* Decode the current option-ARGV-element. */
-
- /* Check whether the ARGV-element is a long option.
-
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
- On the other hand, if there's a long option "fubar" and
- the ARGV-element is "-fu", do consider that an abbreviation of
- the long option, just like "--fu", and not "-f" with arg "u".
-
- This distinction seems to be the most useful approach. */
-
- if (longopts != NULL
- && (argv[optind][1] == '-'
- || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = -1;
- int option_index;
-
- for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar)
- == (unsigned int) strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
-
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- optopt = 0;
- return '?';
- }
-
- if (pfound != NULL)
- {
- option_index = indfound;
- optind++;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- {
- if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- _("%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
- else
- /* +option or -option */
- fprintf (stderr,
- _("%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[optind - 1][0], pfound->name);
- }
-
- nextchar += strlen (nextchar);
-
- optopt = pfound->val;
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- optopt = pfound->val;
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
-
- /* Can't find it as a long option. If this is not getopt_long_only,
- or the option starts with '--' or is not a valid short
- option, then it's an error.
- Otherwise interpret it as a short option. */
- if (!long_only || argv[optind][1] == '-'
- || my_index (optstring, *nextchar) == NULL)
- {
- if (opterr)
- {
- if (argv[optind][1] == '-')
- /* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
- argv[0], nextchar);
- else
- /* +option or -option */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[optind][0], nextchar);
- }
- nextchar = (char *) "";
- optind++;
- optopt = 0;
- return '?';
- }
- }
-
- /* Look at and handle the next short option-character. */
-
- {
- char c = *nextchar++;
- char *temp = my_index (optstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*nextchar == '\0')
- ++optind;
-
- if (temp == NULL || c == ':')
- {
- if (opterr)
- {
- if (posixly_correct)
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: illegal option -- %c\n"),
- argv[0], c);
- else
- fprintf (stderr, _("%s: invalid option -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- return '?';
- }
- /* Convenience. Treat POSIX -W foo same as long option --foo */
- if (temp[0] == 'W' && temp[1] == ';')
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = 0;
- int option_index;
-
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- return c;
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
-
- /* optarg is now the argument, see if it's in the
- table of longopts. */
-
- for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar) == strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
- if (ambig && !exact)
- {
- if (opterr)
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- return '?';
- }
- if (pfound != NULL)
- {
- option_index = indfound;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (opterr)
- fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-
- nextchar += strlen (nextchar);
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (opterr)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
- nextchar = NULL;
- return 'W'; /* Let the application handle it. */
- }
- if (temp[1] == ':')
- {
- if (temp[2] == ':')
- {
- /* This is an option that accepts an argument optionally. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- optind++;
- }
- else
- optarg = NULL;
- nextchar = NULL;
- }
- else
- {
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (opterr)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
- nextchar = NULL;
- }
- }
- return c;
- }
-}
-
-int
-getopt (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- return _getopt_internal (argc, argv, optstring,
- (const struct option *) 0,
- (int *) 0,
- 0);
-}
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
- the above definition of `getopt'. */
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
-
- c = getopt (argc, argv, "abc:d:0123456789");
- if (c == -1)
- break;
-
- switch (c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/pptpd-1.3.3/getopt1.c b/pptpd-1.3.3/getopt1.c
deleted file mode 100644
index 37e79ba..0000000
--- a/pptpd-1.3.3/getopt1.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * getopt1.c
- *
- * Ripped from GLIBC - original copyright follows
- *
- * NOTE: Changed to make dependencies work better:
- * * <config.h> changed to "config.h"
- *
- * $Id: getopt1.c,v 1.1.1.1 2002/06/21 08:51:58 fenix_nl Exp $
- */
-
-/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "our_getopt.h"
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-#ifndef const
-#define const
-#endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-#include <gnu-versions.h>
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-int
-getopt_long (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
-}
-
-/* Like getopt_long, but '-' as well as '--' can indicate a long option.
- If an option that starts with '-' (not '--') doesn't match a long option,
- but does match a short option, it is parsed as a short option
- instead. */
-
-int
-getopt_long_only (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
-}
-
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-#include <stdio.h>
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
- int option_index = 0;
- static struct option long_options[] =
- {
- {"add", 1, 0, 0},
- {"append", 0, 0, 0},
- {"delete", 1, 0, 0},
- {"verbose", 0, 0, 0},
- {"create", 0, 0, 0},
- {"file", 1, 0, 0},
- {0, 0, 0, 0}
- };
-
- c = getopt_long (argc, argv, "abc:d:0123456789",
- long_options, &option_index);
- if (c == -1)
- break;
-
- switch (c)
- {
- case 0:
- printf ("option %s", long_options[option_index].name);
- if (optarg)
- printf (" with arg %s", optarg);
- printf ("\n");
- break;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case 'd':
- printf ("option d with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/pptpd-1.3.3/html/CVS/Entries b/pptpd-1.3.3/html/CVS/Entries
deleted file mode 100644
index 1b7a3e1..0000000
--- a/pptpd-1.3.3/html/CVS/Entries
+++ /dev/null
@@ -1,3 +0,0 @@
-/HOWTO-PoPToP.txt/1.2/Thu Apr 22 04:54:07 2004//
-/setup_pptp_client.html/1.1.1.1/Thu Apr 22 04:54:07 2004//
-D/poptop_ads_howto////
diff --git a/pptpd-1.3.3/html/CVS/Repository b/pptpd-1.3.3/html/CVS/Repository
deleted file mode 100644
index bf2041d..0000000
--- a/pptpd-1.3.3/html/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-poptop/html
diff --git a/pptpd-1.3.3/html/CVS/Root b/pptpd-1.3.3/html/CVS/Root
deleted file mode 100644
index 6f952a5..0000000
--- a/pptpd-1.3.3/html/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:ext:quozl@poptop.cvs.sourceforge.net:/cvsroot/poptop
diff --git a/pptpd-1.3.3/html/HOWTO-PoPToP.txt b/pptpd-1.3.3/html/HOWTO-PoPToP.txt
deleted file mode 100644
index cb69887..0000000
--- a/pptpd-1.3.3/html/HOWTO-PoPToP.txt
+++ /dev/null
@@ -1,873 +0,0 @@
-PoPToP HOWTO/FAQ
-----------------
-Last Updated: 20021024
-Send changes to: Richard de Vroede <r.devroede@linvision.com>
-
-HOWTO/FAQ mostly compiled from PoPToP help pages and the PoPToP Mailing List
-(hosted by Christopher Schulte) by Matthew Ramsay. Large contributions from
-Steve Rhodes and Michael Walter.
-
-
-Contents
---------
-1.0 Introduction
- 1.1 About PoPToP
- 1.2 Credits
-2.0 System Requirements
-3.0 PPP with MSCHAPv2/MPPE Installation
-4.0 PoPToP Installation
-5.0 Windows Client Setup
-6.0 FAQ
-
-
-1.0 Introduction
-----------------
-1.1 About PoPToP
-PoPToP is the PPTP Server solution for Linux. PoPToP allows Linux servers to
-function seamlessly in the PPTP VPN environment. This enables administrators
-to leverage the considerable benefits of both Microsoft and Linux. The
-current pre-release version supports Windows 95/98/NT/2000 PPTP clients and
-PPTP Linux clients. PoPToP is free GNU software.
-
-PoPToP Home Page: http://www.moretonbay.com/vpn/pptp.html
-
-1.2 Credits
-PoPToP was originally started by Matthew Ramsay under the control of
-Moreton Bay Ventures (http://www.moretonbay.com). Around March 1999 PoPToP
-was publically released under the GNU GPL by Moreton Bay/Lineo.
-
-PoPToP is what it is today due to the help of a number of intelligent and
-experienced hackers. More specifically Kevin Thayer, David Luyer and
-Peter Galbavy.
-
-More contributors to PoPToP (in various forms) include Allan Clark, Seth
-Vidal, Harald Vogt and Ron O'Hara.
-
-And finally, credit to all the PoPToP followers who test and report
-problems.
-
-1.3 PopToP migrating from poptop.lineo.com
-March 18, 2002
-
-The main PoPToP developers left Lineo with the SnapGear spin-out. The ball
-is being picked up by Daniel Djamludin. PoPToP has been actively developed
-within SnapGear and a number of improvements need to be rolled out.
-
-Henceforth from this sentence onwards you should refer to "PoPToP" as
-"Poptop" for ease of use and typing.
-
-Lineo have been asked to forward poptop.lineo.com to poptop.sourceforge.net
-
-The sources are being gathered to go into CVS, new binaries and dev images will follow.
-
-Source Forge looks like the best neutral ground to smooth out future upheavals.
-
-
-2.0 System Requirements
------------------------
-1. A modern Linux distribution (such as Debian, Red Hat, etc.) with a recent
- kernel (2.4.x recommended, 2.2.x should be ok). Note: ports exist for
- Solaris, BSD and others but are not supported in this HOWTO at this
- time.
-2. PPP (2.4.1 recommended, 2.3.11 should be ok)
- (and the MSCHAPv2/MPPE patch if you want enhanced Microsoft
- compatible authentication and encryption).
-3. PoPToP v1.1.3 (or download the latest release at:
- http://sourceforge.net/projects/poptop
-
-
-3.0 PoPToP Installation
------------------------
-Check out the documentation at http://sourceforge.net/docman/?group_id=44827
-
-
-4.0 Windows Client Setup
-------------------------
-
-Install it using the add-remove programs tool. Go to windows->communications
-and install VPN support.
-
-(If you do above you may *not* need to follow the instructions below as it
-will already be installed... ?
-
-follow the instructions:
-
- 1.start->settings->control panel->network
- 2.Click add
- 3.choose adapter
- 4.Click add
- 5.select microsoft as the Manufactuarer
- 6.select Microsoft Virtual Private Networking Adapter
- 7.Click ok
- 8.Insert any necessary disks
- 9.Reboot your Machine
-
-take a little nap here...
-
-Once your Machine is back
-
- 1.go to dial-up networking (usually start->programs->Accessories->communications->Dial-up Networking) YMMV
- 2.Click make new connection
- 3.Name the Connection whatever you'd like.
- 4.Select Microsoft VPN adapter as the device
- 5.click next
- 6.type in the ip address or hostname of your pptp server
- 7.click next
- 8.click finish
- 9.Right-click on the intranet icon
- 10.select properties
- 11.choose server types
- 12.check require encrypted password
- 13.uncheck netbeui, ipx/spx compatible
- 14.click tcp/ip settings
- 15.turn off use IP header compression
- 16.turn off use default gw on remote network
- 17.click ok.
- 18.start that connection
- 19.type in your username and pw (yadda, yadda, yadda)
- 20.once it finishes its connection your up.
-
-
-Note that the Win95 routine is similar but requires Dial Up Networking Update 1.3 (free from Microsoft) to be installed first.
-
-
-5.0 FAQ
--------
-
-Q&A.
-INTRODUCTION
-
-After spending the better part of two weeks developing my configuration
-for a pptp sever for remote file access by Windows(tm) clients, I
-thought I would pass along these notes to those who may be interested.
-
-The basic configuration involves a Samba/PoPToP server behind a
-firewall, through which clients using Win98 machines will connect using
-the VPN facility built into that OS. This is diagrammed below.
-
- _____ ___ ______ ______
-| | | \ | fire | | file |
-| win | ---> / net \ ---> | wall | ---> | srvr |
-|_____| \__/\_/ |______| |______|
-
-
-The components of the system consist of the Win98 clients running the
-built-in VPN facility dialing in to their ISP's and connecting through
-the firewall to the Samba server on the internal network using the pptp
-protocol. The firewall uses Network Address Translation to convert an
-open Internet IP address to an internal one. Sounds simple enough
-right?
-
-SIMPLE TEST SETUP
-
-As a starting point, I configured a Win98 box to connect directly to a
-PoPToP server without any authentication or encryption. This was just
-to get a feel for how pptp works and verify the setup. Using the
-pre-packaged rpm's was a big help here. You just rpm the thing onto the
-system and fire it up, and you're in business. The diagram below
-represents this simple system.
-
-
- 192.168.56.142 192.168.56.11
- _____ ______
- | | | file |
- | win | ------------------> | srvr |
- |_____| |______|
-
-Emboldend by my success, I set out to turn on MS authentication and
-encrytion, and this is where the fun started.
-
-AUTHENTICATION AND ENCRYPTION
-
-This is an area where Microsoft really shows its true colors. Turning
-on password and data encryption on the Win98 VPN server configuration
-was quite the eye opening experience. First with the authentication,
-you will have to go through a somewhat difficult compilation of the
-ppp-2.3.8 package. The worst part here is getting all the pieces
-together, namely the rc4 files. This process is well documented in this
-archive, so I won't go into it here.
-
-The next realization is that Microsoft prepends the domain name to the
-user name when submitting the login credentials. For example, srhodes is
-now DBNET\\srhodes. If that wasn't bad enough, I found that the domain
-wasn't even the one I was logged into. My best guess is that the first
-domain that the computer ever logs into is stuck with it for ever. This
-is a real problem if you have multiple domains that you log into. I
-modified the pppd.c code to strip out the domain on MSCHAP logins, but
-you can just set the user name in chap-secrets to match the windows
-version.
-
-Then I spent a whole day trying to figure out why data encryption does
-not work. I tried just about everything I could think of that could be
-wrong. That's when I discovered this archive, for which I am truly
-grateful. It turns out that the Win9x implementation of encrytpion is
-FUBAR! You have to download one of those patches from Microsoft,
-MSDUN 1.4 to get the thing to work.
-
-Windows 95
-http://download.microsoft.com/download/win95/Update/17648/W95/EN-US/dun14-95.exe
-
-Windows 98
-http://download.microsoft.com/download/win98/Update/17648/W98/EN-US/dun14-98.exe
-
-Windows 98se
-http://download.microsoft.com/download/win98SE/Update/17648/W98/EN-US/dun14-SE.exe
-
-
-FIREWALL CONFIGURATION
-
-The issue with a firewall in this setup is that you need to cover two
-types of protocol communication. There is one connection which is a tcp
-connection on port 1723 that handles the control functions and another
-connection using IP type 47, or GRE, which handles the actual data
-communication. This second connection presents a problem for the
-convention linux firewall, ipfwadm. You see, its only set up to handle
-tcp, udp and icmp protocols. It doesn't know about GRE.
-
-The trick around this block is to use one of the new 2.2 kernels, which
-employ a new firewall called ipchains. This tool willl handle arbitrary
-protocols, which can be specified by their numbers.
-
-
- 192.168.2.142 192.168.56.11
- _____ ______ ______
- | | | fire | 192.168.56.1 | file |
- | win | --------------->| wall | --------------> | srvr |
- |_____| 192.168.2.1 |______| |______|
-
-
-
-You need to remember a few things before getting too deep into this.
-The default gateway on win is set to 192.168.2.1, and the default
-gateway on file srvr is set to 192.168.56.1. The firewall has the two
-network interfaces spanning the two subnets and is configured for
-IP forwarding. If you have not yet applied any firewall rules, this
-configuration will work as before. The interesing part is to block out
-all other access to file srvr by implementing ipchains rules.
-
-The short story is:
-
-ipchains -F
-ipchains -P forward DENY
-ipchains -I forward -p tcp -d 192.168.56.11 1723 -j ACCEPT
-ipchains -A forward -p tcp -s 192.168.56.11 1723 -j ACCEPT
-ipchains -A forward -p 47 -d 192.168.56.11 -j ACCEPT
-ipchains -A forward -p 47 -s 192.168.56.11 -j ACCEPT
-
-
-NETWORK ADDRESS TRANSLATION
-
-The next hurdle is to configure the firewall so that it can run an open
-internet IP address on the outside and allow access to an internal
-address on the inside. NAT is very well suited to this task, although
-you may hear otherwise from knowledgable sources. It happens to be my
-preference, though certainly not the only way to skin this cat. You can
-obtain the NAT software and some detailed information from
-
-http://www.csn.tu-chemnitz.de/HyperNews/get/linux-ip-nat.html
-
-But again, there is a problem with the GRE protocol of type 47. The
-tool for configuring NAT, ipnatadm, like its half-brother ipfwadm, is
-not set up to handle arbitrary protocols. Unfortunately, you'll have to
-go into the code and make a slight modification if you want to use it
-for this purpose. There is a procedure called parse_protocol in the
-file routines.c that discriminates the type of protocol to be filtered.
-The basic idea is to accept a string representing a number and use that
-as the filter. Since you have to recompile the kernel anyway to get the
-NAT functionality, maybe it's not so horrible, relatively speaking.
-
-For those ambitous enough, here is the diff for the routines file, copy
-this into a file called routines.diff and use the command patch -p0 <
-routines.diff from within the same directory.
-
-
---- routines.c Thu Mar 25 15:41:58 1999
-+++ /mnt/zip/nat/routines.c Wed Jul 21 21:09:28 1999
-@@ -112,11 +112,18 @@
- else if (strncmp("icmp", s, strlen(s)) == 0)
- nat_set.nat.protocol = IPPROTO_ICMP;
- else {
-+ int number;
-+ char * end;
-+ number = (int)strtol(s, &end, 10);
-+ nat_set.nat.protocol = number;
-+ }
-+ /*
-+ else {
- fprintf(stderr, "ipnatadm: invalid protocol \"%s\"
-specified\n", s);
- exit_tryhelp(2);
-- /* make the compiler happy... */
- return;
- }
-+ */
- }
-
- void parse_hostnetworkmask(char *name, struct in_addr **addrpp, __u32
-*maskp, int *naddrs)
-
-
-
-The patch is actually lifted from ipchains, which was derived from
-ipfwadm, which provides the basis for ipnatadm.
-
-Once you've got all that running, what you want to do is to set up the
-NAT rules so that the incoming client thinks its talking to the
-firewall, as does the outgoing file server. The short of it is:
-
-ipnatadm -F
-ipnatadm -I -i -P 6 -D 192.168.2.1 1723 -N 192.168.56.11 1723
-ipnatadm -O -i -P 6 -S 192.168.56.11 1723 -M 192.168.2.1 1723
-ipnatadm -I -i -P 47 -D 192.168.2.1 -N 192.168.56.11
-ipnatadm -O -i -P 47 -S 192.168.56.11 -M 192.168.2.1
-
-
-Here, the -P argument sets the protocol, 6 is tcp and 47 is GRE.
-PPTP packets targeting the firewall are translated to the internal host
-inbound and vice-versa on the way out. Very slick.
-
-SAMBA
-
-Here's a subject so complex you could probably devote a whole career to
-it. We don't want to get too bogged down, so I'll be brief. Samba
-implements the NetBIOS protocol, which has more quirks than you can
-shake a stick at. One of the biggest problems is the use of subnet
-broadcasting. Suffice it to say, if you want the best results, you
-should set your PoPToP IP addresses to reside within the subnet on which
-the file server ethernet is located. I choose 192.168.56.12 for the
-server address, and it hands out IP's from 192.168.13-127.
-Setting the IP forwarding on the file server to true will give you
-access to other machines on the internal network.
-
-When you go at the samba sever from Win98, you have to use encrypted
-password. Look at smbpasswd and related stuff.
-
-Finding shares on the server is not so easy. The short story here is
-that browsing is implemented via broadcast packets, and broadcast
-packets will not travel down a PPP link. The only way to get browsing
-to work over pptp is to set Samba up as a WINS server and a Domain login
-server, and configure the clients to use that WINS server and force them
-to login to that Domain. Believe me, I tried just about everything to
-avoid that. You will also want to set the samba server as the domain
-master and preferred master for the browsing.
-
-If you can't do that, you can set the ppp/options file to include a
-ms-wins setting for the samba server. This will set the client up so
-they can at least resolve host names. The only way to find a share
-under this configuration is to name it explicitly. You can use the
-tools menu from the Win98 file browser and say find -> computer and
-enter in the name of the samba server and it will be found. I have
-found that setting domain master = yes and preferred master = yes gives
-a rather nice boost to the speed of name lookups on the network.
-
-Here is my abbreviated smb.conf
-
-[global]
- workgroup = VAULT
- server string = acer
- log file = /var/log/samba/log.%m
- max log size = 50
- security = user
- encrypt passwords = yes
- smb passwd file = /etc/smbpasswd
- socket options = TCP_NODELAY
- domain master = yes
- preferred master = yes
- domain logons = yes
- wins support = yes
- dns proxy = no
-[homes]
- comment = Home Directories
- browseable = no
- writable = yes
-
-You should also use the lmhosts option for nmbd (-H) and set up an
-lmhosts file on the samba server. Make sure also the the samba server
-can resolve its own name, through either /etc/hosts or DNS.
-
-In all honesty , I went through the same simple test setup with samba as
-I did for PoPToP, although its not shown here explicitly.
-
-CONCLUSION
-
-PoPToP is a good program, as is Samba. This configuration can work if
-you put a little effort into it. I have seen a lot of questions here
-and in other places about these types of systems, so I would think that
-there is some demand on the part of users who want this type of
-functionality. I hope these notes are useful to you if this is what you
-want to do.
-
-****************************************************************************
-Q&A
-I have a pptp server set up on my office LAN. I can connect to the
-server and ping to it fine, but I can't ping any other hosts on the
-office subnet. I have ip-forwarding turned on and I have proxyarp set
-in the ppp/options file. What can be wrong?
-
-There seem to be a lot of questions floating around about routing and
-masq'ing associated with this issue.
-
-Well, my curiosity got the best of me, so I thought I would check this
-out. Shown below is my test setup for investigating this problem.
-
-
-192.168.8.142 192.168.56.10 192.168.56.11 192.168.56.12
- ________ _______ ______ _____
-| | | | | | | |
-| client |------->| fire |-------->| pptp |----->| host |
-| | | wall | | srvr | | |
-|________| |_______| |______| |______|
- H H
- H 192.168.8.10 H
- H H
- H===================================H
-192.168.5.12 pptp connection 192.168.5.11
-
-
-For the sake of simplicity, we will ignore address translation issues
-associated with the firewall. This assumes that the client at
-192.168.8.142 is going to use 192.168.56.11 as its target address for
-the pptp connection to pptp_srvr. The firewall will block all access to
-
-the 192.168.56.0 subnet except for pptp connections associated with
-pptp_srvr. This can be implemented with ipchains
-
-ipchains -P input DENY
-ipchains -P forward DENY
-ipchains -A input 192.168.56.0/24 -j ACCEPT /* allow connections from
-
-inside */
-ipchains -A input -p tcp -d 192.168.56.11 1723 -j ACCEPT
-ipchains -A input -p 47 -d 192.168.56.11 -j ACCEPT
-ipchains -A forward -p tcp -d 192.168.56.11 1723 -j ACCEPT
-ipchains -A forward -p tcp -s 192.168.56.11 1723 -j ACCEPT
-ipchains -A forward -p 47 -d 192.168.56.11 -j ACCEPT
-ipchains -A forward -p 47 -s 192.168.56.11 -j ACCEPT
-
-When you connect from client to pptp_srvr, you will be able to complete
-the connection and ping to pptp_srvr. However, if you attempt to ping
-host, at 192.168.56.12, this will fail.
-
-A clue to this problem can be found in the /var/tmp/messages file on
-pptp_srvr. There, in the pppd messages, you will find
-
-Cannot determine ethernet address for proxy ARP
-
-This is due to an issue with the pppd program, which attempts to find a
-hardware interface on the subnet to which the pppd client has been
-assigned. In this case its looking for a hardware interface on the
-192.168.5.0 subnet. It will fail to find one, and will drop the
-proxyarp request.
-
-The simplest way around this problem, and the one that is suggested in
-the pppd documentation, is to set the pppd client IP assignment to be on
-
-the local subnet. An example in this case might be 192.168.56.129.
-However, it may not be possible to do that. In the case of a fully
-loaded subnet, there may not be any addresses to spare. Or there may be
-
-some security issues with giving out local subnet addresses. What to
-do?
-
-The place to look is in the arp table. If you run tcpdump on host
-(192.168.56.12) during the time when client is pinging, you will see
-unanswered arp requests from host attempting to find the hardware
-address for 192.168.5.12. You need to proxy the hardware address of the
-
-pptp_srvr for client in order for this request to be fulfilled. This is
-
-the job of proxyarp. However, proxyarp has let us down in this
-instance, and we need to find a workaround.
-
-This can be done manually using the arp command on pptp_srvr. For
-example, if the hardware address of the ethernet card on pptp_srvr is
-00:60:08:98:14:14, you could force the arp to proxy the client pptp
-address by saying
-
-arp --set 192.168.5.12 00:60:08:98:14:13 pub
-
-You should now be able to ping from client to host through the pptp
-connection.
-
-This can be a problem, however, in a dynamic environment when clients
-are logging into and out of the pptp server on a continuous basis. One
-way around this problem is to write a script that will execute upon the
-initiation of each ppp connection.
-
-The place to do this is in /etc/ppp/ip-up. This script is executed each
-
-time a new ppp connection is started. It gets some variables passed
-into it, one of which is the assigned IP address of the client. Note
-that RedHat systems use ip-up.local as the place for you to make the
-script. Don't forget to chmod +x !
-
-
-#! /bin/bash
-
-REMOTE_IP_ADDRESS=$5
-
-date > /var/run/ppp.up
-echo "REMOTE_IP_ADDRESS = " $REMOTE_IP_ADDRESS >> /var/run/ppp.up
-arp --set $REMOTE_IP_ADDRESS 00:60:08:98:14:14 pub >> /var/run/ppp.up
-
-exit 0
-
-
-This should put you in business for accessing the remote subnet under
-this scenario. I am a little bit concerned, however, because I also
-built a script ip-down.local, that should remove the arp proxy when
-client disconnected. It doesn't seem to do anything, however, and if I
-try to delete the arp entry manually, it just spits out a cryptic error
-message. The arp entries remain persistent, as far as I can tell. If
-this is a problem or not, I don't know. The next few clients that log
-in are treated well, so I guess its OK.
-
-****************************************************************************
-Q.
-Also, after running pptpd and monitoring its log file and seeing that it
-failed to open ttyp1 - I chmod +rw /dev/ttyp[0-9] and it seemed to work
-somewhat. But, after I rebooted, I had to do this again. Is this normal?
-
-A.
-pptpd should be running as root (unless you have a system with a setuid
-openpty() helper, which isn't very common). If it fails to open a pty/tty
-pair as root then that is probably because it is in use.
-
-Other programs which use pty/tty's will change their permissions back to
-the standard ones.
-
-****************************************************************************
-Q.
-sometimes when I make a connection to my pptpd server I
-see a message like
-
-Jul 2 17:30:03 ape modprobe: can't locate module ppp-compress-21
-Jul 2 17:30:03 ape modprobe: can't locate module ppp-compress-26
-Jul 2 17:30:03 ape modprobe: can't locate module ppp-compress-24
-Jul 2 17:30:03 ape modprobe: can't locate module ppp-compress-21
-Jul 2 17:30:03 ape modprobe: can't locate module ppp-compress-26
-Jul 2 17:30:03 ape modprobe: can't locate module ppp-compress-24
-Jul 2 17:30:03 ape modprobe: can't locate module ppp-compress-26
-Jul 2 17:30:03 ape modprobe: can't locate module ppp-compress-24
-Jul 2 17:30:03 ape modprobe: can't locate module ppp-compress-21
-
-
-in /var/log/messages on the server. Any idea what I
-can do about it?
-
-A.
-yeah, in your /lib/modules/<kernel version>/net/ directory, there should
-be files called bsd_comp.o and ppp_deflate.o.. insmod those files and
-you'll be good to go.
-
-****************************************************************************
-Q.
-Hi, I'm having trouble getting pptpd & mschap-v2 to work. I downloaded
-all of the patches and compiled everything but whenever i try to connect
-from my win98 machine, it says:
-
-Error 691: The computer you have dialed in to has denied access because
-the username and/or password is invalid on the domain.
-
-What is this suppose to mean?
-
-A.
-Error 691 is an authentication problem probably due to the fact that MS
-chap uses the domain name and username combo to authenticate. If you
-look at the logs you will probably see a message saying that MS chap is
-trying to authenticate user "domain\\username". I got it to work by
-putting the full domain and user string in the client portion of the
-chap-secrets file.
-
-# Secrets for authentication using CHAP
-# client server secret IP
-addresses
-workgroup\\user server password *
-
-If anyone knows how to get it to default to a particular domain, I would
-like to know.
-
-****************************************************************************
-Q.
-how do I go about checking who is logged in via tunnel?
-
-I need some way of writing the pppd data to wtmp/utmp.
-(and not sessreg either)
-
-does anyone know of any way of doing this via ppp?
-
-A.
-pppd syslogs everything to /var/log/messages (that's the default on my box
-anyways) and it will say something like :
-pppd[15450]: CHAP peer authentication succeeded for <username>
-
-you could do a tail /var/log/messages -n2000 | grep CHAP if you wanted to
-see who has been logging in.
-
-other than that, there's not much i know of. all the authentication is
-provided by pppd (if you don't have an auth or a require-chap (or pap, etc.)
-option, it doesn't even ask for a username.
-
-****************************************************************************
-Q.
-My NT client won't connect!
-
-A.
-Try taking header and software compression off.
-
-
-****************************************************************************
-Q. PPTP *client* stops working.
-
-A.
-go to /var/run/pptp/ and look for a socket named x.x.x.x
-delete it and try it again.
-
-****************************************************************************
-Q.
-How many clients does PoPToP support?
-
-A.
-The limits under Linux are:
-
- per-process filedescriptors
- - one per client (would limit clients to 256 by default,
- or 1024 with kernel recompile, or more with major libc/kernel
- hackery)
- - no relevant limit
-
- ttys - currently, with a standard kernel, 256 clients
- - with Unix98 ptys and a small amount of coding, 2048
-
- ppp devices
- - no limit in kernel source for ppp
- - limit of 100 in dev_alloc_name() in 2.2.x
-
- for(i=0;i<100;i++)
- {
- sprintf(dev->name,name,i);
- if(dev_get(dev->name)==NULL)
- return i;
- }
-
- best fix is probably to keep a static int ppp_maxdev so you
- don't end up doing 2000 dev_get's to allocated the 2001'th
- device.
-
- processes
- - 2 per client plus system processes
- - standard kernel max = 512 processes, ie 256 clients
- - i386 max = 4096 processes, ie 2048 clients
-
-So it seems that 2048 will be the limit, if you fix a few things and
-with a minor kernel mod (I could do all of these pretty easily and send
-you a trivial kernel patch). To go above 2048 the easiest approach would
-be to combine pptpctrl and pppd in one process, which would get you to
-4096. Beyond there, you need to go for a select() based model, which would
-be significant coding effort and require large fd-set sizes and so on.
-So 4096 is the practical limit, and 2048 the easy limit.
-
-****************************************************************************
-Q.
-What authentication methods (PAP/CHAP) does PoPToP work with?
-
-A.
-PoPToP uses whatever authentication methods your PPPd provides (usually
-PAP and CHAP). With PPPd patches you can get MSCHAP and MSCHAPv2
-authentication as well.
-
-****************************************************************************
-Q.
-When running PoPToP I get the following error:
-
- Jun 11 08:29:04 server pptpd[4875]: MGR: No more free connection slots!
-
-What does this mean?
-
-A.
-I'd say at a guess you've only configured one IP address and you have
-connected a client, and as such there are no more free connection slots should
-any more clients wish to connect.
-
-****************************************************************************
-Q.
-Does PoPToP suffer from the same security flaws
-(http://www.counterpane.com/pptp.html) as the Windows NT PPTP server?
-
-A.
-An initial look at the article suggests that what the authors hammered was
-not the PPTP protocol, but the authentication that the PPTP VPN servers on
-NT offered access to via open internet. PPTP seems initially to be just
-the path to the weakness, not the weakness itself. Part of their
-observance of weakness deals with use of poor passwords as well, a cheap
-component, simple enough to fix.
-
-> While no flaws were found in PPTP itself, several serious flaws were
-> found in the Microsoft implementation of it.
-> (http://www.counterpane.com/pptp-pressrel.html)
-
-The authors do not specifically say "this is ONLY effective against NT",
-just that NT is affected. This implies that they do not recognize PoPToP,
-and it may be included. The fact that PoPToP has to interOp with MS DUN's
-VPN client means that it will have the same weaknesses. It can only
-protect itself from DoS attacks, have immediate response to out-of-sequence
-packets or illogical packets, etc.
-
-The protocol is not considered weak in this analysis, but the weaknesses
-have to be replicated in apparent behavior by PoPToP. The only thing the
-developers can do with PoPToP is make it a stronger server per se -- more
-able to handle the attacks when the come.
-
-In conclusion: PoPToP suffers the same security vulnerabilities as the NT
-sever (this is because it operates with Windows clients).
-
-Update: MSCHAPv2 has been released and addresses some of the security
-issues. PoPToP works with MSCHAPv2.
-
-****************************************************************************
-Q.
-Does PoPToP support data encryption?
-
-A.
-Yes.. with appropriate PPPd patches. Patches are available for PPPd to
-provide Microsoft compatible RC4 data encryption. The PPPd patch supports
-40 and 128 bit RC4 encryption.
-
-****************************************************************************
-Q.
-PoPToP or IPsec? Which is better suited to my needs?
-
-A.
-1. The difference between PoPToP and IPsec is that PoPToP is ready NOW..
-and requires *no* third party software on the Windows client end
-(Windows comes with a free PPTP client that is trivial to set up).
-
-2. PoPToP is a completely *free* solution.
-Update: Unfortunately not true for Mac *clients* though. The Mac client
-software is around $400 US a copy.
-
-3. PoPToP can be integrated with the latest PPPD patches that take
-advantage of MSCHAPv2 and MPPE (Microsoft encryption using RC4 - 40/128
-bits).
-
-More details follow from Emir Toktar:
-(Refs: A Comprehensive Guide to Virtual Private Networks, IBM.
-Virtual Private Networking: An Overview White Paper - DRAFT, 3/18/98
-Microsoft.)
-
-Neither network layer-based (L2TP, PPTP,...) nor application layer-based
-(IPSec,SSL,SSH) security techniques are the best choice for all
-situations. There will be trade-offs. Network layer security protects the
-information created by upper layer protocols, but it requires that IPSec
-be implemented in the communications stack.
-
-With network layer security, there is no need to modify existing upper
-layer applications. On the other hand, if security features are already
-imbedded within a given application, then the data for that specific
-application will be protected while it is in transit, even in the absence
-of network layer security. Therefore security functions must be imbedded
-on a per-application basis.
-
-There are still other considerations:
-Authentication is provided only for the identity of tunnel endpoints, but
-not for each individual packet that flows inside the tunnel. This can
-expose the tunnel to man-in-the-middle and spoofing attacks.
-
-Network layer security gives blanket protection, but this may not be as
-fine-grained as would be desired for a given application. It protects
-all traffic and is transparent to users and applications.
-
-Network layer security does not provide protection once the datagram has
-arrived at its destination host. That is, it is vulnerable to attack
-within the upper layers of the protocol stack at the destination machine.
-
-Application layer security can protect the information that has been
-generated within the upper layers of the stack, but it offers no
-protection against several common network layer attacks while the
-datagram is in transit. For example, a datagram in transit would be
-vulnerable to spoofing attacks against its source or destination address.
-
-Application layer security is more intelligent (as it knows the
-application) but also more complex and slower.
-
-IPSec provides for tunnel authentication, while PPTP does not.
-
-<User Authentication> Layer 2 tunneling protocols inherit the user
-authentication schemes of PPP, including the EAP methods discussed below.
-Many Layer 3 tunneling schemes assume that the endpoints were well
-known (and authenticated) before the tunnel was established. An exception
-to this is IPSec ISAKMP negotiation, which provides mutual authentication
-of the tunnel endpoints. (Note that most IPSec implementations support
-machine-based certificates only, rather than user certificates. As a
-result, any user with access to one of the endpoint machines can use
-the tunnel. This potential security weakness can be eliminated when
-IPSec is paired with a Layer 2 protocol such as L2TP.
-
-<Token card support> Using the Extensible Authentication Protocol
-(EAP), Layer 2 tunneling protocols can support a wide variety of
-authentication methods, including one-time passwords, cryptographic
-calculators, and smart cards. Layer 3 tunneling protocols (IPSec) can
-use similar methods; for example, IPSec defines public key certificate
-authentication in its ISAKMP/Oakley negotiation.
-
-<Dynamic address assignment> Layer 2 tunneling supports dynamic
-assignment of client addresses based on the Network Control Protocol
-(NCP) negotiation mechanism.
-
-Generally, Layer 3 tunneling schemes assume that an address has already
-been assigned prior to initiation of the tunnel. Schemes for assignment
-of addresses in IPSec tunnel mode are currently under development and
-are not yet available.
-
-<Data Compression> Layer 2 tunneling protocols support PPP-based
-compression schemes. For example, the Microsoft implementations of both
-PPTP and L2TP use Microsoft Point-to-Point Compression (MPPC). The IETF
-is investigating similar mechanisms (such as IP Compression) for the
-Layer 3 tunneling protocols.
-
-<Data Encryption> Layer 2 tunneling protocols support PPP-based data
-encryption mechanisms. Microsoft's implementation of PPTP supports
-optional use of Microsoft Point-to-Point Encryption (MPPE), based on
-the RSA/RC4 algorithm. Layer 3 tunneling protocols can use similar
-methods; for example, IPSec defines several optional data encryption
-methods which are negotiated during the ISAKMP/Oakley exchange.
-
-<Key Management> MPPE, a Layer 2 protocol, relies on the initial key
-generated during user authentication, and then refreshes it
-periodically. IPSec, explicitly negotiates a common key during the
-ISAKMP exchange, and also refreshes it periodically.
-
-<Multi-protocol support> Layer 2 tunneling supports multiple payload
-protocols, which makes it easy for tunneling clients to access their
-corporate networks using IP, IPX, NetBEUI, and so forth. In contrast,
-Layer 3 tunneling protocols, such as IPSec tunnel mode, typically
-support only target networks that use the IP protocol. IPSec is not
-multi-protocol.
-
-IPSec will be suported by Windows 2000.
-
-Many cases can occur, each of which needs to be examined on its own
-merit. It may be desirable to employ a mix of both network layer
-security techniques and application layer techniques to achieve the
-desired overall level of protection. For example, you could use an upper
-layer mechanism such as Secure Sockets Layer (SSL) to encrypt upper
-layer data. SSL could then be supplemented with IPSec's AH protocol at
-the network layer to provide per-packet data origin authentication and
-protection against spoofing attacks.
-
-****************************************************************************
-Q.
-I get a 'createHostSocket: Address already in use' error! what gives?
-
-A.
-Address already in use in createHostSocket means something is already using
-TCP port 1723 - maybe another pptp daemon is running?
-
-****************************************************************************
-Q.
-Does PoPToP work with Windows 2000 clients?
-
-A.
-PoPToP v0.9.5 and above should work with Windows 2000 clients.
-
-****************************************************************************
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/CVS/Entries b/pptpd-1.3.3/html/poptop_ads_howto/CVS/Entries
deleted file mode 100644
index 43e96a3..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/CVS/Entries
+++ /dev/null
@@ -1,15 +0,0 @@
-/diagram1.jpg/1.1/Tue Oct 25 03:08:14 2005//
-/poptop_ads_howto_2.htm/1.1/Tue Oct 25 03:08:14 2005//
-/poptop_ads_howto_3.htm/1.2/Thu Jan 5 00:21:15 2006//
-/poptop_ads_howto_5.htm/1.2/Thu Jan 5 00:21:15 2006//
-/poptop_ads_howto_9.htm/1.2/Thu Jan 5 00:21:15 2006//
-/poptop_ads_howto_11.htm/1.3/Tue Feb 14 00:15:52 2006//
-/poptop_ads_howto_12.htm/1.2/Tue Feb 14 00:15:52 2006//
-/poptop_ads_howto_8.htm/1.3/Tue Feb 14 00:15:52 2006//
-/poptop_ads_howto_1.htm/1.7/Tue Apr 18 03:02:30 2006//
-/poptop_ads_howto_10.htm/1.2/Tue Apr 18 03:02:31 2006//
-/poptop_ads_howto_4.htm/1.7/Tue Apr 18 03:02:31 2006//
-/poptop_ads_howto_6.htm/1.4/Tue Apr 18 03:02:31 2006//
-/poptop_ads_howto_7.htm/1.2/Tue Apr 18 03:02:31 2006//
-/test.txt/1.1/Tue Apr 18 03:02:31 2006//
-D
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/CVS/Repository b/pptpd-1.3.3/html/poptop_ads_howto/CVS/Repository
deleted file mode 100644
index c7b8123..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-poptop/html/poptop_ads_howto
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/CVS/Root b/pptpd-1.3.3/html/poptop_ads_howto/CVS/Root
deleted file mode 100644
index 6f952a5..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:ext:quozl@poptop.cvs.sourceforge.net:/cvsroot/poptop
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/diagram1.jpg b/pptpd-1.3.3/html/poptop_ads_howto/diagram1.jpg
deleted file mode 100644
index 16490fc..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/diagram1.jpg
+++ /dev/null
Binary files differ
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_1.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_1.htm
deleted file mode 100644
index 2a5a969..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_1.htm
+++ /dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<h3>PopTop + MSCHAPv2 + Samba + Radius + Microsoft Active Directory + Fedora Howto</h3>
-<p align="left">Copyright &copy; 2005 Wing S Kwok </p>
-<p align="right">by: Wing S Kwok<br>
- email: skwok (at) acnielsen.com.au </p>
-<p align="left"><strong>Revision History</strong>:</p>
-<dl>
- <dt>Release 0.8 - 5 March 2006</dt>
- <dd>- Updated information on pptpd, samba version</dd>
- <dd>- Updated information on FC4 kernel version</dd>
- <dd>- Added info on changing MTU size</dd>
- <br>
- <dt>Release 0.71 - 3 February 2006</dt>
- <dd>- Problem with kernel 2.6.15 and ppp-2.4.3-5 is Gentoo specific. Corrected the document.</dd>
- <br>
- <dt>Release 0.7 -- 1 February 2006</dt>
- <dd>- Section 12.2 has been rewritten.</dd>
- <dd>- Updated information on Samba version.</dd>
- <dd>- Provided a link to information on problem with kernel 2.6.15 and ppp-2.4.3-5</dd>
- <br>
- <dt>Release 0.6 -- 5 January 2006</dt>
- <dd>- Added a new section on pptp server administration.</dd>
- <dd>- Updated information on Samba version. </dd>
- <br>
- <dt>Release 0.5 -- 17 November 2005</dt>
- <dd>- Included info on kernel 2.6.15-rc1 and MPPE support</dd><br>
- <dt>Release 0.4 -- 30 October 2005</dt>
- <dd>- Updated kernel-ppp-mppe version number</dd><br>
- <dt>Release 0.3 -- 23 October 2005</dt>
- <dd>- added the Acknowledgements section</dd>
- <dd>- added information on problem with FC4 2.6.13 kernel and mppe kernel module </dd>
- <dd>- added information on kernel upgrade and dkms_autoinstaller</dd>
- <dd>- added information on pptp access control</dd>
- <dd>- updated the software version info to reflect the latest available version</dd><br>
- <dt>Release 0.2 -- 23 September 2005</dt>
- <dd>- Rewrote part of the pptp client configuration section and included split tunneling information.</dd><br>
- <dt>Release 0.1 -- 12 September 2005</dt>
- <dd>- added Kerberos version information</dd>
- <dd>- added the full path of winbindd_privileged directory</dd>
- <dd>- fixed the VBScript which had a few lines missing</dd>
- <dd>- corrected a few typos </dd>
-</dl>
-<dl>
- <dt>First Release -- 5 September 2005</dt>
-</dl>
-<p align="left">This document covers how to integrate Poptop with Microsoft Active Directory on Fedora Core 4. Two different implementations are described: a) winbind; and b) freeradius.</p>
-<hr>
-<a name="toc"></a>Table of Contents
-<dl><dt>1. <a href="#introduction">Introduction</a></dt>
- <dt>2. <a href="#disclaimer">Disclaimer</a></dt>
- <dt>3. <a href="#acknowledgement">Acknowledgements</a></dt>
- <dt>4. <a href="poptop_ads_howto_2.htm">The Test Environment</a></dt>
- <dt>5. <a href="poptop_ads_howto_3.htm#network">Network Configuration</a></dt>
- <dd>5.1 <a href="poptop_ads_howto_3.htm#defaultroute">Default Route and Static Routes</a></dd>
- <dd>5.2 <a href="poptop_ads_howto_3.htm#pforward">Enable Packet Forwarding</a></dd>
- <dt>6. <a href="poptop_ads_howto_4.htm#mppe">Install MPPE Kernel Module</a></dt>
- <dd>6.1 <a href="poptop_ads_howto_4.htm#autoinstaller">Kernel Upgrade and dkms_autoinstaller</a></dd>
- <dt>7. <a href="poptop_ads_howto_4.htm#pppd_pptpd">pppd and pptpd</a></dt>
- <dd>7.1 <a href="poptop_ads_howto_4.htm#pppd">Upgrade pppd</a></dd>
- <dd>7.2 <a href="poptop_ads_howto_4.htm#pptpd">Install pptpd</a></dd>
- <dt>8. <a href="poptop_ads_howto_5.htm">Kerberos</a></dt>
- <dd>8.1 <a href="poptop_ads_howto_5.htm#krbconf">Configure Kerberos</a></dd>
- <dd>8.2 <a href="poptop_ads_howto_5.htm#krbtest">Test Kerberos</a></dd>
- <dt>9. <a href="poptop_ads_howto_6.htm">Samba</a></dt>
- <dd>9.1 <a href="poptop_ads_howto_6.htm#smbconf">Configure Samba</a></dd>
- <dd>9.2 <a href="poptop_ads_howto_6.htm#smbjoin">Join the AD Domain</a></dd>
- <dt>10. <a href="poptop_ads_howto_7.htm">pptpd and winbindd</a></dt>
- <dd>10.1 <a href="poptop_ads_howto_7.htm#wbtest">Enable and Test winbindd</a></dd>
- <dd>10.2 <a href="poptop_ads_howto_7.htm#pptpconf">Configure pptpd</a></dd>
- <dd>10.3 <a href="poptop_ads_howto_7.htm#access">PPTP Access Control</a></dd>
- <dt>11. <a href="poptop_ads_howto_8.htm">Software for Radius Setup</a></dt>
- <dt>12. <a href="poptop_ads_howto_8.htm#rclient">Radiusclient</a></dt>
- <dd>12.1 <a href="poptop_ads_howto_8.htm#rclientconf">radiusclient.conf</a></dd>
- <dd>12.2 <a href="poptop_ads_howto_8.htm#dict">dictionary.microsoft</a></dd>
- <dt>13. <a href="poptop_ads_howto_9.htm">Freeradius</a></dt>
- <dd>13.1 <a href="poptop_ads_howto_9.htm#mschap2">Configure Freeradius for MSCHAPv2</a></dd>
- <dd>13.2 <a href="poptop_ads_howto_9.htm#access">PPTP Access Control</a></dd>
- <dt>14 <a href="poptop_ads_howto_10.htm">pptpd and freeradius</a></dt>
- <dd>14.1 <a href="poptop_ads_howto_10.htm#radiusd">Enable freeradius</a></dd>
- <dd>14.2 <a href="poptop_ads_howto_10.htm#pptpdradius">Configure pptpd</a></dd>
- <dt>15. <a href="poptop_ads_howto_11.htm">pptp Client Installation</a></dt>
- <dd>15.1 <a href="poptop_ads_howto_11.htm#splittunnel">Split Tunneling</a></dd>
- <dt>16. <a href="poptop_ads_howto_12.htm">pptp Server Administration </a></dt>
- <dd>16.1 <a href="poptop_ads_howto_12.htm#whoisonline">Who is Online?</a></dd>
- <dd>16.2 <a href="poptop_ads_howto_12.htm#accounting">Accounting</a></dd>
- <dd>16.3 <a href="poptop_ads_howto_12.htm#disconnect">Disconnect a User</a></dd>
-</dl>
-
-<hr>
-<strong><a name="introduction"></a>1. Introduction</strong>
-<p>This document descibes how to build a Linux PPTP server with Poptop and use Microsoft Active Directory to authenticate users. There are a few howtos on this topic, such as the <a href="http://poptop.sourceforge.net/dox/replacing-windows-pptp-with-linux-howto.phtml">Replacing a Windows PPTP Server with Linux Howto</a> maintained by Matt Alexander. Most of them, however, concentrate on Samba and winbind. I followed them and got it working in the test environment. Unfortunately, winbind does not scale very well in a AD setup which has thousands of objects. The AD in my work is a big tree. It spans across all continents and has thousands of users and groups. Winbind simply times out before it can harvest a complete list of users/groups.</p>
-<p align="left">The other way of doing it is with radius. Information on how to setup pptpd with radius against Active Directory is scarce. I can only find bits and pieces information from forums but never find any comprehensive documents. I spent days to try to get it configured properly. After countless frustrations and tears, I eventually got a working setup. I therefore decided to make this howto to document it. Hopefully, you will find it useful.</p>
-<p align="left">To make this howto complete, I include the winbind configuration as well although it may duplicate Matt's work.</p>
-<p align="left"><strong>Note</strong>: this howto is based on Fedora Core 4 and use pre-packaged RPMs whenever possible. If you are using other distributions or like to compile software, you will have to make the necessary adjustments.</p>
-<hr>
-<strong><a name="disclaimer"></a>2. Disclaimer</strong>
-<p>This document is provided as is. I have tried my best to make it as accurate as I can but it may contain wrong information. Use it at your own risk. </p>
-<p>I will greatly appreciate any comments on this document. </p>
-<hr>
-<a name="acknowledgement"></a><strong>3. Acknowledgements
-</strong>
-<p>Thanks to the following individuals who provided feedback and suggestions to make this document better.</p>
-<blockquote>
- <p>Peter Mueller - suggested to add information on Kerberos version (R0.1) <br>
- Francis Lessard - provided details on implementing pptp access control (R0.3)<br>
- James Cameron - provided info on MPPE support on kernel v2.6.15-rc1 (R0.5) <br>
- Phil Oester - pointed out the kernel-2.6.15/ppp-2.4.3-5 problem is Gentoo specific (R0.71) </p>
-</blockquote>
-<hr>
-
-<a href="poptop_ads_howto_2.htm">Next</a>
-&nbsp;&nbsp;<a href="#toc">Content</a>
-
-</body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_10.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_10.htm
deleted file mode 100644
index df14d19..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_10.htm
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><strong>14. pptpd and freeradius </strong></p>
-<p>The section covers the configuration of pptpd + freeradius + AD. If you are looking at the integration via winbind. Go to <a href="poptop_ads_howto_7.htm">this section</a>.</p>
-<hr>
-<a name="radiusd"></a><strong>14.1 Enable freeradius</strong>
-<p>To enable radiusd on bootup, use the chkconfig command.</p>
-<blockquote>
- <pre>[root@pptp ~]# chkconfig radiusd on </pre>
-</blockquote>
-<p>To start radiusd in daemon mode:
-</p>
-<blockquote>
- <pre>[root@pptp ~]# service radiusd start
-Starting RADIUS server: Sun Sep 4 11:26:24 2005 : Info: Starting - reading configuration files ...<br>[ OK ]</pre>
-</blockquote>
-<p></p>
-<hr>
-<a name="pptpdradius"></a><strong>14.2 Configure pptpd </strong>
-<p>There are two configuration files for pptpd. The first one is /etc/pptpd.conf. You can very much keep it as it is except the ip address range for the ppp connections. Edit the file and add two lines at the bottom to specify the local ip address and the ip address pool for the remote connections. </p>
-<blockquote>
- <pre>localip 10.0.0.10<br>remoteip 10.0.0.101-200 </pre>
-</blockquote>
-<p>10.0.0.10 is the ip address of the internal network card eth0. The remoteip is the address pool for the remote connections. </p>
-<p>The second configuration file is /etc/ppp/options.pptpd. I stripped off all remarks from my options.pptpd and it is like this:</p>
-<blockquote>
- <pre>name pptpd
-refuse-pap<br>refuse-chap<br>refuse-mschap<br>require-mschap-v2<br>require-mppe-128
-ms-dns 10.0.0.1
-ms-wins 10.0.0.1
-proxyarp
-lock
-nobsdcomp
-novj
-novjccomp
-nologfd
-auth
-nodefaultroute
-plugin radius.so
-plugin radattr.so</pre>
-</blockquote>
-<p>There are two plugins we used in here. The first one radius.so is required while the second one radattr.so is optional. Radattr.so basically records the parameters passed from radius to pppd in a file. Check the man page of pppd-radattr for details. </p>
-<p>Then, we need to fix the permission of a winbind directory.</p>
-<blockquote>
- <pre>[root@pptp ~]# chgrp radiusd /var/cache/samba/winbindd_privileged/</pre>
-</blockquote>
-<p>If you have Windows XP clients, you may want to reduce the MTU size. Add the line, /sbin/ifconfig $1 mtu 1400, to /etc/ppp/ip-up as shown in the following list.</p>
-<blockquote>
- <pre>[root@pptp ppp]# cat ip-up
-#!/bin/bash
-# This file should not be modified -- make local changes to
-# /etc/ppp/ip-up.local instead
-
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-export PATH
-
-LOGDEVICE=$6
-REALDEVICE=$1
-
-[ -f /etc/sysconfig/network-scripts/ifcfg-${LOGDEVICE} ] && /etc/sysconfig/network-scripts/ifup-post ifcfg-${LOGDEVICE}
-
-/etc/ppp/ip-up.ipv6to4 ${LOGDEVICE}
-
-[ -x /etc/ppp/ip-up.local ] && /etc/ppp/ip-up.local "$@"
-
-<strong>/sbin/ifconfig $1 mtu 1400</strong>
-exit 0</pre>
-</blockquote>
-<p>The above example reduces the MTU size to 1400. In my environment, I found that XP will connect the VPN and ping all servers without problems, however, it cannot connect to the Microsoft Exchange server properly. Reduce the MTU size to 1400 fixed the problem.</p>
-<p>After fixing the files and permission, we can start pptpd and connect to it from remote client. To start it:</p>
-<blockquote>
- <pre>[root@pptp ~]# chkconfig pptpd on<br><br>[root@pptp ~]# service pptpd start<br>Starting pptpd: [ OK ] </pre>
-</blockquote>
-<p>That's all on the server side. </p>
-<p><strong>Note</strong>: The client PCs require special configurations. It will be discussed in <a href="poptop_ads_howto_11.htm">here</a>.</p>
-<hr>
-<a href="poptop_ads_howto_11.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_9.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a>
-<p>&nbsp;</p>
-</body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_11.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_11.htm
deleted file mode 100644
index 868dcc9..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_11.htm
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><strong>15. pptp Client Installation</strong></p>
-<p>I will only describe the Windows XP pptp client installation. For other operating system, please see the documents in <a href="http://poptop.sourceforge.net/dox/">here</a>. </p>
-<ul>
- <li>Start -> Settings -> Control Panels -> Network Connections.</li>
- <li>Click on &quot;Create a new connection&quot; on the left pane. </li>
- <li>A Winzard starts. Click on Next.</li>
- <li>Choose &quot;Connect to the network at my workplace&quot;. Next.</li>
- <li> Choose &quot;Virtual Private Network Connection&quot;. Next.</li>
- <li>Key in the company name. Next.</li>
- <li>Choose &quot;Do not dial the initial connection&quot;. Next</li>
- <li>Type in the external IP address of Hostname of the pptpd gateway. Next.</li>
- <li>Choose &quot;Anyone's use&quot;. Next</li>
- <li>Check the &quot;Add a shortcut to this connection to my desktop&quot;. Finish.</li>
- <li>A new icon appears on the Network Connections under the header Virtual Private Network. Right click on it and choose Properties.</li>
- <li>Click on the Security tab. Check &quot;Advanced (custom settings)&quot; and then click the Settings button.</li>
- <li> Choose &quot;Maximum strength encryption (disconnect if server declines)&quot; on Data Encryption.</li>
- <li>In the same tab, choose &quot;Allow these protocols&quot; and undo all except &quot;Microsoft CHAP Version 2 (MS-CHAP v2)&quot;. Click OK and click OK again to close the window.</li>
-</ul>
-<p>That's all for a standard configuration. All traffic from the PC will pipe through the pptp tunnel except those for the local attached network segment. This is the recommended way of implementing VPN for security reasons.</p>
-<hr>
-<strong><a name="splittunnel"></a>15.1 Split Tunneling</strong>
-<p>Split Tunneling allows you to configure the network so that only selected traffic is directed to the VPN tunnel. For instance, you want browsing traffic to go to the Internet directly but corporate traffic goes via the VPN, then you will need split tunneling. It is also important if your ISP requires a heatbeat from your machine to keep the connection alive. </p>
-<p>While split tunneling provides convenience, it causes security problems because <span name="intelliTxt" id="intelliTxt">it essentially renders the VPN vulnerable to attack as it is accessible through the public, non-secure network. Check your company security policy before inplementing split tunneling. </span></p>
-<p>To set up split tunneling:</p>
-<ul>
- <li>Right click on the icon which you created in section 15 and choose Properties.</li>
- <li>Choose the Networking tab. Highligth the Internet Protocol (TCP/IP) and click on the Properties button.</li>
- <li>Click on the Advanced Button and then deselect &quot;Use default gateway on remote network&quot;. Click OK. Click OK and then click OK.</li>
-</ul>
-<p>If you have a simple private network which has only one single segment, you have finished the configuration. Take a break and enjoy you day.</p>
-<p>If you have multiple subnets in the private network, there are still works to do. By not using the PPP as the default gateway, we introduce another problem. The PPP client will set up routing only to the subnet that is directly attached to the pptp gateway. Traffic will not route to the other subnets. In our test environment, you can only access 10.0.0.0 but not 172.16.0.0. To resolve this problem, I created a VBScript to add the extra routes. </p>
-<p>The VBScript is listed here: </p>
-<blockquote>
- <pre>Option Explicit<br>Dim IP_Address<br>Dim TmpFile : TmpFile = &quot;c:\ip.txt&quot;<br>Dim route1
-
-<strong>route1 = &quot;route add 172.16.0.0 mask 255.255.255.0 &quot;</strong>
-
-SaveIP<br>IP_Address = GetIP()<br>route1 = route1 &amp; IP_Address<br>AddRoute
-
-Sub SaveIP<br> Dim ws : Set ws = CreateObject(&quot;WScript.Shell&quot;)<br> ws.run &quot;%comspec% /c ipconfig &gt; &quot; &amp; TmpFile, 0, True<br> Set ws = Nothing<br>End Sub
-
-Function GetIP()<br> Dim fso : Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)<br> Dim re : Set re = New RegExp<br> re.Global = TRUE
-
- Dim file, fileline, matches<br> Dim pppsection : pppsection = FALSE
-
- If fso.FileExists(TmpFile) Then<br> Set file = fso.OpenTextFile(TmpFile)<br>
- Do While Not file.AtEndOfStream<br> fileline = file.ReadLine
-
- If Not pppsection Then
- If left(fileline,3) = "PPP" Then
- pppsection = TRUE
- End If
- Else
- re.Pattern = "IP Address[\. ]+: "
- If re.Test(fileline) Then
- matches = split(fileline,":")
- GetIP = right(matches(1),len(matches(1))-1)
- End If
- End If
-
- Loop<br> file.Close<br> End If
-
- Set re = Nothing<br> Set fso = Nothing<br>End Function
-
-Sub AddRoute<br> Dim ws : Set ws = CreateObject(&quot;WScript.Shell&quot;)<br> ws.run &quot;%comspec% /c &quot; &amp; route1, 0, True<br> Set ws = Nothing<br>End Sub
-</pre>
-</blockquote>
-<p>Create the VBScript file somewhere in your PC and create a shortcut on the desktop. When the PPP connects, double click on the shortcut will add the route accordingly.</p>
-<p><strong>Note</strong>: you will need to modify the line in bold for your environment. </p>
-<hr>
-<a href="poptop_ads_howto_12.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_10.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a><p>&nbsp;</p>
-<p>&nbsp;</p>
-</body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_12.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_12.htm
deleted file mode 100644
index eeaa16b..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_12.htm
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><strong>16. pptp Server Administration </strong></p>
-<p>This section covers a few tricks on pptp server management. It is far from a complete guide. Any suggestions are welcome.</p>
-<p>The packages <strong>psacct</strong> and <strong>SysVinit</strong> are required for the utilities used in here. They should be installed by default. If they are not, please install them through yum.</p>
-<blockquote>
- <pre>[root@pptp ~]# yum install psacct SysVinit </pre>
-</blockquote><p></p>
-<hr>
-<strong><a name="whoisonline"></a>16.1 Who is Online?</strong>
-<p>To check who is online, the &quot;last&quot; command is used:</p>
-<blockquote>
- <pre>[root@pptp ~]# last | grep ppp | grep still
-James ppp3 202.xx.xxx.xxx Sat Nov 19 17:38 still logged in <br>Andrew ppp1 220.xxx.xxx.xx Sat Nov 19 17:23 still logged in <br>Mary ppp2 1.2.3.4 Sat Nov 19 16:59 still logged in <br>Sue ppp0 202.xx.xxx.xxx Sat Nov 19 16:43 still logged in <br>Mark ppp7 203.xxx.xxx.xxx Sat Nov 19 14:59 still logged in</pre>
-</blockquote>
-<p><strong><em>last</em></strong> is from SysVinit. It reads the information from /var/log/wtmp. </p>
-<p><strong>Note:</strong> for <em><strong>last</strong></em> to work properly, the logwtmp option in the /etc/pptpd.conf must be enabled. If you are sure there are pptp connections but see no output from the above mentioned command, check the logwtmp option in the pptpd.conf file is enabled. </p>
-<hr>
-<strong><a name="accounting"></a>16.2 Accounting </strong>
-<p>The &quot;ac&quot; utility from package psacct will provide a report on the connection time.</p>
-<blockquote>
- <pre>[root@pptp ~]# ac -d -p
- Amy 3.77
- George 0.08
- Mark 1.78
- Richard 0.35
- Lee 3.66
- Simon 5.78
- Nicole 1.05
-Nov 1 total 16.46
- Amy 2.43
- Nicole 8.61
- Richard 4.77
- Mark 0.90
- Lee 4.68
- Keith 1.84
-Nov 2 total 23.23</pre>
-</blockquote>
-<p>The <em><strong>ac</strong></em> command reads the information from /var/log/wtmp. It has a lot of options. Read the man page for details. </p>
-<p><strong>Note</strong>: <br>
- 1.
-If you want the statistics from older version of wtmp, use the -f parameter in &quot;ac&quot; to specify the file. <br>
-2. If users use shell to log in the server as well, the ac will return the connection time of both pptp and shell connections.
-</p>
-<hr>
-<strong><a name="disconnect"></a>16.3 Disconnect a User</strong>
-<p>To disconnect an active connection, you will have to kill the pppd process associate with it. Firstly, run the command in section 16.1 to find out the remote ip address of the user. Say you want to disconnect Mary, her ip address in the above example is 1.2.3.4. Then, find the PID of the pppd process.
-</p>
-<blockquote>
- <pre>[root@pptp /]# ps -ef | grep 1.2.3.4 | grep pppd
-root 8672 8671 0 16:59 ? 00:00:00 /usr/sbin/pppd local file /etc/ppp/options.pptpd 115200
- 10.0.0.10:10.0.0.124 ipparam 1.2.3.4.
- plugin /usr/lib/pptpd/pptpd-logwtmp.so
- pptpd-original-ip 1.2.3.4</pre>
-</blockquote>
-<p>The second field of the output, 8672 in our example, is the PID of the pppd process. Kill the process will disconnect the user.</p>
-<blockquote>
- <pre>[root@pptp /]# kill 8672</pre>
-</blockquote><br>
-<hr>
-<a href="poptop_ads_howto_11.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a>
-</body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_2.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_2.htm
deleted file mode 100644
index 0bda62f..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_2.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><a name="test"></a><strong>4. The Test Environment</strong></p>
-<p>I have built a test environment as shown in the diagram. In the rest of the howto, the configurations of software are based on this topology. </p>
-<p><img src="diagram1.jpg"></p>
-<p>A Windows 2003 SP1 Server is set up as the AD domain controller, DNS server and WINS server. The pptp gateway is the Linux box which has 2 network cards. One connects to the internal network, 10.0.0.0/24, and the other one connects to the Internet with ip address 192.168.0.10/24. The internal network has two subnets, 10.0.0.0/24 and 172.16.0.0/24. </p>
-<p>The domain name of the Windows AD domain is EXAMPLENET.ORG and the corresponding netbios name is EXAMPLE. </p>
-<p><strong>Windows Domain Summary</strong>:</p>
-<table width="558" border="0">
- <tr>
- <td width="266">Domain Controller Name </td>
- <td width="282">dc1.examplenet.org</td>
- </tr>
- <tr>
- <td>Domain Controller IP Address </td>
- <td>10.0.0.1</td>
- </tr>
- <tr>
- <td>DNS IP Address </td>
- <td>10.0.0.1</td>
- </tr>
- <tr>
- <td>WINS IP Address </td>
- <td>10.0.0.1</td>
- </tr>
- <tr>
- <td>AD Domain Name </td>
- <td>examplenet.org</td>
- </tr>
- <tr>
- <td>AD Netbios Domain Name</td>
- <td>example</td>
- </tr>
-</table>
-
-</p>
-<hr>
-<a href="poptop_ads_howto_3.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_1.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a></body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_3.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_3.htm
deleted file mode 100644
index 591f993..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_3.htm
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-<style type="text/css">
-<!--
-.style1 {
- font-family: "Courier New", Courier, mono;
- font-size: 12px;
-}
--->
-</style>
-</head>
-
-<body>
-<p><a name="network"><strong>5. Network Configuration </strong></a></p>
-<p>Microsoft AD depends heavily on DNS. You should have the DNS server working first. </p>
-<p>The pptp gateway should use the Active Directory DNS server instead of the one provided by your ISP. Otherwise, the gateway may have problems to locate the domain controller. Here is the /etc/resolv.conf in my test gateway. </p>
-<blockquote>
-<pre>search examplenet.org
-nameserver 10.0.0.1</pre>
-</blockquote><p></p>
-<hr>
-<a name="defaultroute"><strong>5.1 Default Gateway and Static Routes</strong></a>
-<p>The pptp gateway has two network cards. It is important that the default gateway is pointing to the Internet, your ISP router. Make sure that the internal network card does not have a default gateway address configured. Check the network card configuration files in /etc/sysconfig/network-scripts. </p>
-<p>In my test setup, eth0 is the internal card and eth1 is the external one. In the /etc/sysconfig/network-scripts/ifcfg-eth0, it does not have the line GATEWAY=&quot;x.x.x.x&quot;. In the ifcfg-eth1, it has an entry GATEWAY=&quot;x.x.x.x&quot; pointing to the ISP router ip address.</p>
-<p>My test internal network has multiple subnets, static routes are set up to direct traffic correctly. If you have a simple single segment internal network, you can skip the following step and go to <a href="#pforward">step 5.2</a>.</p>
-<p>To set up static routes in FC4, create a file static-routes in /etc/sysconfig directory. My static-routes file has one line: </p>
-<blockquote>
- <pre>any net 172.16.0.0 netmask 255.255.255.0 dev eth0</pre>
-</blockquote>
-<p>The syntax of the line is important. The line must start with the word &quot;any&quot;.</p>
-<p>Check your routing table with the netstat command.</p>
-<blockquote>
- <pre class="style1">[root@pptp sysconfig]# netstat -nr<br>Kernel IP routing table<br>Destination Gateway Genmask Flags MSS Window irtt Iface
-192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1<br>172.16.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0<br>10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0<br>169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0<br>0.0.0.0 192.168.0.2 0.0.0.0 UG 0 0 0 eth1</pre>
-</blockquote>
-<p><hr>
-<strong><a name="pforward"></a>5.2 Enable Packet Forwarding</strong>
-<p>For ppp to work, the packet forwarding must be enabled. Edit /etc/sysctl.conf with your favourite editor and change the line:</p>
-<blockquote>
- <pre>net.ipv4.ip_forward = 0</pre><p></p>
-</blockquote>
-<p>to</p>
-<blockquote>
- <pre>net.ipv4.ip_forward = 1 </pre>
-</blockquote>
-<p>The change will be effective on the next reboot. To enable it immediately:</p>
-<blockquote>
- <pre>[root@pptp etc]# sysctl -p</pre>
-</blockquote><p></p>
-<hr>
-<a href="poptop_ads_howto_4.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_2.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a>
-</body>
-
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_4.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_4.htm
deleted file mode 100644
index bc9bcc0..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_4.htm
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><strong><a name="mppe"></a>6. Install MPPE Kernel Module </strong></p>
-<p>MPPE support is required for MSCHAPv2. Depending on the kernel version, you may or may not require to perform this step. Kernel version 2.6.15 or above has MPPE built-in. If you are using the latest FC4 2.6.15 kernel, you can go to <a href="#pppd_pptpd">step 7</a> now. If you are using an older kernel which does not support MPPE, you will have to add this feature to it. </p>
-<p>To test if your kernel supports MPPE:</p>
-<blockquote>
- <pre>[root@pptp ~]# modprobe ppp-compress-18 &amp;&amp; echo ok</pre>
-</blockquote>
-<p>If it returns an &quot;ok&quot;, you can safely skip this step and move to <a href="#pppd_pptpd">step 7</a>. If you see &quot;FATAL: Module ppp_mppe not found.&quot;, install MPPE support as described in the following procedure:</p>
-<p> Download the MPPE module builder in rpm format from <a href="http://sourceforge.net/project/showfiles.php?group_id=44827">here</a>. The required RPMs are::</p>
-<blockquote>
- <pre>dkms-2.0.6-1.noarch.rpm
-kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm</pre>
-</blockquote>
-<p>Install them with command &quot;rpm -ivh&quot;.</p>
-<blockquote>
- <pre>[root@pptp ~]# rpm -ivh dkms-2.0.6-1.noarch.rpm
-[root@pptp ~]# rpm -ivh kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm </pre>
-</blockquote>
-<p>If you upgrade your kernel to 2.6.13 or above, kernel_ppp_mppe version 1.0.2 or above must be used. Otherwise, the pptp tunnel will not connect and you will see error message &quot;This system lacks kernel support for PPP.&quot; in /var/log/messages.</p>
-<dt><strong>Note:</strong></dt>
-<dd>(1) Fedora Extra provides also a dkms rpm, dkms-2.0.6-3.fc4.noarch.rpm. I have not tested it. You may want to use the one I mentioned above to make sure the installation will work. </dd>
-<br><hr>
-<strong><a name="autoinstaller"></a>6.1 Kernel Upgrade and dkms_autoinstaller</strong>
-<p>If you upgrade your kernel after installing dkms, thanks to the dkms_autoinstaller service, you will not have to worry about the dkms kernel module. dkms_autoinstaller runs on every bootup. It checks the dkms module to ensure it match the kernel version. If a mismatch is found, it will create a proper one for the boot kernel. </p>
-<p>For dkms_autoinstaller to work, you will need the correct kernel-devel version installed in your system. It is always a good idea to install the kernel-devel rpm alongside with your new kernel. </p>
-<hr>
-<strong><a name="pppd_pptpd" id="pppd_pptpd"></a>7. pppd and pptpd</strong>
-<p><a name="pppd"><strong>7.1 Upgrade pppd </strong></a></p>
-<p>FC4 comes with ppp-2.4.2-7. It is required to be upgraded to a patched version which supports MPPE. The patched version can be found in <a href="http://sourceforge.net/project/showfiles.php?group_id=44827">here</a>. Download the rpm for FC4. At the time of writing, the latest version is 2.4.3-5. Get the FC4 rpm: </p>
-<blockquote>
- <pre>ppp-2.4.3-5.fc4.i386.rpm</pre>
-</blockquote>
-<p>Upgrade the ppp with the downloaded version:</p>
-<blockquote>
- <pre>[root@pptp ~]# rpm -Uvh ppp-2.4.3-5.fc4.i386.rpm</pre>
-</blockquote>
-<p><strong>Note</strong>: If you are a Gentoo user, and are using kernel v2.6.15, the ppp-2.4.3-5 does NOT work because of MPPC. You may find more information from <a href="http://kernel-bugs.osdl.org/show_bug.cgi?id=5827">here</a>.</p>
-<hr>
-<a name="pptpd"></a><strong>7.2 Install pptpd</strong>
-<p>In the <a href="http://sourceforge.net/project/showfiles.php?group_id=44827">same page</a> download the pptpd rpm, pptpd-1.3.1-0.i386.rpm, and install it.</p>
-<blockquote>
- <pre>[root@pptp ~]# rpm -ivh pptpd-1.3.1-0.i386.rpm</pre>
-</blockquote>
-<p><strong>Note</strong>: pptpd-1.3.1 is an experimental version. The stable version is 1.3.0. Both versions work fine for me. It is up to you to choose which one to use. </p>
-<hr>
-<a href="poptop_ads_howto_5.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_3.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a>
-</body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_5.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_5.htm
deleted file mode 100644
index c038a30..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_5.htm
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><strong>8. Kerberos</strong></p>
-<p>There are two different versions of the Kerberos client, version 4 from KTH and 5 from MIT. As Microsoft uses version 5, you should use the MIT version. FC4 includes the MIT one so you will be ok to use the stock standard one.</p>
-<p>Packages krb5-lib and krb5-workstation are required. They are installed by default. If they are not, please get the latest version from yum.</p>
-<hr>
-<a name="krbconf"></a><strong>8.1 Configure Kerberos</strong>
-<p>The configuration file of Kerberos is /etc/krb5.conf. To connect to AD, the settings must match the domain configuration.</p>
-<blockquote>
- <pre>[logging]<br> default = FILE:/var/log/krb5libs.log<br> kdc = FILE:/var/log/krb5kdc.log<br> admin_server = FILE:/var/log/kadmind.log</pre>
- <p>[libdefaults]<br>
- <strong>default_realm = EXAMPLENET.ORG</strong><br>
- dns_lookup_realm = false<br>
- dns_lookup_kdc = false<br>
- ticket_lifetime = 24h<br>
- forwardable = yes</p>
- <p>[realms]<br>
- <strong>EXAMPLENET.ORG = {</strong><br>
- <strong>kdc = dc1.examplenet.org:88</strong><br>
- # admin_server = kerberos.example.com:749<br>
- <strong>default_domain = examplenet.org</strong><br>
- }</p>
- <p>[domain_realm]<br>
- <strong>.examplenet.org = EXAMPLENET.ORG<br>
- examplenet.org = EXAMPLENET.ORG</strong></p>
- <p>[kdc]<br>
- profile = /var/kerberos/krb5kdc/kdc.conf</p>
- <p>[appdefaults]<br>
- pam = {<br>
- debug = false<br>
- ticket_lifetime = 36000<br>
- renew_lifetime = 36000<br>
- forwardable = true<br>
- krb4_convert = false<br>
- }</p>
-</blockquote>
-<p>Lines shown in bold are the ones you should pay attention to. Use uppercase as shown. </p>
-<hr>
-<a name="krbtest"></a><strong>8.2 Test Kerberos</strong>
-<p>Before trying to connect to AD, the AD DNS should have a A record for the pptp server. To add the A record, on your Windows DNS server, click Start -&gt; Administrative Tools -&gt; DNS. The dnsmgmt window pops up. Click on the &quot;+&quot; of &quot;Forward Lookup Zones&quot;. Right click on AD Domain name, in our test environment is EXAMPLENET.ORG, and choose &quot;New Host (A)...&quot;. Put in the server name and ip address and then press the &quot;Add Host&quot; button.</p>
-<p>When the DNS is ready, it is time to test Kerberos. Please note that the domain name must be in capital. </p>
-<blockquote>
- <pre>[root@pptp etc]# kinit -V skwok@EXAMPLENET.ORG<br>Password for skwok@EXAMPLENET.ORG: <br>Authenticated to Kerberos v5 </pre>
-</blockquote>
-<p>To check the Kerberos tickets:</p>
-<blockquote>
- <pre>[root@pptp etc]# klist<br>Ticket cache: FILE:/tmp/krb5cc_0<br>Default principal: skwok@EXAMPLENET.ORG</pre>
- <pre>Valid starting Expires Service principal
- 09/03/05 14:43:47 09/04/05 00:43:04 krbtgt/EXAMPLENET.ORG@EXAMPLENET.ORG
- renew until 09/04/05 14:43:47</pre>
- <pre>Kerberos 4 ticket cache: /tmp/tkt0
- klist: You have no tickets cached</pre>
-</blockquote>
-<p></p>
-<hr>
-<a href="poptop_ads_howto_6.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_4.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a>
-<p>&nbsp;</p>
-</body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_6.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_6.htm
deleted file mode 100644
index 7346959..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_6.htm
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><strong>9. Samba
-</strong></p>
-<p>FC4 comes with samba v3.0.14a. The samba project released v3.0.20 on 20 August 2005. Here is a quote from the v3.0.20 release note about winbind.</p>
-<blockquote>
- <p>-- quote --<br>
- Winbindd has been completely rewritten in this release to support
-an almost completely non-blocking, asynchronous request/reply
-model. This means that winbindd will scale much better in
-large domain environments and on high latency networks.<br>
--- quote --
- </p>
-</blockquote>
-<p>It is highly recommended to upgrade samba to v3.0.20 or above. The latest samba v3.0.21c rpms for FC4 can be found in <a href="http://us5.samba.org/samba/ftp/Binary_Packages/Fedora/RPMS/i386/core/4/">here</a>. Download a copy and then update samba with command &quot;rpm -Uvh samba*.rpm&quot;. </p>
-<p><strong>Note: </strong>
-Samba v3.0.21 has a bug on the oplock code. Avoid this version. Use v3.0.21a or above. </p>
-<hr>
-<strong><a name="smbconf"></a>9.1 Configure Samba</strong>
-<p>No matter you choose to use winbind or freeradius to connect to Active Directory, you will have to configure samba properly. The configuration file of samba is in /etc/samba and is called smb.conf. The file should have at least the following lines. </p>
-<blockquote>
- <pre>[global]
-# define the netbios name of the domain
-<strong>workgroup = EXAMPLE</strong>
-# define the pptp server netbios name
-<strong>netbios name = PPTPDSVR</strong>
-# define the AD domain name
-<strong>realm = EXAMPLENET.ORG</strong>
-# server description
-server string = pptpd Server
-# printer stuff
-printcap name = /etc/printcap
-load printers = no
-cups options = raw
-# log file stuff
-log file = /var/log/samba/%m.log
-max log size = 50
-# must set to ads
-<strong>security = ads</strong>
-# address of domain controller
-<strong>password server = 10.0.0.1</strong>
-# enable encrypt passwords
-<strong>encrypt passwords = yes</strong>
-# default setting
-socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
-# not to be a master browser
-domain master = no
-preferred master = no
-# address of the WINS server
-<strong>wins server = 10.0.0.1</strong>
-dns proxy = no
-# require this line to join the domain
-<strong>client use spnego = yes</strong>
-# winbind stuff
-<strong>idmap uid = 50001-550000
-idmap gid = 50001-550000
-winbind separator = +
-winbind nested groups = Yes
-winbind enum users=yes
-winbind enum groups=yes</strong>
-template shell = /bin/false
-winbind use default domain = no</pre>
-</blockquote>
-<p>The lines in bold are the important ones that you should pay attention to. Execute &quot;testparm&quot; to check the configuration. Correct any errors before proceeding to the next step.</p>
-<hr>
-<a name="smbjoin"></a><strong>9.2 Join the AD Domain</strong>
-<p>Once the Kerberos and Samba are configured, it's time to add the pptpd server to the AD domain.</p>
-<blockquote>
- <pre>[root@pptp ~]# net ads join -U skwok@EXAMPLENET.ORG &quot;Asiapac/Australia/Sydney/Servers&quot;<br>skwok@EXAMPLENET.ORG's password: <br>Using short domain name -- EXAMPLE<br>Joined 'PPTPDSVR' to realm 'EXAMPLENET.ORG'
-</pre>
-</blockquote>
-<p>The above net ads join command create the server in the container</p>
-<p>"OU=Servers,OU=Sydney,OU=Australia,OU=Asiapac,DC=EXAMPLENET,DC=ORG&quot;</p>
-<p>The user must have admin right on the container to create the server object. If the operation is successful, you will see a new server object created in the AD.</p>
-<p>Another test to see if the trust between the pptpd server and the domain is working is smbclient.</p>
-<blockquote>
- <pre>[root@pptp ~]# smbclient //dc1/c$ -k<br>OS=[Windows Server 2003 3790 Service Pack 1] Server=[Windows Server 2003 5.2]<br>smb: \&gt; dir<br> AUTOEXEC.BAT A 0 Wed Jul 20 10:53:47 2005<br> boot.ini AHSR 208 Fri Jul 22 10:41:57 2005<br> CONFIG.SYS A 0 Wed Jul 20 10:53:47 2005<br> Documents and Settings D 0 Fri Jul 22 16:25:51 2005<br> download D 0 Thu Aug 4 17:31:28 2005<br> IO.SYS AHSR 0 Wed Jul 20 10:53:47 2005<br> MSDOS.SYS AHSR 0 Wed Jul 20 10:53:47 2005<br> NTDETECT.COM AHSR 47772 Fri Jul 22 10:16:32 2005<br> ntldr AHSR 295536 Fri Jul 22 10:16:32 2005<br> pagefile.sys AHS 805306368 Fri Aug 12 11:24:27 2005<br> Program Files DR 0 Wed Jul 20 10:51:09 2005<br> shared1 D 0 Thu Jul 21 17:06:28 2005<br> System Volume Information DHS 0 Fri Jul 22 10:52:09 2005<br> WINDOWS D 0 Tue Aug 16 14:33:36 2005<br> wmpub D 0 Wed Jul 20 10:55:13 2005</pre>
- <p> 39064 blocks of size 524288. 31129 blocks available<br>
- smb: \&gt; </p>
-</blockquote>
-<p><strong>Note</strong>: With Samba v3.0.14a or v3.0.20, everytime I run &quot;net ads join&quot;, the command crash at the end with message &quot;*** glibc detected *** net: free(): invalid pointer: 0x001cddb0 ***&quot; and then a dump to the screen. The join seems to be working fine though. Samba v3.0.21a does not have this problem. </p>
-<hr>
-<a href="poptop_ads_howto_7.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_5.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a>
-<p>&nbsp; </p>
-</body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_7.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_7.htm
deleted file mode 100644
index 54536f1..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_7.htm
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><strong>10. pptpd and winbindd </strong></p>
-<p>The section covers how to configure pptpd + winbindd + AD. If you are working on the freeradius configuration, you may skip this section and go to the <a href="poptop_ads_howto_8.htm">next one</a>. </p>
-<p>Most of the hard work has been done in the previous sections. You are very close to the final stage.</p>
-<hr>
-<strong><a name="wbtest"></a>10.1 Enable and Test winbindd</strong>
-<p>pptpd requires only winbindd but not smbd. If you are not using the pptpd server as a samba file server, you will not need to run smbd. Start winbindd with the &quot;service&quot; command.</p>
-<blockquote>
- <pre>[root@pptp ~]# service winbind start<br>Starting Winbind services: [ OK ] </pre>
-</blockquote>
-<p>Winbind starts and spawns two threads. </p>
-<blockquote>
- <pre>[root@pptp ~]# ps -ef | grep winbind | grep -v grep<br>root 18762 1 0 15:59 ? 00:00:00 winbindd<br>root 18763 18762 0 15:59 ? 00:00:00 winbindd</pre>
-</blockquote>
-<p>Wait a few minutes for winbindd to contact the domain controller. Then we can test if winbindd is working fine. If you see no error messages from the wbinfo command, you are in business. </p>
-<blockquote>
- <pre>[root@acna-pptp etc]# wbinfo -t<br>checking the trust secret via RPC calls succeeded
-<br>[root@acna-pptp etc]# wbinfo -u<br>EXAMPLE+Administrator<br>EXAMPLE+Guest<br>EXAMPLE+SUPPORT_388945a0<br>EXAMPLE+DC1$<br>EXAMPLE+krbtgt<br>EXAMPLE+skwok<br>EXAMPLE+ldapuser<br>EXAMPLE+pptpdsvr$
-</pre>
-</blockquote>
-<p>To enable winbind on bootup, use the chkconfig command.</p>
-<blockquote>
- <pre>[root@pptp ~]# chkconfig winbind on </pre>
-</blockquote><p></p>
-<hr>
-<strong><a name="pptpconf"></a>10.2 Configure pptpd </strong>
-<p>There are two configuration files for pptpd. The first one is /etc/pptpd.conf. You can very much keep it as it is except the ip address range for the ppp connections. Edit the file and add two lines at the bottom to specify the local ip address and the ip address pool for the remote connections. </p>
-<blockquote>
- <pre>localip 10.0.0.10<br>remoteip 10.0.0.101-200 </pre>
-</blockquote>
-<p>10.0.0.10 is the ip address of the internal network card eth0. The remoteip is the address pool for the remote connections. </p>
-<p>The second configuration file is /etc/ppp/options.pptpd. I stripped off all remarks from my options.pptpd and it is like this:</p>
-<blockquote>
- <pre>name pptpd
-refuse-pap<br>refuse-chap<br>refuse-mschap<br>require-mschap-v2<br>require-mppe-128
-ms-dns 10.0.0.1
-ms-wins 10.0.0.1
-proxyarp
-lock
-nobsdcomp
-novj
-novjccomp
-nologfd
-auth
-nodefaultroute
-plugin winbind.so
-ntlm_auth-helper &quot;/usr/bin/ntlm_auth --helper-protocol=ntlm-server-1&quot;</pre>
-</blockquote>
-<p>If you have Windows XP clients, you may want to reduce the MTU size. Add the line, /sbin/ifconfig $1 mtu 1400, to /etc/ppp/ip-up as shown in the following list.</p>
-<blockquote>
- <pre>[root@pptp ppp]# cat ip-up
-#!/bin/bash
-# This file should not be modified -- make local changes to
-# /etc/ppp/ip-up.local instead
-
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-export PATH
-
-LOGDEVICE=$6
-REALDEVICE=$1
-
-[ -f /etc/sysconfig/network-scripts/ifcfg-${LOGDEVICE} ] && /etc/sysconfig/network-scripts/ifup-post ifcfg-${LOGDEVICE}
-
-/etc/ppp/ip-up.ipv6to4 ${LOGDEVICE}
-
-[ -x /etc/ppp/ip-up.local ] && /etc/ppp/ip-up.local "$@"
-
-<strong>/sbin/ifconfig $1 mtu 1400</strong>
-exit 0</pre>
-</blockquote>
-<p>The above example reduces the MTU size to 1400. In my environment, I found that XP will connect the VPN and ping all servers without problems, however, it cannot connect to the Microsoft Exchange server properly. Reduce the MTU size to 1400 fixed the problem.</p>
-<p>After fixing the files, we can start pptpd and connect to it from remote client. To start it:</p>
-<blockquote>
- <pre>[root@pptp ~]# chkconfig pptpd on<br><br>[root@pptp ~]# service pptpd start<br>Starting pptpd: [ OK ]</pre>
-</blockquote><p></p>
-<hr>
-<strong><a name="access"></a>10.3 PPTP Access Control </strong>
-<p>The above configuration allows everyone with a valid userID in the AD to connect to the pptpd server. If you want to restrict access to a group of users, you can create a group, say VPN_Allowed, in the AD. Add users to the group and modify the ntml_auth-helper line in the /etc/ppp/options.pptpd:</p>
-<blockquote>
- <pre>ntlm_auth-helper &quot;/usr/bin/ntlm_auth --helper-protocol=ntlm-server-1 <span class="790285904-18102005">--require-membership-of=EXAMPLE+VPN-Allowed</span>&quot; </pre>
-</blockquote>
-<p>That's all on the server side. If winbind works for you, you can proceed to configure the client. The client PCs require special configurations and is discussed in <a href="poptop_ads_howto_11.htm">here</a>.</p>
-<hr>
-<a href="poptop_ads_howto_8.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_6.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a></body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_8.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_8.htm
deleted file mode 100644
index 68f6608..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_8.htm
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><strong>11. Software for R</strong><strong>adius Setup</strong></p>
-<p>In additional to the software we installed in the previous sections, we need two more. Freeradius is one of them. FC4 comes with freeradius-1.0.2-2 but it is broken. At the time of writing, the latest one is freeradius-1.0.4-1.FC4.1. Get it from yum as it has quite a few dependences. yum will resolve all required dependences automagically.</p>
-<blockquote>
- <pre>[root@pptp ~]# yum install freeradius </pre>
-</blockquote>
-<p>The second software you will need is radiusclient. Get the FC4 rpm, radiusclient-0.3.2-0.2.fc4.rf.i386.rpm, from <a href="http://rpmforge.net/user/packages/radiusclient/">RPMforge</a>. Install it with &quot;rpm -ivh&quot;.</p>
-<hr>
-<p><strong><a name="rclient"></a>12. Radiusclient</strong></p>
-<p>Radiusclient is required because the pppd radius plugin relies on it. There are a few configuration files in /etc/radiusclient to look at. The first one is /etc/radiusclient/servers which specify the radius server name and key. We have the radius server in the same box. So the file is like this:</p>
-<blockquote>
- <pre>#Server Name or Client/Server pair Key<br>#---------------- ---------------<br>localhost testing123 </pre>
-</blockquote>
-<p>The key is the secret of the radius server which is specified in /etc/raddb/clients.conf. The default is testing123. Of course, it is a bad idea to use the default.</p>
-<hr>
-<a name="rclientconf"></a><strong>12.1 radiusclient.conf</strong>
-<p>The main configuration file for radiusclient is /etc/radiusclient/radiusclient.conf. Here is how it should be when all remarks are stripped off:</p>
-<blockquote>
- <pre>auth_order radius
-login_tries 4
-login_timeout 60
-nologin /etc/nologin
-issue /etc/radiusclient/issue
-authserver localhost
-acctserver localhost
-servers /etc/radiusclient/servers
-dictionary /etc/radiusclient/dictionary
-login_radius /usr/sbin/login.radius
-seqfile /var/run/radius.seq
-mapfile /etc/radiusclient/port-id-map
-default_realm
-radius_timeout 10
-radius_retries 3</pre>
-</blockquote>
-<p>Basically, all of the lines are default. I have not changed anything.</p>
-<hr>
-<strong><a name="dict"></a>12.2 dictionary.microsoft</strong>
-<p>In /etc/radiusclient, there is a file called dictionary. Add the following line to the end of the file.</p>
-<blockquote>
- <pre>INCLUDE /etc/radiusclient/dictionary.microsoft</pre>
-</blockquote>
-<p>The file, dictionary.microsoft, is not included in the radiusclient. We can modify the one from freeradius so that it can be used by pppd.</p>
-<p>First of all, copy the freeradius one, /usr/share/freeradius/dictionary.microsoft, to /etc/radiusclient. Then change the word &quot;octets&quot; to &quot;string&quot; in the file. Add the word Microsoft to all attributes. Here is my version: </p>
-<blockquote>
- <pre>#<br># Microsoft's VSA's, from RFC 2548<br>#<br># $Id: poptop_ads_howto_8.htm,v 1.3 2006/02/01 22:13:34 wskwok Exp $<br>#
-
-VENDOR Microsoft 311 Microsoft
-
-ATTRIBUTE MS-CHAP-Response 1 string Mircosoft<br>ATTRIBUTE MS-CHAP-Error 2 string Mircosoft<br>ATTRIBUTE MS-CHAP-CPW-1 3 string Mircosoft<br>ATTRIBUTE MS-CHAP-CPW-2 4 string Mircosoft<br>ATTRIBUTE MS-CHAP-LM-Enc-PW 5 string Mircosoft<br>ATTRIBUTE MS-CHAP-NT-Enc-PW 6 string Mircosoft<br>ATTRIBUTE MS-MPPE-Encryption-Policy 7 string Microsoft<br># This is referred to as both singular and plural in the RFC.<br># Plural seems to make more sense.<br>ATTRIBUTE MS-MPPE-Encryption-Type 8 string Microsoft<br>ATTRIBUTE MS-MPPE-Encryption-Types 8 string Microsoft<br>ATTRIBUTE MS-RAS-Vendor 9 integer Microsoft<br>ATTRIBUTE MS-CHAP-Domain 10 string Mircosoft<br>ATTRIBUTE MS-CHAP-Challenge 11 string Microsoft<br>ATTRIBUTE MS-CHAP-MPPE-Keys 12 string Microsoft encrypt=1<br>ATTRIBUTE MS-BAP-Usage 13 integer Microsoft<br>ATTRIBUTE MS-Link-Utilization-Threshold 14 integer Microsoft<br>ATTRIBUTE MS-Link-Drop-Time-Limit 15 integer Microsoft<br>ATTRIBUTE MS-MPPE-Send-Key 16 string Microsoft<br>ATTRIBUTE MS-MPPE-Recv-Key 17 string Microsoft<br>ATTRIBUTE MS-RAS-Version 18 string Microsoft<br>ATTRIBUTE MS-Old-ARAP-Password 19 string Microsoft<br>ATTRIBUTE MS-New-ARAP-Password 20 string Microsoft<br>ATTRIBUTE MS-ARAP-PW-Change-Reason 21 integer Microsoft
-
-ATTRIBUTE MS-Filter 22 string Mircosoft<br>ATTRIBUTE MS-Acct-Auth-Type 23 integer Microsoft<br>ATTRIBUTE MS-Acct-EAP-Type 24 integer Microsoft<br>
-ATTRIBUTE MS-CHAP2-Response 25 string Microsoft<br>ATTRIBUTE MS-CHAP2-Success 26 string Microsoft<br>ATTRIBUTE MS-CHAP2-CPW 27 string Microsoft
-
-ATTRIBUTE MS-Primary-DNS-Server 28 ipaddr<br>ATTRIBUTE MS-Secondary-DNS-Server 29 ipaddr<br>ATTRIBUTE MS-Primary-NBNS-Server 30 ipaddr<br>ATTRIBUTE MS-Secondary-NBNS-Server 31 ipaddr
-
-#ATTRIBUTE MS-ARAP-Challenge 33 string Microsoft
-
-#<br># Integer Translations<br>#
-
-# MS-BAP-Usage Values
-
-VALUE MS-BAP-Usage Not-Allowed 0<br>VALUE MS-BAP-Usage Allowed 1<br>VALUE MS-BAP-Usage Required 2
-
-# MS-ARAP-Password-Change-Reason Values
-
-VALUE MS-ARAP-PW-Change-Reason Just-Change-Password 1<br>VALUE MS-ARAP-PW-Change-Reason Expired-Password 2<br>VALUE MS-ARAP-PW-Change-Reason Admin-Requires-Password-Change 3<br>VALUE MS-ARAP-PW-Change-Reason Password-Too-Short 4
-
-# MS-Acct-Auth-Type Values
-
-VALUE MS-Acct-Auth-Type PAP 1<br>VALUE MS-Acct-Auth-Type CHAP 2<br>VALUE MS-Acct-Auth-Type MS-CHAP-1 3<br>VALUE MS-Acct-Auth-Type MS-CHAP-2 4<br>VALUE MS-Acct-Auth-Type EAP 5
-
-# MS-Acct-EAP-Type Values
-
-VALUE MS-Acct-EAP-Type MD5 4<br>VALUE MS-Acct-EAP-Type OTP 5<br>VALUE MS-Acct-EAP-Type Generic-Token-Card 6<br>VALUE MS-Acct-EAP-Type TLS 13
-
-END-VENDOR Microsoft
-</pre>
-</blockquote><p></p>
-<hr>
-<a href="poptop_ads_howto_9.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_7.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a>
-<p></p>
-</body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_9.htm b/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_9.htm
deleted file mode 100644
index 8b9c023..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/poptop_ads_howto_9.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Poptop MSCHAP2 ADS Howto</title>
-</head>
-
-<body>
-<p><strong>13. Freeradius</strong></p>
-<p>Freeradius has a massive 57KB configuration file. Fortunately, we only have to change a few lines. </p>
-<hr>
-<a name="mschap2"></a><strong>13.1 Configure Freeradius for MSCHAPv2
-</strong>
-<p>Edit /etc/raddb/radiusd.conf to enable MSCAHP2. Open the file and locate the module section and then the mschap subsection.</p>
-<blockquote>
- <pre>modules {<br>
- ....[snip]....<br>
- mschap {
- authtype = MS-CHAP
- use_mppe = yes
- require_encryption = yes
- require_strong = yes
- ntlm_auth = &quot;/usr/bin/ntlm_auth --request-nt-key --username=%{Stripped-User-Name:-%{User-Name:-None}} --challenge=%{mschap:Challenge:-00} --nt-response=%{mschap:NT-Response:-00}&quot;<br> }<br>
- ....[snip]....<br>
-}</pre>
-</blockquote>
-<p>Save the file. The mschap option in the authorize and authenticate sections is enabled by default. If they are not, enable them accordingly. </p>
-<p>The radius server has a secret key for security. The default key for freeradius is testing123. It is a good idea to change it for obvious security reasons. The key is in /etc/raddb/clients.conf. </p>
-<blockquote>
- <pre>client 127.0.0.1 {<br> #<br> # The shared secret use to &quot;encrypt&quot; and &quot;sign&quot; packets between<br> # the NAS and FreeRADIUS. You MUST change this secret from the<br> # default, otherwise it's not a secret any more!<br> #<br> # The secret can be any string, up to 32 characters in length.<br> #<br> secret = testing123
-
- ....[snip]....
-</pre>
-</blockquote>
-<p><strong>Note</strong>: if you change the secret key, you must modify the /etc/radiusclient/servers so that they match each other.
-</p>
-<hr>
-<p><strong><a name="access"></a>13.2 PPTP Access Control </strong></p>
-<p>The above configuration allows everyone with a valid userID in the AD to connect to the pptpd server. If you want to restrict access to a group of users, you can create a group, say VPN_Allowed, in the AD. Add users to the group and modify the ntml_auth line in /etc/raddb/radius.conf to include the parameter &quot;--require-membership-of=EXAMPLE+VPN_Allowed&quot;. </p>
-<p>In the example, I split the line into multiple lines for clarity. It should be one continuous line in the configuration file. </p>
-<blockquote>
- <pre>ntlm_auth = &quot;/usr/bin/ntlm_auth --request-nt-key
- --username=%{Stripped-User-Name:-%{User-Name:-None}}
- --challenge=%{mschap:Challenge:-00}
- --nt-response=%{mschap:NT-Response:-00}
- --require-membership-of=EXAMPLE+VPN_Allowed&quot;</pre>
-</blockquote><p></p>
-<hr>
-<a href="poptop_ads_howto_10.htm">Next</a> &nbsp;&nbsp;<a href="poptop_ads_howto_8.htm">Previous</a>&nbsp;&nbsp;<a href="poptop_ads_howto_1.htm#toc">Content</a><p>&nbsp; </p>
-</body>
-</html>
diff --git a/pptpd-1.3.3/html/poptop_ads_howto/test.txt b/pptpd-1.3.3/html/poptop_ads_howto/test.txt
deleted file mode 100644
index 9daeafb..0000000
--- a/pptpd-1.3.3/html/poptop_ads_howto/test.txt
+++ /dev/null
@@ -1 +0,0 @@
-test
diff --git a/pptpd-1.3.3/html/setup_pptp_client.html b/pptpd-1.3.3/html/setup_pptp_client.html
deleted file mode 100644
index 6e2f6f1..0000000
--- a/pptpd-1.3.3/html/setup_pptp_client.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>Setting up a Linux PPTP Client with WinNT PPTP Server</TITLE>
-</HEAD>
-<BODY BGCOLOR="#FFFFFF">
-<H1>Setting up the Linux PPTP 1.0.2 client (and PPP 2.3.5) with Windows NT PPTP Server</H1>
-
-<HR>
-<A NAME="aboutsys"></A>
-<H2>About the systems</H2>
-<P>
-This document assumes the following:
-<ul>
-<li>remote machine name = orge
-<li>domain remote machine belongs to = gnoll
-<li>username on remote machine = billybob
-<li>password for billybob = bobbybill
-</ul>
-We want to connect our local machine to the remote machine using PPTP. The
-remote machine is a <I>Windows NT</I> box while our local machine is a
-<I>Linux box</I>.
-</P>
-
-<HR>
-
-<A NAME="chapsecrets"></A>
-<H2>PPP chap-secrets file</H2>
-<P>
-Find the <I>chap-secrets</I> file which should be in <I>/etc/ppp/</I>. This
-file should look like this:
-</P>
-<P>
-<TABLE>
-<TR><TD># chap-secrets</TD></TR><TR>
-<TD># client</TD><TD>server</TD><TD>secret</TD><TD>IP adresses</TD></TR><TR>
-<TD>gnoll\\billybob</TD><TD>orge</TD><TD>bobbybill</TD><TD></TD></TR>
-</TABLE>
-</P>
-
-<HR>
-<A NAME="debugging"></A>
-<H2>Setting up PPP debugging</H2>
-<P>
-PPP debugging is handled by <I>syslogd</I>. To setup debugging open
-<I>syslog.conf</I> which should be found in <I>/etc/</I> and add the following
-entry:
-</P>
-<P>
-<B>daemon.debug /var/log/pppd.log</B>
-</P>
-
-<HR>
-<A NAME="launchpptp"></A>
-<H2>Launching PPTP</H2>
-<P>
-The following command is issued on the linux box to connect to the remote NT
-machine.
-</P>
-<P>
-<B>pptp orge debug name gnoll\\billybob remotename orge</B>
-</P>
-
-<HR>
-<A NAME="errors"></A>
-<H2>Errors</H2>
-<P>
-<B>E=691</B><BR>
-This error occurs when you supply an incorrect username/password to the remote
-NT machine. Check the chap-secrets file and the command line where PPTP is
-launched.
-</P>
-
-<HR>
-<A NAME="testing"></A>
-<H2>Testing</H2>
-<P>
-<ul>
-<li> run 'ifconfig' and check that a ppp0 interface exists
-<li> find P-t-P: xxx.xxx.xxx.xxx from the output of ifconfig
-<li> run 'netstat -i' and record the RX-OK and TX-OK values for ppp0
-<li> type 'ping xxx.xxx.xxx.xxx'
-<li> run 'netstat -i' again and see if the values for RX and TX increased.. if yes then it would appear to be working ok....... in theory anyway.
-</ul>
-
-<HR>
-<A HREF="http://www.moretonbay.com/vpn/pptp.html">PoPToP Home Page</a>
-</BODY>
-</HTML>
-
diff --git a/pptpd-1.3.3/if_pppox.h b/pptpd-1.3.3/if_pppox.h
deleted file mode 120000
index c3746aa..0000000
--- a/pptpd-1.3.3/if_pppox.h
+++ /dev/null
@@ -1 +0,0 @@
-../kernel/driver/if_pppox.h \ No newline at end of file
diff --git a/pptpd-1.3.3/install-sh b/pptpd-1.3.3/install-sh
deleted file mode 100755
index e9de238..0000000
--- a/pptpd-1.3.3/install-sh
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/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 "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- chmodcmd=""
- else
- instcmd=mkdir
- 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 -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- 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
- true
- 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
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; 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
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# 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 true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/pptpd-1.3.3/inststr.c b/pptpd-1.3.3/inststr.c
deleted file mode 100644
index 1fcb55b..0000000
--- a/pptpd-1.3.3/inststr.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * inststr.c
- *
- * Little function to change the name of a process
- *
- * Originally from C. S. Ananian's pptpclient
- *
- * $Id: inststr.c,v 1.2 2004/04/22 10:48:16 quozl Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifndef HAVE_SETPROCTITLE
-#include "inststr.h"
-#include "compat.h"
-#include <string.h>
-
-void inststr(int argc, char **argv, char *src)
-{
- if (strlen(src) <= strlen(argv[0])) {
- char *ptr, **pptr;
-
- for (ptr = argv[0]; *ptr; *(ptr++) = '\0')
- ;
- strcpy(argv[0], src);
- for (pptr = argv + 1; *pptr; pptr++)
- for (ptr = *pptr; *ptr; *(ptr++) = '\0')
- ;
- } else {
- /* Originally from the source to perl 4.036 (assigning to $0) */
- char *ptr, *ptr2;
- int count;
-
- ptr = argv[0] + strlen(argv[0]);
- for (count = 1; count < argc; count++) {
- if (argv[count] == ptr + 1) {
- ptr++;
- ptr += strlen(ptr);
- }
- }
- count = 0;
- for (ptr2 = argv[0]; ptr2 <= ptr; ptr2++) {
- *ptr2 = '\0';
- count++;
- }
- strlcpy(argv[0], src, count);
- }
-}
-#endif /* !HAVE_SETPROCTITLE */
diff --git a/pptpd-1.3.3/inststr.h b/pptpd-1.3.3/inststr.h
deleted file mode 100644
index fd61ec4..0000000
--- a/pptpd-1.3.3/inststr.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * inststr.h
- *
- * Change process title
- * From code by C. S. Ananian
- *
- * $Id: inststr.h,v 1.1.1.1 2002/06/21 08:52:00 fenix_nl Exp $
- */
-
-#ifndef _PPTPD_INSTSTR_H
-#define _PPTPD_INSTSTR_H
-
-#ifndef HAVE_SETPROCTITLE
-void inststr(int argc, char **argv, char *src);
-#endif
-
-#endif /* !_PPTPD_INSTSTR_H */
diff --git a/pptpd-1.3.3/makepackage b/pptpd-1.3.3/makepackage
deleted file mode 100755
index 7430ada..0000000
--- a/pptpd-1.3.3/makepackage
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-# given source tree build .tar.gz and package for distribution on this host
-
-os=$(uname)
-if [ -f /etc/redhat-release ]; then
- DISTRO="RedHat"
- DVER=$(cat /etc/redhat-release | cut -d " " -f5-)
-elif [ -f /etc/SuSE-release ]; then
- DISTRO="SuSE"
- DVER=$(cat /etc/SuSE-release | head -n1 | cut -d " " -f3)
-elif [ -f /etc/debian_version ]; then
- DISTRO="Debian"
- DVER=$(cat /etc/debian_version)
-else
- DISTRO=$os
-fi
-
-version=$(./version)
-
-if [ "$DISTRO" == "RedHat" ]; then
- mkdir -p /tmp/pptpd-$version
- cp -ar * /tmp/pptpd-$version/
- cd /tmp
- tar -czf /usr/src/redhat/SOURCES/pptpd-$version.tar.gz pptpd-$version
- cd -
- rpmbuild -ba pptpd.spec
-elif [ "$DISTRO" == "Debian" ]; then
- DPKG_BP=`which dpkg-buildpackage 2>/dev/null`
- if [ -z "$DPKG_BP" ]; then
- echo "dpkg-buildpackage not installed. Do: apt-get install dpkg-dev"
- exit 1
- fi
- $DPKG_BP -rfakeroot
-else
- echo "No packagebuilder implemented yet."
-fi
diff --git a/pptpd-1.3.3/missing b/pptpd-1.3.3/missing
deleted file mode 100755
index a9277d6..0000000
--- a/pptpd-1.3.3/missing
+++ /dev/null
@@ -1,361 +0,0 @@
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-
-scriptversion=2005-06-08.21
-
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-exit
-if test $# -eq 0; then
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
-fi
-
-run=:
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
-
-msg="missing on your system"
-
-case "$1" in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
-
-Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- automake touch all \`Makefile.in' files
- bison create \`y.tab.[ch]', if possible, from existing .[ch]
- flex create \`lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create \`lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]
-
-Send bug reports to <bug-automake@gnu.org>."
- exit $?
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
- ;;
-
- -*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).
-case "$1" in
- lex|yacc)
- # Not GNU programs, they don't have --version.
- ;;
-
- tar)
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- exit 1
- fi
- ;;
-
- *)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running `$TOOL --version' or `$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
- fi
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
- aclocal*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acinclude.m4' or \`${configure_ac}'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`${configure_ac}'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acconfig.h' or \`${configure_ac}'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case "$f" in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te)
- echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
- You might have modified some files without having the
- proper tools for further handling them.
- You can get \`$1' as part of \`Autoconf' from any GNU
- archive site."
-
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison|yacc)
- echo 1>&2 "\
-WARNING: \`$1' $msg. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if [ ! -f y.tab.h ]; then
- echo >y.tab.h
- fi
- if [ ! -f y.tab.c ]; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex|flex)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.l' file. You may need the \`Flex' package
- in order for those modifications to take effect. You can get
- \`Flex' from any GNU archive site."
- rm -f lex.yy.c
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if [ ! -f lex.yy.c ]; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a dependency of a manual page. You may need the
- \`Help2man' package in order for those modifications to take
- effect. You can get \`Help2man' from any GNU archive site."
-
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit 1
- fi
- ;;
-
- makeinfo)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- # The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- # ... or it is the one specified with @setfilename ...
- infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
- # ... or it is derived from the source name (dir/f.texi becomes f.info)
- test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
- fi
- # If the file does not exist, the user really needs makeinfo;
- # let's fail without touching anything.
- test -f $file || exit 1
- touch $file
- ;;
-
- tar)
- shift
-
- # We have already tried tar in the generic part.
- # Look for gnutar/gtar before invocation to avoid ugly error
- # messages.
- if (gnutar --version > /dev/null 2>&1); then
- gnutar "$@" && exit 0
- fi
- if (gtar --version > /dev/null 2>&1); then
- gtar "$@" && exit 0
- fi
- firstarg="$1"
- if shift; then
- case "$firstarg" in
- *o*)
- firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- case "$firstarg" in
- *h*)
- firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- fi
-
- echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
- You may want to install GNU tar or Free paxutils, or check the
- command line arguments."
- exit 1
- ;;
-
- *)
- echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
- You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequisites for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/pptpd-1.3.3/mkinstalldirs b/pptpd-1.3.3/mkinstalldirs
deleted file mode 100755
index d248aeb..0000000
--- a/pptpd-1.3.3/mkinstalldirs
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-# $Id: mkinstalldirs,v 1.1.1.1 2002/06/21 08:52:00 fenix_nl Exp $
-
-errstatus=0
-
-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
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
diff --git a/pptpd-1.3.3/our_getopt.h b/pptpd-1.3.3/our_getopt.h
deleted file mode 100644
index d351893..0000000
--- a/pptpd-1.3.3/our_getopt.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * our_getopt.h
- *
- * Header file for the getopt_long deprived.
- *
- * $Id: our_getopt.h,v 1.1.1.1 2002/06/21 08:52:00 fenix_nl Exp $
- */
-
-/* Declarations for getopt.
- Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _GETOPT_H
-
-#ifndef __need_getopt
-# define _GETOPT_H 1
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
- The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
- of `struct option' terminated by an element containing a name which is
- zero.
-
- The field `has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field `flag' is not NULL, it points to a variable that is set
- to the value given in the field `val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an `int' to
- a compiled-in constant, such as set a value from `optarg', set the
- option's `flag' field to zero and its `val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero `flag' field, `getopt'
- returns the contents of the `val' field. */
-
-struct option
-{
-# if defined __STDC__ && __STDC__
- const char *name;
-# else
- char *name;
-# endif
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'. */
-
-# define no_argument 0
-# define required_argument 1
-# define optional_argument 2
-#endif /* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
- arguments in ARGV (ARGC of them, minus the program name) for
- options given in OPTS.
-
- Return the option character from OPTS just read. Return -1 when
- there are no more options. For unrecognized options, or options
- missing arguments, `optopt' is set to the option letter, and '?' is
- returned.
-
- The OPTS string is a list of characters which are recognized option
- letters, optionally followed by colons, specifying that that letter
- takes an argument, to be placed in `optarg'.
-
- If a letter in OPTS is followed by two colons, its argument is
- optional. This behavior is specific to the GNU `getopt'.
-
- The argument `--' causes premature termination of argument
- scanning, explicitly telling `getopt' that there are no more
- options.
-
- If OPTS begins with `--', then non-option arguments are treated as
- arguments to the option '\0'. This behavior is specific to the GNU
- `getopt'. */
-
-#if defined __STDC__ && __STDC__
-# ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
-extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
-# else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-# endif /* __GNU_LIBRARY__ */
-
-# ifndef __need_getopt
-extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
- const struct option *__longopts, int *__longind);
-extern int getopt_long_only (int __argc, char *const *__argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind);
-
-/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int __argc, char *const *__argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind,
- int __long_only);
-# endif
-#else /* not __STDC__ */
-extern int getopt ();
-# ifndef __need_getopt
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-# endif
-#endif /* __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations. */
-#undef __need_getopt
-
-#endif /* getopt.h */
diff --git a/pptpd-1.3.3/our_syslog.h b/pptpd-1.3.3/our_syslog.h
deleted file mode 100644
index dd44273..0000000
--- a/pptpd-1.3.3/our_syslog.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * our_syslog.h
- *
- * Syslog replacement functions
- *
- * $Id: our_syslog.h,v 1.1.1.1 2002/06/21 08:52:00 fenix_nl Exp $
- */
-
-#ifndef _PPTPD_SYSLOG_H
-#define _PPTPD_SYSLOG_H
-
-/*
- * only enable this if you are debugging and running by hand
- * If init runs us you may not have an fd-2, and thus your write all over
- * someones FD and the die :-(
- */
-#undef USE_STDERR
-
-#ifdef USE_STDERR
-
-/*
- * Send all errors to stderr
- */
-
-#define openlog(a,b,c) ({})
-#define syslog(a,b,c...) ({fprintf(stderr, "pptpd syslog: " b "\n" , ## c);})
-#define closelog() ({})
-
-#define syslog_perror perror
-
-#else
-
-/*
- * Send all errors to syslog
- */
-
-#include <errno.h>
-#include <syslog.h>
-
-#define syslog_perror(s) syslog(LOG_ERR, "%s: %s", s, strerror(errno))
-
-#endif
-
-#endif /* !_PPTPD_SYSLOG_H */
diff --git a/pptpd-1.3.3/plugins/Makefile b/pptpd-1.3.3/plugins/Makefile
deleted file mode 100644
index 059cba1..0000000
--- a/pptpd-1.3.3/plugins/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-CC = gcc
-COPTS = -O2 -g
-CFLAGS = $(COPTS) -I.. -I../../include -fPIC
-LDFLAGS = -shared
-LDADD = -lutil
-INSTALL = install -o root
-prefix = /usr/local
-
-PLUGINS = pptpd-logwtmp.so
-
-# include dependencies if present
-ifeq (.depend,$(wildcard .depend))
-include .depend
-endif
-
-all: $(PLUGINS)
-
-%.so: %.c
- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ $(LDADD)
-
-LIBDIR ?= $(DESTDIR)$(prefix)/lib/pptpd
-
-install: $(PLUGINS)
- $(INSTALL) -d $(LIBDIR)
- $(INSTALL) $? $(LIBDIR)
-
-uninstall:
- rm -f $(LIBDIR)$(PLUGINS)
-
-clean:
- rm -f *.o *.so *.a
-
-depend:
- $(CPP) -M $(CFLAGS) *.c >.depend
diff --git a/pptpd-1.3.3/plugins/pppd.h b/pptpd-1.3.3/plugins/pppd.h
deleted file mode 100644
index 0996128..0000000
--- a/pptpd-1.3.3/plugins/pppd.h
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
- * pppd.h - PPP daemon global declarations.
- *
- * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name "Carnegie Mellon University" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For permission or any legal
- * details, please contact
- * Office of Technology Transfer
- * Carnegie Mellon University
- * 5000 Forbes Avenue
- * Pittsburgh, PA 15213-3890
- * (412) 268-4387, fax: (412) 268-7395
- * tech-transfer@andrew.cmu.edu
- *
- * 4. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by Computing Services
- * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
- *
- * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
- * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * upstream pppd.h,v 1.82 2003/04/07 00:01:46 paulus Exp
- * $Id: pppd.h,v 1.1 2004/04/28 11:36:07 quozl Exp $
- */
-
-/*
- * TODO:
- */
-
-#ifndef __PPPD_H__
-#define __PPPD_H__
-
-#include <stdio.h> /* for FILE */
-#include <limits.h> /* for NGROUPS_MAX */
-#include <sys/param.h> /* for MAXPATHLEN and BSD4_4, if defined */
-#include <sys/types.h> /* for u_int32_t, if defined */
-#include <sys/time.h> /* for struct timeval */
-#include <net/ppp_defs.h>
-
-#if defined(__STDC__)
-#include <stdarg.h>
-#define __V(x) x
-#else
-#include <varargs.h>
-#define __V(x) (va_alist) va_dcl
-#define const
-#define volatile
-#endif
-
-#ifdef INET6
-#include "eui64.h"
-#endif
-
-/*
- * Limits.
- */
-
-#define NUM_PPP 1 /* One PPP interface supported (per process) */
-#define MAXWORDLEN 1024 /* max length of word in file (incl null) */
-#define MAXARGS 1 /* max # args to a command */
-#define MAXNAMELEN 256 /* max length of hostname or name for auth */
-#define MAXSECRETLEN 256 /* max length of password or secret */
-
-/*
- * Option descriptor structure.
- */
-
-typedef unsigned char bool;
-
-enum opt_type {
- o_special_noarg = 0,
- o_special = 1,
- o_bool,
- o_int,
- o_uint32,
- o_string,
- o_wild
-};
-
-typedef struct {
- char *name; /* name of the option */
- enum opt_type type;
- void *addr;
- char *description;
- unsigned int flags;
- void *addr2;
- int upper_limit;
- int lower_limit;
- const char *source;
- short int priority;
- short int winner;
-} option_t;
-
-/* Values for flags */
-#define OPT_VALUE 0xff /* mask for presupplied value */
-#define OPT_HEX 0x100 /* int option is in hex */
-#define OPT_NOARG 0x200 /* option doesn't take argument */
-#define OPT_OR 0x400 /* OR in argument to value */
-#define OPT_INC 0x800 /* increment value */
-#define OPT_A2OR 0x800 /* for o_bool, OR arg to *(u_char *)addr2 */
-#define OPT_PRIV 0x1000 /* privileged option */
-#define OPT_STATIC 0x2000 /* string option goes into static array */
-#define OPT_LLIMIT 0x4000 /* check value against lower limit */
-#define OPT_ULIMIT 0x8000 /* check value against upper limit */
-#define OPT_LIMITS (OPT_LLIMIT|OPT_ULIMIT)
-#define OPT_ZEROOK 0x10000 /* 0 value is OK even if not within limits */
-#define OPT_HIDE 0x10000 /* for o_string, print value as ?????? */
-#define OPT_A2LIST 0x10000 /* for o_special, keep list of values */
-#define OPT_A2CLRB 0x10000 /* o_bool, clr val bits in *(u_char *)addr2 */
-#define OPT_NOINCR 0x20000 /* value mustn't be increased */
-#define OPT_ZEROINF 0x40000 /* with OPT_NOINCR, 0 == infinity */
-#define OPT_PRIO 0x80000 /* process option priorities for this option */
-#define OPT_PRIOSUB 0x100000 /* subsidiary member of priority group */
-#define OPT_ALIAS 0x200000 /* option is alias for previous option */
-#define OPT_A2COPY 0x400000 /* addr2 -> second location to rcv value */
-#define OPT_ENABLE 0x800000 /* use *addr2 as enable for option */
-#define OPT_A2CLR 0x1000000 /* clear *(bool *)addr2 */
-#define OPT_PRIVFIX 0x2000000 /* user can't override if set by root */
-#define OPT_INITONLY 0x4000000 /* option can only be set in init phase */
-#define OPT_DEVEQUIV 0x8000000 /* equiv to device name */
-#define OPT_DEVNAM (OPT_INITONLY | OPT_DEVEQUIV)
-#define OPT_A2PRINTER 0x10000000 /* *addr2 is a fn for printing option */
-#define OPT_A2STRVAL 0x20000000 /* *addr2 points to current string value */
-#define OPT_NOPRINT 0x40000000 /* don't print this option at all */
-
-#define OPT_VAL(x) ((x) & OPT_VALUE)
-
-/* Values for priority */
-#define OPRIO_DEFAULT 0 /* a default value */
-#define OPRIO_CFGFILE 1 /* value from a configuration file */
-#define OPRIO_CMDLINE 2 /* value from the command line */
-#define OPRIO_SECFILE 3 /* value from options in a secrets file */
-#define OPRIO_ROOT 100 /* added to priority if OPT_PRIVFIX && root */
-
-#ifndef GIDSET_TYPE
-#define GIDSET_TYPE gid_t
-#endif
-
-/* Structure representing a list of permitted IP addresses. */
-struct permitted_ip {
- int permit; /* 1 = permit, 0 = forbid */
- u_int32_t base; /* match if (addr & mask) == base */
- u_int32_t mask; /* base and mask are in network byte order */
-};
-
-/*
- * Unfortunately, the linux kernel driver uses a different structure
- * for statistics from the rest of the ports.
- * This structure serves as a common representation for the bits
- * pppd needs.
- */
-struct pppd_stats {
- unsigned int bytes_in;
- unsigned int bytes_out;
- unsigned int pkts_in;
- unsigned int pkts_out;
-};
-
-/* Used for storing a sequence of words. Usually malloced. */
-struct wordlist {
- struct wordlist *next;
- char *word;
-};
-
-/* An endpoint discriminator, used with multilink. */
-#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */
-struct epdisc {
- unsigned char class;
- unsigned char length;
- unsigned char value[MAX_ENDP_LEN];
-};
-
-/* values for epdisc.class */
-#define EPD_NULL 0 /* null discriminator, no data */
-#define EPD_LOCAL 1
-#define EPD_IP 2
-#define EPD_MAC 3
-#define EPD_MAGIC 4
-#define EPD_PHONENUM 5
-
-typedef void (*notify_func) __P((void *, int));
-
-struct notifier {
- struct notifier *next;
- notify_func func;
- void *arg;
-};
-
-/*
- * Global variables.
- */
-
-extern int hungup; /* Physical layer has disconnected */
-extern int ifunit; /* Interface unit number */
-extern char ifname[]; /* Interface name */
-extern char hostname[]; /* Our hostname */
-extern u_char outpacket_buf[]; /* Buffer for outgoing packets */
-extern int phase; /* Current state of link - see values below */
-extern int baud_rate; /* Current link speed in bits/sec */
-extern char *progname; /* Name of this program */
-extern int redirect_stderr;/* Connector's stderr should go to file */
-extern char peer_authname[];/* Authenticated name of peer */
-extern int auth_done[NUM_PPP]; /* Methods actually used for auth */
-extern int privileged; /* We were run by real-uid root */
-extern int need_holdoff; /* Need holdoff period after link terminates */
-extern char **script_env; /* Environment variables for scripts */
-extern int detached; /* Have detached from controlling tty */
-extern GIDSET_TYPE groups[NGROUPS_MAX]; /* groups the user is in */
-extern int ngroups; /* How many groups valid in groups */
-extern struct pppd_stats link_stats; /* byte/packet counts etc. for link */
-extern int link_stats_valid; /* set if link_stats is valid */
-extern unsigned link_connect_time; /* time the link was up for */
-extern int using_pty; /* using pty as device (notty or pty opt.) */
-extern int log_to_fd; /* logging to this fd as well as syslog */
-extern bool log_default; /* log_to_fd is default (stdout) */
-extern char *no_ppp_msg; /* message to print if ppp not in kernel */
-extern volatile int status; /* exit status for pppd */
-extern bool devnam_fixed; /* can no longer change devnam */
-extern int unsuccess; /* # unsuccessful connection attempts */
-extern int do_callback; /* set if we want to do callback next */
-extern int doing_callback; /* set if this is a callback */
-extern int error_count; /* # of times error() has been called */
-extern char ppp_devnam[MAXPATHLEN];
-extern char remote_number[MAXNAMELEN]; /* Remote telephone number, if avail. */
-extern int ppp_session_number; /* Session number (eg PPPoE session) */
-
-extern int listen_time; /* time to listen first (ms) */
-extern struct notifier *pidchange; /* for notifications of pid changing */
-extern struct notifier *phasechange; /* for notifications of phase changes */
-extern struct notifier *exitnotify; /* for notification that we're exiting */
-extern struct notifier *sigreceived; /* notification of received signal */
-extern struct notifier *ip_up_notifier; /* IPCP has come up */
-extern struct notifier *ip_down_notifier; /* IPCP has gone down */
-extern struct notifier *auth_up_notifier; /* peer has authenticated */
-extern struct notifier *link_down_notifier; /* link has gone down */
-extern struct notifier *fork_notifier; /* we are a new child process */
-
-/* Values for do_callback and doing_callback */
-#define CALLBACK_DIALIN 1 /* we are expecting the call back */
-#define CALLBACK_DIALOUT 2 /* we are dialling out to call back */
-
-/*
- * Variables set by command-line options.
- */
-
-extern int debug; /* Debug flag */
-extern int kdebugflag; /* Tell kernel to print debug messages */
-extern int default_device; /* Using /dev/tty or equivalent */
-extern char devnam[MAXPATHLEN]; /* Device name */
-extern int crtscts; /* Use hardware flow control */
-extern bool modem; /* Use modem control lines */
-extern int inspeed; /* Input/Output speed requested */
-extern u_int32_t netmask; /* IP netmask to set on interface */
-extern bool lockflag; /* Create lock file to lock the serial dev */
-extern bool nodetach; /* Don't detach from controlling tty */
-extern bool updetach; /* Detach from controlling tty when link up */
-extern char *initializer; /* Script to initialize physical link */
-extern char *connect_script; /* Script to establish physical link */
-extern char *disconnect_script; /* Script to disestablish physical link */
-extern char *welcomer; /* Script to welcome client after connection */
-extern char *ptycommand; /* Command to run on other side of pty */
-extern int maxconnect; /* Maximum connect time (seconds) */
-extern char user[MAXNAMELEN];/* Our name for authenticating ourselves */
-extern char passwd[MAXSECRETLEN]; /* Password for PAP or CHAP */
-extern bool auth_required; /* Peer is required to authenticate */
-extern bool persist; /* Reopen link after it goes down */
-extern bool uselogin; /* Use /etc/passwd for checking PAP */
-extern char our_name[MAXNAMELEN];/* Our name for authentication purposes */
-extern char remote_name[MAXNAMELEN]; /* Peer's name for authentication */
-extern bool explicit_remote;/* remote_name specified with remotename opt */
-extern bool demand; /* Do dial-on-demand */
-extern char *ipparam; /* Extra parameter for ip up/down scripts */
-extern bool cryptpap; /* Others' PAP passwords are encrypted */
-extern int idle_time_limit;/* Shut down link if idle for this long */
-extern int holdoff; /* Dead time before restarting */
-extern bool holdoff_specified; /* true if user gave a holdoff value */
-extern bool notty; /* Stdin/out is not a tty */
-extern char *pty_socket; /* Socket to connect to pty */
-extern char *record_file; /* File to record chars sent/received */
-extern bool sync_serial; /* Device is synchronous serial device */
-extern int maxfail; /* Max # of unsuccessful connection attempts */
-extern char linkname[MAXPATHLEN]; /* logical name for link */
-extern bool tune_kernel; /* May alter kernel settings as necessary */
-extern int connect_delay; /* Time to delay after connect script */
-extern int max_data_rate; /* max bytes/sec through charshunt */
-extern int req_unit; /* interface unit number to use */
-extern bool multilink; /* enable multilink operation */
-extern bool noendpoint; /* don't send or accept endpt. discrim. */
-extern char *bundle_name; /* bundle name for multilink */
-extern bool dump_options; /* print out option values */
-extern bool dryrun; /* check everything, print options, exit */
-
-#ifdef MAXOCTETS
-extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */
-extern int maxoctets_dir; /* Direction :
- 0 - in+out (default)
- 1 - in
- 2 - out
- 3 - max(in,out) */
-extern int maxoctets_timeout; /* Timeout for check of octets limit */
-#define PPP_OCTETS_DIRECTION_SUM 0
-#define PPP_OCTETS_DIRECTION_IN 1
-#define PPP_OCTETS_DIRECTION_OUT 2
-#define PPP_OCTETS_DIRECTION_MAXOVERAL 3
-/* same as previos, but little different on RADIUS side */
-#define PPP_OCTETS_DIRECTION_MAXSESSION 4
-#endif
-
-#ifdef PPP_FILTER
-extern struct bpf_program pass_filter; /* Filter for pkts to pass */
-extern struct bpf_program active_filter; /* Filter for link-active pkts */
-#endif
-
-#ifdef MSLANMAN
-extern bool ms_lanman; /* Use LanMan password instead of NT */
- /* Has meaning only with MS-CHAP challenges */
-#endif
-
-/* Values for auth_pending, auth_done */
-#define PAP_WITHPEER 0x1
-#define PAP_PEER 0x2
-#define CHAP_WITHPEER 0x4
-#define CHAP_PEER 0x8
-#define EAP_WITHPEER 0x10
-#define EAP_PEER 0x20
-
-/* Values for auth_done only */
-#define CHAP_MD5_WITHPEER 0x40
-#define CHAP_MD5_PEER 0x80
-#ifdef CHAPMS
-#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */
-#define CHAP_MS_WITHPEER 0x100
-#define CHAP_MS_PEER 0x200
-#define CHAP_MS2_WITHPEER 0x400
-#define CHAP_MS2_PEER 0x800
-#endif
-
-extern char *current_option; /* the name of the option being parsed */
-extern int privileged_option; /* set iff the current option came from root */
-extern char *option_source; /* string saying where the option came from */
-extern int option_priority; /* priority of current options */
-
-/*
- * Values for phase.
- */
-#define PHASE_DEAD 0
-#define PHASE_INITIALIZE 1
-#define PHASE_SERIALCONN 2
-#define PHASE_DORMANT 3
-#define PHASE_ESTABLISH 4
-#define PHASE_AUTHENTICATE 5
-#define PHASE_CALLBACK 6
-#define PHASE_NETWORK 7
-#define PHASE_RUNNING 8
-#define PHASE_TERMINATE 9
-#define PHASE_DISCONNECT 10
-#define PHASE_HOLDOFF 11
-
-/*
- * The following struct gives the addresses of procedures to call
- * for a particular protocol.
- */
-struct protent {
- u_short protocol; /* PPP protocol number */
- /* Initialization procedure */
- void (*init) __P((int unit));
- /* Process a received packet */
- void (*input) __P((int unit, u_char *pkt, int len));
- /* Process a received protocol-reject */
- void (*protrej) __P((int unit));
- /* Lower layer has come up */
- void (*lowerup) __P((int unit));
- /* Lower layer has gone down */
- void (*lowerdown) __P((int unit));
- /* Open the protocol */
- void (*open) __P((int unit));
- /* Close the protocol */
- void (*close) __P((int unit, char *reason));
- /* Print a packet in readable form */
- int (*printpkt) __P((u_char *pkt, int len,
- void (*printer) __P((void *, char *, ...)),
- void *arg));
- /* Process a received data packet */
- void (*datainput) __P((int unit, u_char *pkt, int len));
- bool enabled_flag; /* 0 iff protocol is disabled */
- char *name; /* Text name of protocol */
- char *data_name; /* Text name of corresponding data protocol */
- option_t *options; /* List of command-line options */
- /* Check requested options, assign defaults */
- void (*check_options) __P((void));
- /* Configure interface for demand-dial */
- int (*demand_conf) __P((int unit));
- /* Say whether to bring up link for this pkt */
- int (*active_pkt) __P((u_char *pkt, int len));
-};
-
-/* Table of pointers to supported protocols */
-extern struct protent *protocols[];
-
-/*
- * This struct contains pointers to a set of procedures for
- * doing operations on a "channel". A channel provides a way
- * to send and receive PPP packets - the canonical example is
- * a serial port device in PPP line discipline (or equivalently
- * with PPP STREAMS modules pushed onto it).
- */
-struct channel {
- /* set of options for this channel */
- option_t *options;
- /* find and process a per-channel options file */
- void (*process_extra_options) __P((void));
- /* check all the options that have been given */
- void (*check_options) __P((void));
- /* get the channel ready to do PPP, return a file descriptor */
- int (*connect) __P((void));
- /* we're finished with the channel */
- void (*disconnect) __P((void));
- /* put the channel into PPP `mode' */
- int (*establish_ppp) __P((int));
- /* take the channel out of PPP `mode', restore loopback if demand */
- void (*disestablish_ppp) __P((int));
- /* set the transmit-side PPP parameters of the channel */
- void (*send_config) __P((int, u_int32_t, int, int));
- /* set the receive-side PPP parameters of the channel */
- void (*recv_config) __P((int, u_int32_t, int, int));
- /* cleanup on error or normal exit */
- void (*cleanup) __P((void));
- /* close the device, called in children after fork */
- void (*close) __P((void));
-};
-
-extern struct channel *the_channel;
-
-/*
- * Prototypes.
- */
-
-/* Procedures exported from main.c. */
-void set_ifunit __P((int)); /* set stuff that depends on ifunit */
-void detach __P((void)); /* Detach from controlling tty */
-void die __P((int)); /* Cleanup and exit */
-void quit __P((void)); /* like die(1) */
-void novm __P((char *)); /* Say we ran out of memory, and die */
-void timeout __P((void (*func)(void *), void *arg, int s, int us));
- /* Call func(arg) after s.us seconds */
-void untimeout __P((void (*func)(void *), void *arg));
- /* Cancel call to func(arg) */
-void record_child __P((int, char *, void (*) (void *), void *));
-pid_t safe_fork __P((void)); /* Fork & close stuff in child */
-int device_script __P((char *cmd, int in, int out, int dont_wait));
- /* Run `cmd' with given stdin and stdout */
-pid_t run_program __P((char *prog, char **args, int must_exist,
- void (*done)(void *), void *arg));
- /* Run program prog with args in child */
-void reopen_log __P((void)); /* (re)open the connection to syslog */
-void update_link_stats __P((int)); /* Get stats at link termination */
-void script_setenv __P((char *, char *, int)); /* set script env var */
-void script_unsetenv __P((char *)); /* unset script env var */
-void new_phase __P((int)); /* signal start of new phase */
-void add_notifier __P((struct notifier **, notify_func, void *));
-void remove_notifier __P((struct notifier **, notify_func, void *));
-void notify __P((struct notifier *, int));
-int ppp_send_config __P((int, int, u_int32_t, int, int));
-int ppp_recv_config __P((int, int, u_int32_t, int, int));
-
-/* Procedures exported from tty.c. */
-void tty_init __P((void));
-
-/* Procedures exported from utils.c. */
-void log_packet __P((u_char *, int, char *, int));
- /* Format a packet and log it with syslog */
-void print_string __P((char *, int, void (*) (void *, char *, ...),
- void *)); /* Format a string for output */
-int slprintf __P((char *, int, char *, ...)); /* sprintf++ */
-int vslprintf __P((char *, int, char *, va_list)); /* vsprintf++ */
-size_t strlcpy __P((char *, const char *, size_t)); /* safe strcpy */
-size_t strlcat __P((char *, const char *, size_t)); /* safe strncpy */
-void dbglog __P((char *, ...)); /* log a debug message */
-void info __P((char *, ...)); /* log an informational message */
-void notice __P((char *, ...)); /* log a notice-level message */
-void warn __P((char *, ...)); /* log a warning message */
-void error __P((char *, ...)); /* log an error message */
-void fatal __P((char *, ...)); /* log an error message and die(1) */
-void init_pr_log __P((char *, int)); /* initialize for using pr_log */
-void pr_log __P((void *, char *, ...)); /* printer fn, output to syslog */
-void end_pr_log __P((void)); /* finish up after using pr_log */
-void dump_packet __P((const char *, u_char *, int));
- /* dump packet to debug log if interesting */
-ssize_t complete_read __P((int, void *, size_t));
- /* read a complete buffer */
-
-/* Procedures exported from auth.c */
-void link_required __P((int)); /* we are starting to use the link */
-void link_terminated __P((int)); /* we are finished with the link */
-void link_down __P((int)); /* the LCP layer has left the Opened state */
-void link_established __P((int)); /* the link is up; authenticate now */
-void start_networks __P((int)); /* start all the network control protos */
-void continue_networks __P((int)); /* start network [ip, etc] control protos */
-void np_up __P((int, int)); /* a network protocol has come up */
-void np_down __P((int, int)); /* a network protocol has gone down */
-void np_finished __P((int, int)); /* a network protocol no longer needs link */
-void auth_peer_fail __P((int, int));
- /* peer failed to authenticate itself */
-void auth_peer_success __P((int, int, int, char *, int));
- /* peer successfully authenticated itself */
-void auth_withpeer_fail __P((int, int));
- /* we failed to authenticate ourselves */
-void auth_withpeer_success __P((int, int, int));
- /* we successfully authenticated ourselves */
-void auth_check_options __P((void));
- /* check authentication options supplied */
-void auth_reset __P((int)); /* check what secrets we have */
-int check_passwd __P((int, char *, int, char *, int, char **));
- /* Check peer-supplied username/password */
-int get_secret __P((int, char *, char *, char *, int *, int));
- /* get "secret" for chap */
-int get_srp_secret __P((int unit, char *client, char *server, char *secret,
- int am_server));
-int auth_ip_addr __P((int, u_int32_t));
- /* check if IP address is authorized */
-int auth_number __P((void)); /* check if remote number is authorized */
-int bad_ip_adrs __P((u_int32_t));
- /* check if IP address is unreasonable */
-
-/* Procedures exported from demand.c */
-void demand_conf __P((void)); /* config interface(s) for demand-dial */
-void demand_block __P((void)); /* set all NPs to queue up packets */
-void demand_unblock __P((void)); /* set all NPs to pass packets */
-void demand_discard __P((void)); /* set all NPs to discard packets */
-void demand_rexmit __P((int)); /* retransmit saved frames for an NP */
-int loop_chars __P((unsigned char *, int)); /* process chars from loopback */
-int loop_frame __P((unsigned char *, int)); /* should we bring link up? */
-
-/* Procedures exported from multilink.c */
-void mp_check_options __P((void)); /* Check multilink-related options */
-int mp_join_bundle __P((void)); /* join our link to an appropriate bundle */
-char *epdisc_to_str __P((struct epdisc *)); /* string from endpoint discrim. */
-int str_to_epdisc __P((struct epdisc *, char *)); /* endpt disc. from str */
-
-/* Procedures exported from sys-*.c */
-void sys_init __P((void)); /* Do system-dependent initialization */
-void sys_cleanup __P((void)); /* Restore system state before exiting */
-int sys_check_options __P((void)); /* Check options specified */
-void sys_close __P((void)); /* Clean up in a child before execing */
-int ppp_available __P((void)); /* Test whether ppp kernel support exists */
-int get_pty __P((int *, int *, char *, int)); /* Get pty master/slave */
-int open_ppp_loopback __P((void)); /* Open loopback for demand-dialling */
-int tty_establish_ppp __P((int)); /* Turn serial port into a ppp interface */
-void tty_disestablish_ppp __P((int)); /* Restore port to normal operation */
-void generic_disestablish_ppp __P((int dev_fd)); /* Restore device setting */
-int generic_establish_ppp __P((int dev_fd)); /* Make a ppp interface */
-void make_new_bundle __P((int, int, int, int)); /* Create new bundle */
-int bundle_attach __P((int)); /* Attach link to existing bundle */
-void cfg_bundle __P((int, int, int, int)); /* Configure existing bundle */
-void clean_check __P((void)); /* Check if line was 8-bit clean */
-void set_up_tty __P((int, int)); /* Set up port's speed, parameters, etc. */
-void restore_tty __P((int)); /* Restore port's original parameters */
-void setdtr __P((int, int)); /* Raise or lower port's DTR line */
-void output __P((int, u_char *, int)); /* Output a PPP packet */
-void wait_input __P((struct timeval *));
- /* Wait for input, with timeout */
-void add_fd __P((int)); /* Add fd to set to wait for */
-void remove_fd __P((int)); /* Remove fd from set to wait for */
-int read_packet __P((u_char *)); /* Read PPP packet */
-int get_loop_output __P((void)); /* Read pkts from loopback */
-void tty_send_config __P((int, u_int32_t, int, int));
- /* Configure i/f transmit parameters */
-void tty_set_xaccm __P((ext_accm));
- /* Set extended transmit ACCM */
-void tty_recv_config __P((int, u_int32_t, int, int));
- /* Configure i/f receive parameters */
-int ccp_test __P((int, u_char *, int, int));
- /* Test support for compression scheme */
-void ccp_flags_set __P((int, int, int));
- /* Set kernel CCP state */
-int ccp_fatal_error __P((int)); /* Test for fatal decomp error in kernel */
-int get_idle_time __P((int, struct ppp_idle *));
- /* Find out how long link has been idle */
-int get_ppp_stats __P((int, struct pppd_stats *));
- /* Return link statistics */
-void netif_set_mtu __P((int, int)); /* Set PPP interface MTU */
-int netif_get_mtu __P((int)); /* Get PPP interface MTU */
-int sifvjcomp __P((int, int, int, int));
- /* Configure VJ TCP header compression */
-int sifup __P((int)); /* Configure i/f up for one protocol */
-int sifnpmode __P((int u, int proto, enum NPmode mode));
- /* Set mode for handling packets for proto */
-int sifdown __P((int)); /* Configure i/f down for one protocol */
-int sifaddr __P((int, u_int32_t, u_int32_t, u_int32_t));
- /* Configure IPv4 addresses for i/f */
-int cifaddr __P((int, u_int32_t, u_int32_t));
- /* Reset i/f IP addresses */
-#ifdef INET6
-int sif6addr __P((int, eui64_t, eui64_t));
- /* Configure IPv6 addresses for i/f */
-int cif6addr __P((int, eui64_t, eui64_t));
- /* Remove an IPv6 address from i/f */
-#endif
-int sifdefaultroute __P((int, u_int32_t, u_int32_t));
- /* Create default route through i/f */
-int cifdefaultroute __P((int, u_int32_t, u_int32_t));
- /* Delete default route through i/f */
-int sifproxyarp __P((int, u_int32_t));
- /* Add proxy ARP entry for peer */
-int cifproxyarp __P((int, u_int32_t));
- /* Delete proxy ARP entry for peer */
-u_int32_t GetMask __P((u_int32_t)); /* Get appropriate netmask for address */
-int lock __P((char *)); /* Create lock file for device */
-int relock __P((int)); /* Rewrite lock file with new pid */
-void unlock __P((void)); /* Delete previously-created lock file */
-void logwtmp __P((const char *, const char *, const char *));
- /* Write entry to wtmp file */
-int get_host_seed __P((void)); /* Get host-dependent random number seed */
-int have_route_to __P((u_int32_t)); /* Check if route to addr exists */
-#ifdef PPP_FILTER
-int set_filters __P((struct bpf_program *pass, struct bpf_program *active));
- /* Set filter programs in kernel */
-#endif
-#ifdef IPX_CHANGE
-int sipxfaddr __P((int, unsigned long, unsigned char *));
-int cipxfaddr __P((int));
-#endif
-int get_if_hwaddr __P((u_char *addr, char *name));
-char *get_first_ethernet __P((void));
-
-/* Procedures exported from options.c */
-int setipaddr __P((char *, char **, int)); /* Set local/remote ip addresses */
-int parse_args __P((int argc, char **argv));
- /* Parse options from arguments given */
-int options_from_file __P((char *filename, int must_exist, int check_prot,
- int privileged));
- /* Parse options from an options file */
-int options_from_user __P((void)); /* Parse options from user's .ppprc */
-int options_for_tty __P((void)); /* Parse options from /etc/ppp/options.tty */
-int options_from_list __P((struct wordlist *, int privileged));
- /* Parse options from a wordlist */
-int getword __P((FILE *f, char *word, int *newlinep, char *filename));
- /* Read a word from a file */
-void option_error __P((char *fmt, ...));
- /* Print an error message about an option */
-int int_option __P((char *, int *));
- /* Simplified number_option for decimal ints */
-void add_options __P((option_t *)); /* Add extra options */
-void check_options __P((void)); /* check values after all options parsed */
-int override_value __P((const char *, int, const char *));
- /* override value if permitted by priority */
-void print_options __P((void (*) __P((void *, char *, ...)), void *));
- /* print out values of all options */
-
-int parse_dotted_ip __P((char *, u_int32_t *));
-
-/*
- * Hooks to enable plugins to change various things.
- */
-extern int (*new_phase_hook) __P((int));
-extern int (*idle_time_hook) __P((struct ppp_idle *));
-extern int (*holdoff_hook) __P((void));
-extern int (*pap_check_hook) __P((void));
-extern int (*pap_auth_hook) __P((char *user, char *passwd, char **msgp,
- struct wordlist **paddrs,
- struct wordlist **popts));
-extern void (*pap_logout_hook) __P((void));
-extern int (*pap_passwd_hook) __P((char *user, char *passwd));
-extern int (*allowed_address_hook) __P((u_int32_t addr));
-extern void (*ip_up_hook) __P((void));
-extern void (*ip_down_hook) __P((void));
-extern void (*ip_choose_hook) __P((u_int32_t *));
-
-extern int (*chap_check_hook) __P((void));
-extern int (*chap_passwd_hook) __P((char *user, char *passwd));
-
-/* Let a plugin snoop sent and received packets. Useful for L2TP */
-extern void (*snoop_recv_hook) __P((unsigned char *p, int len));
-extern void (*snoop_send_hook) __P((unsigned char *p, int len));
-
-/*
- * Inline versions of get/put char/short/long.
- * Pointer is advanced; we assume that both arguments
- * are lvalues and will already be in registers.
- * cp MUST be u_char *.
- */
-#define GETCHAR(c, cp) { \
- (c) = *(cp)++; \
-}
-#define PUTCHAR(c, cp) { \
- *(cp)++ = (u_char) (c); \
-}
-
-
-#define GETSHORT(s, cp) { \
- (s) = *(cp)++ << 8; \
- (s) |= *(cp)++; \
-}
-#define PUTSHORT(s, cp) { \
- *(cp)++ = (u_char) ((s) >> 8); \
- *(cp)++ = (u_char) (s); \
-}
-
-#define GETLONG(l, cp) { \
- (l) = *(cp)++ << 8; \
- (l) |= *(cp)++; (l) <<= 8; \
- (l) |= *(cp)++; (l) <<= 8; \
- (l) |= *(cp)++; \
-}
-#define PUTLONG(l, cp) { \
- *(cp)++ = (u_char) ((l) >> 24); \
- *(cp)++ = (u_char) ((l) >> 16); \
- *(cp)++ = (u_char) ((l) >> 8); \
- *(cp)++ = (u_char) (l); \
-}
-
-#define INCPTR(n, cp) ((cp) += (n))
-#define DECPTR(n, cp) ((cp) -= (n))
-
-/*
- * System dependent definitions for user-level 4.3BSD UNIX implementation.
- */
-
-#define TIMEOUT(r, f, t) timeout((r), (f), (t), 0)
-#define UNTIMEOUT(r, f) untimeout((r), (f))
-
-#define BCOPY(s, d, l) memcpy(d, s, l)
-#define BZERO(s, n) memset(s, 0, n)
-#define BCMP(s1, s2, l) memcmp(s1, s2, l)
-
-#define PRINTMSG(m, l) { info("Remote message: %0.*v", l, m); }
-
-/*
- * MAKEHEADER - Add Header fields to a packet.
- */
-#define MAKEHEADER(p, t) { \
- PUTCHAR(PPP_ALLSTATIONS, p); \
- PUTCHAR(PPP_UI, p); \
- PUTSHORT(t, p); }
-
-/*
- * Exit status values.
- */
-#define EXIT_OK 0
-#define EXIT_FATAL_ERROR 1
-#define EXIT_OPTION_ERROR 2
-#define EXIT_NOT_ROOT 3
-#define EXIT_NO_KERNEL_SUPPORT 4
-#define EXIT_USER_REQUEST 5
-#define EXIT_LOCK_FAILED 6
-#define EXIT_OPEN_FAILED 7
-#define EXIT_CONNECT_FAILED 8
-#define EXIT_PTYCMD_FAILED 9
-#define EXIT_NEGOTIATION_FAILED 10
-#define EXIT_PEER_AUTH_FAILED 11
-#define EXIT_IDLE_TIMEOUT 12
-#define EXIT_CONNECT_TIME 13
-#define EXIT_CALLBACK 14
-#define EXIT_PEER_DEAD 15
-#define EXIT_HANGUP 16
-#define EXIT_LOOPBACK 17
-#define EXIT_INIT_FAILED 18
-#define EXIT_AUTH_TOPEER_FAILED 19
-#ifdef MAXOCTETS
-#define EXIT_TRAFFIC_LIMIT 20
-#endif
-#define EXIT_CNID_AUTH_FAILED 21
-
-/*
- * Debug macros. Slightly useful for finding bugs in pppd, not particularly
- * useful for finding out why your connection isn't being established.
- */
-#ifdef DEBUGALL
-#define DEBUGMAIN 1
-#define DEBUGFSM 1
-#define DEBUGLCP 1
-#define DEBUGIPCP 1
-#define DEBUGIPV6CP 1
-#define DEBUGUPAP 1
-#define DEBUGCHAP 1
-#endif
-
-#ifndef LOG_PPP /* we use LOG_LOCAL2 for syslog by default */
-#if defined(DEBUGMAIN) || defined(DEBUGFSM) || defined(DEBUGSYS) \
- || defined(DEBUGLCP) || defined(DEBUGIPCP) || defined(DEBUGUPAP) \
- || defined(DEBUGCHAP) || defined(DEBUG) || defined(DEBUGIPV6CP)
-#define LOG_PPP LOG_LOCAL2
-#else
-#define LOG_PPP LOG_DAEMON
-#endif
-#endif /* LOG_PPP */
-
-#ifdef DEBUGMAIN
-#define MAINDEBUG(x) if (debug) dbglog x
-#else
-#define MAINDEBUG(x)
-#endif
-
-#ifdef DEBUGSYS
-#define SYSDEBUG(x) if (debug) dbglog x
-#else
-#define SYSDEBUG(x)
-#endif
-
-#ifdef DEBUGFSM
-#define FSMDEBUG(x) if (debug) dbglog x
-#else
-#define FSMDEBUG(x)
-#endif
-
-#ifdef DEBUGLCP
-#define LCPDEBUG(x) if (debug) dbglog x
-#else
-#define LCPDEBUG(x)
-#endif
-
-#ifdef DEBUGIPCP
-#define IPCPDEBUG(x) if (debug) dbglog x
-#else
-#define IPCPDEBUG(x)
-#endif
-
-#ifdef DEBUGIPV6CP
-#define IPV6CPDEBUG(x) if (debug) dbglog x
-#else
-#define IPV6CPDEBUG(x)
-#endif
-
-#ifdef DEBUGUPAP
-#define UPAPDEBUG(x) if (debug) dbglog x
-#else
-#define UPAPDEBUG(x)
-#endif
-
-#ifdef DEBUGCHAP
-#define CHAPDEBUG(x) if (debug) dbglog x
-#else
-#define CHAPDEBUG(x)
-#endif
-
-#ifdef DEBUGIPXCP
-#define IPXCPDEBUG(x) if (debug) dbglog x
-#else
-#define IPXCPDEBUG(x)
-#endif
-
-#ifndef SIGTYPE
-#if defined(sun) || defined(SYSV) || defined(POSIX_SOURCE)
-#define SIGTYPE void
-#else
-#define SIGTYPE int
-#endif /* defined(sun) || defined(SYSV) || defined(POSIX_SOURCE) */
-#endif /* SIGTYPE */
-
-#ifndef MIN
-#define MIN(a, b) ((a) < (b)? (a): (b))
-#endif
-#ifndef MAX
-#define MAX(a, b) ((a) > (b)? (a): (b))
-#endif
-
-#ifndef offsetof
-#define offsetof(type, member) ((size_t) &((type *)0)->member)
-#endif
-
-#endif /* __PPP_H__ */
diff --git a/pptpd-1.3.3/plugins/pptpd-logwtmp.c b/pptpd-1.3.3/plugins/pptpd-logwtmp.c
deleted file mode 100644
index f5d860a..0000000
--- a/pptpd-1.3.3/plugins/pptpd-logwtmp.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * $Id: pptpd-logwtmp.c,v 1.4 2005/08/03 09:10:59 quozl Exp $
- * pptpd-logwtmp.c - pppd plugin to update wtmp for a pptpd user
- *
- * Copyright 2004 James Cameron.
- *
- * 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.
- */
-#include <unistd.h>
-#include <utmp.h>
-#include <string.h>
-#include "pppd.h"
-#include "config.h"
-
-char pppd_version[] = PPPD_VERSION;
-
-static char pptpd_original_ip[PATH_MAX+1];
-static bool pptpd_logwtmp_strip_domain = 0;
-
-static option_t options[] = {
- { "pptpd-original-ip", o_string, pptpd_original_ip,
- "Original IP address of the PPTP connection",
- OPT_STATIC, NULL, PATH_MAX },
- { "pptpd-logwtmp-strip-domain", o_bool, &pptpd_logwtmp_strip_domain,
- "Strip domain from username before logging", OPT_PRIO | 1 },
- { NULL }
-};
-
-static void ip_up(void *opaque, int arg)
-{
- char *user = peer_authname;
- if (pptpd_logwtmp_strip_domain) {
- char *sep = strstr(user, "//");
- if (sep != NULL)
- user = sep + 2;
- }
- if (debug)
- notice("pptpd-logwtmp.so ip-up %s %s %s", ifname, user,
- pptpd_original_ip);
- logwtmp(ifname, user, pptpd_original_ip);
-}
-
-static void ip_down(void *opaque, int arg)
-{
- if (debug)
- notice("pptpd-logwtmp.so ip-down %s", ifname);
- logwtmp(ifname, "", "");
-}
-
-void plugin_init(void)
-{
- add_options(options);
- add_notifier(&ip_up_notifier, ip_up, NULL);
- add_notifier(&ip_down_notifier, ip_down, NULL);
- if (debug)
- notice("pptpd-logwtmp: $Version$");
-}
diff --git a/pptpd-1.3.3/pptpctrl.c b/pptpd-1.3.3/pptpctrl.c
deleted file mode 100644
index 2cad5d1..0000000
--- a/pptpd-1.3.3/pptpctrl.c
+++ /dev/null
@@ -1,701 +0,0 @@
-/*
- * pptpctrl.c
- *
- * PPTP control connection between PAC-PNS pair
- *
- * $Id: pptpctrl.c,v 1.19 2005/10/30 22:40:41 quozl Exp $
- *
- * 24.02.2008 Bugs fixed by Serbulov D. (SDY)
- * + added SIGCHLD control
- * + added PPPD kill on stop ses
- * + correct exit on duplicate connection
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef __linux__
-#define _GNU_SOURCE 1 /* kill() prototype, broken arpa/inet.h */
-#endif
-
-#include "our_syslog.h"
-
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <sys/time.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#ifdef HAVE_OPENPTY
-#ifdef HAVE_PTY_H
-#include <pty.h>
-#endif
-#ifdef HAVE_LIBUTIL_H
-#include <libutil.h>
-#endif
-#endif
-
-#ifdef __UCLIBC__
-#define socklen_t int
-#endif
-
-#include "compat.h"
-#include "pptpctrl.h"
-#include "pptpdefs.h"
-#include "ctrlpacket.h"
-#include "defaults.h"
-// placing net/if.h here fixes build on Solaris
-#include <net/if.h>
-#include <net/ethernet.h>
-#include "if_pppox.h"
-
-static char *ppp_binary = PPP_BINARY;
-static int pptp_logwtmp;
-static int noipparam; /* if true, don't send ipparam to ppp */
-static char speed[32];
-static char pppdxfig[256];
-static pid_t pppfork; /* so we can kill it after disconnect */
-
-/*
- * Global to handle dying
- *
- * I'd be nice if someone could figure out a way to do it
- * without the global, but i don't think you can.. -tmk
- */
-#define clientSocket 0 /* in case it changes back to a variable */
-static u_int32_t call_id_pair; /* call id (to terminate call) */
-int window=10;
-int pptp_sock=-1;
-struct in_addr inetaddrs[2];
-
-/* Needed by this and ctrlpacket.c */
-int pptpctrl_debug = 0; /* specifies if debugging is on or off */
-uint16_t unique_call_id = 0xFFFF; /* Start value for our call IDs on this TCP link */
-int pptp_timeout=1000000;
-
-int gargc; /* Command line argument count */
-char **gargv; /* Command line argument vector */
-
-/* Local function prototypes */
-static void bail(int sigraised);
-static void pptp_handle_ctrl_connection(char **pppaddrs, struct in_addr *inetaddrs);
-
-static int startCall(char **pppaddrs, struct in_addr *inetaddrs);
-static void launch_pppd(char **pppaddrs, struct in_addr *inetaddrs);
-
-/* Oh the horror.. lets hope this covers all the ones we have to handle */
-#if defined(O_NONBLOCK) && !defined(__sun__) && !defined(__sun)
-#define OUR_NB_MODE O_NONBLOCK
-#else
-#define OUR_NB_MODE O_NDELAY
-#endif
-
-/* read a command line argument, a flag alone */
-#define GETARG_INT(X) \
- X = atoi(argv[arg++])
-
-/* read a command line argument, a string alone */
-#define GETARG_STRING(X) \
- X = strdup(argv[arg++])
-
-/* read a command line argument, a presence flag followed by string */
-#define GETARG_VALUE(X) \
- if(atoi(argv[arg++]) != 0) \
- strlcpy(X, argv[arg++], sizeof(X)); \
- else \
- *X = '\0'
-
-int main(int argc, char **argv)
-{
- char pppLocal[16]; /* local IP to pass to pppd */
- char pppRemote[16]; /* remote IP address to pass to pppd */
- struct sockaddr_in addr; /* client address */
- socklen_t addrlen;
- int arg = 1;
- int flags;
- char *pppaddrs[2] = { pppLocal, pppRemote };
-
- gargc = argc;
- gargv = argv;
-
- /* fail if argument count invalid */
- if (argc < 7) {
- fprintf(stderr, "pptpctrl: insufficient arguments, see man pptpctrl\n");
- exit(2);
- }
-
- /* open a connection to the syslog daemon */
- openlog("pptpd", LOG_PID, PPTP_FACILITY);
-
- /* autoreap if supported */
- signal(SIGCHLD, SIG_IGN);
-
- /* note: update pptpctrl.8 if the argument list format is changed */
- GETARG_INT(pptpctrl_debug);
- GETARG_INT(noipparam);
- GETARG_VALUE(pppdxfig);
- GETARG_VALUE(speed);
- GETARG_VALUE(pppLocal);
- GETARG_VALUE(pppRemote);
- if (arg < argc) GETARG_INT(pptp_timeout);
- if (arg < argc) GETARG_STRING(ppp_binary);
- if (arg < argc) GETARG_INT(pptp_logwtmp);
-
- if (pptpctrl_debug) {
- if (*pppLocal)
- syslog(LOG_DEBUG, "CTRL: local address = %s", pppLocal);
- if (*pppRemote)
- syslog(LOG_DEBUG, "CTRL: remote address = %s", pppRemote);
- if (*speed)
- syslog(LOG_DEBUG, "CTRL: pppd speed = %s", speed);
- if (*pppdxfig)
- syslog(LOG_DEBUG, "CTRL: pppd options file = %s", pppdxfig);
- }
-
- addrlen = sizeof(addr);
- if (getsockname(clientSocket, (struct sockaddr *) &addr, &addrlen) != 0) {
- syslog(LOG_ERR, "CTRL: getsockname() failed");
- syslog_perror("getsockname");
- close(clientSocket);
- bail(0); /* NORETURN */
- }
- inetaddrs[0] = addr.sin_addr;
-
- addrlen = sizeof(addr);
- if (getpeername(clientSocket, (struct sockaddr *) &addr, &addrlen) != 0) {
- syslog(LOG_ERR, "CTRL: getpeername() failed");
- syslog_perror("getpeername");
- close(clientSocket);
- bail(0); /* NORETURN */
- }
- inetaddrs[1] = addr.sin_addr;
-
- /* Set non-blocking */
- if ((flags = fcntl(clientSocket, F_GETFL, arg /* ignored */)) == -1 ||
- fcntl(clientSocket, F_SETFL, flags|OUR_NB_MODE) == -1) {
- syslog(LOG_ERR, "CTRL: Failed to set client socket non-blocking");
- syslog_perror("fcntl");
- close(clientSocket);
- bail(0); /* NORETURN */
- }
-
-
- /* Fiddle with argv */
- my_setproctitle(gargc, gargv, "pptpd [%s]%20c",
- inet_ntoa(addr.sin_addr), ' ');
-
- /* be ready for a grisly death */
- sigpipe_create();
- sigpipe_assign(SIGCHLD);
- sigpipe_assign(SIGTERM);
- NOTE_VALUE(PAC, call_id_pair, htons(-1));
- NOTE_VALUE(PNS, call_id_pair, htons(-1));
-
- syslog(LOG_INFO, "CTRL: Client %s control connection started", inet_ntoa(addr.sin_addr));
- pptp_handle_ctrl_connection(pppaddrs, inetaddrs);
-
- syslog(LOG_DEBUG, "CTRL: Reaping child PPP[%i]", pppfork);
- bail(0); /* NORETURN */
- syslog(LOG_INFO, "CTRL: Client %s control connection finished", inet_ntoa(addr.sin_addr));
- return 1; /* make gcc happy */
-}
-
-//SDY special for prevent pppd session stay on air then need to stop
-void waitclosefork(int sigraised)
-{
- //SDY senf term to fork();
- if (pppfork > 0)
- {
- if (sigraised != SIGCHLD) {
- syslog(LOG_INFO, "CTRL: Client pppd TERM sending");
- kill(pppfork,SIGTERM);
- }
- syslog(LOG_INFO, "CTRL: Client pppd finish wait");
- waitpid(pppfork, NULL, 0);
- }
-}
-
-/*
- * Local functions only below
- */
-
-/*
- * pptp_handle_ctrl_connection
- *
- * 1. read a packet (should be start_ctrl_conn_rqst)
- * 2. reply to packet (send a start_ctrl_conn_rply)
- * 3. proceed with GRE and CTRL connections
- *
- * args: pppaddrs - ppp local and remote addresses (strings)
- * inetaddrs - local and client socket address
- * retn: 0 success, -1 failure
- */
-static void pptp_handle_ctrl_connection(char **pppaddrs, struct in_addr *inetaddrs)
-{
-
- /* For echo requests used to check link is alive */
- int echo_wait = FALSE; /* Waiting for echo? */
- u_int32_t echo_count = 0; /* Sequence # of echo */
- time_t echo_time = 0; /* Time last echo req sent */
- struct timeval idleTime; /* How long to select() */
-
- /* General local variables */
- ssize_t rply_size; /* Reply packet size */
- fd_set fds; /* For select() */
- int maxfd = clientSocket; /* For select() */
- int send_packet; /* Send a packet this time? */
-#if BSDUSER_PPP || SLIRP
-/* not needed by stuff which uses socketpair() in startCall() */
-#define init 1
-#else
- int init = 0; /* Has pppd initialized the pty? */
-#endif
- int sig_fd = sigpipe_fd(); /* Signal pipe descriptor */
-
- unsigned char packet[PPTP_MAX_CTRL_PCKT_SIZE];
- unsigned char rply_packet[PPTP_MAX_CTRL_PCKT_SIZE];
-
- struct sockaddr_pppox dst_addr;
-
- for (;;) {
-
- FD_ZERO(&fds);
- FD_SET(sig_fd, &fds);
- FD_SET(clientSocket, &fds);
-
- /* set timeout */
- idleTime.tv_sec = IDLE_WAIT;
- idleTime.tv_usec = 0;
-
- /* default: do nothing */
- send_packet = FALSE;
-
- switch (select(maxfd + 1, &fds, NULL, NULL, &idleTime)) {
- case -1: /* Error with select() */
- if (errno != EINTR)
- syslog(LOG_ERR, "CTRL: Error with select(), quitting");
- goto leave_clear_call;
-
- case 0:
- if (echo_wait != TRUE) {
- /* Timeout. Start idle link detection. */
- echo_count++;
- if (pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Sending ECHO REQ id %d", echo_count);
- time(&echo_time);
- make_echo_req_packet(rply_packet, &rply_size, echo_count);
- echo_wait = TRUE;
- send_packet = TRUE;
- }
- break;
-
- default:
- break;
- }
-
- /* check for pending SIGTERM delivery */
- if (FD_ISSET(sig_fd, &fds)) {
- int signum = sigpipe_read();
- if (signum == SIGCHLD)
- bail(SIGCHLD);
- else if (signum == SIGTERM)
- bail(SIGTERM);
- }
-
- /* handle control messages */
-
- if (FD_ISSET(clientSocket, &fds)) {
- send_packet = TRUE;
- switch (read_pptp_packet(clientSocket, packet, rply_packet, &rply_size)) {
- case 0:
- syslog(LOG_ERR, "CTRL: CTRL read failed");
- goto leave_drop_call;
-
- case -1:
- send_packet = FALSE;
- break;
-
- case STOP_CTRL_CONN_RQST:
- if (pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Received STOP CTRL CONN request (disconnecting)");
- send_pptp_packet(clientSocket, rply_packet, rply_size);
- goto leave_drop_call;
-
- case CALL_CLR_RQST:
- if(pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Received CALL CLR request (closing call)");
- /* violating RFC */
- goto leave_drop_call;
-
- case OUT_CALL_RQST:
- /* for killing off the link later (ugly) */
- NOTE_VALUE(PAC, call_id_pair, ((struct pptp_out_call_rply *) (rply_packet))->call_id);
- NOTE_VALUE(PNS, call_id_pair, ((struct pptp_out_call_rply *) (rply_packet))->call_id_peer);
-
- dst_addr.sa_family=AF_PPPOX;
- dst_addr.sa_protocol=PX_PROTO_PPTP;
- dst_addr.sa_addr.pptp.call_id=htons(((struct pptp_out_call_rply *) (rply_packet))->call_id_peer);
- dst_addr.sa_addr.pptp.sin_addr=inetaddrs[1];
-
- if (connect(pptp_sock,(struct sockaddr*)&dst_addr,sizeof(dst_addr))){
- syslog(LOG_INFO,"CTRL: failed to connect PPTP socket (%s)\n",strerror(errno));
- goto leave_drop_call; //SDY close on correct!
- break;
- }
-
-
- /* change process title for accounting and status scripts */
- my_setproctitle(gargc, gargv,
- "pptpd [%s:%04X - %04X]",
- inet_ntoa(inetaddrs[1]),
- ntohs(((struct pptp_out_call_rply *) (rply_packet))->call_id_peer),
- ntohs(((struct pptp_out_call_rply *) (rply_packet))->call_id));
- /* start the call, by launching pppd */
- syslog(LOG_INFO, "CTRL: Starting call (launching pppd, opening GRE)");
- startCall(pppaddrs, inetaddrs);
- close(pptp_sock);
- pptp_sock=-1;
- break;
-
- case ECHO_RPLY:
- if (echo_wait == TRUE && ((struct pptp_echo_rply *) (packet))->identifier == echo_count)
- echo_wait = FALSE;
- else
- syslog(LOG_WARNING, "CTRL: Unexpected ECHO REPLY packet");
- /* FALLTHRU */
- case SET_LINK_INFO:
- send_packet = FALSE;
- break;
-
-#ifdef PNS_MODE
- case IN_CALL_RQST:
- case IN_CALL_RPLY:
- case IN_CALL_CONN:
-#endif
-
- case CALL_DISCONN_NTFY:
- case STOP_CTRL_CONN_RPLY:
- /* These don't generate replies. Also they come from things we don't send in this section. */
- syslog(LOG_WARNING, "CTRL: Got a reply to a packet we didn't send");
- send_packet = FALSE;
- break;
-
- /* Otherwise, the already-formed reply will do fine, so send it */
- }
- }
-
- /* send reply packet - this may block, but it should be very rare */
- if (send_packet == TRUE && send_pptp_packet(clientSocket, rply_packet, rply_size) < 0) {
- syslog(LOG_ERR, "CTRL: Error sending GRE, aborting call");
- goto leave_clear_call;
- }
-
- /* waiting for echo reply and curtime - echo_time > max wait */
- if (echo_wait == TRUE && (time(NULL) - echo_time) > MAX_ECHO_WAIT) {
- syslog(LOG_INFO, "CTRL: Session timed out, ending call");
- goto leave_clear_call;
- }
- }
- /* Finished! :-) */
-leave_drop_call:
- NOTE_VALUE(PAC, call_id_pair, htons(-1));
- NOTE_VALUE(PNS, call_id_pair, htons(-1));
- close(clientSocket);
-leave_clear_call:
- return;
-#ifdef init
-#undef init
-#endif
-}
-
-
-/*
- * This is the custom exit() for this program.
- *
- * Updated to also be the default SIGTERM handler, and if
- * the link is going down for unnatural reasons, we will close it
- * right now, it's only been tested for win98, other tests would be nice
- * -tmk
- */
-static void bail(int sigraised)
-{
- if (sigraised)
- syslog(LOG_INFO, "CTRL: Exiting on signal %d", sigraised);
-
- waitclosefork(sigraised);
-
- /* send a disconnect to the other end */
- /* ignore any errors */
- if (GET_VALUE(PAC, call_id_pair) != htons(-1)) {
- fd_set connSet; /* fd_set for select() */
- struct timeval tv; /* time to wait for reply */
- unsigned char packet[PPTP_MAX_CTRL_PCKT_SIZE];
- unsigned char rply_packet[PPTP_MAX_CTRL_PCKT_SIZE];
- ssize_t rply_size; /* reply packet size */
- int pkt;
- int retry = 0;
-
- if (pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Exiting with active call");
-
- make_call_admin_shutdown(rply_packet, &rply_size);
- if(send_pptp_packet(clientSocket, rply_packet, rply_size) < 0)
- goto skip;
-
- make_stop_ctrl_req(rply_packet, &rply_size);
- if(send_pptp_packet(clientSocket, rply_packet, rply_size) < 0)
- goto skip;
-
- FD_ZERO(&connSet);
- FD_SET(clientSocket, &connSet);
- tv.tv_sec = 5; /* wait 5 secs for a reply then quit */
- tv.tv_usec = 0;
-
- /* Wait for STOP CTRL CONN RQST or RPLY */
- while (select(clientSocket + 1, &connSet, NULL, NULL, &tv) == 1) {
- switch((pkt = read_pptp_packet(clientSocket, packet, rply_packet, &rply_size))) {
- case STOP_CTRL_CONN_RQST:
- send_pptp_packet(clientSocket, rply_packet, rply_size);
- goto skip;
- case CALL_CLR_RQST:
- syslog(LOG_WARNING, "CTRL: Got call clear request after call manually shutdown - buggy client");
- break;
- case STOP_CTRL_CONN_RPLY:
- goto skip;
- case -1:
- syslog(LOG_WARNING, "CTRL: Retryable error in disconnect sequence");
- retry++;
- break;
- case 0:
- syslog(LOG_WARNING, "CTRL: Fatal error reading control message in disconnect sequence");
- goto skip;
- default:
- syslog(LOG_WARNING, "CTRL: Unexpected control message %d in disconnect sequence", pkt);
- retry++;
- break;
- }
- tv.tv_sec = 5; /* wait 5 secs for another reply then quit */
- tv.tv_usec = 0;
- if (retry > 100) {
- syslog(LOG_WARNING, "CTRL: Too many retries (%d) - giving up", retry);
- break;
- }
- }
-
- skip:
- NOTE_VALUE(PAC, call_id_pair, htons(-1));
- NOTE_VALUE(PNS, call_id_pair, htons(-1));
- close(clientSocket);
- }
-
- if (pptpctrl_debug)
- syslog(LOG_DEBUG, "CTRL: Exiting now");
-}
-
-/*
- * startCall
- *
- * Launches PPPD for the call.
- *
- * args: pppaddrs - local/remote IPs or "" for either/both if none
- * retn: pty file descriptor
- *
- */
-static int startCall(char **pppaddrs, struct in_addr *inetaddrs)
-{
- /* Launch the PPPD */
-#ifndef HAVE_FORK
- switch(pppfork=vfork()){
-#else
- switch(pppfork=fork()){
-#endif
- case -1: /* fork() error */
- syslog(LOG_ERR, "CTRL: Error forking to exec pppd");
- _exit(1);
-
- case 0: /* child */
-/* In case we move clientSocket back off stdin */
-#ifndef clientSocket
- if (clientSocket > 1)
- close(clientSocket);
-#elif clientSocket > 1
- close(clientSocket);
-#endif
- launch_pppd(pppaddrs, inetaddrs);
- syslog(LOG_ERR, "CTRL: PPPD launch failed! (launch_pppd did not fork)");
- _exit(1);
- }
-
- return -1;
-}
-
-/*
- * launch_pppd
- *
- * Launches the PPP daemon. The PPP daemon is responsible for assigning the
- * PPTP client its IP address.. These values are assigned via the command
- * line.
- *
- * Add return of connected ppp interface
- *
- * retn: 0 on success, -1 on failure.
- *
- */
-static void launch_pppd(char **pppaddrs, struct in_addr *inetaddrs)
-{
- char *pppd_argv[25];
- int an = 0;
- sigset_t sigs;
- char tmp[128];
-
- pppd_argv[an++] = ppp_binary;
-
- if (pptpctrl_debug) {
- syslog(LOG_DEBUG,
- "CTRL (PPPD Launcher): program binary = %s",
- pppd_argv[an - 1]);
- }
-
-#if BSDUSER_PPP
-
- /* The way that Brian Somers' user-land ppp works is to use the
- * system name as a reference for most of the useful options. Hence
- * most things can't be defined on the command line. On OpenBSD at
- * least the file used for the systems is /etc/ppp/ppp.conf, where
- * the pptp stanza should look something like:
-
- pptp:
- set speed sync
- enable pap
- enable chap
- set dns a.a.a.a b.b.b.b
- set ndbs x.x.x.x y.y.y.y
- accept dns
- add 10.0.0/24
-
- * To be honest, at the time of writing, I haven't had the thing
- * working enough to understand :) I will update this comment and
- * make a sample config available when I get there.
- */
-
- /* options for BSDUSER_PPP
- *
- * ignores IP addresses, config file option, speed
- * fix usage info in pptpd.c and configure script if this changes
- *
- * IP addresses can be specified in /etc/ppp/ppp.secret per user
- */
- pppd_argv[an++] = "-direct";
- pppd_argv[an++] = "pptp"; /* XXX this is the system name */
- /* should be dynamic - PMG */
-
-#elif SLIRP
-
- /* options for SLIRP
- *
- * ignores IP addresses from config - SLIRP handles this
- */
- pppd_argv[an++] = "-P";
- pppd_argv[an++] = "+chap";
- pppd_argv[an++] = "-b";
-
- /* If a speed has been specified, use it
- * if not, use "smart" default (defaults.h)
- */
- if (*speed) {
- pppd_argv[an++] = speed;
- } else {
- pppd_argv[an++] = PPP_SPEED_DEFAULT;
- }
-
- if (*pppdxfig) {
- pppd_argv[an++] = "-f";
- pppd_argv[an++] = pppdxfig;
- }
-
- if (pptpctrl_debug) {
- syslog(LOG_DEBUG, "CTRL (PPPD Launcher): Connection speed = %s", pppd_argv[an - 1]);
- }
-#else
-
- /* options for 'normal' pppd */
-
- pppd_argv[an++] = "local";
-
- /* If a pppd option file is specified, use it
- * if not, pppd will default to /etc/ppp/options
- */
- if (*pppdxfig) {
- pppd_argv[an++] = "file";
- pppd_argv[an++] = pppdxfig;
- }
-
- /* If a speed has been specified, use it
- * if not, use "smart" default (defaults.h)
- */
- if (*speed) {
- pppd_argv[an++] = speed;
- } else {
- pppd_argv[an++] = PPP_SPEED_DEFAULT;
- }
-
- if (pptpctrl_debug) {
- if (*pppaddrs[0])
- syslog(LOG_DEBUG, "CTRL (PPPD Launcher): local address = %s", pppaddrs[0]);
- if (*pppaddrs[1])
- syslog(LOG_DEBUG, "CTRL (PPPD Launcher): remote address = %s", pppaddrs[1]);
- }
-
- if (*pppaddrs[0] || *pppaddrs[1]) {
- char pppInterfaceIPs[33];
- sprintf(pppInterfaceIPs, "%s:%s", pppaddrs[0], pppaddrs[1]);
- pppd_argv[an++] = pppInterfaceIPs;
- }
-#endif
-
- if (!noipparam) {
- pppd_argv[an++] = "ipparam";
- pppd_argv[an++] = inet_ntoa(inetaddrs[1]);
- }
-
- if (pptp_logwtmp) {
- pppd_argv[an++] = "plugin";
- pppd_argv[an++] = "/usr/lib/pptpd/pptpd-logwtmp.so";
- pppd_argv[an++] = "pptpd-original-ip";
- pppd_argv[an++] = inet_ntoa(inetaddrs[1]);
- }
-
- pppd_argv[an++] = "plugin";
- pppd_argv[an++] = "pptp.so";
- pppd_argv[an++] = "pptp_client";
- strcpy(tmp,inet_ntoa(inetaddrs[1]));
- pppd_argv[an++] = strdup(tmp);
- pppd_argv[an++] = "pptp_sock";
- sprintf(tmp,"%u",pptp_sock);
- pppd_argv[an++] = strdup(tmp);
- pppd_argv[an++] = "nodetach";
-
- /* argv arrays must always be NULL terminated */
- pppd_argv[an++] = NULL;
- /* make sure SIGCHLD is unblocked, pppd does not expect it */
- sigfillset(&sigs);
- sigprocmask(SIG_UNBLOCK, &sigs, NULL);
- /* run pppd now */
- execvp(pppd_argv[0], pppd_argv);
- /* execvp() failed */
- syslog(LOG_ERR,
- "CTRL (PPPD Launcher): Failed to launch PPP daemon. %s",
- strerror(errno));
-}
diff --git a/pptpd-1.3.3/pptpctrl.h b/pptpd-1.3.3/pptpctrl.h
deleted file mode 100644
index 92c53a7..0000000
--- a/pptpd-1.3.3/pptpctrl.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * pptpctrl.h
- *
- * PPTP control function prototypes.
- *
- * $Id: pptpctrl.h,v 1.1.1.1 2002/06/21 08:52:01 fenix_nl Exp $
- */
-
-#ifndef _PPTPD_PPTPCTRL_H
-#define _PPTPD_PPTPCTRL_H
-
-extern int pptpctrl_debug;
-extern int window;
-extern struct in_addr inetaddrs[2];
-extern int pptp_sock;
-
-#endif /* !_PPTPD_PPTPCTRL_H */
diff --git a/pptpd-1.3.3/pptpd.8 b/pptpd-1.3.3/pptpd.8
deleted file mode 100644
index 2bbc7ab..0000000
--- a/pptpd-1.3.3/pptpd.8
+++ /dev/null
@@ -1,205 +0,0 @@
-.TH PPTPD 8 "29 December 2005"
-.SH NAME
-pptpd - PPTP VPN daemon
-.SH SYNOPSIS
-.PP
-.B pptpd
-[
-.IR options
-]
-.SH DESCRIPTION
-.B pptpd
-is the Poptop PPTP daemon, which manages tunnelled PPP connections
-encapsulated in GRE using the PPTP VPN protocol. It may contain
-features like IP address management and TCP wrappers if compiled in.
-.SH OPTIONS
-
-Here we document the command line options. See
-.BR pptpd.conf (5)
-for configuration directives, IP address allocation, routing, and
-firewall rules.
-
-.TP
-\fB-b\fR|\fB--bcrelay \fIinternal-interface
-specifies that broadcasts received on the server's internal
-network interface should be relayed to the clients.
-
-.TP
-\fB-c\fR|\fB--conf \fIconf-file
-specifies the configuration file for
-.B pptpd
-(default
-.IR /etc/pptpd.conf )
-
-.TP
-.BR -d | --debug
-turns on debugging mode, causing more debugging messages to be sent
-to syslog.
-
-.TP
-\fB-e\fR|\fB--ppp \fIpppd-program
-use
-.I pppd-program
-in place of the default
-.BR pppd (8).
-
-.TP
-.BR -f | --fg
-run in the foreground instead of detaching from terminal
-
-.TP
-.BR -h | --help
-display program usage.
-
-.TP
-.BR -i | --noipparam
-do not send the client's IP address to ip-up scripts (required if you are using the
-.BR pppd (8)
-.I ipparam
-option for some other purpose).
-
-.TP
-\fB-l\fR|\fB--listen \fIx.x.x.x
-specifies the local interface IP address to listen on.
-
-.TP
-\fB-o\fR|\fB--option \fIppp-conf-file
-specifies that pptpd should specify an alternate configuration file
-for the ppp daemon (the default is normally
-.I /etc/ppp/options
-but may vary depending on your ppp daemon).
-
-.TP
-\fB-p\fR|\fB--pidfile \fIpid-file
-specifies an alternate location to store the process ID file (default
-.IR /var/run/pptpd.pid ).
-
-.TP
-\fB-s\fR|\fB--speed \fIbaud
-specifies that the speed
-.I baud
-should be passed to the ppp daemon as the tty speed to use (in some
-cases this is ignored by the ppp daemon).
-
-.TP
-\fB-t\fR|\fB--stimeout \fIseconds
-specifies the number of seconds to wait for the first packet before
-dropping the connection. This is a denial of service protection
-feature.
-
-.TP
-\fB-T\fR|\fB--ptimeout \fImilliseconds
-number of miliseconds to wait for a PPTP "ack" packet after transmitting
-was stoped due to sliding window exceeded. The default is 1000 miliseconds.
-
-.TP
-\fB-k\fR|\fB--keep
-Keep connections after pptpd daemon exit. Default do not keep connections,
-all connections would be terminated on pptpd exit.
-
-.TP
-.BR -w | --logwtmp
-update
-.BR wtmp (5)
-as users connect and disconnect. See
-.BR wtmp (1).
-
-.TP
-\fB-C\fR|\fB--connections \fIn
-limits the number of client connections that may be accepted. Corresponds to the
-.BR connections
-option in
-.IR pptpd.conf .
-If pptpd is allocating IP addresses (e.g.
-.BR --delegate
-is not used) then the number of connections is also limited by the
-.BR remoteip
-option in
-.IR pptpd.conf .
-
-.TP
-.BR -D | --delegate
-delegates the allocation of client IP addresses to
-.BR pppd (8).
-Without this option, which is the default, pptpd manages the list of
-IP addresses for clients and passes the next free address to pppd.
-With this option, pptpd does not pass an address, and so pppd may use
-radius or chap-secrets to allocate an address.
-
-.TP
-.BR -v | --version
-displays the current version of the pptp daemon.
-
-.SH FILES
-/etc/pptpd.conf
-.br
-/var/run/pptpd.pid
-
-.SH DEBUGGING
-To turn on debugging, add 'debug' to /etc/pptpd.conf and your
-PPP options file, and restart pptpd.
-.br
-.LP
-Typically the PPP options file is options.pptpd in /etc/ppp, though on
-some distributions it may be pptpd-options. Use your package manager
-to find it, e.g. 'rpm -ql pptpd | grep options' or 'dpkg --listfiles
-pptpd | grep options'.
-.br
-.LP
-You may need to configure syslogd to catch debug messages. e.g. edit
-/etc/syslog.conf and add something similar to the example below, then
-restart syslogd.
-.br
-.LP
-# debug logging
-.br
-*.debug;mail.none /var/log/debug
-.br
-.LP
-This will log all debug information, except mail, to the file
-/var/log/debug. Note that this is a lot of information and might
-flood your disks. If performance is an issue, you can try turning off
-sync during your debugging, by prefixing the destination with '-'.
-.br
-.LP
-# debug logging
-.br
-*.debug;mail.none -/var/log/debug
-.br
-.LP
-Disable this line and restart syslog after you are done debugging.
-See the syslog man pages for more details.
-.br
-.LP
-
-.SH AUTHORS
-Poptop is written by Matthew Ramsay <matthewr@moreton.com.au>, David Luyer
-<luyer@ucs.uwa.edu.au>, Kevin Thayer <tmk@netmagic.net>, Peter Galbavy
-<Peter.Galbavy@knowledge.com> and others. Development has been moved to
-SourceForge and worked on by Richard de Vroede <r.devroede@linvision.com>
-since June 26, 2002.
-.SH COPYRIGHT
-Copyright \(co 1999 Matthew Ramsay and others.
-.LP
-Poptop 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, or (at your option) any later
-version.
-.LP
-Poptop 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.
-.LP
-You should have received a copy of the GNU General Public License along
-with Poptop; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-.SH AVAILABILITY
-The most recent version of Poptop is available for download from
-SourceForge at
-.IR http://sourceforge.net/projects/poptop .
-.SH "SEE ALSO"
-.BR pppd (8),
-.BR pptpd (8),
-.BR pptpd.conf (5).
-.BR pppd-pptp (8)
diff --git a/pptpd-1.3.3/pptpd.c b/pptpd-1.3.3/pptpd.c
deleted file mode 100644
index b6d2b6a..0000000
--- a/pptpd-1.3.3/pptpd.c
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
- * pptpd.c
- *
- * Grabs any command line argument and processes any further options in
- * the pptpd config file, before throwing over to pptpmanager.c.
- *
- * $Id: pptpd.c,v 1.18 2006/09/04 23:17:25 quozl Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef __linux__
-#define _GNU_SOURCE 1 /* strdup() prototype, broken arpa/inet.h */
-#endif
-
-#ifdef __svr4__
-#define __EXTENSIONS__ 1 /* strdup() prototype */
-#endif
-
-#ifdef __sgi__
-#define _XOPEN_SOURCE 500 /* strdup() prototype */
-#endif
-
-#include "our_syslog.h"
-#include "our_getopt.h"
-
-#include <fcntl.h>
-#include <netdb.h>
-#include <signal.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "configfile.h"
-#include "defaults.h"
-#include "compat.h"
-#include "pptpmanager.h"
-
-#ifdef CONFIG_NETtel
-#include <linux/ledman.h>
-#endif
-
-/* command line arg variables */
-char *ppp_binary = NULL;
-char *pppdoptstr = NULL;
-char *speedstr = NULL;
-char *bindaddr = NULL;
-#ifdef BCRELAY
-char *bcrelay = NULL;
-#endif
-int pptp_debug = 0;
-int pptp_noipparam = 0;
-int pptp_logwtmp = 0;
-int pptp_delegate = 0;
-
-int pptp_stimeout = STIMEOUT_DEFAULT;
-int pptp_ptimeout = PTIMEOUT_DEFAULT;
-
-int pptp_connections = CONNECTIONS_DEFAULT;
-
-int keep_connections=0;
-
-/* Local prototypes */
-static void processIPStr(int type, char *ipstr);
-
-#ifndef HAVE_DAEMON
-static void my_daemon(int argc, char **argv);
-#endif
-
-static void log_pid(char *pid_file);
-static char *lookup(char *);
-
-#ifdef BCRELAY
-static void launch_bcrelay();
-static pid_t bcrelayfork;
-#endif
-
-static void showversion()
-{
- printf("accel-pptpd v%s ", VERSION);
- printf("compiled for pppd-%s, linux-%s\n",PPPD_VERSION,KERNELVERSION);
-}
-static void showusage(char *prog)
-{
- showversion();
- printf("Usage: pptpd [options], where options are:\n\n");
-#ifdef BCRELAY
- printf(" [-b] [--bcrelay if] Use broadcast relay for broadcasts comming from.\n");
- printf(" the specified interface (default is eth1).\n");
-#endif
- printf(" [-c] [--conf file] Specifies the config file to read default\n");
- printf(" settings from (default is %s).\n", PPTPD_CONFIG_FILE_DEFAULT);
- printf(" [-d] [--debug] Turns on debugging (to syslog).\n");
- printf(" [-e] [--ppp file] Use alternate pppd binary, default %s.\n", PPP_BINARY);
- printf(" [-f] [--fg] Run in foreground.\n");
- printf(" [-h] [--help] Displays this help message.\n");
- printf(" [-i] [--noipparam] Suppress the passing of the client's IP address\n");
- printf(" to PPP, which is done by default otherwise.\n");
- printf(" [-l] [--listen x.x.x.x] Specifies IP of local interface to listen to.\n");
-#if !defined(BSDUSER_PPP)
- printf(" [-o] [--option file] Specifies the PPP options file to use\n");
- printf(" (default is /etc/ppp/options).\n");
-#endif
- printf(" [-p] [--pidfile file] Specifies the file to write the process ID to\n");
- printf(" (default is /var/run/pptpd.pid).\n");
-#if !defined(BSDUSER_PPP)
- printf(" [-s] [--speed baud] Specifies the baud speed for the PPP daemon\n");
- printf(" (default is 115200).\n");
-#endif
- printf(" [-t] [--stimeout seconds] Specifies the timeout for the first packet. This is a DOS protection\n");
- printf(" (default is 10).\n");
- printf(" [-T] [--ptimeout msec] Specifies the maximum timeout for the packet.\n");
- printf(" (default is 1000).\n");
- printf(" [-v] [--version] Displays the pptpd version number.\n");
- printf(" [-w] [--logwtmp] Update wtmp as users login.\n");
- printf(" [-C] [--connections n] Limit on number of connections.\n");
- printf(" [-D] [--delegate] Delegate IP allocation to pppd.\n");
- printf(" [-k] [--keep] Keep connections after exit.\n");
- printf(" (default do not keep).\n");
-
- printf("\n\nLogs and debugging go to syslog as DAEMON.");
-
- printf("\n\nCommand line options will override any default settings and any settings\n");
- printf("specified in the config file (default config file: %s).\n\n", PPTPD_CONFIG_FILE_DEFAULT);
-}
-
-
-
-int main(int argc, char **argv)
-{
- /* command line options */
- int c;
-
- /* function-local options */
- int foreground = FALSE;
- char *pid_file = NULL;
-
- /* config file */
- char *configFile = NULL;
-
- /* config file parsing temp strings */
- char tmp[MAX_CONFIG_STRING_SIZE], *tmpstr;
-
- /* open a connection to the syslog daemon */
- openlog("pptpd", LOG_PID, PPTP_FACILITY);
- syslog(LOG_ERR, "MGR: Config file not found!");
-
- /* process command line options */
- while (1) {
- int option_index = 0;
-#ifdef BCRELAY
- char *optstring = "b:c:de:fhil:o:p:s:t:T:vwC:Dk";
-#else
- char *optstring = "c:de:fhil:o:p:s:t:T:vwC:Dk";
-#endif
-
- static struct option long_options[] =
- {
-#ifdef BCRELAY
- {"bcrelay", 1, 0, 0},
-#endif
- {"conf", 1, 0, 'c'},
- {"debug", 0, 0, 'd'},
- {"ppp", 1, 0, 'e'},
- {"fg", 0, 0, 'f'},
- {"help", 0, 0, 'h'},
- {"noipparam", 0, 0, 'i'},
- {"listen", 1, 0, 'l'},
- {"option", 1, 0, 'o'},
- {"pidfile", 1, 0, 'p'},
- {"speed", 1, 0, 's'},
- {"stimeout", 1, 0, 't'},
- {"ptimeout", 1, 0, 'T'},
- {"version", 0, 0, 'v'},
- {"logwtmp", 0, 0, 'w'},
- {"connections", 1, 0, 'C'},
- {"delegate", 0, 0, 'D'},
- {"keep", 0, 0, 'k'},
- {0, 0, 0, 0}
- };
-
- c = getopt_long(argc, argv, optstring, long_options, &option_index);
- if (c == -1)
- break;
- /* convert long options to short form */
- if (c == 0)
-#ifdef BCRELAY
- c = "bcdefhilopstvwCDk"[option_index];
-#else
- c = "cdefhilopstvwCDk"[option_index];
-#endif
- switch (c) {
-#ifdef BCRELAY
- case 'b': /* --bcrelay */
- if (bcrelay) free(bcrelay);
- bcrelay = strdup(optarg);
- break;
-#endif
-
- case 'l': /* --listen */
- tmpstr = lookup(optarg);
- if (!tmpstr) {
- syslog(LOG_ERR, "MGR: Invalid listening address: %s!", optarg);
- return 1;
- }
- if (bindaddr) free(bindaddr);
- bindaddr = strdup(tmpstr);
- break;
-
- case 'h': /* --help */
- showusage(argv[0]);
- return 0;
-
- case 'i': /* --noipparam */
- pptp_noipparam = TRUE;
- break;
-
- case 'e': /* --ppp */
- if (ppp_binary) free(ppp_binary);
- ppp_binary = strdup(optarg);
- break;
-
- case 'd': /* --debug */
- pptp_debug = TRUE;
- break;
-
- case 'f': /* --fg */
- foreground = TRUE;
- break;
-
- case 'v': /* --version */
- showversion();
- return 0;
-
- case 'w': /* --logwtmp */
- pptp_logwtmp = TRUE;
- break;
-
- case 'C': /* --connections */
- pptp_connections = atoi(optarg);
- break;
-
- case 'D': /* --delegate */
- pptp_delegate = TRUE;
- break;
-
- case 'o': /* --option */
- if (pppdoptstr) free(pppdoptstr);
- pppdoptstr = strdup(optarg);
- break;
-
- case 'p': /* --pidfile */
- if (pid_file) free(pid_file);
- pid_file = strdup(optarg);
- break;
-
- case 's': /* --speed */
- if (speedstr) free(speedstr);
- speedstr = strdup(optarg);
- break;
-
- case 't': /* --stimeout */
- pptp_stimeout = atoi(optarg);
- break;
-
- case 'T': /* --stimeout */
- pptp_ptimeout = atoi(optarg);
- break;
- case 'k': /* --keep */
- keep_connections = 1;
- break;
-
- case 'c': /* --conf */
- {
- FILE *f;
- if (!(f = fopen(optarg, "r"))) {
- syslog(LOG_ERR, "MGR: Config file not found!");
- return 1;
- }
- fclose(f);
- if(configFile) free(configFile);
- configFile = strdup(optarg);
- break;
- }
-
- default:
- showusage(argv[0]);
- return 1;
- }
- }
-
- /* Now that we have all the command line args.. lets open the
- * conf file and add anything else (remembering not to override
- * anything since the command line has more privilages :-)
- */
-
- if (!configFile)
- configFile = strdup(PPTPD_CONFIG_FILE_DEFAULT);
-
- if (read_config_file(configFile, CONNECTIONS_KEYWORD, tmp) > 0) {
- pptp_connections = atoi(tmp);
- if (pptp_connections <= 0)
- pptp_connections = CONNECTIONS_DEFAULT;
- }
-
- slot_init(pptp_connections);
-
- if (!pptp_debug && read_config_file(configFile, DEBUG_KEYWORD, tmp) > 0)
- pptp_debug = TRUE;
-
-#ifdef BCRELAY
- if (!bcrelay && read_config_file(configFile, BCRELAY_KEYWORD, tmp) > 0)
- bcrelay = strdup(tmp);
-#endif
-
- if (!pptp_stimeout && read_config_file(configFile, STIMEOUT_KEYWORD, tmp) > 0) {
- pptp_stimeout = atoi(tmp);
- if (pptp_stimeout <= 0)
- pptp_stimeout = STIMEOUT_DEFAULT;
- }
-
- if (!pptp_ptimeout && read_config_file(configFile, PTIMEOUT_KEYWORD, tmp) > 0) {
- pptp_ptimeout = atoi(tmp);
- if (pptp_ptimeout <= 0)
- pptp_ptimeout = PTIMEOUT_DEFAULT;
- }
-
- if (!pptp_noipparam && read_config_file(configFile, NOIPPARAM_KEYWORD, tmp) > 0) {
- pptp_noipparam = TRUE;
- }
-
- if (!bindaddr && read_config_file(configFile, LISTEN_KEYWORD, tmp) > 0) {
- tmpstr = lookup(tmp);
- if(!tmpstr) {
- syslog(LOG_ERR, "MGR: Invalid listening address: %s!", tmp);
- return 1;
- }
- bindaddr = strdup(tmpstr);
- }
-
- if (!speedstr && read_config_file(configFile, SPEED_KEYWORD, tmp) > 0)
- speedstr = strdup(tmp);
-
- if (!pppdoptstr && read_config_file(configFile, PPPD_OPTION_KEYWORD, tmp) > 0) {
- pppdoptstr = strdup(tmp);
- }
-
- if (!ppp_binary && read_config_file(configFile, PPP_BINARY_KEYWORD, tmp) > 0) {
- ppp_binary = strdup(tmp);
- }
-
- if (!pptp_logwtmp && read_config_file(configFile, LOGWTMP_KEYWORD, tmp) > 0) {
- pptp_logwtmp = TRUE;
- }
-
- if (!pptp_delegate && read_config_file(configFile, DELEGATE_KEYWORD, tmp) > 0) {
- pptp_delegate = TRUE;
- }
-
- if (read_config_file(configFile, KEEP_KEYWORD, tmp) > 0) {
- keep_connections = TRUE;
- }
-
- if (!pid_file)
- pid_file = strdup((read_config_file(configFile, PIDFILE_KEYWORD,
- tmp) > 0) ? tmp : PIDFILE_DEFAULT);
-
- if (!pptp_delegate) {
- /* NOTE: remote then local, reason can be seen at the end of processIPStr */
-
- /* grab the remoteip string from the config file */
- if (read_config_file(configFile, REMOTEIP_KEYWORD, tmp) <= 0) {
- /* use "smart" defaults */
- strlcpy(tmp, DEFAULT_REMOTE_IP_LIST, sizeof(tmp));
- }
- processIPStr(REMOTE, tmp);
-
- /* grab the localip string from the config file */
- if (read_config_file(configFile, LOCALIP_KEYWORD, tmp) <= 0) {
- /* use "smart" defaults */
- strlcpy(tmp, DEFAULT_LOCAL_IP_LIST, sizeof(tmp));
- }
- processIPStr(LOCAL, tmp);
- }
-
- free(configFile);
-
- /* if not yet set, adopt default PPP binary path */
- if (!ppp_binary) ppp_binary = strdup(PPP_BINARY);
- /* check that the PPP binary is executable */
- if (access(ppp_binary, X_OK) < 0) {
- syslog(LOG_ERR, "MGR: PPP binary %s not executable",
- ppp_binary);
- return 1;
- }
- /* check that the PPP options file is readable */
- if (pppdoptstr && access(pppdoptstr, R_OK) < 0) {
- syslog(LOG_ERR, "MGR: PPP options file %s not readable",
- pppdoptstr);
- return 1;
- }
-#ifdef BCRELAY
- /* check that the bcrelay binary is executable */
- if (bcrelay && access(BCRELAY_BIN, X_OK) < 0) {
- syslog(LOG_ERR, "MGR: bcrelay binary %s not executable",
- BCRELAY_BIN);
- return 1;
- }
-#endif
-
- syslog(LOG_INFO, "accel-pptpd-%s compiled for pppd-%s, linux-%s\n",VERSION,PPPD_VERSION,KERNELVERSION);
-
- if (!foreground) {
-#if HAVE_DAEMON
- closelog();
- freopen("/dev/null", "r", stdin);
- daemon(0, 0);
- /* returns to child only */
- /* pid will have changed */
- openlog("pptpd", LOG_PID, PPTP_FACILITY);
-#else /* !HAVE_DAEMON */
- my_daemon(argc, argv);
- /* returns to child if !HAVE_FORK
- * never returns if HAVE_FORK (re-execs with -f)
- */
-#endif
- }
-
-#ifdef BCRELAY
- if (bcrelay) {
- syslog(LOG_DEBUG, "CTRL: BCrelay incoming interface is %s", bcrelay);
- /* Launch BCrelay */
-#ifndef HAVE_FORK
- switch(bcrelayfork = vfork()){
-#else
- switch(bcrelayfork = fork()){
-#endif
- case -1: /* fork() error */
- syslog(LOG_ERR, "CTRL: Error forking to exec bcrelay");
- _exit(1);
-
- case 0: /* child */
- syslog(LOG_DEBUG, "CTRL (BCrelay Launcher): Launching BCrelay with pid %i", bcrelayfork);
- launch_bcrelay();
- syslog(LOG_ERR, "CTRL (BCrelay Launcher): Failed to launch BCrelay.");
- _exit(1);
- }
- } /* End bcrelay */
-#endif
-
-#ifdef CONFIG_NETtel
- /* turn the NETtel VPN LED on */
- ledman_cmd(LEDMAN_CMD_ON, LEDMAN_VPN);
-#endif
- /* after we have our final pid... */
- log_pid(pid_file);
-
- /* manage connections until SIGTERM */
- pptp_manager(argc, argv);
-
-#ifdef BCRELAY
- if (bcrelayfork > 0) {
- syslog(LOG_DEBUG, "CTRL: Closing child BCrelay with pid %i", bcrelayfork);
- kill(bcrelayfork, SIGTERM);
- }
-#endif
-
- slot_free();
- return 0;
-}
-
-static void log_pid(char *pid_file) {
- FILE *f;
- pid_t pid;
-
- pid = getpid();
- if ((f = fopen(pid_file, "w")) == NULL) {
- syslog(LOG_ERR, "PPTPD: failed to open(%s), errno=%d\n",
- pid_file, errno);
- return;
- }
- fprintf(f, "%d\n", pid);
- fclose(f);
-}
-
-#ifndef HAVE_DAEMON
-static void my_daemon(int argc, char **argv)
-{
-#ifndef HAVE_FORK
- /* need to use vfork - eg, uClinux */
- char **new_argv;
- int pid;
- extern char **environ;
- int fdr;
-
- new_argv = malloc((argc + 2) * sizeof(char **));
- fdr = open("/dev/null", O_RDONLY);
- syslog(LOG_INFO, "MGR: Option parse OK, re-execing as daemon");
- fflush(stderr);
- if ((pid = vfork()) == 0) {
- if (fdr != 0) { dup2(fdr, 0); close(fdr); }
- SETSIDPGRP();
- chdir("/");
- umask(0);
- memcpy(new_argv + 1, argv, (argc + 1) * sizeof(char **));
- new_argv[0] = PPTPD_BIN;
- new_argv[1] = "-f";
- execve(PPTPD_BIN, new_argv, environ);
- _exit(1);
- } else if (pid > 0) {
- exit(0);
- } else {
- syslog_perror("vfork");
- exit(1);
- }
-#else
- int pid;
-
- closelog();
- if ((pid = fork()) < 0) {
- syslog_perror("fork");
- exit(1);
- } else if (pid)
- exit(0);
- freopen("/dev/null", "r", stdin);
- SETSIDPGRP();
- chdir("/");
- umask(0);
- /* pid will have changed */
- openlog("pptpd", LOG_PID, PPTP_FACILITY);
-#endif
-}
-#endif
-
-/* added for hostname/address lookup -tmk
- * returns NULL if not a valid hostname
- */
-static char *lookup(char *hostname)
-{
- struct hostent *ent;
- struct in_addr hst_addr;
-
- /* Try to parse IP directly */
- if (inet_addr(hostname) != -1)
- return hostname;
-
- /* Else lookup hostname, return NULL if it fails */
- if ((ent = gethostbyname(hostname)) == NULL)
- return NULL;
-
- /* That worked, print it back as a dotted quad. */
- memcpy(&hst_addr.s_addr, ent->h_addr, ent->h_length);
- return inet_ntoa(hst_addr);
-}
-
-#define DEBUG_IP_PARSER 0
-
-/* Return the address or NULL if not valid */
-static char *validip(char *hostname)
-{
- /* Try to parse IP directly */
- if (inet_addr(hostname) != -1)
- return hostname;
- else
- return NULL;
-}
-
-/* Check if it's a valid IP range */
-static int isIpRange(char *str)
-{
- int dashes = 0;
- int dots = 0;
-
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Checking if %s is a valid IP range", str);
-#endif
- do {
- if (*str == '-')
- dashes++;
- else if (*str == '.')
- dots++;
- else if (!strchr("0123456789", *str)) {
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Not an IP range: character %c is not valid", *str);
-#endif
- return 0;
- }
- } while (*++str);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Dashes = %d (wanted: 1), Dots = %d (wanted: 4)", dashes, dots);
-#endif
- return (dashes == 1 && dots == 3);
-}
-
-/* process a type 0 (LOCAL) or type 1 (REMOTE) IP string */
-static void processIPStr(int type, char *ipstr)
-{
- int pos;
-
- char *tmpstr;
- /* char tmpstr2[20]; xxx.xxx.xxx.xxx-xxx (largest we can get) */
- char tmpstr2[128]; /* allow hostnames */
- char *tmpstr3;
- char tmpstr5[16];
- char *tmpstr6;
- char *tmpstr7;
- int num;
-
- char ipa[8]; /* xxx-xxx (largest we can get) */
- char ipb[8];
- char ipc[8];
- char ipd[8];
-
- char ip_pre[13]; /* xxx.xxx.xxx. (largest we can get) */
- char ip_post[13];
-
- char ipl[4];
- char ipu[4];
-
- int bail = FALSE; /* so we know when to stop formatting the ip line */
-
- int lower, upper, n;
-
- num = 0;
-
- while (!bail) {
- if ((tmpstr = strchr(ipstr, ',')) == NULL) {
- /* last (or only) entry reached */
- strlcpy(tmpstr2, ipstr, sizeof(tmpstr2));
- bail = TRUE;
- } else {
- pos = tmpstr - ipstr;
- ipstr[pos] = '\0';
- strlcpy(tmpstr2, ipstr, sizeof(tmpstr2));
- ipstr = tmpstr + 1;
- }
-
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Parsing segment: %s", tmpstr2);
-#endif
-
- if (!isIpRange(tmpstr2)) {
- /* We got a normal IP
- * Check if the IP address is valid, use it if so
- */
- if ((tmpstr7 = lookup(tmpstr2)) == NULL) {
- syslog(LOG_ERR, "MGR: Bad IP address (%s) in config file!", tmpstr2);
- exit(1);
- }
- if (num == pptp_connections) {
- syslog(LOG_WARNING, "MGR: connections limit (%d) reached, extra IP addresses ignored", pptp_connections);
- return;
- }
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Setting IP %d = %s", num, tmpstr7);
-#endif
- if (type == LOCAL)
- slot_set_local(num, tmpstr7);
- else
- slot_set_remote(num, tmpstr7);
- num++;
- } else {
- /* Got a range;
- * eg. 192.168.0.234-238
- * or (thanx Kev! :-).. i thought i was finished :-)
- * 192.168-178.1.231
- */
-
- /* lose the "."'s */
- while ((tmpstr3 = strchr(tmpstr2, '.')) != NULL) {
- pos = tmpstr3 - tmpstr2;
- tmpstr2[pos] = ' ';
- }
-
- if ((tmpstr3 = strchr(tmpstr2, '-')) == NULL ||
- strchr(tmpstr3 + 1, '-') != NULL) {
- syslog(LOG_ERR, "MGR: Confused in IP parse routines (multiple hyphens)");
- continue;
- }
- /* should be left with "192 168 0 234-238"
- * or 192 168-178 1 231
- */
-
- sscanf(tmpstr2, "%7s %7s %7s %7s", ipa, ipb, ipc, ipd);
-
- if ((tmpstr6 = strchr(ipd, '-')) != NULL) {
- pos = tmpstr6 - ipd;
- ipd[pos] = ' ';
- sscanf(ipd, "%3s %3s", ipl, ipu);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: (lower upper) = (%s %s)", ipl, ipu);
-#endif
- lower = atoi(ipl);
- upper = atoi(ipu);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Range = %d to %d on 4th segment", lower, upper);
-#endif
- sprintf(ip_pre, "%.3s.%.3s.%.3s.", ipa, ipb, ipc);
- ip_post[0] = '\0';
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Pre = %s Post = %s", ip_pre, ip_post);
-#endif
- } else if ((tmpstr6 = strchr(ipc, '-')) != NULL) {
- pos = tmpstr6 - ipc;
- ipc[pos] = ' ';
- sscanf(ipc, "%3s %3s", ipl, ipu);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: (lower upper) = (%s %s)", ipl, ipu);
-#endif
- lower = atoi(ipl);
- upper = atoi(ipu);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Range = %d to %d on 3rd segment", lower, upper);
-#endif
- sprintf(ip_pre, "%.3s.%.3s.", ipa, ipb);
- sprintf(ip_post, ".%.3s", ipd);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Pre = %s Post = %s", ip_pre, ip_post);
-#endif
- } else if ((tmpstr6 = strchr(ipb, '-')) != NULL) {
- pos = tmpstr6 - ipb;
- ipb[pos] = ' ';
- sscanf(ipb, "%3s %3s", ipl, ipu);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: (lower upper) = (%s %s)", ipl, ipu);
-#endif
- lower = atoi(ipl);
- upper = atoi(ipu);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Range = %d to %d on 2nd segment", lower, upper);
-#endif
- sprintf(ip_pre, "%.3s.", ipa);
- sprintf(ip_post, ".%.3s.%.3s", ipc, ipd);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Pre = %s Post = %s", ip_pre, ip_post);
-#endif
- } else if ((tmpstr6 = strchr(ipa, '-')) != NULL) {
- pos = tmpstr6 - ipa;
- ipa[pos] = ' ';
- sscanf(ipa, "%3s %3s", ipl, ipu);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: (lower upper) = (%s %s)", ipl, ipu);
-#endif
- lower = atoi(ipl);
- upper = atoi(ipu);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Range = %d to %d on 1st segment", lower, upper);
-#endif
- ip_pre[0] = '\0';
- sprintf(ip_post, ".%.3s.%.3s.%.3s", ipb, ipc, ipd);
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Pre = %s Post = %s", ip_pre, ip_post);
-#endif
- } else {
- syslog(LOG_ERR, "MGR: Confused in IP parse routines (lost hyphen)");
- continue;
- }
-
- for (n = lower; n <= upper; n++) {
- sprintf(tmpstr5, "%s%d%s", ip_pre, n, ip_post);
- /* Check if the ip address is valid */
- if ((tmpstr7 = validip(tmpstr5)) == NULL) {
- syslog(LOG_ERR, "MGR: Bad IP address (%s) in config file!", tmpstr5);
- exit(1);
- }
- if (num == pptp_connections) {
- syslog(LOG_WARNING, "MGR: connections limit (%d) reached, extra IP addresses ignored", pptp_connections);
- return;
- }
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Setting IP %d = %s", num, tmpstr7);
-#endif
- if (type == LOCAL)
- slot_set_local(num, tmpstr7);
- else
- slot_set_remote(num, tmpstr7);
- num++;
- }
- }
- }
- if (num == 1 && type == LOCAL && pptp_connections > 1) {
-#if DEBUG_IP_PARSER
- syslog(LOG_DEBUG, "MGR: Setting all %d local IPs to %s", pptp_connections, slot_get_local(0));
-#endif
- for (n = 1; n < pptp_connections; n++)
- slot_set_local(n, slot_get_local(0));
- } else if (pptp_connections > num) {
- syslog(LOG_INFO, "MGR: Maximum of %d connections reduced to %d, not enough IP addresses given",
- pptp_connections, num);
- pptp_connections = num;
- }
-}
-
-#ifdef BCRELAY
-/* launch_bcrelay
- * Launches broadcast relay. Broadcast relay is responsible for relaying broadcasts to the clients
- * retn: 0 on success, -1 on failure.
- */
-static void launch_bcrelay() {
- char *bcrelay_argv[8];
- int an = 0;
-
- if (bcrelay) {
- syslog(LOG_DEBUG, "MGR: BCrelay incoming interface is %s", bcrelay);
- syslog(LOG_DEBUG, "MGR: BCrelay outgoing interface is regexp ppp[0-9].*");
-
- bcrelay_argv[an++] = BCRELAY_BIN;
- bcrelay_argv[an++] = "-i";
- bcrelay_argv[an++] = bcrelay;
- bcrelay_argv[an++] = "-o";
- bcrelay_argv[an++] = "ppp[0-9].*";
- if (!pptp_debug) {
- bcrelay_argv[an++] = "-n";
- }
- bcrelay_argv[an++] = NULL;
-
- execvp(bcrelay_argv[0], bcrelay_argv);
- }
-}
-#endif
diff --git a/pptpd-1.3.3/pptpd.conf.5 b/pptpd-1.3.3/pptpd.conf.5
deleted file mode 100644
index 0a83b34..0000000
--- a/pptpd-1.3.3/pptpd.conf.5
+++ /dev/null
@@ -1,255 +0,0 @@
-.TH PPTPD.CONF 5 "29 December 2005"
-.SH NAME
-.B pptpd.conf
-- PPTP VPN daemon configuration
-.SH DESCRIPTION
-.BR pptpd (8)
-reads options from this file, usually
-.IR /etc/pptpd.conf .
-Most options can be overridden by the command line. The local and
-remote IP addresses for clients must come from the configuration file
-or from
-.BR pppd (8)
-configuration files.
-.SH OPTIONS
-.TP
-.BI "option " option-file
-the name of an option file to be passed to
-.BR pppd (8)
-in place of the default
-.IR /etc/ppp/options
-so that PPTP specific options can be given.
-Equivalent to the command line
-.B --option
-option.
-
-.TP
-.BI "stimeout " seconds
-number of seconds to wait for a PPTP packet before forking the
-.BR pptpctrl (8)
-program to handle the client. The default is 10 seconds. This is a
-denial of service protection feature.
-Equivalent to the command line
-.B --stimeout
-option.
-
-.TP
-.BI "ptimeout " miliseconds
-number of miliseconds to wait for a PPTP "ack" packet after transmitting
-was stoped due to sliding window exceeded. The default is 1000 miliseconds.
-Equivalent to the command line
-.B --ptimeout
-option.
-
-.TP
-.BI "keep"
-Keep connections after pptpd daemon exit. Default do not keep connections,
-all connections would be terminated on pptpd exit.
-Equivalent to the command line
-.B --keep
-option.
-
-.TP
-.B debug
-turns on debugging mode, sending debugging information to
-.BR syslog (3).
-Has no effect on
-.BR pppd (8)
-debugging. Equivalent to the command line
-.B --debug
-option.
-.TP
-.BI "bcrelay " internal-interface
-turns on broadcast relay mode, sending all broadcasts received on the server's
-internal interface to the clients.
-Equivalent to the command line
-.B --bcrelay
-option.
-
-.TP
-.BI "connections " n
-limits the number of client connections that may be accepted.
-If pptpd is allocating IP addresses (e.g.
-.BR delegate
-is not used) then the number of connections is also limited by the
-.BR remoteip
-option. The default is 100.
-
-.TP
-.BI "delegate"
-delegates the allocation of client IP addresses to
-.BR pppd (8).
-Without this option, which is the default, pptpd manages the list of
-IP addresses for clients and passes the next free address to pppd.
-With this option, pptpd does not pass an address, and so pppd may use
-radius or chap-secrets to allocate an address.
-
-.TP
-.BI "localip " ip-specification
-one or many IP addresses to be used at the local end of the
-tunnelled PPP links between the server and the client. If one address only
-is given, this address is used for all clients. Otherwise, one address
-per client must be given, and if there are no free addresses then any new
-clients will be refused.
-.B localip
-will be ignored if the
-.B delegate
-option is used.
-.TP
-.BI "remoteip " ip-specification
-a list of IP addresses to assign to remote PPTP clients. Each
-connected client must have a different address, so there must be
-at least as many addresses as you have simultaneous clients,
-and preferably some spare, since you cannot change this list
-without restarting pptpd. A warning will be sent to
-.BR syslog (3)
-when the IP address pool is exhausted.
-.B remoteip
-will be ignored if the
-.B delegate
-option is used.
-.TP
-.B noipparam
-by default, the original client IP address is given to
-ip-up scripts using the
-.BR pppd (8)
-option
-.B ipparam.
-The
-.B noipparam
-option prevents this.
-Equivalent to the command line
-.B --noipparam
-option.
-.TP
-.BI "listen " ip-address
-the local interface IP address to listen on for incoming PPTP
-connections (TCP port 1723). Equivalent to the command line
-.B --listen
-option.
-.TP
-.BI "pidfile " pid-file
-specifies an alternate location to store the process ID file
-(default /var/run/pptpd.pid). Equivalent to the command line
-.B --pidfile
-option.
-.TP
-.BI "speed " speed
-specifies a speed (in bits per second) to pass to the PPP daemon as
-the interface speed for the tty/pty pair. This is ignored by some PPP
-daemons, such as Linux's
-.BR pppd (8).
-The default is 115200 bytes per second, which some implementations
-interpret as meaning "no limit". Equivalent to the command line
-.B --speed
-option.
-.SH NOTES
-An
-.I ip-specification
-above (for the
-.B localip
-and
-.B remoteip
-tags) may be a list of IP addresses (for example 192.168.0.2,192.168.0.3),
-a range (for example 192.168.0.1-254 or 192.168.0-255.2) or some combination
-(for example 192.168.0.2,192.168.0.5-8). For some valid pairs might be
-(depending on use of the VPN):
-.P
-.BI "localip " 192.168.0.1
-.br
-.BI "remoteip " 192.168.0.2-254
-.P
-or
-.P
-.BI "localip " 192.168.1.2-254
-.br
-.BI "remoteip " 192.168.0.2-254
-
-.SH ROUTING CHECKLIST - PROXYARP
-Allocate a section of your LAN addresses for use by clients.
-.P
-In
-.IR /etc/ppp/options.pptpd.
-set the
-.B proxyarp
-option.
-In
-.IR pptpd.conf
-do not set
-.B localip
-option, but set
-.B remoteip
-to the allocated address range.
-Enable kernel forwarding of packets, (e.g. using
-.IR /proc/sys/net/ipv4/ip_forward
-).
-.P
-The server will advertise the clients to the LAN using ARP, providing
-it's own ethernet address.
-.BR bcrelay (8)
-should not be required.
-
-.SH ROUTING CHECKLIST - FORWARDING
-Allocate a subnet for the clients that is routable from your LAN, but
-is not part of your LAN.
-.P
-In
-.IR pptpd.conf
-set
-.B localip
-to a single address or range in the allocated subnet, set
-.B remoteip
-to a range in the allocated subnet.
-Enable kernel forwarding of packets, (e.g. using
-.IR /proc/sys/net/ipv4/ip_forward
-).
-The LAN must have a route to the clients using the server as gateway.
-.P
-The server will forward the packets unchanged between the clients and the LAN.
-.BR bcrelay (8)
-will be required to support broadcast protocols such as NETBIOS.
-
-.SH ROUTING CHECKLIST - MASQUERADE
-Allocate a subnet for the clients that is not routable from your LAN,
-and not otherwise routable from the server (e.g. 10.0.0.0/24).
-.P
-Set
-.B localip
-to a single address in the subnet (e.g. 10.0.0.1), set
-.B remoteip
-to a range for the rest of the subnet, (e.g. 10.0.0.2-200).
-Enable kernel forwarding of packets, (e.g. using
-.IR /proc/sys/net/ipv4/ip_forward
-).
-Enable masquerading on eth0 (e.g.
-.I
-iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
-).
-.P
-The server will translate the packets between the clients and the LAN.
-The clients will appear to the LAN as having the address
-corresponding to the server. The LAN need not have an explicit route
-to the clients.
-.BR bcrelay (8)
-will be required to support broadcast protocols such as NETBIOS.
-
-.SH FIREWALL RULES
-.BR pptpd (8)
-accepts control connections on TCP port 1723, and then uses GRE
-(protocol 47) to exchange data packets. Add these rules to your
-.BR iptables (8)
-configuration, or use them as the basis for your own rules:
-.P
-iptables --append INPUT --protocol 47 --jump ACCEPT
-.br
-.nf
-iptables --append INPUT --protocol tcp --match tcp \\
-.br
- --destination-port 1723 --jump ACCEPT
-.fi
-.P
-
-.SH "SEE ALSO"
-.BR pppd (8),
-.BR pptpd (8),
-.BR pptpd.conf (5).
diff --git a/pptpd-1.3.3/pptpd.init b/pptpd-1.3.3/pptpd.init
deleted file mode 100644
index c048dc8..0000000
--- a/pptpd-1.3.3/pptpd.init
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-#
-# Startup script for pptpd
-#
-# chkconfig: - 85 15
-# description: PPTP server
-# processname: pptpd
-# config: /etc/pptpd.conf
-
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-# See how we were called.
-case "$1" in
- start)
- echo -n "Starting pptpd: "
- if [ -f /var/lock/subsys/pptpd ] ; then
- echo
- exit 1
- fi
- daemon /usr/sbin/pptpd
- echo
- touch /var/lock/subsys/pptpd
- ;;
- stop)
- echo -n "Shutting down pptpd: "
- killproc pptpd
- echo
- rm -f /var/lock/subsys/pptpd
- ;;
- status)
- status pptpd
- ;;
- condrestart)
- if [ -f /var/lock/subsys/pptpd ]; then
- $0 stop
- $0 start
- fi
- ;;
- reload|restart)
- $0 stop
- $0 start
- echo "Warning: a pptpd restart does not terminate existing "
- echo "connections, so new connections may be assigned the same IP "
- echo "address and cause unexpected results. Use restart-kill to "
- echo "destroy existing connections during a restart."
- ;;
- restart-kill)
- $0 stop
- ps -ef | grep pptpd | grep -v grep | grep -v rc.d | awk '{print $2}' | uniq | xargs kill 1> /dev/null 2>&1
- $0 start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|restart-kill|status}"
- exit 1
-esac
-
-exit 0
diff --git a/pptpd-1.3.3/pptpd.spec b/pptpd-1.3.3/pptpd.spec
deleted file mode 100644
index 7258db0..0000000
--- a/pptpd-1.3.3/pptpd.spec
+++ /dev/null
@@ -1,157 +0,0 @@
-%{!?__id_u: %define __id_u %([ -x /bin/id ]&&echo /bin/id||([ -x /usr/bin/id ]&&echo /usr/bin/id|| echo /bin/true)) -u}
-
-# Available rpmbuild options:
-#
-# --without libwrap
-# --with bsdppp
-# --with slirp
-# --with ipalloc
-# --without bcrelay
-#
-
-Summary: PoPToP Point to Point Tunneling Server
-Name: pptpd
-Version: 1.3.3
-Release: 1
-License: GPL
-Group: Applications/Internet
-URL: http://poptop.sourceforge.net/
-Source0: http://dl.sf.net/poptop/pptpd-%{version}.tar.gz
-Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: ppp >= 2.4.3
-
-%if %{?_without_libwrap:0}%{!?_without_libwrap:1}
-BuildRequires: tcp_wrappers
-%endif
-
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig, /sbin/service
-
-%description
-This implements a Virtual Private Networking Server (VPN) that is
-compatible with Microsoft VPN clients. It allows windows users to
-connect to an internal firewalled network using their dialup.
-
-%prep
-%setup -q
-
-# Fix permissions for debuginfo package
-%{__chmod} 644 *.[ch]
-
-# Fix multilib
-%{__perl} -pi -e 's,/usr/lib/pptpd,%{_libdir}/pptpd,;' pptpctrl.c
-
-%build
-%configure \
- %{!?_without_libwrap:--with-libwrap} \
- %{?_without_libwrap:--without-libwrap} \
- %{!?_with_bsdppp:--without-bsdppp} \
- %{?_with_bsdppp:--with-bsdppp} \
- %{!?_with_slirp:--without-slirp} \
- %{?_with_slirp:--with-slirp} \
- %{!?_with_ipalloc:--without-pppd-ip-alloc} \
- %{?_with_ipalloc:--with-pppd-ip-alloc} \
- %{!?_without_bcrelay:--with-bcrelay} \
- %{?_without_bcrelay:--without-bcrelay}
-(echo '#undef VERSION'; echo '#define VERSION "2.4.3"') >> plugins/patchlevel.h
-%{__make} CFLAGS='-fno-builtin -fPIC -DSBINDIR=\"%{_sbindir}\" %{optflags}'
-
-%install
-%{__rm} -rf %{buildroot}
-%{__mkdir_p} %{buildroot}/etc/rc.d/init.d
-%{__mkdir_p} %{buildroot}/etc/ppp
-%{__mkdir_p} %{buildroot}%{_bindir}
-%{__mkdir_p} %{buildroot}%{_mandir}/man{5,8}
-%{__make} \
- DESTDIR=%{buildroot} \
- INSTALL=%{__install} \
- LIBDIR=%{buildroot}%{_libdir}/pptpd \
- install
-%{__install} -m 0755 pptpd.init %{buildroot}/etc/rc.d/init.d/pptpd
-%{__install} -m 0644 samples/pptpd.conf %{buildroot}/etc/pptpd.conf
-%{__install} -m 0644 samples/options.pptpd %{buildroot}/etc/ppp/options.pptpd
-%{__install} -m 0755 tools/vpnuser %{buildroot}%{_bindir}/vpnuser
-%{__install} -m 0755 tools/vpnstats.pl %{buildroot}%{_bindir}/vpnstats.pl
-%{__install} -m 0755 tools/pptp-portslave %{buildroot}%{_sbindir}/pptp-portslave
-%{__install} -m 0644 pptpd.conf.5 %{buildroot}%{_mandir}/man5/pptpd.conf.5
-%{__install} -m 0644 pptpd.8 %{buildroot}%{_mandir}/man8/pptpd.8
-%{__install} -m 0644 pptpctrl.8 %{buildroot}%{_mandir}/man8/pptpctrl.8
-
-%post
-/sbin/chkconfig --add pptpd || :
-OUTD="" ; for i in d manager ctrl ; do
- test -x /sbin/pptp$i && OUTD="$OUTD /sbin/pptp$i" ;
-done
-test -z "$OUTD" || \
-{ echo "possible outdated executable detected; we now use %{_sbindir}/pptp*, perhaps you should run the following command:"; echo "rm -i $OUTD" ;}
-
-%postun
-[ $1 -gt 0 ] && /sbin/service pptpd condrestart &> /dev/null || :
-
-%preun
-if [ "$1" -lt 1 ]; then
- /sbin/service pptpd stop &> /dev/null || :
- /sbin/chkconfig --del pptpd || :
-fi
-
-%clean
-%{__rm} -rf %{buildroot}
-
-%files
-%defattr(-,root,root,0755)
-%doc AUTHORS COPYING INSTALL README* TODO ChangeLog* samples
-%{_sbindir}/pptpd
-%{_sbindir}/pptpctrl
-%{_sbindir}/pptp-portslave
-%{!?_without_bcrelay:%{_sbindir}/bcrelay}
-%{_libdir}/pptpd/pptpd-logwtmp.so
-%{_bindir}/vpnuser
-%{_bindir}/vpnstats.pl
-%{_mandir}/man5/pptpd.conf.5*
-%{_mandir}/man8/pptpd.8*
-%{_mandir}/man8/pptpctrl.8*
-/etc/rc.d/init.d/pptpd
-%config(noreplace) /etc/pptpd.conf
-%config(noreplace) /etc/ppp/options.pptpd
-
-%changelog
-* Fri Mar 31 2006 Paul Howarth <paul@city-fan.org> - 1.3.1-1
-- Update to 1.3.1
-
-* Fri Mar 31 2006 Paul Howarth <paul@city-fan.org> - 1.3.0-1
-- update to 1.3.0
-- remove redundant macro definitions
-- change Group: to one listed in rpm's GROUPS file
-- use full URL for source
-- simplify conditional build code
-- use macros for destination directories
-- honour %%{optflags}
-- general spec file cleanup
-- initscript updates:
- don't enable the service by default
- add reload and condrestart options
-- condrestart service on package upgrade
-- fix build on x86_64
-- add buildreq tcp_wrappers
-
-* Fri Feb 18 2005 James Cameron <james.cameron@hp.com>
-- fix to use ppp 2.4.3 for plugin
-
-* Thu Nov 11 2004 James Cameron <james.cameron@hp.com>
-- adjust for building on Red Hat Enterprise Linux, per Charlie Brady
-- remove vpnstats, superceded by vpnstats.pl
-
-* Fri May 21 2004 James Cameron <james.cameron@hp.com>
-- adjust for packaging naming and test
-
-* Fri Apr 23 2004 James Cameron <james.cameron@hp.com>
-- include vpnwho.pl
-
-* Thu Apr 22 2004 James Cameron <james.cameron@hp.com>
-- change description wording
-- change URL for upstream
-- release first candidate for 1.2.0
-
-* Fri Jul 18 2003 R. de Vroede <richard@oip.tudelft.nl>
-- Check the ChangeLog files.
-
diff --git a/pptpd-1.3.3/pptpdefs.h b/pptpd-1.3.3/pptpdefs.h
deleted file mode 100644
index 7ab40b3..0000000
--- a/pptpd-1.3.3/pptpdefs.h
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * pptpdefs.h
- *
- * PPTP structs and defines
- *
- * $Id: pptpdefs.h,v 1.3 2005/08/02 09:51:18 quozl Exp $
- */
-
-#ifndef _PPTPD_PPTPDEFS_H
-#define _PPTPD_PPTPDEFS_H
-
-/* define "portable" htons, etc, copied to make Ananian's gre stuff work. */
-#define hton8(x) (x)
-#define ntoh8(x) (x)
-#define hton16(x) htons(x)
-#define ntoh16(x) ntohs(x)
-#define hton32(x) htonl(x)
-#define ntoh32(x) ntohl(x)
-
-#include <sys/types.h>
-
-/* PPTP ctrl message port */
-#define PPTP_PORT 1723
-
-/* PPTP gre prototype */
-#define PPTP_PROTO 47
-
-/* PPTP version */
-#define PPTP_VERSION 0x0100
-#define PPTP_FIRMWARE_VERSION 0x0001
-
-/* Hostname and Vendor */
-#define PPTP_HOSTNAME "local"
-#define PPTP_VENDOR "linux"
-
-#define MAX_HOSTNAME_SIZE 64
-#define MAX_VENDOR_SIZE 64
-
-/* Magic Cookie */
-#define PPTP_MAGIC_COOKIE 0x1a2b3c4d
-
-/* Message types */
-#define PPTP_CTRL_MESSAGE 1
-
-/* Maximum size of any PPTP control packet we will get */
-#define PPTP_MAX_CTRL_PCKT_SIZE 220
-
-/* Control Connection Management */
-#define START_CTRL_CONN_RQST 1
-#define START_CTRL_CONN_RPLY 2
-#define STOP_CTRL_CONN_RQST 3
-#define STOP_CTRL_CONN_RPLY 4
-#define ECHO_RQST 5
-#define ECHO_RPLY 6
-
-/* Call Management */
-#define OUT_CALL_RQST 7
-#define OUT_CALL_RPLY 8
-#define IN_CALL_RQST 9
-#define IN_CALL_RPLY 10
-#define IN_CALL_CONN 11
-#define CALL_CLR_RQST 12
-#define CALL_DISCONN_NTFY 13
-
-/* Error Reporting */
-#define WAN_ERR_NTFY 14
-
-/* PPP Session Control */
-#define SET_LINK_INFO 15
-
-/* how long before a link is idle? (seconds) */
-#define IDLE_WAIT 60
-
-/* how long should we wait for an echo reply? (seconds) */
-#define MAX_ECHO_WAIT 60
-
-/* how long to wait for ppp to begin negotiation (seconds) */
-#define PPP_WAIT 30
-
-#define RESERVED 0x0000
-
-/* Start Control Connection Reply */
-#define ASYNCHRONOUS_FRAMING 0x00000001
-#define SYNCHRONOUS_FRAMING 0x00000002
-#define ANALOG_ACCESS 0x00000001
-#define DIGITAL_ACCESS 0x00000002
-
-/* Our properties - we don't actually have any physical serial i/f's and only want
- * one call per client!
- */
-#define OUR_FRAMING 0x00000000
-#define OUR_BEARER 0x00000000
-#define MAX_CHANNELS 0x0001
-
-/* Out Call Reply Defines */
-#define PCKT_RECV_WINDOW_SIZE 0x0001
-#define PCKT_PROCESS_DELAY 0x0000
-#define CHANNEL_ID 0x00000000
-
-/* ERROR CODES */
-#define NO_ERROR 0x00
-
-/* CALL_CLEAR RESULT CODES */
-#define LOST_CARRIER 0x01
-#define ADMIN_SHUTDOWN 0x03
-#define CALL_CLEAR_REQUEST 0x04
-
-/* RESULT CODES */
-#define CONNECTED 0x01
-#define DISCONNECTED 0x01
-#define GENERAL_ERROR 0x02 /* also for ERROR CODES, CALL CLEAR */
-#define NO_CARRIER 0x03
-#define BUSY 0x04
-#define NO_DIAL_TONE 0x05
-#define TIME_OUT 0x06
-#define DO_NOT_ACCEPT 0x07
-
-/* CTRL CLOSE CODES */
-#define GENERAL_STOP_CTRL 0x01
-#define STOP_PROTOCOL 0x02
-#define STOP_LOCAL_SHUTDOWN 0x03
-
-/* PPTP CTRL structs */
-
-struct pptp_header {
- u_int16_t length; /* pptp message length incl header */
- u_int16_t pptp_type; /* pptp message type */
- u_int32_t magic; /* magic cookie */
- u_int16_t ctrl_type; /* control message type */
- u_int16_t reserved0; /* reserved */
-};
-
-struct pptp_start_ctrl_conn_rqst {
- struct pptp_header header; /* pptp header */
- u_int16_t version; /* pptp protocol version */
- u_int16_t reserved1; /* reserved */
- u_int32_t framing_cap; /* framing capabilities */
- u_int32_t bearer_cap; /* bearer capabilities */
- u_int16_t max_channels; /* maximum channels */
- u_int16_t firmware_rev; /* firmware revision */
- u_int8_t hostname[MAX_HOSTNAME_SIZE]; /* hostname */
- u_int8_t vendor[MAX_VENDOR_SIZE]; /* vendor */
-};
-
-struct pptp_start_ctrl_conn_rply {
- struct pptp_header header; /* pptp header */
- u_int16_t version; /* pptp protocol version */
- u_int8_t result_code; /* result code */
- u_int8_t error_code; /* error code */
- u_int32_t framing_cap; /* framing capabilities */
- u_int32_t bearer_cap; /* bearer capabilities */
- u_int16_t max_channels; /* maximum channels */
- u_int16_t firmware_rev; /* firmware revision */
- u_int8_t hostname[MAX_HOSTNAME_SIZE]; /* hostname */
- u_int8_t vendor[MAX_VENDOR_SIZE]; /* vendor */
-};
-
-struct pptp_stop_ctrl_conn_rqst {
- struct pptp_header header; /* header */
- u_int8_t reason; /* reason for closing */
- u_int8_t reserved1; /* reserved */
- u_int16_t reserved2; /* reserved */
-};
-
-struct pptp_stop_ctrl_conn_rply {
- struct pptp_header header; /* header */
- u_int8_t result_code; /* result code */
- u_int8_t error_code; /* error code */
- u_int16_t reserved1; /* reserved */
-};
-
-struct pptp_echo_rqst {
- struct pptp_header header; /* header */
- u_int32_t identifier; /* value to match rply with rqst */
-};
-
-struct pptp_echo_rply {
- struct pptp_header header; /* header */
- u_int32_t identifier; /* identifier of echo rqst */
- u_int8_t result_code; /* result code */
- u_int8_t error_code; /* error code */
- u_int16_t reserved1; /* reserved */
-};
-
-struct pptp_out_call_rqst {
- struct pptp_header header; /* header */
- u_int16_t call_id; /* unique identifier to PAC-PNS pair */
- u_int16_t call_serial; /* session identifier */
- u_int32_t min_bps; /* minimum line speed */
- u_int32_t max_bps; /* maximum line speed */
- u_int32_t bearer_type; /* bearer type */
- u_int32_t framing_type; /* framing type */
- u_int16_t pckt_recv_size; /* packet recv window size */
- u_int16_t pckt_delay; /* packet processing delay */
- u_int16_t phone_len; /* phone number length */
- u_int16_t reserved1; /* reserved */
- u_int8_t phone_num[64]; /* phone number */
- u_int8_t subaddress[64]; /* additional dialing info */
-};
-
-struct pptp_out_call_rply {
- struct pptp_header header; /* header */
- u_int16_t call_id; /* unique identifier to PAC-PNS pair */
- u_int16_t call_id_peer; /* set to call_id of the call rqst */
- u_int8_t result_code; /* result code */
- u_int8_t error_code; /* error code */
- u_int16_t cause_code; /* additional failure information */
- u_int32_t speed; /* actual connection speed */
- u_int16_t pckt_recv_size; /* packet recv window size */
- u_int16_t pckt_delay; /* packet processing delay */
- u_int32_t channel_id; /* physical channel ID */
-};
-
-struct pptp_in_call_rqst {
- struct pptp_header header; /* header */
- u_int16_t call_id; /* unique identifier for tunnel */
- u_int16_t call_serial; /* session identifier */
- u_int32_t bearer_type; /* bearer capability */
- u_int32_t channel_id; /* channel ID */
- u_int16_t dialed_len; /* dialed length */
- u_int16_t dialing_len; /* dialing length */
- u_int8_t dialed_num[64]; /* number that was dialed by the caller */
- u_int8_t dialing_num[64]; /* the number from which the call was placed */
- u_int8_t subaddress[64]; /* additional dialing information */
-};
-
-struct pptp_in_call_rply {
- struct pptp_header header; /* header */
- u_int16_t call_id; /* unique identifier for the tunnel */
- u_int16_t peers_call_id; /* set to rcvd call ID */
- u_int8_t result_code; /* result code */
- u_int8_t error_code; /* error code */
- u_int16_t pckt_recv_size; /* packet recv window size */
- u_int16_t pckt_delay; /* packet transmit delay */
- u_int16_t reserved1; /* reserved */
-};
-
-struct pptp_in_call_connect {
- struct pptp_header header; /* header */
- u_int16_t peers_call_id; /* set to rcvd call ID */
- u_int16_t reserved1; /* reserved */
- u_int32_t speed; /* connect speed */
- u_int16_t pckt_recv_size; /* packet rcvd window size */
- u_int16_t pckt_delay; /* packet transmit delay */
- u_int32_t framing_type; /* framing type */
-};
-
-struct pptp_call_clr_rqst {
- struct pptp_header header; /* header */
- u_int16_t call_id; /* call ID assigned by the PNS */
- u_int16_t reserved1; /* reserved */
-};
-
-struct pptp_call_disconn_ntfy {
- struct pptp_header header; /* header */
- u_int16_t call_id; /* call ID assigned by the PAC */
- u_int8_t result_code; /* result code */
- u_int8_t error_code; /* error code */
- u_int16_t cause_code; /* additional disconnect info */
- u_int16_t reserved1; /* reserved */
- u_int8_t call_stats[128]; /* vendor specific call stats */
-};
-
-struct pptp_wan_err_ntfy {
- struct pptp_header header; /* header */
- u_int16_t peers_call_id; /* call ID assigned by PNS */
- u_int16_t reserved1; /* reserved */
- u_int32_t crc_errors; /* # of PPP frames rcvd with CRC errors */
- u_int32_t framing_errors; /* # of improperly framed PPP pckts */
- u_int32_t hardware_overruns; /* # of receive buffer overruns */
- u_int32_t buff_overruns; /* # of buffer overruns */
- u_int32_t timeout_errors; /* # of timeouts */
- u_int32_t align_errors; /* # of alignment errors */
-};
-
-struct pptp_set_link_info {
- struct pptp_header header;
- u_int16_t peers_call_id; /* call ID assigned by PAC */
- u_int16_t reserved1; /* reserved */
- u_int32_t send_accm; /* send ACCM value the client should use */
- u_int32_t recv_accm; /* recv ACCM value the client should use */
-};
-
-/* GRE and PPP structs */
-
-/* Copied from C. S. Ananian */
-
-#define HDLC_FLAG 0x7E
-#define HDLC_ESCAPE 0x7D
-
-#define PPTP_GRE_PROTO 0x880B
-#define PPTP_GRE_VER 0x1
-
-#define PPTP_GRE_FLAG_C 0x80
-#define PPTP_GRE_FLAG_R 0x40
-#define PPTP_GRE_FLAG_K 0x20
-#define PPTP_GRE_FLAG_S 0x10
-#define PPTP_GRE_FLAG_A 0x80
-
-#define PPTP_GRE_IS_C(f) ((f)&PPTP_GRE_FLAG_C)
-#define PPTP_GRE_IS_R(f) ((f)&PPTP_GRE_FLAG_R)
-#define PPTP_GRE_IS_K(f) ((f)&PPTP_GRE_FLAG_K)
-#define PPTP_GRE_IS_S(f) ((f)&PPTP_GRE_FLAG_S)
-#define PPTP_GRE_IS_A(f) ((f)&PPTP_GRE_FLAG_A)
-
-struct pptp_gre_header {
- u_int8_t flags; /* bitfield */
- u_int8_t ver; /* should be PPTP_GRE_VER (enhanced GRE) */
- u_int16_t protocol; /* should be PPTP_GRE_PROTO (ppp-encaps) */
- u_int16_t payload_len; /* size of ppp payload, not inc. gre header */
- u_int16_t call_id; /* peer's call_id for this session */
- u_int32_t seq; /* sequence number. Present if S==1 */
- u_int32_t ack; /* seq number of highest packet recieved by */
- /* sender in this session */
-};
-
-/* For our call ID pairs */
-#define PNS_VALUE 0
-#define PAC_VALUE 1
-
-#define GET_VALUE(which, where) ((which ## _VALUE) ? ((where) & 0xffff) : ((where) >> 16))
-
-#define NOTE_VALUE(which, where, what) ((which ## _VALUE) \
- ? ((where) = ((where) & 0xffff0000) | (what)) \
- : ((where) = ((where) & 0xffff) | ((what) << 16)))
-
-#endif /* !_PPTPD_PPTPDEFS_H */
diff --git a/pptpd-1.3.3/pptpmanager.c b/pptpd-1.3.3/pptpmanager.c
deleted file mode 100644
index 4619ca6..0000000
--- a/pptpd-1.3.3/pptpmanager.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * pptpmanager.c
- *
- * Manages the PoPToP sessions.
- *
- * $Id: pptpmanager.c,v 1.14 2005/12/29 09:59:49 quozl Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef __linux__
-#define _GNU_SOURCE 1 /* broken arpa/inet.h */
-#endif
-
-#include "our_syslog.h"
-
-#include <errno.h>
-#include <netdb.h>
-#include <signal.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/un.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <time.h>
-#include <sys/time.h>
-#include <fcntl.h>
-
-#ifdef HAVE_LIBWRAP
-/* re-include, just in case HAVE_SYSLOG_H wasn't defined */
-#include <syslog.h>
-#include <tcpd.h>
-
-int allow_severity = LOG_WARNING;
-int deny_severity = LOG_WARNING;
-#endif
-
-#ifdef __UCLIBC__
-#define socklen_t int
-#endif
-
-#include "configfile.h"
-#include "defaults.h"
-#include "pptpctrl.h"
-#include "pptpdefs.h"
-#include "pptpmanager.h"
-#include "compat.h"
-
-/* command line arg variables */
-extern char *ppp_binary;
-extern char *pppdoptstr;
-extern char *speedstr;
-extern char *bindaddr;
-extern int pptp_debug;
-extern int pptp_noipparam;
-extern int pptp_logwtmp;
-extern int pptp_delegate;
-
-/* option for timeout on starting ctrl connection */
-extern int pptp_stimeout;
-extern int pptp_ptimeout;
-
-extern int pptp_connections;
-extern int keep_connections;
-
-/* local function prototypes */
-static void connectCall(int clientSocket, int clientNumber);
-static int createHostSocket(int *hostSocket);
-
-/* this end's call identifier */
-uint16_t unique_call_id = 1;
-
-/* slots - begin */
-
-/* data about connection slots */
-struct slot {
- pid_t pid;
- char *local;
- char *remote;
-} *slots;
-
-/* number of connection slots allocated */
-int slot_count;
-
-static void slot_iterate(struct slot *slots, int count, void (*callback) (struct slot *slot))
-{
- int i;
- for(i=0; i<count; i++)
- (*callback)(&slots[i]);
-}
-
-static void slot_slot_init(struct slot *slot)
-{
- slot->pid = 0;
- slot->local = NULL;
- slot->remote = NULL;
-}
-
-void slot_init(int count)
-{
- slot_count = count;
- slots = (struct slot *) calloc(slot_count, sizeof(struct slot));
- slot_iterate(slots, slot_count, slot_slot_init);
-}
-
-static void slot_slot_free(struct slot *slot)
-{
- slot->pid = 0;
- if (slot->local) free(slot->local);
- slot->local = NULL;
- if (slot->remote) free(slot->remote);
- slot->remote = NULL;
-}
-
-void slot_free()
-{
- slot_iterate(slots, slot_count, slot_slot_free);
- free(slots);
- slots = NULL;
- slot_count = 0;
-}
-
-void slot_set_local(int i, char *ip)
-{
- struct slot *slot = &slots[i];
- if (slot->local) free(slot->local);
- slot->local = strdup(ip);
-}
-
-void slot_set_remote(int i, char *ip)
-{
- struct slot *slot = &slots[i];
- if (slot->remote) free(slot->remote);
- slot->remote = strdup(ip);
-}
-
-void slot_set_pid(int i, pid_t pid)
-{
- struct slot *slot = &slots[i];
- slot->pid = pid;
-}
-
-int slot_find_by_pid(pid_t pid)
-{
- int i;
- for(i=0; i<slot_count; i++) {
- struct slot *slot = &slots[i];
- if (slot->pid == pid) return i;
- }
- return -1;
-}
-
-int slot_find_empty()
-{
- return slot_find_by_pid(0);
-}
-
-char *slot_get_local(int i)
-{
- struct slot *slot = &slots[i];
- return slot->local;
-}
-
-char *slot_get_remote(int i)
-{
- struct slot *slot = &slots[i];
- return slot->remote;
-}
-
-/* slots - end */
-
-static void sigchld_responder(int sig)
-{
- int child, status;
-
- while ((child = waitpid(-1, &status, WNOHANG)) > 0) {
- if (pptp_delegate) {
- if (pptp_debug) syslog(LOG_DEBUG, "MGR: Reaped child %d", child);
- } else {
- int i;
- i = slot_find_by_pid(child);
- if (i != -1) {
- slot_set_pid(i, 0);
- if (pptp_debug) syslog(LOG_DEBUG, "MGR: Reaped child %d", child);
- } else {
- syslog(LOG_INFO, "MGR: Reaped unknown child %d", child);
- }
- }
- }
-}
-
-static void sigterm_responder(void)
-{
- int i;
- for(i=0; i<slot_count; i++)
- kill(slots[i].pid,SIGTERM);
-}
-
-int pptp_manager(int argc, char **argv)
-{
- int firstOpen = -1;
- int ctrl_pid;
- socklen_t addrsize;
-
- int hostSocket;
- fd_set connSet;
-
- int rc, sig_fd;
-
- rc = sigpipe_create();
- if (rc < 0) {
- syslog(LOG_ERR, "MGR: unable to setup sigchld pipe!");
- syslog_perror("sigpipe_create");
- exit(-1);
- }
-
- sigpipe_assign(SIGCHLD);
- sigpipe_assign(SIGTERM);
- sig_fd = sigpipe_fd();
-
- /* openlog() not required, done in pptpd.c */
-
- syslog(LOG_INFO, "MGR: Manager process started");
-
- if (!pptp_delegate) {
- syslog(LOG_INFO, "MGR: Maximum of %d connections available",
- pptp_connections);
- }
-
- /* Connect the host socket and activate it for listening */
- if (createHostSocket(&hostSocket) < 0) {
- syslog(LOG_ERR, "MGR: Couldn't create host socket");
- syslog_perror("createHostSocket");
- exit(-1);
- }
-
- while (1) {
- int max_fd;
- FD_ZERO(&connSet);
- if (pptp_delegate) {
- FD_SET(hostSocket, &connSet);
- } else {
- firstOpen = slot_find_empty();
- if (firstOpen == -1) {
- syslog(LOG_ERR, "MGR: No free connection slots or IPs - no more clients can connect!");
- } else {
- FD_SET(hostSocket, &connSet);
- }
- }
- max_fd = hostSocket;
-
- FD_SET(sig_fd, &connSet);
- if (max_fd < sig_fd) max_fd = sig_fd;
-
- while (1) {
- if (select(max_fd + 1, &connSet, NULL, NULL, NULL) != -1) break;
- if (errno == EINTR) continue;
- syslog(LOG_ERR, "MGR: Error with manager select()!");
- syslog_perror("select");
- exit(-1);
- }
-
- if (FD_ISSET(sig_fd, &connSet)) { /* SIGCHLD */
- int signum = sigpipe_read();
- if (signum == SIGCHLD)
- sigchld_responder(signum);
- else if (signum == SIGTERM)
- {
- if (!keep_connections) sigterm_responder();
- return signum;
- }
- }
-
- if (FD_ISSET(hostSocket, &connSet)) { /* A call came! */
- int clientSocket;
- struct sockaddr_in client_addr;
-
- /* Accept call and launch PPTPCTRL */
- addrsize = sizeof(client_addr);
- clientSocket = accept(hostSocket, (struct sockaddr *) &client_addr, &addrsize);
-
-#ifdef HAVE_LIBWRAP
- if (clientSocket != -1) {
- struct request_info r;
- request_init(&r, RQ_DAEMON, "pptpd", RQ_FILE, clientSocket, NULL);
- fromhost(&r);
- if (!hosts_access(&r)) {
- /* send a permission denied message? this is a tcp wrapper
- * type deny so probably best to just drop it immediately like
- * this, as tcp wrappers usually do.
- */
- close(clientSocket);
- /* this would never be file descriptor 0, so use it as a error
- * value
- */
- clientSocket = 0;
- }
- }
-#endif
- if (clientSocket == -1) {
- /* accept failed, but life goes on... */
- syslog(LOG_ERR, "MGR: accept() failed");
- syslog_perror("accept");
- } else if (clientSocket != 0) {
- fd_set rfds;
- struct timeval tv;
- struct pptp_header ph;
-
- /* TODO: this select below prevents
- other connections from being
- processed during the wait for the
- first data packet from the
- client. */
-
- /*
- * DOS protection: get a peek at the first packet
- * and do some checks on it before we continue.
- * A 10 second timeout on the first packet seems reasonable
- * to me, if anything looks sus, throw it away.
- */
-
- FD_ZERO(&rfds);
- FD_SET(clientSocket, &rfds);
- tv.tv_sec = pptp_stimeout;
- tv.tv_usec = 0;
- if (select(clientSocket + 1, &rfds, NULL, NULL, &tv) <= 0) {
- syslog(LOG_ERR, "MGR: dropped slow initial connection");
- close(clientSocket);
- continue;
- }
-
- if (recv(clientSocket, &ph, sizeof(ph), MSG_PEEK) !=
- sizeof(ph)) {
- syslog(LOG_ERR, "MGR: dropped small initial connection");
- close(clientSocket);
- continue;
- }
-
- ph.length = ntohs(ph.length);
- ph.pptp_type = ntohs(ph.pptp_type);
- ph.magic = ntohl(ph.magic);
- ph.ctrl_type = ntohs(ph.ctrl_type);
-
- if (ph.length <= 0 || ph.length > PPTP_MAX_CTRL_PCKT_SIZE) {
- syslog(LOG_WARNING, "MGR: initial packet length %d outside "
- "(0 - %d)", ph.length, PPTP_MAX_CTRL_PCKT_SIZE);
- goto dos_exit;
- }
-
- if (ph.magic != PPTP_MAGIC_COOKIE) {
- syslog(LOG_WARNING, "MGR: initial packet bad magic");
- goto dos_exit;
- }
-
- if (ph.pptp_type != PPTP_CTRL_MESSAGE) {
- syslog(LOG_WARNING, "MGR: initial packet has bad type");
- goto dos_exit;
- }
-
- if (ph.ctrl_type != START_CTRL_CONN_RQST) {
- syslog(LOG_WARNING, "MGR: initial packet has bad ctrl type "
- "0x%x", ph.ctrl_type);
- dos_exit:
- close(clientSocket);
- continue;
- }
-
-#ifndef HAVE_FORK
- switch (ctrl_pid = vfork()) {
-#else
- switch (ctrl_pid = fork()) {
-#endif
- case -1: /* error */
- syslog(LOG_ERR, "MGR: fork() failed launching " PPTP_CTRL_BIN);
- close(clientSocket);
- break;
-
- case 0: /* child */
- close(hostSocket);
- if (pptp_debug)
- syslog(LOG_DEBUG, "MGR: Launching " PPTP_CTRL_BIN " to handle client");
- connectCall(clientSocket, !pptp_delegate ? firstOpen : 0);
- _exit(1);
- /* NORETURN */
- default: /* parent */
- close(clientSocket);
- unique_call_id += MAX_CALLS_PER_TCP_LINK;
- if (!pptp_delegate)
- slot_set_pid(firstOpen, ctrl_pid);
- break;
- }
- }
- } /* FD_ISSET(hostSocket, &connSet) */
- } /* while (1) */
-} /* pptp_manager() */
-
-/*
- * Author: Kevin Thayer
- *
- * This creates a socket to listen on, sets the max # of pending connections and
- * various other options.
- *
- * Returns the fd of the host socket.
- *
- * The function return values are:
- * 0 for sucessful
- * -1 for bad socket creation
- * -2 for bad socket options
- * -3 for bad bind
- * -4 for bad listen
- */
-static int createHostSocket(int *hostSocket)
-{
- int opt = 1;
- struct sockaddr_in address;
-#ifdef HAVE_GETSERVBYNAME
- struct servent *serv;
-#endif
-
- /* create the master socket and check it worked */
- if ((*hostSocket = socket(AF_INET, SOCK_STREAM, 0)) == 0)
- return -1;
-
- /* set master socket to allow daemon to be restarted with connections active */
- if (setsockopt(*hostSocket, SOL_SOCKET, SO_REUSEADDR,
- (char *) &opt, sizeof(opt)) < 0)
- return -2;
-
- /* set up socket */
- memset(&address, 0, sizeof(address));
- address.sin_family = AF_INET;
- if(bindaddr)
- address.sin_addr.s_addr = inet_addr(bindaddr);
- else
- address.sin_addr.s_addr = INADDR_ANY;
-#ifdef HAVE_GETSERVBYNAME
- if ((serv = getservbyname("pptp", "tcp")) != NULL) {
- address.sin_port = serv->s_port;
- } else
-#endif
- address.sin_port = htons(PPTP_PORT);
-
- /* bind the socket to the pptp port */
- if (bind(*hostSocket, (struct sockaddr *) &address, sizeof(address)) < 0)
- return -3;
-
- /* minimal backlog to avoid DoS */
- if (listen(*hostSocket, 3) < 0)
- return -4;
-
- return 0;
-}
-
-/*
- * Author: Kevin Thayer
- *
- * this routine sets up the arguments for the call handler and calls it.
- */
-
-static void connectCall(int clientSocket, int clientNumber)
-{
-
-#define NUM2ARRAY(array, num) snprintf(array, sizeof(array), "%d", num)
-
- char *ctrl_argv[16]; /* arguments for launching 'pptpctrl' binary */
-
- int pptpctrl_argc = 0; /* count the number of arguments sent to pptpctrl */
-
- /* lame strings to hold passed args. */
- char ctrl_debug[2];
- char ctrl_noipparam[2];
- char pppdoptfile_argv[2];
- char speedgiven_argv[2];
- extern char **environ;
-
- char ptimeout_argv[16];
-
- /*
- * Launch the CTRL manager binary; we send it some information such as
- * speed and option file on the command line.
- */
-
- ctrl_argv[pptpctrl_argc++] = PPTP_CTRL_BIN " ";
-
- /* Pass socket as stdin */
- if (clientSocket != 0) {
- dup2(clientSocket, 0);
- close(clientSocket);
- }
-
- /* get argv set up */
- NUM2ARRAY(ctrl_debug, pptp_debug ? 1 : 0);
- ctrl_debug[1] = '\0';
- ctrl_argv[pptpctrl_argc++] = ctrl_debug;
-
- NUM2ARRAY(ctrl_noipparam, pptp_noipparam ? 1 : 0);
- ctrl_noipparam[1] = '\0';
- ctrl_argv[pptpctrl_argc++] = ctrl_noipparam;
-
- /* optionfile = TRUE or FALSE; so the CTRL manager knows whether to load a non-standard options file */
- NUM2ARRAY(pppdoptfile_argv, pppdoptstr ? 1 : 0);
- pppdoptfile_argv[1] = '\0';
- ctrl_argv[pptpctrl_argc++] = pppdoptfile_argv;
- if (pppdoptstr) {
- /* send the option filename so the CTRL manager can launch pppd with this alternate file */
- ctrl_argv[pptpctrl_argc++] = pppdoptstr;
- }
- /* tell the ctrl manager whether we were given a speed */
- NUM2ARRAY(speedgiven_argv, speedstr ? 1 : 0);
- speedgiven_argv[1] = '\0';
- ctrl_argv[pptpctrl_argc++] = speedgiven_argv;
- if (speedstr) {
- /* send the CTRL manager the speed of the connection so it can fire pppd at that speed */
- ctrl_argv[pptpctrl_argc++] = speedstr;
- }
- if (pptp_delegate) {
- /* no local or remote address to specify */
- ctrl_argv[pptpctrl_argc++] = "0";
- ctrl_argv[pptpctrl_argc++] = "0";
- } else {
- /* specify local & remote addresses for this call */
- ctrl_argv[pptpctrl_argc++] = "1";
- ctrl_argv[pptpctrl_argc++] = slot_get_local(clientNumber);
- ctrl_argv[pptpctrl_argc++] = "1";
- ctrl_argv[pptpctrl_argc++] = slot_get_remote(clientNumber);
- }
-
- /* our call id to be included in GRE packets the client
- * will send to us */
- NUM2ARRAY(ptimeout_argv, pptp_ptimeout);
- ctrl_argv[pptpctrl_argc++] = ptimeout_argv;
-
- /* pass path to ppp binary */
- ctrl_argv[pptpctrl_argc++] = ppp_binary;
-
- /* pass logwtmp flag */
- ctrl_argv[pptpctrl_argc++] = pptp_logwtmp ? "1" : "0";
-
- /* note: update pptpctrl.8 if the argument list format is changed */
-
- /* terminate argv array with a NULL */
- ctrl_argv[pptpctrl_argc] = NULL;
- pptpctrl_argc++;
-
- /* ok, args are setup: invoke the call handler */
- execve(PPTP_CTRL_BIN, ctrl_argv, environ);
- syslog(LOG_ERR, "MGR: Failed to exec " PPTP_CTRL_BIN "!");
- _exit(1);
-}
diff --git a/pptpd-1.3.3/pptpmanager.h b/pptpd-1.3.3/pptpmanager.h
deleted file mode 100644
index cd88cba..0000000
--- a/pptpd-1.3.3/pptpmanager.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * pptpmanager.h
- *
- * Manager function prototype.
- *
- * $Id: pptpmanager.h,v 1.2 2005/12/29 09:59:49 quozl Exp $
- */
-
-#ifndef _PPTPD_PPTPSERVER_H
-#define _PPTPD_PPTPSERVER_H
-
-void slot_init(int count);
-void slot_free();
-void slot_set_local(int i, char *ip);
-void slot_set_remote(int i, char *ip);
-void slot_set_pid(int i, pid_t pid);
-int slot_find_by_pid(pid_t pid);
-int slot_find_empty();
-char *slot_get_local(int i);
-char *slot_get_remote(int i);
-
-extern int pptp_manager(int argc, char **argv);
-
-#endif /* !_PPTPD_PPTPSERVER_H */
diff --git a/pptpd-1.3.3/reconf b/pptpd-1.3.3/reconf
deleted file mode 100755
index 8516beb..0000000
--- a/pptpd-1.3.3/reconf
+++ /dev/null
@@ -1,61 +0,0 @@
-#! /bin/sh
-#
-# Reconfigure for a release, by updating the Makefile dependencies and
-# running the autotools.
-#
-# $Id: reconf,v 1.3 2004/04/23 10:06:17 quozl Exp $
-
-# make the existing config.h disappear temporarily
-if test -f config.h
-then
- mv -f config.h config.h.TMP
-fi
-touch config.h
-
-# rebuild dependencies (makedepend)
-for makefile in Makefile.am Makefile.uClinux
-do
- echo -n "Rebuilding $makefile..."
- head -`grep -n 'DO NOT ADD BELOW THIS POINT' $makefile | \
- cut -d: -f1` $makefile > $makefile.new
- for file in *.c
- do
- if test "$makefile" = "Makefile.uClinux"
- then
- gcc -MM $file -include config.embed.h
- else
- gcc -MM $file -DHAVE_CONFIG_H
- fi
- echo ''
- done >> $makefile.new
- echo 'done.'
- if ! cmp -s $makefile.new $makefile
- then
- echo "Changes: <=old >=new"
- diff $makefile $makefile.new | grep '^[<>]'
- mv -f $makefile.new $makefile
- else
- rm -f $makefile.new
- echo "No change."
- fi
-done
-
-# restore the previous config.h
-rm -f config.h
-if test -f config.h.TMP
-then
- mv -f config.h.TMP config.h
-fi
-
-# show us what we do next
-set -x
-
-# reset the configuration
-rm -f config.cache
-rm -f config.log
-
-# run the build tools sequence
-aclocal
-autoconf
-automake -a --copy --verbose
-autoheader
diff --git a/pptpd-1.3.3/samples/chap-secrets b/pptpd-1.3.3/samples/chap-secrets
deleted file mode 100644
index a6dac4e..0000000
--- a/pptpd-1.3.3/samples/chap-secrets
+++ /dev/null
@@ -1,3 +0,0 @@
-# Secrets for authentication using CHAP
-# client server secret IP addresses
-#username pptpd password *
diff --git a/pptpd-1.3.3/samples/options.pptpd b/pptpd-1.3.3/samples/options.pptpd
deleted file mode 100644
index 4fdda0d..0000000
--- a/pptpd-1.3.3/samples/options.pptpd
+++ /dev/null
@@ -1,128 +0,0 @@
-###############################################################################
-# $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
-
-# 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)
-
diff --git a/pptpd-1.3.3/samples/pptpd.conf b/pptpd-1.3.3/samples/pptpd.conf
deleted file mode 100644
index 4abe15b..0000000
--- a/pptpd-1.3.3/samples/pptpd.conf
+++ /dev/null
@@ -1,100 +0,0 @@
-###############################################################################
-# $Id: pptpd.conf,v 1.10 2006/09/04 23:30:57 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: delegate
-# Delegates the allocation of client IP addresses to pppd.
-#
-# Without this option, which is the default, pptpd manages the list of
-# IP addresses for clients and passes the next free address to pppd.
-# With this option, pptpd does not pass an address, and so pppd may use
-# radius or chap-secrets to allocate an address.
-#
-#delegate
-
-# TAG: connections
-# Limits the number of client connections that may be accepted.
-#
-# If pptpd is allocating IP addresses (e.g. delegate is not
-# used) then the number of connections is also limited by the
-# remoteip option. The default is 100.
-#connections 100
-
-# TAG: localip
-# TAG: remoteip
-# Specifies the local and remote IP address ranges.
-#
-# These options are ignored if delegate option is set.
-#
-# 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 the value of connections,
-# it will start at the beginning of the list and go until it
-# gets 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
-#remoteip 192.168.0.234-238,192.168.0.245
-# or
-#localip 192.168.0.234-238,192.168.0.245
-#remoteip 192.168.1.234-238,192.168.1.245
diff --git a/pptpd-1.3.3/tools/pptp-portslave b/pptpd-1.3.3/tools/pptp-portslave
deleted file mode 100755
index fbaee83..0000000
--- a/pptpd-1.3.3/tools/pptp-portslave
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-export PORTSLAVELOGNAME="AutoPPP"
-export PORTSLAVE_SESSION=`date +%s``printf "%X" $RANDOM`
-export PORTSLAVE_START_TIME=`date +%s`
-export PORTSLAVE_DO_ACCT="1"
-exec /usr/sbin/pppd $* plugin /usr/lib/libpsr.so
diff --git a/pptpd-1.3.3/tools/vpnstats b/pptpd-1.3.3/tools/vpnstats
deleted file mode 100755
index bfc9a3d..0000000
--- a/pptpd-1.3.3/tools/vpnstats
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-#
-# vpnstats Get commaseparated file and mail it to the admin
-# Version 1.0 beta by Richard de Vroede - Linvision BV <richard@linvision.com>
-#
-
-# check for conf file, else create with defaults
-CONF=/etc/vpnstats.conf
-if [ ! -f $CONF ]; then
- echo "LOGFILE=/var/log/messages.1" > $CONF
- echo "STATFILE=/var/log/vpnstats" >> $CONF
- echo "TEMPFILE=/tmp/tmpvpnstats" >> $CONF
- echo "SMTP=localhost" >> $CONF
- echo "FROM=" >> $CONF
- echo "TO=" >> $CONF
-fi
-. $CONF
-
-# check for weekly crontab, else create it
-CRON=/etc/cron.weekly/vpnstats.cron
-if [ ! -f $CRON ]; then
- echo "#!/bin/bash" > $CRON
- echo "$0" >> $CRON
- chmod 755 $CRON
-fi
-
-echo "Name,Login,Logout,Connected Minutes,Recieved Bytes,Transmitted Bytes" > $STATFILE
-PPPDPID=$(grep "peer authentication succeeded" $LOGFILE | cut -d [ -f2 | cut -d ] -f 1)
-while [ "$PPPDPID" != "" ]; do
- PID=$(echo $PPPDPID | awk '{print $1}')
- grep $PID $LOGFILE | grep pppd | grep -v pptpd > $TEMPFILE
- NAME=$(grep "succeeded for" $TEMPFILE | awk -F "succeeded for" '{print $2}' | cut -d " " -f 2)
- LOGIN=$(grep "succeeded for" $TEMPFILE | cut -d " " -f 1-3)
- LOGOUT=$(grep "Connect time" $TEMPFILE | cut -d " " -f 1-3)
- CONNECT=$(grep "Connect time" $TEMPFILE | cut -d ] -f 2 | cut -d " " -f 4)
- RXB=$(grep "Sent" $TEMPFILE | cut -d ] -f 2 | cut -d " " -f 3)
- TXB=$(grep "Sent" $TEMPFILE | cut -d ] -f 2 | cut -d " " -f 6)
- echo "$NAME,$LOGIN,$LOGOUT,$CONNECT,$RXB,$TXB" >> $STATFILE
- PPPDPID=$(echo $PPPDPID | sed "s%$PID%%")
- rm -f $TEMPFILE
-done
-
-MAILER=$(echo $(locate sendEmail) | awk '{print$1}')
-if [ "$MAILER" != "" ]; then
- if [ "$FROM" = "" ]; then FROM=root@`uname -n`; fi
- if [ "$TO" = "" ]; then TO=root@localhost; fi
- $MAILER -s $SMTP -u "VPNstats" -f $FROM -t $TO -m " " -a $STATFILE
-else
- if [ -f "/bin/mail" ]; then
- cat $STATFILE | /bin/mail -s "VPNstats" $TO
- else
- echo "You need /bin/mail OR"
- echo "the Perl program sendEmail located at http://freshmeat.net/projects/sendemail/"
- fi
-fi
diff --git a/pptpd-1.3.3/tools/vpnstats.pl b/pptpd-1.3.3/tools/vpnstats.pl
deleted file mode 100755
index 1688d98..0000000
--- a/pptpd-1.3.3/tools/vpnstats.pl
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-#
-# vpnstats - generate list of VPN connections from PPTP+PPP log messages
-# copyright (C) 2002 Scott Merrill (skippy@skippy.net)
-#
-# usage: vpnstats /var/log/messages
-#
-# version 1.4 09-09-2003
-# - thanks to Masaya Miyamoto (miyamo@po.ntts.co.jp)
-# and David Fuzishima (david_f@zipmail.com.br) for fixing the
-# date/time regexes to catch single-digit days (9 instead of 09).
-#
-# version 1.3
-# - thanks to Andy Behrens <andy.behrens@coat.com> for
-# fixing up the regex to catch extraneous whitespace, and
-# domain names that inlucde numbers and underscores.
-# - I modified the output to report when a user is still connected
-# - thanks to Wolfgang Powisch for fixing hostnames included a "-"
-#
-# 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.
-#
-my @messages = ();
-my %PID_USER = ();
-my %PID_IP = ();
-my %PID_LENGTH = ();
-my %PID_SENT = ();
-my %PID_RECEIVED = ();
-my %PID_DATETIME = ();
-my %USER_TOTAL_CONNECT = ();
-my %USER_TOTAL_TIME = ();
-my %USER_TOTAL_SENT = ();
-my %USER_TOTAL_RECEIVED = ();
-my %vpnstats = ();
-
-@messages = <>;
-
-# for each line of input
-foreach my $x (@messages) {
- if ($x =~ /^(\w+\s+\d+\s\d+:\d+:\d+)\s # $1 = date+time
- \S+\spppd\[(\d+)\]:\s # $2 = PID
- MSCHAP-v2\speer\sauthentication\ssucceeded\sfor\s
- # I don't want the DOMAIN\\ prefix
- (.+\\)*(\w+)$ # $4 = username
- /x) {
- $PID_USER{$2} = $4;
- $PID_DATETIME{$2} = $1;
- $USER_TOTAL_CONNECT{$4}++;
- } elsif ($x =~ /^(\w+\s+\d+\s\d+:\d+:\d+)\s # $1 = date+time
- \S+\spppd\[(\d+)\]:\s # $2 = PID
- Connect\stime\s
- (\d*\.\d*) # $3 = minutes
- \sminutes\.$
- /x) {
- $PID_LENGTH{$2} = $3;
- $USER_TOTAL_TIME{$PID_USER{$2}} += $3;
- } elsif ($x =~ /^(\w+\s+\d+\s\d+:\d+:\d+)\s # $1 = date+time
- \S+\spppd\[(\d+)\]:\s # $2 = PID
- Sent\s(\d+)\sbytes,\s # $3 = bytes sent
- received\s(\d+)\s # $4 = bytes received
- /x) {
- $PID_SENT{$2} = $3;
- $PID_RECEIVED{$2} = $4;
- $USER_TOTAL_SENT{$PID_USER{$2}} += $3;
- $USER_TOTAL_RECEIVED{$PID_USER{$2}} += $4;
- } elsif ($x =~ /^(\w+\s+\d+\s\d+:\d+:\d+)\s # $1 = date+time
- \S+\spptpd\[(\d+)\]:\s # $2 = PID
- CTRL:\sClient\s
- (\d+\.\d+\.\d+\.\d+)\s # $3 = IP
- control\sconnection\sfinished$
- /x) {
- $PID_IP{($2+1)} = $3;
- if (!defined ($PID_USER{($2+1)})) {
- $PID_DATETIME{($2+1)} = $1;
- $PID_USER{($2+1)} = "FAILED";
- $USER_TOTAL_CONNECT{"FAILED"}++;
- }
- }
-}
-foreach my $user (sort keys %USER_TOTAL_CONNECT) {
- if (! defined $user) { next };
- if ($user ne "FAILED") {
- print $user, ": ", $USER_TOTAL_CONNECT{$user}, " connections, ";
- print $USER_TOTAL_TIME{$user}, " minutes (";
- print $USER_TOTAL_SENT{$user}, " sent, ";
- print $USER_TOTAL_RECEIVED{$user}, " received).\n";
- foreach my $pid (sort keys %PID_DATETIME) {
- if ($user eq $PID_USER{$pid}) {
- print " ";
- print $PID_DATETIME{$pid}, ": connected ";
- if ($PID_IP{$pid}) {
- print "from $PID_IP{$pid} ";
- print "for $PID_LENGTH{$pid} minutes.\n";
- } else {
- print "<still connected>\n";
- }
- }
- }
- }
-}
-if (defined $USER_TOTAL_CONNECT{"FAILED"}) {
- print "\n\n";
- print "FAILED CONNECTION ATTEMPTS: ";
- print $USER_TOTAL_CONNECT{"FAILED"}, "\n";
- foreach my $pid (sort keys %PID_DATETIME) {
- if ($PID_USER{$pid} eq "FAILED") {
- print " ";
- print $PID_DATETIME{$pid}, ": attempt from ";
- print $PID_IP{$pid}, "\n";
- }
- }
-}
-
diff --git a/pptpd-1.3.3/tools/vpnuser b/pptpd-1.3.3/tools/vpnuser
deleted file mode 100755
index 814027c..0000000
--- a/pptpd-1.3.3/tools/vpnuser
+++ /dev/null
@@ -1,59 +0,0 @@
-#! /bin/sh
-#
-# vpnuser Add/Del user to chap-secrets for VPN
-# Version 1.0 beta by Richard de Vroede - Linvision BV
-# Ideas or worshipping to: richard@linvision.com
-#
-
-config="/etc/ppp/chap-secrets"
-ERROR="Usage:\n$0 add <username> <passwd> or\n$0 del <username> or\n$0 show [<username>] or\n$0 domain <username> <domain>"
-
-# See how we were called.
-case "$1" in
- add)
- if [ "$(echo $2)" != "" ] & [ "$(echo $3)" != "" ]; then
- echo -e "$2\t*\t$3\t*" >> $config
- chmod 600 $config
- else
- echo -e $ERROR
- exit 1
- fi
- ;;
- del)
- if [ "$(echo $2)" != "" ]; then
- grep -vw "$2" $config > /tmp/vpnblaat
- mv /tmp/vpnblaat $config
- chmod 600 $config
- else
- echo -e $ERROR
- exit 1
- fi
- ;;
- show)
- echo -e "User\tServer\tPasswd\tIPnumber"
- echo "---------------------------------"
- if [ "$(echo $2)" != "" ]; then
- grep -w $2 $config
- else
- cat $config
- fi
- ;;
- domain)
- if [ "$(echo $2)" != "" ] & [ "$(echo $3)" != "" ]; then
- grep -vw "$2" $config > /tmp/vpnblaat
- DATA=`grep -w "$2" $config`
- mv /tmp/vpnblaat $config
- DOM=`echo $3 | tr a-z A-Z`
- dom=`echo $3 | tr A-Z a-z`
- echo "$DOM\\\\$DATA" >> $config
- echo "$dom\\\\$DATA" >> $config
- chmod 600 $config
- else
- echo -e $ERROR
- exit 1
- fi
- ;;
- *)
- echo -e $ERROR
- exit 1
-esac
diff --git a/pptpd-1.3.3/version b/pptpd-1.3.3/version
deleted file mode 100755
index 9020996..0000000
--- a/pptpd-1.3.3/version
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-#
-# Grab current version number from configure.in and emit on stdout
-#
-# $Id: version,v 1.1.1.1 2002/06/21 08:52:02 fenix_nl Exp $
-
-VER=`grep AM_INIT_AUTOMAKE configure.in | awk -F'[(),]' '{print $3}'`
-
-if [ "$1" == "-VERSION" ]
-then
- echo $VER | awk -F'.' '{print $1}'
- exit
-fi
-
-if [ "$1" == "-PATCHLEVEL" ]
-then
- echo $VER | awk -F'.' '{print $2}'
- exit
-fi
-
-if [ "$1" == "-SUBLEVEL" ]
-then
- echo $VER | awk -F'.' '{print $3}'
- exit
-fi
-
-echo $VER
-exit
diff --git a/rfc/README b/rfc/README
new file mode 100644
index 0000000..a76719b
--- /dev/null
+++ b/rfc/README
@@ -0,0 +1,15 @@
+In this directory are the various standards documents implemented in
+the pptp package.
+
+rfc791.txt Internet Protocol (IP).
+rfc793.txt Transmission Control Protocol (TCP).
+rfc1661.txt The Point-to-Point Protocol (PPP).
+rfc1662.txt PPP in HDLC-like Framing. (serial encoding).
+rfc1701.txt Generic Routing Encapsulation (GRE).
+rfc1702.txt Generic Routing Encapsulation over IPv4 networks.
+rfc1990.txt The PPP Multilink Protocol (MP).
+ms-chap.txt Microsoft PPP CHAP extensions.
+pptp-draft.txt July 1997 draft of the PPTP standard.
+
+rfc1990 is currently unimplemented in pptp
+ CSA, 12/12/97
diff --git a/rfc/README.Reference b/rfc/README.Reference
new file mode 100644
index 0000000..a76719b
--- /dev/null
+++ b/rfc/README.Reference
@@ -0,0 +1,15 @@
+In this directory are the various standards documents implemented in
+the pptp package.
+
+rfc791.txt Internet Protocol (IP).
+rfc793.txt Transmission Control Protocol (TCP).
+rfc1661.txt The Point-to-Point Protocol (PPP).
+rfc1662.txt PPP in HDLC-like Framing. (serial encoding).
+rfc1701.txt Generic Routing Encapsulation (GRE).
+rfc1702.txt Generic Routing Encapsulation over IPv4 networks.
+rfc1990.txt The PPP Multilink Protocol (MP).
+ms-chap.txt Microsoft PPP CHAP extensions.
+pptp-draft.txt July 1997 draft of the PPTP standard.
+
+rfc1990 is currently unimplemented in pptp
+ CSA, 12/12/97
diff --git a/rfc/ms-chap.txt b/rfc/ms-chap.txt
new file mode 100644
index 0000000..f009400
--- /dev/null
+++ b/rfc/ms-chap.txt
@@ -0,0 +1,1139 @@
+
+
+
+
+
+
+Network Working Group S. Cobb
+Informational Memo Microsoft
+Revision 1.3 March 1997
+
+
+ Microsoft PPP CHAP Extensions
+
+
+Status of this Memo
+
+ This document has no official Internet Engineering Task Force
+ status. It is submitted as an example of one vendor's working
+ solution to several authentication issues not yet standardized by
+ the Point-to-Point Working Group.
+
+ The protocol described is implemented in Microsoft Windows NT 3.5
+ and 3.51 and in Microsoft Windows95. Differences between the
+ platforms are noted in the text. This information, plus that in
+ the references, is believed sufficient to implement an
+ interoperating peer.
+
+ Distribution of this memo is unlimited.
+
+
+Abstract
+
+ The Point-to-Point Protocol (PPP) [1] provides a standard method
+ for transporting multi-protocol datagrams over point-to-point
+ links. PPP defines an extensible Link Control Protocol and a
+ family of Network Control Protocols (NCPs) for establishing and
+ configuring different network-layer protocols.
+
+ This document describes Microsoft's PPP CHAP dialect (MS-CHAP),
+ which extends the user authentication functionality provided on
+ Windows networks to remote workstations. MS-CHAP is closely
+ derived from the PPP Challenge/Handshake Authentication Protocol
+ described in RFC 1334 [2], which the reader should have at hand.
+
+
+History
+
+ Rev 1.21: (Sect 6) Fix error in implicit challenge description
+ Rev 1.22: (Sect 7) Fix error in sub-field table ordering
+ Rev 1.3: (Sect 10) Added hash example section
+
+
+
+
+
+
+
+
+Cobb [Page 1]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+Table Of Contents
+
+ 1. Introduction................................................3
+ 2. LCP Configuration...........................................4
+ 3. Challenge Packet............................................4
+ 4. Response Packet.............................................4
+ 5. Success Packet..............................................8
+ 6. Failure Packet..............................................8
+ 7. Change Password Packet (version 1)..........................9
+ 8. Change Password Packet (version 2).........................12
+ 9. Negotiation Examples.......................................16
+ 10. Hash Example...............................................16
+
+ REFERENCES.....................................................18
+ CHAIR'S ADDRESS................................................19
+ AUTHOR'S ADDRESS...............................................19
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Cobb [Page 2]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+1. Introduction
+
+ Microsoft created MS-CHAP to authenticate remote Windows
+ workstations, providing the functionality to which LAN-based users
+ are accustomed.
+
+ The closest fit available in standard PPP is CHAP which is
+ primarily used for mutual secure authentication between WAN-aware
+ routers. Unfortunately, CHAP is not widely used in support of
+ remote workstations where providers commonly require an insecure
+ text login session in place of PPP authentication protocols. To
+ date, several remote workstation issues have not been adequately
+ addressed in CHAP. MS-CHAP addresses these issues and also
+ integrates the encryption and hashing algorithms used on Windows
+ networks.
+
+ Where possible, MS-CHAP is consistent with standard CHAP, and the
+ differences are easily modularized. Microsoft implements MS-CHAP
+ as extensions to it's standard CHAP code base. Briefly,
+ differences between MS-CHAP and standard CHAP are:
+
+ * MS-CHAP is enabled by negotiating CHAP Algorithm 0x80 in LCP
+ option 3, Authentication Protocol.
+
+ * The MS-CHAP Response packet is in a format designed for
+ compatibility with Microsoft Windows NT 3.5 and 3.51,
+ Microsoft Windows95, and Microsoft LAN Manager 2.x networking
+ products. The MS-CHAP format does not require the
+ authenticator to store a clear or reversibly encrypted
+ password.
+
+ * MS-CHAP provides an authenticator controlled authentication
+ retry mechanism.
+
+ * MS-CHAP provides an authenticator controlled change password
+ mechanism.
+
+ * MS-CHAP defines a set of reason-for-failure codes returned in
+ the Failure packet Message field.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Cobb [Page 3]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+2. LCP Configuration
+
+ The LCP configuration for MS-CHAP is identical to that for
+ standard CHAP, except that the Algorithm field has value 0x80,
+ rather than the MD5 value 0x05. Non-MS-CHAP-aware implementations
+ that correctly implement LCP Config-Rej have no problem dealing
+ with this non-standard option.
+
+ Microsoft currently negotiates authentication only on the
+ server->workstation configuration. Mutual authentication may be
+ supported in the future.
+
+
+3. Challenge Packet
+
+ The MS-CHAP Challenge packet is identical in format to the
+ standard CHAP Challenge packet.
+
+ MS-CHAP authenticators send an 8-octet challenge Value field. It
+ is not necessary for peers to duplicate Microsoft's algorithm for
+ selecting the 8-octet value, but the CHAP guidelines on randomness
+ should be observed.
+
+ Microsoft authenticators do not currently provide information in
+ the Name field. This may change in the future.
+
+
+4. Response Packet
+
+ The MS-CHAP Response packet is identical in format to the standard
+ CHAP Response packet. However, the Value field is sub-formatted
+ differently as follows:
+
+ 24 octets: LAN Manager compatible challenge response
+ 24 octets: Windows NT compatible challenge response
+ 1 octet : "Use Windows NT compatible challenge response" flag
+
+ The LAN Manager compatible challenge response is an encoded
+ function of the password and the received challenge as output by
+ the pseudo-code routine LmChallengeResponse below. LAN Manager
+ passwords are limited to 14 case-insensitive OEM characters.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Cobb [Page 4]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ LmChallengeResponse(
+ IN 8-octet Challenge,
+ IN 0-to-14-oem-char Password,
+ OUT 24-octet Response )
+ {
+ LmPasswordHash(
+ Password,
+ giving PasswordHash )
+
+ ChallengeResponse(
+ Challenge,
+ PasswordHash,
+ giving Response )
+ }
+
+ LmPasswordHash(
+ IN 0-to-14-oem-char Password,
+ OUT 16-octet PasswordHash )
+ {
+ Set UcasePassword to the uppercased Password
+ Zero pad UcasePassword to 14 characters
+
+ DesHash(
+ 1st 7-octets of UcasePassword,
+ giving 1st 8-octets of PasswordHash )
+
+ DesHash(
+ 2nd 7-octets of UcasePassword,
+ giving 2nd 8-octets of PasswordHash )
+ }
+
+ DesHash(
+ IN 7-octet Clear,
+ OUT 8-octet Cypher )
+ {
+ Make Cypher an irreversibly encrypted form of Clear by
+ encrypting known text [6] using Clear as the secret key,
+ that is...
+
+ DesEncrypt(
+ StdText,
+ Clear,
+ giving Cypher )
+ }
+
+
+
+
+
+
+
+
+
+
+
+Cobb [Page 5]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ DesEncrypt(
+ IN 8-octet Clear,
+ IN 7-octet Key,
+ OUT 8-octet Cypher )
+ {
+ Use the DES encryption algorithm [3] to encrypt Clear into
+ Cypher such that Cypher can only be decrypted back to
+ Clear by providing Key. Note that the DES algorithm takes
+ as input a 64-bit stream where the 8th, 16th, 24th, etc
+ bits are parity bits ignored by the encrypting algorithm.
+ Unless you write your own DES to accept 56-bit input
+ without parity, you will need to insert the parity bits
+ yourself.
+ }
+
+ ChallengeResponse(
+ IN 8-octet Challenge,
+ IN 16-octet PasswordHash,
+ OUT 24-octet Response )
+ {
+ Set ZPasswordHash to PasswordHash zero padded to 21 octets
+
+ DesEncrypt(
+ Challenge,
+ 1st 7-octets of ZPasswordHash,
+ giving 1st 8-octets of Response )
+
+ DesEncrypt(
+ Challenge,
+ 2nd 7-octets of ZPasswordHash,
+ giving 2nd 8-octets of Response )
+
+ DesEncrypt(
+ Challenge,
+ 3rd 7-octets of ZPasswordHash,
+ giving 3rd 8-octets of Response )
+ }
+
+
+ The Windows NT compatible challenge response is an encoded
+ function of the password and the received challenge as output by
+ the NtChallengeResponse routine below. The Windows NT password is
+ a string of 0 to (theoretically) 256 case-sensitive Unicode
+ characters. Current versions of Windows NT limit passwords to 14
+ characters, mainly for compatibility reasons, though this may
+ change in the future.
+
+
+
+
+
+
+
+
+
+Cobb [Page 6]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ NtChallengeResponse(
+ IN 8-octet Challenge,
+ IN 0-to-256-unicode-char Password,
+ OUT 24-octet Response )
+ {
+ NtPasswordHash(
+ Password,
+ giving PasswordHash )
+
+ ChallengeResponse(
+ Challenge,
+ PasswordHash,
+ giving Response )
+ }
+
+ NtPasswordHash(
+ IN 0-to-256-unicode-char Password,
+ OUT 16-octet PasswordHash )
+ {
+ Use the MD4 algorithm [4] to irreversibly hash Password
+ into PasswordHash. Only the password is hashed without
+ including any terminating 0.
+ }
+
+ The "use Windows NT compatible challenge response" flag, if 1,
+ indicates that the Windows NT response is provided and should be
+ used in preference to the LAN Manager response. The LAN Manager
+ response will still be used if the account does not have a Windows
+ NT password hash, e.g. if the password has not been changed since
+ the account was uploaded from a LAN Manager 2.x account database.
+ The LAN Manager response need not be provided (set to 0's) if the
+ implementation expects all user accounts to be stored only in
+ fresh Windows NT account databases or ones where all uploaded
+ passwords have been changed. However, doing so may sacrifice
+ downward compatibility with non-Windows-NT servers.
+
+ If the flag is 0, the Windows NT response is ignored and the LAN
+ Manager response is used. If the password is LAN Manager
+ compatible, interoperability may be achieved without providing the
+ Windows NT challenge response (set to 0's), and providing only the
+ LAN Manager response. This is what Microsoft Windows95 does,
+ though this may change in the future. Doing so may sacrifice
+ interoperability with OEM-specific versions of Windows NT designed
+ for maximum security in Windows-NT-only networks.
+
+ Implementors seeking the broadest possible interoperability are
+ advised to supply both responses when the password is LAN Manager
+ compatible. This is what Microsoft Windows NT does.
+
+
+
+
+
+
+
+Cobb [Page 7]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ The Name field identifies the authenticatee's user account name.
+ The Windows NT domain name may prefix the user's account name in
+ the typical Windows NT format, e.g. "redmond\stevec" where
+ "redmond" is a Windows NT domain containing the user account
+ "stevec". If a domain is not provided, the backslash should also
+ be omitted, e.g. "stevec".
+
+
+5. Success Packet
+
+ The Success packet is identical in format to the standard CHAP
+ Success packet.
+
+
+6. Failure Packet
+
+ The Failure packet is identical in format to the standard CHAP
+ Failure packet. There is, however, formatted text stored in the
+ Message field which, contrary to the standard CHAP rules, does
+ affect the protocol. The Message field format is:
+
+ "E=eeeeeeeeee R=r C=cccccccccccccccc V=vvvvvvvvvv"
+
+ where
+
+ The "eeeeeeeeee" is the decimal error code (need not be 10
+ digits) corresponding to one of those listed below, though
+ implementations should deal with codes not on this list
+ gracefully.
+
+ 646 ERROR_RESTRICTED_LOGON_HOURS
+ 647 ERROR_ACCT_DISABLED
+ 648 ERROR_PASSWD_EXPIRED
+ 649 ERROR_NO_DIALIN_PERMISSION
+ 691 ERROR_AUTHENTICATION_FAILURE
+ 709 ERROR_CHANGING_PASSWORD
+
+ The "r" is a flag set to "1" if a retry is allowed, and "0" if
+ not. When authenticator sets this flag to "1" it disables
+ short timeouts, expecting the authenticatee to prompt the user
+ for new credentials and resubmit the response.
+
+ The "cccccccccccccccc" is 16 hex digits representing an ASCII
+ representation of a new challenge value. This field is
+ optional. If it is not sent, authenticator expects the
+ resubmitted response to be calculated based on the previous
+ challenge value plus decimal 23 in the first octet, i.e. the
+ one immediately following the Value Size field. Windows95
+ authenticators may send this field. Windows NT authenticators
+ do not, but may in the future. Both systems implement
+ authenticatee support of this field.
+
+
+
+
+Cobb [Page 8]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ The "vvvvvvvvvv" is the decimal version code (need not be 10
+ digits) indicating the MS-CHAP protocol version supported on
+ the server. Currently, this is interesting only in selecting
+ a Change Password packet type. If the field is not present
+ the version should be assumed 1.
+
+ Implementations should accept but ignore additional text they do
+ not recognize.
+
+
+7. Change Password Packet (version 1)
+
+ The version 1 Change Password packet does not appear in standard
+ CHAP. It allows the authenticatee to change the password on the
+ account specified in the previous Response packet. The version 1
+ Change Password packet should be sent only if the authenticator
+ reports ERROR_PASSWD_EXPIRED (E=648) in the Message field of the
+ Failure packet.
+
+ This packet type is supported by Windows NT 3.5 and 3.51. It is
+ not supported by Windows95, though this may change in the future.
+ See also Change Password Packet (version 2).
+
+ The format of this packet is as follows:
+
+ 1 octet : Code (=5)
+ 1 octet : Identifier
+ 2 octets: Length (=72)
+ 16 octets: Encrypted LAN Manager Old password Hash
+ 16 octets: Encrypted LAN Manager New Password Hash
+ 16 octets: Encrypted Windows NT Old Password Hash
+ 16 octets: Encrypted Windows NT New Password Hash
+ 2 octets: Password Length
+ 2 octets: Flags
+
+
+ Code
+
+ 5
+
+
+ Identifier
+
+ The Identifier field is one octet and aids in matching
+ requests and replies. The value is the Identifier of the
+ received Failure packet to which this packet responds plus 1.
+
+
+ Length
+
+ 72
+
+
+
+
+Cobb [Page 9]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ Encrypted LAN Manager New Password Hash
+ Encrypted LAN Manager Old Password Hash
+
+ These fields contain the LAN Manager password hash of the new
+ and old passwords encrypted with an 8-octet key value [6], as
+ output by the pseudo-code routine LmEncryptedPasswordHash
+ below.
+
+ LmEncryptedPasswordHash(
+ IN 0-to-14-oem-char Password,
+ IN 8-octet KeyValue,
+ OUT 16-octet Cypher )
+ {
+ LmPasswordHash(
+ Password,
+ giving PasswordHash )
+
+ PasswordHashEncryptedWithBlock(
+ PasswordHash,
+ KeyValue,
+ giving Cypher )
+ }
+
+ PasswordHashEncryptedWithBlock(
+ IN 16-octet PasswordHash,
+ IN 7-octet Block,
+ OUT 16-octet Cypher )
+ {
+ DesEncrypt(
+ 1st 8-octets PasswordHash,
+ 1st 7-octets Block,
+ giving 1st 8-octets Cypher )
+
+ DesEncrypt(
+ 2nd 8-octets PasswordHash,
+ 1st 7-octets Block,
+ giving 2nd 8-octets Cypher )
+ }
+
+
+ Encrypted Windows NT New Password Hash
+ Encrypted Windows NT Old Password Hash
+
+ These fields contain the Windows NT password hash of the new
+ and old passwords encrypted with an 8-octet key value [6], as
+ output by the pseudo-code routine NtEncryptedPasswordHash
+ below.
+
+
+
+
+
+
+
+
+Cobb [Page 10]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ NtEncryptedPasswordHash(
+ IN 0-to-14-oem-char Password
+ IN 8-octet Challenge
+ OUT 16-octet Cypher )
+ {
+ NtPasswordHash(
+ Password,
+ giving PasswordHash )
+
+ PasswordHashEncryptedWithBlock(
+ PasswordHash,
+ Challenge,
+ giving Cypher )
+ }
+
+
+ Password Length
+
+ The length in octets of the LAN Manager compatible form of the
+ new password. If this value is less than or equal to 14 it is
+ assumed that the encrypted LAN Manager password hash fields
+ are valid. Otherwise, it is assumed these fields are not
+ valid, in which case the Windows NT compatible passwords must
+ be provided.
+
+
+ Flags
+
+ Bit field of option flags where 0 is the least significant bit
+ of the 16-bit quantity:
+
+ 0 : Set 1 indicates that the encrypted Windows NT
+ hashed passwords are valid and should be used. If
+ 0, the Windows NT fields are not used and the LAN
+ Manager fields must be provided.
+
+ For the broadest possible interoperability,
+ implementations are encouraged to provide both the
+ Windows NT and LAN Manager fields when the password
+ is LAN Manager compatible. This is what Windows NT
+ does.
+
+ 1-15 : Reserved, always set 0.
+
+
+
+
+
+
+
+
+
+
+
+
+Cobb [Page 11]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+8. Change Password Packet (version 2)
+
+ The version 2 Change Password packet does not appear in standard
+ CHAP. It allows the authenticatee to change the password on the
+ account specified in the previous Response packet. The version 2
+ Change Password packet should be sent only if the authenticator
+ reports ERROR_PASSWD_EXPIRED (E=648) and a version of 2 or more in
+ the Message field of the Failure packet.
+
+ This packet type is supported by Windows NT 3.51. It is not
+ supported by Windows NT 3.5 or Windows95, though the latter may
+ change in the future. The version 2 change password packet type
+ is preferable to the version 1 type and should be offered and
+ accepted where possible.
+
+ The format of this packet is as follows:
+
+ 1 octet : Code (=6)
+ 1 octet : Identifier
+ 2 octet : Length (=1070)
+ 516 octets : Password Encrypted with Old NT Hash
+ 16 octets : Old NT Hash Encrypted with New NT Hash
+ 516 octets : Password Encrypted with Old LM Hash
+ 16 octets : Old LM Hash Encrypted With New NT Hash
+ 24 octets : LAN Manager compatible challenge response
+ 24 octets : Windows NT compatible challenge response
+ 2-octet : Flags
+
+
+ Code
+
+ 6
+
+
+ Identifier
+
+ The Identifier field is one octet and aids in matching
+ requests and replies. The value is the Identifier of the
+ received Failure packet to which this packet responds plus 1.
+
+
+ Length
+
+ 1118
+
+
+ Password Encrypted with Old NT Hash
+
+ This field contains the PWBLOCK form of the new Windows NT
+ password encrypted with the old Windows NT password hash, as
+ output by the NewPasswordEncryptedWithOldNtPasswordHash
+ routine below:
+
+
+
+Cobb [Page 12]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ datatype-PWBLOCK
+ {
+ 256-unicode-char Password
+ 4-octets PasswordLength
+ }
+
+ NewPasswordEncryptedWithOldNtPasswordHash(
+ IN 0-to-256-unicode-char NewPassword,
+ IN 0-to-256-unicode-char OldPassword,
+ OUT datatype-PWBLOCK EncryptedPwBlock )
+ {
+ NtPasswordHash(
+ OldPassword,
+ giving PasswordHash )
+
+ EncryptPwBlockWithPasswordHash(
+ NewPassword,
+ PasswordHash,
+ giving EncryptedPwBlock )
+ }
+
+ EncryptPwBlockWithPasswordHash(
+ IN 0-to-256-unicode-char Password,
+ IN 16-octet PasswordHash,
+ OUT datatype-PWBLOCK PwBlock )
+ {
+ Fill ClearPwBlock with random octet values
+ lstrcpyW( to ClearPwBlock.Password, from Password )
+ ClearPwBlock.PasswordLength = lstrlenW( Password )
+
+ Rc4Encrypt(
+ ClearPwBlock,
+ sizeof( ClearPwBlock ),
+ PasswordHash,
+ sizeof( PasswordHash ),
+ giving PwBlock )
+ }
+
+ Rc4Encrypt(
+ IN x-octet Clear,
+ IN integer ClearLength,
+ IN y-octet Key,
+ IN integer KeyLength,
+ OUT x-octet Cypher )
+ {
+ Use the RC4 encryption algorithm [5] to encrypt Clear of
+ length ClearLength octets into a Cypher of the same length
+ such that the Cypher can only be decrypted back to Clear
+ by providing a Key of length KeyLength octets.
+ }
+
+
+
+
+
+Cobb [Page 13]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ Old NT Hash Encrypted with New NT Hash
+
+ This field contains the old Windows NT password hash encrypted
+ with the new Windows NT password hash, as output by the
+ OldNtPasswordHashEncryptedWithNewNtPasswordHash routine below:
+
+ OldNtPasswordHashEncryptedWithNewNtPasswordHash(
+ IN 0-to-256-unicode-char NewPassword,
+ IN 0-to-256-unicode-char OldPassword,
+ OUT 16-octet EncryptedPasswordHash )
+ {
+ NtPasswordHash(
+ OldPassword,
+ giving OldPasswordHash )
+
+ NtPasswordHash(
+ NewPassword,
+ giving NewPasswordHash )
+
+ PasswordHashEncryptedWithBlock(
+ OldPasswordHash,
+ NewPasswordHash,
+ giving EncrytptedPasswordHash )
+ }
+
+
+ Password Encrypted with Old LM Hash
+
+ This field contains the PWBLOCK form of the new Windows NT
+ password encrypted with the old LAN Manager password hash, as
+ output by the NewPasswordEncryptedWithOldLmPasswordHash
+ routine below:
+
+ NewPasswordEncryptedWithOldLmPasswordHash(
+ IN 0-to-256-unicode-char NewPassword,
+ IN 0-to-256-unicode-char OldPassword,
+ OUT datatype-PWBLOCK EncryptedPwBlock )
+ {
+ LmPasswordHash(
+ OldPassword,
+ giving PasswordHash )
+
+ EncryptPwBlockWithPasswordHash(
+ NewPassword,
+ PasswordHash,
+ giving EncryptedPwBlock )
+ }
+
+
+
+
+
+
+
+
+Cobb [Page 14]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ Old LM Hash Encrypted with New NT Hash
+
+ This field contains the old LAN Manager password hash encrypted
+ with the new Windows NT password hash, as output by the
+ OldLmPasswordHashEncryptedWithNewNtPasswordHash routine below:
+
+ OldLmPasswordHashEncryptedWithNewNtPasswordHash(
+ IN 0-to-256-unicode-char NewPassword,
+ IN 0-to-256-unicode-char OldPassword,
+ OUT 16-octet EncryptedPasswordHash )
+ {
+ LmPasswordHash(
+ OldPassword,
+ giving OldPasswordHash )
+
+ NtPasswordHash(
+ NewPassword,
+ giving NewPasswordHash )
+
+ PasswordHashEncryptedWithBlock(
+ OldPasswordHash,
+ NewPasswordHash,
+ giving EncrytptedPasswordHash )
+ }
+
+
+ LAN Manager compatible challenge response
+ Windows NT compatible challenge response
+
+ The challenge response fields as described in the Response
+ packet description, but calculated on the new password and the
+ same challenge used in the last response.
+
+
+ Flags
+
+ Bit field of option flags:
+
+ 0 : The "use Windows NT compatible challenge response"
+ flag as described in the Response packet.
+
+ 1 : Set 1 indicates that the "Password Encrypted with
+ Old LM Hash" and "Old LM Hash Encrypted With New NT
+ Hash" fields are valid and should be used. Set 0
+ indicates these fields are not valid.
+
+ For the broadest possible interoperability,
+ implementations are encouraged to provide both the
+ Windows NT and LAN Manager fields when the password
+ is LAN Manager compatible. This is what Windows NT
+ does.
+
+ 2-15 : Reserved, always set 0.
+
+
+Cobb [Page 15]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+9. Negotiation Examples
+
+ Here are some examples of typical negotiations. The authenticatee
+ is on the left and the authenticator is on the right.
+
+ The packet sequence ID is incremented on each authentication retry
+ Response and on the change password response. All cases where the
+ packet sequence ID is updated are noted below.
+
+ Response retry is never allowed after either Change Password.
+ Change Password may occur after Response retry. The implied
+ challenge form is shown in the examples, though all cases of
+ "first challenge+23" should be replaced by the
+ "C=cccccccccccccccc" challenge if authenticator supplies it in the
+ Failure packet.
+
+
+ Successful authentication
+
+ <- Challenge
+ Response ->
+ <- Success
+
+
+ Failed authentication with no retry allowed
+
+ <- Challenge
+ Response ->
+ <- Failure (E=691 R=0)
+
+
+ Successful authentication after retry
+
+ <- Challenge
+ Response ->
+ <- Failure (E=691 R=1), disable short timeout
+ Response (++ID) to first challenge+23 ->
+ <- Success
+
+
+ Failed hack attack with 3 attempts allowed
+
+ <- Challenge
+ Response ->
+ <- Failure (E=691 R=1), disable short timeout
+ Response (++ID) to first challenge+23 ->
+ <- Failure (E=691 R=1), disable short timeout
+ Response (++ID) to first challenge+23+23 ->
+ <- Failure (E=691 R=0)
+
+
+
+
+
+
+Cobb [Page 16]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+ Successful authentication with password change
+
+ <- Challenge
+ Response ->
+ <- Failure (E=648 R=0), disable short timeout
+ ChangePassword (++ID) to first challenge ->
+ <- Success
+
+ Successful authentication with retry and password change
+
+ <- Challenge
+ Response ->
+ <- Failure (E=691 R=1), disable short timeout
+ Response (++ID) to first challenge+23 ->
+ <- Failure (E=648 R=0), disable short timeout
+ ChangePassword (++ID) to first challenge+23 ->
+ <- Success
+
+
+10. Hash Example
+
+ Intermediate values for password "MyPw".
+
+ 8-octet Challenge:
+ 10 2D B5 DF 08 5D 30 41
+
+ 0-to-14-oem-char LmPassword:
+ 4D 59 50 57
+
+ 16-octet LmPasswordHash:
+ 75 BA 30 19 8E 6D 19 75 AA D3 B4 35 B5 14 04 EE
+
+ 24-octet LmChallengeResponse:
+ 91 88 1D 01 52 AB 0C 33 C5 24 13 5E C2 4A 95 EE
+ 64 E2 3C DC 2D 33 34 7D
+
+ 0-to-256-unicode-char NtPassword:
+ 4D 00 79 00 50 00 77 00
+
+ 16-octet NtPasswordHash:
+ FC 15 6A F7 ED CD 6C 0E DD E3 33 7D 42 7F 4E AC
+
+ 24-octet NtChallengeResponse:
+ 4E 9D 3C 8F 9C FD 38 5D 5B F4 D3 24 67 91 95 6C
+ A4 C3 51 AB 40 9A 3D 61
+
+
+
+
+
+
+
+
+
+
+Cobb [Page 17]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+REFERENCES
+
+ [1] Simpson, W., "The Point-to-Point Protocol (PPP)", RFC 1331,
+ Daydreamer, May 1992
+
+ [2] LLoyd, B and Simpson, W., "PPP Authentication Protocols",
+ RFC 1334, L&A and Daydreamer respectively, Octobet 1992
+
+ [3] "Data Encryption Standard (DES)" is Federal Information
+ Processing Standard publication 46, National Institute of
+ Standard and Techology.
+
+ [4] Rivest, R., "MD4 Message Digest Algorithm", RFC 1320, MIT
+ Laboratory for Computer Science and RSA Data Security, Inc.,
+ April 1992.
+
+ [5] RC4 is an encryption standard available from RSA Data Security
+ Inc.
+
+ [6] The 8-octet StdText string used in the LAN Manager compatible
+ password hashing and the 8-octet KeyValue used in the Change
+ Password (version 1) packet are not available for public
+ distribution at this time. Contact the Microsoft Developer
+ Relations group (at time of writing dbeaver@microsoft.com) for
+ details on obtaining these values. On this particular point
+ the author can't help you.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Cobb [Page 18]
+
+Memo Microsoft PPP CHAP Extensions March 1997
+
+
+CHAIR'S ADDRESS
+
+ The working group can be contacted via the current chair:
+
+ Fred Baker
+ Email: fred@cisco.com
+
+
+
+AUTHOR'S ADDRESS
+
+ The author is a developer in Microsoft's Windows NT
+ Internetworking group, which monitors the ietf-ppp@merit.edu
+ discussions. Questions can also be directed as below, where email
+ is preferred.
+
+ Steve Cobb
+ Microsoft Corporation
+ One Microsoft Way
+ Redmond, WA 98052-6399
+
+ Email: stevec@microsoft.com
+
+ The author maintains an informal mailing list of persons
+ interested in MS-CHAP and other news regarding Windows NT support
+ for PPP authentication protocols. Send email if interested.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Cobb [Page 19]
diff --git a/rfc/pptp-draft.txt b/rfc/pptp-draft.txt
new file mode 100644
index 0000000..f58701b
--- /dev/null
+++ b/rfc/pptp-draft.txt
@@ -0,0 +1,3472 @@
+
+Internet Draft Kory Hamzeh
+ Ascend Communications
+ Gurdeep Singh Pall
+ Microsoft Corporation
+ William Verthein
+ U.S. Robotics/3Com
+ Jeff Taarud
+ Copper Mountain Networks
+ W. Andrew Little
+ ECI Telematics
+July 1997
+Expire in six months
+
+
+ Point-to-Point Tunneling Protocol--PPTP
+ draft-ietf-pppext-pptp-02.txt
+
+Status of this Memo
+
+ This document is an Internet-Draft. Internet-Drafts are working
+ documents of the Internet Engineering Task Force (IETF), its areas,
+ and its working groups. Note that other groups may also distribute
+ working documents as Internet-Drafts.
+
+ Internet-Drafts are draft documents valid for a maximum of six months
+ and may be updated, replaced, or obsoleted by other documents at any
+ time. It is inappropriate to use Internet-Drafts as reference
+ material or to cite them other than as "work in progress."
+
+ To learn the current status of any Internet-Draft, please check the
+ "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow
+ Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
+ munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
+ ftp.isi.edu (US West Coast).
+
+Abstract
+
+ This document specifies a protocol which allows the Point
+ to Point Protocol (PPP) to be tunneled through an IP
+ network. PPTP does not specify any changes to the PPP
+ protocol but rather describes a new vehicle for carrying
+ PPP. A client-server architecture is defined in order to
+ decouple functions which exist in current Network Access
+ Servers (NAS) and support Virtual Private Networks (VPNs).
+ The PPTP Network Server (PNS) is envisioned to run on a
+ general purpose operating system while the client, referred
+ to as a PPTP Access Concentrator (PAC) operates on a dial
+ access platform. PPTP specifies a call-control and
+
+
+
+Hamzeh, et al [Page 1]
+
+Internet Draft PPTP July 1997
+
+
+ management protocol which allows the server to control
+ access for dial-in circuit switched calls originating from
+ a PSTN or ISDN or to initiate outbound circuit-switched
+ connections. PPTP uses an enhanced GRE (Generic Routing
+ Encapsulation) mechanism to provide a flow- and
+ congestion-controlled encapsulated datagram service for
+ carrying PPP packets.
+
+1. Introduction
+
+ PPTP allows existing Network Access Server (NAS) functions to be
+ separated using a client-server architecture. Traditionally, the
+ following functions are implemented by a NAS:
+
+ 1) Physical native interfacing to PSTN or ISDN and control of
+ external modems or terminal adapters.
+
+ A NAS may interface directly to a telco analog or digital circuit
+ or attach via an external modem or terminal adapter. Control of a
+ circuit-switched connection is accomplished with either modem
+ control or DSS1 ISDN call control protocols.
+
+ The NAS, in conjunction with the modem or terminal adapters, may
+ perform rate adaption, analog to digital conversion, sync to async
+ conversion or a number of other alterations of data streams.
+
+ 2) Logical termination of a Point-to-Point-Protocol (PPP) Link
+ Control Protocol (LCP) session.
+
+ 3) Participation in PPP authentication protocols [3].
+
+ 4) Channel aggregation and bundle management for PPP Multilink
+ Protocol.
+
+ 5) Logical termination of various PPP network control protocols
+ (NCP).
+
+ 6) Multiprotocol routing and bridging between NAS interfaces.
+
+ PPTP divides these functions between the PAC and PNS. The PAC is
+ responsible for functions 1, 2, and possibly 3. The PNS may be
+ responsible for function 3 and is responsible for functions 4, 5, and
+ 6. The protocol used to carry PPP protocol data units (PDUs) between
+ the PAC and PNS, as well as call control and management is addressed
+ by PPTP.
+
+ The decoupling of NAS functions offers these benefits:
+
+
+
+
+Hamzeh, et al [Page 2]
+
+Internet Draft PPTP July 1997
+
+
+ Flexible IP address management. Dial-in users may maintain a
+ single IP address as they dial into different PACs as long as they
+ are served from a common PNS. If an enterprise network uses
+ unregistered addresses, a PNS associated with the enterprise
+ assigns addresses meaningful to the private network.
+
+ Support of non-IP protocols for dial networks behind IP networks.
+ This allows Appletalk and IPX, for example to be tunneled through
+ an IP-only provider. The PAC need not be capable of processing
+ these protocols.
+
+ A solution to the "multilink hunt-group splitting" problem.
+ Multilink PPP, typically used to aggregate ISDN B channels,
+ requires that all of the channels composing a multilink bundle be
+ grouped at a single NAS. Since a multilink PPP bundle can be
+ handled by a single PNS, the channels comprising the bundle may be
+ spread across multiple PACs.
+
+
+1.1 Protocol Goals and Assumptions
+
+ The PPTP protocol is implemented only by the PAC and PNS. No other
+ systems need to be aware of PPTP. Dial networks may be connected to a
+ PAC without being aware of PPTP. Standard PPP client software should
+ continue to operate on tunneled PPP links.
+
+ PPTP can also be used to tunnel a PPP session over an IP network. In
+ this configuration the PPTP tunnel and the PPP session runs between
+ the same two machines with the caller acting as a PNS.
+
+ It is envisioned that there will be a many-to-many relationship
+ between PACs and PNSs. A PAC may provide service to many PNSs. For
+ example, an Internet service provider may choose to support PPTP for
+ a number of private network clients and create VPNs for them. Each
+ private network may operate one or more PNSs. A single PNS may
+ associate with many PACs to concentrate traffic from a large number
+ of geographically diverse sites.
+
+ PPTP uses an extended version of GRE to carry user PPP packets. These
+ enhancements allow for low-level congestion and flow control to be
+ provided on the tunnels used to carry user data between PAC and PNS.
+ This mechanism allows for efficient use of the bandwidth available
+ for the tunnels and avoids unnecessary retransmisions and buffer
+ overruns. PPTP does not dictate the particular algorithms to be used
+ for this low level control but it does define the parameters that
+ must be communicated in order to allow such algorithms to work.
+ Suggested algorithms are included in Appendix A.
+
+
+1.2 Terminology
+
+
+Hamzeh, et al [Page 3]
+
+Internet Draft PPTP July 1997
+
+
+ Analog Channel
+
+ A circuit-switched communication path which is intended to
+ carry 3.1 Khz audio in each direction.
+
+ Digital Channel
+
+ A circuit-switched communication path which is intended to
+ carry digital information in each direction.
+
+ Call
+
+ A connection or attempted connection between two terminal
+ endpoints on a PSTN or ISDN--for example, a telephone call
+ between two modems.
+
+ Control Connection
+
+ A control connection is created for each PAC, PNS pair and
+ operates over TCP [4]. The control connection governs aspects
+ of the tunnel and of sessions assigned to the tunnel.
+
+ Dial User
+
+ An end-system or router attached to an on-demand PSTN or ISDN
+ which is either the initiator or recipient of a call.
+
+ Network Access Server (NAS)
+
+ A device providing temporary, on-demand network access to
+ users. This access is point-to-point using PSTN or ISDN lines.
+
+ PPTP Access Concentrator (PAC)
+
+ A device attached to one or more PSTN or ISDN lines capable of
+ PPP operation and of handling the PPTP protocol. The PAC need
+ only implement TCP/IP to pass traffic to one or more PNSs. It
+ may also tunnel non-IP protocols.
+
+ PPTP Network Server (PNS)
+
+ A PNS is envisioned to operate on general-purpose
+ computing/server platforms. The PNS handles the server side of
+ the PPTP protocol. Since PPTP relies completely on TCP/IP and
+ is independent of the interface hardware, the PNS may use any
+ combination of IP interface hardware including LAN and WAN
+ devices.
+
+
+
+
+Hamzeh, et al [Page 4]
+
+Internet Draft PPTP July 1997
+
+
+ Session
+
+ PPTP is connection-oriented. The PNS and PAC maintain state for
+ each user that is attached to a PAC. A session is created when
+ end-to-end PPP connection is attempted between a dial user and
+ the PNS. The datagrams related to a session are sent over the
+ tunnel between the PAC and PNS.
+
+ Tunnel
+
+ A tunnel is defined by a PNS-PAC pair. The tunnel protocol is
+ defined by a modified version of GRE [1,2]. The tunnel carries
+ PPP datagrams between the PAC and the PNS. Many sessions are
+ multiplexed on a single tunnel. A control connection operating
+ over TCP controls the establishment, release, and maintenance
+ of sessions and of the tunnel itself.
+
+1.3 Protocol Overview
+
+ There are two parallel components of PPTP: 1) a Control Connection
+ between each PAC-PNS pair operating over TCP and 2) an IP tunnel
+ operating between the same PAC-PNS pair which is used to transport
+ GRE encapsulated PPP packets for user sessions between the pair.
+
+1.3.1 Control Connection Overview
+
+ Before PPP tunneling can occur between a PAC and PNS, a control
+ connection must be established between them. The control connection
+ is a standard TCP session over which PPTP call control and management
+ information is passed. The control session is logically associated
+ with, but separate from, the sessions being tunneled through a PPTP
+ tunnel. For each PAC-PNS pair both a tunnel and a control connection
+ exist. The control connection is responsible for establishment,
+ management, and release of sessions carried through the tunnel. It is
+ the means by which a PNS is notified of an incoming call at an
+ associated PAC, as well as the means by which a PAC is instructed to
+ place an outgoing dial call.
+
+ A control connection can be established by either the PNS or the PAC.
+ Following the establishment of the required TCP connection, the PNS
+ and PAC establish the control connection using the Start-Control-
+ Connection-Request and -Reply messages. These messages are also used
+ to exchange information about basic operating capabilities of the PAC
+ and PNS. Once the control connection is established, the PAC or PNS
+ may initiate sessions by requesting outbound calls or responding to
+ inbound requests. The control connection may communicate changes in
+ operating characteristics of an individual user session with a Set-
+ Link-Info message. Individual sessions may be released by either the
+
+
+
+Hamzeh, et al [Page 5]
+
+Internet Draft PPTP July 1997
+
+
+ PAC or PNS, also through Control Connection messages.
+
+ The control connection itself is maintained by keep-alive echo
+ messages. This ensures that a connectivity failure between the PNS
+ and the PAC can be detected in a timely manner. Other failures can be
+ reported via the Wan-Error-Notify message, also on the control
+ connection.
+
+ It is intended that the control connection will also carry management
+ related messages in the future, such as a message allowing the PNS to
+ request the status of a given PAC; these message types have not yet
+ been defined.
+
+1.3.2 Tunnel Protocol Overview
+
+ PPTP requires the establishment of a tunnel for each communicating
+ PNS-PAC pair. This tunnel is used to carry all user session PPP
+ packets for sessions involving a given PNS-PAC pair. A key which is
+ present in the GRE header indicates which session a particular PPP
+ packet belongs to. In this manner, PPP packets are multiplexed and
+ demultiplexed over a single tunnel between a given PNS-PAC pair. The
+ value to use in the key field is established by the call
+ establishment procedure which takes place on the control connection.
+
+ The GRE header also contains acknowledgment and sequencing
+ information that is used to perform some level of congestion-control
+ and error detection over the tunnel. Again the control connection is
+ used to determine rate and buffering parameters that are used to
+ regulate the flow of PPP packets for a particular session over the
+ tunnel. PPTP does not specify the particular algorithms to use for
+ congestion-control and flow-control. Suggested algorithms for the
+ determination of adaptive time-outs to recover from dropped data or
+ acknowledgments on the tunnel are included in Appendix A of this
+ document.
+
+1.4 Specification Language
+
+ In this document, several words are used to signify the requirements
+ of the specification. These words are often capitalized.
+
+ MUST This word, or the adjective "required", means
+ that the definition is an absolute requirement
+ of the specification.
+
+ MUST NOT This phrase means that the definition is an
+ absolute prohibition of the specification.
+
+ SHOULD This word, or the adjective "recommended",
+
+
+
+Hamzeh, et al [Page 6]
+
+Internet Draft PPTP July 1997
+
+
+ means that, in some circumstances, valid
+ reasons may exist to ignore this item, but the
+ full implications must be understood and
+ carefully weighed before choosing a different
+ course. Unexpected results may result
+ otherwise.
+
+ MAY This word, or the adjective "optional", means
+ that this item is one of an allowed set of
+ alternatives. An implementation which does
+ not include this option MUST be prepared to
+ interoperate with another implementation which
+ does include the option.
+
+ silently discard The implementation discards the datagram
+ without further processing, and without
+ indicating an error to the sender. The
+ implementation SHOULD provide the capability
+ of logging the error, including the contents
+ of the discarded datagram, and SHOULD record
+ the event in a statistics counter.
+
+
+1.5 Message Format and Protocol Extensibility
+
+ PPTP defines a set of messages sent as TCP data on the control
+ connection between a PNS and a given PAC. The TCP session for the
+ control connection is established by initiating a TCP connection to
+ port 1723 [6]. The source port is assigned to any unused port number.
+
+ Each PPTP Control Connection message begins with an 8 octet fixed
+ header portion. This fixed header contains the following: the total
+ length of the message, the PPTP Message Type indicator, and a "Magic
+ Cookie".
+
+ Two Control Connection message types are indicated by the PPTP
+ Message Type field:
+
+ 1 - Control Message
+ 2 - Management Message
+
+ Management messages are currently not defined.
+
+ The Magic Cookie is always sent as the constant 0x1A2B3C4D. Its
+ basic purpose is to allow the receiver to ensure that it is properly
+ synchronized with the TCP data stream. It should not be used as a
+ means for resynchronizing the TCP data stream in the event that a
+ transmitter issues an improperly formatted message. Loss of
+
+
+
+Hamzeh, et al [Page 7]
+
+Internet Draft PPTP July 1997
+
+
+ synchronization must result in immediate closing of the control
+ connection's TCP session.
+
+ For clarity, all Control Connection message templates in the next
+ section include the entire PPTP Control Connection message header.
+ Numbers preceded by 0x are hexadecimal values.
+
+ The currently defined Control Messages, grouped by function, are:
+
+ Control Message Message Code
+
+ (Control Connection Management)
+
+ Start-Control-Connection-Request 1
+ Start-Control-Connection-Reply 2
+ Stop-Control-Connection-Request 3
+ Stop-Control-Connection-Reply 4
+ Echo-Request 5
+ Echo-Reply 6
+
+ (Call Management)
+
+ Outgoing-Call-Request 7
+ Outgoing-Call-Reply 8
+ Incoming-Call-Request 9
+ Incoming-Call-Reply 10
+ Incoming-Call-Connected 11
+ Call-Clear-Request 12
+ Call-Disconnect-Notify 13
+
+ (Error Reporting)
+
+ WAN-Error-Notify 14
+
+ (PPP Session Control)
+
+ Set-Link-Info 15
+
+
+ The Start-Control-Connection-Request and -Reply messages determine
+ which version of the Control Connection protocol will be used. The
+ version number field carried in these messages consists of a version
+ number in the high octet and a revision number in the low octet.
+ Version handling is described in Section 3. The current value of the
+ version number field is 0x0100 for version 1, revision 0.
+
+ The use of the GRE-like header for the encapsulation of PPP user
+ packets is specified in Section 4.
+
+
+
+Hamzeh, et al [Page 8]
+
+Internet Draft PPTP July 1997
+
+
+ The MTU for the user data packets encapsulated in GRE is 1532 octets,
+ not including the IP and GRE headers.
+
+2.0 Control Connection Protocol Specification
+
+
+ Control Connection messages are used to establish and clear user
+ sessions. The first set of Control Connection messages are used to
+ maintain the control connection itself. The control connection is
+ initiated by either the PNS or PAC after they establish the
+ underlying TCP connection. The procedure and configuration
+ information required to determine which TCP connections are
+ established is not covered by this protocol.
+
+ The following Control Connection messages are all sent as user data
+ on the established TCP connection between a given PNS-PAC pair. Note
+ that care has been taken to ensure that all word (2 octet) and
+ longword (4 octet) values begin on appropriate boundaries. All data
+ is sent in network order (high order octets first). Any "reserved"
+ fields MUST be sent as 0 values to allow for protocol extensibility.
+
+ The TCP header is followed by the PPTP fields shown in the following:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 9]
+
+Internet Draft PPTP July 1997
+
+
+2.1 Start-Control-Connection-Request
+
+ The Start-Control-Connection-Request is a PPTP control message used
+ to establish the control connection between a PNS and a PAC. Each
+ PNS-PAC pair requires a dedicated control connection to be
+ established. A control connection must be established before any
+ other PPTP messages can be issued. The establishment of the control
+ connection can be initiated by either the PNS or PAC. A procedure
+ which handles the occurrence of a collision between PNS and PAC
+ Start-Control-Connection-Requests is described in Section 3.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Protocol Version | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Framing Capabilities |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Bearer Capabilities |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Maximum Channels | Firmware Revision |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Host Name (64 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Vendor String (64 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D. This constant value is used
+ as a sanity check on received messages
+ (see Section 1.5).
+
+
+
+Hamzeh, et al [Page 10]
+
+Internet Draft PPTP July 1997
+
+
+ Control Message Type 1 for Start-Control-Connection-Request.
+
+ Reserved0 This field MUST be 0.
+
+ Protocol Version The version of the PPTP protocol that the
+ sender wishes to use.
+
+ Reserved1 This field MUST be 0.
+
+ Framing Capabilities A set of bits indicating the type of
+ framing that the sender of this message
+ can provide. The currently defined bit
+ settings are:
+
+ 1 - Asynchronous Framing supported
+
+ 2 - Synchronous Framing supported
+
+ Bearer Capabilities A set of bits indicating the bearer
+ capabilities that the sender of this
+ message can provide. The currently
+ defined bit settings are:
+
+ 1 - Analog access supported
+
+ 2 - Digital access supported
+
+ Maximum Channels The total number of individual PPP
+ sessions this PAC can support. In
+ Start-Control-Connection-Requests issued
+ by the PNS, this value SHOULD be set to
+ 0. It MUST be ignored by the PAC.
+
+ Firmware Revision This field contains the firmware revision
+ number of the issuing PAC, when issued by
+ the PAC, or the version of the PNS PPTP
+ driver if issued by the PNS.
+
+ Host Name A 64 octet field containing the DNS name
+ of the issuing PAC or PNS. If less than
+ 64 octets in length, the remainder of
+ this field SHOULD be filled with octets
+ of value 0.
+
+ Vendor Name A 64 octet field containing a vendor
+ specific string describing the type of
+ PAC being used, or the type of PNS
+ software being used if this request is
+
+
+
+Hamzeh, et al [Page 11]
+
+Internet Draft PPTP July 1997
+
+
+ issued by the PNS. If less than 64
+ octets in length, the remainder of this
+ field SHOULD be filled with octets of
+ value 0.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 12]
+
+Internet Draft PPTP July 1997
+
+
+2.2 Start-Control-Connection-Reply
+
+ The Start-Control-Connection-Reply is a PPTP control message sent in
+ reply to a received Start-Control-Connection-Request message. This
+ message contains a result code indicating the result of the control
+ connection establishment attempt.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Protocol Version | Result Code | Error Code |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Framing Capability |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Bearer Capability |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Maximum Channels | Firmware Revision |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Host Name (64 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Vendor String (64 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 2 for Start-Control-Connection-Reply.
+
+ Reserved0 This field MUST be 0.
+
+ Protocol Version The version of the PPTP protocol that the
+
+
+
+Hamzeh, et al [Page 13]
+
+Internet Draft PPTP July 1997
+
+
+ sender wishes to use.
+
+ Result Code Indicates the result of the command
+ channel establishment attempt. Current
+ valid Result Code values are:
+
+ 1 - Successful channel establishment
+
+ 2 - General error -- Error Code
+ indicates the problem
+
+ 3 - Command channel already exists;
+
+ 4 - Requester is not authorized to
+ establish a command channel
+
+ 5 - The protocol version of the
+ requester is not supported
+
+ Error Code This field is set to 0 unless a "General
+ Error" exists, in which case Result Code
+ is set to 2 and this field is set to the
+ value corresponding to the general error
+ condition as specified in Section 2.16.
+
+ Framing Capabilities A set of bits indicating the type of
+ framing that the sender of this message
+ can provide. The currently defined bit
+ settings are:
+
+ 1 - Asynchronous Framing supported
+
+ 2 - Synchronous Framing supported.
+
+ Bearer Capabilities A set of bits indicating the bearer
+ capabilities that the sender of this
+ message can provide. The currently
+ defined bit settings are:
+
+ 1 - Analog access supported
+
+ 2 - Digital access supported
+
+ Maximum Channels The total number of individual PPP
+ sessions this PAC can support. In a
+ Start-Control-Connection-Reply issued by
+ the PNS, this value SHOULD be set to 0
+ and it must be ignored by the PAC. The
+
+
+
+Hamzeh, et al [Page 14]
+
+Internet Draft PPTP July 1997
+
+
+ PNS MUST NOT use this value to try to
+ track the remaining number of PPP
+ sessions that the PAC will allow.
+
+ Firmware Revision This field contains the firmware revision
+ number of the issuing PAC, or the version
+ of the PNS PPTP driver if issued by the
+ PNS.
+
+ Host Name A 64 octet field containing the DNS name
+ of the issuing PAC or PNS. If less than
+ 64 octets in length, the remainder of
+ this field SHOULD be filled with octets
+ of value 0.
+
+ Vendor Name A 64 octet field containing a vendor
+ specific string describing the type of
+ PAC being used, or the type of PNS
+ software being used if this request is
+ issued by the PNS. If less than 64
+ octets in length, the remainder of this
+ field SHOULD be filled with octets of
+ value 0.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 15]
+
+Internet Draft PPTP July 1997
+
+
+2.3 Stop-Control-Connection-Request
+
+ The Stop-Control-Connection-Request is a PPTP control message sent by
+ one peer of a PAC-PNS control connection to inform the other peer
+ that the control connection should be closed. In addition to closing
+ the control connection, all active user calls are implicitly cleared.
+ The reason for issuing this request is indicated in the Reason field.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reason | Reserved1 | Reserved2 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 3 for Stop-Control-Connection-Request.
+
+ Reserved0 This field MUST be 0.
+
+ Reason Indicates the reason for the control
+ connection being closed. Current valid
+ Reason values are:
+
+ 1 (None) - General request to clear
+ control connection
+
+ 2 (Stop-Protocol) - Can't support
+ peer's version of the protocol
+
+ 3 (Stop-Local-Shutdown) - Requester is
+ being shut down
+
+ Reserved1, Reserved2 These fields MUST be 0.
+
+
+
+Hamzeh, et al [Page 16]
+
+Internet Draft PPTP July 1997
+
+
+2.4 Stop-Control-Connection-Reply
+
+ The Stop-Control-Connection-Reply is a PPTP control message sent by
+ one peer of a PAC-PNS control connection upon receipt of a Stop-
+ Control-Connection-Request from the other peer.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Result Code | Error Code | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 4 for Stop-Control-Connection-Reply.
+
+ Reserved0 This field MUST be 0.
+
+ Result Code Indicates the result of the attempt to
+ close the control connection. Current
+ valid Result Code values are:
+
+ 1 (OK) - Control connection closed
+
+ 2 (General Error) - Control connection
+ not closed for reason indicated in
+ Error Code
+
+ Error Code This field is set to 0 unless a "General
+ Error" exists, in which case Result Code
+ is set to 2 and this field is set to the
+ value corresponding to the general error
+ condition as specified in Section 2.16.
+
+ Reserved1 This field MUST be 0.
+
+
+
+Hamzeh, et al [Page 17]
+
+Internet Draft PPTP July 1997
+
+
+2.5 Echo-Request
+
+ The Echo-Request is a PPTP control message sent by either peer of a
+ PAC-PNS control connection. This control message is used as a "keep-
+ Alive" for the control connection. The receiving peer issues an
+ Echo-Reply to each Echo-Request received. As specified in Section 3,
+ if the sender does not receive an Echo Reply in response to an Echo-
+ Request, it will eventually clear the control connection.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Identifier |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 5 for Echo-Request.
+
+ Reserved0 This field MUST be 0.
+
+ Identifier A value set by the sender of the Echo-
+ Request that is used to match the reply
+ with the corresponding request.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 18]
+
+Internet Draft PPTP July 1997
+
+
+2.6 Echo-Reply
+
+ The Echo-Reply is a PPTP control message sent by either peer of a
+ PAC-PNS control connection in response to the receipt of an Echo-
+ Request.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Identifier |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Result Code | Error Code | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 6 for Echo-Reply.
+
+ Reserved0 This field MUST be 0.
+
+ Identifier The contents of the identify field from
+ the received Echo-Request is copied to
+ this field.
+
+ Result Code Indicates the result of the receipt of
+ the Echo-Request. Current valid Result
+ Code values are:
+
+ 1 (OK) - The Echo-Reply is valid
+
+ 2 (General Error) - Echo-Request not
+ accepted for the reason indicated in
+ Error Code
+
+ Error Code This field is set to 0 unless a "General
+
+
+
+Hamzeh, et al [Page 19]
+
+Internet Draft PPTP July 1997
+
+
+ Error" condition exists, in which case
+ Result Code is set to 2 and this field is
+ set to the value corresponding to the
+ general error condition as specified in
+ Section 2.16.
+
+ Reserved1 This field MUST be 0.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 20]
+
+Internet Draft PPTP July 1997
+
+
+2.7 Outgoing-Call-Request
+
+ The Outgoing-Call-Request is a PPTP control message sent by the PNS
+ to the PAC to indicate that an outbound call from the PAC is to be
+ established. This request provides the PAC with information required
+ to make the call. It also provides information to the PAC that is
+ used to regulate the transmission of data to the PNS for this session
+ once it is established.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Call ID | Call Serial Number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Minimum BPS |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Maximum BPS |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Bearer Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Framing Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Packet Recv. Window Size | Packet Processing Delay |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Phone Number Length | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Phone Number (64 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Subaddress (64 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+
+
+
+Hamzeh, et al [Page 21]
+
+Internet Draft PPTP July 1997
+
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 7 for Outgoing-Call-Request.
+
+ Reserved0 This field MUST be 0.
+
+ Call ID A unique identifier, unique to a
+ particular PAC-PNS pair assigned by the
+ PNS to this session. It is used to
+ multiplex and demultiplex data sent over
+ the tunnel between the PNS and PAC
+ involved in this session.
+
+ Call Serial Number An identifier assigned by the PNS to this
+ session for the purpose of identifying
+ this particular session in logged session
+ information. Unlike the Call ID, both
+ the PNS and PAC associate the same Call
+ Serial Number with a given session. The
+ combination of IP address and call serial
+ number SHOULD be unique.
+
+ Minimum BPS The lowest acceptable line speed (in
+ bits/second) for this session.
+
+ Maximum BPS The highest acceptable line speed (in
+ bits/second) for this session.
+
+ Bearer Type A value indicating the bearer capability
+ required for this outgoing call. The
+ currently defined values are:
+
+ 1 - Call to be placed on an analog
+ channel
+
+ 2 - Call to be placed on a digital
+ channel
+
+ 3 - Call can be placed on any type of
+ channel
+
+ Framing Type A value indicating the type of PPP
+ framing to be used for this outgoing
+ call.
+
+ 1 - Call to use Asynchronous framing
+
+ 2 - Call to use Synchronous framing
+
+
+
+Hamzeh, et al [Page 22]
+
+Internet Draft PPTP July 1997
+
+
+ 3 - Call can use either type of
+ framing
+
+ Packet Recv. Window Size The number of received data packets the
+ PNS will buffer for this session.
+
+ Packet Processing Delay A measure of the packet processing delay
+ that might be imposed on data sent to the
+ PNS from the PAC. This value is
+ specified in units of 1/10 seconds. For
+ the PNS this number should be very small.
+ See appendix A for a description of how
+ this value is determined and used.
+
+ Phone Number Length The actual number of valid digits in the
+ Phone Number field.
+
+ Reserved1 This field MUST be 0.
+
+ Phone Number The number to be dialed to establish the
+ outgoing session. For ISDN and analog
+ calls this field is an ASCII string. If
+ the Phone Number is less than 64 octets
+ in length, the remainder of this field is
+ filled with octets of value 0.
+
+ Subaddress A 64 octet field used to specify
+ additional dialing information. If the
+ subaddress is less than 64 octets long,
+ the remainder of this field is filled
+ with octets of value 0.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 23]
+
+Internet Draft PPTP July 1997
+
+
+2.8 Outgoing-Call-Reply
+
+ The Outgoing-Call-Reply is a PPTP control message sent by the PAC to
+ the PNS in response to a received Outgoing-Call-Request message. The
+ reply indicates the result of the outgoing call attempt. It also
+ provides information to the PNS about particular parameters used for
+ the call. It provides information to allow the PNS to regulate the
+ transmission of data to the PAC for this session.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Call ID | Peer's Call ID |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Result Code | Error Code | Cause Code |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Connect Speed |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Packet Recv. Window Size | Packet Processing Delay |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Physical Channel ID |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 8 for Outgoing-Call-Reply.
+
+ Reserved0 This field MUST be 0.
+
+ Call ID A unique identifier for the tunnel,
+ assigned by the PAC to this session. It
+ is used to multiplex and demultiplex data
+ sent over the tunnel between the PNS and
+ PAC involved in this session.
+
+
+
+
+Hamzeh, et al [Page 24]
+
+Internet Draft PPTP July 1997
+
+
+ Peer's Call ID This field is set to the value received
+ in the Call ID field of the corresponding
+ Outgoing-Call-Request message. It is
+ used by the PNS to match the Outgoing-
+ Call-Reply with the Outgoing-Call-Request
+ it issued. It also is used as the value
+ sent in the GRE header for mux/demuxing.
+
+ Result Code This value indicates the result of the
+ Outgoing-Call-Request attempt. Currently
+ valid values are:
+
+ 1 (Connected) - Call established with
+ no errors
+
+ 2 (General Error) - Outgoing Call not
+ established for the reason indicated
+ in Error Code
+
+ 3 (No Carrier) - Outgoing Call failed
+ due to no carrier detected
+
+ 4 (Busy) - Outgoing Call failed due to
+ detection of a busy signal
+
+ 5 (No Dial Tone) - Outgoing Call
+ failed due to lack of a dial tone
+
+ 6 (Time-out) - Outgoing Call was not
+ established within time allotted by
+ PAC
+
+ 7 (Do Not Accept) - Outgoing Call
+ administratively prohibited
+
+ Error Code This field is set to 0 unless a "General
+ Error" condition exists, in which case
+ Result Code is set to 2 and this field is
+ set to the value corresponding to the
+ general error condition as specified in
+ Section 2.16.
+
+ Cause Code This field gives additional failure
+ information. Its value can vary
+ depending upon the type of call
+ attempted. For ISDN call attempts it is
+ the Q.931 cause code.
+
+
+
+
+Hamzeh, et al [Page 25]
+
+Internet Draft PPTP July 1997
+
+
+ Connect Speed The actual connection speed used, in
+ bits/second.
+
+ Packet Recv. Window Size The number of received data packets the
+ PAC will buffer for this session.
+
+ Packet Processing Delay A measure of the packet processing delay
+ that might be imposed on data sent to the
+ PAC from the PNS. This value is
+ specified in units of 1/10 seconds. For
+ the PAC, this number is related to the
+ size of the buffer used to hold packets
+ to be sent to the client and to the speed
+ of the link to the client. This value
+ should be set to the maximum delay that
+ can normally occur between the time a
+ packet arrives at the PAC and is
+ delivered to the client. See Appendix A
+ for an example of how this value is
+ determined and used.
+
+ Physical Channel ID This field is set by the PAC in a
+ vendor-specific manner to the physical
+ channel number used to place this call.
+ It is used for logging purposes only.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 26]
+
+Internet Draft PPTP July 1997
+
+
+2.9 Incoming-Call-Request
+
+ The Incoming-Call-Request is a PPTP control message sent by the PAC
+ to the PNS to indicate that an inbound call is to be established from
+ the PAC. This request provides the PNS with parameter information
+ for the incoming call.
+
+ This message is the first in the "three-way handshake" used by PPTP
+ for establishing incoming calls. The PAC may defer answering the
+ call until it has received an Incoming-Call-Reply from the PNS
+ indicating that the call should be established. This mechanism allows
+ the PNS to obtain sufficient information about the call before it is
+ answered to determine whether the call should be answered or not.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Call ID | Call Serial Number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Call Bearer Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Physical Channel ID |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Dialed Number Length | Dialing Number Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Dialed Number (64 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Dialing Number (64 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Subaddress (64 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+
+
+Hamzeh, et al [Page 27]
+
+Internet Draft PPTP July 1997
+
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 9 for Incoming-Call-Request.
+
+ Reserved0 This field MUST be 0.
+
+ Call ID A unique identifier for this tunnel,
+ assigned by the PAC to this session. It
+ is used to multiplex and demultiplex data
+ sent over the tunnel between the PNS and
+ PAC involved in this session.
+
+ Call Serial Number An identifier assigned by the PAC to this
+ session for the purpose of identifying
+ this particular session in logged session
+ information. Unlike the Call ID, both
+ the PNS and PAC associate the same Call
+ Serial Number to a given session. The
+ combination of IP address and call serial
+ number should be unique.
+
+ Bearer Type A value indicating the bearer capability
+ used for this incoming call. Currently
+ defined values are:
+
+ 1 - Call is on an analog channel
+
+ 2 - Call is on a digital channel
+
+ Physical Channel ID This field is set by the PAC in a
+ vendor-specific manner to the number of
+ the physical channel this call arrived
+ on.
+
+ Dialed Number Length The actual number of valid digits in the
+ Dialed Number field.
+
+ Dialing Number Length The actual number of valid digits in the
+ Dialing Number field.
+
+ Dialed Number The number that was dialed by the caller.
+ For ISDN and analog calls this field is
+ an ASCII string. If the Dialed Number is
+ less than 64 octets in length, the
+ remainder of this field is filled with
+ octets of value 0.
+
+
+
+Hamzeh, et al [Page 28]
+
+Internet Draft PPTP July 1997
+
+
+ Dialing Number The number from which the call was
+ placed. For ISDN and analog calls this
+ field is an ASCII string. If the Dialing
+ Number is less than 64 octets in length,
+ the remainder of this field is filled
+ with octets of value 0.
+
+ Subaddress A 64 octet field used to specify
+ additional dialing information. If the
+ subaddress is less than 64 octets long,
+ the remainder of this field is filled
+ with octets of value 0.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 29]
+
+Internet Draft PPTP July 1997
+
+
+2.10 Incoming-Call-Reply
+
+ The Incoming-Call-Reply is a PPTP control message sent by the PNS to
+ the PAC in response to a received Incoming-Call-Request message. The
+ reply indicates the result of the incoming call attempt. It also
+ provides information to allow the PAC to regulate the transmission of
+ data to the PNS for this session.
+
+ This message is the second in the three-way handshake used by PPTP
+ for establishing incoming calls. It indicates to the PAC whether the
+ call should be answered or not.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Call ID | Peer's Call ID |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Result Code | Error Code | Packet Recv. Window Size |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Packet Transmit Delay | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 10 for Incoming-Call-Reply.
+
+ Reserved0 This field MUST be 0.
+
+ Call ID A unique identifier for this tunnel
+ assigned by the PAC to this session. It
+ is used to multiplex and demultiplex data
+ sent over the tunnel between the PNS and
+ PAC involved in this session.
+
+ Peer's Call ID This field is set to the value received
+
+
+
+Hamzeh, et al [Page 30]
+
+Internet Draft PPTP July 1997
+
+
+ in the Call ID field of the corresponding
+ Incoming-Call-Request message. It is used
+ by the PAC to match the Incoming-Call-
+ Reply with the Incoming-Call-Request it
+ issued. This value is included in the GRE
+ header of transmitted data packets for
+ this session.
+
+ Result Code This value indicates the result of the
+ Incoming-Call-Request attempt. Current
+ valid Result Code values are:
+
+ 1 (Connect) - The PAC should answer
+ the incoming call
+
+ 2 (General Error) - The Incoming Call
+ should not be established due to the
+ reason indicated in Error Code
+
+ 3 (Do Not Accept) - The PAC should not
+ accept the incoming call. It should
+ hang up or issue a busy indication
+
+ Error Code This field is set to 0 unless a "General
+ Error" condition exists, in which case
+ Result Code is set to 2 and this field is
+ set to the value corresponding to the
+ general error condition as specified in
+ Section 2.16.
+
+ Packet Recv. Window Size The number of received data packets the
+ PAC will buffer for this session.
+
+ Packet Transmit Delay A measure of the packet processing delay
+ that might be imposed on data sent to the
+ PAC from the PNS. This value is
+ specified in units of 1/10 seconds. See
+ Appendix A for a description of how this
+ value is determined and used.
+
+ Reserved1 This field MUST be 0.
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 31]
+
+Internet Draft PPTP July 1997
+
+
+2.11 Incoming-Call-Connected
+
+ The Incoming-Call-Connected message is a PPTP control message sent by
+ the PAC to the PNS in response to a received Incoming-Call-Reply. It
+ provides information to the PNS about particular parameters used for
+ the call. It also provides information to allow the PNS to regulate
+ the transmission of data to the PAC for this session.
+
+ This message is the third in the three-way handshake used by PPTP for
+ establishing incoming calls. It provides a mechanism for providing
+ the PNS with additional information about the call that cannot, in
+ general, be obtained at the time the Incoming-Call-Request is issued
+ by the PAC.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Peer's Call ID | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Connect Speed |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Packet Recv. Window Size | Packet Transmit Delay |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Framing Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 11 for Incoming-Call-Connected.
+
+ Reserved0 This field MUST be 0.
+
+ Peer's Call ID This field is set to the value received
+ in the Call ID field of the corresponding
+ Incoming-Call-Reply message. It is used
+
+
+
+Hamzeh, et al [Page 32]
+
+Internet Draft PPTP July 1997
+
+
+ by the PNS to match the Incoming-Call-
+ Connected with the Incoming-Call-Reply it
+ issued.
+
+ Connect Speed The actual connection speed used, in
+ bits/second.
+
+ Packet Recv. Window Size The number of received data packets the
+ PAC will buffer for this session.
+
+ Packet Transmit Delay A measure of the packet processing delay
+ that might be imposed on data sent to the
+ PAC from the PNS. This value is
+ specified in units of 1/10 seconds. See
+ Appendix A for a description of how this
+ value is determined and used.
+
+ Framing Type A value indicating the type of PPP
+ framing being used by this incoming call.
+
+ 1 - Call uses asynchronous framing
+
+ 2 - Call uses synchronous framing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 33]
+
+Internet Draft PPTP July 1997
+
+
+2.12 Call-Clear-Request
+
+ The Call-Clear-Request is a PPTP control message sent by the PNS to
+ the PAC indicating that a particular call is to be disconnected. The
+ call being cleared can be either an incoming or outgoing call, in any
+ state. The PAC responds to this message with a Call-Disconnect-
+ Notify message.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Call ID | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 12 for Call-Clear-Request.
+
+ Reserved0 This field MUST be 0.
+
+ Call ID The Call ID assigned by the PNS to this
+ call. This value is used instead of the
+ Peer's Call ID because the latter may not
+ be known to the PNS if the call must be
+ aborted during call establishment.
+
+ Reserved1 This field MUST be 0.
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 34]
+
+Internet Draft PPTP July 1997
+
+
+2.13 Call-Disconnect-Notify
+
+ The Call-Disconnect-Notify message is a PPTP control message sent by
+ the PAC to the PNS. It is issued whenever a call is disconnected,
+ due to the receipt by the PAC of a Call-Clear-Request or for any
+ other reason. Its purpose is to inform the PNS of both the
+ disconnection and the reason for it.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message Type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Call ID | Result Code | Error Code |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Cause Code | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ + Call Statistics (128 octets) +
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 13 for Call-Disconnect-Notify.
+
+ Reserved0 This field MUST be 0.
+
+ Call ID The value of the Call ID assigned by the
+ PAC to this call. This value is used
+ instead of the Peer's Call ID because the
+ latter may not be known to the PNS if the
+ call must be aborted during call
+ establishment.
+
+ Result Code This value indicates the reason for the
+ disconnect. Current valid Result Code
+
+
+
+Hamzeh, et al [Page 35]
+
+Internet Draft PPTP July 1997
+
+
+ values are:
+
+ 1 (Lost Carrier) - Call disconnected
+ due to loss of carrier
+
+ 2 (General Error) - Call disconnected
+ for the reason indicated in Error
+ Code
+
+ 3 (Admin Shutdown) - Call disconnected
+ for administrative reasons
+
+ 4 (Request) - Call disconnected due to
+ received Call-Clear-Request
+
+ Error Code This field is set to 0 unless a "General
+ Error" condition exists, in which case
+ the Result Code is set to 2 and this
+ field is set to the value corresponding
+ to the general error condition as
+ specified in Section 2.16.
+
+ Cause Code This field gives additional disconnect
+ information. Its value varies depending
+ on the type of call being disconnected.
+ For ISDN calls it is the Q.931 cause
+ code.
+
+ Call Statistics This field is an ASCII string containing
+ vendor-specific call statistics that can
+ be logged for diagnostic purposes. If
+ the length of the string is less than
+ 128, the remainder of the field is filled
+ with octets of value 0.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 36]
+
+Internet Draft PPTP July 1997
+
+
+2.14 WAN-Error-Notify
+
+ The WAN-Error-Notify message is a PPTP control message sent by the
+ PAC to the PNS to indicate WAN error conditions (conditions that
+ occur on the interface supporting PPP). The counters in this message
+ are cumulative. This message should only be sent when an error
+ occurs, and not more than once every 60 seconds. The counters are
+ reset when a new call is established.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Peer's Call ID | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | CRC Errors |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Framing Errors |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Hardware Overruns |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Buffer Overruns |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Time-out Errors |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Alignment Errors |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 14 for WAN-Error-Notify.
+
+ Reserved0 This field MUST be 0.
+
+ Peer's Call ID Th Call ID assigned by the PNS to this
+ call.
+
+
+
+Hamzeh, et al [Page 37]
+
+Internet Draft PPTP July 1997
+
+
+ CRC Errors Number of PPP frames received with CRC
+ errors since session was established.
+
+ Framing Errors Number of improperly framed PPP packets
+ received.
+
+ Hardware Overruns Number of receive buffer over-runs since
+ session was established.
+
+ Buffer Overruns Number of buffer over-runs detected since
+ session was established.
+
+ Time-out Errors Number of time-outs since call was
+ established.
+
+ Alignment Errors Number of alignment errors since call was
+ established.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 38]
+
+Internet Draft PPTP July 1997
+
+
+2.15 Set-Link-Info
+
+ The Set-Link-Info message is a PPTP control message sent by the PNS
+ to the PAC to set PPP-negotiated options. Because these options can
+ change at any time during the life of the call, the PAC must be able
+ to update its internal call information dynamically and perform PPP
+ negotiation on an active PPP session.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Length | PPTP Message Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic Cookie |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Control Message type | Reserved0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Peer's Call ID | Reserved1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Send ACCM |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Receive ACCM |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Length Total length in octets of this PPTP
+ message, including the entire PPTP
+ header.
+
+ PPTP Message Type 1 for Control Message.
+
+ Magic Cookie 0x1A2B3C4D.
+
+ Control Message Type 15 for Set-Link-Info.
+
+ Reserved0 This field MUST be 0.
+
+ Peer's Call ID The value of the Call ID assigned by the
+ PAC to this call.
+
+ Reserved1 This field MUST be 0.
+
+ Send ACCM The send ACCM value the client should use
+ to process outgoing PPP packets. The
+ default value used by the client until
+ this message is received is 0XFFFFFFFF.
+ See [7].
+
+
+
+
+Hamzeh, et al [Page 39]
+
+Internet Draft PPTP July 1997
+
+
+ Receive ACCM The receive ACCM value the client should
+ use to process incoming PPP packets. The
+ default value used by the client until
+ this message is received is 0XFFFFFFFF.
+ See [7].
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 40]
+
+Internet Draft PPTP July 1997
+
+
+2.16 General Error Codes
+
+ General error codes pertain to types of errors which are not specific
+ to any particular PPTP request, but rather to protocol or message
+ format errors. If a PPTP reply indicates in its Result Code that a
+ general error occurred, the General Error value should be examined to
+ determined what the error was. The currently defined General Error
+ codes and their meanings are:
+
+ 0 (None) - No general error
+
+ 1 (Not-Connected) - No control connection exists yet for this
+ PAC-PNS pair
+
+ 2 (Bad-Format) - Length is wrong or Magic Cookie value is
+ incorrect
+
+ 3 (Bad-Value) - One of the field values was out of range or
+ reserved field was non-zero
+
+ 4 (No-Resource) - Insufficient resources to handle this command
+ now
+
+ 5 (Bad-Call ID) - The Call ID is invalid in this context
+
+ 6 (PAC-Error) - A generic vendor-specific error occurred in
+ the PAC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 41]
+
+Internet Draft PPTP July 1997
+
+
+3.0 Control Connection Protocol Operation
+
+ This section describes the operation of various PPTP control
+ connection functions and the Control Connection messages which are
+ used to support them. The protocol operation of the control
+ connection is simplified because TCP is used to provide a reliable
+ transport mechanism.
+ Ordering and retransmission of messages is not a concern at this
+ level. The TCP connection itself, however, can close at any time and
+ an appropriate error recovery mechanism must be provided to handle
+ this case.
+
+ Some error recovery procedures are common to all states of the
+ control connection. If an expected reply does not arrive within 60
+ seconds, the control connection is closed, unless otherwise
+ specified. Appropriate logging should be implemented for easy
+ determination of the problems and the reasons for closing the control
+ connection.
+
+ Receipt of an invalid or malformed Control Connection message should
+ be logged appropriately, and the control connection should be closed
+ and restarted to ensure recovery into a known state.
+
+
+3.1 Control Connection States
+
+ The control connection relies on a standard TCP connection for its
+ service. The PPTP control connection protocol is not distinguishable
+ between the PNS and PAC, but is distinguishable between the
+ originator and receiver. The originating peer is the one which first
+ attempts the TCP open. Since either PAC or PNS may originate a
+ connection, it is possible for a TCP collision to occur. See Section
+ 3.1.3 for a description of this situation.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 42]
+
+Internet Draft PPTP July 1997
+
+
+3.1.1 Control Connection Originator (may be PAC or PNS)
+
+ TCP Open Indication
+ /Send Start Control
+ Connection Request +-----------------+
+ +------------------------------------>| wait_ctl_reply |
+ | +-----------------+
+ | Collision/See (3.1.3) Close TCP V V V Receive Start Ctl
+ | +-------------------------------+ | | Connection Reply
+ | | | | Version OK
+ ^ V | V
+ +-----------------+ Receive Start Ctl | +-----------------+
+ | idle | Connection Reply | | established |
+ +-----------------+ Version Not OK | +-----------------+
+ ^ | V Local Terminate
+ | Receive Stop Control | | /Send Stop
+ | Connection Request | | Control Request
+ | /Send Stop Control Reply V V
+ | Close TCP +-----------------+
+ +-------------------------------------| wait_stop_reply |
+ +-----------------+
+
+
+
+ idle
+
+ The control connection originator attempts to open a TCP connection
+ to the peer during idle state. When the TCP connection is open, the
+ originator transmits a send Start-Control-Connection-Request and then
+ enters the wait_ctl_reply state.
+
+ wait_ctl_reply
+
+ The originator checks to see if another TCP connection has been
+ requested from the same peer, and if so, handles the collision
+ situation described in Section 3.1.3.
+
+ When a Start-Control-Connection-Reply is received, it is examined for
+ a compatible version. If the version of the reply is lower than the
+ version sent in the request, the older (lower) version should be used
+ provided it is supported. If the version in the reply is earlier and
+ supported, the originator moves to the established state. If the
+ version is earlier and not supported, a Stop-Control-Connection-
+ Request SHOULD be sent to the peer and the originator moves into the
+ wait_stop_reply state.
+
+
+
+
+
+
+Hamzeh, et al [Page 43]
+
+Internet Draft PPTP July 1997
+
+
+ established
+
+ An established connection may be terminated by either a local
+ condition or the receipt of a Stop-Control-Connection-Request. In the
+ event of a local termination, the originator MUST send a Stop-
+ Control-Connection-Request and enter the wait_stop_reply state.
+
+ If the originator receives a Stop-Control-Connection-Request it
+ SHOULD send a Stop-Control-Connection-Reply and close the TCP
+ connection making sure that the final TCP information has been
+ "pushed" properly.
+
+ wait_stop_reply
+
+ If a Stop-Control-Connection-Reply is received, the TCP connection
+ SHOULD be closed and the control connection becomes idle.
+
+3.1.2 Control connection Receiver (may be PAC or PNS)
+
+
+ Receive Start Control Connection Request
+ Version Not OK/Send Start Control Connection
+ Reply with Error
+ +--------+
+ | | Receive Control Connection Request Version OK
+ | | /Send Start Control Connection Reply
+ | | +----------------------------------------+
+ ^ V ^ V
+ +-----------------+ Receive Start Ctl +-----------------+
+ | Idle | Connection Request | Established |
+ +-----------------+ /Send Stop Reply +-----------------+
+ ^ ^ Close TCP V V Local Terminate
+ | +-------------------------------------+ | /Send Stop
+ | | Control Conn.
+ | V Request
+ | +-----------------+
+ +-------------------------------------| Wait-Stop-Reply |
+ Receive Stop Control +-----------------+
+ Connection Reply
+ /Close TCP
+
+ idle
+
+ The control connection receiver waits for a TCP open attempt on port
+ 1723. When notified of an open TCP connection, it should prepare to
+ receive PPTP messages. When a Start-Control-Connection-Request is
+ received its version field should be examined. If the version is
+ earlier than the receiver's version and the earlier version can be
+
+
+
+Hamzeh, et al [Page 44]
+
+Internet Draft PPTP July 1997
+
+
+ supported by the receiver, the receiver SHOULD send a Start-Control-
+ Connection-Reply. If the version is earlier than the receiver's
+ version and the version cannot be supported, the receiver SHOULD send
+ a Start- Connection-Reply message, close the TCP connection and
+ remain in the idle state. If the receiver's version is the same as
+ earlier than the peer's, the receiver SHOULD send a Start-Control-
+ Connection-Reply with the receiver's version and enter the
+ established state.
+
+ established
+
+ An established connection may be terminated by either a local
+ condition or the reception of a Stop-Control-Connection-Request. In
+ the event of a local termination, the originator MUST send a Stop-
+ Control-Connection-Request and enter the wait_stop_reply state.
+
+ If the originator receives a Stop-Control-Connection-Request it
+ SHOULD send a Stop-Control-Connection-Reply and close the TCP
+ connection, making sure that the final TCP information has been
+ "pushed" properly.
+
+ wait_stop_reply
+
+ If a Stop-Control-Connection-Reply is received, the TCP connection
+ SHOULD be closed and the control connection becomes idle.
+
+3.1.3 Start Control Connection Initiation Request Collision
+
+ A PAC and PNS must have only one control connection between them. It
+ is possible, however, for a PNS and a PAC to simultaneously attempt
+ to establish a control connection to each other. When a Start-
+ Control-Connection-Request is received on one TCP connection and
+ another Start-Control-Connection-Request has already been sent on
+ another TCP connection to the same peer, a collision has occurred.
+
+ The "winner" of the initiation race is the peer with the higher IP
+ address (compared as 32 bit unsigned values, network number more
+ significant). For example, if the peers 192.33.45.17 and 192.33.45.89
+ collide, the latter will be declared the winner.
+
+ The loser will immediately close the TCP connection it initiated,
+ without sending any further PPTP control messages on it and will
+ respond to the winner's request with a Start-Control-Connection-Reply
+ message. The winner will wait for the Start-Control-Connection-Reply
+ on the connection it initiated and also wait for a TCP termination
+ indication on the connection the loser opened. The winner MUST NOT
+ send any messages on the connection the loser initiated.
+
+
+
+
+Hamzeh, et al [Page 45]
+
+Internet Draft PPTP July 1997
+
+
+3.1.3 Keep Alives and Timers
+
+ A control connection SHOULD be closed by closing the underlying TCP
+ connection under the following circumstances:
+
+ 1. If a control connection is not in the established state (i.e.,
+ Start-Control-Connection-Request and Start-Control-Connection-
+ Reply have not been exchanged), a control connection SHOULD be
+ closed after 60 seconds by a peer waiting for a Start-Control-
+ Connection-Request or Start-Control-Connection-Reply message.
+
+ 2. If a peer's control connection is in the established state and has
+ not received a control message for 60 seconds, it SHOULD send a
+ Echo-Request message. If an Echo-Reply is not received 60 seconds
+ after the Echo-Request message transmission, the control
+ connection SHOULD be closed.
+
+3.2 Call States
+
+3.2.1 Timing considerations
+
+ Because of the real-time nature of telephone signaling, both the PNS
+ and PAC should be implemented with multi-threaded architectures such
+ that messages related to multiple calls are not serialized and
+ blocked. The transit delay between the PAC and PNS should not exceed
+ one second. The call and connection state figures do not specify
+ exceptions caused by timers. The implicit assumption is that since
+ the TCP-based control connection is being verified with keep-alives,
+ there is less need to maintain strict timers for call control
+ messages.
+
+ Establishing outbound international calls, including the modem
+ training and negotiation sequences, may take in excess of 1 minute so
+ the use of short timers is discouraged.
+
+ If a state transition does not occur within 1 minute (except for
+ connections in the idle or established states), the integrity of the
+ protocol processing between the peers is suspect and the ENTIRE
+ CONTROL CONNECTION should be closed and restarted. All Call IDs are
+ logically released whenever a control connection is started. This
+ presumably also helps in preventing toll calls from being "lost" and
+ never cleared.
+
+3.2.2 Call ID values
+
+ Each peer assigns a Call ID value to each user session it requests or
+ accepts. This Call ID value MUST be unique for the tunnel between the
+ PNS and PAC to which it belongs. Tunnels to other peers can use the
+
+
+
+Hamzeh, et al [Page 46]
+
+Internet Draft PPTP July 1997
+
+
+ same Call ID number so the receiver of a packet on a tunnel needs to
+ associate a user session with a particular tunnel and Call ID. It is
+ suggested that the number of potential Call ID values for each tunnel
+ be at least twice as large as the maximum number of calls expected on
+ a given tunnel.
+
+ A session is defined by the triple (PAC, PNS, Call ID).
+
+3.2.3 Incoming calls
+
+ An Incoming-Call-Request message is generated by the PAC when an
+ associated telephone line rings. The PAC selects a Call ID and serial
+ number and indicates the call bearer type. Modems should always
+ indicate analog call type. ISDN calls should indicate digital when
+ unrestricted digital service or rate adaption is used and analog if
+ digital modems are involved. Dialing number, dialed number, and
+ subaddress may be included in the message if they are available from
+ the telephone network.
+
+ Once the PAC sends the Incoming-Call-Request, it waits for a response
+ from the PNS but does not answer the call from the telephone network.
+ The PNS may choose not to accept the call if:
+
+ - No resources are available to handle more sessions
+
+ - The dialed, dialing, or subaddress fields are not indicative of
+ an authorized user
+
+ - The bearer service is not authorized or supported
+
+ If the PNS chooses to accept the call, it responds with an Outgoing-
+ Call-Reply which also indicates window sizes (see Appendix B). When
+ the PAC receives the Outgoing-Call-Reply, it attempts to connect the
+ call, assuming the calling party has not hung up. A final call
+ connected message from the PAC to the PNS indicates that the call
+ states for both the PAC and the PNS should enter the established
+ state.
+
+ When the dialed-in client hangs up, the call is cleared normally and
+ the PAC sends a Call-Disconnect-Notify message. If the PNS wishes to
+ clear a call, it sends a Call-Clear-Request message and then waits
+ for a Call-Disconnect-Notify.
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 47]
+
+Internet Draft PPTP July 1997
+
+
+3.2.3.1 PAC Incoming Call States
+
+
+ Ring/Send Incoming Call Request +-----------------+
+ +----------------------------------------->| wait_reply |
+ | +-----------------+
+ | Receive Incoming Call Reply V V V
+ | Not Accepting | | | Receive Incoming
+ | +--------------------------------+ | | Call Reply Accepting
+ | | +------------------------------+ | /Answer call; Send
+ | | | Abort/Send Call | Call Connected
+ ^ V V Disconnect Notify V
+ +-----------------+ +-----------------+
+ | idle |<-----------------------------| established |
+ +-----------------+ Receive Clear Call Request +-----------------+
+ or telco call dropped
+ or local disconnect
+ /Send Call Disconnect Notify
+
+
+
+ The states associated with the PAC for incoming calls are:
+
+ idle
+
+ The PAC detects an incoming call on one of its telco interfaces.
+ Typically this means an analog line is ringing or an ISDN TE has
+ detected an incoming Q.931 SETUP message. The PAC sends an Incoming-
+ Call-Request message and moves to the wait_reply state.
+
+ wait_reply
+
+ The PAC receives an Incoming-Call-Reply message indicating non-
+ willingness to accept the call (general error or don't accept) and
+ moves back into the idle state. If the reply message indicates that
+ the call is accepted, the PAC sends an Incoming-Call-Connected
+ message and enters the established state.
+
+ established
+
+ Data is exchanged over the tunnel. The call may be cleared following:
+
+ An event on the telco connection. The PAC sends a Call-
+ Disconnect-Notify message
+
+ Receipt of a Call-Clear-Request. The PAC sends a Call-Disconnect-
+ Notify message
+
+
+
+
+Hamzeh, et al [Page 48]
+
+Internet Draft PPTP July 1997
+
+
+ A local reason. The PAC sends a Call-Disconnect-Notify message.
+
+3.2.3.2 PNS Incoming Call States
+
+
+
+ Receive Incoming Call Request
+ /Send Incoming Call Reply +-----------------+
+ Not Accepting if Error | Wait-Connect |
+ +-----+ +-----------------+
+ | | Receive Incoming Call Req. ^ V V
+ | | /Send Incoming Call Reply OK | | | Receive Incoming
+ | | +--------------------------------+ | | Call Connect
+ ^ V ^ V------------------------------+ V
+ +-----------------+ Receive Call Disconnect +-----------------+
+ | Idle | Notify +- | Established |
+ +-----------------+ | +-----------------+
+ ^ ^ | V Local Terminate
+ | +----------------------------+ | /Send Call Clear
+ | Receive Call Disconnect | Request
+ | Notify V
+ | +-----------------+
+ +--------------------------------------| Wait-Disconnect |
+ Receive Call Disconnect +-----------------+
+ Notify
+
+
+
+ The states associated with the PNS for incoming calls are:
+
+ idle
+
+ An Incoming-Call-Request message is received. If the request is not
+ acceptable, an Incoming-Call-Reply is sent back to the PAC and the
+ PNS remains in the idle state. If the Incoming-Call-Request message
+ is acceptable, an Incoming-Call-Reply is sent indicating accept in
+ the result code. The session moves to the wait_connect state.
+
+ wait_connect
+
+ If the session is connected on the PAC, the PAC sends an incoming
+ call connect message to the PNS which then moves into established
+ state. The PAC may send a Call-Disconnect-Notify to indicate that the
+ incoming caller could not be connected. This could happen, for
+ example, if a telephone user accidently places a standard voice call
+ to a PAC resulting in a handshake failure on the called modem.
+
+
+
+
+
+Hamzeh, et al [Page 49]
+
+Internet Draft PPTP July 1997
+
+
+ established
+
+ The session is terminated either by receipt of a Call-Disconnect-
+ Notify message from the PAC or by sending a Call-Clear-Request. Once
+ a Call-Clear-Request has been sent, the session enters the
+ wait_disconnect state.
+
+ wait_disconnect
+
+ Once a Call-Disconnect-Notify is received the session moves back to
+ the idle state.
+
+3.2.4 Outgoing calls
+
+ Outgoing messages are initiated by a PNS and instruct a PAC to place
+ a call on a telco interface. There are only two messages for outgoing
+ calls: Outgoing-Call-Request and Outgoing-Call-Reply. The PNS sends
+ an Outgoing-Call-Request specifying the dialed party phone number and
+ subaddress as well as speed and window parameters. The PAC MUST
+ respond to the Outgoing-Call-Request message with an Outgoing-Call-
+ Reply message once the PAC determines that:
+
+ The call has been successfully connected
+
+ A call failure has occurred for reasons such as: no interfaces are
+ available for dial-out, the called party is busy or does not
+ answer, or no dial tone is detected on the interface chosen for
+ dialing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 50]
+
+Internet Draft PPTP July 1997
+
+
+3.2.4.1 PAC Outgoing Call States
+
+
+
+ Receive Outgoing Call Request in Error
+ /Send Outgoing Call Reply with Error
+ |--------+
+ | | Receive Outgoing Call Request No Error
+ | | /Off Hook; Dial
+ | | +-----------------------------------------
+ ^ V ^ V
+ +-----------------+ Incomplete Call +-----------------+
+ | idle | /Send Outgoing Call | wait_cs_ans |
+ +-----------------+ Reply with Error +-----------------+
+ ^ ^ or Recv. Call Clear Req. V V Telco Answer
+ | | /Send Disconnect Notify| | /Send Outgoing
+ | +-------------------------------------+ | Call Reply.
+ | V
+ | +-----------------+
+ +-------------------------------------| established |
+ Receive Call Clear Request +-----------------+
+ or local terminate
+ or telco disconnect
+ /Hangup call and send
+ Call Disconnect Notify
+
+
+
+ The states associated with the PAC for outgoing calls are:
+
+ idle
+
+ Received Outgoing-Call-Request. If this is received in error, respond
+ with an Outgoing-Call-Reply with error condition set. Otherwise,
+ allocate physical channel to dial on. Place the outbound call, wait
+ for a connection, and move to the wait_cs_ans state.
+
+ wait_cs_ans
+
+ If the call is incomplete, send an Outgoing-Call-Reply with a non-
+ zero Error Code. If a timer expires on an outbound call, send back an
+ Outgoing-Call-Reply with a non-zero Error Code. If a circuit switched
+ connection is established, send an Outgoing-Call-Reply indicating
+ success.
+
+ established
+
+ If a Call-Clear-Request is received, the telco call SHOULD be
+
+
+
+Hamzeh, et al [Page 51]
+
+Internet Draft PPTP July 1997
+
+
+ released via appropriate mechanisms and a Call-Disconnect-Notify
+ message SHOULD BE sent to the PNS. If the call is disconnected by the
+ client or by the telco interface, a Call-Disconnect-Notify message
+ SHOULD be sent to the PNS.
+
+3.2.4.2 PNS Outgoing Call States
+
+
+ Open Indication Abort/Send
+ /Send Outgoing Call Call Clear
+ Request +-----------------+ Request
+ +-------------------------------->| Wait-Reply |------------+
+ | +-----------------+ |
+ | Receive Outgoing Call Reply V V Receive Outgoing |
+ | with Error | | Call Reply |
+ | +-------------------------------+ | No Error |
+ ^ V V |
+ +-----------------+ +-----------------+ |
+ | Idle |<-----------------------------| Established | |
+ +-----------------+ Receive Call Disconnect +-----------------+ |
+ ^ Notify V Local Terminate |
+ | | /Send Call Clear |
+ | | Request |
+ | Receive Call Disconnect V |
+ | Notify +-----------------+ |
+ +---------------------------------| Wait-Disconnect |<-----------+
+ +-----------------+
+
+
+ The states associated with the PNS for outgoing calls are:
+
+ idle
+
+ An Outgoing-Call-Request message is sent to the PAC and the session
+ moves into the wait_reply state.
+
+ wait_reply
+
+ An Outgoing-Call-Reply is received which indicates an error. The
+ session returns to idle state. No telco call is active. If the
+ Outgoing-Call-Reply does not indicate an error, the telco call is
+ connected and the session moves to the established state.
+
+ established
+
+ If a Call-Disconnect-Notify is received, the telco call has been
+ terminated for the reason indicated in the Result and Cause Codes.
+ The session moves back to the idle state. If the PNS chooses to
+
+
+
+Hamzeh, et al [Page 52]
+
+Internet Draft PPTP July 1997
+
+
+ terminate the session, it sends a Call-Clear-Request to the PAC and
+ then enters the wait_disconnect state.
+
+ wait_disconnect
+
+ A session disconnection is waiting to be confirmed by the PAC. Once
+ the PNS receives the Call-Disconnect-Notify message, the session
+ enters idle state.
+
+4.0 Tunnel Protocol Operation
+
+ The user data carried by the PPTP protocol are PPP data packets. PPP
+ packets are carried between the PAC and PNS, encapsulated in GRE
+ packets which in turn are carried over IP. The encapsulated PPP
+ packets are essentially PPP data packets less any media specific
+ framing elements. No HDLC flags, bit insertion, control characters,
+ or control character escapes are included. No CRCs are sent through
+ the tunnel. The IP packets transmitted over the tunnels between a PAC
+ and PNS has the following general structure:
+
+ +--------------------------------+
+ | Media Header |
+ +--------------------------------+
+ | IP Header |
+ +--------------------------------+
+ | GRE Header |
+ +--------------------------------+
+ | PPP Packet |
+ +--------------------------------+
+
+
+4.1 Enhanced GRE header
+
+ The GRE header used in PPTP is enhanced slightly from that specified
+ in the current GRE protocol specification [1,2]. The main difference
+ involves the definition of a new Acknowledgment Number field, used to
+ determine if a particular GRE packet or set of packets has arrived at
+ the remote end of the tunnel. This Acknowledgment capability is not
+ used in conjunction with any retransmission of user data packets. It
+ is used instead to determine the rate at which user data packets are
+ to be transmitted over the tunnel for a given user session.
+
+ The format of the enhanced GRE header is as follows:
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 53]
+
+Internet Draft PPTP July 1997
+
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |C|R|K|S|s|Recur|A| Flags | Ver | Protocol Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key (HW) Payload Length | Key (LW) Call ID |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number (Optional) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Acknowledgment Number (Optional) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ C (Bit 0) Checksum Present. Set to zero
+ (0).
+
+ R (Bit 1) Routing Present. Set to zero
+ (0).
+
+ K (Bit 2) Key Present. Set to one (1).
+
+ S (Bit 3) Sequence Number Present. Set to
+ one (1) if a payload (data) packet is
+ present. Set to zero (0) if payload is
+ not present (GRE packet is an
+ Acknowledgment only).
+
+ s (Bit 4) Strict source route present. Set
+ to zero (0).
+
+ Recur (Bits 5-7) Recursion control. Set to
+ zero (0).
+
+ A (Bit 8) Acknowledgment sequence number
+ present. Set to one (1) if packet
+ contains Acknowledgment Number to be used
+ for acknowledging previously transmitted
+ data.
+
+ Flags (Bits 9-12) Must be set to zero (0).
+
+ Ver (Bits 13-15) Must contain 1 (enhanced
+ GRE).
+
+ Protocol Type Set to hex 880B [8].
+
+ Key Use of the Key field is up to the
+
+
+
+Hamzeh, et al [Page 54]
+
+Internet Draft PPTP July 1997
+
+
+ implementation.
+ PPTP uses it as follows:
+
+ Payload Length
+ (High 2 octets of Key) Size of the
+ payload, not including the GRE header
+
+ Call ID
+ (Low 2 octets) Contains the Peer's
+ Call ID for the session to which this
+ packet belongs.
+
+ Sequence Number Contains the sequence number of the
+ payload. Present if S bit (Bit 3) is one
+ (1).
+
+ Acknowledgment Number Contains the sequence number of the
+ highest numbered GRE packet received by
+ the sending peer for this user session.
+ Present if A bit (Bit 8) is one (1).
+
+ The payload section contains a PPP data packet without any media
+ specific framing elements.
+
+ The sequence numbers involved are per packet sequence numbers. The
+ sequence number for each user session is set to zero at session
+ startup. Each packet sent for a given user session which contains a
+ payload (and has the S bit (Bit 3) set to one) is assigned the next
+ consecutive sequence number for that session.
+
+ This protocol allows acknowledgments to be carried with the data and
+ makes the overall protocol more efficient, which in turn requires
+ less buffering of packets.
+
+
+4.2 Sliding Window Protocol
+
+ The sliding window protocol used on the PPTP data path is used for
+ flow control by each side of the data exchange. The enhanced GRE
+ protocol allows packet acknowledgments to be piggybacked on data
+ packets. Acknowledgments can also be sent separately from data
+ packets. Again, the main purpose of the sliding window protocol is
+ for flow control--retransmissions are not performed by the tunnel
+ peers.
+
+
+
+
+
+
+
+Hamzeh, et al [Page 55]
+
+Internet Draft PPTP July 1997
+
+
+4.3 Multi Packet Acknowledgment
+
+ One feature of the PPTP sliding window protocol is that it allows the
+ acknowledgment of multiple packets with a single acknowledgment. All
+ outstanding packets with a sequence number lower or equal to the
+ acknowledgment number are considered acknowledged. Time-out
+ calculations are performed using the time the packet corresponding to
+ the highest sequence number being acknowledged was transmitted.
+
+
+ Adaptive time-out calculations are only performed when an
+ Acknowledgment is received. When multi-packet acknowledgments are
+ used, the overhead of the adaptive time-out algorithm is reduced. The
+ PAC is not required to transmit multi-packet acknowledgments; it can
+ instead acknowledge each packet individually as it is delivered to
+ the PPP client.
+
+4.4 Out-of-Sequence Packets
+
+ Occasionally packets lose their sequencing across a complicated
+ internetwork. Say, for example that a PNS sends packets 0 to 5 to a
+ PAC. Because of rerouting in the internetwork, packet 4 arrives at
+ the PAC before packet 3. The PAC acknowledges packet 4, and may
+ assume packet 3 is lost. This acknowledgment grants window credit
+ beyond packet 4.
+
+ When the PAC does receive packet 3, it MUST not attempt to transmit
+ it to the corresponding PPP client. To do so could cause problems,
+ as proper PPP protocol operation is premised upon receiving packets
+ in sequence. PPP does properly deal with the loss of packets, but
+ not with reordering so out of sequence packets between the PNS and
+ PAC MUST be silently discarded, or they may be reordered by the
+ receiver. When packet 5 comes in, it is acknowledged by the PAC
+ since it has a higher sequence number than 4, which was the last
+ highest packet acknowledged by the PAC. Packets with duplicate
+ sequence numbers should never occur since the PAC and PNS never
+ retransmit GRE packets. A robust implementation will silently
+ discard duplicate GRE packets, should it receive any.
+
+5.0 Security Considerations
+
+ Security issues are not addressed in this document. End to end
+ security is addressed by PPP. Further security considerations will be
+ addressed by the next version of PPTP.
+
+
+
+
+
+
+
+Hamzeh, et al [Page 56]
+
+Internet Draft PPTP July 1997
+
+
+6.0 Authors' Addresses
+
+
+ Kory Hamzeh
+ Ascend Communications
+ 1275 Harbor Bay Parkway
+ Alameda, CA 94502
+ Email: kory@ascend.com
+
+ Gurdeep Singh Pall
+ Microsoft Corporation
+ Redmond, WA
+ Email: gurdeep@microsoft.com
+
+ William Verthein
+ U.S. Robotics/3Com
+
+ Jeff Taarud
+ Copper Mountain Networks
+
+ W. Andrew Little
+ ECI Telematics
+
+7.0 References
+
+ [1] Hanks, S. Li, T., Farinacci, D. Traina, P., "Generic Routing
+ Encapsulation (GRE)", RFC 1701, October 1994.
+
+ [2] Hanks, S. Li, T., Farinacci, D. Traina, P., "Generic Routing
+ Encapsulation (GRE) over IPv4 Networks", RFC 1702, October 1994.
+
+ [3] Lloyd, B. Simpson, W., "PPP Authentication Protocols", RFC 1334,
+ October 1992.
+
+ [4] Postel, J. B., "Transmission Control Protocol", RFC 791,
+ September 1981
+
+ [5] Postel, J. B., "User Data Protocol", RFC 768, August 1980.
+
+ [6] Reynolds, J., Postel, J., "Assigned Numbers", RFC 1700, October,
+ 1994.
+
+ [7] Simpson, W., editor, "The Point-to-Point Protocol (PPP)", RFC
+ 1661, July 1994.
+
+ [8] Ethertype for PPP, Reserved with Xerox Corporation.
+
+
+
+
+
+Hamzeh, et al [Page 57]
+
+Internet Draft PPTP July 1997
+
+
+Appendix A. Acknowledgment Time-Outs
+
+
+ PPTP uses sliding windows and time-outs to provide both user session
+ flow-control across the internetwork and to perform efficient data
+ buffering to keep the PAC-PNS data channels full without causing
+ receive buffer overflow. PPTP requires that a time-out be used to
+ recover from dropped data or acknowledgment packets. The exact
+ implementation of the time-out is vendor-specific. It is suggested
+ that an adaptive time-out be implemented with backoff for congestion
+ control. The time-out mechanism proposed here has the following
+ properties:
+
+ Independent time-outs for each session. A device (PAC or PNS) will
+ have to maintain and calculate time-outs for every active session.
+
+ An administrator-adjustable maximum time-out, MaxTimeOut, unique
+ to each device.
+
+ An adaptive time-out mechanism that compensates for changing
+ throughput. To reduce packet processing overhead, vendors may
+ choose not to recompute the adaptive time-out for every received
+ acknowledgment. The result of this overhead reduction is that the
+ time-out will not respond as quickly to rapid network changes.
+
+ Timer backoff on time-out to reduce congestion. The backed-off
+ timer value is limited by the configurable maximum time-out value.
+ Timer backoff is done every time an acknowledgment time-out
+ occurs.
+
+ In general, this mechanism has the desirable behavior of quickly
+ backing off upon a time-out and of slowly decreasing the time-out
+ value as packets are delivered without time-outs.
+
+ Some definitions:
+
+ Packet Processing Delay (PPD) is the amount of time required for
+ each side to process the maximum amount of data buffered in their
+ receive packet sliding window. The PPD is the value exchanged
+ between the PAC and PNS when a call is established. For the PNS,
+ this number should be small. For a PAC making modem connections,
+ this number could be significant.
+
+ Sample is the actual amount of time incurred receiving an
+ acknowledgment for a packet. The Sample is measured, not
+ calculated.
+
+ Round-Trip Time (RTT) is the estimated round-trip time for an
+
+
+
+Hamzeh, et al [Page 58]
+
+Internet Draft PPTP July 1997
+
+
+ Acknowledgment to be received for a given transmitted packet. When
+ the network link is a local network, this delay will be minimal
+ (if not zero). When the network link is the Internet, this delay
+ could be substantial and vary widely. RTT is adaptive: it will
+ adjust to include the PPD and whatever shifting network delays
+ contribute to the time between a packet being transmitted and
+ receiving its acknowledgment.
+
+ Adaptive Time-Out (ATO) is the time that must elapse before an
+ acknowledgment is considered lost. After a time-out, the sliding
+ window is partially closed and the ATO is backed off.
+
+
+Packet Processing Delay (PPD)
+
+ The PPD parameter is a 16-bit word exchanged during the Call Control
+ phase that represents tenths of a second (64 means 6.4 seconds). The
+ protocol only specifies that the parameter is exchanged, it does not
+ specify how it is calculated. The way values for PPD are calculated
+ is implementation-dependent and need not be variable (static time-
+ outs are allowed). The PPD must be exchanged in the call connect
+ sequences, even if it remains constant in an implementation. One
+ possible way to calculate the PPD is:
+
+ PPD' = ((PPP_MAX_DATA_MTU - Header) * WindowSize * 8) / ConnectRate
+ PPD = PPD' + PACFudge
+
+ Header is the total size of the IP and GRE headers, which is 36. The
+ MTU is the overall MTU for the internetwork link between the PAC and
+ PNS. WindowSize represents the number of packets in the sliding
+ window, and is implementation-dependent. The latency of the
+ internetwork could be used to pick a window size sufficient to keep
+ the current session's pipe full. The constant 8 converts octets to
+ bits (assuming ConnectRate is in bits per second). If ConnectRate is
+ in bytes per second, omit the 8. PACFudge is not required but can be
+ used to take overall processing overhead of the PAC into account.
+
+ The value of PPD is used to seed the adaptive algorithm with the
+ initial RTT[n-1] value.
+
+Sample
+
+ Sample is the actual measured time for a returned acknowledgment.
+
+Round-Trip Time (RTT)
+
+ The RTT value represents an estimate of the average time it takes for
+ an acknowledgment to be received after a packet is sent to the remote
+
+
+
+Hamzeh, et al [Page 59]
+
+Internet Draft PPTP July 1997
+
+
+ end of the tunnel.
+
+
+A.1 Calculating Adaptive Acknowledgment Time-Out
+
+ We still must decide how much time to allow for acknowledgments to
+ return. If the time-out is set too high, we may wait an unnecessarily
+ long time for dropped packets. If the time-out is too short, we may
+ time out just before the acknowledgment arrives. The acknowledgment
+ time-out should also be reasonable and responsive to changing network
+ conditions.
+
+ The suggested adaptive algorithm detailed below is based on the TCP
+ 1989 implementation and is explained in Richard Steven's book TCP/IP
+ Illustrated, Volume 1 (page 300). 'n' means this iteration of the
+ calculation, and 'n-1' refers to values from the last calculation.
+
+ DIFF[n] = SAMPLE[n] - RTT[n-1]
+ DEV[n] = DEV[n-1] + (beta * (|DIFF[n]| - DEV[n-1]))
+ RTT[n] = RTT[n-1] + (alpha * DIFF[n])
+ ATO[n] = MIN (RTT[n] + (chi * DEV[n]), MaxTimeOut)
+
+ DIFF represents the error between the last estimated round-trip
+ time and the measured time. DIFF is calculated on each iteration.
+
+ DEV is the estimated mean deviation. This approximates the
+ standard deviation. DEV is calculated on each iteration and
+ stored for use in the next iteration. Initially, it is set to 0.
+
+ RTT is the estimated round-trip time of an average packet. RTT is
+ calculated on each iteration and stored for use in the next
+ iteration. Initially, it is set to PPD.
+
+ ATO is the adaptive time-out for the next transmitted packet. ATO
+ is calculated on each iteration. Its value is limited, by the MIN
+ function, to be a maximum of the configured MaxTimeOut value.
+
+ Alpha is the gain for the average and is typically 1/8 (0.125).
+
+ Beta is the gain for the deviation and is typically 1/4 (0.250).
+
+ Chi is the gain for the time-out and is typically set to 4.
+
+ To eliminate division operations for fractional gain elements, the
+ entire set of equations can be scaled. With the suggested gain
+ constants, they should be scaled by 8 to eliminate all division. To
+ simplify calculations, all gain values are kept to powers of two so
+ that shift operations can be used in place of multiplication or
+
+
+
+Hamzeh, et al [Page 60]
+
+Internet Draft PPTP July 1997
+
+
+ division.
+
+
+A.2 Congestion Control: Adjusting for Time-Out
+
+ This section describes how the calculation of ATO is modified in the
+ case where a time-out does occur. When a time-out occurs, the time-
+ out value should be adjusted rapidly upward. Although the GRE
+ packets are not retransmitted when a time-out occurs, the time-out
+ should be adjusted up toward a maximum limit. To compensate for
+ shifting internetwork time delays, a strategy must be employed to
+ increase the time-out when it expires. A simple formula called
+ Karn's Algorithm is used in TCP implementations and may be used in
+ implementing the backoff timers for the PNS or the PAC. Notice that
+ in addition to increasing the time-out, we are also shrinking the
+ size of the window as described in the next section.
+
+ Karn's timer backoff algorithm, as used in TCP, is:
+
+
+ NewTIMEOUT = delta * TIMEOUT
+
+ Adapted to our time-out calculations, for an interval in which a
+ time-out occurs, the new ATO is calculated as:
+
+ RTT[n] = delta * RTT[n-1]
+ DEV[n] = DEV[n-1]
+ ATO[n] = MIN (RTT[n] + (chi * DEV[n]), MaxTimeOut)
+
+ In this modified calculation of ATO, only the two values that
+ contribute to ATO and that are stored for the next iteration are
+ calculated. RTT is scaled by chi, and DEV is unmodified. DIFF is not
+ carried forward and is not used in this scenario. A value of 2 for
+ Delta, the time-out gain factor for RTT, is suggested.
+
+Appendix B. Acknowledgment Time-Out and Window Adjustment
+
+B.1 Initial Window Size
+
+ Although each side has indicated the maximum size of its receive
+ window, it is recommended that a slow start method be used to begin
+ transmitting data. The initial window size on the transmitter is set
+ to half the maximum size the receiver requested, with a minimum size
+ of one packet. The transmitter stops sending packets when the number
+ of packets awaiting acknowledgment is equal to the current window
+ size. As the receiver successfully digests each window, the window
+ size on the transmitter is bumped up by one packet until the maximum
+ is reached. This method prevents a system from flooding an already
+
+
+
+Hamzeh, et al [Page 61]
+
+Internet Draft PPTP July 1997
+
+
+ congested network because no history has been established.
+
+B.2 Closing the Window
+
+ When a time-out does occur on a packet, the sender adjusts the size
+ of the transmit window down to one half its value when it failed.
+ Fractions are rounded up, and the minimum window size is one.
+
+B.3 Opening the Window
+
+ With every successful transmission of a window's worth of packets
+ without a time-out, the transmit window size is increased by one
+ packet until it reaches the maximum window size that was sent by the
+ other side when the call was connected. As stated earlier, no
+ retransmission is done on a time-out. After a time-out, the
+ transmission resumes with the window starting at one half the size of
+ the transmit window when the time-out occurred and adjusting upward
+ by one each time the transmit window is filled with packets that are
+ all acknowledged without time-outs.
+
+B.4 Window Overflow
+
+ When a receiver's window overflows with too many incoming packets,
+ excess packets are thrown away. This situation should not arise if
+ the sliding window procedures are being properly followed by the
+ transmitter and receiver. It is assumed that, on the transmit side,
+ packets are buffered for transmission and are no longer accepted from
+ the packet source when the transmit buffer fills.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hamzeh, et al [Page 62]
+
+
diff --git a/doc/rfc1172.txt b/rfc/rfc1172.txt
index 5307640..5307640 100644
--- a/doc/rfc1172.txt
+++ b/rfc/rfc1172.txt
diff --git a/doc/rfc1332.txt b/rfc/rfc1332.txt
index 3e12042..3e12042 100644
--- a/doc/rfc1332.txt
+++ b/rfc/rfc1332.txt
diff --git a/doc/rfc1334.txt b/rfc/rfc1334.txt
index 6051f48..6051f48 100644
--- a/doc/rfc1334.txt
+++ b/rfc/rfc1334.txt
diff --git a/doc/rfc1548.txt b/rfc/rfc1548.txt
index 7b8a33a..7b8a33a 100644
--- a/doc/rfc1548.txt
+++ b/rfc/rfc1548.txt
diff --git a/doc/rfc1570.txt b/rfc/rfc1570.txt
index edda5d9..edda5d9 100644
--- a/doc/rfc1570.txt
+++ b/rfc/rfc1570.txt
diff --git a/rfc/rfc1661.txt b/rfc/rfc1661.txt
new file mode 100644
index 0000000..02112bd
--- /dev/null
+++ b/rfc/rfc1661.txt
@@ -0,0 +1,2976 @@
+
+
+
+
+
+
+Network Working Group W. Simpson, Editor
+Request for Comments: 1661 Daydreamer
+STD: 51 July 1994
+Obsoletes: 1548
+Category: Standards Track
+
+
+ The Point-to-Point Protocol (PPP)
+
+
+
+Status of this Memo
+
+ This document specifies an Internet standards track protocol for the
+ Internet community, and requests discussion and suggestions for
+ improvements. Please refer to the current edition of the "Internet
+ Official Protocol Standards" (STD 1) for the standardization state
+ and status of this protocol. Distribution of this memo is unlimited.
+
+
+Abstract
+
+ The Point-to-Point Protocol (PPP) provides a standard method for
+ transporting multi-protocol datagrams over point-to-point links. PPP
+ is comprised of three main components:
+
+ 1. A method for encapsulating multi-protocol datagrams.
+
+ 2. A Link Control Protocol (LCP) for establishing, configuring,
+ and testing the data-link connection.
+
+ 3. A family of Network Control Protocols (NCPs) for establishing
+ and configuring different network-layer protocols.
+
+ This document defines the PPP organization and methodology, and the
+ PPP encapsulation, together with an extensible option negotiation
+ mechanism which is able to negotiate a rich assortment of
+ configuration parameters and provides additional management
+ functions. The PPP Link Control Protocol (LCP) is described in terms
+ of this mechanism.
+
+
+Table of Contents
+
+
+ 1. Introduction .......................................... 1
+ 1.1 Specification of Requirements ................... 2
+ 1.2 Terminology ..................................... 3
+
+ 2. PPP Encapsulation ..................................... 4
+
+
+Simpson [Page i]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ 3. PPP Link Operation .................................... 6
+ 3.1 Overview ........................................ 6
+ 3.2 Phase Diagram ................................... 6
+ 3.3 Link Dead (physical-layer not ready) ............ 7
+ 3.4 Link Establishment Phase ........................ 7
+ 3.5 Authentication Phase ............................ 8
+ 3.6 Network-Layer Protocol Phase .................... 8
+ 3.7 Link Termination Phase .......................... 9
+
+ 4. The Option Negotiation Automaton ...................... 11
+ 4.1 State Transition Table .......................... 12
+ 4.2 States .......................................... 14
+ 4.3 Events .......................................... 16
+ 4.4 Actions ......................................... 21
+ 4.5 Loop Avoidance .................................. 23
+ 4.6 Counters and Timers ............................. 24
+
+ 5. LCP Packet Formats .................................... 26
+ 5.1 Configure-Request ............................... 28
+ 5.2 Configure-Ack ................................... 29
+ 5.3 Configure-Nak ................................... 30
+ 5.4 Configure-Reject ................................ 31
+ 5.5 Terminate-Request and Terminate-Ack ............. 33
+ 5.6 Code-Reject ..................................... 34
+ 5.7 Protocol-Reject ................................. 35
+ 5.8 Echo-Request and Echo-Reply ..................... 36
+ 5.9 Discard-Request ................................. 37
+
+ 6. LCP Configuration Options ............................. 39
+ 6.1 Maximum-Receive-Unit (MRU) ...................... 41
+ 6.2 Authentication-Protocol ......................... 42
+ 6.3 Quality-Protocol ................................ 43
+ 6.4 Magic-Number .................................... 45
+ 6.5 Protocol-Field-Compression (PFC) ................ 48
+ 6.6 Address-and-Control-Field-Compression (ACFC)
+
+ SECURITY CONSIDERATIONS ...................................... 51
+ REFERENCES ................................................... 51
+ ACKNOWLEDGEMENTS ............................................. 51
+ CHAIR'S ADDRESS .............................................. 52
+ EDITOR'S ADDRESS ............................................. 52
+
+
+
+
+
+
+
+
+
+
+Simpson [Page ii]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+1. Introduction
+
+ The Point-to-Point Protocol is designed for simple links which
+ transport packets between two peers. These links provide full-duplex
+ simultaneous bi-directional operation, and are assumed to deliver
+ packets in order. It is intended that PPP provide a common solution
+ for easy connection of a wide variety of hosts, bridges and routers
+ [1].
+
+ Encapsulation
+
+ The PPP encapsulation provides for multiplexing of different
+ network-layer protocols simultaneously over the same link. The
+ PPP encapsulation has been carefully designed to retain
+ compatibility with most commonly used supporting hardware.
+
+ Only 8 additional octets are necessary to form the encapsulation
+ when used within the default HDLC-like framing. In environments
+ where bandwidth is at a premium, the encapsulation and framing may
+ be shortened to 2 or 4 octets.
+
+ To support high speed implementations, the default encapsulation
+ uses only simple fields, only one of which needs to be examined
+ for demultiplexing. The default header and information fields
+ fall on 32-bit boundaries, and the trailer may be padded to an
+ arbitrary boundary.
+
+ Link Control Protocol
+
+ In order to be sufficiently versatile to be portable to a wide
+ variety of environments, PPP provides a Link Control Protocol
+ (LCP). The LCP is used to automatically agree upon the
+ encapsulation format options, handle varying limits on sizes of
+ packets, detect a looped-back link and other common
+ misconfiguration errors, and terminate the link. Other optional
+ facilities provided are authentication of the identity of its peer
+ on the link, and determination when a link is functioning properly
+ and when it is failing.
+
+ Network Control Protocols
+
+ Point-to-Point links tend to exacerbate many problems with the
+ current family of network protocols. For instance, assignment and
+ management of IP addresses, which is a problem even in LAN
+ environments, is especially difficult over circuit-switched
+ point-to-point links (such as dial-up modem servers). These
+ problems are handled by a family of Network Control Protocols
+ (NCPs), which each manage the specific needs required by their
+
+
+
+Simpson [Page 1]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ respective network-layer protocols. These NCPs are defined in
+ companion documents.
+
+ Configuration
+
+ It is intended that PPP links be easy to configure. By design,
+ the standard defaults handle all common configurations. The
+ implementor can specify improvements to the default configuration,
+ which are automatically communicated to the peer without operator
+ intervention. Finally, the operator may explicitly configure
+ options for the link which enable the link to operate in
+ environments where it would otherwise be impossible.
+
+ This self-configuration is implemented through an extensible
+ option negotiation mechanism, wherein each end of the link
+ describes to the other its capabilities and requirements.
+ Although the option negotiation mechanism described in this
+ document is specified in terms of the Link Control Protocol (LCP),
+ the same facilities are designed to be used by other control
+ protocols, especially the family of NCPs.
+
+
+
+1.1. Specification of Requirements
+
+ In this document, several words are used to signify the requirements
+ of the specification. These words are often capitalized.
+
+ MUST This word, or the adjective "required", means that the
+ definition is an absolute requirement of the specification.
+
+ MUST NOT This phrase means that the definition is an absolute
+ prohibition of the specification.
+
+ SHOULD This word, or the adjective "recommended", means that there
+ may exist valid reasons in particular circumstances to
+ ignore this item, but the full implications must be
+ understood and carefully weighed before choosing a
+ different course.
+
+ MAY This word, or the adjective "optional", means that this
+ item is one of an allowed set of alternatives. An
+ implementation which does not include this option MUST be
+ prepared to interoperate with another implementation which
+ does include the option.
+
+
+
+
+
+
+Simpson [Page 2]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+1.2. Terminology
+
+ This document frequently uses the following terms:
+
+ datagram The unit of transmission in the network layer (such as IP).
+ A datagram may be encapsulated in one or more packets
+ passed to the data link layer.
+
+ frame The unit of transmission at the data link layer. A frame
+ may include a header and/or a trailer, along with some
+ number of units of data.
+
+ packet The basic unit of encapsulation, which is passed across the
+ interface between the network layer and the data link
+ layer. A packet is usually mapped to a frame; the
+ exceptions are when data link layer fragmentation is being
+ performed, or when multiple packets are incorporated into a
+ single frame.
+
+ peer The other end of the point-to-point link.
+
+ silently discard
+ The implementation discards the packet without further
+ processing. The implementation SHOULD provide the
+ capability of logging the error, including the contents of
+ the silently discarded packet, and SHOULD record the event
+ in a statistics counter.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 3]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+2. PPP Encapsulation
+
+ The PPP encapsulation is used to disambiguate multiprotocol
+ datagrams. This encapsulation requires framing to indicate the
+ beginning and end of the encapsulation. Methods of providing framing
+ are specified in companion documents.
+
+ A summary of the PPP encapsulation is shown below. The fields are
+ transmitted from left to right.
+
+ +----------+-------------+---------+
+ | Protocol | Information | Padding |
+ | 8/16 bits| * | * |
+ +----------+-------------+---------+
+
+
+ Protocol Field
+
+ The Protocol field is one or two octets, and its value identifies
+ the datagram encapsulated in the Information field of the packet.
+ The field is transmitted and received most significant octet
+ first.
+
+ The structure of this field is consistent with the ISO 3309
+ extension mechanism for address fields. All Protocols MUST be
+ odd; the least significant bit of the least significant octet MUST
+ equal "1". Also, all Protocols MUST be assigned such that the
+ least significant bit of the most significant octet equals "0".
+ Frames received which don't comply with these rules MUST be
+ treated as having an unrecognized Protocol.
+
+ Protocol field values in the "0***" to "3***" range identify the
+ network-layer protocol of specific packets, and values in the
+ "8***" to "b***" range identify packets belonging to the
+ associated Network Control Protocols (NCPs), if any.
+
+ Protocol field values in the "4***" to "7***" range are used for
+ protocols with low volume traffic which have no associated NCP.
+ Protocol field values in the "c***" to "f***" range identify
+ packets as link-layer Control Protocols (such as LCP).
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 4]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Up-to-date values of the Protocol field are specified in the most
+ recent "Assigned Numbers" RFC [2]. This specification reserves
+ the following values:
+
+ Value (in hex) Protocol Name
+
+ 0001 Padding Protocol
+ 0003 to 001f reserved (transparency inefficient)
+ 007d reserved (Control Escape)
+ 00cf reserved (PPP NLPID)
+ 00ff reserved (compression inefficient)
+
+ 8001 to 801f unused
+ 807d unused
+ 80cf unused
+ 80ff unused
+
+ c021 Link Control Protocol
+ c023 Password Authentication Protocol
+ c025 Link Quality Report
+ c223 Challenge Handshake Authentication Protocol
+
+ Developers of new protocols MUST obtain a number from the Internet
+ Assigned Numbers Authority (IANA), at IANA@isi.edu.
+
+
+ Information Field
+
+ The Information field is zero or more octets. The Information
+ field contains the datagram for the protocol specified in the
+ Protocol field.
+
+ The maximum length for the Information field, including Padding,
+ but not including the Protocol field, is termed the Maximum
+ Receive Unit (MRU), which defaults to 1500 octets. By
+ negotiation, consenting PPP implementations may use other values
+ for the MRU.
+
+
+ Padding
+
+ On transmission, the Information field MAY be padded with an
+ arbitrary number of octets up to the MRU. It is the
+ responsibility of each protocol to distinguish padding octets from
+ real information.
+
+
+
+
+
+
+Simpson [Page 5]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+3. PPP Link Operation
+
+3.1. Overview
+
+ In order to establish communications over a point-to-point link, each
+ end of the PPP link MUST first send LCP packets to configure and test
+ the data link. After the link has been established, the peer MAY be
+ authenticated.
+
+ Then, PPP MUST send NCP packets to choose and configure one or more
+ network-layer protocols. Once each of the chosen network-layer
+ protocols has been configured, datagrams from each network-layer
+ protocol can be sent over the link.
+
+ The link will remain configured for communications until explicit LCP
+ or NCP packets close the link down, or until some external event
+ occurs (an inactivity timer expires or network administrator
+ intervention).
+
+
+
+3.2. Phase Diagram
+
+ In the process of configuring, maintaining and terminating the
+ point-to-point link, the PPP link goes through several distinct
+ phases which are specified in the following simplified state diagram:
+
+ +------+ +-----------+ +--------------+
+ | | UP | | OPENED | | SUCCESS/NONE
+ | Dead |------->| Establish |---------->| Authenticate |--+
+ | | | | | | |
+ +------+ +-----------+ +--------------+ |
+ ^ | | |
+ | FAIL | FAIL | |
+ +<--------------+ +----------+ |
+ | | |
+ | +-----------+ | +---------+ |
+ | DOWN | | | CLOSING | | |
+ +------------| Terminate |<---+<----------| Network |<-+
+ | | | |
+ +-----------+ +---------+
+
+ Not all transitions are specified in this diagram. The following
+ semantics MUST be followed.
+
+
+
+
+
+
+
+Simpson [Page 6]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+3.3. Link Dead (physical-layer not ready)
+
+ The link necessarily begins and ends with this phase. When an
+ external event (such as carrier detection or network administrator
+ configuration) indicates that the physical-layer is ready to be used,
+ PPP will proceed to the Link Establishment phase.
+
+ During this phase, the LCP automaton (described later) will be in the
+ Initial or Starting states. The transition to the Link Establishment
+ phase will signal an Up event to the LCP automaton.
+
+ Implementation Note:
+
+ Typically, a link will return to this phase automatically after
+ the disconnection of a modem. In the case of a hard-wired link,
+ this phase may be extremely short -- merely long enough to detect
+ the presence of the device.
+
+
+
+3.4. Link Establishment Phase
+
+ The Link Control Protocol (LCP) is used to establish the connection
+ through an exchange of Configure packets. This exchange is complete,
+ and the LCP Opened state entered, once a Configure-Ack packet
+ (described later) has been both sent and received.
+
+ All Configuration Options are assumed to be at default values unless
+ altered by the configuration exchange. See the chapter on LCP
+ Configuration Options for further discussion.
+
+ It is important to note that only Configuration Options which are
+ independent of particular network-layer protocols are configured by
+ LCP. Configuration of individual network-layer protocols is handled
+ by separate Network Control Protocols (NCPs) during the Network-Layer
+ Protocol phase.
+
+ Any non-LCP packets received during this phase MUST be silently
+ discarded.
+
+ The receipt of the LCP Configure-Request causes a return to the Link
+ Establishment phase from the Network-Layer Protocol phase or
+ Authentication phase.
+
+
+
+
+
+
+
+
+Simpson [Page 7]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+3.5. Authentication Phase
+
+ On some links it may be desirable to require a peer to authenticate
+ itself before allowing network-layer protocol packets to be
+ exchanged.
+
+ By default, authentication is not mandatory. If an implementation
+ desires that the peer authenticate with some specific authentication
+ protocol, then it MUST request the use of that authentication
+ protocol during Link Establishment phase.
+
+ Authentication SHOULD take place as soon as possible after link
+ establishment. However, link quality determination MAY occur
+ concurrently. An implementation MUST NOT allow the exchange of link
+ quality determination packets to delay authentication indefinitely.
+
+ Advancement from the Authentication phase to the Network-Layer
+ Protocol phase MUST NOT occur until authentication has completed. If
+ authentication fails, the authenticator SHOULD proceed instead to the
+ Link Termination phase.
+
+ Only Link Control Protocol, authentication protocol, and link quality
+ monitoring packets are allowed during this phase. All other packets
+ received during this phase MUST be silently discarded.
+
+ Implementation Notes:
+
+ An implementation SHOULD NOT fail authentication simply due to
+ timeout or lack of response. The authentication SHOULD allow some
+ method of retransmission, and proceed to the Link Termination
+ phase only after a number of authentication attempts has been
+ exceeded.
+
+ The implementation responsible for commencing Link Termination
+ phase is the implementation which has refused authentication to
+ its peer.
+
+
+
+3.6. Network-Layer Protocol Phase
+
+ Once PPP has finished the previous phases, each network-layer
+ protocol (such as IP, IPX, or AppleTalk) MUST be separately
+ configured by the appropriate Network Control Protocol (NCP).
+
+ Each NCP MAY be Opened and Closed at any time.
+
+
+
+
+
+Simpson [Page 8]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Implementation Note:
+
+ Because an implementation may initially use a significant amount
+ of time for link quality determination, implementations SHOULD
+ avoid fixed timeouts when waiting for their peers to configure a
+ NCP.
+
+ After a NCP has reached the Opened state, PPP will carry the
+ corresponding network-layer protocol packets. Any supported
+ network-layer protocol packets received when the corresponding NCP is
+ not in the Opened state MUST be silently discarded.
+
+ Implementation Note:
+
+ While LCP is in the Opened state, any protocol packet which is
+ unsupported by the implementation MUST be returned in a Protocol-
+ Reject (described later). Only protocols which are supported are
+ silently discarded.
+
+ During this phase, link traffic consists of any possible combination
+ of LCP, NCP, and network-layer protocol packets.
+
+
+
+3.7. Link Termination Phase
+
+ PPP can terminate the link at any time. This might happen because of
+ the loss of carrier, authentication failure, link quality failure,
+ the expiration of an idle-period timer, or the administrative closing
+ of the link.
+
+ LCP is used to close the link through an exchange of Terminate
+ packets. When the link is closing, PPP informs the network-layer
+ protocols so that they may take appropriate action.
+
+ After the exchange of Terminate packets, the implementation SHOULD
+ signal the physical-layer to disconnect in order to enforce the
+ termination of the link, particularly in the case of an
+ authentication failure. The sender of the Terminate-Request SHOULD
+ disconnect after receiving a Terminate-Ack, or after the Restart
+ counter expires. The receiver of a Terminate-Request SHOULD wait for
+ the peer to disconnect, and MUST NOT disconnect until at least one
+ Restart time has passed after sending a Terminate-Ack. PPP SHOULD
+ proceed to the Link Dead phase.
+
+ Any non-LCP packets received during this phase MUST be silently
+ discarded.
+
+
+
+
+Simpson [Page 9]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Implementation Note:
+
+ The closing of the link by LCP is sufficient. There is no need
+ for each NCP to send a flurry of Terminate packets. Conversely,
+ the fact that one NCP has Closed is not sufficient reason to cause
+ the termination of the PPP link, even if that NCP was the only NCP
+ currently in the Opened state.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 10]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+4. The Option Negotiation Automaton
+
+ The finite-state automaton is defined by events, actions and state
+ transitions. Events include reception of external commands such as
+ Open and Close, expiration of the Restart timer, and reception of
+ packets from a peer. Actions include the starting of the Restart
+ timer and transmission of packets to the peer.
+
+ Some types of packets -- Configure-Naks and Configure-Rejects, or
+ Code-Rejects and Protocol-Rejects, or Echo-Requests, Echo-Replies and
+ Discard-Requests -- are not differentiated in the automaton
+ descriptions. As will be described later, these packets do indeed
+ serve different functions. However, they always cause the same
+ transitions.
+
+ Events Actions
+
+ Up = lower layer is Up tlu = This-Layer-Up
+ Down = lower layer is Down tld = This-Layer-Down
+ Open = administrative Open tls = This-Layer-Started
+ Close= administrative Close tlf = This-Layer-Finished
+
+ TO+ = Timeout with counter > 0 irc = Initialize-Restart-Count
+ TO- = Timeout with counter expired zrc = Zero-Restart-Count
+
+ RCR+ = Receive-Configure-Request (Good) scr = Send-Configure-Request
+ RCR- = Receive-Configure-Request (Bad)
+ RCA = Receive-Configure-Ack sca = Send-Configure-Ack
+ RCN = Receive-Configure-Nak/Rej scn = Send-Configure-Nak/Rej
+
+ RTR = Receive-Terminate-Request str = Send-Terminate-Request
+ RTA = Receive-Terminate-Ack sta = Send-Terminate-Ack
+
+ RUC = Receive-Unknown-Code scj = Send-Code-Reject
+ RXJ+ = Receive-Code-Reject (permitted)
+ or Receive-Protocol-Reject
+ RXJ- = Receive-Code-Reject (catastrophic)
+ or Receive-Protocol-Reject
+ RXR = Receive-Echo-Request ser = Send-Echo-Reply
+ or Receive-Echo-Reply
+ or Receive-Discard-Request
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 11]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+4.1. State Transition Table
+
+ The complete state transition table follows. States are indicated
+ horizontally, and events are read vertically. State transitions and
+ actions are represented in the form action/new-state. Multiple
+ actions are separated by commas, and may continue on succeeding lines
+ as space requires; multiple actions may be implemented in any
+ convenient order. The state may be followed by a letter, which
+ indicates an explanatory footnote. The dash ('-') indicates an
+ illegal transition.
+
+ | State
+ | 0 1 2 3 4 5
+Events| Initial Starting Closed Stopped Closing Stopping
+------+-----------------------------------------------------------
+ Up | 2 irc,scr/6 - - - -
+ Down | - - 0 tls/1 0 1
+ Open | tls/1 1 irc,scr/6 3r 5r 5r
+ Close| 0 tlf/0 2 2 4 4
+ |
+ TO+ | - - - - str/4 str/5
+ TO- | - - - - tlf/2 tlf/3
+ |
+ RCR+ | - - sta/2 irc,scr,sca/8 4 5
+ RCR- | - - sta/2 irc,scr,scn/6 4 5
+ RCA | - - sta/2 sta/3 4 5
+ RCN | - - sta/2 sta/3 4 5
+ |
+ RTR | - - sta/2 sta/3 sta/4 sta/5
+ RTA | - - 2 3 tlf/2 tlf/3
+ |
+ RUC | - - scj/2 scj/3 scj/4 scj/5
+ RXJ+ | - - 2 3 4 5
+ RXJ- | - - tlf/2 tlf/3 tlf/2 tlf/3
+ |
+ RXR | - - 2 3 4 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 12]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+
+ | State
+ | 6 7 8 9
+Events| Req-Sent Ack-Rcvd Ack-Sent Opened
+------+-----------------------------------------
+ Up | - - - -
+ Down | 1 1 1 tld/1
+ Open | 6 7 8 9r
+ Close|irc,str/4 irc,str/4 irc,str/4 tld,irc,str/4
+ |
+ TO+ | scr/6 scr/6 scr/8 -
+ TO- | tlf/3p tlf/3p tlf/3p -
+ |
+ RCR+ | sca/8 sca,tlu/9 sca/8 tld,scr,sca/8
+ RCR- | scn/6 scn/7 scn/6 tld,scr,scn/6
+ RCA | irc/7 scr/6x irc,tlu/9 tld,scr/6x
+ RCN |irc,scr/6 scr/6x irc,scr/8 tld,scr/6x
+ |
+ RTR | sta/6 sta/6 sta/6 tld,zrc,sta/5
+ RTA | 6 6 8 tld,scr/6
+ |
+ RUC | scj/6 scj/7 scj/8 scj/9
+ RXJ+ | 6 6 8 9
+ RXJ- | tlf/3 tlf/3 tlf/3 tld,irc,str/5
+ |
+ RXR | 6 7 8 ser/9
+
+
+ The states in which the Restart timer is running are identifiable by
+ the presence of TO events. Only the Send-Configure-Request, Send-
+ Terminate-Request and Zero-Restart-Count actions start or re-start
+ the Restart timer. The Restart timer is stopped when transitioning
+ from any state where the timer is running to a state where the timer
+ is not running.
+
+ The events and actions are defined according to a message passing
+ architecture, rather than a signalling architecture. If an action is
+ desired to control specific signals (such as DTR), additional actions
+ are likely to be required.
+
+ [p] Passive option; see Stopped state discussion.
+
+ [r] Restart option; see Open event discussion.
+
+ [x] Crossed connection; see RCA event discussion.
+
+
+
+
+
+
+Simpson [Page 13]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+4.2. States
+
+ Following is a more detailed description of each automaton state.
+
+ Initial
+
+ In the Initial state, the lower layer is unavailable (Down), and
+ no Open has occurred. The Restart timer is not running in the
+ Initial state.
+
+ Starting
+
+ The Starting state is the Open counterpart to the Initial state.
+ An administrative Open has been initiated, but the lower layer is
+ still unavailable (Down). The Restart timer is not running in the
+ Starting state.
+
+ When the lower layer becomes available (Up), a Configure-Request
+ is sent.
+
+ Closed
+
+ In the Closed state, the link is available (Up), but no Open has
+ occurred. The Restart timer is not running in the Closed state.
+
+ Upon reception of Configure-Request packets, a Terminate-Ack is
+ sent. Terminate-Acks are silently discarded to avoid creating a
+ loop.
+
+ Stopped
+
+ The Stopped state is the Open counterpart to the Closed state. It
+ is entered when the automaton is waiting for a Down event after
+ the This-Layer-Finished action, or after sending a Terminate-Ack.
+ The Restart timer is not running in the Stopped state.
+
+ Upon reception of Configure-Request packets, an appropriate
+ response is sent. Upon reception of other packets, a Terminate-
+ Ack is sent. Terminate-Acks are silently discarded to avoid
+ creating a loop.
+
+ Rationale:
+
+ The Stopped state is a junction state for link termination,
+ link configuration failure, and other automaton failure modes.
+ These potentially separate states have been combined.
+
+ There is a race condition between the Down event response (from
+
+
+
+Simpson [Page 14]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ the This-Layer-Finished action) and the Receive-Configure-
+ Request event. When a Configure-Request arrives before the
+ Down event, the Down event will supercede by returning the
+ automaton to the Starting state. This prevents attack by
+ repetition.
+
+ Implementation Option:
+
+ After the peer fails to respond to Configure-Requests, an
+ implementation MAY wait passively for the peer to send
+ Configure-Requests. In this case, the This-Layer-Finished
+ action is not used for the TO- event in states Req-Sent, Ack-
+ Rcvd and Ack-Sent.
+
+ This option is useful for dedicated circuits, or circuits which
+ have no status signals available, but SHOULD NOT be used for
+ switched circuits.
+
+ Closing
+
+ In the Closing state, an attempt is made to terminate the
+ connection. A Terminate-Request has been sent and the Restart
+ timer is running, but a Terminate-Ack has not yet been received.
+
+ Upon reception of a Terminate-Ack, the Closed state is entered.
+ Upon the expiration of the Restart timer, a new Terminate-Request
+ is transmitted, and the Restart timer is restarted. After the
+ Restart timer has expired Max-Terminate times, the Closed state is
+ entered.
+
+ Stopping
+
+ The Stopping state is the Open counterpart to the Closing state.
+ A Terminate-Request has been sent and the Restart timer is
+ running, but a Terminate-Ack has not yet been received.
+
+ Rationale:
+
+ The Stopping state provides a well defined opportunity to
+ terminate a link before allowing new traffic. After the link
+ has terminated, a new configuration may occur via the Stopped
+ or Starting states.
+
+ Request-Sent
+
+ In the Request-Sent state an attempt is made to configure the
+ connection. A Configure-Request has been sent and the Restart
+ timer is running, but a Configure-Ack has not yet been received
+
+
+
+Simpson [Page 15]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ nor has one been sent.
+
+ Ack-Received
+
+ In the Ack-Received state, a Configure-Request has been sent and a
+ Configure-Ack has been received. The Restart timer is still
+ running, since a Configure-Ack has not yet been sent.
+
+ Ack-Sent
+
+ In the Ack-Sent state, a Configure-Request and a Configure-Ack
+ have both been sent, but a Configure-Ack has not yet been
+ received. The Restart timer is running, since a Configure-Ack has
+ not yet been received.
+
+ Opened
+
+ In the Opened state, a Configure-Ack has been both sent and
+ received. The Restart timer is not running.
+
+ When entering the Opened state, the implementation SHOULD signal
+ the upper layers that it is now Up. Conversely, when leaving the
+ Opened state, the implementation SHOULD signal the upper layers
+ that it is now Down.
+
+
+
+4.3. Events
+
+ Transitions and actions in the automaton are caused by events.
+
+ Up
+
+ This event occurs when a lower layer indicates that it is ready to
+ carry packets.
+
+ Typically, this event is used by a modem handling or calling
+ process, or by some other coupling of the PPP link to the physical
+ media, to signal LCP that the link is entering Link Establishment
+ phase.
+
+ It also can be used by LCP to signal each NCP that the link is
+ entering Network-Layer Protocol phase. That is, the This-Layer-Up
+ action from LCP triggers the Up event in the NCP.
+
+ Down
+
+ This event occurs when a lower layer indicates that it is no
+
+
+
+Simpson [Page 16]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ longer ready to carry packets.
+
+ Typically, this event is used by a modem handling or calling
+ process, or by some other coupling of the PPP link to the physical
+ media, to signal LCP that the link is entering Link Dead phase.
+
+ It also can be used by LCP to signal each NCP that the link is
+ leaving Network-Layer Protocol phase. That is, the This-Layer-
+ Down action from LCP triggers the Down event in the NCP.
+
+ Open
+
+ This event indicates that the link is administratively available
+ for traffic; that is, the network administrator (human or program)
+ has indicated that the link is allowed to be Opened. When this
+ event occurs, and the link is not in the Opened state, the
+ automaton attempts to send configuration packets to the peer.
+
+ If the automaton is not able to begin configuration (the lower
+ layer is Down, or a previous Close event has not completed), the
+ establishment of the link is automatically delayed.
+
+ When a Terminate-Request is received, or other events occur which
+ cause the link to become unavailable, the automaton will progress
+ to a state where the link is ready to re-open. No additional
+ administrative intervention is necessary.
+
+ Implementation Option:
+
+ Experience has shown that users will execute an additional Open
+ command when they want to renegotiate the link. This might
+ indicate that new values are to be negotiated.
+
+ Since this is not the meaning of the Open event, it is
+ suggested that when an Open user command is executed in the
+ Opened, Closing, Stopping, or Stopped states, the
+ implementation issue a Down event, immediately followed by an
+ Up event. Care must be taken that an intervening Down event
+ cannot occur from another source.
+
+ The Down followed by an Up will cause an orderly renegotiation
+ of the link, by progressing through the Starting to the
+ Request-Sent state. This will cause the renegotiation of the
+ link, without any harmful side effects.
+
+ Close
+
+ This event indicates that the link is not available for traffic;
+
+
+
+Simpson [Page 17]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ that is, the network administrator (human or program) has
+ indicated that the link is not allowed to be Opened. When this
+ event occurs, and the link is not in the Closed state, the
+ automaton attempts to terminate the connection. Futher attempts
+ to re-configure the link are denied until a new Open event occurs.
+
+ Implementation Note:
+
+ When authentication fails, the link SHOULD be terminated, to
+ prevent attack by repetition and denial of service to other
+ users. Since the link is administratively available (by
+ definition), this can be accomplished by simulating a Close
+ event to the LCP, immediately followed by an Open event. Care
+ must be taken that an intervening Close event cannot occur from
+ another source.
+
+ The Close followed by an Open will cause an orderly termination
+ of the link, by progressing through the Closing to the Stopping
+ state, and the This-Layer-Finished action can disconnect the
+ link. The automaton waits in the Stopped or Starting states
+ for the next connection attempt.
+
+ Timeout (TO+,TO-)
+
+ This event indicates the expiration of the Restart timer. The
+ Restart timer is used to time responses to Configure-Request and
+ Terminate-Request packets.
+
+ The TO+ event indicates that the Restart counter continues to be
+ greater than zero, which triggers the corresponding Configure-
+ Request or Terminate-Request packet to be retransmitted.
+
+ The TO- event indicates that the Restart counter is not greater
+ than zero, and no more packets need to be retransmitted.
+
+ Receive-Configure-Request (RCR+,RCR-)
+
+ This event occurs when a Configure-Request packet is received from
+ the peer. The Configure-Request packet indicates the desire to
+ open a connection and may specify Configuration Options. The
+ Configure-Request packet is more fully described in a later
+ section.
+
+ The RCR+ event indicates that the Configure-Request was
+ acceptable, and triggers the transmission of a corresponding
+ Configure-Ack.
+
+ The RCR- event indicates that the Configure-Request was
+
+
+
+Simpson [Page 18]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ unacceptable, and triggers the transmission of a corresponding
+ Configure-Nak or Configure-Reject.
+
+ Implementation Note:
+
+ These events may occur on a connection which is already in the
+ Opened state. The implementation MUST be prepared to
+ immediately renegotiate the Configuration Options.
+
+ Receive-Configure-Ack (RCA)
+
+ This event occurs when a valid Configure-Ack packet is received
+ from the peer. The Configure-Ack packet is a positive response to
+ a Configure-Request packet. An out of sequence or otherwise
+ invalid packet is silently discarded.
+
+ Implementation Note:
+
+ Since the correct packet has already been received before
+ reaching the Ack-Rcvd or Opened states, it is extremely
+ unlikely that another such packet will arrive. As specified,
+ all invalid Ack/Nak/Rej packets are silently discarded, and do
+ not affect the transitions of the automaton.
+
+ However, it is not impossible that a correctly formed packet
+ will arrive through a coincidentally-timed cross-connection.
+ It is more likely to be the result of an implementation error.
+ At the very least, this occurance SHOULD be logged.
+
+ Receive-Configure-Nak/Rej (RCN)
+
+ This event occurs when a valid Configure-Nak or Configure-Reject
+ packet is received from the peer. The Configure-Nak and
+ Configure-Reject packets are negative responses to a Configure-
+ Request packet. An out of sequence or otherwise invalid packet is
+ silently discarded.
+
+ Implementation Note:
+
+ Although the Configure-Nak and Configure-Reject cause the same
+ state transition in the automaton, these packets have
+ significantly different effects on the Configuration Options
+ sent in the resulting Configure-Request packet.
+
+ Receive-Terminate-Request (RTR)
+
+ This event occurs when a Terminate-Request packet is received.
+ The Terminate-Request packet indicates the desire of the peer to
+
+
+
+Simpson [Page 19]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ close the connection.
+
+ Implementation Note:
+
+ This event is not identical to the Close event (see above), and
+ does not override the Open commands of the local network
+ administrator. The implementation MUST be prepared to receive
+ a new Configure-Request without network administrator
+ intervention.
+
+ Receive-Terminate-Ack (RTA)
+
+ This event occurs when a Terminate-Ack packet is received from the
+ peer. The Terminate-Ack packet is usually a response to a
+ Terminate-Request packet. The Terminate-Ack packet may also
+ indicate that the peer is in Closed or Stopped states, and serves
+ to re-synchronize the link configuration.
+
+ Receive-Unknown-Code (RUC)
+
+ This event occurs when an un-interpretable packet is received from
+ the peer. A Code-Reject packet is sent in response.
+
+ Receive-Code-Reject, Receive-Protocol-Reject (RXJ+,RXJ-)
+
+ This event occurs when a Code-Reject or a Protocol-Reject packet
+ is received from the peer.
+
+ The RXJ+ event arises when the rejected value is acceptable, such
+ as a Code-Reject of an extended code, or a Protocol-Reject of a
+ NCP. These are within the scope of normal operation. The
+ implementation MUST stop sending the offending packet type.
+
+ The RXJ- event arises when the rejected value is catastrophic,
+ such as a Code-Reject of Configure-Request, or a Protocol-Reject
+ of LCP! This event communicates an unrecoverable error that
+ terminates the connection.
+
+ Receive-Echo-Request, Receive-Echo-Reply, Receive-Discard-Request
+ (RXR)
+
+ This event occurs when an Echo-Request, Echo-Reply or Discard-
+ Request packet is received from the peer. The Echo-Reply packet
+ is a response to an Echo-Request packet. There is no reply to an
+ Echo-Reply or Discard-Request packet.
+
+
+
+
+
+
+Simpson [Page 20]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+4.4. Actions
+
+ Actions in the automaton are caused by events and typically indicate
+ the transmission of packets and/or the starting or stopping of the
+ Restart timer.
+
+ Illegal-Event (-)
+
+ This indicates an event that cannot occur in a properly
+ implemented automaton. The implementation has an internal error,
+ which should be reported and logged. No transition is taken, and
+ the implementation SHOULD NOT reset or freeze.
+
+ This-Layer-Up (tlu)
+
+ This action indicates to the upper layers that the automaton is
+ entering the Opened state.
+
+ Typically, this action is used by the LCP to signal the Up event
+ to a NCP, Authentication Protocol, or Link Quality Protocol, or
+ MAY be used by a NCP to indicate that the link is available for
+ its network layer traffic.
+
+ This-Layer-Down (tld)
+
+ This action indicates to the upper layers that the automaton is
+ leaving the Opened state.
+
+ Typically, this action is used by the LCP to signal the Down event
+ to a NCP, Authentication Protocol, or Link Quality Protocol, or
+ MAY be used by a NCP to indicate that the link is no longer
+ available for its network layer traffic.
+
+ This-Layer-Started (tls)
+
+ This action indicates to the lower layers that the automaton is
+ entering the Starting state, and the lower layer is needed for the
+ link. The lower layer SHOULD respond with an Up event when the
+ lower layer is available.
+
+ This results of this action are highly implementation dependent.
+
+ This-Layer-Finished (tlf)
+
+ This action indicates to the lower layers that the automaton is
+ entering the Initial, Closed or Stopped states, and the lower
+ layer is no longer needed for the link. The lower layer SHOULD
+ respond with a Down event when the lower layer has terminated.
+
+
+
+Simpson [Page 21]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Typically, this action MAY be used by the LCP to advance to the
+ Link Dead phase, or MAY be used by a NCP to indicate to the LCP
+ that the link may terminate when there are no other NCPs open.
+
+ This results of this action are highly implementation dependent.
+
+ Initialize-Restart-Count (irc)
+
+ This action sets the Restart counter to the appropriate value
+ (Max-Terminate or Max-Configure). The counter is decremented for
+ each transmission, including the first.
+
+ Implementation Note:
+
+ In addition to setting the Restart counter, the implementation
+ MUST set the timeout period to the initial value when Restart
+ timer backoff is used.
+
+ Zero-Restart-Count (zrc)
+
+ This action sets the Restart counter to zero.
+
+ Implementation Note:
+
+ This action enables the FSA to pause before proceeding to the
+ desired final state, allowing traffic to be processed by the
+ peer. In addition to zeroing the Restart counter, the
+ implementation MUST set the timeout period to an appropriate
+ value.
+
+ Send-Configure-Request (scr)
+
+ A Configure-Request packet is transmitted. This indicates the
+ desire to open a connection with a specified set of Configuration
+ Options. The Restart timer is started when the Configure-Request
+ packet is transmitted, to guard against packet loss. The Restart
+ counter is decremented each time a Configure-Request is sent.
+
+ Send-Configure-Ack (sca)
+
+ A Configure-Ack packet is transmitted. This acknowledges the
+ reception of a Configure-Request packet with an acceptable set of
+ Configuration Options.
+
+ Send-Configure-Nak (scn)
+
+ A Configure-Nak or Configure-Reject packet is transmitted, as
+ appropriate. This negative response reports the reception of a
+
+
+
+Simpson [Page 22]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Configure-Request packet with an unacceptable set of Configuration
+ Options.
+
+ Configure-Nak packets are used to refuse a Configuration Option
+ value, and to suggest a new, acceptable value. Configure-Reject
+ packets are used to refuse all negotiation about a Configuration
+ Option, typically because it is not recognized or implemented.
+ The use of Configure-Nak versus Configure-Reject is more fully
+ described in the chapter on LCP Packet Formats.
+
+ Send-Terminate-Request (str)
+
+ A Terminate-Request packet is transmitted. This indicates the
+ desire to close a connection. The Restart timer is started when
+ the Terminate-Request packet is transmitted, to guard against
+ packet loss. The Restart counter is decremented each time a
+ Terminate-Request is sent.
+
+ Send-Terminate-Ack (sta)
+
+ A Terminate-Ack packet is transmitted. This acknowledges the
+ reception of a Terminate-Request packet or otherwise serves to
+ synchronize the automatons.
+
+ Send-Code-Reject (scj)
+
+ A Code-Reject packet is transmitted. This indicates the reception
+ of an unknown type of packet.
+
+ Send-Echo-Reply (ser)
+
+ An Echo-Reply packet is transmitted. This acknowledges the
+ reception of an Echo-Request packet.
+
+
+
+4.5. Loop Avoidance
+
+ The protocol makes a reasonable attempt at avoiding Configuration
+ Option negotiation loops. However, the protocol does NOT guarantee
+ that loops will not happen. As with any negotiation, it is possible
+ to configure two PPP implementations with conflicting policies that
+ will never converge. It is also possible to configure policies which
+ do converge, but which take significant time to do so. Implementors
+ should keep this in mind and SHOULD implement loop detection
+ mechanisms or higher level timeouts.
+
+
+
+
+
+Simpson [Page 23]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+4.6. Counters and Timers
+
+ Restart Timer
+
+ There is one special timer used by the automaton. The Restart
+ timer is used to time transmissions of Configure-Request and
+ Terminate-Request packets. Expiration of the Restart timer causes
+ a Timeout event, and retransmission of the corresponding
+ Configure-Request or Terminate-Request packet. The Restart timer
+ MUST be configurable, but SHOULD default to three (3) seconds.
+
+ Implementation Note:
+
+ The Restart timer SHOULD be based on the speed of the link.
+ The default value is designed for low speed (2,400 to 9,600
+ bps), high switching latency links (typical telephone lines).
+ Higher speed links, or links with low switching latency, SHOULD
+ have correspondingly faster retransmission times.
+
+ Instead of a constant value, the Restart timer MAY begin at an
+ initial small value and increase to the configured final value.
+ Each successive value less than the final value SHOULD be at
+ least twice the previous value. The initial value SHOULD be
+ large enough to account for the size of the packets, twice the
+ round trip time for transmission at the link speed, and at
+ least an additional 100 milliseconds to allow the peer to
+ process the packets before responding. Some circuits add
+ another 200 milliseconds of satellite delay. Round trip times
+ for modems operating at 14,400 bps have been measured in the
+ range of 160 to more than 600 milliseconds.
+
+ Max-Terminate
+
+ There is one required restart counter for Terminate-Requests.
+ Max-Terminate indicates the number of Terminate-Request packets
+ sent without receiving a Terminate-Ack before assuming that the
+ peer is unable to respond. Max-Terminate MUST be configurable,
+ but SHOULD default to two (2) transmissions.
+
+ Max-Configure
+
+ A similar counter is recommended for Configure-Requests. Max-
+ Configure indicates the number of Configure-Request packets sent
+ without receiving a valid Configure-Ack, Configure-Nak or
+ Configure-Reject before assuming that the peer is unable to
+ respond. Max-Configure MUST be configurable, but SHOULD default
+ to ten (10) transmissions.
+
+
+
+
+Simpson [Page 24]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Max-Failure
+
+ A related counter is recommended for Configure-Nak. Max-Failure
+ indicates the number of Configure-Nak packets sent without sending
+ a Configure-Ack before assuming that configuration is not
+ converging. Any further Configure-Nak packets for peer requested
+ options are converted to Configure-Reject packets, and locally
+ desired options are no longer appended. Max-Failure MUST be
+ configurable, but SHOULD default to five (5) transmissions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 25]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+5. LCP Packet Formats
+
+ There are three classes of LCP packets:
+
+ 1. Link Configuration packets used to establish and configure a
+ link (Configure-Request, Configure-Ack, Configure-Nak and
+ Configure-Reject).
+
+ 2. Link Termination packets used to terminate a link (Terminate-
+ Request and Terminate-Ack).
+
+ 3. Link Maintenance packets used to manage and debug a link
+ (Code-Reject, Protocol-Reject, Echo-Request, Echo-Reply, and
+ Discard-Request).
+
+ In the interest of simplicity, there is no version field in the LCP
+ packet. A correctly functioning LCP implementation will always
+ respond to unknown Protocols and Codes with an easily recognizable
+ LCP packet, thus providing a deterministic fallback mechanism for
+ implementations of other versions.
+
+ Regardless of which Configuration Options are enabled, all LCP Link
+ Configuration, Link Termination, and Code-Reject packets (codes 1
+ through 7) are always sent as if no Configuration Options were
+ negotiated. In particular, each Configuration Option specifies a
+ default value. This ensures that such LCP packets are always
+ recognizable, even when one end of the link mistakenly believes the
+ link to be open.
+
+ Exactly one LCP packet is encapsulated in the PPP Information field,
+ where the PPP Protocol field indicates type hex c021 (Link Control
+ Protocol).
+
+ A summary of the Link Control Protocol packet format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Data ...
+ +-+-+-+-+
+
+
+ Code
+
+ The Code field is one octet, and identifies the kind of LCP
+
+
+
+Simpson [Page 26]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ packet. When a packet is received with an unknown Code field, a
+ Code-Reject packet is transmitted.
+
+ Up-to-date values of the LCP Code field are specified in the most
+ recent "Assigned Numbers" RFC [2]. This document concerns the
+ following values:
+
+ 1 Configure-Request
+ 2 Configure-Ack
+ 3 Configure-Nak
+ 4 Configure-Reject
+ 5 Terminate-Request
+ 6 Terminate-Ack
+ 7 Code-Reject
+ 8 Protocol-Reject
+ 9 Echo-Request
+ 10 Echo-Reply
+ 11 Discard-Request
+
+
+ Identifier
+
+ The Identifier field is one octet, and aids in matching requests
+ and replies. When a packet is received with an invalid Identifier
+ field, the packet is silently discarded without affecting the
+ automaton.
+
+ Length
+
+ The Length field is two octets, and indicates the length of the
+ LCP packet, including the Code, Identifier, Length and Data
+ fields. The Length MUST NOT exceed the MRU of the link.
+
+ Octets outside the range of the Length field are treated as
+ padding and are ignored on reception. When a packet is received
+ with an invalid Length field, the packet is silently discarded
+ without affecting the automaton.
+
+ Data
+
+ The Data field is zero or more octets, as indicated by the Length
+ field. The format of the Data field is determined by the Code
+ field.
+
+
+
+
+
+
+
+
+Simpson [Page 27]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+5.1. Configure-Request
+
+ Description
+
+ An implementation wishing to open a connection MUST transmit a
+ Configure-Request. The Options field is filled with any desired
+ changes to the link defaults. Configuration Options SHOULD NOT be
+ included with default values.
+
+ Upon reception of a Configure-Request, an appropriate reply MUST
+ be transmitted.
+
+ A summary of the Configure-Request packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Options ...
+ +-+-+-+-+
+
+
+ Code
+
+ 1 for Configure-Request.
+
+ Identifier
+
+ The Identifier field MUST be changed whenever the contents of the
+ Options field changes, and whenever a valid reply has been
+ received for a previous request. For retransmissions, the
+ Identifier MAY remain unchanged.
+
+ Options
+
+ The options field is variable in length, and contains the list of
+ zero or more Configuration Options that the sender desires to
+ negotiate. All Configuration Options are always negotiated
+ simultaneously. The format of Configuration Options is further
+ described in a later chapter.
+
+
+
+
+
+
+
+
+
+Simpson [Page 28]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+5.2. Configure-Ack
+
+ Description
+
+ If every Configuration Option received in a Configure-Request is
+ recognizable and all values are acceptable, then the
+ implementation MUST transmit a Configure-Ack. The acknowledged
+ Configuration Options MUST NOT be reordered or modified in any
+ way.
+
+ On reception of a Configure-Ack, the Identifier field MUST match
+ that of the last transmitted Configure-Request. Additionally, the
+ Configuration Options in a Configure-Ack MUST exactly match those
+ of the last transmitted Configure-Request. Invalid packets are
+ silently discarded.
+
+ A summary of the Configure-Ack packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Options ...
+ +-+-+-+-+
+
+
+ Code
+
+ 2 for Configure-Ack.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Configure-Request which caused this Configure-Ack.
+
+ Options
+
+ The Options field is variable in length, and contains the list of
+ zero or more Configuration Options that the sender is
+ acknowledging. All Configuration Options are always acknowledged
+ simultaneously.
+
+
+
+
+
+
+
+
+Simpson [Page 29]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+5.3. Configure-Nak
+
+ Description
+
+ If every instance of the received Configuration Options is
+ recognizable, but some values are not acceptable, then the
+ implementation MUST transmit a Configure-Nak. The Options field
+ is filled with only the unacceptable Configuration Options from
+ the Configure-Request. All acceptable Configuration Options are
+ filtered out of the Configure-Nak, but otherwise the Configuration
+ Options from the Configure-Request MUST NOT be reordered.
+
+ Options which have no value fields (boolean options) MUST use the
+ Configure-Reject reply instead.
+
+ Each Configuration Option which is allowed only a single instance
+ MUST be modified to a value acceptable to the Configure-Nak
+ sender. The default value MAY be used, when this differs from the
+ requested value.
+
+ When a particular type of Configuration Option can be listed more
+ than once with different values, the Configure-Nak MUST include a
+ list of all values for that option which are acceptable to the
+ Configure-Nak sender. This includes acceptable values that were
+ present in the Configure-Request.
+
+ Finally, an implementation may be configured to request the
+ negotiation of a specific Configuration Option. If that option is
+ not listed, then that option MAY be appended to the list of Nak'd
+ Configuration Options, in order to prompt the peer to include that
+ option in its next Configure-Request packet. Any value fields for
+ the option MUST indicate values acceptable to the Configure-Nak
+ sender.
+
+ On reception of a Configure-Nak, the Identifier field MUST match
+ that of the last transmitted Configure-Request. Invalid packets
+ are silently discarded.
+
+ Reception of a valid Configure-Nak indicates that when a new
+ Configure-Request is sent, the Configuration Options MAY be
+ modified as specified in the Configure-Nak. When multiple
+ instances of a Configuration Option are present, the peer SHOULD
+ select a single value to include in its next Configure-Request
+ packet.
+
+ Some Configuration Options have a variable length. Since the
+ Nak'd Option has been modified by the peer, the implementation
+ MUST be able to handle an Option length which is different from
+
+
+
+Simpson [Page 30]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ the original Configure-Request.
+
+ A summary of the Configure-Nak packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Options ...
+ +-+-+-+-+
+
+
+ Code
+
+ 3 for Configure-Nak.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Configure-Request which caused this Configure-Nak.
+
+ Options
+
+ The Options field is variable in length, and contains the list of
+ zero or more Configuration Options that the sender is Nak'ing.
+ All Configuration Options are always Nak'd simultaneously.
+
+
+
+5.4. Configure-Reject
+
+ Description
+
+ If some Configuration Options received in a Configure-Request are
+ not recognizable or are not acceptable for negotiation (as
+ configured by a network administrator), then the implementation
+ MUST transmit a Configure-Reject. The Options field is filled
+ with only the unacceptable Configuration Options from the
+ Configure-Request. All recognizable and negotiable Configuration
+ Options are filtered out of the Configure-Reject, but otherwise
+ the Configuration Options MUST NOT be reordered or modified in any
+ way.
+
+ On reception of a Configure-Reject, the Identifier field MUST
+ match that of the last transmitted Configure-Request.
+ Additionally, the Configuration Options in a Configure-Reject MUST
+
+
+
+Simpson [Page 31]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ be a proper subset of those in the last transmitted Configure-
+ Request. Invalid packets are silently discarded.
+
+ Reception of a valid Configure-Reject indicates that when a new
+ Configure-Request is sent, it MUST NOT include any of the
+ Configuration Options listed in the Configure-Reject.
+
+ A summary of the Configure-Reject packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Options ...
+ +-+-+-+-+
+
+
+ Code
+
+ 4 for Configure-Reject.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Configure-Request which caused this Configure-Reject.
+
+ Options
+
+ The Options field is variable in length, and contains the list of
+ zero or more Configuration Options that the sender is rejecting.
+ All Configuration Options are always rejected simultaneously.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 32]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+5.5. Terminate-Request and Terminate-Ack
+
+ Description
+
+ LCP includes Terminate-Request and Terminate-Ack Codes in order to
+ provide a mechanism for closing a connection.
+
+ An implementation wishing to close a connection SHOULD transmit a
+ Terminate-Request. Terminate-Request packets SHOULD continue to
+ be sent until Terminate-Ack is received, the lower layer indicates
+ that it has gone down, or a sufficiently large number have been
+ transmitted such that the peer is down with reasonable certainty.
+
+ Upon reception of a Terminate-Request, a Terminate-Ack MUST be
+ transmitted.
+
+ Reception of an unelicited Terminate-Ack indicates that the peer
+ is in the Closed or Stopped states, or is otherwise in need of
+ re-negotiation.
+
+ A summary of the Terminate-Request and Terminate-Ack packet formats
+ is shown below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Data ...
+ +-+-+-+-+
+
+
+ Code
+
+ 5 for Terminate-Request;
+
+ 6 for Terminate-Ack.
+
+ Identifier
+
+ On transmission, the Identifier field MUST be changed whenever the
+ content of the Data field changes, and whenever a valid reply has
+ been received for a previous request. For retransmissions, the
+ Identifier MAY remain unchanged.
+
+ On reception, the Identifier field of the Terminate-Request is
+ copied into the Identifier field of the Terminate-Ack packet.
+
+
+
+
+Simpson [Page 33]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Data
+
+ The Data field is zero or more octets, and contains uninterpreted
+ data for use by the sender. The data may consist of any binary
+ value. The end of the field is indicated by the Length.
+
+
+
+5.6. Code-Reject
+
+ Description
+
+ Reception of a LCP packet with an unknown Code indicates that the
+ peer is operating with a different version. This MUST be reported
+ back to the sender of the unknown Code by transmitting a Code-
+ Reject.
+
+ Upon reception of the Code-Reject of a code which is fundamental
+ to this version of the protocol, the implementation SHOULD report
+ the problem and drop the connection, since it is unlikely that the
+ situation can be rectified automatically.
+
+ A summary of the Code-Reject packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Rejected-Packet ...
+ +-+-+-+-+-+-+-+-+
+
+
+ Code
+
+ 7 for Code-Reject.
+
+ Identifier
+
+ The Identifier field MUST be changed for each Code-Reject sent.
+
+ Rejected-Packet
+
+ The Rejected-Packet field contains a copy of the LCP packet which
+ is being rejected. It begins with the Information field, and does
+ not include any Data Link Layer headers nor an FCS. The
+ Rejected-Packet MUST be truncated to comply with the peer's
+
+
+
+Simpson [Page 34]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ established MRU.
+
+
+
+5.7. Protocol-Reject
+
+ Description
+
+ Reception of a PPP packet with an unknown Protocol field indicates
+ that the peer is attempting to use a protocol which is
+ unsupported. This usually occurs when the peer attempts to
+ configure a new protocol. If the LCP automaton is in the Opened
+ state, then this MUST be reported back to the peer by transmitting
+ a Protocol-Reject.
+
+ Upon reception of a Protocol-Reject, the implementation MUST stop
+ sending packets of the indicated protocol at the earliest
+ opportunity.
+
+ Protocol-Reject packets can only be sent in the LCP Opened state.
+ Protocol-Reject packets received in any state other than the LCP
+ Opened state SHOULD be silently discarded.
+
+ A summary of the Protocol-Reject packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Rejected-Protocol | Rejected-Information ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Code
+
+ 8 for Protocol-Reject.
+
+ Identifier
+
+ The Identifier field MUST be changed for each Protocol-Reject
+ sent.
+
+ Rejected-Protocol
+
+ The Rejected-Protocol field is two octets, and contains the PPP
+ Protocol field of the packet which is being rejected.
+
+
+
+Simpson [Page 35]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Rejected-Information
+
+ The Rejected-Information field contains a copy of the packet which
+ is being rejected. It begins with the Information field, and does
+ not include any Data Link Layer headers nor an FCS. The
+ Rejected-Information MUST be truncated to comply with the peer's
+ established MRU.
+
+
+
+5.8. Echo-Request and Echo-Reply
+
+ Description
+
+ LCP includes Echo-Request and Echo-Reply Codes in order to provide
+ a Data Link Layer loopback mechanism for use in exercising both
+ directions of the link. This is useful as an aid in debugging,
+ link quality determination, performance testing, and for numerous
+ other functions.
+
+ Upon reception of an Echo-Request in the LCP Opened state, an
+ Echo-Reply MUST be transmitted.
+
+ Echo-Request and Echo-Reply packets MUST only be sent in the LCP
+ Opened state. Echo-Request and Echo-Reply packets received in any
+ state other than the LCP Opened state SHOULD be silently
+ discarded.
+
+
+ A summary of the Echo-Request and Echo-Reply packet formats is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic-Number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Data ...
+ +-+-+-+-+
+
+
+ Code
+
+ 9 for Echo-Request;
+
+ 10 for Echo-Reply.
+
+
+
+Simpson [Page 36]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Identifier
+
+ On transmission, the Identifier field MUST be changed whenever the
+ content of the Data field changes, and whenever a valid reply has
+ been received for a previous request. For retransmissions, the
+ Identifier MAY remain unchanged.
+
+ On reception, the Identifier field of the Echo-Request is copied
+ into the Identifier field of the Echo-Reply packet.
+
+ Magic-Number
+
+ The Magic-Number field is four octets, and aids in detecting links
+ which are in the looped-back condition. Until the Magic-Number
+ Configuration Option has been successfully negotiated, the Magic-
+ Number MUST be transmitted as zero. See the Magic-Number
+ Configuration Option for further explanation.
+
+ Data
+
+ The Data field is zero or more octets, and contains uninterpreted
+ data for use by the sender. The data may consist of any binary
+ value. The end of the field is indicated by the Length.
+
+
+
+5.9. Discard-Request
+
+ Description
+
+ LCP includes a Discard-Request Code in order to provide a Data
+ Link Layer sink mechanism for use in exercising the local to
+ remote direction of the link. This is useful as an aid in
+ debugging, performance testing, and for numerous other functions.
+
+ Discard-Request packets MUST only be sent in the LCP Opened state.
+ On reception, the receiver MUST silently discard any Discard-
+ Request that it receives.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 37]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ A summary of the Discard-Request packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Magic-Number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Data ...
+ +-+-+-+-+
+
+ Code
+
+ 11 for Discard-Request.
+
+ Identifier
+
+ The Identifier field MUST be changed for each Discard-Request
+ sent.
+
+ Magic-Number
+
+ The Magic-Number field is four octets, and aids in detecting links
+ which are in the looped-back condition. Until the Magic-Number
+ Configuration Option has been successfully negotiated, the Magic-
+ Number MUST be transmitted as zero. See the Magic-Number
+ Configuration Option for further explanation.
+
+ Data
+
+ The Data field is zero or more octets, and contains uninterpreted
+ data for use by the sender. The data may consist of any binary
+ value. The end of the field is indicated by the Length.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 38]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+6. LCP Configuration Options
+
+ LCP Configuration Options allow negotiation of modifications to the
+ default characteristics of a point-to-point link. If a Configuration
+ Option is not included in a Configure-Request packet, the default
+ value for that Configuration Option is assumed.
+
+ Some Configuration Options MAY be listed more than once. The effect
+ of this is Configuration Option specific, and is specified by each
+ such Configuration Option description. (None of the Configuration
+ Options in this specification can be listed more than once.)
+
+ The end of the list of Configuration Options is indicated by the
+ Length field of the LCP packet.
+
+ Unless otherwise specified, all Configuration Options apply in a
+ half-duplex fashion; typically, in the receive direction of the link
+ from the point of view of the Configure-Request sender.
+
+ Design Philosophy
+
+ The options indicate additional capabilities or requirements of
+ the implementation that is requesting the option. An
+ implementation which does not understand any option SHOULD
+ interoperate with one which implements every option.
+
+ A default is specified for each option which allows the link to
+ correctly function without negotiation of the option, although
+ perhaps with less than optimal performance.
+
+ Except where explicitly specified, acknowledgement of an option
+ does not require the peer to take any additional action other than
+ the default.
+
+ It is not necessary to send the default values for the options in
+ a Configure-Request.
+
+
+ A summary of the Configuration Option format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Data ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+
+Simpson [Page 39]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Type
+
+ The Type field is one octet, and indicates the type of
+ Configuration Option. Up-to-date values of the LCP Option Type
+ field are specified in the most recent "Assigned Numbers" RFC [2].
+ This document concerns the following values:
+
+ 0 RESERVED
+ 1 Maximum-Receive-Unit
+ 3 Authentication-Protocol
+ 4 Quality-Protocol
+ 5 Magic-Number
+ 7 Protocol-Field-Compression
+ 8 Address-and-Control-Field-Compression
+
+
+ Length
+
+ The Length field is one octet, and indicates the length of this
+ Configuration Option including the Type, Length and Data fields.
+
+ If a negotiable Configuration Option is received in a Configure-
+ Request, but with an invalid or unrecognized Length, a Configure-
+ Nak SHOULD be transmitted which includes the desired Configuration
+ Option with an appropriate Length and Data.
+
+ Data
+
+ The Data field is zero or more octets, and contains information
+ specific to the Configuration Option. The format and length of
+ the Data field is determined by the Type and Length fields.
+
+ When the Data field is indicated by the Length to extend beyond
+ the end of the Information field, the entire packet is silently
+ discarded without affecting the automaton.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 40]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+6.1. Maximum-Receive-Unit (MRU)
+
+ Description
+
+ This Configuration Option may be sent to inform the peer that the
+ implementation can receive larger packets, or to request that the
+ peer send smaller packets.
+
+ The default value is 1500 octets. If smaller packets are
+ requested, an implementation MUST still be able to receive the
+ full 1500 octet information field in case link synchronization is
+ lost.
+
+ Implementation Note:
+
+ This option is used to indicate an implementation capability.
+ The peer is not required to maximize the use of the capacity.
+ For example, when a MRU is indicated which is 2048 octets, the
+ peer is not required to send any packet with 2048 octets. The
+ peer need not Configure-Nak to indicate that it will only send
+ smaller packets, since the implementation will always require
+ support for at least 1500 octets.
+
+ A summary of the Maximum-Receive-Unit Configuration Option format is
+ shown below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Maximum-Receive-Unit |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Type
+
+ 1
+
+ Length
+
+ 4
+
+ Maximum-Receive-Unit
+
+ The Maximum-Receive-Unit field is two octets, and specifies the
+ maximum number of octets in the Information and Padding fields.
+ It does not include the framing, Protocol field, FCS, nor any
+ transparency bits or bytes.
+
+
+
+
+Simpson [Page 41]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+6.2. Authentication-Protocol
+
+ Description
+
+ On some links it may be desirable to require a peer to
+ authenticate itself before allowing network-layer protocol packets
+ to be exchanged.
+
+ This Configuration Option provides a method to negotiate the use
+ of a specific protocol for authentication. By default,
+ authentication is not required.
+
+ An implementation MUST NOT include multiple Authentication-
+ Protocol Configuration Options in its Configure-Request packets.
+ Instead, it SHOULD attempt to configure the most desirable
+ protocol first. If that protocol is Configure-Nak'd, then the
+ implementation SHOULD attempt the next most desirable protocol in
+ the next Configure-Request.
+
+ The implementation sending the Configure-Request is indicating
+ that it expects authentication from its peer. If an
+ implementation sends a Configure-Ack, then it is agreeing to
+ authenticate with the specified protocol. An implementation
+ receiving a Configure-Ack SHOULD expect the peer to authenticate
+ with the acknowledged protocol.
+
+ There is no requirement that authentication be full-duplex or that
+ the same protocol be used in both directions. It is perfectly
+ acceptable for different protocols to be used in each direction.
+ This will, of course, depend on the specific protocols negotiated.
+
+ A summary of the Authentication-Protocol Configuration Option format
+ is shown below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Authentication-Protocol |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Data ...
+ +-+-+-+-+
+
+
+ Type
+
+ 3
+
+
+
+
+
+Simpson [Page 42]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Length
+
+ >= 4
+
+ Authentication-Protocol
+
+ The Authentication-Protocol field is two octets, and indicates the
+ authentication protocol desired. Values for this field are always
+ the same as the PPP Protocol field values for that same
+ authentication protocol.
+
+ Up-to-date values of the Authentication-Protocol field are
+ specified in the most recent "Assigned Numbers" RFC [2]. Current
+ values are assigned as follows:
+
+ Value (in hex) Protocol
+
+ c023 Password Authentication Protocol
+ c223 Challenge Handshake Authentication Protocol
+
+
+ Data
+
+ The Data field is zero or more octets, and contains additional
+ data as determined by the particular protocol.
+
+
+
+6.3. Quality-Protocol
+
+ Description
+
+ On some links it may be desirable to determine when, and how
+ often, the link is dropping data. This process is called link
+ quality monitoring.
+
+ This Configuration Option provides a method to negotiate the use
+ of a specific protocol for link quality monitoring. By default,
+ link quality monitoring is disabled.
+
+ The implementation sending the Configure-Request is indicating
+ that it expects to receive monitoring information from its peer.
+ If an implementation sends a Configure-Ack, then it is agreeing to
+ send the specified protocol. An implementation receiving a
+ Configure-Ack SHOULD expect the peer to send the acknowledged
+ protocol.
+
+ There is no requirement that quality monitoring be full-duplex or
+
+
+
+Simpson [Page 43]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ that the same protocol be used in both directions. It is
+ perfectly acceptable for different protocols to be used in each
+ direction. This will, of course, depend on the specific protocols
+ negotiated.
+
+ A summary of the Quality-Protocol Configuration Option format is
+ shown below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Quality-Protocol |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Data ...
+ +-+-+-+-+
+
+
+ Type
+
+ 4
+
+ Length
+
+ >= 4
+
+ Quality-Protocol
+
+ The Quality-Protocol field is two octets, and indicates the link
+ quality monitoring protocol desired. Values for this field are
+ always the same as the PPP Protocol field values for that same
+ monitoring protocol.
+
+ Up-to-date values of the Quality-Protocol field are specified in
+ the most recent "Assigned Numbers" RFC [2]. Current values are
+ assigned as follows:
+
+ Value (in hex) Protocol
+
+ c025 Link Quality Report
+
+
+ Data
+
+ The Data field is zero or more octets, and contains additional
+ data as determined by the particular protocol.
+
+
+
+
+
+
+Simpson [Page 44]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+6.4. Magic-Number
+
+ Description
+
+ This Configuration Option provides a method to detect looped-back
+ links and other Data Link Layer anomalies. This Configuration
+ Option MAY be required by some other Configuration Options such as
+ the Quality-Protocol Configuration Option. By default, the
+ Magic-Number is not negotiated, and zero is inserted where a
+ Magic-Number might otherwise be used.
+
+ Before this Configuration Option is requested, an implementation
+ MUST choose its Magic-Number. It is recommended that the Magic-
+ Number be chosen in the most random manner possible in order to
+ guarantee with very high probability that an implementation will
+ arrive at a unique number. A good way to choose a unique random
+ number is to start with a unique seed. Suggested sources of
+ uniqueness include machine serial numbers, other network hardware
+ addresses, time-of-day clocks, etc. Particularly good random
+ number seeds are precise measurements of the inter-arrival time of
+ physical events such as packet reception on other connected
+ networks, server response time, or the typing rate of a human
+ user. It is also suggested that as many sources as possible be
+ used simultaneously.
+
+ When a Configure-Request is received with a Magic-Number
+ Configuration Option, the received Magic-Number is compared with
+ the Magic-Number of the last Configure-Request sent to the peer.
+ If the two Magic-Numbers are different, then the link is not
+ looped-back, and the Magic-Number SHOULD be acknowledged. If the
+ two Magic-Numbers are equal, then it is possible, but not certain,
+ that the link is looped-back and that this Configure-Request is
+ actually the one last sent. To determine this, a Configure-Nak
+ MUST be sent specifying a different Magic-Number value. A new
+ Configure-Request SHOULD NOT be sent to the peer until normal
+ processing would cause it to be sent (that is, until a Configure-
+ Nak is received or the Restart timer runs out).
+
+ Reception of a Configure-Nak with a Magic-Number different from
+ that of the last Configure-Nak sent to the peer proves that a link
+ is not looped-back, and indicates a unique Magic-Number. If the
+ Magic-Number is equal to the one sent in the last Configure-Nak,
+ the possibility of a looped-back link is increased, and a new
+ Magic-Number MUST be chosen. In either case, a new Configure-
+ Request SHOULD be sent with the new Magic-Number.
+
+ If the link is indeed looped-back, this sequence (transmit
+ Configure-Request, receive Configure-Request, transmit Configure-
+
+
+
+Simpson [Page 45]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Nak, receive Configure-Nak) will repeat over and over again. If
+ the link is not looped-back, this sequence might occur a few
+ times, but it is extremely unlikely to occur repeatedly. More
+ likely, the Magic-Numbers chosen at either end will quickly
+ diverge, terminating the sequence. The following table shows the
+ probability of collisions assuming that both ends of the link
+ select Magic-Numbers with a perfectly uniform distribution:
+
+ Number of Collisions Probability
+ -------------------- ---------------------
+ 1 1/2**32 = 2.3 E-10
+ 2 1/2**32**2 = 5.4 E-20
+ 3 1/2**32**3 = 1.3 E-29
+
+
+ Good sources of uniqueness or randomness are required for this
+ divergence to occur. If a good source of uniqueness cannot be
+ found, it is recommended that this Configuration Option not be
+ enabled; Configure-Requests with the option SHOULD NOT be
+ transmitted and any Magic-Number Configuration Options which the
+ peer sends SHOULD be either acknowledged or rejected. In this
+ case, looped-back links cannot be reliably detected by the
+ implementation, although they may still be detectable by the peer.
+
+ If an implementation does transmit a Configure-Request with a
+ Magic-Number Configuration Option, then it MUST NOT respond with a
+ Configure-Reject when it receives a Configure-Request with a
+ Magic-Number Configuration Option. That is, if an implementation
+ desires to use Magic Numbers, then it MUST also allow its peer to
+ do so. If an implementation does receive a Configure-Reject in
+ response to a Configure-Request, it can only mean that the link is
+ not looped-back, and that its peer will not be using Magic-
+ Numbers. In this case, an implementation SHOULD act as if the
+ negotiation had been successful (as if it had instead received a
+ Configure-Ack).
+
+ The Magic-Number also may be used to detect looped-back links
+ during normal operation, as well as during Configuration Option
+ negotiation. All LCP Echo-Request, Echo-Reply, and Discard-
+ Request packets have a Magic-Number field. If Magic-Number has
+ been successfully negotiated, an implementation MUST transmit
+ these packets with the Magic-Number field set to its negotiated
+ Magic-Number.
+
+ The Magic-Number field of these packets SHOULD be inspected on
+ reception. All received Magic-Number fields MUST be equal to
+ either zero or the peer's unique Magic-Number, depending on
+ whether or not the peer negotiated a Magic-Number.
+
+
+
+Simpson [Page 46]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ Reception of a Magic-Number field equal to the negotiated local
+ Magic-Number indicates a looped-back link. Reception of a Magic-
+ Number other than the negotiated local Magic-Number, the peer's
+ negotiated Magic-Number, or zero if the peer didn't negotiate one,
+ indicates a link which has been (mis)configured for communications
+ with a different peer.
+
+ Procedures for recovery from either case are unspecified, and may
+ vary from implementation to implementation. A somewhat
+ pessimistic procedure is to assume a LCP Down event. A further
+ Open event will begin the process of re-establishing the link,
+ which can't complete until the looped-back condition is
+ terminated, and Magic-Numbers are successfully negotiated. A more
+ optimistic procedure (in the case of a looped-back link) is to
+ begin transmitting LCP Echo-Request packets until an appropriate
+ Echo-Reply is received, indicating a termination of the looped-
+ back condition.
+
+ A summary of the Magic-Number Configuration Option format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Magic-Number
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Magic-Number (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Type
+
+ 5
+
+ Length
+
+ 6
+
+ Magic-Number
+
+ The Magic-Number field is four octets, and indicates a number
+ which is very likely to be unique to one end of the link. A
+ Magic-Number of zero is illegal and MUST always be Nak'd, if it is
+ not Rejected outright.
+
+
+
+
+
+
+
+Simpson [Page 47]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+6.5. Protocol-Field-Compression (PFC)
+
+ Description
+
+ This Configuration Option provides a method to negotiate the
+ compression of the PPP Protocol field. By default, all
+ implementations MUST transmit packets with two octet PPP Protocol
+ fields.
+
+ PPP Protocol field numbers are chosen such that some values may be
+ compressed into a single octet form which is clearly
+ distinguishable from the two octet form. This Configuration
+ Option is sent to inform the peer that the implementation can
+ receive such single octet Protocol fields.
+
+ As previously mentioned, the Protocol field uses an extension
+ mechanism consistent with the ISO 3309 extension mechanism for the
+ Address field; the Least Significant Bit (LSB) of each octet is
+ used to indicate extension of the Protocol field. A binary "0" as
+ the LSB indicates that the Protocol field continues with the
+ following octet. The presence of a binary "1" as the LSB marks
+ the last octet of the Protocol field. Notice that any number of
+ "0" octets may be prepended to the field, and will still indicate
+ the same value (consider the two binary representations for 3,
+ 00000011 and 00000000 00000011).
+
+ When using low speed links, it is desirable to conserve bandwidth
+ by sending as little redundant data as possible. The Protocol-
+ Field-Compression Configuration Option allows a trade-off between
+ implementation simplicity and bandwidth efficiency. If
+ successfully negotiated, the ISO 3309 extension mechanism may be
+ used to compress the Protocol field to one octet instead of two.
+ The large majority of packets are compressible since data
+ protocols are typically assigned with Protocol field values less
+ than 256.
+
+ Compressed Protocol fields MUST NOT be transmitted unless this
+ Configuration Option has been negotiated. When negotiated, PPP
+ implementations MUST accept PPP packets with either double-octet
+ or single-octet Protocol fields, and MUST NOT distinguish between
+ them.
+
+ The Protocol field is never compressed when sending any LCP
+ packet. This rule guarantees unambiguous recognition of LCP
+ packets.
+
+ When a Protocol field is compressed, the Data Link Layer FCS field
+ is calculated on the compressed frame, not the original
+
+
+
+Simpson [Page 48]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+ uncompressed frame.
+
+ A summary of the Protocol-Field-Compression Configuration Option
+ format is shown below. The fields are transmitted from left to
+ right.
+
+ 0 1
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Type
+
+ 7
+
+ Length
+
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 49]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+6.6. Address-and-Control-Field-Compression (ACFC)
+
+ Description
+
+ This Configuration Option provides a method to negotiate the
+ compression of the Data Link Layer Address and Control fields. By
+ default, all implementations MUST transmit frames with Address and
+ Control fields appropriate to the link framing.
+
+ Since these fields usually have constant values for point-to-point
+ links, they are easily compressed. This Configuration Option is
+ sent to inform the peer that the implementation can receive
+ compressed Address and Control fields.
+
+ If a compressed frame is received when Address-and-Control-Field-
+ Compression has not been negotiated, the implementation MAY
+ silently discard the frame.
+
+ The Address and Control fields MUST NOT be compressed when sending
+ any LCP packet. This rule guarantees unambiguous recognition of
+ LCP packets.
+
+ When the Address and Control fields are compressed, the Data Link
+ Layer FCS field is calculated on the compressed frame, not the
+ original uncompressed frame.
+
+ A summary of the Address-and-Control-Field-Compression configuration
+ option format is shown below. The fields are transmitted from left
+ to right.
+
+ 0 1
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Type
+
+ 8
+
+ Length
+
+ 2
+
+
+
+
+
+
+
+Simpson [Page 50]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+Security Considerations
+
+ Security issues are briefly discussed in sections concerning the
+ Authentication Phase, the Close event, and the Authentication-
+ Protocol Configuration Option.
+
+
+
+References
+
+ [1] Perkins, D., "Requirements for an Internet Standard Point-to-
+ Point Protocol", RFC 1547, Carnegie Mellon University,
+ December 1993.
+
+ [2] Reynolds, J., and Postel, J., "Assigned Numbers", STD 2, RFC
+ 1340, USC/Information Sciences Institute, July 1992.
+
+
+Acknowledgements
+
+ This document is the product of the Point-to-Point Protocol Working
+ Group of the Internet Engineering Task Force (IETF). Comments should
+ be submitted to the ietf-ppp@merit.edu mailing list.
+
+ Much of the text in this document is taken from the working group
+ requirements [1]; and RFCs 1171 & 1172, by Drew Perkins while at
+ Carnegie Mellon University, and by Russ Hobby of the University of
+ California at Davis.
+
+ William Simpson was principally responsible for introducing
+ consistent terminology and philosophy, and the re-design of the phase
+ and negotiation state machines.
+
+ Many people spent significant time helping to develop the Point-to-
+ Point Protocol. The complete list of people is too numerous to list,
+ but the following people deserve special thanks: Rick Adams, Ken
+ Adelman, Fred Baker, Mike Ballard, Craig Fox, Karl Fox, Phill Gross,
+ Kory Hamzeh, former WG chair Russ Hobby, David Kaufman, former WG
+ chair Steve Knowles, Mark Lewis, former WG chair Brian Lloyd, John
+ LoVerso, Bill Melohn, Mike Patton, former WG chair Drew Perkins, Greg
+ Satz, John Shriver, Vernon Schryver, and Asher Waldfogel.
+
+ Special thanks to Morning Star Technologies for providing computing
+ resources and network access support for writing this specification.
+
+
+
+
+
+
+
+Simpson [Page 51]
+ RFC 1661 Point-to-Point Protocol July 1994
+
+
+Chair's Address
+
+ The working group can be contacted via the current chair:
+
+ Fred Baker
+ Advanced Computer Communications
+ 315 Bollay Drive
+ Santa Barbara, California 93117
+
+ fbaker@acc.com
+
+
+
+Editor's Address
+
+ Questions about this memo can also be directed to:
+
+ William Allen Simpson
+ Daydreamer
+ Computer Systems Consulting Services
+ 1384 Fontaine
+ Madison Heights, Michigan 48071
+
+ Bill.Simpson@um.cc.umich.edu
+ bsimpson@MorningStar.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 52]
+
+
diff --git a/rfc/rfc1662.txt b/rfc/rfc1662.txt
new file mode 100644
index 0000000..5a5b214
--- /dev/null
+++ b/rfc/rfc1662.txt
@@ -0,0 +1,1436 @@
+
+
+
+
+
+
+
+Network Working Group W. Simpson, Editor
+Request for Comments: 1662 Daydreamer
+STD: 51 July 1994
+Obsoletes: 1549
+Category: Standards Track
+
+
+ PPP in HDLC-like Framing
+
+
+Status of this Memo
+
+ This document specifies an Internet standards track protocol for the
+ Internet community, and requests discussion and suggestions for
+ improvements. Please refer to the current edition of the "Internet
+ Official Protocol Standards" (STD 1) for the standardization state
+ and status of this protocol. Distribution of this memo is unlimited.
+
+
+Abstract
+
+ The Point-to-Point Protocol (PPP) [1] provides a standard method for
+ transporting multi-protocol datagrams over point-to-point links.
+
+ This document describes the use of HDLC-like framing for PPP
+ encapsulated packets.
+
+
+Table of Contents
+
+
+ 1. Introduction .......................................... 1
+ 1.1 Specification of Requirements ................... 2
+ 1.2 Terminology ..................................... 2
+
+ 2. Physical Layer Requirements ........................... 3
+
+ 3. The Data Link Layer ................................... 4
+ 3.1 Frame Format .................................... 5
+ 3.2 Modification of the Basic Frame ................. 7
+
+ 4. Octet-stuffed framing ................................. 8
+ 4.1 Flag Sequence ................................... 8
+ 4.2 Transparency .................................... 8
+ 4.3 Invalid Frames .................................. 9
+ 4.4 Time Fill ....................................... 9
+ 4.4.1 Octet-synchronous ............................... 9
+ 4.4.2 Asynchronous .................................... 9
+ 4.5 Transmission Considerations ..................... 10
+ 4.5.1 Octet-synchronous ............................... 10
+ 4.5.2 Asynchronous .................................... 10
+
+
+Simpson [Page i]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ 5. Bit-stuffed framing ................................... 11
+ 5.1 Flag Sequence ................................... 11
+ 5.2 Transparency .................................... 11
+ 5.3 Invalid Frames .................................. 11
+ 5.4 Time Fill ....................................... 11
+ 5.5 Transmission Considerations ..................... 12
+
+ 6. Asynchronous to Synchronous Conversion ................ 13
+
+ 7. Additional LCP Configuration Options .................. 14
+ 7.1 Async-Control-Character-Map (ACCM) .............. 14
+
+ APPENDICES ................................................... 17
+ A. Recommended LCP Options ............................... 17
+ B. Automatic Recognition of PPP Frames ................... 17
+ C. Fast Frame Check Sequence (FCS) Implementation ........ 18
+ C.1 FCS table generator ............................. 18
+ C.2 16-bit FCS Computation Method ................... 19
+ C.3 32-bit FCS Computation Method ................... 21
+
+ SECURITY CONSIDERATIONS ...................................... 24
+ REFERENCES ................................................... 24
+ ACKNOWLEDGEMENTS ............................................. 25
+ CHAIR'S ADDRESS .............................................. 25
+ EDITOR'S ADDRESS ............................................. 25
+
+
+
+
+1. Introduction
+
+ This specification provides for framing over both bit-oriented and
+ octet-oriented synchronous links, and asynchronous links with 8 bits
+ of data and no parity. These links MUST be full-duplex, but MAY be
+ either dedicated or circuit-switched.
+
+ An escape mechanism is specified to allow control data such as
+ XON/XOFF to be transmitted transparently over the link, and to remove
+ spurious control data which may be injected into the link by
+ intervening hardware and software.
+
+ Some protocols expect error free transmission, and either provide
+ error detection only on a conditional basis, or do not provide it at
+ all. PPP uses the HDLC Frame Check Sequence for error detection.
+ This is commonly available in hardware implementations, and a
+ software implementation is provided.
+
+
+
+
+
+
+Simpson [Page 1]
+RFC 1662 HDLC-like Framing July 1994
+
+
+1.1. Specification of Requirements
+
+ In this document, several words are used to signify the requirements
+ of the specification. These words are often capitalized.
+
+ MUST This word, or the adjective "required", means that the
+ definition is an absolute requirement of the specification.
+
+ MUST NOT This phrase means that the definition is an absolute
+ prohibition of the specification.
+
+ SHOULD This word, or the adjective "recommended", means that there
+ may exist valid reasons in particular circumstances to
+ ignore this item, but the full implications must be
+ understood and carefully weighed before choosing a
+ different course.
+
+ MAY This word, or the adjective "optional", means that this
+ item is one of an allowed set of alternatives. An
+ implementation which does not include this option MUST be
+ prepared to interoperate with another implementation which
+ does include the option.
+
+
+1.2. Terminology
+
+ This document frequently uses the following terms:
+
+ datagram The unit of transmission in the network layer (such as IP).
+ A datagram may be encapsulated in one or more packets
+ passed to the data link layer.
+
+ frame The unit of transmission at the data link layer. A frame
+ may include a header and/or a trailer, along with some
+ number of units of data.
+
+ packet The basic unit of encapsulation, which is passed across the
+ interface between the network layer and the data link
+ layer. A packet is usually mapped to a frame; the
+ exceptions are when data link layer fragmentation is being
+ performed, or when multiple packets are incorporated into a
+ single frame.
+
+ peer The other end of the point-to-point link.
+
+ silently discard
+ The implementation discards the packet without further
+ processing. The implementation SHOULD provide the
+ capability of logging the error, including the contents of
+ the silently discarded packet, and SHOULD record the event
+ in a statistics counter.
+
+
+Simpson [Page 2]
+RFC 1662 HDLC-like Framing July 1994
+
+
+2. Physical Layer Requirements
+
+ PPP is capable of operating across most DTE/DCE interfaces (such as,
+ EIA RS-232-E, EIA RS-422, and CCITT V.35). The only absolute
+ requirement imposed by PPP is the provision of a full-duplex circuit,
+ either dedicated or circuit-switched, which can operate in either an
+ asynchronous (start/stop), bit-synchronous, or octet-synchronous
+ mode, transparent to PPP Data Link Layer frames.
+
+ Interface Format
+
+ PPP presents an octet interface to the physical layer. There is
+ no provision for sub-octets to be supplied or accepted.
+
+ Transmission Rate
+
+ PPP does not impose any restrictions regarding transmission rate,
+ other than that of the particular DTE/DCE interface.
+
+ Control Signals
+
+ PPP does not require the use of control signals, such as Request
+ To Send (RTS), Clear To Send (CTS), Data Carrier Detect (DCD), and
+ Data Terminal Ready (DTR).
+
+ When available, using such signals can allow greater functionality
+ and performance. In particular, such signals SHOULD be used to
+ signal the Up and Down events in the LCP Option Negotiation
+ Automaton [1]. When such signals are not available, the
+ implementation MUST signal the Up event to LCP upon
+ initialization, and SHOULD NOT signal the Down event.
+
+ Because signalling is not required, the physical layer MAY be
+ decoupled from the data link layer, hiding the transient details
+ of the physical transport. This has implications for mobility in
+ cellular radio networks, and other rapidly switching links.
+
+ When moving from cell to cell within the same zone, an
+ implementation MAY choose to treat the entire zone as a single
+ link, even though transmission is switched among several
+ frequencies. The link is considered to be with the central
+ control unit for the zone, rather than the individual cell
+ transceivers. However, the link SHOULD re-establish its
+ configuration whenever the link is switched to a different
+ administration.
+
+ Due to the bursty nature of data traffic, some implementations
+ have choosen to disconnect the physical layer during periods of
+
+
+
+Simpson [Page 3]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ inactivity, and reconnect when traffic resumes, without informing
+ the data link layer. Robust implementations should avoid using
+ this trick over-zealously, since the price for decreased setup
+ latency is decreased security. Implementations SHOULD signal the
+ Down event whenever "significant time" has elapsed since the link
+ was disconnected. The value for "significant time" is a matter of
+ considerable debate, and is based on the tariffs, call setup
+ times, and security concerns of the installation.
+
+
+
+3. The Data Link Layer
+
+ PPP uses the principles described in ISO 3309-1979 HDLC frame
+ structure, most recently the fourth edition 3309:1991 [2], which
+ specifies modifications to allow HDLC use in asynchronous
+ environments.
+
+ The PPP control procedures use the Control field encodings described
+ in ISO 4335-1979 HDLC elements of procedures, most recently the
+ fourth edition 4335:1991 [4].
+
+ This should not be construed to indicate that every feature of the
+ above recommendations are included in PPP. Each feature included
+ is explicitly described in the following sections.
+
+ To remain consistent with standard Internet practice, and avoid
+ confusion for people used to reading RFCs, all binary numbers in the
+ following descriptions are in Most Significant Bit to Least
+ Significant Bit order, reading from left to right, unless otherwise
+ indicated. Note that this is contrary to standard ISO and CCITT
+ practice which orders bits as transmitted (network bit order). Keep
+ this in mind when comparing this document with the international
+ standards documents.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 4]
+RFC 1662 HDLC-like Framing July 1994
+
+
+3.1. Frame Format
+
+ A summary of the PPP HDLC-like frame structure is shown below. This
+ figure does not include bits inserted for synchronization (such as
+ start and stop bits for asynchronous links), nor any bits or octets
+ inserted for transparency. The fields are transmitted from left to
+ right.
+
+ +----------+----------+----------+
+ | Flag | Address | Control |
+ | 01111110 | 11111111 | 00000011 |
+ +----------+----------+----------+
+ +----------+-------------+---------+
+ | Protocol | Information | Padding |
+ | 8/16 bits| * | * |
+ +----------+-------------+---------+
+ +----------+----------+-----------------
+ | FCS | Flag | Inter-frame Fill
+ |16/32 bits| 01111110 | or next Address
+ +----------+----------+-----------------
+
+ The Protocol, Information and Padding fields are described in the
+ Point-to-Point Protocol Encapsulation [1].
+
+ Flag Sequence
+
+ Each frame begins and ends with a Flag Sequence, which is the
+ binary sequence 01111110 (hexadecimal 0x7e). All implementations
+ continuously check for this flag, which is used for frame
+ synchronization.
+
+ Only one Flag Sequence is required between two frames. Two
+ consecutive Flag Sequences constitute an empty frame, which is
+ silently discarded, and not counted as a FCS error.
+
+ Address Field
+
+ The Address field is a single octet, which contains the binary
+ sequence 11111111 (hexadecimal 0xff), the All-Stations address.
+ Individual station addresses are not assigned. The All-Stations
+ address MUST always be recognized and received.
+
+ The use of other address lengths and values may be defined at a
+ later time, or by prior agreement. Frames with unrecognized
+ Addresses SHOULD be silently discarded.
+
+
+
+
+
+
+Simpson [Page 5]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ Control Field
+
+ The Control field is a single octet, which contains the binary
+ sequence 00000011 (hexadecimal 0x03), the Unnumbered Information
+ (UI) command with the Poll/Final (P/F) bit set to zero.
+
+ The use of other Control field values may be defined at a later
+ time, or by prior agreement. Frames with unrecognized Control
+ field values SHOULD be silently discarded.
+
+ Frame Check Sequence (FCS) Field
+
+ The Frame Check Sequence field defaults to 16 bits (two octets).
+ The FCS is transmitted least significant octet first, which
+ contains the coefficient of the highest term.
+
+ A 32-bit (four octet) FCS is also defined. Its use may be
+ negotiated as described in "PPP LCP Extensions" [5].
+
+ The use of other FCS lengths may be defined at a later time, or by
+ prior agreement.
+
+ The FCS field is calculated over all bits of the Address, Control,
+ Protocol, Information and Padding fields, not including any start
+ and stop bits (asynchronous) nor any bits (synchronous) or octets
+ (asynchronous or synchronous) inserted for transparency. This
+ also does not include the Flag Sequences nor the FCS field itself.
+
+ When octets are received which are flagged in the Async-
+ Control-Character-Map, they are discarded before calculating
+ the FCS.
+
+ For more information on the specification of the FCS, see the
+ Appendices.
+
+ The end of the Information and Padding fields is found by locating
+ the closing Flag Sequence and removing the Frame Check Sequence
+ field.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 6]
+RFC 1662 HDLC-like Framing July 1994
+
+
+3.2. Modification of the Basic Frame
+
+ The Link Control Protocol can negotiate modifications to the standard
+ HDLC-like frame structure. However, modified frames will always be
+ clearly distinguishable from standard frames.
+
+ Address-and-Control-Field-Compression
+
+ When using the standard HDLC-like framing, the Address and Control
+ fields contain the hexadecimal values 0xff and 0x03 respectively.
+ When other Address or Control field values are in use, Address-
+ and-Control-Field-Compression MUST NOT be negotiated.
+
+ On transmission, compressed Address and Control fields are simply
+ omitted.
+
+ On reception, the Address and Control fields are decompressed by
+ examining the first two octets. If they contain the values 0xff
+ and 0x03, they are assumed to be the Address and Control fields.
+ If not, it is assumed that the fields were compressed and were not
+ transmitted.
+
+ By definition, the first octet of a two octet Protocol field
+ will never be 0xff (since it is not even). The Protocol field
+ value 0x00ff is not allowed (reserved) to avoid ambiguity when
+ Protocol-Field-Compression is enabled and the first Information
+ field octet is 0x03.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 7]
+RFC 1662 HDLC-like Framing July 1994
+
+
+4. Octet-stuffed framing
+
+ This chapter summarizes the use of HDLC-like framing with 8-bit
+ asynchronous and octet-synchronous links.
+
+
+
+4.1. Flag Sequence
+
+ The Flag Sequence indicates the beginning or end of a frame. The
+ octet stream is examined on an octet-by-octet basis for the value
+ 01111110 (hexadecimal 0x7e).
+
+
+
+4.2. Transparency
+
+ An octet stuffing procedure is used. The Control Escape octet is
+ defined as binary 01111101 (hexadecimal 0x7d), most significant bit
+ first.
+
+ As a minimum, sending implementations MUST escape the Flag Sequence
+ and Control Escape octets.
+
+ After FCS computation, the transmitter examines the entire frame
+ between the two Flag Sequences. Each Flag Sequence, Control Escape
+ octet, and any octet which is flagged in the sending Async-Control-
+ Character-Map (ACCM), is replaced by a two octet sequence consisting
+ of the Control Escape octet followed by the original octet
+ exclusive-or'd with hexadecimal 0x20.
+
+ This is bit 5 complemented, where the bit positions are numbered
+ 76543210 (the 6th bit as used in ISO numbered 87654321 -- BEWARE
+ when comparing documents).
+
+ Receiving implementations MUST correctly process all Control Escape
+ sequences.
+
+ On reception, prior to FCS computation, each octet with value less
+ than hexadecimal 0x20 is checked. If it is flagged in the receiving
+ ACCM, it is simply removed (it may have been inserted by intervening
+ data communications equipment). Each Control Escape octet is also
+ removed, and the following octet is exclusive-or'd with hexadecimal
+ 0x20, unless it is the Flag Sequence (which aborts a frame).
+
+ A few examples may make this more clear. Escaped data is transmitted
+ on the link as follows:
+
+
+
+
+Simpson [Page 8]
+RFC 1662 HDLC-like Framing July 1994
+
+
+
+ 0x7e is encoded as 0x7d, 0x5e. (Flag Sequence)
+ 0x7d is encoded as 0x7d, 0x5d. (Control Escape)
+ 0x03 is encoded as 0x7d, 0x23. (ETX)
+
+ Some modems with software flow control may intercept outgoing DC1 and
+ DC3 ignoring the 8th (parity) bit. This data would be transmitted on
+ the link as follows:
+
+ 0x11 is encoded as 0x7d, 0x31. (XON)
+ 0x13 is encoded as 0x7d, 0x33. (XOFF)
+ 0x91 is encoded as 0x7d, 0xb1. (XON with parity set)
+ 0x93 is encoded as 0x7d, 0xb3. (XOFF with parity set)
+
+
+
+
+4.3. Invalid Frames
+
+ Frames which are too short (less than 4 octets when using the 16-bit
+ FCS), or which end with a Control Escape octet followed immediately
+ by a closing Flag Sequence, or in which octet-framing is violated (by
+ transmitting a "0" stop bit where a "1" bit is expected), are
+ silently discarded, and not counted as a FCS error.
+
+
+
+4.4. Time Fill
+
+4.4.1. Octet-synchronous
+
+ There is no provision for inter-octet time fill.
+
+ The Flag Sequence MUST be transmitted during inter-frame time fill.
+
+
+4.4.2. Asynchronous
+
+ Inter-octet time fill MUST be accomplished by transmitting continuous
+ "1" bits (mark-hold state).
+
+ Inter-frame time fill can be viewed as extended inter-octet time
+ fill. Doing so can save one octet for every frame, decreasing delay
+ and increasing bandwidth. This is possible since a Flag Sequence may
+ serve as both a frame end and a frame begin. After having received
+ any frame, an idle receiver will always be in a frame begin state.
+
+
+
+
+Simpson [Page 9]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ Robust transmitters should avoid using this trick over-zealously,
+ since the price for decreased delay is decreased reliability. Noisy
+ links may cause the receiver to receive garbage characters and
+ interpret them as part of an incoming frame. If the transmitter does
+ not send a new opening Flag Sequence before sending the next frame,
+ then that frame will be appended to the noise characters causing an
+ invalid frame (with high reliability).
+
+ It is suggested that implementations will achieve the best results by
+ always sending an opening Flag Sequence if the new frame is not
+ back-to-back with the last. Transmitters SHOULD send an open Flag
+ Sequence whenever "appreciable time" has elapsed after the prior
+ closing Flag Sequence. The maximum value for "appreciable time" is
+ likely to be no greater than the typing rate of a slow typist, about
+ 1 second.
+
+
+
+4.5. Transmission Considerations
+
+4.5.1. Octet-synchronous
+
+ The definition of various encodings and scrambling is the
+ responsibility of the DTE/DCE equipment in use, and is outside the
+ scope of this specification.
+
+
+4.5.2. Asynchronous
+
+ All octets are transmitted least significant bit first, with one
+ start bit, eight bits of data, and one stop bit. There is no
+ provision for seven bit asynchronous links.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 10]
+RFC 1662 HDLC-like Framing July 1994
+
+
+5. Bit-stuffed framing
+
+ This chapter summarizes the use of HDLC-like framing with bit-
+ synchronous links.
+
+
+
+5.1. Flag Sequence
+
+ The Flag Sequence indicates the beginning or end of a frame, and is
+ used for frame synchronization. The bit stream is examined on a
+ bit-by-bit basis for the binary sequence 01111110 (hexadecimal 0x7e).
+
+ The "shared zero mode" Flag Sequence "011111101111110" SHOULD NOT be
+ used. When not avoidable, such an implementation MUST ensure that
+ the first Flag Sequence detected (the end of the frame) is promptly
+ communicated to the link layer. Use of the shared zero mode hinders
+ interoperability with bit-synchronous to asynchronous and bit-
+ synchronous to octet-synchronous converters.
+
+
+
+5.2. Transparency
+
+ After FCS computation, the transmitter examines the entire frame
+ between the two Flag Sequences. A "0" bit is inserted after all
+ sequences of five contiguous "1" bits (including the last 5 bits of
+ the FCS) to ensure that a Flag Sequence is not simulated.
+
+ On reception, prior to FCS computation, any "0" bit that directly
+ follows five contiguous "1" bits is discarded.
+
+
+
+5.3. Invalid Frames
+
+ Frames which are too short (less than 4 octets when using the 16-bit
+ FCS), or which end with a sequence of more than six "1" bits, are
+ silently discarded, and not counted as a FCS error.
+
+
+
+5.4. Time Fill
+
+ There is no provision for inter-octet time fill.
+
+ The Flag Sequence SHOULD be transmitted during inter-frame time fill.
+ However, certain types of circuit-switched links require the use of
+
+
+
+Simpson [Page 11]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ mark idle (continuous ones), particularly those that calculate
+ accounting based on periods of bit activity. When mark idle is used
+ on a bit-synchronous link, the implementation MUST ensure at least 15
+ consecutive "1" bits between Flags during the idle period, and that
+ the Flag Sequence is always generated at the beginning of a frame
+ after an idle period.
+
+ This differs from practice in ISO 3309, which allows 7 to 14 bit
+ mark idle.
+
+
+
+5.5. Transmission Considerations
+
+ All octets are transmitted least significant bit first.
+
+ The definition of various encodings and scrambling is the
+ responsibility of the DTE/DCE equipment in use, and is outside the
+ scope of this specification.
+
+ While PPP will operate without regard to the underlying
+ representation of the bit stream, lack of standards for transmission
+ will hinder interoperability as surely as lack of data link
+ standards. At speeds of 56 Kbps through 2.0 Mbps, NRZ is currently
+ most widely available, and on that basis is recommended as a default.
+
+ When configuration of the encoding is allowed, NRZI is recommended as
+ an alternative, because of its relative immunity to signal inversion
+ configuration errors, and instances when it MAY allow connection
+ without an expensive DSU/CSU. Unfortunately, NRZI encoding
+ exacerbates the missing x1 factor of the 16-bit FCS, so that one
+ error in 2**15 goes undetected (instead of one in 2**16), and triple
+ errors are not detected. Therefore, when NRZI is in use, it is
+ recommended that the 32-bit FCS be negotiated, which includes the x1
+ factor.
+
+ At higher speeds of up to 45 Mbps, some implementors have chosen the
+ ANSI High Speed Synchronous Interface [HSSI]. While this experience
+ is currently limited, implementors are encouraged to cooperate in
+ choosing transmission encoding.
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 12]
+RFC 1662 HDLC-like Framing July 1994
+
+
+6. Asynchronous to Synchronous Conversion
+
+ There may be some use of asynchronous-to-synchronous converters (some
+ built into modems and cellular interfaces), resulting in an
+ asynchronous PPP implementation on one end of a link and a
+ synchronous implementation on the other. It is the responsibility of
+ the converter to do all stuffing conversions during operation.
+
+ To enable this functionality, synchronous PPP implementations MUST
+ always respond to the Async-Control-Character-Map Configuration
+ Option with the LCP Configure-Ack. However, acceptance of the
+ Configuration Option does not imply that the synchronous
+ implementation will do any ACCM mapping. Instead, all such octet
+ mapping will be performed by the asynchronous-to-synchronous
+ converter.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 13]
+RFC 1662 HDLC-like Framing July 1994
+
+
+7. Additional LCP Configuration Options
+
+ The Configuration Option format and basic options are already defined
+ for LCP [1].
+
+ Up-to-date values of the LCP Option Type field are specified in the
+ most recent "Assigned Numbers" RFC [10]. This document concerns the
+ following values:
+
+ 2 Async-Control-Character-Map
+
+
+
+
+7.1. Async-Control-Character-Map (ACCM)
+
+ Description
+
+ This Configuration Option provides a method to negotiate the use
+ of control character transparency on asynchronous links.
+
+ Each end of the asynchronous link maintains two Async-Control-
+ Character-Maps. The receiving ACCM is 32 bits, but the sending
+ ACCM may be up to 256 bits. This results in four distinct ACCMs,
+ two in each direction of the link.
+
+ For asynchronous links, the default receiving ACCM is 0xffffffff.
+ The default sending ACCM is 0xffffffff, plus the Control Escape
+ and Flag Sequence characters themselves, plus whatever other
+ outgoing characters are flagged (by prior configuration) as likely
+ to be intercepted.
+
+ For other types of links, the default value is 0, since there is
+ no need for mapping.
+
+ The default inclusion of all octets less than hexadecimal 0x20
+ allows all ASCII control characters [6] excluding DEL (Delete)
+ to be transparently communicated through all known data
+ communications equipment.
+
+ The transmitter MAY also send octets with values in the range 0x40
+ through 0xff (except 0x5e) in Control Escape format. Since these
+ octet values are not negotiable, this does not solve the problem
+ of receivers which cannot handle all non-control characters.
+ Also, since the technique does not affect the 8th bit, this does
+ not solve problems for communications links that can send only 7-
+ bit characters.
+
+
+
+
+Simpson [Page 14]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ Note that this specification differs in detail from later
+ amendments, such as 3309:1991/Amendment 2 [3]. However, such
+ "extended transparency" is applied only by "prior agreement".
+ Use of the transparency methods in this specification
+ constitute a prior agreement with respect to PPP.
+
+ For compatibility with 3309:1991/Amendment 2, the transmitter
+ MAY escape DEL and ACCM equivalents with the 8th (most
+ significant) bit set. No change is required in the receiving
+ algorithm.
+
+ Following ACCM negotiation, the transmitter SHOULD cease
+ escaping DEL.
+
+ However, it is rarely necessary to map all control characters, and
+ often it is unnecessary to map any control characters. The
+ Configuration Option is used to inform the peer which control
+ characters MUST remain mapped when the peer sends them.
+
+ The peer MAY still send any other octets in mapped format, if it
+ is necessary because of constraints known to the peer. The peer
+ SHOULD Configure-Nak with the logical union of the sets of mapped
+ octets, so that when such octets are spuriously introduced they
+ can be ignored on receipt.
+
+ A summary of the Async-Control-Character-Map Configuration Option
+ format is shown below. The fields are transmitted from left to
+ right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | ACCM
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ ACCM (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Type
+
+ 2
+
+ Length
+
+ 6
+
+
+
+
+
+
+Simpson [Page 15]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ ACCM
+
+ The ACCM field is four octets, and indicates the set of control
+ characters to be mapped. The map is sent most significant octet
+ first.
+
+ Each numbered bit corresponds to the octet of the same value. If
+ the bit is cleared to zero, then that octet need not be mapped.
+ If the bit is set to one, then that octet MUST remain mapped. For
+ example, if bit 19 is set to zero, then the ASCII control
+ character 19 (DC3, Control-S) MAY be sent in the clear.
+
+ Note: The least significant bit of the least significant octet
+ (the final octet transmitted) is numbered bit 0, and would map
+ to the ASCII control character NUL.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 16]
+RFC 1662 HDLC-like Framing July 1994
+
+
+A. Recommended LCP Options
+
+ The following Configurations Options are recommended:
+
+ High Speed links
+
+ Magic Number
+ Link Quality Monitoring
+ No Address and Control Field Compression
+ No Protocol Field Compression
+
+
+ Low Speed or Asynchronous links
+
+ Async Control Character Map
+ Magic Number
+ Address and Control Field Compression
+ Protocol Field Compression
+
+
+
+B. Automatic Recognition of PPP Frames
+
+ It is sometimes desirable to detect PPP frames, for example during a
+ login sequence. The following octet sequences all begin valid PPP
+ LCP frames:
+
+ 7e ff 03 c0 21
+ 7e ff 7d 23 c0 21
+ 7e 7d df 7d 23 c0 21
+
+ Note that the first two forms are not a valid username for Unix.
+ However, only the third form generates a correctly checksummed PPP
+ frame, whenever 03 and ff are taken as the control characters ETX and
+ DEL without regard to parity (they are correct for an even parity
+ link) and discarded.
+
+ Many implementations deal with this by putting the interface into
+ packet mode when one of the above username patterns are detected
+ during login, without examining the initial PPP checksum. The
+ initial incoming PPP frame is discarded, but a Configure-Request is
+ sent immediately.
+
+
+
+
+
+
+
+
+
+Simpson [Page 17]
+RFC 1662 HDLC-like Framing July 1994
+
+
+C. Fast Frame Check Sequence (FCS) Implementation
+
+ The FCS was originally designed with hardware implementations in
+ mind. A serial bit stream is transmitted on the wire, the FCS is
+ calculated over the serial data as it goes out, and the complement of
+ the resulting FCS is appended to the serial stream, followed by the
+ Flag Sequence.
+
+ The receiver has no way of determining that it has finished
+ calculating the received FCS until it detects the Flag Sequence.
+ Therefore, the FCS was designed so that a particular pattern results
+ when the FCS operation passes over the complemented FCS. A good
+ frame is indicated by this "good FCS" value.
+
+
+
+C.1. FCS table generator
+
+ The following code creates the lookup table used to calculate the
+ FCS-16.
+
+ /*
+ * Generate a FCS-16 table.
+ *
+ * Drew D. Perkins at Carnegie Mellon University.
+ *
+ * Code liberally borrowed from Mohsen Banan and D. Hugh Redelmeier.
+ */
+
+ /*
+ * The FCS-16 generator polynomial: x**0 + x**5 + x**12 + x**16.
+ */
+ #define P 0x8408
+
+
+ main()
+ {
+ register unsigned int b, v;
+ register int i;
+
+ printf("typedef unsigned short u16;\n");
+ printf("static u16 fcstab[256] = {");
+ for (b = 0; ; ) {
+ if (b % 8 == 0)
+ printf("\n");
+
+ v = b;
+ for (i = 8; i--; )
+
+
+
+Simpson [Page 18]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ v = v & 1 ? (v >> 1) ^ P : v >> 1;
+
+ printf("\t0x%04x", v & 0xFFFF);
+ if (++b == 256)
+ break;
+ printf(",");
+ }
+ printf("\n};\n");
+ }
+
+
+
+C.2. 16-bit FCS Computation Method
+
+ The following code provides a table lookup computation for
+ calculating the Frame Check Sequence as data arrives at the
+ interface. This implementation is based on [7], [8], and [9].
+
+ /*
+ * u16 represents an unsigned 16-bit number. Adjust the typedef for
+ * your hardware.
+ */
+ typedef unsigned short u16;
+
+ /*
+ * FCS lookup table as calculated by the table generator.
+ */
+ static u16 fcstab[256] = {
+ 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
+ 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
+ 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
+ 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
+ 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
+ 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
+ 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
+ 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
+ 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
+ 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
+ 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
+ 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
+ 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
+ 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
+ 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
+ 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
+ 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
+ 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
+ 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
+ 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
+
+
+
+Simpson [Page 19]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
+ 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
+ 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
+ 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
+ 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
+ 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
+ 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
+ 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
+ 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
+ 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
+ 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
+ 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
+ };
+
+ #define PPPINITFCS16 0xffff /* Initial FCS value */
+ #define PPPGOODFCS16 0xf0b8 /* Good final FCS value */
+
+ /*
+ * Calculate a new fcs given the current fcs and the new data.
+ */
+ u16 pppfcs16(fcs, cp, len)
+ register u16 fcs;
+ register unsigned char *cp;
+ register int len;
+ {
+ ASSERT(sizeof (u16) == 2);
+ ASSERT(((u16) -1) > 0);
+ while (len--)
+ fcs = (fcs >> 8) ^ fcstab[(fcs ^ *cp++) & 0xff];
+
+ return (fcs);
+ }
+
+ /*
+ * How to use the fcs
+ */
+ tryfcs16(cp, len)
+ register unsigned char *cp;
+ register int len;
+ {
+ u16 trialfcs;
+
+ /* add on output */
+ trialfcs = pppfcs16( PPPINITFCS16, cp, len );
+ trialfcs ^= 0xffff; /* complement */
+ cp[len] = (trialfcs & 0x00ff); /* least significant byte first */
+ cp[len+1] = ((trialfcs >> 8) & 0x00ff);
+
+
+
+
+Simpson [Page 20]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ /* check on input */
+ trialfcs = pppfcs16( PPPINITFCS16, cp, len + 2 );
+ if ( trialfcs == PPPGOODFCS16 )
+ printf("Good FCS\n");
+ }
+
+
+
+C.3. 32-bit FCS Computation Method
+
+ The following code provides a table lookup computation for
+ calculating the 32-bit Frame Check Sequence as data arrives at the
+ interface.
+
+ /*
+ * The FCS-32 generator polynomial: x**0 + x**1 + x**2 + x**4 + x**5
+ * + x**7 + x**8 + x**10 + x**11 + x**12 + x**16
+ * + x**22 + x**23 + x**26 + x**32.
+ */
+
+ /*
+ * u32 represents an unsigned 32-bit number. Adjust the typedef for
+ * your hardware.
+ */
+ typedef unsigned long u32;
+
+ static u32 fcstab_32[256] =
+ {
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
+ 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
+ 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
+ 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
+ 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
+ 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
+ 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
+ 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
+ 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
+ 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
+ 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
+ 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
+ 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
+ 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
+ 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
+ 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
+ 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+
+
+
+Simpson [Page 21]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
+ 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
+ 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
+ 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
+ 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
+ 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
+ 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
+ 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
+ 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
+ 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
+ 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
+ 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
+ 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
+ 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
+ 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
+ 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
+ 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
+ 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
+ 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
+ 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
+ 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
+ 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
+ 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
+ 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
+ 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
+ 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
+ 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
+ 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
+ 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
+ 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
+ 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
+ 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
+ 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
+ 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
+ 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
+ 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
+ };
+
+ #define PPPINITFCS32 0xffffffff /* Initial FCS value */
+ #define PPPGOODFCS32 0xdebb20e3 /* Good final FCS value */
+
+
+
+Simpson [Page 22]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ /*
+ * Calculate a new FCS given the current FCS and the new data.
+ */
+ u32 pppfcs32(fcs, cp, len)
+ register u32 fcs;
+ register unsigned char *cp;
+ register int len;
+ {
+ ASSERT(sizeof (u32) == 4);
+ ASSERT(((u32) -1) > 0);
+ while (len--)
+ fcs = (((fcs) >> 8) ^ fcstab_32[((fcs) ^ (*cp++)) & 0xff]);
+
+ return (fcs);
+ }
+
+ /*
+ * How to use the fcs
+ */
+ tryfcs32(cp, len)
+ register unsigned char *cp;
+ register int len;
+ {
+ u32 trialfcs;
+
+ /* add on output */
+ trialfcs = pppfcs32( PPPINITFCS32, cp, len );
+ trialfcs ^= 0xffffffff; /* complement */
+ cp[len] = (trialfcs & 0x00ff); /* least significant byte first */
+ cp[len+1] = ((trialfcs >>= 8) & 0x00ff);
+ cp[len+2] = ((trialfcs >>= 8) & 0x00ff);
+ cp[len+3] = ((trialfcs >> 8) & 0x00ff);
+
+ /* check on input */
+ trialfcs = pppfcs32( PPPINITFCS32, cp, len + 4 );
+ if ( trialfcs == PPPGOODFCS32 )
+ printf("Good FCS\n");
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+Simpson [Page 23]
+RFC 1662 HDLC-like Framing July 1994
+
+
+Security Considerations
+
+ As noted in the Physical Layer Requirements section, the link layer
+ might not be informed when the connected state of the physical layer
+ has changed. This results in possible security lapses due to over-
+ reliance on the integrity and security of switching systems and
+ administrations. An insertion attack might be undetected. An
+ attacker which is able to spoof the same calling identity might be
+ able to avoid link authentication.
+
+
+
+References
+
+ [1] Simpson, W., Editor, "The Point-to-Point Protocol (PPP)",
+ STD 50, RFC 1661, Daydreamer, July 1994.
+
+ [2] ISO/IEC 3309:1991(E), "Information Technology -
+ Telecommunications and information exchange between systems -
+ High-level data link control (HDLC) procedures - Frame
+ structure", International Organization For Standardization,
+ Fourth edition 1991-06-01.
+
+ [3] ISO/IEC 3309:1991/Amd.2:1992(E), "Information Technology -
+ Telecommunications and information exchange between systems -
+ High-level data link control (HDLC) procedures - Frame
+ structure - Amendment 2: Extended transparency options for
+ start/stop transmission", International Organization For
+ Standardization, 1992-01-15.
+
+ [4] ISO/IEC 4335:1991(E), "Information Technology -
+ Telecommunications and information exchange between systems -
+ High-level data link control (HDLC) procedures - Elements of
+ procedures", International Organization For Standardization,
+ Fourth edition 1991-09-15.
+
+ [5] Simpson, W., Editor, "PPP LCP Extensions", RFC 1570,
+ Daydreamer, January 1994.
+
+ [6] ANSI X3.4-1977, "American National Standard Code for
+ Information Interchange", American National Standards
+ Institute, 1977.
+
+ [7] Perez, "Byte-wise CRC Calculations", IEEE Micro, June 1983.
+
+ [8] Morse, G., "Calculating CRC's by Bits and Bytes", Byte,
+ September 1986.
+
+
+
+
+Simpson [Page 24]
+RFC 1662 HDLC-like Framing July 1994
+
+
+ [9] LeVan, J., "A Fast CRC", Byte, November 1987.
+
+ [10] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC
+ 1340, USC/Information Sciences Institute, July 1992.
+
+
+
+Acknowledgements
+
+ This document is the product of the Point-to-Point Protocol Working
+ Group of the Internet Engineering Task Force (IETF). Comments should
+ be submitted to the ietf-ppp@merit.edu mailing list.
+
+ This specification is based on previous RFCs, where many
+ contributions have been acknowleged.
+
+ The 32-bit FCS example code was provided by Karl Fox (Morning Star
+ Technologies).
+
+ Special thanks to Morning Star Technologies for providing computing
+ resources and network access support for writing this specification.
+
+
+
+Chair's Address
+
+ The working group can be contacted via the current chair:
+
+ Fred Baker
+ Advanced Computer Communications
+ 315 Bollay Drive
+ Santa Barbara, California 93117
+
+ fbaker@acc.com
+
+
+Editor's Address
+
+ Questions about this memo can also be directed to:
+
+ William Allen Simpson
+ Daydreamer
+ Computer Systems Consulting Services
+ 1384 Fontaine
+ Madison Heights, Michigan 48071
+
+ Bill.Simpson@um.cc.umich.edu
+ bsimpson@MorningStar.com
+
+
+Simpson [Page 25]
diff --git a/rfc/rfc1701.txt b/rfc/rfc1701.txt
new file mode 100644
index 0000000..60a0e9b
--- /dev/null
+++ b/rfc/rfc1701.txt
@@ -0,0 +1,451 @@
+
+
+
+
+
+
+Network Working Group S. Hanks
+Request for Comments: 1701 NetSmiths, Ltd.
+Category: Informational T. Li
+ D. Farinacci
+ P. Traina
+ cisco Systems
+ October 1994
+
+
+ Generic Routing Encapsulation (GRE)
+
+Status of this Memo
+
+
+ This memo provides information for the Internet community. This memo
+ does not specify an Internet standard of any kind. Distribution of
+ this memo is unlimited.
+
+Abstract
+
+ This document specifies a protocol for performing encapsulation of an
+ arbitrary network layer protocol over another arbitrary network layer
+ protocol.
+
+Introduction
+
+ A number of different proposals [RFC 1234, RFC 1226] currently exist
+ for the encapsulation of one protocol over another protocol. Other
+ types of encapsulations [RFC 1241, SDRP, RFC 1479] have been proposed
+ for transporting IP over IP for policy purposes. This memo describes
+ a protocol which is very similar to, but is more general than, the
+ above proposals. In attempting to be more general, many protocol
+ specific nuances have been ignored. The result is that this proposal
+ is may be less suitable for a situation where a specific "X over Y"
+ encapsulation has been described. It is the attempt of this protocol
+ to provide a simple, general purpose mechanism which is reduces the
+ problem of encapsulation from its current O(n^2) problem to a more
+ manageable state. This proposal also attempts to provide a
+ lightweight encapsulation for use in policy based routing. This memo
+ explicitly does not address the issue of when a packet should be
+ encapsulated. This memo acknowledges, but does not address problems
+ with mutual encapsulation [RFC 1326].
+
+ In the most general case, a system has a packet that needs to be
+ encapsulated and routed. We will call this the payload packet. The
+ payload is first encapsulated in a GRE packet, which possibly also
+ includes a route. The resulting GRE packet can then be encapsulated
+ in some other protocol and then forwarded. We will call this outer
+
+
+
+Hanks, Li, Farinacci & Traina [Page 1]
+
+RFC 1701 Generic Routing Encapsulation (GRE) October 1994
+
+
+ protocol the delivery protocol. The algorithms for processing this
+ packet are discussed later.
+
+Overall packet
+
+ The entire encapsulated packet would then have the form:
+
+ ---------------------------------
+ | |
+ | Delivery Header |
+ | |
+ ---------------------------------
+ | |
+ | GRE Header |
+ | |
+ ---------------------------------
+ | |
+ | Payload packet |
+ | |
+ ---------------------------------
+
+Packet header
+
+ The GRE packet header has the form:
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |C|R|K|S|s|Recur| Flags | Ver | Protocol Type |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Checksum (optional) | Offset (optional) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key (optional) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number (optional) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Routing (optional)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Flags and version (2 octets)
+
+ The GRE flags are encoded in the first two octets. Bit 0 is the
+ most significant bit, bit 15 is the least significant bit. Bits
+ 13 through 15 are reserved for the Version field. Bits 5 through
+ 12 are reserved for future use and MUST be transmitted as zero.
+
+
+
+
+
+
+Hanks, Li, Farinacci & Traina [Page 2]
+
+RFC 1701 Generic Routing Encapsulation (GRE) October 1994
+
+
+ Checksum Present (bit 0)
+
+ If the Checksum Present bit is set to 1, then the Checksum field
+ is present and contains valid information.
+
+ If either the Checksum Present bit or the Routing Present bit are
+ set, BOTH the Checksum and Offset fields are present in the GRE
+ packet.
+
+ Routing Present (bit 1)
+
+ If the Routing Present bit is set to 1, then it indicates that the
+ Offset and Routing fields are present and contain valid
+ information.
+
+ If either the Checksum Present bit or the Routing Present bit are
+ set, BOTH the Checksum and Offset fields are present in the GRE
+ packet.
+
+ Key Present (bit 2)
+
+ If the Key Present bit is set to 1, then it indicates that the Key
+ field is present in the GRE header. Otherwise, the Key field is
+ not present in the GRE header.
+
+ Sequence Number Present (bit 3)
+
+ If the Sequence Number Present bit is set to 1, then it indicates
+ that the Sequence Number field is present. Otherwise, the
+ Sequence Number field is not present in the GRE header.
+
+ Strict Source Route (bit 4)
+
+ The meaning of the Strict Source route bit is defined in other
+ documents. It is recommended that this bit only be set to 1 if
+ all of the the Routing Information consists of Strict Source
+ Routes.
+
+ Recursion Control (bits 5-7)
+
+ Recursion control contains a three bit unsigned integer which
+ contains the number of additional encapsulations which are
+ permissible. This SHOULD default to zero.
+
+ Version Number (bits 13-15)
+
+ The Version Number field MUST contain the value 0. Other values
+ are outside of the scope of this document.
+
+
+
+Hanks, Li, Farinacci & Traina [Page 3]
+
+RFC 1701 Generic Routing Encapsulation (GRE) October 1994
+
+
+ Protocol Type (2 octets)
+
+ The Protocol Type field contains the protocol type of the payload
+ packet. In general, the value will be the Ethernet protocol type
+ field for the packet. Currently defined protocol types are listed
+ below. Additional values may be defined in other documents.
+
+ Offset (2 octets)
+
+ The offset field indicates the octet offset from the start of the
+ Routing field to the first octet of the active Source Route Entry
+ to be examined. This field is present if the Routing Present or
+ the Checksum Present bit is set to 1, and contains valid
+ information only if the Routing Present bit is set to 1.
+
+ Checksum (2 octets)
+
+ The Checksum field contains the IP (one's complement) checksum of
+ the GRE header and the payload packet. This field is present if
+ the Routing Present or the Checksum Present bit is set to 1, and
+ contains valid information only if the Checksum Present bit is set
+ to 1.
+
+ Key (4 octets)
+
+ The Key field contains a four octet number which was inserted by
+ the encapsulator. It may be used by the receiver to authenticate
+ the source of the packet. The techniques for determining
+ authenticity are outside of the scope of this document. The Key
+ field is only present if the Key Present field is set to 1.
+
+ Sequence Number (4 octets)
+
+ The Sequence Number field contains an unsigned 32 bit integer
+ which is inserted by the encapsulator. It may be used by the
+ receiver to establish the order in which packets have been
+ transmitted from the encapsulator to the receiver. The exact
+ algorithms for the generation of the Sequence Number and the
+ semantics of their reception is outside of the scope of this
+ document.
+
+ Routing (variable)
+
+ The Routing field is optional and is present only if the Routing
+ Present bit is set to 1.
+
+
+
+
+
+
+Hanks, Li, Farinacci & Traina [Page 4]
+
+RFC 1701 Generic Routing Encapsulation (GRE) October 1994
+
+
+ The Routing field is a list of Source Route Entries (SREs). Each
+ SRE has the form:
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Address Family | SRE Offset | SRE Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Routing Information ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ The routing field is terminated with a "NULL" SRE containing an
+ address family of type 0x0000 and a length of 0.
+
+ Address Family (2 octets)
+
+ The Address Family field contains a two octet value which indicates
+ the syntax and semantics of the Routing Information field. The
+ values for this field and the corresponding syntax and semantics for
+ Routing Information are defined in other documents.
+
+ SRE Offset (1 octet)
+
+ The SRE Offset field indicates the octet offset from the start of the
+ Routing Information field to the first octet of the active entry in
+ Source Route Entry to be examined.
+
+ SRE Length (1 octet)
+
+ The SRE Length field contains the number of octets in the SRE. If
+ the SRE Length is 0, this indicates this is the last SRE in the
+ Routing field.
+
+ Routing Information (variable)
+
+ The Routing Information field contains data which may be used in
+ routing this packet. The exact semantics of this field is defined in
+ other documents.
+
+Forwarding of GRE packets
+
+ Normally, a system which is forwarding delivery layer packets will
+ not differentiate GRE packets from other packets in any way.
+ However, a GRE packet may be received by a system. In this case, the
+ system should use some delivery-specific means to determine that this
+ is a GRE packet. Once this is determined, the Key, Sequence Number
+ and Checksum fields if they contain valid information as indicated by
+ the corresponding flags may be checked. If the Routing Present bit
+
+
+
+Hanks, Li, Farinacci & Traina [Page 5]
+
+RFC 1701 Generic Routing Encapsulation (GRE) October 1994
+
+
+ is set to 1, then the Address Family field should be checked to
+ determine the semantics and use of the SRE Length, SRE Offset and
+ Routing Information fields. The exact semantics for processing a SRE
+ for each Address Family is defined in other documents.
+
+ Once all SREs have been processed, then the source route is complete,
+ the GRE header should be removed, the payload's TTL MUST be
+ decremented (if one exists) and the payload packet should be
+ forwarded as a normal packet. The exact forwarding method depends on
+ the Protocol Type field.
+
+Current List of Protocol Types
+
+ The following are currently assigned protocol types for GRE. Future
+ protocol types must be taken from DIX ethernet encoding. For
+ historical reasons, a number of other values have been used for some
+ protocols. The following table of values MUST be used to identify
+ the following protocols:
+
+ Protocol Family PTYPE
+ --------------- -----
+ Reserved 0000
+ SNA 0004
+ OSI network layer 00FE
+ PUP 0200
+ XNS 0600
+ IP 0800
+ Chaos 0804
+ RFC 826 ARP 0806
+ Frame Relay ARP 0808
+ VINES 0BAD
+ VINES Echo 0BAE
+ VINES Loopback 0BAF
+ DECnet (Phase IV) 6003
+ Transparent Ethernet Bridging 6558
+ Raw Frame Relay 6559
+ Apollo Domain 8019
+ Ethertalk (Appletalk) 809B
+ Novell IPX 8137
+ RFC 1144 TCP/IP compression 876B
+ IP Autonomous Systems 876C
+ Secure Data 876D
+ Reserved FFFF
+
+ See the IANA list of Ether Types for the complete list of these
+ values.
+
+ URL = ftp://ftp.isi.edu/in-notes/iana/assignments/ethernet-numbers.
+
+
+
+Hanks, Li, Farinacci & Traina [Page 6]
+
+RFC 1701 Generic Routing Encapsulation (GRE) October 1994
+
+
+References
+
+ RFC 1479
+ Steenstrup, M. "Inter-Domain Policy Routing Protocol
+ Specification: Version 1", RFC1479, BBN Systems and Technologies,
+ July 1993.
+
+ RFC 1226
+ Kantor, B. "Internet Protocol Encapsulation of AX.25 Frames", RFC
+ 1226, University of California, San Diego, May 1991.
+
+ RFC 1234
+ Provan, D. "Tunneling IPX Traffic through IP Networks", RFC 1234,
+ Novell, Inc., June 1991.
+
+ RFC 1241
+ Woodburn, R., and D. Mills, "Scheme for an Internet Encapsulation
+ Protocol: Version 1", RFC 1241, SAIC, University of Delaware, July
+ 1991.
+
+ RFC 1326
+ Tsuchiya, P., "Mutual Encapsulation Considered Dangerous", RFC
+ 1326, Bellcore, May 1992.
+
+ SDRP
+ Estrin, D., Li, T., and Y. Rekhter, "Source Demand Routing
+ Protocol Specification (Version 1)", Work in Progress.
+
+ RFC 1702
+ Hanks, S., Li, T., Farinacci, D., and P. Traina, "Generic Routing
+ Encapsulation over IPv4 networks", RFC 1702, NetSmiths, Ltd.,
+ cisco Systems, October 1994.
+
+Security Considerations
+
+ Security issues are not discussed in this memo.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hanks, Li, Farinacci & Traina [Page 7]
+
+RFC 1701 Generic Routing Encapsulation (GRE) October 1994
+
+
+Acknowledgements
+
+ The authors would like to acknowledge Yakov Rekhter (IBM) and Deborah
+ Estrin (USC) for their advice, encouragement and insightful comments.
+
+Authors' Addresses
+
+ Stan Hanks
+ NetSmiths, Ltd.
+ 2025 Lincoln Highway
+ Edison NJ, 08817
+
+ EMail: stan@netsmiths.com
+
+
+ Tony Li
+ cisco Systems, Inc.
+ 1525 O'Brien Drive
+ Menlo Park, CA 94025
+
+ EMail: tli@cisco.com
+
+
+ Dino Farinacci
+ cisco Systems, Inc.
+ 1525 O'Brien Drive
+ Menlo Park, CA 94025
+
+ EMail: dino@cisco.com
+
+
+ Paul Traina
+ cisco Systems, Inc.
+ 1525 O'Brien Drive
+ Menlo Park, CA 94025
+
+ EMail: pst@cisco.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hanks, Li, Farinacci & Traina [Page 8]
+
diff --git a/rfc/rfc1702.txt b/rfc/rfc1702.txt
new file mode 100644
index 0000000..50b57ae
--- /dev/null
+++ b/rfc/rfc1702.txt
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+Network Working Group S. Hanks
+Request for Comments: 1702 NetSmiths, Ltd.
+Category: Informational T. Li
+ D. Farinacci
+ P. Traina
+ cisco Systems
+ October 1994
+
+
+ Generic Routing Encapsulation over IPv4 networks
+
+Status of this Memo
+
+ This memo provides information for the Internet community. This memo
+ does not specify an Internet standard of any kind. Distribution of
+ this memo is unlimited.
+
+Introduction
+
+ In an earlier memo [RFC 1701], we described GRE, a mechanism for
+ encapsulating arbitrary packets within an arbitrary transport
+ protocol. This is a companion memo which describes the use of GRE
+ with IP. This memo addresses the case of using IP as the delivery
+ protocol or the payload protocol and the special case of IP as both
+ the delivery and payload. This memo also describes using IP
+ addresses and autonomous system numbers as part of a GRE source
+ route.
+
+IP as a delivery protocol
+
+ GRE packets which are encapsulated within IP will use IP protocol
+ type 47.
+
+IP as a payload protocol
+
+ IP packets will be encapsulated with a Protocol Type field of 0x800.
+
+ For the Address Family value of 0x800, the Routing Information field
+ will consist of a list of IP addresses and indicates an IP source
+ route. The first octet of the Routing Information field constitute a
+ 8 bit integer offset from the start of the Source Route Entry (SRE),
+ called the SRE Offset. The SRE Offset indicates the first octet of
+ the next IP address. The SRE Length field consists of the total
+ length of the IP Address List in octets.
+
+
+
+
+
+
+
+Hanks, Li, Farinacci & Traina [Page 1]
+
+RFC 1702 GRE over IPv4 networks October 1994
+
+
+ This has the form:
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Address Family | SRE Offset | SRE Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | IP Address List ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ For the Address Family value of 0xfffe, the Routing Information field
+ will consist of a list of Autonomous System numbers and indicates an
+ AS source route. The third octet of the Routing Information field
+ contains an 8 bit unsigned integer offset from the start of the
+ Source Route Entry (SRE), called the SRE Offset. The SRE Offset
+ indicates the first octet of the next AS number. THe SRE Length
+ field consists of the total length of the AS Number list in octets.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Address Family | SRE Offset | SRE Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | AS Number List ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+IP as both delivery and payload protocol
+
+ When IP is encapsulated in IP, the TTL, TOS, and IP security options
+ MAY be copied from the payload packet into the same fields in the
+ delivery packet. The payload packet's TTL MUST be decremented when
+ the packet is decapsulated to insure that no packet lives forever.
+
+IP source routes
+
+ When a system is processing a SRE with an Address Family indicating
+ an IP source route, it MUST use the SRE Offset to determine the next
+ destination IP address. If the next IP destination is this system,
+ the SRE Offset field should be increased by four (the size of an IP
+ address). If the SRE Offset is equal to the SRE Length in this SRE,
+ then the Offset field in the GRE header should be adjusted to point
+ to the next SRE (if any). This should be repeated until the next IP
+ destination is not this system or until the entire SRE has been
+ processed.
+
+ If the source route is incomplete, then the Strict Source Route bit
+ is checked. If the source route is a strict source route and the
+ next IP destination is NOT an adjacent system, the packet MUST be
+
+
+
+Hanks, Li, Farinacci & Traina [Page 2]
+
+RFC 1702 GRE over IPv4 networks October 1994
+
+
+ dropped. Otherwise, the system should use the IP address indicated
+ by the Offset field to replace the destination address in the
+ delivery header and forward the packet.
+
+Autonomous system source routes
+
+ When a system is processing a SRE with an Address Family indicating
+ an AS source route, it MUST use the SRE Offset field to determine the
+ next autonomous system. If the next autonomous system is the local
+ autonomous system, the SRE Offset field should be increased by two
+ (the size of an autonomous system number). If the SRE Offset is
+ equal to the SRE Length in this SRE, then the Offset field in the GRE
+ header should be adjusted to point to the next SRE (if any). This
+ should be repeated until the next autonomous system number is not
+ equal to the local autonomous system number or until the entire SRE
+ has been processed.
+
+ If the source route is incomplete, then the Strict Source Route bit
+ is checked. If the source route is a strict source route and the
+ next autonomous system is NOT an adjacent autonomous system, the
+ packet should be dropped. Otherwise, the system should use the
+ autonomous system number indicated by the SRE Offset field to replace
+ the destination address in the delivery header and forward the
+ packet. The exact mechanism for determining the next delivery
+ destination address given the AS number is outside of the scope of
+ this document.
+
+Security Considerations
+
+ Security issues are not discussed in this memo.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Hanks, Li, Farinacci & Traina [Page 3]
+
+RFC 1702 GRE over IPv4 networks October 1994
+
+
+Authors' Addresses
+
+ Stan Hanks
+ NetSmiths, Ltd.
+ 2025 Lincoln Highway
+ Edison, NJ 08817
+
+ EMail: stan@netsmiths.com
+
+
+ Tony Li
+ cisco Systems, Inc.
+ 1525 O'Brien Drive
+ Menlo Park, CA 94025
+
+ EMail: tli@cisco.com
+
+
+ Dino Farinacci
+ cisco Systems, Inc.
+ 1525 O'Brien Drive
+ Menlo Park, CA 94025
+
+ EMail: dino@cisco.com
+
+
+ Paul Traina
+ cisco Systems, Inc.
+ 1525 O'Brien Drive
+ Menlo Park, CA 94025
+
+ EMail: pst@cisco.com
+
+References
+
+ RFC 1701
+ Hanks, S., Li, T, Farinacci, D., and P. Traina, "Generic Routing
+ Encapsulation", RFC 1701, NetSmiths, Ltd., and cisco Systems,
+ October 1994.
+
+
+
+
+
+
+
+
+
+
+
+
+Hanks, Li, Farinacci & Traina [Page 4]
+
diff --git a/doc/rfc1877.txt b/rfc/rfc1877.txt
index 843c15c..843c15c 100644
--- a/doc/rfc1877.txt
+++ b/rfc/rfc1877.txt
diff --git a/doc/rfc1962.txt b/rfc/rfc1962.txt
index fc9b47d..fc9b47d 100644
--- a/doc/rfc1962.txt
+++ b/rfc/rfc1962.txt
diff --git a/doc/rfc1979.txt b/rfc/rfc1979.txt
index 7a95cd3..7a95cd3 100644
--- a/doc/rfc1979.txt
+++ b/rfc/rfc1979.txt
diff --git a/rfc/rfc1990.txt b/rfc/rfc1990.txt
new file mode 100644
index 0000000..a4f7ffe
--- /dev/null
+++ b/rfc/rfc1990.txt
@@ -0,0 +1,1347 @@
+
+
+
+
+
+
+Network Working Group K. Sklower
+Request for Comments: 1990 University of California, Berkeley
+Obsoletes: 1717 B. Lloyd
+Category: Standards Track G. McGregor
+ Lloyd Internetworking
+ D. Carr
+ Newbridge Networks Corporation
+ T. Coradetti
+ Sidewalk Software
+ August 1996
+
+
+ The PPP Multilink Protocol (MP)
+
+
+Status of this Memo
+
+ This document specifies an Internet standards track protocol for the
+ Internet community, and requests discussion and suggestions for
+ improvements. Please refer to the current edition of the "Internet
+ Official Protocol Standards" (STD 1) for the standardization state
+ and status of this protocol. Distribution of this memo is unlimited.
+
+Abstract
+
+ This document proposes a method for splitting, recombining and
+ sequencing datagrams across multiple logical data links. This work
+ was originally motivated by the desire to exploit multiple bearer
+ channels in ISDN, but is equally applicable to any situation in which
+ multiple PPP links connect two systems, including async links. This
+ is accomplished by means of new PPP [2] options and protocols.
+
+ The differences between the current PPP Multilink specification (RFC
+ 1717) and this memo are explained in Section 11. Any system
+ implementing the additional restrictions required by this memo will
+ be backwards compatible with conforming RFC 1717 implementations.
+
+Acknowledgements
+
+ The authors specifically wish to thank Fred Baker of ACC, Craig Fox
+ of Network Systems, Gerry Meyer of Spider Systems, Dan Brennan of
+ Penril Datability Networks, Vernon Schryver of SGI (for the
+ comprehensive discussion of padding), and the members of the IP over
+ Large Public Data Networks and PPP Extensions working groups, for
+ much useful discussion on the subject.
+
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 1]
+
+RFC 1990 PPP Multilink August 1996
+
+
+Table of Contents
+
+ 1. Introduction ................................................ 2
+ 1.1. Motivation ................................................ 2
+ 1.2. Functional Description .................................... 3
+ 1.3. Conventions ............................................... 4
+ 2. General Overview ............................................ 4
+ 3. Packet Formats .............................................. 7
+ 3.1. Padding Considerations .................................... 10
+ 4. Trading Buffer Space Against Fragment Loss .................. 10
+ 4.1. Detecting Fragment Loss ................................... 11
+ 4.2. Buffer Space Requirements ................................. 12
+ 5. PPP Link Control Protocol Extensions ........................ 13
+ 5.1. Configuration Option Types ................................ 13
+ 5.1.1. Multilink MRRU LCP option ............................... 14
+ 5.1.2. Short Sequence Number Header Format Option .............. 15
+ 5.1.3. Endpoint Discriminator Option ........................... 15
+ 6. Initiating use of Multilink Headers ......................... 19
+ 7. Closing Member links ........................................ 20
+ 8. Interaction with Other Protocols ............................ 20
+ 9. Security Considerations ..................................... 21
+ 10. References ................................................. 21
+ 11. Differences from RFC 1717 .................................. 22
+ 11.1. Negotiating Multilink, per se ............................ 22
+ 11.2. Initial Sequence Number defined .......................... 22
+ 11.3. Default Value of the MRRU ................................ 22
+ 11.4. Config-Nak of EID prohibited ............................. 22
+ 11.5. Uniformity of Sequence Space ............................. 22
+ 11.6. Commencing and Abating use of Multilink Headers .......... 23
+ 11.7. Manual Configuration and Bundle Assignment ............... 23
+ 12. Authors' Addresses ......................................... 24
+
+1. Introduction
+
+1.1. Motivation
+
+ Basic Rate and Primary Rate ISDN both offer the possibility of
+ opening multiple simultaneous channels between systems, giving users
+ additional bandwidth on demand (for additional cost). Previous
+ proposals for the transmission of internet protocols over ISDN have
+ stated as a goal the ability to make use of this capability, (e.g.,
+ Leifer et al., [1]).
+
+ There are proposals being advanced for providing synchronization
+ between multiple streams at the bit level (the BONDING proposals);
+ such features are not as yet widely deployed, and may require
+ additional hardware for end system. Thus, it may be useful to have a
+ purely software solution, or at least an interim measure.
+
+
+
+Sklower, et. al. Standards Track [Page 2]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ There are other instances where bandwidth on demand can be exploited,
+ such as using a dialup async line at 28,800 baud to back up a leased
+ synchronous line, or opening additional X.25 SVCs where the window
+ size is limited to two by international agreement.
+
+ The simplest possible algorithms of alternating packets between
+ channels on a space available basis (which might be called the Bank
+ Teller's algorithm) may have undesirable side effects due to
+ reordering of packets.
+
+ By means of a four-byte sequencing header, and simple synchronization
+ rules, one can split packets among parallel virtual circuits between
+ systems in such a way that packets do not become reordered, or at
+ least the likelihood of this is greatly reduced.
+
+1.2. Functional Description
+
+ The method discussed here is similar to the multilink protocol
+ described in ISO 7776 [4], but offers the additional ability to split
+ and recombine packets, thereby reducing latency, and potentially
+ increase the effective maximum receive unit (MRU). Furthermore,
+ there is no requirement here for acknowledged-mode operation on the
+ link layer, although that is optionally permitted.
+
+ Multilink is based on an LCP option negotiation that permits a system
+ to indicate to its peer that it is capable of combining multiple
+ physical links into a "bundle". Only under exceptional conditions
+ would a given pair of systems require the operation of more than one
+ bundle connecting them.
+
+ Multilink is negotiated during the initial LCP option negotiation. A
+ system indicates to its peer that it is willing to do multilink by
+ sending the multilink option as part of the initial LCP option
+ negotiation. This negotiation indicates three things:
+
+ 1. The system offering the option is capable of combining multiple
+ physical links into one logical link;
+
+ 2. The system is capable of receiving upper layer protocol data
+ units (PDU) fragmented using the multilink header (described
+ later) and reassembling the fragments back into the original PDU
+ for processing;
+
+ 3. The system is capable of receiving PDUs of size N octets where N
+ is specified as part of the option even if N is larger than the
+ maximum receive unit (MRU) for a single physical link.
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 3]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ Once multilink has been successfully negotiated, the sending system
+ is free to send PDUs encapsulated and/or fragmented with the
+ multilink header.
+
+1.3. Conventions
+
+ The following language conventions are used in the items of
+ specification in this document:
+
+ o MUST, SHALL or MANDATORY -- the item is an absolute requirement
+ of the specification.
+
+ o SHOULD or RECOMMENDED -- the item should generally be followed
+ for all but exceptional circumstances.
+
+ o MAY or OPTIONAL -- the item is truly optional and may be
+ followed or ignored according to the needs of the implementor.
+
+2. General Overview
+
+ In order to establish communications over a point-to-point link, each
+ end of the PPP link must first send LCP packets to configure the data
+ link during Link Establishment phase. After the link has been
+ established, PPP provides for an Authentication phase in which the
+ authentication protocols can be used to determine identifiers
+ associated with each system connected by the link.
+
+ The goal of multilink operation is to coordinate multiple independent
+ links between a fixed pair of systems, providing a virtual link with
+ greater bandwidth than any of the constituent members. The aggregate
+ link, or bundle, is named by the pair of identifiers for two systems
+ connected by the multiple links. A system identifier may include
+ information provided by PPP Authentication [3] and information
+ provided by LCP negotiation. The bundled links can be different
+ physical links, as in multiple async lines, but may also be instances
+ of multiplexed links, such as ISDN, X.25 or Frame Relay. The links
+ may also be of different kinds, such as pairing dialup async links
+ with leased synchronous links.
+
+ We suggest that multilink operation can be modeled as a virtual PPP
+ link-layer entity wherein packets received over different physical
+ link-layer entities are identified as belonging to a separate PPP
+ network protocol (the Multilink Protocol, or MP) and recombined and
+ sequenced according to information present in a multilink
+ fragmentation header. All packets received over links identified as
+ belonging to the multilink arrangement are presented to the same
+ network-layer protocol processing machine, whether they have
+ multilink headers or not.
+
+
+
+Sklower, et. al. Standards Track [Page 4]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ The packets to be transmitted using the multilink procedure are
+ encapsulated according to the rules for PPP where the following
+ options would have been manually configured:
+
+ o No async control character Map
+ o No Magic Number
+ o No Link Quality Monitoring
+ o Address and Control Field Compression
+ o Protocol Field Compression
+ o No Compound Frames
+ o No Self-Describing-Padding
+
+ According to the rules specified in RFC1661, this means that an
+ implementation MUST accept reassembled packets with and without
+ leading zeroes present in the Protocol Field of the reassembled
+ packet. Although it is explicitly forbidden below to include the
+ Address and Control fields (usually, the two bytes FF 03) in the
+ material to be fragmented, it is a good defensive programming
+ practice to accept the packet anyway, ignoring the two bytes if
+ present, as that is what RFC1661 specifies.
+
+ As a courtesy to implementations that perform better when certain
+ alignment obtains, it is suggested that a determination be made when
+ a bundle is created on whether to transmit leading zeroes by
+ examining whether PFC has been negotiated on the first link admitted
+ into a bundle. This determination should be kept in force so long as
+ a bundle persists.
+
+ Of course, individual links are permitted to have different settings
+ for these options. As described below, member links SHOULD negotiate
+ Self-Describing-Padding, even though pre-fragmented packets MUST NOT
+ be padded. Since the Protocol Field Compression mode on the member
+ link allows a sending system to include a leading byte of zero or not
+ at its discretion, this is an alternative mechanism for generating
+ even-length packets.
+
+ LCP negotiations are not permitted on the bundle itself. An
+ implementation MUST NOT transmit LCP Configure-Request, -Reject,
+ -Ack, -Nak, Terminate-Request or -Ack packets via the multilink
+ procedure, and an implementation receiving them MUST silently discard
+ them. (By "silently discard" we mean to not generate any PPP packets
+ in response; an implementation is free to generate a log entry
+ registering the reception of the unexpected packet). By contrast,
+ other LCP packets having control functions not associated with
+ changing the defaults for the bundle itself are permitted. An
+ implementation MAY transmit LCP Code-Reject, Protocol-Reject, Echo-
+ Request, Echo-Reply and Discard-Request Packets.
+
+
+
+
+Sklower, et. al. Standards Track [Page 5]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ The effective MRU for the logical-link entity is negotiated via an
+ LCP option. It is irrelevant whether Network Control Protocol
+ packets are encapsulated in multilink headers or not, or even over
+ which link they are sent, once that link identifies itself as
+ belonging to a multilink arrangement.
+
+ Note that network protocols that are not sent using multilink headers
+ cannot be sequenced. (And consequently will be delivered in any
+ convenient way).
+
+ For example, consider the case in Figure 1. Link 1 has negotiated
+ network layers NL 1, NL 2, and MP between two systems. The two
+ systems then negotiate MP over Link 2.
+
+ Frames received on link 1 are demultiplexed at the data link layer
+ according the PPP network protocol identifier and can be sent to NL
+ 1, NL 2, or MP. Link 2 will accept frames with all network protocol
+ identifiers that Link 1 does.
+
+ Frames received by MP are further demultiplexed at the network layer
+ according to the PPP network protocol identifier and sent to NL 1 or
+ NL 2. Any frames received by MP for any other network layer
+ protocols are rejected using the normal protocol reject mechanism.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 6]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ Figure 1. Multilink Overview.
+
+ Network Layer
+ -------------
+ ______ ______
+ / \ / \
+ | NL 1 | | NL 2 |
+ \______/ \______/
+ | | | | | |
+ | | +-------------o-o-o-+
+ | +------+ +-----+ | | |
+ | | | | | |
+ | +------o--o-------+ + |
+ | | |__|_ | |
+ | | / \ | |
+ | | | MLCP | <--- Link Layer
+ | | \______/ Demultiplexing
+ | | | | |
+ | | | | |
+ | | | <--- Virtual Link
+ | | | | |
+ | | | | |
+ | | | | |
+ | | + | |
+ ___|_| | ___|_|
+ / \ | / \
+ | LCP |------+-----| LCP | <--- Link Layer
+ \______/ \______/ Demultiplexing
+ | |
+ | |
+ Link 1 Link 2
+
+3. Packet Formats
+
+ In this section we describe the layout of individual fragments, which
+ are the "packets" in the Multilink Protocol. Network Protocol
+ packets are first encapsulated (but not framed) according to normal
+ PPP procedures, and large packets are broken up into multiple
+ segments sized appropriately for the multiple physical links.
+ Although it would otherwise be permitted by the PPP spec,
+ implementations MUST NOT include the Address and Control Field in the
+ logical entity to be fragmented. A new PPP header consisting of the
+ Multilink Protocol Identifier, and the Multilink header is inserted
+ before each section. (Thus the first fragment of a multilink packet
+ in PPP will have two headers, one for the fragment, followed by the
+ header for the packet itself).
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 7]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ Systems implementing the multilink procedure are not required to
+ fragment small packets. There is also no requirement that the
+ segments be of equal sizes, or that packets must be broken up at all.
+ A possible strategy for contending with member links of differing
+ transmission rates would be to divide the packets into segments
+ proportion to the transmission rates. Another strategy might be to
+ divide them into many equal fragments and distribute multiple
+ fragments per link, the numbers being proportional to the relative
+ speeds of the links.
+
+ PPP multilink fragments are encapsulated using the protocol
+ identifier 0x00-0x3d. Following the protocol identifier is a four
+ byte header containing a sequence number, and two one bit fields
+ indicating that the fragment begins a packet or terminates a packet.
+ After negotiation of an additional PPP LCP option, the four byte
+ header may be optionally replaced by a two byte header with only a 12
+ bit sequence space. Address & Control and Protocol ID compression
+ are assumed to be in effect. Individual fragments will, therefore,
+ have the following format:
+
+ Figure 2: Long Sequence Number Fragment Format.
+
+
+ +---------------+---------------+
+ PPP Header: | Address 0xff | Control 0x03 |
+ +---------------+---------------+
+ | PID(H) 0x00 | PID(L) 0x3d |
+ +-+-+-+-+-+-+-+-+---------------+
+ MP Header: |B|E|0|0|0|0|0|0|sequence number|
+ +-+-+-+-+-+-+-+-+---------------+
+ | sequence number (L) |
+ +---------------+---------------+
+ | fragment data |
+ | . |
+ | . |
+ | . |
+ +---------------+---------------+
+ PPP FCS: | FCS |
+ +---------------+---------------+
+
+
+
+
+
+
+
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 8]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ Figure 3: Short Sequence Number Fragment Format.
+
+
+ +---------------+---------------+
+ PPP Header: | Address 0xff | Control 0x03 |
+ +---------------+---------------+
+ | PID(H) 0x00 | PID(L) 0x3d |
+ +-+-+-+-+-------+---------------+
+ MP Header: |B|E|0|0| sequence number |
+ +-+-+-+-+-------+---------------+
+ | fragment data |
+ | . |
+ | . |
+ | . |
+ +---------------+---------------+
+ PPP FCS: | FCS |
+ +---------------+---------------+
+
+ The (B)eginning fragment bit is a one bit field set to 1 on the first
+ fragment derived from a PPP packet and set to 0 for all other
+ fragments from the same PPP packet.
+
+ The (E)nding fragment bit is a one bit field set to 1 on the last
+ fragment and set to 0 for all other fragments. A fragment may have
+ both the (B)eginning and (E)nding fragment bits set to 1.
+
+ The sequence field is a 24 bit or 12 bit number that is incremented
+ for every fragment transmitted. By default, the sequence field is 24
+ bits long, but can be negotiated to be only 12 bits with an LCP
+ configuration option described below.
+
+ Between the (E)nding fragment bit and the sequence number is a
+ reserved field, whose use is not currently defined, which MUST be set
+ to zero. It is 2 bits long when the use of short sequence numbers
+ has been negotiated, 6 bits otherwise.
+
+ In this multilink protocol, a single reassembly structure is
+ associated with the bundle. The multilink headers are interpreted in
+ the context of this structure.
+
+ The FCS field shown in the diagram is inherited from the normal
+ framing mechanism from the member link on which the packet is
+ transmitted. There is no separate FCS applied to the reconstituted
+ packet as a whole if transmitted in more than one fragment.
+
+
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 9]
+
+RFC 1990 PPP Multilink August 1996
+
+
+3.1. Padding Considerations
+
+ Systems that support the multilink protocol SHOULD implement Self-
+ Describing-Padding. A system that implements self-describing-padding
+ by definition will either include the padding option in its initial
+ LCP Configure-Requests, or (to avoid the delay of a Configure-Reject)
+ include the padding option after receiving a NAK containing the
+ option.
+
+ A system that must pad its own transmissions but does not use Self-
+ Describing-Padding when not using multilink, MAY continue to not use
+ Self-Describing-Padding if it ensures by careful choice of fragment
+ lengths that only (E)nding fragments of packets are padded. A system
+ MUST NOT add padding to any packet that cannot be recognized as
+ padded by the peer. Non-terminal fragments MUST NOT be padded with
+ trailing material by any other method than Self-Describing-Padding.
+
+ A system MUST ensure that Self-Describing-Padding as described in RFC
+ 1570 [11] is negotiated on the individual link before transmitting
+ any multilink data packets if it might pad non-terminal fragments or
+ if it would use network or compression protocols that are vulnerable
+ to padding, as described in RFC 1570. If necessary, the system that
+ adds padding MUST use LCP Configure-NAK's to elicit a Configure-
+ Request for Self-Describing-Padding from the peer.
+
+ Note that LCP Configure-Requests can be sent at any time on any link,
+ and that the peer will always respond with a Configure-Request of its
+ own. A system that pads its transmissions but uses no protocols
+ other than multilink that are vulnerable to padding MAY delay
+ ensuring that the peer has Configure-Requested Self-Describing-
+ Padding until it seems desireable to negotiate the use of Multilink
+ itself. This permits the interoperability of a system that pads with
+ older peers that support neither Multilink nor Self-Describing-
+ Padding.
+
+4. Trading Buffer Space Against Fragment Loss
+
+ In a multilink procedure one channel may be delayed with respect to
+ the other channels in the bundle. This can lead to fragments being
+ received out of order, thus increasing the difficulty in detecting
+ the loss of a fragment. The task of estimating the amount of space
+ required for buffering on the receiver becomes more complex because
+ of this. In this section we discuss a technique for declaring that a
+ fragment is lost, with the intent of minimizing the buffer space
+ required, yet minimizing the number of avoidable packet losses.
+
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 10]
+
+RFC 1990 PPP Multilink August 1996
+
+
+4.1. Detecting Fragment Loss
+
+ On each member link in a bundle, the sender MUST transmit fragments
+ with strictly increasing sequence numbers (modulo the size of the
+ sequence space). This requirement supports a strategy for the
+ receiver to detect lost fragments based on comparing sequence
+ numbers. The sequence number is not reset upon each new PPP packet,
+ and a sequence number is consumed even for those fragments which
+ contain an entire PPP packet, i.e., one in which both the (B)eginning
+ and (E)nding bits are set.
+
+ An implementation MUST set the sequence number of the first fragment
+ transmited on a newly-constructed bundle to zero. (Joining a
+ secondary link to an exisiting bundle is invisible to the protocol,
+ and an implementation MUST NOT reset the sequence number space in
+ this situation).
+
+ The receiver keeps track of the incoming sequence numbers on each
+ link in a bundle and maintains the current minimum of the most
+ recently received sequence number over all the member links in the
+ bundle (call this M). The receiver detects the end of a packet when
+ it receives a fragment bearing the (E)nding bit. Reassembly of the
+ packet is complete if all sequence numbers up to that fragment have
+ been received.
+
+ A lost fragment is detected when M advances past the sequence number
+ of a fragment bearing an (E)nding bit of a packet which has not been
+ completely reassembled (i.e., not all the sequence numbers between
+ the fragment bearing the (B)eginning bit and the fragment bearing the
+ (E)nding bit have been received). This is because of the increasing
+ sequence number rule over the bundle. Any sequence number so
+ detected is assumed to correspond to a fragment which has been lost.
+
+ An implementation MUST assume that if a fragment bears a (B)eginning
+ bit, that the previously numbered fragment bore an (E)nding bit.
+ Thus if a packet is lost bearing the (E)nding bit, and the packet
+ whose fragment number is M contains a (B)eginning bit, the
+ implementation MUST discard fragments for all unassembled packets
+ through M-1, but SHOULD NOT discard the fragment bearing the new
+ (B)eginning bit on this basis alone.
+
+ The detection of a lost fragment, whose sequence number was deduced
+ to be U, causes the receiver to discard all fragments up to the
+ lowest numbered fragment with an ending bit (possibly deduced)
+ greater than or equal to U. However, the quantity M may jump into
+ the middle of a chain of packets which can be successful completed.
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 11]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ Fragments may be lost due to corruption of individual packets or
+ catastrophic loss of the link (which may occur only in one
+ direction). This version of the multilink protocol mandates no
+ specific procedures for the detection of failed links. The PPP link
+ quality management facility, or the periodic issuance of LCP echo-
+ requests could be used to achieve this.
+
+ Senders SHOULD avoid keeping any member links idle to maximize early
+ detection of lost fragments by the receiver, since the value of M is
+ not incremented on idle links. Senders SHOULD rotate traffic among
+ the member links if there isn't sufficient traffic to overflow the
+ capacity of one link to avoid idle links.
+
+ Loss of the final fragment of a transmission can cause the receiver
+ to stall until new packets arrive. The likelihood of this may be
+ decreased by sending a null fragment on each member link in a bundle
+ that would otherwise become idle immediately after having transmitted
+ a fragment bearing the (E)nding bit, where a null fragment is one
+ consisting only of a multilink header bearing both the (B)egin and
+ (E)nding bits (i.e., having no payload). Implementations concerned
+ about either wasting bandwidth or per packet costs are not required
+ to send null fragments and may elect to defer sending them until a
+ timer expires, with the marginally increased possibility of lengthier
+ stalls in the receiver. The receiver SHOULD implement some type of
+ link idle timer to guard against indefinite stalls.
+
+ The increasing sequence per link rule prohibits the reallocation of
+ fragments queued up behind a failing link to a working one, a
+ practice which is not unusual for implementations of ISO multilink
+ over LAPB [4].
+
+4.2. Buffer Space Requirements
+
+ There is no amount of buffering that will guarantee correct detection
+ of fragment loss, since an adversarial peer may withhold a fragment
+ on one channel and send arbitrary amounts on the others. For the
+ usual case where all channels are transmitting, you can show that
+ there is a minimum amount below which you could not correctly detect
+ packet loss. The amount depends on the relative delay between the
+ channels, (D[channel-i,channel-j]), the data rate of each channel,
+ R[c], the maximum fragment size permitted on each channel, F[c], and
+ the total amount of buffering the transmitter has allocated amongst
+ the channels.
+
+ When using PPP, the delay between channels could be estimated by
+ using LCP echo request and echo reply packets. (In the case of links
+ of different transmission rates, the round trip times should be
+ adjusted to take this into account.) The slippage for each channel
+
+
+
+Sklower, et. al. Standards Track [Page 12]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ is defined as the bandwidth times the delay for that channel relative
+ to the channel with the longest delay, S[c] = R[c] * D[c,c-worst].
+ (S[c-worst] will be zero, of course!)
+
+ A situation which would exacerbate sequence number skew would be one
+ in which there is extremely bursty traffic (almost allowing all
+ channels to drain), and then where the transmitter would first queue
+ up as many consecutively numbered packets on one link as it could,
+ then queue up the next batch on a second link, and so on. Since
+ transmitters must be able to buffer at least a maximum- sized
+ fragment for each link (and will usually buffer up at least two) A
+ receiver that allocates any less than S[1] + S[2] + ... + S[N] + F[1]
+ + ... + F[N], will be at risk for incorrectly assuming packet loss,
+ and therefore, SHOULD allocate at least twice that.
+
+5. PPP Link Control Protocol Extensions
+
+ If reliable multilink operation is desired, PPP Reliable Transmission
+ [6] (essentially the use of ISO LAPB) MUST be negotiated prior to the
+ use of the Multilink Protocol on each member link.
+
+ Whether or not reliable delivery is employed over member links, an
+ implementation MUST present a signal to the NCP's running over the
+ multilink arrangement that a loss has occurred.
+
+ Compression may be used separately on each member link, or run over
+ the bundle (as a logical group link). The use of multiple
+ compression streams under the bundle (i.e., on each link separately)
+ is indicated by running the Compression Control Protocol [5] but with
+ an alternative PPP protocol ID.
+
+5.1. Configuration Option Types
+
+ The Multilink Protocol introduces the use of additional LCP
+ Configuration Options:
+
+ o Multilink Maximum Received Reconstructed Unit
+ o Multilink Short Sequence Number Header Format
+ o Endpoint Discriminator
+
+
+
+
+
+
+
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 13]
+
+RFC 1990 PPP Multilink August 1996
+
+
+5.1.1. Multilink MRRU LCP option
+
+ Figure 4: Multilink MRRU LCP option
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type = 17 | Length = 4 | Max-Receive-Reconstructed-Unit|
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ The presence of this LCP option indicates that the system sending it
+ implements the PPP Multilink Protocol. If not rejected, the system
+ will construe all packets received on this link as being able to be
+ processed by a common protocol machine with any other packets
+ received from the same peer on any other link on which this option
+ has been accepted.
+
+ The Max-Receive-Reconstructed unit field is two octets, and specifies
+ the maximum number of octets in the Information fields of reassembled
+ packets. A system MUST be able to receive the full 1500 octet
+ Information field of any reassembled PPP packet although it MAY
+ attempt to negotiate a smaller, or larger value. The number 1500
+ here comes from the specification for the MRU LCP option in PPP; if
+ this requirement is changed in a future version of RFC 1661, the same
+ rules will apply here.
+
+ A system MUST include the LCP MRRU option in every LCP negotiation
+ intended to instantiate a bundle or to join an existing bundle. If
+ the LCP MRRU option is offered on a link which is intended to join an
+ existing bundle, a system MUST offer the same Max-Receive-
+ Reconstruct-Unit value previously negotiated for the bundle.
+
+ A system MUST NOT send any multilink packets on any link unless its
+ peer has offered the MMRU LCP option and the system has configure-
+ Ack'ed it during the most recent LCP negotiation on that link. A
+ system MAY include the MMRU LCP option in a configure-NAK, if its
+ peer has not offered it (until, according to PPP rules, the peer
+ configure-Reject's it).
+
+ Note: the MRRU value conveyed im this option corresponds to the MRU
+ of the bundle when conceptualized as a PPP entity; but the rules for
+ the Multilink MRRU option are different from the LCP MRU option, as
+ some value MUST be offered in every LCP negotiation, and that
+ confirmation of this option is required prior to multilink
+ interpretation.
+
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 14]
+
+RFC 1990 PPP Multilink August 1996
+
+
+5.1.2. Short Sequence Number Header Format Option
+
+ Figure 5: Short Sequence Number Header Format Option
+
+ 0 1
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type = 18 | Length = 2 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ This option advises the peer that the implementation wishes to
+ receive fragments with short, 12 bit sequence numbers. When a peer
+ system configure-Ack's this option, it MUST transmit all multilink
+ packets on all links of the bundle with 12 bit sequence numbers or
+ configure-Reject the option. If 12 bit sequence numbers are desired,
+ this option MUST be negotiated when the bundle is instantiated, and
+ MUST be explicitly included in every LCP configure request offered by
+ a system when the system intends to include that link in an existing
+ bundle using 12 bit sequence numbers. If this option is never
+ negotiated during the life of a bundle, sequence numbers are 24 bits
+ long.
+
+ An implementation wishing to transmit multilink fragments with short
+ sequence numbers MAY include the multilink short sequence number in a
+ configure-NAK to ask that the peer respond with a request to receive
+ short sequence numbers. The peer is not compelled to respond with
+ the option.
+
+5.1.3. Endpoint Discriminator Option
+
+ Figure 7: Endpoint Discriminator Option
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type = 19 | Length | Class | Address ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ The Endpoint Discriminator Option represents identification of the
+ system transmitting the packet. This option advises a system that
+ the peer on this link could be the same as the peer on another
+ existing link. If the option distinguishes this peer from all
+ others, a new bundle MUST be established from the link being
+ negotiated. If this option matches the class and address of some
+ other peer of an existing link, the new link MUST be joined to the
+ bundle containing the link to the matching peer or MUST establish a
+ new bundle, depending on the decision tree shown in (1) through (4)
+ below.
+
+
+
+Sklower, et. al. Standards Track [Page 15]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ To securely join an existing bundle, a PPP authentication protocol
+ [3] must be used to obtain authenticated information from the peer to
+ prevent a hostile peer from joining an existing bundle by presenting
+ a falsified discriminator option.
+
+ This option is not required for multilink operation. If a system
+ does not receive the Multilink MRRU option, but does receive the
+ Endpoint Discriminator Option, and there is no manual configuration
+ providing outside information, the implementation MUST NOT assume
+ that multilink operation is being requested on this basis alone.
+
+ As there is also no requirement for authentication, there are four
+ sets of scenarios:
+
+ (1) No authentication, no discriminator:
+ All new links MUST be joined to one bundle, unless
+ there is manual configuration to the contrary.
+ It is also permissible to have more than one manually
+ configured bundle connecting two given systems.
+
+ (2) Discriminator, no authentication:
+ Discriminator match -> MUST join matching bundle,
+ discriminator mismatch -> MUST establish new bundle.
+
+ (3) No discriminator, authentication:
+ Authenticated match -> MUST join matching bundle,
+ authenticated mismatch -> MUST establish new bundle.
+
+ (4) Discriminator, authentication:
+ Discriminator match and authenticated match -> MUST join bundle,
+ discriminator mismatch -> MUST establish new bundle,
+ authenticated mismatch -> MUST establish new bundle.
+
+ The option contains a Class which selects an identifier address space
+ and an Address which selects a unique identifier within the class
+ address space.
+
+ This identifier is expected to refer to the mechanical equipment
+ associated with the transmitting system. For some classes,
+ uniqueness of the identifier is global and is not bounded by the
+ scope of a particular administrative domain. Within each class,
+ uniqueness of address values is controlled by a class dependent
+ policy for assigning values.
+
+ Each endpoint may chose an identifier class without restriction.
+ Since the objective is to detect mismatches between endpoints
+ erroneously assumed to be alike, mismatch on class alone is
+ sufficient. Although no one class is recommended, classes which have
+
+
+
+Sklower, et. al. Standards Track [Page 16]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ universally unique values are preferred.
+
+ This option is not required to be supported either by the system or
+ the peer. If the option is not present in a Configure-Request, the
+ system MUST NOT generate a Configure-Nak of this option for any
+ reason; instead it SHOULD behave as if it had received the option
+ with Class = 0, Address = 0. If a system receives a Configure-Nak or
+ Configure-Reject of this option, it MUST remove it from any
+ additional Configure-Request.
+
+ The size is determined from the Length field of the element. For
+ some classes, the length is fixed, for others the length is variable.
+ The option is invalid if the Length field indicates a size below the
+ minimum for the class.
+
+ An implementation MAY use the Endpoint Discriminator to locate
+ administration or authentication records in a local database. Such
+ use of this option is incidental to its purpose and is deprecated
+ when a PPP Authentication protocol [3] can be used instead. Since
+ some classes permit the peer to generate random or locally assigned
+ address values, use of this option as a database key requires prior
+ agreement between peer administrators.
+
+ The specification of the subfields are:
+
+ Type
+ 19 = for Endpoint Discriminator
+
+ Length
+ 3 + length of Address
+
+ Class
+ The Class field is one octet and indicates the identifier
+ address space. The most up-to-date values of the LCP Endpoint
+ Discriminator Class field are specified in the most recent
+ "Assigned Numbers" RFC [7]. Current values are assigned as
+ follows:
+
+ 0 Null Class
+
+ 1 Locally Assigned Address
+
+ 2 Internet Protocol (IP) Address
+
+ 3 IEEE 802.1 Globally Assigned MAC Address
+
+ 4 PPP Magic-Number Block
+
+
+
+
+Sklower, et. al. Standards Track [Page 17]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ 5 Public Switched Network Directory Number
+
+ Address
+ The Address field is one or more octets and indicates the
+ identifier address within the selected class. The length and
+ content depend on the value of the Class as follows:
+
+ Class 0 - Null Class
+
+ Maximum Length: 0
+
+ Content:
+ This class is the default value if the option is not
+ present in a received Configure-Request.
+
+ Class 1 - Locally Assigned Address
+
+ Maximum Length: 20
+
+ Content:
+
+ This class is defined to permit a local assignment in the
+ case where use of one of the globally unique classes is not
+ possible. Use of a device serial number is suggested. The
+ use of this class is deprecated since uniqueness is not
+ guaranteed.
+
+ Class 2 - Internet Protocol (IP) Address
+
+ Fixed Length: 4
+
+ Content:
+
+ An address in this class contains an IP host address as
+ defined in [8].
+
+ Class 3 - IEEE 802.1 Globally Assigned MAC Address
+
+ Fixed Length: 6
+
+ Content:
+
+ An address in this class contains an IEEE 802.1 MAC address
+ in canonical (802.3) format [9]. The address MUST have the
+ global/local assignment bit clear and MUST have the
+ multicast/specific bit clear. Locally assigned MAC
+ addresses should be represented using Class 1.
+
+
+
+
+Sklower, et. al. Standards Track [Page 18]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ Class 4 - PPP Magic-Number Block
+
+ Maximum Length: 20
+
+ Content:
+
+ This is not an address but a block of 1 to 5 concatenated
+ 32 bit PPP Magic-Numbers as defined in [2]. This class
+ provides for automatic generation of a value likely but not
+ guaranteed to be unique. The same block MUST be used by an
+ endpoint continuously during any period in which at least
+ one link is in the LCP Open state. The use of this class
+ is deprecated.
+
+ Note that PPP Magic-Numbers are used in [2] to detect
+ unexpected loopbacks of a link from an endpoint to itself.
+ There is a small probability that two distinct endpoints
+ will generate matching magic-numbers. This probability is
+ geometrically reduced when the LCP negotiation is repeated
+ in search of the desired mismatch, if a peer can generate
+ uncorrelated magic-numbers.
+
+ As used here, magic-numbers are used to determine if two
+ links are in fact from the same peer endpoint or from two
+ distinct endpoints. The numbers always match when there is
+ one endpoint. There is a small probability that the
+ numbers will match even if there are two endpoints. To
+ achieve the same confidence that there is not a false match
+ as for LCP loopback detection, several uncorrelated magic-
+ numbers can be combined in one block.
+
+ Class 5 - Public Switched Network Directory Number
+
+ Maximum Length: 15
+
+ Content:
+
+ An address in this class contains an octet sequence as
+ defined by I.331 (E.164) representing an international
+ telephone directory number suitable for use to access the
+ endpoint via the public switched telephone network [10].
+
+6. Initiating use of Multilink Headers
+
+ When the use of the Multilink protocol has been negotiated on a link
+ (say Y), and the link is being added to a bundle which currently
+ contains a single existing link (say X), a system MUST transmit a
+ Multilink-encapsulated packet on X before transmitting any Multilink-
+
+
+
+Sklower, et. al. Standards Track [Page 19]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ encapsulated packets on Y.
+
+ Since links may be added and removed from a bundle without destroying
+ the state associated with it, the fragment should be assigned the
+ appropriate (next) fragment number. As noted earlier, the first
+ fragment transmitted in the life of a bundle is assigned fragment
+ number 0.
+
+7. Closing Member links
+
+ Member links may be terminated according to normal PPP LCP procedures
+ using LCP Terminate-Request and Terminate-Ack packets on that member
+ link. Since it is assumed that member links usually do not reorder
+ packets, receipt of a terminate ack is sufficient to assume that any
+ multilink protocol packets ahead of it are at no special risk of
+ loss.
+
+ Receipt of an LCP Terminate-Request on one link does not conclude the
+ procedure on the remaining links.
+
+ So long as any member links in the bundle are active, the PPP state
+ for the bundle persists as a separate entity. However, if the there
+ is a unique link in the bundle, and all the other links were closed
+ gracefully (with Terminate-Ack), an implementation MAY cease using
+ multilink
+ headers.
+
+ If the multilink procedure is used in conjunction with PPP reliable
+ transmission, and a member link is not closed gracefully, the
+ implementation should expect to receive packets which violate the
+ increasing sequence number rule.
+
+8. Interaction with Other Protocols
+
+ In the common case, LCP, and the Authentication Control Protocol
+ would be negotiated over each member link. The Network Protocols
+ themselves and associated control exchanges would normally have been
+ conducted once, on the bundle.
+
+ In some instances it may be desirable for some Network Protocols to
+ be exempted from sequencing requirements, and if the MRU sizes of the
+ link did not cause fragmentation, those protocols could be sent
+ directly over the member links.
+
+ Although explicitly discouraged above, if there were several member
+ links connecting two implementations, and independent sequencing of
+ two protocol sets were desired, but blocking of one by the other was
+ not, one could describe two multilink procedures by assigning
+
+
+
+Sklower, et. al. Standards Track [Page 20]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ multiple endpoint identifiers to a given system. Each member link,
+ however, would only belong to one bundle. One could think of a
+ physical router as housing two logically separate implementations,
+ each of which is independently configured.
+
+ A simpler solution would be to have one link refuse to join the
+ bundle, by sending a Configure-Reject in response to the Multilink
+ LCP option.
+
+9. Security Considerations
+
+ Operation of this protocol is no more and no less secure than
+ operation of the PPP authentication protocols [3]. The reader is
+ directed there for further discussion.
+
+10. References
+
+ [1] Leifer, D., Sheldon, S., and B. Gorsline, "A Subnetwork Control
+ Protocol for ISDN Circuit-Switching", University of Michigan
+ (unpublished), March 1991.
+
+ [2] Simpson, W., Editor, "The Point-to-Point Protocol (PPP)", STD 51,
+ RFC 1661, Daydreamer, July 1994.
+
+ [3] Lloyd, B., and W. Simpson, "PPP Authentication Protocols", RFC
+ 1334, Lloyd Internetworking, Daydreamer, October 1992.
+
+ [4] International Organisation for Standardization, "HDLC -
+ Description of the X.25 LAPB-Compatible DTE Data Link
+ Procedures", International Standard 7776, 1988
+
+ [5] Rand, D., "The PPP Compression Control Protocol (CCP)", PPP
+ Extensions Working Group, RFC 1962, June 1996.
+
+ [6] Rand, D., "PPP Reliable Transmission", RFC 1663, Novell, July
+ 1994
+
+ [7] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC 1700,
+ USC/Information Sciences Institute, October 1994.
+
+ [8] Postel, J., Editor, "Internet Protocol - DARPA Internet Program
+ Protocol Specification", STD 5, RFC 791, USC/Information Sciences
+ Institute, September 1981.
+
+ [9] Institute of Electrical and Electronics Engineers, Inc., "IEEE
+ Local and Metropolitan Area Networks: Overview and Architecture",
+ IEEE Std. 802-1990, 1990.
+
+
+
+
+Sklower, et. al. Standards Track [Page 21]
+
+RFC 1990 PPP Multilink August 1996
+
+
+ [10] The International Telegraph and Telephone Consultative Committee
+ (CCITT), "Numbering Plan for the ISDN Area", Recommendation I.331
+ (E.164), 1988.
+
+ [11] Simpson, W., Editor, "PPP LCP Extensions", RFC 1570, Daydreamer,
+ January 1994.
+
+11. Differences from RFC 1717
+
+ This section documents differences from RFC 1717. There are
+ restrictions placed on implementations that were absent in RFC 1717;
+ systems obeying these restrictions are fully interoperable with RFC
+ 1717 - compliant systems.
+
+11.1. Negotiating Multilink, per se
+
+ RFC 1717 permitted either the use of the Short Sequence Number Header
+ Format (SSNHF) or the Maximum Reconstructed Receive Unit (MRRU)
+ options by themselves to indicate the intent to negotiate multilink.
+ This specification forbids the use of the SSNHF option by itself; but
+ does permit the specific of both options together. Any
+ implementation which otherwise conforms to rfc1717 and also obeys
+ this restriction will interoperate with any RFC 1717 implementation.
+
+11.2. Initial Sequence Number defined
+
+ This specification requires that the first sequence number
+ transmitted after the virtual link has reached to open state be 0.
+
+11.3. Default Value of the MRRU
+
+ This specfication removes the default value for the MRRU, (since it
+ must always be negotiated with some value), and specifies that an
+ implementation must be support an MRRU with same value as the default
+ MRU size for PPP.
+
+11.4. Config-Nak of EID prohibited
+
+ This specification forbids the config-Naking of an EID for any
+ reason.
+
+11.5. Uniformity of Sequence Space
+
+ This specification requires that the same sequence format be employed
+ on all links in a bundle.
+
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 22]
+
+RFC 1990 PPP Multilink August 1996
+
+
+11.6. Commencing and Abating use of Multilink Headers
+
+ This memo specifies how one should start the use of Multilink Headers
+ when a link is added, and under what circumstances it is safe to
+ discontinue their use.
+
+11.7. Manual Configuration and Bundle Assignment
+
+ The document explicitly permits multiple bundles to be manually
+ configured in the absence of both the Endpoint Descriminator and any
+ form of authentication.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Sklower, et. al. Standards Track [Page 23]
+
+RFC 1990 PPP Multilink August 1996
+
+
+13. Authors' Addresses
+
+ Keith Sklower
+ Computer Science Department
+ 384 Soda Hall, Mail Stop 1776
+ University of California
+ Berkeley, CA 94720-1776
+
+ Phone: (510) 642-9587
+ EMail: sklower@CS.Berkeley.EDU
+
+
+ Brian Lloyd
+ Lloyd Internetworking
+ 3031 Alhambra Drive
+ Cameron Park, CA 95682
+
+ Phone: (916) 676-1147
+ EMail: brian@lloyd.com
+
+
+ Glenn McGregor
+ Lloyd Internetworking
+ 3031 Alhambra Drive
+ Cameron Park, CA 95682
+
+ Phone: (916) 676-1147
+ EMail: glenn@lloyd.com
+
+
+ Dave Carr
+ Newbridge Networks Corporation
+ 600 March Road
+ P.O. Box 13600
+ Kanata, Ontario,
+ Canada, K2K 2E6
+
+ Phone: (613) 591-3600
+ EMail: dcarr@Newbridge.COM
+
+
+ Tom Coradetti
+ Sidewalk Software
+ 1190 Josephine Road
+ Roseville, MN 55113
+
+ Phone: (612) 490 7856
+ EMail: 70761.1664@compuserve.com
+
+
+
+Sklower, et. al. Standards Track [Page 24]
+
diff --git a/doc/rfc1994.txt b/rfc/rfc1994.txt
index e4a553e..e4a553e 100644
--- a/doc/rfc1994.txt
+++ b/rfc/rfc1994.txt
diff --git a/rfc/rfc2138.txt b/rfc/rfc2138.txt
new file mode 100644
index 0000000..9f4a86d
--- /dev/null
+++ b/rfc/rfc2138.txt
@@ -0,0 +1,3643 @@
+
+
+
+
+
+
+Network Working Group C. Rigney
+Request for Comments: 2138 Livingston
+Obsoletes: 2058 A. Rubens
+Category: Standards Track Merit
+ W. Simpson
+ Daydreamer
+ S. Willens
+ Livingston
+ April 1997
+
+
+ Remote Authentication Dial In User Service (RADIUS)
+
+Status of this Memo
+
+ This document specifies an Internet standards track protocol for the
+ Internet community, and requests discussion and suggestions for
+ improvements. Please refer to the current edition of the "Internet
+ Official Protocol Standards" (STD 1) for the standardization state
+ and status of this protocol. Distribution of this memo is unlimited.
+
+Abstract
+
+ This document describes a protocol for carrying authentication,
+ authorization, and configuration information between a Network Access
+ Server which desires to authenticate its links and a shared
+ Authentication Server.
+
+Implementation Note
+
+ This memo documents the RADIUS protocol. There has been some
+ confusion in the assignment of port numbers for this protocol. The
+ early deployment of RADIUS was done using the erroneously chosen port
+ number 1645, which conflicts with the "datametrics" service. The
+ officially assigned port number for RADIUS is 1812.
+
+Table of Contents
+
+ 1. Introduction .......................................... 3
+ 1.1 Specification of Requirements ................... 4
+ 1.2 Terminology ..................................... 5
+ 2. Operation ............................................. 5
+ 2.1 Challenge/Response .............................. 7
+ 2.2 Interoperation with PAP and CHAP ................ 7
+ 2.3 Why UDP? ........................................ 8
+ 3. Packet Format ......................................... 10
+ 4. Packet Types .......................................... 13
+ 4.1 Access-Request .................................. 13
+
+
+
+Rigney, et. al. Standards Track [Page 1]
+
+RFC 2138 RADIUS April 1997
+
+
+ 4.2 Access-Accept ................................... 14
+ 4.3 Access-Reject ................................... 15
+ 4.4 Access-Challenge ................................ 17
+ 5. Attributes ............................................ 18
+ 5.1 User-Name ....................................... 21
+ 5.2 User-Password ................................... 22
+ 5.3 CHAP-Password ................................... 23
+ 5.4 NAS-IP-Address .................................. 24
+ 5.5 NAS-Port ........................................ 25
+ 5.6 Service-Type .................................... 26
+ 5.7 Framed-Protocol ................................. 28
+ 5.8 Framed-IP-Address ............................... 29
+ 5.9 Framed-IP-Netmask ............................... 29
+ 5.10 Framed-Routing .................................. 30
+ 5.11 Filter-Id ....................................... 31
+ 5.12 Framed-MTU ...................................... 32
+ 5.13 Framed-Compression .............................. 33
+ 5.14 Login-IP-Host ................................... 33
+ 5.15 Login-Service ................................... 34
+ 5.16 Login-TCP-Port .................................. 35
+ 5.17 (unassigned) .................................... 36
+ 5.18 Reply-Message ................................... 36
+ 5.19 Callback-Number ................................. 37
+ 5.20 Callback-Id ..................................... 38
+ 5.21 (unassigned) .................................... 38
+ 5.22 Framed-Route .................................... 39
+ 5.23 Framed-IPX-Network .............................. 40
+ 5.24 State ........................................... 40
+ 5.25 Class ........................................... 41
+ 5.26 Vendor-Specific ................................. 42
+ 5.27 Session-Timeout ................................. 44
+ 5.28 Idle-Timeout .................................... 44
+ 5.29 Termination-Action .............................. 45
+ 5.30 Called-Station-Id ............................... 46
+ 5.31 Calling-Station-Id .............................. 47
+ 5.32 NAS-Identifier .................................. 48
+ 5.33 Proxy-State ..................................... 48
+ 5.34 Login-LAT-Service ............................... 49
+ 5.35 Login-LAT-Node .................................. 50
+ 5.36 Login-LAT-Group ................................. 51
+ 5.37 Framed-AppleTalk-Link ........................... 52
+ 5.38 Framed-AppleTalk-Network ........................ 53
+ 5.39 Framed-AppleTalk-Zone ........................... 54
+ 5.40 CHAP-Challenge .................................. 55
+ 5.41 NAS-Port-Type ................................... 55
+ 5.42 Port-Limit ...................................... 56
+ 5.43 Login-LAT-Port .................................. 57
+ 5.44 Table of Attributes ............................. 58
+
+
+
+Rigney, et. al. Standards Track [Page 2]
+
+RFC 2138 RADIUS April 1997
+
+
+ 6. Examples .............................................. 59
+ 6.1 User Telnet to Specified Host ................... 60
+ 6.2 Framed User Authenticating with CHAP ............ 60
+ 6.3 User with Challenge-Response card ............... 61
+ Security Considerations ...................................... 63
+ References ................................................... 64
+ Acknowledgements ............................................. 64
+ Chair's Address .............................................. 65
+ Author's Addresses ........................................... 65
+
+1. Introduction
+
+ Managing dispersed serial line and modem pools for large numbers of
+ users can create the need for significant administrative support.
+ Since modem pools are by definition a link to the outside world, they
+ require careful attention to security, authorization and accounting.
+ This can be best achieved by managing a single "database" of users,
+ which allows for authentication (verifying user name and password) as
+ well as configuration information detailing the type of service to
+ deliver to the user (for example, SLIP, PPP, telnet, rlogin).
+
+ Key features of RADIUS are:
+
+ Client/Server Model
+
+ A Network Access Server (NAS) operates as a client of RADIUS. The
+ client is responsible for passing user information to designated
+ RADIUS servers, and then acting on the response which is returned.
+
+ RADIUS servers are responsible for receiving user connection
+ requests, authenticating the user, and then returning all
+ configuration information necessary for the client to deliver
+ service to the user.
+
+ A RADIUS server can act as a proxy client to other RADIUS servers
+ or other kinds of authentication servers.
+
+ Network Security
+
+ Transactions between the client and RADIUS server are
+ authenticated through the use of a shared secret, which is never
+ sent over the network. In addition, any user passwords are sent
+ encrypted between the client and RADIUS server, to eliminate the
+ possibility that someone snooping on an unsecure network could
+ determine a user's password.
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 3]
+
+RFC 2138 RADIUS April 1997
+
+
+ Flexible Authentication Mechanisms
+
+ The RADIUS server can support a variety of methods to authenticate
+ a user. When it is provided with the user name and original
+ password given by the user, it can support PPP PAP or CHAP, UNIX
+ login, and other authentication mechanisms.
+
+ Extensible Protocol
+
+ All transactions are comprised of variable length Attribute-
+ Length-Value 3-tuples. New attribute values can be added without
+ disturbing existing implementations of the protocol.
+
+1.1. Specification of Requirements
+
+ In this document, several words are used to signify the requirements
+ of the specification. These words are often capitalized.
+
+ MUST This word, or the adjective "required", means that the
+ definition is an absolute requirement of the specification.
+
+ MUST NOT This phrase means that the definition is an absolute
+ prohibition of the specification.
+
+ SHOULD This word, or the adjective "recommended", means that there
+ may exist valid reasons in particular circumstances to
+ ignore this item, but the full implications must be
+ understood and carefully weighed before choosing a
+ different course.
+
+ MAY This word, or the adjective "optional", means that this
+ item is one of an allowed set of alternatives. An
+ implementation which does not include this option MUST be
+ prepared to interoperate with another implementation which
+ does include the option.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 4]
+
+RFC 2138 RADIUS April 1997
+
+
+1.2. Terminology
+
+ This document frequently uses the following terms:
+
+ service The NAS provides a service to the dial-in user, such as PPP
+ or Telnet.
+
+ session Each service provided by the NAS to a dial-in user
+ constitutes a session, with the beginning of the session
+ defined as the point where service is first provided and
+ the end of the session defined as the point where service
+ is ended. A user may have multiple sessions in parallel or
+ series if the NAS supports that.
+
+ silently discard
+ This means the implementation discards the packet without
+ further processing. The implementation SHOULD provide the
+ capability of logging the error, including the contents of
+ the silently discarded packet, and SHOULD record the event
+ in a statistics counter.
+
+2. Operation
+
+ When a client is configured to use RADIUS, any user of the client
+ presents authentication information to the client. This might be
+ with a customizable login prompt, where the user is expected to enter
+ their username and password. Alternatively, the user might use a
+ link framing protocol such as the Point-to-Point Protocol (PPP),
+ which has authentication packets which carry this information.
+
+ Once the client has obtained such information, it may choose to
+ authenticate using RADIUS. To do so, the client creates an "Access-
+ Request" containing such Attributes as the user's name, the user's
+ password, the ID of the client and the Port ID which the user is
+ accessing. When a password is present, it is hidden using a method
+ based on the RSA Message Digest Algorithm MD5 [1].
+
+ The Access-Request is submitted to the RADIUS server via the network.
+ If no response is returned within a length of time, the request is
+ re-sent a number of times. The client can also forward requests to
+ an alternate server or servers in the event that the primary server
+ is down or unreachable. An alternate server can be used either after
+ a number of tries to the primary server fail, or in a round-robin
+ fashion. Retry and fallback algorithms are the topic of current
+ research and are not specified in detail in this document.
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 5]
+
+RFC 2138 RADIUS April 1997
+
+
+ Once the RADIUS server receives the request, it validates the sending
+ client. A request from a client for which the RADIUS server does not
+ have a shared secret should be silently discarded. If the client is
+ valid, the RADIUS server consults a database of users to find the
+ user whose name matches the request. The user entry in the database
+ contains a list of requirements which must be met to allow access for
+ the user. This always includes verification of the password, but can
+ also specify the client(s) or port(s) to which the user is allowed
+ access.
+
+ The RADIUS server MAY make requests of other servers in order to
+ satisfy the request, in which case it acts as a client.
+
+ If any condition is not met, the RADIUS server sends an "Access-
+ Reject" response indicating that this user request is invalid. If
+ desired, the server MAY include a text message in the Access-Reject
+ which MAY be displayed by the client to the user. No other
+ Attributes are permitted in an Access-Reject.
+
+ If all conditions are met and the RADIUS server wishes to issue a
+ challenge to which the user must respond, the RADIUS server sends an
+ "Access-Challenge" response. It MAY include a text message to be
+ displayed by the client to the user prompting for a response to the
+ challenge, and MAY include a State attribute. If the client receives
+ an Access-Challenge and supports challenge/response it MAY display
+ the text message, if any, to the user, and then prompt the user for a
+ response. The client then re-submits its original Access-Request
+ with a new request ID, with the User-Password Attribute replaced by
+ the response (encrypted), and including the State Attribute from the
+ Access-Challenge, if any. Only 0 or 1 instances of the State
+ Attributes should be present in a request. The server can respond to
+ this new Access-Request with either an Access-Accept, an Access-
+ Reject, or another Access-Challenge.
+
+ If all conditions are met, the list of configuration values for the
+ user are placed into an "Access-Accept" response. These values
+ include the type of service (for example: SLIP, PPP, Login User) and
+ all necessary values to deliver the desired service. For SLIP and
+ PPP, this may include values such as IP address, subnet mask, MTU,
+ desired compression, and desired packet filter identifiers. For
+ character mode users, this may include values such as desired
+ protocol and host.
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 6]
+
+RFC 2138 RADIUS April 1997
+
+
+2.1. Challenge/Response
+
+ In challenge/response authentication, the user is given an
+ unpredictable number and challenged to encrypt it and give back the
+ result. Authorized users are equipped with special devices such as
+ smart cards or software that facilitate calculation of the correct
+ response with ease. Unauthorized users, lacking the appropriate
+ device or software and lacking knowledge of the secret key necessary
+ to emulate such a device or software, can only guess at the response.
+
+ The Access-Challenge packet typically contains a Reply-Message
+ including a challenge to be displayed to the user, such as a numeric
+ value unlikely ever to be repeated. Typically this is obtained from
+ an external server that knows what type of authenticator should be in
+ the possession of the authorized user and can therefore choose a
+ random or non-repeating pseudorandom number of an appropriate radix
+ and length.
+
+ The user then enters the challenge into his device (or software) and
+ it calculates a response, which the user enters into the client which
+ forwards it to the RADIUS server via a second Access-Request. If the
+ response matches the expected response the RADIUS server replies with
+ an Access-Accept, otherwise an Access-Reject.
+
+ Example: The NAS sends an Access-Request packet to the RADIUS Server
+ with NAS-Identifier, NAS-Port, User-Name, User-Password (which may
+ just be a fixed string like "challenge" or ignored). The server
+ sends back an Access-Challenge packet with State and a Reply-Message
+ along the lines of "Challenge 12345678, enter your response at the
+ prompt" which the NAS displays. The NAS prompts for the response and
+ sends a NEW Access-Request to the server (with a new ID) with NAS-
+ Identifier, NAS-Port, User-Name, User-Password (the response just
+ entered by the user, encrypted), and the same State Attribute that
+ came with the Access-Challenge. The server then sends back either an
+ Access-Accept or Access-Reject based on whether the response matches
+ what it should be, or it can even send another Access-Challenge.
+
+2.2. Interoperation with PAP and CHAP
+
+ For PAP, the NAS takes the PAP ID and password and sends them in an
+ Access-Request packet as the User-Name and User-Password. The NAS MAY
+ include the Attributes Service-Type = Framed-User and Framed-Protocol
+ = PPP as a hint to the RADIUS server that PPP service is expected.
+
+ For CHAP, the NAS generates a random challenge (preferably 16 octets)
+ and sends it to the user, who returns a CHAP response along with a
+ CHAP ID and CHAP username. The NAS then sends an Access-Request
+ packet to the RADIUS server with the CHAP username as the User-Name
+
+
+
+Rigney, et. al. Standards Track [Page 7]
+
+RFC 2138 RADIUS April 1997
+
+
+ and with the CHAP ID and CHAP response as the CHAP-Password
+ (Attribute 3). The random challenge can either be included in the
+ CHAP-Challenge attribute or, if it is 16 octets long, it can be
+ placed in the Request Authenticator field of the Access-Request
+ packet. The NAS MAY include the Attributes Service-Type = Framed-
+ User and Framed-Protocol = PPP as a hint to the RADIUS server that
+ PPP service is expected.
+
+ The RADIUS server looks up a password based on the User-Name,
+ encrypts the challenge using MD5 on the CHAP ID octet, that password,
+ and the CHAP challenge (from the CHAP-Challenge attribute if present,
+ otherwise from the Request Authenticator), and compares that result
+ to the CHAP-Password. If they match, the server sends back an
+ Access-Accept, otherwise it sends back an Access-Reject.
+
+ If the RADIUS server is unable to perform the requested
+ authentication it should return an Access-Reject. For example, CHAP
+ requires that the user's password be available in cleartext to the
+ server so that it can encrypt the CHAP challenge and compare that to
+ the CHAP response. If the password is not available in cleartext to
+ the RADIUS server then the server MUST send an Access-Reject to the
+ client.
+
+2.3. Why UDP?
+
+ A frequently asked question is why RADIUS uses UDP instead of TCP as
+ a transport protocol. UDP was chosen for strictly technical reasons.
+
+ There are a number of issues which must be understood. RADIUS is a
+ transaction based protocol which has several interesting
+ characteristics:
+
+ 1. If the request to a primary Authentication server fails, a
+ secondary server must be queried.
+
+ To meet this requirement, a copy of the request must be kept
+ above the transport layer to allow for alternate transmission.
+ This means that retransmission timers are still required.
+
+ 2. The timing requirements of this particular protocol are
+ significantly different than TCP provides.
+
+ At one extreme, RADIUS does not require a "responsive"
+ detection of lost data. The user is willing to wait several
+ seconds for the authentication to complete. The generally
+ aggressive TCP retransmission (based on average round trip
+ time) is not required, nor is the acknowledgement overhead of
+ TCP.
+
+
+
+Rigney, et. al. Standards Track [Page 8]
+
+RFC 2138 RADIUS April 1997
+
+
+ At the other extreme, the user is not willing to wait several
+ minutes for authentication. Therefore the reliable delivery of
+ TCP data two minutes later is not useful. The faster use of an
+ alternate server allows the user to gain access before giving
+ up.
+
+ 3. The stateless nature of this protocol simplifies the use of UDP.
+
+ Clients and servers come and go. Systems are rebooted, or are
+ power cycled independently. Generally this does not cause a
+ problem and with creative timeouts and detection of lost TCP
+ connections, code can be written to handle anomalous events.
+ UDP however completely eliminates any of this special handling.
+ Each client and server can open their UDP transport just once
+ and leave it open through all types of failure events on the
+ network.
+
+ 4. UDP simplifies the server implementation.
+
+ In the earliest implementations of RADIUS, the server was
+ single threaded. This means that a single request was
+ received, processed, and returned. This was found to be
+ unmanageable in environments where the back-end security
+ mechanism took real time (1 or more seconds). The server
+ request queue would fill and in environments where hundreds of
+ people were being authenticated every minute, the request
+ turn-around time increased to longer that users were willing to
+ wait (this was especially severe when a specific lookup in a
+ database or over DNS took 30 or more seconds). The obvious
+ solution was to make the server multi-threaded. Achieving this
+ was simple with UDP. Separate processes were spawned to serve
+ each request and these processes could respond directly to the
+ client NAS with a simple UDP packet to the original transport
+ of the client.
+
+ It's not all a panacea. As noted, using UDP requires one thing
+ which is built into TCP: with UDP we must artificially manage
+ retransmission timers to the same server, although they don't
+ require the same attention to timing provided by TCP. This one
+ penalty is a small price to pay for the advantages of UDP in
+ this protocol.
+
+ Without TCP we would still probably be using tin cans connected
+ by string. But for this particular protocol, UDP is a better
+ choice.
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 9]
+
+RFC 2138 RADIUS April 1997
+
+
+3. Packet Format
+
+ Exactly one RADIUS packet is encapsulated in the UDP Data field [2],
+ where the UDP Destination Port field indicates 1812 (decimal).
+
+ When a reply is generated, the source and destination ports are
+ reversed.
+
+ This memo documents the RADIUS protocol. There has been some
+ confusion in the assignment of port numbers for this protocol. The
+ early deployment of RADIUS was done using the erroneously chosen port
+ number 1645, which conflicts with the "datametrics" service. The
+ officially assigned port number for RADIUS is 1812.
+
+ A summary of the RADIUS data format is shown below. The fields are
+ transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+Code
+
+ The Code field is one octet, and identifies the type of RADIUS
+ packet. When a packet is received with an invalid Code field, it is
+ silently discarded.
+
+ RADIUS Codes (decimal) are assigned as follows:
+
+ 1 Access-Request
+ 2 Access-Accept
+ 3 Access-Reject
+ 4 Accounting-Request
+ 5 Accounting-Response
+ 11 Access-Challenge
+ 12 Status-Server (experimental)
+ 13 Status-Client (experimental)
+ 255 Reserved
+
+
+
+
+Rigney, et. al. Standards Track [Page 10]
+
+RFC 2138 RADIUS April 1997
+
+
+ Codes 4 and 5 are covered in the RADIUS Accounting document [9], and
+ are not further mentioned here. Codes 12 and 13 are reserved for
+ possible use, but are not further mentioned here.
+
+Identifier
+
+ The Identifier field is one octet, and aids in matching requests and
+ replies.
+
+Length
+
+ The Length field is two octets. It indicates the length of the
+ packet including the Code, Identifier, Length, Authenticator and
+ Attribute fields. Octets outside the range of the Length field
+ should be treated as padding and should be ignored on reception. If
+ the packet is shorter than the Length field indicates, it should be
+ silently discarded. The minimum length is 20 and maximum length is
+ 4096.
+
+Authenticator
+
+ The Authenticator field is sixteen (16) octets. The most significant
+ octet is transmitted first. This value is used to authenticate the
+ reply from the RADIUS server, and is used in the password hiding
+ algorithm.
+
+Request Authenticator
+
+ In Access-Request Packets, the Authenticator value is a 16 octet
+ random number, called the Request Authenticator. The value SHOULD
+ be unpredictable and unique over the lifetime of a secret (the
+ password shared between the client and the RADIUS server), since
+ repetition of a request value in conjunction with the same secret
+ would permit an attacker to reply with a previously intercepted
+ response. Since it is expected that the same secret MAY be used
+ to authenticate with servers in disparate geographic regions, the
+ Request Authenticator field SHOULD exhibit global and temporal
+ uniqueness.
+
+ The Request Authenticator value in an Access-Request packet SHOULD
+ also be unpredictable, lest an attacker trick a server into
+ responding to a predicted future request, and then use the
+ response to masquerade as that server to a future Access-Request.
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 11]
+
+RFC 2138 RADIUS April 1997
+
+
+ Although protocols such as RADIUS are incapable of protecting
+ against theft of an authenticated session via realtime active
+ wiretapping attacks, generation of unique unpredictable requests
+ can protect against a wide range of active attacks against
+ authentication.
+
+ The NAS and RADIUS server share a secret. That shared secret
+ followed by the Request Authenticator is put through a one-way MD5
+ hash to create a 16 octet digest value which is xored with the
+ password entered by the user, and the xored result placed in the
+ User-Password attribute in the Access-Request packet. See the
+ entry for User-Password in the section on Attributes for a more
+ detailed description.
+
+ Response Authenticator
+
+ The value of the Authenticator field in Access-Accept, Access-
+ Reject, and Access-Challenge packets is called the Response
+ Authenticator, and contains a one-way MD5 hash calculated over a
+ stream of octets consisting of: the RADIUS packet, beginning with
+ the Code field, including the Identifier, the Length, the Request
+ Authenticator field from the Access-Request packet, and the
+ response Attributes, followed by the shared secret. That is,
+ ResponseAuth = MD5(Code+ID+Length+RequestAuth+Attributes+Secret)
+ where + denotes concatenation.
+
+Administrative Note
+
+ The secret (password shared between the client and the RADIUS server)
+ SHOULD be at least as large and unguessable as a well-chosen
+ password. It is preferred that the secret be at least 16 octets.
+ This is to ensure a sufficiently large range for the secret to
+ provide protection against exhaustive search attacks. A RADIUS
+ server SHOULD use the source IP address of the RADIUS UDP packet to
+ decide which shared secret to use, so that RADIUS requests can be
+ proxied.
+
+ When using a forwarding proxy, the proxy must be able to alter the
+ packet as it passes through in each direction - when the proxy
+ forwards the request, the proxy can add a Proxy-State Attribute, and
+ when the proxy forwards a response, it removes the Proxy-State
+ Attribute. Since Access-Accept and Access-Reject replies are
+ authenticated on the entire packet contents, the stripping of the
+ Proxy-State attribute would invalidate the signature in the packet -
+ so the proxy has to re-sign it.
+
+ Further details of RADIUS proxy implementation are outside the scope
+ of this document.
+
+
+
+Rigney, et. al. Standards Track [Page 12]
+
+RFC 2138 RADIUS April 1997
+
+
+Attributes
+
+ Many Attributes may have multiple instances, in such a case the order
+ of Attributes of the same Type SHOULD be preserved. The order of
+ Attributes of different Types is not required to be preserved.
+
+ In the section below on "Attributes" where the text refers to which
+ packets an attribute is allowed in, only packets with Codes 1, 2, 3
+ and 11 and attributes defined in this document are covered in this
+ document. A summary table is provided at the end of the "Attributes"
+ section. To determine which Attributes are allowed in packets with
+ codes 4 and 5 refer to the RADIUS Accounting document [9].
+
+4. Packet Types
+
+ The RADIUS Packet type is determined by the Code field in the first
+ octet of the Packet.
+
+4.1. Access-Request
+
+ Description
+
+ Access-Request packets are sent to a RADIUS server, and convey
+ information used to determine whether a user is allowed access to
+ a specific NAS, and any special services requested for that user.
+ An implementation wishing to authenticate a user MUST transmit a
+ RADIUS packet with the Code field set to 1 (Access-Request).
+
+ Upon receipt of an Access-Request from a valid client, an
+ appropriate reply MUST be transmitted.
+
+ An Access-Request MUST contain a User-Name attribute. It SHOULD
+ contain either a NAS-IP-Address attribute or NAS-Identifier
+ attribute (or both, although that is not recommended). It MUST
+ contain either a User-Password attribute or CHAP-Password
+ attribute. It SHOULD contain a NAS-Port or NAS-Port-Type
+ attribute or both unless the type of access being requested does
+ not involve a port or the NAS does not distinguish among its
+ ports.
+
+ An Access-Request MAY contain additional attributes as a hint to
+ the server, but the server is not required to honor the hint.
+
+ When a User-Password is present, it is hidden using a method based
+ on the RSA Message Digest Algorithm MD5 [1].
+
+ A summary of the Access-Request packet format is shown below. The
+ fields are transmitted from left to right.
+
+
+
+Rigney, et. al. Standards Track [Page 13]
+
+RFC 2138 RADIUS April 1997
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Request Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 1 for Access-Request.
+
+ Identifier
+
+ The Identifier field MUST be changed whenever the content of the
+ Attributes field changes, and whenever a valid reply has been
+ received for a previous request. For retransmissions, the
+ Identifier MUST remain unchanged.
+
+ Request Authenticator
+
+ The Request Authenticator value MUST be changed each time a new
+ Identifier is used.
+
+ Attributes
+
+ The Attribute field is variable in length, and contains the list
+ of Attributes that are required for the type of service, as well
+ as any desired optional Attributes.
+
+4.2. Access-Accept
+
+ Description
+
+ Access-Accept packets are sent by the RADIUS server, and provide
+ specific configuration information necessary to begin delivery of
+ service to the user. If all Attribute values received in an
+ Access-Request are acceptable then the RADIUS implementation MUST
+ transmit a packet with the Code field set to 2 (Access-Accept).
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 14]
+
+RFC 2138 RADIUS April 1997
+
+
+ On reception of an Access-Accept, the Identifier field is matched
+ with a pending Access-Request. Additionally, the Response
+ Authenticator field MUST contain the correct response for the
+ pending Access-Request. Invalid packets are silently discarded.
+
+ A summary of the Access-Accept packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Response Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 2 for Access-Accept.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Access-Request which caused this Access-Accept.
+
+ Response Authenticator
+
+ The Response Authenticator value is calculated from the Access-
+ Request value, as described earlier.
+
+ Attributes
+
+ The Attribute field is variable in length, and contains a list of
+ zero or more Attributes.
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 15]
+
+RFC 2138 RADIUS April 1997
+
+
+4.3. Access-Reject
+
+ Description
+
+ If any value of the received Attributes is not acceptable, then
+ the RADIUS server MUST transmit a packet with the Code field set
+ to 3 (Access-Reject). It MAY include one or more Reply-Message
+ Attributes with a text message which the NAS MAY display to the
+ user.
+
+ A summary of the Access-Reject packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Response Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 3 for Access-Reject.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Access-Request which caused this Access-Reject.
+
+ Response Authenticator
+
+ The Response Authenticator value is calculated from the Access-
+ Request value, as described earlier.
+
+ Attributes
+
+ The Attribute field is variable in length, and contains a list of
+ zero or more Attributes.
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 16]
+
+RFC 2138 RADIUS April 1997
+
+
+4.4. Access-Challenge
+
+ Description
+
+ If the RADIUS server desires to send the user a challenge
+ requiring a response, then the RADIUS server MUST respond to the
+ Access-Request by transmitting a packet with the Code field set to
+ 11 (Access-Challenge).
+
+ The Attributes field MAY have one or more Reply-Message
+ Attributes, and MAY have a single State Attribute, or none. No
+ other Attributes are permitted in an Access-Challenge.
+
+ On receipt of an Access-Challenge, the Identifier field is matched
+ with a pending Access-Request. Additionally, the Response
+ Authenticator field MUST contain the correct response for the
+ pending Access-Request. Invalid packets are silently discarded.
+
+ If the NAS does not support challenge/response, it MUST treat an
+ Access-Challenge as though it had received an Access-Reject
+ instead.
+
+ If the NAS supports challenge/response, receipt of a valid
+ Access-Challenge indicates that a new Access-Request SHOULD be
+ sent. The NAS MAY display the text message, if any, to the user,
+ and then prompt the user for a response. It then sends its
+ original Access-Request with a new request ID and Request
+ Authenticator, with the User-Password Attribute replaced by the
+ user's response (encrypted), and including the State Attribute
+ from the Access-Challenge, if any. Only 0 or 1 instances of the
+ State Attribute can be present in an Access-Request.
+
+ A NAS which supports PAP MAY forward the Reply-Message to the
+ dialin client and accept a PAP response which it can use as though
+ the user had entered the response. If the NAS cannot do so, it
+ should treat the Access-Challenge as though it had received an
+ Access-Reject instead.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 17]
+
+RFC 2138 RADIUS April 1997
+
+
+ A summary of the Access-Challenge packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Response Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 11 for Access-Challenge.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Access-Request which caused this Access-Challenge.
+
+ Response Authenticator
+
+ The Response Authenticator value is calculated from the Access-
+ Request value, as described earlier.
+
+ Attributes
+
+ The Attributes field is variable in length, and contains a list of
+ zero or more Attributes.
+
+5. Attributes
+
+ RADIUS Attributes carry the specific authentication, authorization,
+ information and configuration details for the request and reply.
+
+ Some Attributes MAY be included more than once. The effect of this
+ is Attribute specific, and is specified in each Attribute
+ description.
+
+ The end of the list of Attributes is indicated by the Length of the
+ RADIUS packet.
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 18]
+
+RFC 2138 RADIUS April 1997
+
+
+ A summary of the Attribute format is shown below. The fields are
+ transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | Value ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ The Type field is one octet. Up-to-date values of the RADIUS Type
+ field are specified in the most recent "Assigned Numbers" RFC [3].
+ Values 192-223 are reserved for experimental use, values 224-240
+ are reserved for implementation-specific use, and values 241-255
+ are reserved and should not be used. This specification concerns
+ the following values:
+
+ A RADIUS server MAY ignore Attributes with an unknown Type.
+
+ A RADIUS client MAY ignore Attributes with an unknown Type.
+
+ 1 User-Name
+ 2 User-Password
+ 3 CHAP-Password
+ 4 NAS-IP-Address
+ 5 NAS-Port
+ 6 Service-Type
+ 7 Framed-Protocol
+ 8 Framed-IP-Address
+ 9 Framed-IP-Netmask
+ 10 Framed-Routing
+ 11 Filter-Id
+ 12 Framed-MTU
+ 13 Framed-Compression
+ 14 Login-IP-Host
+ 15 Login-Service
+ 16 Login-TCP-Port
+ 17 (unassigned)
+ 18 Reply-Message
+ 19 Callback-Number
+ 20 Callback-Id
+ 21 (unassigned)
+ 22 Framed-Route
+ 23 Framed-IPX-Network
+ 24 State
+ 25 Class
+ 26 Vendor-Specific
+
+
+
+Rigney, et. al. Standards Track [Page 19]
+
+RFC 2138 RADIUS April 1997
+
+
+ 27 Session-Timeout
+ 28 Idle-Timeout
+ 29 Termination-Action
+ 30 Called-Station-Id
+ 31 Calling-Station-Id
+ 32 NAS-Identifier
+ 33 Proxy-State
+ 34 Login-LAT-Service
+ 35 Login-LAT-Node
+ 36 Login-LAT-Group
+ 37 Framed-AppleTalk-Link
+ 38 Framed-AppleTalk-Network
+ 39 Framed-AppleTalk-Zone
+ 40-59 (reserved for accounting)
+ 60 CHAP-Challenge
+ 61 NAS-Port-Type
+ 62 Port-Limit
+ 63 Login-LAT-Port
+
+ Length
+
+ The Length field is one octet, and indicates the length of this
+ Attribute including the Type, Length and Value fields. If an
+ Attribute is received in an Access-Request but with an invalid
+ Length, an Access-Reject SHOULD be transmitted. If an Attribute
+ is received in an Access-Accept, Access-Reject or Access-Challenge
+ packet with an invalid length, the packet MUST either be treated
+ an Access-Reject or else silently discarded.
+
+ Value
+
+ The Value field is zero or more octets and contains information
+ specific to the Attribute. The format and length of the Value
+ field is determined by the Type and Length fields.
+
+ Note that a "string" in RADIUS does not require termination by an
+ ASCII NUL because the Attribute already has a length field.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 20]
+
+RFC 2138 RADIUS April 1997
+
+
+ The format of the value field is one of four data types.
+
+ string 0-253 octets
+
+ address 32 bit value, most significant octet first.
+
+ integer 32 bit value, most significant octet first.
+
+ time 32 bit value, most significant octet first -- seconds
+ since 00:00:00 GMT, January 1, 1970. The standard
+ Attributes do not use this data type but it is presented
+ here for possible use within Vendor-Specific attributes.
+
+
+5.1. User-Name
+
+ Description
+
+ This Attribute indicates the name of the user to be authenticated.
+ It is only used in Access-Request packets.
+
+ A summary of the User-Name Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 1 for User-Name.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The NAS may limit the
+ maximum length of the User-Name but the ability to handle at least
+ 63 octets is recommended.
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 21]
+
+RFC 2138 RADIUS April 1997
+
+
+ The format of the username MAY be one of several forms:
+
+ monolithic Consisting only of alphanumeric characters. This
+ simple form might be used to locally manage a NAS.
+
+ simple Consisting only of printable ASCII characters.
+
+ name@fqdn SMTP address. The Fully Qualified Domain Name (with or
+ without trailing dot) indicates the realm in which the
+ name part applies.
+
+ distinguished name
+ A name in ASN.1 form used in Public Key authentication
+ systems.
+
+5.2. User-Password
+
+ Description
+
+ This Attribute indicates the password of the user to be
+ authenticated, or the user's input following an Access-Challenge.
+ It is only used in Access-Request packets.
+
+ On transmission, the password is hidden. The password is first
+ padded at the end with nulls to a multiple of 16 octets. A one-
+ way MD5 hash is calculated over a stream of octets consisting of
+ the shared secret followed by the Request Authenticator. This
+ value is XORed with the first 16 octet segment of the password and
+ placed in the first 16 octets of the String field of the User-
+ Password Attribute.
+
+ If the password is longer than 16 characters, a second one-way MD5
+ hash is calculated over a stream of octets consisting of the
+ shared secret followed by the result of the first xor. That hash
+ is XORed with the second 16 octet segment of the password and
+ placed in the second 16 octets of the String field of the User-
+ Password Attribute.
+
+ If necessary, this operation is repeated, with each xor result
+ being used along with the shared secret to generate the next hash
+ to xor the next segment of the password, to no more than 128
+ characters.
+
+ The method is taken from the book "Network Security" by Kaufman,
+ Perlman and Speciner [4] pages 109-110. A more precise
+ explanation of the method follows:
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 22]
+
+RFC 2138 RADIUS April 1997
+
+
+ Call the shared secret S and the pseudo-random 128-bit Request
+ Authenticator RA. Break the password into 16-octet chunks p1, p2,
+ etc. with the last one padded at the end with nulls to a 16-octet
+ boundary. Call the ciphertext blocks c(1), c(2), etc. We'll need
+ intermediate values b1, b2, etc.
+
+ b1 = MD5(S + RA) c(1) = p1 xor b1
+ b2 = MD5(S + c(1)) c(2) = p2 xor b2
+ . .
+ . .
+ . .
+ bi = MD5(S + c(i-1)) c(i) = pi xor bi
+
+ The String will contain c(1)+c(2)+...+c(i) where + denotes
+ concatenation.
+
+ On receipt, the process is reversed to yield the original
+ password.
+
+ A summary of the User-Password Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 2 for User-Password.
+
+ Length
+
+ At least 18 and no larger than 130.
+
+ String
+
+ The String field is between 16 and 128 octets long, inclusive.
+
+5.3. CHAP-Password
+
+ Description
+
+ This Attribute indicates the response value provided by a PPP
+ Challenge-Handshake Authentication Protocol (CHAP) user in
+ response to the challenge. It is only used in Access-Request
+ packets.
+
+
+
+Rigney, et. al. Standards Track [Page 23]
+
+RFC 2138 RADIUS April 1997
+
+
+ The CHAP challenge value is found in the CHAP-Challenge Attribute
+ (60) if present in the packet, otherwise in the Request
+ Authenticator field.
+
+ A summary of the CHAP-Password Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | CHAP Ident | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 3 for CHAP-Password.
+
+ Length
+
+ 19
+
+ CHAP Ident
+
+ This field is one octet, and contains the CHAP Identifier from the
+ user's CHAP Response.
+
+ String
+
+ The String field is 16 octets, and contains the CHAP Response from
+ the user.
+
+5.4. NAS-IP-Address
+
+ Description
+
+ This Attribute indicates the identifying IP Address of the NAS
+ which is requesting authentication of the user. It is only used
+ in Access-Request packets. Either NAS-IP-Address or NAS-
+ Identifier SHOULD be present in an Access-Request packet.
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 24]
+
+RFC 2138 RADIUS April 1997
+
+
+ A summary of the NAS-IP-Address Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 4 for NAS-IP-Address.
+
+ Length
+
+ 6
+
+ Address
+
+ The Address field is four octets.
+
+5.5. NAS-Port
+
+ Description
+
+ This Attribute indicates the physical port number of the NAS which
+ is authenticating the user. It is only used in Access-Request
+ packets. Note that this is using "port" in its sense of a
+ physical connection on the NAS, not in the sense of a TCP or UDP
+ port number. Either NAS-Port or NAS-Port-Type (61) or both SHOULD
+ be present in an Access-Request packet, if the NAS differentiates
+ among its ports.
+
+ A summary of the NAS-Port Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 25]
+
+RFC 2138 RADIUS April 1997
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 5 for NAS-Port.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. Despite the size of the field,
+ values range from 0 to 65535.
+
+5.6. Service-Type
+
+ Description
+
+ This Attribute indicates the type of service the user has
+ requested, or the type of service to be provided. It MAY be used
+ in both Access-Request and Access-Accept packets. A NAS is not
+ required to implement all of these service types, and MUST treat
+ unknown or unsupported Service-Types as though an Access-Reject
+ had been received instead.
+
+ A summary of the Service-Type Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 6 for Service-Type.
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 26]
+
+RFC 2138 RADIUS April 1997
+
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 1 Login
+ 2 Framed
+ 3 Callback Login
+ 4 Callback Framed
+ 5 Outbound
+ 6 Administrative
+ 7 NAS Prompt
+ 8 Authenticate Only
+ 9 Callback NAS Prompt
+
+
+ The service types are defined as follows when used in an Access-
+ Accept. When used in an Access-Request, they should be considered
+ to be a hint to the RADIUS server that the NAS has reason to
+ believe the user would prefer the kind of service indicated, but
+ the server is not required to honor the hint.
+
+ Login The user should be connected to a host.
+
+ Framed A Framed Protocol should be started for the
+ User, such as PPP or SLIP.
+
+ Callback Login The user should be disconnected and called
+ back, then connected to a host.
+
+ Callback Framed The user should be disconnected and called
+ back, then a Framed Protocol should be started
+ for the User, such as PPP or SLIP.
+
+ Outbound The user should be granted access to outgoing
+ devices.
+
+ Administrative The user should be granted access to the
+ administrative interface to the NAS from which
+ privileged commands can be executed.
+
+ NAS Prompt The user should be provided a command prompt
+ on the NAS from which non-privileged commands
+ can be executed.
+
+
+
+
+Rigney, et. al. Standards Track [Page 27]
+
+RFC 2138 RADIUS April 1997
+
+
+ Authenticate Only Only Authentication is requested, and no
+ authorization information needs to be returned
+ in the Access-Accept (typically used by proxy
+ servers rather than the NAS itself).
+
+ Callback NAS Prompt The user should be disconnected and called
+ back, then provided a command prompt on the
+ NAS from which non-privileged commands can be
+ executed.
+
+5.7. Framed-Protocol
+
+ Description
+
+ This Attribute indicates the framing to be used for framed access.
+ It MAY be used in both Access-Request and Access-Accept packets.
+
+ A summary of the Framed-Protocol Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 7 for Framed-Protocol.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 1 PPP
+ 2 SLIP
+ 3 AppleTalk Remote Access Protocol (ARAP)
+ 4 Gandalf proprietary SingleLink/MultiLink protocol
+ 5 Xylogics proprietary IPX/SLIP
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 28]
+
+RFC 2138 RADIUS April 1997
+
+
+5.8. Framed-IP-Address
+
+ Description
+
+ This Attribute indicates the address to be configured for the
+ user. It MAY be used in Access-Accept packets. It MAY be used in
+ an Access-Request packet as a hint by the NAS to the server that
+ it would prefer that address, but the server is not required to
+ honor the hint.
+
+ A summary of the Framed-IP-Address Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 8 for Framed-IP-Address.
+
+ Length
+
+ 6
+
+ Address
+
+ The Address field is four octets. The value 0xFFFFFFFF indicates
+ that the NAS should allow the user to select an address (e.g.
+ Negotiated). The value 0xFFFFFFFE indicates that the NAS should
+ select an address for the user (e.g. Assigned from a pool of
+ addresses kept by the NAS). Other valid values indicate that the
+ NAS should use that value as the user's IP address.
+
+5.9. Framed-IP-Netmask
+
+ Description
+
+ This Attribute indicates the IP netmask to be configured for the
+ user when the user is a router to a network. It MAY be used in
+ Access-Accept packets. It MAY be used in an Access-Request packet
+ as a hint by the NAS to the server that it would prefer that
+ netmask, but the server is not required to honor the hint.
+
+
+
+
+Rigney, et. al. Standards Track [Page 29]
+
+RFC 2138 RADIUS April 1997
+
+
+ A summary of the Framed-IP-Netmask Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 9 for Framed-IP-Netmask.
+
+ Length
+
+ 6
+
+ Address
+
+ The Address field is four octets specifying the IP netmask of the
+ user.
+
+5.10. Framed-Routing
+
+ Description
+
+ This Attribute indicates the routing method for the user, when the
+ user is a router to a network. It is only used in Access-Accept
+ packets.
+
+ A summary of the Framed-Routing Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 10 for Framed-Routing.
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 30]
+
+RFC 2138 RADIUS April 1997
+
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 0 None
+ 1 Send routing packets
+ 2 Listen for routing packets
+ 3 Send and Listen
+
+5.11. Filter-Id
+
+ Description
+
+ This Attribute indicates the name of the filter list for this
+ user. Zero or more Filter-Id attributes MAY be sent in an
+ Access-Accept packet.
+
+ Identifying a filter list by name allows the filter to be used on
+ different NASes without regard to filter-list implementation
+ details.
+
+ A summary of the Filter-Id Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 11 for Filter-Id.
+
+ Length
+
+ >= 3
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 31]
+
+RFC 2138 RADIUS April 1997
+
+
+ String
+
+ The String field is one or more octets, and its contents are
+ implementation dependent. It is intended to be human readable and
+ MUST NOT affect operation of the protocol. It is recommended that
+ the message contain displayable ASCII characters from the range 32
+ through 126 decimal.
+
+5.12. Framed-MTU
+
+ Description
+
+ This Attribute indicates the Maximum Transmission Unit to be
+ configured for the user, when it is not negotiated by some other
+ means (such as PPP). It is only used in Access-Accept packets.
+
+ A summary of the Framed-MTU Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 12 for Framed-MTU.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. Despite the size of the field,
+ values range from 64 to 65535.
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 32]
+
+RFC 2138 RADIUS April 1997
+
+
+5.13. Framed-Compression
+
+ Description
+
+ This Attribute indicates a compression protocol to be used for the
+ link. It MAY be used in Access-Accept packets. It MAY be used in
+ an Access-Request packet as a hint to the server that the NAS
+ would prefer to use that compression, but the server is not
+ required to honor the hint.
+
+ More than one compression protocol Attribute MAY be sent. It is
+ the responsibility of the NAS to apply the proper compression
+ protocol to appropriate link traffic.
+
+ A summary of the Framed-Compression Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 13 for Framed-Compression.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 0 None
+ 1 VJ TCP/IP header compression [5]
+ 2 IPX header compression
+
+5.14. Login-IP-Host
+
+ Description
+
+ This Attribute indicates the system with which to connect the
+ user, when the Login-Service Attribute is included. It MAY be
+ used in Access-Accept packets. It MAY be used in an Access-
+
+
+
+Rigney, et. al. Standards Track [Page 33]
+
+RFC 2138 RADIUS April 1997
+
+
+ Request packet as a hint to the server that the NAS would prefer
+ to use that host, but the server is not required to honor the
+ hint.
+
+ A summary of the Login-IP-Host Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 14 for Login-IP-Host.
+
+ Length
+
+ 6
+
+ Address
+
+ The Address field is four octets. The value 0xFFFFFFFF indicates
+ that the NAS SHOULD allow the user to select an address. The
+ value 0 indicates that the NAS SHOULD select a host to connect the
+ user to. Other values indicate the address the NAS SHOULD connect
+ the user to.
+
+5.15. Login-Service
+
+ Description
+
+ This Attribute indicates the service which should be used to
+ connect the user to the login host. It is only used in Access-
+ Accept packets.
+
+ A summary of the Login-Service Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 34]
+
+RFC 2138 RADIUS April 1997
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 15 for Login-Service.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 0 Telnet
+ 1 Rlogin
+ 2 TCP Clear
+ 3 PortMaster (proprietary)
+ 4 LAT
+
+5.16. Login-TCP-Port
+
+ Description
+
+ This Attribute indicates the TCP port with which the user is to be
+ connected, when the Login-Service Attribute is also present. It
+ is only used in Access-Accept packets.
+
+ A summary of the Login-TCP-Port Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 16 for Login-TCP-Port.
+
+
+
+Rigney, et. al. Standards Track [Page 35]
+
+RFC 2138 RADIUS April 1997
+
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. Despite the size of the field,
+ values range from 0 to 65535.
+
+5.17. (unassigned)
+
+ Description
+
+ ATTRIBUTE TYPE 17 HAS NOT BEEN ASSIGNED.
+
+5.18. Reply-Message
+
+ Description
+
+ This Attribute indicates text which MAY be displayed to the user.
+
+ When used in an Access-Accept, it is the success message.
+
+ When used in an Access-Reject, it is the failure message. It MAY
+ indicate a dialog message to prompt the user before another
+ Access-Request attempt.
+
+ When used in an Access-Challenge, it MAY indicate a dialog message
+ to prompt the user for a response.
+
+ Multiple Reply-Message's MAY be included and if any are displayed,
+ they MUST be displayed in the same order as they appear in the
+ packet.
+
+ A summary of the Reply-Message Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+ Type
+
+ 18 for Reply-Message.
+
+
+
+
+Rigney, et. al. Standards Track [Page 36]
+
+RFC 2138 RADIUS April 1997
+
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, and its contents are
+ implementation dependent. It is intended to be human readable,
+ and MUST NOT affect operation of the protocol. It is recommended
+ that the message contain displayable ASCII characters from the
+ range 10, 13, and 32 through 126 decimal. Mechanisms for
+ extension to other character sets are beyond the scope of this
+ specification.
+
+5.19. Callback-Number
+
+ Description
+
+ This Attribute indicates a dialing string to be used for callback.
+ It MAY be used in Access-Accept packets. It MAY be used in an
+ Access-Request packet as a hint to the server that a Callback
+ service is desired, but the server is not required to honor the
+ hint.
+
+ A summary of the Callback-Number Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 19 for Callback-Number.
+
+ Length
+
+ >= 3
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 37]
+
+RFC 2138 RADIUS April 1997
+
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.20. Callback-Id
+
+ Description
+
+ This Attribute indicates the name of a place to be called, to be
+ interpreted by the NAS. It MAY be used in Access-Accept packets.
+
+ A summary of the Callback-Id Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 20 for Callback-Id.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.21. (unassigned)
+
+ Description
+
+ ATTRIBUTE TYPE 21 HAS NOT BEEN ASSIGNED.
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 38]
+
+RFC 2138 RADIUS April 1997
+
+
+5.22. Framed-Route
+
+ Description
+
+ This Attribute provides routing information to be configured for
+ the user on the NAS. It is used in the Access-Accept packet and
+ can appear multiple times.
+
+ A summary of the Framed-Route Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 22 for Framed-Route.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, and its contents are
+ implementation dependent. It is intended to be human readable and
+ MUST NOT affect operation of the protocol. It is recommended that
+ the message contain displayable ASCII characters from the range 32
+ through 126 decimal.
+
+ For IP routes, it SHOULD contain a destination prefix in dotted
+ quad form optionally followed by a slash and a decimal length
+ specifier stating how many high order bits of the prefix should be
+ used. That is followed by a space, a gateway address in dotted
+ quad form, a space, and one or more metrics separated by spaces.
+ For example, "192.168.1.0/24 192.168.1.1 1 2 -1 3 400". The length
+ specifier may be omitted in which case it should default to 8 bits
+ for class A prefixes, 16 bits for class B prefixes, and 24 bits
+ for class C prefixes. For example, "192.168.1.0 192.168.1.1 1".
+
+ Whenever the gateway address is specified as "0.0.0.0" the IP
+ address of the user SHOULD be used as the gateway address.
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 39]
+
+RFC 2138 RADIUS April 1997
+
+
+5.23. Framed-IPX-Network
+
+ Description
+
+ This Attribute indicates the IPX Network number to be configured
+ for the user. It is used in Access-Accept packets.
+
+ A summary of the Framed-IPX-Network Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 23 for Framed-IPX-Network.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. The value 0xFFFFFFFE indicates
+ that the NAS should select an IPX network for the user (e.g.
+ assigned from a pool of one or more IPX networks kept by the NAS).
+ Other values should be used as the IPX network for the link to the
+ user.
+
+5.24. State
+
+ Description
+
+ This Attribute is available to be sent by the server to the client
+ in an Access-Challenge and MUST be sent unmodified from the client
+ to the server in the new Access-Request reply to that challenge,
+ if any.
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 40]
+
+RFC 2138 RADIUS April 1997
+
+
+ This Attribute is available to be sent by the server to the client
+ in an Access-Accept that also includes a Termination-Action
+ Attribute with the value of RADIUS-Request. If the NAS performs
+ the Termination-Action by sending a new Access-Request upon
+ termination of the current session, it MUST include the State
+ attribute unchanged in that Access-Request.
+
+ In either usage, no interpretation by the client should be made.
+ A packet may have only one State Attribute. Usage of the State
+ Attribute is implementation dependent.
+
+ A summary of the State Attribute format is shown below. The fields
+ are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 24 for State.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.25. Class
+
+ Description
+
+ This Attribute is available to be sent by the server to the client
+ in an Access-Accept and should be sent unmodified by the client to
+ the accounting server as part of the Accounting-Request packet if
+ accounting is supported. No interpretation by the client should
+ be made.
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 41]
+
+RFC 2138 RADIUS April 1997
+
+
+ A summary of the Class Attribute format is shown below. The fields
+ are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 25 for Class.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.26. Vendor-Specific
+
+ Description
+
+ This Attribute is available to allow vendors to support their own
+ extended Attributes not suitable for general usage. It MUST not
+ affect the operation of the RADIUS protocol.
+
+ Servers not equipped to interpret the vendor-specific information
+ sent by a client MUST ignore it (although it may be reported).
+ Clients which do not receive desired vendor-specific information
+ SHOULD make an attempt to operate without it, although they may do
+ so (and report they are doing so) in a degraded mode.
+
+ A summary of the Vendor-Specific Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 42]
+
+RFC 2138 RADIUS April 1997
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Vendor-Id
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Vendor-Id (cont) | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 26 for Vendor-Specific.
+
+ Length
+
+ >= 7
+
+ Vendor-Id
+
+ The high-order octet is 0 and the low-order 3 octets are the SMI
+ Network Management Private Enterprise Code of the Vendor in
+ network byte order, as defined in the Assigned Numbers RFC [3].
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+ It SHOULD be encoded as a sequence of vendor type / vendor length
+ / value fields, as follows. The Attribute-Specific field is
+ dependent on the vendor's definition of that attribute. An
+ example encoding of the Vendor-Specific attribute using this
+ method follows:
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Vendor-Id
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Vendor-Id (cont) | Vendor type | Vendor length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attribute-Specific...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 43]
+
+RFC 2138 RADIUS April 1997
+
+
+5.27. Session-Timeout
+
+ Description
+
+ This Attribute sets the maximum number of seconds of service to be
+ provided to the user before termination of the session or prompt.
+ This Attribute is available to be sent by the server to the client
+ in an Access-Accept or Access-Challenge.
+
+ A summary of the Session-Timeout Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 27 for Session-Timeout.
+
+ Length
+
+ 6
+
+ Value
+
+ The field is 4 octets, containing a 32-bit unsigned integer with
+ the maximum number of seconds this user should be allowed to
+ remain connected by the NAS.
+
+5.28. Idle-Timeout
+
+ Description
+
+ This Attribute sets the maximum number of consecutive seconds of
+ idle connection allowed to the user before termination of the
+ session or prompt. This Attribute is available to be sent by the
+ server to the client in an Access-Accept or Access-Challenge.
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 44]
+
+RFC 2138 RADIUS April 1997
+
+
+ A summary of the Idle-Timeout Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 28 for Idle-Timeout.
+
+ Length
+
+ 6
+
+ Value
+
+ The field is 4 octets, containing a 32-bit unsigned integer with
+ the maximum number of consecutive seconds of idle time this user
+ should be permitted before being disconnected by the NAS.
+
+5.29. Termination-Action
+
+ Description
+
+ This Attribute indicates what action the NAS should take when the
+ specified service is completed. It is only used in Access-Accept
+ packets.
+
+ A summary of the Termination-Action Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 29 for Termination-Action.
+
+
+
+
+Rigney, et. al. Standards Track [Page 45]
+
+RFC 2138 RADIUS April 1997
+
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 0 Default
+ 1 RADIUS-Request
+
+ If the Value is set to RADIUS-Request, upon termination of the
+ specified service the NAS MAY send a new Access-Request to the
+ RADIUS server, including the State attribute if any.
+
+5.30. Called-Station-Id
+
+ Description
+
+ This Attribute allows the NAS to send in the Access-Request packet
+ the phone number that the user called, using Dialed Number
+ Identification (DNIS) or similar technology. Note that this may be
+ different from the phone number the call comes in on. It is only
+ used in Access-Request packets.
+
+ A summary of the Called-Station-Id Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+ Type
+
+ 30 for Called-Station-Id.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, containing the phone
+ number that the user's call came in on.
+
+
+
+
+Rigney, et. al. Standards Track [Page 46]
+
+RFC 2138 RADIUS April 1997
+
+
+ The actual format of the information is site or application
+ specific. Printable ASCII is recommended, but a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.31. Calling-Station-Id
+
+ Description
+
+ This Attribute allows the NAS to send in the Access-Request packet
+ the phone number that the call came from, using Automatic Number
+ Identification (ANI) or similar technology. It is only used in
+ Access-Request packets.
+
+ A summary of the Calling-Station-Id Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 31 for Calling-Station-Id.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, containing the phone
+ number that the user placed the call from.
+
+ The actual format of the information is site or application
+ specific. Printable ASCII is recommended, but a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 47]
+
+RFC 2138 RADIUS April 1997
+
+
+5.32. NAS-Identifier
+
+ Description
+
+ This Attribute contains a string identifying the NAS originating
+ the Access-Request. It is only used in Access-Request packets.
+ Either NAS-IP-Address or NAS-Identifier SHOULD be present in an
+ Access-Request packet.
+
+ A summary of the NAS-Identifier Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 32 for NAS-Identifier.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, and should be unique to
+ the NAS within the scope of the RADIUS server. For example, a
+ fully qualified domain name would be suitable as a NAS-Identifier.
+
+ The actual format of the information is site or application
+ specific, and a robust implementation SHOULD support the field as
+ undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.33. Proxy-State
+
+ Description
+
+ This Attribute is available to be sent by a proxy server to
+ another server when forwarding an Access-Request and MUST be
+ returned unmodified in the Access-Accept, Access-Reject or
+ Access-Challenge. This attribute should be removed by the proxy
+ server before the response is forwarded to the NAS.
+
+
+
+Rigney, et. al. Standards Track [Page 48]
+
+RFC 2138 RADIUS April 1997
+
+
+ Usage of the Proxy-State Attribute is implementation dependent. A
+ description of its function is outside the scope of this
+ specification.
+
+ A summary of the Proxy-State Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 33 for Proxy-State.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.34. Login-LAT-Service
+
+ Description
+
+ This Attribute indicates the system with which the user is to be
+ connected by LAT. It MAY be used in Access-Accept packets, but
+ only when LAT is specified as the Login-Service. It MAY be used
+ in an Access-Request packet as a hint to the server, but the
+ server is not required to honor the hint.
+
+ Administrators use the service attribute when dealing with
+ clustered systems, such as a VAX or Alpha cluster. In such an
+ environment several different time sharing hosts share the same
+ resources (disks, printers, etc.), and administrators often
+ configure each to offer access (service) to each of the shared
+ resources. In this case, each host in the cluster advertises its
+ services through LAT broadcasts.
+
+
+
+
+Rigney, et. al. Standards Track [Page 49]
+
+RFC 2138 RADIUS April 1997
+
+
+ Sophisticated users often know which service providers (machines)
+ are faster and tend to use a node name when initiating a LAT
+ connection. Alternately, some administrators want particular
+ users to use certain machines as a primitive form of load
+ balancing (although LAT knows how to do load balancing itself).
+
+ A summary of the Login-LAT-Service Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+ Type
+
+ 34 for Login-LAT-Service.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, and contains the identity
+ of the LAT service to use. The LAT Architecture allows this
+ string to contain $ (dollar), - (hyphen), . (period), _
+ (underscore), numerics, upper and lower case alphabetics, and the
+ ISO Latin-1 character set extension [6]. All LAT string
+ comparisons are case insensitive.
+
+5.35. Login-LAT-Node
+
+ Description
+
+ This Attribute indicates the Node with which the user is to be
+ automatically connected by LAT. It MAY be used in Access-Accept
+ packets, but only when LAT is specified as the Login-Service. It
+ MAY be used in an Access-Request packet as a hint to the server,
+ but the server is not required to honor the hint.
+
+ A summary of the Login-LAT-Node Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 50]
+
+RFC 2138 RADIUS April 1997
+
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 35 for Login-LAT-Node.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, and contains the identity
+ of the LAT Node to connect the user to. The LAT Architecture
+ allows this string to contain $ (dollar), - (hyphen), . (period),
+ _ (underscore), numerics, upper and lower case alphabetics, and
+ the ISO Latin-1 character set extension. All LAT string
+ comparisons are case insensitive.
+
+5.36. Login-LAT-Group
+
+ Description
+
+ This Attribute contains a string identifying the LAT group codes
+ which this user is authorized to use. It MAY be used in Access-
+ Accept packets, but only when LAT is specified as the Login-
+ Service. It MAY be used in an Access-Request packet as a hint to
+ the server, but the server is not required to honor the hint.
+
+ LAT supports 256 different group codes, which LAT uses as a form
+ of access rights. LAT encodes the group codes as a 256 bit
+ bitmap.
+
+ Administrators can assign one or more of the group code bits at
+ the LAT service provider; it will only accept LAT connections that
+ have these group codes set in the bit map. The administrators
+ assign a bitmap of authorized group codes to each user; LAT gets
+ these from the operating system, and uses these in its requests to
+ the service providers.
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 51]
+
+RFC 2138 RADIUS April 1997
+
+
+ A summary of the Login-LAT-Group Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 36 for Login-LAT-Group.
+
+ Length
+
+ 34
+
+ String
+
+ The String field is a 32 octet bit map, most significant octet
+ first. A robust implementation SHOULD support the field as
+ undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.37. Framed-AppleTalk-Link
+
+ Description
+
+ This Attribute indicates the AppleTalk network number which should
+ be used for the serial link to the user, which is another
+ AppleTalk router. It is only used in Access-Accept packets. It
+ is never used when the user is not another router.
+
+ A summary of the Framed-AppleTalk-Link Attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 52]
+
+RFC 2138 RADIUS April 1997
+
+
+ Type
+
+ 37 for Framed-AppleTalk-Link.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. Despite the size of the field,
+ values range from 0 to 65535. The special value of 0 indicates
+ that this is an unnumbered serial link. A value of 1-65535 means
+ that the serial line between the NAS and the user should be
+ assigned that value as an AppleTalk network number.
+
+5.38. Framed-AppleTalk-Network
+
+ Description
+
+ This Attribute indicates the AppleTalk Network number which the
+ NAS should probe to allocate an AppleTalk node for the user. It
+ is only used in Access-Accept packets. It is never used when the
+ user is another router. Multiple instances of this Attribute
+ indicate that the NAS may probe using any of the network numbers
+ specified.
+
+ A summary of the Framed-AppleTalk-Network Attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 38 for Framed-AppleTalk-Network.
+
+ Length
+
+ 6
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 53]
+
+RFC 2138 RADIUS April 1997
+
+
+ Value
+
+ The Value field is four octets. Despite the size of the field,
+ values range from 0 to 65535. The special value 0 indicates that
+ the NAS should assign a network for the user, using its default
+ cable range. A value between 1 and 65535 (inclusive) indicates
+ the AppleTalk Network the NAS should probe to find an address for
+ the user.
+
+5.39. Framed-AppleTalk-Zone
+
+ Description
+
+ This Attribute indicates the AppleTalk Default Zone to be used for
+ this user. It is only used in Access-Accept packets. Multiple
+ instances of this attribute in the same packet are not allowed.
+
+ A summary of the Framed-AppleTalk-Zone Attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 39 for Framed-AppleTalk-Zone.
+
+ Length
+
+ >= 3
+
+ String
+
+ The name of the Default AppleTalk Zone to be used for this user.
+ A robust implementation SHOULD support the field as
+ undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 54]
+
+RFC 2138 RADIUS April 1997
+
+
+5.40. CHAP-Challenge
+
+ Description
+
+ This Attribute contains the CHAP Challenge sent by the NAS to a
+ PPP Challenge-Handshake Authentication Protocol (CHAP) user. It
+ is only used in Access-Request packets.
+
+ If the CHAP challenge value is 16 octets long it MAY be placed in
+ the Request Authenticator field instead of using this attribute.
+
+ A summary of the CHAP-Challenge Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 60 for CHAP-Challenge.
+
+ Length
+
+ >= 7
+
+ String
+
+ The String field contains the CHAP Challenge.
+
+5.41. NAS-Port-Type
+
+ Description
+
+ This Attribute indicates the type of the physical port of the NAS
+ which is authenticating the user. It can be used instead of or in
+ addition to the NAS-Port (5) attribute. It is only used in
+ Access-Request packets. Either NAS-Port (5) or NAS-Port-Type or
+ both SHOULD be present in an Access-Request packet, if the NAS
+ differentiates among its ports.
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 55]
+
+RFC 2138 RADIUS April 1997
+
+
+ A summary of the NAS-Port-Type Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 61 for NAS-Port-Type.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. "Virtual" refers to a connection
+ to the NAS via some transport protocol, instead of through a
+ physical port. For example, if a user telnetted into a NAS to
+ authenticate himself as an Outbound-User, the Access-Request might
+ include NAS-Port-Type = Virtual as a hint to the RADIUS server
+ that the user was not on a physical port.
+
+ 0 Async
+ 1 Sync
+ 2 ISDN Sync
+ 3 ISDN Async V.120
+ 4 ISDN Async V.110
+ 5 Virtual
+
+5.42. Port-Limit
+
+ Description
+
+ This Attribute sets the maximum number of ports to be provided to
+ the user by the NAS. This Attribute MAY be sent by the server to
+ the client in an Access-Accept packet. It is intended for use in
+ conjunction with Multilink PPP [7] or similar uses. It MAY also
+ be sent by the NAS to the server as a hint that that many ports
+ are desired for use, but the server is not required to honor the
+ hint.
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 56]
+
+RFC 2138 RADIUS April 1997
+
+
+ A summary of the Port-Limit Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 62 for Port-Limit.
+
+ Length
+
+ 6
+
+ Value
+
+ The field is 4 octets, containing a 32-bit unsigned integer with
+ the maximum number of ports this user should be allowed to connect
+ to on the NAS.
+
+5.43. Login-LAT-Port
+
+ Description
+
+ This Attribute indicates the Port with which the user is to be
+ connected by LAT. It MAY be used in Access-Accept packets, but
+ only when LAT is specified as the Login-Service. It MAY be used
+ in an Access-Request packet as a hint to the server, but the
+ server is not required to honor the hint.
+
+ A summary of the Login-LAT-Port Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 63 for Login-LAT-Port.
+
+
+
+
+Rigney, et. al. Standards Track [Page 57]
+
+RFC 2138 RADIUS April 1997
+
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, and contains the identity
+ of the LAT port to use. The LAT Architecture allows this string
+ to contain $ (dollar), - (hyphen), . (period), _ (underscore),
+ numerics, upper and lower case alphabetics, and the ISO Latin-1
+ character set extension. All LAT string comparisons are case
+ insensitive.
+
+5.44. Table of Attributes
+
+ The following table provides a guide to which attributes may be found
+ in which kinds of packets, and in what quantity.
+
+ Request Accept Reject Challenge # Attribute
+ 1 0 0 0 1 User-Name
+ 0-1 0 0 0 2 User-Password [Note 1]
+ 0-1 0 0 0 3 CHAP-Password [Note 1]
+ 0-1 0 0 0 4 NAS-IP-Address
+ 0-1 0 0 0 5 NAS-Port
+ 0-1 0-1 0 0 6 Service-Type
+ 0-1 0-1 0 0 7 Framed-Protocol
+ 0-1 0-1 0 0 8 Framed-IP-Address
+ 0-1 0-1 0 0 9 Framed-IP-Netmask
+ 0 0-1 0 0 10 Framed-Routing
+ 0 0+ 0 0 11 Filter-Id
+ 0 0-1 0 0 12 Framed-MTU
+ 0+ 0+ 0 0 13 Framed-Compression
+ 0+ 0+ 0 0 14 Login-IP-Host
+ 0 0-1 0 0 15 Login-Service
+ 0 0-1 0 0 16 Login-TCP-Port
+ 0 0+ 0+ 0+ 18 Reply-Message
+ 0-1 0-1 0 0 19 Callback-Number
+ 0 0-1 0 0 20 Callback-Id
+ 0 0+ 0 0 22 Framed-Route
+ 0 0-1 0 0 23 Framed-IPX-Network
+ 0-1 0-1 0 0-1 24 State
+ 0 0+ 0 0 25 Class
+ 0+ 0+ 0 0+ 26 Vendor-Specific
+ 0 0-1 0 0-1 27 Session-Timeout
+ 0 0-1 0 0-1 28 Idle-Timeout
+ 0 0-1 0 0 29 Termination-Action
+ 0-1 0 0 0 30 Called-Station-Id
+ 0-1 0 0 0 31 Calling-Station-Id
+
+
+
+Rigney, et. al. Standards Track [Page 58]
+
+RFC 2138 RADIUS April 1997
+
+
+ 0-1 0 0 0 32 NAS-Identifier
+ 0+ 0+ 0+ 0+ 33 Proxy-State
+ 0-1 0-1 0 0 34 Login-LAT-Service
+ 0-1 0-1 0 0 35 Login-LAT-Node
+ 0-1 0-1 0 0 36 Login-LAT-Group
+ 0 0-1 0 0 37 Framed-AppleTalk-Link
+ 0 0+ 0 0 38 Framed-AppleTalk-Network
+ 0 0-1 0 0 39 Framed-AppleTalk-Zone
+ 0-1 0 0 0 60 CHAP-Challenge
+ 0-1 0 0 0 61 NAS-Port-Type
+ 0-1 0-1 0 0 62 Port-Limit
+ 0-1 0-1 0 0 63 Login-LAT-Port
+
+
+ Request Accept Reject Challenge # Attribute
+
+
+ [Note 1] An Access-Request MUST contain either a User-Password or a
+ CHAP-Password, and MUST NOT contain both.
+
+ The following table defines the meaning of the above table entries.
+
+ 0 This attribute MUST NOT be present in packet.
+ 0+ Zero or more instances of this attribute MAY be present in packet.
+ 0-1 Zero or one instance of this attribute MAY be present in packet.
+ 1 Exactly one instance of this attribute MUST be present in packet.
+
+6. Examples
+
+ A few examples are presented to illustrate the flow of packets and
+ use of typical attributes. These examples are not intended to be
+ exhaustive, many others are possible.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 59]
+
+RFC 2138 RADIUS April 1997
+
+
+6.1. User Telnet to Specified Host
+
+ The NAS at 192.168.1.16 sends an Access-Request UDP packet to the
+ RADIUS Server for a user named nemo logging in on port 3.
+
+ Code = 1 (Access-Request)
+ ID = 0
+ Length = 56
+ Request Authenticator = {16 octet random number}
+ Attributes:
+ User-Name = "nemo"
+ User-Password = {16 octets of Password padded at end with nulls,
+ XORed with MD5(shared secret|Request Authenticator)}
+ NAS-IP-Address = 192.168.1.16
+ NAS-Port = 3
+
+ The RADIUS server authenticates nemo, and sends an Access-Accept UDP
+ packet to the NAS telling it to telnet nemo to host 192.168.1.3.
+
+ Code = 2 (Access-Accept)
+ ID = 0 (same as in Access-Request)
+ Length = 38
+ Response Authenticator = {16-octet MD-5 checksum of the code (2),
+ id (0), Length (38), the Request Authenticator from
+ above, the attributes in this reply, and the shared
+ secret}
+ Attributes:
+ Service-Type = Login-User
+ Login-Service = Telnet
+ Login-Host = 192.168.1.3
+
+6.2. Framed User Authenticating with CHAP
+
+ The NAS at 192.168.1.16 sends an Access-Request UDP packet to the
+ RADIUS Server for a user named flopsy logging in on port 20 with PPP,
+ authenticating using CHAP. The NAS sends along the Service-Type and
+ Framed-Protocol attributes as a hint to the RADIUS server that this
+ user is looking for PPP, although the NAS is not required to do so.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 60]
+
+RFC 2138 RADIUS April 1997
+
+
+ Code = 1 (Access-Request)
+ ID = 1
+ Length = 71
+ Request Authenticator = {16 octet random number also used as
+ CHAP challenge}
+ Attributes:
+ User-Name = "flopsy"
+ CHAP-Password = {1 octet CHAP ID followed by 16 octet
+ CHAP response}
+ NAS-IP-Address = 192.168.1.16
+ NAS-Port = 20
+ Service-Type = Framed-User
+ Framed-Protocol = PPP
+
+ The RADIUS server authenticates flopsy, and sends an Access-Accept
+ UDP packet to the NAS telling it to start PPP service and assign an
+ address for the user out of its dynamic address pool.
+
+ Code = 2 (Access-Accept)
+ ID = 1 (same as in Access-Request)
+ Length = 56
+ Response Authenticator = {16-octet MD-5 checksum of the code (2),
+ id (1), Length (56), the Request Authenticator from
+ above, the attributes in this reply, and the shared
+ secret}
+ Attributes:
+ Service-Type = Framed-User
+ Framed-Protocol = PPP
+ Framed-IP-Address = 255.255.255.254
+ Framed-Routing = None
+ Framed-Compression = 1 (VJ TCP/IP Header Compression)
+ Framed-MTU = 1500
+
+6.3. User with Challenge-Response card
+
+ The NAS at 192.168.1.16 sends an Access-Request UDP packet to the
+ RADIUS Server for a user named mopsy logging in on port 7.
+
+ Code = 1 (Access-Request)
+ ID = 2
+ Length = 57
+ Request Authenticator = {16 octet random number}
+ Attributes:
+ User-Name = "mopsy"
+ User-Password = {16 octets of Password padded at end with nulls,
+ XORed with MD5(shared secret|Request Authenticator)}
+ NAS-IP-Address = 192.168.1.16
+ NAS-Port = 7
+
+
+
+Rigney, et. al. Standards Track [Page 61]
+
+RFC 2138 RADIUS April 1997
+
+
+ The RADIUS server decides to challenge mopsy, sending back a
+ challenge string and looking for a response. The RADIUS server
+ therefore and sends an Access-Challenge UDP packet to the NAS.
+
+ Code = 11 (Access-Challenge}
+ ID = 2 (same as in Access-Request)
+ Length = 78
+ Response Authenticator = {16-octet MD-5 checksum of the code (11),
+ id (2), length (78), the Request Authenticator from
+ above, the attributes in this reply, and the shared
+ secret}
+ Attributes:
+ Reply-Message = "Challenge 32769430. Enter response at prompt."
+ State = {Magic Cookie to be returned along with user's response;
+ in this example 8 octets of data}
+
+ The user enters his response, and the NAS send a new Access-Request
+ with that response, and includes the State Attribute.
+
+ Code = 1 (Access-Request)
+ ID = 3 (Note that this changes)
+ Length = 67
+ Request Authenticator = {NEW 16 octet random number}
+ Attributes:
+ User-Name = "mopsy"
+ User-Password = {16 octets of Response padded at end with
+ nulls, XORed with MD5 checksum of shared secret
+ plus above Request Authenticator}
+ NAS-IP-Address = 192.168.1.16
+ NAS-Port = 7
+ State = {Magic Cookie from Access-Challenge packet, unchanged}
+
+ The Response was incorrect, so the RADIUS server tells the NAS to
+ reject the login attempt.
+
+ Code = 3 (Access-Reject)
+ ID = 3 (same as in Access-Request)
+ Length = 20
+ Response Authenticator = {16-octet MD-5 checksum of the code (3),
+ id (3), length(20), the Request Authenticator from
+ above, the attributes in this reply if any, and the
+ shared secret}
+ Attributes:
+ (none, although a Reply-Message could be sent)
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 62]
+
+RFC 2138 RADIUS April 1997
+
+
+Security Considerations
+
+ Security issues are the primary topic of this document.
+
+ In practice, within or associated with each RADIUS server, there is a
+ database which associates "user" names with authentication
+ information ("secrets"). It is not anticipated that a particular
+ named user would be authenticated by multiple methods. This would
+ make the user vulnerable to attacks which negotiate the least secure
+ method from among a set. Instead, for each named user there should
+ be an indication of exactly one method used to authenticate that user
+ name. If a user needs to make use of different authentication
+ methods under different circumstances, then distinct user names
+ SHOULD be employed, each of which identifies exactly one
+ authentication method.
+
+ Passwords and other secrets should be stored at the respective ends
+ such that access to them is as limited as possible. Ideally, the
+ secrets should only be accessible to the process requiring access in
+ order to perform the authentication.
+
+ The secrets should be distributed with a mechanism that limits the
+ number of entities that handle (and thus gain knowledge of) the
+ secret. Ideally, no unauthorized person should ever gain knowledge
+ of the secrets. It is possible to achieve this with SNMP Security
+ Protocols [8], but such a mechanism is outside the scope of this
+ specification.
+
+ Other distribution methods are currently undergoing research and
+ experimentation. The SNMP Security document [8] also has an
+ excellent overview of threats to network protocols.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 63]
+
+RFC 2138 RADIUS April 1997
+
+
+References
+
+ [1] Rivest, R., and S. Dusse, "The MD5 Message-Digest Algorithm",
+ RFC 1321, MIT Laboratory for Computer Science, RSA Data
+ Security Inc., April 1992.
+
+ [2] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
+ USC/Information Sciences Institute, August 1980.
+
+ [3] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC
+ 1700, USC/Information Sciences Institute, October 1994.
+
+ [4] Kaufman, C., Perlman, R., and Speciner, M., "Network Security:
+ Private Communications in a Public World", Prentice Hall, March
+ 1995, ISBN 0-13-061466-1.
+
+ [5] Jacobson, V., "Compressing TCP/IP headers for low-speed serial
+ links", RFC 1144, Lawrence Berkeley Laboratory, February 1990.
+
+ [6] ISO 8859. International Standard -- Information Processing --
+ 8-bit Single-Byte Coded Graphic Character Sets -- Part 1: Latin
+ Alphabet No. 1, ISO 8859-1:1987.
+ <URL:http://www.iso.ch/cate/d16338.html>
+
+ [7] Sklower, K., Lloyd, B., McGregor, G., and Carr, D., "The PPP
+ Multilink Protocol (MP)", RFC 1717, University of California
+ Berkeley, Lloyd Internetworking, Newbridge Networks
+ Corporation, November 1994.
+
+ [8] Galvin, J., McCloghrie, K., and Davin, J., "SNMP Security
+ Protocols", RFC 1352, Trusted Information Systems, Inc., Hughes
+ LAN Systems, Inc., MIT Laboratory for Computer Science, July
+ 1992.
+
+ [9] Rigney, C., "RADIUS Accounting", RFC 2139, April 1997.
+
+Acknowledgments
+
+ RADIUS was originally developed by Livingston Enterprises for their
+ PortMaster series of Network Access Servers.
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 64]
+
+RFC 2138 RADIUS April 1997
+
+
+Chair's Address
+
+ The working group can be contacted via the current chair:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ Phone: +1 510 426 0770
+ EMail: cdr@livingston.com
+
+Authors' Addresses
+
+ Questions about this memo can also be directed to:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ Phone: +1 510 426 0770
+ EMail: cdr@livingston.com
+
+ Allan C. Rubens
+ Merit Network, Inc.
+ 4251 Plymouth Road
+ Ann Arbor, Michigan 48105-2785
+
+ EMail: acr@merit.edu
+
+ William Allen Simpson
+ Daydreamer
+ Computer Systems Consulting Services
+ 1384 Fontaine
+ Madison Heights, Michigan 48071
+
+ EMail: wsimpson@greendragon.com
+
+ Steve Willens
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ EMail: steve@livingston.com
+
+
+
+
+
+
+Rigney, et. al. Standards Track [Page 65]
+
diff --git a/rfc/rfc2139.txt b/rfc/rfc2139.txt
new file mode 100644
index 0000000..88c5af8
--- /dev/null
+++ b/rfc/rfc2139.txt
@@ -0,0 +1,1403 @@
+
+
+
+
+
+
+Network Working Group C. Rigney
+Request for Comments: 2139 Livingston
+Obsoletes: 2059 April 1997
+Category: Informational
+
+
+ RADIUS Accounting
+
+Status of this Memo
+
+ This memo provides information for the Internet community. This memo
+ does not specify an Internet standard of any kind. Distribution of
+ this memo is unlimited.
+
+Abstract
+
+ This document describes a protocol for carrying accounting
+ information between a Network Access Server and a shared Accounting
+ Server.
+
+Implementation Note
+
+ This memo documents the RADIUS Accounting protocol. There has been
+ some confusion in the assignment of port numbers for this protocol.
+ The early deployment of RADIUS Accounting was done using the
+ erroneously chosen port number 1646, which conflicts with the "sa-
+ msg-port" service. The officially assigned port number for RADIUS
+ Accounting is 1813.
+
+Table of Contents
+
+ 1. Introduction .......................................... 2
+ 1.1 Specification of Requirements ................... 3
+ 1.2 Terminology ..................................... 3
+ 2. Operation ............................................. 4
+ 3. Packet Format ......................................... 5
+ 4. Packet Types .......................................... 7
+ 4.1 Accounting-Request .............................. 7
+ 4.2 Accounting-Response ............................. 8
+ 5. Attributes ............................................ 10
+ 5.1 Acct-Status-Type ................................ 11
+ 5.2 Acct-Delay-Time ................................. 12
+ 5.3 Acct-Input-Octets ............................... 13
+ 5.4 Acct-Output-Octets .............................. 14
+ 5.5 Acct-Session-Id ................................. 14
+ 5.6 Acct-Authentic .................................. 15
+ 5.7 Acct-Session-Time ............................... 16
+ 5.8 Acct-Input-Packets .............................. 16
+
+
+
+Rigney Informational [Page 1]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ 5.9 Acct-Output-Packets ............................. 17
+ 5.10 Acct-Terminate-Cause ............................ 18
+ 5.11 Acct-Multi-Session-Id ........................... 20
+ 5.12 Acct-Link-Count ................................. 21
+ 5.13 Table of Attributes ............................. 22
+ Security Considerations ...................................... 24
+ References ................................................... 24
+ Acknowledgements ............................................. 24
+ Chair's Address .............................................. 24
+ Author's Address ............................................. 25
+
+1. Introduction
+
+ Managing dispersed serial line and modem pools for large numbers of
+ users can create the need for significant administrative support.
+ Since modem pools are by definition a link to the outside world, they
+ require careful attention to security, authorization and accounting.
+ This can be best achieved by managing a single "database" of users,
+ which allows for authentication (verifying user name and password) as
+ well as configuration information detailing the type of service to
+ deliver to the user (for example, SLIP, PPP, telnet, rlogin).
+
+ The RADIUS (Remote Authentication Dial In User Service) document [4]
+ specifies the RADIUS protocol used for Authentication and
+ Authorization. This memo extends the use of the RADIUS protocol to
+ cover delivery of accounting information from the Network Access
+ Server (NAS) to a RADIUS accounting server.
+
+ Key features of RADIUS Accounting are:
+
+ Client/Server Model
+
+ A Network Access Server (NAS) operates as a client of the
+ RADIUS accounting server. The client is responsible for
+ passing user accounting information to a designated RADIUS
+ accounting server.
+
+ The RADIUS accounting server is responsible for receiving the
+ accounting request and returning a response to the client
+ indicating that it has successfully received the request.
+
+ The RADIUS accounting server can act as a proxy client to other
+ kinds of accounting servers.
+
+
+
+
+
+
+
+
+Rigney Informational [Page 2]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ Network Security
+
+ Transactions between the client and RADIUS accounting server
+ are authenticated through the use of a shared secret, which is
+ never sent over the network.
+
+ Extensible Protocol
+
+ All transactions are comprised of variable length Attribute-
+ Length-Value 3-tuples. New attribute values can be added
+ without disturbing existing implementations of the protocol.
+
+1.1. Specification of Requirements
+
+ In this document, several words are used to signify the requirements
+ of the specification. These words are often capitalized.
+
+ MUST This word, or the adjective "required", means that the
+ definition is an absolute requirement of the specification.
+
+ MUST NOT This phrase means that the definition is an absolute
+ prohibition of the specification.
+
+ SHOULD This word, or the adjective "recommended", means that there
+ may exist valid reasons in particular circumstances to
+ ignore this item, but the full implications must be
+ understood and carefully weighed before choosing a
+ different course.
+
+ MAY This word, or the adjective "optional", means that this
+ item is one of an allowed set of alternatives. An
+ implementation which does not include this option MUST be
+ prepared to interoperate with another implementation which
+ does include the option.
+
+1.2. Terminology
+
+ This document uses the following terms:
+
+ service The NAS provides a service to the dial-in user, such as PPP
+ or Telnet.
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 3]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ session Each service provided by the NAS to a dial-in user
+ constitutes a session, with the beginning of the session
+ defined as the point where service is first provided and
+ the end of the session defined as the point where service
+ is ended. A user may have multiple sessions in parallel or
+ series if the NAS supports that, with each session
+ generating a separate start and stop accounting record with
+ its own Acct-Session-Id.
+
+ silently discard
+ This means the implementation discards the packet without
+ further processing. The implementation SHOULD provide the
+ capability of logging the error, including the contents of
+ the silently discarded packet, and SHOULD record the event
+ in a statistics counter.
+
+2. Operation
+
+ When a client is configured to use RADIUS Accounting, at the start of
+ service delivery it will generate an Accounting Start packet
+ describing the type of service being delivered and the user it is
+ being delivered to, and will send that to the RADIUS Accounting
+ server, which will send back an acknowledgement that the packet has
+ been received. At the end of service delivery the client will
+ generate an Accounting Stop packet describing the type of service
+ that was delivered and optionally statistics such as elapsed time,
+ input and output octets, or input and output packets. It will send
+ that to the RADIUS Accounting server, which will send back an
+ acknowledgement that the packet has been received.
+
+ The Accounting-Request (whether for Start or Stop) is submitted to
+ the RADIUS accounting server via the network. It is recommended that
+ the client continue attempting to send the Accounting-Request packet
+ until it receives an acknowledgement, using some form of backoff. If
+ no response is returned within a length of time, the request is re-
+ sent a number of times. The client can also forward requests to an
+ alternate server or servers in the event that the primary server is
+ down or unreachable. An alternate server can be used either after a
+ number of tries to the primary server fail, or in a round-robin
+ fashion. Retry and fallback algorithms are the topic of current
+ research and are not specified in detail in this document.
+
+ The RADIUS accounting server MAY make requests of other servers in
+ order to satisfy the request, in which case it acts as a client.
+
+ If the RADIUS accounting server is unable to successfully record the
+ accounting packet it MUST NOT send an Accounting-Response
+ acknowledgment to the client.
+
+
+
+Rigney Informational [Page 4]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+3. Packet Format
+
+ Exactly one RADIUS Accounting packet is encapsulated in the UDP Data
+ field [1], where the UDP Destination Port field indicates 1813
+ (decimal).
+
+ When a reply is generated, the source and destination ports are
+ reversed.
+
+ This memo documents the RADIUS Accounting protocol. There has been
+ some confusion in the assignment of port numbers for this protocol.
+ The early deployment of RADIUS Accounting was done using the
+ erroneously chosen port number 1646, which conflicts with the "sa-
+ msg-port" service. The officially assigned port number for RADIUS
+ Accounting is 1813.
+
+ A summary of the RADIUS data format is shown below. The fields are
+ transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| Code | Identifier | Length |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| |
+| Authenticator |
+| |
+| |
++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+| Attributes ...
++-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+Code
+
+ The Code field is one octet, and identifies the type of RADIUS
+ packet. When a packet is received with an invalid Code field, it is
+ silently discarded.
+
+ RADIUS Accounting Codes (decimal) are assigned as follows:
+
+ 4 Accounting-Request
+ 5 Accounting-Response
+
+Identifier
+
+ The Identifier field is one octet, and aids in matching requests and
+ replies.
+
+
+
+Rigney Informational [Page 5]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+Length
+
+ The Length field is two octets. It indicates the length of the
+ packet including the Code, Identifier, Length, Authenticator and
+ Attribute fields. Octets outside the range of the Length field
+ should be treated as padding and should be ignored on reception. If
+ the packet is shorter than the Length field indicates, it should be
+ silently discarded. The minimum length is 20 and maximum length is
+ 4096.
+
+Authenticator
+
+ The Authenticator field is sixteen (16) octets. The most significant
+ octet is transmitted first. This value is used to authenticate the
+ messages between the client and RADIUS accounting server.
+
+Request Authenticator
+
+ In Accounting-Request Packets, the Authenticator value is a 16 octet
+ MD5 [3] checksum, called the Request Authenticator.
+
+ The NAS and RADIUS accounting server share a secret. The Request
+ Authenticator field in Accounting-Request packets contains a one- way
+ MD5 hash calculated over a stream of octets consisting of the Code +
+ Identifier + Length + 16 zero octets + request attributes + shared
+ secret (where + indicates concatenation). The 16 octet MD5 hash
+ value is stored in the Authenticator field of the Accounting-Request
+ packet.
+
+ Note that the Request Authenticator of an Accounting-Request can
+ not be done the same way as the Request Authenticator of a RADIUS
+ Access-Request, because there is no User-Password attribute in an
+ Accounting-Request.
+
+Response Authenticator
+
+ The Authenticator field in an Accounting-Response packet is called
+ the Response Authenticator, and contains a one-way MD5 hash
+ calculated over a stream of octets consisting of the Accounting-
+ Response Code, Identifier, Length, the Request Authenticator field
+ from the Accounting-Request packet being replied to, and the response
+ attributes if any, followed by the shared secret. The resulting 16
+ octet MD5 hash value is stored in the Authenticator field of the
+ Accounting-Response packet.
+
+
+
+
+
+
+
+Rigney Informational [Page 6]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+Attributes
+
+ Attributes may have multiple instances, in such a case the order of
+ attributes of the same type SHOULD be preserved. The order of
+ attributes of different types is not required to be preserved.
+
+4. Packet Types
+
+ The RADIUS packet type is determined by the Code field in the first
+ octet of the packet.
+
+4.1. Accounting-Request
+
+ Description
+
+ Accounting-Request packets are sent from a client (typically a
+ Network Access Server or its proxy) to a RADIUS accounting server,
+ and convey information used to provide accounting for a service
+ provided to a user. The client transmits a RADIUS packet with the
+ Code field set to 4 (Accounting-Request).
+
+ Upon receipt of an Accounting-Request, the server MUST transmit an
+ Accounting-Response reply if it successfully records the
+ accounting packet, and MUST NOT transmit any reply if it fails to
+ record the accounting packet.
+
+ Any attribute valid in a RADIUS Access-Request or Access-Accept
+ packet is valid in a RADIUS Accounting-Request packet, except that
+ the following attributes MUST NOT be present in an Accounting-
+ Request: User-Password, CHAP-Password, Reply-Message, State.
+ Either NAS-IP-Address or NAS-Identifier MUST be present in a
+ RADIUS Accounting-Request. It SHOULD contain a NAS-Port or NAS-
+ Port-Type attribute or both unless the service does not involve a
+ port or the NAS does not distinguish among its ports.
+
+ A summary of the Accounting-Request packet format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 7]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Request Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 4 for Accounting-Request.
+
+ Identifier
+
+ The Identifier field MUST be changed whenever the content of the
+ Attributes field changes, and whenever a valid reply has been
+ received for a previous request. For retransmissions where the
+ contents are identical, the Identifier MUST remain unchanged.
+
+ Note that if Acct-Delay-Time is included in the attributes of an
+ Accounting-Request then the Acct-Delay-Time value will be updated
+ when the packet is retransmitted, changing the content of the
+ Attributes field and requiring a new Identifier and Request
+ Authenticator.
+
+ Request Authenticator
+
+ The Request Authenticator of an Accounting-Request contains a 16-
+ octet MD5 hash value calculated according to the method described
+ in "Request Authenticator" above.
+
+ Attributes
+
+ The Attributes field is variable in length, and contains a list of
+ Attributes.
+
+4.2. Accounting-Response
+
+ Description
+
+ Accounting-Response packets are sent by the RADIUS accounting
+ server to the client to acknowledge that the Accounting-Request
+ has been received and recorded successfully. If the Accounting-
+
+
+
+Rigney Informational [Page 8]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ Request was recorded successfully then the RADIUS accounting
+ server MUST transmit a packet with the Code field set to 5
+ (Accounting-Response). On reception of an Accounting-Response by
+ the client, the Identifier field is matched with a pending
+ Accounting-Request. Invalid packets are silently discarded.
+
+ A RADIUS Accounting-Response is not required to have any
+ attributes in it.
+
+ A summary of the Accounting-Response packet format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Response Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 5 for Accounting-Response.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Accounting-Request which caused this Accounting-Response.
+
+ Response Authenticator
+
+ The Response Authenticator of an Accounting-Response contains a
+ 16-octet MD5 hash value calculated according to the method
+ described in "Response Authenticator" above.
+
+ Attributes
+
+ The Attributes field is variable in length, and contains a list of
+ zero or more Attributes.
+
+
+
+
+
+
+
+Rigney Informational [Page 9]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+5. Attributes
+
+ RADIUS Attributes carry the specific authentication, authorization
+ and accounting details for the request and response.
+
+ Some attributes MAY be included more than once. The effect of this
+ is attribute specific, and is specified in each attribute
+ description.
+
+ The end of the list of attributes is indicated by the Length of the
+ RADIUS packet.
+
+ A summary of the attribute format is shown below. The fields are
+ transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ The Type field is one octet. Up-to-date values of the RADIUS Type
+ field are specified in the most recent "Assigned Numbers" RFC [2].
+ Values 192-223 are reserved for experimental use, values 224-240
+ are reserved for implementation-specific use, and values 241-255
+ are reserved and should not be used. This specification concerns
+ the following values:
+
+ 1-39 (refer to RADIUS document [4])
+ 40 Acct-Status-Type
+ 41 Acct-Delay-Time
+ 42 Acct-Input-Octets
+ 43 Acct-Output-Octets
+ 44 Acct-Session-Id
+ 45 Acct-Authentic
+ 46 Acct-Session-Time
+ 47 Acct-Input-Packets
+ 48 Acct-Output-Packets
+ 49 Acct-Terminate-Cause
+ 50 Acct-Multi-Session-Id
+ 51 Acct-Link-Count
+ 60+ (refer to RADIUS document [4])
+
+
+
+
+
+
+
+Rigney Informational [Page 10]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ Length
+
+ The Length field is one octet, and indicates the length of this
+ attribute including the Type, Length and Value fields. If an
+ attribute is received in an Accounting-Request with an invalid
+ Length, the entire request should be silently discarded.
+
+ Value
+
+ The Value field is zero or more octets and contains information
+ specific to the attribute. The format and length of the Value
+ field is determined by the Type and Length fields.
+
+ The format of the value field is one of four data types.
+
+ string 0-253 octets
+
+ address 32 bit value, most significant octet first.
+
+ integer 32 bit value, most significant octet first.
+
+ time 32 bit value, most significant octet first -- seconds
+ since 00:00:00 GMT, January 1, 1970. The standard
+ Attributes do not use this data type but it is presented
+ here for possible use within Vendor-Specific attributes.
+
+5.1. Acct-Status-Type
+
+ Description
+
+ This attribute indicates whether this Accounting-Request marks the
+ beginning of the user service (Start) or the end (Stop).
+
+ It MAY be used by the client to mark the start of accounting (for
+ example, upon booting) by specifying Accounting-On and to mark the
+ end of accounting (for example, just before a scheduled reboot) by
+ specifying Accounting-Off.
+
+ A summary of the Acct-Status-Type attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+Rigney Informational [Page 11]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ Type
+
+ 40 for Acct-Status-Type.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 1 Start
+ 2 Stop
+ 7 Accounting-On
+ 8 Accounting-Off
+
+5.2. Acct-Delay-Time
+
+ Description
+
+ This attribute indicates how many seconds the client has been
+ trying to send this record for, and can be subtracted from the
+ time of arrival on the server to find the approximate time of the
+ event generating this Accounting-Request. (Network transit time
+ is ignored.)
+
+ Note that changing the Acct-Delay-Time causes the Identifier to
+ change; see the discussion under Identifier above.
+
+ A summary of the Acct-Delay-Time attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 41 for Acct-Delay-Time.
+
+ Length
+
+ 6
+
+
+
+Rigney Informational [Page 12]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ Value
+
+ The Value field is four octets.
+
+5.3. Acct-Input-Octets
+
+ Description
+
+ This attribute indicates how many octets have been received from
+ the port over the course of this service being provided, and can
+ only be present in Accounting-Request records where the Acct-
+ Status-Type is set to Stop.
+
+ A summary of the Acct-Input-Octets attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 42 for Acct-Input-Octets.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.4. Acct-Output-Octets
+
+ Description
+
+ This attribute indicates how many octets have been sent to the
+ port in the course of delivering this service, and can only be
+ present in Accounting-Request records where the Acct-Status-Type
+ is set to Stop.
+
+ A summary of the Acct-Output-Octets attribute format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+
+Rigney Informational [Page 13]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 43 for Acct-Output-Octets.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.5. Acct-Session-Id
+
+ Description
+
+ This attribute is a unique Accounting ID to make it easy to match
+ start and stop records in a log file. The start and stop records
+ for a given session MUST have the same Acct-Session-Id. It is
+ strongly recommended that the Acct-Session-Id be a printable ASCII
+ string.
+
+ For example, one implementation uses a string with an 8-digit
+ upper case hexadecimal number, the first two digits increment on
+ each reboot (wrapping every 256 reboots) and the next 6 digits
+ counting from 0 for the first person logging in after a reboot up
+ to 2^24-1, about 16 million. Other encodings are possible.
+
+ A summary of the Acct-Session-Id attribute format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 14]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 44 for Acct-Session-Id.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field SHOULD be a string of printable ASCII characters.
+
+5.6. Acct-Authentic
+
+ Description
+
+ This attribute MAY be included in an Accounting-Request to
+ indicate how the user was authenticated, whether by RADIUS, the
+ NAS itself, or another remote authentication protocol. Users who
+ are delivered service without being authenticated SHOULD NOT
+ generate Accounting records.
+
+ A summary of the Acct-Authentic attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 45 for Acct-Authentic.
+
+ Length
+
+ 6
+
+
+
+
+
+Rigney Informational [Page 15]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ Value
+
+ The Value field is four octets.
+
+ 1 RADIUS
+ 2 Local
+ 3 Remote
+
+5.7. Acct-Session-Time
+
+ Description
+
+ This attribute indicates how many seconds the user has received
+ service for, and can only be present in Accounting-Request records
+ where the Acct-Status-Type is set to Stop.
+
+ A summary of the Acct-Session-Time attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 46 for Acct-Session-Time.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.8. Acct-Input-Packets
+
+ Description
+
+ This attribute indicates how many packets have been received from
+ the port over the course of this service being provided to a
+ Framed User, and can only be present in Accounting-Request records
+ where the Acct-Status-Type is set to Stop.
+
+
+
+
+Rigney Informational [Page 16]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ A summary of the Acct-Input-packets attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 47 for Acct-Input-Packets.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.9. Acct-Output-Packets
+
+ Description
+
+ This attribute indicates how many packets have been sent to the
+ port in the course of delivering this service to a Framed User,
+ and can only be present in Accounting-Request records where the
+ Acct-Status-Type is set to Stop.
+
+ A summary of the Acct-Output-Packets attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 48 for Acct-Output-Packets.
+
+
+
+
+
+Rigney Informational [Page 17]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.10. Acct-Terminate-Cause
+
+ Description
+
+ This attribute indicates how the session was terminated, and can
+ only be present in Accounting-Request records where the Acct-
+ Status-Type is set to Stop.
+
+ A summary of the Acct-Terminate-Cause attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 49 for Acct-Terminate-Cause
+
+ Length
+
+ 6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 18]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ Value
+
+ The Value field is four octets, containing an integer specifying
+ the cause of session termination, as follows:
+
+ 1 User Request
+ 2 Lost Carrier
+ 3 Lost Service
+ 4 Idle Timeout
+ 5 Session Timeout
+ 6 Admin Reset
+ 7 Admin Reboot
+ 8 Port Error
+ 9 NAS Error
+ 10 NAS Request
+ 11 NAS Reboot
+ 12 Port Unneeded
+ 13 Port Preempted
+ 14 Port Suspended
+ 15 Service Unavailable
+ 16 Callback
+ 17 User Error
+ 18 Host Request
+
+
+
+ The termination causes are as follows:
+
+ User Request User requested termination of service, for
+ example with LCP Terminate or by logging out.
+
+ Lost Carrier DCD was dropped on the port.
+
+ Lost Service Service can no longer be provided; for
+ example, user's connection to a host was
+ interrupted.
+
+ Idle Timeout Idle timer expired.
+
+ Session Timeout Maximum session length timer expired.
+
+ Admin Reset Administrator reset the port or session.
+
+ Admin Reboot Administrator is ending service on the NAS,
+ for example prior to rebooting the NAS.
+
+ Port Error NAS detected an error on the port which
+ required ending the session.
+
+
+
+Rigney Informational [Page 19]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ NAS Error NAS detected some error (other than on the
+ port) which required ending the session.
+
+ NAS Request NAS ended session for a non-error reason not
+ otherwise listed here.
+
+ NAS Reboot The NAS ended the session in order to reboot
+ non-administratively ("crash").
+
+ Port Unneeded NAS ended session because resource usage fell
+ below low-water mark (for example, if a
+ bandwidth-on-demand algorithm decided that
+ the port was no longer needed).
+
+ Port Preempted NAS ended session in order to allocate the
+ port to a higher priority use.
+
+ Port Suspended NAS ended session to suspend a virtual
+ session.
+
+ Service Unavailable NAS was unable to provide requested service.
+
+ Callback NAS is terminating current session in order
+ to perform callback for a new session.
+
+ User Error Input from user is in error, causing
+ termination of session.
+
+ Host Request Login Host terminated session normally.
+
+5.11. Acct-Multi-Session-Id
+
+ Description
+
+ This attribute is a unique Accounting ID to make it easy to link
+ together multiple related sessions in a log file. Each session
+ linked together would have a unique Acct-Session-Id but the same
+ Acct-Multi-Session-Id. It is strongly recommended that the Acct-
+ Multi-Session-Id be a printable ASCII string.
+
+ A summary of the Acct-Session-Id attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+Rigney Informational [Page 20]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ Type
+
+ 50 for Acct-Multi-Session-Id.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field SHOULD be a string of printable ASCII characters.
+
+5.12. Acct-Link-Count
+
+ Description
+
+ This attribute gives the count of links which are known to have
+ been in a given multilink session at the time the accounting
+ record is generated. The NAS MAY include the Acct-Link-Count
+ attribute in any Accounting-Request which might have multiple
+ links.
+
+ A summary of the Acct-Link-Count attribute format is show below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 51 for Acct-Link-Count.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets, and contains the number of links
+ seen so far in this Multilink Session.
+
+
+
+
+
+
+Rigney Informational [Page 21]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ It may be used to make it easier for an accounting server to know
+ when it has all the records for a given Multilink session. When
+ the number of Accounting-Requests received with Acct-Status-Type =
+ Stop and the same Acct-Multi-Session-Id and unique Acct-Session-
+ Id's equals the largest value of Acct-Link-Count seen in those
+ Accounting-Requests, all Stop Accounting-Requests for that
+ Multilink Session have been received.
+
+ An example showing 8 Accounting-Requests should make things
+ clearer. For clarity only the relevant attributes are shown, but
+ additional attributes containing accounting information will also
+ be present in the Accounting-Request.
+
+ Multi-Session-Id Session-Id Status-Type Link-Count
+ "10" "10" Start 1
+ "10" "11" Start 2
+ "10" "11" Stop 2
+ "10" "12" Start 3
+ "10" "13" Start 4
+ "10" "12" Stop 4
+ "10" "13" Stop 4
+ "10" "10" Stop 4
+
+5.13. Table of Attributes
+
+ The following table provides a guide to which attributes may be found
+ in Accounting-Request packets. No attributes should be found in
+ Accounting-Response packets except Proxy-State and possibly Vendor-
+ Specific.
+
+ # Attribute
+ 0-1 User-Name
+ 0 User-Password
+ 0 CHAP-Password
+ 0-1 NAS-IP-Address [5]
+ 0-1 NAS-Port
+ 0-1 Service-Type
+ 0-1 Framed-Protocol
+ 0-1 Framed-IP-Address
+ 0-1 Framed-IP-Netmask
+ 0-1 Framed-Routing
+ 0+ Filter-Id
+ 0-1 Framed-MTU
+ 0+ Framed-Compression
+ 0+ Login-IP-Host
+ 0-1 Login-Service
+ 0-1 Login-TCP-Port
+ 0 Reply-Message
+
+
+
+Rigney Informational [Page 22]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+ 0-1 Callback-Number
+ 0-1 Callback-Id
+ 0+ Framed-Route
+ 0-1 Framed-IPX-Network
+ 0 State
+ 0+ Class
+ 0+ Vendor-Specific
+ 0-1 Session-Timeout
+ 0-1 Idle-Timeout
+ 0-1 Termination-Action
+ 0-1 Called-Station-Id
+ 0-1 Calling-Station-Id
+ 0-1 NAS-Identifier [4]
+ 0+ Proxy-State
+ 0-1 Login-LAT-Service
+ 0-1 Login-LAT-Node
+ 0-1 Login-LAT-Group
+ 0-1 Framed-AppleTalk-Link
+ 0-1 Framed-AppleTalk-Network
+ 0-1 Framed-AppleTalk-Zone
+ 1 Acct-Status-Type
+ 0-1 Acct-Delay-Time
+ 0-1 Acct-Input-Octets
+ 0-1 Acct-Output-Octets
+ 1 Acct-Session-Id
+ 0-1 Acct-Authentic
+ 0-1 Acct-Session-Time
+ 0-1 Acct-Input-Packets
+ 0-1 Acct-Output-Packets
+ 0-1 Acct-Terminate-Cause
+ 0+ Acct-Multi-Session-Id
+ 0+ Acct-Link-Count
+ 0 CHAP-Challenge
+ 0-1 NAS-Port-Type
+ 0-1 Port-Limit
+ 0-1 Login-LAT-Port
+
+
+ [5] An Accounting-Request MUST contain either a NAS-IP-Address or a
+ NAS-Identifier, and it is permitted (but not recommended) for it to
+ contain both.
+
+ The following table defines the above table entries.
+
+ 0 This attribute MUST NOT be present
+ 0+ Zero or more instances of this attribute MAY be present.
+ 0-1 Zero or one instance of this attribute MAY be present.
+ 1 Exactly one instance of this attribute MUST be present.
+
+
+
+Rigney Informational [Page 23]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+Security Considerations
+
+ Security issues are briefly discussed in sections concerning the
+ authenticator included in accounting requests and responses, using a
+ shared secret which is never sent over the network.
+
+References
+
+ [1] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
+ USC/Information Sciences Institute, August 1980.
+
+ [2] Reynolds, J., and Postel, J., "Assigned Numbers", STD 2, RFC
+ 1700, USC/Information Sciences Institute, October 1994.
+
+ [3] Rivest, R., and Dusse, S., "The MD5 Message-Digest Algorithm",
+ RFC 1321, MIT Laboratory for Computer Science, RSA Data
+ Security Inc., April 1992.
+
+ [4] Rigney, C., Rubens, A., Simpson, W., and Willens, S., "Remote
+ Authentication Dial In User Service (RADIUS)", RFC 2138,
+ April 1997.
+
+Acknowledgments
+
+ RADIUS and RADIUS Accounting were originally developed by Livingston
+ Enterprises for their PortMaster series of Network Access Servers.
+
+Chair's Address
+
+ The RADIUS working group can be contacted via the current chair:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ Phone: +1 510 426 0770
+ EMail: cdr@livingston.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 24]
+
+RFC 2139 RADIUS Accounting April 1997
+
+
+Author's Address
+
+ Questions about this memo can also be directed to:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ EMail: cdr@livingston.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 25]
+
diff --git a/doc/rfc2284.txt b/rfc/rfc2284.txt
index 9940562..9940562 100644
--- a/doc/rfc2284.txt
+++ b/rfc/rfc2284.txt
diff --git a/doc/rfc2433.txt b/rfc/rfc2433.txt
index 3536e72..3536e72 100644
--- a/doc/rfc2433.txt
+++ b/rfc/rfc2433.txt
diff --git a/rfc/rfc2548.txt b/rfc/rfc2548.txt
new file mode 100644
index 0000000..35c83c3
--- /dev/null
+++ b/rfc/rfc2548.txt
@@ -0,0 +1,2299 @@
+
+
+
+
+
+
+Network Working Group G. Zorn
+Request for Comments: 2548 Microsoft Corporation
+Category: Informational March 1999
+
+
+ Microsoft Vendor-specific RADIUS Attributes
+
+Status of this Memo
+
+ This memo provides information for the Internet community. It does
+ not specify an Internet standard of any kind. Distribution of this
+ memo is unlimited.
+
+Copyright Notice
+
+ Copyright (C) The Internet Society (1999). All Rights Reserved.
+
+Abstract
+
+ This document describes the set of Microsoft vendor-specific RADIUS
+ attributes. These attributes are designed to support Microsoft
+ proprietary dial-up protocols and/or provide support for features
+ which is not provided by the standard RADIUS attribute set [3]. It
+ is expected that this memo will be updated whenever Microsoft defines
+ a new vendor-specific attribute, since its primary purpose is to
+ provide an open, easily accessible reference for third-parties
+ wishing to interoperate with Microsoft products.
+
+1. Specification of Requirements
+
+ In this document, the key words "MAY", "MUST, "MUST NOT", "optional",
+ "recommended", "SHOULD", and "SHOULD NOT" are to be interpreted as
+ described in [2].
+
+2. Attributes
+
+ The following sections describe sub-attributes which may be
+ transmitted in one or more RADIUS attributes of type Vendor-Specific
+ [3]. More than one sub-attribute MAY be transmitted in a single
+ Vendor-Specific Attribute; if this is done, the sub-attributes SHOULD
+ be packed as a sequence of Vendor-Type/Vendor-Length/Value triples
+ following the inital Type, Length and Vendor-ID fields. The Length
+ field of the Vendor-Specific Attribute MUST be set equal to the sum
+ of the Vendor-Length fields of the sub-attributes contained in the
+ Vendor-Specific Attribute, plus six. The Vendor-ID field of the
+ Vendor-Specific Attribute(s) MUST be set to decimal 311 (Microsoft).
+
+
+
+
+
+Zorn Informational [Page 1]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+2.1. Attributes for Support of MS-CHAP Version 1
+
+2.1.1. Introduction
+
+ Microsoft created Microsoft Challenge-Handshake Authentication
+ Protocol (MS-CHAP) [4] to authenticate remote Windows workstations,
+ providing the functionality to which LAN-based users are accustomed.
+ Where possible, MS-CHAP is consistent with standard CHAP [5], and the
+ differences are easily modularized. Briefly, the differences between
+ MS-CHAP and standard CHAP are:
+
+ * MS-CHAP is enabled by negotiating CHAP Algorithm 0x80 in LCP
+ option 3, Authentication Protocol.
+
+ * The MS-CHAP Response packet is in a format designed for
+ compatibility with Microsoft Windows NT 3.5, 3.51 and 4.0,
+ Microsoft Windows95, and Microsoft LAN Manager 2.x networking
+ products. The MS-CHAP format does not require the authenticator
+ to store a clear-text or reversibly encrypted password.
+
+ * MS-CHAP provides an authenticator-controlled authentication
+ retry mechanism.
+
+ * MS-CHAP provides an authenticator-controlled password changing
+ mechanism.
+
+ * MS-CHAP defines an extended set of reason-for-failure codes,
+ returned in the Failure packet Message field.
+
+ The attributes defined in this section reflect these differences.
+
+2.1.2. MS-CHAP-Challenge
+
+ Description
+
+ This Attribute contains the challenge sent by a NAS to a Microsoft
+ Challenge-Handshake Authentication Protocol (MS-CHAP) user. It
+ MAY be used in both Access-Request and Access-Challenge packets.
+
+ A summary of the MS-CHAP-Challenge Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 2]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 11 for MS-CHAP-Challenge.
+
+ Vendor-Length
+ > 2
+
+ String
+ The String field contains the MS-CHAP challenge.
+
+2.1.3. MS-CHAP-Response
+
+ Description
+
+ This Attribute contains the response value provided by a PPP
+ Microsoft Challenge-Handshake Authentication Protocol (MS-CHAP)
+ user in response to the challenge. It is only used in Access-
+ Request packets.
+
+ A summary of the MS-CHAP-Response Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 3]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Ident | Flags |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | LM-Response
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response(cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | NT-Response
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 1 for MS-CHAP-Response.
+
+ Vendor-Length
+ 52
+
+ Ident
+ Identical to the PPP CHAP Identifier.
+
+ Flags
+ The Flags field is one octet in length. If the Flags field is one
+ (0x01), the NT-Response field is to be used in preference to the
+ LM-Response field for authentication. The LM-Response field MAY
+ still be used (if non-empty), but the NT-Response SHOULD be tried
+ first. If it is zero, the NT-Response field MUST be ignored and
+ the LM-Response field used.
+
+
+
+
+
+Zorn Informational [Page 4]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ LM-Response
+ The LM-Response field is 24 octets in length and holds an encoded
+ function of the password and the received challenge. If this
+ field is empty, it SHOULD be zero-filled.
+
+ NT-Response
+
+ The NT-Response field is 24 octets in length and holds an encoded
+ function of the password and the received challenge. If this
+ field is empty, it SHOULD be zero-filled.
+
+2.1.4. MS-CHAP-Domain
+
+ Description
+
+ The MS-CHAP-Domain Attribute indicates the Windows NT domain in
+ which the user was authenticated. It MAY be included in both
+ Access-Accept and Accounting-Request packets.
+
+ A summary of the MS-CHAP-Domain Attribute format is given below. The
+ fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Ident | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 10 for MS-CHAP-Domain.
+
+ Vendor-Length
+ > 3
+
+ Ident
+ The Ident field is one octet and aids in matching requests and
+ replies.
+
+ String
+ This field contains the name in ASCII of the Windows NT domain in
+ which the user was authenticated.
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 5]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+2.1.5. MS-CHAP-Error
+
+ Description
+
+ The MS-CHAP-Error Attribute contains error data related to the
+ preceding MS-CHAP exchange. This Attribute may be used in both
+ MS-CHAP-V1 and MS-CHAP-V2 (see below) exchanges. It is only used
+ in Access-Reject packets.
+
+ A summary of the MS-CHAP-Error Attribute format is given below. The
+ fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Ident | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 2 for MS-CHAP-Error.
+
+ Vendor-Length
+ > 3
+
+ Ident
+ The Ident field is one octet and aids in matching requests and
+ replies.
+
+ String
+ This field contains specially formatted ASCII text, which is
+ interpreted by the authenticating peer.
+
+2.1.6. MS-CHAP-CPW-1
+
+ Description
+
+ This Attribute allows the user to change their password if it has
+ expired. This Attribute is only used in Access-Request packets, and
+ should only be included if an MS-CHAP-Error attribute was included in
+ the immediately preceding Access-Reject packet, the String field of
+ the MS-CHAP-Error attribute indicated that the user password had
+ expired, and the MS-CHAP version is less than 2.
+
+ A summary of the MS-CHAP-CPW-1 Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+
+
+
+
+
+Zorn Informational [Page 6]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Code | Ident |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | LM-Old-Password
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Old-Password (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Old-Password (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Old-Password (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | LM-New-Password
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-New-Password (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-New-Password (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-New-Password (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | NT-Old-Password
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Old-Password (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Old-Password (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Old-Password (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | NT-New-Password
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-New-Password (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-New-Password (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-New-Password (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | New-LM-Password-Length | Flags |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 3 for MS-CHAP-PW-1
+
+ Vendor-Length
+ 72
+
+ Code
+ The Code field is one octet in length. Its value is always 5.
+
+
+
+Zorn Informational [Page 7]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ Ident
+ The Ident field is one octet and aids in matching requests and
+ replies.
+
+ LM-Old-Password
+ The LM-Old-Password field is 16 octets in length. It contains the
+ encrypted Lan Manager hash of the old password.
+
+ LM-New-Password
+ The LM-New-Password field is 16 octets in length. It contains the
+ encrypted Lan Manager hash of the new password.
+
+ NT-Old-Password
+ The NT-Old-Password field is 16 octets in length. It contains the
+ encrypted Lan Manager hash of the old password.
+
+ NT-New-Password
+ The NT-New-Password field is 16 octets in length. It contains the
+ encrypted Lan Manager hash of the new password.
+
+ New-LM-Password-Length
+ The New-LM-Password-Length field is two octets in length and
+ contains the length in octets of the new LAN Manager-compatible
+ password.
+
+ Flags
+ The Flags field is two octets in length. If the least significant
+ bit of the Flags field is one, this indicates that the NT-New-
+ Password and NT-Old-Password fields are valid and SHOULD be used.
+ Otherwise, the LM-New-Password and LM-Old-Password fields MUST be
+ used.
+
+2.1.7. MS-CHAP-CPW-2
+
+ Description
+
+ This Attribute allows the user to change their password if it has
+ expired. This Attribute is only used in Access-Request packets,
+ and should only be included if an MS-CHAP-Error attribute was
+ included in the immediately preceding Access-Reject packet, the
+ String field of the MS-CHAP-Error attribute indicated that the
+ user password had expired, and the MS-CHAP version is equal to 2.
+
+ A summary of the MS-CHAP-CPW-2 Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+
+
+
+
+
+Zorn Informational [Page 8]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Code | Ident |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Old-NT-Hash
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Old-NT-Hash (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Old-NT-Hash (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Old-NT-Hash (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Old-LM-Hash
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Old-LM-Hash(cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Old-LM-Hash(cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Old-LM-Hash(cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | LM-Response
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Response (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | NT-Response
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--++-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--++-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Flags |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+Zorn Informational [Page 9]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ Vendor-Type
+ 4 for MS-CHAP-PW-2
+
+ Vendor-Length
+ 86
+
+ Code
+ 6
+
+ Ident
+ The Ident field is one octet and aids in matching requests and
+ replies. The value of this field MUST be identical to that in the
+ Ident field in all instances of the MS-CHAP-LM-Enc-PW, MS-CHAP-NT-
+ Enc-PW and MS-CHAP-PW-2 attributes contained in a single Access-
+ Request packet.
+
+ Old-NT-Hash
+ The Old-NT-Hash field is 16 octets in length. It contains the old
+ Windows NT password hash encrypted with the new Windows NT
+ password hash.
+
+ Old-LM-Hash
+ The Old-LM-Hash field is 16 octets in length. It contains the old
+ Lan Manager password hash encrypted with the new Windows NT
+ password hash.
+
+ LM-Response
+ The LM-Response field is 24 octets in length and holds an encoded
+ function of the password and the received challenge. If this
+ field is empty, it SHOULD be zero-filled.
+
+ NT-Response
+ The NT-Response field is 24 octets in length and holds an encoded
+ function of the password and the received challenge. If this
+ field is empty, it SHOULD be zero-filled.
+
+ Flags
+ The Flags field is two octets in length. If the least significant
+ bit (bit 0) of this field is one, the NT-Response field is to be
+ used in preference to the LM-Response field for authentication.
+ The LM-Response field MAY still be used (if present), but the NT-
+ Response SHOULD be tried first. If least significant bit of the
+ field is zero, the NT-Response field MUST be ignored and the LM-
+ Response field used instead. If bit 1 of the Flags field is one,
+ the Old-LM-Hash field is valid and SHOULD be used. If this bit is
+ set, at least one instance of the MS-CHAP-LM-Enc-PW attribute MUST
+ be included in the packet.
+
+
+
+
+Zorn Informational [Page 10]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+2.1.8. MS-CHAP-LM-Enc-PW
+
+ Description
+
+ This Attribute contains the new Windows NT password encrypted with
+ the old LAN Manager password hash. The encrypted Windows NT
+ password is 516 octets in length; since this is longer than the
+ maximum lengtth of a RADIUS attribute, the password must be split
+ into several attibutes for transmission. A 2 octet sequence
+ number is included in the attribute to help preserve ordering of
+ the password fragments.
+
+ This Attribute is only used in Access-Request packets, in
+ conjunction with the MS-CHAP-CPW-2 attribute. It should only be
+ included if an MS-CHAP-Error attribute was included in the
+ immediately preceding Access-Reject packet, the String field of
+ the MS-CHAP-Error attribute indicated that the user password had
+ expired, and the MS-CHAP version is 2 or greater.
+
+ A summary of the MS-CHAP-LM-Enc-PW Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Code | Ident |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence-Number | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 5 for MS-CHAP-LM-Enc-PW
+
+ Vendor-Length
+ > 6
+
+ Code 6. Code is the same as for the MS-CHAP-PW-2 attribute.
+
+ Ident
+ The Ident field is one octet and aids in matching requests and
+ replies. The value of this field MUST be identical in all
+ instances of the MS-CHAP-LM-Enc-PW, MS-CHAP-NT-Enc-PW and MS-
+ CHAP-PW-2 attributes which are present in the same Access-Request
+ packet.
+
+
+
+
+
+
+
+Zorn Informational [Page 11]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ Sequence-Number
+ The Sequence-Number field is two octets in length and indicates
+ which "chunk" of the encrypted password is contained in the
+ following String field.
+
+ String The String field contains a portion of the encrypted password.
+
+2.2. MS-CHAP-NT-Enc-PW
+
+ Description
+
+ This Attribute contains the new Windows NT password encrypted with
+ the old Windows NT password hash. The encrypted Windows NT
+ password is 516 octets in length; since this is longer than the
+ maximum lengtth of a RADIUS attribute, the password must be split
+ into several attibutes for transmission. A 2 octet sequence
+ number is included in the attribute to help preserve ordering of
+ the password fragments.
+
+ This Attribute is only used in Access-Request packets, in conjunc-
+ tion with the MS-CHAP-CPW-2 and MS-CHAP2-CPW attributes. It
+ should only be included if an MS-CHAP-Error attribute was included
+ in the immediately preceding Access-Reject packet, the String
+ field of the MS-CHAP-Error attribute indicated that the user
+ password had expired, and the MS-CHAP version is 2 or greater.
+
+ A summary of the MS-CHAP-NT-Enc-PW Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Code | Ident |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence-Number | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 6 for MS-CHAP-NT-Enc-PW
+
+ Vendor-Length
+ > 6
+
+ Code
+ 6. Code is the same as for the MS-CHAP-PW-2 attribute.
+
+
+
+
+
+
+Zorn Informational [Page 12]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ Ident
+ The Ident field is one octet and aids in matching requests and
+ replies. The value of this field MUST be identical in all
+ instances of the MS-CHAP-LM-Enc-PW, MS-CHAP-NT-Enc-PW and MS-
+ CHAP-PW-2 attributes which are present in the same Access-Request
+ packet.
+
+ Sequence-Number
+ The Sequence-Number field is two octets in length and indicates
+ which "chunk" of the encrypted password is contained in the
+ following String field.
+
+ String
+ The String field contains a portion of the encrypted password.
+
+2.3. Attributes for Support of MS-CHAP Version 2
+
+2.3.1. Introduction
+
+ This section describes RADIUS attributes supporting version two of
+ Microsoft's PPP CHAP dialect (MS-CHAP-V2) [14]. MS-CHAP-V2 is
+ similar to, but incompatible with, MS-CHAP version one (MS-CHAP-V1)
+ [4]. Certain protocol fields have been deleted or reused but with
+ different semantics. Where possible, MS-CHAP-V2 is consistent with
+ both MS-CHAP-V1 and standard CHAP [1]. Briefly, the differences
+ between MS-CHAP-V2 and MS-CHAP-V1 are:
+
+ * MS-CHAP-V2 is enabled by negotiating CHAP Algorithm 0x81 in LCP
+ option 3, Authentication Protocol.
+
+ * MS-CHAP-V2 provides mutual authentication between peers by
+ piggybacking a peer challenge on the Response packet and an
+ authenticator response on the Success packet.
+
+ * The calculation of the "Windows NT compatible challenge
+ response" sub-field in the Response packet has been changed to
+ include the peer challenge and the user name.
+
+ * In MS-CHAP-V1, the "LAN Manager compatible challenge response"
+ sub-field was always sent in the Response packet. This field
+ has been replaced in MS-CHAP-V2 by the Peer-Challenge field.
+
+ * The format of the Message field in the Failure packet has been
+ changed.
+
+ * The Change Password (version 1) and Change Password (version 2)
+ packets are no longer supported. They have been replaced with a
+ single Change-Password packet.
+
+
+
+Zorn Informational [Page 13]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ The attributes defined in this section reflect these differences.
+
+2.3.2. MS-CHAP2-Response
+
+ Description
+
+ This Attribute contains the response value provided by an MS-
+ CHAP-V2 peer in response to the challenge. It is only used in
+ Access-Request packets.
+
+ A summary of the MS-CHAP2-Response Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Ident | Flags |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Peer-Challenge
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Peer-Challenge (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Peer-Challenge (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Peer-Challenge (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Reserved
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Reserved (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Response
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Response (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 25 for MS-CHAP2-Response.
+
+ Vendor-Length
+ 52
+
+
+
+Zorn Informational [Page 14]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ Ident
+ Identical to the PPP MS-CHAP v2 Identifier.
+
+ Flags
+ The Flags field is one octet in length. It is reserved for future
+ use and MUST be zero.
+
+ Peer-Challenge
+ The Peer-Challenge field is a 16-octet random number.
+
+ Reserved
+ This field is reserved for future use and MUST be zero.
+
+ Response
+ The Response field is 24 octets in length and holds an encoded
+ function of the password, the Peer-Challenge field and the
+ received challenge.
+
+2.3.3. MS-CHAP2-Success
+
+ Description
+
+ This Attribute contains a 42-octet authenticator response string.
+ This string MUST be included in the Message field of the MS-CHAP-
+ V2 Success packet sent from the NAS to the peer. This Attribute
+ is only used in Access-Accept packets.
+
+ A summary of the MS-CHAP2-Success Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Ident | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 26 for MS-CHAP2-Success.
+
+ Vendor-Length
+ 45
+
+ Ident
+ Identical to the PPP MS-CHAP v2 Identifier.
+
+ String
+ The 42-octet authenticator string (see above).
+
+
+
+
+Zorn Informational [Page 15]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+2.3.4. MS-CHAP2-CPW
+
+ Description
+
+ This Attribute allows the user to change their password if it has
+ expired. This Attribute is only used in conjunction with the MS-
+ CHAP-NT-Enc-PW attribute in Access-Request packets, and should
+ only be included if an MS-CHAP-Error attribute was included in the
+ immediately preceding Access-Reject packet, the String field of
+ the MS-CHAP-Error attribute indicated that the user password had
+ expired, and the MS-CHAP version is equal to 3.
+
+ A summary of the MS-CHAP-CPW-2 Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 16]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Code | Ident |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Encrypted-Hash
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Encrypted-Hash (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Encrypted-Hash (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Encrypted-Hash (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Peer-Challenge
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Peer-Challenge (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Peer-Challenge (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Peer-Challenge (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Peer-Challenge (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Peer-Challenge (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | NT-Response
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--++-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--++-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Response (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Flags |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 27 for MS-CHAP2-PW
+
+ Vendor-Length
+ 70
+
+ Code
+ 7
+
+
+
+Zorn Informational [Page 17]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ Ident
+ The Ident field is one octet and aids in matching requests and
+ replies. The value of this field MUST be identical to that in the
+ Ident field in all instances of the MS-CHAP-NT-Enc-PW contained in
+ the Access-Request packet.
+
+ Encrypted-Hash
+ The Encrypted-Hash field is 16 octets in length. It contains the
+ old Windows NT password hash encrypted with the new Windows NT
+ password hash.
+
+ NT-Response
+ The NT-Response field is 24 octets in length and holds an encoded
+ function of the new password, the Peer-Challenge field and the
+ received challenge.
+
+ Flags
+ The Flags field is two octets in length. This field is reserved
+ for future use and MUST be zero.
+
+2.4. Attributes for MPPE Support
+
+ This section describes a set of Attributes designed to support the
+ use of Microsoft Point-to-Point Encryption (MPPE) [6] in dial-up
+ networks. MPPE is a means of representing Point to Point Protocol
+ (PPP) [7] packets in a encrypted form. MPPE uses the RSA RC4 [8]
+ algorithm for encryption. The length of the session key to be used
+ for initializing encryption tables can be negotiated; MPPE currently
+ supports 40 bit and 128 bit session keys. MPPE is negotiated within
+ option 18 in the PPP Compression Control Protocol (CCP)[9], [10].
+
+2.4.1. MS-CHAP-MPPE-Keys
+
+ Description
+
+ The MS-CHAP-MPPE-Keys Attribute contains two session keys for use
+ by the Microsoft Point-to-Point Encryption Protocol (MPPE). This
+ Attribute is only included in Access-Accept packets.
+
+ A summary of the MS-CHAP-MPPE-Keys Attribute format is given below.
+ The fields are transmitted left to right.
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 18]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Keys
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Keys (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Keys (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Keys (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Keys (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Keys (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Keys (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Keys (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Keys (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 12 for MS-CHAP-MPPE-Keys.
+
+ Vendor-Length
+ 34
+
+ Keys
+ The Keys field consists of two logical sub-fields: the LM-Key and
+ the NT-Key. The LM-Key is eight octets in length and contains the
+ first eight bytes of the output of the function LmPasswordHash(P,
+ This hash is constructed as follows: let the plain-text password
+ be represented by P.
+
+ The NT-Key sub-field is sixteen octets in length and contains the
+ first sixteen octets of the hashed Windows NT password. The
+ format of the plaintext Keys field is illustrated in the following
+ diagram:
+
+
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 19]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | LM-Key
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ LM-Key (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | NT-Key
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Key (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Key (cont)
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ NT-Key (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Padding
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Padding (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ The Keys field MUST be encrypted by the RADIUS server using the
+ same method defined for the User-Password Attribute [3]. Padding
+ is required because the method referenced above requires the field
+ to be encrypted to be a multiple of sixteen octets in length.
+
+ Implementation Note
+ This attribute should only be returned in response to an
+ Access-Request packet containing MS-CHAP attributes.
+
+2.4.2. MS-MPPE-Send-Key
+
+ Description
+
+ The MS-MPPE-Send-Key Attribute contains a session key for use by
+ the Microsoft Point-to-Point Encryption Protocol (MPPE). As the
+ name implies, this key is intended for encrypting packets sent
+ from the NAS to the remote host. This Attribute is only included
+ in Access-Accept packets.
+
+ A summary of the MS-MPPE-Send-Key Attribute format is given below.
+ The fields are transmitted left to right.
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 20]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Salt
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 16 for MS-MPPE-Send-Key.
+
+ Vendor-Length
+ > 4
+
+ Salt
+ The Salt field is two octets in length and is used to ensure the
+ uniqueness of the keys used to encrypt each of the encrypted
+ attributes occurring in a given Access-Accept packet. The most
+ significant bit (leftmost) of the Salt field MUST be set (1). The
+ contents of each Salt field in a given Access-Accept packet MUST
+ be unique.
+
+ String
+ The plaintext String field consists of three logical sub-fields:
+ the Key-Length and Key sub-fields (both of which are required),
+ and the optional Padding sub-field. The Key-Length sub-field is
+ one octet in length and contains the length of the unencrypted Key
+ sub-field. The Key sub-field contains the actual encryption key.
+ If the combined length (in octets) of the unencrypted Key-Length
+ and Key sub-fields is not an even multiple of 16, then the Padding
+ sub-field MUST be present. If it is present, the length of the
+ Padding sub-field is variable, between 1 and 15 octets. The
+ String field MUST be encrypted as follows, prior to transmission:
+
+ Construct a plaintext version of the String field by concate-
+ nating the Key-Length and Key sub-fields. If necessary, pad
+ the resulting string until its length (in octets) is an even
+ multiple of 16. It is recommended that zero octets (0x00) be
+ used for padding. Call this plaintext P.
+
+ Call the shared secret S, the pseudo-random 128-bit Request
+ Authenticator (from the corresponding Access-Request packet) R,
+ and the contents of the Salt field A. Break P into 16 octet
+ chunks p(1), p(2)...p(i), where i = len(P)/16. Call the
+ ciphertext blocks c(1), c(2)...c(i) and the final ciphertext C.
+ Intermediate values b(1), b(2)...c(i) are required. Encryption
+ is performed in the following manner ('+' indicates
+ concatenation):
+
+
+
+Zorn Informational [Page 21]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ b(1) = MD5(S + R + A) c(1) = p(1) xor b(1) C = c(1)
+ b(2) = MD5(S + c(1)) c(2) = p(2) xor b(2) C = C + c(2)
+ . .
+ . .
+ . .
+ b(i) = MD5(S + c(i-1)) c(i) = p(i) xor b(i) C = C + c(i)
+
+ The resulting encrypted String field will contain
+ c(1)+c(2)+...+c(i).
+
+ On receipt, the process is reversed to yield the plaintext String.
+
+ Implementation Notes
+ It is possible that the length of the key returned may be larger
+ than needed for the encryption scheme in use. In this case, the
+ RADIUS client is responsible for performing any necessary
+ truncation.
+
+ This attribute MAY be used to pass a key from an external (e.g.,
+ EAP [15]) server to the RADIUS server. In this case, it may be
+ impossible for the external server to correctly encrypt the key,
+ since the RADIUS shared secret might be unavailable. The external
+ server SHOULD, however, return the attribute as defined above; the
+ Salt field SHOULD be zero-filled and padding of the String field
+ SHOULD be done. When the RADIUS server receives the attribute
+ from the external server, it MUST correctly set the Salt field and
+ encrypt the String field before transmitting it to the RADIUS
+ client. If the channel used to communicate the MS-MPPE-Send-Key
+ attribute is not secure from eavesdropping, the attribute MUST be
+ cryptographically protected.
+
+2.4.3. MS-MPPE-Recv-Key
+
+ Description
+
+ The MS-MPPE-Recv-Key Attribute contains a session key for use by
+ the Microsoft Point-to-Point Encryption Protocol (MPPE). As the
+ name implies, this key is intended for encrypting packets received
+ by the NAS from the remote host. This Attribute is only included
+ in Access-Accept packets.
+
+ A summary of the MS-MPPE-Recv-Key Attribute format is given below.
+ The fields are transmitted left to right.
+
+
+
+
+
+
+
+
+Zorn Informational [Page 22]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Salt
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 17 for MS-MPPE-Recv-Key.
+
+ Vendor-Length
+ > 4
+
+ Salt
+ The Salt field is two octets in length and is used to ensure the
+ uniqueness of the keys used to encrypt each of the encrypted
+ attributes occurring in a given Access-Accept packet. The most
+ significant bit (leftmost) of the Salt field MUST be set (1). The
+ contents of each Salt field in a given Access-Accept packet MUST
+ be unique.
+
+ String
+ The plaintext String field consists of three logical sub-fields:
+ the Key-Length and Key sub-fields (both of which are required),
+ and the optional Padding sub-field. The Key-Length sub-field is
+ one octet in length and contains the length of the unencrypted Key
+ sub-field. The Key sub-field contains the actual encryption key.
+ If the combined length (in octets) of the unencrypted Key-Length
+ and Key sub-fields is not an even multiple of 16, then the Padding
+ sub-field MUST be present. If it is present, the length of the
+ Padding sub-field is variable, between 1 and 15 octets. The
+ String field MUST be encrypted as follows, prior to transmission:
+
+ Construct a plaintext version of the String field by
+ concatenating the Key-Length and Key sub-fields. If necessary,
+ pad the resulting string until its length (in octets) is an
+ even multiple of 16. It is recommended that zero octets (0x00)
+ be used for padding. Call this plaintext P.
+
+ Call the shared secret S, the pseudo-random 128-bit Request
+ Authenticator (from the corresponding Access-Request packet) R,
+ and the contents of the Salt field A. Break P into 16 octet
+ chunks p(1), p(2)...p(i), where i = len(P)/16. Call the
+ ciphertext blocks c(1), c(2)...c(i) and the final ciphertext C.
+ Intermediate values b(1), b(2)...c(i) are required. Encryption
+ is performed in the following manner ('+' indicates
+ concatenation):
+
+
+
+Zorn Informational [Page 23]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ b(1) = MD5(S + R + A) c(1) = p(1) xor b(1) C = c(1)
+ b(2) = MD5(S + c(1)) c(2) = p(2) xor b(2) C = C + c(2)
+ . .
+ . .
+ . .
+ b(i) = MD5(S + c(i-1)) c(i) = p(i) xor b(i) C = C + c(i)
+
+ The resulting encrypted String field will contain
+ c(1)+c(2)+...+c(i).
+
+ On receipt, the process is reversed to yield the plaintext String.
+
+ Implementation Notes
+ It is possible that the length of the key returned may be larger
+ than needed for the encryption scheme in use. In this case, the
+ RADIUS client is responsible for performing any necessary
+ truncation.
+
+ This attribute MAY be used to pass a key from an external (e.g.,
+ EAP [15]) server to the RADIUS server. In this case, it may be
+ impossible for the external server to correctly encrypt the key,
+ since the RADIUS shared secret might be unavailable. The external
+ server SHOULD, however, return the attribute as defined above; the
+ Salt field SHOULD be zero-filled and padding of the String field
+ SHOULD be done. When the RADIUS server receives the attribute
+ from the external server, it MUST correctly set the Salt field and
+ encrypt the String field before transmitting it to the RADIUS
+ client. If the channel used to communicate the MS-MPPE-Recv-Key
+ attribute is not secure from eavesdropping, the attribute MUST be
+ cryptographically protected.
+
+2.4.4. MS-MPPE-Encryption-Policy
+
+ Description
+
+ The MS-MPPE-Encryption-Policy Attribute may be used to signify
+ whether the use of encryption is allowed or required. If the
+ Policy field is equal to 1 (Encryption-Allowed), any or none of
+ the encryption types specified in the MS-MPPE-Encryption-Types
+ Attribute MAY be used. If the Policy field is equal to 2
+ (Encryption-Required), any of the encryption types specified in
+ the MS-MPPE-Encryption-Types Attribute MAY be used, but at least
+ one MUST be used.
+
+ A summary of the MS-MPPE-Encryption-Policy Attribute format is given
+ below. The fields are transmitted left to right.
+
+
+
+
+
+Zorn Informational [Page 24]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Policy
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Policy (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 7 for MS-MPPE-Encryption-Policy.
+
+ Vendor-Length
+ 6
+
+ Policy
+ The Policy field is 4 octets in length. Defined values are:
+
+ 1 Encryption-Allowed 2 Encryption-Required
+
+2.4.5. MS-MPPE-Encryption-Types
+
+ Description
+
+ The MS-MPPE-Encryption-Types Attribute is used to signify the
+ types of encryption available for use with MPPE. It is a four
+ octet integer that is interpreted as a string of bits.
+
+ A summary of the MS-MPPE-Encryption-Policy Attribute format is given
+ below. The fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Types
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Types (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 8 for MS-MPPE-Encryption-Types.
+
+ Vendor-Length
+ 6
+
+ Policy
+ The Types field is 4 octets in length. The following diagram
+ illustrates the Types field.
+
+
+
+
+Zorn Informational [Page 25]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 3 2 1
+ 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |S|L| |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ If the L bit is set, RC4[5] encryption using a 40-bit key is
+ allowed. If the S bit is set, RC4 encryption using a 128-bit key
+ is allowed. If both the L and S bits are set, then either 40- or
+ 128-bit keys may be used with the RC4 algorithm.
+
+2.5. Attributes for BAP Support
+
+ This section describes a set of vendor-specific RADIUS attributes
+ designed to support the dynamic control of bandwidth allocation in
+ multilink PPP [11]. Attributes are defined that specify whether use
+ of the PPP Bandwidth Allocation Protocol (BAP) [12] is allowed or
+ required on incoming calls, the level of line capacity (expressed as
+ a percentage) below which utilization must fall before a link is
+ eligible to be dropped, and the length of time (in seconds) that a
+ link must be under-utilized before it is dropped.
+
+2.5.1. MS-BAP-Usage
+
+ Description
+
+ This Attribute describes whether the use of BAP is allowed,
+ disallowed or required on new multilink calls. It MAY be used in
+ Access-Accept packets.
+
+ A summary of the MS-BAP-Usage Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 13 for MS-BAP-Usage.
+
+ Vendor-Length
+ 6
+
+
+
+
+
+Zorn Informational [Page 26]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ Value
+ The Value field is four octets.
+
+ 0 BAP usage not allowed
+ 1 BAP usage allowed
+ 2 BAP usage required
+
+2.5.2. MS-Link-Utilization-Threshold
+
+ Description
+
+ This Attribute represents the percentage of available bandwidth
+ utilization below which the link must fall before the link is
+ eligible for termination. Permissible values for the MS-Link-
+ Utilization-Threshold Attribute are in the range 1-100, inclusive.
+ It is only used in Access-Accept packets.
+
+ A summary of the MS-Link-Utilization-Threshold Attribute format is
+ shown below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 14 for MS-Link-Utilization-Threshold
+
+ Vendor-Length 6
+
+ Value The Value field is four octets in length and represents the
+ percentage of available bandwidth utilization below which the link
+ must fall before the link is eligible for termination.
+ Permissible values are in the range 1-100, inclusive.
+
+2.5.3. MS-Link-Drop-Time-Limit
+
+ Description
+
+ The MS-Link-Drop-Time-Limit Attribute indicates the length of time
+ (in seconds) that a link must be underutilized before it is
+ dropped. It MAY only be included in Access-Accept packets.
+
+ A summary of the MS-Link-Drop-Time-Limit Attribute format is given
+ below. The fields are transmitted left to right.
+
+
+
+Zorn Informational [Page 27]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 15 for MS-Link-Drop-Time-Limit
+
+ Vendor-Length
+ 6
+
+ Value
+ The Value field represents the number of seconds that a link must
+ be underutilized (i.e., display bandwidth utilization below the
+ threshold specified in the MS-Link-Utilization-Threshold
+ Attribute) before the link is dropped.
+
+2.6. Attributes for ARAP Support
+
+ This section describes a set of Attributes designed to support the
+ Apple Remote Access Protocol (ARAP).
+
+2.6.1. MS-Old-ARAP-Password
+
+ Description
+
+ The MS-Old-ARAP-Password Attribute is used to transmit the old
+ ARAP password during an ARAP password change operation. It MAY be
+ included in Access-Request packets.
+
+ A summary of the MS-Old-ARAP-Password Attribute Attribute format is
+ given below. The fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 19 for MS-Old-ARAP-Password Attribute
+
+ Vendor-Length
+ > 3
+
+
+
+
+Zorn Informational [Page 28]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ String
+ The String field is one or more octets. It contains the old ARAP
+ password DES-encrypted using itself as the key.
+
+2.6.2. MS-New-ARAP-Password
+
+ Description
+
+ The MS-New-ARAP-Password Attribute is used to transmit the new
+ ARAP password during an ARAP password change operation. It MAY be
+ included in Access-Request packets.
+
+ A summary of the MS-New-ARAP-Password Attribute Attribute format is
+ given below. The fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 20 for MS-New-ARAP-Password Attribute
+
+ Vendor-Length
+ > 3
+
+ String
+ The String field is one or more octets. It contains the new ARAP
+ password DES-encrypted using the old ARAP password as the key.
+
+2.6.3. MS-ARAP-Password-Change-Reason
+
+ Description
+
+ The MS-ARAP-Password-Change-Reason Attribute is used to indicate
+ reason for a server-initiated password change. It MAY be included
+ in Access-Challenge packets.
+
+ A summary of the MS-ARAP-Password-Change-Reason Attribute format is
+ given below. The fields are transmitted left to right.
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 29]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Why
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Why (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 21 for MS-ARAP-Password-Change-Reason
+
+ Vendor-Length
+ 6
+
+ Why
+ The Why field is 4 octets in length. The following values are
+ defined:
+ Just-Change-Password 1
+ Expired-Password 2
+ Admin-Requires-Password-Change 3
+ Password-Too-Short 4
+
+2.6.4. MS-ARAP-Challenge
+
+ Description
+
+ This attribute is only present in an Access-Request packet
+ containing a Framed-Protocol Attribute with the value 3 (ARAP).
+
+ A summary of the MS-ARAP-Challenge Attribute format is given below.
+ The fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Challenge
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Challenge (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Challenge (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 33 for MS-ARAP-Challenge
+
+ Vendor-Length
+ 10
+
+
+
+
+Zorn Informational [Page 30]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ Value
+ The Challenge Field is 8 octets in length. It contains the
+ challenge (as two 4-octet quantities) sent by the NAS to the peer.
+
+2.7. Miscellaneous Attributes
+
+ This section describes attributes which do not fall into any
+ particular category, but are used in the identification and operation
+ of Microsoft remote access products.
+
+2.7.1. MS-RAS-Vendor
+
+ Description
+
+ The MS-RAS-Vendor Attribute is used to indicate the manufacturer
+ of the RADIUS client machine. It MAY be included in both Access-
+ Request and Accounting-Request packets.
+
+ A summary of the MS-RAS-Vendor Attribute format is given below. The
+ fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Vendor-ID
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Vendor-ID (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 9 for MS-RAS-Vendor
+
+ Vendor-Length
+ 6
+
+ Vendor-ID
+ The Vendor-ID field is 4 octets in length. The high-order octet
+ is 0 and the low-order 3 octets are the SMI Network Management
+ Private Enterprise Code of the Vendor in network byte order, as
+ defined in the Assigned Numbers RFC [13].
+
+2.7.2. MS-RAS-Version
+
+ Description
+
+ The MS-RAS-Version Attribute is used to indicate the version of
+ the RADIUS client software. This attribute SHOULD be included in
+ packets containing an MS-RAS-Vendor Attribute; it SHOULD NOT be
+
+
+
+Zorn Informational [Page 31]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ sent in packets which do not contain an MS-RAS-Vendor Attribute.
+ It MAY be included in both Access-Request and Accounting-Request
+ packets.
+
+ A summary of the MS-RAS-Version Attribute format is given below. The
+ fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 18 for MS-RAS-Version
+
+ Vendor-Length
+ > 3
+
+ String
+ The String field is one or more octets. The actual format of the
+ information is vendor specific, and a robust implementation SHOULD
+ support the field as undistinguished octets.
+
+2.7.3. MS-Filter
+
+ Description
+
+ The MS-Filter Attribute is used to transmit traffic filters. It
+ MAY be included in both Access-Accept and Accounting-Request
+ packets.
+
+ If multiple MS-Filter Attributes are contained within a packet,
+ they MUST be in order and they MUST be consecutive attributes in
+ the packet.
+
+ A summary of the MS-Filter Attribute format is given below. The
+ fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Filter...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 22 for MS-Filter Attribute
+
+
+
+
+Zorn Informational [Page 32]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ Vendor-Length
+ > 3
+
+ Filter
+ The Filter field is one or more octets. It contains a sequence of
+ undifferentiated octets.
+
+ If multiple MS-Filter Attributes occur in a single Access-Accept
+ packet, the Filter field from each MUST be concatenated in the
+ order received to form the actual filter.
+
+2.7.4. MS-Acct-Auth-Type
+
+ Description
+
+ The MS-Acct-Auth-Type Attribute is used to represent the method
+ used to authenticate the dial-up user. It MAY be included in
+ Accounting-Request packets.
+
+ A summary of the MS-Acct-Auth-Type Attribute format is given below.
+ The fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | Auth-Type
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Auth-Type (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 23 for MS-Acct-Auth-Type
+
+ Vendor-Length
+ 6
+
+ Auth-Type
+ The Auth-Type field is 4 octets in length. The following values
+ are defined for this field:
+
+ PAP 1
+ CHAP 2
+ MS-CHAP-1 3
+ MS-CHAP-2 4
+ EAP 5
+
+
+
+
+
+
+Zorn Informational [Page 33]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+2.7.5. MS-Acct-EAP-Type
+
+ Description
+
+ The MS-Acct-EAP-Type Attribute is used to represent the Extensible
+ Authentication Protocol (EAP) [15] type used to authenticate the
+ dial-up user. It MAY be included in Accounting-Request packets.
+
+ A summary of the MS-Acct-EAP-Type Attribute format is given below.
+ The fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | EAP-Type
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ EAP-Type (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 24 for MS-Acct-EAP-Type
+
+ Vendor-Length
+ 6
+
+ Auth-Type
+ The EAP-Type field is 4 octets in length. The following values
+ are currently defined for this field:
+
+ MD5 4
+ OTP 5
+ Generic Token Card 6
+ TLS 13
+
+2.7.6. MS-Primary-DNS-Server
+
+ Description
+
+ The MS-Primary-DNS-Server Attribute is used to indicate the
+ address of the primary Domain Name Server (DNS) [16, 17] server to
+ be used by the PPP peer. It MAY be included in both Access-Accept
+ and Accounting-Request packets.
+
+ A summary of the MS-Primary-DNS-Server Attribute format is given
+ below. The fields are transmitted left to right.
+
+
+
+
+
+
+Zorn Informational [Page 34]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | IP-Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ IP-Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 28 for MS-Primary-DNS-Server
+
+ Vendor-Length
+ 6
+
+ IP-Address
+ The IP-Address field is 4 octets in length. It contains the IP
+ address of the primary DNS server.
+
+2.7.7. MS-Secondary-DNS-Server
+
+ Description
+
+ The MS-Secondary-DNS-Server Attribute is used to indicate the
+ address of the secondary DNS server to be used by the PPP peer.
+ It MAY be included in both Access-Accept and Accounting-Request
+ packets.
+
+ A summary of the MS-Secondary-DNS-Server Attribute format is given
+ below. The fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | IP-Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ IP-Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 29 for MS-Secondary-DNS-Server
+
+ Vendor-Length
+ 6
+
+ IP-Address
+ The IP-Address field is 4 octets in length. It contains the IP
+ address of the secondary DNS server.
+
+
+
+
+Zorn Informational [Page 35]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+2.7.8. MS-Primary-NBNS-Server
+
+ Description
+
+ The MS-Primary-NBNS-Server Attribute is used to indicate the
+ address of the primary NetBIOS Name Server (NBNS) [18] server to
+ be used by the PPP peer. It MAY be included in both Access-Accept
+ and Accounting-Request packets.
+
+ A summary of the MS-Primary-MBNS-Server Attribute format is given
+ below. The fields are transmitted left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | IP-Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ IP-Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 30 for MS-Primary-NBNS-Server
+
+ Vendor-Length
+ 6
+
+ IP-Address
+ The IP-Address field is 4 octets in length. It contains the IP
+ address of the primary NBNS server.
+
+2.7.9. MS-Secondary-NBNS-Server
+
+ Description
+
+ The MS-Secondary-NBNS-Server Attribute is used to indicate the
+ address of the secondary DNS server to be used by the PPP peer.
+ It MAY be included in both Access-Accept and Accounting-Request
+ packets.
+
+ A summary of the MS-Secondary-NBNS-Server Attribute format is given
+ below. The fields are transmitted left to right.
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 36]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Vendor-Type | Vendor-Length | IP-Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ IP-Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Vendor-Type
+ 31 for MS-Secondary-NBNS-Server
+
+ Vendor-Length
+ 6
+
+ IP-Address
+ The IP-Address field is 4 octets in length. It contains the IP
+ address of the secondary NBNS server.
+
+3. Table of Attributes
+
+ The following table provides a guide to which of the above attributes
+ may be found in which kinds of packets, and in what quantity.
+
+ Request Accept Reject Challenge Acct-Request # Attribute
+ 0-1 0 0 0 0 1 MS-CHAP-Response
+ 0 0 0-1 0 0 2 MS-CHAP-Error
+ 0-1 0 0 0 0 3 MS-CHAP-CPW-1
+ 0-1 0 0 0 0 4 MS-CHAP-CPW-2
+ 0+ 0 0 0 0 5 MS-CHAP-LM-Enc-PW
+ 0+ 0 0 0 0 6 MS-CHAP-NT-Enc-PW
+ 0 0-1 0 0 0 7 MS-MPPE-Encryption-
+ Policy
+ 0 0-1 0 0 0 8 MS-MPPE-Encryption-Type
+ 0-1 0 0 0 0-1 9 MS-RAS-Vendor
+ 0 0-1 0 0 0-1 10 MS-CHAP-Domain
+ 0-1 0 0 0-1 0 11 MS-CHAP-Challenge
+ 0 0-1 0 0 0 12 MS-CHAP-MPPE-Keys
+ 0 0-1 0 0 0 13 MS-BAP-Usage
+ 0 0-1 0 0 0 14 MS-Link-Utilization-
+ Threshold
+ 0 0-1 0 0 0 15 MS-Link-Drop-Time-Limit
+ 0 0-1 0 0 0 16 MS-MPPE-Send-Key
+ 0 0-1 0 0 0 17 MS-MPPE-Recv-Key
+ 0-1 0 0 0 0-1 18 MS-RAS-Version
+ 0-1 0 0 0 0 19 MS-Old-ARAP-Password
+ 0-1 0 0 0 0 20 MS-New-ARAP-Password
+ 0 0 0 0-1 0 21 MS-ARAP-PW-Change-
+ Reason
+
+
+
+Zorn Informational [Page 37]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ 0 0+ 0 0 0+ 22 MS-Filter
+ 0 0 0 0 0-1 23 MS-Acct-Auth-Type
+ 0 0 0 0 0-1 24 MS-Acct-EAP-Type
+ 0-1 0 0 0 0 25 MS-CHAP2-Response
+ 0 0-1 0 0 0 26 MS-CHAP2-Success
+ 0-1 0 0 0 0 27 MS-CHAP2-CPW
+ 0 0-1 0 0 0-1 28 MS-Primary-DNS-Server
+ 0 0-1 0 0 0-1 29 MS-Secondary-DNS-Server
+ 0 0-1 0 0 0-1 30 MS-Primary-NBNS-Server
+ 0 0-1 0 0 0-1 31 MS-Secondary-NBNS-
+ Server
+ 0-1 0 0 0 0 33 MS-ARAP-Challenge
+
+The following table defines the meaning of the above table entries.
+
+0 This attribute MUST NOT be present in packet.
+0+ Zero or more instances of this attribute MAY be present in packet.
+0-1 Zero or one instance of this attribute MAY be present in packet.
+
+4. Security Considerations
+
+ MS-CHAP, like PPP CHAP, is susceptible to dictionary attacks. User
+ passwords should be chosen with care, and be of sufficient length to
+ deter easy guessing.
+
+ Although the scheme used to protect the Keys field of the MS-CHAP-
+ MPPE-Keys, MS-MPPE-Send-Key and MS-MPPE-Recv-Key Attributes is
+ believed to be relatively secure on the wire, RADIUS proxies will
+ decrypt and re-encrypt the field for forwarding. Therefore, these
+ attributes SHOULD NOT be used on networks where untrusted RADIUS
+ proxies reside.
+
+5. Acknowledgements
+
+ Thanks to Carl Rigney (cdr@livingston.com), Ashwin Palekar (ash-
+ winp@microsoft.com), Aydin Edguer (edguer@MorningStar.com), Narendra
+ Gidwani (nareng@microsoft.com), Steve Cobb (stevec@microsoft.com),
+ Pat Calhoun (pcalhoun@eng.sun.com), Dave Mitton
+ (dmitton@baynetworks.com), Paul Funk (paul@funk.com), Gurdeep Singh
+ Pall (gurdeep@microsoft.com), Stephen Bensley (sbens@microsoft.com),
+ and Don Rule (don-aldr@microsoft.com) for useful suggestions and
+ editorial feedback.
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 38]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+6. Editor's Address
+
+ Questions about this memo can be directed to:
+
+ Glen Zorn
+ Microsoft Corporation
+ One Microsoft Way
+ Redmond, Washington 98052
+
+ Phone: +1 425 703 1559
+ Fax: +1 425 936 7329
+ EMail: glennz@microsoft.com
+
+7. References
+
+ [1] Simpson, W., "PPP Challenge Handshake Authentication
+ Protocol (CHAP)", RFC 1994, August 1996.
+
+ [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement
+ Levels", BCP 14, RFC 2119, March 1997.
+
+ [3] Rigney, C., Rubens, A., Simpson, W. and S. Willens, "Remote
+ Access Dial In User Service", RFC 2138, April 1997.
+
+ [4] Zorn, G. and S. Cobb, "Microsoft PPP CHAP Extensions", RFC 2433,
+ October 1998.
+
+ [5] Simpson, W., "PPP Challenge Handshake Authentication Protocol
+ (CHAP)", RFC 1994, August 1996.
+
+ [6] Zorn, G. and G. Pall, "Microsoft Point-to-Point Encryption
+ (MPPE) Protocol", Work in Progress.
+
+ [7] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, RFC
+ 1661, July 1994.
+
+ [8] RC4 is a proprietary encryption algorithm available under
+ license from RSA Data Security Inc. For licensing information,
+ contact:
+ RSA Data Security, Inc.
+ 100 Marine Parkway
+ Redwood City, CA 94065-1031
+
+ [9] Pall, G., "Microsoft Point-to-Point Compression (MPPC)
+ Protocol", RFC 2118, March 1997.
+
+ [10] Rand, D., "The PPP Compression Control Protocol (CCP)", RFC
+ 1962, June 1996.
+
+
+
+Zorn Informational [Page 39]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+ [11] Sklower, K., Lloyd, B., McGregor, G., Carr, D. and T. Coradetti,
+ "The PPP Multilink Protocol (MP)", RFC 1990, August 1996.
+
+ [12] Richards, C. and K. Smith, "The PPP Bandwidth Allocation
+ Protocol (BAP) The PPP Bandwidth Allocation Control Protocol
+ (BACP)", RFC 2125, March 1997.
+
+ [13] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC 1700,
+ October 1994.
+
+ [14] Zorn, G., "Microsoft PPP CHAP Extensions, Version 2", Work in
+ Progress.
+
+ [15] Blunk, L. and J. Vollbrecht, "PPP Extensible Authentication
+ Protocol (EAP)", RFC 2284, March 1998.
+
+ [16] Mockapetris, P., "Domain Names - Concepts and Facilities", STD
+ 13, RFC 1034, USC/ISI, November 1987.
+
+ [17] Mockapetris, P., "Domain Names - Implementation and
+ Specification", STD 13, RFC 1035, November 1987.
+
+ [18] Auerbach, K., and A. Aggarwal, "Protocol Standard for a NetBIOS
+ Service on a TCP/UDP Transport", STD 19, RFCs 1001 and 1002,
+ March 1987.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 40]
+
+RFC 2548 Microsoft Vendor-specific RADIUS Attributes March 1999
+
+
+10. Full Copyright Statement
+
+ Copyright (C) The Internet Society (1999). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assigns.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 41]
+
diff --git a/doc/rfc2637.txt b/rfc/rfc2637.txt
index 56e9e0f..56e9e0f 100644
--- a/doc/rfc2637.txt
+++ b/rfc/rfc2637.txt
diff --git a/doc/rfc2716.txt b/rfc/rfc2716.txt
index 71b4a84..71b4a84 100644
--- a/doc/rfc2716.txt
+++ b/rfc/rfc2716.txt
diff --git a/doc/rfc2759.txt b/rfc/rfc2759.txt
index 60371c4..60371c4 100644
--- a/doc/rfc2759.txt
+++ b/rfc/rfc2759.txt
diff --git a/rfc/rfc2865.txt b/rfc/rfc2865.txt
new file mode 100644
index 0000000..10ec231
--- /dev/null
+++ b/rfc/rfc2865.txt
@@ -0,0 +1,4259 @@
+
+
+
+
+
+
+Network Working Group C. Rigney
+Request for Comments: 2865 S. Willens
+Obsoletes: 2138 Livingston
+Category: Standards Track A. Rubens
+ Merit
+ W. Simpson
+ Daydreamer
+ June 2000
+
+
+ Remote Authentication Dial In User Service (RADIUS)
+
+Status of this Memo
+
+ This document specifies an Internet standards track protocol for the
+ Internet community, and requests discussion and suggestions for
+ improvements. Please refer to the current edition of the "Internet
+ Official Protocol Standards" (STD 1) for the standardization state
+ and status of this protocol. Distribution of this memo is unlimited.
+
+Copyright Notice
+
+ Copyright (C) The Internet Society (2000). All Rights Reserved.
+
+IESG Note:
+
+ This protocol is widely implemented and used. Experience has shown
+ that it can suffer degraded performance and lost data when used in
+ large scale systems, in part because it does not include provisions
+ for congestion control. Readers of this document may find it
+ beneficial to track the progress of the IETF's AAA working group,
+ which may develop a successor protocol that better addresses the
+ scaling and congestion control issues.
+
+Abstract
+
+ This document describes a protocol for carrying authentication,
+ authorization, and configuration information between a Network Access
+ Server which desires to authenticate its links and a shared
+ Authentication Server.
+
+Implementation Note
+
+ This memo documents the RADIUS protocol. The early deployment of
+ RADIUS was done using UDP port number 1645, which conflicts with the
+ "datametrics" service. The officially assigned port number for
+ RADIUS is 1812.
+
+
+
+
+Rigney, et al. Standards Track [Page 1]
+
+RFC 2865 RADIUS June 2000
+
+
+Table of Contents
+
+ 1. Introduction .......................................... 3
+ 1.1 Specification of Requirements ................... 4
+ 1.2 Terminology ..................................... 5
+ 2. Operation ............................................. 5
+ 2.1 Challenge/Response .............................. 7
+ 2.2 Interoperation with PAP and CHAP ................ 8
+ 2.3 Proxy ........................................... 8
+ 2.4 Why UDP? ........................................ 11
+ 2.5 Retransmission Hints ............................ 12
+ 2.6 Keep-Alives Considered Harmful .................. 13
+ 3. Packet Format ......................................... 13
+ 4. Packet Types .......................................... 17
+ 4.1 Access-Request .................................. 17
+ 4.2 Access-Accept ................................... 18
+ 4.3 Access-Reject ................................... 20
+ 4.4 Access-Challenge ................................ 21
+ 5. Attributes ............................................ 22
+ 5.1 User-Name ....................................... 26
+ 5.2 User-Password ................................... 27
+ 5.3 CHAP-Password ................................... 28
+ 5.4 NAS-IP-Address .................................. 29
+ 5.5 NAS-Port ........................................ 30
+ 5.6 Service-Type .................................... 31
+ 5.7 Framed-Protocol ................................. 33
+ 5.8 Framed-IP-Address ............................... 34
+ 5.9 Framed-IP-Netmask ............................... 34
+ 5.10 Framed-Routing .................................. 35
+ 5.11 Filter-Id ....................................... 36
+ 5.12 Framed-MTU ...................................... 37
+ 5.13 Framed-Compression .............................. 37
+ 5.14 Login-IP-Host ................................... 38
+ 5.15 Login-Service ................................... 39
+ 5.16 Login-TCP-Port .................................. 40
+ 5.17 (unassigned) .................................... 41
+ 5.18 Reply-Message ................................... 41
+ 5.19 Callback-Number ................................. 42
+ 5.20 Callback-Id ..................................... 42
+ 5.21 (unassigned) .................................... 43
+ 5.22 Framed-Route .................................... 43
+ 5.23 Framed-IPX-Network .............................. 44
+ 5.24 State ........................................... 45
+ 5.25 Class ........................................... 46
+ 5.26 Vendor-Specific ................................. 47
+ 5.27 Session-Timeout ................................. 48
+ 5.28 Idle-Timeout .................................... 49
+ 5.29 Termination-Action .............................. 49
+
+
+
+Rigney, et al. Standards Track [Page 2]
+
+RFC 2865 RADIUS June 2000
+
+
+ 5.30 Called-Station-Id ............................... 50
+ 5.31 Calling-Station-Id .............................. 51
+ 5.32 NAS-Identifier .................................. 52
+ 5.33 Proxy-State ..................................... 53
+ 5.34 Login-LAT-Service ............................... 54
+ 5.35 Login-LAT-Node .................................. 55
+ 5.36 Login-LAT-Group ................................. 56
+ 5.37 Framed-AppleTalk-Link ........................... 57
+ 5.38 Framed-AppleTalk-Network ........................ 58
+ 5.39 Framed-AppleTalk-Zone ........................... 58
+ 5.40 CHAP-Challenge .................................. 59
+ 5.41 NAS-Port-Type ................................... 60
+ 5.42 Port-Limit ...................................... 61
+ 5.43 Login-LAT-Port .................................. 62
+ 5.44 Table of Attributes ............................. 63
+ 6. IANA Considerations ................................... 64
+ 6.1 Definition of Terms ............................. 64
+ 6.2 Recommended Registration Policies ............... 65
+ 7. Examples .............................................. 66
+ 7.1 User Telnet to Specified Host ................... 66
+ 7.2 Framed User Authenticating with CHAP ............ 67
+ 7.3 User with Challenge-Response card ............... 68
+ 8. Security Considerations ............................... 71
+ 9. Change Log ............................................ 71
+ 10. References ............................................ 73
+ 11. Acknowledgements ...................................... 74
+ 12. Chair's Address ....................................... 74
+ 13. Authors' Addresses .................................... 75
+ 14. Full Copyright Statement .............................. 76
+
+1. Introduction
+
+ This document obsoletes RFC 2138 [1]. A summary of the changes
+ between this document and RFC 2138 is available in the "Change Log"
+ appendix.
+
+ Managing dispersed serial line and modem pools for large numbers of
+ users can create the need for significant administrative support.
+ Since modem pools are by definition a link to the outside world, they
+ require careful attention to security, authorization and accounting.
+ This can be best achieved by managing a single "database" of users,
+ which allows for authentication (verifying user name and password) as
+ well as configuration information detailing the type of service to
+ deliver to the user (for example, SLIP, PPP, telnet, rlogin).
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 3]
+
+RFC 2865 RADIUS June 2000
+
+
+ Key features of RADIUS are:
+
+ Client/Server Model
+
+ A Network Access Server (NAS) operates as a client of RADIUS. The
+ client is responsible for passing user information to designated
+ RADIUS servers, and then acting on the response which is returned.
+
+ RADIUS servers are responsible for receiving user connection
+ requests, authenticating the user, and then returning all
+ configuration information necessary for the client to deliver
+ service to the user.
+
+ A RADIUS server can act as a proxy client to other RADIUS servers
+ or other kinds of authentication servers.
+
+ Network Security
+
+ Transactions between the client and RADIUS server are
+ authenticated through the use of a shared secret, which is never
+ sent over the network. In addition, any user passwords are sent
+ encrypted between the client and RADIUS server, to eliminate the
+ possibility that someone snooping on an unsecure network could
+ determine a user's password.
+
+ Flexible Authentication Mechanisms
+
+ The RADIUS server can support a variety of methods to authenticate
+ a user. When it is provided with the user name and original
+ password given by the user, it can support PPP PAP or CHAP, UNIX
+ login, and other authentication mechanisms.
+
+ Extensible Protocol
+
+ All transactions are comprised of variable length Attribute-
+ Length-Value 3-tuples. New attribute values can be added without
+ disturbing existing implementations of the protocol.
+
+1.1. Specification of Requirements
+
+ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
+ "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
+ document are to be interpreted as described in BCP 14 [2]. These key
+ words mean the same thing whether capitalized or not.
+
+ An implementation is not compliant if it fails to satisfy one or more
+ of the must or must not requirements for the protocols it implements.
+ An implementation that satisfies all the must, must not, should and
+
+
+
+Rigney, et al. Standards Track [Page 4]
+
+RFC 2865 RADIUS June 2000
+
+
+ should not requirements for its protocols is said to be
+ "unconditionally compliant"; one that satisfies all the must and must
+ not requirements but not all the should or should not requirements
+ for its protocols is said to be "conditionally compliant".
+
+ A NAS that does not implement a given service MUST NOT implement the
+ RADIUS attributes for that service. For example, a NAS that is
+ unable to offer ARAP service MUST NOT implement the RADIUS attributes
+ for ARAP. A NAS MUST treat a RADIUS access-accept authorizing an
+ unavailable service as an access-reject instead.
+
+1.2. Terminology
+
+ This document frequently uses the following terms:
+
+ service The NAS provides a service to the dial-in user, such as PPP
+ or Telnet.
+
+ session Each service provided by the NAS to a dial-in user
+ constitutes a session, with the beginning of the session
+ defined as the point where service is first provided and
+ the end of the session defined as the point where service
+ is ended. A user may have multiple sessions in parallel or
+ series if the NAS supports that.
+
+ silently discard
+ This means the implementation discards the packet without
+ further processing. The implementation SHOULD provide the
+ capability of logging the error, including the contents of
+ the silently discarded packet, and SHOULD record the event
+ in a statistics counter.
+
+2. Operation
+
+ When a client is configured to use RADIUS, any user of the client
+ presents authentication information to the client. This might be
+ with a customizable login prompt, where the user is expected to enter
+ their username and password. Alternatively, the user might use a
+ link framing protocol such as the Point-to-Point Protocol (PPP),
+ which has authentication packets which carry this information.
+
+ Once the client has obtained such information, it may choose to
+ authenticate using RADIUS. To do so, the client creates an "Access-
+ Request" containing such Attributes as the user's name, the user's
+ password, the ID of the client and the Port ID which the user is
+ accessing. When a password is present, it is hidden using a method
+ based on the RSA Message Digest Algorithm MD5 [3].
+
+
+
+
+Rigney, et al. Standards Track [Page 5]
+
+RFC 2865 RADIUS June 2000
+
+
+ The Access-Request is submitted to the RADIUS server via the network.
+ If no response is returned within a length of time, the request is
+ re-sent a number of times. The client can also forward requests to
+ an alternate server or servers in the event that the primary server
+ is down or unreachable. An alternate server can be used either after
+ a number of tries to the primary server fail, or in a round-robin
+ fashion. Retry and fallback algorithms are the topic of current
+ research and are not specified in detail in this document.
+
+ Once the RADIUS server receives the request, it validates the sending
+ client. A request from a client for which the RADIUS server does not
+ have a shared secret MUST be silently discarded. If the client is
+ valid, the RADIUS server consults a database of users to find the
+ user whose name matches the request. The user entry in the database
+ contains a list of requirements which must be met to allow access for
+ the user. This always includes verification of the password, but can
+ also specify the client(s) or port(s) to which the user is allowed
+ access.
+
+ The RADIUS server MAY make requests of other servers in order to
+ satisfy the request, in which case it acts as a client.
+
+ If any Proxy-State attributes were present in the Access-Request,
+ they MUST be copied unmodified and in order into the response packet.
+ Other Attributes can be placed before, after, or even between the
+ Proxy-State attributes.
+
+ If any condition is not met, the RADIUS server sends an "Access-
+ Reject" response indicating that this user request is invalid. If
+ desired, the server MAY include a text message in the Access-Reject
+ which MAY be displayed by the client to the user. No other
+ Attributes (except Proxy-State) are permitted in an Access-Reject.
+
+ If all conditions are met and the RADIUS server wishes to issue a
+ challenge to which the user must respond, the RADIUS server sends an
+ "Access-Challenge" response. It MAY include a text message to be
+ displayed by the client to the user prompting for a response to the
+ challenge, and MAY include a State attribute.
+
+ If the client receives an Access-Challenge and supports
+ challenge/response it MAY display the text message, if any, to the
+ user, and then prompt the user for a response. The client then re-
+ submits its original Access-Request with a new request ID, with the
+ User-Password Attribute replaced by the response (encrypted), and
+ including the State Attribute from the Access-Challenge, if any.
+ Only 0 or 1 instances of the State Attribute SHOULD be
+
+
+
+
+
+Rigney, et al. Standards Track [Page 6]
+
+RFC 2865 RADIUS June 2000
+
+
+ present in a request. The server can respond to this new Access-
+ Request with either an Access-Accept, an Access-Reject, or another
+ Access-Challenge.
+
+ If all conditions are met, the list of configuration values for the
+ user are placed into an "Access-Accept" response. These values
+ include the type of service (for example: SLIP, PPP, Login User) and
+ all necessary values to deliver the desired service. For SLIP and
+ PPP, this may include values such as IP address, subnet mask, MTU,
+ desired compression, and desired packet filter identifiers. For
+ character mode users, this may include values such as desired
+ protocol and host.
+
+2.1. Challenge/Response
+
+ In challenge/response authentication, the user is given an
+ unpredictable number and challenged to encrypt it and give back the
+ result. Authorized users are equipped with special devices such as
+ smart cards or software that facilitate calculation of the correct
+ response with ease. Unauthorized users, lacking the appropriate
+ device or software and lacking knowledge of the secret key necessary
+ to emulate such a device or software, can only guess at the response.
+
+ The Access-Challenge packet typically contains a Reply-Message
+ including a challenge to be displayed to the user, such as a numeric
+ value unlikely ever to be repeated. Typically this is obtained from
+ an external server that knows what type of authenticator is in the
+ possession of the authorized user and can therefore choose a random
+ or non-repeating pseudorandom number of an appropriate radix and
+ length.
+
+ The user then enters the challenge into his device (or software) and
+ it calculates a response, which the user enters into the client which
+ forwards it to the RADIUS server via a second Access-Request. If the
+ response matches the expected response the RADIUS server replies with
+ an Access-Accept, otherwise an Access-Reject.
+
+ Example: The NAS sends an Access-Request packet to the RADIUS Server
+ with NAS-Identifier, NAS-Port, User-Name, User-Password (which may
+ just be a fixed string like "challenge" or ignored). The server
+ sends back an Access-Challenge packet with State and a Reply-Message
+ along the lines of "Challenge 12345678, enter your response at the
+ prompt" which the NAS displays. The NAS prompts for the response and
+ sends a NEW Access-Request to the server (with a new ID) with NAS-
+ Identifier, NAS-Port, User-Name, User-Password (the response just
+ entered by the user, encrypted), and the same State Attribute that
+
+
+
+
+
+Rigney, et al. Standards Track [Page 7]
+
+RFC 2865 RADIUS June 2000
+
+
+ came with the Access-Challenge. The server then sends back either an
+ Access-Accept or Access-Reject based on whether the response matches
+ the required value, or it can even send another Access-Challenge.
+
+2.2. Interoperation with PAP and CHAP
+
+ For PAP, the NAS takes the PAP ID and password and sends them in an
+ Access-Request packet as the User-Name and User-Password. The NAS MAY
+ include the Attributes Service-Type = Framed-User and Framed-Protocol
+ = PPP as a hint to the RADIUS server that PPP service is expected.
+
+ For CHAP, the NAS generates a random challenge (preferably 16 octets)
+ and sends it to the user, who returns a CHAP response along with a
+ CHAP ID and CHAP username. The NAS then sends an Access-Request
+ packet to the RADIUS server with the CHAP username as the User-Name
+ and with the CHAP ID and CHAP response as the CHAP-Password
+ (Attribute 3). The random challenge can either be included in the
+ CHAP-Challenge attribute or, if it is 16 octets long, it can be
+ placed in the Request Authenticator field of the Access-Request
+ packet. The NAS MAY include the Attributes Service-Type = Framed-
+ User and Framed-Protocol = PPP as a hint to the RADIUS server that
+ PPP service is expected.
+
+ The RADIUS server looks up a password based on the User-Name,
+ encrypts the challenge using MD5 on the CHAP ID octet, that password,
+ and the CHAP challenge (from the CHAP-Challenge attribute if present,
+ otherwise from the Request Authenticator), and compares that result
+ to the CHAP-Password. If they match, the server sends back an
+ Access-Accept, otherwise it sends back an Access-Reject.
+
+ If the RADIUS server is unable to perform the requested
+ authentication it MUST return an Access-Reject. For example, CHAP
+ requires that the user's password be available in cleartext to the
+ server so that it can encrypt the CHAP challenge and compare that to
+ the CHAP response. If the password is not available in cleartext to
+ the RADIUS server then the server MUST send an Access-Reject to the
+ client.
+
+2.3. Proxy
+
+ With proxy RADIUS, one RADIUS server receives an authentication (or
+ accounting) request from a RADIUS client (such as a NAS), forwards
+ the request to a remote RADIUS server, receives the reply from the
+ remote server, and sends that reply to the client, possibly with
+ changes to reflect local administrative policy. A common use for
+ proxy RADIUS is roaming. Roaming permits two or more administrative
+ entities to allow each other's users to dial in to either entity's
+ network for service.
+
+
+
+Rigney, et al. Standards Track [Page 8]
+
+RFC 2865 RADIUS June 2000
+
+
+ The NAS sends its RADIUS access-request to the "forwarding server"
+ which forwards it to the "remote server". The remote server sends a
+ response (Access-Accept, Access-Reject, or Access-Challenge) back to
+ the forwarding server, which sends it back to the NAS. The User-Name
+ attribute MAY contain a Network Access Identifier [8] for RADIUS
+ Proxy operations. The choice of which server receives the forwarded
+ request SHOULD be based on the authentication "realm". The
+ authentication realm MAY be the realm part of a Network Access
+ Identifier (a "named realm"). Alternatively, the choice of which
+ server receives the forwarded request MAY be based on whatever other
+ criteria the forwarding server is configured to use, such as Called-
+ Station-Id (a "numbered realm").
+
+ A RADIUS server can function as both a forwarding server and a remote
+ server, serving as a forwarding server for some realms and a remote
+ server for other realms. One forwarding server can act as a
+ forwarder for any number of remote servers. A remote server can have
+ any number of servers forwarding to it and can provide authentication
+ for any number of realms. One forwarding server can forward to
+ another forwarding server to create a chain of proxies, although care
+ must be taken to avoid introducing loops.
+
+ The following scenario illustrates a proxy RADIUS communication
+ between a NAS and the forwarding and remote RADIUS servers:
+
+ 1. A NAS sends its access-request to the forwarding server.
+
+ 2. The forwarding server forwards the access-request to the remote
+ server.
+
+ 3. The remote server sends an access-accept, access-reject or
+ access-challenge back to the forwarding server. For this example,
+ an access-accept is sent.
+
+ 4. The forwarding server sends the access-accept to the NAS.
+
+ The forwarding server MUST treat any Proxy-State attributes already
+ in the packet as opaque data. Its operation MUST NOT depend on the
+ content of Proxy-State attributes added by previous servers.
+
+ If there are any Proxy-State attributes in the request received from
+ the client, the forwarding server MUST include those Proxy-State
+ attributes in its reply to the client. The forwarding server MAY
+ include the Proxy-State attributes in the access-request when it
+ forwards the request, or MAY omit them in the forwarded request. If
+ the forwarding server omits the Proxy-State attributes in the
+ forwarded access-request, it MUST attach them to the response before
+ sending it to the client.
+
+
+
+Rigney, et al. Standards Track [Page 9]
+
+RFC 2865 RADIUS June 2000
+
+
+ We now examine each step in more detail.
+
+ 1. A NAS sends its access-request to the forwarding server. The
+ forwarding server decrypts the User-Password, if present, using
+ the shared secret it knows for the NAS. If a CHAP-Password
+ attribute is present in the packet and no CHAP-Challenge attribute
+ is present, the forwarding server MUST leave the Request-
+ Authenticator untouched or copy it to a CHAP-Challenge attribute.
+
+ '' The forwarding server MAY add one Proxy-State attribute to the
+ packet. (It MUST NOT add more than one.) If it adds a Proxy-
+ State, the Proxy-State MUST appear after any other Proxy-States in
+ the packet. The forwarding server MUST NOT modify any other
+ Proxy-States that were in the packet (it may choose not to forward
+ them, but it MUST NOT change their contents). The forwarding
+ server MUST NOT change the order of any attributes of the same
+ type, including Proxy-State.
+
+ 2. The forwarding server encrypts the User-Password, if present,
+ using the secret it shares with the remote server, sets the
+ Identifier as needed, and forwards the access-request to the
+ remote server.
+
+ 3. The remote server (if the final destination) verifies the user
+ using User-Password, CHAP-Password, or such method as future
+ extensions may dictate, and returns an access-accept, access-
+ reject or access-challenge back to the forwarding server. For
+ this example, an access-accept is sent. The remote server MUST
+ copy all Proxy-State attributes (and only the Proxy-State
+ attributes) in order from the access-request to the response
+ packet, without modifying them.
+
+ 4. The forwarding server verifies the Response Authenticator using
+ the secret it shares with the remote server, and silently discards
+ the packet if it fails verification. If the packet passes
+ verification, the forwarding server removes the last Proxy-State
+ (if it attached one), signs the Response Authenticator using the
+ secret it shares with the NAS, restores the Identifier to match
+ the one in the original request by the NAS, and sends the access-
+ accept to the NAS.
+
+ A forwarding server MAY need to modify attributes to enforce local
+ policy. Such policy is outside the scope of this document, with the
+ following restrictions. A forwarding server MUST not modify existing
+ Proxy-State, State, or Class attributes present in the packet.
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 10]
+
+RFC 2865 RADIUS June 2000
+
+
+ Implementers of forwarding servers should consider carefully which
+ values it is willing to accept for Service-Type. Careful
+ consideration must be given to the effects of passing along Service-
+ Types of NAS-Prompt or Administrative in a proxied Access-Accept, and
+ implementers may wish to provide mechanisms to block those or other
+ service types, or other attributes. Such mechanisms are outside the
+ scope of this document.
+
+2.4. Why UDP?
+
+ A frequently asked question is why RADIUS uses UDP instead of TCP as
+ a transport protocol. UDP was chosen for strictly technical reasons.
+
+ There are a number of issues which must be understood. RADIUS is a
+ transaction based protocol which has several interesting
+ characteristics:
+
+ 1. If the request to a primary Authentication server fails, a
+ secondary server must be queried.
+
+ To meet this requirement, a copy of the request must be kept above
+ the transport layer to allow for alternate transmission. This
+ means that retransmission timers are still required.
+
+ 2. The timing requirements of this particular protocol are
+ significantly different than TCP provides.
+
+ At one extreme, RADIUS does not require a "responsive" detection
+ of lost data. The user is willing to wait several seconds for the
+ authentication to complete. The generally aggressive TCP
+ retransmission (based on average round trip time) is not required,
+ nor is the acknowledgement overhead of TCP.
+
+ At the other extreme, the user is not willing to wait several
+ minutes for authentication. Therefore the reliable delivery of
+ TCP data two minutes later is not useful. The faster use of an
+ alternate server allows the user to gain access before giving up.
+
+ 3. The stateless nature of this protocol simplifies the use of UDP.
+
+ Clients and servers come and go. Systems are rebooted, or are
+ power cycled independently. Generally this does not cause a
+ problem and with creative timeouts and detection of lost TCP
+ connections, code can be written to handle anomalous events. UDP
+ however completely eliminates any of this special handling. Each
+ client and server can open their UDP transport just once and leave
+ it open through all types of failure events on the network.
+
+
+
+
+Rigney, et al. Standards Track [Page 11]
+
+RFC 2865 RADIUS June 2000
+
+
+ 4. UDP simplifies the server implementation.
+
+ In the earliest implementations of RADIUS, the server was single
+ threaded. This means that a single request was received,
+ processed, and returned. This was found to be unmanageable in
+ environments where the back-end security mechanism took real time
+ (1 or more seconds). The server request queue would fill and in
+ environments where hundreds of people were being authenticated
+ every minute, the request turn-around time increased to longer
+ than users were willing to wait (this was especially severe when a
+ specific lookup in a database or over DNS took 30 or more
+ seconds). The obvious solution was to make the server multi-
+ threaded. Achieving this was simple with UDP. Separate processes
+ were spawned to serve each request and these processes could
+ respond directly to the client NAS with a simple UDP packet to the
+ original transport of the client.
+
+ It's not all a panacea. As noted, using UDP requires one thing which
+ is built into TCP: with UDP we must artificially manage
+ retransmission timers to the same server, although they don't require
+ the same attention to timing provided by TCP. This one penalty is a
+ small price to pay for the advantages of UDP in this protocol.
+
+ Without TCP we would still probably be using tin cans connected by
+ string. But for this particular protocol, UDP is a better choice.
+
+2.5. Retransmission Hints
+
+ If the RADIUS server and alternate RADIUS server share the same
+ shared secret, it is OK to retransmit the packet to the alternate
+ RADIUS server with the same ID and Request Authenticator, because the
+ content of the attributes haven't changed. If you want to use a new
+ Request Authenticator when sending to the alternate server, you may.
+
+ If you change the contents of the User-Password attribute (or any
+ other attribute), you need a new Request Authenticator and therefore
+ a new ID.
+
+ If the NAS is retransmitting a RADIUS request to the same server as
+ before, and the attributes haven't changed, you MUST use the same
+ Request Authenticator, ID, and source port. If any attributes have
+ changed, you MUST use a new Request Authenticator and ID.
+
+ A NAS MAY use the same ID across all servers, or MAY keep track of
+ IDs separately for each server, it is up to the implementer. If a
+ NAS needs more than 256 IDs for outstanding requests, it MAY use
+
+
+
+
+
+Rigney, et al. Standards Track [Page 12]
+
+RFC 2865 RADIUS June 2000
+
+
+ additional source ports to send requests from, and keep track of IDs
+ for each source port. This allows up to 16 million or so outstanding
+ requests at one time to a single server.
+
+2.6. Keep-Alives Considered Harmful
+
+ Some implementers have adopted the practice of sending test RADIUS
+ requests to see if a server is alive. This practice is strongly
+ discouraged, since it adds to load and harms scalability without
+ providing any additional useful information. Since a RADIUS request
+ is contained in a single datagram, in the time it would take you to
+ send a ping you could just send the RADIUS request, and getting a
+ reply tells you that the RADIUS server is up. If you do not have a
+ RADIUS request to send, it does not matter if the server is up or
+ not, because you are not using it.
+
+ If you want to monitor your RADIUS server, use SNMP. That's what
+ SNMP is for.
+
+3. Packet Format
+
+ Exactly one RADIUS packet is encapsulated in the UDP Data field [4],
+ where the UDP Destination Port field indicates 1812 (decimal).
+
+ When a reply is generated, the source and destination ports are
+ reversed.
+
+ This memo documents the RADIUS protocol. The early deployment of
+ RADIUS was done using UDP port number 1645, which conflicts with the
+ "datametrics" service. The officially assigned port number for
+ RADIUS is 1812.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 13]
+
+RFC 2865 RADIUS June 2000
+
+
+ A summary of the RADIUS data format is shown below. The fields are
+ transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ The Code field is one octet, and identifies the type of RADIUS
+ packet. When a packet is received with an invalid Code field, it
+ is silently discarded.
+
+ RADIUS Codes (decimal) are assigned as follows:
+
+ 1 Access-Request
+ 2 Access-Accept
+ 3 Access-Reject
+ 4 Accounting-Request
+ 5 Accounting-Response
+ 11 Access-Challenge
+ 12 Status-Server (experimental)
+ 13 Status-Client (experimental)
+ 255 Reserved
+
+ Codes 4 and 5 are covered in the RADIUS Accounting document [5].
+ Codes 12 and 13 are reserved for possible use, but are not further
+ mentioned here.
+
+ Identifier
+
+ The Identifier field is one octet, and aids in matching requests
+ and replies. The RADIUS server can detect a duplicate request if
+ it has the same client source IP address and source UDP port and
+ Identifier within a short span of time.
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 14]
+
+RFC 2865 RADIUS June 2000
+
+
+ Length
+
+ The Length field is two octets. It indicates the length of the
+ packet including the Code, Identifier, Length, Authenticator and
+ Attribute fields. Octets outside the range of the Length field
+ MUST be treated as padding and ignored on reception. If the
+ packet is shorter than the Length field indicates, it MUST be
+ silently discarded. The minimum length is 20 and maximum length
+ is 4096.
+
+ Authenticator
+
+ The Authenticator field is sixteen (16) octets. The most
+ significant octet is transmitted first. This value is used to
+ authenticate the reply from the RADIUS server, and is used in the
+ password hiding algorithm.
+
+ Request Authenticator
+
+ In Access-Request Packets, the Authenticator value is a 16
+ octet random number, called the Request Authenticator. The
+ value SHOULD be unpredictable and unique over the lifetime of a
+ secret (the password shared between the client and the RADIUS
+ server), since repetition of a request value in conjunction
+ with the same secret would permit an attacker to reply with a
+ previously intercepted response. Since it is expected that the
+ same secret MAY be used to authenticate with servers in
+ disparate geographic regions, the Request Authenticator field
+ SHOULD exhibit global and temporal uniqueness.
+
+ The Request Authenticator value in an Access-Request packet
+ SHOULD also be unpredictable, lest an attacker trick a server
+ into responding to a predicted future request, and then use the
+ response to masquerade as that server to a future Access-
+ Request.
+
+ Although protocols such as RADIUS are incapable of protecting
+ against theft of an authenticated session via realtime active
+ wiretapping attacks, generation of unique unpredictable
+ requests can protect against a wide range of active attacks
+ against authentication.
+
+ The NAS and RADIUS server share a secret. That shared secret
+ followed by the Request Authenticator is put through a one-way
+ MD5 hash to create a 16 octet digest value which is xored with
+ the password entered by the user, and the xored result placed
+
+
+
+
+
+Rigney, et al. Standards Track [Page 15]
+
+RFC 2865 RADIUS June 2000
+
+
+ in the User-Password attribute in the Access-Request packet.
+ See the entry for User-Password in the section on Attributes
+ for a more detailed description.
+
+ Response Authenticator
+
+ The value of the Authenticator field in Access-Accept, Access-
+ Reject, and Access-Challenge packets is called the Response
+ Authenticator, and contains a one-way MD5 hash calculated over
+ a stream of octets consisting of: the RADIUS packet, beginning
+ with the Code field, including the Identifier, the Length, the
+ Request Authenticator field from the Access-Request packet, and
+ the response Attributes, followed by the shared secret. That
+ is, ResponseAuth =
+ MD5(Code+ID+Length+RequestAuth+Attributes+Secret) where +
+ denotes concatenation.
+
+ Administrative Note
+
+ The secret (password shared between the client and the RADIUS
+ server) SHOULD be at least as large and unguessable as a well-
+ chosen password. It is preferred that the secret be at least 16
+ octets. This is to ensure a sufficiently large range for the
+ secret to provide protection against exhaustive search attacks.
+ The secret MUST NOT be empty (length 0) since this would allow
+ packets to be trivially forged.
+
+ A RADIUS server MUST use the source IP address of the RADIUS UDP
+ packet to decide which shared secret to use, so that RADIUS
+ requests can be proxied.
+
+ When using a forwarding proxy, the proxy must be able to alter the
+ packet as it passes through in each direction - when the proxy
+ forwards the request, the proxy MAY add a Proxy-State Attribute,
+ and when the proxy forwards a response, it MUST remove its Proxy-
+ State Attribute if it added one. Proxy-State is always added or
+ removed after any other Proxy-States, but no other assumptions
+ regarding its location within the list of attributes can be made.
+ Since Access-Accept and Access-Reject replies are authenticated on
+ the entire packet contents, the stripping of the Proxy-State
+ attribute invalidates the signature in the packet - so the proxy
+ has to re-sign it.
+
+ Further details of RADIUS proxy implementation are outside the
+ scope of this document.
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 16]
+
+RFC 2865 RADIUS June 2000
+
+
+4. Packet Types
+
+ The RADIUS Packet type is determined by the Code field in the first
+ octet of the Packet.
+
+4.1. Access-Request
+
+ Description
+
+ Access-Request packets are sent to a RADIUS server, and convey
+ information used to determine whether a user is allowed access to
+ a specific NAS, and any special services requested for that user.
+ An implementation wishing to authenticate a user MUST transmit a
+ RADIUS packet with the Code field set to 1 (Access-Request).
+
+ Upon receipt of an Access-Request from a valid client, an
+ appropriate reply MUST be transmitted.
+
+ An Access-Request SHOULD contain a User-Name attribute. It MUST
+ contain either a NAS-IP-Address attribute or a NAS-Identifier
+ attribute (or both).
+
+ An Access-Request MUST contain either a User-Password or a CHAP-
+ Password or a State. An Access-Request MUST NOT contain both a
+ User-Password and a CHAP-Password. If future extensions allow
+ other kinds of authentication information to be conveyed, the
+ attribute for that can be used in an Access-Request instead of
+ User-Password or CHAP-Password.
+
+ An Access-Request SHOULD contain a NAS-Port or NAS-Port-Type
+ attribute or both unless the type of access being requested does
+ not involve a port or the NAS does not distinguish among its
+ ports.
+
+ An Access-Request MAY contain additional attributes as a hint to
+ the server, but the server is not required to honor the hint.
+
+ When a User-Password is present, it is hidden using a method based
+ on the RSA Message Digest Algorithm MD5 [3].
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 17]
+
+RFC 2865 RADIUS June 2000
+
+
+ A summary of the Access-Request packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Request Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 1 for Access-Request.
+
+ Identifier
+
+ The Identifier field MUST be changed whenever the content of the
+ Attributes field changes, and whenever a valid reply has been
+ received for a previous request. For retransmissions, the
+ Identifier MUST remain unchanged.
+
+ Request Authenticator
+
+ The Request Authenticator value MUST be changed each time a new
+ Identifier is used.
+
+ Attributes
+
+ The Attribute field is variable in length, and contains the list
+ of Attributes that are required for the type of service, as well
+ as any desired optional Attributes.
+
+4.2. Access-Accept
+
+ Description
+
+ Access-Accept packets are sent by the RADIUS server, and provide
+ specific configuration information necessary to begin delivery of
+ service to the user. If all Attribute values received in an
+ Access-Request are acceptable then the RADIUS implementation MUST
+ transmit a packet with the Code field set to 2 (Access-Accept).
+
+
+
+
+Rigney, et al. Standards Track [Page 18]
+
+RFC 2865 RADIUS June 2000
+
+
+ On reception of an Access-Accept, the Identifier field is matched
+ with a pending Access-Request. The Response Authenticator field
+ MUST contain the correct response for the pending Access-Request.
+ Invalid packets are silently discarded.
+
+ A summary of the Access-Accept packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Response Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 2 for Access-Accept.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Access-Request which caused this Access-Accept.
+
+ Response Authenticator
+
+ The Response Authenticator value is calculated from the Access-
+ Request value, as described earlier.
+
+ Attributes
+
+ The Attribute field is variable in length, and contains a list of
+ zero or more Attributes.
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 19]
+
+RFC 2865 RADIUS June 2000
+
+
+4.3. Access-Reject
+
+ Description
+
+ If any value of the received Attributes is not acceptable, then
+ the RADIUS server MUST transmit a packet with the Code field set
+ to 3 (Access-Reject). It MAY include one or more Reply-Message
+ Attributes with a text message which the NAS MAY display to the
+ user.
+
+ A summary of the Access-Reject packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Response Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 3 for Access-Reject.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Access-Request which caused this Access-Reject.
+
+ Response Authenticator
+
+ The Response Authenticator value is calculated from the Access-
+ Request value, as described earlier.
+
+ Attributes
+
+ The Attribute field is variable in length, and contains a list of
+ zero or more Attributes.
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 20]
+
+RFC 2865 RADIUS June 2000
+
+
+4.4. Access-Challenge
+
+ Description
+
+ If the RADIUS server desires to send the user a challenge
+ requiring a response, then the RADIUS server MUST respond to the
+ Access-Request by transmitting a packet with the Code field set to
+ 11 (Access-Challenge).
+
+ The Attributes field MAY have one or more Reply-Message
+ Attributes, and MAY have a single State Attribute, or none.
+ Vendor-Specific, Idle-Timeout, Session-Timeout and Proxy-State
+ attributes MAY also be included. No other Attributes defined in
+ this document are permitted in an Access-Challenge.
+
+ On receipt of an Access-Challenge, the Identifier field is matched
+ with a pending Access-Request. Additionally, the Response
+ Authenticator field MUST contain the correct response for the
+ pending Access-Request. Invalid packets are silently discarded.
+
+ If the NAS does not support challenge/response, it MUST treat an
+ Access-Challenge as though it had received an Access-Reject
+ instead.
+
+ If the NAS supports challenge/response, receipt of a valid
+ Access-Challenge indicates that a new Access-Request SHOULD be
+ sent. The NAS MAY display the text message, if any, to the user,
+ and then prompt the user for a response. It then sends its
+ original Access-Request with a new request ID and Request
+ Authenticator, with the User-Password Attribute replaced by the
+ user's response (encrypted), and including the State Attribute
+ from the Access-Challenge, if any. Only 0 or 1 instances of the
+ State Attribute can be present in an Access-Request.
+
+ A NAS which supports PAP MAY forward the Reply-Message to the
+ dialing client and accept a PAP response which it can use as
+ though the user had entered the response. If the NAS cannot do
+ so, it MUST treat the Access-Challenge as though it had received
+ an Access-Reject instead.
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 21]
+
+RFC 2865 RADIUS June 2000
+
+
+ A summary of the Access-Challenge packet format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Response Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 11 for Access-Challenge.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Access-Request which caused this Access-Challenge.
+
+ Response Authenticator
+
+ The Response Authenticator value is calculated from the Access-
+ Request value, as described earlier.
+
+ Attributes
+
+ The Attributes field is variable in length, and contains a list of
+ zero or more Attributes.
+
+5. Attributes
+
+ RADIUS Attributes carry the specific authentication, authorization,
+ information and configuration details for the request and reply.
+
+ The end of the list of Attributes is indicated by the Length of the
+ RADIUS packet.
+
+ Some Attributes MAY be included more than once. The effect of this
+ is Attribute specific, and is specified in each Attribute
+ description. A summary table is provided at the end of the
+ "Attributes" section.
+
+
+
+
+Rigney, et al. Standards Track [Page 22]
+
+RFC 2865 RADIUS June 2000
+
+
+ If multiple Attributes with the same Type are present, the order of
+ Attributes with the same Type MUST be preserved by any proxies. The
+ order of Attributes of different Types is not required to be
+ preserved. A RADIUS server or client MUST NOT have any dependencies
+ on the order of attributes of different types. A RADIUS server or
+ client MUST NOT require attributes of the same type to be contiguous.
+
+ Where an Attribute's description limits which kinds of packet it can
+ be contained in, this applies only to the packet types defined in
+ this document, namely Access-Request, Access-Accept, Access-Reject
+ and Access-Challenge (Codes 1, 2, 3, and 11). Other documents
+ defining other packet types may also use Attributes described here.
+ To determine which Attributes are allowed in Accounting-Request and
+ Accounting-Response packets (Codes 4 and 5) refer to the RADIUS
+ Accounting document [5].
+
+ Likewise where packet types defined here state that only certain
+ Attributes are permissible in them, future memos defining new
+ Attributes should indicate which packet types the new Attributes may
+ be present in.
+
+ A summary of the Attribute format is shown below. The fields are
+ transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | Value ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ The Type field is one octet. Up-to-date values of the RADIUS Type
+ field are specified in the most recent "Assigned Numbers" RFC [6].
+ Values 192-223 are reserved for experimental use, values 224-240
+ are reserved for implementation-specific use, and values 241-255
+ are reserved and should not be used.
+
+ A RADIUS server MAY ignore Attributes with an unknown Type.
+
+ A RADIUS client MAY ignore Attributes with an unknown Type.
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 23]
+
+RFC 2865 RADIUS June 2000
+
+
+ This specification concerns the following values:
+
+ 1 User-Name
+ 2 User-Password
+ 3 CHAP-Password
+ 4 NAS-IP-Address
+ 5 NAS-Port
+ 6 Service-Type
+ 7 Framed-Protocol
+ 8 Framed-IP-Address
+ 9 Framed-IP-Netmask
+ 10 Framed-Routing
+ 11 Filter-Id
+ 12 Framed-MTU
+ 13 Framed-Compression
+ 14 Login-IP-Host
+ 15 Login-Service
+ 16 Login-TCP-Port
+ 17 (unassigned)
+ 18 Reply-Message
+ 19 Callback-Number
+ 20 Callback-Id
+ 21 (unassigned)
+ 22 Framed-Route
+ 23 Framed-IPX-Network
+ 24 State
+ 25 Class
+ 26 Vendor-Specific
+ 27 Session-Timeout
+ 28 Idle-Timeout
+ 29 Termination-Action
+ 30 Called-Station-Id
+ 31 Calling-Station-Id
+ 32 NAS-Identifier
+ 33 Proxy-State
+ 34 Login-LAT-Service
+ 35 Login-LAT-Node
+ 36 Login-LAT-Group
+ 37 Framed-AppleTalk-Link
+ 38 Framed-AppleTalk-Network
+ 39 Framed-AppleTalk-Zone
+ 40-59 (reserved for accounting)
+ 60 CHAP-Challenge
+ 61 NAS-Port-Type
+ 62 Port-Limit
+ 63 Login-LAT-Port
+
+
+
+
+
+Rigney, et al. Standards Track [Page 24]
+
+RFC 2865 RADIUS June 2000
+
+
+ Length
+
+ The Length field is one octet, and indicates the length of this
+ Attribute including the Type, Length and Value fields. If an
+ Attribute is received in an Access-Request but with an invalid
+ Length, an Access-Reject SHOULD be transmitted. If an Attribute
+ is received in an Access-Accept, Access-Reject or Access-Challenge
+ packet with an invalid length, the packet MUST either be treated
+ as an Access-Reject or else silently discarded.
+
+ Value
+
+ The Value field is zero or more octets and contains information
+ specific to the Attribute. The format and length of the Value
+ field is determined by the Type and Length fields.
+
+ Note that none of the types in RADIUS terminate with a NUL (hex
+ 00). In particular, types "text" and "string" in RADIUS do not
+ terminate with a NUL (hex 00). The Attribute has a length field
+ and does not use a terminator. Text contains UTF-8 encoded 10646
+ [7] characters and String contains 8-bit binary data. Servers and
+ servers and clients MUST be able to deal with embedded nulls.
+ RADIUS implementers using C are cautioned not to use strcpy() when
+ handling strings.
+
+ The format of the value field is one of five data types. Note
+ that type "text" is a subset of type "string".
+
+ text 1-253 octets containing UTF-8 encoded 10646 [7]
+ characters. Text of length zero (0) MUST NOT be sent;
+ omit the entire attribute instead.
+
+ string 1-253 octets containing binary data (values 0 through
+ 255 decimal, inclusive). Strings of length zero (0)
+ MUST NOT be sent; omit the entire attribute instead.
+
+ address 32 bit value, most significant octet first.
+
+ integer 32 bit unsigned value, most significant octet first.
+
+ time 32 bit unsigned value, most significant octet first --
+ seconds since 00:00:00 UTC, January 1, 1970. The
+ standard Attributes do not use this data type but it is
+ presented here for possible use in future attributes.
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 25]
+
+RFC 2865 RADIUS June 2000
+
+
+5.1. User-Name
+
+ Description
+
+ This Attribute indicates the name of the user to be authenticated.
+ It MUST be sent in Access-Request packets if available.
+
+ It MAY be sent in an Access-Accept packet, in which case the
+ client SHOULD use the name returned in the Access-Accept packet in
+ all Accounting-Request packets for this session. If the Access-
+ Accept includes Service-Type = Rlogin and the User-Name attribute,
+ a NAS MAY use the returned User-Name when performing the Rlogin
+ function.
+
+ A summary of the User-Name Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 1 for User-Name.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The NAS may limit the
+ maximum length of the User-Name but the ability to handle at least
+ 63 octets is recommended.
+
+ The format of the username MAY be one of several forms:
+
+ text Consisting only of UTF-8 encoded 10646 [7] characters.
+
+ network access identifier
+ A Network Access Identifier as described in RFC 2486
+ [8].
+
+ distinguished name
+ A name in ASN.1 form used in Public Key authentication
+ systems.
+
+
+
+Rigney, et al. Standards Track [Page 26]
+
+RFC 2865 RADIUS June 2000
+
+
+5.2. User-Password
+
+ Description
+
+ This Attribute indicates the password of the user to be
+ authenticated, or the user's input following an Access-Challenge.
+ It is only used in Access-Request packets.
+
+ On transmission, the password is hidden. The password is first
+ padded at the end with nulls to a multiple of 16 octets. A one-
+ way MD5 hash is calculated over a stream of octets consisting of
+ the shared secret followed by the Request Authenticator. This
+ value is XORed with the first 16 octet segment of the password and
+ placed in the first 16 octets of the String field of the User-
+ Password Attribute.
+
+ If the password is longer than 16 characters, a second one-way MD5
+ hash is calculated over a stream of octets consisting of the
+ shared secret followed by the result of the first xor. That hash
+ is XORed with the second 16 octet segment of the password and
+ placed in the second 16 octets of the String field of the User-
+ Password Attribute.
+
+ If necessary, this operation is repeated, with each xor result
+ being used along with the shared secret to generate the next hash
+ to xor the next segment of the password, to no more than 128
+ characters.
+
+ The method is taken from the book "Network Security" by Kaufman,
+ Perlman and Speciner [9] pages 109-110. A more precise
+ explanation of the method follows:
+
+ Call the shared secret S and the pseudo-random 128-bit Request
+ Authenticator RA. Break the password into 16-octet chunks p1, p2,
+ etc. with the last one padded at the end with nulls to a 16-octet
+ boundary. Call the ciphertext blocks c(1), c(2), etc. We'll need
+ intermediate values b1, b2, etc.
+
+ b1 = MD5(S + RA) c(1) = p1 xor b1
+ b2 = MD5(S + c(1)) c(2) = p2 xor b2
+ . .
+ . .
+ . .
+ bi = MD5(S + c(i-1)) c(i) = pi xor bi
+
+ The String will contain c(1)+c(2)+...+c(i) where + denotes
+ concatenation.
+
+
+
+
+Rigney, et al. Standards Track [Page 27]
+
+RFC 2865 RADIUS June 2000
+
+
+ On receipt, the process is reversed to yield the original
+ password.
+
+ A summary of the User-Password Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 2 for User-Password.
+
+ Length
+
+ At least 18 and no larger than 130.
+
+ String
+
+ The String field is between 16 and 128 octets long, inclusive.
+
+5.3. CHAP-Password
+
+ Description
+
+ This Attribute indicates the response value provided by a PPP
+ Challenge-Handshake Authentication Protocol (CHAP) user in
+ response to the challenge. It is only used in Access-Request
+ packets.
+
+ The CHAP challenge value is found in the CHAP-Challenge Attribute
+ (60) if present in the packet, otherwise in the Request
+ Authenticator field.
+
+ A summary of the CHAP-Password Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | CHAP Ident | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 28]
+
+RFC 2865 RADIUS June 2000
+
+
+ Type
+
+ 3 for CHAP-Password.
+
+ Length
+
+ 19
+
+ CHAP Ident
+
+ This field is one octet, and contains the CHAP Identifier from the
+ user's CHAP Response.
+
+ String
+
+ The String field is 16 octets, and contains the CHAP Response from
+ the user.
+
+5.4. NAS-IP-Address
+
+ Description
+
+ This Attribute indicates the identifying IP Address of the NAS
+ which is requesting authentication of the user, and SHOULD be
+ unique to the NAS within the scope of the RADIUS server. NAS-IP-
+ Address is only used in Access-Request packets. Either NAS-IP-
+ Address or NAS-Identifier MUST be present in an Access-Request
+ packet.
+
+ Note that NAS-IP-Address MUST NOT be used to select the shared
+ secret used to authenticate the request. The source IP address of
+ the Access-Request packet MUST be used to select the shared
+ secret.
+
+ A summary of the NAS-IP-Address Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 4 for NAS-IP-Address.
+
+
+
+Rigney, et al. Standards Track [Page 29]
+
+RFC 2865 RADIUS June 2000
+
+
+ Length
+
+ 6
+
+ Address
+
+ The Address field is four octets.
+
+5.5. NAS-Port
+
+ Description
+
+ This Attribute indicates the physical port number of the NAS which
+ is authenticating the user. It is only used in Access-Request
+ packets. Note that this is using "port" in its sense of a
+ physical connection on the NAS, not in the sense of a TCP or UDP
+ port number. Either NAS-Port or NAS-Port-Type (61) or both SHOULD
+ be present in an Access-Request packet, if the NAS differentiates
+ among its ports.
+
+ A summary of the NAS-Port Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 5 for NAS-Port.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 30]
+
+RFC 2865 RADIUS June 2000
+
+
+5.6. Service-Type
+
+ Description
+
+ This Attribute indicates the type of service the user has
+ requested, or the type of service to be provided. It MAY be used
+ in both Access-Request and Access-Accept packets. A NAS is not
+ required to implement all of these service types, and MUST treat
+ unknown or unsupported Service-Types as though an Access-Reject
+ had been received instead.
+
+ A summary of the Service-Type Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 6 for Service-Type.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 1 Login
+ 2 Framed
+ 3 Callback Login
+ 4 Callback Framed
+ 5 Outbound
+ 6 Administrative
+ 7 NAS Prompt
+ 8 Authenticate Only
+ 9 Callback NAS Prompt
+ 10 Call Check
+ 11 Callback Administrative
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 31]
+
+RFC 2865 RADIUS June 2000
+
+
+ The service types are defined as follows when used in an Access-
+ Accept. When used in an Access-Request, they MAY be considered to
+ be a hint to the RADIUS server that the NAS has reason to believe
+ the user would prefer the kind of service indicated, but the
+ server is not required to honor the hint.
+
+ Login The user should be connected to a host.
+
+ Framed A Framed Protocol should be started for the
+ User, such as PPP or SLIP.
+
+ Callback Login The user should be disconnected and called
+ back, then connected to a host.
+
+ Callback Framed The user should be disconnected and called
+ back, then a Framed Protocol should be started
+ for the User, such as PPP or SLIP.
+
+ Outbound The user should be granted access to outgoing
+ devices.
+
+ Administrative The user should be granted access to the
+ administrative interface to the NAS from which
+ privileged commands can be executed.
+
+ NAS Prompt The user should be provided a command prompt
+ on the NAS from which non-privileged commands
+ can be executed.
+
+ Authenticate Only Only Authentication is requested, and no
+ authorization information needs to be returned
+ in the Access-Accept (typically used by proxy
+ servers rather than the NAS itself).
+
+ Callback NAS Prompt The user should be disconnected and called
+ back, then provided a command prompt on the
+ NAS from which non-privileged commands can be
+ executed.
+
+ Call Check Used by the NAS in an Access-Request packet to
+ indicate that a call is being received and
+ that the RADIUS server should send back an
+ Access-Accept to answer the call, or an
+ Access-Reject to not accept the call,
+ typically based on the Called-Station-Id or
+ Calling-Station-Id attributes. It is
+
+
+
+
+
+Rigney, et al. Standards Track [Page 32]
+
+RFC 2865 RADIUS June 2000
+
+
+ recommended that such Access-Requests use the
+ value of Calling-Station-Id as the value of
+ the User-Name.
+
+ Callback Administrative
+ The user should be disconnected and called
+ back, then granted access to the
+ administrative interface to the NAS from which
+ privileged commands can be executed.
+
+5.7. Framed-Protocol
+
+ Description
+
+ This Attribute indicates the framing to be used for framed access.
+ It MAY be used in both Access-Request and Access-Accept packets.
+
+ A summary of the Framed-Protocol Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 7 for Framed-Protocol.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 1 PPP
+ 2 SLIP
+ 3 AppleTalk Remote Access Protocol (ARAP)
+ 4 Gandalf proprietary SingleLink/MultiLink protocol
+ 5 Xylogics proprietary IPX/SLIP
+ 6 X.75 Synchronous
+
+
+
+
+
+Rigney, et al. Standards Track [Page 33]
+
+RFC 2865 RADIUS June 2000
+
+
+5.8. Framed-IP-Address
+
+ Description
+
+ This Attribute indicates the address to be configured for the
+ user. It MAY be used in Access-Accept packets. It MAY be used in
+ an Access-Request packet as a hint by the NAS to the server that
+ it would prefer that address, but the server is not required to
+ honor the hint.
+
+ A summary of the Framed-IP-Address Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 8 for Framed-IP-Address.
+
+ Length
+
+ 6
+
+ Address
+
+ The Address field is four octets. The value 0xFFFFFFFF indicates
+ that the NAS Should allow the user to select an address (e.g.
+ Negotiated). The value 0xFFFFFFFE indicates that the NAS should
+ select an address for the user (e.g. Assigned from a pool of
+ addresses kept by the NAS). Other valid values indicate that the
+ NAS should use that value as the user's IP address.
+
+5.9. Framed-IP-Netmask
+
+ Description
+
+ This Attribute indicates the IP netmask to be configured for the
+ user when the user is a router to a network. It MAY be used in
+ Access-Accept packets. It MAY be used in an Access-Request packet
+ as a hint by the NAS to the server that it would prefer that
+ netmask, but the server is not required to honor the hint.
+
+
+
+
+Rigney, et al. Standards Track [Page 34]
+
+RFC 2865 RADIUS June 2000
+
+
+ A summary of the Framed-IP-Netmask Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 9 for Framed-IP-Netmask.
+
+ Length
+
+ 6
+
+ Address
+
+ The Address field is four octets specifying the IP netmask of the
+ user.
+
+5.10. Framed-Routing
+
+ Description
+
+ This Attribute indicates the routing method for the user, when the
+ user is a router to a network. It is only used in Access-Accept
+ packets.
+
+ A summary of the Framed-Routing Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 10 for Framed-Routing.
+
+
+
+
+
+Rigney, et al. Standards Track [Page 35]
+
+RFC 2865 RADIUS June 2000
+
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 0 None
+ 1 Send routing packets
+ 2 Listen for routing packets
+ 3 Send and Listen
+
+5.11. Filter-Id
+
+ Description
+
+ This Attribute indicates the name of the filter list for this
+ user. Zero or more Filter-Id attributes MAY be sent in an
+ Access-Accept packet.
+
+ Identifying a filter list by name allows the filter to be used on
+ different NASes without regard to filter-list implementation
+ details.
+
+ A summary of the Filter-Id Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | Text ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 11 for Filter-Id.
+
+ Length
+
+ >= 3
+
+ Text
+
+ The Text field is one or more octets, and its contents are
+ implementation dependent. It is intended to be human readable and
+ MUST NOT affect operation of the protocol. It is recommended that
+ the message contain UTF-8 encoded 10646 [7] characters.
+
+
+
+Rigney, et al. Standards Track [Page 36]
+
+RFC 2865 RADIUS June 2000
+
+
+5.12. Framed-MTU
+
+ Description
+
+ This Attribute indicates the Maximum Transmission Unit to be
+ configured for the user, when it is not negotiated by some other
+ means (such as PPP). It MAY be used in Access-Accept packets. It
+ MAY be used in an Access-Request packet as a hint by the NAS to
+ the server that it would prefer that value, but the server is not
+ required to honor the hint.
+
+ A summary of the Framed-MTU Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 12 for Framed-MTU.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. Despite the size of the field,
+ values range from 64 to 65535.
+
+5.13. Framed-Compression
+
+ Description
+
+ This Attribute indicates a compression protocol to be used for the
+ link. It MAY be used in Access-Accept packets. It MAY be used in
+ an Access-Request packet as a hint to the server that the NAS
+ would prefer to use that compression, but the server is not
+ required to honor the hint.
+
+ More than one compression protocol Attribute MAY be sent. It is
+ the responsibility of the NAS to apply the proper compression
+ protocol to appropriate link traffic.
+
+
+
+Rigney, et al. Standards Track [Page 37]
+
+RFC 2865 RADIUS June 2000
+
+
+ A summary of the Framed-Compression Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 13 for Framed-Compression.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 0 None
+ 1 VJ TCP/IP header compression [10]
+ 2 IPX header compression
+ 3 Stac-LZS compression
+
+5.14. Login-IP-Host
+
+ Description
+
+ This Attribute indicates the system with which to connect the user,
+ when the Login-Service Attribute is included. It MAY be used in
+ Access-Accept packets. It MAY be used in an Access-Request packet as
+ a hint to the server that the NAS would prefer to use that host, but
+ the server is not required to honor the hint.
+
+ A summary of the Login-IP-Host Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 38]
+
+RFC 2865 RADIUS June 2000
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Address
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Address (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 14 for Login-IP-Host.
+
+ Length
+
+ 6
+
+ Address
+
+ The Address field is four octets. The value 0xFFFFFFFF indicates
+ that the NAS SHOULD allow the user to select an address. The
+ value 0 indicates that the NAS SHOULD select a host to connect the
+ user to. Other values indicate the address the NAS SHOULD connect
+ the user to.
+
+5.15. Login-Service
+
+ Description
+
+ This Attribute indicates the service to use to connect the user to
+ the login host. It is only used in Access-Accept packets.
+
+ A summary of the Login-Service Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 15 for Login-Service.
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 39]
+
+RFC 2865 RADIUS June 2000
+
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 0 Telnet
+ 1 Rlogin
+ 2 TCP Clear
+ 3 PortMaster (proprietary)
+ 4 LAT
+ 5 X25-PAD
+ 6 X25-T3POS
+ 8 TCP Clear Quiet (suppresses any NAS-generated connect string)
+
+5.16. Login-TCP-Port
+
+ Description
+
+ This Attribute indicates the TCP port with which the user is to be
+ connected, when the Login-Service Attribute is also present. It
+ is only used in Access-Accept packets.
+
+ A summary of the Login-TCP-Port Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 16 for Login-TCP-Port.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. Despite the size of the field,
+ values range from 0 to 65535.
+
+
+
+Rigney, et al. Standards Track [Page 40]
+
+RFC 2865 RADIUS June 2000
+
+
+5.17. (unassigned)
+
+ Description
+
+ ATTRIBUTE TYPE 17 HAS NOT BEEN ASSIGNED.
+
+5.18. Reply-Message
+
+ Description
+
+ This Attribute indicates text which MAY be displayed to the user.
+
+ When used in an Access-Accept, it is the success message.
+
+ When used in an Access-Reject, it is the failure message. It MAY
+ indicate a dialog message to prompt the user before another
+ Access-Request attempt.
+
+ When used in an Access-Challenge, it MAY indicate a dialog message
+ to prompt the user for a response.
+
+ Multiple Reply-Message's MAY be included and if any are displayed,
+ they MUST be displayed in the same order as they appear in the
+ packet.
+
+ A summary of the Reply-Message Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | Text ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 18 for Reply-Message.
+
+ Length
+
+ >= 3
+
+ Text
+
+ The Text field is one or more octets, and its contents are
+ implementation dependent. It is intended to be human readable,
+ and MUST NOT affect operation of the protocol. It is recommended
+ that the message contain UTF-8 encoded 10646 [7] characters.
+
+
+
+Rigney, et al. Standards Track [Page 41]
+
+RFC 2865 RADIUS June 2000
+
+
+5.19. Callback-Number
+
+ Description
+
+ This Attribute indicates a dialing string to be used for callback.
+ It MAY be used in Access-Accept packets. It MAY be used in an
+ Access-Request packet as a hint to the server that a Callback
+ service is desired, but the server is not required to honor the
+ hint.
+
+ A summary of the Callback-Number Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 19 for Callback-Number.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.20. Callback-Id
+
+ Description
+
+ This Attribute indicates the name of a place to be called, to be
+ interpreted by the NAS. It MAY be used in Access-Accept packets.
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 42]
+
+RFC 2865 RADIUS June 2000
+
+
+ A summary of the Callback-Id Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 20 for Callback-Id.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.21. (unassigned)
+
+ Description
+
+ ATTRIBUTE TYPE 21 HAS NOT BEEN ASSIGNED.
+
+5.22. Framed-Route
+
+ Description
+
+ This Attribute provides routing information to be configured for
+ the user on the NAS. It is used in the Access-Accept packet and
+ can appear multiple times.
+
+ A summary of the Framed-Route Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | Text ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+
+Rigney, et al. Standards Track [Page 43]
+
+RFC 2865 RADIUS June 2000
+
+
+ Type
+
+ 22 for Framed-Route.
+
+ Length
+
+ >= 3
+
+ Text
+
+ The Text field is one or more octets, and its contents are
+ implementation dependent. It is intended to be human readable and
+ MUST NOT affect operation of the protocol. It is recommended that
+ the message contain UTF-8 encoded 10646 [7] characters.
+
+ For IP routes, it SHOULD contain a destination prefix in dotted
+ quad form optionally followed by a slash and a decimal length
+ specifier stating how many high order bits of the prefix to use.
+ That is followed by a space, a gateway address in dotted quad
+ form, a space, and one or more metrics separated by spaces. For
+ example, "192.168.1.0/24 192.168.1.1 1 2 -1 3 400". The length
+ specifier may be omitted, in which case it defaults to 8 bits for
+ class A prefixes, 16 bits for class B prefixes, and 24 bits for
+ class C prefixes. For example, "192.168.1.0 192.168.1.1 1".
+
+ Whenever the gateway address is specified as "0.0.0.0" the IP
+ address of the user SHOULD be used as the gateway address.
+
+5.23. Framed-IPX-Network
+
+ Description
+
+ This Attribute indicates the IPX Network number to be configured
+ for the user. It is used in Access-Accept packets.
+
+ A summary of the Framed-IPX-Network Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 44]
+
+RFC 2865 RADIUS June 2000
+
+
+ Type
+
+ 23 for Framed-IPX-Network.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. The value 0xFFFFFFFE indicates
+ that the NAS should select an IPX network for the user (e.g.
+ assigned from a pool of one or more IPX networks kept by the NAS).
+ Other values should be used as the IPX network for the link to the
+ user.
+
+5.24. State
+
+ Description
+
+ This Attribute is available to be sent by the server to the client
+ in an Access-Challenge and MUST be sent unmodified from the client
+ to the server in the new Access-Request reply to that challenge,
+ if any.
+
+ This Attribute is available to be sent by the server to the client
+ in an Access-Accept that also includes a Termination-Action
+ Attribute with the value of RADIUS-Request. If the NAS performs
+ the Termination-Action by sending a new Access-Request upon
+ termination of the current session, it MUST include the State
+ attribute unchanged in that Access-Request.
+
+ In either usage, the client MUST NOT interpret the attribute
+ locally. A packet must have only zero or one State Attribute.
+ Usage of the State Attribute is implementation dependent.
+
+ A summary of the State Attribute format is shown below. The fields
+ are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 24 for State.
+
+
+
+Rigney, et al. Standards Track [Page 45]
+
+RFC 2865 RADIUS June 2000
+
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.25. Class
+
+ Description
+
+ This Attribute is available to be sent by the server to the client
+ in an Access-Accept and SHOULD be sent unmodified by the client to
+ the accounting server as part of the Accounting-Request packet if
+ accounting is supported. The client MUST NOT interpret the
+ attribute locally.
+
+ A summary of the Class Attribute format is shown below. The fields
+ are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 25 for Class.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+
+
+Rigney, et al. Standards Track [Page 46]
+
+RFC 2865 RADIUS June 2000
+
+
+5.26. Vendor-Specific
+
+ Description
+
+ This Attribute is available to allow vendors to support their own
+ extended Attributes not suitable for general usage. It MUST not
+ affect the operation of the RADIUS protocol.
+
+ Servers not equipped to interpret the vendor-specific information
+ sent by a client MUST ignore it (although it may be reported).
+ Clients which do not receive desired vendor-specific information
+ SHOULD make an attempt to operate without it, although they may do
+ so (and report they are doing so) in a degraded mode.
+
+ A summary of the Vendor-Specific Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Vendor-Id
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Vendor-Id (cont) | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 26 for Vendor-Specific.
+
+ Length
+
+ >= 7
+
+ Vendor-Id
+
+ The high-order octet is 0 and the low-order 3 octets are the SMI
+ Network Management Private Enterprise Code of the Vendor in
+ network byte order, as defined in the "Assigned Numbers" RFC [6].
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+
+
+
+Rigney, et al. Standards Track [Page 47]
+
+RFC 2865 RADIUS June 2000
+
+
+ It SHOULD be encoded as a sequence of vendor type / vendor length
+ / value fields, as follows. The Attribute-Specific field is
+ dependent on the vendor's definition of that attribute. An
+ example encoding of the Vendor-Specific attribute using this
+ method follows:
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Vendor-Id
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Vendor-Id (cont) | Vendor type | Vendor length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attribute-Specific...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Multiple subattributes MAY be encoded within a single Vendor-
+ Specific attribute, although they do not have to be.
+
+5.27. Session-Timeout
+
+ Description
+
+ This Attribute sets the maximum number of seconds of service to be
+ provided to the user before termination of the session or prompt.
+ This Attribute is available to be sent by the server to the client
+ in an Access-Accept or Access-Challenge.
+
+ A summary of the Session-Timeout Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 27 for Session-Timeout.
+
+ Length
+
+ 6
+
+
+
+
+
+Rigney, et al. Standards Track [Page 48]
+
+RFC 2865 RADIUS June 2000
+
+
+ Value
+
+ The field is 4 octets, containing a 32-bit unsigned integer with
+ the maximum number of seconds this user should be allowed to
+ remain connected by the NAS.
+
+5.28. Idle-Timeout
+
+ Description
+
+ This Attribute sets the maximum number of consecutive seconds of
+ idle connection allowed to the user before termination of the
+ session or prompt. This Attribute is available to be sent by the
+ server to the client in an Access-Accept or Access-Challenge.
+
+ A summary of the Idle-Timeout Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 28 for Idle-Timeout.
+
+ Length
+
+ 6
+
+ Value
+
+ The field is 4 octets, containing a 32-bit unsigned integer with
+ the maximum number of consecutive seconds of idle time this user
+ should be permitted before being disconnected by the NAS.
+
+5.29. Termination-Action
+
+ Description
+
+ This Attribute indicates what action the NAS should take when the
+ specified service is completed. It is only used in Access-Accept
+ packets.
+
+
+
+
+Rigney, et al. Standards Track [Page 49]
+
+RFC 2865 RADIUS June 2000
+
+
+ A summary of the Termination-Action Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 29 for Termination-Action.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 0 Default
+ 1 RADIUS-Request
+
+ If the Value is set to RADIUS-Request, upon termination of the
+ specified service the NAS MAY send a new Access-Request to the
+ RADIUS server, including the State attribute if any.
+
+5.30. Called-Station-Id
+
+ Description
+
+ This Attribute allows the NAS to send in the Access-Request packet
+ the phone number that the user called, using Dialed Number
+ Identification (DNIS) or similar technology. Note that this may
+ be different from the phone number the call comes in on. It is
+ only used in Access-Request packets.
+
+ A summary of the Called-Station-Id Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+
+Rigney, et al. Standards Track [Page 50]
+
+RFC 2865 RADIUS June 2000
+
+
+ Type
+
+ 30 for Called-Station-Id.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, containing the phone
+ number that the user's call came in on.
+
+ The actual format of the information is site or application
+ specific. UTF-8 encoded 10646 [7] characters are recommended, but
+ a robust implementation SHOULD support the field as
+ undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.31. Calling-Station-Id
+
+ Description
+
+ This Attribute allows the NAS to send in the Access-Request packet
+ the phone number that the call came from, using Automatic Number
+ Identification (ANI) or similar technology. It is only used in
+ Access-Request packets.
+
+ A summary of the Calling-Station-Id Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 31 for Calling-Station-Id.
+
+ Length
+
+ >= 3
+
+
+
+
+
+Rigney, et al. Standards Track [Page 51]
+
+RFC 2865 RADIUS June 2000
+
+
+ String
+
+ The String field is one or more octets, containing the phone
+ number that the user placed the call from.
+
+ The actual format of the information is site or application
+ specific. UTF-8 encoded 10646 [7] characters are recommended, but
+ a robust implementation SHOULD support the field as
+ undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.32. NAS-Identifier
+
+ Description
+
+ This Attribute contains a string identifying the NAS originating
+ the Access-Request. It is only used in Access-Request packets.
+ Either NAS-IP-Address or NAS-Identifier MUST be present in an
+ Access-Request packet.
+
+ Note that NAS-Identifier MUST NOT be used to select the shared
+ secret used to authenticate the request. The source IP address of
+ the Access-Request packet MUST be used to select the shared
+ secret.
+
+ A summary of the NAS-Identifier Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 32 for NAS-Identifier.
+
+ Length
+
+ >= 3
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 52]
+
+RFC 2865 RADIUS June 2000
+
+
+ String
+
+ The String field is one or more octets, and should be unique to
+ the NAS within the scope of the RADIUS server. For example, a
+ fully qualified domain name would be suitable as a NAS-Identifier.
+
+ The actual format of the information is site or application
+ specific, and a robust implementation SHOULD support the field as
+ undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.33. Proxy-State
+
+ Description
+
+ This Attribute is available to be sent by a proxy server to
+ another server when forwarding an Access-Request and MUST be
+ returned unmodified in the Access-Accept, Access-Reject or
+ Access-Challenge. When the proxy server receives the response to
+ its request, it MUST remove its own Proxy-State (the last Proxy-
+ State in the packet) before forwarding the response to the NAS.
+
+ If a Proxy-State Attribute is added to a packet when forwarding
+ the packet, the Proxy-State Attribute MUST be added after any
+ existing Proxy-State attributes.
+
+ The content of any Proxy-State other than the one added by the
+ current server should be treated as opaque octets and MUST NOT
+ affect operation of the protocol.
+
+ Usage of the Proxy-State Attribute is implementation dependent. A
+ description of its function is outside the scope of this
+ specification.
+
+ A summary of the Proxy-State Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 33 for Proxy-State.
+
+
+
+Rigney, et al. Standards Track [Page 53]
+
+RFC 2865 RADIUS June 2000
+
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.34. Login-LAT-Service
+
+ Description
+
+ This Attribute indicates the system with which the user is to be
+ connected by LAT. It MAY be used in Access-Accept packets, but
+ only when LAT is specified as the Login-Service. It MAY be used
+ in an Access-Request packet as a hint to the server, but the
+ server is not required to honor the hint.
+
+ Administrators use the service attribute when dealing with
+ clustered systems, such as a VAX or Alpha cluster. In such an
+ environment several different time sharing hosts share the same
+ resources (disks, printers, etc.), and administrators often
+ configure each to offer access (service) to each of the shared
+ resources. In this case, each host in the cluster advertises its
+ services through LAT broadcasts.
+
+ Sophisticated users often know which service providers (machines)
+ are faster and tend to use a node name when initiating a LAT
+ connection. Alternately, some administrators want particular
+ users to use certain machines as a primitive form of load
+ balancing (although LAT knows how to do load balancing itself).
+
+ A summary of the Login-LAT-Service Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 54]
+
+RFC 2865 RADIUS June 2000
+
+
+ Type
+
+ 34 for Login-LAT-Service.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets, and contains the identity
+ of the LAT service to use. The LAT Architecture allows this
+ string to contain $ (dollar), - (hyphen), . (period), _
+ (underscore), numerics, upper and lower case alphabetics, and the
+ ISO Latin-1 character set extension [11]. All LAT string
+ comparisons are case insensitive.
+
+5.35. Login-LAT-Node
+
+ Description
+
+ This Attribute indicates the Node with which the user is to be
+ automatically connected by LAT. It MAY be used in Access-Accept
+ packets, but only when LAT is specified as the Login-Service. It
+ MAY be used in an Access-Request packet as a hint to the server,
+ but the server is not required to honor the hint.
+
+ A summary of the Login-LAT-Node Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 35 for Login-LAT-Node.
+
+ Length
+
+ >= 3
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 55]
+
+RFC 2865 RADIUS June 2000
+
+
+ String
+
+ The String field is one or more octets, and contains the identity
+ of the LAT Node to connect the user to. The LAT Architecture
+ allows this string to contain $ (dollar), - (hyphen), . (period),
+ _ (underscore), numerics, upper and lower case alphabetics, and
+ the ISO Latin-1 character set extension. All LAT string
+ comparisons are case insensitive.
+
+5.36. Login-LAT-Group
+
+ Description
+
+ This Attribute contains a string identifying the LAT group codes
+ which this user is authorized to use. It MAY be used in Access-
+ Accept packets, but only when LAT is specified as the Login-
+ Service. It MAY be used in an Access-Request packet as a hint to
+ the server, but the server is not required to honor the hint.
+
+ LAT supports 256 different group codes, which LAT uses as a form
+ of access rights. LAT encodes the group codes as a 256 bit
+ bitmap.
+
+ Administrators can assign one or more of the group code bits at
+ the LAT service provider; it will only accept LAT connections that
+ have these group codes set in the bit map. The administrators
+ assign a bitmap of authorized group codes to each user; LAT gets
+ these from the operating system, and uses these in its requests to
+ the service providers.
+
+ A summary of the Login-LAT-Group Attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 36 for Login-LAT-Group.
+
+ Length
+
+ 34
+
+
+
+
+
+Rigney, et al. Standards Track [Page 56]
+
+RFC 2865 RADIUS June 2000
+
+
+ String
+
+ The String field is a 32 octet bit map, most significant octet
+ first. A robust implementation SHOULD support the field as
+ undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.37. Framed-AppleTalk-Link
+
+ Description
+
+ This Attribute indicates the AppleTalk network number which should
+ be used for the serial link to the user, which is another
+ AppleTalk router. It is only used in Access-Accept packets. It
+ is never used when the user is not another router.
+
+ A summary of the Framed-AppleTalk-Link Attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 37 for Framed-AppleTalk-Link.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. Despite the size of the field,
+ values range from 0 to 65535. The special value of 0 indicates
+ that this is an unnumbered serial link. A value of 1-65535 means
+ that the serial line between the NAS and the user should be
+ assigned that value as an AppleTalk network number.
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 57]
+
+RFC 2865 RADIUS June 2000
+
+
+5.38. Framed-AppleTalk-Network
+
+ Description
+
+ This Attribute indicates the AppleTalk Network number which the
+ NAS should probe to allocate an AppleTalk node for the user. It
+ is only used in Access-Accept packets. It is never used when the
+ user is another router. Multiple instances of this Attribute
+ indicate that the NAS may probe using any of the network numbers
+ specified.
+
+ A summary of the Framed-AppleTalk-Network Attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 38 for Framed-AppleTalk-Network.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. Despite the size of the field,
+ values range from 0 to 65535. The special value 0 indicates that
+ the NAS should assign a network for the user, using its default
+ cable range. A value between 1 and 65535 (inclusive) indicates
+ the AppleTalk Network the NAS should probe to find an address for
+ the user.
+
+5.39. Framed-AppleTalk-Zone
+
+ Description
+
+ This Attribute indicates the AppleTalk Default Zone to be used for
+ this user. It is only used in Access-Accept packets. Multiple
+ instances of this attribute in the same packet are not allowed.
+
+
+
+
+
+Rigney, et al. Standards Track [Page 58]
+
+RFC 2865 RADIUS June 2000
+
+
+ A summary of the Framed-AppleTalk-Zone Attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 39 for Framed-AppleTalk-Zone.
+
+ Length
+
+ >= 3
+
+ String
+
+ The name of the Default AppleTalk Zone to be used for this user.
+ A robust implementation SHOULD support the field as
+ undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+5.40. CHAP-Challenge
+
+ Description
+
+ This Attribute contains the CHAP Challenge sent by the NAS to a
+ PPP Challenge-Handshake Authentication Protocol (CHAP) user. It
+ is only used in Access-Request packets.
+
+ If the CHAP challenge value is 16 octets long it MAY be placed in
+ the Request Authenticator field instead of using this attribute.
+
+ A summary of the CHAP-Challenge Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 59]
+
+RFC 2865 RADIUS June 2000
+
+
+ Type
+
+ 60 for CHAP-Challenge.
+
+ Length
+
+ >= 7
+
+ String
+
+ The String field contains the CHAP Challenge.
+
+5.41. NAS-Port-Type
+
+ Description
+
+ This Attribute indicates the type of the physical port of the NAS
+ which is authenticating the user. It can be used instead of or in
+ addition to the NAS-Port (5) attribute. It is only used in
+ Access-Request packets. Either NAS-Port (5) or NAS-Port-Type or
+ both SHOULD be present in an Access-Request packet, if the NAS
+ differentiates among its ports.
+
+ A summary of the NAS-Port-Type Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 61 for NAS-Port-Type.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets. "Virtual" refers to a connection
+ to the NAS via some transport protocol, instead of through a
+ physical port. For example, if a user telnetted into a NAS to
+
+
+
+
+Rigney, et al. Standards Track [Page 60]
+
+RFC 2865 RADIUS June 2000
+
+
+ authenticate himself as an Outbound-User, the Access-Request might
+ include NAS-Port-Type = Virtual as a hint to the RADIUS server
+ that the user was not on a physical port.
+
+ 0 Async
+ 1 Sync
+ 2 ISDN Sync
+ 3 ISDN Async V.120
+ 4 ISDN Async V.110
+ 5 Virtual
+ 6 PIAFS
+ 7 HDLC Clear Channel
+ 8 X.25
+ 9 X.75
+ 10 G.3 Fax
+ 11 SDSL - Symmetric DSL
+ 12 ADSL-CAP - Asymmetric DSL, Carrierless Amplitude Phase
+ Modulation
+ 13 ADSL-DMT - Asymmetric DSL, Discrete Multi-Tone
+ 14 IDSL - ISDN Digital Subscriber Line
+ 15 Ethernet
+ 16 xDSL - Digital Subscriber Line of unknown type
+ 17 Cable
+ 18 Wireless - Other
+ 19 Wireless - IEEE 802.11
+
+ PIAFS is a form of wireless ISDN commonly used in Japan, and
+ stands for PHS (Personal Handyphone System) Internet Access Forum
+ Standard (PIAFS).
+
+5.42. Port-Limit
+
+ Description
+
+ This Attribute sets the maximum number of ports to be provided to
+ the user by the NAS. This Attribute MAY be sent by the server to
+ the client in an Access-Accept packet. It is intended for use in
+ conjunction with Multilink PPP [12] or similar uses. It MAY also
+ be sent by the NAS to the server as a hint that that many ports
+ are desired for use, but the server is not required to honor the
+ hint.
+
+ A summary of the Port-Limit Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 61]
+
+RFC 2865 RADIUS June 2000
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 62 for Port-Limit.
+
+ Length
+
+ 6
+
+ Value
+
+ The field is 4 octets, containing a 32-bit unsigned integer with
+ the maximum number of ports this user should be allowed to connect
+ to on the NAS.
+
+5.43. Login-LAT-Port
+
+ Description
+
+ This Attribute indicates the Port with which the user is to be
+ connected by LAT. It MAY be used in Access-Accept packets, but
+ only when LAT is specified as the Login-Service. It MAY be used
+ in an Access-Request packet as a hint to the server, but the
+ server is not required to honor the hint.
+
+ A summary of the Login-LAT-Port Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Type
+
+ 63 for Login-LAT-Port.
+
+ Length
+
+ >= 3
+
+
+
+Rigney, et al. Standards Track [Page 62]
+
+RFC 2865 RADIUS June 2000
+
+
+ String
+
+ The String field is one or more octets, and contains the identity
+ of the LAT port to use. The LAT Architecture allows this string
+ to contain $ (dollar), - (hyphen), . (period), _ (underscore),
+ numerics, upper and lower case alphabetics, and the ISO Latin-1
+ character set extension. All LAT string comparisons are case
+ insensitive.
+
+5.44. Table of Attributes
+
+ The following table provides a guide to which attributes may be found
+ in which kinds of packets, and in what quantity.
+
+ Request Accept Reject Challenge # Attribute
+ 0-1 0-1 0 0 1 User-Name
+ 0-1 0 0 0 2 User-Password [Note 1]
+ 0-1 0 0 0 3 CHAP-Password [Note 1]
+ 0-1 0 0 0 4 NAS-IP-Address [Note 2]
+ 0-1 0 0 0 5 NAS-Port
+ 0-1 0-1 0 0 6 Service-Type
+ 0-1 0-1 0 0 7 Framed-Protocol
+ 0-1 0-1 0 0 8 Framed-IP-Address
+ 0-1 0-1 0 0 9 Framed-IP-Netmask
+ 0 0-1 0 0 10 Framed-Routing
+ 0 0+ 0 0 11 Filter-Id
+ 0-1 0-1 0 0 12 Framed-MTU
+ 0+ 0+ 0 0 13 Framed-Compression
+ 0+ 0+ 0 0 14 Login-IP-Host
+ 0 0-1 0 0 15 Login-Service
+ 0 0-1 0 0 16 Login-TCP-Port
+ 0 0+ 0+ 0+ 18 Reply-Message
+ 0-1 0-1 0 0 19 Callback-Number
+ 0 0-1 0 0 20 Callback-Id
+ 0 0+ 0 0 22 Framed-Route
+ 0 0-1 0 0 23 Framed-IPX-Network
+ 0-1 0-1 0 0-1 24 State [Note 1]
+ 0 0+ 0 0 25 Class
+ 0+ 0+ 0 0+ 26 Vendor-Specific
+ 0 0-1 0 0-1 27 Session-Timeout
+ 0 0-1 0 0-1 28 Idle-Timeout
+ 0 0-1 0 0 29 Termination-Action
+ 0-1 0 0 0 30 Called-Station-Id
+ 0-1 0 0 0 31 Calling-Station-Id
+ 0-1 0 0 0 32 NAS-Identifier [Note 2]
+ 0+ 0+ 0+ 0+ 33 Proxy-State
+ 0-1 0-1 0 0 34 Login-LAT-Service
+ 0-1 0-1 0 0 35 Login-LAT-Node
+
+
+
+Rigney, et al. Standards Track [Page 63]
+
+RFC 2865 RADIUS June 2000
+
+
+ 0-1 0-1 0 0 36 Login-LAT-Group
+ 0 0-1 0 0 37 Framed-AppleTalk-Link
+ 0 0+ 0 0 38 Framed-AppleTalk-Network
+ 0 0-1 0 0 39 Framed-AppleTalk-Zone
+ 0-1 0 0 0 60 CHAP-Challenge
+ 0-1 0 0 0 61 NAS-Port-Type
+ 0-1 0-1 0 0 62 Port-Limit
+ 0-1 0-1 0 0 63 Login-LAT-Port
+ Request Accept Reject Challenge # Attribute
+
+ [Note 1] An Access-Request MUST contain either a User-Password or a
+ CHAP-Password or State. An Access-Request MUST NOT contain both a
+ User-Password and a CHAP-Password. If future extensions allow other
+ kinds of authentication information to be conveyed, the attribute for
+ that can be used in an Access-Request instead of User-Password or
+ CHAP-Password.
+
+ [Note 2] An Access-Request MUST contain either a NAS-IP-Address or a
+ NAS-Identifier (or both).
+
+ The following table defines the meaning of the above table entries.
+
+0 This attribute MUST NOT be present in packet.
+0+ Zero or more instances of this attribute MAY be present in packet.
+0-1 Zero or one instance of this attribute MAY be present in packet.
+1 Exactly one instance of this attribute MUST be present in packet.
+
+6. IANA Considerations
+
+ This section provides guidance to the Internet Assigned Numbers
+ Authority (IANA) regarding registration of values related to the
+ RADIUS protocol, in accordance with BCP 26 [13].
+
+ There are three name spaces in RADIUS that require registration:
+ Packet Type Codes, Attribute Types, and Attribute Values (for certain
+ Attributes).
+
+ RADIUS is not intended as a general-purpose Network Access Server
+ (NAS) management protocol, and allocations should not be made for
+ purposes unrelated to Authentication, Authorization or Accounting.
+
+6.1. Definition of Terms
+
+ The following terms are used here with the meanings defined in
+ BCP 26: "name space", "assigned value", "registration".
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 64]
+
+RFC 2865 RADIUS June 2000
+
+
+ The following policies are used here with the meanings defined in
+ BCP 26: "Private Use", "First Come First Served", "Expert Review",
+ "Specification Required", "IETF Consensus", "Standards Action".
+
+6.2. Recommended Registration Policies
+
+ For registration requests where a Designated Expert should be
+ consulted, the IESG Area Director for Operations should appoint the
+ Designated Expert.
+
+ For registration requests requiring Expert Review, the ietf-radius
+ mailing list should be consulted.
+
+ Packet Type Codes have a range from 1 to 254, of which 1-5,11-13 have
+ been allocated. Because a new Packet Type has considerable impact on
+ interoperability, a new Packet Type Code requires Standards Action,
+ and should be allocated starting at 14.
+
+ Attribute Types have a range from 1 to 255, and are the scarcest
+ resource in RADIUS, thus must be allocated with care. Attributes
+ 1-53,55,60-88,90-91 have been allocated, with 17 and 21 available for
+ re-use. Attributes 17, 21, 54, 56-59, 89, 92-191 may be allocated
+ following Expert Review, with Specification Required. Release of
+ blocks of Attribute Types (more than 3 at a time for a given purpose)
+ should require IETF Consensus. It is recommended that attributes 17
+ and 21 be used only after all others are exhausted.
+
+ Note that RADIUS defines a mechanism for Vendor-Specific extensions
+ (Attribute 26) and the use of that should be encouraged instead of
+ allocation of global attribute types, for functions specific only to
+ one vendor's implementation of RADIUS, where no interoperability is
+ deemed useful.
+
+ As stated in the "Attributes" section above:
+
+ "[Attribute Type] Values 192-223 are reserved for experimental
+ use, values 224-240 are reserved for implementation-specific use,
+ and values 241-255 are reserved and should not be used."
+
+ Therefore Attribute values 192-240 are considered Private Use, and
+ values 241-255 require Standards Action.
+
+ Certain attributes (for example, NAS-Port-Type) in RADIUS define a
+ list of values to correspond with various meanings. There can be 4
+ billion (2^32) values for each attribute. Adding additional values to
+ the list can be done on a First Come, First Served basis by the IANA.
+
+
+
+
+
+Rigney, et al. Standards Track [Page 65]
+
+RFC 2865 RADIUS June 2000
+
+
+7. Examples
+
+ A few examples are presented to illustrate the flow of packets and
+ use of typical attributes. These examples are not intended to be
+ exhaustive, many others are possible. Hexadecimal dumps of the
+ example packets are given in network byte order, using the shared
+ secret "xyzzy5461".
+
+7.1. User Telnet to Specified Host
+
+ The NAS at 192.168.1.16 sends an Access-Request UDP packet to the
+ RADIUS Server for a user named nemo logging in on port 3 with
+ password "arctangent".
+
+ The Request Authenticator is a 16 octet random number generated by
+ the NAS.
+
+ The User-Password is 16 octets of password padded at end with nulls,
+ XORed with MD5(shared secret|Request Authenticator).
+
+ 01 00 00 38 0f 40 3f 94 73 97 80 57 bd 83 d5 cb
+ 98 f4 22 7a 01 06 6e 65 6d 6f 02 12 0d be 70 8d
+ 93 d4 13 ce 31 96 e4 3f 78 2a 0a ee 04 06 c0 a8
+ 01 10 05 06 00 00 00 03
+
+ 1 Code = Access-Request (1)
+ 1 ID = 0
+ 2 Length = 56
+ 16 Request Authenticator
+
+ Attributes:
+ 6 User-Name = "nemo"
+ 18 User-Password
+ 6 NAS-IP-Address = 192.168.1.16
+ 6 NAS-Port = 3
+
+ The RADIUS server authenticates nemo, and sends an Access-Accept UDP
+ packet to the NAS telling it to telnet nemo to host 192.168.1.3.
+
+ The Response Authenticator is a 16-octet MD5 checksum of the code
+ (2), id (0), Length (38), the Request Authenticator from above, the
+ attributes in this reply, and the shared secret.
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 66]
+
+RFC 2865 RADIUS June 2000
+
+
+ 02 00 00 26 86 fe 22 0e 76 24 ba 2a 10 05 f6 bf
+ 9b 55 e0 b2 06 06 00 00 00 01 0f 06 00 00 00 00
+ 0e 06 c0 a8 01 03
+
+ 1 Code = Access-Accept (2)
+ 1 ID = 0 (same as in Access-Request)
+ 2 Length = 38
+ 16 Response Authenticator
+
+ Attributes:
+ 6 Service-Type (6) = Login (1)
+ 6 Login-Service (15) = Telnet (0)
+ 6 Login-IP-Host (14) = 192.168.1.3
+
+7.2. Framed User Authenticating with CHAP
+
+ The NAS at 192.168.1.16 sends an Access-Request UDP packet to the
+ RADIUS Server for a user named flopsy logging in on port 20 with PPP,
+ authenticating using CHAP. The NAS sends along the Service-Type and
+ Framed-Protocol attributes as a hint to the RADIUS server that this
+ user is looking for PPP, although the NAS is not required to do so.
+
+ The Request Authenticator is a 16 octet random number generated by
+ the NAS, and is also used as the CHAP Challenge.
+
+ The CHAP-Password consists of a 1 octet CHAP ID, in this case 22,
+ followed by the 16 octet CHAP response.
+
+ 01 01 00 47 2a ee 86 f0 8d 0d 55 96 9c a5 97 8e
+ 0d 33 67 a2 01 08 66 6c 6f 70 73 79 03 13 16 e9
+ 75 57 c3 16 18 58 95 f2 93 ff 63 44 07 72 75 04
+ 06 c0 a8 01 10 05 06 00 00 00 14 06 06 00 00 00
+ 02 07 06 00 00 00 01
+
+ 1 Code = 1 (Access-Request)
+ 1 ID = 1
+ 2 Length = 71
+ 16 Request Authenticator
+
+ Attributes:
+ 8 User-Name (1) = "flopsy"
+ 19 CHAP-Password (3)
+ 6 NAS-IP-Address (4) = 192.168.1.16
+ 6 NAS-Port (5) = 20
+ 6 Service-Type (6) = Framed (2)
+ 6 Framed-Protocol (7) = PPP (1)
+
+
+
+
+
+Rigney, et al. Standards Track [Page 67]
+
+RFC 2865 RADIUS June 2000
+
+
+ The RADIUS server authenticates flopsy, and sends an Access-Accept
+ UDP packet to the NAS telling it to start PPP service and assign an
+ address for the user out of its dynamic address pool.
+
+ The Response Authenticator is a 16-octet MD5 checksum of the code
+ (2), id (1), Length (56), the Request Authenticator from above, the
+ attributes in this reply, and the shared secret.
+
+ 02 01 00 38 15 ef bc 7d ab 26 cf a3 dc 34 d9 c0
+ 3c 86 01 a4 06 06 00 00 00 02 07 06 00 00 00 01
+ 08 06 ff ff ff fe 0a 06 00 00 00 02 0d 06 00 00
+ 00 01 0c 06 00 00 05 dc
+
+ 1 Code = Access-Accept (2)
+ 1 ID = 1 (same as in Access-Request)
+ 2 Length = 56
+ 16 Response Authenticator
+
+ Attributes:
+ 6 Service-Type (6) = Framed (2)
+ 6 Framed-Protocol (7) = PPP (1)
+ 6 Framed-IP-Address (8) = 255.255.255.254
+ 6 Framed-Routing (10) = None (0)
+ 6 Framed-Compression (13) = VJ TCP/IP Header Compression (1)
+ 6 Framed-MTU (12) = 1500
+
+7.3. User with Challenge-Response card
+
+ The NAS at 192.168.1.16 sends an Access-Request UDP packet to the
+ RADIUS Server for a user named mopsy logging in on port 7. The user
+ enters the dummy password "challenge" in this example. The challenge
+ and response generated by the smart card for this example are
+ "32769430" and "99101462".
+
+ The Request Authenticator is a 16 octet random number generated by
+ the NAS.
+
+ The User-Password is 16 octets of password, in this case "challenge",
+ padded at the end with nulls, XORed with MD5(shared secret|Request
+ Authenticator).
+
+ 01 02 00 39 f3 a4 7a 1f 6a 6d 76 71 0b 94 7a b9
+ 30 41 a0 39 01 07 6d 6f 70 73 79 02 12 33 65 75
+ 73 77 82 89 b5 70 88 5e 15 08 48 25 c5 04 06 c0
+ a8 01 10 05 06 00 00 00 07
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 68]
+
+RFC 2865 RADIUS June 2000
+
+
+ 1 Code = Access-Request (1)
+ 1 ID = 2
+ 2 Length = 57
+ 16 Request Authenticator
+
+ Attributes:
+ 7 User-Name (1) = "mopsy"
+ 18 User-Password (2)
+ 6 NAS-IP-Address (4) = 192.168.1.16
+ 6 NAS-Port (5) = 7
+
+ The RADIUS server decides to challenge mopsy, sending back a
+ challenge string and looking for a response. The RADIUS server
+ therefore and sends an Access-Challenge UDP packet to the NAS.
+
+ The Response Authenticator is a 16-octet MD5 checksum of the code
+ (11), id (2), length (78), the Request Authenticator from above, the
+ attributes in this reply, and the shared secret.
+
+ The Reply-Message is "Challenge 32769430. Enter response at prompt."
+
+ The State is a magic cookie to be returned along with user's
+ response; in this example 8 octets of data (33 32 37 36 39 34 33 30
+ in hex).
+
+ 0b 02 00 4e 36 f3 c8 76 4a e8 c7 11 57 40 3c 0c
+ 71 ff 9c 45 12 30 43 68 61 6c 6c 65 6e 67 65 20
+ 33 32 37 36 39 34 33 30 2e 20 20 45 6e 74 65 72
+ 20 72 65 73 70 6f 6e 73 65 20 61 74 20 70 72 6f
+ 6d 70 74 2e 18 0a 33 32 37 36 39 34 33 30
+
+ 1 Code = Access-Challenge (11)
+ 1 ID = 2 (same as in Access-Request)
+ 2 Length = 78
+ 16 Response Authenticator
+
+ Attributes:
+ 48 Reply-Message (18)
+ 10 State (24)
+
+ The user enters his response, and the NAS send a new Access-Request
+ with that response, and includes the State Attribute.
+
+ The Request Authenticator is a new 16 octet random number.
+
+ The User-Password is 16 octets of the user's response, in this case
+ "99101462", padded at the end with nulls, XORed with MD5(shared
+ secret|Request Authenticator).
+
+
+
+Rigney, et al. Standards Track [Page 69]
+
+RFC 2865 RADIUS June 2000
+
+
+ The state is the magic cookie from the Access-Challenge packet,
+ unchanged.
+
+ 01 03 00 43 b1 22 55 6d 42 8a 13 d0 d6 25 38 07
+ c4 57 ec f0 01 07 6d 6f 70 73 79 02 12 69 2c 1f
+ 20 5f c0 81 b9 19 b9 51 95 f5 61 a5 81 04 06 c0
+ a8 01 10 05 06 00 00 00 07 18 10 33 32 37 36 39
+ 34 33 30
+
+ 1 Code = Access-Request (1)
+ 1 ID = 3 (Note that this changes.)
+ 2 Length = 67
+ 16 Request Authenticator
+
+ Attributes:
+ 7 User-Name = "mopsy"
+ 18 User-Password
+ 6 NAS-IP-Address (4) = 192.168.1.16
+ 6 NAS-Port (5) = 7
+ 10 State (24)
+
+ The Response was incorrect (for the sake of example), so the RADIUS
+ server tells the NAS to reject the login attempt.
+
+ The Response Authenticator is a 16 octet MD5 checksum of the code
+ (3), id (3), length(20), the Request Authenticator from above, the
+ attributes in this reply (in this case, none), and the shared secret.
+
+ 03 03 00 14 a4 2f 4f ca 45 91 6c 4e 09 c8 34 0f
+ 9e 74 6a a0
+
+ 1 Code = Access-Reject (3)
+ 1 ID = 3 (same as in Access-Request)
+ 2 Length = 20
+ 16 Response Authenticator
+
+ Attributes:
+ (none, although a Reply-Message could be sent)
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 70]
+
+RFC 2865 RADIUS June 2000
+
+
+8. Security Considerations
+
+ Security issues are the primary topic of this document.
+
+ In practice, within or associated with each RADIUS server, there is a
+ database which associates "user" names with authentication
+ information ("secrets"). It is not anticipated that a particular
+ named user would be authenticated by multiple methods. This would
+ make the user vulnerable to attacks which negotiate the least secure
+ method from among a set. Instead, for each named user there should
+ be an indication of exactly one method used to authenticate that user
+ name. If a user needs to make use of different authentication
+ methods under different circumstances, then distinct user names
+ SHOULD be employed, each of which identifies exactly one
+ authentication method.
+
+ Passwords and other secrets should be stored at the respective ends
+ such that access to them is as limited as possible. Ideally, the
+ secrets should only be accessible to the process requiring access in
+ order to perform the authentication.
+
+ The secrets should be distributed with a mechanism that limits the
+ number of entities that handle (and thus gain knowledge of) the
+ secret. Ideally, no unauthorized person should ever gain knowledge
+ of the secrets. It is possible to achieve this with SNMP Security
+ Protocols [14], but such a mechanism is outside the scope of this
+ specification.
+
+ Other distribution methods are currently undergoing research and
+ experimentation. The SNMP Security document [14] also has an
+ excellent overview of threats to network protocols.
+
+ The User-Password hiding mechanism described in Section 5.2 has not
+ been subjected to significant amounts of cryptanalysis in the
+ published literature. Some in the IETF community are concerned that
+ this method might not provide sufficient confidentiality protection
+ [15] to passwords transmitted using RADIUS. Users should evaluate
+ their threat environment and consider whether additional security
+ mechanisms should be employed.
+
+9. Change Log
+
+ The following changes have been made from RFC 2138:
+
+ Strings should use UTF-8 instead of US-ASCII and should be handled as
+ 8-bit data.
+
+ Integers and dates are now defined as 32 bit unsigned values.
+
+
+
+Rigney, et al. Standards Track [Page 71]
+
+RFC 2865 RADIUS June 2000
+
+
+ Updated list of attributes that can be included in Access-Challenge
+ to be consistent with the table of attributes.
+
+ User-Name mentions Network Access Identifiers.
+
+ User-Name may now be sent in Access-Accept for use with accounting
+ and Rlogin.
+
+ Values added for Service-Type, Login-Service, Framed-Protocol,
+ Framed-Compression, and NAS-Port-Type.
+
+ NAS-Port can now use all 32 bits.
+
+ Examples now include hexadecimal displays of the packets.
+
+ Source UDP port must be used in conjunction with the Request
+ Identifier when identifying duplicates.
+
+ Multiple subattributes may be allowed in a Vendor-Specific attribute.
+
+ An Access-Request is now required to contain either a NAS-IP-Address
+ or NAS-Identifier (or may contain both).
+
+ Added notes under "Operations" with more information on proxy,
+ retransmissions, and keep-alives.
+
+ If multiple Attributes with the same Type are present, the order of
+ Attributes with the same Type MUST be preserved by any proxies.
+
+ Clarified Proxy-State.
+
+ Clarified that Attributes must not depend on position within the
+ packet, as long as Attributes of the same type are kept in order.
+
+ Added IANA Considerations section.
+
+ Updated section on "Proxy" under "Operations".
+
+ Framed-MTU can now be sent in Access-Request as a hint.
+
+ Updated Security Considerations.
+
+ Text strings identified as a subset of string, to clarify use of
+ UTF-8.
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 72]
+
+RFC 2865 RADIUS June 2000
+
+
+10. References
+
+ [1] Rigney, C., Rubens, A., Simpson, W. and S. Willens, "Remote
+ Authentication Dial In User Service (RADIUS)", RFC 2138, April
+ 1997.
+
+ [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement
+ Levels", BCP 14, RFC 2119, March, 1997.
+
+ [3] Rivest, R. and S. Dusse, "The MD5 Message-Digest Algorithm",
+ RFC 1321, April 1992.
+
+ [4] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August
+ 1980.
+
+ [5] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000.
+
+ [6] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC
+ 1700, October 1994.
+
+ [7] Yergeau, F., "UTF-8, a transformation format of ISO 10646", RFC
+ 2279, January 1998.
+
+ [8] Aboba, B. and M. Beadles, "The Network Access Identifier", RFC
+ 2486, January 1999.
+
+ [9] Kaufman, C., Perlman, R., and Speciner, M., "Network Security:
+ Private Communications in a Public World", Prentice Hall, March
+ 1995, ISBN 0-13-061466-1.
+
+ [10] Jacobson, V., "Compressing TCP/IP headers for low-speed serial
+ links", RFC 1144, February 1990.
+
+ [11] ISO 8859. International Standard -- Information Processing --
+ 8-bit Single-Byte Coded Graphic Character Sets -- Part 1: Latin
+ Alphabet No. 1, ISO 8859-1:1987.
+
+ [12] Sklower, K., Lloyd, B., McGregor, G., Carr, D. and T.
+ Coradetti, "The PPP Multilink Protocol (MP)", RFC 1990, August
+ 1996.
+
+ [13] Alvestrand, H. and T. Narten, "Guidelines for Writing an IANA
+ Considerations Section in RFCs", BCP 26, RFC 2434, October
+ 1998.
+
+ [14] Galvin, J., McCloghrie, K. and J. Davin, "SNMP Security
+ Protocols", RFC 1352, July 1992.
+
+
+
+
+Rigney, et al. Standards Track [Page 73]
+
+RFC 2865 RADIUS June 2000
+
+
+ [15] Dobbertin, H., "The Status of MD5 After a Recent Attack",
+ CryptoBytes Vol.2 No.2, Summer 1996.
+
+11. Acknowledgements
+
+ RADIUS was originally developed by Steve Willens of Livingston
+ Enterprises for their PortMaster series of Network Access Servers.
+
+12. Chair's Address
+
+ The working group can be contacted via the current chair:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ Phone: +1 925 737 2100
+ EMail: cdr@telemancy.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 74]
+
+RFC 2865 RADIUS June 2000
+
+
+13. Authors' Addresses
+
+ Questions about this memo can also be directed to:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ Phone: +1 925 737 2100
+ EMail: cdr@telemancy.com
+
+
+ Allan C. Rubens
+ Merit Network, Inc.
+ 4251 Plymouth Road
+ Ann Arbor, Michigan 48105-2785
+
+ EMail: acr@merit.edu
+
+
+ William Allen Simpson
+ Daydreamer
+ Computer Systems Consulting Services
+ 1384 Fontaine
+ Madison Heights, Michigan 48071
+
+ EMail: wsimpson@greendragon.com
+
+
+ Steve Willens
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ EMail: steve@livingston.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 75]
+
+RFC 2865 RADIUS June 2000
+
+
+14. Full Copyright Statement
+
+ Copyright (C) The Internet Society (2000). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assigns.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+Acknowledgement
+
+ Funding for the RFC Editor function is currently provided by the
+ Internet Society.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Standards Track [Page 76]
+
diff --git a/rfc/rfc2866.txt b/rfc/rfc2866.txt
new file mode 100644
index 0000000..82da1dc
--- /dev/null
+++ b/rfc/rfc2866.txt
@@ -0,0 +1,1571 @@
+
+
+
+
+
+
+Network Working Group C. Rigney
+Request for Comments: 2866 Livingston
+Category: Informational June 2000
+Obsoletes: 2139
+
+
+ RADIUS Accounting
+
+Status of this Memo
+
+ This memo provides information for the Internet community. It does
+ not specify an Internet standard of any kind. Distribution of this
+ memo is unlimited.
+
+Copyright Notice
+
+ Copyright (C) The Internet Society (2000). All Rights Reserved.
+
+Abstract
+
+ This document describes a protocol for carrying accounting
+ information between a Network Access Server and a shared Accounting
+ Server.
+
+Implementation Note
+
+ This memo documents the RADIUS Accounting protocol. The early
+ deployment of RADIUS Accounting was done using UDP port number 1646,
+ which conflicts with the "sa-msg-port" service. The officially
+ assigned port number for RADIUS Accounting is 1813.
+
+Table of Contents
+
+ 1. Introduction .................................... 2
+ 1.1 Specification of Requirements ................. 3
+ 1.2 Terminology ................................... 3
+ 2. Operation ....................................... 4
+ 2.1 Proxy ......................................... 4
+ 3. Packet Format ................................... 5
+ 4. Packet Types ................................... 7
+ 4.1 Accounting-Request ............................ 8
+ 4.2 Accounting-Response ........................... 9
+ 5. Attributes ...................................... 10
+ 5.1 Acct-Status-Type .............................. 12
+ 5.2 Acct-Delay-Time ............................... 13
+ 5.3 Acct-Input-Octets ............................. 14
+ 5.4 Acct-Output-Octets ............................ 15
+ 5.5 Acct-Session-Id ............................... 15
+
+
+
+Rigney Informational [Page 1]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ 5.6 Acct-Authentic ................................ 16
+ 5.7 Acct-Session-Time ............................. 17
+ 5.8 Acct-Input-Packets ............................ 18
+ 5.9 Acct-Output-Packets ........................... 18
+ 5.10 Acct-Terminate-Cause .......................... 19
+ 5.11 Acct-Multi-Session-Id ......................... 21
+ 5.12 Acct-Link-Count ............................... 22
+ 5.13 Table of Attributes ........................... 23
+ 6. IANA Considerations ............................. 25
+ 7. Security Considerations ......................... 25
+ 8. Change Log ...................................... 25
+ 9. References ...................................... 26
+ 10. Acknowledgements ................................ 26
+ 11. Chair's Address ................................. 26
+ 12. Author's Address ................................ 27
+ 13. Full Copyright Statement ........................ 28
+
+1. Introduction
+
+ Managing dispersed serial line and modem pools for large numbers of
+ users can create the need for significant administrative support.
+ Since modem pools are by definition a link to the outside world, they
+ require careful attention to security, authorization and accounting.
+ This can be best achieved by managing a single "database" of users,
+ which allows for authentication (verifying user name and password) as
+ well as configuration information detailing the type of service to
+ deliver to the user (for example, SLIP, PPP, telnet, rlogin).
+
+ The RADIUS (Remote Authentication Dial In User Service) document [2]
+ specifies the RADIUS protocol used for Authentication and
+ Authorization. This memo extends the use of the RADIUS protocol to
+ cover delivery of accounting information from the Network Access
+ Server (NAS) to a RADIUS accounting server.
+
+ This document obsoletes RFC 2139 [1]. A summary of the changes
+ between this document and RFC 2139 is available in the "Change Log"
+ appendix.
+
+ Key features of RADIUS Accounting are:
+
+ Client/Server Model
+
+ A Network Access Server (NAS) operates as a client of the
+ RADIUS accounting server. The client is responsible for
+ passing user accounting information to a designated RADIUS
+ accounting server.
+
+
+
+
+
+Rigney Informational [Page 2]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ The RADIUS accounting server is responsible for receiving the
+ accounting request and returning a response to the client
+ indicating that it has successfully received the request.
+
+ The RADIUS accounting server can act as a proxy client to
+ other kinds of accounting servers.
+
+ Network Security
+
+ Transactions between the client and RADIUS accounting server
+ are authenticated through the use of a shared secret, which is
+ never sent over the network.
+
+ Extensible Protocol
+
+ All transactions are comprised of variable length Attribute-
+ Length-Value 3-tuples. New attribute values can be added
+ without disturbing existing implementations of the protocol.
+
+1.1. Specification of Requirements
+
+ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
+ "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
+ document are to be interpreted as described in RFC 2119 [3]. These
+ key words mean the same thing whether capitalized or not.
+
+1.2. Terminology
+
+ This document uses the following terms:
+
+ service The NAS provides a service to the dial-in user, such as PPP
+ or Telnet.
+
+ session Each service provided by the NAS to a dial-in user
+ constitutes a session, with the beginning of the session
+ defined as the point where service is first provided and
+ the end of the session defined as the point where service
+ is ended. A user may have multiple sessions in parallel or
+ series if the NAS supports that, with each session
+ generating a separate start and stop accounting record with
+ its own Acct-Session-Id.
+
+ silently discard
+ This means the implementation discards the packet without
+ further processing. The implementation SHOULD provide the
+ capability of logging the error, including the contents of
+ the silently discarded packet, and SHOULD record the event
+ in a statistics counter.
+
+
+
+Rigney Informational [Page 3]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+2. Operation
+
+ When a client is configured to use RADIUS Accounting, at the start of
+ service delivery it will generate an Accounting Start packet
+ describing the type of service being delivered and the user it is
+ being delivered to, and will send that to the RADIUS Accounting
+ server, which will send back an acknowledgement that the packet has
+ been received. At the end of service delivery the client will
+ generate an Accounting Stop packet describing the type of service
+ that was delivered and optionally statistics such as elapsed time,
+ input and output octets, or input and output packets. It will send
+ that to the RADIUS Accounting server, which will send back an
+ acknowledgement that the packet has been received.
+
+ The Accounting-Request (whether for Start or Stop) is submitted to
+ the RADIUS accounting server via the network. It is recommended that
+ the client continue attempting to send the Accounting-Request packet
+ until it receives an acknowledgement, using some form of backoff. If
+ no response is returned within a length of time, the request is re-
+ sent a number of times. The client can also forward requests to an
+ alternate server or servers in the event that the primary server is
+ down or unreachable. An alternate server can be used either after a
+ number of tries to the primary server fail, or in a round-robin
+ fashion. Retry and fallback algorithms are the topic of current
+ research and are not specified in detail in this document.
+
+ The RADIUS accounting server MAY make requests of other servers in
+ order to satisfy the request, in which case it acts as a client.
+
+ If the RADIUS accounting server is unable to successfully record the
+ accounting packet it MUST NOT send an Accounting-Response
+ acknowledgment to the client.
+
+2.1. Proxy
+
+ See the "RADIUS" RFC [2] for information on Proxy RADIUS. Proxy
+ Accounting RADIUS works the same way, as illustrated by the following
+ example.
+
+ 1. The NAS sends an accounting-request to the forwarding server.
+
+ 2. The forwarding server logs the accounting-request (if desired),
+ adds its Proxy-State (if desired) after any other Proxy-State
+ attributes, updates the Request Authenticator, and forwards the
+ request to the remote server.
+
+
+
+
+
+
+Rigney Informational [Page 4]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ 3. The remote server logs the accounting-request (if desired),
+ copies all Proxy-State attributes in order and unmodified from
+ the request to the response packet, and sends the accounting-
+ response to the forwarding server.
+
+ 4. The forwarding server strips the last Proxy-State (if it added
+ one in step 2), updates the Response Authenticator and sends
+ the accounting-response to the NAS.
+
+ A forwarding server MUST not modify existing Proxy-State or Class
+ attributes present in the packet.
+
+ A forwarding server may either perform its forwarding function in a
+ pass through manner, where it sends retransmissions on as soon as it
+ gets them, or it may take responsibility for retransmissions, for
+ example in cases where the network link between forwarding and remote
+ server has very different characteristics than the link between NAS
+ and forwarding server.
+
+ Extreme care should be used when implementing a proxy server that
+ takes responsibility for retransmissions so that its retransmission
+ policy is robust and scalable.
+
+3. Packet Format
+
+ Exactly one RADIUS Accounting packet is encapsulated in the UDP Data
+ field [4], where the UDP Destination Port field indicates 1813
+ (decimal).
+
+ When a reply is generated, the source and destination ports are
+ reversed.
+
+ This memo documents the RADIUS Accounting protocol. The early
+ deployment of RADIUS Accounting was done using UDP port number 1646,
+ which conflicts with the "sa-msg-port" service. The officially
+ assigned port number for RADIUS Accounting is 1813.
+
+ A summary of the RADIUS data format is shown below. The fields are
+ transmitted from left to right.
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 5]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+ Code
+
+ The Code field is one octet, and identifies the type of RADIUS
+ packet. When a packet is received with an invalid Code field, it
+ is silently discarded.
+
+ RADIUS Accounting Codes (decimal) are assigned as follows:
+
+ 4 Accounting-Request
+ 5 Accounting-Response
+
+ Identifier
+
+ The Identifier field is one octet, and aids in matching requests
+ and replies. The RADIUS server can detect a duplicate request if
+ it has the same client source IP address and source UDP port and
+ Identifier within a short span of time.
+
+ Length
+
+ The Length field is two octets. It indicates the length of the
+ packet including the Code, Identifier, Length, Authenticator and
+ Attribute fields. Octets outside the range of the Length field
+ MUST be treated as padding and ignored on reception. If the
+ packet is shorter than the Length field indicates, it MUST be
+ silently discarded. The minimum length is 20 and maximum length
+ is 4095.
+
+ Authenticator
+
+ The Authenticator field is sixteen (16) octets. The most
+ significant octet is transmitted first. This value is used to
+ authenticate the messages between the client and RADIUS accounting
+ server.
+
+
+
+Rigney Informational [Page 6]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ Request Authenticator
+
+ In Accounting-Request Packets, the Authenticator value is a 16
+ octet MD5 [5] checksum, called the Request Authenticator.
+
+ The NAS and RADIUS accounting server share a secret. The Request
+ Authenticator field in Accounting-Request packets contains a one-
+ way MD5 hash calculated over a stream of octets consisting of the
+ Code + Identifier + Length + 16 zero octets + request attributes +
+ shared secret (where + indicates concatenation). The 16 octet MD5
+ hash value is stored in the Authenticator field of the
+ Accounting-Request packet.
+
+ Note that the Request Authenticator of an Accounting-Request can
+ not be done the same way as the Request Authenticator of a RADIUS
+ Access-Request, because there is no User-Password attribute in an
+ Accounting-Request.
+
+ Response Authenticator
+
+ The Authenticator field in an Accounting-Response packet is called
+ the Response Authenticator, and contains a one-way MD5 hash
+ calculated over a stream of octets consisting of the Accounting-
+ Response Code, Identifier, Length, the Request Authenticator field
+ from the Accounting-Request packet being replied to, and the
+ response attributes if any, followed by the shared secret. The
+ resulting 16 octet MD5 hash value is stored in the Authenticator
+ field of the Accounting-Response packet.
+
+ Attributes
+
+ Attributes may have multiple instances, in such a case the order
+ of attributes of the same type SHOULD be preserved. The order of
+ attributes of different types is not required to be preserved.
+
+4. Packet Types
+
+ The RADIUS packet type is determined by the Code field in the first
+ octet of the packet.
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 7]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+4.1. Accounting-Request
+
+ Description
+
+ Accounting-Request packets are sent from a client (typically a
+ Network Access Server or its proxy) to a RADIUS accounting server,
+ and convey information used to provide accounting for a service
+ provided to a user. The client transmits a RADIUS packet with the
+ Code field set to 4 (Accounting-Request).
+
+ Upon receipt of an Accounting-Request, the server MUST transmit an
+ Accounting-Response reply if it successfully records the
+ accounting packet, and MUST NOT transmit any reply if it fails to
+ record the accounting packet.
+
+ Any attribute valid in a RADIUS Access-Request or Access-Accept
+ packet is valid in a RADIUS Accounting-Request packet, except that
+ the following attributes MUST NOT be present in an Accounting-
+ Request: User-Password, CHAP-Password, Reply-Message, State.
+ Either NAS-IP-Address or NAS-Identifier MUST be present in a
+ RADIUS Accounting-Request. It SHOULD contain a NAS-Port or NAS-
+ Port-Type attribute or both unless the service does not involve a
+ port or the NAS does not distinguish among its ports.
+
+ If the Accounting-Request packet includes a Framed-IP-Address,
+ that attribute MUST contain the IP address of the user. If the
+ Access-Accept used the special values for Framed-IP-Address
+ telling the NAS to assign or negotiate an IP address for the user,
+ the Framed-IP-Address (if any) in the Accounting-Request MUST
+ contain the actual IP address assigned or negotiated.
+
+ A summary of the Accounting-Request packet format is shown below.
+
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Request Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+
+
+
+Rigney Informational [Page 8]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ Code
+
+ 4 for Accounting-Request.
+
+ Identifier
+
+ The Identifier field MUST be changed whenever the content of the
+ Attributes field changes, and whenever a valid reply has been
+ received for a previous request. For retransmissions where the
+ contents are identical, the Identifier MUST remain unchanged.
+
+ Note that if Acct-Delay-Time is included in the attributes of an
+ Accounting-Request then the Acct-Delay-Time value will be updated
+ when the packet is retransmitted, changing the content of the
+ Attributes field and requiring a new Identifier and Request
+ Authenticator.
+
+ Request Authenticator
+
+ The Request Authenticator of an Accounting-Request contains a 16-octet
+ MD5 hash value calculated according to the method described in
+ "Request Authenticator" above.
+
+ Attributes
+
+ The Attributes field is variable in length, and contains a list of
+ Attributes.
+
+4.2. Accounting-Response
+
+ Description
+
+ Accounting-Response packets are sent by the RADIUS accounting
+ server to the client to acknowledge that the Accounting-Request
+ has been received and recorded successfully. If the Accounting-
+ Request was recorded successfully then the RADIUS accounting
+ server MUST transmit a packet with the Code field set to 5
+ (Accounting-Response). On reception of an Accounting-Response by
+ the client, the Identifier field is matched with a pending
+ Accounting-Request. The Response Authenticator field MUST contain
+ the correct response for the pending Accounting-Request. Invalid
+ packets are silently discarded.
+
+ A RADIUS Accounting-Response is not required to have any
+ attributes in it.
+
+ A summary of the Accounting-Response packet format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+Rigney Informational [Page 9]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Response Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ 5 for Accounting-Response.
+
+ Identifier
+
+ The Identifier field is a copy of the Identifier field of the
+ Accounting-Request which caused this Accounting-Response.
+
+ Response Authenticator
+
+ The Response Authenticator of an Accounting-Response contains a
+ 16-octet MD5 hash value calculated according to the method
+ described in "Response Authenticator" above.
+
+ Attributes
+
+ The Attributes field is variable in length, and contains a list of
+ zero or more Attributes.
+
+5. Attributes
+
+ RADIUS Attributes carry the specific authentication, authorization
+ and accounting details for the request and response.
+
+ Some attributes MAY be included more than once. The effect of this
+ is attribute specific, and is specified in each attribute
+ description.
+
+ The end of the list of attributes is indicated by the Length of the
+ RADIUS packet.
+
+ A summary of the attribute format is shown below. The fields are
+ transmitted from left to right.
+
+
+
+
+Rigney Informational [Page 10]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Type
+
+ The Type field is one octet. Up-to-date values of the RADIUS Type
+ field are specified in the most recent "Assigned Numbers" RFC [6].
+ Values 192-223 are reserved for experimental use, values 224-240
+ are reserved for implementation-specific use, and values 241-255
+ are reserved and should not be used. This specification concerns
+ the following values:
+
+ 1-39 (refer to RADIUS document [2])
+ 40 Acct-Status-Type
+ 41 Acct-Delay-Time
+ 42 Acct-Input-Octets
+ 43 Acct-Output-Octets
+ 44 Acct-Session-Id
+ 45 Acct-Authentic
+ 46 Acct-Session-Time
+ 47 Acct-Input-Packets
+ 48 Acct-Output-Packets
+ 49 Acct-Terminate-Cause
+ 50 Acct-Multi-Session-Id
+ 51 Acct-Link-Count
+ 60+ (refer to RADIUS document [2])
+
+ Length
+
+ The Length field is one octet, and indicates the length of this
+ attribute including the Type, Length and Value fields. If an
+ attribute is received in an Accounting-Request with an invalid
+ Length, the entire request MUST be silently discarded.
+
+ Value
+
+ The Value field is zero or more octets and contains information
+ specific to the attribute. The format and length of the Value
+ field is determined by the Type and Length fields.
+
+ Note that none of the types in RADIUS terminate with a NUL (hex
+ 00). In particular, types "text" and "string" in RADIUS do not
+ terminate with a NUL (hex 00). The Attribute has a length field
+ and does not use a terminator. Text contains UTF-8 encoded 10646
+
+
+
+Rigney Informational [Page 11]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ [7] characters and String contains 8-bit binary data. Servers and
+ servers and clients MUST be able to deal with embedded nulls.
+ RADIUS implementers using C are cautioned not to use strcpy() when
+ handling strings.
+
+ The format of the value field is one of five data types. Note
+ that type "text" is a subset of type "string."
+
+ text 1-253 octets containing UTF-8 encoded 10646 [7]
+ characters. Text of length zero (0) MUST NOT be sent;
+ omit the entire attribute instead.
+
+ string 1-253 octets containing binary data (values 0 through 255
+ decimal, inclusive). Strings of length zero (0) MUST NOT
+ be sent; omit the entire attribute instead.
+
+ address 32 bit value, most significant octet first.
+
+ integer 32 bit unsigned value, most significant octet first.
+
+ time 32 bit unsigned value, most significant octet first --
+ seconds since 00:00:00 UTC, January 1, 1970. The
+ standard Attributes do not use this data type but it is
+ presented here for possible use in future attributes.
+
+5.1. Acct-Status-Type
+
+ Description
+
+ This attribute indicates whether this Accounting-Request marks the
+ beginning of the user service (Start) or the end (Stop).
+
+ It MAY be used by the client to mark the start of accounting (for
+ example, upon booting) by specifying Accounting-On and to mark the
+ end of accounting (for example, just before a scheduled reboot) by
+ specifying Accounting-Off.
+
+ A summary of the Acct-Status-Type attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+Rigney Informational [Page 12]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ Type
+
+ 40 for Acct-Status-Type.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 1 Start
+ 2 Stop
+ 3 Interim-Update
+ 7 Accounting-On
+ 8 Accounting-Off
+ 9-14 Reserved for Tunnel Accounting
+ 15 Reserved for Failed
+
+5.2. Acct-Delay-Time
+
+ Description
+
+ This attribute indicates how many seconds the client has been
+ trying to send this record for, and can be subtracted from the
+ time of arrival on the server to find the approximate time of the
+ event generating this Accounting-Request. (Network transit time
+ is ignored.)
+
+ Note that changing the Acct-Delay-Time causes the Identifier to
+ change; see the discussion under Identifier above.
+
+ A summary of the Acct-Delay-Time attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 13]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ Type
+
+ 41 for Acct-Delay-Time.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.3. Acct-Input-Octets
+
+ Description
+
+ This attribute indicates how many octets have been received from
+ the port over the course of this service being provided, and can
+ only be present in Accounting-Request records where the Acct-
+ Status-Type is set to Stop.
+
+ A summary of the Acct-Input-Octets attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 42 for Acct-Input-Octets.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+
+
+
+
+
+
+
+Rigney Informational [Page 14]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+5.4. Acct-Output-Octets
+
+ Description
+
+ This attribute indicates how many octets have been sent to the
+ port in the course of delivering this service, and can only be
+ present in Accounting-Request records where the Acct-Status-Type
+ is set to Stop.
+
+ A summary of the Acct-Output-Octets attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 43 for Acct-Output-Octets.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.5. Acct-Session-Id
+
+ Description
+
+ This attribute is a unique Accounting ID to make it easy to match
+ start and stop records in a log file. The start and stop records
+ for a given session MUST have the same Acct-Session-Id. An
+ Accounting-Request packet MUST have an Acct-Session-Id. An
+ Access-Request packet MAY have an Acct-Session-Id; if it does,
+ then the NAS MUST use the same Acct-Session-Id in the Accounting-
+ Request packets for that session.
+
+ The Acct-Session-Id SHOULD contain UTF-8 encoded 10646 [7]
+ characters.
+
+
+
+
+
+Rigney Informational [Page 15]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ For example, one implementation uses a string with an 8-digit
+ upper case hexadecimal number, the first two digits increment on
+ each reboot (wrapping every 256 reboots) and the next 6 digits
+ counting from 0 for the first person logging in after a reboot up
+ to 2^24-1, about 16 million. Other encodings are possible.
+
+ A summary of the Acct-Session-Id attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Text ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 44 for Acct-Session-Id.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field SHOULD be a string of UTF-8 encoded 10646 [7]
+ characters.
+
+5.6. Acct-Authentic
+
+ Description
+
+ This attribute MAY be included in an Accounting-Request to
+ indicate how the user was authenticated, whether by RADIUS, the
+ NAS itself, or another remote authentication protocol. Users who
+ are delivered service without being authenticated SHOULD NOT
+ generate Accounting records.
+
+ A summary of the Acct-Authentic attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+Rigney Informational [Page 16]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ Type
+
+ 45 for Acct-Authentic.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 1 RADIUS
+ 2 Local
+ 3 Remote
+
+5.7. Acct-Session-Time
+
+ Description
+
+ This attribute indicates how many seconds the user has received
+ service for, and can only be present in Accounting-Request records
+ where the Acct-Status-Type is set to Stop.
+
+ A summary of the Acct-Session-Time attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 46 for Acct-Session-Time.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+
+
+
+
+Rigney Informational [Page 17]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+5.8. Acct-Input-Packets
+
+ Description
+
+ This attribute indicates how many packets have been received from
+ the port over the course of this service being provided to a
+ Framed User, and can only be present in Accounting-Request records
+ where the Acct-Status-Type is set to Stop.
+
+ A summary of the Acct-Input-packets attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 47 for Acct-Input-Packets.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.9. Acct-Output-Packets
+
+ Description
+
+ This attribute indicates how many packets have been sent to the
+ port in the course of delivering this service to a Framed User,
+ and can only be present in Accounting-Request records where the
+ Acct-Status-Type is set to Stop.
+
+ A summary of the Acct-Output-Packets attribute format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+Rigney Informational [Page 18]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 48 for Acct-Output-Packets.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.10. Acct-Terminate-Cause
+
+ Description
+
+ This attribute indicates how the session was terminated, and can
+ only be present in Accounting-Request records where the Acct-
+ Status-Type is set to Stop.
+
+ A summary of the Acct-Terminate-Cause attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 19]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ Type
+
+ 49 for Acct-Terminate-Cause
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets, containing an integer specifying
+ the cause of session termination, as follows:
+
+ 1 User Request
+ 2 Lost Carrier
+ 3 Lost Service
+ 4 Idle Timeout
+ 5 Session Timeout
+ 6 Admin Reset
+ 7 Admin Reboot
+ 8 Port Error
+ 9 NAS Error
+ 10 NAS Request
+ 11 NAS Reboot
+ 12 Port Unneeded
+ 13 Port Preempted
+ 14 Port Suspended
+ 15 Service Unavailable
+ 16 Callback
+ 17 User Error
+ 18 Host Request
+
+ The termination causes are as follows:
+
+ User Request User requested termination of service, for
+ example with LCP Terminate or by logging out.
+
+ Lost Carrier DCD was dropped on the port.
+
+ Lost Service Service can no longer be provided; for
+ example, user's connection to a host was
+ interrupted.
+
+ Idle Timeout Idle timer expired.
+
+ Session Timeout Maximum session length timer expired.
+
+ Admin Reset Administrator reset the port or session.
+
+
+
+Rigney Informational [Page 20]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ Admin Reboot Administrator is ending service on the NAS,
+ for example prior to rebooting the NAS.
+
+ Port Error NAS detected an error on the port which
+ required ending the session.
+
+ NAS Error NAS detected some error (other than on the
+ port) which required ending the session.
+
+ NAS Request NAS ended session for a non-error reason not
+ otherwise listed here.
+
+ NAS Reboot The NAS ended the session in order to reboot
+ non-administratively ("crash").
+
+ Port Unneeded NAS ended session because resource usage fell
+ below low-water mark (for example, if a
+ bandwidth-on-demand algorithm decided that
+ the port was no longer needed).
+
+ Port Preempted NAS ended session in order to allocate the
+ port to a higher priority use.
+
+ Port Suspended NAS ended session to suspend a virtual
+ session.
+
+ Service Unavailable NAS was unable to provide requested service.
+
+ Callback NAS is terminating current session in order
+ to perform callback for a new session.
+
+ User Error Input from user is in error, causing
+ termination of session.
+
+ Host Request Login Host terminated session normally.
+
+5.11. Acct-Multi-Session-Id
+
+ Description
+
+ This attribute is a unique Accounting ID to make it easy to link
+ together multiple related sessions in a log file. Each session
+ linked together would have a unique Acct-Session-Id but the same
+ Acct-Multi-Session-Id. It is strongly recommended that the Acct-
+ Multi-Session-Id contain UTF-8 encoded 10646 [7] characters.
+
+ A summary of the Acct-Session-Id attribute format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+Rigney Informational [Page 21]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 50 for Acct-Multi-Session-Id.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field SHOULD contain UTF-8 encoded 10646 [7] characters.
+
+5.12. Acct-Link-Count
+
+ Description
+
+ This attribute gives the count of links which are known to have been
+ in a given multilink session at the time the accounting record is
+ generated. The NAS MAY include the Acct-Link-Count attribute in any
+ Accounting-Request which might have multiple links.
+
+ A summary of the Acct-Link-Count attribute format is show below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 22]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ Type
+
+ 51 for Acct-Link-Count.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets, and contains the number of links
+ seen so far in this Multilink Session.
+
+ It may be used to make it easier for an accounting server to know
+ when it has all the records for a given Multilink session. When
+ the number of Accounting-Requests received with Acct-Status-Type =
+ Stop and the same Acct-Multi-Session-Id and unique Acct-Session-
+ Id's equals the largest value of Acct-Link-Count seen in those
+ Accounting-Requests, all Stop Accounting-Requests for that
+ Multilink Session have been received.
+
+ An example showing 8 Accounting-Requests should make things
+ clearer. For clarity only the relevant attributes are shown, but
+ additional attributes containing accounting information will also
+ be present in the Accounting-Request.
+
+ Multi-Session-Id Session-Id Status-Type Link-Count
+ "10" "10" Start 1
+ "10" "11" Start 2
+ "10" "11" Stop 2
+ "10" "12" Start 3
+ "10" "13" Start 4
+ "10" "12" Stop 4
+ "10" "13" Stop 4
+ "10" "10" Stop 4
+
+5.13. Table of Attributes
+
+ The following table provides a guide to which attributes may be found
+ in Accounting-Request packets. No attributes should be found in
+ Accounting-Response packets except Proxy-State and possibly Vendor-
+ Specific.
+
+
+ # Attribute
+ 0-1 User-Name
+ 0 User-Password
+ 0 CHAP-Password
+
+
+
+Rigney Informational [Page 23]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ 0-1 NAS-IP-Address [Note 1]
+ 0-1 NAS-Port
+ 0-1 Service-Type
+ 0-1 Framed-Protocol
+ 0-1 Framed-IP-Address
+ 0-1 Framed-IP-Netmask
+ 0-1 Framed-Routing
+ 0+ Filter-Id
+ 0-1 Framed-MTU
+ 0+ Framed-Compression
+ 0+ Login-IP-Host
+ 0-1 Login-Service
+ 0-1 Login-TCP-Port
+ 0 Reply-Message
+ 0-1 Callback-Number
+ 0-1 Callback-Id
+ 0+ Framed-Route
+ 0-1 Framed-IPX-Network
+ 0 State
+ 0+ Class
+ 0+ Vendor-Specific
+ 0-1 Session-Timeout
+ 0-1 Idle-Timeout
+ 0-1 Termination-Action
+ 0-1 Called-Station-Id
+ 0-1 Calling-Station-Id
+ 0-1 NAS-Identifier [Note 1]
+ 0+ Proxy-State
+ 0-1 Login-LAT-Service
+ 0-1 Login-LAT-Node
+ 0-1 Login-LAT-Group
+ 0-1 Framed-AppleTalk-Link
+ 0-1 Framed-AppleTalk-Network
+ 0-1 Framed-AppleTalk-Zone
+ 1 Acct-Status-Type
+ 0-1 Acct-Delay-Time
+ 0-1 Acct-Input-Octets
+ 0-1 Acct-Output-Octets
+ 1 Acct-Session-Id
+ 0-1 Acct-Authentic
+ 0-1 Acct-Session-Time
+ 0-1 Acct-Input-Packets
+ 0-1 Acct-Output-Packets
+ 0-1 Acct-Terminate-Cause
+ 0+ Acct-Multi-Session-Id
+ 0+ Acct-Link-Count
+ 0 CHAP-Challenge
+
+
+
+
+Rigney Informational [Page 24]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+ 0-1 NAS-Port-Type
+ 0-1 Port-Limit
+ 0-1 Login-LAT-Port
+
+ [Note 1] An Accounting-Request MUST contain either a NAS-IP-Address
+ or a NAS-Identifier (or both).
+
+ The following table defines the above table entries.
+
+ 0 This attribute MUST NOT be present
+ 0+ Zero or more instances of this attribute MAY be present.
+ 0-1 Zero or one instance of this attribute MAY be present.
+ 1 Exactly one instance of this attribute MUST be present.
+
+6. IANA Considerations
+
+ The Packet Type Codes, Attribute Types, and Attribute Values defined
+ in this document are registered by the Internet Assigned Numbers
+ Authority (IANA) from the RADIUS name spaces as described in the
+ "IANA Considerations" section of RFC 2865 [2], in accordance with BCP
+ 26 [8].
+
+7. Security Considerations
+
+ Security issues are discussed in sections concerning the
+ authenticator included in accounting requests and responses, using a
+ shared secret which is never sent over the network.
+
+8. Change Log
+
+ US-ASCII replaced by UTF-8.
+
+ Added notes on Proxy.
+
+ Framed-IP-Address should contain the actual IP address of the user.
+
+ If Acct-Session-ID was sent in an access-request, it must be used in
+ the accounting-request for that session.
+
+ New values added to Acct-Status-Type.
+
+ Added an IANA Considerations section.
+
+ Updated references.
+
+ Text strings identified as a subset of string, to clarify use of
+ UTF-8.
+
+
+
+
+Rigney Informational [Page 25]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+9. References
+
+ [1] Rigney, C., "RADIUS Accounting", RFC 2139, April 1997.
+
+ [2] Rigney, C., Willens, S., Rubens, A. and W. Simpson, "Remote
+ Authentication Dial In User Service (RADIUS)", RFC 2865, June
+ 2000.
+
+ [3] Bradner, S., "Key words for use in RFCs to Indicate Requirement
+ Levels", BCP 14, RFC 2119, March, 1997.
+
+ [4] Postel, J., "User Datagram Protocol", STD 6, RFC 768, August
+ 1980.
+
+ [5] Rivest, R. and S. Dusse, "The MD5 Message-Digest Algorithm", RFC
+ 1321, April 1992.
+
+ [6] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC 1700,
+ October 1994.
+
+ [7] Yergeau, F., "UTF-8, a transformation format of ISO 10646", RFC
+ 2279, January 1998.
+
+ [8] Alvestrand, H. and T. Narten, "Guidelines for Writing an IANA
+ Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.
+
+10. Acknowledgements
+
+ RADIUS and RADIUS Accounting were originally developed by Steve
+ Willens of Livingston Enterprises for their PortMaster series of
+ Network Access Servers.
+
+11. Chair's Address
+
+ The RADIUS working group can be contacted via the current chair:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ Phone: +1 925 737 2100
+ EMail: cdr@telemancy.com
+
+
+
+
+
+
+
+
+Rigney Informational [Page 26]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+12. Author's Address
+
+ Questions about this memo can also be directed to:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ EMail: cdr@telemancy.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 27]
+
+RFC 2866 RADIUS Accounting June 2000
+
+
+13. Full Copyright Statement
+
+ Copyright (C) The Internet Society (2000). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assigns.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+Acknowledgement
+
+ Funding for the RFC Editor function is currently provided by the
+ Internet Society.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney Informational [Page 28]
+
diff --git a/rfc/rfc2869.txt b/rfc/rfc2869.txt
new file mode 100644
index 0000000..74ed7f6
--- /dev/null
+++ b/rfc/rfc2869.txt
@@ -0,0 +1,2635 @@
+
+
+
+
+
+
+Network Working Group C. Rigney
+Request for Comments: 2869 Livingston
+Category: Informational W. Willats
+ Cyno Technologies
+ P. Calhoun
+ Sun Microsystems
+ June 2000
+
+
+ RADIUS Extensions
+
+Status of this Memo
+
+ This memo provides information for the Internet community. It does
+ not specify an Internet standard of any kind. Distribution of this
+ memo is unlimited.
+
+Copyright Notice
+
+ Copyright (C) The Internet Society (2000). All Rights Reserved.
+
+Abstract
+
+ This document describes additional attributes for carrying
+ authentication, authorization and accounting information between a
+ Network Access Server (NAS) and a shared Accounting Server using the
+ Remote Authentication Dial In User Service (RADIUS) protocol
+ described in RFC 2865 [1] and RFC 2866 [2].
+
+Table of Contents
+
+ 1. Introduction .......................................... 2
+ 1.1 Specification of Requirements ................... 3
+ 1.2 Terminology ..................................... 3
+ 2. Operation ............................................. 4
+ 2.1 RADIUS support for Interim Accounting Updates.... 4
+ 2.2 RADIUS support for Apple Remote Access
+ Protocol ........................................ 5
+ 2.3 RADIUS Support for Extensible Authentication
+ Protocol (EAP) .................................. 11
+ 2.3.1 Protocol Overview ............................... 11
+ 2.3.2 Retransmission .................................. 13
+ 2.3.3 Fragmentation ................................... 14
+ 2.3.4 Examples ........................................ 14
+ 2.3.5 Alternative uses ................................ 19
+ 3. Packet Format ......................................... 19
+ 4. Packet Types .......................................... 19
+ 5. Attributes ............................................ 20
+
+
+
+Rigney, et al. Informational [Page 1]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ 5.1 Acct-Input-Gigawords ............................ 22
+ 5.2 Acct-Output-Gigawords ........................... 23
+ 5.3 Event-Timestamp ................................. 23
+ 5.4 ARAP-Password ................................... 24
+ 5.5 ARAP-Features ................................... 25
+ 5.6 ARAP-Zone-Access ................................ 26
+ 5.7 ARAP-Security ................................... 27
+ 5.8 ARAP-Security-Data .............................. 28
+ 5.9 Password-Retry .................................. 28
+ 5.10 Prompt .......................................... 29
+ 5.11 Connect-Info .................................... 30
+ 5.12 Configuration-Token ............................. 31
+ 5.13 EAP-Message ..................................... 32
+ 5.14 Message-Authenticator ........................... 33
+ 5.15 ARAP-Challenge-Response ......................... 35
+ 5.16 Acct-Interim-Interval ........................... 36
+ 5.17 NAS-Port-Id ..................................... 37
+ 5.18 Framed-Pool ..................................... 37
+ 5.19 Table of Attributes ............................. 38
+ 6. IANA Considerations ................................... 39
+ 7. Security Considerations ............................... 39
+ 7.1 Message-Authenticator Security .................. 39
+ 7.2 EAP Security .................................... 39
+ 7.2.1 Separation of EAP server and PPP authenticator .. 40
+ 7.2.2 Connection hijacking ............................ 41
+ 7.2.3 Man in the middle attacks ....................... 41
+ 7.2.4 Multiple databases .............................. 41
+ 7.2.5 Negotiation attacks ............................. 42
+ 8. References ............................................ 43
+ 9. Acknowledgements ...................................... 44
+ 10. Chair's Address ....................................... 44
+ 11. Authors' Addresses .................................... 45
+ 12. Full Copyright Statement .............................. 47
+
+1. Introduction
+
+ RFC 2865 [1] describes the RADIUS Protocol as it is implemented and
+ deployed today, and RFC 2866 [2] describes how Accounting can be
+ performed with RADIUS.
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 2]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ This memo suggests several additional Attributes that can be added to
+ RADIUS to perform various useful functions. These Attributes do not
+ have extensive field experience yet and should therefore be
+ considered experimental.
+
+ The Extensible Authentication Protocol (EAP) [3] is a PPP extension
+ that provides support for additional authentication methods within
+ PPP. This memo describes how the EAP-Message and Message-
+ Authenticator attributes may be used for providing EAP support within
+ RADIUS.
+
+ All attributes are comprised of variable length Type-Length-Value 3-
+ tuples. New attribute values can be added without disturbing
+ existing implementations of the protocol.
+
+1.1. Specification of Requirements
+
+ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
+ "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
+ document are to be interpreted as described in RFC 2119 [4].
+
+ An implementation is not compliant if it fails to satisfy one or more
+ of the must or must not requirements for the protocols it implements.
+ An implementation that satisfies all the must, must not, should and
+ should not requirements for its protocols is said to be
+ "unconditionally compliant"; one that satisfies all the must and must
+ not requirements but not all the should or should not requirements
+ for its protocols is said to be "conditionally compliant."
+
+ A NAS that does not implement a given service MUST NOT implement the
+ RADIUS attributes for that service. For example, a NAS that is
+ unable to offer ARAP service MUST NOT implement the RADIUS attributes
+ for ARAP. A NAS MUST treat a RADIUS access-request requesting an
+ unavailable service as an access-reject instead.
+
+1.2. Terminology
+
+ This document uses the following terms:
+
+ service The NAS provides a service to the dial-in user, such as PPP
+ or Telnet.
+
+ session Each service provided by the NAS to a dial-in user
+ constitutes a session, with the beginning of the session
+ defined as the point where service is first provided and
+ the end of the session defined as the point where service
+
+
+
+
+
+Rigney, et al. Informational [Page 3]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ is ended. A user may have multiple sessions in parallel or
+ series if the NAS supports that, with each session
+ generating a separate start and stop accounting record.
+
+ silently discard
+ This means the implementation discards the packet without
+ further processing. The implementation SHOULD provide the
+ capability of logging the error, including the contents of
+ the silently discarded packet, and SHOULD record the event
+ in a statistics counter.
+
+2. Operation
+
+ Operation is identical to that defined in RFC 2865 [1] and RFC 2866
+ [2].
+
+2.1. RADIUS support for Interim Accounting Updates
+
+ When a user is authenticated, a RADIUS server issues an Access-Accept
+ in response to a successful Access-Request. If the server wishes to
+ receive interim accounting messages for the given user it must
+ include the Acct-Interim-Interval RADIUS attribute in the message,
+ which indicates the interval in seconds between interim messages.
+
+ It is also possible to statically configure an interim value on the
+ NAS itself. Note that a locally configured value on the NAS MUST
+ override the value found in an Access-Accept.
+
+ This scheme does not break backward interoperability since a RADIUS
+ server not supporting this extension will simply not add the new
+ Attribute. NASes not supporting this extension will ignore the
+ Attribute.
+
+ Note that all information in an interim message is cumulative (i.e.
+ number of packets sent is the total since the beginning of the
+ session, not since the last interim message).
+
+ It is envisioned that an Interim Accounting record (with Acct-
+ Status-Type = Interim-Update (3)) would contain all of the attributes
+ normally found in an Accounting Stop message with the exception of
+ the Acct-Term-Cause attribute.
+
+ Since all the information is cumulative, a NAS MUST ensure that only
+ a single generation of an interim Accounting message for a given
+ session is present in the retransmission queue at any given time.
+
+
+
+
+
+
+Rigney, et al. Informational [Page 4]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ A NAS MAY use a fudge factor to add a random delay between Interim
+ Accounting messages for separate sessions. This will ensure that a
+ cycle where all messages are sent at once is prevented, such as might
+ otherwise occur if a primary link was recently restored and many
+ dial-up users were directed to the same NAS at once.
+
+ The Network and NAS CPU load of using Interim Updates should be
+ carefully considered, and appropriate values of Acct-Interim-Interval
+ chosen.
+
+2.2. RADIUS support for Apple Remote Access Protocol
+
+ The RADIUS (Remote Authentication Dial-In User Service) protocol
+ provides a method that allows multiple dial-in Network Access Server
+ (NAS) devices to share a common authentication database.
+
+ The Apple Remote Access Protocol (ARAP) provides a method for sending
+ AppleTalk network traffic over point-to-point links, typically, but
+ not exclusively, asynchronous and ISDN switched-circuit connections.
+ Though Apple is moving toward ATCP on PPP for future remote access
+ services, ARAP is still a common way for the installed base of
+ Macintosh users to make remote network connections, and is likely to
+ remain so for some time.
+
+ ARAP is supported by several NAS vendors who also support PPP, IPX
+ and other protocols in the same NAS. ARAP connections in these
+ multi-protocol devices are often not authenticated with RADIUS, or if
+ they are, each vendor creates an individual solution to the problem.
+
+ This section describes the use of additional RADIUS attributes to
+ support ARAP. RADIUS client and server implementations that implement
+ this specification should be able to authenticate ARAP connections in
+ an interoperable manner.
+
+ This section assumes prior knowledge of RADIUS, and will go into some
+ detail on the operation of ARAP before entering a detailed discussion
+ of the proposed ARAP RADIUS attributes.
+
+ There are two features of ARAP this document does not address:
+
+ 1. User initiated password changing. This is not part of RADIUS,
+ but can be implemented through a software process other than
+ RADIUS.
+
+ 2. Out-of-Band messages. At any time, the NAS can send messages to
+ an ARA client which appear in a dialog box on the dial-in
+ user's screen. These are not part of authentication and do not
+ belong here. However, we note that a Reply-Message attribute in
+
+
+
+Rigney, et al. Informational [Page 5]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ an Access-Accept may be sent down to the user as a sign-on
+ message of the day string using the out-of-band channel.
+
+ We have tried to respect the spirit of the existing RADIUS protocol
+ as much as possible, making design decisions compatible with prior
+ art. Further, we have tried to strike a balance between flooding the
+ RADIUS world with new attributes, and hiding all of ARAP operation
+ within a single multiplexed ARAP attribute string or within Extended
+ Authentication Protocol (EAP) [3] machinery.
+
+ However, we feel ARAP is enough of a departure from PPP to warrant a
+ small set of similarly named attributes of its own.
+
+ We have assumed that an ARAP-aware RADIUS server will be able to do
+ DES encryption and generate security module challenges. This is in
+ keeping with the general RADIUS goal of smart server / simple NAS.
+
+ ARAP authenticates a connection in two phases. The first is a "Two-
+ Way DES" random number exchange, using the user's password as a key.
+ We say "Two-Way" because the ARAP NAS challenges the dial-in client
+ to authenticate itself, and the dial-in client challenges the ARAP
+ NAS to authenticate itself.
+
+ Specifically, ARAP does the following:
+
+ 1. The NAS sends two 32-bit random numbers to the dial-in client
+ in an ARAP msg_auth_challenge packet.
+
+ 2. The dial-in client uses the user's password to DES encrypt the
+ two random numbers sent to it by the NAS. The dial-in client
+ then sends this result, the user's name and two 32-bit random
+ numbers of its own back to the NAS in an ARAP msg_auth_request
+ packet.
+
+ 3. The NAS verifies the encrypted random numbers sent by the
+ dial-in client are what it expected. If so, it encrypts the
+ dial-in client's challenge using the password and sends it back
+ to the dial-in client in an ARAP msg_auth_response packet.
+
+ Note that if the dial-in client's response was wrong, meaning the
+ user has the wrong password, the server can initiate a retry sequence
+ up to the maximum amount of retries allowed by the NAS. In this case,
+ when the dial-in client receives the ARAP msg_auth_response packet it
+ will acknowledge it with an ARAP msg_auth_again packet.
+
+ After this first "DES Phase" the ARAP NAS MAY initiate a secondary
+ authentication phase using what Apple calls "Add-In Security
+ Modules." Security Modules are small pieces of code which run on
+
+
+
+Rigney, et al. Informational [Page 6]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ both the client and server and are allowed to read and write
+ arbitrary data across the communications link to perform additional
+ authentication functions. Various security token vendors use this
+ mechanism to authenticate ARA callers.
+
+ Although ARAP allows security modules to read and write anything they
+ like, all existing security modules use simple challenge and response
+ cycles, with perhaps some overall control information. This document
+ assumes all existing security modules can be supported with one or
+ more challenge/response cycles.
+
+ To complicate RADIUS and ARAP integration, ARAP sends down some
+ profile information after the DES Phase and before the Security
+ Module phase. This means that besides the responses to challenges,
+ this profile information must also be present, at somewhat unusual
+ times. Fortunately the information is only a few pieces of numeric
+ data related to passwords, which this document packs into a single
+ new attribute.
+
+ Presenting an Access-Request to RADIUS on behalf of an ARAP
+ connection is straightforward. The ARAP NAS generates the random
+ number challenge, and then receives the dial-in client's response,
+ the dial-in client's challenge, and the user's name. Assuming the
+ user is not a guest, the following information is forwarded in an
+ Access-Request packet: User-Name (up to 31 characters long),
+ Framed-Protocol (set to 3, ARAP), ARAP-Password, and any additional
+ attributes desired, such as Service-Type, NAS-IP-Address, NAS-Id,
+ NAS-Port-Type, NAS-Port, NAS-Port-Id, Connect-Info, etc.
+
+ The Request Authenticator is a NAS-generated 16 octet random number.
+ The low-order 8 octets of this number are sent to the dial-in user as
+ the two 4 octet random numbers required in the ARAP
+ msg_auth_challenge packet. Octets 0-3 are the first random number and
+ Octets 4-7 are the second random number.
+
+ The ARAP-Password in the Access-Request contains a 16 octet random
+ number field, and is used to carry the dial-in user's response to the
+ NAS challenge and the client's own challenge to the NAS. The high-
+ order octets contain the dial-in user's challenge to the NAS (2 32-
+ bit numbers, 8 octets) and the low-order octets contain the dial-in
+ user's response to the NAS challenge (2 32-bit numbers, 8 octets).
+
+ Only one of User-Password, CHAP-Password, or ARAP-Password needs to
+ be present in an Access-Request, or one or more EAP-Messages.
+
+ If the RADIUS server does not support ARAP it SHOULD return an
+ Access-Reject to the NAS.
+
+
+
+
+Rigney, et al. Informational [Page 7]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ If the RADIUS server does support ARAP, it should verify the user's
+ response using the Challenge (from the lower order 8 octets of the
+ Request Authenticator) and the user's response (from the low order 8
+ octets of the ARAP-Password).
+
+ If that authentication fails, the RADIUS server should return an
+ Access-Reject packet to the NAS, with optional Password-Retry and
+ Reply-Messages attributes. The presence of Password-Retry indicates
+ the ARAP NAS MAY choose to initiate another challenge-response cycle,
+ up to a total number of times equal to the integer value of the
+ Password-Retry attribute.
+
+ If the user is authenticated, the RADIUS server should return an
+ Access-Accept packet (Code 2) to the NAS, with ID and Response
+ Authenticator as usual, and attributes as follows:
+
+ Service-Type of Framed-Protocol.
+
+ Framed-Protocol of ARAP (3).
+
+ Session-Timeout with the maximum connect time for the user in
+ seconds. If the user is to be given unlimited time,
+ Session-Timeout should not be included in the Access-Accept
+ packet, and ARAP will treat that as an unlimited timeout (-1).
+
+ ARAP-Challenge-Response, containing 8 octets with the response to
+ the dial-in client's challenge. The RADIUS server calculates this
+ value by taking the dial-in client's challenge from the high order
+ 8 octets of the ARAP-Password attribute and performing DES
+ encryption on this value with the authenticating user's password
+ as the key. If the user's password is less than 8 octets in
+ length, the password is padded at the end with NULL octets to a
+ length of 8 before using it as a key. If the user's password is
+ greater than 8 octets in length, an Access-Reject MUST be sent
+ instead.
+
+ ARAP-Features, containing information that the NAS should send to
+ the user in an ARAP "feature flags" packet.
+
+ Octet 0: If zero, user cannot change their password. If non-
+ zero user can. (RADIUS does not handle the password changing,
+ just the attribute which indicates whether ARAP indicates they
+ can.)
+
+ Octet 1: Minimum acceptable password length (0-8).
+
+
+
+
+
+
+Rigney, et al. Informational [Page 8]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Octet 2-5: Password creation date in Macintosh format, defined
+ as 32 bits unsigned representing seconds since Midnight GMT
+ January 1, 1904.
+
+ Octet 6-9 Password Expiration Delta from create date in
+ seconds.
+
+ Octet 10-13: Current RADIUS time in Macintosh format
+
+ Optionally, a single Reply-Message with a text string up to 253
+ characters long which MAY be sent down to the user to be displayed
+ in a sign-on/message of the day dialog.
+
+ Framed-AppleTalk-Network may be included.
+
+ Framed-AppleTalk-Zone, up to 32 characters in length, may be
+ included.
+
+ ARAP defines the notion of a list of zones for a user. Along with
+ a list of zone names, a Zone Access Flag is defined (and used by
+ the NAS) which says how to use the list of zone names. That is,
+ the dial-in user may only be allowed to see the Default Zone, or
+ only the zones in the zone list (inclusive) or any zone except
+ those in the zone list (exclusive).
+
+ The ARAP NAS handles this by having a named filter which contains
+ (at least) zone names. This solves the problem where a single
+ RADIUS server is managing disparate NAS clients who may not be
+ able to "see" all of the zone names in a user zone list. Zone
+ names only have meaning "at the NAS." The disadvantage of this
+ approach is that zone filters must be set up on the NAS somehow,
+ then referenced by the RADIUS Filter-Id.
+
+ ARAP-Zone-Access contains an integer which specifies how the "zone
+ list" for this user should be used. If this attribute is present
+ and the value is 2 or 4 then a Filter-Id must also be present to
+ name a zone list filter to apply the access flag to.
+
+ The inclusion of a Callback-Number or Callback-Id attribute in the
+ Access-Accept MAY cause the ARAP NAS to disconnect after sending
+ the Feature Flags to begin callback processing in an ARAP specific
+ way.
+
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 9]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Other attributes may be present in the Access-Accept packet as well.
+
+ An ARAP NAS will need other information to finish bringing up the
+ connection to the dial in client, but this information can be
+ provided by the ARAP NAS without any help from RADIUS, either through
+ configuration by SNMP, a NAS administration program, or deduced by
+ the AppleTalk stack in the NAS. Specifically:
+
+ 1. AppearAsNet and AppearAsNode values, sent to the client to tell
+ it what network and node numbers it should use in its datagram
+ packets. AppearAsNet can be taken from the Framed-AppleTalk-
+ Network attribute or from the configuration or AppleTalk stack
+ onthe NAS.
+
+ 2. The "default" zone - that is the name of the AppleTalk zone in
+ which the dial-in client will appear. (Or can be specified
+ with the Framed-AppleTalk-Zone attribute.)
+
+ 3. Other very NAS specific stuff such as the name of the NAS, and
+ smartbuffering information. (Smartbuffering is an ARAP
+ mechanism for replacing common AppleTalk datagrams with small
+ tokens, to improve slow link performance in a few common
+ traffic situations.)
+
+ 4. "Zone List" information for this user. The ARAP specification
+ defines a "zone count" field which is actually unused.
+
+ RADIUS supports ARAP Security Modules in the following manner.
+
+ After DES authentication has been completed, the RADIUS server may
+ instruct the ARAP NAS to run one or more security modules for the
+ dial-in user. Although the underlying protocol supports executing
+ multiple security modules in series, in practice all current
+ implementations only allow executing one. Through the use of
+ multiple Access-Challenge requests, multiple modules can be
+ supported, but this facility will probably never be used.
+
+ We also assume that, even though ARAP allows a free-form dialog
+ between security modules on each end of the point-to-point link, in
+ actual practice all security modules can be reduced to a simple
+ challenge/response cycle.
+
+ If the RADIUS server wishes to instruct the ARAP NAS to run a
+ security module, it should send an Access-Challenge packet to the NAS
+ with (optionally) the State attribute, plus the ARAP-Challenge-
+ Response, ARAP-Features, and two more attributes:
+
+
+
+
+
+Rigney, et al. Informational [Page 10]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ ARAP-Security: a four octet security module signature, containing a
+ Macintosh OSType.
+
+ ARAP-Security-Data, a string to carry the actual security module
+ challenge and response.
+
+ When the security module finishes executing, the security module
+ response is passed in an ARAP-Security-Data attribute from the NAS
+ to the RADIUS server in a second Access-Request, also including the
+ State from the Access-Challenge. The authenticator field contains no
+ special information in this case, and this can be discerned by the
+ presence of the State attribute.
+
+2.3. RADIUS Support for Extensible Authentication Protocol (EAP)
+
+ The Extensible Authentication Protocol (EAP), described in [3],
+ provides a standard mechanism for support of additional
+ authentication methods within PPP. Through the use of EAP, support
+ for a number of authentication schemes may be added, including smart
+ cards, Kerberos, Public Key, One Time Passwords, and others. In
+ order to provide for support of EAP within RADIUS, two new
+ attributes, EAP-Message and Message-Authenticator, are introduced in
+ this document. This section describes how these new attributes may be
+ used for providing EAP support within RADIUS.
+
+ In the proposed scheme, the RADIUS server is used to shuttle RADIUS-
+ encapsulated EAP Packets between the NAS and a backend security
+ server. While the conversation between the RADIUS server and the
+ backend security server will typically occur using a proprietary
+ protocol developed by the backend security server vendor, it is also
+ possible to use RADIUS-encapsulated EAP via the EAP-Message
+ attribute. This has the advantage of allowing the RADIUS server to
+ support EAP without the need for authentication-specific code, which
+ can instead reside on the backend security server.
+
+2.3.1. Protocol Overview
+
+ The EAP conversation between the authenticating peer (dial-in user)
+ and the NAS begins with the negotiation of EAP within LCP. Once EAP
+ has been negotiated, the NAS MUST send an EAP-Request/Identity
+ message to the authenticating peer, unless identity is determined via
+ some other means such as Called-Station-Id or Calling-Station-Id.
+ The peer will then respond with an EAP-Response/Identity which the
+ the NAS will then forward to the RADIUS server in the EAP-Message
+ attribute of a RADIUS Access-Request packet. The RADIUS Server will
+ typically use the EAP-Response/Identity to determine which EAP type
+ is to be applied to the user.
+
+
+
+
+Rigney, et al. Informational [Page 11]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ In order to permit non-EAP aware RADIUS proxies to forward the
+ Access-Request packet, if the NAS sends the EAP-Request/Identity, the
+ NAS MUST copy the contents of the EAP-Response/Identity into the
+ User-Name attribute and MUST include the EAP-Response/Identity in the
+ User-Name attribute in every subsequent Access-Request. NAS-Port or
+ NAS-Port-Id SHOULD be included in the attributes issued by the NAS in
+ the Access-Request packet, and either NAS-Identifier or NAS-IP-
+ Address MUST be included. In order to permit forwarding of the
+ Access-Reply by EAP-unaware proxies, if a User-Name attribute was
+ included in an Access-Request, the RADIUS Server MUST include the
+ User-Name attribute in subsequent Access-Accept packets. Without the
+ User-Name attribute, accounting and billing becomes very difficult to
+ manage.
+
+ If identity is determined via another means such as Called-Station-Id
+ or Calling-Station-Id, the NAS MUST include these identifying
+ attributes in every Access-Request.
+
+ While this approach will save a round-trip, it cannot be universally
+ employed. There are circumstances in which the user's identity may
+ not be needed (such as when authentication and accounting is handled
+ based on Called-Station-Id or Calling-Station-Id), and therefore an
+ EAP-Request/Identity packet may not necessarily be issued by the NAS
+ to the authenticating peer. In cases where an EAP-Request/Identity
+ packet will not be sent, the NAS will send to the RADIUS server a
+ RADIUS Access-Request packet containing an EAP-Message attribute
+ signifying EAP-Start. EAP-Start is indicated by sending an EAP-
+ Message attribute with a length of 2 (no data). However, it should be
+ noted that since no User-Name attribute is included in the Access-
+ Request, this approach is not compatible with RADIUS as specified in
+ [1], nor can it easily be applied in situations where proxies are
+ deployed, such as roaming or shared use networks.
+
+ If the RADIUS server supports EAP, it MUST respond with an Access-
+ Challenge packet containing an EAP-Message attribute. If the RADIUS
+ server does not support EAP, it MUST respond with an Access-Reject.
+ The EAP-Message attribute includes an encapsulated EAP packet which
+ is then passed on to the authenticating peer. In the case where the
+ NAS does not initially send an EAP-Request/Identity message to the
+ peer, the Access-Challenge typically will contain an EAP-Message
+ attribute encapsulating an EAP-Request/Identity message, requesting
+ the dial-in user to identify themself. The NAS will then respond with
+ a RADIUS Access-Request packet containing an EAP-Message attribute
+ encapsulating an EAP-Response. The conversation continues until
+ either a RADIUS Access-Reject or Access-Accept packet is received.
+
+
+
+
+
+
+Rigney, et al. Informational [Page 12]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Reception of a RADIUS Access-Reject packet, with or without an EAP-
+ Message attribute encapsulating EAP-Failure, MUST result in the NAS
+ issuing an LCP Terminate Request to the authenticating peer. A
+ RADIUS Access-Accept packet with an EAP-Message attribute
+ encapsulating EAP-Success successfully ends the authentication phase.
+ The RADIUS Access-Accept/EAP-Message/EAP-Success packet MUST contain
+ all of the expected attributes which are currently returned in an
+ Access-Accept packet.
+
+ The above scenario creates a situation in which the NAS never needs
+ to manipulate an EAP packet. An alternative may be used in
+ situations where an EAP-Request/Identity message will always be sent
+ by the NAS to the authenticating peer.
+
+ For proxied RADIUS requests there are two methods of processing. If
+ the domain is determined based on the Called-Station-Id, the RADIUS
+ Server may proxy the initial RADIUS Access-Request/EAP-Start. If the
+ domain is determined based on the user's identity, the local RADIUS
+ Server MUST respond with a RADIUS Access-Challenge/EAP-Identity
+ packet. The response from the authenticating peer MUST be proxied to
+ the final authentication server.
+
+ For proxied RADIUS requests, the NAS may receive an Access-Reject
+ packet in response to its Access-Request/EAP-Identity packet. This
+ would occur if the message was proxied to a RADIUS Server which does
+ not support the EAP-Message extension. On receiving an Access-Reject,
+ the NAS MUST send an LCP Terminate Request to the authenticating
+ peer, and disconnect.
+
+2.3.2. Retransmission
+
+ As noted in [3], the EAP authenticator (NAS) is responsible for
+ retransmission of packets between the authenticating peer and the
+ NAS. Thus if an EAP packet is lost in transit between the
+ authenticating peer and the NAS (or vice versa), the NAS will
+ retransmit. As in RADIUS [1], the RADIUS client is responsible for
+ retransmission of packets between the RADIUS client and the RADIUS
+ server.
+
+ Note that it may be necessary to adjust retransmission strategies and
+ authentication timeouts in certain cases. For example, when a token
+ card is used additional time may be required to allow the user to
+ find the card and enter the token. Since the NAS will typically not
+ have knowledge of the required parameters, these need to be provided
+ by the RADIUS server. This can be accomplished by inclusion of
+ Session-Timeout and Password-Retry attributes within the Access-
+ Challenge packet.
+
+
+
+
+Rigney, et al. Informational [Page 13]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ If Session-Timeout is present in an Access-Challenge packet that also
+ contains an EAP-Message, the value of the Session-Timeout provides
+ the NAS with the maximum number of seconds the NAS should wait for an
+ EAP-Response before retransmitting the EAP-Message to the dial-in
+ user.
+
+2.3.3. Fragmentation
+
+ Using the EAP-Message attribute, it is possible for the RADIUS server
+ to encapsulate an EAP packet that is larger than the MTU on the link
+ between the NAS and the peer. Since it is not possible for the RADIUS
+ server to use MTU discovery to ascertain the link MTU, the Framed-MTU
+ attribute may be included in an Access-Request packet containing an
+ EAP-Message attribute so as to provide the RADIUS server with this
+ information.
+
+2.3.4. Examples
+
+ The example below shows the conversation between the authenticating
+ peer, NAS, and RADIUS server, for the case of a One Time Password
+ (OTP) authentication. OTP is used only for illustrative purposes;
+ other authentication protocols could also have been used, although
+ they might show somewhat different behavior.
+
+Authenticating Peer NAS RADIUS Server
+------------------- --- -------------
+
+ <- PPP LCP Request-EAP
+ auth
+PPP LCP ACK-EAP
+auth ->
+ <- PPP EAP-Request/
+ Identity
+PPP EAP-Response/
+Identity (MyID) ->
+ RADIUS
+ Access-Request/
+ EAP-Message/
+ EAP-Response/
+ (MyID) ->
+ <- RADIUS
+ Access-Challenge/
+ EAP-Message/EAP-Request
+ OTP/OTP Challenge
+ <- PPP EAP-Request/
+ OTP/OTP Challenge
+PPP EAP-Response/
+OTP, OTPpw ->
+
+
+
+Rigney, et al. Informational [Page 14]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ RADIUS
+ Access-Request/
+ EAP-Message/
+ EAP-Response/
+ OTP, OTPpw ->
+ <- RADIUS
+ Access-Accept/
+ EAP-Message/EAP-Success
+ (other attributes)
+ <- PPP EAP-Success
+PPP Authentication
+Phase complete,
+NCP Phase starts
+
+In the case where the NAS first sends an EAP-Start packet to the
+RADIUS server, the conversation would appear as follows:
+
+Authenticating Peer NAS RADIUS Server
+------------------- --- -------------
+
+ <- PPP LCP Request-EAP
+ auth
+PPP LCP ACK-EAP
+auth ->
+ RADIUS
+ Access-Request/
+ EAP-Message/Start ->
+ <- RADIUS
+ Access-Challenge/
+ EAP-Message/Identity
+ <- PPP EA-Request/
+ Identity
+PPP EAP-Response/
+Identity (MyID) ->
+ RADIUS
+ Access-Request/
+ EAP-Message/
+ EAP-Response/
+ (MyID) ->
+ <- RADIUS
+ Access-Challenge/
+ EAP-Message/EAP-Request
+ OTP/OTP Challenge
+ <- PPP EAP-Request/
+ OTP/OTP Challenge
+PPP EAP-Response/
+OTP, OTPpw ->
+
+
+
+
+Rigney, et al. Informational [Page 15]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ RADIUS
+ Access-Request/
+ EAP-Message/
+ EAP-Response/
+ OTP, OTPpw ->
+ <- RADIUS
+ Access-Accept/
+ EAP-Message/EAP-Success
+ (other attributes)
+ <- PPP EAP-Success
+PPP Authentication
+Phase complete,
+NCP Phase starts
+
+In the case where the client fails EAP authentication, the
+conversation would appear as follows:
+
+Authenticating Peer NAS RADIUS Server
+------------------- --- -------------
+
+ <- PPP LCP Request-EAP
+ auth
+PPP LCP ACK-EAP
+auth ->
+ Access-Request/
+ EAP-Message/Start ->
+ <- RADIUS
+ Access-Challenge/
+ EAP-Message/Identity
+ <- PPP EAP-Request/
+ Identity
+PPP EAP-Response/
+Identity (MyID) ->
+ RADIUS
+ Access-Request/
+ EAP-Message/
+ EAP-Response/
+ (MyID) ->
+ <- RADIUS
+ Access-Challenge/
+ EAP-Message/EAP-Request
+ OTP/OTP Challenge
+ <- PPP EAP-Request/
+ OTP/OTP Challenge
+PPP EAP-Response/
+OTP, OTPpw ->
+ RADIUS
+ Access-Request/
+
+
+
+Rigney, et al. Informational [Page 16]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ EAP-Message/
+ EAP-Response/
+ OTP, OTPpw ->
+ <- RADIUS
+ Access-Reject/
+ EAP-Message/EAP-Failure
+
+ <- PPP EAP-Failure
+ (client disconnected)
+
+In the case that the RADIUS server or proxy does not support
+EAP-Message, the conversation would appear as follows:
+
+Authenticating Peer NAS RADIUS Server
+------------------- --- -------------
+
+ <- PPP LCP Request-EAP
+ auth
+PPP LCP ACK-EAP
+auth ->
+ RADIUS
+ Access-Request/
+ EAP-Message/Start ->
+ <- RADIUS
+ Access-Reject
+ <- PPP LCP Terminate
+ (User Disconnected)
+
+In the case where the local RADIUS Server does support EAP-Message,
+but the remote RADIUS Server does not, the conversation would appear
+as follows:
+
+Authenticating Peer NAS RADIUS Server
+------------------- --- -------------
+
+ <- PPP LCP Request-EAP
+ auth
+PPP LCP ACK-EAP
+auth ->
+ RADIUS
+ Access-Request/
+ EAP-Message/Start ->
+ <- RADIUS
+ Access-Challenge/
+ EAP-Message/Identity
+ <- PPP EAP-Request/
+ Identity
+
+
+
+
+Rigney, et al. Informational [Page 17]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+PPP EAP-Response/
+Identity
+(MyID) ->
+ RADIUS
+ Access-Request/
+ EAP-Message/EAP-Response/
+ (MyID) ->
+ <- RADIUS
+ Access-Reject
+ (proxied from remote
+ RADIUS Server)
+ <- PPP LCP Terminate
+ (User Disconnected)
+
+In the case where the authenticating peer does not support EAP, but
+where EAP is required for that user, the conversation would appear as
+follows:
+
+Authenticating Peer NAS RADIUS Server
+------------------- --- -------------
+
+ <- PPP LCP Request-EAP
+ auth
+PPP LCP NAK-EAP
+auth ->
+ <- PPP LCP Request-CHAP
+ auth
+PPP LCP ACK-CHAP
+auth ->
+ <- PPP CHAP Challenge
+PPP CHAP Response ->
+ RADIUS
+ Access-Request/
+ User-Name,
+ CHAP-Password ->
+ <- RADIUS
+ Access-Reject
+ <- PPP LCP Terminate
+ (User Disconnected)
+
+In the case where the NAS does not support EAP, but where EAP is
+required for that user, the conversation would appear as follows:
+
+Authenticating Peer NAS RADIUS Server
+------------------- --- -------------
+
+ <- PPP LCP Request-CHAP
+ auth
+
+
+
+Rigney, et al. Informational [Page 18]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+PP LCP ACK-CHAP
+auth ->
+ <- PPP CHAP Challenge
+PPP CHAP Response ->
+ RADIUS
+ Access-Request/
+ User-Name,
+ CHAP-Password ->
+
+ <- RADIUS
+ Access-Reject
+ <- PPP LCP Terminate
+ (User Disconnected)
+
+2.3.5. Alternative uses
+
+ Currently the conversation between the backend security server and
+ the RADIUS server is proprietary because of lack of standardization.
+ In order to increase standardization and provide interoperability
+ between Radius vendors and backend security vendors, it is
+ recommended that RADIUS-encapsulated EAP be used for this
+ conversation.
+
+ This has the advantage of allowing the RADIUS server to support EAP
+ without the need for authentication-specific code within the RADIUS
+ server. Authentication-specific code can then reside on a backend
+ security server instead.
+
+ In the case where RADIUS-encapsulated EAP is used in a conversation
+ between a RADIUS server and a backend security server, the security
+ server will typically return an Access-Accept/EAP-Success message
+ without inclusion of the expected attributes currently returned in an
+ Access-Accept. This means that the RADIUS server MUST add these
+ attributes prior to sending an Access-Accept/EAP-Success message to
+ the NAS.
+
+3. Packet Format
+
+ Packet Format is identical to that defined in RFC 2865 [1] and 2866
+ [2].
+
+4. Packet Types
+
+ Packet types are identical to those defined in RFC 2865 [1] and 2866
+ [2].
+
+ See "Table of Attributes" below to determine which types of packets
+ can contain which attributes defined here.
+
+
+
+Rigney, et al. Informational [Page 19]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+5. Attributes
+
+ RADIUS Attributes carry the specific authentication, authorization
+ and accounting details for the request and response.
+
+ Some attributes MAY be included more than once. The effect of this
+ is attribute specific, and is specified in each attribute
+ description. The order of attributes of the same type SHOULD be
+ preserved. The order of attributes of different types is not
+ required to be preserved.
+
+ The end of the list of attributes is indicated by the Length of the
+ RADIUS packet.
+
+ A summary of the attribute format is the same as in RFC 2865 [1] but
+ is included here for ease of reference. The fields are transmitted
+ from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Type
+
+ The Type field is one octet. Up-to-date values of the RADIUS Type
+ field are specified in the most recent "Assigned Numbers" RFC [5].
+ Values 192-223 are reserved for experimental use, values 224-240
+ are reserved for implementation-specific use, and values 241-255
+ are reserved and should not be used. This specification concerns
+ the following values:
+
+ 1-39 (refer to RFC 2865 [1], "RADIUS")
+ 40-51 (refer to RFC 2866 [2], "RADIUS Accounting")
+ 52 Acct-Input-Gigawords
+ 53 Acct-Output-Gigawords
+ 54 Unused
+ 55 Event-Timestamp
+ 56-59 Unused
+ 60-63 (refer to RFC 2865 [1], "RADIUS")
+ 64-67 (refer to [6])
+ 68 (refer to [7])
+ 69 (refer to [6])
+ 70 ARAP-Password
+ 71 ARAP-Features
+ 72 ARAP-Zone-Access
+
+
+
+Rigney, et al. Informational [Page 20]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ 73 ARAP-Security
+ 74 ARAP-Security-Data
+ 75 Password-Retry
+ 76 Prompt
+ 77 Connect-Info
+ 78 Configuration-Token
+ 79 EAP-Message
+ 80 Message-Authenticator
+ 81-83 (refer to [6])
+ 84 ARAP-Challenge-Response
+ 85 Acct-Interim-Interval
+ 86 (refer to [7])
+ 87 NAS-Port-Id
+ 88 Framed-Pool
+ 89 Unused
+ 90-91 (refer to [6])
+ 92-191 Unused
+
+ Length
+
+ The Length field is one octet, and indicates the length of this
+ attribute including the Type, Length and Value fields. If an
+ attribute is received in a packet with an invalid Length, the
+ entire request should be silently discarded.
+
+ Value
+
+ The Value field is zero or more octets and contains information
+ specific to the attribute. The format and length of the Value
+ field is determined by the Type and Length fields.
+
+ Note that none of the types in RADIUS terminate with a NUL (hex
+ 00). In particular, types "text" and "string" in RADIUS do not
+ terminate with a NUL (hex 00). The Attribute has a length field
+ and does not use a terminator. Text contains UTF-8 encoded 10646
+ [8] characters and String contains 8-bit binary data. Servers and
+ servers and clients MUST be able to deal with embedded nulls.
+ RADIUS implementers using C are cautioned not to use strcpy() when
+ handling strings.
+
+ The format of the value field is one of five data types. Note
+ that type "text" is a subset of type "string."
+
+ text 1-253 octets containing UTF-8 encoded 10646 [8]
+ characters. Text of length zero (0) MUST NOT be sent;
+ omit the entire attribute instead.
+
+
+
+
+
+Rigney, et al. Informational [Page 21]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ string 1-253 octets containing binary data (values 0 through
+ 255 decimal, inclusive). Strings of length zero (0) MUST
+ NOT be sent; omit the entire attribute instead.
+
+ address 32 bit unsigned value, most significant octet first.
+
+ integer 32 bit unsigned value, most significant octet first.
+
+ time 32 bit unsigned value, most significant octet first --
+ seconds since 00:00:00 UTC, January 1, 1970.
+
+5.1. Acct-Input-Gigawords
+
+ Description
+
+ This attribute indicates how many times the Acct-Input-Octets
+ counter has wrapped around 2^32 over the course of this service
+ being provided, and can only be present in Accounting-Request
+ records where the Acct-Status-Type is set to Stop or Interim-
+ Update.
+
+ A summary of the Acct-Input-Gigawords attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 52 for Acct-Input-Gigawords.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 22]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+5.2. Acct-Output-Gigawords
+
+ Description
+
+ This attribute indicates how many times the Acct-Output-Octets
+ counter has wrapped around 2^32 in the course of delivering this
+ service, and can only be present in Accounting-Request records
+ where the Acct-Status-Type is set to Stop or Interim-Update.
+
+ A summary of the Acct-Output-Gigawords attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 53 for Acct-Output-Gigawords.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+5.3. Event-Timestamp
+
+ Description
+
+ This attribute is included in an Accounting-Request packet to
+ record the time that this event occurred on the NAS, in seconds
+ since January 1, 1970 00:00 UTC.
+
+ A summary of the Event-Timestamp attribute format is shown below.
+ The fields are transmitted from left to right.
+
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 23]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 55 for Event-Timestamp
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets encoding an unsigned integer with
+ the number of seconds since January 1, 1970 00:00 UTC.
+
+5.4. ARAP-Password
+
+ Description
+
+ This attribute is only present in an Access-Request packet
+ containing a Framed-Protocol of ARAP.
+
+ Only one of User-Password, CHAP-Password, or ARAP-Password needs
+ to be present in an Access-Request, or one or more EAP-Messages.
+
+ A summary of the ARAP-Password attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Value2
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Value3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Value4
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+
+
+Rigney, et al. Informational [Page 24]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Type
+
+ 70 for ARAP-Password.
+
+ Length
+
+ 18
+
+ Value
+
+ This attribute contains a 16 octet string, used to carry the
+ dial-in user's response to the NAS challenge and the client's own
+ challenge to the NAS. The high-order octets (Value1 and Value2)
+ contain the dial-in user's challenge to the NAS (2 32-bit numbers,
+ 8 octets) and the low-order octets (Value3 and Value4) contain the
+ dial-in user's response to the NAS challenge (2 32-bit numbers, 8
+ octets).
+
+5.5. ARAP-Features
+
+ Description
+
+ This attribute is sent in an Access-Accept packet with Framed-
+ Protocol of ARAP, and includes password information that the NAS
+ should sent to the user in an ARAP "feature flags" packet.
+
+ A summary of the ARAP-Features attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value1 | Value2 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Value3 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Value4 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Value5 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 71 for ARAP-Features.
+
+ Length
+
+ 16
+
+
+
+Rigney, et al. Informational [Page 25]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Value
+
+ The Value field is a compound string containing information the
+ NAS should send to the user in the ARAP "feature flags" packet.
+
+ Value1: If zero, user cannot change their password. If non-zero
+ user can. (RADIUS does not handle the password changing, just
+ the attribute which indicates whether ARAP indicates they can.)
+
+ Value2: Minimum acceptable password length, from 0 to 8.
+
+ Value3: Password creation date in Macintosh format, defined as
+ 32 unsigned bits representing seconds since Midnight GMT
+ January 1, 1904.
+
+ Value4: Password Expiration Delta from create date in seconds.
+
+ Value5: Current RADIUS time in Macintosh format.
+
+5.6. ARAP-Zone-Access
+
+ Description
+
+ This attribute is included in an Access-Accept packet with
+ Framed-Protocol of ARAP to indicate how the ARAP zone list for the
+ user should be used.
+
+ A summary of the ARAP-Zone-Access attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Type
+
+ 72 for ARAP-Zone-Access.
+
+ Length
+
+ 6
+
+
+
+
+
+Rigney, et al. Informational [Page 26]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Value
+
+ The Value field is four octets encoding an integer with one of the
+ following values:
+
+ 1 Only allow access to default zone
+ 2 Use zone filter inclusively
+ 4 Use zone filter exclusively
+
+
+ The value 3 is skipped, not because these are bit flags, but
+ because 3 in some ARAP implementations means "all zones" which is
+ the same as not specifying a list at all under RADIUS.
+
+ If this attribute is present and the value is 2 or 4 then a
+ Filter-Id must also be present to name a zone list filter to apply
+ the access flag to.
+
+5.7. ARAP-Security
+
+ Description
+
+ This attribute identifies the ARAP Security Module to be used in
+ an Access-Challenge packet.
+
+ A summary of the ARAP-Security attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 73 for ARAP-Security.
+
+ Length
+
+ 6
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 27]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Value
+
+ The Value field is four octets, containing an integer specifying
+ the security module signature, which is a Macintosh OSType.
+ (Macintosh OSTypes are 4 ascii characters cast as a 32-bit
+ integer)
+
+5.8. ARAP-Security-Data
+
+ Description
+
+ This attribute contains the actual security module challenge or
+ response, and can be found in Access-Challenge and Access-Request
+ packets.
+
+ A summary of the ARAP-Security-Data attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 74 for ARAP-Security-Data.
+
+ Length
+
+ >=3
+
+ String
+
+ The String field contains the security module challenge or
+ response associated with the ARAP Security Module specified in
+ ARAP-Security.
+
+5.9. Password-Retry
+
+ Description
+
+ This attribute MAY be included in an Access-Reject to indicate how
+ many authentication attempts a user may be allowed to attempt
+ before being disconnected.
+
+ It is primarily intended for use with ARAP authentication.
+
+
+
+
+Rigney, et al. Informational [Page 28]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ A summary of the Password-Retry attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 75 for Password-Retry.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets, containing an integer specifying
+ the number of password retry attempts to permit the user.
+
+5.10. Prompt
+
+ Description
+
+ This attribute is used only in Access-Challenge packets, and
+ indicates to the NAS whether it should echo the user's response as
+ it is entered, or not echo it.
+
+
+ A summary of the Prompt attribute format is shown below. The fields
+ are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 76 for Prompt.
+
+
+
+
+Rigney, et al. Informational [Page 29]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets.
+
+ 0 No Echo
+ 1 Echo
+
+5.11. Connect-Info
+
+ Description
+
+ This attribute is sent from the NAS to indicate the nature of the
+ user's connection.
+
+ The NAS MAY send this attribute in an Access-Request or
+ Accounting-Request to indicate the nature of the user's
+ connection.
+
+ A summary of the Connect-Info attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Text...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 77 for Connect-Info.
+
+ Length
+
+ >= 3
+
+ Text
+
+ The Text field consists of UTF-8 encoded 10646 [8] characters.
+ The connection speed SHOULD be included at the beginning of the
+ first Connect-Info attribute in the packet. If the transmit and
+ receive connection speeds differ, they may both be included in the
+ first attribute with the transmit speed first (the speed the NAS
+ modem transmits at), a slash (/), the receive speed, then
+ optionally other information.
+
+
+
+Rigney, et al. Informational [Page 30]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ For example, "28800 V42BIS/LAPM" or "52000/31200 V90"
+
+ More than one Connect-Info attribute may be present in an
+ Accounting-Request packet to accommodate expected efforts by ITU
+ to have modems report more connection information in a standard
+ format that might exceed 252 octets.
+
+5.12. Configuration-Token
+
+ Description
+
+ This attribute is for use in large distributed authentication
+ networks based on proxy. It is sent from a RADIUS Proxy Server to
+ a RADIUS Proxy Client in an Access-Accept to indicate a type of
+ user profile to be used. It should not be sent to a NAS.
+
+ A summary of the Configuration-Token attribute format is shown below.
+ The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | String ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 78 for Configuration-Token.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field is one or more octets. The actual format of the
+ information is site or application specific, and a robust
+ implementation SHOULD support the field as undistinguished octets.
+
+ The codification of the range of allowed usage of this field is
+ outside the scope of this specification.
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 31]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+5.13. EAP-Message
+
+ Description
+
+ This attribute encapsulates Extended Access Protocol [3] packets
+ so as to allow the NAS to authenticate dial-in users via EAP
+ without having to understand the EAP protocol.
+
+ The NAS places any EAP messages received from the user into one or
+ more EAP attributes and forwards them to the RADIUS Server as part
+ of the Access-Request, which can return EAP messages in Access-
+ Challenge, Access-Accept and Access-Reject packets.
+
+ A RADIUS Server receiving EAP messages that it does not understand
+ SHOULD return an Access-Reject.
+
+ The NAS places EAP messages received from the authenticating peer
+ into one or more EAP-Message attributes and forwards them to the
+ RADIUS Server within an Access-Request message. If multiple EAP-
+ Messages are contained within an Access-Request or Access-
+ Challenge packet, they MUST be in order and they MUST be
+ consecutive attributes in the Access-Request or Access-Challenge
+ packet. Access-Accept and Access-Reject packets SHOULD only have
+ ONE EAP-Message attribute in them, containing EAP-Success or EAP-
+ Failure.
+
+ It is expected that EAP will be used to implement a variety of
+ authentication methods, including methods involving strong
+ cryptography. In order to prevent attackers from subverting EAP by
+ attacking RADIUS/EAP, (for example, by modifying the EAP-Success
+ or EAP-Failure packets) it is necessary that RADIUS/EAP provide
+ integrity protection at least as strong as those used in the EAP
+ methods themselves.
+
+ Therefore the Message-Authenticator attribute MUST be used to
+ protect all Access-Request, Access-Challenge, Access-Accept, and
+ Access-Reject packets containing an EAP-Message attribute.
+
+ Access-Request packets including an EAP-Message attribute without
+ a Message-Authenticator attribute SHOULD be silently discarded by
+ the RADIUS server. A RADIUS Server supporting EAP-Message MUST
+ calculate the correct value of the Message-Authenticator and
+ silently discard the packet if it does not match the value sent.
+ A RADIUS Server not supporting EAP-Message MUST return an Access-
+ Reject if it receives an Access-Request containing an EAP-Message
+ attribute. A RADIUS Server receiving an EAP-Message attribute that
+ it does not understand MUST return an Access-Reject.
+
+
+
+
+Rigney, et al. Informational [Page 32]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Access-Challenge, Access-Accept, or Access-Reject packets
+ including an EAP-Message attribute without a Message-Authenticator
+ attribute SHOULD be silently discarded by the NAS. A NAS
+ supporting EAP-Message MUST calculate the correct value of the
+ Message-Authenticator and silently discard the packet if it does
+ not match the value sent.
+
+ A summary of the EAP-Message attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 79 for EAP-Message.
+
+ Length
+
+ >= 3
+
+ String
+
+ The String field contains EAP packets, as defined in [3]. If
+ multiple EAP-Message attributes are present in a packet their
+ values should be concatenated; this allows EAP packets longer than
+ 253 octets to be passed by RADIUS.
+
+5.14. Message-Authenticator
+
+ Description
+
+ This attribute MAY be used to sign Access-Requests to prevent
+ spoofing Access-Requests using CHAP, ARAP or EAP authentication
+ methods. It MAY be used in any Access-Request. It MUST be used
+ in any Access-Request, Access-Accept, Access-Reject or Access-
+ Challenge that includes an EAP-Message attribute.
+
+ A RADIUS Server receiving an Access-Request with a Message-
+ Authenticator Attribute present MUST calculate the correct value
+ of the Message-Authenticator and silently discard the packet if it
+ does not match the value sent.
+
+
+
+
+
+
+Rigney, et al. Informational [Page 33]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ A RADIUS Client receiving an Access-Accept, Access-Reject or
+ Access-Challenge with a Message-Authenticator Attribute present
+ MUST calculate the correct value of the Message-Authenticator and
+ silently discard the packet if it does not match the value sent.
+
+ Earlier drafts of this memo used "Signature" as the name of this
+ attribute, but Message-Authenticator is more precise. Its
+ operation has not changed, just the name.
+
+ A summary of the Message-Authenticator attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 80 for Message-Authenticator
+
+ Length
+
+ 18
+
+ String
+
+ When present in an Access-Request packet, Message-Authenticator is
+ an HMAC-MD5 [9] checksum of the entire Access-Request packet,
+ including Type, ID, Length and authenticator, using the shared
+ secret as the key, as follows.
+
+ Message-Authenticator = HMAC-MD5 (Type, Identifier, Length,
+ Request Authenticator, Attributes)
+
+ When the checksum is calculated the signature string should be
+ considered to be sixteen octets of zero.
+
+ For Access-Challenge, Access-Accept, and Access-Reject packets,
+ the Message-Authenticator is calculated as follows, using the
+ Request-Authenticator from the Access-Request this packet is in
+ reply to:
+
+ Message-Authenticator = HMAC-MD5 (Type, Identifier, Length,
+ Request Authenticator, Attributes)
+
+
+
+
+
+Rigney, et al. Informational [Page 34]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ When the checksum is calculated the signature string should be
+ considered to be sixteen octets of zero. The shared secret is
+ used as the key for the HMAC-MD5 hash. The is calculated and
+ inserted in the packet before the Response Authenticator is
+ calculated.
+
+ This attribute is not needed if the User-Password attribute is
+ present, but is useful for preventing attacks on other types of
+ authentication. This attribute is intended to thwart attempts by
+ an attacker to setup a "rogue" NAS, and perform online dictionary
+ attacks against the RADIUS server. It does not afford protection
+ against "offline" attacks where the attacker intercepts packets
+ containing (for example) CHAP challenge and response, and performs
+ a dictionary attack against those packets offline.
+
+ IP Security will eventually make this attribute unnecessary, so it
+ should be considered an interim measure.
+
+5.15. ARAP-Challenge-Response
+
+ Description
+
+ This attribute is sent in an Access-Accept packet with Framed-
+ Protocol of ARAP, and contains the response to the dial-in
+ client's challenge.
+
+ A summary of the ARAP-Challenge-Response attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 84 for ARAP-Challenge-Response.
+
+ Length
+
+ 10
+
+
+
+
+
+Rigney, et al. Informational [Page 35]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Value
+
+ The Value field contains an 8 octet response to the dial-in
+ client's challenge. The RADIUS server calculates this value by
+ taking the dial-in client's challenge from the high order 8 octets
+ of the ARAP-Password attribute and performing DES encryption on
+ this value with the authenticating user's password as the key. If
+ the user's password is less than 8 octets in length, the password
+ is padded at the end with NULL octets to a length of 8 before
+ using it as a key.
+
+5.16. Acct-Interim-Interval
+
+ Description
+
+ This attribute indicates the number of seconds between each
+ interim update in seconds for this specific session. This value
+ can only appear in the Access-Accept message.
+
+ A summary of the Acct-Interim-Interval attribute format is shown
+ below. The fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 85 for Acct-Interim-Interval.
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field contains the number of seconds between each
+ interim update to be sent from the NAS for this session. The value
+ MUST NOT be smaller than 60. The value SHOULD NOT be smaller than
+ 600, and careful consideration should be given to its impact on
+ network traffic.
+
+
+
+
+
+
+Rigney, et al. Informational [Page 36]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+5.17. NAS-Port-Id
+
+ Description
+
+ This Attribute contains a text string which identifies the port of
+ the NAS which is authenticating the user. It is only used in
+ Access-Request and Accounting-Request packets. Note that this is
+ using "port" in its sense of a physical connection on the NAS, not
+ in the sense of a TCP or UDP port number.
+
+ Either NAS-Port or NAS-Port-Id SHOULD be present in an Access-
+ Request packet, if the NAS differentiates among its ports. NAS-
+ Port-Id is intended for use by NASes which cannot conveniently
+ number their ports.
+
+ A summary of the NAS-Port-Id Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Text...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+
+ Type
+
+ 87 for NAS-Port-Id.
+
+ Length
+
+ >= 3
+
+ Text
+
+ The Text field contains the name of the port using UTF-8 encoded
+ 10646 [8] characters.
+
+5.18. Framed-Pool
+
+ Description
+
+ This Attribute contains the name of an assigned address pool that
+ SHOULD be used to assign an address for the user. If a NAS does
+ not support multiple address pools, the NAS should ignore this
+ Attribute. Address pools are usually used for IP addresses, but
+ can be used for other protocols if the NAS supports pools for
+ those protocols.
+
+
+
+Rigney, et al. Informational [Page 37]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ A summary of the Framed-Pool Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | String...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 88 for Framed-Pool
+
+ Length
+
+ >= 3
+
+ String
+
+ The string field contains the name of an assigned address pool
+ configured on the NAS.
+
+5.19. Table of Attributes
+
+ The following table provides a guide to which attributes may be found
+ in which kind of packets. Acct-Input-Gigawords, Acct-Output-
+ Gigawords, Event-Timestamp, and NAS-Port-Id may have 0-1 instances in
+ an Accounting-Request packet. Connect-Info may have 0+ instances in
+ an Accounting-Request packet. The other attributes added in this
+ document must not be present in an Accounting-Request.
+
+Request Accept Reject Challenge # Attribute
+0-1 0 0 0 70 ARAP-Password [Note 1]
+0 0-1 0 0-1 71 ARAP-Features
+0 0-1 0 0 72 ARAP-Zone-Access
+0-1 0 0 0-1 73 ARAP-Security
+0+ 0 0 0+ 74 ARAP-Security-Data
+0 0 0-1 0 75 Password-Retry
+0 0 0 0-1 76 Prompt
+0-1 0 0 0 77 Connect-Info
+0 0+ 0 0 78 Configuration-Token
+0+ 0+ 0+ 0+ 79 EAP-Message [Note 1]
+0-1 0-1 0-1 0-1 80 Message-Authenticator [Note 1]
+0 0-1 0 0-1 84 ARAP-Challenge-Response
+0 0-1 0 0 85 Acct-Interim-Interval
+0-1 0 0 0 87 NAS-Port-Id
+0 0-1 0 0 88 Framed-Pool
+Request Accept Reject Challenge # Attribute
+
+
+
+Rigney, et al. Informational [Page 38]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ [Note 1] An Access-Request that contains either a User-Password or
+ CHAP-Password or ARAP-Password or one or more EAP-Message attributes
+ MUST NOT contain more than one type of those four attributes. If it
+ does not contain any of those four attributes, it SHOULD contain a
+ Message-Authenticator. If any packet type contains an EAP-Message
+ attribute it MUST also contain a Message-Authenticator.
+
+ The following table defines the above table entries.
+
+ 0 This attribute MUST NOT be present
+ 0+ Zero or more instances of this attribute MAY be present.
+ 0-1 Zero or one instance of this attribute MAY be present.
+ 1 Exactly one instance of this attribute MUST be present.
+
+6. IANA Considerations
+
+ The Packet Type Codes, Attribute Types, and Attribute Values defined
+ in this document are registered by the Internet Assigned Numbers
+ Authority (IANA) from the RADIUS name spaces as described in the
+ "IANA Considerations" section of [1], in accordance with BCP 26 [10].
+
+7. Security Considerations
+
+ The attributes other than Message-Authenticator and EAP-Message in
+ this document have no additional security considerations beyond those
+ already identified in [1].
+
+7.1. Message-Authenticator Security
+
+ Access-Request packets with a User-Password establish the identity of
+ both the user and the NAS sending the Access-Request, because of the
+ way the shared secret between NAS and RADIUS server is used.
+ Access-Request packets with CHAP-Password or EAP-Message do not have
+ a User-Password attribute, so the Message-Authenticator attribute
+ should be used in access-request packets that do not have a User-
+ Password, in order to establish the identity of the NAS sending the
+ request.
+
+7.2. EAP Security
+
+ Since the purpose of EAP is to provide enhanced security for PPP
+ authentication, it is critical that RADIUS support for EAP be secure.
+ In particular, the following issues must be addressed:
+
+ Separation of EAP server and PPP authenticator
+ Connection hijacking
+ Man in the middle attacks
+ Multiple databases
+
+
+
+Rigney, et al. Informational [Page 39]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Negotiation attacks
+
+7.2.1. Separation of EAP server and PPP authenticator
+
+ It is possible for the EAP endpoints to mutually authenticate,
+ negotiate a ciphersuite, and derive a session key for subsequent use
+ in PPP encryption.
+
+ This does not present an issue on the peer, since the peer and EAP
+ client reside on the same machine; all that is required is for the
+ EAP client module to pass the session key to the PPP encryption
+ module.
+
+ The situation is more complex when EAP is used with RADIUS, since the
+ PPP authenticator will typically not reside on the same machine as
+ the EAP server. For example, the EAP server may be a backend security
+ server, or a module residing on the RADIUS server.
+
+ In the case where the EAP server and PPP authenticator reside on
+ different machines, there are several implications for security.
+ Firstly, mutual authentication will occur between the peer and the
+ EAP server, not between the peer and the authenticator. This means
+ that it is not possible for the peer to validate the identity of the
+ NAS or tunnel server that it is speaking to.
+
+ As described earlier, when EAP/RADIUS is used to encapsulate EAP
+ packets, the Message-Authenticator attribute is required in
+ EAP/RADIUS Access-Requests sent from the NAS or tunnel server to the
+ RADIUS server. Since the Message-Authenticator attribute involves a
+ HMAC-MD5 hash, it is possible for the RADIUS server to verify the
+ integrity of the Access-Request as well as the NAS or tunnel server's
+ identity. Similarly, Access-Challenge packets sent from the RADIUS
+ server to the NAS are also authenticated and integrity protected
+ using an HMAC-MD5 hash, enabling the NAS or tunnel server to
+ determine the integrity of the packet and verify the identity of the
+ RADIUS server. Moreover, EAP packets sent via methods that contain
+ their own integrity protection cannot be successfully modified by a
+ rogue NAS or tunnel server.
+
+ The second issue that arises in the case of an EAP server and PPP
+ authenticator residing on different machines is that the session key
+ negotiated between the peer and EAP server will need to be
+ transmitted to the authenticator. Therefore a mechanism needs to be
+ provided to transmit the session key from the EAP server to the
+ authenticator or tunnel server that needs to use the key. The
+ specification of this transit mechanism is outside the scope of this
+ document.
+
+
+
+
+Rigney, et al. Informational [Page 40]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+7.2.2. Connection hijacking
+
+ In this form of attack, the attacker attempts to inject packets into
+ the conversation between the NAS and the RADIUS server, or between
+ the RADIUS server and the backend security server. RADIUS does not
+ support encryption, and as described in [1], only Access-Reply and
+ Access-Challenge packets are integrity protected. Moreover, the
+ integrity protection mechanism described in [1] is weaker than that
+ likely to be used by some EAP methods, making it possible to subvert
+ those methods by attacking EAP/RADIUS.
+
+ In order to provide for authentication of all packets in the EAP
+ exchange, all EAP/RADIUS packets MUST be authenticated using the
+ Message-Authenticator attribute, as described previously.
+
+7.2.3. Man in the middle attacks
+
+ Since RADIUS security is based on shared secrets, end-to-end security
+ is not provided in the case where authentication or accounting
+ packets are forwarded along a proxy chain. As a result, attackers
+ gaining control of a RADIUS proxy will be able to modify EAP packets
+ in transit.
+
+7.2.4. Multiple databases
+
+ In many cases a backend security server will be deployed along with a
+ RADIUS server in order to provide EAP services. Unless the backend
+ security server also functions as a RADIUS server, two separate user
+ databases will exist, each containing information about the security
+ requirements for the user. This represents a weakness, since security
+ may be compromised by a successful attack on either of the servers,
+ or their backend databases. With multiple user databases, adding a
+ new user may require multiple operations, increasing the chances for
+ error. The problems are further magnified in the case where user
+ information is also being kept in an LDAP server. In this case, three
+ stores of user information may exist.
+
+ In order to address these threats, consolidation of databases is
+ recommended. This can be achieved by having both the RADIUS server
+ and backend security server store information in the same backend
+ database; by having the backend security server provide a full RADIUS
+ implementation; or by consolidating both the backend security server
+ and the RADIUS server onto the same machine.
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 41]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+7.2.5. Negotiation attacks
+
+ In a negotiation attack, a rogue NAS, tunnel server, RADIUS proxy or
+ RADIUS server causes the authenticating peer to choose a less secure
+ authentication method so as to make it easier to obtain the user's
+ password. For example, a session that would normally be authenticated
+ with EAP would instead authenticated via CHAP or PAP; alternatively,
+ a connection that would normally be authenticated via one EAP type
+ occurs via a less secure EAP type, such as MD5. The threat posed by
+ rogue devices, once thought to be remote, has gained currency given
+ compromises of telephone company switching systems, such as those
+ described in [11].
+
+ Protection against negotiation attacks requires the elimination of
+ downward negotiations. This can be achieved via implementation of
+ per-connection policy on the part of the authenticating peer, and
+ per-user policy on the part of the RADIUS server.
+
+ For the authenticating peer, authentication policy should be set on a
+ per-connection basis. Per-connection policy allows an authenticating
+ peer to negotiate EAP when calling one service, while negotiating
+ CHAP for another service, even if both services are accessible via
+ the same phone number.
+
+ With per-connection policy, an authenticating peer will only attempt
+ to negotiate EAP for a session in which EAP support is expected. As a
+ result, there is a presumption that an authenticating peer selecting
+ EAP requires that level of security. If it cannot be provided, it is
+ likely that there is some kind of misconfiguration, or even that the
+ authenticating peer is contacting the wrong server. Should the NAS
+ not be able to negotiate EAP, or should the EAP-Request sent by the
+ NAS be of a different EAP type than what is expected, the
+ authenticating peer MUST disconnect. An authenticating peer expecting
+ EAP to be negotiated for a session MUST NOT negotiate CHAP or PAP.
+
+ For a NAS, it may not be possible to determine whether a user is
+ required to authenticate with EAP until the user's identity is known.
+ For example, for shared-uses NASes it is possible for one reseller to
+ implement EAP while another does not. In such cases, if any users of
+ the NAS MUST do EAP, then the NAS MUST attempt to negotiate EAP for
+ every call. This avoids forcing an EAP-capable client to do more than
+ one authentication, which weakens security.
+
+ If CHAP is negotiated, the NAS will pass the User-Name and CHAP-
+ Password attributes to the RADIUS Server in an Access-Request packet.
+ If the user is not required to use EAP, then the RADIUS Server will
+ respond with an Access-Accept or Access-Reject packet as appropriate.
+ However, if CHAP has been negotiated but EAP is required, the RADIUS
+
+
+
+Rigney, et al. Informational [Page 42]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ server MUST respond with an Access-Reject, rather than an Access-
+ Challenge/EAP-Message/EAP-Request packet. The authenticating peer
+ MUST refuse to renegotiate authentication, even if the renegotiation
+ is from CHAP to EAP.
+
+ If EAP is negotiated but is not supported by the RADIUS proxy or
+ server, then the server or proxy MUST respond with an Access-Reject.
+ In these cases, the NAS MUST send an LCP-Terminate and disconnect the
+ user. This is the correct behavior since the authenticating peer is
+ expecting EAP to be negotiated, and that expectation cannot be
+ fulfilled. An EAP-capable authenticating peer MUST refuse to
+ renegotiate the authentication protocol if EAP had initially been
+ negotiated. Note that problems with a non-EAP capable RADIUS proxy
+ could prove difficult to diagnose, since a user dialing in from one
+ location (with an EAP-capable proxy) might be able to successfully
+ authenticate via EAP, while the same user dialing into another
+ location (and encountering an EAP-incapable proxy) might be
+ consistently disconnected.
+
+8. References
+
+ [1] Rigney, C., Willens, S., Rubens, A. and W. Simpson, "Remote
+ Authentication Dial In User Service (RADIUS)", RFC 2865, June
+ 2000.
+
+ [2] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000.
+
+ [3] Blunk, L. and J. Vollbrecht, "PPP Extensible Authentication
+ Protocol (EAP)", RFC 2284, March 1998.
+
+ [4] Bradner, S., "Key words for use in RFCs to Indicate Requirement
+ Levels", BCP 14, RFC 2119, March, 1997.
+
+ [5] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC 1700,
+ October 1994.
+
+ [6] Zorn, G., Leifer, D., Rubens, A., Shriver, J., Holdrege, M. and
+ I. Goyret, "RADIUS Attributes for Tunnel Protocol Support", RFC
+ 2868, June 2000.
+
+ [7] Zorn, G., Aboba, B. and D. Mitton, "RADIUS Accounting
+ Modifications for Tunnel Protocol Support", RFC 2867, June 2000.
+
+ [8] Yergeau, F., "UTF-8, a transformation format of ISO 10646", RFC
+ 2279, January 1998.
+
+
+
+
+
+
+Rigney, et al. Informational [Page 43]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ [9] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-Hashing
+ for Message Authentication", RFC 2104, February 1997.
+
+ [10] Alvestrand, H. and T. Narten, "Guidelines for Writing an IANA
+ Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.
+
+ [11] Slatalla, M., and Quittner, J., "Masters of Deception."
+ HarperCollins, New York, 1995.
+
+9. Acknowledgements
+
+ RADIUS and RADIUS Accounting were originally developed by Livingston
+ Enterprises (now part of Lucent Technologies) for their PortMaster
+ series of Network Access Servers.
+
+ The section on ARAP is adopted with permission from "Using RADIUS to
+ Authenticate Apple Remote Access Connections" by Ward Willats of Cyno
+ Technologies (ward@cyno.com).
+
+ The section on Acct-Interim-Interval is adopted with permission from
+ an earlier work in progress by Pat Calhoun of Sun Microsystems, Mark
+ Beadles of Compuserve, and Alex Ratcliffe of UUNET Technologies.
+
+ The section on EAP is adopted with permission from an earlier work in
+ progress by Pat Calhoun of Sun Microsystems, Allan Rubens of Merit
+ Network, and Bernard Aboba of Microsoft. Thanks also to Dave Dawson
+ and Karl Fox of Ascend, and Glen Zorn and Narendra Gidwani of
+ Microsoft for useful discussions of this problem space.
+
+10. Chair's Address
+
+ The RADIUS working group can be contacted via the current chair:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ Phone: +1 925 737 2100
+ EMail: cdr@telemancy.com
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 44]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+11. Authors' Addresses
+
+ Questions about this memo can also be directed to:
+
+ Carl Rigney
+ Livingston Enterprises
+ 4464 Willow Road
+ Pleasanton, California 94588
+
+ EMail: cdr@telemancy.com
+
+ Questions on ARAP and RADIUS may be directed to:
+
+ Ward Willats
+ Cyno Technologies
+ 1082 Glen Echo Ave
+ San Jose, CA 95125
+
+ Phone: +1 408 297 7766
+ EMail: ward@cyno.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 45]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+ Questions on EAP and RADIUS may be directed to any of the following:
+
+ Pat R. Calhoun
+ Network and Security Research Center
+ Sun Microsystems, Inc.
+ 15 Network Circle
+ Menlo Park, CA 94025
+
+ Phone: +1 650 786 7733
+ EMail: pcalhoun@eng.sun.com
+
+
+ Allan C. Rubens
+ Tut Systems, Inc.
+ 220 E. Huron, Suite 260
+ Ann Arbor, MI 48104
+
+ Phone: +1 734 995 1697
+ EMail: arubens@tutsys.com
+
+
+ Bernard Aboba
+ Microsoft Corporation
+ One Microsoft Way
+ Redmond, WA 98052
+
+ Phone: +1 425 936 6605
+ EMail: bernarda@microsoft.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 46]
+
+RFC 2869 RADIUS Extensions June 2000
+
+
+12. Full Copyright Statement
+
+ Copyright (C) The Internet Society (2000). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assigns.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+Acknowledgement
+
+ Funding for the RFC Editor function is currently provided by the
+ Internet Society.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigney, et al. Informational [Page 47]
+
diff --git a/doc/rfc3078.txt b/rfc/rfc3078.txt
index 5bbcc13..5bbcc13 100644
--- a/doc/rfc3078.txt
+++ b/rfc/rfc3078.txt
diff --git a/rfc/rfc3079.txt b/rfc/rfc3079.txt
new file mode 100644
index 0000000..4d7ba0d
--- /dev/null
+++ b/rfc/rfc3079.txt
@@ -0,0 +1,1179 @@
+
+
+
+
+
+
+Network Working Group G. Zorn
+Request for Comments: 3079 cisco Systems
+Category: Informational March 2001
+
+
+ Deriving Keys for use with Microsoft Point-to-Point Encryption (MPPE)
+
+Status of this Memo
+
+ This memo provides information for the Internet community. It does
+ not specify an Internet standard of any kind. Distribution of this
+ memo is unlimited.
+
+Copyright Notice
+
+ Copyright (C) The Internet Society (2001). All Rights Reserved.
+
+Abstract
+
+ The Point-to-Point Protocol (PPP) provides a standard method for
+ transporting multi-protocol datagrams over point-to-point links.
+
+ The PPP Compression Control Protocol provides a method to negotiate
+ and utilize compression protocols over PPP encapsulated links.
+
+ Microsoft Point to Point Encryption (MPPE) is a means of representing
+ PPP packets in an encrypted form. MPPE uses the RSA RC4 algorithm to
+ provide data confidentiality. The length of the session key to be
+ used for initializing encryption tables can be negotiated. MPPE
+ currently supports 40-bit, 56-bit and 128-bit session keys. MPPE
+ session keys are changed frequently; the exact frequency depends upon
+ the options negotiated, but may be every packet. MPPE is negotiated
+ within option 18 in the Compression Control Protocol.
+
+ This document describes the method used to derive initial MPPE
+ session keys from a variety of credential types. It is expected that
+ this memo will be updated whenever Microsoft defines a new key
+ derivation method for MPPE, since its primary purpose is to provide
+ an open, easily accessible reference for third-parties wishing to
+ interoperate with Microsoft products.
+
+ MPPE itself (including the protocol used to negotiate its use, the
+ details of the encryption method used and the algorithm used to
+ change session keys during a session) is described in RFC 3078.
+
+
+
+
+
+
+
+Zorn Informational [Page 1]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+Table of Contents
+
+ 1. Specification of Requirements ............................... 2
+ 2. Deriving Session Keys from MS-CHAP Credentials .............. 2
+ 2.1. Generating 40-bit Session Keys ............................ 3
+ 2.2. Generating 56-bit Session Keys ............................ 3
+ 2.3. Generating 128-bit Session Keys ........................... 4
+ 2.4. Key Derivation Functions .................................. 5
+ 2.5. Sample Key Derivations .................................... 6
+ 2.5.1. Sample 40-bit Key Derivation ............................ 6
+ 2.5.2. Sample 56-bit Key Derivation ............................ 6
+ 2.5.3. Sample 128-bit Key Derivation ........................... 7
+ 3. Deriving Session Keys from MS-CHAP-2 Credentials ............ 7
+ 3.1. Generating 40-bit Session Keys ............................ 8
+ 3.2. Generating 56-bit Session Keys ............................ 9
+ 3.3. Generating 128-bit Session Keys ...........................10
+ 3.4. Key Derivation Functions ..................................11
+ 3.5. Sample Key Derivations ....................................13
+ 3.5.1. Sample 40-bit Key Derivation ............................13
+ 3.5.2. Sample 56-bit Key Derivation ............................14
+ 3.5.3. Sample 128-bit Key Derivation ...........................15
+ 4. Deriving MPPE Session Keys from TLS Session Keys ............16
+ 4.1. Generating 40-bit Session Keys ............................16
+ 4.2. Generating 56-bit Session Keys ............................17
+ 4.3. Generating 128-bit Session Keys ...........................17
+ 5. Security Considerations .....................................18
+ 5.1. MS-CHAP Credentials .......................................18
+ 5.2. EAP-TLS Credentials .......................................19
+ 6. References ..................................................19
+ 7. Acknowledgements ............................................20
+ 8. Author's Address ............................................20
+ 9. Full Copyright Statement ....................................21
+
+1. Specification of Requirements
+
+ In this document, the key words "MAY", "MUST, "MUST NOT", "optional",
+ "recommended", "SHOULD", and "SHOULD NOT" are to be interpreted as
+ described in [6].
+
+2. Deriving Session Keys from MS-CHAP Credentials
+
+ The Microsoft Challenge-Handshake Authentication Protocol (MS-CHAP-1)
+ [2] is a Microsoft-proprietary PPP [1] authentication protocol,
+ providing the functionality to which LAN-based users are accustomed
+ while integrating the encryption and hashing algorithms used on
+ Windows networks.
+
+
+
+
+
+Zorn Informational [Page 2]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+ The following sections detail the methods used to derive initial
+ session keys (40-, 56- and 128-bit) from MS-CHAP-1 credentials.
+
+ Implementation Note
+
+ The initial session key in both directions is derived from the
+ credentials of the peer that initiated the call and the challenge
+ used (if any) is the challenge from the first authentication.
+ This is true for both unilateral and bilateral authentication, as
+ well as for each link in a multilink bundle. In the multi-chassis
+ multilink case, implementations are responsible for ensuring that
+ the correct keys are generated on all participating machines.
+
+2.1. Generating 40-bit Session Keys
+
+ MPPE uses a derivative of the peer's LAN Manager password as the 40-
+ bit session key used for initializing the RC4 encryption tables.
+
+ The first step is to obfuscate the peer's password using the
+ LmPasswordHash() function (described in [2]). The first 8 octets of
+ the result are used as the basis for the session key generated in the
+ following way:
+
+/*
+* PasswordHash is the basis for the session key
+* SessionKey is a copy of PasswordHash and is the generative session key
+* 8 is the length (in octets) of the key to be generated.
+*
+*/
+Get_Key(PasswordHash, SessionKey, 8)
+
+/*
+* The effective length of the key is reduced to 40 bits by
+* replacing the first three bytes as follows:
+*/
+SessionKey[0] = 0xd1 ;
+SessionKey[1] = 0x26 ;
+SessionKey[2] = 0x9e ;
+
+2.2. Generating 56-bit Session Keys
+
+ MPPE uses a derivative of the peer's LAN Manager password as the 56-
+ bit session key used for initializing the RC4 encryption tables.
+
+ The first step is to obfuscate the peer's password using the
+ LmPasswordHash() function (described in [2]). The first 8 octets of
+ the result are used as the basis for the session key generated in the
+ following way:
+
+
+
+Zorn Informational [Page 3]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+/*
+* PasswordHash is the basis for the session key
+* SessionKey is a copy of PasswordHash and is the generative session key
+* 8 is the length (in octets) of the key to be generated.
+*
+*/
+Get_Key(PasswordHash, SessionKey, 8)
+
+/*
+* The effective length of the key is reduced to 56 bits by
+* replacing the first byte as follows:
+*/
+SessionKey[0] = 0xd1 ;
+
+2.3. Generating 128-bit Session Keys
+
+ MPPE uses a derivative of the peer's Windows NT password as the 128-
+ bit session key used for initializing encryption tables.
+
+ The first step is to obfuscate the peer's password using
+ NtPasswordHash() function as described in [2]. The first 16 octets
+ of the result are then hashed again using the MD4 algorithm. The
+ first 16 octets of the second hash are used as the basis for the
+ session key generated in the following way:
+
+/*
+* Challenge (as described in [9]) is sent by the PPP authenticator
+* during authentication and is 8 octets long.
+* NtPasswordHashHash is the basis for the session key.
+* On return, InitialSessionKey contains the initial session
+* key to be used.
+*/
+Get_Start_Key(Challenge, NtPasswordHashHash, InitialSessionKey)
+
+/*
+* CurrentSessionKey is a copy of InitialSessionKey
+* and is the generative session key.
+* Length (in octets) of the key to generate is 16.
+*
+*/
+Get_Key(InitialSessionKey, CurrentSessionKey, 16)
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 4]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+2.4. Key Derivation Functions
+
+ The following procedures are used to derive the session key.
+
+/*
+ * Pads used in key derivation
+ */
+
+SHApad1[40] =
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+SHApad2[40] =
+ {0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2,
+ 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2,
+ 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2,
+ 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2};
+
+/*
+ * SHAInit(), SHAUpdate() and SHAFinal() functions are an
+ * implementation of Secure Hash Algorithm (SHA-1) [7]. These are
+ * available in public domain or can be licensed from
+ * RSA Data Security, Inc.
+ *
+ * 1) InitialSessionKey is 8 octets long for 56- and 40-bit
+ * session keys, 16 octets long for 128 bit session keys.
+ * 2) CurrentSessionKey is same as InitialSessionKey when this
+ * routine is called for the first time for the session.
+ */
+
+Get_Key(
+IN InitialSessionKey,
+IN/OUT CurrentSessionKey
+IN LengthOfDesiredKey )
+{
+ SHAInit(Context)
+ SHAUpdate(Context, InitialSessionKey, LengthOfDesiredKey)
+ SHAUpdate(Context, SHAPad1, 40)
+ SHAUpdate(Context, CurrentSessionKey, LengthOfDesiredKey)
+ SHAUpdate(Context, SHAPad2, 40)
+ SHAFinal(Context, Digest)
+ memcpy(CurrentSessionKey, Digest, LengthOfDesiredKey)
+}
+
+Get_Start_Key(
+IN Challenge,
+
+
+
+Zorn Informational [Page 5]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+IN NtPasswordHashHash,
+OUT InitialSessionKey)
+{
+ SHAInit(Context)
+ SHAUpdate(Context, NtPasswordHashHash, 16)
+ SHAUpdate(Context, NtPasswordHashHash, 16)
+ SHAUpdate(Context, Challenge, 8)
+ SHAFinal(Context, Digest)
+ memcpy(InitialSessionKey, Digest, 16)
+}
+
+2.5. Sample Key Derivations
+
+ The following sections illustrate 40-, 56- and 128-bit key
+ derivations. All intermediate values are in hexadecimal.
+
+2.5.1. Sample 40-bit Key Derivation
+
+
+ Initial Values
+ Password = "clientPass"
+
+ Step 1: LmPasswordHash(Password, PasswordHash)
+ PasswordHash = 76 a1 52 93 60 96 d7 83 0e 23 90 22 74 04 af d2
+
+ Step 2: Copy PasswordHash to SessionKey
+ SessionKey = 76 a1 52 93 60 96 d7 83 0e 23 90 22 74 04 af d2
+
+ Step 3: GetKey(PasswordHash, SessionKey, 8)
+ SessionKey = d8 08 01 53 8c ec 4a 08
+
+ Step 4: Reduce the effective key length to 40 bits
+ SessionKey = d1 26 9e 53 8c ec 4a 08
+
+2.5.2. Sample 56-bit Key Derivation
+
+ Initial Values
+ Password = "clientPass"
+
+ Step 1: LmPasswordHash(Password, PasswordHash)
+ PasswordHash = 76 a1 52 93 60 96 d7 83 0e 23 90 22 74 04 af d2
+
+ Step 2: Copy PasswordHash to SessionKey
+ SessionKey = 76 a1 52 93 60 96 d7 83 0e 23 90 22 74 04 af d2
+
+ Step 3: GetKey(PasswordHash, SessionKey, 8)
+ SessionKey = d8 08 01 53 8c ec 4a 08
+
+
+
+
+Zorn Informational [Page 6]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+ Step 4: Reduce the effective key length to 56 bits
+ SessionKey = d1 08 01 53 8c ec 4a 08
+
+2.5.3. Sample 128-bit Key Derivation
+
+Initial Values
+ Password = "clientPass"
+ Challenge = 10 2d b5 df 08 5d 30 41
+
+Step 1: NtPasswordHash(Password, PasswordHash)
+ PasswordHash = 44 eb ba 8d 53 12 b8 d6 11 47 44 11 f5 69 89 ae
+
+Step 2: PasswordHashHash = MD4(PasswordHash)
+ PasswordHashHash = 41 c0 0c 58 4b d2 d9 1c 40 17 a2 a1 2f a5 9f 3f
+
+Step 3: GetStartKey(Challenge, PasswordHashHash, InitialSessionKey)
+ InitialSessionKey = a8 94 78 50 cf c0 ac ca d1 78 9f b6 2d dc dd b0
+
+Step 4: Copy InitialSessionKey to CurrentSessionKey
+ CurrentSessionKey = a8 94 78 50 cf c0 ac c1 d1 78 9f b6 2d dc dd b0
+
+Step 5: GetKey(InitialSessionKey, CurrentSessionKey, 16)
+ CurrentSessionKey = 59 d1 59 bc 09 f7 6f 1d a2 a8 6a 28 ff ec 0b 1e
+
+3. Deriving Session Keys from MS-CHAP-2 Credentials
+
+ Version 2 of the Microsoft Challenge-Handshake Authentication
+ Protocol (MS-CHAP-2) [8] is a Microsoft-proprietary PPP
+ authentication protocol, providing the functionality to which LAN-
+ based users are accustomed while integrating the encryption and
+ hashing algorithms used on Windows networks.
+
+ The following sections detail the methods used to derive initial
+ session keys from MS-CHAP-2 credentials. 40-, 56- and 128-bit keys
+ are all derived using the same algorithm from the authenticating
+ peer's Windows NT password. The only difference is in the length of
+ the keys and their effective strength: 40- and 56-bit keys are 8
+ octets in length, while 128-bit keys are 16 octets long. Separate
+ keys are derived for the send and receive directions of the session.
+
+ Implementation Note
+
+ The initial session keys in both directions are derived from the
+ credentials of the peer that initiated the call and the challenges
+ used are those from the first authentication. This is true as
+ well for each link in a multilink bundle. In the multi-chassis
+ multilink case, implementations are responsible for ensuring that
+ the correct keys are generated on all participating machines.
+
+
+
+Zorn Informational [Page 7]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+3.1. Generating 40-bit Session Keys
+
+ When used in conjunction with MS-CHAP-2 authentication, the initial
+ MPPE session keys are derived from the peer's Windows NT password.
+
+ The first step is to obfuscate the peer's password using
+ NtPasswordHash() function as described in [8].
+
+ NtPasswordHash(Password, PasswordHash)
+
+ The first 16 octets of the result are then hashed again using the MD4
+ algorithm.
+
+ PasswordHashHash = md4(PasswordHash)
+
+ The first 16 octets of this second hash are used together with the
+ NT- Response field from the MS-CHAP-2 Response packet [8] as the
+ basis for the master session key:
+
+ GetMasterKey(PasswordHashHash, NtResponse, MasterKey)
+
+ Once the master key has been generated, it is used to derive two 40-
+ bit session keys, one for sending and one for receiving:
+
+ GetAsymmetricStartKey(MasterKey, MasterSendKey, 8, TRUE, TRUE)
+ GetAsymmetricStartKey(MasterKey, MasterReceiveKey, 8, FALSE, TRUE)
+
+ The master session keys are never used to encrypt or decrypt data;
+ they are only used in the derivation of transient session keys. The
+ initial transient session keys are obtained by calling the function
+ GetNewKeyFromSHA() (described in [3]):
+
+GetNewKeyFromSHA(MasterSendKey, MasterSendKey, 8, SendSessionKey)
+GetNewKeyFromSHA(MasterReceiveKey, MasterReceiveKey, 8,
+ ReceiveSessionKey)
+
+ Next, the effective strength of both keys is reduced by setting the
+ first three octets to known constants:
+
+ SendSessionKey[0] = ReceiveSessionKey[0] = 0xd1
+ SendSessionKey[1] = ReceiveSessionKey[1] = 0x26
+ SendSessionKey[2] = ReceiveSessionKey[2] = 0x9e
+
+ Finally, the RC4 tables are initialized using the new session keys:
+
+ rc4_key(SendRC4key, 8, SendSessionKey)
+ rc4_key(ReceiveRC4key, 8, ReceiveSessionKey)
+
+
+
+
+Zorn Informational [Page 8]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+3.2. Generating 56-bit Session Keys
+
+ When used in conjunction with MS-CHAP-2 authentication, the initial
+ MPPE session keys are derived from the peer's Windows NT password.
+
+ The first step is to obfuscate the peer's password using
+ NtPasswordHash() function as described in [8].
+
+ NtPasswordHash(Password, PasswordHash)
+
+ The first 16 octets of the result are then hashed again using the MD4
+ algorithm.
+
+ PasswordHashHash = md4(PasswordHash)
+
+ The first 16 octets of this second hash are used together with the
+ NT-Response field from the MS-CHAP-2 Response packet [8] as the basis
+ for the master session key:
+
+ GetMasterKey(PasswordHashHash, NtResponse, MasterKey)
+
+ Once the master key has been generated, it is used to derive two
+ 56-bit session keys, one for sending and one for receiving:
+
+ GetAsymmetricStartKey(MasterKey, MasterSendKey, 8, TRUE, TRUE)
+ GetAsymmetricStartKey(MasterKey, MasterReceiveKey, 8, FALSE, TRUE)
+
+ The master session keys are never used to encrypt or decrypt data;
+ they are only used in the derivation of transient session keys. The
+ initial transient session keys are obtained by calling the function
+ GetNewKeyFromSHA() (described in [3]):
+
+GetNewKeyFromSHA(MasterSendKey, MasterSendKey, 8, SendSessionKey)
+GetNewKeyFromSHA(MasterReceiveKey, MasterReceiveKey, 8,
+ ReceiveSessionKey)
+
+ Next, the effective strength of both keys is reduced by setting the
+ first octet to a known constant:
+
+ SendSessionKey[0] = ReceiveSessionKey[0] = 0xd1
+
+ Finally, the RC4 tables are initialized using the new session keys:
+
+ rc4_key(SendRC4key, 8, SendSessionKey)
+ rc4_key(ReceiveRC4key, 8, ReceiveSessionKey)
+
+
+
+
+
+
+Zorn Informational [Page 9]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+3.3. Generating 128-bit Session Keys
+
+ When used in conjunction with MS-CHAP-2 authentication, the initial
+ MPPE session keys are derived from the peer's Windows NT password.
+
+ The first step is to obfuscate the peer's password using
+ NtPasswordHash() function as described in [8].
+
+ NtPasswordHash(Password, PasswordHash)
+
+ The first 16 octets of the result are then hashed again using the MD4
+ algorithm.
+
+ PasswordHashHash = md4(PasswordHash)
+
+ The first 16 octets of this second hash are used together with the
+ NT-Response field from the MS-CHAP-2 Response packet [8] as the basis
+ for the master session key:
+
+ GetMasterKey(PasswordHashHash, NtResponse, MasterKey)
+
+ Once the master key has been generated, it is used to derive two
+ 128-bit master session keys, one for sending and one for receiving:
+
+GetAsymmetricStartKey(MasterKey, MasterSendKey, 16, TRUE, TRUE)
+GetAsymmetricStartKey(MasterKey, MasterReceiveKey, 16, FALSE, TRUE)
+
+ The master session keys are never used to encrypt or decrypt data;
+ they are only used in the derivation of transient session keys. The
+ initial transient session keys are obtained by calling the function
+ GetNewKeyFromSHA() (described in [3]):
+
+GetNewKeyFromSHA(MasterSendKey, MasterSendKey, 16, SendSessionKey)
+GetNewKeyFromSHA(MasterReceiveKey, MasterReceiveKey, 16,
+ ReceiveSessionKey)
+
+ Finally, the RC4 tables are initialized using the new session keys:
+
+ rc4_key(SendRC4key, 16, SendSessionKey)
+ rc4_key(ReceiveRC4key, 16, ReceiveSessionKey)
+
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 10]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+3.4. Key Derivation Functions
+
+ The following procedures are used to derive the session key.
+
+/*
+ * Pads used in key derivation
+ */
+
+SHSpad1[40] =
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+SHSpad2[40] =
+ {0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2,
+ 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2,
+ 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2,
+ 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2};
+
+/*
+ * "Magic" constants used in key derivations
+ */
+
+Magic1[27] =
+ {0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74,
+ 0x68, 0x65, 0x20, 0x4d, 0x50, 0x50, 0x45, 0x20, 0x4d,
+ 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x4b, 0x65, 0x79};
+
+Magic2[84] =
+ {0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68,
+ 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x6b, 0x65, 0x79,
+ 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73,
+ 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x69, 0x64, 0x65,
+ 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68,
+ 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20,
+ 0x6b, 0x65, 0x79, 0x2e};
+
+Magic3[84] =
+ {0x4f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x20, 0x73, 0x69, 0x64, 0x65, 0x2c, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68,
+ 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x20,
+ 0x6b, 0x65, 0x79, 0x3b, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68,
+ 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73,
+ 0x69, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73,
+
+
+
+Zorn Informational [Page 11]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+ 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20,
+ 0x6b, 0x65, 0x79, 0x2e};
+
+
+ GetMasterKey(
+ IN 16-octet PasswordHashHash,
+ IN 24-octet NTResponse,
+ OUT 16-octet MasterKey )
+ {
+ 20-octet Digest
+
+ ZeroMemory(Digest, sizeof(Digest));
+
+ /*
+ * SHSInit(), SHSUpdate() and SHSFinal()
+ * are an implementation of the Secure Hash Standard [7].
+ */
+
+ SHSInit(Context);
+ SHSUpdate(Context, PasswordHashHash, 16);
+ SHSUpdate(Context, NTResponse, 24);
+ SHSUpdate(Context, Magic1, 27);
+ SHSFinal(Context, Digest);
+
+ MoveMemory(MasterKey, Digest, 16);
+ }
+
+ VOID
+ GetAsymetricStartKey(
+ IN 16-octet MasterKey,
+ OUT 8-to-16 octet SessionKey,
+ IN INTEGER SessionKeyLength,
+ IN BOOLEAN IsSend,
+ IN BOOLEAN IsServer )
+ {
+
+ 20-octet Digest;
+
+ ZeroMemory(Digest, 20);
+
+ if (IsSend) {
+ if (IsServer) {
+ s = Magic3
+ } else {
+ s = Magic2
+ }
+ } else {
+ if (IsServer) {
+
+
+
+Zorn Informational [Page 12]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+ s = Magic2
+ } else {
+ s = Magic3
+ }
+ }
+
+ /*
+ * SHSInit(), SHSUpdate() and SHSFinal()
+ * are an implementation of the Secure Hash Standard [7].
+ */
+
+ SHSInit(Context);
+ SHSUpdate(Context, MasterKey, 16);
+ SHSUpdate(Context, SHSpad1, 40);
+ SHSUpdate(Context, s, 84);
+ SHSUpdate(Context, SHSpad2, 40);
+ SHSFinal(Context, Digest);
+
+ MoveMemory(SessionKey, Digest, SessionKeyLength);
+ }
+
+3.5. Sample Key Derivations
+
+ The following sections illustrate 40-, 56- and 128-bit key
+ derivations. All intermediate values are in hexadecimal.
+
+3.5.1. Sample 40-bit Key Derivation
+
+Initial Values
+ UserName = "User"
+ = 55 73 65 72
+
+ Password = "clientPass"
+ = 63 00 6C 00 69 00 65 00 6E 00
+ 74 00 50 00 61 00 73 00 73 00
+
+ AuthenticatorChallenge = 5B 5D 7C 7D 7B 3F 2F 3E 3C 2C
+ 60 21 32 26 26 28
+ PeerChallenge = 21 40 23 24 25 5E 26 2A 28 29 5F 2B 3A 33 7C 7E
+
+ Challenge = D0 2E 43 86 BC E9 12 26
+
+ NT-Response =
+ 82 30 9E CD 8D 70 8B 5E A0 8F AA 39 81 CD 83 54 42 33
+ 11 4A 3D 85 D6 DF
+
+Step 1: NtPasswordHash(Password, PasswordHash)
+ PasswordHash = 44 EB BA 8D 53 12 B8 D6 11 47 44 11 F5 69 89 AE
+
+
+
+Zorn Informational [Page 13]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+Step 2: PasswordHashHash = MD4(PasswordHash)
+ PasswordHashHash = 41 C0 0C 58 4B D2 D9 1C 40 17 A2 A1 2F A5 9F 3F
+
+Step 3: Derive the master key (GetMasterKey())
+ MasterKey = FD EC E3 71 7A 8C 83 8C B3 88 E5 27 AE 3C DD 31
+
+Step 4: Derive the master send session key (GetAsymmetricStartKey())
+ SendStartKey40 = 8B 7C DC 14 9B 99 3A 1B
+
+Step 5: Derive the initial send session key (GetNewKeyFromSHA())
+ SendSessionKey40 = D1 26 9E C4 9F A6 2E 3E
+
+Sample Encrypted Message
+ rc4(SendSessionKey40, "test message") = 92 91 37 91 7E 58 03 D6
+ 68 D7 58 98
+
+3.5.2. Sample 56-bit Key Derivation
+
+Initial Values
+ UserName = "User"
+ = 55 73 65 72
+
+ Password = "clientPass"
+ = 63 00 6C 00 69 00 65 00 6E 00 74 00 50
+ 00 61 00 73 00 73 00
+
+ AuthenticatorChallenge = 5B 5D 7C 7D 7B 3F 2F 3E 3C 2C
+ 60 21 32 26 26 28
+ PeerChallenge = 21 40 23 24 25 5E 26 2A 28 29 5F 2B 3A 33 7C 7E
+
+ Challenge = D0 2E 43 86 BC E9 12 26
+
+ NT-Response =
+ 82 30 9E CD 8D 70 8B 5E A0 8F AA 39 81 CD 83 54 42 33
+ 11 4A 3D 85 D6 DF
+
+Step 1: NtPasswordHash(Password, PasswordHash)
+ PasswordHash = 44 EB BA 8D 53 12 B8 D6 11 47 44 11 F5 69 89 AE
+
+Step 2: PasswordHashHash = MD4(PasswordHash)
+ PasswordHashHash = 41 C0 0C 58 4B D2 D9 1C 40 17 A2 A1 2F A5 9F 3F
+
+Step 3: Derive the master key (GetMasterKey())
+ MasterKey = FD EC E3 71 7A 8C 83 8C B3 88 E5 27 AE 3C DD 31
+
+Step 4: Derive the master send session key (GetAsymmetricStartKey())
+ SendStartKey56 = 8B 7C DC 14 9B 99 3A 1B
+
+
+
+
+Zorn Informational [Page 14]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+Step 5: Derive the initial send session key (GetNewKeyFromSHA())
+ SendSessionKey56 = D1 5C 00 C4 9F A6 2E 3E
+
+Sample Encrypted Message
+ rc4(SendSessionKey40, "test message") = 3F 10 68 33 FA 44 8D
+ A8 42 BC 57 58
+
+3.5.3. Sample 128-bit Key Derivation
+
+Initial Values
+ UserName = "User"
+ = 55 73 65 72
+
+ Password = "clientPass"
+ = 63 00 6C 00 69 00 65 00 6E 00
+ 74 00 50 00 61 00 73 00 73 00
+
+ AuthenticatorChallenge = 5B 5D 7C 7D 7B 3F 2F 3E 3C 2C
+ 60 21 32 26 26 28
+
+ PeerChallenge = 21 40 23 24 25 5E 26 2A 28 29 5F 2B 3A 33 7C 7E
+
+ Challenge = D0 2E 43 86 BC E9 12 26
+
+ NT-Response =
+ 82 30 9E CD 8D 70 8B 5E A0 8F AA 39 81 CD 83 54 42 33
+ 11 4A 3D 85 D6 DF
+
+Step 1: NtPasswordHash(Password, PasswordHash)
+ PasswordHash = 44 EB BA 8D 53 12 B8 D6 11 47 44 11 F5 69 89 AE
+
+Step 2: PasswordHashHash = MD4(PasswordHash)
+ PasswordHashHash = 41 C0 0C 58 4B D2 D9 1C 40 17 A2 A1 2F A5 9F 3F
+
+Step 2: Derive the master key (GetMasterKey())
+ MasterKey = FD EC E3 71 7A 8C 83 8C B3 88 E5 27 AE 3C DD 31
+
+Step 3: Derive the send master session key (GetAsymmetricStartKey())
+
+ SendStartKey128 = 8B 7C DC 14 9B 99 3A 1B A1 18 CB 15 3F 56 DC CB
+
+Step 4: Derive the initial send session key (GetNewKeyFromSHA())
+ SendSessionKey128 = 40 5C B2 24 7A 79 56 E6 E2 11 00 7A E2 7B 22 D4
+
+Sample Encrypted Message
+ rc4(SendSessionKey128, "test message") = 81 84 83 17 DF 68
+ 84 62 72 FB 5A BE
+
+
+
+
+Zorn Informational [Page 15]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+4. Deriving MPPE Session Keys from TLS Session Keys
+
+ The Extensible Authentication Protocol (EAP) [10] is a PPP extension
+ that provides support for additional authentication methods within
+ PPP. Transport Level Security (TLS) [11] provides for mutual
+ authentication, integrity-protected ciphersuite negotiation and key
+ exchange between two endpoints. EAP-TLS [12] is an EAP
+ authentication type which allows the use of TLS within the PPP
+ authentication framework. The following sections describe the
+ methods used to derive initial session keys from TLS session keys.
+ 56-, 40- and 128-bit keys are derived using the same algorithm. The
+ only difference is in the length of the keys and their effective
+ strength: 56- and 40-bit keys are 8 octets in length, while 128-bit
+ keys are 16 octets long. Separate keys are derived for the send and
+ receive directions of the session.
+
+4.1. Generating 40-bit Session Keys
+
+ When MPPE is used in conjunction with EAP-TLS authentication, the TLS
+ master secret is used as the master session key.
+
+ The algorithm used to derive asymmetrical master session keys from
+ the TLS master secret is described in [12]. The master session keys
+ are never used to encrypt or decrypt data; they are only used in the
+ derivation of transient session keys.
+
+ Implementation Note
+
+ If the asymmetrical master keys are less than 8 octets in length,
+ they MUST be padded on the left with zeroes before being used to
+ derive the initial transient session keys. Conversely, if the
+ asymmetrical master keys are more than 8 octets in length, they
+ must be truncated to 8 octets before being used to derive the
+ initial transient session keys.
+
+ The initial transient session keys are obtained by calling the
+ function GetNewKeyFromSHA() (described in [3]):
+
+GetNewKeyFromSHA(MasterSendKey, MasterSendKey, 8, SendSessionKey)
+GetNewKeyFromSHA(MasterReceiveKey, MasterReceiveKey, 8,
+ReceiveSessionKey)
+
+ Next, the effective strength of both keys is reduced by setting the
+ first three octets to known constants:
+
+ SendSessionKey[0] = ReceiveSessionKey[0] = 0xD1
+ SendSessionKey[1] = ReceiveSessionKey[1] = 0x26
+ SendSessionKey[2] = ReceiveSessionKey[2] = 0x9E
+
+
+
+Zorn Informational [Page 16]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+ Finally, the RC4 tables are initialized using the new session keys:
+
+ rc4_key(SendRC4key, 8, SendSessionKey)
+ rc4_key(ReceiveRC4key, 8, ReceiveSessionKey)
+
+4.2. Generating 56-bit Session Keys
+
+ When MPPE is used in conjunction with EAP-TLS authentication, the TLS
+ master secret is used as the master session key.
+
+ The algorithm used to derive asymmetrical master session keys from
+ the TLS master secret is described in [12]. The master session keys
+ are never used to encrypt or decrypt data; they are only used in the
+ derivation of transient session keys.
+
+ Implementation Note
+
+ If the asymmetrical master keys are less than 8 octets in length,
+ they MUST be padded on the left with zeroes before being used to
+ derive the initial transient session keys. Conversely, if the
+ asymmetrical master keys are more than 8 octets in length, they
+ must be truncated to 8 octets before being used to derive the
+ initial transient session keys.
+
+ The initial transient session keys are obtained by calling the
+ function GetNewKeyFromSHA() (described in [3]):
+
+GetNewKeyFromSHA(MasterSendKey, MasterSendKey, 8, SendSessionKey)
+GetNewKeyFromSHA(MasterReceiveKey, MasterReceiveKey, 8,
+ReceiveSessionKey)
+
+ Next, the effective strength of both keys is reduced by setting the
+ initial octet to a known constant:
+
+ SendSessionKey[0] = ReceiveSessionKey[0] = 0xD1
+
+ Finally, the RC4 tables are initialized using the new session keys:
+
+ rc4_key(SendRC4key, 8, SendSessionKey)
+ rc4_key(ReceiveRC4key, 8, ReceiveSessionKey)
+
+4.3. Generating 128-bit Session Keys
+
+ When MPPE is used in conjunction with EAP-TLS authentication, the TLS
+ master secret is used as the master session key.
+
+
+
+
+
+
+Zorn Informational [Page 17]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+ The algorithm used to derive asymmetrical master session keys from
+ the TLS master secret is described in [12]. Note that the send key
+ on one side is the receive key on the other.
+
+ The master session keys are never used to encrypt or decrypt data;
+ they are only used in the derivation of transient session keys.
+
+ Implementation Note
+
+ If the asymmetrical master keys are less than 16 octets in length,
+ they MUST be padded on the left with zeroes before being used to
+ derive the initial transient session keys. Conversely, if the
+ asymmetrical master keys are more than 16 octets in length, they
+ must be truncated to 16 octets before being used to derive the
+ initial transient session keys.
+
+ The initial transient session keys are obtained by calling the
+ function GetNewKeyFromSHA() (described in [3]):
+
+GetNewKeyFromSHA(MasterSendKey, MasterSendKey, 16, SendSessionKey)
+GetNewKeyFromSHA(MasterReceiveKey, MasterReceiveKey, 16,
+ReceiveSessionKey)
+
+ Finally, the RC4 tables are initialized using the new session keys:
+
+ rc4_key(SendRC4key, 16, SendSessionKey)
+ rc4_key(ReceiveRC4key, 16, ReceiveSessionKey)
+
+5. Security Considerations
+
+5.1. MS-CHAP Credentials
+
+ Because of the way in which 40-bit keys are derived from MS-CHAP-1
+ credentials, the initial 40-bit session key will be identical in all
+ sessions established under the same peer credentials. For this
+ reason, and because RC4 with a 40-bit key length is believed to be a
+ relatively weak cipher, peers SHOULD NOT use 40-bit keys derived from
+ the LAN Manager password hash (as described above) if it can be
+ avoided.
+
+ Since the MPPE session keys are derived from user passwords (in the
+ MS- CHAP-1 and MS-CHAP-2 cases), care should be taken to ensure the
+ selection of strong passwords and passwords should be changed
+ frequently.
+
+
+
+
+
+
+
+Zorn Informational [Page 18]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+5.2. EAP-TLS Credentials
+
+ The strength of the session keys is dependent upon the security of
+ the TLS protocol.
+
+ The EAP server may be on a separate machine from the PPP
+ authenticator; if this is the case, adequate care must be taken in
+ the transmission of the EAP-TLS master keys to the authenticator.
+
+6. References
+
+ [1] Simpson, W., "The Point-to-Point Protocol (PPP)", STD 51, RFC
+ 1661, July 1994.
+
+ [2] Zorn, G. and S. Cobb, "Microsoft PPP CHAP Extensions", RFC 2433,
+ October 1998.
+
+ [3] Pall, G. and G. Zorn, "Microsoft Point-to-Point Encryption
+ (MPPE) RFC 3078, March 2001.
+
+ [4] RC4 is a proprietary encryption algorithm available under
+ license from RSA Data Security Inc. For licensing information,
+ contact:
+ RSA Data Security, Inc.
+ 100 Marine Parkway
+ Redwood City, CA 94065-1031
+
+ [5] Pall, G., "Microsoft Point-to-Point Compression (MPPC)
+ Protocol", RFC 2118, March 1997.
+
+ [6] Bradner, S., "Key words for use in RFCs to Indicate Requirement
+ Levels", BCP 14, RFC 2119, March 1997.
+
+ [7] "Secure Hash Standard", Federal Information Processing Standards
+ Publication 180-1, National Institute of Standards and
+ Technology, April 1995.
+
+ [8] Zorn, G., "Microsoft PPP CHAP Extensions, Version 2", RFC 2759,
+ January 2000.
+
+ [9] Simpson, W., "PPP Challenge Handshake Authentication Protocol
+ (CHAP)", RFC 1994, August 1996.
+
+ [10] Blunk, L. and J. Vollbrecht, "PPP Extensible Authentication
+ Protocol (EAP)", RFC 2284, March 1998.
+
+
+
+
+
+
+Zorn Informational [Page 19]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+ [11] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC
+ 2246, January 1999.
+
+ [12] Aboba, B. and D. Simon, "PPP EAP TLS Authentication Protocol",
+ RFC 2716, October 1999.
+
+7. Acknowledgements
+
+ Anthony Bell, Richard B. Ward, Terence Spies and Thomas Dimitri, all
+ of Microsoft Corporation, significantly contributed to the design and
+ development of MPPE.
+
+ Additional thanks to Robert Friend, Joe Davies, Jody Terrill, Archie
+ Cobbs, Mark Deuser, Vijay Baliga, Brad Robel-Forrest and Jeff Haag
+ for useful feedback.
+
+ The technical portions of this memo were completed while the author
+ was employed by Microsoft Corporation.
+
+8. Author's Address
+
+ Questions about this memo can also be directed to:
+
+ Glen Zorn
+ cisco Systems
+ 500 108th Avenue N.E.
+ Suite 500
+ Bellevue, Washington 98004
+ USA
+
+ Phone: +1 425 438 8218
+ FAX: +1 425 438 1848
+ EMail: gwz@cisco.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 20]
+
+RFC 3079 MPPE Key Derivation March 2001
+
+
+9. Full Copyright Statement
+
+ Copyright (C) The Internet Society (2001). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assigns.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+Acknowledgement
+
+ Funding for the RFC Editor function is currently provided by the
+ Internet Society.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Zorn Informational [Page 21]
+
diff --git a/doc/rfc3544.txt b/rfc/rfc3544.txt
index b4d2ac5..b4d2ac5 100644
--- a/doc/rfc3544.txt
+++ b/rfc/rfc3544.txt
diff --git a/rfc/rfc3576.txt b/rfc/rfc3576.txt
new file mode 100644
index 0000000..89fd9eb
--- /dev/null
+++ b/rfc/rfc3576.txt
@@ -0,0 +1,1683 @@
+
+
+
+
+
+
+Network Working Group M. Chiba
+Request for Comments: 3576 G. Dommety
+Category: Informational M. Eklund
+ Cisco Systems, Inc.
+ D. Mitton
+ Circular Logic, UnLtd.
+ B. Aboba
+ Microsoft Corporation
+ July 2003
+
+
+ Dynamic Authorization Extensions to Remote
+ Authentication Dial In User Service (RADIUS)
+
+Status of this Memo
+
+ This memo provides information for the Internet community. It does
+ not specify an Internet standard of any kind. Distribution of this
+ memo is unlimited.
+
+Copyright Notice
+
+ Copyright (C) The Internet Society (2003). All Rights Reserved.
+
+Abstract
+
+ This document describes a currently deployed extension to the Remote
+ Authentication Dial In User Service (RADIUS) protocol, allowing
+ dynamic changes to a user session, as implemented by network access
+ server products. This includes support for disconnecting users and
+ changing authorizations applicable to a user session.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 1]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+Table of Contents
+
+ 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
+ 1.1. Applicability. . . . . . . . . . . . . . . . . . . . . . 3
+ 1.2. Requirements Language . . . . . . . . . . . . . . . . . 5
+ 1.3. Terminology. . . . . . . . . . . . . . . . . . . . . . . 5
+ 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
+ 2.1. Disconnect Messages (DM) . . . . . . . . . . . . . . . . 5
+ 2.2. Change-of-Authorization Messages (CoA) . . . . . . . . . 6
+ 2.3. Packet Format. . . . . . . . . . . . . . . . . . . . . . 7
+ 3. Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . 11
+ 3.1. Error-Cause. . . . . . . . . . . . . . . . . . . . . . . 13
+ 3.2. Table of Attributes. . . . . . . . . . . . . . . . . . . 16
+ 4. IANA Considerations. . . . . . . . . . . . . . . . . . . . . . 20
+ 5. Security Considerations. . . . . . . . . . . . . . . . . . . . 21
+ 5.1. Authorization Issues . . . . . . . . . . . . . . . . . . 21
+ 5.2. Impersonation. . . . . . . . . . . . . . . . . . . . . . 22
+ 5.3. IPsec Usage Guidelines . . . . . . . . . . . . . . . . . 22
+ 5.4. Replay Protection. . . . . . . . . . . . . . . . . . . . 25
+ 6. Example Traces . . . . . . . . . . . . . . . . . . . . . . . . 26
+ 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 26
+ 7.1. Normative References . . . . . . . . . . . . . . . . . . 26
+ 7.2. Informative References . . . . . . . . . . . . . . . . . 27
+ 8. Intellectual Property Statement. . . . . . . . . . . . . . . . 28
+ 9. Acknowledgements. . . . . . . . . . . . . . . . . . . . . . . 28
+ 10. Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 29
+ 11. Full Copyright Statement . . . . . . . . . . . . . . . . . . . 30
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 2]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+1. Introduction
+
+ The RADIUS protocol, defined in [RFC2865], does not support
+ unsolicited messages sent from the RADIUS server to the Network
+ Access Server (NAS).
+
+ However, there are many instances in which it is desirable for
+ changes to be made to session characteristics, without requiring the
+ NAS to initiate the exchange. For example, it may be desirable for
+ administrators to be able to terminate a user session in progress.
+ Alternatively, if the user changes authorization level, this may
+ require that authorization attributes be added/deleted from a user
+ session.
+
+ To overcome these limitations, several vendors have implemented
+ additional RADIUS commands in order to be able to support unsolicited
+ messages sent from the RADIUS server to the NAS. These extended
+ commands provide support for Disconnect and Change-of-Authorization
+ (CoA) messages. Disconnect messages cause a user session to be
+ terminated immediately, whereas CoA messages modify session
+ authorization attributes such as data filters.
+
+1.1. Applicability
+
+ This protocol is being recommended for publication as an
+ Informational RFC rather than as a standards-track RFC because of
+ problems that cannot be fixed without creating incompatibilities with
+ deployed implementations. This includes security vulnerabilities, as
+ well as semantic ambiguities resulting from the design of the
+ Change-of-Authorization (CoA) commands. While fixes are recommended,
+ they cannot be made mandatory since this would be incompatible with
+ existing implementations.
+
+ Existing implementations of this protocol do not support
+ authorization checks, so that an ISP sharing a NAS with another ISP
+ could disconnect or change authorizations for another ISP's users.
+ In order to remedy this problem, a "Reverse Path Forwarding" check is
+ recommended. See Section 5.1. for details.
+
+ Existing implementations utilize per-packet authentication and
+ integrity protection algorithms with known weaknesses [MD5Attack].
+ To provide stronger per-packet authentication and integrity
+ protection, the use of IPsec is recommended. See Section 5.3. for
+ details.
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 3]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ Existing implementations lack replay protection. In order to support
+ replay detection, it is recommended that the Event-Timestamp
+ Attribute be added to all messages in situations where IPsec replay
+ protection is not employed. Implementations should be configurable
+ to silently discard messages lacking the Event-Timestamp Attribute.
+ See Section 5.4. for details.
+
+ The approach taken with CoA commands in existing implementations
+ results in a semantic ambiguity. Existing implementations of the
+ CoA-Request identify the affected session, as well as supply the
+ authorization changes. Since RADIUS Attributes included within
+ existing implementations of the CoA-Request can be used for session
+ identification or authorization change, it may not be clear which
+ function a given attribute is serving.
+
+ The problem does not exist within [Diameter], in which authorization
+ change is requested by a command using Attribute Value Pairs (AVPs)
+ solely for identification, resulting in initiation of a standard
+ Request/Response sequence where authorization changes are supplied.
+ As a result, in no command can Diameter AVPs have multiple potential
+ meanings.
+
+ Due to differences in handling change-of-authorization requests in
+ RADIUS and Diameter, it may be difficult or impossible for a
+ Diameter/RADIUS gateway to successfully translate existing
+ implementations of this specification to equivalent messages in
+ Diameter. For example, a Diameter command changing any attribute
+ used for identification within existing CoA-Request implementations
+ cannot be translated, since such an authorization change is
+ impossible to carry out in existing implementations. Similarly,
+ translation between existing implementations of Disconnect-Request or
+ CoA-Request messages and Diameter is tricky because a Disconnect-
+ Request or CoA-Request message will need to be translated to multiple
+ Diameter commands.
+
+ To simplify translation between RADIUS and Diameter, a Service-Type
+ Attribute with value "Authorize Only" can (optionally) be included
+ within a Disconnect-Request or CoA-Request. Such a Request contains
+ only identification attributes. A NAS supporting the "Authorize
+ Only" Service-Type within a Disconnect-Request or CoA-Request
+ responds with a NAK containing a Service-Type Attribute with value
+ "Authorize Only" and an Error-Cause Attribute with value "Request
+ Initiated". The NAS will then send an Access-Request containing a
+ Service-Type Attribute with a value of "Authorize Only". This usage
+ sequence is akin to what occurs in Diameter and so is more easily
+ translated by a Diameter/RADIUS gateway.
+
+
+
+
+
+Chiba, et al. Informational [Page 4]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+1.2. Requirements Language
+
+ In this document, several words are used to signify the requirements
+ of the specification. These words are often capitalized. The key
+ words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
+ "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document
+ are to be interpreted as described in [RFC2119].
+
+1.3. Terminology
+
+ This document frequently uses the following terms:
+
+ Network Access Server (NAS): The device providing access to the
+ network.
+
+ service: The NAS provides a service to the user,
+ such as IEEE 802 or PPP.
+
+ session: Each service provided by the NAS to a
+ user constitutes a session, with the
+ beginning of the session defined as the
+ point where service is first provided
+ and the end of the session defined as
+ the point where service is ended. A
+ user may have multiple sessions in
+ parallel or series if the NAS supports
+ that.
+
+ silently discard: This means the implementation discards
+ the packet without further processing.
+ The implementation SHOULD provide the
+ capability of logging the error,
+ including the contents of the silently
+ discarded packet, and SHOULD record the
+ event in a statistics counter.
+
+2. Overview
+
+ This section describes the most commonly implemented features of
+ Disconnect and Change-of-Authorization messages.
+
+2.1. Disconnect Messages (DM)
+
+ A Disconnect-Request packet is sent by the RADIUS server in order to
+ terminate a user session on a NAS and discard all associated session
+ context. The Disconnect-Request packet is sent to UDP port 3799, and
+ identifies the NAS as well as the user session to be terminated by
+ inclusion of the identification attributes described in Section 3.
+
+
+
+Chiba, et al. Informational [Page 5]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ +----------+ Disconnect-Request +----------+
+ | | <-------------------- | |
+ | NAS | | RADIUS |
+ | | Disconnect-Response | Server |
+ | | ---------------------> | |
+ +----------+ +----------+
+
+ The NAS responds to a Disconnect-Request packet sent by a RADIUS
+ server with a Disconnect-ACK if all associated session context is
+ discarded and the user session is no longer connected, or a
+ Disconnect-NAK, if the NAS was unable to disconnect the session and
+ discard all associated session context. A NAS MUST respond to a
+ Disconnect-Request including a Service-Type Attribute with value
+ "Authorize Only" with a Disconnect-NAK; a Disconnect-ACK MUST NOT be
+ sent. A NAS MUST respond to a Disconnect-Request including a
+ Service-Type Attribute with an unsupported value with a Disconnect-
+ NAK; an Error-Cause Attribute with value "Unsupported Service" MAY be
+ included. A Disconnect-ACK MAY contain the Attribute
+ Acct-Terminate-Cause (49) [RFC2866] with the value set to 6 for
+ Admin-Reset.
+
+2.2. Change-of-Authorization Messages (CoA)
+
+ CoA-Request packets contain information for dynamically changing
+ session authorizations. This is typically used to change data
+ filters. The data filters can be of either the ingress or egress
+ kind, and are sent in addition to the identification attributes as
+ described in section 3. The port used, and packet format (described
+ in Section 2.3.), are the same as that for Disconnect-Request
+ Messages.
+
+ The following attribute MAY be sent in a CoA-Request:
+
+ Filter-ID (11) - Indicates the name of a data filter list to be
+ applied for the session that the identification
+ attributes map to.
+
+ +----------+ CoA-Request +----------+
+ | | <-------------------- | |
+ | NAS | | RADIUS |
+ | | CoA-Response | Server |
+ | | ---------------------> | |
+ +----------+ +----------+
+
+ The NAS responds to a CoA-Request sent by a RADIUS server with a
+ CoA-ACK if the NAS is able to successfully change the authorizations
+ for the user session, or a CoA-NAK if the Request is unsuccessful. A
+ NAS MUST respond to a CoA-Request including a Service-Type Attribute
+
+
+
+Chiba, et al. Informational [Page 6]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ with value "Authorize Only" with a CoA-NAK; a CoA-ACK MUST NOT be
+ sent. A NAS MUST respond to a CoA-Request including a Service-Type
+ Attribute with an unsupported value with a CoA-NAK; an Error-Cause
+ Attribute with value "Unsupported Service" MAY be included.
+
+2.3. Packet Format
+
+ For either Disconnect-Request or CoA-Request messages UDP port 3799
+ is used as the destination port. For responses, the source and
+ destination ports are reversed. Exactly one RADIUS packet is
+ encapsulated in the UDP Data field.
+
+ A summary of the data format is shown below. The fields are
+ transmitted from left to right.
+
+ The packet format consists of the fields: Code, Identifier, Length,
+ Authenticator, and Attributes in Type:Length:Value (TLV) format. All
+ fields hold the same meaning as those described in RADIUS [RFC2865].
+ The Authenticator field MUST be calculated in the same way as is
+ specified for an Accounting-Request in [RFC2866].
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Code | Identifier | Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ | Authenticator |
+ | |
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Attributes ...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-
+
+ Code
+
+ The Code field is one octet, and identifies the type of RADIUS
+ packet. Packets received with an invalid Code field MUST be
+ silently discarded. RADIUS codes (decimal) for this extension are
+ assigned as follows:
+
+ 40 - Disconnect-Request [RFC2882]
+ 41 - Disconnect-ACK [RFC2882]
+ 42 - Disconnect-NAK [RFC2882]
+ 43 - CoA-Request [RFC2882]
+ 44 - CoA-ACK [RFC2882]
+ 45 - CoA-NAK [RFC2882]
+
+
+
+
+Chiba, et al. Informational [Page 7]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ Identifier
+
+ The Identifier field is one octet, and aids in matching requests
+ and replies. The RADIUS client can detect a duplicate request if
+ it has the same server source IP address and source UDP port and
+ Identifier within a short span of time.
+
+ Unlike RADIUS as defined in [RFC2865], the responsibility for
+ retransmission of Disconnect-Request and CoA-Request messages lies
+ with the RADIUS server. If after sending these messages, the
+ RADIUS server does not receive a response, it will retransmit.
+
+ The Identifier field MUST be changed whenever the content of the
+ Attributes field changes, or whenever a valid reply has been
+ received for a previous request. For retransmissions where the
+ contents are identical, the Identifier MUST remain unchanged.
+
+ If the RADIUS server is retransmitting a Disconnect-Request or
+ CoA-Request to the same client as before, and the Attributes have
+ not changed, the same Request Authenticator, Identifier and source
+ port MUST be used. If any Attributes have changed, a new
+ Authenticator and Identifier MUST be used.
+
+ Note that if the Event-Timestamp Attribute is included, it will be
+ updated when the packet is retransmitted, changing the content of
+ the Attributes field and requiring a new Identifier and Request
+ Authenticator.
+
+ If the Request to a primary proxy fails, a secondary proxy must be
+ queried, if available. Issues relating to failover algorithms are
+ described in [AAATransport]. Since this represents a new request,
+ a new Request Authenticator and Identifier MUST be used. However,
+ where the RADIUS server is sending directly to the client,
+ failover typically does not make sense, since Disconnect or CoA
+ messages need to be delivered to the NAS where the session
+ resides.
+
+ Length
+
+ The Length field is two octets. It indicates the length of the
+ packet including the Code, Identifier, Length, Authenticator and
+ Attribute fields. Octets outside the range of the Length field
+ MUST be treated as padding and ignored on reception. If the
+ packet is shorter than the Length field indicates, it MUST be
+ silently discarded. The minimum length is 20 and the maximum
+ length is 4096.
+
+
+
+
+
+Chiba, et al. Informational [Page 8]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ Authenticator
+
+ The Authenticator field is sixteen (16) octets. The most
+ significant octet is transmitted first. This value is used to
+ authenticate the messages between the RADIUS server and client.
+
+ Request Authenticator
+
+ In Request packets, the Authenticator value is a 16 octet MD5
+ [RFC1321] checksum, called the Request Authenticator. The Request
+ Authenticator is calculated the same way as for an Accounting-
+ Request, specified in [RFC2866].
+
+ Note that the Request Authenticator of a Disconnect or CoA-Request
+ cannot be done the same way as the Request Authenticator of a
+ RADIUS Access-Request, because there is no User-Password Attribute
+ in a Disconnect-Request or CoA-Request.
+
+ Response Authenticator
+
+ The Authenticator field in a Response packet (e.g. Disconnect-ACK,
+ Disconnect-NAK, CoA-ACK, or CoA-NAK) is called the Response
+ Authenticator, and contains a one-way MD5 hash calculated over a
+ stream of octets consisting of the Code, Identifier, Length, the
+ Request Authenticator field from the packet being replied to, and
+ the response Attributes if any, followed by the shared secret.
+ The resulting 16 octet MD5 hash value is stored in the
+ Authenticator field of the Response packet.
+
+ Administrative note: As noted in [RFC2865] Section 3, the secret
+ (password shared between the client and the RADIUS server) SHOULD be
+ at least as large and unguessable as a well-chosen password. RADIUS
+ clients MUST use the source IP address of the RADIUS UDP packet to
+ decide which shared secret to use, so that requests can be proxied.
+
+ Attributes
+
+ In Disconnect and CoA-Request messages, all Attributes are treated
+ as mandatory. A NAS MUST respond to a CoA-Request containing one
+ or more unsupported Attributes or Attribute values with a CoA-NAK;
+ a Disconnect-Request containing one or more unsupported Attributes
+ or Attribute values MUST be answered with a Disconnect-NAK. State
+ changes resulting from a CoA-Request MUST be atomic: if the
+ Request is successful, a CoA-ACK is sent, and all requested
+ authorization changes MUST be made. If the CoA-Request is
+ unsuccessful, a CoA-NAK MUST be sent, and the requested
+
+
+
+
+
+Chiba, et al. Informational [Page 9]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ authorization changes MUST NOT be made. Similarly, a state change
+ MUST NOT occur as a result of an unsuccessful Disconnect-Request;
+ here a Disconnect-NAK MUST be sent.
+
+ Since within this specification attributes may be used for
+ identification, authorization or other purposes, even if a NAS
+ implements an attribute for use with RADIUS authentication and
+ accounting, it may not support inclusion of that attribute within
+ Disconnect-Request or CoA-Request messages, given the difference
+ in attribute semantics. This is true even for attributes
+ specified within [RFC2865], [RFC2868], [RFC2869] or [RFC3162] as
+ allowable within Access-Accept messages.
+
+ As a result, attributes beyond those specified in Section 3.2.
+ SHOULD NOT be included within Disconnect or CoA messages since
+ this could produce unpredictable results.
+
+ When using a forwarding proxy, the proxy must be able to alter the
+ packet as it passes through in each direction. When the proxy
+ forwards a Disconnect or CoA-Request, it MAY add a Proxy-State
+ Attribute, and when the proxy forwards a response, it MUST remove
+ its Proxy-State Attribute if it added one. Proxy-State is always
+ added or removed after any other Proxy-States, but no other
+ assumptions regarding its location within the list of Attributes
+ can be made. Since Disconnect and CoA responses are authenticated
+ on the entire packet contents, the stripping of the Proxy-State
+ Attribute invalidates the integrity check - so the proxy needs to
+ recompute it. A forwarding proxy MUST NOT modify existing Proxy-
+ State, State, or Class Attributes present in the packet.
+
+ If there are any Proxy-State Attributes in a Disconnect-Request or
+ CoA-Request received from the server, the forwarding proxy MUST
+ include those Proxy-State Attributes in its response to the
+ server. The forwarding proxy MAY include the Proxy-State
+ Attributes in the Disconnect-Request or CoA-Request when it
+ forwards the request, or it MAY omit them in the forwarded
+ request. If the forwarding proxy omits the Proxy-State Attributes
+ in the request, it MUST attach them to the response before sending
+ it to the server.
+
+
+
+
+
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 10]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+3. Attributes
+
+ In Disconnect-Request and CoA-Request packets, certain attributes are
+ used to uniquely identify the NAS as well as a user session on the
+ NAS. All NAS identification attributes included in a Request message
+ MUST match in order for a Disconnect-Request or CoA-Request to be
+ successful; otherwise a Disconnect-NAK or CoA-NAK SHOULD be sent.
+ For session identification attributes, the User-Name and Acct-
+ Session-Id Attributes, if included, MUST match in order for a
+ Disconnect-Request or CoA-Request to be successful; other session
+ identification attributes SHOULD match. Where a mismatch of session
+ identification attributes is detected, a Disconnect-NAK or CoA-NAK
+ SHOULD be sent. The ability to use NAS or session identification
+ attributes to map to unique/multiple sessions is beyond the scope of
+ this document. Identification attributes include NAS and session
+ identification attributes, as described below.
+
+ NAS identification attributes
+
+ Attribute # Reference Description
+ --------- --- --------- -----------
+ NAS-IP-Address 4 [RFC2865] The IPv4 address of the NAS.
+ NAS-Identifier 32 [RFC2865] String identifying the NAS.
+ NAS-IPv6-Address 95 [RFC3162] The IPv6 address of the NAS.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 11]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ Session identification attributes
+
+ Attribute # Reference Description
+ --------- --- --------- -----------
+ User-Name 1 [RFC2865] The name of the user
+ associated with the session.
+ NAS-Port 5 [RFC2865] The port on which the
+ session is terminated.
+ Framed-IP-Address 8 [RFC2865] The IPv4 address associated
+ with the session.
+ Called-Station-Id 30 [RFC2865] The link address to which
+ the session is connected.
+ Calling-Station-Id 31 [RFC2865] The link address from which
+ the session is connected.
+ Acct-Session-Id 44 [RFC2866] The identifier uniquely
+ identifying the session
+ on the NAS.
+ Acct-Multi-Session-Id 50 [RFC2866] The identifier uniquely
+ identifying related sessions.
+ NAS-Port-Type 61 [RFC2865] The type of port used.
+ NAS-Port-Id 87 [RFC2869] String identifying the port
+ where the session is.
+ Originating-Line-Info 94 [NASREQ] Provides information on the
+ characteristics of the line
+ from which a session
+ originated.
+ Framed-Interface-Id 96 [RFC3162] The IPv6 Interface Identifier
+ associated with the session;
+ always sent with
+ Framed-IPv6-Prefix.
+ Framed-IPv6-Prefix 97 [RFC3162] The IPv6 prefix associated
+ with the session, always sent
+ with Framed-Interface-Id.
+
+ To address security concerns described in Section 5.1., the User-Name
+ Attribute SHOULD be present in Disconnect-Request or CoA-Request
+ packets; one or more additional session identification attributes MAY
+ also be present. To address security concerns described in Section
+ 5.2., one or more of the NAS-IP-Address or NAS-IPv6-Address
+ Attributes SHOULD be present in Disconnect-Request or CoA-Request
+ packets; the NAS-Identifier Attribute MAY be present in addition.
+
+ If one or more authorization changes specified in a CoA-Request
+ cannot be carried out, or if one or more attributes or attribute-
+ values is unsupported, a CoA-NAK MUST be sent. Similarly, if there
+ are one or more unsupported attributes or attribute values in a
+ Disconnect-Request, a Disconnect-NAK MUST be sent.
+
+
+
+
+Chiba, et al. Informational [Page 12]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ Where a Service-Type Attribute with value "Authorize Only" is
+ included within a CoA-Request or Disconnect-Request, attributes
+ representing an authorization change MUST NOT be included; only
+ identification attributes are permitted. If attributes other than
+ NAS or session identification attributes are included in such a CoA-
+ Request, implementations MUST send a CoA-NAK; an Error-Cause
+ Attribute with value "Unsupported Attribute" MAY be included.
+ Similarly, if attributes other than NAS or session identification
+ attributes are included in such a Disconnect-Request, implementations
+ MUST send a Disconnect-NAK; an Error-Cause Attribute with value
+ "Unsupported Attribute" MAY be included.
+
+3.1. Error-Cause
+
+ Description
+
+ It is possible that the NAS cannot honor Disconnect-Request or
+ CoA-Request messages for some reason. The Error-Cause Attribute
+ provides more detail on the cause of the problem. It MAY be
+ included within Disconnect-ACK, Disconnect-NAK and CoA-NAK
+ messages.
+
+ A summary of the Error-Cause Attribute format is shown below. The
+ fields are transmitted from left to right.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Length | Value
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ Value (cont) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Type
+
+ 101 for Error-Cause
+
+ Length
+
+ 6
+
+ Value
+
+ The Value field is four octets, containing an integer specifying
+ the cause of the error. Values 0-199 and 300-399 are reserved.
+ Values 200-299 represent successful completion, so that these
+ values may only be sent within Disconnect-ACK or CoA-ACK message
+ and MUST NOT be sent within a Disconnect-NAK or CoA-NAK. Values
+
+
+
+Chiba, et al. Informational [Page 13]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ 400-499 represent fatal errors committed by the RADIUS server, so
+ that they MAY be sent within CoA-NAK or Disconnect-NAK messages,
+ and MUST NOT be sent within CoA-ACK or Disconnect-ACK messages.
+ Values 500-599 represent fatal errors occurring on a NAS or RADIUS
+ proxy, so that they MAY be sent within CoA-NAK and Disconnect-NAK
+ messages, and MUST NOT be sent within CoA-ACK or Disconnect-ACK
+ messages. Error-Cause values SHOULD be logged by the RADIUS
+ server. Error-Code values (expressed in decimal) include:
+
+ # Value
+ --- -----
+ 201 Residual Session Context Removed
+ 202 Invalid EAP Packet (Ignored)
+ 401 Unsupported Attribute
+ 402 Missing Attribute
+ 403 NAS Identification Mismatch
+ 404 Invalid Request
+ 405 Unsupported Service
+ 406 Unsupported Extension
+ 501 Administratively Prohibited
+ 502 Request Not Routable (Proxy)
+ 503 Session Context Not Found
+ 504 Session Context Not Removable
+ 505 Other Proxy Processing Error
+ 506 Resources Unavailable
+ 507 Request Initiated
+
+ "Residual Session Context Removed" is sent in response to a
+ Disconnect-Request if the user session is no longer active, but
+ residual session context was found and successfully removed. This
+ value is only sent within a Disconnect-ACK and MUST NOT be sent
+ within a CoA-ACK, Disconnect-NAK or CoA-NAK.
+
+ "Invalid EAP Packet (Ignored)" is a non-fatal error that MUST NOT be
+ sent by implementations of this specification.
+
+ "Unsupported Attribute" is a fatal error sent if a Request contains
+ an attribute (such as a Vendor-Specific or EAP-Message Attribute)
+ that is not supported.
+
+ "Missing Attribute" is a fatal error sent if critical attributes
+ (such as NAS or session identification attributes) are missing from a
+ Request.
+
+ "NAS Identification Mismatch" is a fatal error sent if one or more
+ NAS identification attributes (see Section 3.) do not match the
+ identity of the NAS receiving the Request.
+
+
+
+
+Chiba, et al. Informational [Page 14]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ "Invalid Request" is a fatal error sent if some other aspect of the
+ Request is invalid, such as if one or more attributes (such as EAP-
+ Message Attribute(s)) are not formatted properly.
+
+ "Unsupported Service" is a fatal error sent if a Service-Type
+ Attribute included with the Request is sent with an invalid or
+ unsupported value.
+
+ "Unsupported Extension" is a fatal error sent due to lack of support
+ for an extension such as Disconnect and/or CoA messages. This will
+ typically be sent by a proxy receiving an ICMP port unreachable
+ message after attempting to forward a Request to the NAS.
+
+ "Administratively Prohibited" is a fatal error sent if the NAS is
+ configured to prohibit honoring of Request messages for the specified
+ session.
+
+ "Request Not Routable" is a fatal error which MAY be sent by a RADIUS
+ proxy and MUST NOT be sent by a NAS. It indicates that the RADIUS
+ proxy was unable to determine how to route the Request to the NAS.
+ For example, this can occur if the required entries are not present
+ in the proxy's realm routing table.
+
+ "Session Context Not Found" is a fatal error sent if the session
+ context identified in the Request does not exist on the NAS.
+
+ "Session Context Not Removable" is a fatal error sent in response to
+ a Disconnect-Request if the NAS was able to locate the session
+ context, but could not remove it for some reason. It MUST NOT be
+ sent within a CoA-ACK, CoA-NAK or Disconnect-ACK, only within a
+ Disconnect-NAK.
+
+ "Other Proxy Processing Error" is a fatal error sent in response to a
+ Request that could not be processed by a proxy, for reasons other
+ than routing.
+
+ "Resources Unavailable" is a fatal error sent when a Request could
+ not be honored due to lack of available NAS resources (memory, non-
+ volatile storage, etc.).
+
+ "Request Initiated" is a fatal error sent in response to a Request
+ including a Service-Type Attribute with a value of "Authorize Only".
+ It indicates that the Disconnect-Request or CoA-Request has not been
+ honored, but that a RADIUS Access-Request including a Service-Type
+ Attribute with value "Authorize Only" is being sent to the RADIUS
+ server.
+
+
+
+
+
+Chiba, et al. Informational [Page 15]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+3.2. Table of Attributes
+
+ The following table provides a guide to which attributes may be found
+ in which packets, and in what quantity.
+
+ Change-of-Authorization Messages
+
+ Request ACK NAK # Attribute
+ 0-1 0 0 1 User-Name [Note 1]
+ 0-1 0 0 4 NAS-IP-Address [Note 1]
+ 0-1 0 0 5 NAS-Port [Note 1]
+ 0-1 0 0-1 6 Service-Type [Note 6]
+ 0-1 0 0 7 Framed-Protocol [Note 3]
+ 0-1 0 0 8 Framed-IP-Address [Note 1]
+ 0-1 0 0 9 Framed-IP-Netmask [Note 3]
+ 0-1 0 0 10 Framed-Routing [Note 3]
+ 0+ 0 0 11 Filter-ID [Note 3]
+ 0-1 0 0 12 Framed-MTU [Note 3]
+ 0+ 0 0 13 Framed-Compression [Note 3]
+ 0+ 0 0 14 Login-IP-Host [Note 3]
+ 0-1 0 0 15 Login-Service [Note 3]
+ 0-1 0 0 16 Login-TCP-Port [Note 3]
+ 0+ 0 0 18 Reply-Message [Note 2]
+ 0-1 0 0 19 Callback-Number [Note 3]
+ 0-1 0 0 20 Callback-Id [Note 3]
+ 0+ 0 0 22 Framed-Route [Note 3]
+ 0-1 0 0 23 Framed-IPX-Network [Note 3]
+ 0-1 0-1 0-1 24 State [Note 7]
+ 0+ 0 0 25 Class [Note 3]
+ 0+ 0 0 26 Vendor-Specific [Note 3]
+ 0-1 0 0 27 Session-Timeout [Note 3]
+ 0-1 0 0 28 Idle-Timeout [Note 3]
+ 0-1 0 0 29 Termination-Action [Note 3]
+ 0-1 0 0 30 Called-Station-Id [Note 1]
+ 0-1 0 0 31 Calling-Station-Id [Note 1]
+ 0-1 0 0 32 NAS-Identifier [Note 1]
+ 0+ 0+ 0+ 33 Proxy-State
+ 0-1 0 0 34 Login-LAT-Service [Note 3]
+ 0-1 0 0 35 Login-LAT-Node [Note 3]
+ 0-1 0 0 36 Login-LAT-Group [Note 3]
+ 0-1 0 0 37 Framed-AppleTalk-Link [Note 3]
+ 0+ 0 0 38 Framed-AppleTalk-Network [Note 3]
+ 0-1 0 0 39 Framed-AppleTalk-Zone [Note 3]
+ 0-1 0 0 44 Acct-Session-Id [Note 1]
+ 0-1 0 0 50 Acct-Multi-Session-Id [Note 1]
+ 0-1 0-1 0-1 55 Event-Timestamp
+ 0-1 0 0 61 NAS-Port-Type [Note 1]
+ Request ACK NAK # Attribute
+
+
+
+Chiba, et al. Informational [Page 16]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ Request ACK NAK # Attribute
+ 0-1 0 0 62 Port-Limit [Note 3]
+ 0-1 0 0 63 Login-LAT-Port [Note 3]
+ 0+ 0 0 64 Tunnel-Type [Note 5]
+ 0+ 0 0 65 Tunnel-Medium-Type [Note 5]
+ 0+ 0 0 66 Tunnel-Client-Endpoint [Note 5]
+ 0+ 0 0 67 Tunnel-Server-Endpoint [Note 5]
+ 0+ 0 0 69 Tunnel-Password [Note 5]
+ 0-1 0 0 71 ARAP-Features [Note 3]
+ 0-1 0 0 72 ARAP-Zone-Access [Note 3]
+ 0+ 0 0 78 Configuration-Token [Note 3]
+ 0+ 0-1 0 79 EAP-Message [Note 2]
+ 0-1 0-1 0-1 80 Message-Authenticator
+ 0+ 0 0 81 Tunnel-Private-Group-ID [Note 5]
+ 0+ 0 0 82 Tunnel-Assignment-ID [Note 5]
+ 0+ 0 0 83 Tunnel-Preference [Note 5]
+ 0-1 0 0 85 Acct-Interim-Interval [Note 3]
+ 0-1 0 0 87 NAS-Port-Id [Note 1]
+ 0-1 0 0 88 Framed-Pool [Note 3]
+ 0+ 0 0 90 Tunnel-Client-Auth-ID [Note 5]
+ 0+ 0 0 91 Tunnel-Server-Auth-ID [Note 5]
+ 0-1 0 0 94 Originating-Line-Info [Note 1]
+ 0-1 0 0 95 NAS-IPv6-Address [Note 1]
+ 0-1 0 0 96 Framed-Interface-Id [Note 1]
+ 0+ 0 0 97 Framed-IPv6-Prefix [Note 1]
+ 0+ 0 0 98 Login-IPv6-Host [Note 3]
+ 0+ 0 0 99 Framed-IPv6-Route [Note 3]
+ 0-1 0 0 100 Framed-IPv6-Pool [Note 3]
+ 0 0 0+ 101 Error-Cause
+ Request ACK NAK # Attribute
+
+ Disconnect Messages
+
+ Request ACK NAK # Attribute
+ 0-1 0 0 1 User-Name [Note 1]
+ 0-1 0 0 4 NAS-IP-Address [Note 1]
+ 0-1 0 0 5 NAS-Port [Note 1]
+ 0-1 0 0-1 6 Service-Type [Note 6]
+ 0-1 0 0 8 Framed-IP-Address [Note 1]
+ 0+ 0 0 18 Reply-Message [Note 2]
+ 0-1 0-1 0-1 24 State [Note 7]
+ 0+ 0 0 25 Class [Note 4]
+ 0+ 0 0 26 Vendor-Specific
+ 0-1 0 0 30 Called-Station-Id [Note 1]
+ 0-1 0 0 31 Calling-Station-Id [Note 1]
+ 0-1 0 0 32 NAS-Identifier [Note 1]
+ 0+ 0+ 0+ 33 Proxy-State
+ Request ACK NAK # Attribute
+
+
+
+Chiba, et al. Informational [Page 17]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ Request ACK NAK # Attribute
+ 0-1 0 0 44 Acct-Session-Id [Note 1]
+ 0-1 0-1 0 49 Acct-Terminate-Cause
+ 0-1 0 0 50 Acct-Multi-Session-Id [Note 1]
+ 0-1 0-1 0-1 55 Event-Timestamp
+ 0-1 0 0 61 NAS-Port-Type [Note 1]
+ 0+ 0-1 0 79 EAP-Message [Note 2]
+ 0-1 0-1 0-1 80 Message-Authenticator
+ 0-1 0 0 87 NAS-Port-Id [Note 1]
+ 0-1 0 0 94 Originating-Line-Info [Note 1]
+ 0-1 0 0 95 NAS-IPv6-Address [Note 1]
+ 0-1 0 0 96 Framed-Interface-Id [Note 1]
+ 0+ 0 0 97 Framed-IPv6-Prefix [Note 1]
+ 0 0+ 0+ 101 Error-Cause
+ Request ACK NAK # Attribute
+
+ [Note 1] Where NAS or session identification attributes are included
+ in Disconnect-Request or CoA-Request messages, they are used for
+ identification purposes only. These attributes MUST NOT be used for
+ purposes other than identification (e.g. within CoA-Request messages
+ to request authorization changes).
+
+ [Note 2] The Reply-Message Attribute is used to present a displayable
+ message to the user. The message is only displayed as a result of a
+ successful Disconnect-Request or CoA-Request (where a Disconnect-ACK
+ or CoA-ACK is subsequently sent). Where EAP is used for
+ authentication, an EAP-Message/Notification-Request Attribute is sent
+ instead, and Disconnect-ACK or CoA-ACK messages contain an EAP-
+ Message/Notification-Response Attribute.
+
+ [Note 3] When included within a CoA-Request, these attributes
+ represent an authorization change request. When one of these
+ attributes is omitted from a CoA-Request, the NAS assumes that the
+ attribute value is to remain unchanged. Attributes included in a
+ CoA-Request replace all existing value(s) of the same attribute(s).
+
+ [Note 4] When included within a successful Disconnect-Request (where
+ a Disconnect-ACK is subsequently sent), the Class Attribute SHOULD be
+ sent unmodified by the client to the accounting server in the
+ Accounting Stop packet. If the Disconnect-Request is unsuccessful,
+ then the Class Attribute is not processed.
+
+ [Note 5] When included within a CoA-Request, these attributes
+ represent an authorization change request. Where tunnel attribute(s)
+ are sent within a successful CoA-Request, all existing tunnel
+ attributes are removed and replaced by the new attribute(s).
+
+
+
+
+
+Chiba, et al. Informational [Page 18]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ [Note 6] When included within a Disconnect-Request or CoA-Request, a
+ Service-Type Attribute with value "Authorize Only" indicates that the
+ Request only contains NAS and session identification attributes, and
+ that the NAS should attempt reauthorization by sending an Access-
+ Request with a Service-Type Attribute with value "Authorize Only".
+ This enables a usage model akin to that supported in Diameter, thus
+ easing translation between the two protocols. Support for the
+ Service-Type Attribute is optional within CoA-Request and
+ Disconnect-Request messages; where it is not included, the Request
+ message may contain both identification and authorization attributes.
+ A NAS that does not support the Service-Type Attribute with the value
+ "Authorize Only" within a Disconnect-Request MUST respond with a
+ Disconnect-NAK including no Service-Type Attribute; an Error-Cause
+ Attribute with value "Unsupported Service" MAY be included. A NAS
+ that does not support the Service-Type Attribute with the value
+ "Authorize Only" within a CoA-Request MUST respond with a CoA-NAK
+ including no Service-Type Attribute; an Error-Cause Attribute with
+ value "Unsupported Service" MAY be included.
+
+ A NAS supporting the "Authorize Only" Service-Type value within
+ Disconnect-Request or CoA-Request messages MUST respond with a
+ Disconnect-NAK or CoA-NAK respectively, containing a Service-Type
+ Attribute with value "Authorize Only", and an Error-Cause Attribute
+ with value "Request Initiated". The NAS then sends an Access-Request
+ to the RADIUS server with a Service-Type Attribute with value
+ "Authorize Only". This Access-Request SHOULD contain the NAS
+ attributes from the Disconnect or CoA-Request, as well as the session
+ attributes from the Request legal for inclusion in an Access-Request
+ as specified in [RFC2865], [RFC2868], [RFC2869] and [RFC3162]. As
+ noted in [RFC2869] Section 5.19, a Message-Authenticator attribute
+ SHOULD be included in an Access-Request that does not contain a
+ User-Password, CHAP-Password, ARAP-Password or EAP-Message Attribute.
+ The RADIUS server should send back an Access-Accept to (re-)authorize
+ the session or an Access-Reject to refuse to (re-)authorize it.
+
+ [Note 7] The State Attribute is available to be sent by the RADIUS
+ server to the NAS in a Disconnect-Request or CoA-Request message and
+ MUST be sent unmodified from the NAS to the RADIUS server in a
+ subsequent ACK or NAK message. If a Service-Type Attribute with
+ value "Authorize Only" is included in a Disconnect-Request or CoA-
+ Request along with a State Attribute, then the State Attribute MUST
+ be sent unmodified from the NAS to the RADIUS server in the resulting
+ Access-Request sent to the RADIUS server, if any. The State
+ Attribute is also available to be sent by the RADIUS server to the
+ NAS in a CoA-Request that also includes a Termination-Action
+ Attribute with the value of RADIUS-Request. If the client performs
+ the Termination-Action by sending a new Access-Request upon
+ termination of the current session, it MUST include the State
+
+
+
+Chiba, et al. Informational [Page 19]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ Attribute unchanged in that Access-Request. In either usage, the
+ client MUST NOT interpret the Attribute locally. A Disconnect-
+ Request or CoA-Request packet must have only zero or one State
+ Attribute. Usage of the State Attribute is implementation dependent.
+ If the RADIUS server does not recognize the State Attribute in the
+ Access-Request, then it MUST send an Access-Reject.
+
+ The following table defines the meaning of the above table entries.
+
+ 0 This attribute MUST NOT be present in packet.
+ 0+ Zero or more instances of this attribute MAY be present in
+ packet.
+ 0-1 Zero or one instance of this attribute MAY be present in packet.
+ 1 Exactly one instance of this attribute MUST be present in packet.
+
+4. IANA Considerations
+
+ This document uses the RADIUS [RFC2865] namespace, see
+ <http://www.iana.org/assignments/radius-types>. There are six
+ updates for the section: RADIUS Packet Type Codes. These Packet
+ Types are allocated in [RADIANA]:
+
+ 40 - Disconnect-Request
+ 41 - Disconnect-ACK
+ 42 - Disconnect-NAK
+ 43 - CoA-Request
+ 44 - CoA-ACK
+ 45 - CoA-NAK
+
+ Allocation of a new Service-Type value for "Authorize Only" is
+ requested. This document also uses the UDP [RFC768] namespace, see
+ <http://www.iana.org/assignments/port-numbers>. The authors request
+ a port assignment from the Registered ports range. Finally, this
+ specification allocates the Error-Cause Attribute (101) with the
+ following decimal values:
+
+ # Value
+ --- -----
+ 201 Residual Session Context Removed
+ 202 Invalid EAP Packet (Ignored)
+ 401 Unsupported Attribute
+ 402 Missing Attribute
+ 403 NAS Identification Mismatch
+ 404 Invalid Request
+ 405 Unsupported Service
+ 406 Unsupported Extension
+ 501 Administratively Prohibited
+ 502 Request Not Routable (Proxy)
+
+
+
+Chiba, et al. Informational [Page 20]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ 503 Session Context Not Found
+ 504 Session Context Not Removable
+ 505 Other Proxy Processing Error
+ 506 Resources Unavailable
+ 507 Request Initiated
+
+5. Security Considerations
+
+5.1. Authorization Issues
+
+ Where a NAS is shared by multiple providers, it is undesirable for
+ one provider to be able to send Disconnect-Request or CoA-Requests
+ affecting the sessions of another provider.
+
+ A NAS or RADIUS proxy MUST silently discard Disconnect-Request or
+ CoA-Request messages from untrusted sources. By default, a RADIUS
+ proxy SHOULD perform a "reverse path forwarding" (RPF) check to
+ verify that a Disconnect-Request or CoA-Request originates from an
+ authorized RADIUS server. In addition, it SHOULD be possible to
+ explicitly authorize additional sources of Disconnect-Request or
+ CoA-Request packets relating to certain classes of sessions. For
+ example, a particular source can be explicitly authorized to send
+ CoA-Request messages relating to users within a set of realms.
+
+ To perform the RPF check, the proxy uses the session identification
+ attributes included in Disconnect-Request or CoA-Request messages, in
+ order to determine the RADIUS server(s) to which an equivalent
+ Access-Request could be routed. If the source address of the
+ Disconnect-Request or CoA-Request is within this set, then the
+ Request is forwarded; otherwise it MUST be silently discarded.
+
+ Typically the proxy will extract the realm from the Network Access
+ Identifier [RFC2486] included within the User-Name Attribute, and
+ determine the corresponding RADIUS servers in the proxy routing
+ tables. The RADIUS servers for that realm are then compared against
+ the source address of the packet. Where no RADIUS proxy is present,
+ the RPF check will need to be performed by the NAS itself.
+
+ Since authorization to send a Disconnect-Request or CoA-Request is
+ determined based on the source address and the corresponding shared
+ secret, the NASes or proxies SHOULD configure a different shared
+ secret for each RADIUS server.
+
+
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 21]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+5.2. Impersonation
+
+ [RFC2865] Section 3 states:
+
+ A RADIUS server MUST use the source IP address of the RADIUS UDP
+ packet to decide which shared secret to use, so that RADIUS
+ requests can be proxied.
+
+ When RADIUS requests are forwarded by a proxy, the NAS-IP-Address or
+ NAS-IPv6-Address Attributes will typically not match the source
+ address observed by the RADIUS server. Since the NAS-Identifier
+ Attribute need not contain an FQDN, this attribute may not be
+ resolvable to the source address observed by the RADIUS server, even
+ when no proxy is present.
+
+ As a result, the authenticity check performed by a RADIUS server or
+ proxy does not verify the correctness of NAS identification
+ attributes. This makes it possible for a rogue NAS to forge NAS-IP-
+ Address, NAS-IPv6-Address or NAS-Identifier Attributes within a
+ RADIUS Access-Request in order to impersonate another NAS. It is
+ also possible for a rogue NAS to forge session identification
+ attributes such as the Called-Station-Id, Calling-Station-Id, or
+ Originating-Line-Info [NASREQ]. This could fool the RADIUS server
+ into sending Disconnect-Request or CoA-Request messages containing
+ forged session identification attributes to a NAS targeted by an
+ attacker.
+
+ To address these vulnerabilities RADIUS proxies SHOULD check whether
+ NAS identification attributes (see Section 3.) match the source
+ address of packets originating from the NAS. Where one or more
+ attributes do not match, Disconnect-Request or CoA-Request messages
+ SHOULD be silently discarded.
+
+ Such a check may not always be possible. Since the NAS-Identifier
+ Attribute need not correspond to an FQDN, it may not be resolvable to
+ an IP address to be matched against the source address. Also, where
+ a NAT exists between the RADIUS client and proxy, checking the NAS-
+ IP-Address or NAS-IPv6-Address Attributes may not be feasible.
+
+5.3. IPsec Usage Guidelines
+
+ In addition to security vulnerabilities unique to Disconnect or CoA
+ messages, the protocol exchanges described in this document are
+ susceptible to the same vulnerabilities as RADIUS [RFC2865]. It is
+ RECOMMENDED that IPsec be employed to afford better security.
+
+
+
+
+
+
+Chiba, et al. Informational [Page 22]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ Implementations of this specification SHOULD support IPsec [RFC2401]
+ along with IKE [RFC2409] for key management. IPsec ESP [RFC2406]
+ with a non-null transform SHOULD be supported, and IPsec ESP with a
+ non-null encryption transform and authentication support SHOULD be
+ used to provide per-packet confidentiality, authentication, integrity
+ and replay protection. IKE SHOULD be used for key management.
+
+ Within RADIUS [RFC2865], a shared secret is used for hiding
+ Attributes such as User-Password, as well as used in computation of
+ the Response Authenticator. In RADIUS accounting [RFC2866], the
+ shared secret is used in computation of both the Request
+ Authenticator and the Response Authenticator.
+
+ Since in RADIUS a shared secret is used to provide confidentiality as
+ well as integrity protection and authentication, only use of IPsec
+ ESP with a non-null transform can provide security services
+ sufficient to substitute for RADIUS application-layer security.
+ Therefore, where IPsec AH or ESP null is used, it will typically
+ still be necessary to configure a RADIUS shared secret.
+
+ Where RADIUS is run over IPsec ESP with a non-null transform, the
+ secret shared between the NAS and the RADIUS server MAY NOT be
+ configured. In this case, a shared secret of zero length MUST be
+ assumed. However, a RADIUS server that cannot know whether incoming
+ traffic is IPsec-protected MUST be configured with a non-null RADIUS
+ shared secret.
+
+ When IPsec ESP is used with RADIUS, per-packet authentication,
+ integrity and replay protection MUST be used. 3DES-CBC MUST be
+ supported as an encryption transform and AES-CBC SHOULD be supported.
+ AES-CBC SHOULD be offered as a preferred encryption transform if
+ supported. HMAC-SHA1-96 MUST be supported as an authentication
+ transform. DES-CBC SHOULD NOT be used as the encryption transform.
+
+ A typical IPsec policy for an IPsec-capable RADIUS client is
+ "Initiate IPsec, from me to any destination port UDP 1812". This
+ IPsec policy causes an IPsec SA to be set up by the RADIUS client
+ prior to sending RADIUS traffic. If some RADIUS servers contacted by
+ the client do not support IPsec, then a more granular policy will be
+ required: "Initiate IPsec, from me to IPsec-Capable-RADIUS-Server,
+ destination port UDP 1812."
+
+ For a client implementing this specification, the policy would be
+ "Accept IPsec, from any to me, destination port UDP 3799". This
+ causes the RADIUS client to accept (but not require) use of IPsec.
+ It may not be appropriate to require IPsec for all RADIUS servers
+ connecting to an IPsec-enabled RADIUS client, since some RADIUS
+ servers may not support IPsec.
+
+
+
+Chiba, et al. Informational [Page 23]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ For an IPsec-capable RADIUS server, a typical IPsec policy is "Accept
+ IPsec, from any to me, destination port 1812". This causes the
+ RADIUS server to accept (but not require) use of IPsec. It may not
+ be appropriate to require IPsec for all RADIUS clients connecting to
+ an IPsec-enabled RADIUS server, since some RADIUS clients may not
+ support IPsec.
+
+ For servers implementing this specification, the policy would be
+ "Initiate IPsec, from me to any, destination port UDP 3799". This
+ causes the RADIUS server to initiate IPsec when sending RADIUS
+ extension traffic to any RADIUS client. If some RADIUS clients
+ contacted by the server do not support IPsec, then a more granular
+ policy will be required, such as "Initiate IPsec, from me to IPsec-
+ capable-RADIUS-client, destination port UDP 3799".
+
+ Where IPsec is used for security, and no RADIUS shared secret is
+ configured, it is important that the RADIUS client and server perform
+ an authorization check. Before enabling a host to act as a RADIUS
+ client, the RADIUS server SHOULD check whether the host is authorized
+ to provide network access. Similarly, before enabling a host to act
+ as a RADIUS server, the RADIUS client SHOULD check whether the host
+ is authorized for that role.
+
+ RADIUS servers can be configured with the IP addresses (for IKE
+ Aggressive Mode with pre-shared keys) or FQDNs (for certificate
+ authentication) of RADIUS clients. Alternatively, if a separate
+ Certification Authority (CA) exists for RADIUS clients, then the
+ RADIUS server can configure this CA as a trust anchor [RFC3280] for
+ use with IPsec.
+
+ Similarly, RADIUS clients can be configured with the IP addresses
+ (for IKE Aggressive Mode with pre-shared keys) or FQDNs (for
+ certificate authentication) of RADIUS servers. Alternatively, if a
+ separate CA exists for RADIUS servers, then the RADIUS client can
+ configure this CA as a trust anchor for use with IPsec.
+
+ Since unlike SSL/TLS, IKE does not permit certificate policies to be
+ set on a per-port basis, certificate policies need to apply to all
+ uses of IPsec on RADIUS clients and servers. In IPsec deployment
+ supporting only certificate authentication, a management station
+ initiating an IPsec-protected telnet session to the RADIUS server
+ would need to obtain a certificate chaining to the RADIUS client CA.
+ Issuing such a certificate might not be appropriate if the management
+ station was not authorized as a RADIUS client.
+
+ Where RADIUS clients may obtain their IP address dynamically (such as
+ an Access Point supporting DHCP), Main Mode with pre-shared keys
+ [RFC2409] SHOULD NOT be used, since this requires use of a group
+
+
+
+Chiba, et al. Informational [Page 24]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ pre-shared key; instead, Aggressive Mode SHOULD be used. Where
+ RADIUS client addresses are statically assigned, either Aggressive
+ Mode or Main Mode MAY be used. With certificate authentication, Main
+ Mode SHOULD be used.
+
+ Care needs to be taken with IKE Phase 1 Identity Payload selection in
+ order to enable mapping of identities to pre-shared keys, even with
+ Aggressive Mode. Where the ID_IPV4_ADDR or ID_IPV6_ADDR Identity
+ Payloads are used and addresses are dynamically assigned, mapping of
+ identities to keys is not possible, so that group pre-shared keys are
+ still a practical necessity. As a result, the ID_FQDN identity
+ payload SHOULD be employed in situations where Aggressive mode is
+ utilized along with pre-shared keys and IP addresses are dynamically
+ assigned. This approach also has other advantages, since it allows
+ the RADIUS server and client to configure themselves based on the
+ fully qualified domain name of their peers.
+
+ Note that with IPsec, security services are negotiated at the
+ granularity of an IPsec SA, so that RADIUS exchanges requiring a set
+ of security services different from those negotiated with existing
+ IPsec SAs will need to negotiate a new IPsec SA. Separate IPsec SAs
+ are also advisable where quality of service considerations dictate
+ different handling RADIUS conversations. Attempting to apply
+ different quality of service to connections handled by the same IPsec
+ SA can result in reordering, and falling outside the replay window.
+ For a discussion of the issues, see [RFC2983].
+
+5.4. Replay Protection
+
+ Where IPsec replay protection is not used, the Event-Timestamp (55)
+ Attribute [RFC2869] SHOULD be included within all messages. When
+ this attribute is present, both the NAS and the RADIUS server MUST
+ check that the Event-Timestamp Attribute is current within an
+ acceptable time window. If the Event-Timestamp Attribute is not
+ current, then the message MUST be silently discarded. This implies
+ the need for time synchronization within the network, which can be
+ achieved by a variety of means, including secure NTP, as described in
+ [NTPAUTH].
+
+ Both the NAS and the RADIUS server SHOULD be configurable to silently
+ discard messages lacking an Event-Timestamp Attribute. A default
+ time window of 300 seconds is recommended.
+
+
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 25]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+6. Example Traces
+
+ Disconnect Request with User-Name:
+
+ 0: xxxx xxxx xxxx xxxx xxxx 2801 001c 1b23 .B.....$.-(....#
+ 16: 624c 3543 ceba 55f1 be55 a714 ca5e 0108 bL5C..U..U...^..
+ 32: 6d63 6869 6261
+
+ Disconnect Request with Acct-Session-ID:
+
+ 0: xxxx xxxx xxxx xxxx xxxx 2801 001e ad0d .B..... ~.(.....
+ 16: 8e53 55b6 bd02 a0cb ace6 4e38 77bd 2c0a .SU.......N8w.,.
+ 32: 3930 3233 3435 3637 90234567
+
+ Disconnect Request with Framed-IP-Address:
+
+ 0: xxxx xxxx xxxx xxxx xxxx 2801 001a 0bda .B....."2.(.....
+ 16: 33fe 765b 05f0 fd9c c32a 2f6b 5182 0806 3.v[.....*/kQ...
+ 32: 0a00 0203
+
+7. References
+
+7.1. Normative References
+
+ [RFC1305] Mills, D., "Network Time Protocol (version 3)
+ Specification, Implementation and Analysis", RFC 1305,
+ March 1992.
+
+ [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC
+ 1321, April 1992.
+
+ [RFC2104] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC:
+ Keyed-Hashing for Message Authentication", RFC 2104,
+ February 1997.
+
+ [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
+ Requirement Levels", BCP 14, RFC 2119, March 1997.
+
+ [RFC2401] Kent, S. and R. Atkinson, "Security Architecture for
+ the Internet Protocol", RFC 2401, November 1998.
+
+ [RFC2406] Kent, S. and R. Atkinson, "IP Encapsulating Security
+ Payload (ESP)", RFC 2406, November 1998.
+
+ [RFC2409] Harkins, D. and D. Carrel, "The Internet Key Exchange
+ (IKE)", RFC 2409, November 1998.
+
+
+
+
+
+Chiba, et al. Informational [Page 26]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing
+ an IANA Considerations Section in RFCs", BCP 26, RFC
+ 2434, October 1998.
+
+ [RFC2486] Aboba, B. and M. Beadles, "The Network Access
+ Identifier", RFC 2486, January 1999.
+
+ [RFC2865] Rigney, C., Willens, S., Rubens, A. and W. Simpson,
+ "Remote Authentication Dial In User Service (RADIUS)",
+ RFC 2865, June 2000.
+
+ [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000.
+
+ [RFC2869] Rigney, C., Willats, W. and P. Calhoun, "RADIUS
+ Extensions", RFC 2869, June 2000.
+
+ [RFC3162] Aboba, B., Zorn, G. and D. Mitton, "RADIUS and IPv6",
+ RFC 3162, August 2001.
+
+ [RFC3280] Housley, R., Polk, W., Ford, W. and D. Solo, "Internet
+ X.509 Public Key Infrastructure Certificate and
+ Certificate Revocation List (CRL) Profile", RFC 3280,
+ April 2002.
+
+ [RADIANA] Aboba, B., "IANA Considerations for RADIUS (Remote
+ Authentication Dial In User Service)", RFC 3575, July
+ 2003.
+
+7.2. Informative References
+
+ [RFC2882] Mitton, D., "Network Access Server Requirements:
+ Extended RADIUS Practices", RFC 2882, July 2000.
+
+ [RFC2983] Black, D. "Differentiated Services and Tunnels", RFC
+ 2983, October 2000.
+
+ [AAATransport] Aboba, B. and J. Wood, "Authentication, Authorization
+ and Accounting (AAA) Transport Profile", RFC 3539,
+ June 2003.
+
+ [Diameter] Calhoun, P., et al., "Diameter Base Protocol", Work in
+ Progress.
+
+ [MD5Attack] Dobbertin, H., "The Status of MD5 After a Recent
+ Attack", CryptoBytes Vol.2 No.2, Summer 1996.
+
+ [NASREQ] Calhoun, P., et al., "Diameter Network Access Server
+ Application", Work in Progress.
+
+
+
+Chiba, et al. Informational [Page 27]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+ [NTPAUTH] Mills, D., "Public Key Cryptography for the Network
+ Time Protocol", Work in Progress.
+
+8. Intellectual Property Statement
+
+ The IETF takes no position regarding the validity or scope of any
+ intellectual property or other rights that might be claimed to
+ pertain to the implementation or use of the technology described in
+ this document or the extent to which any license under such rights
+ might or might not be available; neither does it represent that it
+ has made any effort to identify any such rights. Information on the
+ IETF's procedures with respect to rights in standards-track and
+ standards- related documentation can be found in BCP-11. Copies of
+ claims of rights made available for publication and any assurances of
+ licenses to be made available, or the result of an attempt made to
+ obtain a general license or permission for the use of such
+ proprietary rights by implementers or users of this specification can
+ be obtained from the IETF Secretariat.
+
+ The IETF invites any interested party to bring to its attention any
+ copyrights, patents or patent applications, or other proprietary
+ rights which may cover technology that may be required to practice
+ this standard. Please address the information to the IETF Executive
+ Director.
+
+9. Acknowledgments
+
+ This protocol was first developed and distributed by Ascend
+ Communications. Example code was distributed in their free server
+ kit.
+
+ The authors would like to acknowledge the valuable suggestions and
+ feedback from the following people:
+
+ Avi Lior <avi@bridgewatersystems.com>,
+ Randy Bush <randy@psg.net>,
+ Steve Bellovin <smb@research.att.com>
+ Glen Zorn <gwz@cisco.com>,
+ Mark Jones <mjones@bridgewatersystems.com>,
+ Claudio Lapidus <clapidus@hotmail.com>,
+ Anurag Batta <Anurag_Batta@3com.com>,
+ Kuntal Chowdhury <chowdury@nortelnetworks.com>, and
+ Tim Moore <timmoore@microsoft.com>.
+ Russ Housley <housley@vigilsec.com>
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 28]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+10. Authors' Addresses
+
+ Murtaza Chiba
+ Cisco Systems, Inc.
+ 170 West Tasman Dr.
+ San Jose CA, 95134
+
+ EMail: mchiba@cisco.com
+ Phone: +1 408 525 7198
+
+ Gopal Dommety
+ Cisco Systems, Inc.
+ 170 West Tasman Dr.
+ San Jose, CA 95134
+
+ EMail: gdommety@cisco.com
+ Phone: +1 408 525 1404
+
+ Mark Eklund
+ Cisco Systems, Inc.
+ 170 West Tasman Dr.
+ San Jose, CA 95134
+
+ EMail: meklund@cisco.com
+ Phone: +1 865 671 6255
+
+ David Mitton
+ Circular Logic UnLtd.
+ 733 Turnpike Street #154
+ North Andover, MA 01845
+
+ EMail: david@mitton.com
+ Phone: +1 978 683 1814
+
+ Bernard Aboba
+ Microsoft Corporation
+ One Microsoft Way
+ Redmond, WA 98052
+
+ EMail: bernarda@microsoft.com
+ Phone: +1 425 706 6605
+ Fax: +1 425 936 7329
+
+
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 29]
+
+RFC 3576 Dynamic Authorization Extensions to RADIUS July 2003
+
+
+11. Full Copyright Statement
+
+ Copyright (C) The Internet Society (2003). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assignees.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+Acknowledgement
+
+ Funding for the RFC Editor function is currently provided by the
+ Internet Society.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Chiba, et al. Informational [Page 30]
+
diff --git a/rfc/rfc3580.txt b/rfc/rfc3580.txt
new file mode 100644
index 0000000..b87235c
--- /dev/null
+++ b/rfc/rfc3580.txt
@@ -0,0 +1,1683 @@
+
+
+
+
+
+
+Network Working Group P. Congdon
+Request for Comments: 3580 Hewlett Packard Company
+Category: Informational B. Aboba
+ Microsoft
+ A. Smith
+ Trapeze Networks
+ G. Zorn
+ Cisco Systems
+ J. Roese
+ Enterasys
+ September 2003
+
+
+ IEEE 802.1X Remote Authentication Dial In User Service (RADIUS)
+ Usage Guidelines
+
+Status of this Memo
+
+ This memo provides information for the Internet community. It does
+ not specify an Internet standard of any kind. Distribution of this
+ memo is unlimited.
+
+Copyright Notice
+
+ Copyright (C) The Internet Society (2003). All Rights Reserved.
+
+Abstract
+
+ This document provides suggestions on Remote Authentication Dial In
+ User Service (RADIUS) usage by IEEE 802.1X Authenticators. The
+ material in this document is also included within a non-normative
+ Appendix within the IEEE 802.1X specification, and is being presented
+ as an IETF RFC for informational purposes.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 1]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+Table of Contents
+
+ 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
+ 1.1. Terminology. . . . . . . . . . . . . . . . . . . . . . . 3
+ 1.2. Requirements Language. . . . . . . . . . . . . . . . . . 4
+ 2. RADIUS Accounting Attributes . . . . . . . . . . . . . . . . . 5
+ 2.1. Acct-Terminate-Cause . . . . . . . . . . . . . . . . . . 5
+ 2.2. Acct-Multi-Session-Id. . . . . . . . . . . . . . . . . . 6
+ 2.3. Acct-Link-Count. . . . . . . . . . . . . . . . . . . . . 7
+ 3. RADIUS Authentication. . . . . . . . . . . . . . . . . . . . . 7
+ 3.1. User-Name. . . . . . . . . . . . . . . . . . . . . . . . 8
+ 3.2. User-Password, CHAP-Password, CHAP-Challenge . . . . . . 8
+ 3.3. NAS-IP-Address, NAS-IPv6-Address . . . . . . . . . . . . 8
+ 3.4. NAS-Port . . . . . . . . . . . . . . . . . . . . . . . . 8
+ 3.5. Service-Type . . . . . . . . . . . . . . . . . . . . . . 8
+ 3.6. Framed-Protocol. . . . . . . . . . . . . . . . . . . . . 9
+ 3.7. Framed-IP-Address, Framed-IP-Netmask . . . . . . . . . . 9
+ 3.8. Framed-Routing . . . . . . . . . . . . . . . . . . . . . 9
+ 3.9. Filter-ID. . . . . . . . . . . . . . . . . . . . . . . . 9
+ 3.10. Framed-MTU . . . . . . . . . . . . . . . . . . . . . . . 9
+ 3.11. Framed-Compression . . . . . . . . . . . . . . . . . . . 10
+ 3.12. Displayable Messages . . . . . . . . . . . . . . . . . . 10
+ 3.13. Callback-Number, Callback-ID . . . . . . . . . . . . . . 10
+ 3.14. Framed-Route, Framed-IPv6-Route. . . . . . . . . . . . . 11
+ 3.15. State, Class, Proxy-State. . . . . . . . . . . . . . . . 11
+ 3.16. Vendor-Specific. . . . . . . . . . . . . . . . . . . . . 11
+ 3.17. Session-Timeout. . . . . . . . . . . . . . . . . . . . . 11
+ 3.18. Idle-Timeout . . . . . . . . . . . . . . . . . . . . . . 12
+ 3.19. Termination-Action . . . . . . . . . . . . . . . . . . . 12
+ 3.20. Called-Station-Id. . . . . . . . . . . . . . . . . . . . 12
+ 3.21. Calling-Station-Id . . . . . . . . . . . . . . . . . . . 12
+ 3.22. NAS-Identifier . . . . . . . . . . . . . . . . . . . . . 12
+ 3.23. NAS-Port-Type. . . . . . . . . . . . . . . . . . . . . . 12
+ 3.24. Port-Limit . . . . . . . . . . . . . . . . . . . . . . . 13
+ 3.25. Password-Retry . . . . . . . . . . . . . . . . . . . . . 13
+ 3.26. Connect-Info . . . . . . . . . . . . . . . . . . . . . . 13
+ 3.27. EAP-Message. . . . . . . . . . . . . . . . . . . . . . . 13
+ 3.28. Message-Authenticator. . . . . . . . . . . . . . . . . . 13
+ 3.29. NAS-Port-Id. . . . . . . . . . . . . . . . . . . . . . . 13
+ 3.30. Framed-Pool, Framed-IPv6-Pool. . . . . . . . . . . . . . 14
+ 3.31. Tunnel Attributes. . . . . . . . . . . . . . . . . . . . 14
+ 4. RC4 EAPOL-Key Descriptor . . . . . . . . . . . . . . . . . . . 15
+ 5. Security Considerations. . . . . . . . . . . . . . . . . . . . 18
+ 5.1. Packet Modification or Forgery . . . . . . . . . . . . . 18
+ 5.2. Dictionary Attacks . . . . . . . . . . . . . . . . . . . 19
+ 5.3. Known Plaintext Attacks. . . . . . . . . . . . . . . . . 19
+ 5.4. Replay . . . . . . . . . . . . . . . . . . . . . . . . . 20
+ 5.5. Outcome Mismatches . . . . . . . . . . . . . . . . . . . 20
+
+
+
+Congdon, et al. Informational [Page 2]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ 5.6. 802.11 Integration . . . . . . . . . . . . . . . . . . . 20
+ 5.7. Key Management Issues. . . . . . . . . . . . . . . . . . 21
+ 6. IANA Considerations. . . . . . . . . . . . . . . . . . . . . . 22
+ 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 22
+ 7.1. Normative References . . . . . . . . . . . . . . . . . . 22
+ 7.2. Informative References . . . . . . . . . . . . . . . . . 23
+ 8. Table of Attributes. . . . . . . . . . . . . . . . . . . . . . 25
+ 9. Intellectual Property Statement . . . . . . . . . . . . . . . 28
+ 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 28
+ 11. Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 29
+ 12. Full Copyright Statement . . . . . . . . . . . . . . . . . . . 30
+
+1. Introduction
+
+ IEEE 802.1X enables authenticated access to IEEE 802 media, including
+ Ethernet, Token Ring, and 802.11 wireless LANs. Although Remote
+ Authentication Dial In User Service (RADIUS) support is optional
+ within IEEE 802.1X, it is expected that many IEEE 802.1X
+ Authenticators will function as RADIUS clients.
+
+ IEEE 802.1X [IEEE8021X] provides "network port authentication" for
+ IEEE 802 [IEEE802] media, including Ethernet [IEEE8023], Token Ring
+ and 802.11 [IEEE80211] wireless LANS.
+
+ IEEE 802.1X does not require use of a backend Authentication Server,
+ and thus can be deployed with stand-alone bridges or Access Points,
+ as well as in centrally managed scenarios.
+
+ In situations where it is desirable to centrally manage
+ authentication, authorization and accounting (AAA) for IEEE 802
+ networks, deployment of a backend authentication and accounting
+ server is desirable. In such situations, it is expected that IEEE
+ 802.1X Authenticators will function as AAA clients.
+
+ This document provides suggestions on RADIUS usage by IEEE 802.1X
+ Authenticators. Support for any AAA protocol is optional for IEEE
+ 802.1X Authenticators, and therefore this specification has been
+ incorporated into a non-normative Appendix within the IEEE 802.1X
+ specification.
+
+1.1. Terminology
+
+ This document uses the following terms:
+
+ Access Point (AP)
+ A Station that provides access to the distribution services via
+ the wireless medium for associated Stations.
+
+
+
+
+Congdon, et al. Informational [Page 3]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ Association
+ The service used to establish Access Point/Station mapping and
+ enable Station invocation of the distribution system services.
+
+ Authenticator
+ An Authenticator is an entity that requires authentication from
+ the Supplicant. The Authenticator may be connected to the
+ Supplicant at the other end of a point-to-point LAN segment or
+ 802.11 wireless link.
+
+ Authentication Server
+ An Authentication Server is an entity that provides an
+ Authentication Service to an Authenticator. This service
+ verifies, from the credentials provided by the Supplicant, the
+ claim of identity made by the Supplicant.
+
+ Port Access Entity (PAE)
+ The protocol entity associated with a physical or virtual
+ (802.11) Port. A given PAE may support the protocol
+ functionality associated with the Authenticator, Supplicant or
+ both.
+
+ Station (STA)
+ Any device that contains an IEEE 802.11 conformant medium
+ access control (MAC) and physical layer (PHY) interface to the
+ wireless medium (WM).
+
+ Supplicant
+ A Supplicant is an entity that is being authenticated by an
+ Authenticator. The Supplicant may be connected to the
+ Authenticator at one end of a point-to-point LAN segment or
+ 802.11 wireless link.
+
+1.2. Requirements Language
+
+ In this document, several words are used to signify the requirements
+ of the specification. These words are often capitalized. The key
+ words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
+ "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document
+ are to be interpreted as described in [RFC2119].
+
+
+
+
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 4]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+2. RADIUS Accounting Attributes
+
+ With a few exceptions, the RADIUS accounting attributes defined in
+ [RFC2866], [RFC2867], and [RFC2869] have the same meaning within IEEE
+ 802.1X sessions as they do in dialup sessions and therefore no
+ additional commentary is needed.
+
+ Attributes requiring more discussion include:
+
+ Acct-Terminate-Cause
+ Acct-Multi-Session-Id
+ Acct-Link-Count
+
+2.1. Acct-Terminate-Cause
+
+ This attribute indicates how the session was terminated, as described
+ in [RFC2866]. [IEEE8021X] defines the following termination cause
+ values, which are shown with their RADIUS equivalents in the table on
+ the next page.
+
+ IEEE 802.1X RADIUS
+ dot1xAuthSessionTerminateCause Acct-Terminate-Cause
+ Value Value
+ ------------- --------------------
+ SupplicantLogoff(1) User Request (1)
+ portFailure(2) Lost Carrier (2)
+ SupplicantRestart(3) Supplicant Restart (19)
+ reauthFailed(4) Reauthentication Failure (20)
+ authControlForceUnauth(5) Admin Reset (6)
+ portReInit(6) Port Reinitialized (21)
+ portAdminDisabled(7) Port Administratively Disabled (22)
+ notTerminatedYet(999) N/A
+
+ When using this attribute, the User Request (1) termination cause
+ corresponds to the situation in which the session terminated due to
+ an EAPOL-Logoff received from the Supplicant. When a session is
+ moved due to roaming, the EAPOL state machines will treat this as a
+ Supplicant Logoff.
+
+ A Lost Carrier (2) termination cause indicates session termination
+ due to loss of physical connectivity for reasons other than roaming
+ between Access Points. For example, if the Supplicant disconnects a
+ point-to-point LAN connection, or moves out of range of an Access
+ Point, this termination cause is used. Lost Carrier (2) therefore
+ equates to a Port Disabled condition in the EAPOL state machines.
+
+ A Supplicant Restart (19) termination cause indicates
+ re-initialization of the Supplicant state machines.
+
+
+
+Congdon, et al. Informational [Page 5]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ A Reauthentication Failure (20) termination cause indicates that a
+ previously authenticated Supplicant has failed to re-authenticate
+ successfully following expiry of the re-authentication timer or
+ explicit re-authentication request by management action.
+
+ Within [IEEE80211], periodic re-authentication may be useful in
+ preventing reuse of an initialization vector with a given key. Since
+ successful re-authentication does not result in termination of the
+ session, accounting packets are not sent as a result of
+ re-authentication unless the status of the session changes. For
+ example:
+
+ a. The session is terminated due to re-authentication failure. In
+ this case the Reauthentication Failure (20) termination cause is
+ used.
+
+ b. The authorizations are changed as a result of a successful
+ re-authentication. In this case, the Service Unavailable (15)
+ termination cause is used. For accounting purposes, the portion
+ of the session after the authorization change is treated as a
+ separate session.
+
+ Where IEEE 802.1X authentication occurs prior to association,
+ accounting packets are not sent until an association occurs.
+
+ An Admin Reset (6) termination cause indicates that the Port has been
+ administratively forced into the unauthorized state.
+
+ A Port Reinitialized (21) termination cause indicates that the Port's
+ MAC has been reinitialized.
+
+ A Port Administratively Disabled (22) termination cause indicates
+ that the Port has been administratively disabled.
+
+2.2. Acct-Multi-Session-Id
+
+ The purpose of this attribute is to make it possible to link together
+ multiple related sessions. While [IEEE8021X] does not act on
+ aggregated ports, it is possible for a Supplicant roaming between
+ Access Points to cause multiple RADIUS accounting packets to be sent
+ by different Access Points.
+
+ Where supported by the Access Points, the Acct-Multi-Session-Id
+ attribute can be used to link together the multiple related sessions
+ of a roaming Supplicant. In such a situation, if the session context
+ is transferred between Access Points, accounting packets MAY be sent
+ without a corresponding authentication and authorization exchange,
+
+
+
+
+Congdon, et al. Informational [Page 6]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ provided that Association has occurred. However, in such a situation
+ it is assumed that the Acct-Multi-Session-Id is transferred between
+ the Access Points as part of the Inter-Access Point Protocol (IAPP).
+
+ If the Acct-Multi-Session-Id were not unique between Access Points,
+ then it is possible that the chosen Acct-Multi-Session-Id will
+ overlap with an existing value allocated on that Access Point, and
+ the Accounting Server would therefore be unable to distinguish a
+ roaming session from a multi-link session.
+
+ As a result, the Acct-Multi-Session-Id attribute is unique among all
+ the bridges or Access Points, Supplicants and sessions. In order to
+ provide this uniqueness, it is suggested that the Acct-Multi-
+ Session-Id be of the form:
+
+ Original AP MAC Address | Supplicant MAC Address | NTP Timestamp
+
+ Here "|" represents concatenation, the original AP MAC Address is the
+ MAC address of the bridge or Access Point at which the session
+ started, and the 64-bit NTP timestamp indicates the beginning of the
+ original session. In order to provide for consistency of the Acct-
+ Multi-Session-Id between roaming sessions, the Acct-Multi-Session-Id
+ may be moved between Access Points as part of IAPP or another handoff
+ scheme.
+
+ The use of an Acct-Multi-Session-Id of this form guarantees
+ uniqueness among all Access Points, Supplicants and sessions. Since
+ the NTP timestamp does not wrap on reboot, there is no possibility
+ that a rebooted Access Point could choose an Acct-Multi-Session-Id
+ that could be confused with that of a previous session.
+
+ Since the Acct-Multi-Session-Id is of type String as defined in
+ [RFC2866], for use with IEEE 802.1X, it is encoded as an ASCII string
+ of Hex digits. Example: "00-10-A4-23-19-C0-00-12-B2-
+ 14-23-DE-AF-23-83-C0-76-B8-44-E8"
+
+2.3. Acct-Link-Count
+
+ The Acct-Link-Count attribute may be used to account for the number
+ of ports that have been aggregated.
+
+3. RADIUS Authentication
+
+ This section describes how attributes defined in [RFC2865],
+ [RFC2867], [RFC2868], [RFC2869], [RFC3162] and [RFC3579] are used in
+ IEEE 802.1X authentication.
+
+
+
+
+
+Congdon, et al. Informational [Page 7]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+3.1. User-Name
+
+ In IEEE 802.1X, the Supplicant typically provides its identity via an
+ EAP-Response/Identity message. Where available, the Supplicant
+ identity is included in the User-Name attribute, and included in the
+ RADIUS Access-Request and Access-Reply messages as specified in
+ [RFC2865] and [RFC3579].
+
+ Alternatively, as discussed in [RFC3579] Section 2.1., the User-Name
+ attribute may contain the Calling-Station-ID value, which is set to
+ the Supplicant MAC address.
+
+3.2. User-Password, CHAP-Password, CHAP-Challenge
+
+ Since IEEE 802.1X does not support PAP or CHAP authentication, the
+ User-Password, CHAP-Password or CHAP-Challenge attributes are not
+ used by IEEE 802.1X Authenticators acting as RADIUS clients.
+
+3.3. NAS-IP-Address, NAS-IPv6-Address
+
+ For use with IEEE 802.1X, the NAS-IP-Address contains the IPv4
+ address of the bridge or Access Point acting as an Authenticator, and
+ the NAS-IPv6-Address contains the IPv6 address. If the IEEE 802.1X
+ Authenticator has more than one interface, it may be desirable to use
+ a loopback address for this purpose so that the Authenticator will
+ still be reachable even if one of the interfaces were to fail.
+
+3.4. NAS-Port
+
+ For use with IEEE 802.1X the NAS-Port will contain the port number of
+ the bridge, if this is available. While an Access Point does not
+ have physical ports, a unique "association ID" is assigned to every
+ mobile Station upon a successful association exchange. As a result,
+ for an Access Point, if the association exchange has been completed
+ prior to authentication, the NAS-Port attribute will contain the
+ association ID, which is a 16-bit unsigned integer. Where IEEE
+ 802.1X authentication occurs prior to association, a unique NAS-Port
+ value may not be available.
+
+3.5. Service-Type
+
+ For use with IEEE 802.1X, the Framed (2), Authenticate Only (8), and
+ Call Check (10) values are most commonly used.
+
+ A Service-Type of Framed indicates that appropriate 802 framing
+ should be used for the connection. A Service-Type of Authenticate
+ Only (8) indicates that no authorization information needs to be
+ returned in the Access-Accept. As described in [RFC2865], a
+
+
+
+Congdon, et al. Informational [Page 8]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ Service-Type of Call Check is included in an Access-Request packet to
+ request that the RADIUS server accept or reject the connection
+ attempt, typically based on the Called-Station-ID (set to the bridge
+ or Access Point MAC address) or Calling-Station-ID attributes (set to
+ the Supplicant MAC address). As noted in [RFC2865], it is
+ recommended that in this case, the User-Name attribute be given the
+ value of Calling-Station-Id.
+
+3.6. Framed-Protocol
+
+ Since there is no value for IEEE 802 media, the Framed-Protocol
+ attribute is not used by IEEE 802.1X Authenticators.
+
+3.7. Framed-IP-Address, Framed-IP-Netmask
+
+ IEEE 802.1X does not provide a mechanism for IP address assignment.
+ Therefore the Framed-IP-Address and Framed-IP-Netmask attributes can
+ only be used by IEEE 802.1X Authenticators that support IP address
+ assignment mechanisms. Typically this capability is supported by
+ layer 3 devices.
+
+3.8. Framed-Routing
+
+ The Framed-Routing attribute indicates the routing method for the
+ Supplicant. It is therefore only relevant for IEEE 802.1X
+ Authenticators that act as layer 3 devices, and cannot be used by a
+ bridge or Access Point.
+
+3.9. Filter-ID
+
+ This attribute indicates the name of the filter list to be applied to
+ the Supplicant's session. For use with an IEEE 802.1X Authenticator,
+ it may be used to indicate either layer 2 or layer 3 filters. Layer
+ 3 filters are typically only supported on IEEE 802.1X Authenticators
+ that act as layer 3 devices.
+
+3.10. Framed-MTU
+
+ This attribute indicates the maximum size of an IP packet that may be
+ transmitted over the wire between the Supplicant and the
+ Authenticator. IEEE 802.1X Authenticators set this to the value
+ corresponding to the relevant 802 medium, and include it in the
+ RADIUS Access-Request. The RADIUS server may send an EAP packet as
+ large as Framed-MTU minus four (4) octets, taking into account the
+ additional overhead for the IEEE 802.1X Version (1), Type (1) and
+ Body Length (2) fields. For EAP over IEEE 802 media, the Framed-MTU
+ values (which do not include LLC/SNAP overhead) and maximum frame
+ length values (not including the preamble) are as follows:
+
+
+
+Congdon, et al. Informational [Page 9]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ Maximum Frame
+ Media Framed-MTU Length
+ ========= =============== ==============
+ Ethernet 1500 1522
+ 802.3 1500 1522
+ 802.4 8174 8193
+ 802.5 (4 Mbps) 4528 4550
+ 802.5 (16 Mbps) 18173 18200
+ 802.5 (100 Mb/s) 18173 18200
+ 802.6 9191 9240
+ 802.9a 1500 1518
+ 802.11 2304 2346
+ 802.12 (Ethernet) 1500 1518
+ 802.12 (Token Ring) 4502 4528
+ FDDI 4479 4500
+
+ NOTE - the Framed-MTU size for IEEE 802.11 media may change as a
+ result of ongoing work being undertaken in the IEEE 802.11 Working
+ Group. Since some 802.11 stations cannot handle an MTU larger than
+ 1500 octets, it is recommended that RADIUS servers encountering a
+ NAS-Port-Type value of 802.11 send EAP packets no larger than 1496
+ octets.
+
+3.11. Framed-Compression
+
+ [IEEE8021X] does not include compression support. Therefore this
+ attribute is not understood by [IEEE8021X] Authenticators.
+
+3.12. Displayable Messages
+
+ The Reply-Message attribute, defined in section 5.18 of [RFC2865],
+ indicates text which may be displayed to the user. This is similar
+ in concept to the EAP Notification Type, defined in [RFC2284]. As
+ noted in [RFC3579], Section 2.6.5, when sending a displayable message
+ to an [IEEE8021X] Authenticator, displayable messages are best sent
+ within EAP-Message/EAP-Request/Notification attribute(s), and not
+ within Reply-Message attribute(s).
+
+3.13. Callback-Number, Callback-ID
+
+ These attributes are not understood by IEEE 802.1X Authenticators.
+
+
+
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 10]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+3.14. Framed-Route, Framed-IPv6-Route
+
+ The Framed-Route and Framed-IPv6-Route attributes provide routes that
+ are to be configured for the Supplicant. These attributes are
+ therefore only relevant for IEEE 802.1X Authenticators that act as
+ layer 3 devices, and cannot be understood by a bridge or Access
+ Point.
+
+3.15. State, Class, Proxy-State
+
+ These attributes are used for the same purposes as described in
+ [RFC2865].
+
+3.16. Vendor-Specific
+
+ Vendor-specific attributes are used for the same purposes as
+ described in [RFC2865]. The MS-MPPE-Send-Key and MS-MPPE-Recv-Key
+ attributes, described in section 2.4 of [RFC2548], MAY be used to
+ encrypt and authenticate the RC4 EAPOL-Key descriptor [IEEE8021X,
+ Section 7.6]. Examples of the derivation of the MS-MPPE-Send-Key and
+ MS-MPPE-Recv-Key attributes from the master key negotiated by an EAP
+ method are given in [RFC2716]. Details of the EAPOL-Key descriptor
+ are provided in Section 4.
+
+3.17. Session-Timeout
+
+ When sent along in an Access-Accept without a Termination-Action
+ attribute or with a Termination-Action attribute set to Default, the
+ Session-Timeout attribute specifies the maximum number of seconds of
+ service provided prior to session termination.
+
+ When sent in an Access-Accept along with a Termination-Action value
+ of RADIUS-Request, the Session-Timeout attribute specifies the
+ maximum number of seconds of service provided prior to re-
+ authentication. In this case, the Session-Timeout attribute is used
+ to load the reAuthPeriod constant within the Reauthentication Timer
+ state machine of 802.1X. When sent with a Termination-Action value
+ of RADIUS-Request, a Session-Timeout value of zero indicates the
+ desire to perform another authentication (possibly of a different
+ type) immediately after the first authentication has successfully
+ completed.
+
+ When sent in an Access-Challenge, this attribute represents the
+ maximum number of seconds that an IEEE 802.1X Authenticator should
+ wait for an EAP-Response before retransmitting. In this case, the
+ Session-Timeout attribute is used to load the suppTimeout constant
+ within the backend state machine of IEEE 802.1X.
+
+
+
+
+Congdon, et al. Informational [Page 11]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+3.18. Idle-Timeout
+
+ The Idle-Timeout attribute is described in [RFC2865]. For IEEE 802
+ media other than 802.11 the media are always on. As a result the
+ Idle-Timeout attribute is typically only used with wireless media
+ such as IEEE 802.11. It is possible for a wireless device to wander
+ out of range of all Access Points. In this case, the Idle-Timeout
+ attribute indicates the maximum time that a wireless device may
+ remain idle.
+
+3.19. Termination-Action
+
+ This attribute indicates what action should be taken when the service
+ is completed. The value RADIUS-Request (1) indicates that re-
+ authentication should occur on expiration of the Session-Time. The
+ value Default (0) indicates that the session should terminate.
+
+3.20. Called-Station-Id
+
+ For IEEE 802.1X Authenticators, this attribute is used to store the
+ bridge or Access Point MAC address in ASCII format (upper case only),
+ with octet values separated by a "-". Example: "00-10-A4-23-19-C0".
+ In IEEE 802.11, where the SSID is known, it SHOULD be appended to the
+ Access Point MAC address, separated from the MAC address with a ":".
+ Example "00-10-A4-23-19-C0:AP1".
+
+3.21. Calling-Station-Id
+
+ For IEEE 802.1X Authenticators, this attribute is used to store the
+ Supplicant MAC address in ASCII format (upper case only), with octet
+ values separated by a "-". Example: "00-10-A4-23-19-C0".
+
+3.22. NAS-Identifier
+
+ This attribute contains a string identifying the IEEE 802.1X
+ Authenticator originating the Access-Request.
+
+3.23. NAS-Port-Type
+
+ For use with IEEE 802.1X, NAS-Port-Type values of Ethernet (15)
+ Wireless - IEEE 802.11 (19), Token Ring (20) and FDDI (21) may be
+ used.
+
+
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 12]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+3.24. Port-Limit
+
+ This attribute has no meaning when sent to an [IEEE8021X]
+ Authenticator.
+
+3.25. Password-Retry
+
+ In IEEE 802.1X, the Authenticator always transitions to the HELD
+ state after an authentication failure. Thus this attribute does not
+ make sense for IEEE 802.1X.
+
+3.26. Connect-Info
+
+ This attribute is sent by a bridge or Access Point to indicate the
+ nature of the Supplicant's connection. When sent in the Access-
+ Request it is recommended that this attribute contain information on
+ the speed of the Supplicant's connection. For 802.11, the following
+ format is recommended: "CONNECT 11Mbps 802.11b". If sent in the
+ Accounting STOP, this attribute may be used to summarize statistics
+ relating to session quality. For example, in IEEE 802.11, the
+ Connect-Info attribute may contain information on the number of link
+ layer retransmissions. The exact format of this attribute is
+ implementation specific.
+
+3.27. EAP-Message
+
+ Since IEEE 802.1X provides for encapsulation of EAP as described in
+ [RFC2284] and [IEEE8021X], the EAP-Message attribute defined in
+ [RFC3579] is used to encapsulate EAP packets for transmission from
+ the IEEE 802.1X Authenticator to the Authentication Server. [RFC3579]
+ Section 2.2. describes how the Authentication Server handles invalid
+ EAP packets passed to it by the Authenticator.
+
+3.28. Message-Authenticator
+
+ As noted in [RFC3579] Section 3.1., the Message-Authenticator
+ attribute MUST be used to protect packets within a RADIUS/EAP
+ conversation.
+
+3.29. NAS-Port-Id
+
+ This attribute is used to identify the IEEE 802.1X Authenticator port
+ which authenticates the Supplicant. The NAS-Port-Id differs from the
+ NAS-Port in that it is a string of variable length whereas the NAS-
+ Port is a 4 octet value.
+
+
+
+
+
+
+Congdon, et al. Informational [Page 13]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+3.30. Framed-Pool, Framed-IPv6-Pool
+
+ IEEE 802.1X does not provide a mechanism for IP address assignment.
+ Therefore the Framed-Pool and Framed-IPv6-Pool attributes can only be
+ used by IEEE 802.1X Authenticators that support IP address assignment
+ mechanisms. Typically this capability is supported by layer 3
+ devices.
+
+3.31. Tunnel Attributes
+
+ Reference [RFC2868] defines RADIUS tunnel attributes used for
+ authentication and authorization, and [RFC2867] defines tunnel
+ attributes used for accounting. Where the IEEE 802.1X Authenticator
+ supports tunneling, a compulsory tunnel may be set up for the
+ Supplicant as a result of the authentication.
+
+ In particular, it may be desirable to allow a port to be placed into
+ a particular Virtual LAN (VLAN), defined in [IEEE8021Q], based on the
+ result of the authentication. This can be used, for example, to
+ allow a wireless host to remain on the same VLAN as it moves within a
+ campus network.
+
+ The RADIUS server typically indicates the desired VLAN by including
+ tunnel attributes within the Access-Accept. However, the IEEE 802.1X
+ Authenticator may also provide a hint as to the VLAN to be assigned
+ to the Supplicant by including Tunnel attributes within the Access-
+ Request.
+
+ For use in VLAN assignment, the following tunnel attributes are used:
+
+ Tunnel-Type=VLAN (13)
+ Tunnel-Medium-Type=802
+ Tunnel-Private-Group-ID=VLANID
+
+ Note that the VLANID is 12-bits, taking a value between 1 and 4094,
+ inclusive. Since the Tunnel-Private-Group-ID is of type String as
+ defined in [RFC2868], for use with IEEE 802.1X, the VLANID integer
+ value is encoded as a string.
+
+ When Tunnel attributes are sent, it is necessary to fill in the Tag
+ field. As noted in [RFC2868], section 3.1:
+
+ The Tag field is one octet in length and is intended to provide a
+ means of grouping attributes in the same packet which refer to the
+ same tunnel. Valid values for this field are 0x01 through 0x1F,
+ inclusive. If the Tag field is unused, it MUST be zero (0x00).
+
+
+
+
+
+Congdon, et al. Informational [Page 14]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ For use with Tunnel-Client-Endpoint, Tunnel-Server-Endpoint, Tunnel-
+ Private-Group-ID, Tunnel-Assignment-ID, Tunnel-Client-Auth-ID or
+ Tunnel-Server-Auth-ID attributes (but not Tunnel-Type, Tunnel-
+ Medium-Type, Tunnel-Password, or Tunnel-Preference), a tag field of
+ greater than 0x1F is interpreted as the first octet of the following
+ field.
+
+ Unless alternative tunnel types are provided, (e.g. for IEEE 802.1X
+ Authenticators that may support tunneling but not VLANs), it is only
+ necessary for tunnel attributes to specify a single tunnel. As a
+ result, where it is only desired to specify the VLANID, the tag field
+ SHOULD be set to zero (0x00) in all tunnel attributes. Where
+ alternative tunnel types are to be provided, tag values between 0x01
+ and 0x1F SHOULD be chosen.
+
+4. RC4 EAPOL-Key Frame
+
+ The RC4 EAPOL-Key frame is created and transmitted by the
+ Authenticator in order to provide media specific key information.
+ For example, within 802.11 the RC4 EAPOL-Key frame can be used to
+ distribute multicast/broadcast ("default") keys, or unicast ("key
+ mapping") keys. The "default" key is the same for all Stations
+ within a broadcast domain.
+
+ The RC4 EAPOL-Key frame is not acknowledged and therefore the
+ Authenticator does not know whether the Supplicant has received it.
+ If it is lost, then the Supplicant and Authenticator will not have
+ the same keying material, and communication will fail. If this
+ occurs, the problem is typically addressed by re-running the
+ authentication.
+
+ The RC4 EAPOL-Key frame is sent from the Authenticator to the
+ Supplicant in order to provision the "default" key, and subsequently
+ in order to refresh the "default" key. It may also be used to
+ refresh the key-mapping key. Rekey is typically only required with
+ weak ciphersuites such as WEP, defined in [IEEE80211].
+
+ Where keys are required, an EAP method that derives keys is typically
+ selected. Therefore the initial "key mapping" keys can be derived
+ from EAP keying material, without requiring the Authenticator to send
+ an RC4 EAPOL-Key frame to the Supplicant. An example of how EAP
+ keying material can be derived and used is presented in [RFC2716].
+
+
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 15]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ While the RC4 EAPOL-Key frame is defined in [IEEE8021X], a more
+ complete description is provided on the next page.
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Version | Packet Type | Packet Body Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Type | Key Length |Replay Counter...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Replay Counter...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Replay Counter | Key IV...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key IV...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key IV...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key IV...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key IV... |F| Key Index |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key Signature...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key Signature...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key Signature...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key Signature...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Key...
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Version
+ The Version field is one octet. For IEEE 802.1X, it contains the
+ value 0x01.
+
+ Packet Type
+ The Packet Type field is one octet, and determines the type of
+ packet being transmitted. For an EAPOL-Key Descriptor, the Packet
+ Type field contains 0x03.
+
+ Packet Body Length
+ The Packet Body Length is two octets, and contains the length of
+ the EAPOL-Key descriptor in octets, not including the Version,
+ Packet Type and Packet Body Length fields.
+
+
+
+
+
+Congdon, et al. Informational [Page 16]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ Type
+ The Type field is a single octet. The Key descriptor is defined
+ differently for each Type; this specification documents only the
+ RC4 Key Descriptor (Type = 0x01).
+
+ Key Length
+ The Key Length field is two octets. If Packet Body Length = 44 +
+ Key Length, then the Key Field contains the key in encrypted form,
+ of length Key Length. This is 5 octets (40 bits) for WEP, and 13
+ octets (104 bits) for WEP-128. If Packet Body Length = 44, then
+ the Key field is absent, and Key Length represents the number of
+ least significant octets from the MS-MPPE-Send-Key attribute
+ [RFC2548] to be used as the keying material. Note that the MS-
+ MPPE-Send-Key and MS-MPPE-Recv-Key attributes are defined from the
+ point of view of the Authenticator. From the Supplicant point of
+ reference, the terms are reversed. Thus the MS-MPPE-Recv-Key on
+ the Supplicant corresponds to the MS-MPPE-Send-Key on the
+ Authenticator, and the MS-MPPE-Send-Key on the Supplicant
+ corresponds to the MS-MPPE-Recv-Key on the Authenticator.
+
+ Replay Counter
+ The Replay Counter field is 8 octets. It does not repeat within
+ the life of the keying material used to encrypt the Key field and
+ compute the Key Signature field. A 64-bit NTP timestamp MAY be
+ used as the Replay Counter.
+
+ Key IV
+ The Key IV field is 16 octets and includes a 128-bit
+ cryptographically random number.
+
+ F
+ The Key flag (F) is a single bit, describing the type of key that
+ is included in the Key field. Values are:
+
+ 0 = for broadcast (default key)
+ 1 = for unicast (key mapping key)
+
+ Key Index
+ The Key Index is 7 bits.
+
+ Key Signature
+ The Key Signature field is 16 octets. It contains an HMAC-MD5
+ message integrity check computed over the EAPOL-Key descriptor,
+ starting from the Version field, with the Key field filled in if
+ present, but with the Key Signature field set to zero. For the
+ computation, the 32 octet (256 bit) MS-MPPE-Send-Key [RFC2548] is
+ used as the HMAC-MD5 key.
+
+
+
+
+Congdon, et al. Informational [Page 17]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ Key
+ If Packet Body Length = 44 + Key Length, then the Key Field
+ contains the key in encrypted form, of length Key Length. If
+ Packet Body Length = 44, then the Key field is absent, and the
+ least significant Key Length octets from the MS-MPPE-Send-Key
+ attribute is used as the keying material. Where the Key field is
+ encrypted using RC4, the RC4 encryption key used to encrypt this
+ field is formed by concatenating the 16 octet (128 bit) Key-IV
+ field with the 32 octet MS-MPPE-Recv-Key attribute. This yields a
+ 48 octet RC4 key (384 bits).
+
+5. Security Considerations
+
+ Since this document describes the use of RADIUS for purposes of
+ authentication, authorization, and accounting in IEEE 802.1X-enabled
+ networks, it is vulnerable to all of the threats that are present in
+ other RADIUS applications. For a discussion of these threats, see
+ [RFC2607], [RFC2865], [RFC3162], [RFC3579], and [RFC3576].
+
+ Vulnerabilities include:
+
+ Packet modification or forgery
+ Dictionary attacks
+ Known plaintext attacks
+ Replay
+ Outcome mismatches
+ 802.11 integration
+ Key management issues
+
+5.1. Packet Modification or Forgery
+
+ RADIUS, defined in [RFC2865], does not require all Access-Requests to
+ be authenticated or integrity protected. However, IEEE 802.1X is
+ based on EAP. As described in [3579], Section 3.1.:
+
+ The Message-Authenticator attribute MUST be used to protect all
+ Access-Request, Access-Challenge, Access-Accept, and Access-Reject
+ packets containing an EAP-Message attribute.
+
+ As a result, when used with IEEE 802.1X, all RADIUS packets MUST be
+ authenticated and integrity protected. In addition, as described in
+ [3579], Section 4.2.:
+
+ To address the security vulnerabilities of RADIUS/EAP,
+ implementations of this specification SHOULD support IPsec
+ [RFC2401] along with IKE [RFC2409] for key management. IPsec ESP
+ [RFC2406] with non-null transform SHOULD be supported, and IPsec
+ ESP with a non-null encryption transform and authentication
+
+
+
+Congdon, et al. Informational [Page 18]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ support SHOULD be used to provide per-packet confidentiality,
+ authentication, integrity and replay protection. IKE SHOULD be
+ used for key management.
+
+5.2. Dictionary Attacks
+
+ As discussed in [RFC3579] Section 4.3.3., the RADIUS shared secret is
+ vulnerable to offline dictionary attack, based on capture of the
+ Response Authenticator or Message-Authenticator attribute. In order
+ to decrease the level of vulnerability, [RFC2865], Section 3
+ recommends:
+
+ The secret (password shared between the client and the RADIUS
+ server) SHOULD be at least as large and unguessable as a well-
+ chosen password. It is preferred that the secret be at least 16
+ octets.
+
+ In addition, the risk of an offline dictionary attack can be further
+ mitigated by employing IPsec ESP with a non-null transform in order
+ to encrypt the RADIUS conversation, as described in [RFC3579],
+ Section 4.2.
+
+5.3. Known Plaintext Attacks
+
+ Since IEEE 802.1X is based on EAP, which does not support PAP, the
+ RADIUS User-Password attribute is not used to carry hidden user
+ passwords. The hiding mechanism utilizes MD5, defined in [RFC1321],
+ in order to generate a key stream based on the RADIUS shared secret
+ and the Request Authenticator. Where PAP is in use, it is possible
+ to collect key streams corresponding to a given Request Authenticator
+ value, by capturing RADIUS conversations corresponding to a PAP
+ authentication attempt using a known password. Since the User-
+ Password is known, the key stream corresponding to a given Request
+ Authenticator can be determined and stored.
+
+ The vulnerability is described in detail in [RFC3579], Section 4.3.4.
+ Even though IEEE 802.1X Authenticators do not support PAP
+ authentication, a security vulnerability can still exist where the
+ same RADIUS shared secret is used for hiding User-Password as well as
+ other attributes. This can occur, for example, if the same RADIUS
+ proxy handles authentication requests for both IEEE 802.1X (which may
+ hide the Tunnel-Password, MS-MPPE-Send-Key and MS-MPPE-Recv-Key
+ attributes) and GPRS (which may hide the User-Password attribute).
+
+ The threat can be mitigated by protecting RADIUS with IPsec ESP with
+ a non-null transform, as described in [RFC3579], Section 4.2. In
+ addition, the same RADIUS shared secret MUST NOT be used for both
+ IEEE 802.1X authentication and PAP authentication.
+
+
+
+Congdon, et al. Informational [Page 19]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+5.4. Replay
+
+ As noted in [RFC3579] Section 4.3.5., the RADIUS protocol provides
+ only limited support for replay protection. Replay protection for
+ RADIUS authentication and accounting can be provided by enabling
+ IPsec replay protection with RADIUS, as described in [RFC3579],
+ Section 4.2.
+
+ As with the Request Authenticator, for use with IEEE 802.1X
+ Authenticators, the Acct-Session-Id SHOULD be globally and temporally
+ unique.
+
+5.5. Outcome Mismatches
+
+ [RFC3579] Section 2.6.3. discusses the issues that arise when the EAP
+ packet encapsulated in an EAP-Message attribute does not agree with
+ the RADIUS Packet Type. For example, an EAP Success packet might be
+ encapsulated within an Access-Reject; an EAP Failure might be sent
+ within an Access-Accept; or an EAP Success or Failure might be sent
+ within an Access-Challenge.
+
+ As described in [RFC3579] Section 2.6.3., these conflicting messages
+ are likely to cause confusion. To ensure that access decisions made
+ by IEEE 802.1X Authenticators conform to the wishes of the RADIUS
+ server, it is necessary for the Authenticator to make the decision
+ solely based on the authentication result (Access-Accept/Reject) and
+ not based on the contents of EAP-Message attributes, if present.
+
+5.6. 802.11 Integration
+
+ [IEEE8021X] was developed for use on wired IEEE 802 networks such as
+ Ethernet, and therefore does not describe how to securely adapt IEEE
+ 802.1X for use with 802.11. This is left to an enhanced security
+ specification under development within IEEE 802.11.
+
+ For example, [IEEE8021X] does not specify whether authentication
+ occurs prior to, or after association, nor how the derived keys are
+ used within various ciphersuites. It also does not specify
+ ciphersuites addressing the vulnerabilities discovered in WEP,
+ described in [Berkeley], [Arbaugh], [Fluhrer], and [Stubbl].
+ [IEEE8021X] only defines an authentication framework, leaving the
+ definition of the authentication methods to other documents, such as
+ [RFC2716].
+
+ Since [IEEE8021X] does not address 802.11 integration issues,
+ implementors are strongly advised to consult additional IEEE 802.11
+ security specifications for guidance on how to adapt IEEE 802.1X for
+ use with 802.11. For example, it is likely that the IEEE 802.11
+
+
+
+Congdon, et al. Informational [Page 20]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ enhanced security specification will define its own IEEE 802.11 key
+ hierarchy as well as new EAPOL-Key descriptors.
+
+5.7. Key Management Issues
+
+ The EAPOL-Key descriptor described in Section 4. is likely to be
+ deprecated in the future, when the IEEE 802.11 enhanced security
+ group completes its work. Known security issues include:
+
+ [1] Default key-only support. IEEE 802.1X enables the derivation of
+ per-Station unicast keys, known in [IEEE80211] as "key mapping
+ keys." Keys used to encrypt multicast/broadcast traffic are
+ known as "default keys". However, in some 802.11
+ implementations, the unicast keys, derived as part of the EAP
+ authentication process, are used solely in order to encrypt,
+ authenticate and integrity protect the EAPOL-Key descriptor, as
+ described in Section 4. These implementations only support use
+ of default keys (ordinarily only used with multicast/broadcast
+ traffic) to secure all traffic, unicast or multicast/broadcast,
+ resulting in inherent security weaknesses.
+
+ Where per-Station key-mapping keys (e.g. unicast keys) are
+ unsupported, any Station possessing the default key can decrypt
+ traffic from other Stations or impersonate them. When used
+ along with a weak cipher (e.g. WEP), implementations supporting
+ only default keys provide more material for attacks such as
+ those described in [Fluhrer] and [Stubbl]. If in addition, the
+ default key is not refreshed periodically, IEEE 802.1X dynamic
+ key derivation provides little or no security benefit. For an
+ understanding of the issues with WEP, see [Berkeley], [Arbaugh],
+ [Fluhrer], and [Stubbl].
+
+ [2] Reuse of keying material. The EAPOL-Key descriptor specified in
+ section 4 uses the same keying material (MS-MPPE-Recv-Key) both
+ to encrypt the Key field within the EAPOL-Key descriptor, and to
+ encrypt data passed between the Station and Access Point.
+ Multi-purpose keying material is frowned upon, since multiple
+ uses can leak information helpful to an attacker.
+
+ [3] Weak algorithms. The algorithm used to encrypt the Key field
+ within the EAPOL-Key descriptor is similar to the algorithm used
+ in WEP, and as a result, shares some of the same weaknesses. As
+ with WEP, the RC4 stream cipher is used to encrypt the key. As
+ input to the RC4 engine, the IV and key are concatenated rather
+ than being combined within a mixing function. As with WEP, the
+ IV is not a counter, and therefore there is little protection
+ against reuse.
+
+
+
+
+Congdon, et al. Informational [Page 21]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ As a result of these vulnerabilities, implementors intending to use
+ the EAPOL-Key descriptor described in this document are urged to
+ consult the 802.11 enhanced security specification for a more secure
+ alternative. It is also advisable to consult the evolving literature
+ on WEP vulnerabilities, in order to better understand the risks, as
+ well as to obtain guidance on setting an appropriate re-keying
+ interval.
+
+6. IANA Considerations
+
+ This specification does not create any RADIUS attributes nor any new
+ number spaces for IANA administration. However, it does require
+ assignment of new values to existing RADIUS attributes. These
+ include:
+
+ Attribute Values Required
+ ========= ===============
+ NAS-Port-Type Token-Ring (20), FDDI (21)
+ Tunnel-Type VLAN (13)
+ Acct-Terminate-Cause Supplicant Restart (19)
+ Reauthentication Failure (20)
+ Port Reinitialized (21)
+ Port Administratively Disabled (22)
+
+7. References
+
+7.1. Normative References
+
+ [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC
+ 1321, April 1992.
+
+ [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
+ Requirement Levels", BCP 14, RFC 2119, March 1997.
+
+ [RFC2284] Blunk, L. and J. Vollbrecht, "PPP Extensible
+ Authentication Protocol (EAP)", RFC 2284, March 1998.
+
+ [RFC2865] Rigney, C., Willens, S., Rubens, A. and W. Simpson,
+ "Remote Authentication Dial In User Service (RADIUS)",
+ RFC 2865, June 2000.
+
+ [RFC2866] Rigney, C., "RADIUS Accounting", RFC 2866, June 2000.
+
+ [RFC2867] Zorn, G., Aboba, B. and D. Mitton, "RADIUS Accounting
+ Modifications for Tunnel Protocol Support", RFC 2867,
+ June 2000.
+
+
+
+
+
+Congdon, et al. Informational [Page 22]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ [RFC2868] Zorn, G., Leifer, D., Rubens, A., Shriver, J.,
+ Holdrege, M. and I. Goyret, "RADIUS Attributes for
+ Tunnel Protocol Support", RFC 2868, June 2000.
+
+ [RFC2869] Rigney, C., Willats, W. and P. Calhoun, "RADIUS
+ Extensions", RFC 2869, June 2000.
+
+ [RFC3162] Aboba, B., Zorn, G. and D. Mitton, "RADIUS and IPv6",
+ RFC 3162, August 2001.
+
+ [RFC3280] Housley, R., Polk, W., Ford, W. and D. Solo, "Internet
+ X.509 Public Key Infrastructure Certificate and
+ Certificate Revocation List (CRL) Profile", RFC 3280,
+ April 2002.
+
+ [RFC3576] Chiba, M., Dommety, G., Eklund, M., Mitton, D. and B.
+ Aboba, "Dynamic Authorization Extensions to Remote
+ Authentication Dial In User Service (RADIUS)", RFC
+ 3576, July 2003.
+
+ [RFC3579] Aboba, B. and P. Calhoun, "RADIUS (Remote
+ Authentication Dial In User Service) Support For
+ Extensible Authentication Protocol (EAP)", RFC 3579,
+ September 2003.
+
+ [IEEE8021X] IEEE Standards for Local and Metropolitan Area
+ Networks: Port based Network Access Control, IEEE Std
+ 802.1X-2001, June 2001.
+
+7.2. Informative References
+
+ [RFC2104] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC:
+ Keyed-Hashing for Message Authentication", RFC 2104,
+ February 1997.
+
+ [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing
+ an IANA Considerations Section in RFCs", BCP 26, RFC
+ 2434, October 1998.
+
+ [RFC2548] Zorn, G., "Microsoft Vendor-specific RADIUS
+ Attributes", RFC 2548, March 1999.
+
+ [RFC2607] Aboba, B. and J. Vollbrecht, "Proxy Chaining and
+ Policy Implementation in Roaming", RFC 2607, June
+ 1999.
+
+ [RFC2716] Aboba, B. and D. Simon, "PPP EAP TLS Authentication
+ Protocol", RFC 2716, October 1999.
+
+
+
+Congdon, et al. Informational [Page 23]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ [MD5Attack] Dobbertin, H., "The Status of MD5 After a Recent
+ Attack." CryptoBytes Vol.2 No.2, Summer 1996.
+
+ [IEEE802] IEEE Standards for Local and Metropolitan Area
+ Networks: Overview and Architecture, ANSI/IEEE Std
+ 802, 1990.
+
+ [IEEE8021Q] IEEE Standards for Local and Metropolitan Area
+ Networks: Draft Standard for Virtual Bridged Local
+ Area Networks, P802.1Q, January 1998.
+
+ [IEEE8023] ISO/IEC 8802-3 Information technology -
+ Telecommunications and information exchange between
+ systems - Local and metropolitan area networks -
+ Common specifications - Part 3: Carrier Sense
+ Multiple Access with Collision Detection (CSMA/CD)
+ Access Method and Physical Layer Specifications, (also
+ ANSI/IEEE Std 802.3- 1996), 1996.
+
+ [IEEE80211] Information technology - Telecommunications and
+ information exchange between systems - Local and
+ metropolitan area networks - Specific Requirements
+ Part 11: Wireless LAN Medium Access Control (MAC) and
+ Physical Layer (PHY) Specifications, IEEE Std.
+ 802.11-1999, 1999.
+
+ [Berkeley] Borisov, N., Goldberg, I. and D. Wagner, "Intercepting
+ Mobile Communications: The Insecurity of 802.11", ACM
+ SIGMOBILE, Seventh Annual International Conference on
+ Mobile Computing and Networking, July 2001, Rome,
+ Italy.
+
+ [Arbaugh] Arbaugh, W., Shankar, N. and J.Y.C. Wan, "Your 802.11
+ Wireless Network has No Clothes", Department of
+ Computer Science, University of Maryland, College
+ Park, March 2001.
+
+ [Fluhrer] Fluhrer, S., Mantin, I. and A. Shamir, "Weaknesses in
+ the Key Scheduling Algorithm of RC4", Eighth Annual
+ Workshop on Selected Areas in Cryptography, Toronto,
+ Canada, August 2001.
+
+ [Stubbl] Stubblefield, A., Ioannidis, J. and A. Rubin, "Using
+ the Fluhrer, Mantin and Shamir Attack to Break WEP",
+ 2002 NDSS Conference.
+
+
+
+
+
+
+Congdon, et al. Informational [Page 24]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+8. Table of Attributes
+
+ The following table provides a guide to which attributes MAY be sent
+ and received as part of IEEE 802.1X authentication. L3 denotes
+ attributes that require layer 3 capabilities, and thus may not be
+ supported by all Authenticators. For each attribute, the reference
+ provides the definitive information on usage.
+
+ 802.1X # Attribute
+ X 1 User-Name [RFC2865]
+ 2 User-Password [RFC2865]
+ 3 CHAP-Password [RFC2865]
+ X 4 NAS-IP-Address [RFC2865]
+ X 5 NAS-Port [RFC2865]
+ X 6 Service-Type [RFC2865]
+ 7 Framed-Protocol [RFC2865]
+ L3 8 Framed-IP-Address [RFC2865]
+ L3 9 Framed-IP-Netmask [RFC2865]
+ L3 10 Framed-Routing [RFC2865]
+ X 11 Filter-Id [RFC2865]
+ X 12 Framed-MTU [RFC2865]
+ 13 Framed-Compression [RFC2865]
+ L3 14 Login-IP-Host [RFC2865]
+ L3 15 Login-Service [RFC2865]
+ L3 16 Login-TCP-Port [RFC2865]
+ 18 Reply-Message [RFC2865]
+ 19 Callback-Number [RFC2865]
+ 20 Callback-Id [RFC2865]
+ L3 22 Framed-Route [RFC2865]
+ L3 23 Framed-IPX-Network [RFC2865]
+ X 24 State [RFC2865]
+ X 25 Class [RFC2865]
+ X 26 Vendor-Specific [RFC2865]
+ X 27 Session-Timeout [RFC2865]
+ X 28 Idle-Timeout [RFC2865]
+ X 29 Termination-Action [RFC2865]
+ X 30 Called-Station-Id [RFC2865]
+ X 31 Calling-Station-Id [RFC2865]
+ X 32 NAS-Identifier [RFC2865]
+ X 33 Proxy-State [RFC2865]
+ 34 Login-LAT-Service [RFC2865]
+ 35 Login-LAT-Node [RFC2865]
+ 36 Login-LAT-Group [RFC2865]
+ 802.1X # Attribute
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 25]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ 802.1X # Attribute
+ L3 37 Framed-AppleTalk-Link [RFC2865]
+ L3 38 Framed-AppleTalk-Network [RFC2865]
+ L3 39 Framed-AppleTalk-Zone [RFC2865]
+ X 40 Acct-Status-Type [RFC2866]
+ X 41 Acct-Delay-Time [RFC2866]
+ X 42 Acct-Input-Octets [RFC2866]
+ X 43 Acct-Output-Octets [RFC2866]
+ X 44 Acct-Session-Id [RFC2866]
+ X 45 Acct-Authentic [RFC2866]
+ X 46 Acct-Session-Time [RFC2866]
+ X 47 Acct-Input-Packets [RFC2866]
+ X 48 Acct-Output-Packets [RFC2866]
+ X 49 Acct-Terminate-Cause [RFC2866]
+ X 50 Acct-Multi-Session-Id [RFC2866]
+ X 51 Acct-Link-Count [RFC2866]
+ X 52 Acct-Input-Gigawords [RFC2869]
+ X 53 Acct-Output-Gigawords [RFC2869]
+ X 55 Event-Timestamp [RFC2869]
+ 60 CHAP-Challenge [RFC2865]
+ X 61 NAS-Port-Type [RFC2865]
+ 62 Port-Limit [RFC2865]
+ 63 Login-LAT-Port [RFC2865]
+ X 64 Tunnel-Type [RFC2868]
+ X 65 Tunnel-Medium-Type [RFC2868]
+ L3 66 Tunnel-Client-Endpoint [RFC2868]
+ L3 67 Tunnel-Server-Endpoint [RFC2868]
+ L3 68 Acct-Tunnel-Connection [RFC2867]
+ L3 69 Tunnel-Password [RFC2868]
+ 70 ARAP-Password [RFC2869]
+ 71 ARAP-Features [RFC2869]
+ 72 ARAP-Zone-Access [RFC2869]
+ 73 ARAP-Security [RFC2869]
+ 74 ARAP-Security-Data [RFC2869]
+ 75 Password-Retry [RFC2869]
+ 76 Prompt [RFC2869]
+ X 77 Connect-Info [RFC2869]
+ X 78 Configuration-Token [RFC2869]
+ X 79 EAP-Message [RFC3579]
+ X 80 Message-Authenticator [RFC3579]
+ X 81 Tunnel-Private-Group-ID [RFC2868]
+ L3 82 Tunnel-Assignment-ID [RFC2868]
+ X 83 Tunnel-Preference [RFC2868]
+ 84 ARAP-Challenge-Response [RFC2869]
+ 802.1X # Attribute
+
+
+
+
+
+
+Congdon, et al. Informational [Page 26]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+ 802.1X # Attribute
+ X 85 Acct-Interim-Interval [RFC2869]
+ X 86 Acct-Tunnel-Packets-Lost [RFC2867]
+ X 87 NAS-Port-Id [RFC2869]
+ L3 88 Framed-Pool [RFC2869]
+ L3 90 Tunnel-Client-Auth-ID [RFC2868]
+ L3 91 Tunnel-Server-Auth-ID [RFC2868]
+ X 95 NAS-IPv6-Address [RFC3162]
+ 96 Framed-Interface-Id [RFC3162]
+ L3 97 Framed-IPv6-Prefix [RFC3162]
+ L3 98 Login-IPv6-Host [RFC3162]
+ L3 99 Framed-IPv6-Route [RFC3162]
+ L3 100 Framed-IPv6-Pool [RFC3162]
+ X 101 Error-Cause [RFC3576]
+ 802.1X # Attribute
+
+ Key
+ ===
+ X = May be used with IEEE 802.1X authentication
+ L3 = Implemented only by Authenticators with Layer 3
+ capabilities
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 27]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+9. Intellectual Property Statement
+
+ The IETF takes no position regarding the validity or scope of any
+ intellectual property or other rights that might be claimed to
+ pertain to the implementation or use of the technology described in
+ this document or the extent to which any license under such rights
+ might or might not be available; neither does it represent that it
+ has made any effort to identify any such rights. Information on the
+ IETF's procedures with respect to rights in standards-track and
+ standards- related documentation can be found in BCP-11. Copies of
+ claims of rights made available for publication and any assurances of
+ licenses to be made available, or the result of an attempt made to
+ obtain a general license or permission for the use of such
+ proprietary rights by implementors or users of this specification can
+ be obtained from the IETF Secretariat.
+
+ The IETF invites any interested party to bring to its attention any
+ copyrights, patents or patent applications, or other proprietary
+ rights which may cover technology that may be required to practice
+ this standard. Please address the information to the IETF Executive
+ Director.
+
+10. Acknowledgments
+
+ The authors would like to acknowledge Bob O'Hara of Airespace, David
+ Halasz of Cisco, Tim Moore, Sachin Seth and Ashwin Palekar of
+ Microsoft, Andrea Li, Albert Young and Dave Bagby of 3Com for
+ contributions to this document.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 28]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+11. Authors' Addresses
+
+ Paul Congdon
+ Hewlett Packard Company
+ HP ProCurve Networking
+ 8000 Foothills Blvd, M/S 5662
+ Roseville, CA 95747
+
+ Phone: +1 916 785 5753
+ Fax: +1 916 785 8478
+ EMail: paul_congdon@hp.com
+
+ Bernard Aboba
+ Microsoft Corporation
+ One Microsoft Way
+ Redmond, WA 98052
+
+ Phone: +1 425 706 6605
+ Fax: +1 425 936 7329
+ EMail: bernarda@microsoft.com
+
+ Andrew Smith
+ Trapeze Networks
+ 5753 W. Las Positas Blvd.
+ Pleasanton, CA 94588-4084
+
+ Fax: +1 415 345 1827
+ EMail: ah_smith@acm.org
+
+ John Roese
+ Enterasys
+
+ Phone: +1 603 337 1506
+ EMail: jjr@enterasys.com
+
+ Glen Zorn
+ Cisco Systems, Inc.
+ 500 108th Avenue N.E., Suite 500
+ Bellevue, WA 98004
+
+ Phone: +1 425 438 8218
+ Fax: +1 425 438 1848
+ EMail: gwz@cisco.com
+
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 29]
+
+RFC 3580 IEEE 802.1X RADIUS September 2003
+
+
+12. Full Copyright Statement
+
+ Copyright (C) The Internet Society (2003). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assignees.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+Acknowledgement
+
+ Funding for the RFC Editor function is currently provided by the
+ Internet Society.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Congdon, et al. Informational [Page 30]
+
diff --git a/rfc/rfc791.txt b/rfc/rfc791.txt
new file mode 100644
index 0000000..5952d0b
--- /dev/null
+++ b/rfc/rfc791.txt
@@ -0,0 +1,2887 @@
+
+
+RFC: 791
+
+
+
+
+
+
+
+ INTERNET PROTOCOL
+
+
+ DARPA INTERNET PROGRAM
+
+ PROTOCOL SPECIFICATION
+
+
+
+ September 1981
+
+
+
+
+
+
+
+
+
+
+
+
+
+ prepared for
+
+ Defense Advanced Research Projects Agency
+ Information Processing Techniques Office
+ 1400 Wilson Boulevard
+ Arlington, Virginia 22209
+
+
+
+
+
+
+
+ by
+
+ Information Sciences Institute
+ University of Southern California
+ 4676 Admiralty Way
+ Marina del Rey, California 90291
+
+
+
+September 1981
+ Internet Protocol
+
+
+
+ TABLE OF CONTENTS
+
+ PREFACE ........................................................ iii
+
+1. INTRODUCTION ..................................................... 1
+
+ 1.1 Motivation .................................................... 1
+ 1.2 Scope ......................................................... 1
+ 1.3 Interfaces .................................................... 1
+ 1.4 Operation ..................................................... 2
+
+2. OVERVIEW ......................................................... 5
+
+ 2.1 Relation to Other Protocols ................................... 9
+ 2.2 Model of Operation ............................................ 5
+ 2.3 Function Description .......................................... 7
+ 2.4 Gateways ...................................................... 9
+
+3. SPECIFICATION ................................................... 11
+
+ 3.1 Internet Header Format ....................................... 11
+ 3.2 Discussion ................................................... 23
+ 3.3 Interfaces ................................................... 31
+
+APPENDIX A: Examples & Scenarios ................................... 34
+APPENDIX B: Data Transmission Order ................................ 39
+
+GLOSSARY ............................................................ 41
+
+REFERENCES .......................................................... 45
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page i]
+
+
+ September 1981
+Internet Protocol
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page ii]
+
+
+September 1981
+ Internet Protocol
+
+
+
+ PREFACE
+
+
+
+This document specifies the DoD Standard Internet Protocol. This
+document is based on six earlier editions of the ARPA Internet Protocol
+Specification, and the present text draws heavily from them. There have
+been many contributors to this work both in terms of concepts and in
+terms of text. This edition revises aspects of addressing, error
+handling, option codes, and the security, precedence, compartments, and
+handling restriction features of the internet protocol.
+
+ Jon Postel
+
+ Editor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page iii]
+
+
+
+ September 1981
+
+
+RFC: 791
+Replaces: RFC 760
+IENs 128, 123, 111,
+80, 54, 44, 41, 28, 26
+
+ INTERNET PROTOCOL
+
+ DARPA INTERNET PROGRAM
+ PROTOCOL SPECIFICATION
+
+
+
+ 1. INTRODUCTION
+
+1.1. Motivation
+
+ The Internet Protocol is designed for use in interconnected systems of
+ packet-switched computer communication networks. Such a system has
+ been called a "catenet" [1]. The internet protocol provides for
+ transmitting blocks of data called datagrams from sources to
+ destinations, where sources and destinations are hosts identified by
+ fixed length addresses. The internet protocol also provides for
+ fragmentation and reassembly of long datagrams, if necessary, for
+ transmission through "small packet" networks.
+
+1.2. Scope
+
+ The internet protocol is specifically limited in scope to provide the
+ functions necessary to deliver a package of bits (an internet
+ datagram) from a source to a destination over an interconnected system
+ of networks. There are no mechanisms to augment end-to-end data
+ reliability, flow control, sequencing, or other services commonly
+ found in host-to-host protocols. The internet protocol can capitalize
+ on the services of its supporting networks to provide various types
+ and qualities of service.
+
+1.3. Interfaces
+
+ This protocol is called on by host-to-host protocols in an internet
+ environment. This protocol calls on local network protocols to carry
+ the internet datagram to the next gateway or destination host.
+
+ For example, a TCP module would call on the internet module to take a
+ TCP segment (including the TCP header and user data) as the data
+ portion of an internet datagram. The TCP module would provide the
+ addresses and other parameters in the internet header to the internet
+ module as arguments of the call. The internet module would then
+ create an internet datagram and call on the local network interface to
+ transmit the internet datagram.
+
+ In the ARPANET case, for example, the internet module would call on a
+
+
+ [Page 1]
+
+
+ September 1981
+Internet Protocol
+Introduction
+
+
+
+ local net module which would add the 1822 leader [2] to the internet
+ datagram creating an ARPANET message to transmit to the IMP. The
+ ARPANET address would be derived from the internet address by the
+ local network interface and would be the address of some host in the
+ ARPANET, that host might be a gateway to other networks.
+
+1.4. Operation
+
+ The internet protocol implements two basic functions: addressing and
+ fragmentation.
+
+ The internet modules use the addresses carried in the internet header
+ to transmit internet datagrams toward their destinations. The
+ selection of a path for transmission is called routing.
+
+ The internet modules use fields in the internet header to fragment and
+ reassemble internet datagrams when necessary for transmission through
+ "small packet" networks.
+
+ The model of operation is that an internet module resides in each host
+ engaged in internet communication and in each gateway that
+ interconnects networks. These modules share common rules for
+ interpreting address fields and for fragmenting and assembling
+ internet datagrams. In addition, these modules (especially in
+ gateways) have procedures for making routing decisions and other
+ functions.
+
+ The internet protocol treats each internet datagram as an independent
+ entity unrelated to any other internet datagram. There are no
+ connections or logical circuits (virtual or otherwise).
+
+ The internet protocol uses four key mechanisms in providing its
+ service: Type of Service, Time to Live, Options, and Header Checksum.
+
+ The Type of Service is used to indicate the quality of the service
+ desired. The type of service is an abstract or generalized set of
+ parameters which characterize the service choices provided in the
+ networks that make up the internet. This type of service indication
+ is to be used by gateways to select the actual transmission parameters
+ for a particular network, the network to be used for the next hop, or
+ the next gateway when routing an internet datagram.
+
+ The Time to Live is an indication of an upper bound on the lifetime of
+ an internet datagram. It is set by the sender of the datagram and
+ reduced at the points along the route where it is processed. If the
+ time to live reaches zero before the internet datagram reaches its
+ destination, the internet datagram is destroyed. The time to live can
+ be thought of as a self destruct time limit.
+
+
+[Page 2]
+
+
+September 1981
+ Internet Protocol
+ Introduction
+
+
+
+ The Options provide for control functions needed or useful in some
+ situations but unnecessary for the most common communications. The
+ options include provisions for timestamps, security, and special
+ routing.
+
+ The Header Checksum provides a verification that the information used
+ in processing internet datagram has been transmitted correctly. The
+ data may contain errors. If the header checksum fails, the internet
+ datagram is discarded at once by the entity which detects the error.
+
+ The internet protocol does not provide a reliable communication
+ facility. There are no acknowledgments either end-to-end or
+ hop-by-hop. There is no error control for data, only a header
+ checksum. There are no retransmissions. There is no flow control.
+
+ Errors detected may be reported via the Internet Control Message
+ Protocol (ICMP) [3] which is implemented in the internet protocol
+ module.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 3]
+
+
+ September 1981
+Internet Protocol
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 4]
+
+
+September 1981
+ Internet Protocol
+
+
+
+ 2. OVERVIEW
+
+2.1. Relation to Other Protocols
+
+ The following diagram illustrates the place of the internet protocol
+ in the protocol hierarchy:
+
+
+ +------+ +-----+ +-----+ +-----+
+ |Telnet| | FTP | | TFTP| ... | ... |
+ +------+ +-----+ +-----+ +-----+
+ | | | |
+ +-----+ +-----+ +-----+
+ | TCP | | UDP | ... | ... |
+ +-----+ +-----+ +-----+
+ | | |
+ +--------------------------+----+
+ | Internet Protocol & ICMP |
+ +--------------------------+----+
+ |
+ +---------------------------+
+ | Local Network Protocol |
+ +---------------------------+
+
+ Protocol Relationships
+
+ Figure 1.
+
+ Internet protocol interfaces on one side to the higher level
+ host-to-host protocols and on the other side to the local network
+ protocol. In this context a "local network" may be a small network in
+ a building or a large network such as the ARPANET.
+
+2.2. Model of Operation
+
+ The model of operation for transmitting a datagram from one
+ application program to another is illustrated by the following
+ scenario:
+
+ We suppose that this transmission will involve one intermediate
+ gateway.
+
+ The sending application program prepares its data and calls on its
+ local internet module to send that data as a datagram and passes the
+ destination address and other parameters as arguments of the call.
+
+ The internet module prepares a datagram header and attaches the data
+ to it. The internet module determines a local network address for
+ this internet address, in this case it is the address of a gateway.
+
+
+ [Page 5]
+
+
+ September 1981
+Internet Protocol
+Overview
+
+
+
+ It sends this datagram and the local network address to the local
+ network interface.
+
+ The local network interface creates a local network header, and
+ attaches the datagram to it, then sends the result via the local
+ network.
+
+ The datagram arrives at a gateway host wrapped in the local network
+ header, the local network interface strips off this header, and
+ turns the datagram over to the internet module. The internet module
+ determines from the internet address that the datagram is to be
+ forwarded to another host in a second network. The internet module
+ determines a local net address for the destination host. It calls
+ on the local network interface for that network to send the
+ datagram.
+
+ This local network interface creates a local network header and
+ attaches the datagram sending the result to the destination host.
+
+ At this destination host the datagram is stripped of the local net
+ header by the local network interface and handed to the internet
+ module.
+
+ The internet module determines that the datagram is for an
+ application program in this host. It passes the data to the
+ application program in response to a system call, passing the source
+ address and other parameters as results of the call.
+
+
+ Application Application
+ Program Program
+ \ /
+ Internet Module Internet Module Internet Module
+ \ / \ /
+ LNI-1 LNI-1 LNI-2 LNI-2
+ \ / \ /
+ Local Network 1 Local Network 2
+
+
+
+ Transmission Path
+
+ Figure 2
+
+
+
+
+
+
+
+[Page 6]
+
+
+September 1981
+ Internet Protocol
+ Overview
+
+
+
+2.3. Function Description
+
+ The function or purpose of Internet Protocol is to move datagrams
+ through an interconnected set of networks. This is done by passing
+ the datagrams from one internet module to another until the
+ destination is reached. The internet modules reside in hosts and
+ gateways in the internet system. The datagrams are routed from one
+ internet module to another through individual networks based on the
+ interpretation of an internet address. Thus, one important mechanism
+ of the internet protocol is the internet address.
+
+ In the routing of messages from one internet module to another,
+ datagrams may need to traverse a network whose maximum packet size is
+ smaller than the size of the datagram. To overcome this difficulty, a
+ fragmentation mechanism is provided in the internet protocol.
+
+ Addressing
+
+ A distinction is made between names, addresses, and routes [4]. A
+ name indicates what we seek. An address indicates where it is. A
+ route indicates how to get there. The internet protocol deals
+ primarily with addresses. It is the task of higher level (i.e.,
+ host-to-host or application) protocols to make the mapping from
+ names to addresses. The internet module maps internet addresses to
+ local net addresses. It is the task of lower level (i.e., local net
+ or gateways) procedures to make the mapping from local net addresses
+ to routes.
+
+ Addresses are fixed length of four octets (32 bits). An address
+ begins with a network number, followed by local address (called the
+ "rest" field). There are three formats or classes of internet
+ addresses: in class a, the high order bit is zero, the next 7 bits
+ are the network, and the last 24 bits are the local address; in
+ class b, the high order two bits are one-zero, the next 14 bits are
+ the network and the last 16 bits are the local address; in class c,
+ the high order three bits are one-one-zero, the next 21 bits are the
+ network and the last 8 bits are the local address.
+
+ Care must be taken in mapping internet addresses to local net
+ addresses; a single physical host must be able to act as if it were
+ several distinct hosts to the extent of using several distinct
+ internet addresses. Some hosts will also have several physical
+ interfaces (multi-homing).
+
+ That is, provision must be made for a host to have several physical
+ interfaces to the network with each having several logical internet
+ addresses.
+
+
+
+ [Page 7]
+
+
+ September 1981
+Internet Protocol
+Overview
+
+
+
+ Examples of address mappings may be found in "Address Mappings" [5].
+
+ Fragmentation
+
+ Fragmentation of an internet datagram is necessary when it
+ originates in a local net that allows a large packet size and must
+ traverse a local net that limits packets to a smaller size to reach
+ its destination.
+
+ An internet datagram can be marked "don't fragment." Any internet
+ datagram so marked is not to be internet fragmented under any
+ circumstances. If internet datagram marked don't fragment cannot be
+ delivered to its destination without fragmenting it, it is to be
+ discarded instead.
+
+ Fragmentation, transmission and reassembly across a local network
+ which is invisible to the internet protocol module is called
+ intranet fragmentation and may be used [6].
+
+ The internet fragmentation and reassembly procedure needs to be able
+ to break a datagram into an almost arbitrary number of pieces that
+ can be later reassembled. The receiver of the fragments uses the
+ identification field to ensure that fragments of different datagrams
+ are not mixed. The fragment offset field tells the receiver the
+ position of a fragment in the original datagram. The fragment
+ offset and length determine the portion of the original datagram
+ covered by this fragment. The more-fragments flag indicates (by
+ being reset) the last fragment. These fields provide sufficient
+ information to reassemble datagrams.
+
+ The identification field is used to distinguish the fragments of one
+ datagram from those of another. The originating protocol module of
+ an internet datagram sets the identification field to a value that
+ must be unique for that source-destination pair and protocol for the
+ time the datagram will be active in the internet system. The
+ originating protocol module of a complete datagram sets the
+ more-fragments flag to zero and the fragment offset to zero.
+
+ To fragment a long internet datagram, an internet protocol module
+ (for example, in a gateway), creates two new internet datagrams and
+ copies the contents of the internet header fields from the long
+ datagram into both new internet headers. The data of the long
+ datagram is divided into two portions on a 8 octet (64 bit) boundary
+ (the second portion might not be an integral multiple of 8 octets,
+ but the first must be). Call the number of 8 octet blocks in the
+ first portion NFB (for Number of Fragment Blocks). The first
+ portion of the data is placed in the first new internet datagram,
+ and the total length field is set to the length of the first
+
+
+[Page 8]
+
+
+September 1981
+ Internet Protocol
+ Overview
+
+
+
+ datagram. The more-fragments flag is set to one. The second
+ portion of the data is placed in the second new internet datagram,
+ and the total length field is set to the length of the second
+ datagram. The more-fragments flag carries the same value as the
+ long datagram. The fragment offset field of the second new internet
+ datagram is set to the value of that field in the long datagram plus
+ NFB.
+
+ This procedure can be generalized for an n-way split, rather than
+ the two-way split described.
+
+ To assemble the fragments of an internet datagram, an internet
+ protocol module (for example at a destination host) combines
+ internet datagrams that all have the same value for the four fields:
+ identification, source, destination, and protocol. The combination
+ is done by placing the data portion of each fragment in the relative
+ position indicated by the fragment offset in that fragment's
+ internet header. The first fragment will have the fragment offset
+ zero, and the last fragment will have the more-fragments flag reset
+ to zero.
+
+2.4. Gateways
+
+ Gateways implement internet protocol to forward datagrams between
+ networks. Gateways also implement the Gateway to Gateway Protocol
+ (GGP) [7] to coordinate routing and other internet control
+ information.
+
+ In a gateway the higher level protocols need not be implemented and
+ the GGP functions are added to the IP module.
+
+
+ +-------------------------------+
+ | Internet Protocol & ICMP & GGP|
+ +-------------------------------+
+ | |
+ +---------------+ +---------------+
+ | Local Net | | Local Net |
+ +---------------+ +---------------+
+
+ Gateway Protocols
+
+ Figure 3.
+
+
+
+
+
+
+
+ [Page 9]
+
+
+ September 1981
+Internet Protocol
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 10]
+
+
+September 1981
+ Internet Protocol
+
+
+
+ 3. SPECIFICATION
+
+3.1. Internet Header Format
+
+ A summary of the contents of the internet header follows:
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |Version| IHL |Type of Service| Total Length |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Identification |Flags| Fragment Offset |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Time to Live | Protocol | Header Checksum |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Source Address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Destination Address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Options | Padding |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Example Internet Datagram Header
+
+ Figure 4.
+
+ Note that each tick mark represents one bit position.
+
+ Version: 4 bits
+
+ The Version field indicates the format of the internet header. This
+ document describes version 4.
+
+ IHL: 4 bits
+
+ Internet Header Length is the length of the internet header in 32
+ bit words, and thus points to the beginning of the data. Note that
+ the minimum value for a correct header is 5.
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 11]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ Type of Service: 8 bits
+
+ The Type of Service provides an indication of the abstract
+ parameters of the quality of service desired. These parameters are
+ to be used to guide the selection of the actual service parameters
+ when transmitting a datagram through a particular network. Several
+ networks offer service precedence, which somehow treats high
+ precedence traffic as more important than other traffic (generally
+ by accepting only traffic above a certain precedence at time of high
+ load). The major choice is a three way tradeoff between low-delay,
+ high-reliability, and high-throughput.
+
+ Bits 0-2: Precedence.
+ Bit 3: 0 = Normal Delay, 1 = Low Delay.
+ Bits 4: 0 = Normal Throughput, 1 = High Throughput.
+ Bits 5: 0 = Normal Relibility, 1 = High Relibility.
+ Bit 6-7: Reserved for Future Use.
+
+ 0 1 2 3 4 5 6 7
+ +-----+-----+-----+-----+-----+-----+-----+-----+
+ | | | | | | |
+ | PRECEDENCE | D | T | R | 0 | 0 |
+ | | | | | | |
+ +-----+-----+-----+-----+-----+-----+-----+-----+
+
+ Precedence
+
+ 111 - Network Control
+ 110 - Internetwork Control
+ 101 - CRITIC/ECP
+ 100 - Flash Override
+ 011 - Flash
+ 010 - Immediate
+ 001 - Priority
+ 000 - Routine
+
+ The use of the Delay, Throughput, and Reliability indications may
+ increase the cost (in some sense) of the service. In many networks
+ better performance for one of these parameters is coupled with worse
+ performance on another. Except for very unusual cases at most two
+ of these three indications should be set.
+
+ The type of service is used to specify the treatment of the datagram
+ during its transmission through the internet system. Example
+ mappings of the internet type of service to the actual service
+ provided on networks such as AUTODIN II, ARPANET, SATNET, and PRNET
+ is given in "Service Mappings" [8].
+
+
+
+[Page 12]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ The Network Control precedence designation is intended to be used
+ within a network only. The actual use and control of that
+ designation is up to each network. The Internetwork Control
+ designation is intended for use by gateway control originators only.
+ If the actual use of these precedence designations is of concern to
+ a particular network, it is the responsibility of that network to
+ control the access to, and use of, those precedence designations.
+
+ Total Length: 16 bits
+
+ Total Length is the length of the datagram, measured in octets,
+ including internet header and data. This field allows the length of
+ a datagram to be up to 65,535 octets. Such long datagrams are
+ impractical for most hosts and networks. All hosts must be prepared
+ to accept datagrams of up to 576 octets (whether they arrive whole
+ or in fragments). It is recommended that hosts only send datagrams
+ larger than 576 octets if they have assurance that the destination
+ is prepared to accept the larger datagrams.
+
+ The number 576 is selected to allow a reasonable sized data block to
+ be transmitted in addition to the required header information. For
+ example, this size allows a data block of 512 octets plus 64 header
+ octets to fit in a datagram. The maximal internet header is 60
+ octets, and a typical internet header is 20 octets, allowing a
+ margin for headers of higher level protocols.
+
+ Identification: 16 bits
+
+ An identifying value assigned by the sender to aid in assembling the
+ fragments of a datagram.
+
+ Flags: 3 bits
+
+ Various Control Flags.
+
+ Bit 0: reserved, must be zero
+ Bit 1: (DF) 0 = May Fragment, 1 = Don't Fragment.
+ Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments.
+
+ 0 1 2
+ +---+---+---+
+ | | D | M |
+ | 0 | F | F |
+ +---+---+---+
+
+ Fragment Offset: 13 bits
+
+ This field indicates where in the datagram this fragment belongs.
+
+
+ [Page 13]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ The fragment offset is measured in units of 8 octets (64 bits). The
+ first fragment has offset zero.
+
+ Time to Live: 8 bits
+
+ This field indicates the maximum time the datagram is allowed to
+ remain in the internet system. If this field contains the value
+ zero, then the datagram must be destroyed. This field is modified
+ in internet header processing. The time is measured in units of
+ seconds, but since every module that processes a datagram must
+ decrease the TTL by at least one even if it process the datagram in
+ less than a second, the TTL must be thought of only as an upper
+ bound on the time a datagram may exist. The intention is to cause
+ undeliverable datagrams to be discarded, and to bound the maximum
+ datagram lifetime.
+
+ Protocol: 8 bits
+
+ This field indicates the next level protocol used in the data
+ portion of the internet datagram. The values for various protocols
+ are specified in "Assigned Numbers" [9].
+
+ Header Checksum: 16 bits
+
+ A checksum on the header only. Since some header fields change
+ (e.g., time to live), this is recomputed and verified at each point
+ that the internet header is processed.
+
+ The checksum algorithm is:
+
+ The checksum field is the 16 bit one's complement of the one's
+ complement sum of all 16 bit words in the header. For purposes of
+ computing the checksum, the value of the checksum field is zero.
+
+ This is a simple to compute checksum and experimental evidence
+ indicates it is adequate, but it is provisional and may be replaced
+ by a CRC procedure, depending on further experience.
+
+ Source Address: 32 bits
+
+ The source address. See section 3.2.
+
+ Destination Address: 32 bits
+
+ The destination address. See section 3.2.
+
+
+
+
+
+[Page 14]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ Options: variable
+
+ The options may appear or not in datagrams. They must be
+ implemented by all IP modules (host and gateways). What is optional
+ is their transmission in any particular datagram, not their
+ implementation.
+
+ In some environments the security option may be required in all
+ datagrams.
+
+ The option field is variable in length. There may be zero or more
+ options. There are two cases for the format of an option:
+
+ Case 1: A single octet of option-type.
+
+ Case 2: An option-type octet, an option-length octet, and the
+ actual option-data octets.
+
+ The option-length octet counts the option-type octet and the
+ option-length octet as well as the option-data octets.
+
+ The option-type octet is viewed as having 3 fields:
+
+ 1 bit copied flag,
+ 2 bits option class,
+ 5 bits option number.
+
+ The copied flag indicates that this option is copied into all
+ fragments on fragmentation.
+
+ 0 = not copied
+ 1 = copied
+
+ The option classes are:
+
+ 0 = control
+ 1 = reserved for future use
+ 2 = debugging and measurement
+ 3 = reserved for future use
+
+
+
+
+
+
+
+
+
+
+
+ [Page 15]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ The following internet options are defined:
+
+ CLASS NUMBER LENGTH DESCRIPTION
+ ----- ------ ------ -----------
+ 0 0 - End of Option list. This option occupies only
+ 1 octet; it has no length octet.
+ 0 1 - No Operation. This option occupies only 1
+ octet; it has no length octet.
+ 0 2 11 Security. Used to carry Security,
+ Compartmentation, User Group (TCC), and
+ Handling Restriction Codes compatible with DOD
+ requirements.
+ 0 3 var. Loose Source Routing. Used to route the
+ internet datagram based on information
+ supplied by the source.
+ 0 9 var. Strict Source Routing. Used to route the
+ internet datagram based on information
+ supplied by the source.
+ 0 7 var. Record Route. Used to trace the route an
+ internet datagram takes.
+ 0 8 4 Stream ID. Used to carry the stream
+ identifier.
+ 2 4 var. Internet Timestamp.
+
+
+
+ Specific Option Definitions
+
+ End of Option List
+
+ +--------+
+ |00000000|
+ +--------+
+ Type=0
+
+ This option indicates the end of the option list. This might
+ not coincide with the end of the internet header according to
+ the internet header length. This is used at the end of all
+ options, not the end of each option, and need only be used if
+ the end of the options would not otherwise coincide with the end
+ of the internet header.
+
+ May be copied, introduced, or deleted on fragmentation, or for
+ any other reason.
+
+
+
+
+
+
+[Page 16]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ No Operation
+
+ +--------+
+ |00000001|
+ +--------+
+ Type=1
+
+ This option may be used between options, for example, to align
+ the beginning of a subsequent option on a 32 bit boundary.
+
+ May be copied, introduced, or deleted on fragmentation, or for
+ any other reason.
+
+ Security
+
+ This option provides a way for hosts to send security,
+ compartmentation, handling restrictions, and TCC (closed user
+ group) parameters. The format for this option is as follows:
+
+ +--------+--------+---//---+---//---+---//---+---//---+
+ |10000010|00001011|SSS SSS|CCC CCC|HHH HHH| TCC |
+ +--------+--------+---//---+---//---+---//---+---//---+
+ Type=130 Length=11
+
+ Security (S field): 16 bits
+
+ Specifies one of 16 levels of security (eight of which are
+ reserved for future use).
+
+ 00000000 00000000 - Unclassified
+ 11110001 00110101 - Confidential
+ 01111000 10011010 - EFTO
+ 10111100 01001101 - MMMM
+ 01011110 00100110 - PROG
+ 10101111 00010011 - Restricted
+ 11010111 10001000 - Secret
+ 01101011 11000101 - Top Secret
+ 00110101 11100010 - (Reserved for future use)
+ 10011010 11110001 - (Reserved for future use)
+ 01001101 01111000 - (Reserved for future use)
+ 00100100 10111101 - (Reserved for future use)
+ 00010011 01011110 - (Reserved for future use)
+ 10001001 10101111 - (Reserved for future use)
+ 11000100 11010110 - (Reserved for future use)
+ 11100010 01101011 - (Reserved for future use)
+
+
+
+
+
+ [Page 17]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ Compartments (C field): 16 bits
+
+ An all zero value is used when the information transmitted is
+ not compartmented. Other values for the compartments field
+ may be obtained from the Defense Intelligence Agency.
+
+ Handling Restrictions (H field): 16 bits
+
+ The values for the control and release markings are
+ alphanumeric digraphs and are defined in the Defense
+ Intelligence Agency Manual DIAM 65-19, "Standard Security
+ Markings".
+
+ Transmission Control Code (TCC field): 24 bits
+
+ Provides a means to segregate traffic and define controlled
+ communities of interest among subscribers. The TCC values are
+ trigraphs, and are available from HQ DCA Code 530.
+
+ Must be copied on fragmentation. This option appears at most
+ once in a datagram.
+
+ Loose Source and Record Route
+
+ +--------+--------+--------+---------//--------+
+ |10000011| length | pointer| route data |
+ +--------+--------+--------+---------//--------+
+ Type=131
+
+ The loose source and record route (LSRR) option provides a means
+ for the source of an internet datagram to supply routing
+ information to be used by the gateways in forwarding the
+ datagram to the destination, and to record the route
+ information.
+
+ The option begins with the option type code. The second octet
+ is the option length which includes the option type code and the
+ length octet, the pointer octet, and length-3 octets of route
+ data. The third octet is the pointer into the route data
+ indicating the octet which begins the next source address to be
+ processed. The pointer is relative to this option, and the
+ smallest legal value for the pointer is 4.
+
+ A route data is composed of a series of internet addresses.
+ Each internet address is 32 bits or 4 octets. If the pointer is
+ greater than the length, the source route is empty (and the
+ recorded route full) and the routing is to be based on the
+ destination address field.
+
+
+[Page 18]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ If the address in destination address field has been reached and
+ the pointer is not greater than the length, the next address in
+ the source route replaces the address in the destination address
+ field, and the recorded route address replaces the source
+ address just used, and pointer is increased by four.
+
+ The recorded route address is the internet module's own internet
+ address as known in the environment into which this datagram is
+ being forwarded.
+
+ This procedure of replacing the source route with the recorded
+ route (though it is in the reverse of the order it must be in to
+ be used as a source route) means the option (and the IP header
+ as a whole) remains a constant length as the datagram progresses
+ through the internet.
+
+ This option is a loose source route because the gateway or host
+ IP is allowed to use any route of any number of other
+ intermediate gateways to reach the next address in the route.
+
+ Must be copied on fragmentation. Appears at most once in a
+ datagram.
+
+ Strict Source and Record Route
+
+ +--------+--------+--------+---------//--------+
+ |10001001| length | pointer| route data |
+ +--------+--------+--------+---------//--------+
+ Type=137
+
+ The strict source and record route (SSRR) option provides a
+ means for the source of an internet datagram to supply routing
+ information to be used by the gateways in forwarding the
+ datagram to the destination, and to record the route
+ information.
+
+ The option begins with the option type code. The second octet
+ is the option length which includes the option type code and the
+ length octet, the pointer octet, and length-3 octets of route
+ data. The third octet is the pointer into the route data
+ indicating the octet which begins the next source address to be
+ processed. The pointer is relative to this option, and the
+ smallest legal value for the pointer is 4.
+
+ A route data is composed of a series of internet addresses.
+ Each internet address is 32 bits or 4 octets. If the pointer is
+ greater than the length, the source route is empty (and the
+
+
+
+ [Page 19]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ recorded route full) and the routing is to be based on the
+ destination address field.
+
+ If the address in destination address field has been reached and
+ the pointer is not greater than the length, the next address in
+ the source route replaces the address in the destination address
+ field, and the recorded route address replaces the source
+ address just used, and pointer is increased by four.
+
+ The recorded route address is the internet module's own internet
+ address as known in the environment into which this datagram is
+ being forwarded.
+
+ This procedure of replacing the source route with the recorded
+ route (though it is in the reverse of the order it must be in to
+ be used as a source route) means the option (and the IP header
+ as a whole) remains a constant length as the datagram progresses
+ through the internet.
+
+ This option is a strict source route because the gateway or host
+ IP must send the datagram directly to the next address in the
+ source route through only the directly connected network
+ indicated in the next address to reach the next gateway or host
+ specified in the route.
+
+ Must be copied on fragmentation. Appears at most once in a
+ datagram.
+
+ Record Route
+
+ +--------+--------+--------+---------//--------+
+ |00000111| length | pointer| route data |
+ +--------+--------+--------+---------//--------+
+ Type=7
+
+ The record route option provides a means to record the route of
+ an internet datagram.
+
+ The option begins with the option type code. The second octet
+ is the option length which includes the option type code and the
+ length octet, the pointer octet, and length-3 octets of route
+ data. The third octet is the pointer into the route data
+ indicating the octet which begins the next area to store a route
+ address. The pointer is relative to this option, and the
+ smallest legal value for the pointer is 4.
+
+ A recorded route is composed of a series of internet addresses.
+ Each internet address is 32 bits or 4 octets. If the pointer is
+
+
+[Page 20]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ greater than the length, the recorded route data area is full.
+ The originating host must compose this option with a large
+ enough route data area to hold all the address expected. The
+ size of the option does not change due to adding addresses. The
+ intitial contents of the route data area must be zero.
+
+ When an internet module routes a datagram it checks to see if
+ the record route option is present. If it is, it inserts its
+ own internet address as known in the environment into which this
+ datagram is being forwarded into the recorded route begining at
+ the octet indicated by the pointer, and increments the pointer
+ by four.
+
+ If the route data area is already full (the pointer exceeds the
+ length) the datagram is forwarded without inserting the address
+ into the recorded route. If there is some room but not enough
+ room for a full address to be inserted, the original datagram is
+ considered to be in error and is discarded. In either case an
+ ICMP parameter problem message may be sent to the source
+ host [3].
+
+ Not copied on fragmentation, goes in first fragment only.
+ Appears at most once in a datagram.
+
+ Stream Identifier
+
+ +--------+--------+--------+--------+
+ |10001000|00000010| Stream ID |
+ +--------+--------+--------+--------+
+ Type=136 Length=4
+
+ This option provides a way for the 16-bit SATNET stream
+ identifier to be carried through networks that do not support
+ the stream concept.
+
+ Must be copied on fragmentation. Appears at most once in a
+ datagram.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 21]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ Internet Timestamp
+
+ +--------+--------+--------+--------+
+ |01000100| length | pointer|oflw|flg|
+ +--------+--------+--------+--------+
+ | internet address |
+ +--------+--------+--------+--------+
+ | timestamp |
+ +--------+--------+--------+--------+
+ | . |
+ .
+ .
+ Type = 68
+
+ The Option Length is the number of octets in the option counting
+ the type, length, pointer, and overflow/flag octets (maximum
+ length 40).
+
+ The Pointer is the number of octets from the beginning of this
+ option to the end of timestamps plus one (i.e., it points to the
+ octet beginning the space for next timestamp). The smallest
+ legal value is 5. The timestamp area is full when the pointer
+ is greater than the length.
+
+ The Overflow (oflw) [4 bits] is the number of IP modules that
+ cannot register timestamps due to lack of space.
+
+ The Flag (flg) [4 bits] values are
+
+ 0 -- time stamps only, stored in consecutive 32-bit words,
+
+ 1 -- each timestamp is preceded with internet address of the
+ registering entity,
+
+ 3 -- the internet address fields are prespecified. An IP
+ module only registers its timestamp if it matches its own
+ address with the next specified internet address.
+
+ The Timestamp is a right-justified, 32-bit timestamp in
+ milliseconds since midnight UT. If the time is not available in
+ milliseconds or cannot be provided with respect to midnight UT
+ then any time may be inserted as a timestamp provided the high
+ order bit of the timestamp field is set to one to indicate the
+ use of a non-standard value.
+
+ The originating host must compose this option with a large
+ enough timestamp data area to hold all the timestamp information
+ expected. The size of the option does not change due to adding
+
+
+[Page 22]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ timestamps. The intitial contents of the timestamp data area
+ must be zero or internet address/zero pairs.
+
+ If the timestamp data area is already full (the pointer exceeds
+ the length) the datagram is forwarded without inserting the
+ timestamp, but the overflow count is incremented by one.
+
+ If there is some room but not enough room for a full timestamp
+ to be inserted, or the overflow count itself overflows, the
+ original datagram is considered to be in error and is discarded.
+ In either case an ICMP parameter problem message may be sent to
+ the source host [3].
+
+ The timestamp option is not copied upon fragmentation. It is
+ carried in the first fragment. Appears at most once in a
+ datagram.
+
+ Padding: variable
+
+ The internet header padding is used to ensure that the internet
+ header ends on a 32 bit boundary. The padding is zero.
+
+3.2. Discussion
+
+ The implementation of a protocol must be robust. Each implementation
+ must expect to interoperate with others created by different
+ individuals. While the goal of this specification is to be explicit
+ about the protocol there is the possibility of differing
+ interpretations. In general, an implementation must be conservative
+ in its sending behavior, and liberal in its receiving behavior. That
+ is, it must be careful to send well-formed datagrams, but must accept
+ any datagram that it can interpret (e.g., not object to technical
+ errors where the meaning is still clear).
+
+ The basic internet service is datagram oriented and provides for the
+ fragmentation of datagrams at gateways, with reassembly taking place
+ at the destination internet protocol module in the destination host.
+ Of course, fragmentation and reassembly of datagrams within a network
+ or by private agreement between the gateways of a network is also
+ allowed since this is transparent to the internet protocols and the
+ higher-level protocols. This transparent type of fragmentation and
+ reassembly is termed "network-dependent" (or intranet) fragmentation
+ and is not discussed further here.
+
+ Internet addresses distinguish sources and destinations to the host
+ level and provide a protocol field as well. It is assumed that each
+ protocol will provide for whatever multiplexing is necessary within a
+ host.
+
+
+ [Page 23]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ Addressing
+
+ To provide for flexibility in assigning address to networks and
+ allow for the large number of small to intermediate sized networks
+ the interpretation of the address field is coded to specify a small
+ number of networks with a large number of host, a moderate number of
+ networks with a moderate number of hosts, and a large number of
+ networks with a small number of hosts. In addition there is an
+ escape code for extended addressing mode.
+
+ Address Formats:
+
+ High Order Bits Format Class
+ --------------- ------------------------------- -----
+ 0 7 bits of net, 24 bits of host a
+ 10 14 bits of net, 16 bits of host b
+ 110 21 bits of net, 8 bits of host c
+ 111 escape to extended addressing mode
+
+ A value of zero in the network field means this network. This is
+ only used in certain ICMP messages. The extended addressing mode
+ is undefined. Both of these features are reserved for future use.
+
+ The actual values assigned for network addresses is given in
+ "Assigned Numbers" [9].
+
+ The local address, assigned by the local network, must allow for a
+ single physical host to act as several distinct internet hosts.
+ That is, there must be a mapping between internet host addresses and
+ network/host interfaces that allows several internet addresses to
+ correspond to one interface. It must also be allowed for a host to
+ have several physical interfaces and to treat the datagrams from
+ several of them as if they were all addressed to a single host.
+
+ Address mappings between internet addresses and addresses for
+ ARPANET, SATNET, PRNET, and other networks are described in "Address
+ Mappings" [5].
+
+ Fragmentation and Reassembly.
+
+ The internet identification field (ID) is used together with the
+ source and destination address, and the protocol fields, to identify
+ datagram fragments for reassembly.
+
+ The More Fragments flag bit (MF) is set if the datagram is not the
+ last fragment. The Fragment Offset field identifies the fragment
+ location, relative to the beginning of the original unfragmented
+ datagram. Fragments are counted in units of 8 octets. The
+
+
+[Page 24]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ fragmentation strategy is designed so than an unfragmented datagram
+ has all zero fragmentation information (MF = 0, fragment offset =
+ 0). If an internet datagram is fragmented, its data portion must be
+ broken on 8 octet boundaries.
+
+ This format allows 2**13 = 8192 fragments of 8 octets each for a
+ total of 65,536 octets. Note that this is consistent with the the
+ datagram total length field (of course, the header is counted in the
+ total length and not in the fragments).
+
+ When fragmentation occurs, some options are copied, but others
+ remain with the first fragment only.
+
+ Every internet module must be able to forward a datagram of 68
+ octets without further fragmentation. This is because an internet
+ header may be up to 60 octets, and the minimum fragment is 8 octets.
+
+ Every internet destination must be able to receive a datagram of 576
+ octets either in one piece or in fragments to be reassembled.
+
+ The fields which may be affected by fragmentation include:
+
+ (1) options field
+ (2) more fragments flag
+ (3) fragment offset
+ (4) internet header length field
+ (5) total length field
+ (6) header checksum
+
+ If the Don't Fragment flag (DF) bit is set, then internet
+ fragmentation of this datagram is NOT permitted, although it may be
+ discarded. This can be used to prohibit fragmentation in cases
+ where the receiving host does not have sufficient resources to
+ reassemble internet fragments.
+
+ One example of use of the Don't Fragment feature is to down line
+ load a small host. A small host could have a boot strap program
+ that accepts a datagram stores it in memory and then executes it.
+
+ The fragmentation and reassembly procedures are most easily
+ described by examples. The following procedures are example
+ implementations.
+
+ General notation in the following pseudo programs: "=<" means "less
+ than or equal", "#" means "not equal", "=" means "equal", "<-" means
+ "is set to". Also, "x to y" includes x and excludes y; for example,
+ "4 to 7" would include 4, 5, and 6 (but not 7).
+
+
+
+ [Page 25]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ An Example Fragmentation Procedure
+
+ The maximum sized datagram that can be transmitted through the
+ next network is called the maximum transmission unit (MTU).
+
+ If the total length is less than or equal the maximum transmission
+ unit then submit this datagram to the next step in datagram
+ processing; otherwise cut the datagram into two fragments, the
+ first fragment being the maximum size, and the second fragment
+ being the rest of the datagram. The first fragment is submitted
+ to the next step in datagram processing, while the second fragment
+ is submitted to this procedure in case it is still too large.
+
+ Notation:
+
+ FO - Fragment Offset
+ IHL - Internet Header Length
+ DF - Don't Fragment flag
+ MF - More Fragments flag
+ TL - Total Length
+ OFO - Old Fragment Offset
+ OIHL - Old Internet Header Length
+ OMF - Old More Fragments flag
+ OTL - Old Total Length
+ NFB - Number of Fragment Blocks
+ MTU - Maximum Transmission Unit
+
+ Procedure:
+
+ IF TL =< MTU THEN Submit this datagram to the next step
+ in datagram processing ELSE IF DF = 1 THEN discard the
+ datagram ELSE
+ To produce the first fragment:
+ (1) Copy the original internet header;
+ (2) OIHL <- IHL; OTL <- TL; OFO <- FO; OMF <- MF;
+ (3) NFB <- (MTU-IHL*4)/8;
+ (4) Attach the first NFB*8 data octets;
+ (5) Correct the header:
+ MF <- 1; TL <- (IHL*4)+(NFB*8);
+ Recompute Checksum;
+ (6) Submit this fragment to the next step in
+ datagram processing;
+ To produce the second fragment:
+ (7) Selectively copy the internet header (some options
+ are not copied, see option definitions);
+ (8) Append the remaining data;
+ (9) Correct the header:
+ IHL <- (((OIHL*4)-(length of options not copied))+3)/4;
+
+
+[Page 26]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ TL <- OTL - NFB*8 - (OIHL-IHL)*4);
+ FO <- OFO + NFB; MF <- OMF; Recompute Checksum;
+ (10) Submit this fragment to the fragmentation test; DONE.
+
+ In the above procedure each fragment (except the last) was made
+ the maximum allowable size. An alternative might produce less
+ than the maximum size datagrams. For example, one could implement
+ a fragmentation procedure that repeatly divided large datagrams in
+ half until the resulting fragments were less than the maximum
+ transmission unit size.
+
+ An Example Reassembly Procedure
+
+ For each datagram the buffer identifier is computed as the
+ concatenation of the source, destination, protocol, and
+ identification fields. If this is a whole datagram (that is both
+ the fragment offset and the more fragments fields are zero), then
+ any reassembly resources associated with this buffer identifier
+ are released and the datagram is forwarded to the next step in
+ datagram processing.
+
+ If no other fragment with this buffer identifier is on hand then
+ reassembly resources are allocated. The reassembly resources
+ consist of a data buffer, a header buffer, a fragment block bit
+ table, a total data length field, and a timer. The data from the
+ fragment is placed in the data buffer according to its fragment
+ offset and length, and bits are set in the fragment block bit
+ table corresponding to the fragment blocks received.
+
+ If this is the first fragment (that is the fragment offset is
+ zero) this header is placed in the header buffer. If this is the
+ last fragment ( that is the more fragments field is zero) the
+ total data length is computed. If this fragment completes the
+ datagram (tested by checking the bits set in the fragment block
+ table), then the datagram is sent to the next step in datagram
+ processing; otherwise the timer is set to the maximum of the
+ current timer value and the value of the time to live field from
+ this fragment; and the reassembly routine gives up control.
+
+ If the timer runs out, the all reassembly resources for this
+ buffer identifier are released. The initial setting of the timer
+ is a lower bound on the reassembly waiting time. This is because
+ the waiting time will be increased if the Time to Live in the
+ arriving fragment is greater than the current timer value but will
+ not be decreased if it is less. The maximum this timer value
+ could reach is the maximum time to live (approximately 4.25
+ minutes). The current recommendation for the initial timer
+ setting is 15 seconds. This may be changed as experience with
+
+
+ [Page 27]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ this protocol accumulates. Note that the choice of this parameter
+ value is related to the buffer capacity available and the data
+ rate of the transmission medium; that is, data rate times timer
+ value equals buffer size (e.g., 10Kb/s X 15s = 150Kb).
+
+ Notation:
+
+ FO - Fragment Offset
+ IHL - Internet Header Length
+ MF - More Fragments flag
+ TTL - Time To Live
+ NFB - Number of Fragment Blocks
+ TL - Total Length
+ TDL - Total Data Length
+ BUFID - Buffer Identifier
+ RCVBT - Fragment Received Bit Table
+ TLB - Timer Lower Bound
+
+ Procedure:
+
+ (1) BUFID <- source|destination|protocol|identification;
+ (2) IF FO = 0 AND MF = 0
+ (3) THEN IF buffer with BUFID is allocated
+ (4) THEN flush all reassembly for this BUFID;
+ (5) Submit datagram to next step; DONE.
+ (6) ELSE IF no buffer with BUFID is allocated
+ (7) THEN allocate reassembly resources
+ with BUFID;
+ TIMER <- TLB; TDL <- 0;
+ (8) put data from fragment into data buffer with
+ BUFID from octet FO*8 to
+ octet (TL-(IHL*4))+FO*8;
+ (9) set RCVBT bits from FO
+ to FO+((TL-(IHL*4)+7)/8);
+ (10) IF MF = 0 THEN TDL <- TL-(IHL*4)+(FO*8)
+ (11) IF FO = 0 THEN put header in header buffer
+ (12) IF TDL # 0
+ (13) AND all RCVBT bits from 0
+ to (TDL+7)/8 are set
+ (14) THEN TL <- TDL+(IHL*4)
+ (15) Submit datagram to next step;
+ (16) free all reassembly resources
+ for this BUFID; DONE.
+ (17) TIMER <- MAX(TIMER,TTL);
+ (18) give up until next fragment or timer expires;
+ (19) timer expires: flush all reassembly with this BUFID; DONE.
+
+ In the case that two or more fragments contain the same data
+
+
+[Page 28]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ either identically or through a partial overlap, this procedure
+ will use the more recently arrived copy in the data buffer and
+ datagram delivered.
+
+ Identification
+
+ The choice of the Identifier for a datagram is based on the need to
+ provide a way to uniquely identify the fragments of a particular
+ datagram. The protocol module assembling fragments judges fragments
+ to belong to the same datagram if they have the same source,
+ destination, protocol, and Identifier. Thus, the sender must choose
+ the Identifier to be unique for this source, destination pair and
+ protocol for the time the datagram (or any fragment of it) could be
+ alive in the internet.
+
+ It seems then that a sending protocol module needs to keep a table
+ of Identifiers, one entry for each destination it has communicated
+ with in the last maximum packet lifetime for the internet.
+
+ However, since the Identifier field allows 65,536 different values,
+ some host may be able to simply use unique identifiers independent
+ of destination.
+
+ It is appropriate for some higher level protocols to choose the
+ identifier. For example, TCP protocol modules may retransmit an
+ identical TCP segment, and the probability for correct reception
+ would be enhanced if the retransmission carried the same identifier
+ as the original transmission since fragments of either datagram
+ could be used to construct a correct TCP segment.
+
+ Type of Service
+
+ The type of service (TOS) is for internet service quality selection.
+ The type of service is specified along the abstract parameters
+ precedence, delay, throughput, and reliability. These abstract
+ parameters are to be mapped into the actual service parameters of
+ the particular networks the datagram traverses.
+
+ Precedence. An independent measure of the importance of this
+ datagram.
+
+ Delay. Prompt delivery is important for datagrams with this
+ indication.
+
+ Throughput. High data rate is important for datagrams with this
+ indication.
+
+
+
+
+ [Page 29]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ Reliability. A higher level of effort to ensure delivery is
+ important for datagrams with this indication.
+
+ For example, the ARPANET has a priority bit, and a choice between
+ "standard" messages (type 0) and "uncontrolled" messages (type 3),
+ (the choice between single packet and multipacket messages can also
+ be considered a service parameter). The uncontrolled messages tend
+ to be less reliably delivered and suffer less delay. Suppose an
+ internet datagram is to be sent through the ARPANET. Let the
+ internet type of service be given as:
+
+ Precedence: 5
+ Delay: 0
+ Throughput: 1
+ Reliability: 1
+
+ In this example, the mapping of these parameters to those available
+ for the ARPANET would be to set the ARPANET priority bit on since
+ the Internet precedence is in the upper half of its range, to select
+ standard messages since the throughput and reliability requirements
+ are indicated and delay is not. More details are given on service
+ mappings in "Service Mappings" [8].
+
+ Time to Live
+
+ The time to live is set by the sender to the maximum time the
+ datagram is allowed to be in the internet system. If the datagram
+ is in the internet system longer than the time to live, then the
+ datagram must be destroyed.
+
+ This field must be decreased at each point that the internet header
+ is processed to reflect the time spent processing the datagram.
+ Even if no local information is available on the time actually
+ spent, the field must be decremented by 1. The time is measured in
+ units of seconds (i.e. the value 1 means one second). Thus, the
+ maximum time to live is 255 seconds or 4.25 minutes. Since every
+ module that processes a datagram must decrease the TTL by at least
+ one even if it process the datagram in less than a second, the TTL
+ must be thought of only as an upper bound on the time a datagram may
+ exist. The intention is to cause undeliverable datagrams to be
+ discarded, and to bound the maximum datagram lifetime.
+
+ Some higher level reliable connection protocols are based on
+ assumptions that old duplicate datagrams will not arrive after a
+ certain time elapses. The TTL is a way for such protocols to have
+ an assurance that their assumption is met.
+
+
+
+
+[Page 30]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ Options
+
+ The options are optional in each datagram, but required in
+ implementations. That is, the presence or absence of an option is
+ the choice of the sender, but each internet module must be able to
+ parse every option. There can be several options present in the
+ option field.
+
+ The options might not end on a 32-bit boundary. The internet header
+ must be filled out with octets of zeros. The first of these would
+ be interpreted as the end-of-options option, and the remainder as
+ internet header padding.
+
+ Every internet module must be able to act on every option. The
+ Security Option is required if classified, restricted, or
+ compartmented traffic is to be passed.
+
+ Checksum
+
+ The internet header checksum is recomputed if the internet header is
+ changed. For example, a reduction of the time to live, additions or
+ changes to internet options, or due to fragmentation. This checksum
+ at the internet level is intended to protect the internet header
+ fields from transmission errors.
+
+ There are some applications where a few data bit errors are
+ acceptable while retransmission delays are not. If the internet
+ protocol enforced data correctness such applications could not be
+ supported.
+
+ Errors
+
+ Internet protocol errors may be reported via the ICMP messages [3].
+
+3.3. Interfaces
+
+ The functional description of user interfaces to the IP is, at best,
+ fictional, since every operating system will have different
+ facilities. Consequently, we must warn readers that different IP
+ implementations may have different user interfaces. However, all IPs
+ must provide a certain minimum set of services to guarantee that all
+ IP implementations can support the same protocol hierarchy. This
+ section specifies the functional interfaces required of all IP
+ implementations.
+
+ Internet protocol interfaces on one side to the local network and on
+ the other side to either a higher level protocol or an application
+ program. In the following, the higher level protocol or application
+
+
+ [Page 31]
+
+
+ September 1981
+Internet Protocol
+Specification
+
+
+
+ program (or even a gateway program) will be called the "user" since it
+ is using the internet module. Since internet protocol is a datagram
+ protocol, there is minimal memory or state maintained between datagram
+ transmissions, and each call on the internet protocol module by the
+ user supplies all information necessary for the IP to perform the
+ service requested.
+
+ An Example Upper Level Interface
+
+ The following two example calls satisfy the requirements for the user
+ to internet protocol module communication ("=>" means returns):
+
+ SEND (src, dst, prot, TOS, TTL, BufPTR, len, Id, DF, opt => result)
+
+ where:
+
+ src = source address
+ dst = destination address
+ prot = protocol
+ TOS = type of service
+ TTL = time to live
+ BufPTR = buffer pointer
+ len = length of buffer
+ Id = Identifier
+ DF = Don't Fragment
+ opt = option data
+ result = response
+ OK = datagram sent ok
+ Error = error in arguments or local network error
+
+ Note that the precedence is included in the TOS and the
+ security/compartment is passed as an option.
+
+ RECV (BufPTR, prot, => result, src, dst, TOS, len, opt)
+
+ where:
+
+ BufPTR = buffer pointer
+ prot = protocol
+ result = response
+ OK = datagram received ok
+ Error = error in arguments
+ len = length of buffer
+ src = source address
+ dst = destination address
+ TOS = type of service
+ opt = option data
+
+
+
+[Page 32]
+
+
+September 1981
+ Internet Protocol
+ Specification
+
+
+
+ When the user sends a datagram, it executes the SEND call supplying
+ all the arguments. The internet protocol module, on receiving this
+ call, checks the arguments and prepares and sends the message. If the
+ arguments are good and the datagram is accepted by the local network,
+ the call returns successfully. If either the arguments are bad, or
+ the datagram is not accepted by the local network, the call returns
+ unsuccessfully. On unsuccessful returns, a reasonable report must be
+ made as to the cause of the problem, but the details of such reports
+ are up to individual implementations.
+
+ When a datagram arrives at the internet protocol module from the local
+ network, either there is a pending RECV call from the user addressed
+ or there is not. In the first case, the pending call is satisfied by
+ passing the information from the datagram to the user. In the second
+ case, the user addressed is notified of a pending datagram. If the
+ user addressed does not exist, an ICMP error message is returned to
+ the sender, and the data is discarded.
+
+ The notification of a user may be via a pseudo interrupt or similar
+ mechanism, as appropriate in the particular operating system
+ environment of the implementation.
+
+ A user's RECV call may then either be immediately satisfied by a
+ pending datagram, or the call may be pending until a datagram arrives.
+
+ The source address is included in the send call in case the sending
+ host has several addresses (multiple physical connections or logical
+ addresses). The internet module must check to see that the source
+ address is one of the legal address for this host.
+
+ An implementation may also allow or require a call to the internet
+ module to indicate interest in or reserve exclusive use of a class of
+ datagrams (e.g., all those with a certain value in the protocol
+ field).
+
+ This section functionally characterizes a USER/IP interface. The
+ notation used is similar to most procedure of function calls in high
+ level languages, but this usage is not meant to rule out trap type
+ service calls (e.g., SVCs, UUOs, EMTs), or any other form of
+ interprocess communication.
+
+
+
+
+
+
+
+
+
+
+ [Page 33]
+
+
+ September 1981
+Internet Protocol
+
+
+
+APPENDIX A: Examples & Scenarios
+
+Example 1:
+
+ This is an example of the minimal data carrying internet datagram:
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |Ver= 4 |IHL= 5 |Type of Service| Total Length = 21 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Identification = 111 |Flg=0| Fragment Offset = 0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Time = 123 | Protocol = 1 | header checksum |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | source address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | destination address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ +-+-+-+-+-+-+-+-+
+
+ Example Internet Datagram
+
+ Figure 5.
+
+ Note that each tick mark represents one bit position.
+
+ This is a internet datagram in version 4 of internet protocol; the
+ internet header consists of five 32 bit words, and the total length of
+ the datagram is 21 octets. This datagram is a complete datagram (not
+ a fragment).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 34]
+
+
+September 1981
+ Internet Protocol
+
+
+
+Example 2:
+
+ In this example, we show first a moderate size internet datagram (452
+ data octets), then two internet fragments that might result from the
+ fragmentation of this datagram if the maximum sized transmission
+ allowed were 280 octets.
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |Ver= 4 |IHL= 5 |Type of Service| Total Length = 472 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Identification = 111 |Flg=0| Fragment Offset = 0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Time = 123 | Protocol = 6 | header checksum |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | source address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | destination address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ \ \
+ \ \
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Example Internet Datagram
+
+ Figure 6.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 35]
+
+
+ September 1981
+Internet Protocol
+
+
+
+ Now the first fragment that results from splitting the datagram after
+ 256 data octets.
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |Ver= 4 |IHL= 5 |Type of Service| Total Length = 276 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Identification = 111 |Flg=1| Fragment Offset = 0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Time = 119 | Protocol = 6 | Header Checksum |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | source address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | destination address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ \ \
+ \ \
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Example Internet Fragment
+
+ Figure 7.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 36]
+
+
+September 1981
+ Internet Protocol
+
+
+
+ And the second fragment.
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |Ver= 4 |IHL= 5 |Type of Service| Total Length = 216 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Identification = 111 |Flg=0| Fragment Offset = 32 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Time = 119 | Protocol = 6 | Header Checksum |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | source address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | destination address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ \ \
+ \ \
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Example Internet Fragment
+
+ Figure 8.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 37]
+
+
+ September 1981
+Internet Protocol
+
+
+
+Example 3:
+
+ Here, we show an example of a datagram containing options:
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |Ver= 4 |IHL= 8 |Type of Service| Total Length = 576 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Identification = 111 |Flg=0| Fragment Offset = 0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Time = 123 | Protocol = 6 | Header Checksum |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | source address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | destination address |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Opt. Code = x | Opt. Len.= 3 | option value | Opt. Code = x |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Opt. Len. = 4 | option value | Opt. Code = 1 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Opt. Code = y | Opt. Len. = 3 | option value | Opt. Code = 0 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ \ \
+ \ \
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Example Internet Datagram
+
+ Figure 9.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 38]
+
+
+September 1981
+ Internet Protocol
+
+
+
+APPENDIX B: Data Transmission Order
+
+The order of transmission of the header and data described in this
+document is resolved to the octet level. Whenever a diagram shows a
+group of octets, the order of transmission of those octets is the normal
+order in which they are read in English. For example, in the following
+diagram the octets are transmitted in the order they are numbered.
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | 1 | 2 | 3 | 4 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | 5 | 6 | 7 | 8 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | 9 | 10 | 11 | 12 |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Transmission Order of Bytes
+
+ Figure 10.
+
+Whenever an octet represents a numeric quantity the left most bit in the
+diagram is the high order or most significant bit. That is, the bit
+labeled 0 is the most significant bit. For example, the following
+diagram represents the value 170 (decimal).
+
+
+ 0 1 2 3 4 5 6 7
+ +-+-+-+-+-+-+-+-+
+ |1 0 1 0 1 0 1 0|
+ +-+-+-+-+-+-+-+-+
+
+ Significance of Bits
+
+ Figure 11.
+
+Similarly, whenever a multi-octet field represents a numeric quantity
+the left most bit of the whole field is the most significant bit. When
+a multi-octet quantity is transmitted the most significant octet is
+transmitted first.
+
+
+
+
+
+
+
+
+
+ [Page 39]
+
+
+ September 1981
+Internet Protocol
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 40]
+
+
+September 1981
+ Internet Protocol
+
+
+
+ GLOSSARY
+
+
+
+1822
+ BBN Report 1822, "The Specification of the Interconnection of
+ a Host and an IMP". The specification of interface between a
+ host and the ARPANET.
+
+ARPANET leader
+ The control information on an ARPANET message at the host-IMP
+ interface.
+
+ARPANET message
+ The unit of transmission between a host and an IMP in the
+ ARPANET. The maximum size is about 1012 octets (8096 bits).
+
+ARPANET packet
+ A unit of transmission used internally in the ARPANET between
+ IMPs. The maximum size is about 126 octets (1008 bits).
+
+Destination
+ The destination address, an internet header field.
+
+DF
+ The Don't Fragment bit carried in the flags field.
+
+Flags
+ An internet header field carrying various control flags.
+
+Fragment Offset
+ This internet header field indicates where in the internet
+ datagram a fragment belongs.
+
+GGP
+ Gateway to Gateway Protocol, the protocol used primarily
+ between gateways to control routing and other gateway
+ functions.
+
+header
+ Control information at the beginning of a message, segment,
+ datagram, packet or block of data.
+
+ICMP
+ Internet Control Message Protocol, implemented in the internet
+ module, the ICMP is used from gateways to hosts and between
+ hosts to report errors and make routing suggestions.
+
+
+
+
+ [Page 41]
+
+
+ September 1981
+Internet Protocol
+Glossary
+
+
+
+Identification
+ An internet header field carrying the identifying value
+ assigned by the sender to aid in assembling the fragments of a
+ datagram.
+
+IHL
+ The internet header field Internet Header Length is the length
+ of the internet header measured in 32 bit words.
+
+IMP
+ The Interface Message Processor, the packet switch of the
+ ARPANET.
+
+Internet Address
+ A four octet (32 bit) source or destination address consisting
+ of a Network field and a Local Address field.
+
+internet datagram
+ The unit of data exchanged between a pair of internet modules
+ (includes the internet header).
+
+internet fragment
+ A portion of the data of an internet datagram with an internet
+ header.
+
+Local Address
+ The address of a host within a network. The actual mapping of
+ an internet local address on to the host addresses in a
+ network is quite general, allowing for many to one mappings.
+
+MF
+ The More-Fragments Flag carried in the internet header flags
+ field.
+
+module
+ An implementation, usually in software, of a protocol or other
+ procedure.
+
+more-fragments flag
+ A flag indicating whether or not this internet datagram
+ contains the end of an internet datagram, carried in the
+ internet header Flags field.
+
+NFB
+ The Number of Fragment Blocks in a the data portion of an
+ internet fragment. That is, the length of a portion of data
+ measured in 8 octet units.
+
+
+
+[Page 42]
+
+
+September 1981
+ Internet Protocol
+ Glossary
+
+
+
+octet
+ An eight bit byte.
+
+Options
+ The internet header Options field may contain several options,
+ and each option may be several octets in length.
+
+Padding
+ The internet header Padding field is used to ensure that the
+ data begins on 32 bit word boundary. The padding is zero.
+
+Protocol
+ In this document, the next higher level protocol identifier,
+ an internet header field.
+
+Rest
+ The local address portion of an Internet Address.
+
+Source
+ The source address, an internet header field.
+
+TCP
+ Transmission Control Protocol: A host-to-host protocol for
+ reliable communication in internet environments.
+
+TCP Segment
+ The unit of data exchanged between TCP modules (including the
+ TCP header).
+
+TFTP
+ Trivial File Transfer Protocol: A simple file transfer
+ protocol built on UDP.
+
+Time to Live
+ An internet header field which indicates the upper bound on
+ how long this internet datagram may exist.
+
+TOS
+ Type of Service
+
+Total Length
+ The internet header field Total Length is the length of the
+ datagram in octets including internet header and data.
+
+TTL
+ Time to Live
+
+
+
+
+ [Page 43]
+
+
+ September 1981
+Internet Protocol
+Glossary
+
+
+
+Type of Service
+ An internet header field which indicates the type (or quality)
+ of service for this internet datagram.
+
+UDP
+ User Datagram Protocol: A user level protocol for transaction
+ oriented applications.
+
+User
+ The user of the internet protocol. This may be a higher level
+ protocol module, an application program, or a gateway program.
+
+Version
+ The Version field indicates the format of the internet header.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 44]
+
+
+September 1981
+ Internet Protocol
+
+
+
+ REFERENCES
+
+
+
+[1] Cerf, V., "The Catenet Model for Internetworking," Information
+ Processing Techniques Office, Defense Advanced Research Projects
+ Agency, IEN 48, July 1978.
+
+[2] Bolt Beranek and Newman, "Specification for the Interconnection of
+ a Host and an IMP," BBN Technical Report 1822, Revised May 1978.
+
+[3] Postel, J., "Internet Control Message Protocol - DARPA Internet
+ Program Protocol Specification," RFC 792, USC/Information Sciences
+ Institute, September 1981.
+
+[4] Shoch, J., "Inter-Network Naming, Addressing, and Routing,"
+ COMPCON, IEEE Computer Society, Fall 1978.
+
+[5] Postel, J., "Address Mappings," RFC 796, USC/Information Sciences
+ Institute, September 1981.
+
+[6] Shoch, J., "Packet Fragmentation in Inter-Network Protocols,"
+ Computer Networks, v. 3, n. 1, February 1979.
+
+[7] Strazisar, V., "How to Build a Gateway", IEN 109, Bolt Beranek and
+ Newman, August 1979.
+
+[8] Postel, J., "Service Mappings," RFC 795, USC/Information Sciences
+ Institute, September 1981.
+
+[9] Postel, J., "Assigned Numbers," RFC 790, USC/Information Sciences
+ Institute, September 1981.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 45]
+
diff --git a/rfc/rfc793.txt b/rfc/rfc793.txt
new file mode 100644
index 0000000..603a78c
--- /dev/null
+++ b/rfc/rfc793.txt
@@ -0,0 +1,5247 @@
+
+
+RFC: 793
+
+
+
+
+
+
+
+ TRANSMISSION CONTROL PROTOCOL
+
+
+ DARPA INTERNET PROGRAM
+
+ PROTOCOL SPECIFICATION
+
+
+
+ September 1981
+
+
+
+
+
+
+
+
+
+
+
+
+
+ prepared for
+
+ Defense Advanced Research Projects Agency
+ Information Processing Techniques Office
+ 1400 Wilson Boulevard
+ Arlington, Virginia 22209
+
+
+
+
+
+
+
+ by
+
+ Information Sciences Institute
+ University of Southern California
+ 4676 Admiralty Way
+ Marina del Rey, California 90291
+
+
+
+September 1981
+ Transmission Control Protocol
+
+
+
+ TABLE OF CONTENTS
+
+ PREFACE ........................................................ iii
+
+1. INTRODUCTION ..................................................... 1
+
+ 1.1 Motivation .................................................... 1
+ 1.2 Scope ......................................................... 2
+ 1.3 About This Document ........................................... 2
+ 1.4 Interfaces .................................................... 3
+ 1.5 Operation ..................................................... 3
+
+2. PHILOSOPHY ....................................................... 7
+
+ 2.1 Elements of the Internetwork System ........................... 7
+ 2.2 Model of Operation ............................................ 7
+ 2.3 The Host Environment .......................................... 8
+ 2.4 Interfaces .................................................... 9
+ 2.5 Relation to Other Protocols ................................... 9
+ 2.6 Reliable Communication ........................................ 9
+ 2.7 Connection Establishment and Clearing ........................ 10
+ 2.8 Data Communication ........................................... 12
+ 2.9 Precedence and Security ...................................... 13
+ 2.10 Robustness Principle ......................................... 13
+
+3. FUNCTIONAL SPECIFICATION ........................................ 15
+
+ 3.1 Header Format ................................................ 15
+ 3.2 Terminology .................................................. 19
+ 3.3 Sequence Numbers ............................................. 24
+ 3.4 Establishing a connection .................................... 30
+ 3.5 Closing a Connection ......................................... 37
+ 3.6 Precedence and Security ...................................... 40
+ 3.7 Data Communication ........................................... 40
+ 3.8 Interfaces ................................................... 44
+ 3.9 Event Processing ............................................. 52
+
+GLOSSARY ............................................................ 79
+
+REFERENCES .......................................................... 85
+
+
+
+
+
+
+
+
+
+
+
+ [Page i]
+
+
+ September 1981
+Transmission Control Protocol
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page ii]
+
+
+September 1981
+ Transmission Control Protocol
+
+
+
+ PREFACE
+
+
+
+This document describes the DoD Standard Transmission Control Protocol
+(TCP). There have been nine earlier editions of the ARPA TCP
+specification on which this standard is based, and the present text
+draws heavily from them. There have been many contributors to this work
+both in terms of concepts and in terms of text. This edition clarifies
+several details and removes the end-of-letter buffer-size adjustments,
+and redescribes the letter mechanism as a push function.
+
+ Jon Postel
+
+ Editor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page iii]
+
+
+
+
+RFC: 793
+Replaces: RFC 761
+IENs: 129, 124, 112, 81,
+55, 44, 40, 27, 21, 5
+
+ TRANSMISSION CONTROL PROTOCOL
+
+ DARPA INTERNET PROGRAM
+ PROTOCOL SPECIFICATION
+
+
+
+ 1. INTRODUCTION
+
+The Transmission Control Protocol (TCP) is intended for use as a highly
+reliable host-to-host protocol between hosts in packet-switched computer
+communication networks, and in interconnected systems of such networks.
+
+This document describes the functions to be performed by the
+Transmission Control Protocol, the program that implements it, and its
+interface to programs or users that require its services.
+
+1.1. Motivation
+
+ Computer communication systems are playing an increasingly important
+ role in military, government, and civilian environments. This
+ document focuses its attention primarily on military computer
+ communication requirements, especially robustness in the presence of
+ communication unreliability and availability in the presence of
+ congestion, but many of these problems are found in the civilian and
+ government sector as well.
+
+ As strategic and tactical computer communication networks are
+ developed and deployed, it is essential to provide means of
+ interconnecting them and to provide standard interprocess
+ communication protocols which can support a broad range of
+ applications. In anticipation of the need for such standards, the
+ Deputy Undersecretary of Defense for Research and Engineering has
+ declared the Transmission Control Protocol (TCP) described herein to
+ be a basis for DoD-wide inter-process communication protocol
+ standardization.
+
+ TCP is a connection-oriented, end-to-end reliable protocol designed to
+ fit into a layered hierarchy of protocols which support multi-network
+ applications. The TCP provides for reliable inter-process
+ communication between pairs of processes in host computers attached to
+ distinct but interconnected computer communication networks. Very few
+ assumptions are made as to the reliability of the communication
+ protocols below the TCP layer. TCP assumes it can obtain a simple,
+ potentially unreliable datagram service from the lower level
+ protocols. In principle, the TCP should be able to operate above a
+ wide spectrum of communication systems ranging from hard-wired
+ connections to packet-switched or circuit-switched networks.
+
+
+ [Page 1]
+
+
+ September 1981
+Transmission Control Protocol
+Introduction
+
+
+
+ TCP is based on concepts first described by Cerf and Kahn in [1]. The
+ TCP fits into a layered protocol architecture just above a basic
+ Internet Protocol [2] which provides a way for the TCP to send and
+ receive variable-length segments of information enclosed in internet
+ datagram "envelopes". The internet datagram provides a means for
+ addressing source and destination TCPs in different networks. The
+ internet protocol also deals with any fragmentation or reassembly of
+ the TCP segments required to achieve transport and delivery through
+ multiple networks and interconnecting gateways. The internet protocol
+ also carries information on the precedence, security classification
+ and compartmentation of the TCP segments, so this information can be
+ communicated end-to-end across multiple networks.
+
+ Protocol Layering
+
+ +---------------------+
+ | higher-level |
+ +---------------------+
+ | TCP |
+ +---------------------+
+ | internet protocol |
+ +---------------------+
+ |communication network|
+ +---------------------+
+
+ Figure 1
+
+ Much of this document is written in the context of TCP implementations
+ which are co-resident with higher level protocols in the host
+ computer. Some computer systems will be connected to networks via
+ front-end computers which house the TCP and internet protocol layers,
+ as well as network specific software. The TCP specification describes
+ an interface to the higher level protocols which appears to be
+ implementable even for the front-end case, as long as a suitable
+ host-to-front end protocol is implemented.
+
+1.2. Scope
+
+ The TCP is intended to provide a reliable process-to-process
+ communication service in a multinetwork environment. The TCP is
+ intended to be a host-to-host protocol in common use in multiple
+ networks.
+
+1.3. About this Document
+
+ This document represents a specification of the behavior required of
+ any TCP implementation, both in its interactions with higher level
+ protocols and in its interactions with other TCPs. The rest of this
+
+
+[Page 2]
+
+
+September 1981
+ Transmission Control Protocol
+ Introduction
+
+
+
+ section offers a very brief view of the protocol interfaces and
+ operation. Section 2 summarizes the philosophical basis for the TCP
+ design. Section 3 offers both a detailed description of the actions
+ required of TCP when various events occur (arrival of new segments,
+ user calls, errors, etc.) and the details of the formats of TCP
+ segments.
+
+1.4. Interfaces
+
+ The TCP interfaces on one side to user or application processes and on
+ the other side to a lower level protocol such as Internet Protocol.
+
+ The interface between an application process and the TCP is
+ illustrated in reasonable detail. This interface consists of a set of
+ calls much like the calls an operating system provides to an
+ application process for manipulating files. For example, there are
+ calls to open and close connections and to send and receive data on
+ established connections. It is also expected that the TCP can
+ asynchronously communicate with application programs. Although
+ considerable freedom is permitted to TCP implementors to design
+ interfaces which are appropriate to a particular operating system
+ environment, a minimum functionality is required at the TCP/user
+ interface for any valid implementation.
+
+ The interface between TCP and lower level protocol is essentially
+ unspecified except that it is assumed there is a mechanism whereby the
+ two levels can asynchronously pass information to each other.
+ Typically, one expects the lower level protocol to specify this
+ interface. TCP is designed to work in a very general environment of
+ interconnected networks. The lower level protocol which is assumed
+ throughout this document is the Internet Protocol [2].
+
+1.5. Operation
+
+ As noted above, the primary purpose of the TCP is to provide reliable,
+ securable logical circuit or connection service between pairs of
+ processes. To provide this service on top of a less reliable internet
+ communication system requires facilities in the following areas:
+
+ Basic Data Transfer
+ Reliability
+ Flow Control
+ Multiplexing
+ Connections
+ Precedence and Security
+
+ The basic operation of the TCP in each of these areas is described in
+ the following paragraphs.
+
+
+ [Page 3]
+
+
+ September 1981
+Transmission Control Protocol
+Introduction
+
+
+
+ Basic Data Transfer:
+
+ The TCP is able to transfer a continuous stream of octets in each
+ direction between its users by packaging some number of octets into
+ segments for transmission through the internet system. In general,
+ the TCPs decide when to block and forward data at their own
+ convenience.
+
+ Sometimes users need to be sure that all the data they have
+ submitted to the TCP has been transmitted. For this purpose a push
+ function is defined. To assure that data submitted to a TCP is
+ actually transmitted the sending user indicates that it should be
+ pushed through to the receiving user. A push causes the TCPs to
+ promptly forward and deliver data up to that point to the receiver.
+ The exact push point might not be visible to the receiving user and
+ the push function does not supply a record boundary marker.
+
+ Reliability:
+
+ The TCP must recover from data that is damaged, lost, duplicated, or
+ delivered out of order by the internet communication system. This
+ is achieved by assigning a sequence number to each octet
+ transmitted, and requiring a positive acknowledgment (ACK) from the
+ receiving TCP. If the ACK is not received within a timeout
+ interval, the data is retransmitted. At the receiver, the sequence
+ numbers are used to correctly order segments that may be received
+ out of order and to eliminate duplicates. Damage is handled by
+ adding a checksum to each segment transmitted, checking it at the
+ receiver, and discarding damaged segments.
+
+ As long as the TCPs continue to function properly and the internet
+ system does not become completely partitioned, no transmission
+ errors will affect the correct delivery of data. TCP recovers from
+ internet communication system errors.
+
+ Flow Control:
+
+ TCP provides a means for the receiver to govern the amount of data
+ sent by the sender. This is achieved by returning a "window" with
+ every ACK indicating a range of acceptable sequence numbers beyond
+ the last segment successfully received. The window indicates an
+ allowed number of octets that the sender may transmit before
+ receiving further permission.
+
+
+
+
+
+
+
+[Page 4]
+
+
+September 1981
+ Transmission Control Protocol
+ Introduction
+
+
+
+ Multiplexing:
+
+ To allow for many processes within a single Host to use TCP
+ communication facilities simultaneously, the TCP provides a set of
+ addresses or ports within each host. Concatenated with the network
+ and host addresses from the internet communication layer, this forms
+ a socket. A pair of sockets uniquely identifies each connection.
+ That is, a socket may be simultaneously used in multiple
+ connections.
+
+ The binding of ports to processes is handled independently by each
+ Host. However, it proves useful to attach frequently used processes
+ (e.g., a "logger" or timesharing service) to fixed sockets which are
+ made known to the public. These services can then be accessed
+ through the known addresses. Establishing and learning the port
+ addresses of other processes may involve more dynamic mechanisms.
+
+ Connections:
+
+ The reliability and flow control mechanisms described above require
+ that TCPs initialize and maintain certain status information for
+ each data stream. The combination of this information, including
+ sockets, sequence numbers, and window sizes, is called a connection.
+ Each connection is uniquely specified by a pair of sockets
+ identifying its two sides.
+
+ When two processes wish to communicate, their TCP's must first
+ establish a connection (initialize the status information on each
+ side). When their communication is complete, the connection is
+ terminated or closed to free the resources for other uses.
+
+ Since connections must be established between unreliable hosts and
+ over the unreliable internet communication system, a handshake
+ mechanism with clock-based sequence numbers is used to avoid
+ erroneous initialization of connections.
+
+ Precedence and Security:
+
+ The users of TCP may indicate the security and precedence of their
+ communication. Provision is made for default values to be used when
+ these features are not needed.
+
+
+
+
+
+
+
+
+
+ [Page 5]
+
+
+ September 1981
+Transmission Control Protocol
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 6]
+
+
+September 1981
+ Transmission Control Protocol
+
+
+
+ 2. PHILOSOPHY
+
+2.1. Elements of the Internetwork System
+
+ The internetwork environment consists of hosts connected to networks
+ which are in turn interconnected via gateways. It is assumed here
+ that the networks may be either local networks (e.g., the ETHERNET) or
+ large networks (e.g., the ARPANET), but in any case are based on
+ packet switching technology. The active agents that produce and
+ consume messages are processes. Various levels of protocols in the
+ networks, the gateways, and the hosts support an interprocess
+ communication system that provides two-way data flow on logical
+ connections between process ports.
+
+ The term packet is used generically here to mean the data of one
+ transaction between a host and its network. The format of data blocks
+ exchanged within the a network will generally not be of concern to us.
+
+ Hosts are computers attached to a network, and from the communication
+ network's point of view, are the sources and destinations of packets.
+ Processes are viewed as the active elements in host computers (in
+ accordance with the fairly common definition of a process as a program
+ in execution). Even terminals and files or other I/O devices are
+ viewed as communicating with each other through the use of processes.
+ Thus, all communication is viewed as inter-process communication.
+
+ Since a process may need to distinguish among several communication
+ streams between itself and another process (or processes), we imagine
+ that each process may have a number of ports through which it
+ communicates with the ports of other processes.
+
+2.2. Model of Operation
+
+ Processes transmit data by calling on the TCP and passing buffers of
+ data as arguments. The TCP packages the data from these buffers into
+ segments and calls on the internet module to transmit each segment to
+ the destination TCP. The receiving TCP places the data from a segment
+ into the receiving user's buffer and notifies the receiving user. The
+ TCPs include control information in the segments which they use to
+ ensure reliable ordered data transmission.
+
+ The model of internet communication is that there is an internet
+ protocol module associated with each TCP which provides an interface
+ to the local network. This internet module packages TCP segments
+ inside internet datagrams and routes these datagrams to a destination
+ internet module or intermediate gateway. To transmit the datagram
+ through the local network, it is embedded in a local network packet.
+
+ The packet switches may perform further packaging, fragmentation, or
+
+
+ [Page 7]
+
+
+ September 1981
+Transmission Control Protocol
+Philosophy
+
+
+
+ other operations to achieve the delivery of the local packet to the
+ destination internet module.
+
+ At a gateway between networks, the internet datagram is "unwrapped"
+ from its local packet and examined to determine through which network
+ the internet datagram should travel next. The internet datagram is
+ then "wrapped" in a local packet suitable to the next network and
+ routed to the next gateway, or to the final destination.
+
+ A gateway is permitted to break up an internet datagram into smaller
+ internet datagram fragments if this is necessary for transmission
+ through the next network. To do this, the gateway produces a set of
+ internet datagrams; each carrying a fragment. Fragments may be
+ further broken into smaller fragments at subsequent gateways. The
+ internet datagram fragment format is designed so that the destination
+ internet module can reassemble fragments into internet datagrams.
+
+ A destination internet module unwraps the segment from the datagram
+ (after reassembling the datagram, if necessary) and passes it to the
+ destination TCP.
+
+ This simple model of the operation glosses over many details. One
+ important feature is the type of service. This provides information
+ to the gateway (or internet module) to guide it in selecting the
+ service parameters to be used in traversing the next network.
+ Included in the type of service information is the precedence of the
+ datagram. Datagrams may also carry security information to permit
+ host and gateways that operate in multilevel secure environments to
+ properly segregate datagrams for security considerations.
+
+2.3. The Host Environment
+
+ The TCP is assumed to be a module in an operating system. The users
+ access the TCP much like they would access the file system. The TCP
+ may call on other operating system functions, for example, to manage
+ data structures. The actual interface to the network is assumed to be
+ controlled by a device driver module. The TCP does not call on the
+ network device driver directly, but rather calls on the internet
+ datagram protocol module which may in turn call on the device driver.
+
+ The mechanisms of TCP do not preclude implementation of the TCP in a
+ front-end processor. However, in such an implementation, a
+ host-to-front-end protocol must provide the functionality to support
+ the type of TCP-user interface described in this document.
+
+
+
+
+
+
+[Page 8]
+
+
+September 1981
+ Transmission Control Protocol
+ Philosophy
+
+
+
+2.4. Interfaces
+
+ The TCP/user interface provides for calls made by the user on the TCP
+ to OPEN or CLOSE a connection, to SEND or RECEIVE data, or to obtain
+ STATUS about a connection. These calls are like other calls from user
+ programs on the operating system, for example, the calls to open, read
+ from, and close a file.
+
+ The TCP/internet interface provides calls to send and receive
+ datagrams addressed to TCP modules in hosts anywhere in the internet
+ system. These calls have parameters for passing the address, type of
+ service, precedence, security, and other control information.
+
+2.5. Relation to Other Protocols
+
+ The following diagram illustrates the place of the TCP in the protocol
+ hierarchy:
+
+
+ +------+ +-----+ +-----+ +-----+
+ |Telnet| | FTP | |Voice| ... | | Application Level
+ +------+ +-----+ +-----+ +-----+
+ | | | |
+ +-----+ +-----+ +-----+
+ | TCP | | RTP | ... | | Host Level
+ +-----+ +-----+ +-----+
+ | | |
+ +-------------------------------+
+ | Internet Protocol & ICMP | Gateway Level
+ +-------------------------------+
+ |
+ +---------------------------+
+ | Local Network Protocol | Network Level
+ +---------------------------+
+
+ Protocol Relationships
+
+ Figure 2.
+
+ It is expected that the TCP will be able to support higher level
+ protocols efficiently. It should be easy to interface higher level
+ protocols like the ARPANET Telnet or AUTODIN II THP to the TCP.
+
+2.6. Reliable Communication
+
+ A stream of data sent on a TCP connection is delivered reliably and in
+ order at the destination.
+
+
+
+ [Page 9]
+
+
+ September 1981
+Transmission Control Protocol
+Philosophy
+
+
+
+ Transmission is made reliable via the use of sequence numbers and
+ acknowledgments. Conceptually, each octet of data is assigned a
+ sequence number. The sequence number of the first octet of data in a
+ segment is transmitted with that segment and is called the segment
+ sequence number. Segments also carry an acknowledgment number which
+ is the sequence number of the next expected data octet of
+ transmissions in the reverse direction. When the TCP transmits a
+ segment containing data, it puts a copy on a retransmission queue and
+ starts a timer; when the acknowledgment for that data is received, the
+ segment is deleted from the queue. If the acknowledgment is not
+ received before the timer runs out, the segment is retransmitted.
+
+ An acknowledgment by TCP does not guarantee that the data has been
+ delivered to the end user, but only that the receiving TCP has taken
+ the responsibility to do so.
+
+ To govern the flow of data between TCPs, a flow control mechanism is
+ employed. The receiving TCP reports a "window" to the sending TCP.
+ This window specifies the number of octets, starting with the
+ acknowledgment number, that the receiving TCP is currently prepared to
+ receive.
+
+2.7. Connection Establishment and Clearing
+
+ To identify the separate data streams that a TCP may handle, the TCP
+ provides a port identifier. Since port identifiers are selected
+ independently by each TCP they might not be unique. To provide for
+ unique addresses within each TCP, we concatenate an internet address
+ identifying the TCP with a port identifier to create a socket which
+ will be unique throughout all networks connected together.
+
+ A connection is fully specified by the pair of sockets at the ends. A
+ local socket may participate in many connections to different foreign
+ sockets. A connection can be used to carry data in both directions,
+ that is, it is "full duplex".
+
+ TCPs are free to associate ports with processes however they choose.
+ However, several basic concepts are necessary in any implementation.
+ There must be well-known sockets which the TCP associates only with
+ the "appropriate" processes by some means. We envision that processes
+ may "own" ports, and that processes can initiate connections only on
+ the ports they own. (Means for implementing ownership is a local
+ issue, but we envision a Request Port user command, or a method of
+ uniquely allocating a group of ports to a given process, e.g., by
+ associating the high order bits of a port name with a given process.)
+
+ A connection is specified in the OPEN call by the local port and
+ foreign socket arguments. In return, the TCP supplies a (short) local
+
+
+[Page 10]
+
+
+September 1981
+ Transmission Control Protocol
+ Philosophy
+
+
+
+ connection name by which the user refers to the connection in
+ subsequent calls. There are several things that must be remembered
+ about a connection. To store this information we imagine that there
+ is a data structure called a Transmission Control Block (TCB). One
+ implementation strategy would have the local connection name be a
+ pointer to the TCB for this connection. The OPEN call also specifies
+ whether the connection establishment is to be actively pursued, or to
+ be passively waited for.
+
+ A passive OPEN request means that the process wants to accept incoming
+ connection requests rather than attempting to initiate a connection.
+ Often the process requesting a passive OPEN will accept a connection
+ request from any caller. In this case a foreign socket of all zeros
+ is used to denote an unspecified socket. Unspecified foreign sockets
+ are allowed only on passive OPENs.
+
+ A service process that wished to provide services for unknown other
+ processes would issue a passive OPEN request with an unspecified
+ foreign socket. Then a connection could be made with any process that
+ requested a connection to this local socket. It would help if this
+ local socket were known to be associated with this service.
+
+ Well-known sockets are a convenient mechanism for a priori associating
+ a socket address with a standard service. For instance, the
+ "Telnet-Server" process is permanently assigned to a particular
+ socket, and other sockets are reserved for File Transfer, Remote Job
+ Entry, Text Generator, Echoer, and Sink processes (the last three
+ being for test purposes). A socket address might be reserved for
+ access to a "Look-Up" service which would return the specific socket
+ at which a newly created service would be provided. The concept of a
+ well-known socket is part of the TCP specification, but the assignment
+ of sockets to services is outside this specification. (See [4].)
+
+ Processes can issue passive OPENs and wait for matching active OPENs
+ from other processes and be informed by the TCP when connections have
+ been established. Two processes which issue active OPENs to each
+ other at the same time will be correctly connected. This flexibility
+ is critical for the support of distributed computing in which
+ components act asynchronously with respect to each other.
+
+ There are two principal cases for matching the sockets in the local
+ passive OPENs and an foreign active OPENs. In the first case, the
+ local passive OPENs has fully specified the foreign socket. In this
+ case, the match must be exact. In the second case, the local passive
+ OPENs has left the foreign socket unspecified. In this case, any
+ foreign socket is acceptable as long as the local sockets match.
+ Other possibilities include partially restricted matches.
+
+
+
+ [Page 11]
+
+
+ September 1981
+Transmission Control Protocol
+Philosophy
+
+
+
+ If there are several pending passive OPENs (recorded in TCBs) with the
+ same local socket, an foreign active OPEN will be matched to a TCB
+ with the specific foreign socket in the foreign active OPEN, if such a
+ TCB exists, before selecting a TCB with an unspecified foreign socket.
+
+ The procedures to establish connections utilize the synchronize (SYN)
+ control flag and involves an exchange of three messages. This
+ exchange has been termed a three-way hand shake [3].
+
+ A connection is initiated by the rendezvous of an arriving segment
+ containing a SYN and a waiting TCB entry each created by a user OPEN
+ command. The matching of local and foreign sockets determines when a
+ connection has been initiated. The connection becomes "established"
+ when sequence numbers have been synchronized in both directions.
+
+ The clearing of a connection also involves the exchange of segments,
+ in this case carrying the FIN control flag.
+
+2.8. Data Communication
+
+ The data that flows on a connection may be thought of as a stream of
+ octets. The sending user indicates in each SEND call whether the data
+ in that call (and any preceeding calls) should be immediately pushed
+ through to the receiving user by the setting of the PUSH flag.
+
+ A sending TCP is allowed to collect data from the sending user and to
+ send that data in segments at its own convenience, until the push
+ function is signaled, then it must send all unsent data. When a
+ receiving TCP sees the PUSH flag, it must not wait for more data from
+ the sending TCP before passing the data to the receiving process.
+
+ There is no necessary relationship between push functions and segment
+ boundaries. The data in any particular segment may be the result of a
+ single SEND call, in whole or part, or of multiple SEND calls.
+
+ The purpose of push function and the PUSH flag is to push data through
+ from the sending user to the receiving user. It does not provide a
+ record service.
+
+ There is a coupling between the push function and the use of buffers
+ of data that cross the TCP/user interface. Each time a PUSH flag is
+ associated with data placed into the receiving user's buffer, the
+ buffer is returned to the user for processing even if the buffer is
+ not filled. If data arrives that fills the user's buffer before a
+ PUSH is seen, the data is passed to the user in buffer size units.
+
+ TCP also provides a means to communicate to the receiver of data that
+ at some point further along in the data stream than the receiver is
+
+
+[Page 12]
+
+
+September 1981
+ Transmission Control Protocol
+ Philosophy
+
+
+
+ currently reading there is urgent data. TCP does not attempt to
+ define what the user specifically does upon being notified of pending
+ urgent data, but the general notion is that the receiving process will
+ take action to process the urgent data quickly.
+
+2.9. Precedence and Security
+
+ The TCP makes use of the internet protocol type of service field and
+ security option to provide precedence and security on a per connection
+ basis to TCP users. Not all TCP modules will necessarily function in
+ a multilevel secure environment; some may be limited to unclassified
+ use only, and others may operate at only one security level and
+ compartment. Consequently, some TCP implementations and services to
+ users may be limited to a subset of the multilevel secure case.
+
+ TCP modules which operate in a multilevel secure environment must
+ properly mark outgoing segments with the security, compartment, and
+ precedence. Such TCP modules must also provide to their users or
+ higher level protocols such as Telnet or THP an interface to allow
+ them to specify the desired security level, compartment, and
+ precedence of connections.
+
+2.10. Robustness Principle
+
+ TCP implementations will follow a general principle of robustness: be
+ conservative in what you do, be liberal in what you accept from
+ others.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 13]
+
+
+ September 1981
+Transmission Control Protocol
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 14]
+
+
+September 1981
+ Transmission Control Protocol
+
+
+
+ 3. FUNCTIONAL SPECIFICATION
+
+3.1. Header Format
+
+ TCP segments are sent as internet datagrams. The Internet Protocol
+ header carries several information fields, including the source and
+ destination host addresses [2]. A TCP header follows the internet
+ header, supplying information specific to the TCP protocol. This
+ division allows for the existence of host level protocols other than
+ TCP.
+
+ TCP Header Format
+
+
+ 0 1 2 3
+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Source Port | Destination Port |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Sequence Number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Acknowledgment Number |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Data | |U|A|P|R|S|F| |
+ | Offset| Reserved |R|C|S|S|Y|I| Window |
+ | | |G|K|H|T|N|N| |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Checksum | Urgent Pointer |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Options | Padding |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | data |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ TCP Header Format
+
+ Note that one tick mark represents one bit position.
+
+ Figure 3.
+
+ Source Port: 16 bits
+
+ The source port number.
+
+ Destination Port: 16 bits
+
+ The destination port number.
+
+
+
+
+ [Page 15]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ Sequence Number: 32 bits
+
+ The sequence number of the first data octet in this segment (except
+ when SYN is present). If SYN is present the sequence number is the
+ initial sequence number (ISN) and the first data octet is ISN+1.
+
+ Acknowledgment Number: 32 bits
+
+ If the ACK control bit is set this field contains the value of the
+ next sequence number the sender of the segment is expecting to
+ receive. Once a connection is established this is always sent.
+
+ Data Offset: 4 bits
+
+ The number of 32 bit words in the TCP Header. This indicates where
+ the data begins. The TCP header (even one including options) is an
+ integral number of 32 bits long.
+
+ Reserved: 6 bits
+
+ Reserved for future use. Must be zero.
+
+ Control Bits: 6 bits (from left to right):
+
+ URG: Urgent Pointer field significant
+ ACK: Acknowledgment field significant
+ PSH: Push Function
+ RST: Reset the connection
+ SYN: Synchronize sequence numbers
+ FIN: No more data from sender
+
+ Window: 16 bits
+
+ The number of data octets beginning with the one indicated in the
+ acknowledgment field which the sender of this segment is willing to
+ accept.
+
+ Checksum: 16 bits
+
+ The checksum field is the 16 bit one's complement of the one's
+ complement sum of all 16 bit words in the header and text. If a
+ segment contains an odd number of header and text octets to be
+ checksummed, the last octet is padded on the right with zeros to
+ form a 16 bit word for checksum purposes. The pad is not
+ transmitted as part of the segment. While computing the checksum,
+ the checksum field itself is replaced with zeros.
+
+ The checksum also covers a 96 bit pseudo header conceptually
+
+
+[Page 16]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ prefixed to the TCP header. This pseudo header contains the Source
+ Address, the Destination Address, the Protocol, and TCP length.
+ This gives the TCP protection against misrouted segments. This
+ information is carried in the Internet Protocol and is transferred
+ across the TCP/Network interface in the arguments or results of
+ calls by the TCP on the IP.
+
+ +--------+--------+--------+--------+
+ | Source Address |
+ +--------+--------+--------+--------+
+ | Destination Address |
+ +--------+--------+--------+--------+
+ | zero | PTCL | TCP Length |
+ +--------+--------+--------+--------+
+
+ The TCP Length is the TCP header length plus the data length in
+ octets (this is not an explicitly transmitted quantity, but is
+ computed), and it does not count the 12 octets of the pseudo
+ header.
+
+ Urgent Pointer: 16 bits
+
+ This field communicates the current value of the urgent pointer as a
+ positive offset from the sequence number in this segment. The
+ urgent pointer points to the sequence number of the octet following
+ the urgent data. This field is only be interpreted in segments with
+ the URG control bit set.
+
+ Options: variable
+
+ Options may occupy space at the end of the TCP header and are a
+ multiple of 8 bits in length. All options are included in the
+ checksum. An option may begin on any octet boundary. There are two
+ cases for the format of an option:
+
+ Case 1: A single octet of option-kind.
+
+ Case 2: An octet of option-kind, an octet of option-length, and
+ the actual option-data octets.
+
+ The option-length counts the two octets of option-kind and
+ option-length as well as the option-data octets.
+
+ Note that the list of options may be shorter than the data offset
+ field might imply. The content of the header beyond the
+ End-of-Option option must be header padding (i.e., zero).
+
+ A TCP must implement all options.
+
+
+ [Page 17]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ Currently defined options include (kind indicated in octal):
+
+ Kind Length Meaning
+ ---- ------ -------
+ 0 - End of option list.
+ 1 - No-Operation.
+ 2 4 Maximum Segment Size.
+
+
+ Specific Option Definitions
+
+ End of Option List
+
+ +--------+
+ |00000000|
+ +--------+
+ Kind=0
+
+ This option code indicates the end of the option list. This
+ might not coincide with the end of the TCP header according to
+ the Data Offset field. This is used at the end of all options,
+ not the end of each option, and need only be used if the end of
+ the options would not otherwise coincide with the end of the TCP
+ header.
+
+ No-Operation
+
+ +--------+
+ |00000001|
+ +--------+
+ Kind=1
+
+ This option code may be used between options, for example, to
+ align the beginning of a subsequent option on a word boundary.
+ There is no guarantee that senders will use this option, so
+ receivers must be prepared to process options even if they do
+ not begin on a word boundary.
+
+ Maximum Segment Size
+
+ +--------+--------+---------+--------+
+ |00000010|00000100| max seg size |
+ +--------+--------+---------+--------+
+ Kind=2 Length=4
+
+
+
+
+
+
+[Page 18]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ Maximum Segment Size Option Data: 16 bits
+
+ If this option is present, then it communicates the maximum
+ receive segment size at the TCP which sends this segment.
+ This field must only be sent in the initial connection request
+ (i.e., in segments with the SYN control bit set). If this
+ option is not used, any segment size is allowed.
+
+ Padding: variable
+
+ The TCP header padding is used to ensure that the TCP header ends
+ and data begins on a 32 bit boundary. The padding is composed of
+ zeros.
+
+3.2. Terminology
+
+ Before we can discuss very much about the operation of the TCP we need
+ to introduce some detailed terminology. The maintenance of a TCP
+ connection requires the remembering of several variables. We conceive
+ of these variables being stored in a connection record called a
+ Transmission Control Block or TCB. Among the variables stored in the
+ TCB are the local and remote socket numbers, the security and
+ precedence of the connection, pointers to the user's send and receive
+ buffers, pointers to the retransmit queue and to the current segment.
+ In addition several variables relating to the send and receive
+ sequence numbers are stored in the TCB.
+
+ Send Sequence Variables
+
+ SND.UNA - send unacknowledged
+ SND.NXT - send next
+ SND.WND - send window
+ SND.UP - send urgent pointer
+ SND.WL1 - segment sequence number used for last window update
+ SND.WL2 - segment acknowledgment number used for last window
+ update
+ ISS - initial send sequence number
+
+ Receive Sequence Variables
+
+ RCV.NXT - receive next
+ RCV.WND - receive window
+ RCV.UP - receive urgent pointer
+ IRS - initial receive sequence number
+
+
+
+
+
+
+ [Page 19]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ The following diagrams may help to relate some of these variables to
+ the sequence space.
+
+ Send Sequence Space
+
+ 1 2 3 4
+ ----------|----------|----------|----------
+ SND.UNA SND.NXT SND.UNA
+ +SND.WND
+
+ 1 - old sequence numbers which have been acknowledged
+ 2 - sequence numbers of unacknowledged data
+ 3 - sequence numbers allowed for new data transmission
+ 4 - future sequence numbers which are not yet allowed
+
+ Send Sequence Space
+
+ Figure 4.
+
+
+
+ The send window is the portion of the sequence space labeled 3 in
+ figure 4.
+
+ Receive Sequence Space
+
+ 1 2 3
+ ----------|----------|----------
+ RCV.NXT RCV.NXT
+ +RCV.WND
+
+ 1 - old sequence numbers which have been acknowledged
+ 2 - sequence numbers allowed for new reception
+ 3 - future sequence numbers which are not yet allowed
+
+ Receive Sequence Space
+
+ Figure 5.
+
+
+
+ The receive window is the portion of the sequence space labeled 2 in
+ figure 5.
+
+ There are also some variables used frequently in the discussion that
+ take their values from the fields of the current segment.
+
+
+
+
+[Page 20]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ Current Segment Variables
+
+ SEG.SEQ - segment sequence number
+ SEG.ACK - segment acknowledgment number
+ SEG.LEN - segment length
+ SEG.WND - segment window
+ SEG.UP - segment urgent pointer
+ SEG.PRC - segment precedence value
+
+ A connection progresses through a series of states during its
+ lifetime. The states are: LISTEN, SYN-SENT, SYN-RECEIVED,
+ ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK,
+ TIME-WAIT, and the fictional state CLOSED. CLOSED is fictional
+ because it represents the state when there is no TCB, and therefore,
+ no connection. Briefly the meanings of the states are:
+
+ LISTEN - represents waiting for a connection request from any remote
+ TCP and port.
+
+ SYN-SENT - represents waiting for a matching connection request
+ after having sent a connection request.
+
+ SYN-RECEIVED - represents waiting for a confirming connection
+ request acknowledgment after having both received and sent a
+ connection request.
+
+ ESTABLISHED - represents an open connection, data received can be
+ delivered to the user. The normal state for the data transfer phase
+ of the connection.
+
+ FIN-WAIT-1 - represents waiting for a connection termination request
+ from the remote TCP, or an acknowledgment of the connection
+ termination request previously sent.
+
+ FIN-WAIT-2 - represents waiting for a connection termination request
+ from the remote TCP.
+
+ CLOSE-WAIT - represents waiting for a connection termination request
+ from the local user.
+
+ CLOSING - represents waiting for a connection termination request
+ acknowledgment from the remote TCP.
+
+ LAST-ACK - represents waiting for an acknowledgment of the
+ connection termination request previously sent to the remote TCP
+ (which includes an acknowledgment of its connection termination
+ request).
+
+
+
+ [Page 21]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ TIME-WAIT - represents waiting for enough time to pass to be sure
+ the remote TCP received the acknowledgment of its connection
+ termination request.
+
+ CLOSED - represents no connection state at all.
+
+ A TCP connection progresses from one state to another in response to
+ events. The events are the user calls, OPEN, SEND, RECEIVE, CLOSE,
+ ABORT, and STATUS; the incoming segments, particularly those
+ containing the SYN, ACK, RST and FIN flags; and timeouts.
+
+ The state diagram in figure 6 illustrates only state changes, together
+ with the causing events and resulting actions, but addresses neither
+ error conditions nor actions which are not connected with state
+ changes. In a later section, more detail is offered with respect to
+ the reaction of the TCP to events.
+
+ NOTE BENE: this diagram is only a summary and must not be taken as
+ the total specification.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 22]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+
+ +---------+ ---------\ active OPEN
+ | CLOSED | \ -----------
+ +---------+<---------\ \ create TCB
+ | ^ \ \ snd SYN
+ passive OPEN | | CLOSE \ \
+ ------------ | | ---------- \ \
+ create TCB | | delete TCB \ \
+ V | \ \
+ +---------+ CLOSE | \
+ | LISTEN | ---------- | |
+ +---------+ delete TCB | |
+ rcv SYN | | SEND | |
+ ----------- | | ------- | V
+ +---------+ snd SYN,ACK / \ snd SYN +---------+
+ | |<----------------- ------------------>| |
+ | SYN | rcv SYN | SYN |
+ | RCVD |<-----------------------------------------------| SENT |
+ | | snd ACK | |
+ | |------------------ -------------------| |
+ +---------+ rcv ACK of SYN \ / rcv SYN,ACK +---------+
+ | -------------- | | -----------
+ | x | | snd ACK
+ | V V
+ | CLOSE +---------+
+ | ------- | ESTAB |
+ | snd FIN +---------+
+ | CLOSE | | rcv FIN
+ V ------- | | -------
+ +---------+ snd FIN / \ snd ACK +---------+
+ | FIN |<----------------- ------------------>| CLOSE |
+ | WAIT-1 |------------------ | WAIT |
+ +---------+ rcv FIN \ +---------+
+ | rcv ACK of FIN ------- | CLOSE |
+ | -------------- snd ACK | ------- |
+ V x V snd FIN V
+ +---------+ +---------+ +---------+
+ |FINWAIT-2| | CLOSING | | LAST-ACK|
+ +---------+ +---------+ +---------+
+ | rcv ACK of FIN | rcv ACK of FIN |
+ | rcv FIN -------------- | Timeout=2MSL -------------- |
+ | ------- x V ------------ x V
+ \ snd ACK +---------+delete TCB +---------+
+ ------------------------>|TIME WAIT|------------------>| CLOSED |
+ +---------+ +---------+
+
+ TCP Connection State Diagram
+ Figure 6.
+
+
+ [Page 23]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+3.3. Sequence Numbers
+
+ A fundamental notion in the design is that every octet of data sent
+ over a TCP connection has a sequence number. Since every octet is
+ sequenced, each of them can be acknowledged. The acknowledgment
+ mechanism employed is cumulative so that an acknowledgment of sequence
+ number X indicates that all octets up to but not including X have been
+ received. This mechanism allows for straight-forward duplicate
+ detection in the presence of retransmission. Numbering of octets
+ within a segment is that the first data octet immediately following
+ the header is the lowest numbered, and the following octets are
+ numbered consecutively.
+
+ It is essential to remember that the actual sequence number space is
+ finite, though very large. This space ranges from 0 to 2**32 - 1.
+ Since the space is finite, all arithmetic dealing with sequence
+ numbers must be performed modulo 2**32. This unsigned arithmetic
+ preserves the relationship of sequence numbers as they cycle from
+ 2**32 - 1 to 0 again. There are some subtleties to computer modulo
+ arithmetic, so great care should be taken in programming the
+ comparison of such values. The symbol "=<" means "less than or equal"
+ (modulo 2**32).
+
+ The typical kinds of sequence number comparisons which the TCP must
+ perform include:
+
+ (a) Determining that an acknowledgment refers to some sequence
+ number sent but not yet acknowledged.
+
+ (b) Determining that all sequence numbers occupied by a segment
+ have been acknowledged (e.g., to remove the segment from a
+ retransmission queue).
+
+ (c) Determining that an incoming segment contains sequence numbers
+ which are expected (i.e., that the segment "overlaps" the
+ receive window).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 24]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ In response to sending data the TCP will receive acknowledgments. The
+ following comparisons are needed to process the acknowledgments.
+
+ SND.UNA = oldest unacknowledged sequence number
+
+ SND.NXT = next sequence number to be sent
+
+ SEG.ACK = acknowledgment from the receiving TCP (next sequence
+ number expected by the receiving TCP)
+
+ SEG.SEQ = first sequence number of a segment
+
+ SEG.LEN = the number of octets occupied by the data in the segment
+ (counting SYN and FIN)
+
+ SEG.SEQ+SEG.LEN-1 = last sequence number of a segment
+
+ A new acknowledgment (called an "acceptable ack"), is one for which
+ the inequality below holds:
+
+ SND.UNA < SEG.ACK =< SND.NXT
+
+ A segment on the retransmission queue is fully acknowledged if the sum
+ of its sequence number and length is less or equal than the
+ acknowledgment value in the incoming segment.
+
+ When data is received the following comparisons are needed:
+
+ RCV.NXT = next sequence number expected on an incoming segments, and
+ is the left or lower edge of the receive window
+
+ RCV.NXT+RCV.WND-1 = last sequence number expected on an incoming
+ segment, and is the right or upper edge of the receive window
+
+ SEG.SEQ = first sequence number occupied by the incoming segment
+
+ SEG.SEQ+SEG.LEN-1 = last sequence number occupied by the incoming
+ segment
+
+ A segment is judged to occupy a portion of valid receive sequence
+ space if
+
+ RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+
+ or
+
+ RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND
+
+
+
+ [Page 25]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ The first part of this test checks to see if the beginning of the
+ segment falls in the window, the second part of the test checks to see
+ if the end of the segment falls in the window; if the segment passes
+ either part of the test it contains data in the window.
+
+ Actually, it is a little more complicated than this. Due to zero
+ windows and zero length segments, we have four cases for the
+ acceptability of an incoming segment:
+
+ Segment Receive Test
+ Length Window
+ ------- ------- -------------------------------------------
+
+ 0 0 SEG.SEQ = RCV.NXT
+
+ 0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+
+ >0 0 not acceptable
+
+ >0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+ or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND
+
+ Note that when the receive window is zero no segments should be
+ acceptable except ACK segments. Thus, it is be possible for a TCP to
+ maintain a zero receive window while transmitting data and receiving
+ ACKs. However, even when the receive window is zero, a TCP must
+ process the RST and URG fields of all incoming segments.
+
+ We have taken advantage of the numbering scheme to protect certain
+ control information as well. This is achieved by implicitly including
+ some control flags in the sequence space so they can be retransmitted
+ and acknowledged without confusion (i.e., one and only one copy of the
+ control will be acted upon). Control information is not physically
+ carried in the segment data space. Consequently, we must adopt rules
+ for implicitly assigning sequence numbers to control. The SYN and FIN
+ are the only controls requiring this protection, and these controls
+ are used only at connection opening and closing. For sequence number
+ purposes, the SYN is considered to occur before the first actual data
+ octet of the segment in which it occurs, while the FIN is considered
+ to occur after the last actual data octet in a segment in which it
+ occurs. The segment length (SEG.LEN) includes both data and sequence
+ space occupying controls. When a SYN is present then SEG.SEQ is the
+ sequence number of the SYN.
+
+
+
+
+
+
+
+[Page 26]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ Initial Sequence Number Selection
+
+ The protocol places no restriction on a particular connection being
+ used over and over again. A connection is defined by a pair of
+ sockets. New instances of a connection will be referred to as
+ incarnations of the connection. The problem that arises from this is
+ -- "how does the TCP identify duplicate segments from previous
+ incarnations of the connection?" This problem becomes apparent if the
+ connection is being opened and closed in quick succession, or if the
+ connection breaks with loss of memory and is then reestablished.
+
+ To avoid confusion we must prevent segments from one incarnation of a
+ connection from being used while the same sequence numbers may still
+ be present in the network from an earlier incarnation. We want to
+ assure this, even if a TCP crashes and loses all knowledge of the
+ sequence numbers it has been using. When new connections are created,
+ an initial sequence number (ISN) generator is employed which selects a
+ new 32 bit ISN. The generator is bound to a (possibly fictitious) 32
+ bit clock whose low order bit is incremented roughly every 4
+ microseconds. Thus, the ISN cycles approximately every 4.55 hours.
+ Since we assume that segments will stay in the network no more than
+ the Maximum Segment Lifetime (MSL) and that the MSL is less than 4.55
+ hours we can reasonably assume that ISN's will be unique.
+
+ For each connection there is a send sequence number and a receive
+ sequence number. The initial send sequence number (ISS) is chosen by
+ the data sending TCP, and the initial receive sequence number (IRS) is
+ learned during the connection establishing procedure.
+
+ For a connection to be established or initialized, the two TCPs must
+ synchronize on each other's initial sequence numbers. This is done in
+ an exchange of connection establishing segments carrying a control bit
+ called "SYN" (for synchronize) and the initial sequence numbers. As a
+ shorthand, segments carrying the SYN bit are also called "SYNs".
+ Hence, the solution requires a suitable mechanism for picking an
+ initial sequence number and a slightly involved handshake to exchange
+ the ISN's.
+
+ The synchronization requires each side to send it's own initial
+ sequence number and to receive a confirmation of it in acknowledgment
+ from the other side. Each side must also receive the other side's
+ initial sequence number and send a confirming acknowledgment.
+
+ 1) A --> B SYN my sequence number is X
+ 2) A <-- B ACK your sequence number is X
+ 3) A <-- B SYN my sequence number is Y
+ 4) A --> B ACK your sequence number is Y
+
+
+
+ [Page 27]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ Because steps 2 and 3 can be combined in a single message this is
+ called the three way (or three message) handshake.
+
+ A three way handshake is necessary because sequence numbers are not
+ tied to a global clock in the network, and TCPs may have different
+ mechanisms for picking the ISN's. The receiver of the first SYN has
+ no way of knowing whether the segment was an old delayed one or not,
+ unless it remembers the last sequence number used on the connection
+ (which is not always possible), and so it must ask the sender to
+ verify this SYN. The three way handshake and the advantages of a
+ clock-driven scheme are discussed in [3].
+
+ Knowing When to Keep Quiet
+
+ To be sure that a TCP does not create a segment that carries a
+ sequence number which may be duplicated by an old segment remaining in
+ the network, the TCP must keep quiet for a maximum segment lifetime
+ (MSL) before assigning any sequence numbers upon starting up or
+ recovering from a crash in which memory of sequence numbers in use was
+ lost. For this specification the MSL is taken to be 2 minutes. This
+ is an engineering choice, and may be changed if experience indicates
+ it is desirable to do so. Note that if a TCP is reinitialized in some
+ sense, yet retains its memory of sequence numbers in use, then it need
+ not wait at all; it must only be sure to use sequence numbers larger
+ than those recently used.
+
+ The TCP Quiet Time Concept
+
+ This specification provides that hosts which "crash" without
+ retaining any knowledge of the last sequence numbers transmitted on
+ each active (i.e., not closed) connection shall delay emitting any
+ TCP segments for at least the agreed Maximum Segment Lifetime (MSL)
+ in the internet system of which the host is a part. In the
+ paragraphs below, an explanation for this specification is given.
+ TCP implementors may violate the "quiet time" restriction, but only
+ at the risk of causing some old data to be accepted as new or new
+ data rejected as old duplicated by some receivers in the internet
+ system.
+
+ TCPs consume sequence number space each time a segment is formed and
+ entered into the network output queue at a source host. The
+ duplicate detection and sequencing algorithm in the TCP protocol
+ relies on the unique binding of segment data to sequence space to
+ the extent that sequence numbers will not cycle through all 2**32
+ values before the segment data bound to those sequence numbers has
+ been delivered and acknowledged by the receiver and all duplicate
+ copies of the segments have "drained" from the internet. Without
+ such an assumption, two distinct TCP segments could conceivably be
+
+
+[Page 28]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ assigned the same or overlapping sequence numbers, causing confusion
+ at the receiver as to which data is new and which is old. Remember
+ that each segment is bound to as many consecutive sequence numbers
+ as there are octets of data in the segment.
+
+ Under normal conditions, TCPs keep track of the next sequence number
+ to emit and the oldest awaiting acknowledgment so as to avoid
+ mistakenly using a sequence number over before its first use has
+ been acknowledged. This alone does not guarantee that old duplicate
+ data is drained from the net, so the sequence space has been made
+ very large to reduce the probability that a wandering duplicate will
+ cause trouble upon arrival. At 2 megabits/sec. it takes 4.5 hours
+ to use up 2**32 octets of sequence space. Since the maximum segment
+ lifetime in the net is not likely to exceed a few tens of seconds,
+ this is deemed ample protection for foreseeable nets, even if data
+ rates escalate to l0's of megabits/sec. At 100 megabits/sec, the
+ cycle time is 5.4 minutes which may be a little short, but still
+ within reason.
+
+ The basic duplicate detection and sequencing algorithm in TCP can be
+ defeated, however, if a source TCP does not have any memory of the
+ sequence numbers it last used on a given connection. For example, if
+ the TCP were to start all connections with sequence number 0, then
+ upon crashing and restarting, a TCP might re-form an earlier
+ connection (possibly after half-open connection resolution) and emit
+ packets with sequence numbers identical to or overlapping with
+ packets still in the network which were emitted on an earlier
+ incarnation of the same connection. In the absence of knowledge
+ about the sequence numbers used on a particular connection, the TCP
+ specification recommends that the source delay for MSL seconds
+ before emitting segments on the connection, to allow time for
+ segments from the earlier connection incarnation to drain from the
+ system.
+
+ Even hosts which can remember the time of day and used it to select
+ initial sequence number values are not immune from this problem
+ (i.e., even if time of day is used to select an initial sequence
+ number for each new connection incarnation).
+
+ Suppose, for example, that a connection is opened starting with
+ sequence number S. Suppose that this connection is not used much
+ and that eventually the initial sequence number function (ISN(t))
+ takes on a value equal to the sequence number, say S1, of the last
+ segment sent by this TCP on a particular connection. Now suppose,
+ at this instant, the host crashes, recovers, and establishes a new
+ incarnation of the connection. The initial sequence number chosen is
+ S1 = ISN(t) -- last used sequence number on old incarnation of
+ connection! If the recovery occurs quickly enough, any old
+
+
+ [Page 29]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ duplicates in the net bearing sequence numbers in the neighborhood
+ of S1 may arrive and be treated as new packets by the receiver of
+ the new incarnation of the connection.
+
+ The problem is that the recovering host may not know for how long it
+ crashed nor does it know whether there are still old duplicates in
+ the system from earlier connection incarnations.
+
+ One way to deal with this problem is to deliberately delay emitting
+ segments for one MSL after recovery from a crash- this is the "quite
+ time" specification. Hosts which prefer to avoid waiting are
+ willing to risk possible confusion of old and new packets at a given
+ destination may choose not to wait for the "quite time".
+ Implementors may provide TCP users with the ability to select on a
+ connection by connection basis whether to wait after a crash, or may
+ informally implement the "quite time" for all connections.
+ Obviously, even where a user selects to "wait," this is not
+ necessary after the host has been "up" for at least MSL seconds.
+
+ To summarize: every segment emitted occupies one or more sequence
+ numbers in the sequence space, the numbers occupied by a segment are
+ "busy" or "in use" until MSL seconds have passed, upon crashing a
+ block of space-time is occupied by the octets of the last emitted
+ segment, if a new connection is started too soon and uses any of the
+ sequence numbers in the space-time footprint of the last segment of
+ the previous connection incarnation, there is a potential sequence
+ number overlap area which could cause confusion at the receiver.
+
+3.4. Establishing a connection
+
+ The "three-way handshake" is the procedure used to establish a
+ connection. This procedure normally is initiated by one TCP and
+ responded to by another TCP. The procedure also works if two TCP
+ simultaneously initiate the procedure. When simultaneous attempt
+ occurs, each TCP receives a "SYN" segment which carries no
+ acknowledgment after it has sent a "SYN". Of course, the arrival of
+ an old duplicate "SYN" segment can potentially make it appear, to the
+ recipient, that a simultaneous connection initiation is in progress.
+ Proper use of "reset" segments can disambiguate these cases.
+
+ Several examples of connection initiation follow. Although these
+ examples do not show connection synchronization using data-carrying
+ segments, this is perfectly legitimate, so long as the receiving TCP
+ doesn't deliver the data to the user until it is clear the data is
+ valid (i.e., the data must be buffered at the receiver until the
+ connection reaches the ESTABLISHED state). The three-way handshake
+ reduces the possibility of false connections. It is the
+
+
+
+[Page 30]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ implementation of a trade-off between memory and messages to provide
+ information for this checking.
+
+ The simplest three-way handshake is shown in figure 7 below. The
+ figures should be interpreted in the following way. Each line is
+ numbered for reference purposes. Right arrows (-->) indicate
+ departure of a TCP segment from TCP A to TCP B, or arrival of a
+ segment at B from A. Left arrows (<--), indicate the reverse.
+ Ellipsis (...) indicates a segment which is still in the network
+ (delayed). An "XXX" indicates a segment which is lost or rejected.
+ Comments appear in parentheses. TCP states represent the state AFTER
+ the departure or arrival of the segment (whose contents are shown in
+ the center of each line). Segment contents are shown in abbreviated
+ form, with sequence number, control flags, and ACK field. Other
+ fields such as window, addresses, lengths, and text have been left out
+ in the interest of clarity.
+
+
+
+ TCP A TCP B
+
+ 1. CLOSED LISTEN
+
+ 2. SYN-SENT --> <SEQ=100><CTL=SYN> --> SYN-RECEIVED
+
+ 3. ESTABLISHED <-- <SEQ=300><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED
+
+ 4. ESTABLISHED --> <SEQ=101><ACK=301><CTL=ACK> --> ESTABLISHED
+
+ 5. ESTABLISHED --> <SEQ=101><ACK=301><CTL=ACK><DATA> --> ESTABLISHED
+
+ Basic 3-Way Handshake for Connection Synchronization
+
+ Figure 7.
+
+ In line 2 of figure 7, TCP A begins by sending a SYN segment
+ indicating that it will use sequence numbers starting with sequence
+ number 100. In line 3, TCP B sends a SYN and acknowledges the SYN it
+ received from TCP A. Note that the acknowledgment field indicates TCP
+ B is now expecting to hear sequence 101, acknowledging the SYN which
+ occupied sequence 100.
+
+ At line 4, TCP A responds with an empty segment containing an ACK for
+ TCP B's SYN; and in line 5, TCP A sends some data. Note that the
+ sequence number of the segment in line 5 is the same as in line 4
+ because the ACK does not occupy sequence number space (if it did, we
+ would wind up ACKing ACK's!).
+
+
+
+ [Page 31]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ Simultaneous initiation is only slightly more complex, as is shown in
+ figure 8. Each TCP cycles from CLOSED to SYN-SENT to SYN-RECEIVED to
+ ESTABLISHED.
+
+
+
+ TCP A TCP B
+
+ 1. CLOSED CLOSED
+
+ 2. SYN-SENT --> <SEQ=100><CTL=SYN> ...
+
+ 3. SYN-RECEIVED <-- <SEQ=300><CTL=SYN> <-- SYN-SENT
+
+ 4. ... <SEQ=100><CTL=SYN> --> SYN-RECEIVED
+
+ 5. SYN-RECEIVED --> <SEQ=100><ACK=301><CTL=SYN,ACK> ...
+
+ 6. ESTABLISHED <-- <SEQ=300><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED
+
+ 7. ... <SEQ=101><ACK=301><CTL=ACK> --> ESTABLISHED
+
+ Simultaneous Connection Synchronization
+
+ Figure 8.
+
+ The principle reason for the three-way handshake is to prevent old
+ duplicate connection initiations from causing confusion. To deal with
+ this, a special control message, reset, has been devised. If the
+ receiving TCP is in a non-synchronized state (i.e., SYN-SENT,
+ SYN-RECEIVED), it returns to LISTEN on receiving an acceptable reset.
+ If the TCP is in one of the synchronized states (ESTABLISHED,
+ FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT), it
+ aborts the connection and informs its user. We discuss this latter
+ case under "half-open" connections below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 32]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+
+
+ TCP A TCP B
+
+ 1. CLOSED LISTEN
+
+ 2. SYN-SENT --> <SEQ=100><CTL=SYN> ...
+
+ 3. (duplicate) ... <SEQ=90><CTL=SYN> --> SYN-RECEIVED
+
+ 4. SYN-SENT <-- <SEQ=300><ACK=91><CTL=SYN,ACK> <-- SYN-RECEIVED
+
+ 5. SYN-SENT --> <SEQ=91><CTL=RST> --> LISTEN
+
+
+ 6. ... <SEQ=100><CTL=SYN> --> SYN-RECEIVED
+
+ 7. SYN-SENT <-- <SEQ=400><ACK=101><CTL=SYN,ACK> <-- SYN-RECEIVED
+
+ 8. ESTABLISHED --> <SEQ=101><ACK=401><CTL=ACK> --> ESTABLISHED
+
+ Recovery from Old Duplicate SYN
+
+ Figure 9.
+
+ As a simple example of recovery from old duplicates, consider
+ figure 9. At line 3, an old duplicate SYN arrives at TCP B. TCP B
+ cannot tell that this is an old duplicate, so it responds normally
+ (line 4). TCP A detects that the ACK field is incorrect and returns a
+ RST (reset) with its SEQ field selected to make the segment
+ believable. TCP B, on receiving the RST, returns to the LISTEN state.
+ When the original SYN (pun intended) finally arrives at line 6, the
+ synchronization proceeds normally. If the SYN at line 6 had arrived
+ before the RST, a more complex exchange might have occurred with RST's
+ sent in both directions.
+
+ Half-Open Connections and Other Anomalies
+
+ An established connection is said to be "half-open" if one of the
+ TCPs has closed or aborted the connection at its end without the
+ knowledge of the other, or if the two ends of the connection have
+ become desynchronized owing to a crash that resulted in loss of
+ memory. Such connections will automatically become reset if an
+ attempt is made to send data in either direction. However, half-open
+ connections are expected to be unusual, and the recovery procedure is
+ mildly involved.
+
+ If at site A the connection no longer exists, then an attempt by the
+
+
+ [Page 33]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ user at site B to send any data on it will result in the site B TCP
+ receiving a reset control message. Such a message indicates to the
+ site B TCP that something is wrong, and it is expected to abort the
+ connection.
+
+ Assume that two user processes A and B are communicating with one
+ another when a crash occurs causing loss of memory to A's TCP.
+ Depending on the operating system supporting A's TCP, it is likely
+ that some error recovery mechanism exists. When the TCP is up again,
+ A is likely to start again from the beginning or from a recovery
+ point. As a result, A will probably try to OPEN the connection again
+ or try to SEND on the connection it believes open. In the latter
+ case, it receives the error message "connection not open" from the
+ local (A's) TCP. In an attempt to establish the connection, A's TCP
+ will send a segment containing SYN. This scenario leads to the
+ example shown in figure 10. After TCP A crashes, the user attempts to
+ re-open the connection. TCP B, in the meantime, thinks the connection
+ is open.
+
+
+
+ TCP A TCP B
+
+ 1. (CRASH) (send 300,receive 100)
+
+ 2. CLOSED ESTABLISHED
+
+ 3. SYN-SENT --> <SEQ=400><CTL=SYN> --> (??)
+
+ 4. (!!) <-- <SEQ=300><ACK=100><CTL=ACK> <-- ESTABLISHED
+
+ 5. SYN-SENT --> <SEQ=100><CTL=RST> --> (Abort!!)
+
+ 6. SYN-SENT CLOSED
+
+ 7. SYN-SENT --> <SEQ=400><CTL=SYN> -->
+
+ Half-Open Connection Discovery
+
+ Figure 10.
+
+ When the SYN arrives at line 3, TCP B, being in a synchronized state,
+ and the incoming segment outside the window, responds with an
+ acknowledgment indicating what sequence it next expects to hear (ACK
+ 100). TCP A sees that this segment does not acknowledge anything it
+ sent and, being unsynchronized, sends a reset (RST) because it has
+ detected a half-open connection. TCP B aborts at line 5. TCP A will
+
+
+
+[Page 34]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ continue to try to establish the connection; the problem is now
+ reduced to the basic 3-way handshake of figure 7.
+
+ An interesting alternative case occurs when TCP A crashes and TCP B
+ tries to send data on what it thinks is a synchronized connection.
+ This is illustrated in figure 11. In this case, the data arriving at
+ TCP A from TCP B (line 2) is unacceptable because no such connection
+ exists, so TCP A sends a RST. The RST is acceptable so TCP B
+ processes it and aborts the connection.
+
+
+
+ TCP A TCP B
+
+ 1. (CRASH) (send 300,receive 100)
+
+ 2. (??) <-- <SEQ=300><ACK=100><DATA=10><CTL=ACK> <-- ESTABLISHED
+
+ 3. --> <SEQ=100><CTL=RST> --> (ABORT!!)
+
+ Active Side Causes Half-Open Connection Discovery
+
+ Figure 11.
+
+ In figure 12, we find the two TCPs A and B with passive connections
+ waiting for SYN. An old duplicate arriving at TCP B (line 2) stirs B
+ into action. A SYN-ACK is returned (line 3) and causes TCP A to
+ generate a RST (the ACK in line 3 is not acceptable). TCP B accepts
+ the reset and returns to its passive LISTEN state.
+
+
+
+ TCP A TCP B
+
+ 1. LISTEN LISTEN
+
+ 2. ... <SEQ=Z><CTL=SYN> --> SYN-RECEIVED
+
+ 3. (??) <-- <SEQ=X><ACK=Z+1><CTL=SYN,ACK> <-- SYN-RECEIVED
+
+ 4. --> <SEQ=Z+1><CTL=RST> --> (return to LISTEN!)
+
+ 5. LISTEN LISTEN
+
+ Old Duplicate SYN Initiates a Reset on two Passive Sockets
+
+ Figure 12.
+
+
+
+ [Page 35]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ A variety of other cases are possible, all of which are accounted for
+ by the following rules for RST generation and processing.
+
+ Reset Generation
+
+ As a general rule, reset (RST) must be sent whenever a segment arrives
+ which apparently is not intended for the current connection. A reset
+ must not be sent if it is not clear that this is the case.
+
+ There are three groups of states:
+
+ 1. If the connection does not exist (CLOSED) then a reset is sent
+ in response to any incoming segment except another reset. In
+ particular, SYNs addressed to a non-existent connection are rejected
+ by this means.
+
+ If the incoming segment has an ACK field, the reset takes its
+ sequence number from the ACK field of the segment, otherwise the
+ reset has sequence number zero and the ACK field is set to the sum
+ of the sequence number and segment length of the incoming segment.
+ The connection remains in the CLOSED state.
+
+ 2. If the connection is in any non-synchronized state (LISTEN,
+ SYN-SENT, SYN-RECEIVED), and the incoming segment acknowledges
+ something not yet sent (the segment carries an unacceptable ACK), or
+ if an incoming segment has a security level or compartment which
+ does not exactly match the level and compartment requested for the
+ connection, a reset is sent.
+
+ If our SYN has not been acknowledged and the precedence level of the
+ incoming segment is higher than the precedence level requested then
+ either raise the local precedence level (if allowed by the user and
+ the system) or send a reset; or if the precedence level of the
+ incoming segment is lower than the precedence level requested then
+ continue as if the precedence matched exactly (if the remote TCP
+ cannot raise the precedence level to match ours this will be
+ detected in the next segment it sends, and the connection will be
+ terminated then). If our SYN has been acknowledged (perhaps in this
+ incoming segment) the precedence level of the incoming segment must
+ match the local precedence level exactly, if it does not a reset
+ must be sent.
+
+ If the incoming segment has an ACK field, the reset takes its
+ sequence number from the ACK field of the segment, otherwise the
+ reset has sequence number zero and the ACK field is set to the sum
+ of the sequence number and segment length of the incoming segment.
+ The connection remains in the same state.
+
+
+
+[Page 36]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ 3. If the connection is in a synchronized state (ESTABLISHED,
+ FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
+ any unacceptable segment (out of window sequence number or
+ unacceptible acknowledgment number) must elicit only an empty
+ acknowledgment segment containing the current send-sequence number
+ and an acknowledgment indicating the next sequence number expected
+ to be received, and the connection remains in the same state.
+
+ If an incoming segment has a security level, or compartment, or
+ precedence which does not exactly match the level, and compartment,
+ and precedence requested for the connection,a reset is sent and
+ connection goes to the CLOSED state. The reset takes its sequence
+ number from the ACK field of the incoming segment.
+
+ Reset Processing
+
+ In all states except SYN-SENT, all reset (RST) segments are validated
+ by checking their SEQ-fields. A reset is valid if its sequence number
+ is in the window. In the SYN-SENT state (a RST received in response
+ to an initial SYN), the RST is acceptable if the ACK field
+ acknowledges the SYN.
+
+ The receiver of a RST first validates it, then changes state. If the
+ receiver was in the LISTEN state, it ignores it. If the receiver was
+ in SYN-RECEIVED state and had previously been in the LISTEN state,
+ then the receiver returns to the LISTEN state, otherwise the receiver
+ aborts the connection and goes to the CLOSED state. If the receiver
+ was in any other state, it aborts the connection and advises the user
+ and goes to the CLOSED state.
+
+3.5. Closing a Connection
+
+ CLOSE is an operation meaning "I have no more data to send." The
+ notion of closing a full-duplex connection is subject to ambiguous
+ interpretation, of course, since it may not be obvious how to treat
+ the receiving side of the connection. We have chosen to treat CLOSE
+ in a simplex fashion. The user who CLOSEs may continue to RECEIVE
+ until he is told that the other side has CLOSED also. Thus, a program
+ could initiate several SENDs followed by a CLOSE, and then continue to
+ RECEIVE until signaled that a RECEIVE failed because the other side
+ has CLOSED. We assume that the TCP will signal a user, even if no
+ RECEIVEs are outstanding, that the other side has closed, so the user
+ can terminate his side gracefully. A TCP will reliably deliver all
+ buffers SENT before the connection was CLOSED so a user who expects no
+ data in return need only wait to hear the connection was CLOSED
+ successfully to know that all his data was received at the destination
+ TCP. Users must keep reading connections they close for sending until
+ the TCP says no more data.
+
+
+ [Page 37]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ There are essentially three cases:
+
+ 1) The user initiates by telling the TCP to CLOSE the connection
+
+ 2) The remote TCP initiates by sending a FIN control signal
+
+ 3) Both users CLOSE simultaneously
+
+ Case 1: Local user initiates the close
+
+ In this case, a FIN segment can be constructed and placed on the
+ outgoing segment queue. No further SENDs from the user will be
+ accepted by the TCP, and it enters the FIN-WAIT-1 state. RECEIVEs
+ are allowed in this state. All segments preceding and including FIN
+ will be retransmitted until acknowledged. When the other TCP has
+ both acknowledged the FIN and sent a FIN of its own, the first TCP
+ can ACK this FIN. Note that a TCP receiving a FIN will ACK but not
+ send its own FIN until its user has CLOSED the connection also.
+
+ Case 2: TCP receives a FIN from the network
+
+ If an unsolicited FIN arrives from the network, the receiving TCP
+ can ACK it and tell the user that the connection is closing. The
+ user will respond with a CLOSE, upon which the TCP can send a FIN to
+ the other TCP after sending any remaining data. The TCP then waits
+ until its own FIN is acknowledged whereupon it deletes the
+ connection. If an ACK is not forthcoming, after the user timeout
+ the connection is aborted and the user is told.
+
+ Case 3: both users close simultaneously
+
+ A simultaneous CLOSE by users at both ends of a connection causes
+ FIN segments to be exchanged. When all segments preceding the FINs
+ have been processed and acknowledged, each TCP can ACK the FIN it
+ has received. Both will, upon receiving these ACKs, delete the
+ connection.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 38]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+
+
+ TCP A TCP B
+
+ 1. ESTABLISHED ESTABLISHED
+
+ 2. (Close)
+ FIN-WAIT-1 --> <SEQ=100><ACK=300><CTL=FIN,ACK> --> CLOSE-WAIT
+
+ 3. FIN-WAIT-2 <-- <SEQ=300><ACK=101><CTL=ACK> <-- CLOSE-WAIT
+
+ 4. (Close)
+ TIME-WAIT <-- <SEQ=300><ACK=101><CTL=FIN,ACK> <-- LAST-ACK
+
+ 5. TIME-WAIT --> <SEQ=101><ACK=301><CTL=ACK> --> CLOSED
+
+ 6. (2 MSL)
+ CLOSED
+
+ Normal Close Sequence
+
+ Figure 13.
+
+
+
+ TCP A TCP B
+
+ 1. ESTABLISHED ESTABLISHED
+
+ 2. (Close) (Close)
+ FIN-WAIT-1 --> <SEQ=100><ACK=300><CTL=FIN,ACK> ... FIN-WAIT-1
+ <-- <SEQ=300><ACK=100><CTL=FIN,ACK> <--
+ ... <SEQ=100><ACK=300><CTL=FIN,ACK> -->
+
+ 3. CLOSING --> <SEQ=101><ACK=301><CTL=ACK> ... CLOSING
+ <-- <SEQ=301><ACK=101><CTL=ACK> <--
+ ... <SEQ=101><ACK=301><CTL=ACK> -->
+
+ 4. TIME-WAIT TIME-WAIT
+ (2 MSL) (2 MSL)
+ CLOSED CLOSED
+
+ Simultaneous Close Sequence
+
+ Figure 14.
+
+
+
+
+
+ [Page 39]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+3.6. Precedence and Security
+
+ The intent is that connection be allowed only between ports operating
+ with exactly the same security and compartment values and at the
+ higher of the precedence level requested by the two ports.
+
+ The precedence and security parameters used in TCP are exactly those
+ defined in the Internet Protocol (IP) [2]. Throughout this TCP
+ specification the term "security/compartment" is intended to indicate
+ the security parameters used in IP including security, compartment,
+ user group, and handling restriction.
+
+ A connection attempt with mismatched security/compartment values or a
+ lower precedence value must be rejected by sending a reset. Rejecting
+ a connection due to too low a precedence only occurs after an
+ acknowledgment of the SYN has been received.
+
+ Note that TCP modules which operate only at the default value of
+ precedence will still have to check the precedence of incoming
+ segments and possibly raise the precedence level they use on the
+ connection.
+
+ The security paramaters may be used even in a non-secure environment
+ (the values would indicate unclassified data), thus hosts in
+ non-secure environments must be prepared to receive the security
+ parameters, though they need not send them.
+
+3.7. Data Communication
+
+ Once the connection is established data is communicated by the
+ exchange of segments. Because segments may be lost due to errors
+ (checksum test failure), or network congestion, TCP uses
+ retransmission (after a timeout) to ensure delivery of every segment.
+ Duplicate segments may arrive due to network or TCP retransmission.
+ As discussed in the section on sequence numbers the TCP performs
+ certain tests on the sequence and acknowledgment numbers in the
+ segments to verify their acceptability.
+
+ The sender of data keeps track of the next sequence number to use in
+ the variable SND.NXT. The receiver of data keeps track of the next
+ sequence number to expect in the variable RCV.NXT. The sender of data
+ keeps track of the oldest unacknowledged sequence number in the
+ variable SND.UNA. If the data flow is momentarily idle and all data
+ sent has been acknowledged then the three variables will be equal.
+
+ When the sender creates a segment and transmits it the sender advances
+ SND.NXT. When the receiver accepts a segment it advances RCV.NXT and
+ sends an acknowledgment. When the data sender receives an
+
+
+[Page 40]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ acknowledgment it advances SND.UNA. The extent to which the values of
+ these variables differ is a measure of the delay in the communication.
+ The amount by which the variables are advanced is the length of the
+ data in the segment. Note that once in the ESTABLISHED state all
+ segments must carry current acknowledgment information.
+
+ The CLOSE user call implies a push function, as does the FIN control
+ flag in an incoming segment.
+
+ Retransmission Timeout
+
+ Because of the variability of the networks that compose an
+ internetwork system and the wide range of uses of TCP connections the
+ retransmission timeout must be dynamically determined. One procedure
+ for determining a retransmission time out is given here as an
+ illustration.
+
+ An Example Retransmission Timeout Procedure
+
+ Measure the elapsed time between sending a data octet with a
+ particular sequence number and receiving an acknowledgment that
+ covers that sequence number (segments sent do not have to match
+ segments received). This measured elapsed time is the Round Trip
+ Time (RTT). Next compute a Smoothed Round Trip Time (SRTT) as:
+
+ SRTT = ( ALPHA * SRTT ) + ((1-ALPHA) * RTT)
+
+ and based on this, compute the retransmission timeout (RTO) as:
+
+ RTO = min[UBOUND,max[LBOUND,(BETA*SRTT)]]
+
+ where UBOUND is an upper bound on the timeout (e.g., 1 minute),
+ LBOUND is a lower bound on the timeout (e.g., 1 second), ALPHA is
+ a smoothing factor (e.g., .8 to .9), and BETA is a delay variance
+ factor (e.g., 1.3 to 2.0).
+
+ The Communication of Urgent Information
+
+ The objective of the TCP urgent mechanism is to allow the sending user
+ to stimulate the receiving user to accept some urgent data and to
+ permit the receiving TCP to indicate to the receiving user when all
+ the currently known urgent data has been received by the user.
+
+ This mechanism permits a point in the data stream to be designated as
+ the end of urgent information. Whenever this point is in advance of
+ the receive sequence number (RCV.NXT) at the receiving TCP, that TCP
+ must tell the user to go into "urgent mode"; when the receive sequence
+ number catches up to the urgent pointer, the TCP must tell user to go
+
+
+ [Page 41]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ into "normal mode". If the urgent pointer is updated while the user
+ is in "urgent mode", the update will be invisible to the user.
+
+ The method employs a urgent field which is carried in all segments
+ transmitted. The URG control flag indicates that the urgent field is
+ meaningful and must be added to the segment sequence number to yield
+ the urgent pointer. The absence of this flag indicates that there is
+ no urgent data outstanding.
+
+ To send an urgent indication the user must also send at least one data
+ octet. If the sending user also indicates a push, timely delivery of
+ the urgent information to the destination process is enhanced.
+
+ Managing the Window
+
+ The window sent in each segment indicates the range of sequence
+ numbers the sender of the window (the data receiver) is currently
+ prepared to accept. There is an assumption that this is related to
+ the currently available data buffer space available for this
+ connection.
+
+ Indicating a large window encourages transmissions. If more data
+ arrives than can be accepted, it will be discarded. This will result
+ in excessive retransmissions, adding unnecessarily to the load on the
+ network and the TCPs. Indicating a small window may restrict the
+ transmission of data to the point of introducing a round trip delay
+ between each new segment transmitted.
+
+ The mechanisms provided allow a TCP to advertise a large window and to
+ subsequently advertise a much smaller window without having accepted
+ that much data. This, so called "shrinking the window," is strongly
+ discouraged. The robustness principle dictates that TCPs will not
+ shrink the window themselves, but will be prepared for such behavior
+ on the part of other TCPs.
+
+ The sending TCP must be prepared to accept from the user and send at
+ least one octet of new data even if the send window is zero. The
+ sending TCP must regularly retransmit to the receiving TCP even when
+ the window is zero. Two minutes is recommended for the retransmission
+ interval when the window is zero. This retransmission is essential to
+ guarantee that when either TCP has a zero window the re-opening of the
+ window will be reliably reported to the other.
+
+ When the receiving TCP has a zero window and a segment arrives it must
+ still send an acknowledgment showing its next expected sequence number
+ and current window (zero).
+
+ The sending TCP packages the data to be transmitted into segments
+
+
+[Page 42]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ which fit the current window, and may repackage segments on the
+ retransmission queue. Such repackaging is not required, but may be
+ helpful.
+
+ In a connection with a one-way data flow, the window information will
+ be carried in acknowledgment segments that all have the same sequence
+ number so there will be no way to reorder them if they arrive out of
+ order. This is not a serious problem, but it will allow the window
+ information to be on occasion temporarily based on old reports from
+ the data receiver. A refinement to avoid this problem is to act on
+ the window information from segments that carry the highest
+ acknowledgment number (that is segments with acknowledgment number
+ equal or greater than the highest previously received).
+
+ The window management procedure has significant influence on the
+ communication performance. The following comments are suggestions to
+ implementers.
+
+ Window Management Suggestions
+
+ Allocating a very small window causes data to be transmitted in
+ many small segments when better performance is achieved using
+ fewer large segments.
+
+ One suggestion for avoiding small windows is for the receiver to
+ defer updating a window until the additional allocation is at
+ least X percent of the maximum allocation possible for the
+ connection (where X might be 20 to 40).
+
+ Another suggestion is for the sender to avoid sending small
+ segments by waiting until the window is large enough before
+ sending data. If the the user signals a push function then the
+ data must be sent even if it is a small segment.
+
+ Note that the acknowledgments should not be delayed or unnecessary
+ retransmissions will result. One strategy would be to send an
+ acknowledgment when a small segment arrives (with out updating the
+ window information), and then to send another acknowledgment with
+ new window information when the window is larger.
+
+ The segment sent to probe a zero window may also begin a break up
+ of transmitted data into smaller and smaller segments. If a
+ segment containing a single data octet sent to probe a zero window
+ is accepted, it consumes one octet of the window now available.
+ If the sending TCP simply sends as much as it can whenever the
+ window is non zero, the transmitted data will be broken into
+ alternating big and small segments. As time goes on, occasional
+ pauses in the receiver making window allocation available will
+
+
+ [Page 43]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ result in breaking the big segments into a small and not quite so
+ big pair. And after a while the data transmission will be in
+ mostly small segments.
+
+ The suggestion here is that the TCP implementations need to
+ actively attempt to combine small window allocations into larger
+ windows, since the mechanisms for managing the window tend to lead
+ to many small windows in the simplest minded implementations.
+
+3.8. Interfaces
+
+ There are of course two interfaces of concern: the user/TCP interface
+ and the TCP/lower-level interface. We have a fairly elaborate model
+ of the user/TCP interface, but the interface to the lower level
+ protocol module is left unspecified here, since it will be specified
+ in detail by the specification of the lowel level protocol. For the
+ case that the lower level is IP we note some of the parameter values
+ that TCPs might use.
+
+ User/TCP Interface
+
+ The following functional description of user commands to the TCP is,
+ at best, fictional, since every operating system will have different
+ facilities. Consequently, we must warn readers that different TCP
+ implementations may have different user interfaces. However, all
+ TCPs must provide a certain minimum set of services to guarantee
+ that all TCP implementations can support the same protocol
+ hierarchy. This section specifies the functional interfaces
+ required of all TCP implementations.
+
+ TCP User Commands
+
+ The following sections functionally characterize a USER/TCP
+ interface. The notation used is similar to most procedure or
+ function calls in high level languages, but this usage is not
+ meant to rule out trap type service calls (e.g., SVCs, UUOs,
+ EMTs).
+
+ The user commands described below specify the basic functions the
+ TCP must perform to support interprocess communication.
+ Individual implementations must define their own exact format, and
+ may provide combinations or subsets of the basic functions in
+ single calls. In particular, some implementations may wish to
+ automatically OPEN a connection on the first SEND or RECEIVE
+ issued by the user for a given connection.
+
+
+
+
+
+[Page 44]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ In providing interprocess communication facilities, the TCP must
+ not only accept commands, but must also return information to the
+ processes it serves. The latter consists of:
+
+ (a) general information about a connection (e.g., interrupts,
+ remote close, binding of unspecified foreign socket).
+
+ (b) replies to specific user commands indicating success or
+ various types of failure.
+
+ Open
+
+ Format: OPEN (local port, foreign socket, active/passive
+ [, timeout] [, precedence] [, security/compartment] [, options])
+ -> local connection name
+
+ We assume that the local TCP is aware of the identity of the
+ processes it serves and will check the authority of the process
+ to use the connection specified. Depending upon the
+ implementation of the TCP, the local network and TCP identifiers
+ for the source address will either be supplied by the TCP or the
+ lower level protocol (e.g., IP). These considerations are the
+ result of concern about security, to the extent that no TCP be
+ able to masquerade as another one, and so on. Similarly, no
+ process can masquerade as another without the collusion of the
+ TCP.
+
+ If the active/passive flag is set to passive, then this is a
+ call to LISTEN for an incoming connection. A passive open may
+ have either a fully specified foreign socket to wait for a
+ particular connection or an unspecified foreign socket to wait
+ for any call. A fully specified passive call can be made active
+ by the subsequent execution of a SEND.
+
+ A transmission control block (TCB) is created and partially
+ filled in with data from the OPEN command parameters.
+
+ On an active OPEN command, the TCP will begin the procedure to
+ synchronize (i.e., establish) the connection at once.
+
+ The timeout, if present, permits the caller to set up a timeout
+ for all data submitted to TCP. If data is not successfully
+ delivered to the destination within the timeout period, the TCP
+ will abort the connection. The present global default is five
+ minutes.
+
+ The TCP or some component of the operating system will verify
+ the users authority to open a connection with the specified
+
+
+ [Page 45]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ precedence or security/compartment. The absence of precedence
+ or security/compartment specification in the OPEN call indicates
+ the default values must be used.
+
+ TCP will accept incoming requests as matching only if the
+ security/compartment information is exactly the same and only if
+ the precedence is equal to or higher than the precedence
+ requested in the OPEN call.
+
+ The precedence for the connection is the higher of the values
+ requested in the OPEN call and received from the incoming
+ request, and fixed at that value for the life of the
+ connection.Implementers may want to give the user control of
+ this precedence negotiation. For example, the user might be
+ allowed to specify that the precedence must be exactly matched,
+ or that any attempt to raise the precedence be confirmed by the
+ user.
+
+ A local connection name will be returned to the user by the TCP.
+ The local connection name can then be used as a short hand term
+ for the connection defined by the <local socket, foreign socket>
+ pair.
+
+ Send
+
+ Format: SEND (local connection name, buffer address, byte
+ count, PUSH flag, URGENT flag [,timeout])
+
+ This call causes the data contained in the indicated user buffer
+ to be sent on the indicated connection. If the connection has
+ not been opened, the SEND is considered an error. Some
+ implementations may allow users to SEND first; in which case, an
+ automatic OPEN would be done. If the calling process is not
+ authorized to use this connection, an error is returned.
+
+ If the PUSH flag is set, the data must be transmitted promptly
+ to the receiver, and the PUSH bit will be set in the last TCP
+ segment created from the buffer. If the PUSH flag is not set,
+ the data may be combined with data from subsequent SENDs for
+ transmission efficiency.
+
+ If the URGENT flag is set, segments sent to the destination TCP
+ will have the urgent pointer set. The receiving TCP will signal
+ the urgent condition to the receiving process if the urgent
+ pointer indicates that data preceding the urgent pointer has not
+ been consumed by the receiving process. The purpose of urgent
+ is to stimulate the receiver to process the urgent data and to
+ indicate to the receiver when all the currently known urgent
+
+
+[Page 46]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ data has been received. The number of times the sending user's
+ TCP signals urgent will not necessarily be equal to the number
+ of times the receiving user will be notified of the presence of
+ urgent data.
+
+ If no foreign socket was specified in the OPEN, but the
+ connection is established (e.g., because a LISTENing connection
+ has become specific due to a foreign segment arriving for the
+ local socket), then the designated buffer is sent to the implied
+ foreign socket. Users who make use of OPEN with an unspecified
+ foreign socket can make use of SEND without ever explicitly
+ knowing the foreign socket address.
+
+ However, if a SEND is attempted before the foreign socket
+ becomes specified, an error will be returned. Users can use the
+ STATUS call to determine the status of the connection. In some
+ implementations the TCP may notify the user when an unspecified
+ socket is bound.
+
+ If a timeout is specified, the current user timeout for this
+ connection is changed to the new one.
+
+ In the simplest implementation, SEND would not return control to
+ the sending process until either the transmission was complete
+ or the timeout had been exceeded. However, this simple method
+ is both subject to deadlocks (for example, both sides of the
+ connection might try to do SENDs before doing any RECEIVEs) and
+ offers poor performance, so it is not recommended. A more
+ sophisticated implementation would return immediately to allow
+ the process to run concurrently with network I/O, and,
+ furthermore, to allow multiple SENDs to be in progress.
+ Multiple SENDs are served in first come, first served order, so
+ the TCP will queue those it cannot service immediately.
+
+ We have implicitly assumed an asynchronous user interface in
+ which a SEND later elicits some kind of SIGNAL or
+ pseudo-interrupt from the serving TCP. An alternative is to
+ return a response immediately. For instance, SENDs might return
+ immediate local acknowledgment, even if the segment sent had not
+ been acknowledged by the distant TCP. We could optimistically
+ assume eventual success. If we are wrong, the connection will
+ close anyway due to the timeout. In implementations of this
+ kind (synchronous), there will still be some asynchronous
+ signals, but these will deal with the connection itself, and not
+ with specific segments or buffers.
+
+ In order for the process to distinguish among error or success
+ indications for different SENDs, it might be appropriate for the
+
+
+ [Page 47]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ buffer address to be returned along with the coded response to
+ the SEND request. TCP-to-user signals are discussed below,
+ indicating the information which should be returned to the
+ calling process.
+
+ Receive
+
+ Format: RECEIVE (local connection name, buffer address, byte
+ count) -> byte count, urgent flag, push flag
+
+ This command allocates a receiving buffer associated with the
+ specified connection. If no OPEN precedes this command or the
+ calling process is not authorized to use this connection, an
+ error is returned.
+
+ In the simplest implementation, control would not return to the
+ calling program until either the buffer was filled, or some
+ error occurred, but this scheme is highly subject to deadlocks.
+ A more sophisticated implementation would permit several
+ RECEIVEs to be outstanding at once. These would be filled as
+ segments arrive. This strategy permits increased throughput at
+ the cost of a more elaborate scheme (possibly asynchronous) to
+ notify the calling program that a PUSH has been seen or a buffer
+ filled.
+
+ If enough data arrive to fill the buffer before a PUSH is seen,
+ the PUSH flag will not be set in the response to the RECEIVE.
+ The buffer will be filled with as much data as it can hold. If
+ a PUSH is seen before the buffer is filled the buffer will be
+ returned partially filled and PUSH indicated.
+
+ If there is urgent data the user will have been informed as soon
+ as it arrived via a TCP-to-user signal. The receiving user
+ should thus be in "urgent mode". If the URGENT flag is on,
+ additional urgent data remains. If the URGENT flag is off, this
+ call to RECEIVE has returned all the urgent data, and the user
+ may now leave "urgent mode". Note that data following the
+ urgent pointer (non-urgent data) cannot be delivered to the user
+ in the same buffer with preceeding urgent data unless the
+ boundary is clearly marked for the user.
+
+ To distinguish among several outstanding RECEIVEs and to take
+ care of the case that a buffer is not completely filled, the
+ return code is accompanied by both a buffer pointer and a byte
+ count indicating the actual length of the data received.
+
+ Alternative implementations of RECEIVE might have the TCP
+
+
+
+[Page 48]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ allocate buffer storage, or the TCP might share a ring buffer
+ with the user.
+
+ Close
+
+ Format: CLOSE (local connection name)
+
+ This command causes the connection specified to be closed. If
+ the connection is not open or the calling process is not
+ authorized to use this connection, an error is returned.
+ Closing connections is intended to be a graceful operation in
+ the sense that outstanding SENDs will be transmitted (and
+ retransmitted), as flow control permits, until all have been
+ serviced. Thus, it should be acceptable to make several SEND
+ calls, followed by a CLOSE, and expect all the data to be sent
+ to the destination. It should also be clear that users should
+ continue to RECEIVE on CLOSING connections, since the other side
+ may be trying to transmit the last of its data. Thus, CLOSE
+ means "I have no more to send" but does not mean "I will not
+ receive any more." It may happen (if the user level protocol is
+ not well thought out) that the closing side is unable to get rid
+ of all its data before timing out. In this event, CLOSE turns
+ into ABORT, and the closing TCP gives up.
+
+ The user may CLOSE the connection at any time on his own
+ initiative, or in response to various prompts from the TCP
+ (e.g., remote close executed, transmission timeout exceeded,
+ destination inaccessible).
+
+ Because closing a connection requires communication with the
+ foreign TCP, connections may remain in the closing state for a
+ short time. Attempts to reopen the connection before the TCP
+ replies to the CLOSE command will result in error responses.
+
+ Close also implies push function.
+
+ Status
+
+ Format: STATUS (local connection name) -> status data
+
+ This is an implementation dependent user command and could be
+ excluded without adverse effect. Information returned would
+ typically come from the TCB associated with the connection.
+
+ This command returns a data block containing the following
+ information:
+
+ local socket,
+
+
+ [Page 49]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+ foreign socket,
+ local connection name,
+ receive window,
+ send window,
+ connection state,
+ number of buffers awaiting acknowledgment,
+ number of buffers pending receipt,
+ urgent state,
+ precedence,
+ security/compartment,
+ and transmission timeout.
+
+ Depending on the state of the connection, or on the
+ implementation itself, some of this information may not be
+ available or meaningful. If the calling process is not
+ authorized to use this connection, an error is returned. This
+ prevents unauthorized processes from gaining information about a
+ connection.
+
+ Abort
+
+ Format: ABORT (local connection name)
+
+ This command causes all pending SENDs and RECEIVES to be
+ aborted, the TCB to be removed, and a special RESET message to
+ be sent to the TCP on the other side of the connection.
+ Depending on the implementation, users may receive abort
+ indications for each outstanding SEND or RECEIVE, or may simply
+ receive an ABORT-acknowledgment.
+
+ TCP-to-User Messages
+
+ It is assumed that the operating system environment provides a
+ means for the TCP to asynchronously signal the user program. When
+ the TCP does signal a user program, certain information is passed
+ to the user. Often in the specification the information will be
+ an error message. In other cases there will be information
+ relating to the completion of processing a SEND or RECEIVE or
+ other user call.
+
+ The following information is provided:
+
+ Local Connection Name Always
+ Response String Always
+ Buffer Address Send & Receive
+ Byte count (counts bytes received) Receive
+ Push flag Receive
+ Urgent flag Receive
+
+
+[Page 50]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ TCP/Lower-Level Interface
+
+ The TCP calls on a lower level protocol module to actually send and
+ receive information over a network. One case is that of the ARPA
+ internetwork system where the lower level module is the Internet
+ Protocol (IP) [2].
+
+ If the lower level protocol is IP it provides arguments for a type
+ of service and for a time to live. TCP uses the following settings
+ for these parameters:
+
+ Type of Service = Precedence: routine, Delay: normal, Throughput:
+ normal, Reliability: normal; or 00000000.
+
+ Time to Live = one minute, or 00111100.
+
+ Note that the assumed maximum segment lifetime is two minutes.
+ Here we explicitly ask that a segment be destroyed if it cannot
+ be delivered by the internet system within one minute.
+
+ If the lower level is IP (or other protocol that provides this
+ feature) and source routing is used, the interface must allow the
+ route information to be communicated. This is especially important
+ so that the source and destination addresses used in the TCP
+ checksum be the originating source and ultimate destination. It is
+ also important to preserve the return route to answer connection
+ requests.
+
+ Any lower level protocol will have to provide the source address,
+ destination address, and protocol fields, and some way to determine
+ the "TCP length", both to provide the functional equivlent service
+ of IP and to be used in the TCP checksum.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 51]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+
+
+
+3.9. Event Processing
+
+ The processing depicted in this section is an example of one possible
+ implementation. Other implementations may have slightly different
+ processing sequences, but they should differ from those in this
+ section only in detail, not in substance.
+
+ The activity of the TCP can be characterized as responding to events.
+ The events that occur can be cast into three categories: user calls,
+ arriving segments, and timeouts. This section describes the
+ processing the TCP does in response to each of the events. In many
+ cases the processing required depends on the state of the connection.
+
+ Events that occur:
+
+ User Calls
+
+ OPEN
+ SEND
+ RECEIVE
+ CLOSE
+ ABORT
+ STATUS
+
+ Arriving Segments
+
+ SEGMENT ARRIVES
+
+ Timeouts
+
+ USER TIMEOUT
+ RETRANSMISSION TIMEOUT
+ TIME-WAIT TIMEOUT
+
+ The model of the TCP/user interface is that user commands receive an
+ immediate return and possibly a delayed response via an event or
+ pseudo interrupt. In the following descriptions, the term "signal"
+ means cause a delayed response.
+
+ Error responses are given as character strings. For example, user
+ commands referencing connections that do not exist receive "error:
+ connection not open".
+
+ Please note in the following that all arithmetic on sequence numbers,
+ acknowledgment numbers, windows, et cetera, is modulo 2**32 the size
+ of the sequence number space. Also note that "=<" means less than or
+ equal to (modulo 2**32).
+
+
+
+[Page 52]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+
+
+
+ A natural way to think about processing incoming segments is to
+ imagine that they are first tested for proper sequence number (i.e.,
+ that their contents lie in the range of the expected "receive window"
+ in the sequence number space) and then that they are generally queued
+ and processed in sequence number order.
+
+ When a segment overlaps other already received segments we reconstruct
+ the segment to contain just the new data, and adjust the header fields
+ to be consistent.
+
+ Note that if no state change is mentioned the TCP stays in the same
+ state.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 53]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ OPEN Call
+
+
+
+ OPEN Call
+
+ CLOSED STATE (i.e., TCB does not exist)
+
+ Create a new transmission control block (TCB) to hold connection
+ state information. Fill in local socket identifier, foreign
+ socket, precedence, security/compartment, and user timeout
+ information. Note that some parts of the foreign socket may be
+ unspecified in a passive OPEN and are to be filled in by the
+ parameters of the incoming SYN segment. Verify the security and
+ precedence requested are allowed for this user, if not return
+ "error: precedence not allowed" or "error: security/compartment
+ not allowed." If passive enter the LISTEN state and return. If
+ active and the foreign socket is unspecified, return "error:
+ foreign socket unspecified"; if active and the foreign socket is
+ specified, issue a SYN segment. An initial send sequence number
+ (ISS) is selected. A SYN segment of the form <SEQ=ISS><CTL=SYN>
+ is sent. Set SND.UNA to ISS, SND.NXT to ISS+1, enter SYN-SENT
+ state, and return.
+
+ If the caller does not have access to the local socket specified,
+ return "error: connection illegal for this process". If there is
+ no room to create a new connection, return "error: insufficient
+ resources".
+
+ LISTEN STATE
+
+ If active and the foreign socket is specified, then change the
+ connection from passive to active, select an ISS. Send a SYN
+ segment, set SND.UNA to ISS, SND.NXT to ISS+1. Enter SYN-SENT
+ state. Data associated with SEND may be sent with SYN segment or
+ queued for transmission after entering ESTABLISHED state. The
+ urgent bit if requested in the command must be sent with the data
+ segments sent as a result of this command. If there is no room to
+ queue the request, respond with "error: insufficient resources".
+ If Foreign socket was not specified, then return "error: foreign
+ socket unspecified".
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 54]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+OPEN Call
+
+
+
+ SYN-SENT STATE
+ SYN-RECEIVED STATE
+ ESTABLISHED STATE
+ FIN-WAIT-1 STATE
+ FIN-WAIT-2 STATE
+ CLOSE-WAIT STATE
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT STATE
+
+ Return "error: connection already exists".
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 55]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ SEND Call
+
+
+
+ SEND Call
+
+ CLOSED STATE (i.e., TCB does not exist)
+
+ If the user does not have access to such a connection, then return
+ "error: connection illegal for this process".
+
+ Otherwise, return "error: connection does not exist".
+
+ LISTEN STATE
+
+ If the foreign socket is specified, then change the connection
+ from passive to active, select an ISS. Send a SYN segment, set
+ SND.UNA to ISS, SND.NXT to ISS+1. Enter SYN-SENT state. Data
+ associated with SEND may be sent with SYN segment or queued for
+ transmission after entering ESTABLISHED state. The urgent bit if
+ requested in the command must be sent with the data segments sent
+ as a result of this command. If there is no room to queue the
+ request, respond with "error: insufficient resources". If
+ Foreign socket was not specified, then return "error: foreign
+ socket unspecified".
+
+ SYN-SENT STATE
+ SYN-RECEIVED STATE
+
+ Queue the data for transmission after entering ESTABLISHED state.
+ If no space to queue, respond with "error: insufficient
+ resources".
+
+ ESTABLISHED STATE
+ CLOSE-WAIT STATE
+
+ Segmentize the buffer and send it with a piggybacked
+ acknowledgment (acknowledgment value = RCV.NXT). If there is
+ insufficient space to remember this buffer, simply return "error:
+ insufficient resources".
+
+ If the urgent flag is set, then SND.UP <- SND.NXT-1 and set the
+ urgent pointer in the outgoing segments.
+
+
+
+
+
+
+
+
+
+
+[Page 56]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+SEND Call
+
+
+
+ FIN-WAIT-1 STATE
+ FIN-WAIT-2 STATE
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT STATE
+
+ Return "error: connection closing" and do not service request.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 57]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ RECEIVE Call
+
+
+
+ RECEIVE Call
+
+ CLOSED STATE (i.e., TCB does not exist)
+
+ If the user does not have access to such a connection, return
+ "error: connection illegal for this process".
+
+ Otherwise return "error: connection does not exist".
+
+ LISTEN STATE
+ SYN-SENT STATE
+ SYN-RECEIVED STATE
+
+ Queue for processing after entering ESTABLISHED state. If there
+ is no room to queue this request, respond with "error:
+ insufficient resources".
+
+ ESTABLISHED STATE
+ FIN-WAIT-1 STATE
+ FIN-WAIT-2 STATE
+
+ If insufficient incoming segments are queued to satisfy the
+ request, queue the request. If there is no queue space to
+ remember the RECEIVE, respond with "error: insufficient
+ resources".
+
+ Reassemble queued incoming segments into receive buffer and return
+ to user. Mark "push seen" (PUSH) if this is the case.
+
+ If RCV.UP is in advance of the data currently being passed to the
+ user notify the user of the presence of urgent data.
+
+ When the TCP takes responsibility for delivering data to the user
+ that fact must be communicated to the sender via an
+ acknowledgment. The formation of such an acknowledgment is
+ described below in the discussion of processing an incoming
+ segment.
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 58]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+RECEIVE Call
+
+
+
+ CLOSE-WAIT STATE
+
+ Since the remote side has already sent FIN, RECEIVEs must be
+ satisfied by text already on hand, but not yet delivered to the
+ user. If no text is awaiting delivery, the RECEIVE will get a
+ "error: connection closing" response. Otherwise, any remaining
+ text can be used to satisfy the RECEIVE.
+
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT STATE
+
+ Return "error: connection closing".
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 59]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ CLOSE Call
+
+
+
+ CLOSE Call
+
+ CLOSED STATE (i.e., TCB does not exist)
+
+ If the user does not have access to such a connection, return
+ "error: connection illegal for this process".
+
+ Otherwise, return "error: connection does not exist".
+
+ LISTEN STATE
+
+ Any outstanding RECEIVEs are returned with "error: closing"
+ responses. Delete TCB, enter CLOSED state, and return.
+
+ SYN-SENT STATE
+
+ Delete the TCB and return "error: closing" responses to any
+ queued SENDs, or RECEIVEs.
+
+ SYN-RECEIVED STATE
+
+ If no SENDs have been issued and there is no pending data to send,
+ then form a FIN segment and send it, and enter FIN-WAIT-1 state;
+ otherwise queue for processing after entering ESTABLISHED state.
+
+ ESTABLISHED STATE
+
+ Queue this until all preceding SENDs have been segmentized, then
+ form a FIN segment and send it. In any case, enter FIN-WAIT-1
+ state.
+
+ FIN-WAIT-1 STATE
+ FIN-WAIT-2 STATE
+
+ Strictly speaking, this is an error and should receive a "error:
+ connection closing" response. An "ok" response would be
+ acceptable, too, as long as a second FIN is not emitted (the first
+ FIN may be retransmitted though).
+
+
+
+
+
+
+
+
+
+
+
+[Page 60]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+CLOSE Call
+
+
+
+ CLOSE-WAIT STATE
+
+ Queue this request until all preceding SENDs have been
+ segmentized; then send a FIN segment, enter CLOSING state.
+
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT STATE
+
+ Respond with "error: connection closing".
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 61]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ ABORT Call
+
+
+
+ ABORT Call
+
+ CLOSED STATE (i.e., TCB does not exist)
+
+ If the user should not have access to such a connection, return
+ "error: connection illegal for this process".
+
+ Otherwise return "error: connection does not exist".
+
+ LISTEN STATE
+
+ Any outstanding RECEIVEs should be returned with "error:
+ connection reset" responses. Delete TCB, enter CLOSED state, and
+ return.
+
+ SYN-SENT STATE
+
+ All queued SENDs and RECEIVEs should be given "connection reset"
+ notification, delete the TCB, enter CLOSED state, and return.
+
+ SYN-RECEIVED STATE
+ ESTABLISHED STATE
+ FIN-WAIT-1 STATE
+ FIN-WAIT-2 STATE
+ CLOSE-WAIT STATE
+
+ Send a reset segment:
+
+ <SEQ=SND.NXT><CTL=RST>
+
+ All queued SENDs and RECEIVEs should be given "connection reset"
+ notification; all segments queued for transmission (except for the
+ RST formed above) or retransmission should be flushed, delete the
+ TCB, enter CLOSED state, and return.
+
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT STATE
+
+ Respond with "ok" and delete the TCB, enter CLOSED state, and
+ return.
+
+
+
+
+
+
+
+
+[Page 62]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+STATUS Call
+
+
+
+ STATUS Call
+
+ CLOSED STATE (i.e., TCB does not exist)
+
+ If the user should not have access to such a connection, return
+ "error: connection illegal for this process".
+
+ Otherwise return "error: connection does not exist".
+
+ LISTEN STATE
+
+ Return "state = LISTEN", and the TCB pointer.
+
+ SYN-SENT STATE
+
+ Return "state = SYN-SENT", and the TCB pointer.
+
+ SYN-RECEIVED STATE
+
+ Return "state = SYN-RECEIVED", and the TCB pointer.
+
+ ESTABLISHED STATE
+
+ Return "state = ESTABLISHED", and the TCB pointer.
+
+ FIN-WAIT-1 STATE
+
+ Return "state = FIN-WAIT-1", and the TCB pointer.
+
+ FIN-WAIT-2 STATE
+
+ Return "state = FIN-WAIT-2", and the TCB pointer.
+
+ CLOSE-WAIT STATE
+
+ Return "state = CLOSE-WAIT", and the TCB pointer.
+
+ CLOSING STATE
+
+ Return "state = CLOSING", and the TCB pointer.
+
+ LAST-ACK STATE
+
+ Return "state = LAST-ACK", and the TCB pointer.
+
+
+
+
+
+ [Page 63]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ STATUS Call
+
+
+
+ TIME-WAIT STATE
+
+ Return "state = TIME-WAIT", and the TCB pointer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 64]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+SEGMENT ARRIVES
+
+
+
+ SEGMENT ARRIVES
+
+ If the state is CLOSED (i.e., TCB does not exist) then
+
+ all data in the incoming segment is discarded. An incoming
+ segment containing a RST is discarded. An incoming segment not
+ containing a RST causes a RST to be sent in response. The
+ acknowledgment and sequence field values are selected to make the
+ reset sequence acceptable to the TCP that sent the offending
+ segment.
+
+ If the ACK bit is off, sequence number zero is used,
+
+ <SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
+
+ If the ACK bit is on,
+
+ <SEQ=SEG.ACK><CTL=RST>
+
+ Return.
+
+ If the state is LISTEN then
+
+ first check for an RST
+
+ An incoming RST should be ignored. Return.
+
+ second check for an ACK
+
+ Any acknowledgment is bad if it arrives on a connection still in
+ the LISTEN state. An acceptable reset segment should be formed
+ for any arriving ACK-bearing segment. The RST should be
+ formatted as follows:
+
+ <SEQ=SEG.ACK><CTL=RST>
+
+ Return.
+
+ third check for a SYN
+
+ If the SYN bit is set, check the security. If the
+ security/compartment on the incoming segment does not exactly
+ match the security/compartment in the TCB then send a reset and
+ return.
+
+ <SEQ=SEG.ACK><CTL=RST>
+
+
+
+ [Page 65]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ SEGMENT ARRIVES
+
+
+
+ If the SEG.PRC is greater than the TCB.PRC then if allowed by
+ the user and the system set TCB.PRC<-SEG.PRC, if not allowed
+ send a reset and return.
+
+ <SEQ=SEG.ACK><CTL=RST>
+
+ If the SEG.PRC is less than the TCB.PRC then continue.
+
+ Set RCV.NXT to SEG.SEQ+1, IRS is set to SEG.SEQ and any other
+ control or text should be queued for processing later. ISS
+ should be selected and a SYN segment sent of the form:
+
+ <SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK>
+
+ SND.NXT is set to ISS+1 and SND.UNA to ISS. The connection
+ state should be changed to SYN-RECEIVED. Note that any other
+ incoming control or data (combined with SYN) will be processed
+ in the SYN-RECEIVED state, but processing of SYN and ACK should
+ not be repeated. If the listen was not fully specified (i.e.,
+ the foreign socket was not fully specified), then the
+ unspecified fields should be filled in now.
+
+ fourth other text or control
+
+ Any other control or text-bearing segment (not containing SYN)
+ must have an ACK and thus would be discarded by the ACK
+ processing. An incoming RST segment could not be valid, since
+ it could not have been sent in response to anything sent by this
+ incarnation of the connection. So you are unlikely to get here,
+ but if you do, drop the segment, and return.
+
+ If the state is SYN-SENT then
+
+ first check the ACK bit
+
+ If the ACK bit is set
+
+ If SEG.ACK =< ISS, or SEG.ACK > SND.NXT, send a reset (unless
+ the RST bit is set, if so drop the segment and return)
+
+ <SEQ=SEG.ACK><CTL=RST>
+
+ and discard the segment. Return.
+
+ If SND.UNA =< SEG.ACK =< SND.NXT then the ACK is acceptable.
+
+ second check the RST bit
+
+
+[Page 66]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+SEGMENT ARRIVES
+
+
+
+ If the RST bit is set
+
+ If the ACK was acceptable then signal the user "error:
+ connection reset", drop the segment, enter CLOSED state,
+ delete TCB, and return. Otherwise (no ACK) drop the segment
+ and return.
+
+ third check the security and precedence
+
+ If the security/compartment in the segment does not exactly
+ match the security/compartment in the TCB, send a reset
+
+ If there is an ACK
+
+ <SEQ=SEG.ACK><CTL=RST>
+
+ Otherwise
+
+ <SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
+
+ If there is an ACK
+
+ The precedence in the segment must match the precedence in the
+ TCB, if not, send a reset
+
+ <SEQ=SEG.ACK><CTL=RST>
+
+ If there is no ACK
+
+ If the precedence in the segment is higher than the precedence
+ in the TCB then if allowed by the user and the system raise
+ the precedence in the TCB to that in the segment, if not
+ allowed to raise the prec then send a reset.
+
+ <SEQ=0><ACK=SEG.SEQ+SEG.LEN><CTL=RST,ACK>
+
+ If the precedence in the segment is lower than the precedence
+ in the TCB continue.
+
+ If a reset was sent, discard the segment and return.
+
+ fourth check the SYN bit
+
+ This step should be reached only if the ACK is ok, or there is
+ no ACK, and it the segment did not contain a RST.
+
+ If the SYN bit is on and the security/compartment and precedence
+
+
+ [Page 67]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ SEGMENT ARRIVES
+
+
+
+ are acceptable then, RCV.NXT is set to SEG.SEQ+1, IRS is set to
+ SEG.SEQ. SND.UNA should be advanced to equal SEG.ACK (if there
+ is an ACK), and any segments on the retransmission queue which
+ are thereby acknowledged should be removed.
+
+ If SND.UNA > ISS (our SYN has been ACKed), change the connection
+ state to ESTABLISHED, form an ACK segment
+
+ <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
+
+ and send it. Data or controls which were queued for
+ transmission may be included. If there are other controls or
+ text in the segment then continue processing at the sixth step
+ below where the URG bit is checked, otherwise return.
+
+ Otherwise enter SYN-RECEIVED, form a SYN,ACK segment
+
+ <SEQ=ISS><ACK=RCV.NXT><CTL=SYN,ACK>
+
+ and send it. If there are other controls or text in the
+ segment, queue them for processing after the ESTABLISHED state
+ has been reached, return.
+
+ fifth, if neither of the SYN or RST bits is set then drop the
+ segment and return.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 68]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+SEGMENT ARRIVES
+
+
+
+ Otherwise,
+
+ first check sequence number
+
+ SYN-RECEIVED STATE
+ ESTABLISHED STATE
+ FIN-WAIT-1 STATE
+ FIN-WAIT-2 STATE
+ CLOSE-WAIT STATE
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT STATE
+
+ Segments are processed in sequence. Initial tests on arrival
+ are used to discard old duplicates, but further processing is
+ done in SEG.SEQ order. If a segment's contents straddle the
+ boundary between old and new, only the new parts should be
+ processed.
+
+ There are four cases for the acceptability test for an incoming
+ segment:
+
+ Segment Receive Test
+ Length Window
+ ------- ------- -------------------------------------------
+
+ 0 0 SEG.SEQ = RCV.NXT
+
+ 0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+
+ >0 0 not acceptable
+
+ >0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+ or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND
+
+ If the RCV.WND is zero, no segments will be acceptable, but
+ special allowance should be made to accept valid ACKs, URGs and
+ RSTs.
+
+ If an incoming segment is not acceptable, an acknowledgment
+ should be sent in reply (unless the RST bit is set, if so drop
+ the segment and return):
+
+ <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
+
+ After sending the acknowledgment, drop the unacceptable segment
+ and return.
+
+
+ [Page 69]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ SEGMENT ARRIVES
+
+
+
+ In the following it is assumed that the segment is the idealized
+ segment that begins at RCV.NXT and does not exceed the window.
+ One could tailor actual segments to fit this assumption by
+ trimming off any portions that lie outside the window (including
+ SYN and FIN), and only processing further if the segment then
+ begins at RCV.NXT. Segments with higher begining sequence
+ numbers may be held for later processing.
+
+ second check the RST bit,
+
+ SYN-RECEIVED STATE
+
+ If the RST bit is set
+
+ If this connection was initiated with a passive OPEN (i.e.,
+ came from the LISTEN state), then return this connection to
+ LISTEN state and return. The user need not be informed. If
+ this connection was initiated with an active OPEN (i.e., came
+ from SYN-SENT state) then the connection was refused, signal
+ the user "connection refused". In either case, all segments
+ on the retransmission queue should be removed. And in the
+ active OPEN case, enter the CLOSED state and delete the TCB,
+ and return.
+
+ ESTABLISHED
+ FIN-WAIT-1
+ FIN-WAIT-2
+ CLOSE-WAIT
+
+ If the RST bit is set then, any outstanding RECEIVEs and SEND
+ should receive "reset" responses. All segment queues should be
+ flushed. Users should also receive an unsolicited general
+ "connection reset" signal. Enter the CLOSED state, delete the
+ TCB, and return.
+
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT
+
+ If the RST bit is set then, enter the CLOSED state, delete the
+ TCB, and return.
+
+
+
+
+
+
+
+
+[Page 70]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+SEGMENT ARRIVES
+
+
+
+ third check security and precedence
+
+ SYN-RECEIVED
+
+ If the security/compartment and precedence in the segment do not
+ exactly match the security/compartment and precedence in the TCB
+ then send a reset, and return.
+
+ ESTABLISHED STATE
+
+ If the security/compartment and precedence in the segment do not
+ exactly match the security/compartment and precedence in the TCB
+ then send a reset, any outstanding RECEIVEs and SEND should
+ receive "reset" responses. All segment queues should be
+ flushed. Users should also receive an unsolicited general
+ "connection reset" signal. Enter the CLOSED state, delete the
+ TCB, and return.
+
+ Note this check is placed following the sequence check to prevent
+ a segment from an old connection between these ports with a
+ different security or precedence from causing an abort of the
+ current connection.
+
+ fourth, check the SYN bit,
+
+ SYN-RECEIVED
+ ESTABLISHED STATE
+ FIN-WAIT STATE-1
+ FIN-WAIT STATE-2
+ CLOSE-WAIT STATE
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT STATE
+
+ If the SYN is in the window it is an error, send a reset, any
+ outstanding RECEIVEs and SEND should receive "reset" responses,
+ all segment queues should be flushed, the user should also
+ receive an unsolicited general "connection reset" signal, enter
+ the CLOSED state, delete the TCB, and return.
+
+ If the SYN is not in the window this step would not be reached
+ and an ack would have been sent in the first step (sequence
+ number check).
+
+
+
+
+
+
+ [Page 71]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ SEGMENT ARRIVES
+
+
+
+ fifth check the ACK field,
+
+ if the ACK bit is off drop the segment and return
+
+ if the ACK bit is on
+
+ SYN-RECEIVED STATE
+
+ If SND.UNA =< SEG.ACK =< SND.NXT then enter ESTABLISHED state
+ and continue processing.
+
+ If the segment acknowledgment is not acceptable, form a
+ reset segment,
+
+ <SEQ=SEG.ACK><CTL=RST>
+
+ and send it.
+
+ ESTABLISHED STATE
+
+ If SND.UNA < SEG.ACK =< SND.NXT then, set SND.UNA <- SEG.ACK.
+ Any segments on the retransmission queue which are thereby
+ entirely acknowledged are removed. Users should receive
+ positive acknowledgments for buffers which have been SENT and
+ fully acknowledged (i.e., SEND buffer should be returned with
+ "ok" response). If the ACK is a duplicate
+ (SEG.ACK < SND.UNA), it can be ignored. If the ACK acks
+ something not yet sent (SEG.ACK > SND.NXT) then send an ACK,
+ drop the segment, and return.
+
+ If SND.UNA < SEG.ACK =< SND.NXT, the send window should be
+ updated. If (SND.WL1 < SEG.SEQ or (SND.WL1 = SEG.SEQ and
+ SND.WL2 =< SEG.ACK)), set SND.WND <- SEG.WND, set
+ SND.WL1 <- SEG.SEQ, and set SND.WL2 <- SEG.ACK.
+
+ Note that SND.WND is an offset from SND.UNA, that SND.WL1
+ records the sequence number of the last segment used to update
+ SND.WND, and that SND.WL2 records the acknowledgment number of
+ the last segment used to update SND.WND. The check here
+ prevents using old segments to update the window.
+
+
+
+
+
+
+
+
+
+[Page 72]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+SEGMENT ARRIVES
+
+
+
+ FIN-WAIT-1 STATE
+
+ In addition to the processing for the ESTABLISHED state, if
+ our FIN is now acknowledged then enter FIN-WAIT-2 and continue
+ processing in that state.
+
+ FIN-WAIT-2 STATE
+
+ In addition to the processing for the ESTABLISHED state, if
+ the retransmission queue is empty, the user's CLOSE can be
+ acknowledged ("ok") but do not delete the TCB.
+
+ CLOSE-WAIT STATE
+
+ Do the same processing as for the ESTABLISHED state.
+
+ CLOSING STATE
+
+ In addition to the processing for the ESTABLISHED state, if
+ the ACK acknowledges our FIN then enter the TIME-WAIT state,
+ otherwise ignore the segment.
+
+ LAST-ACK STATE
+
+ The only thing that can arrive in this state is an
+ acknowledgment of our FIN. If our FIN is now acknowledged,
+ delete the TCB, enter the CLOSED state, and return.
+
+ TIME-WAIT STATE
+
+ The only thing that can arrive in this state is a
+ retransmission of the remote FIN. Acknowledge it, and restart
+ the 2 MSL timeout.
+
+ sixth, check the URG bit,
+
+ ESTABLISHED STATE
+ FIN-WAIT-1 STATE
+ FIN-WAIT-2 STATE
+
+ If the URG bit is set, RCV.UP <- max(RCV.UP,SEG.UP), and signal
+ the user that the remote side has urgent data if the urgent
+ pointer (RCV.UP) is in advance of the data consumed. If the
+ user has already been signaled (or is still in the "urgent
+ mode") for this continuous sequence of urgent data, do not
+ signal the user again.
+
+
+
+ [Page 73]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ SEGMENT ARRIVES
+
+
+
+ CLOSE-WAIT STATE
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT
+
+ This should not occur, since a FIN has been received from the
+ remote side. Ignore the URG.
+
+ seventh, process the segment text,
+
+ ESTABLISHED STATE
+ FIN-WAIT-1 STATE
+ FIN-WAIT-2 STATE
+
+ Once in the ESTABLISHED state, it is possible to deliver segment
+ text to user RECEIVE buffers. Text from segments can be moved
+ into buffers until either the buffer is full or the segment is
+ empty. If the segment empties and carries an PUSH flag, then
+ the user is informed, when the buffer is returned, that a PUSH
+ has been received.
+
+ When the TCP takes responsibility for delivering the data to the
+ user it must also acknowledge the receipt of the data.
+
+ Once the TCP takes responsibility for the data it advances
+ RCV.NXT over the data accepted, and adjusts RCV.WND as
+ apporopriate to the current buffer availability. The total of
+ RCV.NXT and RCV.WND should not be reduced.
+
+ Please note the window management suggestions in section 3.7.
+
+ Send an acknowledgment of the form:
+
+ <SEQ=SND.NXT><ACK=RCV.NXT><CTL=ACK>
+
+ This acknowledgment should be piggybacked on a segment being
+ transmitted if possible without incurring undue delay.
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 74]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+SEGMENT ARRIVES
+
+
+
+ CLOSE-WAIT STATE
+ CLOSING STATE
+ LAST-ACK STATE
+ TIME-WAIT STATE
+
+ This should not occur, since a FIN has been received from the
+ remote side. Ignore the segment text.
+
+ eighth, check the FIN bit,
+
+ Do not process the FIN if the state is CLOSED, LISTEN or SYN-SENT
+ since the SEG.SEQ cannot be validated; drop the segment and
+ return.
+
+ If the FIN bit is set, signal the user "connection closing" and
+ return any pending RECEIVEs with same message, advance RCV.NXT
+ over the FIN, and send an acknowledgment for the FIN. Note that
+ FIN implies PUSH for any segment text not yet delivered to the
+ user.
+
+ SYN-RECEIVED STATE
+ ESTABLISHED STATE
+
+ Enter the CLOSE-WAIT state.
+
+ FIN-WAIT-1 STATE
+
+ If our FIN has been ACKed (perhaps in this segment), then
+ enter TIME-WAIT, start the time-wait timer, turn off the other
+ timers; otherwise enter the CLOSING state.
+
+ FIN-WAIT-2 STATE
+
+ Enter the TIME-WAIT state. Start the time-wait timer, turn
+ off the other timers.
+
+ CLOSE-WAIT STATE
+
+ Remain in the CLOSE-WAIT state.
+
+ CLOSING STATE
+
+ Remain in the CLOSING state.
+
+ LAST-ACK STATE
+
+ Remain in the LAST-ACK state.
+
+
+ [Page 75]
+
+
+ September 1981
+Transmission Control Protocol
+Functional Specification
+ SEGMENT ARRIVES
+
+
+
+ TIME-WAIT STATE
+
+ Remain in the TIME-WAIT state. Restart the 2 MSL time-wait
+ timeout.
+
+ and return.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 76]
+
+
+September 1981
+ Transmission Control Protocol
+ Functional Specification
+USER TIMEOUT
+
+
+
+ USER TIMEOUT
+
+ For any state if the user timeout expires, flush all queues, signal
+ the user "error: connection aborted due to user timeout" in general
+ and for any outstanding calls, delete the TCB, enter the CLOSED
+ state and return.
+
+ RETRANSMISSION TIMEOUT
+
+ For any state if the retransmission timeout expires on a segment in
+ the retransmission queue, send the segment at the front of the
+ retransmission queue again, reinitialize the retransmission timer,
+ and return.
+
+ TIME-WAIT TIMEOUT
+
+ If the time-wait timeout expires on a connection delete the TCB,
+ enter the CLOSED state and return.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 77]
+
+
+ September 1981
+Transmission Control Protocol
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[Page 78]
+
+
+September 1981
+ Transmission Control Protocol
+
+
+
+ GLOSSARY
+
+
+
+1822
+ BBN Report 1822, "The Specification of the Interconnection of
+ a Host and an IMP". The specification of interface between a
+ host and the ARPANET.
+
+ACK
+ A control bit (acknowledge) occupying no sequence space, which
+ indicates that the acknowledgment field of this segment
+ specifies the next sequence number the sender of this segment
+ is expecting to receive, hence acknowledging receipt of all
+ previous sequence numbers.
+
+ARPANET message
+ The unit of transmission between a host and an IMP in the
+ ARPANET. The maximum size is about 1012 octets (8096 bits).
+
+ARPANET packet
+ A unit of transmission used internally in the ARPANET between
+ IMPs. The maximum size is about 126 octets (1008 bits).
+
+connection
+ A logical communication path identified by a pair of sockets.
+
+datagram
+ A message sent in a packet switched computer communications
+ network.
+
+Destination Address
+ The destination address, usually the network and host
+ identifiers.
+
+FIN
+ A control bit (finis) occupying one sequence number, which
+ indicates that the sender will send no more data or control
+ occupying sequence space.
+
+fragment
+ A portion of a logical unit of data, in particular an internet
+ fragment is a portion of an internet datagram.
+
+FTP
+ A file transfer protocol.
+
+
+
+
+
+ [Page 79]
+
+
+ September 1981
+Transmission Control Protocol
+Glossary
+
+
+
+header
+ Control information at the beginning of a message, segment,
+ fragment, packet or block of data.
+
+host
+ A computer. In particular a source or destination of messages
+ from the point of view of the communication network.
+
+Identification
+ An Internet Protocol field. This identifying value assigned
+ by the sender aids in assembling the fragments of a datagram.
+
+IMP
+ The Interface Message Processor, the packet switch of the
+ ARPANET.
+
+internet address
+ A source or destination address specific to the host level.
+
+internet datagram
+ The unit of data exchanged between an internet module and the
+ higher level protocol together with the internet header.
+
+internet fragment
+ A portion of the data of an internet datagram with an internet
+ header.
+
+IP
+ Internet Protocol.
+
+IRS
+ The Initial Receive Sequence number. The first sequence
+ number used by the sender on a connection.
+
+ISN
+ The Initial Sequence Number. The first sequence number used
+ on a connection, (either ISS or IRS). Selected on a clock
+ based procedure.
+
+ISS
+ The Initial Send Sequence number. The first sequence number
+ used by the sender on a connection.
+
+leader
+ Control information at the beginning of a message or block of
+ data. In particular, in the ARPANET, the control information
+ on an ARPANET message at the host-IMP interface.
+
+
+
+[Page 80]
+
+
+September 1981
+ Transmission Control Protocol
+ Glossary
+
+
+
+left sequence
+ This is the next sequence number to be acknowledged by the
+ data receiving TCP (or the lowest currently unacknowledged
+ sequence number) and is sometimes referred to as the left edge
+ of the send window.
+
+local packet
+ The unit of transmission within a local network.
+
+module
+ An implementation, usually in software, of a protocol or other
+ procedure.
+
+MSL
+ Maximum Segment Lifetime, the time a TCP segment can exist in
+ the internetwork system. Arbitrarily defined to be 2 minutes.
+
+octet
+ An eight bit byte.
+
+Options
+ An Option field may contain several options, and each option
+ may be several octets in length. The options are used
+ primarily in testing situations; for example, to carry
+ timestamps. Both the Internet Protocol and TCP provide for
+ options fields.
+
+packet
+ A package of data with a header which may or may not be
+ logically complete. More often a physical packaging than a
+ logical packaging of data.
+
+port
+ The portion of a socket that specifies which logical input or
+ output channel of a process is associated with the data.
+
+process
+ A program in execution. A source or destination of data from
+ the point of view of the TCP or other host-to-host protocol.
+
+PUSH
+ A control bit occupying no sequence space, indicating that
+ this segment contains data that must be pushed through to the
+ receiving user.
+
+RCV.NXT
+ receive next sequence number
+
+
+
+ [Page 81]
+
+
+ September 1981
+Transmission Control Protocol
+Glossary
+
+
+
+RCV.UP
+ receive urgent pointer
+
+RCV.WND
+ receive window
+
+receive next sequence number
+ This is the next sequence number the local TCP is expecting to
+ receive.
+
+receive window
+ This represents the sequence numbers the local (receiving) TCP
+ is willing to receive. Thus, the local TCP considers that
+ segments overlapping the range RCV.NXT to
+ RCV.NXT + RCV.WND - 1 carry acceptable data or control.
+ Segments containing sequence numbers entirely outside of this
+ range are considered duplicates and discarded.
+
+RST
+ A control bit (reset), occupying no sequence space, indicating
+ that the receiver should delete the connection without further
+ interaction. The receiver can determine, based on the
+ sequence number and acknowledgment fields of the incoming
+ segment, whether it should honor the reset command or ignore
+ it. In no case does receipt of a segment containing RST give
+ rise to a RST in response.
+
+RTP
+ Real Time Protocol: A host-to-host protocol for communication
+ of time critical information.
+
+SEG.ACK
+ segment acknowledgment
+
+SEG.LEN
+ segment length
+
+SEG.PRC
+ segment precedence value
+
+SEG.SEQ
+ segment sequence
+
+SEG.UP
+ segment urgent pointer field
+
+
+
+
+
+[Page 82]
+
+
+September 1981
+ Transmission Control Protocol
+ Glossary
+
+
+
+SEG.WND
+ segment window field
+
+segment
+ A logical unit of data, in particular a TCP segment is the
+ unit of data transfered between a pair of TCP modules.
+
+segment acknowledgment
+ The sequence number in the acknowledgment field of the
+ arriving segment.
+
+segment length
+ The amount of sequence number space occupied by a segment,
+ including any controls which occupy sequence space.
+
+segment sequence
+ The number in the sequence field of the arriving segment.
+
+send sequence
+ This is the next sequence number the local (sending) TCP will
+ use on the connection. It is initially selected from an
+ initial sequence number curve (ISN) and is incremented for
+ each octet of data or sequenced control transmitted.
+
+send window
+ This represents the sequence numbers which the remote
+ (receiving) TCP is willing to receive. It is the value of the
+ window field specified in segments from the remote (data
+ receiving) TCP. The range of new sequence numbers which may
+ be emitted by a TCP lies between SND.NXT and
+ SND.UNA + SND.WND - 1. (Retransmissions of sequence numbers
+ between SND.UNA and SND.NXT are expected, of course.)
+
+SND.NXT
+ send sequence
+
+SND.UNA
+ left sequence
+
+SND.UP
+ send urgent pointer
+
+SND.WL1
+ segment sequence number at last window update
+
+SND.WL2
+ segment acknowledgment number at last window update
+
+
+
+ [Page 83]
+
+
+ September 1981
+Transmission Control Protocol
+Glossary
+
+
+
+SND.WND
+ send window
+
+socket
+ An address which specifically includes a port identifier, that
+ is, the concatenation of an Internet Address with a TCP port.
+
+Source Address
+ The source address, usually the network and host identifiers.
+
+SYN
+ A control bit in the incoming segment, occupying one sequence
+ number, used at the initiation of a connection, to indicate
+ where the sequence numbering will start.
+
+TCB
+ Transmission control block, the data structure that records
+ the state of a connection.
+
+TCB.PRC
+ The precedence of the connection.
+
+TCP
+ Transmission Control Protocol: A host-to-host protocol for
+ reliable communication in internetwork environments.
+
+TOS
+ Type of Service, an Internet Protocol field.
+
+Type of Service
+ An Internet Protocol field which indicates the type of service
+ for this internet fragment.
+
+URG
+ A control bit (urgent), occupying no sequence space, used to
+ indicate that the receiving user should be notified to do
+ urgent processing as long as there is data to be consumed with
+ sequence numbers less than the value indicated in the urgent
+ pointer.
+
+urgent pointer
+ A control field meaningful only when the URG bit is on. This
+ field communicates the value of the urgent pointer which
+ indicates the data octet associated with the sending user's
+ urgent call.
+
+
+
+
+
+[Page 84]
+
+
+September 1981
+ Transmission Control Protocol
+
+
+
+ REFERENCES
+
+
+
+[1] Cerf, V., and R. Kahn, "A Protocol for Packet Network
+ Intercommunication", IEEE Transactions on Communications,
+ Vol. COM-22, No. 5, pp 637-648, May 1974.
+
+[2] Postel, J. (ed.), "Internet Protocol - DARPA Internet Program
+ Protocol Specification", RFC 791, USC/Information Sciences
+ Institute, September 1981.
+
+[3] Dalal, Y. and C. Sunshine, "Connection Management in Transport
+ Protocols", Computer Networks, Vol. 2, No. 6, pp. 454-473,
+ December 1978.
+
+[4] Postel, J., "Assigned Numbers", RFC 790, USC/Information Sciences
+ Institute, September 1981.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [Page 85]
+