/* * ccp_input - process a received CCP packet. */ static void ccp_input( int unit, u_char *p, int len) { fsm *f = &ccp_fsm[unit]; int oldstate; /* * Check for a terminate-request so we can print a message. */ oldstate = f->state; fsm_input(f, p, len); if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) notice("Compression disabled by peer."); /* * If we get a terminate-ack and we're not asking for compression, * close CCP. */ if (oldstate == REQSENT && p[0] == TERMACK && !ANY_COMPRESS(ccp_gotoptions[unit])) ccp_close(unit, "No compression negotiated"); }
/* * ccp_input - process a received CCP packet. */ void ccp_input(PPP_IF_VAR_T *pPppIf, u_char *p, int len) { fsm *f = &pPppIf->ccp_fsm; int oldstate; /* * Check for a terminate-request so we can print a message. */ oldstate = f->state; fsm_input(f, p, len); if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED){ syslog(SYS_LOG_NOTICE, "Compression disabled by peer."); diag_printf("Compression disabled by peer.\n"); #ifdef MPPE if (pPppIf->ccp_wantoptions.mppe) { diag_printf("MPPE disabled, closing LCP\n"); lcp_close(pPppIf); } #endif /* MPPE */ } /* * If we get a terminate-ack and we're not asking for compression, * close CCP. */ if (oldstate == REQSENT && p[0] == TERMACK && !ANY_COMPRESS(f->pPppIf->ccp_gotoptions)) ccp_close(pPppIf); }