]> git.ozlabs.org Git - ppp.git/blobdiff - aix4/ppp_comp.c
added 0 hdrlen param to comp_init
[ppp.git] / aix4 / ppp_comp.c
index 58f26ad1ad17058d8655b45c9a4a64f306cd4118..4974855075b7553f780635eca8f9b651de862141 100644 (file)
@@ -24,7 +24,7 @@
  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
  * OR MODIFICATIONS.
  *
- * $Id: ppp_comp.c,v 1.1 1994/12/05 00:29:21 paulus Exp $
+ * $Id: ppp_comp.c,v 1.4 1995/04/28 06:13:05 paulus Exp $
  */
 
 #include <net/net_globals.h>
@@ -168,10 +168,35 @@ 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) {
+                *(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,14 +428,14 @@ 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 {
                if (cp->rstate != NULL
                    && (*cp->rcomp->decomp_init)
                        (cp->rstate, dp + CCP_HDRLEN, clen - CCP_HDRLEN,
-                        0/* unit */, cp->mru, cp->debug))
+                        0/* unit */, 0, cp->mru, cp->debug))
                    cp->ccp_state = (cp->ccp_state & ~CCP_ERR)
                        | CCP_DECOMP_RUN;
            }