Beispiel #1
0
/* Stop PPPoE session */
void
pppoe_session_stop(pppoe_session *_this)
{
	if (_this->state != PPPOE_SESSION_STATE_DISPOSING)
		pppoe_session_disconnect(_this);

}
Beispiel #2
0
/* stop PPPoE daemon */
void
pppoed_stop(pppoed *_this)
{
	pppoed_listener *plistener;
	hash_link *hl;
	pppoe_session *session;

	if (!pppoed_is_running(_this))
		return;

	_this->state = PPPOED_STATE_STOPPED;
	if (_this->session_hash != NULL) {
		for (hl = hash_first(_this->session_hash);
		    hl != NULL;
		    hl = hash_next(_this->session_hash)) {
			session = (pppoe_session *)hl->item;
			pppoe_session_disconnect(session);
			pppoe_session_stop(session);
		}
	}
	for (slist_itr_first(&_this->listener);
	    slist_itr_has_next(&_this->listener);) {
		plistener = slist_itr_next(&_this->listener);
		pppoed_listener_stop(plistener);
		free(plistener);
		slist_itr_remove(&_this->listener);
	}
	PPPOED_DBG((_this, LOG_DEBUG, "Stopped"));
}
Beispiel #3
0
static void
pppoe_session_close_by_ppp(npppd_ppp *ppp)
{
	pppoe_session *_this;

	_this = ppp->phy_context;
	PPPOE_SESSION_ASSERT(_this != NULL);
	if (_this != NULL)
		/* do this before pptp_call_disconnect() */
		_this->ppp = NULL;

	pppoe_session_disconnect(_this);
}