Lines Matching full:if

32 #if PPP_SUPPORT && CCP_SUPPORT  /* don't build if not configured for use in lwipopts.h */
42 #if MPPE_SUPPORT
59 #if PPP_OPTIONS
68 #if MPPE_SUPPORT
111 #if MPPE_SUPPORT
175 #if PRINTPKT_SUPPORT
178 #if PPP_DATAINPUT
191 #if PRINTPKT_SUPPORT
194 #if PPP_DATAINPUT
197 #if PRINTPKT_SUPPORT
201 #if PPP_OPTIONS
205 #if DEMAND_SUPPORT
250 #if DEFLATE_SUPPORT in ccp_anycompress()
253 #if BSDCOMPRESS_SUPPORT in ccp_anycompress()
256 #if PREDICTOR_SUPPORT in ccp_anycompress()
259 #if MPPE_SUPPORT in ccp_anycompress()
269 #define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */
273 #if PPP_OPTIONS
286 if (endp != str && *endp == ',') {
290 if (*endp != 0 || endp == str) {
294 if ((rbits != 0 && (rbits < BSD_MIN_BITS || rbits > BSD_MAX_BITS))
300 if (rbits > 0) {
305 if (abits > 0) {
325 if (endp != str && *endp == ',') {
329 if (*endp != 0 || endp == str) {
333 if ((rbits != 0 && (rbits < DEFLATE_MIN_SIZE || rbits > DEFLATE_MAX_SIZE))
340 if (rbits == DEFLATE_MIN_SIZE || abits == DEFLATE_MIN_SIZE) {
341 if (rbits == DEFLATE_MIN_SIZE)
343 if (abits == DEFLATE_MIN_SIZE)
348 if (rbits > 0) {
353 if (abits > 0) {
376 #if 0 /* Not necessary, everything is cleared in ppp_new() */ in ccp_init()
383 #if DEFLATE_SUPPORT in ccp_init()
394 #if BSDCOMPRESS_SUPPORT in ccp_init()
401 #if PREDICTOR_SUPPORT in ccp_init()
413 if (f->state != PPP_FSM_OPENED) in ccp_open()
421 if (!ccp_anycompress(go)) in ccp_open()
465 if (oldstate == PPP_FSM_OPENED && p[0] == TERMREQ && f->state != PPP_FSM_OPENED) { in ccp_input()
467 #if MPPE_SUPPORT in ccp_input()
468 if (go->mppe) { in ccp_input()
476 * If we get a terminate-ack and we're not asking for compression, in ccp_input()
479 if (oldstate == PPP_FSM_REQSENT && p[0] == TERMACK in ccp_input()
494 if (f->state != PPP_FSM_OPENED) in ccp_extcode()
503 if ((pcb->ccp_localstate & RACK_PENDING) && id == f->reqid) { in ccp_extcode()
522 #if MPPE_SUPPORT in ccp_protrej()
529 #if MPPE_SUPPORT in ccp_protrej()
530 if (go->mppe) { in ccp_protrej()
545 #if MPPE_SUPPORT in ccp_resetci()
548 #if DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT in ccp_resetci()
551 #if DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT in ccp_resetci()
555 #if MPPE_SUPPORT in ccp_resetci()
556 if (pcb->settings.require_mppe) { in ccp_resetci()
566 #if MPPE_SUPPORT in ccp_resetci()
567 if (go->mppe) { in ccp_resetci()
577 * NB: If MPPE is required, all other compression opts are invalid. in ccp_resetci()
578 * So, we return right away if we can't do it. in ccp_resetci()
591 if (numbits > 1) { in ccp_resetci()
596 if (!numbits) { in ccp_resetci()
603 if (!pcb->mppe_keys_set) { in ccp_resetci()
611 if (pcb->auth_done & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) { in ccp_resetci()
613 if (go->mppe & MPPE_OPT_40) { in ccp_resetci()
621 if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) { in ccp_resetci()
631 #if BSDCOMPRESS_SUPPORT in ccp_resetci()
634 #if PREDICTOR_SUPPORT in ccp_resetci()
638 #if DEFLATE_SUPPORT in ccp_resetci()
648 #if BSDCOMPRESS_SUPPORT in ccp_resetci()
649 /* FIXME: we don't need to test if BSD compress is available in ccp_resetci()
650 * if BSDCOMPRESS_SUPPORT is set, it is. in ccp_resetci()
652 if (go->bsd_compress) { in ccp_resetci()
656 if (go->bsd_bits < BSD_MIN_BITS) { in ccp_resetci()
662 if (res > 0) { in ccp_resetci()
664 } else if (res < 0) { in ccp_resetci()
672 #if DEFLATE_SUPPORT in ccp_resetci()
673 /* FIXME: we don't need to test if deflate is available in ccp_resetci()
674 * if DEFLATE_SUPPORT is set, it is. in ccp_resetci()
676 if (go->deflate) { in ccp_resetci()
677 if (go->deflate_correct) { in ccp_resetci()
682 if (go->deflate_size < DEFLATE_MIN_WORKS) { in ccp_resetci()
688 if (res > 0) { in ccp_resetci()
690 } else if (res < 0) { in ccp_resetci()
697 if (go->deflate_draft) { in ccp_resetci()
702 if (go->deflate_size < DEFLATE_MIN_WORKS) { in ccp_resetci()
708 if (res > 0) { in ccp_resetci()
710 } else if (res < 0) { in ccp_resetci()
717 if (!go->deflate_correct && !go->deflate_draft) in ccp_resetci()
721 #if PREDICTOR_SUPPORT in ccp_resetci()
722 /* FIXME: we don't need to test if predictor is available, in ccp_resetci()
723 * if PREDICTOR_SUPPORT is set, it is. in ccp_resetci()
725 if (go->predictor_1) { in ccp_resetci()
728 if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) in ccp_resetci()
731 if (go->predictor_2) { in ccp_resetci()
734 if (ccp_test(pcb, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) in ccp_resetci()
748 #if BSDCOMPRESS_SUPPORT in ccp_cilen()
751 #if DEFLATE_SUPPORT in ccp_cilen()
755 #if PREDICTOR_SUPPORT in ccp_cilen()
759 #if MPPE_SUPPORT in ccp_cilen()
777 #if MPPE_SUPPORT in ccp_addci()
778 if (go->mppe) { in ccp_addci()
786 #if DEFLATE_SUPPORT in ccp_addci()
787 if (go->deflate) { in ccp_addci()
788 if (go->deflate_correct) { in ccp_addci()
795 if (go->deflate_draft) { in ccp_addci()
804 #if BSDCOMPRESS_SUPPORT in ccp_addci()
805 if (go->bsd_compress) { in ccp_addci()
812 #if PREDICTOR_SUPPORT in ccp_addci()
814 if (go->predictor_1) { in ccp_addci()
819 if (go->predictor_2) { in ccp_addci()
838 #if BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT in ccp_ackci()
842 #if MPPE_SUPPORT in ccp_ackci()
843 if (go->mppe) { in ccp_ackci()
849 if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE)) in ccp_ackci()
854 if (len == 0) in ccp_ackci()
858 #if DEFLATE_SUPPORT in ccp_ackci()
859 if (go->deflate) { in ccp_ackci()
860 if (len < CILEN_DEFLATE in ccp_ackci()
869 if (len == 0) in ccp_ackci()
871 if (go->deflate_correct && go->deflate_draft) { in ccp_ackci()
872 if (len < CILEN_DEFLATE in ccp_ackci()
883 #if BSDCOMPRESS_SUPPORT in ccp_ackci()
884 if (go->bsd_compress) { in ccp_ackci()
885 if (len < CILEN_BSD_COMPRESS in ccp_ackci()
892 if (p == p0 && len == 0) in ccp_ackci()
896 #if PREDICTOR_SUPPORT in ccp_ackci()
897 if (go->predictor_1) { in ccp_ackci()
898 if (len < CILEN_PREDICTOR_1 in ccp_ackci()
904 if (p == p0 && len == 0) in ccp_ackci()
907 if (go->predictor_2) { in ccp_ackci()
908 if (len < CILEN_PREDICTOR_2 in ccp_ackci()
914 if (p == p0 && len == 0) in ccp_ackci()
919 if (len != 0) in ccp_ackci()
934 #if !MPPE_SUPPORT && !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT in ccp_nakci()
942 #if MPPE_SUPPORT in ccp_nakci()
943 if (go->mppe && len >= CILEN_MPPE in ccp_nakci()
948 * Fail if we aren't willing to use his suggestion. in ccp_nakci()
951 if ((try_.mppe & MPPE_OPT_STATEFUL) && pcb->settings.refuse_mppe_stateful) { in ccp_nakci()
954 } else if (((go->mppe | MPPE_OPT_STATEFUL) & try_.mppe) != try_.mppe) { in ccp_nakci()
959 if (!try_.mppe) { in ccp_nakci()
965 #if DEFLATE_SUPPORT in ccp_nakci()
966 if (go->deflate && len >= CILEN_DEFLATE in ccp_nakci()
972 * Stop asking for Deflate if we don't understand his suggestion. in ccp_nakci()
974 if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL in ccp_nakci()
978 else if (DEFLATE_SIZE(p[2]) < go->deflate_size) in ccp_nakci()
982 if (go->deflate_correct && go->deflate_draft in ccp_nakci()
990 #if BSDCOMPRESS_SUPPORT in ccp_nakci()
991 if (go->bsd_compress && len >= CILEN_BSD_COMPRESS in ccp_nakci()
998 if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) in ccp_nakci()
1000 else if (BSD_NBITS(p[2]) < go->bsd_bits) in ccp_nakci()
1013 if (f->state != PPP_FSM_OPENED) in ccp_nakci()
1032 if (len == 0 && pcb->ccp_all_rejected) in ccp_rejci()
1035 #if MPPE_SUPPORT in ccp_rejci()
1036 if (go->mppe && len >= CILEN_MPPE in ccp_rejci()
1044 #if DEFLATE_SUPPORT in ccp_rejci()
1045 if (go->deflate_correct && len >= CILEN_DEFLATE in ccp_rejci()
1047 if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) in ccp_rejci()
1054 if (go->deflate_draft && len >= CILEN_DEFLATE in ccp_rejci()
1056 if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) in ccp_rejci()
1063 if (!try_.deflate_correct && !try_.deflate_draft) in ccp_rejci()
1066 #if BSDCOMPRESS_SUPPORT in ccp_rejci()
1067 if (go->bsd_compress && len >= CILEN_BSD_COMPRESS in ccp_rejci()
1069 if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) in ccp_rejci()
1076 #if PREDICTOR_SUPPORT in ccp_rejci()
1077 if (go->predictor_1 && len >= CILEN_PREDICTOR_1 in ccp_rejci()
1083 if (go->predictor_2 && len >= CILEN_PREDICTOR_2 in ccp_rejci()
1091 if (len != 0) in ccp_rejci()
1094 if (f->state != PPP_FSM_OPENED) in ccp_rejci()
1110 #if DEFLATE_SUPPORT || BSDCOMPRESS_SUPPORT in ccp_reqci()
1116 #if MPPE_SUPPORT in ccp_reqci()
1130 if (len < 2 || p[1] < 2 || p[1] > len) { in ccp_reqci()
1140 #if MPPE_SUPPORT in ccp_reqci()
1142 if (!ao->mppe || clen != CILEN_MPPE) { in ccp_reqci()
1148 /* Nak if anything unsupported or unknown are set. */ in ccp_reqci()
1149 if (ho->mppe & MPPE_OPT_UNSUPPORTED) { in ccp_reqci()
1153 if (ho->mppe & MPPE_OPT_UNKNOWN) { in ccp_reqci()
1159 if (ho->mppe & MPPE_OPT_STATEFUL) { in ccp_reqci()
1163 * it if he can do it; stateful mode is bad over in ccp_reqci()
1166 if (pcb->settings.refuse_mppe_stateful) { in ccp_reqci()
1174 if ((ho->mppe & MPPE_OPT_128) in ccp_reqci()
1178 if (ao->mppe & MPPE_OPT_128) in ccp_reqci()
1180 else if (ao->mppe & MPPE_OPT_40) in ccp_reqci()
1186 } else if (ho->mppe & MPPE_OPT_128) { in ccp_reqci()
1187 if (!(ao->mppe & MPPE_OPT_128)) { in ccp_reqci()
1191 } else if (ho->mppe & MPPE_OPT_40) { in ccp_reqci()
1192 if (!(ao->mppe & MPPE_OPT_40)) { in ccp_reqci()
1207 if (newret == CONFACK) { in ccp_reqci()
1217 if (mtu) in ccp_reqci()
1231 #if DEFLATE_SUPPORT in ccp_reqci()
1234 if (!ao->deflate || clen != CILEN_DEFLATE in ccp_reqci()
1243 if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL in ccp_reqci()
1247 if (!dont_nak) { in ccp_reqci()
1257 * size they want. If the window is too big, reduce in ccp_reqci()
1261 if (p == p0) { in ccp_reqci()
1264 if (res > 0) in ccp_reqci()
1266 if (res < 0 || nb == DEFLATE_MIN_WORKS || dont_nak) { in ccp_reqci()
1278 #if BSDCOMPRESS_SUPPORT in ccp_reqci()
1280 if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { in ccp_reqci()
1287 if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION in ccp_reqci()
1290 if (!dont_nak) { in ccp_reqci()
1299 * size they want. If the code size is too big, reduce in ccp_reqci()
1303 if (p == p0) { in ccp_reqci()
1306 if (res > 0) in ccp_reqci()
1308 if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { in ccp_reqci()
1321 #if PREDICTOR_SUPPORT in ccp_reqci()
1323 if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { in ccp_reqci()
1329 if (p == p0 in ccp_reqci()
1336 if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { in ccp_reqci()
1342 if (p == p0 in ccp_reqci()
1354 if (newret == CONFNAK && dont_nak) in ccp_reqci()
1356 if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { in ccp_reqci()
1358 if (newret == CONFREJ && ret == CONFNAK) in ccp_reqci()
1361 if (p != retp) in ccp_reqci()
1370 if (ret != CONFACK) { in ccp_reqci()
1371 if (ret == CONFREJ && *lenp == retp - p0) in ccp_reqci()
1376 #if MPPE_SUPPORT in ccp_reqci()
1377 if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) { in ccp_reqci()
1390 #if !DEFLATE_SUPPORT && !BSDCOMPRESS_SUPPORT in method_name()
1394 if (!ccp_anycompress(opt)) in method_name()
1397 #if MPPE_SUPPORT in method_name()
1405 if (opt->mppe & MPPE_OPT_128) { in method_name()
1409 if (opt->mppe & MPPE_OPT_40) { in method_name()
1413 if (opt->mppe & MPPE_OPT_STATEFUL) in method_name()
1421 #if DEFLATE_SUPPORT in method_name()
1424 if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) in method_name()
1434 #if BSDCOMPRESS_SUPPORT in method_name()
1436 if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) in method_name()
1444 #if PREDICTOR_SUPPORT in method_name()
1466 if (ccp_anycompress(go)) { in ccp_up()
1467 if (ccp_anycompress(ho)) { in ccp_up()
1468 if (go->method == ho->method) { in ccp_up()
1477 } else if (ccp_anycompress(ho)) in ccp_up()
1479 #if MPPE_SUPPORT in ccp_up()
1480 if (go->mppe) { in ccp_up()
1491 #if MPPE_SUPPORT in ccp_down()
1495 if (pcb->ccp_localstate & RACK_PENDING) in ccp_down()
1499 #if MPPE_SUPPORT in ccp_down()
1500 if (go->mppe) { in ccp_down()
1502 if (pcb->lcp_fsm.state == PPP_FSM_OPENED) { in ccp_down()
1503 /* If LCP is not already going down, make sure it does. */ in ccp_down()
1511 #if PRINTPKT_SUPPORT
1528 if (plen < HEADERLEN) in ccp_printpkt()
1533 if (len < HEADERLEN || len > plen) in ccp_printpkt()
1536 if (code >= 1 && code <= (int)LWIP_ARRAYSIZE(ccp_codenames) && ccp_codenames[code-1] != NULL) in ccp_printpkt()
1553 if (optlen < 2 || optlen > len) in ccp_printpkt()
1559 #if MPPE_SUPPORT in ccp_printpkt()
1561 if (optlen >= CILEN_MPPE) { in ccp_printpkt()
1573 if (mppe_opts & MPPE_OPT_UNKNOWN) in ccp_printpkt()
1580 #if DEFLATE_SUPPORT in ccp_printpkt()
1583 if (optlen >= CILEN_DEFLATE) { in ccp_printpkt()
1587 if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) in ccp_printpkt()
1589 if (p[3] != DEFLATE_CHK_SEQUENCE) in ccp_printpkt()
1595 #if BSDCOMPRESS_SUPPORT in ccp_printpkt()
1597 if (optlen >= CILEN_BSD_COMPRESS) { in ccp_printpkt()
1604 #if PREDICTOR_SUPPORT in ccp_printpkt()
1606 if (optlen >= CILEN_PREDICTOR_1) { in ccp_printpkt()
1612 if (optlen >= CILEN_PREDICTOR_2) { in ccp_printpkt()
1629 if (len > 0 && *p >= ' ' && *p < 0x7f) { in ccp_printpkt()
1647 #if PPP_DATAINPUT
1657 * decompression; if it was, we take CCP down, thus disabling
1662 #if MPPE_SUPPORT in ccp_datainput()
1669 if (f->state == PPP_FSM_OPENED) { in ccp_datainput()
1670 if (ccp_fatal_error(pcb)) { in ccp_datainput()
1676 #if MPPE_SUPPORT in ccp_datainput()
1678 * If we were doing MPPE, we must also take the link down. in ccp_datainput()
1680 if (go->mppe) { in ccp_datainput()
1688 * We don't do that if we are still waiting for an in ccp_datainput()
1691 if (!(pcb->ccp_localstate & RACK_PENDING)) { in ccp_datainput()
1709 if (f->state != PPP_FSM_OPENED) in ccp_resetrequest()
1714 * We don't do that if we are still waiting for an in ccp_resetrequest()
1717 if (!(pcb->ccp_localstate & RACK_PENDING)) { in ccp_resetrequest()
1732 if (f->state == PPP_FSM_OPENED && (pcb->ccp_localstate & RREQ_REPEAT)) { in ccp_rack_timeout()