📄 test-m2pa.c
字号:
case NNOPROTOID: return ("[NNOPROTOID]"); default: { static char buf[32]; snprintf(buf, sizeof(buf), "[%lu]", (ulong) nerr); return buf; } }}#endif /* TEST_M2PA */const char *lmi_strreason(unsigned int reason){ switch (reason) { default: case LMI_UNSPEC: return ("Unknown or unspecified"); case LMI_BADADDRESS: return ("Address was invalid"); case LMI_BADADDRTYPE: return ("Invalid address type"); case LMI_BADDIAL: return ("(not used)"); case LMI_BADDIALTYPE: return ("(not used)"); case LMI_BADDISPOSAL: return ("Invalid disposal parameter"); case LMI_BADFRAME: return ("Defective SDU received"); case LMI_BADPPA: return ("Invalid PPA identifier"); case LMI_BADPRIM: return ("Unregognized primitive"); case LMI_DISC: return ("Disconnected"); case LMI_EVENT: return ("Protocol-specific event ocurred"); case LMI_FATALERR: return ("Device has become unusable"); case LMI_INITFAILED: return ("Link initialization failed"); case LMI_NOTSUPP: return ("Primitive not supported by this device"); case LMI_OUTSTATE: return ("Primitive was issued from invalid state"); case LMI_PROTOSHORT: return ("M_PROTO block too short"); case LMI_SYSERR: return ("UNIX system error"); case LMI_WRITEFAIL: return ("Unitdata request failed"); case LMI_CRCERR: return ("CRC or FCS error"); case LMI_DLE_EOT: return ("DLE EOT detected"); case LMI_FORMAT: return ("Format error detected"); case LMI_HDLC_ABORT: return ("Aborted frame detected"); case LMI_OVERRUN: return ("Input overrun"); case LMI_TOOSHORT: return ("Frame too short"); case LMI_INCOMPLETE: return ("Partial frame received"); case LMI_BUSY: return ("Telephone was busy"); case LMI_NOANSWER: return ("Connection went unanswered"); case LMI_CALLREJECT: return ("Connection rejected"); case LMI_HDLC_IDLE: return ("HDLC line went idle"); case LMI_HDLC_NOTIDLE: return ("HDLC link no longer idle"); case LMI_QUIESCENT: return ("Line being reassigned"); case LMI_RESUMED: return ("Line has been reassigned"); case LMI_DSRTIMEOUT: return ("Did not see DSR in time"); case LMI_LAN_COLLISIONS: return ("LAN excessive collisions"); case LMI_LAN_REFUSED: return ("LAN message refused"); case LMI_LAN_NOSTATION: return ("LAN no such station"); case LMI_LOSTCTS: return ("Lost Clear to Send signal"); case LMI_DEVERR: return ("Start of device-specific error codes"); }}char *lmerrno_string(long uerr, ulong lmerr){ switch (lmerr) { case LMI_UNSPEC: /* Unknown or unspecified */ return ("[LMI_UNSPEC]"); case LMI_BADADDRESS: /* Address was invalid */ return ("[LMI_BADADDRESS]"); case LMI_BADADDRTYPE: /* Invalid address type */ return ("[LMI_BADADDRTYPE]"); case LMI_BADDIAL: /* (not used) */ return ("[LMI_BADDIAL]"); case LMI_BADDIALTYPE: /* (not used) */ return ("[LMI_BADDIALTYPE]"); case LMI_BADDISPOSAL: /* Invalid disposal parameter */ return ("[LMI_BADDISPOSAL]"); case LMI_BADFRAME: /* Defective SDU received */ return ("[LMI_BADFRAME]"); case LMI_BADPPA: /* Invalid PPA identifier */ return ("[LMI_BADPPA]"); case LMI_BADPRIM: /* Unregognized primitive */ return ("[LMI_BADPRIM]"); case LMI_DISC: /* Disconnected */ return ("[LMI_DISC]"); case LMI_EVENT: /* Protocol-specific event ocurred */ return ("[LMI_EVENT]"); case LMI_FATALERR: /* Device has become unusable */ return ("[LMI_FATALERR]"); case LMI_INITFAILED: /* Link initialization failed */ return ("[LMI_INITFAILED]"); case LMI_NOTSUPP: /* Primitive not supported by this device */ return ("[LMI_NOTSUPP]"); case LMI_OUTSTATE: /* Primitive was issued from invalid state */ return ("[LMI_OUTSTATE]"); case LMI_PROTOSHORT: /* M_PROTO block too short */ return ("[LMI_PROTOSHORT]"); case LMI_SYSERR: /* UNIX system error */ return errno_string(uerr); case LMI_WRITEFAIL: /* Unitdata request failed */ return ("[LMI_WRITEFAIL]"); case LMI_CRCERR: /* CRC or FCS error */ return ("[LMI_CRCERR]"); case LMI_DLE_EOT: /* DLE EOT detected */ return ("[LMI_DLE_EOT]"); case LMI_FORMAT: /* Format error detected */ return ("[LMI_FORMAT]"); case LMI_HDLC_ABORT: /* Aborted frame detected */ return ("[LMI_HDLC_ABORT]"); case LMI_OVERRUN: /* Input overrun */ return ("[LMI_OVERRUN]"); case LMI_TOOSHORT: /* Frame too short */ return ("[LMI_TOOSHORT]"); case LMI_INCOMPLETE: /* Partial frame received */ return ("[LMI_INCOMPLETE]"); case LMI_BUSY: /* Telephone was busy */ return ("[LMI_BUSY]"); case LMI_NOANSWER: /* Connection went unanswered */ return ("[LMI_NOANSWER]"); case LMI_CALLREJECT: /* Connection rejected */ return ("[LMI_CALLREJECT]"); case LMI_HDLC_IDLE: /* HDLC line went idle */ return ("[LMI_HDLC_IDLE]"); case LMI_HDLC_NOTIDLE: /* HDLC link no longer idle */ return ("[LMI_HDLC_NOTIDLE]"); case LMI_QUIESCENT: /* Line being reassigned */ return ("[LMI_QUIESCENT]"); case LMI_RESUMED: /* Line has been reassigned */ return ("[LMI_RESUMED]"); case LMI_DSRTIMEOUT: /* Did not see DSR in time */ return ("[LMI_DSRTIMEOUT]"); case LMI_LAN_COLLISIONS: /* LAN excessive collisions */ return ("[LMI_LAN_COLLISIONS]"); case LMI_LAN_REFUSED: /* LAN message refused */ return ("[LMI_LAN_REFUSED]"); case LMI_LAN_NOSTATION: /* LAN no such station */ return ("[LMI_LAN_NOSTATION]"); case LMI_LOSTCTS: /* Lost Clear to Send signal */ return ("[LMI_LOSTCTS]"); case LMI_DEVERR: /* Start of device-specific error codes */ return ("[LMI_DEVERR]"); default: { static char buf[32]; snprintf(buf, sizeof(buf), "[%lu]", (ulong) lmerr); return buf; } }}const char *event_string(int child, int event){ switch (child) { case CHILD_IUT: switch (event) { case __EVENT_IUT_OUT_OF_SERVICE: return ("!out of service"); case __EVENT_IUT_IN_SERVICE: return ("!in service"); case __EVENT_IUT_RPO: return ("!rpo"); case __EVENT_IUT_RPR: return ("!rpr"); case __EVENT_IUT_DATA: return ("!msu");#if TEST_M2PA case __TEST_ENABLE_CON: return ("!enable con"); case __TEST_DISABLE_CON: return ("!disable con"); case __TEST_OK_ACK: return ("!ok ack"); case __TEST_ERROR_ACK: return ("!error ack"); case __TEST_ERROR_IND: return ("!error ind");#endif /* TEST_M2PA */ } break; default: case CHILD_PTU: switch (event) { case __STATUS_OUT_OF_SERVICE: return ("OUT-OF-SERVICE"); case __STATUS_ALIGNMENT: return ("ALIGNMENT"); case __STATUS_PROVING_NORMAL: return ("PROVING-NORMAL"); case __STATUS_PROVING_EMERG: return ("PROVING-EMERGENCY"); case __STATUS_IN_SERVICE: return ("IN-SERVICE"); case __STATUS_PROCESSOR_OUTAGE: return ("PROCESSOR-OUTAGE"); case __STATUS_PROCESSOR_ENDED: return ("PROCESSOR-ENDED"); case __STATUS_BUSY: return ("BUSY"); case __STATUS_BUSY_ENDED: return ("BUSY-ENDED"); case __STATUS_SEQUENCE_SYNC: return ("READY"); case __MSG_PROVING: return ("PROVING"); case __TEST_ACK: return ("ACK"); case __TEST_DATA: return ("DATA"); case __TEST_SIO: return ("SIO"); case __TEST_SIN: return ("SIN"); case __TEST_SIE: return ("SIE"); case __TEST_SIOS: return ("SIOS"); case __TEST_SIPO: return ("SIPO"); case __TEST_SIB: return ("SIB"); case __TEST_SIX: return ("SIX"); case __TEST_SIO2: return ("SIO2"); case __TEST_SIN2: return ("SIN2"); case __TEST_SIE2: return ("SIE2"); case __TEST_SIOS2: return ("SIOS2"); case __TEST_SIPO2: return ("SIPO2"); case __TEST_SIB2: return ("SIB2"); case __TEST_SIX2: return ("SIX2"); case __TEST_FISU: return ("FISU"); case __TEST_FISU_S: return ("FISU_S"); case __TEST_FISU_BAD_FIB: return ("FISU_BAD_FIB"); case __TEST_FISU_CORRUPT: return ("FISU_CORRUPT"); case __TEST_FISU_CORRUPT_S: return ("FISU_CORRUPT_S"); case __TEST_LSSU_CORRUPT: return ("LSSU_CORRUPT"); case __TEST_LSSU_CORRUPT_S: return ("LSSU_CORRUPT_S"); case __TEST_MSU: return ("MSU"); case __TEST_MSU_SEVEN_ONES: return ("MSU_SEVEN_ONES"); case __TEST_MSU_TOO_LONG: return ("MSU_TOO_LONG"); case __TEST_MSU_TOO_SHORT: return ("MSU_TOO_SHORT"); case __TEST_TX_BREAK: return ("TX_BREAK"); case __TEST_TX_MAKE: return ("TX_MAKE"); case __TEST_FISU_FISU_1FLAG: return ("FISU_FISU_1FLAG"); case __TEST_FISU_FISU_2FLAG: return ("FISU_FISU_2FLAG"); case __TEST_MSU_MSU_1FLAG: return ("MSU_MSU_1FLAG"); case __TEST_MSU_MSU_2FLAG: return ("MSU_MSU_2FLAG"); } break; } switch (event) { case __EVENT_EOF: return ("END OF FILE"); case __EVENT_NO_MSG: return ("NO MESSAGE"); case __EVENT_TIMEOUT: return ("TIMEOUT"); case __EVENT_UNKNOWN: return ("UNKNOWN"); case __RESULT_DECODE_ERROR: return ("DECODE ERROR"); case __RESULT_SCRIPT_ERROR: return ("SCRIPT ERROR"); case __RESULT_INCONCLUSIVE: return ("INCONCLUSIVE"); case __RESULT_SUCCESS: return ("SUCCESS"); case __RESULT_FAILURE: return ("FAILURE");#if TEST_X400 case __TEST_ENABLE_CON: return ("!enable con"); case __TEST_DISABLE_CON: return ("!disable con"); case __TEST_OK_ACK: return ("!ok ack"); case __TEST_ERROR_ACK: return ("!error ack"); case __TEST_ERROR_IND: return ("!error ind");#endif /* TEST_X400 */#if TEST_M2UA case __TEST_CONN_REQ: return ("T_CONN_REQ"); case __TEST_CONN_RES: return ("T_CONN_RES"); case __TEST_DISCON_REQ: return ("T_DISCON_REQ"); case __TEST_DATA_REQ: return ("T_DATA_REQ"); case __TEST_EXDATA_REQ: return ("T_EXDATA_REQ"); case __TEST_OPTDATA_REQ: return ("T_OPTDATA_REQ"); case __TEST_INFO_REQ: return ("T_INFO_REQ"); case __TEST_BIND_REQ: return ("T_BIND_REQ"); case __TEST_UNBIND_REQ: return ("T_UNBIND_REQ"); case __TEST_UNITDATA_REQ: return ("T_UNITDATA_REQ"); case __TEST_OPTMGMT_REQ: return ("T_OPTMGMT_REQ"); case __TEST_ORDREL_REQ: return ("T_ORDREL_REQ"); case __TEST_CONN_IND: return ("T_CONN_IND"); case __TEST_CONN_CON: return ("T_CONN_CON"); case __TEST_DISCON_IND: return ("T_DISCON_IND"); case __TEST_DATA_IND: return ("T_DATA_IND"); case __TEST_EXDATA_IND: return ("T_EXDATA_IND"); case __TEST_NRM_OPTDATA_IND: return ("T_OPTDATA_IND"); case __TEST_EXP_OPTDATA_IND: return ("T_OPTDATA_IND"); case __TEST_INFO_ACK: return ("T_INFO_ACK"); case __TEST_BIND_ACK: return ("T_BIND_ACK"); case __TEST_ERROR_ACK: return ("T_ERROR_ACK"); case __TEST_OK_ACK: return ("T_OK_ACK"); case __TEST_UNITDATA_IND: return ("T_UNITDATA_IND"); case __TEST_UDERROR_IND: return ("T_UDERROR_IND"); case __TEST_OPTMGMT_ACK: return ("T_OPTMGMT_ACK"); case __TEST_ORDREL_IND: return ("T_ORDREL_IND"); case __TEST_ADDR_REQ: return ("T_ADDR_REQ"); case __TEST_ADDR_ACK: return ("T_ADDR_ACK"); case __TEST_CAPABILITY_REQ: return ("T_CAPABILITY_REQ"); case __TEST_CAPABILITY_ACK: return ("T_CAPABILITY_ACK");#endif#if TEST_M2PA case __TEST_CONN_REQ: return ("N_CONN_REQ"); case __TEST_CONN_RES: return ("N_CONN_RES"); case __TEST_DISCON_REQ: return ("N_DISCON_REQ"); case __TEST_DATA_REQ: return ("N_DATA_REQ"); case __TEST_EXDATA_REQ: return ("N_EXDATA_REQ"); case __TEST_INFO_REQ: return ("N_INFO_REQ"); case __TEST_BIND_REQ: return ("N_BIND_REQ"); case __TEST_UNBIND_REQ: return ("N_UNBIND_REQ"); case __TEST_UNITDATA_REQ: return ("N_UNITDATA_REQ"); case __TEST_OPTMGMT_REQ: return ("N_OPTMGMT_REQ"); case __TEST_CONN_IND: return ("N_CONN_IND"); case __TEST_CONN_CON: return ("N_CONN_CON"); case __TEST_DISCON_IND: return ("N_DISCON_IND"); case __TEST_DATA_IND: return ("N_DATA_IND"); case __TEST_EXDATA_IND: return ("N_EXDATA_IND"); case __TEST_INFO_ACK: return ("N_INFO_ACK"); case __TEST_BIND_ACK: return ("N_BIND_ACK"); case __TEST_ERROR_ACK: return ("N_ERROR_ACK"); case __TEST_OK_ACK: return ("N_OK_ACK"); case __TEST_UNITDATA_IND: return ("N_UNITDATA_IND"); case __TEST_UDERROR_IND: return ("N_UDERROR_IND"); case __TEST_DATACK_REQ: return ("N_DATACK_REQ"); case __TEST_DATACK_IND: return ("N_DATACK_IND"); case __TEST_RESET_REQ: return ("N_RESET_REQ"); case __TEST_RESET_IND: return ("N_RESET_IND"); case __TEST_RESET_RES: return ("N_RESET_RES"); case __TEST_RESET_CON: return ("N_RESET_CON");#endif /* TEST_M2PA */ case __TEST_COUNT: return ("COUNT"); case __TEST_TRIES: return ("TRIES"); case __TEST_ETC: return ("ETC"); case __TEST_SIB_S: return ("SIB_S"); case __TEST_POWER_ON: return ("POWER_ON"); case __TEST_START: return ("START"); case __TEST_STOP: return ("STOP"); case __TEST_LPO: return ("LPO"); case __TEST_LPR: return ("LPR"); case __TEST_CONTINUE: return ("CONTINUE"); case __TEST_EMERG: return ("EMERG"); case __TEST_CEASE: return ("CEASE"); case __TEST_SEND_MSU: return ("SEND_MSU"); case __TEST_SEND_MSU_S: return ("SEND_MSU_S"); case __TEST_CONG_A: return ("CONG_A"); case __TEST_CONG_D: return ("CONG_D"); case __TEST_NO_CONG:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -