diff options
author | Bill Meier <wmeier@newsguy.com> | 2013-12-14 18:33:55 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2013-12-14 18:33:55 +0000 |
commit | 3ddb2011f916bce75a74855d14ea1818761ee41e (patch) | |
tree | dbaf6c023fc88d38bbf4543c3b8880adee9ea0be | |
parent | 1190f52ecb918f45c6fea0d899132b8b3ec66515 (diff) |
Create/use several extended value-strings;
(Sort & remove dups from underlying value_string arrays);
Reformat a few long lines;
Add editor modelines;
svn path=/trunk/; revision=54103
-rw-r--r-- | epan/dissectors/packet-t30.c | 410 | ||||
-rw-r--r-- | epan/dissectors/packet-t30.h | 4 | ||||
-rw-r--r-- | ui/gtk/voip_calls.c | 35 |
3 files changed, 243 insertions, 206 deletions
diff --git a/epan/dissectors/packet-t30.c b/epan/dissectors/packet-t30.c index d29fd98fed..5ff256b141 100644 --- a/epan/dissectors/packet-t30.c +++ b/epan/dissectors/packet-t30.c @@ -162,210 +162,212 @@ static const value_string t30_control_vals[] = { { 0, NULL } }; -#define T30_FC_DIS 0x01 -#define T30_FC_CSI 0x02 -#define T30_FC_NSF 0x04 -#define T30_FC_DTC 0x81 -#define T30_FC_CIG 0x82 -#define T30_FC_NSC 0x84 -#define T30_FC_PWD 0x83 -#define T30_FC_SEP 0x85 -#define T30_FC_PSA 0x86 -#define T30_FC_CIA 0x87 -#define T30_FC_ISP 0x88 -#define T30_FC_DCS 0x41 -#define T30_FC_TSI 0x42 -#define T30_FC_NSS 0x44 -#define T30_FC_SUB 0x43 -#define T30_FC_SID 0x45 -#define T30_FC_TSA 0x46 -#define T30_FC_IRA 0x47 -#define T30_FC_CFR 0x21 -#define T30_FC_FTT 0x22 -#define T30_FC_CSA 0x24 -#define T30_FC_EOM 0x71 -#define T30_FC_MPS 0x72 -#define T30_FC_EOP 0x74 +#define T30_FC_DIS 0x01 +#define T30_FC_CSI 0x02 +#define T30_FC_NSF 0x04 +#define T30_FC_CFR 0x21 +#define T30_FC_FTT 0x22 +#define T30_FC_CTR 0x23 +#define T30_FC_CSA 0x24 +#define T30_FC_MCF 0x31 +#define T30_FC_RTN 0x32 +#define T30_FC_RTP 0x33 +#define T30_FC_PIN 0x34 +#define T30_FC_PIP 0x35 +#define T30_FC_PID 0x36 +#define T30_FC_RNR 0x37 +#define T30_FC_ERR 0x38 +#define T30_FC_PPR 0x3D +#define T30_FC_FDM 0x3F +#define T30_FC_DCS 0x41 +#define T30_FC_TSI 0x42 +#define T30_FC_SUB 0x43 +#define T30_FC_NSS 0x44 +#define T30_FC_SID 0x45 +#define T30_FC_TSA 0x46 +#define T30_FC_IRA 0x47 +#define T30_FC_CTC 0x48 +#define T30_FC_FNV 0x53 +#define T30_FC_TR 0x56 +#define T30_FC_TNR 0x57 +#define T30_FC_CRP 0x58 +#define T30_FC_DCN 0x5F +#define T30_FC_FCD 0x60 +#define T30_FC_RCP 0x61 +#define T30_FC_EOM 0x71 +#define T30_FC_MPS 0x72 +#define T30_FC_EOR 0x73 +#define T30_FC_EOP 0x74 +#define T30_FC_RR 0x76 +#define T30_FC_PRI_EOP2 0x78 #define T30_FC_PRI_EOM 0x79 #define T30_FC_PRI_MPS 0x7A #define T30_FC_PRI_EOP 0x7C -#define T30_FC_PRI_EOP2 0x78 -#define T30_FC_MCF 0x31 -#define T30_FC_RTP 0x33 -#define T30_FC_RTN 0x32 -#define T30_FC_PIP 0x35 -#define T30_FC_PIN 0x34 -#define T30_FC_FDM 0x3F -#define T30_FC_DCN 0x5F -#define T30_FC_CRP 0x58 -#define T30_FC_FNV 0x53 -#define T30_FC_TNR 0x57 -#define T30_FC_TR 0x56 -#define T30_FC_MCF 0x31 -#define T30_FC_PID 0x36 -#define T30_FC_PPR 0x3D -#define T30_FC_RNR 0x37 -#define T30_FC_CRP 0x58 -#define T30_FC_CTC 0x48 -#define T30_FC_CTR 0x23 -#define T30_FC_PPS 0x7D -#define T30_FC_EOR 0x73 -#define T30_FC_RR 0x76 -#define T30_FC_ERR 0x38 -#define T30_FC_FCD 0x60 -#define T30_FC_RCP 0x61 - -const value_string t30_facsimile_control_field_vals[] = { - { T30_FC_DIS, "Digital Identification Signal" }, - { T30_FC_CSI, "Called Subscriber Identification" }, - { T30_FC_NSF, "Non-Standard Facilities" }, - { T30_FC_DTC, "Digital Transmit Command" }, - { T30_FC_CIG, "Calling Subscriber Identification" }, - { T30_FC_NSC, "Non-Standard facilities Command" }, - { T30_FC_PWD, "Password" }, - { T30_FC_SEP, "Selective Polling" }, - { T30_FC_PSA, "Polled Subaddress" }, - { T30_FC_CIA, "Calling subscriber Internet Address" }, - { T30_FC_ISP, "Internet Selective Polling Address" }, - { T30_FC_DCS, "Digital Command Signal" }, - { T30_FC_TSI, "Transmitting Subscriber Identification" }, - { T30_FC_NSS, "Non-Standard facilities Set-up" }, - { T30_FC_SUB, "Subaddress" }, - { T30_FC_SID, "Sender Identification" }, - { T30_FC_TSA, "Transmitting Subscriber Internet address" }, - { T30_FC_IRA, "Internet Routing Address" }, - { T30_FC_CFR, "Confirmation To Receive" }, - { T30_FC_FTT, "Failure To Train" }, - { T30_FC_CSA, "Called Subscriber Internet Address" }, - { T30_FC_EOM, "End Of Message" }, - { T30_FC_MPS, "MultiPage Signal" }, - { T30_FC_EOP, "End Of Procedure" }, - { T30_FC_PRI_EOM, "Procedure Interrupt-End Of Message" }, - { T30_FC_PRI_MPS, "Procedure Interrupt-MultiPage Signal" }, - { T30_FC_PRI_EOP, "Procedure Interrupt-End Of Procedure" }, - { T30_FC_PRI_EOP2, "Procedure Interrupt-End Of Procedure" }, - { T30_FC_MCF, "Message Confirmation" }, - { T30_FC_RTP, "Retrain Positive" }, - { T30_FC_RTN, "Retrain Negative" }, - { T30_FC_PIP, "Procedure Interrupt Positive" }, - { T30_FC_PIN, "Procedure Interrupt Negative" }, - { T30_FC_FDM, "File Diagnostics Message" }, - { T30_FC_DCN, "Disconnect" }, - { T30_FC_CRP, "Command Repeat" }, - { T30_FC_FNV, "Field Not Valid" }, - { T30_FC_TNR, "Transmit not ready" }, - { T30_FC_TR, "Transmit ready" }, - { T30_FC_MCF, "Message Confirmation" }, - { T30_FC_PID, "Procedure Interrupt Disconnect" }, - { T30_FC_PPR, "Partial Page Request" }, - { T30_FC_RNR, "Receive Not Ready" }, - { T30_FC_CRP, "Command Repeat" }, - { T30_FC_CTC, "Continue To Correct" }, - { T30_FC_CTR, "Response for Continue To Correct" }, - { T30_FC_PPS, "Partial Page Signal" }, - { T30_FC_EOR, "End Of Retransmission" }, - { T30_FC_RR, "Receive Ready" }, - { T30_FC_ERR, "Response for End of Retransmission" }, - { T30_FC_FCD, "Facsimile coded data" }, - { T30_FC_RCP, "Return to control for partial page" }, +#define T30_FC_PPS 0x7D +#define T30_FC_DTC 0x81 +#define T30_FC_CIG 0x82 +#define T30_FC_PWD 0x83 +#define T30_FC_NSC 0x84 +#define T30_FC_SEP 0x85 +#define T30_FC_PSA 0x86 +#define T30_FC_CIA 0x87 +#define T30_FC_ISP 0x88 + +static const value_string t30_facsimile_control_field_vals[] = { + /* 0x01 */ { T30_FC_DIS, "Digital Identification Signal" }, + /* 0x02 */ { T30_FC_CSI, "Called Subscriber Identification" }, + /* 0x04 */ { T30_FC_NSF, "Non-Standard Facilities" }, + /* 0x21 */ { T30_FC_CFR, "Confirmation To Receive" }, + /* 0x22 */ { T30_FC_FTT, "Failure To Train" }, + /* 0x23 */ { T30_FC_CTR, "Response for Continue To Correct" }, + /* 0x24 */ { T30_FC_CSA, "Called Subscriber Internet Address" }, + /* 0x31 */ { T30_FC_MCF, "Message Confirmation" }, + /* 0x32 */ { T30_FC_RTN, "Retrain Negative" }, + /* 0x33 */ { T30_FC_RTP, "Retrain Positive" }, + /* 0x34 */ { T30_FC_PIN, "Procedure Interrupt Negative" }, + /* 0x35 */ { T30_FC_PIP, "Procedure Interrupt Positive" }, + /* 0x36 */ { T30_FC_PID, "Procedure Interrupt Disconnect" }, + /* 0x37 */ { T30_FC_RNR, "Receive Not Ready" }, + /* 0x38 */ { T30_FC_ERR, "Response for End of Retransmission" }, + /* 0x3D */ { T30_FC_PPR, "Partial Page Request" }, + /* 0x3F */ { T30_FC_FDM, "File Diagnostics Message" }, + /* 0x41 */ { T30_FC_DCS, "Digital Command Signal" }, + /* 0x42 */ { T30_FC_TSI, "Transmitting Subscriber Identification" }, + /* 0x43 */ { T30_FC_SUB, "Subaddress" }, + /* 0x44 */ { T30_FC_NSS, "Non-Standard facilities Set-up" }, + /* 0x45 */ { T30_FC_SID, "Sender Identification" }, + /* 0x46 */ { T30_FC_TSA, "Transmitting Subscriber Internet address" }, + /* 0x47 */ { T30_FC_IRA, "Internet Routing Address" }, + /* 0x48 */ { T30_FC_CTC, "Continue To Correct" }, + /* 0x53 */ { T30_FC_FNV, "Field Not Valid" }, + /* 0x56 */ { T30_FC_TR, "Transmit ready" }, + /* 0x57 */ { T30_FC_TNR, "Transmit not ready" }, + /* 0x58 */ { T30_FC_CRP, "Command Repeat" }, + /* 0x5F */ { T30_FC_DCN, "Disconnect" }, + /* 0x60 */ { T30_FC_FCD, "Facsimile coded data" }, + /* 0x61 */ { T30_FC_RCP, "Return to control for partial page" }, + /* 0x71 */ { T30_FC_EOM, "End Of Message" }, + /* 0x72 */ { T30_FC_MPS, "MultiPage Signal" }, + /* 0x73 */ { T30_FC_EOR, "End Of Retransmission" }, + /* 0x74 */ { T30_FC_EOP, "End Of Procedure" }, + /* 0x76 */ { T30_FC_RR, "Receive Ready" }, + /* 0x78 */ { T30_FC_PRI_EOP2, "Procedure Interrupt-End Of Procedure" }, + /* 0x79 */ { T30_FC_PRI_EOM, "Procedure Interrupt-End Of Message" }, + /* 0x7A */ { T30_FC_PRI_MPS, "Procedure Interrupt-MultiPage Signal" }, + /* 0x7C */ { T30_FC_PRI_EOP, "Procedure Interrupt-End Of Procedure" }, + /* 0x7D */ { T30_FC_PPS, "Partial Page Signal" }, + /* 0x81 */ { T30_FC_DTC, "Digital Transmit Command" }, + /* 0x82 */ { T30_FC_CIG, "Calling Subscriber Identification" }, + /* 0x83 */ { T30_FC_PWD, "Password" }, + /* 0x84 */ { T30_FC_NSC, "Non-Standard facilities Command" }, + /* 0x85 */ { T30_FC_SEP, "Selective Polling" }, + /* 0x86 */ { T30_FC_PSA, "Polled Subaddress" }, + /* 0x87 */ { T30_FC_CIA, "Calling subscriber Internet Address" }, + /* 0x88 */ { T30_FC_ISP, "Internet Selective Polling Address" }, { 0, NULL } }; - -const value_string t30_facsimile_control_field_vals_short[] = { - { T30_FC_DIS, "DIS" }, - { T30_FC_CSI, "CSI" }, - { T30_FC_NSF, "NSF" }, - { T30_FC_DTC, "DTC" }, - { T30_FC_CIG, "CIG" }, - { T30_FC_NSC, "NSC" }, - { T30_FC_PWD, "PWD" }, - { T30_FC_SEP, "SEP" }, - { T30_FC_PSA, "PSA" }, - { T30_FC_CIA, "CIA" }, - { T30_FC_ISP, "ISP" }, - { T30_FC_DCS, "DCS" }, - { T30_FC_TSI, "TSI" }, - { T30_FC_NSS, "NSS" }, - { T30_FC_SUB, "SUB" }, - { T30_FC_SID, "SID" }, - { T30_FC_TSA, "TSA" }, - { T30_FC_IRA, "IRA" }, - { T30_FC_CFR, "CFR" }, - { T30_FC_FTT, "FTT" }, - { T30_FC_CSA, "CSA" }, - { T30_FC_EOM, "EOM" }, - { T30_FC_MPS, "MPS" }, - { T30_FC_EOP, "EOP" }, - { T30_FC_PRI_EOM, "PRI_EOM" }, - { T30_FC_PRI_MPS, "PRI_MPS" }, - { T30_FC_PRI_EOP, "EOP" }, - { T30_FC_PRI_EOP2, "EOP2" }, - { T30_FC_MCF, "MCF" }, - { T30_FC_RTP, "RTP" }, - { T30_FC_RTN, "RTN" }, - { T30_FC_PIP, "PIP" }, - { T30_FC_PIN, "PIN" }, - { T30_FC_FDM, "FDM" }, - { T30_FC_DCN, "DCN" }, - { T30_FC_CRP, "CRP" }, - { T30_FC_FNV, "FNV" }, - { T30_FC_TNR, "TNR" }, - { T30_FC_TR, "TR" }, - { T30_FC_MCF, "MCF" }, - { T30_FC_PID, "PID" }, - { T30_FC_PPR, "PPR" }, - { T30_FC_RNR, "RNR" }, - { T30_FC_CRP, "CRP" }, - { T30_FC_CTC, "CTC" }, - { T30_FC_CTR, "CTR" }, - { T30_FC_PPS, "PPS" }, - { T30_FC_EOR, "EOR" }, - { T30_FC_RR, "RR" }, - { T30_FC_ERR, "ERR" }, - { T30_FC_FCD, "FCD" }, - { T30_FC_RCP, "RCP" }, +value_string_ext t30_facsimile_control_field_vals_ext = + VALUE_STRING_EXT_INIT(t30_facsimile_control_field_vals); + +static const value_string t30_facsimile_control_field_vals_short[] = { + /* 0x01 */ { T30_FC_DIS, "DIS" }, + /* 0x02 */ { T30_FC_CSI, "CSI" }, + /* 0x04 */ { T30_FC_NSF, "NSF" }, + /* 0x21 */ { T30_FC_CFR, "CFR" }, + /* 0x22 */ { T30_FC_FTT, "FTT" }, + /* 0x23 */ { T30_FC_CTR, "CTR" }, + /* 0x24 */ { T30_FC_CSA, "CSA" }, + /* 0x31 */ { T30_FC_MCF, "MCF" }, + /* 0x32 */ { T30_FC_RTN, "RTN" }, + /* 0x33 */ { T30_FC_RTP, "RTP" }, + /* 0x34 */ { T30_FC_PIN, "PIN" }, + /* 0x35 */ { T30_FC_PIP, "PIP" }, + /* 0x36 */ { T30_FC_PID, "PID" }, + /* 0x37 */ { T30_FC_RNR, "RNR" }, + /* 0x38 */ { T30_FC_ERR, "ERR" }, + /* 0x3D */ { T30_FC_PPR, "PPR" }, + /* 0x3F */ { T30_FC_FDM, "FDM" }, + /* 0x41 */ { T30_FC_DCS, "DCS" }, + /* 0x42 */ { T30_FC_TSI, "TSI" }, + /* 0x43 */ { T30_FC_SUB, "SUB" }, + /* 0x44 */ { T30_FC_NSS, "NSS" }, + /* 0x45 */ { T30_FC_SID, "SID" }, + /* 0x46 */ { T30_FC_TSA, "TSA" }, + /* 0x47 */ { T30_FC_IRA, "IRA" }, + /* 0x48 */ { T30_FC_CTC, "CTC" }, + /* 0x53 */ { T30_FC_FNV, "FNV" }, + /* 0x56 */ { T30_FC_TR, "TR" }, + /* 0x57 */ { T30_FC_TNR, "TNR" }, + /* 0x58 */ { T30_FC_CRP, "CRP" }, + /* 0x5F */ { T30_FC_DCN, "DCN" }, + /* 0x60 */ { T30_FC_FCD, "FCD" }, + /* 0x61 */ { T30_FC_RCP, "RCP" }, + /* 0x71 */ { T30_FC_EOM, "EOM" }, + /* 0x72 */ { T30_FC_MPS, "MPS" }, + /* 0x73 */ { T30_FC_EOR, "EOR" }, + /* 0x74 */ { T30_FC_EOP, "EOP" }, + /* 0x76 */ { T30_FC_RR, "RR" }, + /* 0x78 */ { T30_FC_PRI_EOP2, "EOP2" }, + /* 0x79 */ { T30_FC_PRI_EOM, "PRI_EOM" }, + /* 0x7A */ { T30_FC_PRI_MPS, "PRI_MPS" }, + /* 0x7C */ { T30_FC_PRI_EOP, "EOP" }, + /* 0x7D */ { T30_FC_PPS, "PPS" }, + /* 0x81 */ { T30_FC_DTC, "DTC" }, + /* 0x82 */ { T30_FC_CIG, "CIG" }, + /* 0x83 */ { T30_FC_PWD, "PWD" }, + /* 0x84 */ { T30_FC_NSC, "NSC" }, + /* 0x85 */ { T30_FC_SEP, "SEP" }, + /* 0x86 */ { T30_FC_PSA, "PSA" }, + /* 0x87 */ { T30_FC_CIA, "CIA" }, + /* 0x88 */ { T30_FC_ISP, "ISP" }, { 0, NULL } }; +value_string_ext t30_facsimile_control_field_vals_short_ext = + VALUE_STRING_EXT_INIT(t30_facsimile_control_field_vals_short); static const value_string t30_data_signalling_rate_vals[] = { { 0x00, "ITU-T V.27 ter fall-back mode" }, - { 0x04, "ITU-T V.27 ter" }, - { 0x08, "ITU-T V.29" }, - { 0x0C, "ITU-T V.27 ter and V.29" }, - { 0x02, "Not used" }, - { 0x06, "Reserved" }, - { 0x0A, "Not used" }, - { 0x0E, "Invalid" }, { 0x01, "Not used" }, - { 0x05, "Reserved" }, - { 0x09, "Not used" }, - { 0x0D, "ITU-T V.27 ter, V.29, and V.17" }, + { 0x02, "Not used" }, { 0x03, "Not used" }, + { 0x04, "ITU-T V.27 ter" }, + { 0x05, "Reserved" }, + { 0x06, "Reserved" }, { 0x07, "Reserved" }, + { 0x08, "ITU-T V.29" }, + { 0x09, "Not used" }, + { 0x0A, "Not used" }, { 0x0B, "Not used" }, + { 0x0C, "ITU-T V.27 ter and V.29" }, + { 0x0D, "ITU-T V.27 ter, V.29, and V.17" }, + { 0x0E, "Invalid" }, { 0x0F, "Reserved" }, { 0, NULL } }; +static value_string_ext t30_data_signalling_rate_vals_ext = + VALUE_STRING_EXT_INIT(t30_data_signalling_rate_vals); static const value_string t30_data_signalling_rate_dcs_vals[] = { { 0x00, "2400 bit/s, ITU-T V.27 ter" }, - { 0x04, "4800 bit/s, ITU-T V.27 ter" }, - { 0x08, "9600 bit/s, ITU-T V.29" }, - { 0x0C, "7200 bit/s, ITU-T V.29" }, - { 0x02, "Invalid" }, - { 0x06, "Invalid" }, - { 0x0A, "Reserved" }, - { 0x0E, "Reserved" }, { 0x01, "14 400 bit/s, ITU-T V.17" }, - { 0x05, "12 000 bit/s, ITU-T V.17" }, - { 0x09, "9600 bit/s, ITU-T V.17" }, - { 0x0D, "7200 bit/s, ITU-T V.17" }, + { 0x02, "Invalid" }, { 0x03, "Reserved" }, + { 0x04, "4800 bit/s, ITU-T V.27 ter" }, + { 0x05, "12 000 bit/s, ITU-T V.17" }, + { 0x06, "Invalid" }, { 0x07, "Reserved" }, + { 0x08, "9600 bit/s, ITU-T V.29" }, + { 0x09, "9600 bit/s, ITU-T V.17" }, + { 0x0A, "Reserved" }, { 0x0B, "Reserved" }, + { 0x0C, "7200 bit/s, ITU-T V.29" }, + { 0x0D, "7200 bit/s, ITU-T V.17" }, + { 0x0E, "Reserved" }, { 0x0F, "Reserved" }, { 0, NULL } }; +static value_string_ext t30_data_signalling_rate_dcs_vals_ext = + VALUE_STRING_EXT_INIT(t30_data_signalling_rate_dcs_vals); static const value_string t30_recording_width_capabilities_vals[] = { { 0x00, "Scan line length 215 mm +- 1%" }, @@ -489,7 +491,7 @@ static gchar * t30_get_string_numbers(tvbuff_t *tvb, int offset, int len) { gchar *buf; - int i; + int i; /* the length must be 20 bytes per T30 rec*/ if (len != LENGTH_T30_NUM) @@ -510,7 +512,7 @@ t30_get_string_numbers(tvbuff_t *tvb, int offset, int len) static void dissect_t30_numbers(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, proto_tree *tree, t38_packet_info* t38) { - gchar *str_num=NULL; + gchar *str_num; str_num = t30_get_string_numbers(tvb, offset, len); if (str_num) { @@ -681,23 +683,23 @@ dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, prot proto_tree_add_item(tree, hf_t30_fif_dsr, tvb, offset, 1, ENC_NA); col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", - val_to_str_const((octet&0x3C) >> 2, t30_data_signalling_rate_vals, "<unknown>")); + val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_vals_ext, "<unknown>")); if (t38) g_snprintf(t38->desc, MAX_T38_DESC, "DSR:%s", - val_to_str_const((octet&0x3C) >> 2, t30_data_signalling_rate_vals, "<unknown>")); + val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_vals_ext, "<unknown>")); } else { proto_tree_add_item(tree, hf_t30_fif_dsr_dcs, tvb, offset, 1, ENC_NA); col_append_fstr(pinfo->cinfo, COL_INFO, " - DSR:%s", - val_to_str_const((octet&0x3C) >> 2, t30_data_signalling_rate_dcs_vals, "<unknown>")); + val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_dcs_vals_ext, "<unknown>")); if (t38) g_snprintf(t38->desc, MAX_T38_DESC, "DSR:%s", - val_to_str_const((octet&0x3C) >> 2, t30_data_signalling_rate_dcs_vals, "<unknown>")); + val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_dcs_vals_ext, "<unknown>")); } proto_tree_add_item(tree, hf_t30_fif_res, tvb, offset, 1, ENC_NA); proto_tree_add_item(tree, hf_t30_fif_tdcc, tvb, offset, 1, ENC_NA); @@ -921,15 +923,15 @@ dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, prot static int dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - int offset = 0; + int offset = 0; proto_item *it; proto_tree *tr; proto_tree *tr_fif; proto_item *it_fcf; - guint8 octet; - guint32 frag_len; + guint8 octet; + guint32 frag_len; proto_item *item; - t38_packet_info* t38 = (t38_packet_info*)data; + t38_packet_info *t38 = (t38_packet_info*)data; if (tvb_reported_length_remaining(tvb, offset) < 3) { proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb, @@ -968,8 +970,8 @@ dissect_t30_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data col_append_fstr(pinfo->cinfo, COL_INFO, " %s - %s", - val_to_str_const(octet & 0x7F, t30_facsimile_control_field_vals_short, "<unknown>"), - val_to_str_const(octet & 0x7F, t30_facsimile_control_field_vals, "<unknown>") ); + val_to_str_ext_const(octet & 0x7F, &t30_facsimile_control_field_vals_short_ext, "<unknown>"), + val_to_str_ext_const(octet & 0x7F, &t30_facsimile_control_field_vals_ext, "<unknown>") ); /* TODO: VS Code Analysis makes a good point - several of these commands can't get detected while the m.s.b. is masked off! (e.g. T30_FC_DTC is 0x81). I couldn't readily work out from the T.30 @@ -1027,8 +1029,8 @@ proto_register_t30(void) { "Control", "t30.Control", FT_UINT8, BASE_HEX, VALS(t30_control_vals), 0, "Control Field", HFILL }}, { &hf_t30_Facsimile_Control, - { "Facsimile Control", "t30.FacsimileControl", FT_UINT8, BASE_DEC, - VALS(t30_facsimile_control_field_vals), 0x7F, NULL, HFILL }}, + { "Facsimile Control", "t30.FacsimileControl", FT_UINT8, BASE_DEC | BASE_EXT_STRING, + &t30_facsimile_control_field_vals_ext, 0x7F, NULL, HFILL }}, { &hf_t30_fif_sm, { "Store and forward Internet fax- Simple mode (ITU-T T.37)", "t30.fif.sm", FT_BOOLEAN, 8, @@ -1052,11 +1054,11 @@ proto_register_t30(void) { "Receiver fax operation", "t30.fif.rfo", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40, NULL, HFILL }}, { &hf_t30_fif_dsr, - { "Data signalling rate", "t30.fif.dsr", FT_UINT8, BASE_HEX, - VALS(t30_data_signalling_rate_vals), 0x3C, NULL, HFILL }}, + { "Data signalling rate", "t30.fif.dsr", FT_UINT8, BASE_HEX | BASE_EXT_STRING, + &t30_data_signalling_rate_vals_ext, 0x3C, NULL, HFILL }}, { &hf_t30_fif_dsr_dcs, - { "Data signalling rate", "t30.fif.dsr_dcs", FT_UINT8, BASE_HEX, - VALS(t30_data_signalling_rate_dcs_vals), 0x3C, NULL, HFILL }}, + { "Data signalling rate", "t30.fif.dsr_dcs", FT_UINT8, BASE_HEX | BASE_EXT_STRING, + &t30_data_signalling_rate_dcs_vals_ext, 0x3C, NULL, HFILL }}, { &hf_t30_fif_res, { "R8x7.7 lines/mm and/or 200x200 pels/25.4 mm", "t30.fif.res", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }}, @@ -1366,9 +1368,9 @@ proto_register_t30(void) }; static ei_register_info ei[] = { - { &ei_t30_bad_length, { "t30.bad_length", PI_MALFORMED, PI_ERROR, "Bad length", EXPFILL }}, - { &ei_t30_Address_FF, { "t30.Address.FF", PI_REASSEMBLE, PI_WARN, "T30 Address must be 0xFF", EXPFILL }}, - { &ei_t30_Control_C0C8, { "t30.Control.C0C8", PI_REASSEMBLE, PI_WARN, "T30 Control Field must be 0xC0 or 0xC8", EXPFILL }}, + { &ei_t30_bad_length, { "t30.bad_length", PI_MALFORMED, PI_ERROR, "Bad length", EXPFILL }}, + { &ei_t30_Address_FF, { "t30.Address.FF", PI_REASSEMBLE, PI_WARN, "T30 Address must be 0xFF", EXPFILL }}, + { &ei_t30_Control_C0C8, { "t30.Control.C0C8", PI_REASSEMBLE, PI_WARN, "T30 Control Field must be 0xC0 or 0xC8", EXPFILL }}, }; expert_module_t* expert_t30; @@ -1384,3 +1386,15 @@ proto_register_t30(void) } +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * vi: set shiftwidth=4 tabstop=8 expandtab: + * :indentSize=4:tabSize=8:noTabs=true: + */ diff --git a/epan/dissectors/packet-t30.h b/epan/dissectors/packet-t30.h index 0f2daee7e4..412a50b432 100644 --- a/epan/dissectors/packet-t30.h +++ b/epan/dissectors/packet-t30.h @@ -27,5 +27,5 @@ #include "ws_symbol_export.h" -WS_DLL_PUBLIC const value_string t30_facsimile_control_field_vals[]; -WS_DLL_PUBLIC const value_string t30_facsimile_control_field_vals_short[]; +WS_DLL_PUBLIC value_string_ext t30_facsimile_control_field_vals_ext; +WS_DLL_PUBLIC value_string_ext t30_facsimile_control_field_vals_short_ext; diff --git a/ui/gtk/voip_calls.c b/ui/gtk/voip_calls.c index 52b352c909..4fb505c251 100644 --- a/ui/gtk/voip_calls.c +++ b/ui/gtk/voip_calls.c @@ -879,19 +879,42 @@ T38_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const vo break; case 2: /* hdlc-fcs-OK */ case 4: /* hdlc-fcs-OK-sig-end */ - frame_label = g_strdup_printf("%s %s", val_to_str(pi->t30_Facsimile_Control & 0x7F, t30_facsimile_control_field_vals_short, "Ukn (0x%02X)"), pi->desc); - comment = g_strdup_printf("t38:%s:HDLC:%s",val_to_str(pi->data_value, t38_T30_data_vals, "Ukn (0x%02X)"), val_to_str(pi->t30_Facsimile_Control & 0x7F, t30_facsimile_control_field_vals, "Ukn (0x%02X)")); + frame_label = g_strdup_printf("%s %s", + val_to_str_ext(pi->t30_Facsimile_Control & 0x7F, + &t30_facsimile_control_field_vals_short_ext, + "Ukn (0x%02X)"), + pi->desc); + comment = g_strdup_printf("t38:%s:HDLC:%s", + val_to_str(pi->data_value, + t38_T30_data_vals, + "Ukn (0x%02X)"), + val_to_str_ext(pi->t30_Facsimile_Control & 0x7F, + &t30_facsimile_control_field_vals_ext, + "Ukn (0x%02X)")); break; case 3: /* hdlc-fcs-BAD */ case 5: /* hdlc-fcs-BAD-sig-end */ frame_label = g_strdup(pi->Data_Field_field_type_value == 3 ? "fcs-BAD" : "fcs-BAD-sig-end"); - comment = g_strdup_printf("WARNING: received t38:%s:HDLC:%s", val_to_str(pi->data_value, t38_T30_data_vals, "Ukn (0x%02X)"), pi->Data_Field_field_type_value == 3 ? "fcs-BAD" : "fcs-BAD-sig-end"); + comment = g_strdup_printf("WARNING: received t38:%s:HDLC:%s", + val_to_str(pi->data_value, + t38_T30_data_vals, + "Ukn (0x%02X)"), + pi->Data_Field_field_type_value == 3 ? "fcs-BAD" : "fcs-BAD-sig-end"); break; case 7: /* t4-non-ecm-sig-end */ duration = nstime_to_sec(&pinfo->rel_ts) - pi->time_first_t4_data; - frame_label = g_strdup_printf("t4-non-ecm-data:%s",val_to_str(pi->data_value, t38_T30_data_vals, "Ukn (0x%02X)") ); - comment = g_strdup_printf("t38:t4-non-ecm-data:%s Duration: %.2fs %s",val_to_str(pi->data_value, t38_T30_data_vals, "Ukn (0x%02X)"), duration, pi->desc_comment ); - insert_to_graph_t38(tapinfo, pinfo, frame_label, comment, (guint16)conv_num, &(pinfo->src), &(pinfo->dst), line_style, pi->frame_num_first_t4_data); + frame_label = g_strdup_printf("t4-non-ecm-data:%s", + val_to_str(pi->data_value, + t38_T30_data_vals, + "Ukn (0x%02X)") ); + comment = g_strdup_printf("t38:t4-non-ecm-data:%s Duration: %.2fs %s", + val_to_str(pi->data_value, + t38_T30_data_vals, + "Ukn (0x%02X)"), + duration, pi->desc_comment ); + insert_to_graph_t38(tapinfo, pinfo, frame_label, comment, + (guint16)conv_num, &(pinfo->src), &(pinfo->dst), + line_style, pi->frame_num_first_t4_data); break; } } |