X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=aix4%2Fppp_comp.c;h=7032d9af1b25c4ef3c092cc991b081aa82819eb7;hp=181eebb610243a3c1bdecfe38e7eef42abc59b03;hb=b6101aaab41daebf1df13747af0923f51d5c549b;hpb=8b856ec46871a1386487cda562cafa627cf48c88;ds=sidebyside diff --git a/aix4/ppp_comp.c b/aix4/ppp_comp.c index 181eebb..7032d9a 100644 --- a/aix4/ppp_comp.c +++ b/aix4/ppp_comp.c @@ -24,7 +24,7 @@ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, * OR MODIFICATIONS. * - * $Id: ppp_comp.c,v 1.2 1994/12/05 00:55:24 paulus Exp $ + * $Id: ppp_comp.c,v 1.6 1995/06/23 01:42:54 paulus Exp $ */ #include @@ -86,7 +86,9 @@ struct ppp_comp_state { extern struct compressor ppp_bsd_compress; struct compressor *ppp_compressors[] = { +#if DO_BSD_COMPRESS &ppp_bsd_compress, +#endif NULL }; @@ -168,10 +170,36 @@ ppp_comp_wput(q, mp) int error, len, proto, state; struct ppp_option_data *odp; struct compressor **comp; + struct ppp_comp_stats *pcp; cp = (struct ppp_comp_state *) q->q_ptr; switch (mp->b_datap->db_type) { + case M_CTL: + switch (*(u_char *) mp->b_rptr) { + case IF_GET_CSTATS: + freemsg(mp); + mp = allocb(sizeof(struct ppp_comp_stats) + sizeof(u_long), + BPRI_HI); + if (mp != NULL) { + mp->b_datap->db_type = M_CTL; + *(u_char *) mp->b_wptr = IF_CSTATS; + mp->b_wptr += sizeof(u_long); /* should be enough alignment */ + pcp = (struct ppp_comp_stats *) mp->b_wptr; + mp->b_wptr += sizeof(struct ppp_comp_stats); + bzero(pcp, sizeof(struct ppp_comp_stats)); + if (cp->xstate != NULL) + (*cp->xcomp->comp_stat)(cp->xstate, &pcp->c); + if (cp->rstate != NULL) + (*cp->rcomp->decomp_stat)(cp->rstate, &pcp->d); + qreply(q, mp); + } + break; + default: + putnext(q, mp); + } + break; + case M_DATA: /* first find out what the protocol is */ if (mp->b_wptr - mp->b_rptr >= PPP_HDRLEN @@ -403,7 +431,7 @@ ppp_comp_ccp(q, mp, rcvd) if (cp->xstate != NULL && (*cp->xcomp->comp_init) (cp->xstate, dp + CCP_HDRLEN, clen - CCP_HDRLEN, - 0, /* XXX: should be unit */ + 0, /* XXX: should be unit */ 0, cp->debug)) cp->ccp_state |= CCP_COMP_RUN; } else {