Rename the IPR_VJ option into IRIP_VJ (as irip(4) told all the time),

create an opt_ header and make the dependency on slcompress.c more exact.
(OK by martin)
This commit is contained in:
drochner 2003-04-11 14:45:27 +00:00
parent b862bb2e33
commit 93c6f5d089
2 changed files with 15 additions and 13 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files,v 1.606 2003/04/10 22:06:51 christos Exp $
# $NetBSD: files,v 1.607 2003/04/11 14:45:27 drochner Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@ -964,6 +964,7 @@ defpseudo isdn: isdndev, tty
# ISDN network interfaces
defpseudo irip: isdndev, ifnet
defflag opt_irip.h IRIP_VJ
defpseudo ippp: isdndev, sppp, ifnet
# KTTCP network throughput testing pseudo-device
@ -1178,7 +1179,7 @@ file net/raw_cb.c
file net/raw_usrreq.c
file net/route.c
file net/rtsock.c
file net/slcompress.c sl | ppp | strip | irip
file net/slcompress.c sl | ppp | strip | (irip & irip_vj)
file net/zlib.c (ppp & ppp_deflate) | ipsec
file netinet/if_arp.c arp | netatalk needs-flag
file netinet/if_atm.c atm

View File

@ -27,7 +27,7 @@
* i4b_ipr.c - isdn4bsd IP over raw HDLC ISDN network driver
* ---------------------------------------------------------
*
* $Id: i4b_ipr.c,v 1.14 2002/12/28 21:11:23 kristerw Exp $
* $Id: i4b_ipr.c,v 1.15 2003/04/11 14:45:29 drochner Exp $
*
* $FreeBSD$
*
@ -59,9 +59,10 @@
*---------------------------------------------------------------------------*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i4b_ipr.c,v 1.14 2002/12/28 21:11:23 kristerw Exp $");
__KERNEL_RCSID(0, "$NetBSD: i4b_ipr.c,v 1.15 2003/04/11 14:45:29 drochner Exp $");
#include "irip.h"
#include "opt_irip.h"
#if NIRIP > 0
@ -101,7 +102,7 @@ __KERNEL_RCSID(0, "$NetBSD: i4b_ipr.c,v 1.14 2002/12/28 21:11:23 kristerw Exp $"
#include <netinet/in_var.h>
#include <netinet/ip.h>
#ifdef IPR_VJ
#ifdef IRIP_VJ
#include <net/slcompress.h>
#define IPR_COMPRESS IFF_LINK0 /* compress TCP traffic */
#define IPR_AUTOCOMP IFF_LINK1 /* auto-enable TCP compression */
@ -118,7 +119,7 @@ __KERNEL_RCSID(0, "$NetBSD: i4b_ipr.c,v 1.14 2002/12/28 21:11:23 kristerw Exp $"
*---------------------------------------------------------------------------*/
#define IPR_VJ_USEBUFFER /* define to use an allocated separate buffer*/
/* undef to uncompress in the mbuf itself */
#endif /* IPR_VJ */
#endif /* IRIP_VJ */
#if defined(__FreeBSD_version) && __FreeBSD_version >= 400008
#include "bpf.h"
@ -210,7 +211,7 @@ struct ipr_softc {
int sc_log_first; /* log first n packets */
#endif
#ifdef IPR_VJ
#ifdef IRIP_VJ
struct slcompress sc_compr; /* tcp compression data */
#ifdef IPR_VJ_USEBUFFER
u_char *sc_cbuf; /* tcp decompression buffer */
@ -323,7 +324,7 @@ iripattach()
sc->sc_if.if_softc = sc;
#endif
#ifdef IPR_VJ
#ifdef IRIP_VJ
sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_SIMPLEX | IPR_AUTOCOMP;
#else
sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_SIMPLEX;
@ -369,7 +370,7 @@ iripattach()
sc->sc_log_first = IPR_LOG;
#endif
#ifdef IPR_VJ
#ifdef IRIP_VJ
#ifdef __FreeBSD__
sl_compress_init(&sc->sc_compr, -1);
#else
@ -920,7 +921,7 @@ ipr_rx_data_rdy(void *softc)
{
register struct ipr_softc *sc = softc;
register struct mbuf *m;
#ifdef IPR_VJ
#ifdef IRIP_VJ
#ifdef IPR_VJ_USEBUFFER
u_char *cp = sc->sc_cbuf;
#endif
@ -966,7 +967,7 @@ ipr_rx_data_rdy(void *softc)
sc->sc_if.if_ipackets++;
sc->sc_if.if_ibytes += m->m_pkthdr.len;
#ifdef IPR_VJ
#ifdef IRIP_VJ
if((c = (*(mtod(m, u_char *)) & 0xf0)) != (IPVERSION << 4))
{
/* copy data to buffer */
@ -1110,7 +1111,7 @@ ipr_tx_queue_empty(void *softc)
{
register struct ipr_softc *sc = softc;
register struct mbuf *m;
#ifdef IPR_VJ
#ifdef IRIP_VJ
struct ip *ip;
#endif
int x = 0;
@ -1155,7 +1156,7 @@ ipr_tx_queue_empty(void *softc)
sc->sc_outb += m->m_pkthdr.len; /* size before compression */
#endif
#ifdef IPR_VJ
#ifdef IRIP_VJ
if((ip = mtod(m, struct ip *))->ip_p == IPPROTO_TCP)
{
if(sc->sc_if.if_flags & IPR_COMPRESS)