Lines Matching refs:f
274 static int lcp_coderej __P((fsm *f, int code, int id, u_char *inp, int len));
503 fsm *f = &lcp_fsm[unit];
507 f->unit = unit;
508 f->protocol = PPP_LCP;
509 f->callbacks = &lcp_callbacks;
511 fsm_init(f);
573 fsm *f = &lcp_fsm[unit];
576 f->flags = 0;
578 f->flags |= OPT_PASSIVE;
580 f->flags |= OPT_SILENT;
581 fsm_open(f);
593 fsm *f = &lcp_fsm[unit];
597 if (f->state == STOPPED && (f->flags & (OPT_PASSIVE|OPT_SILENT))) {
604 f->state = CLOSED;
605 lcp_finished(f);
666 fsm *f = &lcp_fsm[unit];
668 fsm_input(f, p, len);
676 lcp_extcode(f, code, id, inp, len)
677 fsm *f;
686 lcp_rprotrej(f, inp, len);
690 if (f->state != OPENED)
693 PUTLONG(lcp_gotoptions[f->unit].magicnumber, magp);
694 fsm_sdata(f, CODE_ECHOREP, id, inp, len);
698 if (!lcp_received_echo_reply(f, id, inp, len)) {
701 LcpLinkFailure(f);
715 lcp_received_identification(f, id, inp, len);
719 lcp_received_timeremain(f, id, inp, len);
734 lcp_rprotrej(f, inp, len)
735 fsm *f;
754 if( f->state != OPENED ){
756 fsm_state(f->state));
765 (*protp->protrej)(f->unit);
792 lcp_coderej(f, code, id, inp, len)
793 fsm *f;
808 UNTIMEOUT (LcpEchoTimeout, f);
842 lcp_resetci(f)
843 fsm *f;
845 lcp_options *wo = &lcp_wantoptions[f->unit];
846 lcp_options *go = &lcp_gotoptions[f->unit];
847 lcp_options *ao = &lcp_allowoptions[f->unit];
864 fsm_setpeermru(f->unit, PPP_MTU > absmax_mtu ? absmax_mtu : PPP_MTU);
865 auth_reset(f->unit);
873 lcp_cilen(f)
874 fsm *f;
876 lcp_options *go = &lcp_gotoptions[f->unit];
913 lcp_addci(f, ucp, lenp)
914 fsm *f;
918 lcp_options *go = &lcp_gotoptions[f->unit];
919 lcp_options *ho = &lcp_hisoptions[f->unit];
978 if (f->state == ACKSENT && go->neg_lqr && go->lqr_period == 0 &&
1011 lcp_ackci(f, p, len)
1012 fsm *f;
1016 lcp_options *go = &lcp_gotoptions[f->unit];
1018 lcp_options *ao = &lcp_allowoptions[f->unit];
1193 lcp_nakci(f, p, len)
1194 fsm *f;
1198 lcp_options *go = &lcp_gotoptions[f->unit];
1199 lcp_options *wo = &lcp_wantoptions[f->unit];
1579 if (f->state != OPENED) {
1589 lcp_close(f->unit, "Loopback detected");
1614 lcp_rejci(f, p, len)
1615 fsm *f;
1619 lcp_options *go = &lcp_gotoptions[f->unit];
1743 LcpSendIdentification(f);
1812 if (f->state != OPENED)
1831 lcp_reqci(f, p, lenp, dont_nak)
1832 fsm *f;
1837 lcp_options *wo = &lcp_wantoptions[f->unit];
1838 lcp_options *go = &lcp_gotoptions[f->unit];
1839 lcp_options *ho = &lcp_hisoptions[f->unit];
1840 lcp_options *ao = &lcp_allowoptions[f->unit];
1974 f->flags &= ~OPT_SILENT;
1976 fsm_lowerdown(f);
1977 fsm_lowerup(f);
2373 LcpSendIdentification(f);
2388 lcp_up(f)
2389 fsm *f;
2391 lcp_options *wo = &lcp_wantoptions[f->unit];
2392 lcp_options *ho = &lcp_hisoptions[f->unit];
2393 lcp_options *go = &lcp_gotoptions[f->unit];
2394 lcp_options *ao = &lcp_allowoptions[f->unit];
2413 ppp_send_config(f->unit, mtu,
2416 fsm_setpeermru(f->unit, mtu);
2420 ppp_recv_config(f->unit, mru,
2424 ppp_send_fcs(f->unit, ho->neg_fcs ? ho->fcs_type : FCSALT_16);
2425 ppp_recv_fcs(f->unit, go->neg_fcs ? go->fcs_type : FCSALT_16);
2428 ppp_send_muxoption(f->unit, ho->pppmux);
2429 ppp_recv_muxoption(f->unit, go->pppmux);
2432 lcp_echo_lowerup(f->unit); /* Enable echo messages */
2436 LcpSendIdentification(f);
2440 link_established(f->unit);
2450 lcp_down(f)
2451 fsm *f;
2454 lcp_options *go = &lcp_gotoptions[f->unit];
2456 lcp_echo_lowerdown(f->unit);
2458 link_down(f->unit);
2461 ppp_send_config(f->unit, mtu, 0xffffffff, 0, 0);
2462 ppp_recv_config(f->unit, (PPP_MRU > absmax_mru ? absmax_mru : PPP_MRU),
2466 ppp_send_fcs(f->unit, FCSALT_16);
2467 ppp_recv_fcs(f->unit, FCSALT_16);
2469 fsm_setpeermru(f->unit, mtu);
2477 lcp_starting(f)
2478 fsm *f;
2480 link_required(f->unit);
2488 lcp_finished(f)
2489 fsm *f;
2491 link_terminated(f->unit);
2846 LcpLinkFailure (f)
2847 fsm *f;
2851 if (f->state == OPENED) {
2870 lcp_close(f->unit, close_message);
2880 LcpEchoCheck (f)
2881 fsm *f;
2883 if (f->state != OPENED || lcp_echo_interval == 0)
2886 LcpSendEchoRequest (f);
2893 TIMEOUT (LcpEchoTimeout, f, lcp_echo_interval);
2916 lcp_received_echo_reply (f, id, inp, len)
2917 fsm *f;
2930 if (lcp_gotoptions[f->unit].neg_magicnumber &&
2931 magic == lcp_gotoptions[f->unit].magicnumber) {
2953 LcpSendEchoRequest (f)
2954 fsm *f;
2972 LcpLinkFailure(f);
2980 if (f->state == OPENED) {
2981 lcp_magic = lcp_gotoptions[f->unit].magicnumber;
2999 fsm_sdata(f, CODE_ECHOREQ, lcp_echo_number++ & 0xFF, pkt, pktp - pkt);
3012 fsm *f = &lcp_fsm[unit];
3021 LcpEchoCheck(f);
3032 fsm *f = &lcp_fsm[unit];
3035 UNTIMEOUT (LcpEchoTimeout, f);
3045 LcpSendIdentification (f)
3046 fsm *f;
3055 if (f->state == OPENED)
3056 lcp_magic = lcp_gotoptions[f->unit].magicnumber;
3065 fsm_sdata(f, CODE_IDENT, ++f->id, pkt, pktp - pkt);
3070 lcp_received_identification (f, id, inp, len)
3071 fsm *f;
3085 if (lcp_gotoptions[f->unit].neg_magicnumber && f->state == OPENED &&
3086 magic == lcp_gotoptions[f->unit].magicnumber) {
3098 LcpSendTimeRemaining(f, time_remaining)
3099 fsm *f;
3106 if (f->state != OPENED)
3109 lcp_magic = lcp_gotoptions[f->unit].magicnumber;
3113 fsm_sdata(f, CODE_TIMEREMAIN, ++f->id, pkt, pktp - pkt);
3118 lcp_received_timeremain(f, id, inp, len)
3119 fsm *f;
3133 if (lcp_gotoptions[f->unit].neg_magicnumber && f->state == OPENED &&
3134 magic == lcp_gotoptions[f->unit].magicnumber) {