• Home
  • Raw
  • Download

Lines Matching refs:unit

167 static void ccp_init __P((int unit));
168 static void ccp_open __P((int unit));
169 static void ccp_close __P((int unit, char *));
170 static void ccp_lowerup __P((int unit));
172 static void ccp_input __P((int unit, u_char *pkt, int len));
173 static void ccp_protrej __P((int unit));
177 static void ccp_datainput __P((int unit, u_char *pkt, int len));
351 ccp_init(unit) in ccp_init() argument
352 int unit; in ccp_init()
354 fsm *f = &ccp_fsm[unit];
356 f->unit = unit;
361 memset(&ccp_wantoptions[unit], 0, sizeof(ccp_options));
362 memset(&ccp_gotoptions[unit], 0, sizeof(ccp_options));
363 memset(&ccp_allowoptions[unit], 0, sizeof(ccp_options));
364 memset(&ccp_hisoptions[unit], 0, sizeof(ccp_options));
387 ccp_open(unit) in ccp_open() argument
388 int unit; in ccp_open()
390 fsm *f = &ccp_fsm[unit];
393 ccp_flags_set(unit, 1, 0);
400 if (!ANY_COMPRESS(ccp_gotoptions[unit]))
410 ccp_close(unit, reason) in ccp_close() argument
411 int unit; in ccp_close()
414 ccp_flags_set(unit, 0, 0);
415 fsm_close(&ccp_fsm[unit], reason);
422 ccp_lowerup(unit) in ccp_lowerup() argument
423 int unit; in ccp_lowerup()
425 fsm_lowerup(&ccp_fsm[unit]);
432 ccp_lowerdown(unit) in ccp_lowerdown() argument
433 int unit; in ccp_lowerdown()
435 fsm_lowerdown(&ccp_fsm[unit]);
442 ccp_input(unit, p, len) in ccp_input() argument
443 int unit; in ccp_input()
447 fsm *f = &ccp_fsm[unit];
458 if (ccp_gotoptions[unit].mppe) {
460 lcp_close(unit, "MPPE disabled by peer");
470 && !ANY_COMPRESS(ccp_gotoptions[unit]))
471 ccp_close(unit, "No compression negotiated");
494 if (ccp_localstate[f->unit] & RACK_PENDING && id == f->reqid) {
495 ccp_localstate[f->unit] &= ~(RACK_PENDING | RREQ_REPEAT);
511 ccp_protrej(unit) in ccp_protrej() argument
512 int unit; in ccp_protrej()
514 ccp_flags_set(unit, 0, 0);
515 fsm_lowerdown(&ccp_fsm[unit]);
518 if (ccp_gotoptions[unit].mppe) {
520 lcp_close(unit, "MPPE required but peer negotiation failed");
533 ccp_options *go = &ccp_gotoptions[f->unit];
536 *go = ccp_wantoptions[f->unit];
537 all_rejected[f->unit] = 0;
541 ccp_options *ao = &ccp_allowoptions[f->unit];
542 int auth_mschap_bits = auth_done[f->unit];
567 lcp_close(f->unit, "MPPE required but not available");
572 lcp_close(f->unit, "MPPE required but not available");
580 lcp_close(f->unit, "MPPE required but not available");
585 if (auth_done[f->unit] & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) {
590 ccp_wantoptions[f->unit].mppe &= ~MPPE_OPT_40;
598 lcp_close(f->unit, "MPPE required but not available");
622 if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0) {
624 lcp_close(f->unit, "MPPE required but not available");
632 if (ccp_test(f->unit, opt_buf, CILEN_BSD_COMPRESS, 0) <= 0)
641 if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0)
649 if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0)
658 if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_1, 0) <= 0)
664 if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_2, 0) <= 0)
676 ccp_options *go = &ccp_gotoptions[f->unit];
695 ccp_options *go = &ccp_gotoptions[f->unit];
712 res = ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0);
717 lcp_close(f->unit, "MPPE required but not available in kernel");
733 res = ccp_test(f->unit, p, CILEN_DEFLATE, 0);
765 res = ccp_test(f->unit, p, CILEN_BSD_COMPRESS, 0);
782 if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_1, 0) <= 0) {
791 if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_2, 0) <= 0) {
813 ccp_options *go = &ccp_gotoptions[f->unit];
903 ccp_options *go = &ccp_gotoptions[f->unit];
929 lcp_close(f->unit, "MPPE required but peer negotiation failed");
992 ccp_options *go = &ccp_gotoptions[f->unit];
1001 if (len == 0 && all_rejected[f->unit])
1008 lcp_close(f->unit, "MPPE required but peer refused");
1078 ccp_options *ho = &ccp_hisoptions[f->unit];
1079 ccp_options *ao = &ccp_allowoptions[f->unit];
1178 if (ccp_test(f->unit, opt_buf,
1182 lcp_close(f->unit, "MPPE required but not available");
1191 mtu = netif_get_mtu(f->unit);
1193 netif_set_mtu(f->unit, mtu - MPPE_PAD);
1237 res = ccp_test(f->unit, p, CILEN_DEFLATE, 1);
1278 res = ccp_test(f->unit, p, CILEN_BSD_COMPRESS, 1);
1302 && ccp_test(f->unit, p, CILEN_PREDICTOR_1, 1) <= 0) {
1315 && ccp_test(f->unit, p, CILEN_PREDICTOR_2, 1) <= 0) {
1343 all_rejected[f->unit] = 1;
1350 lcp_close(f->unit, "MPPE required but peer negotiation failed");
1428 ccp_options *go = &ccp_gotoptions[f->unit];
1429 ccp_options *ho = &ccp_hisoptions[f->unit];
1432 ccp_flags_set(f->unit, 1, 1);
1450 continue_networks(f->unit); /* Bring up IP et al */
1462 if (ccp_localstate[f->unit] & RACK_PENDING)
1464 ccp_localstate[f->unit] = 0;
1465 ccp_flags_set(f->unit, 1, 0);
1467 if (ccp_gotoptions[f->unit].mppe) {
1468 ccp_gotoptions[f->unit].mppe = 0;
1469 if (lcp_fsm[f->unit].state == OPENED) {
1472 lcp_close(f->unit, "MPPE disabled");
1622 ccp_datainput(unit, pkt, len) in ccp_datainput() argument
1623 int unit; in ccp_datainput()
1629 f = &ccp_fsm[unit];
1631 if (ccp_fatal_error(unit)) {
1636 ccp_close(unit, "Lost compression sync");
1641 if (ccp_gotoptions[unit].mppe) {
1643 lcp_close(unit, "Too many MPPE errors");
1652 if (!(ccp_localstate[f->unit] & RACK_PENDING)) {
1655 ccp_localstate[f->unit] |= RACK_PENDING;
1657 ccp_localstate[f->unit] |= RREQ_REPEAT;
1671 if (f->state == OPENED && ccp_localstate[f->unit] & RREQ_REPEAT) {
1674 ccp_localstate[f->unit] &= ~RREQ_REPEAT;
1676 ccp_localstate[f->unit] &= ~RACK_PENDING;