• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NDBGL2函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中NDBGL2函数的典型用法代码示例。如果您正苦于以下问题:C++ NDBGL2函数的具体用法?C++ NDBGL2怎么用?C++ NDBGL2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NDBGL2函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: i4b_next_l2state

/*---------------------------------------------------------------------------*
 *	event handler, executes function and sets new state
 *---------------------------------------------------------------------------*/	
void i4b_next_l2state(l2_softc_t *l2sc, int event)
{
	int currstate, newstate;
	int (*savpostfsmfunc)(int) = NULL;

	/* check event number */
	if(event > N_EVENTS)
		panic("i4b_l2fsm.c: event > N_EVENTS\n");

	/* get current state and check it */
	if((currstate = l2sc->Q921_state) > N_STATES) 	/* failsafe */
		panic("i4b_l2fsm.c: currstate > N_STATES\n");	

	/* get new state and check it */
	if((newstate = l2state_tab[event][currstate].newstate) > N_STATES)
		panic("i4b_l2fsm.c: newstate > N_STATES\n");	
	
	
	if(newstate != ST_SUBSET)
	{	/* state function does NOT set new state */
		NDBGL2(L2_F_MSG, "FSM event [%s]: [%s/%d => %s/%d]",
				l2event_text[event],
                                l2state_text[currstate], currstate,
                                l2state_text[newstate], newstate);
        }

	/* execute state transition function */
        (*l2state_tab[event][currstate].func)(l2sc);

	if(newstate == ST_SUBSET)
	{	/* state function DOES set new state */
		NDBGL2(L2_F_MSG, "FSM S-event [%s]: [%s => %s]", l2event_text[event],
                                           l2state_text[currstate],
                                           l2state_text[l2sc->Q921_state]);
        }
        
	/* check for illegal new state */

	if(newstate == ST_ILL)
	{
		newstate = currstate;
		NDBGL2(L2_F_ERR, "FSM illegal state, state = %s, event = %s!",
                                l2state_text[currstate],
				l2event_text[event]);
	}

	/* check if state machine function has to set new state */

	if(newstate != ST_SUBSET)
		l2sc->Q921_state = newstate;        /* no, we set new state */

	if(l2sc->postfsmfunc != NULL)
	{
		NDBGL2(L2_F_MSG, "FSM executing postfsmfunc!");
		/* try to avoid an endless loop */
		savpostfsmfunc = l2sc->postfsmfunc;
		l2sc->postfsmfunc = NULL;
        	(*savpostfsmfunc)(l2sc->postfsmarg);
        }
}
开发者ID:MarginC,项目名称:kame,代码行数:63,代码来源:i4b_l2fsm.c


示例2: i4b_rxd_ack

/*---------------------------------------------------------------------------*
 *	got s or i frame, check if valid ack for last sent frame
 *---------------------------------------------------------------------------*/
void
i4b_rxd_ack(l2_softc_t *l2sc, struct isdn_l3_driver *drv, int nr)
{

#ifdef NOTDEF
	NDBGL2(L2_ERROR, "N(R)=%d, UA=%d, V(R)=%d, V(S)=%d, V(A)=%d",
		nr,
		l2sc->ua_num,
		l2sc->vr,
		l2sc->vs,
		l2sc->va);
#endif

	if(l2sc->ua_num != UA_EMPTY)
	{
		int s;

		s = splnet();
		
		M128DEC(nr);

		if(l2sc->ua_num != nr)
			NDBGL2(L2_ERROR, "((N(R)-1)=%d) != (UA=%d) !!!", nr, l2sc->ua_num);
			
		i4b_Dfreembuf(l2sc->ua_frame);
		l2sc->ua_num = UA_EMPTY;
		
		splx(s);
	}
}
开发者ID:MarginC,项目名称:kame,代码行数:33,代码来源:i4b_util.c


示例3: i4b_rxd_ack

/*---------------------------------------------------------------------------*
 *	got s or i frame, check if valid ack for last sent frame
 *---------------------------------------------------------------------------*/
