Lines Matching defs:ppp

536 		/* XXX : TODO: should it counts lost packets  ppp->ierrors
537 * and update ppp->ierrors counter? */
650 /* notify to ppp that the PPTP physical layer is already downed */
654 if (_this->ppp != NULL)
655 ppp_phy_downed(_this->ppp);
659 /* input packet to ppp */
664 npppd_ppp *ppp;
666 ppp = _this->ppp;
667 if (ppp == NULL) {
669 "Received ppp frame but ppp is not assigned yet");
672 rval = ppp->recv_packet(ppp, pkt, pktlen, delayed ? PPP_IO_FLAGS_DELAYED : 0);
673 if (_this->ppp == NULL) /* ppp is freed */
677 ppp->ierrors++;
679 ppp->ipackets++;
680 ppp->ibytes += pktlen;
684 /* it called when ppp outputs packet */
686 pptp_call_ppp_output(npppd_ppp *ppp, unsigned char *bytes, int nbytes,
691 _this = ppp->phy_context;
698 ppp->oerrors++;
701 ppp->opackets++;
702 ppp->obytes += nbytes;
707 /* it called when pptp call was closed at ppp */
709 pptp_call_closed_by_ppp(npppd_ppp *ppp)
713 PPTP_CALL_ASSERT(ppp != NULL);
714 PPTP_CALL_ASSERT(ppp->phy_context != NULL);
716 _this = ppp->phy_context;
719 _this->ppp = NULL;
728 /* bind() for ppp */
732 npppd_ppp *ppp;
734 ppp = NULL;
735 if ((ppp = ppp_create()) == NULL)
738 PPTP_CALL_ASSERT(_this->ppp == NULL);
740 if (_this->ppp != NULL)
743 _this->ppp = ppp;
745 ppp->phy_context = _this;
746 ppp->tunnel_type = NPPPD_TUNNEL_PPTP;
747 ppp->tunnel_session_id = _this->id;
748 ppp->send_packet = pptp_call_ppp_output;
749 ppp->phy_close = pptp_call_closed_by_ppp;
751 strlcpy(ppp->phy_label, PPTP_CTRL_LISTENER_TUN_NAME(_this->ctrl),
752 sizeof(ppp->phy_label));
754 PPTP_CALL_ASSERT(sizeof(ppp->phy_info) >= _this->ctrl->peer.ss_len);
755 memcpy(&ppp->phy_info, &_this->ctrl->peer,
756 MINIMUM(sizeof(ppp->phy_info), _this->ctrl->peer.ss_len));
758 if (ppp_init(npppd_get_npppd(), ppp) != 0)
761 pptp_call_log(_this, LOG_NOTICE, "logtype=PPPBind ppp=%d", ppp->id);
762 ppp_start(ppp);
766 pptp_call_log(_this, LOG_ERR, "failed binding ppp");
768 if (ppp != NULL)
769 ppp_destroy(ppp);
770 _this->ppp = NULL;