Lines Matching refs:len
57 static void cbcp_input __P((int unit, u_char *pkt, int len));
59 static int cbcp_printpkt __P((u_char *pkt, int len,
88 static void cbcp_recvreq __P((cbcp_state *us, u_char *pckt, int len));
89 static void cbcp_recvack __P((cbcp_state *us, u_char *pckt, int len));
90 static void cbcp_send __P((cbcp_state *us, int code, u_char *buf, int len));
146 u_short len; local
159 GETSHORT(len, inp);
161 if (len > pktlen) {
162 error("CBCP packet: invalid length (%d > %d)", len, pktlen);
166 len -= CBCP_MINLEN;
171 cbcp_recvreq(us, inp, len);
187 cbcp_recvack(us, inp, len);
228 int code, id, len, olen, alen; local
238 GETSHORT(len, p);
247 if (len < HEADERLEN) {
248 printer(arg, " header length %d<%d", len, HEADERLEN);
251 if (len > plen) {
252 printer(arg, " truncated (%d>%d)", len, plen);
253 len = plen;
255 len -= HEADERLEN;
261 while (len >= 2) {
270 if (olen > len) {
271 printer(arg, "trunc[%d>%d] ", olen, len);
272 olen = len;
274 len -= olen;
308 if (len > 0) {
309 if (len > 8)
312 printer(arg, "%.*B", len, p);
314 p += len;
331 int len = pcktlen; local
337 while (len > 0) {
345 len -= opt_len;
383 len = 0;
390 len = 3 + 1 + strlen(us->us_number) + 1;
391 PUTCHAR(len , bufp);
395 cbcp_send(us, CBCP_RESP, buf, len);
403 len = 3;
404 PUTCHAR(len, bufp);
406 cbcp_send(us, CBCP_RESP, buf, len);
414 len = 3;
415 PUTCHAR(len , bufp);
417 cbcp_send(us, CBCP_RESP, buf, len);
428 cbcp_send(us, code, buf, len) in cbcp_send() argument
432 int len;
439 outlen = 4 + len;
447 if (len > 0)
448 BCOPY(buf, outp, len);
457 cbcp_recvack(us, pckt, len) in cbcp_recvack() argument
460 int len;
465 if (len > 0) {