void
i4b_rxd_ack(l2_softc_t *l2sc, int nr)
{

#ifdef NOTDEF
	NDBGL2(L2_ERROR, "N(R)=%d, UA=%d, V(R)=%d, V(S)=%d, V(A)=%d",
		nr,
		l2sc->ua_num,
		l2sc->vr,
		l2sc->vs,
		l2sc->va);
#endif

	if(l2sc->ua_num != UA_EMPTY)
	{
		CRIT_VAR;

		CRIT_BEG;
		
		M128DEC(nr);

		if(l2sc->ua_num != nr)
			NDBGL2(L2_ERROR, "((N(R)-1)=%d) != (UA=%d) !!!", nr, l2sc->ua_num);
			
		i4b_Dfreembuf(l2sc->ua_frame);
		l2sc->ua_num = UA_EMPTY;
		
		CRIT_END;
	}
}
开发者ID:MarginC,项目名称:kame,代码行数:33,代码来源:i4b_util.c


示例4: F_T01

/*---------------------------------------------------------------------------*
 *	FSM state ST_TEI_ASGD event dl establish request
 *---------------------------------------------------------------------------*/	
static void
F_T01(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_T01 executing");
	i4b_establish_data_link(l2sc);
	l2sc->l3initiated = 1;
}
开发者ID:MarginC,项目名称:kame,代码行数:10,代码来源:i4b_l2fsm.c


示例5: F_T10

/*---------------------------------------------------------------------------*
 *	FSM state ST_TEI_ASGD event rx'd DM
 *---------------------------------------------------------------------------*/	
static void
F_T10(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_T10 executing");

	if(l2sc->rxd_PF)
	{
		l2sc->Q921_state = ST_TEI_ASGD;
	}
	else
	{
#ifdef NOTDEF
		if(NOT able_to_etablish)
		{
			l2sc->Q921_state = ST_TEI_ASGD;
			return;
		}
#endif
		i4b_establish_data_link(l2sc);

		l2sc->l3initiated = 1;

		l2sc->Q921_state = ST_AW_EST;
	}
}
开发者ID:MarginC,项目名称:kame,代码行数:28,代码来源:i4b_l2fsm.c


示例6: F_T13

/*---------------------------------------------------------------------------*
 *	FSM state ST_TEI_ASGD event dl release request
 *---------------------------------------------------------------------------*/	
static void
F_T13(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_T13 executing");
	l2sc->postfsmarg = l2sc->unit;
	l2sc->postfsmfunc = DL_Rel_Cnf_A;
}
开发者ID:MarginC,项目名称:kame,代码行数:10,代码来源:i4b_l2fsm.c


示例7: F_MF19

/*---------------------------------------------------------------------------*
 *	FSM state ST_MULTIFR event rx'd RNR
 *---------------------------------------------------------------------------*/	
static void
F_MF19(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_MF19 executing");

	l2sc->peer_busy = 1;

	if(l2sc->rxd_CR == CR_CMD_FROM_NT)
	{
		if(l2sc->rxd_PF == 1)
		{
			i4b_enquiry_response(l2sc);
		}
	}
	else
	{
		if(l2sc->rxd_PF == 1)
		{
			i4b_mdl_error_ind(l2sc, "F_MF19", MDL_ERR_A);
                }
        }

	if(i4b_l2_nr_ok(l2sc->rxd_NR, l2sc->va, l2sc->vs))
        {
                l2sc->va = l2sc->rxd_NR;
                i4b_T203_stop(l2sc);
                i4b_T200_restart(l2sc);
		l2sc->Q921_state = ST_MULTIFR;
        }
        else
        {
                i4b_nr_error_recovery(l2sc);
		l2sc->Q921_state = ST_AW_EST;                
        }
}
开发者ID:MarginC,项目名称:kame,代码行数:38,代码来源:i4b_l2fsm.c


示例8: i4b_l2_nr_ok

/*---------------------------------------------------------------------------*
 *	check for v(a) <= n(r) <= v(s)
 *	nr = receive sequence frame counter, va = acknowledge sequence frame
 *	counter and vs = transmit sequence frame counter
 *---------------------------------------------------------------------------*/
int
i4b_l2_nr_ok(int nr, int va, int vs)
{
	if((va > nr) && ((nr != 0) || (va != 127)))
	{
		NDBGL2(L2_ERROR, "ERROR, va = %d, nr = %d, vs = %d [1]", va, nr, vs);
		return 0;	/* fail */
	}

	if((nr > vs) && ((vs != 0) || (nr != 127)))
	{
		NDBGL2(L2_ERROR, "ERROR, va = %d, nr = %d, vs = %d [2]", va, nr, vs);
		return 0;	/* fail */
	}
	return 1;		/* good */
}
开发者ID:MarginC,项目名称:kame,代码行数:21,代码来源:i4b_util.c


示例9: F_AE11

/*---------------------------------------------------------------------------*
 *	FSM state ST_AW_EST event T200 expiry
 *---------------------------------------------------------------------------*/	
static void
F_AE11(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_AE11 executing");

	if(l2sc->RC >= N200)
	{
		i4b_Dcleanifq(&l2sc->i_queue);

		i4b_mdl_error_ind(l2sc, "F_AE11", MDL_ERR_G);

		l2sc->postfsmarg = l2sc->unit;
		l2sc->postfsmfunc = DL_Rel_Ind_A;

		l2sc->Q921_state = ST_TEI_ASGD;
	}
	else
	{
		l2sc->RC++;

		i4b_tx_sabme(l2sc, P1);

		i4b_T200_start(l2sc);

		l2sc->Q921_state = ST_AW_EST;
	}
}
开发者ID:MarginC,项目名称:kame,代码行数:30,代码来源:i4b_l2fsm.c


示例10: F_AR08

/*---------------------------------------------------------------------------*
 *	FSM state ST_AW_REL event rx'd DISC
 *---------------------------------------------------------------------------*/	
static void
F_AR08(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_AR08 executing");
	MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE);
	i4b_tx_ua(l2sc, l2sc->rxd_PF);	
}
开发者ID:MarginC,项目名称:kame,代码行数:10,代码来源:i4b_l2fsm.c


示例11: F_AR11

/*---------------------------------------------------------------------------*
 *	FSM state ST_AW_REL event T200 expiry
 *---------------------------------------------------------------------------*/	
static void
F_AR11(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_AR11 executing");

	if(l2sc->RC >= N200)
	{
		i4b_mdl_error_ind(l2sc, "F_AR11", MDL_ERR_H);

		l2sc->postfsmarg = l2sc->unit;
		l2sc->postfsmfunc = DL_Rel_Cnf_A;

		l2sc->Q921_state = ST_TEI_ASGD;
	}
	else
	{
		l2sc->RC++;

		i4b_tx_disc(l2sc, P1);

		i4b_T200_start(l2sc);

		l2sc->Q921_state = ST_AW_REL;
	}
}
开发者ID:MarginC,项目名称:kame,代码行数:28,代码来源:i4b_l2fsm.c


示例12: F_MF07

/*---------------------------------------------------------------------------*
 *	FSM state ST_MULTIFR event rx'd SABME
 *---------------------------------------------------------------------------*/	
static void
F_MF07(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_MF07 executing");

	i4b_clear_exception_conditions(l2sc);

	MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);	

	i4b_tx_ua(l2sc, l2sc->rxd_PF);

	i4b_mdl_error_ind(l2sc, "F_MF07", MDL_ERR_F);

	if(l2sc->vs != l2sc->va)
	{
		i4b_Dcleanifq(&l2sc->i_queue);
	
		l2sc->postfsmarg = l2sc->unit;
		l2sc->postfsmfunc = DL_Est_Ind_A;
	}

	i4b_T200_stop(l2sc);
	i4b_T203_start(l2sc);

	l2sc->vs = 0;
	l2sc->va = 0;
	l2sc->vr = 0;	
}
开发者ID:MarginC,项目名称:kame,代码行数:31,代码来源:i4b_l2fsm.c


示例13: F_MF12

/*---------------------------------------------------------------------------*
 *	FSM state ST_MULTIFR event dl data request
 *---------------------------------------------------------------------------*/	
static void
F_MF12(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_MF12 executing");

	i4b_i_frame_queued_up(l2sc);
}
开发者ID:MarginC,项目名称:kame,代码行数:10,代码来源:i4b_l2fsm.c


示例14: F_T09

/*---------------------------------------------------------------------------*
 *	FSM state ST_TEI_ASGD event rx'd UA
 *---------------------------------------------------------------------------*/	
static void
F_T09(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_T09 executing");
	i4b_mdl_error_ind(l2sc, "F_T09", MDL_ERR_C);
	i4b_mdl_error_ind(l2sc, "F_T09", MDL_ERR_D);	
}
开发者ID:MarginC,项目名称:kame,代码行数:10,代码来源:i4b_l2fsm.c


示例15: F_T07

/*---------------------------------------------------------------------------*
 *	FSM state ST_TEI_ASGD event rx'd SABME
 *---------------------------------------------------------------------------*/	
static void
F_T07(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_T07 executing");

/* XXX */
#ifdef NOTDEF
	if(NOT able to establish)
	{
		i4b_tx_dm(l2sc, l2sc->rxd_PF);
		l2sc->Q921_state = ST_TEI_ASGD;
		return;
	}
#endif

	i4b_clear_exception_conditions(l2sc);

	MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE);
	
	i4b_tx_ua(l2sc, l2sc->rxd_PF);

	l2sc->vs = 0;
	l2sc->va = 0;
	l2sc->vr = 0;	

	l2sc->postfsmarg = l2sc->unit;
	l2sc->postfsmfunc = DL_Est_Ind_A;

	i4b_T203_start(l2sc);	

	l2sc->Q921_state = ST_MULTIFR;
}
开发者ID:MarginC,项目名称:kame,代码行数:35,代码来源:i4b_l2fsm.c


示例16: F_MF14

/*---------------------------------------------------------------------------*
 *	FSM state ST_MULTIFR event T203 expiry
 *---------------------------------------------------------------------------*/	
static void
F_MF14(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_MF14 executing");

	i4b_transmit_enquire(l2sc);

	l2sc->RC = 0;
}
开发者ID:MarginC,项目名称:kame,代码行数:12,代码来源:i4b_l2fsm.c


示例17: F_AE01

/*---------------------------------------------------------------------------*
 *	FSM state ST_AW_EST event dl establish request
 *---------------------------------------------------------------------------*/	
static void
F_AE01(l2_softc_t *l2sc)
{
	NDBGL2(L2_F_MSG, "FSM function F_AE01 executing");

	i4b_Dcleanifq(&l2sc->i_queue);
	
	l2sc->l3initiated = 1;
}
开发者ID:MarginC,项目名称:kame,代码行数:12,代码来源:i4b_l2fsm.c


示例18: i4b_T202_timeout

/*---------------------------------------------------------------------------*
 *	Q.921 timer T202 timeout function
 *---------------------------------------------------------------------------*/
static void
i4b_T202_timeout(l2_softc_t *l2sc)
{
	NDBGL2(L2_T_ERR, "bri %d, N202 = %d", l2sc->drv->bri, l2sc->N202);
	
	if(--(l2sc->N202))
	{
		(*l2sc->T202func)(l2sc);
	}
}
开发者ID:MarginC,项目名称:kame,代码行数:13,代码来源:i4b_l2timer.c


示例19: i4b_tx_disc

/*---------------------------------------------------------------------------*
 *	transmit DISC command
 *---------------------------------------------------------------------------*/
void
i4b_tx_disc(l2_softc_t *l2sc, pbit_t pbit)
{
	struct mbuf *m;
	
	l2sc->stat.tx_disc++;
	NDBGL2(L2_U_MSG, "tx DISC, tei = %d", l2sc->tei);
	m = i4b_build_u_frame(l2sc, CR_CMD_TO_NT, pbit, DISC);
	PH_Data_Req(l2sc->unit, m, MBUF_FREE);
}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:13,代码来源:i4b_uframe.c


示例20: i4b_tx_frmr

/*---------------------------------------------------------------------------*
 *	transmit FRMR response
 *---------------------------------------------------------------------------*/
void
i4b_tx_frmr(l2_softc_t *l2sc, fbit_t fbit)
{
	struct mbuf *m;
	
	l2sc->stat.tx_frmr++;
	NDBGL2(L2_U_MSG, "tx FRMR, tei = %d", l2sc->tei);
	m = i4b_build_u_frame(l2sc, CR_RSP_TO_NT, fbit, FRMR);
	PH_Data_Req(l2sc->unit, m, MBUF_FREE);
}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:13,代码来源:i4b_uframe.c



注:本文中的NDBGL2函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NDBGL3函数代码示例发布时间:2022-05-30
下一篇:
C++ ND函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap