decompression when setting the compressor.
-/* From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
+/* $Id: if_ppp.h,v 1.11 1998/03/24 23:54:58 paulus Exp $ */
/*
* if_ppp.h - Point-to-Point Protocol definitions.
#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
-#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
#define SC_DEBUG 0x00010000 /* enable debug messages */
#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
-#define SC_MASK 0x0fE0ffff /* bits that user can change */
+#define SC_MASK 0x0f0000ff /* bits that user can change */
/* state bits */
-#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
-#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
-#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */
#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */
#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
-/* From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
+/* $Id: if_ppp.h,v 1.11 1998/03/24 23:54:58 paulus Exp $ */
/*
* if_ppp.h - Point-to-Point Protocol definitions.
#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
-#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
#define SC_DEBUG 0x00010000 /* enable debug messages */
#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
-#define SC_MASK 0x0fE0ffff /* bits that user can change */
+#define SC_MASK 0x0f0000ff /* bits that user can change */
/* state bits */
-#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
-#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
-#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */
#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */
#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
#define CHECK_CHARACTERS 1
#define PPP_COMPRESS 1
-/* $Id: ppp.c,v 1.16 1998/03/19 05:02:17 paulus Exp $ */
+/* $Id: ppp.c,v 1.17 1998/03/24 23:54:59 paulus Exp $ */
#include <linux/version.h>
#include <linux/config.h> /* for CONFIG_KERNELD */
(*ppp->sc_rcomp->incomp) (ppp->sc_rc_state,
data, count);
}
+ } else if (proto == PPP_COMP && (ppp->flags & SC_DEBUG)) {
+ printk(KERN_DEBUG "ppp: frame not decompressed: "
+ "flags=%x, count=%d, sc_rc_state=%p\n",
+ ppp->flags, count, ppp->sc_rc_state);
}
/*
* Process the uncompressed frame.
}
break;
}
+ if (ppp->flags & SC_DEBUG)
+ printk(KERN_DEBUG "ppp_proto_ccp: %s code %d, flags=%x\n",
+ (rcvd? "rcvd": "sent"), CCP_CODE(dp), ppp->flags);
restore_flags(flags);
}
}
/*
- * Process the BSD compression IOCTL event for the tty device.
+ * Process the set-compression ioctl.
*/
static int
save_flags(flags);
cli();
- ppp->flags &= ~(SC_COMP_RUN | SC_DECOMP_RUN);
+ ppp->flags &= ~(data.transmit? SC_COMP_RUN: SC_DECOMP_RUN);
restore_flags(flags);
cp = find_compressor (ccp_option[0]);
unsigned int param2, unsigned long param3)
{
struct ppp *ppp = tty2ppp (tty);
- register int temp_i = 0;
+ register int temp_i = 0, oldflags;
int error = 0;
+ unsigned long flags;
/*
* Verify the status of the PPP device.
*/
if (error != 0)
break;
temp_i &= SC_MASK;
- temp_i |= (ppp->flags & ~SC_MASK);
- if ((ppp->flags & SC_CCP_OPEN) &&
- (temp_i & SC_CCP_OPEN) == 0)
- ppp_ccp_closed (ppp);
+ if ((ppp->flags & SC_CCP_OPEN) && (temp_i & SC_CCP_OPEN) == 0)
+ ppp_ccp_closed(ppp);
- if ((ppp->flags | temp_i) & SC_DEBUG)
+ save_flags(flags);
+ cli();
+ oldflags = ppp->flags;
+ ppp->flags = temp_i |= (ppp->flags & ~SC_MASK);
+ restore_flags(flags);
+ if ((oldflags | temp_i) & SC_DEBUG)
printk (KERN_INFO
"ppp_tty_ioctl: set flags to %x\n", temp_i);
- ppp->flags = temp_i;
break;
/*
* Set the compression mode
*
* ppp_deflate.c - interface the zlib procedures for Deflate compression
* and decompression (as used by gzip) to the PPP code.
- * This version is for use with Linux kernel 1.3.X.
+ * This version is for use with Linux kernel 1.3.X and later.
*
* Copyright (c) 1994 The Australian National University.
* All rights reserved.
}
}
- if (decode_proto)
+ if (decode_proto) {
+ if (state->debug)
+ printk(KERN_DEBUG "z_decompress%d: didn't get proto\n",
+ state->unit);
return DECOMP_ERROR;
+ }
olen = osize + overflow - state->strm.avail_out;
state->stats.unc_bytes += olen;