⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mplsb10.c

📁 技术文件名称:MPLSv1.0软件模块测试规程
💻 C
📖 第 1 页 / 共 3 页
字号:
 *  NOTE          :  ..                                                 
*   2002-11-23      sbp    修改提示信息                             
/************************************************************************/
int16 mplsCommonErrorMsg(struct sty *sty,int16 ResMsgNo)
{
   if(ResMsgNo==MPLS_SDP_CMD_SUCCESS)
       return SDP_CMD_SUCCESS;
   else
   {
   	   switch(ResMsgNo)
   	   {
   	      case MPLS_EGRESS_FOR_CONFIG:
   	      	 {
   	      	 	sdp_printf(sty,"   This policy change needn't restart routing protocols!\n");
   	      	 	ResMsgNo = SDP_CMD_SUCCESS;
   	      	 	break;
   	      	}                          /* add by lixia for egress for policy */
   	      case MPLS_LSRID_NOT_CONFIG: 
   	           {
   	              sdp_printf(sty,"  Please configure the router ID first!\n");  /* 把空格去掉 2002-12-11 sbp */
   	              break;
   	           }
   	      case MPLS_TRANSPORT_ADDR_FIRST_DELETE: 
   	           {
   	              sdp_printf(sty,"  Transport address already configured!\n");
                
   	              break;
   	           }
   	      case MPLS_MODULE_NO_ERROR: 
   	           {
   	              sdp_printf(sty, "  Module No. wrong!\n");
   	              break;
   	           }
   	      case MPLS_NOT_PERMIT_THRESHOLD: 
   	           {
   	              sdp_printf(sty, "  Session trap diable, not configure the threshold.\n");
   	              break;
   	           }
   	      case MPLS_LSR_ID_EXIST_ERROR:
   	           {
   	              sdp_printf(sty," Please delete the LsrId before configure it again! \n");
   	              break;
   	           }
   	      case MPLS_LSR_ID_SWITCH_ERROR:
   	           {
   	              sdp_printf(sty,"  LSR ID can't be configured now, please try later!\n");
   	              break;
   	           }
   	      case MPLS_LSRID_OR_LDP_START_ERROR:
   	           {
   	              sdp_printf(sty,"  LSR ID hasn't been configured or the LDP process not started! \n");
   	              break;
   	           }
   	      case MPLS_LOOP_DETECTION_DENY:
   	           {
   	              sdp_printf(sty,"   Loop detection method prohibitted!\n");
   	              break;
   	           }
   	      case MPLS_ACCESS_LIST_EXIST_ERROR:
   	           {
   	              sdp_printf(sty,"   The access list not exist!\n");
   	              break;
   	           }
   	      case MPLS_MEMERY_ALLOCAT_ERROR:     /* MEMORY ALLOCAT ERROR  ADD SBP 2001-12-21 */
   	           {
   	              sdp_printf(sty,"   Memory unavailable!\n");
   	              break;
   	           }
   	      case MPLS_NOT_FIND_LSP_ON_LSPNO:    /* MEMORY ALLOCAT ERROR  ADD SBP 2001-12-21 */
   	           {
   	              sdp_printf(sty,"    LSP not found!\n");
   	              return SDP_CMD_SUCCESS;
   	           }
   	      case MPLS_CR_LSP_WARNING_DELETE: /* 提示删除相应的LSP   , add  sbp  2001-12-21 */
   	           {
   	              sdp_printf(sty," The connection between QoS Filter and LSP has been deleted. You should delete\n the corresponding LSP.\n");
   	              return SDP_CMD_SUCCESS;
   	           }
          case MPLS_QOS_CR_LSP_BINDINGS_NOT_ZERO:   /* QoS Filter has lsp binded to it,
                                                    so can delete the filter sbp 2001-12-21 */
               {
   	              sdp_printf(sty,"  You shouldn't delete the QoS Filter, because LSP binded to it exists.\n");
   	              break;
   	           }
   	      case MPLS_QOS_CR_LSP_BINDINGS_NOT_MOD: /* szh add 2003-10-22 */
   	           {
                   sdp_printf(sty,"  You shouldn't mod the QoS Filter, because LSP binded to it exists.\n");
   	               break;
   	           }       	                 
   	      case MPLS_QOS_FILTER_NOT_FOUND:  /* QoS Filter has been not found, add sbp 2001-12-21 */
               {
   	              sdp_printf(sty,"  Filter not found.\n");
   	              break;
   	           }
   	      case MPLS_CR_LSP_NOT_EXIST:  /* THE LSP IS NOT EXIST SBP 2001-12-25 */
               {
   	              sdp_printf(sty,"   The LSP doesn't exist.\n");
   	              break;
   	           }
             case MPLS_ETHI_NOT_CONFIG_VPI_VCI:  /* ETHI IS NOT CONFIGURED VPI/VCI SBP 2001-12-25 */
               {
   	              sdp_printf(sty,"   Not ATM port!\n");
   	              break;
   	           }
   	      case MPLS_VPI_VCI_CONFIG_OUTOF_RANGE:  /* VPi or vci out of range of system  sbp 2001-12-25 */
               {
   	              sdp_printf(sty,"    Vpi or Vci out of range of system!\n");
   	              break;
   	           }
   	      case MPLS_ATM_NOT_CONFIG_LABEL:   /* atm IS NOT CONFIGURED VPI/VCI SBP 2001-12-25 */
               {
   	              sdp_printf(sty,"    Not ethernet port!\n");
   	              break;
   	           }
   	      case MPLS_ETHI_NOT_CONFIG_BANDWIDTH:  /* SBP 2001-12-28  bandwidth can not be configured on the ehti port  */
               {
   	              sdp_printf(sty,"    Not ATM port!\n");
   	              break;
   	           }
   	      case MPLS_ATM_BANDWIDTH_OUT_OF_RANGE: /* SBP 2001-12-28   the bandwidth OUT OF RANGE */
               {
   	              sdp_printf(sty,"   Bandwidth out of range!\n");
   	              break;
   	           }
   	      case MPLS_ATM_ETHI_LABLE_SPACE_ERROR:  /* SBP 2001-12-28  label space is error */
               {
   	              sdp_printf(sty,"   The label space is wrong.\n");
   	              break;
   	           }
   	      case MPLS_LDP_OPTIONAL_PARAMETER_ERROR: /* SBP 2001-12-28  MPLS LDP entity optional parameter is wrong or right */
               {
   	              sdp_printf(sty,"   The LDP entity optional parameter is wrong.\n");
   	              break;
   	           }
   	      case MPLS_OQS_FILTER_PHYPORT_TOO_MANY: /* SBP 2001-12-28  MPLS LDP entity optional parameter is wrong or right */
               {
   	              sdp_printf(sty,"   Too many physical ports configured!\n");
   	              break;
   	           }
   	      case MPLS_TUNNEL_TO_TWO_FILTER:
   	           {
   	              sdp_printf(sty,"   One tunnel can not be binded to two filters!\n");
   	              break;
   	           }
   	      case MPLS_FILTER_PORT_EORROR:  /* sbp 2002-12-18 */
   	           {
   	              sdp_printf(sty,"   The maximum port number should not be smaller than the minimum port number!\n");
   	              break;
   	           }
   	      case MPLS_LOOP_DETECT_AGGREGATE:
   	           {
   	              sdp_printf(sty,"   Aggregation will be invalid!\n");
   	              return SDP_CMD_SUCCESS;
   	           }
   	      case MPLS_FILTER_NO_DST:
   	           {
   	              sdp_printf(sty,"   The filter's destination should be configured!\n");
   	              break;
   	           }
          default:
              break; 
   	   }
   	   
   	   return ResMsgNo;
   }
}
/************************************************************************
* FUNCTION NAME  : sdp_check_atm_module_port_no()	                            
 * DESCRIPTION:   : check whether the ATM modue and port no is right			    
 *  INPUT         : number : string inputted                           				
 *  OUTPUT        : special value or fail message		                           				
 *  AUTHOR/DATE   : Sun Baoping/ 01.12.12                               
 *  GLOBAL        : NONE						
 *  NOTE          :                                                 
 * 2002.11.28 Sunbaoping 处理端口配置与数据无关
 * 2004.9.20 lixia只允许对lic配置
 * 2004.9.20  lixia修改对M2000配置的判断条件
 * 2004.9.20  lixia修改板类型判断条件为:非GEI类型板,因为配置的单板可能不在线,查不到相应的信息,此时可以配置
/************************************************************************/
int16 sdp_check_atm_module_port_no(int8 * number)
{
    int16   val_len,count_num=0,count_num1=0;
    int8    * p_temp;
    int8    f_temp[3];
    int8    n_temp[3];
    int16   num,num1;  
    uchar   temp_module,temp_port;
    uchar   numFnd;
    uchar   cardtype;

    memset(f_temp,0,sizeof(int8)*3);
    memset(n_temp,0,sizeof(int8)*3);

    p_temp=number;
    val_len=STRLEN(p_temp);
    while ((*p_temp >= '0') && (*p_temp <= '9'))
    {
    	f_temp[count_num]=*p_temp;
        p_temp++;
        count_num++;
    }
    if(*p_temp!='/')
       return SDP_PARAM_NO_USE;
    else
    {
       p_temp++;
       count_num++;
    }
    
    while ((*p_temp >= '0') && (*p_temp <= '9'))
    {
    	n_temp[count_num1]=*p_temp;
        p_temp++;
        count_num++;
        count_num1++;
    } 
    if ( count_num != val_len )  
        return SDP_PARAM_NO_USE;
    if(count_num>9)
        return SDP_PARAM_NO_USE;
    temp_module = attache_atoi( f_temp );
    temp_port   = attache_atoi( n_temp );

    
        if(mplsOamLocalPlatformType==MPLS_OAM_PLATFORM_M1000)
        {
    	 if( temp_module !=0||temp_port  > 4  ||temp_port < 1)
    	   return SDP_PARAM_NO_USE;
        }
    else if(mplsOamLocalPlatformType==MPLS_OAM_PLATFORM_AX)
                   {
    	if( temp_module  > 13 || temp_module <7||temp_port  > 4  ||temp_port < 1)
    	   return SDP_PARAM_NO_USE;
    	   cardtype = fecLdpGetCardTypeOnModule(temp_module);
        if((cardtype>=MPLS_CARDTYPE_GEI)&&(cardtype<=MPLS_GEICARD_END)) /*2004-6-2 lixia mod*/
    	   //if(!((cardtype>=MPLS_CARDTYPE_LIC1)&&(cardtype<=MPLS_APCLIC_END)))
    	       return SDP_PARAM_NO_USE;
                       }
    else if(mplsOamLocalPlatformType==MPLS_OAM_PLATFORM_BX)
    {
    	/*modify by xjs,放大端口数到8,此处应该按板类型来区分,2003-7-29 18:38*/
    	if( temp_module  > 11 || temp_module <2||temp_port  > 8  ||temp_port < 1)
    	   return SDP_PARAM_NO_USE;
    	cardtype = fecLdpGetCardTypeOnModule(temp_module);
        if((cardtype>=MPLS_CARDTYPE_GEI)&&(cardtype<=MPLS_GEICARD_END))  /*2004-6-2 lixia mod*/
    	   //if(!((cardtype>=MPLS_CARDTYPE_LIC1)&&(cardtype<=MPLS_APCLIC_END)))
    	       return SDP_PARAM_NO_USE;
                   }
    else if(mplsOamLocalPlatformType==MPLS_OAM_PLATFORM_M2000)  /* M2K MPLSPORT 2003-6-20 */
    {
	 if(!((temp_module ==0 && (temp_port == 15 || temp_port == 16))||
	     ((temp_module  > 5  &&temp_module < 9)&&(temp_port >0 && temp_port < 5))))
	   return SDP_PARAM_NO_USE;
	   cardtype = fecLdpGetCardTypeOnModule(temp_module);
         if((cardtype>=MPLS_CARDTYPE_GEI)&&(cardtype<=MPLS_GEICARD_END))  /*2004-6-2 lixia mod*/
    	  // if(!(((cardtype>=MPLS_CARDTYPE_LIC1)&&(cardtype<=MPLS_APCLIC_END))||((cardtype>=MPLS_CARDTYPE_MPU)&&(cardtype<=MPLS_MPU_END))))  /* 2004.5.8  lixia修改对M2000配置的判断条件*/
    	       return SDP_PARAM_NO_USE;
    }
                   else
        return SDP_PARAM_NO_USE;
        
            return SDP_PARAM_CHAR ;
}
/************************************************************************
 * FUNCTION NAME  : sdp_check_ethernet_module_port_no()	                            
 * DESCRIPTION:   : check whether the ETHERNET modue and port no is right			    
 *  INPUT         : number : string inputted                           				
 *  OUTPUT        : special value or fail message		                           				
 *  AUTHOR/DATE   : Sun Baoping/ 01.12.12                               
 *  GLOBAL        : NONE						
 *  NOTE          :                                                 
 * 2002.11.28 Sunbaoping 处理端口配置与数据无关
/************************************************************************/
int16 sdp_check_ethernet_module_port_no(int8 * number)
{
    int16   val_len,count_num=0,count_num1=0;
    int8    * p_temp;
    int8    f_temp[3];
    int8    n_temp[3];
    int16   num,num1;  
    uchar   temp_module,temp_port;
    uchar   numFnd;

    memset(f_temp,0,sizeof(int8)*3);
    memset(n_temp,0,sizeof(int8)*3);
    
    p_temp=number;
    val_len=STRLEN(p_temp);
    while ((*p_temp >= '0') && (*p_temp <= '9'))
    {
    	f_temp[count_num]=*p_temp;
        p_temp++;
        count_num++;
    }
    if(*p_temp!='/')
       return SDP_PARAM_NO_USE;
    else
    {
       p_temp++;
       count_num++;
    }
    
    while ((*p_temp >= '0') && (*p_temp <= '9'))
    {
    	n_temp[count_num1]=*p_temp;
        p_temp++;
        count_num++;
        count_num1++;
    } 
    if ( count_num != val_len )  
        return SDP_PARAM_NO_USE;
    if(count_num>9)
        return SDP_PARAM_NO_USE;
    temp_module = attache_atoi( f_temp );
    temp_port   = attache_atoi( n_temp );

    if(mplsOamLocalPlatformType==MPLS_OAM_PLATFORM_M1000||mplsOamLocalPlatformType==MPLS_OAM_PLATFORM_BX)
                   	   {
    	 if( temp_module  >= 5 || temp_module <=0||temp_port  > 8  ||temp_port < 1)
    	   return SDP_PARAM_NO_USE;
                   }
    else if(mplsOamLocalPlatformType==MPLS_OAM_PLATFORM_AX)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -