diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-05-14 19:57:19 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-05-14 19:57:19 +0000 |
commit | 8e509279b899720a94ffc466b49c0955222befe1 (patch) | |
tree | 546abfb2471636d97530060b6ad75c9cbf4f0515 /epan | |
parent | cd01af1357a5587b22c4af3e43d82c27771add13 (diff) | |
download | wireshark-8e509279b899720a94ffc466b49c0955222befe1.tar.gz |
Add a tag for original frame number.
svn path=/trunk/; revision=49298
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-exported_pdu.c | 11 | ||||
-rw-r--r-- | epan/dissectors/packet-sip.c | 2 | ||||
-rw-r--r-- | epan/exported_pdu.c | 20 | ||||
-rw-r--r-- | epan/exported_pdu.h | 6 |
4 files changed, 38 insertions, 1 deletions
diff --git a/epan/dissectors/packet-exported_pdu.c b/epan/dissectors/packet-exported_pdu.c index 93143b6fb2..2b74fc04c6 100644 --- a/epan/dissectors/packet-exported_pdu.c +++ b/epan/dissectors/packet-exported_pdu.c @@ -45,6 +45,7 @@ static int hf_exported_pdu_ipv6_src = -1; static int hf_exported_pdu_ipv6_dst = -1; static int hf_exported_pdu_src_port = -1; static int hf_exported_pdu_dst_port = -1; +static int hf_exported_pdu_orig_fno = -1; /* Initialize the subtree pointers */ @@ -73,6 +74,8 @@ static const value_string exported_pdu_tag_vals[] = { { EXP_PDU_TAG_SS7_OPC, "SS7 OPC" }, { EXP_PDU_TAG_SS7_DPC, "SS7 DPC" }, + { EXP_PDU_TAG_ORIG_FNO, "Original Frame number" }, + { 0, NULL } }; @@ -144,6 +147,9 @@ dissect_exported_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(tag_tree, hf_exported_pdu_dst_port, tvb, offset, 4, ENC_BIG_ENDIAN); pinfo->destport = tvb_get_ntohl(tvb,offset); break; + case EXP_PDU_TAG_ORIG_FNO: + proto_tree_add_item(tag_tree, hf_exported_pdu_orig_fno, tvb, offset, 4, ENC_BIG_ENDIAN); + break; default: break; }; @@ -227,6 +233,11 @@ proto_register_exported_pdu(void) FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, + { &hf_exported_pdu_orig_fno, + { "Original Frame Number", "exported_pdu.orig_fno", + FT_INT32, BASE_DEC, NULL, 0, + NULL, HFILL } + }, }; /* Setup protocol subtree array */ diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index 75e0bb3c20..469a59917f 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -999,7 +999,7 @@ export_sip_pdu(packet_info *pinfo, tvbuff_t *tvb) guint32 tags_bit_field; tags_bit_field = EXP_PDU_TAG_IP_SRC_BIT + EXP_PDU_TAG_IP_DST_BIT + EXP_PDU_TAG_SRC_PORT_BIT+ - EXP_PDU_TAG_DST_PORT_BIT; + EXP_PDU_TAG_DST_PORT_BIT + EXP_PDU_TAG_ORIG_FNO_BIT; exp_pdu_data = load_export_pdu_tags(pinfo, "sip", -1, tags_bit_field); diff --git a/epan/exported_pdu.c b/epan/exported_pdu.c index 166797dd3f..9c66bb7323 100644 --- a/epan/exported_pdu.c +++ b/epan/exported_pdu.c @@ -83,6 +83,10 @@ load_export_pdu_tags(packet_info *pinfo, const char* proto_name, int wtap_encap tag_buf_size= tag_buf_size + EXP_PDU_TAG_DST_PORT_LEN + 4; } + if((tags_bit_field & EXP_PDU_TAG_ORIG_FNO_BIT) == EXP_PDU_TAG_ORIG_FNO_BIT){ + tag_buf_size= tag_buf_size + EXP_PDU_TAG_ORIG_FNO_LEN + 4; + } + /* Add end of options length */ tag_buf_size+=4; @@ -182,6 +186,22 @@ load_export_pdu_tags(packet_info *pinfo, const char* proto_name, int wtap_encap exp_pdu_data->tlv_buffer[i+1] = (pinfo->destport & 0x00ff0000) >> 16; exp_pdu_data->tlv_buffer[i+2] = (pinfo->destport & 0x0000ff00) >> 8; exp_pdu_data->tlv_buffer[i+3] = (pinfo->destport & 0x000000ff); + i = i +EXP_PDU_TAG_DST_PORT_LEN; + } + + if((tags_bit_field & EXP_PDU_TAG_ORIG_FNO_LEN) == EXP_PDU_TAG_ORIG_FNO_LEN){ + exp_pdu_data->tlv_buffer[i] = 0; + i++; + exp_pdu_data->tlv_buffer[i] = EXP_PDU_TAG_ORIG_FNO; + i++; + exp_pdu_data->tlv_buffer[i] = 0; + i++; + exp_pdu_data->tlv_buffer[i] = EXP_PDU_TAG_ORIG_FNO_LEN; /* tag length */ + i++; + exp_pdu_data->tlv_buffer[i] = (pinfo->fd->num & 0xff000000) >> 24; + exp_pdu_data->tlv_buffer[i+1] = (pinfo->fd->num & 0x00ff0000) >> 16; + exp_pdu_data->tlv_buffer[i+2] = (pinfo->fd->num & 0x0000ff00) >> 8; + exp_pdu_data->tlv_buffer[i+3] = (pinfo->fd->num & 0x000000ff); /*i = i +EXP_PDU_TAG_DST_PORT_LEN;*/ } diff --git a/epan/exported_pdu.h b/epan/exported_pdu.h index 662b12301c..3747cc029e 100644 --- a/epan/exported_pdu.h +++ b/epan/exported_pdu.h @@ -80,6 +80,8 @@ #define EXP_PDU_TAG_SS7_OPC 27 #define EXP_PDU_TAG_SS7_DPC 28 +#define EXP_PDU_TAG_ORIG_FNO 29 + typedef struct _exp_pdu_data_t { int tlv_buffer_len; @@ -99,6 +101,8 @@ typedef struct _exp_pdu_data_t { #define EXP_PDU_TAG_SS7_OPC_BIT 0x00000020 #define EXP_PDU_TAG_SS7_DPC_BIT 0x00000040 +#define EXP_PDU_TAG_ORIG_FNO_BIT 0x00000080 + #define EXP_PDU_TAG_IPV4_SRC_LEN 4 #define EXP_PDU_TAG_IPV4_DST_LEN 4 #define EXP_PDU_TAG_IPV6_SRC_LEN 16 @@ -112,6 +116,8 @@ typedef struct _exp_pdu_data_t { #define EXP_PDU_TAG_SS7_OPC_LEN 2 #define EXP_PDU_TAG_SS7_DPC_LEN 2 +#define EXP_PDU_TAG_ORIG_FNO_LEN 4 + /** * Allocates and fills the exp_pdu_data_t struct according to the wanted_exp_tags * bit_fileld, if proto_name is != NULL, wtap_encap must be -1 or vice-versa |