+ 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;
+