📄 u_ievn.c
字号:
printf ("Not Present"); printf ("\n Event Action Name : "); if (req_ptr->evact_name_pres) print_objname (&(req_ptr->evact_name)); else printf ("Not present"); printf ("\n Continue After Name : "); if (req_ptr->ca_name_pres) print_objname (&(req_ptr->ca_name)); else printf ("Not present"); printf ("\n Event Enrollment Names : "); if (req_ptr->eenames_pres) { printf ("%d ", req_ptr->num_of_eenames); obj_ptr = (OBJECT_NAME *) (req_ptr + 1); line = 16; for (j = 0; j < req_ptr->num_of_eenames; j++) { print_objname (obj_ptr); obj_ptr++; line += 2; if (line >= 22) { if ((j+1) < req_ptr->num_of_eenames) printf ("\n\n Press return to continue, x to exit"); else printf ("\n\n Press return to continue"); ch = get_a_char (); if (ch == 'x' || ch == 'X') j = req_ptr->num_of_eenames; /* exit selected */ line = 16; } } } else printf ("Not present"); } /* create a default response */ rsp_info = (GETEEA_RESP_INFO *) dest_buffer; rsp_info->num_of_evenroll = 0; rsp_info->more_follows = SD_FALSE; if (mms_debug_sel & MMS_LOG_USR_IND) { ee_ptr = (EVENT_ENROLLMENT *) (rsp_info + 1); inp_str = (ST_UCHAR *) dest_buffer + 4096; tot_len = 0; printf ("\n"); done = SD_FALSE; while (!done) { printf ("\n Event Enrollment %d)", rsp_info->num_of_evenroll+1); printf ("\n Enter Event Enrollment Name : (R)\n"); if (get_objname (&ee_ptr->evenroll_name)) { rsp_info->num_of_evenroll++; printf (" Enter Event Condition Name : (default = undefined)\n"); if (get_objname (&ee_ptr->evcon_name)) ee_ptr->evcon_name_tag = 0; else ee_ptr->evcon_name_tag = 1; if (ask (" Send Event Action Name? : (y/n) ",0)) { ee_ptr->evact_name_pres = SD_TRUE; printf (" Enter Event Action Name : (default = undefined)\n"); if (get_objname (&ee_ptr->evact_name)) ee_ptr->evact_name_tag = 0; else ee_ptr->evact_name_tag = 1; } else ee_ptr->evact_name_pres = SD_FALSE; ee_ptr->client_app_pres = SD_FALSE; if (ask (" Send Client Application? : (y/n) ",0)) { if (ee_ptr->client_app = get_asn1_app_ref (&len,(ST_UCHAR *)tbuf, sizeof (tbuf))) { if ((tot_len += len) < 4096) { memcpy (inp_str, ee_ptr->client_app, len); ee_ptr->client_app_pres = SD_TRUE; ee_ptr->client_app = inp_str; ee_ptr->client_app_len = len; inp_str += (len + 1); } else wait_msg ("\n Client Application too long, last entry was lost "); } } if (ask (" Enter MMS Deletable (y/n) : (default = FALSE) ", 0)) ee_ptr->mms_deletable = SD_TRUE; else ee_ptr->mms_deletable = SD_FALSE; printf (" Enter Enrollment Class (0-1): (default = 0) "); ee_ptr->ee_class = 0; if (intget (&num)) { if ((num >= 0) && (num <=1)) ee_ptr->ee_class = num; } printf (" Enter Duration (0-1) : (default = 0) "); ee_ptr->duration = 0; if (intget (&num)) { if ((num >= 0) && (num <=1)) ee_ptr->duration = num; } printf (" Enter Invoke Id : (O) "); ee_ptr->invoke_id_pres = SD_FALSE; if (intget (&num)) { ee_ptr->invoke_id_pres = SD_TRUE; ee_ptr->invoke_id = (unsigned long) num; } printf (" Enter Remaining Acceptable Delay : (O) "); ee_ptr->rem_acc_delay_pres = SD_FALSE; if (intget (&num)) { ee_ptr->rem_acc_delay_pres = SD_TRUE; ee_ptr->rem_acc_delay = (unsigned long) num; } printf (" Enter Additional Detail : (O) "); if (len = input_hex ((ST_UCHAR *)tbuf, 100)) { if ((tot_len += len) < 2048) { memcpy (inp_str, tbuf, len); ee_ptr->addl_detail_pres = SD_TRUE; ee_ptr->addl_detail = inp_str; ee_ptr->addl_detail_len = len; inp_str += (len + 1); } else { ee_ptr->addl_detail_pres = SD_FALSE; wait_msg ("\n Additional Detail too long, last entry was lost "); } } else ee_ptr->addl_detail_pres = SD_FALSE; ee_ptr->ackec_name_pres = SD_FALSE; if (ask (" Send Acknowledgement Event Condition Name? : (y/n) ",0)) { ee_ptr->ackec_name_pres = SD_TRUE; printf (" Enter Ack Event Cond Name : (default = undefined)\n"); if (get_objname (&ee_ptr->ackec_name)) ee_ptr->ackec_name_tag = 0; else ee_ptr->ackec_name_tag = 1; } ee_ptr++; } else done = SD_TRUE; } if (ask (" Enter More Follows (y/n) : (default = FALSE) ", 0)) rsp_info->more_follows = SD_TRUE; else rsp_info->more_follows = SD_FALSE; } mp_geteea_resp (req_info, rsp_info); /* send the response */ indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* REPORT EVENT ENROLLMENT STATUS *//************************************************************************/#if MMS_REPEES_EN & RESP_ENST_VOID u_repees_ind (MMSREQ_IND *req_info) {REPEES_REQ_INFO *ptr;REPEES_RESP_INFO rsp_info; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Report Event Enrollment Status "); ptr = (REPEES_REQ_INFO *) req_info->req_info_ptr; printf ("\n Event Enrollment Name : "); print_objname (&(ptr->evenroll_name)); } /* create a default response */ rsp_info.ec_transitions = 0x00; rsp_info.not_lost = SD_FALSE; rsp_info.duration = 0; rsp_info.alarm_ack_rule_pres = SD_TRUE; rsp_info.alarm_ack_rule = 0; rsp_info.cur_state = 0; if (mms_debug_sel & MMS_LOG_USR_IND) { printf ("\n\n Enter Event Condition Transitions : (default = no) "); if (ask ("\n Idle to Disabled (y/n) : ", 0)) rsp_info.ec_transitions |= 0x01; if (ask (" Active to Disabled (y/n) : ", 0)) rsp_info.ec_transitions |= 0x02; if (ask (" Disabled to Idle (y/n) : ", 0)) rsp_info.ec_transitions |= 0x04; if (ask (" Active to Idle (y/n) : ", 0)) rsp_info.ec_transitions |= 0x08; if (ask (" Disabled to Active (y/n) : ", 0)) rsp_info.ec_transitions |= 0x10; if (ask (" Idle to Active (y/n) : ", 0)) rsp_info.ec_transitions |= 0x20; if (ask (" Any to Deleted (y/n) : ", 0)) rsp_info.ec_transitions |= 0x40; if (ask (" Enter Notification Lost (y/n) : (default = FALSE) ", 0)) rsp_info.not_lost = SD_TRUE; else rsp_info.not_lost = SD_FALSE; printf (" Enter Duration (0-1) : (default = 0) "); if (intget (&num)) { if ((num >= 0) && (num <=1)) rsp_info.duration = num; } printf (" Enter Alarm Acknowledgment Rule (0-3) : (O) "); rsp_info.alarm_ack_rule_pres = SD_FALSE; if (intget (&num)) { if ((num >= 0) && (num <=3)) { rsp_info.alarm_ack_rule_pres = SD_TRUE; rsp_info.alarm_ack_rule = num; } } printf (" Enter Current State (0-7) : (default = 0) "); if (intget (&num)) { if ((num >= 0) && (num <=7)) rsp_info.cur_state = num; } } mp_repees_resp (req_info, &rsp_info); /* send the response */ indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* ALTER EVENT ENROLLMENT *//************************************************************************/#if MMS_ALTEE_EN & RESP_ENST_VOID u_altee_ind (MMSREQ_IND *req_info) {ALTEE_REQ_INFO *ptr;ALTEE_RESP_INFO rsp_info; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Alter Event Enrollment "); ptr = (ALTEE_REQ_INFO *) req_info->req_info_ptr; printf ("\n Event Enrollment Name : "); print_objname (&(ptr->evenroll_name)); printf ("\n Event Cond Transitions : "); if (ptr->ec_transitions_pres) { printf ("%02x",ptr->ec_transitions); printf ("\n Idle to Disabled : "); if (ptr->ec_transitions & 0x01) printf ("set "); else printf ("not set "); printf ("\n Active to Disabled : "); if (ptr->ec_transitions & 0x02) printf ("set "); else printf ("not set "); printf ("\n Disabled to Idle : "); if (ptr->ec_transitions & 0x04) printf ("set "); else printf ("not set "); printf ("\n Active to Idle : "); if (ptr->ec_transitions & 0x08) printf ("set "); else printf ("not set "); printf ("\n Disabled to Active : "); if (ptr->ec_transitions & 0x10) printf ("set "); else printf ("not set "); printf ("\n Idle to Active : "); if (ptr->ec_transitions & 0x20) printf ("set "); else printf ("not set "); printf ("\n Any to Deleted : "); if (ptr->ec_transitions & 0x40) printf ("set "); else printf ("not set "); } else printf ("Not Present"); printf ("\n Alarm Ack Rule : "); if (ptr->alarm_ack_rule_pres) { printf ("%d, ", ptr->alarm_ack_rule); switch (ptr->alarm_ack_rule) { case 0 : printf ("none"); break; case 1 : printf ("simple"); break; case 2 : printf ("ack active"); break; case 3 : printf ("ack all"); break; default: printf ("invalid ack rule"); break; } } else printf ("Not Present"); } /* create a default response */ rsp_info.cur_state_tag = 1; /* undefined state */ rsp_info.trans_time.evtime_tag = 0; rsp_info.trans_time.evtime.time_of_day.form = MMS_BTOD6; rsp_info.trans_time.evtime.time_of_day.ms = 12345; rsp_info.trans_time.evtime.time_of_day.day = 86399999; if (mms_debug_sel & MMS_LOG_USR_IND) { printf ("\n\n Enter Current State (0-7) : (default = undefined) "); if (intget (&num)) { if ((num >= 0) && (num <=7)) { rsp_info.cur_state_tag = 0; /* state is defined */ rsp_info.state = num; } } else rsp_info.cur_state_tag = 1; /* undefined state */ printf (" Enter Transition Time :\n"); get_evtime (&rsp_info.trans_time); } mp_altee_resp (req_info, &rsp_info); /* send the response */ indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* EVENT NOTIFICATION *//************************************************************************/ST_VOID list_error_info (ERR_INFO *);#if MMS_EVNOT_EN & RESP_ENST_VOID u_evnot_ind (MMSREQ_IND *req_info) {EVNOT_REQ_INFO *ptr;ST_INT ch; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Event Notification "); ptr = (EVNOT_REQ_INFO *) req_info->req_info_ptr; printf ("\n\n Press return to continue"); ch = get_a_char (); CLEARSCR; printf ("\n Event Enrollment Name : "); print_objname (&(ptr->evenroll_name)); printf ("\n Event Condition Name : "); print_objname (&(ptr->evcon_name)); printf ("\n Severity : %d", ptr->severity); printf ("\n Current EC State : "); if (ptr->cur_state_pres) { switch (ptr->cur_state) { case 0 : printf ("%d, disabled", ptr->cur_state); break; case 1 : printf ("%d, idle", ptr->cur_state); break; case 2 : printf ("%d, active", ptr->cur_state); break; default: printf ("%d, invalid state", ptr->cur_state); break; } } else printf ("Not Present"); printf ("\n Event Transition Time : "); print_evtime (&(ptr->trans_time)); printf (" Notification Lost : "); if (ptr->not_lost) printf ("Yes "); else printf ("No "); printf ("\n Alarm Ack Rule : "); if (ptr->alarm_ack_rule_pres) { printf ("%d, ", ptr->alarm_ack_rule); switch (ptr->alarm_ack_rule) { case 0 : printf ("none"); break; case 1 : printf ("simple"); break; case 2 : printf ("ack active"); break; case 3 : printf ("ack all"); break; default: printf ("invalid ack rule"); break; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -