feat: create cook branch
This commit is contained in:
@@ -30,7 +30,7 @@ extern mtp3_routing_result routingResult;
|
||||
extern void mtp3_debug(int n,const char *fmt,...);
|
||||
extern BYTE mtp3_check_dpc_equal_to_opc(BYTE nw, ulong dpc);
|
||||
|
||||
static int detail_debug_flag=0;
|
||||
static int detail_debug_flag=1;
|
||||
static int rc_timer=190;
|
||||
extern DWORD mtp_local_ip, mtp_peer_ip;
|
||||
|
||||
@@ -472,46 +472,15 @@ int priority_own_link(WORD lsno,WORD sls)
|
||||
return -1;
|
||||
|
||||
ls = &mtp3.ls[lsno];
|
||||
|
||||
if(detail_debug_flag)
|
||||
{
|
||||
if(1)
|
||||
{
|
||||
char buf[256];
|
||||
char strbuf[1024];
|
||||
|
||||
mtp3_debug(MTP3DB_EVENT, "%s, linkset=%d, sls=%d, linkconfigred=%d ",
|
||||
__FUNCTION__,
|
||||
lsno,
|
||||
sls,
|
||||
mtp3.ls[lsno].linksNum_configured);
|
||||
memset(strbuf, 0x00, 16);
|
||||
for(i=0;i<2; i++)
|
||||
{
|
||||
link = ls_sls[(lsno<<4)+i];
|
||||
sprintf(buf, "ls_sls[%02d]=%d, ip=%08x, state=%d",
|
||||
i,
|
||||
ls_sls[(lsno<<4)+i],
|
||||
mtp3_para->lk[link].e1_to_mtp3,
|
||||
mtp3ObjState.link_l3_state[link]);
|
||||
strcat(strbuf, buf);
|
||||
}
|
||||
mtp3_debug(MTP3DB_EVENT, "%s, %s ",
|
||||
__FUNCTION__,
|
||||
strbuf);
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0;i<16;i++)
|
||||
// for (i=0;i<mtp3.ls[lsno].linksNum_configured;i++)
|
||||
for (i=0;i<mtp3.ls[lsno].linksNum_configured;i++)
|
||||
{
|
||||
link = ls_sls[(lsno<<4)+i];
|
||||
|
||||
if (mtp3_para->lk[link].e1_to_mtp3 == mtp3_localip && mtp3ObjState.link_l3_state[link] == AVAILABLE)
|
||||
return link;
|
||||
}
|
||||
|
||||
for (i=0;i<16;i++)
|
||||
// for (i=0;i<mtp3.ls[lsno].linksNum_configured;i++)
|
||||
for (i=0;i<mtp3.ls[lsno].linksNum_configured;i++)
|
||||
{
|
||||
link = ls_sls[(lsno<<4)+i];
|
||||
|
||||
@@ -607,11 +576,14 @@ int check_outbound_route(BYTE nw, long dpc, WORD sls, long opc)
|
||||
ls_info = &mtp3.ls[ls];
|
||||
|
||||
/* added for override link status -- start */
|
||||
/*
|
||||
if(m2ua_get_traffic_mode_type()==0)
|
||||
{
|
||||
if(ls_info->send_asp_ac_link_id>0 && ls_info->send_asp_ac_link_id != 0xffff)
|
||||
{
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,
|
||||
"[SCCP] M3UA ==> M2UA < %s > DPC=%d, Link=%d (asc link=%d)",__FUNCTION__, dpc, outlink,
|
||||
ls_info->send_asp_ac_link_id);
|
||||
|
||||
return ls_info->send_asp_ac_link_id;
|
||||
}
|
||||
@@ -619,11 +591,14 @@ int check_outbound_route(BYTE nw, long dpc, WORD sls, long opc)
|
||||
{
|
||||
int link_no = get_asp_ac_link(ls,sls);
|
||||
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,
|
||||
"[SCCP] M3UA ==> M2UA < %s > DPC=%d, Link=%d (asc link=%d)",__FUNCTION__, dpc, link_no,
|
||||
ls_info->send_asp_ac_link_id);
|
||||
|
||||
return link_no;
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* added for override link status -- end*/
|
||||
|
||||
if (mtp3_para->lk[outlink].e1_to_mtp3 == mtp3_localip && mtp3ObjState.link_l3_state[outlink] == AVAILABLE)
|
||||
@@ -639,11 +614,14 @@ int check_outbound_route(BYTE nw, long dpc, WORD sls, long opc)
|
||||
ls_info = &mtp3.ls[ls];
|
||||
|
||||
/* added for override link status -- start */
|
||||
/*
|
||||
if(m2ua_get_traffic_mode_type()==0)
|
||||
{
|
||||
if(ls_info->send_asp_ac_link_id>0 && ls_info->send_asp_ac_link_id != 0xffff)
|
||||
{
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,
|
||||
"[SCCP] M3UA ==> M2UA < %s > DPC=%d(ALS), Link=%d (asc link=%d)",__FUNCTION__, dpc, outlink,
|
||||
ls_info->send_asp_ac_link_id);
|
||||
|
||||
return ls_info->send_asp_ac_link_id;
|
||||
}
|
||||
@@ -651,11 +629,14 @@ int check_outbound_route(BYTE nw, long dpc, WORD sls, long opc)
|
||||
{
|
||||
int link_no = get_asp_ac_link(ls,sls);
|
||||
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,
|
||||
"[SCCP] M3UA ==> M2UA < %s > DPC=%d(ALS), Link=%d (asc link=%d)",__FUNCTION__, dpc, link_no,
|
||||
ls_info->send_asp_ac_link_id);
|
||||
|
||||
return link_no;
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* added for override link status -- end*/
|
||||
|
||||
if (mtp3_para->lk[outlink].e1_to_mtp3 == mtp3_localip && mtp3ObjState.link_l3_state[outlink] == AVAILABLE)
|
||||
@@ -3035,7 +3016,7 @@ void m3ua_upd_route_status(WORD chl, DWORD rc, BYTE rc_status, BYTE ls_disable)
|
||||
if( ls_disable == 0)
|
||||
continue;
|
||||
|
||||
// sp->m3ua_rc_status[spplace] = rc_status;
|
||||
sp->m3ua_rc_status[spplace] = rc_status;
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT," <%s.%d> M3UA update route info, link=%d, sppace=%d, sp->routine=%d",
|
||||
__FUNCTION__,
|
||||
@@ -3043,19 +3024,15 @@ void m3ua_upd_route_status(WORD chl, DWORD rc, BYTE rc_status, BYTE ls_disable)
|
||||
chl,
|
||||
spplace, sp->routine[spplace]);
|
||||
|
||||
mark_normal_linkset_unavailable(&sp->routine[spplace]);
|
||||
|
||||
if ( ((sp->routine[spplace] >> 2) & 3) == 0 )/*alternative route available */
|
||||
sp->routine[spplace] = (sp->routine[spplace] & 0x3f) + 0x40;/* current route change from normal linkset to alternative linkset */
|
||||
else/* sp not accessible */
|
||||
{
|
||||
sp_unaccessable((BYTE *)&sp->routine[spplace]);
|
||||
primitive_to_userpart(nw,mtp3_para->nw[nw].routing[spplace].dpc,UNAVAILABLE);
|
||||
sp->m3ua_rc_status[spplace] = rc_status;
|
||||
}
|
||||
if(mtp3ObjState.lk_mtp3[chl] == mtp3_localip)
|
||||
{
|
||||
if(1)
|
||||
if(mtp_peer_ip != 0)
|
||||
{
|
||||
send_route_to_other_plat(mtp3_para->nw[nw].routing[spplace].dpc,
|
||||
@@ -3089,27 +3066,21 @@ void m3ua_upd_route_status(WORD chl, DWORD rc, BYTE rc_status, BYTE ls_disable)
|
||||
continue;
|
||||
|
||||
|
||||
//sp->m3ua_rc_status[spplace] = rc_status;
|
||||
sp->m3ua_rc_status[spplace] = rc_status;
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT," <%s.%d> M3UA ALS update route info, link=%d, sppace=%d, sp->routine=%d, rc_status=%d",
|
||||
mtp3_debug(MTP3DB_EVENT," <%s.%d> M3UA ALS update route info, link=%d, sppace=%d, sp->routine=%d",
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
chl,
|
||||
spplace, sp->routine[spplace],
|
||||
sp->m3ua_rc_status[spplace]);
|
||||
|
||||
mark_alternative_linkset_unavailable(&sp->routine[spplace]);
|
||||
spplace, sp->routine[spplace]);
|
||||
|
||||
if ( (sp->routine[spplace] & 3) != 0 )/* normal route unavailable */
|
||||
{
|
||||
sp_unaccessable((BYTE *)&sp->routine[spplace]);
|
||||
primitive_to_userpart(nw,mtp3_para->nw[nw].routing[spplace].dpc,UNAVAILABLE);
|
||||
sp->m3ua_rc_status[spplace] = rc_status;
|
||||
|
||||
}
|
||||
if(mtp3ObjState.lk_mtp3[chl] == mtp3_localip)
|
||||
{
|
||||
if(1)
|
||||
if(mtp_peer_ip != 0)
|
||||
{
|
||||
send_route_to_other_plat(mtp3_para->nw[nw].routing[spplace].dpc,
|
||||
@@ -3202,7 +3173,6 @@ void m3ua_upd_route_status(WORD chl, DWORD rc, BYTE rc_status, BYTE ls_disable)
|
||||
primitive_to_userpart(nw,mtp3_para->nw[nw].routing[spplace].dpc,AVAILABLE);
|
||||
}
|
||||
|
||||
if(1)
|
||||
if(mtp3ObjState.lk_mtp3[chl] == mtp3_localip && mtp_peer_ip != 0)
|
||||
{
|
||||
send_route_to_other_plat(dpc,
|
||||
@@ -3222,8 +3192,6 @@ void m3ua_upd_route_status(WORD chl, DWORD rc, BYTE rc_status, BYTE ls_disable)
|
||||
__LINE__,
|
||||
chl,
|
||||
spplace, sp->routine[spplace]);
|
||||
|
||||
rc_timer = 100; //make sure 1 second later to send ASP_AC
|
||||
|
||||
}
|
||||
sp = &mtp3.nw[nw];
|
||||
@@ -3234,37 +3202,29 @@ void m3ua_upd_route_status(WORD chl, DWORD rc, BYTE rc_status, BYTE ls_disable)
|
||||
// continue;
|
||||
sp->m3ua_rc_status[spplace] = rc_status;
|
||||
routine = (BYTE*)&sp->routine[spplace];
|
||||
|
||||
if(detail_debug_flag)
|
||||
if(0)
|
||||
mtp3_debug(MTP3DB_EVENT," <%s:%d> S5 ALS,M3UA update route info, link=%d, sppace=%d, sp->routine=%d",
|
||||
__FUNCTION__, __LINE__,
|
||||
chl,
|
||||
spplace, *routine);
|
||||
spplace, sp->routine[spplace]);
|
||||
|
||||
mark_alternative_linkset_available(&mtp3.nw[nw].routine[spplace]); //17-11-07
|
||||
routine = (BYTE *)&mtp3.nw[nw].routine[spplace];
|
||||
|
||||
if ( (*routine) >> 6 == 2 )// no route
|
||||
if ( (*routine) >> 6 == 2 )/* no route */
|
||||
{
|
||||
(*routine) = ((*routine) & 0x3f) + 0x40;// current route is alternative linkset
|
||||
(*routine) = ((*routine) & 0x3f) + 0x40;/* current route is alternative linkset */
|
||||
primitive_to_userpart(nw,mtp3_para->nw[nw].routing[spplace].dpc,AVAILABLE);
|
||||
}
|
||||
{
|
||||
mark_alternative_linkset_available(&mtp3.nw[nw].routine[spplace]);
|
||||
routine = (BYTE *)&mtp3.nw[nw].routine[spplace];
|
||||
|
||||
/*
|
||||
if (Nlinkset_status(*routine) == LS_AVAILABLE)
|
||||
(*routine) = ((*routine) & 0x3f); // current route is normal linkset
|
||||
else if (Alinkset_status(*routine) == LS_AVAILABLE)
|
||||
(*routine) = ((*routine) & 0x3f) + 0x40;
|
||||
else
|
||||
(*routine) = ((*routine) & 0x3f) + 0x80;
|
||||
}
|
||||
*/
|
||||
|
||||
if(0)
|
||||
{
|
||||
mark_alternative_linkset_available(&mtp3.nw[nw].routine[spplace]);
|
||||
routine = (BYTE *)&mtp3.nw[nw].routine[spplace];
|
||||
}
|
||||
|
||||
if(1)
|
||||
if(mtp3ObjState.lk_mtp3[chl] == mtp3_localip && mtp_peer_ip != 0)
|
||||
{
|
||||
send_route_to_other_plat(mtp3_para->nw[nw].routing[spplace].dpc,
|
||||
@@ -3274,15 +3234,17 @@ void m3ua_upd_route_status(WORD chl, DWORD rc, BYTE rc_status, BYTE ls_disable)
|
||||
chl,
|
||||
opc);
|
||||
}
|
||||
|
||||
if(mtp3ObjState.lk_mtp3[chl] == mtp3_localip && mtp3_para->lk[chl].e1_to_alterMTP3 !=0)
|
||||
send_route_to_other_plat(mtp3_para->nw[nw].routing[spplace].dpc, nw, sp->routine[spplace], mtp3_para->lk[chl].e1_to_alterMTP3, chl, opc);
|
||||
}
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT," <%s:%d> S5 ALS,M3UA update route info, link=%d, sppace=%d, sp->routine=%d",
|
||||
__FUNCTION__, __LINE__,
|
||||
chl,
|
||||
spplace, sp->routine[spplace]);
|
||||
|
||||
if(mtp3ObjState.lk_mtp3[chl] == mtp3_localip && mtp3_para->lk[chl].e1_to_alterMTP3 !=0)
|
||||
send_route_to_other_plat(mtp3_para->nw[nw].routing[spplace].dpc, nw, sp->routine[spplace], mtp3_para->lk[chl].e1_to_alterMTP3, chl, opc);
|
||||
}
|
||||
|
||||
}
|
||||
// if ((mtp3.nw[nw].routine[dpc_index] & 0x0f) == 0x0a)// all road unavailable
|
||||
// mark_dstSP_inaccessible(&mtp3.nw[nw].routine[dpc_index]);
|
||||
@@ -3400,7 +3362,6 @@ int m3ua_ssnm_update_route(xua_ssnm_cmd *p_ssnm)
|
||||
else
|
||||
primitive_to_userpart(nw,mtp3_para->nw[nw].routing[spplace].dpc,AVAILABLE);
|
||||
|
||||
if(1)
|
||||
if(mtp3ObjState.lk_mtp3[link] == mtp3_localip && mtp_peer_ip != 0)
|
||||
{
|
||||
send_route_to_other_plat(mtp3_para->nw[nw].routing[spplace].dpc,
|
||||
@@ -3425,12 +3386,10 @@ int m3ua_updateStatus(WORD chl, BYTE new_l2_state,BYTE command, DWORD rc, BYTE r
|
||||
ls_info *ls;
|
||||
int set_unaccessable = 0 ;
|
||||
|
||||
/*
|
||||
if ((mtp3ObjState.lk_configured[chl] == PARA_NOT_CONFIGURED) ||
|
||||
(mtp3ObjState.lk_mtp3[chl] != mtp3_localip))
|
||||
return 0;
|
||||
|
||||
*/
|
||||
rc_timer = 195+(mtp2_systemid%2)*5;
|
||||
|
||||
if (mtp3ObjState.lk_configured[chl] == PARA_NOT_CONFIGURED)
|
||||
@@ -3459,7 +3418,7 @@ int m3ua_updateStatus(WORD chl, BYTE new_l2_state,BYTE command, DWORD rc, BYTE r
|
||||
|
||||
if (new_l2_state != mtp3ObjState.link_l2_state[chl])
|
||||
{
|
||||
if(detail_debug_flag)
|
||||
// if(detail_debug_flag)
|
||||
{
|
||||
mtp3_debug(MTP3DB_ERROR,"m3ua_updateStatus, link=%d, l2_state=%d, command=%d, rc=%d, rc_status=%d",
|
||||
chl, new_l2_state, command, rc, rc_status);
|
||||
@@ -3517,36 +3476,11 @@ int m3ua_updateStatus(WORD chl, BYTE new_l2_state,BYTE command, DWORD rc, BYTE r
|
||||
m3ua_upd_route_status(chl, rc, 5, 1);
|
||||
|
||||
mtp3.ls[ls_t].links_available ++;
|
||||
|
||||
ls->links_available_t = scan_ls_link_available(ls_t);
|
||||
|
||||
if(ls->links_available_t == 1)
|
||||
{
|
||||
if (mtp3ObjState.lk_mtp3[chl] != mtp3_localip)
|
||||
ls->send_asp_ac_link_id = chl;
|
||||
}
|
||||
|
||||
if(0)
|
||||
{
|
||||
if(ls->links_available_t== 1)
|
||||
{
|
||||
if(ls->send_asp_ac_link_id == 0x00 || ls->send_asp_ac_link_id == 0xffff )
|
||||
{//for override mode
|
||||
ls->send_asp_ac_link_id = chl;
|
||||
|
||||
m3ua_set_link_rc_to_m2ua(chl);
|
||||
|
||||
send_command_to_m3ua(chl, 1,M3UA_RC_CMD , rc, 0);
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,"<%s:%d> M3UA send RC_CMD, link=%d",
|
||||
__FUNCTION__, __LINE__,
|
||||
chl);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//mtp3ObjState.lk_mtp3[chl] = mtp3_localip;
|
||||
mtp3ObjState.lk_mtp3[chl] = mtp3_localip;
|
||||
}
|
||||
else if (mtp3ObjState.link_l2_state[chl] == MTP2_STATE_WORKING)
|
||||
{
|
||||
@@ -3579,7 +3513,6 @@ int m3ua_updateStatus(WORD chl, BYTE new_l2_state,BYTE command, DWORD rc, BYTE r
|
||||
|
||||
if(ls->send_asp_ac_link_id == chl)
|
||||
ls->send_asp_ac_link_id = 0xFFFF;
|
||||
|
||||
ls->links_nls_asp_ac_send_flag[chl] = 0;
|
||||
|
||||
ls->links_available_t = scan_ls_link_available(ls_t);
|
||||
@@ -3668,9 +3601,8 @@ int GetM3uaMsg(ulong port)
|
||||
|
||||
chl = lm_lk_ptr->link;//???
|
||||
new_l2_state = lm_lk_ptr->opercode;
|
||||
if(new_l2_state)
|
||||
m3ua_updateStatus(chl, new_l2_state, 0, 0 ,0);
|
||||
mtp3_debug(MTP3DB_PRIMITIVE_MSG,"get M3UA link[%d], state=%d, heartbeat from %lx", chl, new_l2_state, msgSourceIP);
|
||||
mtp3_debug(MTP3DB_PRIMITIVE_MSG,"get M3UA link heartbeat from %lx",msgSourceIP);
|
||||
mtp3_showbuf(MTP3DB_PRIMITIVE_MSG,(BYTE *)mtp3_m3ua_msg,ntohs(lm_lk_ptr->len)+4);
|
||||
|
||||
return 0;
|
||||
@@ -3787,22 +3719,9 @@ int GetM3uaMsg(ulong port)
|
||||
int send_command_to_m3ua(WORD link, BYTE command, BYTE xua_msg_class, DWORD rc, DWORD aff_pc)
|
||||
{
|
||||
char charCmd[32];
|
||||
static int rc_cmd_counter=0, total_cmd_counter=0;
|
||||
|
||||
if(0)
|
||||
{
|
||||
if(rc_cmd_counter < 5 && total_cmd_counter++ < 100)
|
||||
{
|
||||
char buf[128];
|
||||
|
||||
sprintf(buf, "link=%d, cmd=%d, xmc=%d", link, command, xua_msg_class);
|
||||
pub_print_traceback(buf);
|
||||
}
|
||||
}
|
||||
|
||||
if(xua_msg_class == M3UA_RC_CMD)
|
||||
{
|
||||
rc_cmd_counter ++;
|
||||
mtp3_iprt.io_msg.msgLength = 5+1+4+1;
|
||||
mtp3_iprt.io_msg.msgContent[0] = xua_msg_class;
|
||||
mtp3_iprt.io_msg.msgContent[2] = link>>8;
|
||||
@@ -3811,9 +3730,6 @@ int send_command_to_m3ua(WORD link, BYTE command, BYTE xua_msg_class, DWORD rc,
|
||||
mtp3_iprt.io_msg.msgContent[4] = 7;
|
||||
mtp3_iprt.io_msg.msgContent[9] = command;
|
||||
memcpy(&mtp3_iprt.io_msg.msgContent[5], &rc, 4);
|
||||
|
||||
sprintf(charCmd,"M3UA_ASP_Active");
|
||||
|
||||
}else if(xua_msg_class == M3UA_MGMT_CMD)
|
||||
{
|
||||
mtp3_iprt.io_msg.msgLength = 5+1+1;
|
||||
@@ -3871,33 +3787,8 @@ void deactive_m3ua_lk(WORD link)
|
||||
}
|
||||
}
|
||||
|
||||
void m3ua_set_link_rc_to_m2ua(int linkno)
|
||||
{
|
||||
int i;
|
||||
WORD lsno, spplace;
|
||||
BYTE nw;
|
||||
DWORD rc;
|
||||
network *sp;
|
||||
ls_info *ls;
|
||||
|
||||
lsno = mtp3_para->lk[linkno].e1_to_linkset;
|
||||
if (lsno >= MAX_LS)
|
||||
return;
|
||||
|
||||
ls = &mtp3.ls[lsno];
|
||||
nw = mtp3_para->ls_pro[lsno].nw_id;
|
||||
sp = &mtp3.nw[nw];
|
||||
|
||||
for ( i=0; i<(ls->influ_dstnum_asNLS % MAX_LS_DPC_ADD1); i++ )
|
||||
{
|
||||
spplace = ls->influ_dstplace_intable_asNLS[i];
|
||||
rc = mtp3_para->nw[nw].routing[spplace].rc;
|
||||
m2ua_set_sg_rc(linkno, rc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void check_m3ua_link_status(int force_flag)
|
||||
extern int m2ua_set_sg_rc(int linkno, int rc);
|
||||
void check_m3ua_link_status()
|
||||
{
|
||||
int link,i;
|
||||
WORD lsno, spplace;
|
||||
@@ -3906,16 +3797,15 @@ void check_m3ua_link_status(int force_flag)
|
||||
network *sp;
|
||||
ls_info *ls;
|
||||
static int link_timer=0;
|
||||
int check_timer = ( mtp2_systemid * 30 + 400);
|
||||
int check_timer = ( mtp2_systemid * 30 + 200);
|
||||
int send_asp_ac_flag = 0;
|
||||
|
||||
if(rc_timer >= check_timer || force_flag)//2s
|
||||
if(rc_timer >= check_timer)//2s
|
||||
{
|
||||
rc_timer = 0;
|
||||
for(link=0;link<MAX_LK; link++)
|
||||
{
|
||||
|
||||
// if(MTP3_LINK_TYPE(link) == LKTYPE_M3UA && (mtp3_para->lk[link].admin_state& 1)&&(check_if_local_ip(mtp3ObjState.lk_mtp3[link] )) ) //mtp3_localip))
|
||||
if(MTP3_LINK_TYPE(link) == LKTYPE_M3UA && (mtp3_para->lk[link].admin_state& 1)&&(mtp3ObjState.lk_mtp3[link] == mtp3_localip))
|
||||
{
|
||||
if(mtp3ObjState.link_l3_state[link] == AVAILABLE)
|
||||
@@ -3972,38 +3862,11 @@ void check_m3ua_link_status(int force_flag)
|
||||
}
|
||||
if(send_asp_ac_flag == 0)
|
||||
{
|
||||
//ls->send_asp_ac_link_id = link; //
|
||||
if(0)
|
||||
{
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,"<%s:%d> M3UA send RC_CMD, link=%d, total links=%d, sppace=%d, sp->routine=%d, act link=%d",
|
||||
__FUNCTION__, __LINE__,
|
||||
link,
|
||||
ls->links_available_t,
|
||||
spplace,
|
||||
sp->routine[spplace],
|
||||
ls->send_asp_ac_link_id);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ls->links_nls_asp_ac_send_flag[link] == 1)
|
||||
send_asp_ac_flag = 0;
|
||||
ls->send_asp_ac_link_id = link; //
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(0)
|
||||
mtp3_debug(MTP3DB_EVENT,"<%s:%d> link=%d, sppace=%d, sp->routine=%d, rc_status=%d, lk_asp_ac=%d",
|
||||
__FUNCTION__, __LINE__,
|
||||
link,
|
||||
spplace,
|
||||
sp->routine[spplace],
|
||||
sp->m3ua_rc_status[spplace],
|
||||
ls->links_nls_asp_ac_send_flag[link]);
|
||||
|
||||
|
||||
if(sp->m3ua_rc_status[spplace]!=5 || ls->links_nls_asp_ac_send_flag[link] == 0 )
|
||||
{
|
||||
@@ -4118,13 +3981,8 @@ void check_m3ua_link_status(int force_flag)
|
||||
{
|
||||
if(MTP3_LINK_TYPE(link) == LKTYPE_M3UA && (mtp3_para->lk[link].admin_state& 1) &&(mtp3ObjState.lk_mtp3[link] == mtp3_localip))
|
||||
{
|
||||
if(mtp3ObjState.link_l3_state[link] == UNAVAILABLE || mtp3ObjState.link_enable_sent_flag[link] == 0)
|
||||
{
|
||||
mtp3ObjState.link_enable_sent_flag[link] = 1;
|
||||
if(mtp3ObjState.link_l3_state[link] == UNAVAILABLE)
|
||||
send_command_to_m3ua(link, MTP3_M3UA_ENABLE,M3UA_MGMT_CMD,0, 0);
|
||||
|
||||
rc_timer = 100;
|
||||
}
|
||||
}
|
||||
/* if(MTP3_LINK_TYPE(link) == LKTYPE_M3UA && mtp3ObjInput.lsac_input_from_mgmt[link] == LSAC_MGMT_DEACTIVATE_LINK)
|
||||
{
|
||||
@@ -4144,7 +4002,7 @@ void check_m3ua_link_status(int force_flag)
|
||||
|
||||
void m3ua_timer()
|
||||
{
|
||||
check_m3ua_link_status(0);
|
||||
check_m3ua_link_status();
|
||||
}
|
||||
|
||||
void send_mtp_msg(int outlink, BYTE *msgptr)
|
||||
@@ -4264,9 +4122,7 @@ void send_mtp_msg(int outlink, BYTE *msgptr)
|
||||
/* debug show message */
|
||||
if(pclen == MTP3_24BIT_PC)
|
||||
{
|
||||
// memmove(m3ua_ptr->msg.m3ua.content, msgptr+11+1, len-8-1);
|
||||
memmove(m3ua_ptr->msg.m3ua.content, msgptr+11+1, len-6-1);
|
||||
|
||||
memmove(m3ua_ptr->msg.m3ua.content, msgptr+11+1, len-8-1);
|
||||
dpc = 0;
|
||||
opc = 0;
|
||||
sls = msgptr[11];
|
||||
@@ -4277,9 +4133,7 @@ void send_mtp_msg(int outlink, BYTE *msgptr)
|
||||
m3ua_ptr->msg_class = M3UA_MAUP_MSG;
|
||||
m3ua_ptr->msg.m3ua.ni = nw;
|
||||
m3ua_ptr->msg.m3ua.si = msgptr[4] & 0x0f;
|
||||
// m3ua_ptr->msg.m3ua.len = ntohs(len - 8 - 1 - 4); //m3ua_ptr->msg.m3ua.len = ntohs(len - 8-1); //modify by Jink on 2012-11-01
|
||||
m3ua_ptr->msg.m3ua.len = ntohs(len - 6 - 1 - 4); //m3ua_ptr->msg.m3ua.len = ntohs(len - 8-1); //modify by Jink on 2012-11-01
|
||||
|
||||
m3ua_ptr->msg.m3ua.len = ntohs(len - 8 - 1 - 4); //m3ua_ptr->msg.m3ua.len = ntohs(len - 8-1); //modify by Jink on 2012-11-01
|
||||
m3ua_ptr->msg.m3ua.mp = 0;
|
||||
m3ua_ptr->msg.m3ua.sls = sls;
|
||||
m3ua_ptr->msg.m3ua.rc = get_m3ua_rc_by_dpc(nw, m3ua_ptr->msg.m3ua.dpc, m3ua_ptr->msg.m3ua.opc);
|
||||
@@ -4419,7 +4273,6 @@ int update_route_by_other_plat(u32 dpc,BYTE nw, BYTE routine, WORD chl, u32 opc)
|
||||
lsno = mtp3_para->lk[chl].e1_to_linkset;
|
||||
ull opc_dpc=0;
|
||||
|
||||
return 0;
|
||||
|
||||
if (lsno >= MAX_LS)
|
||||
return 0;
|
||||
@@ -4438,24 +4291,14 @@ int update_route_by_other_plat(u32 dpc,BYTE nw, BYTE routine, WORD chl, u32 opc)
|
||||
i = sort_rec->index[index];
|
||||
else
|
||||
return 0;
|
||||
|
||||
sp->routine[i] = routine;
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT," <%s:%d> link=%d, linkset=%d, dpc=%d, sp->routine .local=%d,peer=%d",
|
||||
mtp3_debug(MTP3DB_EVENT," <%s:%d> link=%d, linkset=%d, dpc=%d, sp->routine=%d",
|
||||
__FUNCTION__, __LINE__,
|
||||
chl,
|
||||
lsno,
|
||||
dpc,
|
||||
sp->routine[i],
|
||||
routine);
|
||||
if(0)
|
||||
if(sp->routine[i] != routine)
|
||||
{
|
||||
outroute = (sp->routine[i] >> 6) & 3;
|
||||
if(outroute != 2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
sp->routine[i] = routine;
|
||||
|
||||
outroute = (routine >> 6) & 3;
|
||||
if ( outroute == 2 )/* no outbound route */
|
||||
@@ -5010,15 +4853,12 @@ void hmrt_tcbc_update_routing_tables(WORD chl)
|
||||
spplace = ls->influ_dstplace_intable_asNLS[i];
|
||||
routine = (BYTE*)&sp->routine[spplace];
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,"\33[32m%s:%d : Link %d Linkset %d , routine: =%02x\33[0m",__FUNCTION__, __LINE__, chl, lsno,
|
||||
mtp3_debug(MTP3DB_EVENT,"\33[32m%s: Link %d Linkset %d , routine: =%02x\33[0m",__FUNCTION__, chl, lsno,
|
||||
*routine);
|
||||
|
||||
mark_normal_linkset_available(routine); //117-11-07
|
||||
|
||||
if (Nlinkset_status(*routine) == LS_AVAILABLE)
|
||||
{
|
||||
*routine = ((*routine) & 0x3f);/* current route is normal linkset */
|
||||
if(1)
|
||||
if(ls->links_nls_asp_ac_send_flag[spplace] == 0)
|
||||
{
|
||||
ls->links_nls_asp_ac_send_flag[spplace] = 1;
|
||||
@@ -5028,7 +4868,6 @@ void hmrt_tcbc_update_routing_tables(WORD chl)
|
||||
else if (Alinkset_status(*routine) == LS_AVAILABLE)
|
||||
{
|
||||
(*routine) = ((*routine) & 0x3f) + 0x40;
|
||||
if(1)
|
||||
if(ls->links_als_asp_ac_send_flag[spplace] == 0)
|
||||
{
|
||||
ls->links_als_asp_ac_send_flag[spplace] = 1;
|
||||
@@ -5037,29 +4876,18 @@ void hmrt_tcbc_update_routing_tables(WORD chl)
|
||||
}
|
||||
else
|
||||
{
|
||||
//mark_normal_linkset_available(routine);
|
||||
mark_normal_linkset_available(routine);
|
||||
|
||||
(*routine) = ((*routine) & 0x3f) + 0x80;
|
||||
|
||||
primitive_to_userpart(nw,mtp3_para->nw[nw].routing[spplace].dpc,AVAILABLE);
|
||||
}
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,"\33[32m%s:%d : Link %d Linkset %d , routine: =%02x\33[0m",__FUNCTION__, __LINE__, chl, lsno,
|
||||
*routine);
|
||||
|
||||
}
|
||||
|
||||
for ( i=0; i<(ls->influ_dstnum_asALS % MAX_LS_DPC_ADD1); i++ )
|
||||
{
|
||||
spplace = ls->influ_dstplace_intable_asALS[i];
|
||||
routine = (BYTE*)&sp->routine[spplace];
|
||||
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,"\33[32m%s:%d : Link %d Linkset %d , ssplace=%d, routine: =%02x\33[0m",__FUNCTION__, __LINE__, chl, lsno,
|
||||
spplace, *routine);
|
||||
|
||||
mark_alternative_linkset_available(routine); //17-11-07
|
||||
|
||||
if ( (*routine) >> 6 == 2 )/* no route */
|
||||
{
|
||||
(*routine) = ((*routine) & 0x3f) + 0x40;/* current route is alternative linkset */
|
||||
@@ -5073,36 +4901,23 @@ void hmrt_tcbc_update_routing_tables(WORD chl)
|
||||
else
|
||||
(*routine) = ((*routine) & 0x3f) + 0x80;
|
||||
|
||||
if(1)
|
||||
if(ls->links_als_asp_ac_send_flag[spplace] == 0)
|
||||
{
|
||||
ls->links_als_asp_ac_send_flag[spplace] = 1;
|
||||
ls->send_asp_ac_link_id = chl;
|
||||
}
|
||||
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_EVENT,"\33[32m%s:%d : Link %d Linkset %d , routine: =%02x\33[0m",__FUNCTION__, __LINE__, chl, lsno,
|
||||
*routine);
|
||||
|
||||
}
|
||||
//if (mtp3ObjState.lk_mtp3[chl] == mtp3_localip) for dual alarm issue
|
||||
mtp3_send_alarm(lsno+MTP3_LINKSET_COMPONENT,0);
|
||||
set_heartbeat(ALARM_LS_AVAILABLE,lsno);
|
||||
mtp3_para->ls_pro[lsno].ls_state = 1;//ALARM_LS_AVAILABLE;
|
||||
}
|
||||
if (mtp3ObjState.lk_mtp3[chl] == mtp3_localip)
|
||||
mtp3_send_alarm(MTP3_LINK_COMPONENT+chl,0);
|
||||
|
||||
ls->links_available_t = scan_ls_link_available(lsno);
|
||||
|
||||
if (mtp3ObjState.lk_mtp3[chl] == mtp3_localip)
|
||||
mtp3_send_alarm(MTP3_LINK_COMPONENT+chl,0);
|
||||
else
|
||||
{
|
||||
if(ls->links_available_t >= 1)
|
||||
{
|
||||
if(ls->send_asp_ac_link_id == 0 || ls->send_asp_ac_link_id == 0xffff)
|
||||
ls->send_asp_ac_link_id = chl;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ls->links_available_t > 0 )
|
||||
{
|
||||
@@ -5115,15 +4930,12 @@ void hmrt_tcbc_update_routing_tables(WORD chl)
|
||||
mtp3_debug(MTP3DB_EVENT,"\33[32m%s: Link %d L3 in service,Linkset %d in service\33[0m",__FUNCTION__, chl,lsno);
|
||||
}
|
||||
|
||||
/*
|
||||
if(link_already_available != AVAILABLE)
|
||||
ls->links_available_t++;
|
||||
else
|
||||
mtp3_debug(MTP3DB_ERROR,"update routing table fail, links=%d have already available", chl);
|
||||
*/
|
||||
|
||||
current_measure->lk_measure1[chl][1]++;/* local changeback */
|
||||
|
||||
// printf("\r\n tcbc %d update routine cmp link_available = %d \n\r",chl, ls->links_available_t);
|
||||
}
|
||||
|
||||
@@ -5156,11 +4968,7 @@ void hmrt_tcoc_update_routing_tables(WORD chl)
|
||||
if (link_inhibited[chl] == TRUE)
|
||||
mtp3ObjState.link_l3_state[chl] = INHIBITED;
|
||||
else
|
||||
{
|
||||
mtp3ObjState.link_l3_state[chl] = UNAVAILABLE;
|
||||
mtp3ObjState.link_enable_sent_flag[chl] = 0;
|
||||
|
||||
}
|
||||
|
||||
set_heartbeat(ALARM_LINK_UNAVAILABLE,chl);
|
||||
|
||||
@@ -5213,9 +5021,8 @@ void hmrt_tcoc_update_routing_tables(WORD chl)
|
||||
primitive_to_userpart(nw,mtp3_para->nw[nw].routing[spplace].dpc,UNAVAILABLE);
|
||||
sp->m3ua_rc_status[spplace] = 0;
|
||||
}
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_ERROR,"%s:%d, Link=%d, changeover DPC=%d, rc_status=%d", __FUNCTION__, __LINE__,
|
||||
chl, mtp3_para->nw[nw].routing[spplace].dpc, sp->m3ua_rc_status[spplace]);
|
||||
mtp3_debug(MTP3DB_ERROR,"%s, Link=%d, changeover DPC=%d", __FUNCTION__, chl,
|
||||
mtp3_para->nw[nw].routing[spplace].dpc);
|
||||
|
||||
}
|
||||
|
||||
@@ -5228,10 +5035,6 @@ void hmrt_tcoc_update_routing_tables(WORD chl)
|
||||
primitive_to_userpart(nw,mtp3_para->nw[nw].routing[spplace].dpc,UNAVAILABLE);
|
||||
sp->m3ua_rc_status[spplace] = 0;
|
||||
}
|
||||
if(detail_debug_flag)
|
||||
mtp3_debug(MTP3DB_ERROR,"%s:%d, Link=%d, changeover DPC=%d, rc_status=%d", __FUNCTION__, __LINE__,
|
||||
chl, mtp3_para->nw[nw].routing[spplace].dpc, sp->m3ua_rc_status[spplace]);
|
||||
|
||||
}
|
||||
|
||||
//memset(&ls_sls[lsx16],MAX_LK,16);
|
||||
|
||||
Reference in New Issue
Block a user