Пример #1
0
/** This function is called on authentication succeed */
void
ppp_auth_ok(npppd_ppp *_this)
{
	if (npppd_ppp_bind_iface(_this->pppd, _this) != 0) {
		ppp_log(_this, LOG_WARNING, "No interface binding.");
		ppp_stop(_this, NULL);

		return;
	}
	if (_this->realm != NULL) {
		npppd_ppp_get_username_for_auth(_this->pppd, _this,
		    _this->username, _this->username);
		if (!npppd_check_calling_number(_this->pppd, _this)) {
			ppp_log(_this, LOG_ALERT,
			    "logtype=TUNNELDENY user=\"%s\" "
			    "reason=\"Calling number check is failed\"",
			    _this->username);
			    /* XXX */
			ppp_stop(_this, NULL);
			return;
		}
	}
	if (_this->peer_auth != 0) {
		/* Limit the number of connections per the user */
		if (!npppd_check_user_max_session(_this->pppd, _this)) {
			ppp_log(_this, LOG_WARNING,
			    "user %s exceeds user-max-session limit",
			    _this->username);
			ppp_stop(_this, NULL);

			return;
		}
		PPP_ASSERT(_this->realm != NULL);
	}

	if (!npppd_ppp_iface_is_ready(_this->pppd, _this)) {
		ppp_log(_this, LOG_WARNING,
		    "interface '%s' is not ready.",
		    npppd_ppp_get_iface_name(_this->pppd, _this));
		ppp_stop(_this, NULL);

		return;
	}
	if (_this->proxy_authen_resp != NULL) {
		free(_this->proxy_authen_resp);
		_this->proxy_authen_resp = NULL;
	}

	fsm_lowerup(&_this->ipcp.fsm);
	fsm_open(&_this->ipcp.fsm);
#ifdef	USE_NPPPD_MPPE
	if (MPPE_MUST_NEGO(_this)) {
		fsm_lowerup(&_this->ccp.fsm);
		fsm_open(&_this->ccp.fsm);
	}
#endif

	return;
}
Пример #2
0
Файл: lcp.c Проект: AoLaD/rtems
/*
 * lcp_open - LCP is allowed to come up.
 */
void
lcp_open(
    int unit)
{
    fsm *f = &lcp_fsm[unit];
    lcp_options *wo = &lcp_wantoptions[unit];

    f->flags = 0;
    if (wo->passive)
	f->flags |= OPT_PASSIVE;
    if (wo->silent)
	f->flags |= OPT_SILENT;
    fsm_open(f);
}
Пример #3
0
Файл: ccp.c Проект: rtemss/rtems
/*
 * ccp_open - CCP is allowed to come up.
 */
static void
ccp_open(
    int unit)
{
    fsm *f = &ccp_fsm[unit];

    if (f->state != OPENED)
        ccp_flags_set(unit, 1, 0);

    /*
     * Find out which compressors the kernel supports before
     * deciding whether to open in silent mode.
     */
    ccp_resetci(f);
    if (!ANY_COMPRESS(ccp_gotoptions[unit]))
        f->flags |= OPT_SILENT;

    fsm_open(f);
}
Пример #4
0
/*
 * ccp_open - CCP is allowed to come up.
 */
void
ccp_open(PPP_IF_VAR_T *pPppIf)
{
	diag_printf("\n<ccp_open>\n");
    fsm *f = &pPppIf->ccp_fsm;

    if (f->state != OPENED)
		ccp_flags_set(&pPppIf->pSc->sc_flags,1, 0);

    /*
     * Find out which compressors the kernel supports before
     * deciding whether to open in silent mode.
     */
    ccp_resetci(f);
    if (!ANY_COMPRESS(f->pPppIf->ccp_gotoptions))
	f->flags |= OPT_SILENT;

	{ //Added by Eddy
		int ipmode = 0;
		CFG_get(CFG_WAN_IP_MODE, &ipmode);
		if (ipmode == PPPOEMODE)
			f->flags |= OPT_SILENT;
	#ifdef	CONFIG_PPTP_PPPOE	
	  //Added by Haitao
	  	int pptp_wanif = 0;
	    CFG_get(CFG_PTP_WANIF, &pptp_wanif);
	    if(ipmode == PPTPMODE && pptp_wanif == 2 && !strcmp(pPppIf->pppname,"ppp0"))//for pptp over pppoe use ppp
			f->flags |= OPT_SILENT;
	#endif	
	#ifdef	CONFIG_L2TP_OVER_PPPOE	
	  int l2tp_wanif = 0;
	  CFG_get(CFG_L2T_WANIF, &l2tp_wanif);
	  if((ipmode == L2TPMODE) && (l2tp_wanif == 2) && (!strcmp(pPppIf->pppname,"ppp0")))//for l2tp over pppoe use ppp
	    f->flags |= OPT_SILENT;
	#endif	
	}

    fsm_open(f);
}
Пример #5
0
/*
 * ipcp_open - IPCP is allowed to come up.
 */
static void
ipcp_open(
    int unit)
{
    fsm_open(&ipcp_fsm[unit]);
}
Пример #6
0
/*
 * acscp_open - acscp is allowed to come up.
 */
static void
acscp_open(int unit)
{
    fsm_open(&acscp_fsm[unit]);
    acscp_is_open = 1;
}
Пример #7
0
/**
 * This function is called when HDLC as LCP's lower layer is up.
 */
void
lcp_lowerup(lcp *_this)
{
	fsm_lowerup(&_this->fsm);
	fsm_open(&_this->fsm);
}
Пример #8
0
static void
ccp_open (void)
{
	fsm_open(&ccp_fsm);
	}