📄 u_ievn.c
字号:
else printf ("Not present"); printf ("\n Event Action Result : "); if (ptr->evact_result_pres) { print_objname (&(ptr->evact_name)); if (ptr->evact_result_tag == 0) { printf ("\n Success, Conf Serv Resp: "); list_bytes (ptr->conf_serv_resp,ptr->conf_serv_resp_len); printf ("\n CS Resp Detail: "); if (ptr->cs_rdetail_pres) list_bytes (ptr->cs_rdetail,ptr->cs_rdetail_len); else printf ("Not present "); } else { printf ("\n Failure, Modifier Pos : "); if (ptr->mod_pos_pres) printf ("%lu ", ptr->mod_pos); else printf ("Not present "); list_error_info (ptr->serv_err); } } else printf ("Not present"); } indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* ACKNOWLEDGE EVENT NOTIFICATION *//************************************************************************/#if MMS_ACKEVNOT_EN & RESP_ENST_VOID u_ackevnot_ind (MMSREQ_IND *req_info) {ACKEVNOT_REQ_INFO *ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Acknowledge Event Notification "); ptr = (ACKEVNOT_REQ_INFO *) req_info->req_info_ptr; printf ("\n Event Enrollment Name : "); print_objname (&(ptr->evenroll_name)); printf ("\n Acknowledge State : "); switch (ptr->ack_state) { case 0 : printf ("0, disabled"); break; case 1 : printf ("1, idle"); break; case 2 : printf ("2, active"); break; default: printf ("%d, invalid ack state", ptr->ack_state); break; } printf ("\n Event Time : "); print_evtime (&(ptr->evtime)); printf (" Ack Event Condition Name: "); if (ptr->ackec_name_pres) print_objname (&(ptr->ackec_name)); else printf ("Not present"); } mp_ackevnot_resp (req_info); /* send the response */ indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* GET ALARM SUMMARY *//************************************************************************/#if MMS_GETAS_EN & RESP_ENST_VOID u_getas_ind (MMSREQ_IND *req_info) {GETAS_RESP_INFO *rsp_info;GETAS_REQ_INFO *ptr;ALARM_SUMMARY *as_ptr;ST_UCHAR *inp_str; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Get Alarm Summary "); ptr = (GETAS_REQ_INFO *) req_info->req_info_ptr; printf ("\n Enrollments Only : "); if (ptr->enroll_only) printf ("YES"); else printf ("NO"); printf ("\n Active Alarms Only : "); if (ptr->act_alarms_only) printf ("YES"); else printf ("NO"); printf ("\n Acknowledgement Filter : %d, ", ptr->ack_filter); switch (ptr->ack_filter) { case 0 : printf ("not acked"); break; case 1 : printf ("acked"); break; case 2 : printf ("all"); break; default: printf ("invalid ack filter"); break; } printf ("\n Most Severe Filter : %02X ", ptr->most_sev_filter); printf ("\n Least Severe Filter : %02X ", ptr->least_sev_filter); printf ("\n Continue After Name : "); if (ptr->ca_pres) print_objname (&(ptr->ca_name)); else printf ("Not present"); } /* use first 7K for resp info */ rsp_info = (GETAS_RESP_INFO *) dest_buffer; as_ptr = (ALARM_SUMMARY *) (rsp_info + 1); inp_str = (ST_UCHAR *)dest_buffer + 8192; /* use 8-10K for input strings*/ rsp_info->num_of_alarm_sum = 2; /* create a default response */ as_ptr->evcon_name.object_tag = 0; strcpy (as_ptr->evcon_name.obj_name.vmd_spec, "ecname1"); as_ptr->severity = 0; as_ptr->cur_state = 0; as_ptr->unack_state = 0; memcpy (inp_str, "\x80\x01\x01", 3); as_ptr->addl_detail_pres = SD_TRUE; as_ptr->addl_detail = inp_str; as_ptr->addl_detail_len = 3; inp_str += 3; as_ptr->tti_time_pres = SD_FALSE; as_ptr->tta_time_pres = SD_FALSE; as_ptr++; as_ptr->evcon_name.object_tag = 0; strcpy (as_ptr->evcon_name.obj_name.vmd_spec, "ecname2"); as_ptr->severity = 2; as_ptr->cur_state = 2; as_ptr->unack_state = 2; memcpy (inp_str, "\x80\x01\x02", 3); as_ptr->addl_detail_pres = SD_TRUE; as_ptr->addl_detail = inp_str; as_ptr->addl_detail_len = 3; inp_str += 3; as_ptr->tta_time_pres = SD_TRUE; as_ptr->tta_time.evtime_tag = 0; as_ptr->tta_time.evtime.time_of_day.form = MMS_BTOD6; as_ptr->tta_time.evtime.time_of_day.ms = 12345; as_ptr->tta_time.evtime.time_of_day.day = 86399999; as_ptr->tti_time_pres = SD_TRUE; as_ptr->tti_time.evtime_tag = 0; as_ptr->tti_time.evtime.time_of_day.form = MMS_BTOD6; as_ptr->tti_time.evtime.time_of_day.ms = 12345; as_ptr->tti_time.evtime.time_of_day.day = 86399999; as_ptr++; rsp_info->more_follows = SD_FALSE; if (mms_debug_sel & MMS_LOG_USR_IND) { tot_len = 0; as_ptr = (ALARM_SUMMARY *) (rsp_info + 1); inp_str = (ST_UCHAR *)dest_buffer + 8192; /* use 8-10K for input */ rsp_info->num_of_alarm_sum = 0; printf ("\n"); done = SD_FALSE; while (!done) { printf ("\nAlarm Summary: %d", rsp_info->num_of_alarm_sum+1); printf ("\n Enter Event Condition Name :\n"); if (get_objname (&as_ptr->evcon_name)) { rsp_info->num_of_alarm_sum++; printf (" Enter Severity (0-127) : (default = 0) "); as_ptr->severity = 0; if (intget (&num) && ((num >= 0) && (num <= 127))) as_ptr->severity = (ST_UCHAR) num; printf (" Enter Current State (0-2) (default = 0) : "); as_ptr->cur_state = 0; if (intget (&num) && ((num >= 0) && (num <= 2))) as_ptr->cur_state = num; printf (" Enter Unacknowledged State (0-3) (default = 0) : "); as_ptr->unack_state = 0; if (intget (&num) && ((num >= 0) && (num <= 3))) as_ptr->unack_state = num; printf (" Enter Additional Detail (O) : "); if (len = input_hex ((ST_UCHAR *)tbuf, 100)) { if ((tot_len += len) < 2048) { memcpy (inp_str, tbuf, len); as_ptr->addl_detail_pres = SD_TRUE; as_ptr->addl_detail = inp_str; as_ptr->addl_detail_len = len; inp_str += (len + 1); } else { as_ptr->addl_detail_pres = SD_FALSE; wait_msg ("\n Additional Detail too long, last entry was lost "); } } else as_ptr->addl_detail_pres = SD_FALSE; printf (" Enter Time of Last Transition to Active : \n"); if (get_evtime (&as_ptr->tta_time)) as_ptr->tta_time_pres = SD_TRUE; else as_ptr->tta_time_pres = SD_FALSE; printf (" Enter Time of Last Transition to Idle : \n"); if (get_evtime (&as_ptr->tti_time)) as_ptr->tti_time_pres = SD_TRUE; else as_ptr->tti_time_pres = SD_FALSE; as_ptr++; } else done = SD_TRUE; } rsp_info->more_follows = (ST_BOOLEAN) ask ("\n Enter More Follows (y/n) (default = FALSE) : ",0); } mp_getas_resp (req_info, rsp_info); /* send the response */ indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* GET ALARM ENROLLMENT SUMMARY *//************************************************************************/#if MMS_GETAES_EN & RESP_ENST_VOID u_getaes_ind (MMSREQ_IND *req_info) {GETAES_REQ_INFO *ptr;GETAES_RESP_INFO *rsp_info;ALARM_ENROLL_SUMMARY *aes_ptr;ST_UCHAR *inp_str; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Get Alarm Enrollment Summary "); ptr = (GETAES_REQ_INFO *) req_info->req_info_ptr; printf ("\n Enrollments Only : "); if (ptr->enroll_only) printf ("YES"); else printf ("NO"); printf ("\n Active Alarms Only : "); if (ptr->act_alarms_only) printf ("YES"); else printf ("NO"); printf ("\n Acknowledgement Filter : %d, ", ptr->ack_filter); switch (ptr->ack_filter) { case 0 : printf ("not acked"); break; case 1 : printf ("acked"); break; case 2 : printf ("all"); break; default: printf ("invalid ack filter"); break; } printf ("\n Most Severe Filter : %02X ", ptr->most_sev_filter); printf ("\n Least Severe Filter : %02X ", ptr->least_sev_filter); printf ("\n Continue After Name : "); if (ptr->ca_name_pres) print_objname (&(ptr->ca_name)); else printf ("Not present"); } /* create a default response */ rsp_info = (GETAES_RESP_INFO *) dest_buffer; rsp_info->num_of_alarm_esum = 0; rsp_info->more_follows = SD_FALSE; if (mms_debug_sel & MMS_LOG_USR_IND) { aes_ptr = (ALARM_ENROLL_SUMMARY *) (rsp_info + 1); inp_str = (ST_UCHAR *)dest_buffer + 4096; tot_len = 0; printf ("\n"); done = SD_FALSE; while (!done) { printf ("\nAlarm Enrollment Summary: %d",rsp_info->num_of_alarm_esum+1); printf ("\n Enter Event Enrollment Name : (R) \n"); if (get_objname (&aes_ptr->evenroll_name)) { rsp_info->num_of_alarm_esum++; aes_ptr->client_app_pres = SD_FALSE; if (ask (" Send Client Application? : (y/n) ", 0)) { if (aes_ptr->client_app = get_asn1_app_ref (&len,(ST_UCHAR *)tbuf, sizeof (tbuf))) { if ((tot_len += len) < 4096) { memcpy (inp_str, aes_ptr->client_app, len); aes_ptr->client_app_pres = SD_TRUE; aes_ptr->client_app = inp_str; aes_ptr->client_app_len = len; inp_str += (len + 1); } else wait_msg ("\n Client Application too long, last entry was lost "); } } printf (" Enter Severity (default = 0) : "); aes_ptr->severity = 0; if (intget (&num)) aes_ptr->severity = (ST_UCHAR) num; printf (" Enter Current State (0-2) (default = 0) : "); aes_ptr->cur_state = 0; if (intget (&num)) { if ((num >= 0) && (num <=2)) aes_ptr->cur_state = num; } printf (" Enter Additional Detail : (O) "); if (len = input_hex ((ST_UCHAR *)tbuf, 100)) { if ((tot_len += len) < 4096) { memcpy (inp_str, tbuf, len); aes_ptr->addl_detail_pres = SD_TRUE; aes_ptr->addl_detail = inp_str; aes_ptr->addl_detail_len = len; inp_str += (len + 1); } else { aes_ptr->addl_detail_pres = SD_FALSE; wait_msg ("\n Additional Detail too long, last entry was lost "); } } else aes_ptr->addl_detail_pres = SD_FALSE; if (ask (" Enter Notification Lost (y/n) : (default = FALSE) ", 0)) aes_ptr->not_lost = SD_TRUE; else aes_ptr->not_lost = SD_FALSE; printf (" Enter Alarm Acknowledgment Rule (0-3) : (default = 0) "); aes_ptr->alarm_ack_rule = 0; if (intget (&num)) { if ((num >= 0) && (num <=3)) aes_ptr->alarm_ack_rule = num; } printf (" Enter Enrollment State (0-7) : (O) "); aes_ptr->ee_state_pres = SD_FALSE; aes_ptr->ee_state = 0; if (intget (&num)) { if ((num >= 0) && (num <= 7)) { aes_ptr->ee_state_pres = SD_TRUE; aes_ptr->ee_state = num; } } printf (" Enter Time of Last Transition to Active (O) : \n"); if (get_evtime (&aes_ptr->tta_time)) aes_ptr->tta_time_pres = SD_TRUE; else aes_ptr->tta_time_pres = SD_FALSE; printf (" Enter Active Acknowledged Time (O) : \n"); if (get_evtime (&aes_ptr->aack_time)) aes_ptr->aack_time_pres = SD_TRUE; else aes_ptr->aack_time_pres = SD_FALSE; printf (" Enter Time of Last Transition to Idle (O) : \n"); if (get_evtime (&aes_ptr->tti_time)) aes_ptr->tti_time_pres = SD_TRUE; else aes_ptr->tti_time_pres = SD_FALSE; printf (" Enter Idle Acknowledged Time (O) : \n"); if (get_evtime (&aes_ptr->iack_time)) aes_ptr->iack_time_pres = SD_TRUE; else aes_ptr->iack_time_pres = SD_FALSE; aes_ptr++; } else done = SD_TRUE; } if (ask ("\n Enter More Follows (y/n) : (default = FALSE) ", 0)) rsp_info->more_follows = SD_TRUE; else rsp_info->more_follows = SD_FALSE; } mp_getaes_resp (req_info, rsp_info); /* send the response */ indic_info_wait (); /* allow user to see indic info */ }#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -