Lines Matching defs:f
242 fsm *f = &lcp_fsm[unit];
246 f->unit = unit;
247 f->protocol = PPP_LCP;
248 f->callbacks = &lcp_callbacks;
250 fsm_init(f);
307 fsm *f = &lcp_fsm[unit];
310 f->flags = 0;
312 f->flags |= OPT_PASSIVE;
315 f->flags |= OPT_SILENT;
317 fsm_open(f);
329 fsm *f = &lcp_fsm[unit];
334 if (f->state == LS_STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT)) {
341 f->state = LS_CLOSED;
342 lcp_finished(f);
344 fsm_close(f, reason);
397 fsm *f = &lcp_fsm[unit];
399 fsm_input(f, p, len);
407 lcp_extcode(fsm *f, int code, u_char id, u_char *inp, int len)
413 lcp_rprotrej(f, inp, len);
417 if (f->state != LS_OPENED) {
422 PUTLONG(lcp_gotoptions[f->unit].magicnumber, magp);
423 fsm_sdata(f, ECHOREP, id, inp, len);
427 lcp_received_echo_reply(f, id, inp, len);
446 lcp_rprotrej(fsm *f, u_char *inp, int len)
465 if( f->state != LS_OPENED ) {
466 LCPDEBUG(LOG_INFO, ("Protocol-Reject discarded: LCP in state %d\n", f->state));
475 (*protp->protrej)(f->unit);
518 lcp_resetci(fsm *f)
520 lcp_wantoptions[f->unit].magicnumber = magic();
521 lcp_wantoptions[f->unit].numloops = 0;
522 lcp_gotoptions[f->unit] = lcp_wantoptions[f->unit];
523 peer_mru[f->unit] = PPP_MRU;
524 auth_reset(f->unit);
532 lcp_cilen(fsm *f)
534 lcp_options *go = &lcp_gotoptions[f->unit];
562 lcp_addci(fsm *f, u_char *ucp, int *lenp)
564 lcp_options *go = &lcp_gotoptions[f->unit];
637 lcp_ackci(fsm *f, u_char *p, int len)
639 lcp_options *go = &lcp_gotoptions[f->unit];
759 lcp_nakci(fsm *f, u_char *p, int len)
761 lcp_options *go = &lcp_gotoptions[f->unit];
762 lcp_options *wo = &lcp_wantoptions[f->unit];
1049 if (f->state != LS_OPENED) {
1053 lcp_close(f->unit, "Loopback detected");
1079 lcp_rejci(fsm *f, u_char *p, int len)
1081 lcp_options *go = &lcp_gotoptions[f->unit];
1204 if (f->state != LS_OPENED) {
1223 lcp_reqci(fsm *f,
1228 lcp_options *go = &lcp_gotoptions[f->unit];
1229 lcp_options *ho = &lcp_hisoptions[f->unit];
1230 lcp_options *ao = &lcp_allowoptions[f->unit];
1640 lcp_up(fsm *f)
1642 lcp_options *wo = &lcp_wantoptions[f->unit];
1643 lcp_options *ho = &lcp_hisoptions[f->unit];
1644 lcp_options *go = &lcp_gotoptions[f->unit];
1645 lcp_options *ao = &lcp_allowoptions[f->unit];
1660 ppp_send_config(f->unit, LWIP_MIN(ao->mru, (ho->neg_mru? ho->mru: PPP_MRU)),
1668 ppp_recv_config(f->unit, (go->neg_mru? LWIP_MAX(wo->mru, go->mru): PPP_MRU),
1673 peer_mru[f->unit] = ho->mru;
1676 lcp_echo_lowerup(f->unit); /* Enable echo messages */
1678 link_established(f->unit); /* The link is up; authenticate now */
1688 lcp_down(fsm *f)
1690 lcp_options *go = &lcp_gotoptions[f->unit];
1692 lcp_echo_lowerdown(f->unit);
1694 link_down(f->unit);
1696 ppp_send_config(f->unit, PPP_MRU, 0xffffffffl, 0, 0);
1697 ppp_recv_config(f->unit, PPP_MRU,
1700 peer_mru[f->unit] = PPP_MRU;
1708 lcp_starting(fsm *f)
1710 link_required(f->unit); /* lwip: currently does nothing */
1718 lcp_finished(fsm *f)
1720 link_terminated(f->unit); /* we are finished with the link */
1937 LcpLinkFailure (fsm *f)
1939 if (f->state == LS_OPENED) {
1942 lcp_close(f->unit, "Peer not responding");
1950 LcpEchoCheck (fsm *f)
1952 LcpSendEchoRequest (f);
1959 TIMEOUT (LcpEchoTimeout, f, lcp_echo_interval);
1979 lcp_received_echo_reply (fsm *f, int id, u_char *inp, int len)
1991 if (lcp_gotoptions[f->unit].neg_magicnumber && magic == lcp_gotoptions[f->unit].magicnumber) {
2004 LcpSendEchoRequest (fsm *f)
2014 LcpLinkFailure(f);
2022 if (f->state == LS_OPENED) {
2023 lcp_magic = lcp_gotoptions[f->unit].magicnumber;
2026 fsm_sdata(f, ECHOREQ, (u_char)(lcp_echo_number++ & 0xFF), pkt, (int)(pktp - pkt));
2038 fsm *f = &lcp_fsm[unit];
2047 LcpEchoCheck (f);
2058 fsm *f = &lcp_fsm[unit];
2061 UNTIMEOUT (LcpEchoTimeout, f);