Lines Matching defs:unit
51 static void ccp_init(int unit);
52 static void ccp_open(int unit);
53 static void ccp_close(int unit, char *);
54 static void ccp_lowerup(int unit);
56 static void ccp_input(int unit, u_char *pkt, int len);
57 static void ccp_protrej(int unit);
60 static void ccp_datainput(int unit, u_char *pkt, int len);
141 ccp_init(int unit)
143 fsm *f = &ccp_fsm[unit];
145 f->unit = unit;
150 memset(&ccp_wantoptions[unit], 0, sizeof(ccp_options));
151 memset(&ccp_gotoptions[unit], 0, sizeof(ccp_options));
152 memset(&ccp_allowoptions[unit], 0, sizeof(ccp_options));
153 memset(&ccp_hisoptions[unit], 0, sizeof(ccp_options));
176 ccp_open(int unit)
178 fsm *f = &ccp_fsm[unit];
181 ccp_flags_set(unit, 1, 0);
188 if (!ANY_COMPRESS(ccp_gotoptions[unit]))
198 ccp_close(int unit, char *reason)
200 ccp_flags_set(unit, 0, 0);
201 fsm_close(&ccp_fsm[unit], reason);
208 ccp_lowerup(int unit)
210 fsm_lowerup(&ccp_fsm[unit]);
217 ccp_lowerdown(int unit)
219 fsm_lowerdown(&ccp_fsm[unit]);
226 ccp_input(int unit, u_char *p, int len)
228 fsm *f = &ccp_fsm[unit];
244 && !ANY_COMPRESS(ccp_gotoptions[unit]))
245 ccp_close(unit, "No compression negotiated");
264 if (ccp_localstate[f->unit] & RACK_PENDING && id == f->reqid) {
265 ccp_localstate[f->unit] &= ~(RACK_PENDING | RREQ_REPEAT);
281 ccp_protrej(int unit)
283 ccp_flags_set(unit, 0, 0);
284 fsm_lowerdown(&ccp_fsm[unit]);
293 ccp_options *go = &ccp_gotoptions[f->unit];
296 *go = ccp_wantoptions[f->unit];
297 all_rejected[f->unit] = 0;
307 if (ccp_test(f->unit, opt_buf, CILEN_BSD_COMPRESS, 0) <= 0)
316 if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0)
324 if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0)
333 if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_1, 0) <= 0)
339 if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_2, 0) <= 0)
350 ccp_options *go = &ccp_gotoptions[f->unit];
365 ccp_options *go = &ccp_gotoptions[f->unit];
379 res = ccp_test(f->unit, p, CILEN_DEFLATE, 0);
407 res = ccp_test(f->unit, p, CILEN_BSD_COMPRESS, 0);
425 if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_1, 0) <= 0) {
434 if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_2, 0) <= 0) {
453 ccp_options *go = &ccp_gotoptions[f->unit];
523 ccp_options *go = &ccp_gotoptions[f->unit];
589 ccp_options *go = &ccp_gotoptions[f->unit];
598 if (len == 0 && all_rejected[f->unit])
667 ccp_options *ho = &ccp_hisoptions[f->unit];
668 ccp_options *ao = &ccp_allowoptions[f->unit];
720 res = ccp_test(f->unit, p, CILEN_DEFLATE, 1);
761 res = ccp_test(f->unit, p, CILEN_BSD_COMPRESS, 1);
785 && ccp_test(f->unit, p, CILEN_PREDICTOR_1, 1) <= 0) {
798 && ccp_test(f->unit, p, CILEN_PREDICTOR_2, 1) <= 0) {
826 all_rejected[f->unit] = 1;
879 ccp_options *go = &ccp_gotoptions[f->unit];
880 ccp_options *ho = &ccp_hisoptions[f->unit];
883 ccp_flags_set(f->unit, 1, 1);
908 if (ccp_localstate[f->unit] & RACK_PENDING)
910 ccp_localstate[f->unit] = 0;
911 ccp_flags_set(f->unit, 1, 0);
1033 ccp_datainput(int unit, u_char *pkt, int len)
1037 f = &ccp_fsm[unit];
1039 if (ccp_fatal_error(unit)) {
1044 ccp_close(unit, "Lost compression sync");
1051 if (!(ccp_localstate[f->unit] & RACK_PENDING)) {
1054 ccp_localstate[f->unit] |= RACK_PENDING;
1056 ccp_localstate[f->unit] |= RREQ_REPEAT;
1069 if (f->state == OPENED && ccp_localstate[f->unit] & RREQ_REPEAT) {
1072 ccp_localstate[f->unit] &= ~RREQ_REPEAT;
1074 ccp_localstate[f->unit] &= ~RACK_PENDING;