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

📄 u_idom.c

📁 ICCP Toolkit 是在 Tru64下开发Tase.2通信协议的开发包
💻 C
📖 第 1 页 / 共 2 页
字号:
      rsp_info.load_data = ext_buf;      }    else      {      rsp_info.load_data_type = LOAD_DATA_NON_CODED;      printf ("\n\n Enter Load Data (HEX) : ");      rsp_info.load_data_len = 0;      rsp_info.load_data_len = input_hex ((ST_UCHAR *)dest_buffer,200);      }        rsp_info.more_follows  = ask (" Enter more follows (y=TRUE, n=FALSE) (default = TRUE) : ",TRUE);    }    mp_upload_resp (req_info, &rsp_info); 	/* send the response	*/#endif  indic_info ();		        }#endif/************************************************************************//* TERMINATE UPLOAD SEQUENCE						*//************************************************************************/#if MMS_TERM_UPL_EN & RESP_ENST_VOID u_termupl_ind (MMSREQ_IND *req_info)  {TERMUPL_REQ_INFO *ptr;  if (mms_debug_sel & MMS_LOG_USR_IND)    {    indic_info_print (req_info,"Terminate Upload Sequence ");    ptr = (TERMUPL_REQ_INFO *) req_info->req_info_ptr;    printf ("\n Upload State Machine Id : %ld", ptr->ulsmid);    }#ifdef VM_ULDL  if (uldl_ctrl_tbl[req_info->chan].uldl_state != UL_IN_PROGRESS)    mp_err_resp (req_info,3,0);  else    {    uldl_ctrl_tbl[req_info->chan].uldl_state = ULDL_IDLE;    if (uldl_ctrl_tbl[req_info->chan].fptr)      {      fclose (uldl_ctrl_tbl[req_info->chan].fptr);      uldl_ctrl_tbl[req_info->chan].fptr = NULL;      }    mp_termupl_resp (req_info);    }#else  mp_termupl_resp (req_info);#endif  indic_info_wait ();			/* allow user to see indic info */  }#endif/************************************************************************//* REQUEST DOMAIN DOWNLOAD						*//************************************************************************/#if MMS_RDDWN_EN & RESP_ENST_VOID u_rddwn_ind (MMSREQ_IND *req_info)  {RDDWN_REQ_INFO  *ptr;ST_INT	i;ST_CHAR	**cap_ptr;FILE_NAME *fname_idx;  if (mms_debug_sel & MMS_LOG_USR_IND)    {    indic_info_print (req_info,"Request Domain Download ");    ptr     = (RDDWN_REQ_INFO *) req_info->req_info_ptr;    cap_ptr = (ST_CHAR **) (ptr + 1);    fname_idx = (FILE_NAME *)(cap_ptr + ptr->num_of_capab);    printf ("\n Domain Name        : %s",ptr->dname);    printf ("\n Sharable           : ");    if (ptr->sharable)      printf ("YES");    else      printf ("NO");    printf ("\n Number of FileNames  : %d ", ptr->num_of_fname);    for (i = 0; i < ptr->num_of_fname; i++, fname_idx++)      {      printf ("\n   %d) ", i+1);      list_bytes ((ST_UCHAR *)fname_idx->fname, fname_idx->fn_len);      }    printf ("\n Number of Capabilities  : %d ", ptr->num_of_capab);    for (i = 0; i < ptr->num_of_capab; i++, cap_ptr++)      printf ("\n   %d)  %s ", i+1, *cap_ptr);    }  mp_rddwn_resp (req_info);			/* send the response	*/  indic_info_wait ();			/* allow user to see indic info */  }#endif/************************************************************************//* REQUEST DOMAIN UPLOAD						*//************************************************************************/#if MMS_RDUPL_EN & RESP_ENST_VOID u_rdupl_ind (MMSREQ_IND *req_info)  {RDUPL_REQ_INFO  *ptr;FILE_NAME *fname_idx;ST_INT	i;  if (mms_debug_sel & MMS_LOG_USR_IND)    {    indic_info_print (req_info,"Request Domain Upload ");    ptr     = (RDUPL_REQ_INFO *) req_info->req_info_ptr;    printf ("\n Domain Name        : %s",ptr->dname);    fname_idx = (FILE_NAME *)(ptr + 1);    printf ("\n Number of FileNames  : %d ", ptr->num_of_fname);    for (i = 0; i < ptr->num_of_fname; i++, fname_idx++)      {      printf ("\n   %d) ", i+1);      list_bytes ((ST_UCHAR *)fname_idx->fname, fname_idx->fn_len);      }    }  mp_rdupl_resp (req_info);			/* send the response	*/  indic_info_wait ();			/* allow user to see indic info */  }#endif/************************************************************************//* LOAD DOMAIN CONTENT							*//************************************************************************/#if MMS_LOAD_DOM_EN & RESP_ENST_VOID u_loaddom_ind (MMSREQ_IND *req_info)  {LOADDOM_REQ_INFO *ptr;ST_INT	i;ST_CHAR	**cap_ptr;ST_CHAR	**init_cap_ptr;FILE_NAME *fname_idx;NAMED_DOM_CTRL *dom;INITDOWN_REQ_INFO *init_down_ptr;ST_INT	size;  if (mms_debug_sel & MMS_LOG_USR_IND)    {    indic_info_print (req_info,"Load Domain Content ");    ptr     = (LOADDOM_REQ_INFO *) req_info->req_info_ptr;    cap_ptr = (ST_CHAR **) (ptr + 1);    fname_idx = (FILE_NAME *)(cap_ptr + ptr->num_of_capab);    printf ("\n Domain Name        : %s",ptr->dname);    printf ("\n Sharable           : ");    if (ptr->sharable)      printf ("YES");    else      printf ("NO");    printf ("\n Number of FileNames  : %d ", ptr->num_of_fname);    for (i = 0; i < ptr->num_of_fname; i++, fname_idx++)      {      printf ("\n   %d) ", i+1);      list_bytes ((ST_UCHAR *)fname_idx->fname, fname_idx->fn_len);      }    printf ("\n Third Party        : ");    if (ptr->third_pty_pres)      print_asn1_app_ref (ptr->third_pty, ptr->third_pty_len);    else      printf ("Not Present");    printf ("\n Number of Capabilities  : %d ", ptr->num_of_capab);    for (i = 0; i < ptr->num_of_capab; i++, cap_ptr++)      printf ("\n   %d)  %s ", i+1, *cap_ptr);    }#ifdef VM_ULDL/* Add a Domain if one does not exist					*/  ptr     = (LOADDOM_REQ_INFO *) req_info->req_info_ptr;  if ((dom = ms_find_named_dom (ptr->dname)) != NULL)      {/* If the Domain exists it must be in the READY state and be network 	*//* deletable.								*/    if ((dom->state != DOM_READY) || (dom->deletable != SD_TRUE))      {      /* send a service error because we are in the wrong state or	*/      /* could not delete the domain contents from another appliction	*/printf ("\n Domain '%s' should be READY and DELETABLE",ptr->dname);      mp_err_resp (req_info, 4, 2);      return;      }    else      {      /* delete the object so we can add the new one and give it the   	*/      /* new list of capabilities.					*/      ms_del_named_dom (ptr->dname);      }    }  size = sizeof (INITDOWN_REQ_INFO) +   (ptr->num_of_capab * sizeof (ST_CHAR *));  init_down_ptr = (INITDOWN_REQ_INFO *)chk_calloc (1, size);  strcpy (init_down_ptr->dname, ptr->dname);  init_down_ptr->sharable = ptr->sharable;  init_down_ptr->num_of_capab = ptr->num_of_capab;  cap_ptr = (ST_CHAR **) (ptr + 1);  init_cap_ptr = (ST_CHAR **) (init_down_ptr + 1);  for (i = 0; i < ptr->num_of_capab; i++, cap_ptr++, init_cap_ptr++)    {    *init_cap_ptr = *cap_ptr;    }  if (dom = ms_add_named_domain (init_down_ptr, 0xff))    {    dom->deletable = SD_TRUE;    dom->state = DOM_READY;    }  chk_free (init_down_ptr);   	/* no leaks please		*/#endif  mp_loaddom_resp (req_info);			/* send the response	*/  indic_info_wait ();			/* allow user to see indic info */  }#endif/************************************************************************//* STORE DOMAIN CONTENT 						*//************************************************************************/#if MMS_STR_DOM_EN & RESP_ENST_VOID u_storedom_ind (MMSREQ_IND *req_info)  {STOREDOM_REQ_INFO *ptr;FILE_NAME *fname_idx;register i;  if (mms_debug_sel & MMS_LOG_USR_IND)    {    indic_info_print (req_info,"Store Domain Content ");    ptr     = (STOREDOM_REQ_INFO *) req_info->req_info_ptr;    printf ("\n Domain Name        : %s",ptr->dname);    fname_idx = (FILE_NAME *)(ptr + 1);    printf ("\n Number of FileNames  : %d ", ptr->num_of_fname);    for (i = 0; i < ptr->num_of_fname; i++, fname_idx++)      {      printf ("\n   %d) ", i+1);      list_bytes ((ST_UCHAR *)fname_idx->fname, fname_idx->fn_len);      }    printf ("\n Third Party        : ");    if (ptr->third_pty_pres)      print_asn1_app_ref (ptr->third_pty, ptr->third_pty_len);    else      printf ("Not Present");    }  mp_storedom_resp (req_info);			/* send the response	*/  indic_info_wait ();			/* allow user to see indic info */  }#endif/************************************************************************//* DELETE DOMAIN							*//************************************************************************/#define	USE_MV_DELDOM#if MMS_DEL_DOM_EN & RESP_ENST_VOID u_deldom_ind (MMSREQ_IND *req_info)  {DELDOM_REQ_INFO *ptr;ST_RET ret;  ptr = (DELDOM_REQ_INFO *) req_info->req_info_ptr;  if (mms_debug_sel & MMS_LOG_USR_IND)    {    indic_info_print (req_info,"Delete Domain ");    printf ("\n Domain Name    : %s",ptr->dname);    }#if defined (USE_MV_DELDOM)  ret = ms_del_named_dom (ptr->dname);  if (ret == SD_SUCCESS)    {    mp_deldom_resp (req_info);			/* send the response	*/    }  else    {    if (ret == MVE_DOMAIN_NAME)      mp_err_resp (req_info,2,1);    else if (ret == MVE_DOM_STATE)      mp_err_resp (req_info,4,2);    }#else  mp_deldom_resp (req_info);			/* send the response	*/#endif  indic_info_wait ();			/* allow user to see indic info */  }#endif/************************************************************************//* GET DOMAIN ATTRIBUTE 						*//************************************************************************/#define	USE_MV_GETDOM_RESP	/* define to use the VM GetDom resp	*/#if MMS_GET_DOM_EN & RESP_ENST_VOID u_getdom_ind (MMSREQ_IND *req_info)  {GETDOM_REQ_INFO	*ptr;#if !defined (USE_MV_GETDOM_RESP)GETDOM_RESP_INFO *rsp_info;ST_CHAR	**cap_ptr;ST_CHAR	**pin_ptr;ST_CHAR	 *inp_str;#endif  if (mms_debug_sel & MMS_LOG_USR_IND)    {    indic_info_print (req_info,"Get Domain Attribute ");    ptr = (GETDOM_REQ_INFO *) req_info->req_info_ptr;    printf ("\n Domain Name     : %s",ptr->dname);    }#if defined (USE_MV_GETDOM_RESP)  mv_getdom_resp (req_info);  indic_info_wait ();			/* allow user to see indic info */#else					/* use first 2K for resp info	*/  rsp_info = (GETDOM_RESP_INFO *) dest_buffer;  cap_ptr  = (ST_CHAR **) (rsp_info + 1);  inp_str  = dest_buffer + 2048;	/* use 3-10K for input strings	*/  rsp_info->num_of_capab = 3;		/* create a default response	*/  strcpy (inp_str, "capability_1");  *cap_ptr++ = inp_str;  inp_str += strlen (inp_str) + 1;  strcpy (inp_str, "capability_2");  *cap_ptr++ = inp_str;  inp_str += strlen (inp_str) + 1;  strcpy (inp_str, "capability_3");  *cap_ptr++ = inp_str;  inp_str += strlen (inp_str) + 1;  rsp_info->mms_deletable  = SD_FALSE;  rsp_info->sharable	   = SD_FALSE;  pin_ptr = cap_ptr;  rsp_info->num_of_pinames = 2;  strcpy (inp_str, "piname_1");  *pin_ptr++ = inp_str;  inp_str += strlen (inp_str) + 1;  strcpy (inp_str, "piname_2");  *pin_ptr++ = inp_str;  inp_str += strlen (inp_str) + 1;  rsp_info->state	   = 0;  rsp_info->upload_in_progress = 0;  if (mms_debug_sel & MMS_LOG_USR_IND)    {    tot_len = 0;    cap_ptr  = (ST_CHAR **) (rsp_info + 1);	/* reinitialize buffer pointers */    inp_str  = dest_buffer + 2048;    rsp_info->num_of_capab  = 0;    printf ("\n\n");    done = SD_FALSE;    while (!done)      {      printf (" Enter Capability String : (O) ");      if (strget (tbuf))        {        if ((tot_len += strlen (tbuf) + 1) < 8192)  	  {  	  rsp_info->num_of_capab++;  	  strcpy (inp_str, tbuf);  	  *cap_ptr = inp_str;  	  cap_ptr++;  	  inp_str += strlen (inp_str) + 1;  	  }        else  	  {  	  done = SD_TRUE;  	  wait_msg ("\n Capabilities List too ST_INT32, last string was lost. ");  	  }        }      else        done = SD_TRUE;			/* set exit condition		*/      }    rsp_info->mms_deletable = ask (" Enter whether MMS is deletable (y,n) (default = y) : ",SD_TRUE);    rsp_info->sharable = ask (" Enter whether domain is sharable (y,n) (default = y) : ",SD_TRUE);    pin_ptr = cap_ptr;    rsp_info->num_of_pinames = 0;    done = SD_FALSE;    while (!done)      {      printf (" Enter Program Invocation Name : (O) ");      if (strget (tbuf))        {        if ((tot_len += strlen (tbuf) + 1) < 8192)  	  {  	  rsp_info->num_of_pinames++;  	  strcpy (inp_str, tbuf);  	  *pin_ptr = inp_str;  	  pin_ptr++;  	  inp_str += strlen (inp_str) + 1;  	  }        else  	  {          done = SD_TRUE;  	  wait_msg ("\n Capabilities + PI Name List too ST_INT32, last string lost.");  	  }        }      else        done = SD_TRUE;			/* set exit condition		*/      }    printf (" Enter State (default = 0) :");    rsp_info->state = 0;    intget (&rsp_info->state);      printf (" Enter Upload in Progress (default = 0) :");    rsp_info->upload_in_progress = 0;    if (intget (&num))      rsp_info->upload_in_progress = (ST_CHAR) num;    }  mp_getdom_resp (req_info, rsp_info);		/* send the response	*/  indic_info ();	#endif  }#endif

⌨️ 快捷键说明

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