diff options
author | amurai <amurai@FreeBSD.org> | 1995-02-26 12:18:08 +0000 |
---|---|---|
committer | amurai <amurai@FreeBSD.org> | 1995-02-26 12:18:08 +0000 |
commit | eeb422fed8735188e4e141578d0383ae57ba8343 (patch) | |
tree | d05da3a88d3d54962fad8582d501f1b7ad9500b9 /usr.sbin/ppp/route.c | |
parent | 7c16fe40ea66e6edc77ed310b654360adf11b9f9 (diff) | |
download | FreeBSD-src-eeb422fed8735188e4e141578d0383ae57ba8343.zip FreeBSD-src-eeb422fed8735188e4e141578d0383ae57ba8343.tar.gz |
New user Process PPP based on iij-ppp0.94beta2.
o Supporting SYNC SIO device (But need a device driver)
- add "set speed sync"
o Fixing bug for Predictor-1 function.
o Add new parameter that re-sent interval for set timeout commands.
o Improving RTT (Round Trip Time) and reducing processor time.
- Previous Timer service was using polling, and now using
SIGALRM ;-)
- A 0.94beta2 will not work correctly....
-- Follows are additinal feature not including 0.94beta2
o Support Proxy ARP
- add "enable/disable proxy" commands
o Marging common routine in CHAP/PAP.
o Enhancing LCP/IPCP log information.
o Support local Authfication connection on port 300x and tty.
- You can set up pair of your "hostname -s" and
password in ppp.secret. if either ppp.secret file nor
your hostname line don't exist, It will notify a message
and working as same as previous version.(Backword compatibility)
- If you did set up them, It's allow connection but nothing to do
except help and passwd command.
- add "passwd yourpasswd" commands
o Support afilter - keep Alive filter that a packet can send/receiving
according to ifilter/ofilter but doesn't count it as preventing idle
timer expires.
- Same syntax of other filters.
o Fixing bugs reported by current user for previous one. Thanks !!
Reviewed by: Atsushi Murai (amurai@spec.co.jp)
Diffstat (limited to 'usr.sbin/ppp/route.c')
-rw-r--r-- | usr.sbin/ppp/route.c | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c index bf2cc09..f36cfcb 100644 --- a/usr.sbin/ppp/route.c +++ b/usr.sbin/ppp/route.c @@ -18,6 +18,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * $Id:$ + * */ #include <sys/types.h> #include <machine/endian.h> @@ -30,8 +31,7 @@ #include <netinet/in_systm.h> #include <netinet/in.h> #include <arpa/inet.h> -#if __FreeBSD__ >= 2 -#include <osreldate.h> +#if (BSD >= 199306) #include <sys/sysctl.h> #else #include <sys/kinfo.h> @@ -170,18 +170,21 @@ ShowRoute() int *lp; int needed, nb; u_long mask; -#if ( __FreeBSD_version >= 199412 ) - int mib[6]; +#if (BSD >= 199306) + int mib[6]; #endif -#if ( __FreeBSD_version >= 199412 ) +#if (BSD >= 199306) mib[0] = CTL_NET; mib[1] = PF_ROUTE; - mib[2] = 0; /* protocol */ - mib[3] = 0; /* wildcard address family */ + mib[2] = 0; + mib[3] = 0; mib[4] = NET_RT_DUMP; - mib[5] = 0; /* no flags */ - needed = sysctl(mib, 6, NULL, &needed, NULL, 0 ); + mib[5] = 0; + if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { + perror("sysctl-estimate"); + return(1); + } #else needed = getkerninfo(KINFO_RT_DUMP, 0, 0, 0); #endif @@ -190,9 +193,11 @@ ShowRoute() sp = malloc(needed); if (sp == NULL) return(1); -#if ( __FreeBSD_version >= 199412 ) - if (sysctl(mib, 6, sp, &needed, NULL, 0 ) < 0) +#if (BSD >= 199306) + if (sysctl(mib, 6, sp, &needed, NULL, 0) < 0) { + perror("sysctl-getroute"); return(1); + } #else if (getkerninfo(KINFO_RT_DUMP, sp, &needed, 0) < 0) return(1); @@ -250,24 +255,28 @@ int all; u_long mask; int *lp, nb; u_char *wp; -#if ( __FreeBSD_version >= 199412 ) - int mib[6]; +#if (BSD >= 199306) + int mib[6]; #endif #ifdef DEBUG logprintf("DeleteIfRoutes (%d)\n", IfIndex); #endif -#if ( __FreeBSD_version >= 199412 ) +#if (BSD >= 199306) mib[0] = CTL_NET; mib[1] = PF_ROUTE; - mib[2] = 0; /* protocol */ - mib[3] = 0; /* wildcard address family */ + mib[2] = 0; + mib[3] = 0; mib[4] = NET_RT_DUMP; - mib[5] = 0; /* no flags */ - needed = sysctl(mib, 6, NULL, &needed, NULL, 0 ); + mib[5] = 0; + if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { + perror("sysctl-estimate"); + return; + } #else needed = getkerninfo(KINFO_RT_DUMP, 0, 0, 0); #endif + if (needed < 0) return; @@ -275,9 +284,10 @@ int all; if (sp == NULL) return; -#if ( __FreeBSD_version >= 199412 ) - if (sysctl(mib, 6, sp, &needed, NULL, 0 ) < 0) { +#if (BSD >= 199306) + if (sysctl(mib, 6, sp, &needed, NULL, 0) < 0) { free(sp); + perror("sysctl-getroute"); return; } #else @@ -374,17 +384,12 @@ char *name; IfIndex = index; return(index); } -#if defined(__FreeBSD__) || (_BSDI_VERSION >= 199312) index++; -#endif } len -= elen; ifrp = (struct ifreq *)((char *)ifrp + elen); ifrp++; -#if defined(_BSDI_VERSION) && (_BSDI_VERSION < 199312) - index++; -#endif } close(s); |