📄 u_cdom.c
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//* (c) Copyright Systems Integration Specialists Company, Inc., *//* 1986 - 1997, All Rights Reserved. *//* *//* MODULE NAME : u_cdom.c *//* PRODUCT(S) : MMSEASE *//* *//* MODULE DESCRIPTION : *//* This module contains user confirm functions. These functions *//* are invoked from 'mms_req_serve' when the response to an *//* outstanding request is received. These functions should check *//* the resp_err member of the request control structure before *//* assuming returned data. *//* *//* NOTES ON REQUEST INFORMATION : *//* In the user application, request information structures may be *//* committed when the request is made (e.g. for error recovery). *//* If so, these information buffers could be freed in the confirm *//* functions. In the sample application, all request information *//* structures are automatic or handled when the request is issued. *//* *//* GLOBAL FUNCTIONS DEFINED IN THIS MODULE : *//* *//* MODIFICATION LOG : *//* Date Who Rev Comments *//* -------- --- ------ ------------------------------------------- *//* 04/15/97 DSF 7.00 MMSEASE 7.0 release. See MODL70.DOC for *//* history. *//************************************************************************/#include "glbtypes.h"#include "sysincs.h"#include "mms_usr.h"#include "mms_pdom.h"#include "mms_vdom.h"#include "userdefs.h"#include "mmsop_en.h"#include "gvaldefs.h"#include "scrndefs.h"#include "fkeydefs.h"/************************************************************************//* For debug version, use a static pointer to avoid duplication of *//* __FILE__ strings. *//************************************************************************/#ifdef DEBUG_SISCOstatic ST_CHAR *thisFileName = __FILE__;#endif/************************************************************************//************************************************************************//* DOMAIN MANAGEMENT *//************************************************************************//************************************************************************//* MP INITDWN *//************************************************************************/#if MMS_INIT_DWN_EN & REQ_ENST_VOID u_mp_initdown_conf (MMSREQ_PEND *req_ptr) { if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Initiate Download Sequence "); if (req_ptr->resp_err) list_err_info (req_ptr); conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP DWNLOAD *//************************************************************************/#if MMS_DWN_LOAD_EN & REQ_ENST_VOID u_mp_download_conf (MMSREQ_PEND *req_ptr) {DOWNLOAD_RESP_INFO *ptr;DOWNLOAD_REQ_INFO dlreq;TERMDOWN_REQ_INFO tdreq;ST_CHAR junk[100];EXTERN_INFO ext; if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Download Segment "); if (req_ptr->resp_err) list_err_info (req_ptr); else { ptr = (DOWNLOAD_RESP_INFO *) req_ptr->resp_info_ptr; printf ("\n More Follows : "); if (ptr->more_follows) printf ("SD_TRUE"); else printf ("FALSE"); printf ("\n Load Data Length : %d", ptr->load_data_len); if (ptr->load_data_type == LOAD_DATA_CODED) { printf ("\n CODED LOAD DATA"); if (ask ("\n Do you want to decode and list EXTERNAL (y,n) (default = n) : ",0)) { if (!ms_decode_extern (ptr->load_data, ptr->load_data_len,&ext)) list_external (stdout,&ext); else { printf ("\n EXTERNAL decode error\n"); list_bytes (ptr->load_data, ptr->load_data_len); } } else list_bytes (ptr->load_data, ptr->load_data_len); } else { printf ("\n NON-CODED LOAD DATA"); if (ptr->load_data_len > 0) { printf ("\n Enter A for ASCII display, just ENTER for HEX : "); if (strget (junk) && (junk[0] == 'A' || junk[0] == 'a')) { printf ("\n "); list_ascii ((ST_CHAR *)ptr->load_data, ptr->load_data_len); } else { printf ("\n"); list_bytes (ptr->load_data, ptr->load_data_len); } } } /* non-coded */ } /* not error */ conf_info_wait (); }#ifdef VM_ULDL/* For VM download operation, handle the conf data and send another *//* download segment request if appropriate */ if (req_ptr->resp_err) { uldl_ctrl_tbl[req_ptr->chan].uldl_state = ULDL_IDLE; fclose (uldl_ctrl_tbl[req_ptr->chan].fptr); uldl_ctrl_tbl[req_ptr->chan].fptr = NULL; ms_del_named_dom (uldl_ctrl_tbl[req_ptr->chan].dname); } else /* Success */ { ptr = (DOWNLOAD_RESP_INFO *) req_ptr->resp_info_ptr; fwrite (ptr->load_data, 1, ptr->load_data_len, uldl_ctrl_tbl[req_ptr->chan].fptr); if (ptr->more_follows) { strcpy (dlreq.dname,uldl_ctrl_tbl[req_ptr->chan].dname); mp_download (req_ptr->chan,&dlreq); } else /* Download is complete */ { strcpy (tdreq.dname,uldl_ctrl_tbl[req_ptr->chan].dname); tdreq.discarded = SD_FALSE; mp_termdown (req_ptr->chan,&tdreq); fclose (uldl_ctrl_tbl[req_ptr->chan].fptr); uldl_ctrl_tbl[req_ptr->chan].fptr = NULL; } } /* not error */#endif /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP TERMDWN *//************************************************************************/#if MMS_TERM_DWN_EN & REQ_ENST_VOID u_mp_termdown_conf (MMSREQ_PEND *req_ptr) { if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Terminate Download Sequence "); if (req_ptr->resp_err) list_err_info (req_ptr); conf_info_wait (); }#ifdef VM_ULDL uldl_ctrl_tbl[req_ptr->chan].uldl_state = ULDL_IDLE; uldl_ctrl_tbl[req_ptr->chan].dom->state = DOM_READY;#endif /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MV DOWNLOAD *//************************************************************************/#if MMS_MV_DWN_EN & REQ_ENST_VOID u_mv_download_conf (MMSREQ_PEND *req_ptr) {MV_DL_REQ_INFO *dl_req_info; dl_req_info = (MV_DL_REQ_INFO *)req_ptr->req_info_ptr; if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Domain Download"); if (req_ptr->resp_err) list_err_info (req_ptr); printf (" \n# of bytes downloaded to the server: %ld", dl_req_info->asn1_byte_count); conf_info_wait (); }/* if we opened up a file for the VM to download we have to close it*/ if (dl_req_info->type == FILDOM) fclose (dl_req_info->i.fileinfo.fp); /* take care of continuous send var */ ms_clr_mvreq (req_ptr); /* clear the VM command info */ } #endif/************************************************************************//* MP INITUPL *//************************************************************************/#if MMS_INIT_UPL_EN & REQ_ENST_VOID u_mp_initupl_conf (MMSREQ_PEND *req_ptr) {INITUPL_RESP_INFO *ptr;ST_CHAR **cap_ptr;ST_INT i; if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Initiate Upload Sequence "); if (req_ptr->resp_err) list_err_info (req_ptr); else { ptr = (INITUPL_RESP_INFO *) req_ptr->resp_info_ptr; cap_ptr = (ST_CHAR **) (ptr + 1); printf ("\n Upload State Machine ID : %ld", ptr->ulsmid); 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); } conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP UPLOAD *//************************************************************************/#if MMS_UP_LOAD_EN & REQ_ENST_VOID u_mp_upload_conf (MMSREQ_PEND *req_ptr) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -