Lines Matching refs:unit
87 static void ccp_init __P((int unit));
88 static void ccp_open __P((int unit));
89 static void ccp_close __P((int unit, char *));
90 static void ccp_lowerup __P((int unit));
92 static void ccp_input __P((int unit, u_char *pkt, int len));
93 static void ccp_protrej __P((int unit));
97 static void ccp_datainput __P((int unit, u_char *pkt, int len));
302 ccp_init(unit) in ccp_init() argument
303 int unit; in ccp_init()
305 fsm *f = &ccp_fsm[unit];
307 f->unit = unit;
313 BZERO(&ccp_wantoptions[unit], sizeof(ccp_options));
314 BZERO(&ccp_gotoptions[unit], sizeof(ccp_options));
315 BZERO(&ccp_allowoptions[unit], sizeof(ccp_options));
316 BZERO(&ccp_hisoptions[unit], sizeof(ccp_options));
339 ccp_open(unit) in ccp_open() argument
340 int unit; in ccp_open()
342 fsm *f = &ccp_fsm[unit];
350 ccp_flags_set(unit, 1, 0);
357 if (!ANY_COMPRESS(ccp_gotoptions[unit]))
367 ccp_close(unit, reason) in ccp_close() argument
368 int unit; in ccp_close()
371 ccp_flags_set(unit, 0, 0);
372 fsm_close(&ccp_fsm[unit], reason);
379 ccp_lowerup(unit) in ccp_lowerup() argument
380 int unit; in ccp_lowerup()
382 fsm_lowerup(&ccp_fsm[unit]);
389 ccp_lowerdown(unit) in ccp_lowerdown() argument
390 int unit; in ccp_lowerdown()
392 fsm_lowerdown(&ccp_fsm[unit]);
399 ccp_input(unit, p, len) in ccp_input() argument
400 int unit; in ccp_input()
404 fsm *f = &ccp_fsm[unit];
420 && !ANY_COMPRESS(ccp_gotoptions[unit]))
421 ccp_close(unit, "No compression negotiated");
449 ccp_localstate[f->unit] &= ~RREQ_IGNORED & ~RREQ_REJECTED;
450 if ((ccp_localstate[f->unit] & RACK_PENDING) && id == f->reqid) {
451 ccp_localstate[f->unit] &= ~RACK_PENDING & ~RREQ_REPEAT;
478 if (!(ccp_localstate[f->unit] & RREQ_REJECTED)) {
481 ccp_open(f->unit);
483 ccp_localstate[f->unit] |= RREQ_REJECTED;
492 ccp_localstate[f->unit] |= RACK_REJECTED;
511 ccp_protrej(unit) in ccp_protrej() argument
512 int unit; in ccp_protrej()
515 ccp_flags_set(unit, 0, 0);
516 fsm_lowerdown(&ccp_fsm[unit]);
526 ccp_options *go = &ccp_gotoptions[f->unit];
529 *go = ccp_wantoptions[f->unit];
530 all_rejected[f->unit] = 0;
540 if (ccp_test(f->unit, opt_buf, CILEN_BSD_COMPRESS, 0) <= 0)
549 if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0)
557 if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0)
566 if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_1, 0) <= 0)
572 if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_2, 0) <= 0)
584 ccp_options *go = &ccp_gotoptions[f->unit];
603 ccp_options *go = &ccp_gotoptions[f->unit];
617 res = ccp_test(f->unit, p, CILEN_DEFLATE, 0);
646 res = ccp_test(f->unit, p, CILEN_BSD_COMPRESS, 0);
667 if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_1, 0) <= 0) {
676 if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_2, 0) <= 0) {
698 ccp_options *go = &ccp_gotoptions[f->unit];
773 ccp_options *go = &ccp_gotoptions[f->unit];
858 ccp_options *go = &ccp_gotoptions[f->unit];
867 if (len == 0 && all_rejected[f->unit])
936 ccp_options *ho = &ccp_hisoptions[f->unit];
937 ccp_options *ao = &ccp_allowoptions[f->unit];
1000 res = ccp_test(f->unit, pv, CILEN_DEFLATE, 1);
1019 ccp_tune(f->unit, deflate_tune);
1057 res = ccp_test(f->unit, pv, CILEN_BSD_COMPRESS, 1);
1092 ccp_test(f->unit, pv, CILEN_PREDICTOR_1, 1) <= 0) {
1113 ccp_test(f->unit, p, CILEN_PREDICTOR_2, 1) <= 0) {
1218 ccp_options *go = &ccp_gotoptions[f->unit];
1219 ccp_options *ho = &ccp_hisoptions[f->unit];
1225 ccp_flags_set(f->unit, 1, 1);
1248 if (ccp_localstate[f->unit] & RACK_PENDING)
1251 ccp_localstate[f->unit] &= ~RACK_PENDING & ~RREQ_REPEAT;
1253 ccp_flags_set(f->unit, 1, 0);
1439 ccp_datainput(unit, pkt, len) in ccp_datainput() argument
1440 int unit; in ccp_datainput()
1446 f = &ccp_fsm[unit];
1448 if (ccp_fatal_error(unit)) {
1453 ccp_close(unit, "Lost compression sync");
1465 if (ccp_localstate[f->unit] & RREQ_REJECTED) {
1467 ccp_open(f->unit);
1468 } else if (ccp_localstate[f->unit] & RACK_PENDING) {
1470 ccp_localstate[f->unit] |= RREQ_REPEAT;
1475 ccp_localstate[f->unit] |= RACK_PENDING;
1491 ccp_localstate[f->unit] &= ~RACK_PENDING;
1497 if (ccp_localstate[f->unit] & RREQ_IGNORED) {
1499 ccp_localstate[f->unit] =
1500 (ccp_localstate[f->unit] & ~RREQ_IGNORED) | RREQ_REJECTED;
1501 ccp_open(f->unit);
1502 } else if (ccp_localstate[f->unit] & RREQ_REPEAT) {
1506 ccp_localstate[f->unit] =
1507 (ccp_localstate[f->unit] & ~RREQ_REPEAT) | RREQ_IGNORED |
1511 ccp_localstate[f->unit] |= RREQ_IGNORED;