Lines Matching defs:unit
91 static void ccp_init __P((int unit));
92 static void ccp_open __P((int unit));
93 static void ccp_close __P((int unit, char *));
94 static void ccp_lowerup __P((int unit));
96 static void ccp_input __P((int unit, u_char *pkt, int len));
97 static void ccp_protrej __P((int unit));
101 static void ccp_datainput __P((int unit, u_char *pkt, int len));
306 ccp_init(unit)
307 int unit;
309 fsm *f = &ccp_fsm[unit];
311 f->unit = unit;
317 BZERO(&ccp_wantoptions[unit], sizeof(ccp_options));
318 BZERO(&ccp_gotoptions[unit], sizeof(ccp_options));
319 BZERO(&ccp_allowoptions[unit], sizeof(ccp_options));
320 BZERO(&ccp_hisoptions[unit], sizeof(ccp_options));
343 ccp_open(unit)
344 int unit;
346 fsm *f = &ccp_fsm[unit];
354 ccp_flags_set(unit, 1, 0);
361 if (!ANY_COMPRESS(ccp_gotoptions[unit]))
371 ccp_close(unit, reason)
372 int unit;
375 ccp_flags_set(unit, 0, 0);
376 fsm_close(&ccp_fsm[unit], reason);
383 ccp_lowerup(unit)
384 int unit;
386 fsm_lowerup(&ccp_fsm[unit]);
393 ccp_lowerdown(unit)
394 int unit;
396 fsm_lowerdown(&ccp_fsm[unit]);
403 ccp_input(unit, p, len)
404 int unit;
408 fsm *f = &ccp_fsm[unit];
424 && !ANY_COMPRESS(ccp_gotoptions[unit]))
425 ccp_close(unit, "No compression negotiated");
453 ccp_localstate[f->unit] &= ~RREQ_IGNORED & ~RREQ_REJECTED;
454 if ((ccp_localstate[f->unit] & RACK_PENDING) && id == f->reqid) {
455 ccp_localstate[f->unit] &= ~RACK_PENDING & ~RREQ_REPEAT;
482 if (!(ccp_localstate[f->unit] & RREQ_REJECTED)) {
485 ccp_open(f->unit);
487 ccp_localstate[f->unit] |= RREQ_REJECTED;
496 ccp_localstate[f->unit] |= RACK_REJECTED;
515 ccp_protrej(unit)
516 int unit;
519 ccp_flags_set(unit, 0, 0);
520 fsm_lowerdown(&ccp_fsm[unit]);
530 ccp_options *go = &ccp_gotoptions[f->unit];
533 *go = ccp_wantoptions[f->unit];
534 all_rejected[f->unit] = 0;
544 if (ccp_test(f->unit, opt_buf, CILEN_BSD_COMPRESS, 0) <= 0)
553 if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0)
561 if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0)
570 if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_1, 0) <= 0)
576 if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_2, 0) <= 0)
588 ccp_options *go = &ccp_gotoptions[f->unit];
607 ccp_options *go = &ccp_gotoptions[f->unit];
621 res = ccp_test(f->unit, p, CILEN_DEFLATE, 0);
650 res = ccp_test(f->unit, p, CILEN_BSD_COMPRESS, 0);
671 if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_1, 0) <= 0) {
680 if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_2, 0) <= 0) {
702 ccp_options *go = &ccp_gotoptions[f->unit];
777 ccp_options *go = &ccp_gotoptions[f->unit];
862 ccp_options *go = &ccp_gotoptions[f->unit];
871 if (len == 0 && all_rejected[f->unit])
940 ccp_options *ho = &ccp_hisoptions[f->unit];
941 ccp_options *ao = &ccp_allowoptions[f->unit];
1004 res = ccp_test(f->unit, pv, CILEN_DEFLATE, 1);
1023 ccp_tune(f->unit, deflate_tune);
1061 res = ccp_test(f->unit, pv, CILEN_BSD_COMPRESS, 1);
1096 ccp_test(f->unit, pv, CILEN_PREDICTOR_1, 1) <= 0) {
1117 ccp_test(f->unit, p, CILEN_PREDICTOR_2, 1) <= 0) {
1222 ccp_options *go = &ccp_gotoptions[f->unit];
1223 ccp_options *ho = &ccp_hisoptions[f->unit];
1229 ccp_flags_set(f->unit, 1, 1);
1252 if (ccp_localstate[f->unit] & RACK_PENDING)
1255 ccp_localstate[f->unit] &= ~RACK_PENDING & ~RREQ_REPEAT;
1257 ccp_flags_set(f->unit, 1, 0);
1443 ccp_datainput(unit, pkt, len)
1444 int unit;
1450 f = &ccp_fsm[unit];
1452 if (ccp_fatal_error(unit)) {
1457 ccp_close(unit, "Lost compression sync");
1469 if (ccp_localstate[f->unit] & RREQ_REJECTED) {
1471 ccp_open(f->unit);
1472 } else if (ccp_localstate[f->unit] & RACK_PENDING) {
1474 ccp_localstate[f->unit] |= RREQ_REPEAT;
1479 ccp_localstate[f->unit] |= RACK_PENDING;
1495 ccp_localstate[f->unit] &= ~RACK_PENDING;
1501 if (ccp_localstate[f->unit] & RREQ_IGNORED) {
1503 ccp_localstate[f->unit] =
1504 (ccp_localstate[f->unit] & ~RREQ_IGNORED) | RREQ_REJECTED;
1505 ccp_open(f->unit);
1506 } else if (ccp_localstate[f->unit] & RREQ_REPEAT) {
1510 ccp_localstate[f->unit] =
1511 (ccp_localstate[f->unit] & ~RREQ_REPEAT) | RREQ_IGNORED |
1515 ccp_localstate[f->unit] |= RREQ_IGNORED;