diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-12-12 17:32:22 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-12-12 17:32:22 +0000 |
commit | 138ce6f204f782d256ddf6d8bfd6fac93a321ee5 (patch) | |
tree | cd4f6af21f179850f87d6b80e4cfa51c5cdd697b /epan | |
parent | aad04d59638f03884228d8c6a735c67bda5f7a6f (diff) |
Try to fix "initializer element is not computable at load time"
svn path=/trunk/; revision=53962
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-sflow.c | 29 | ||||
-rw-r--r-- | epan/dissectors/packet-sua.c | 80 | ||||
-rw-r--r-- | epan/dissectors/packet-tcp.c | 15 |
3 files changed, 91 insertions, 33 deletions
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c index 0023fbdb65..9e269d04cf 100644 --- a/epan/dissectors/packet-sflow.c +++ b/epan/dissectors/packet-sflow.c @@ -877,9 +877,12 @@ dissect_sflow_245_extended_switch(tvbuff_t *tvb, proto_tree *tree, gint offset) /* extended router data, after the packet data */ static gint dissect_sflow_245_extended_router(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { - struct sflow_address_type addr_type = {hf_sflow_245_nexthop_v4, hf_sflow_245_nexthop_v6}; + struct sflow_address_type addr_type; - offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); + addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4; + addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6; + + offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); proto_tree_add_item(tree, hf_sflow_245_nexthop_src_mask, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(tree, hf_sflow_245_nexthop_dst_mask, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -895,8 +898,11 @@ dissect_sflow_5_extended_mpls_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_item *ti_in; proto_tree *out_stack; proto_item *ti_out; + struct sflow_address_type addr_type; + + addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4; + addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6; - struct sflow_address_type addr_type = {hf_sflow_245_nexthop_v4, hf_sflow_245_nexthop_v6}; offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); in_label_count = tvb_get_ntohl(tvb, offset); @@ -937,8 +943,11 @@ dissect_sflow_5_extended_mpls_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* extended NAT data */ static gint dissect_sflow_5_extended_nat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) { - struct sflow_address_type addr_type = {hf_sflow_245_ipv4_src, - hf_sflow_245_ipv6_src}; + struct sflow_address_type addr_type; + + addr_type.hf_addr_v4 = hf_sflow_245_ipv4_src; + addr_type.hf_addr_v6 = hf_sflow_245_ipv6_src; + offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); addr_type.hf_addr_v4 = hf_sflow_245_ipv4_dst; @@ -965,7 +974,10 @@ dissect_sflow_245_extended_gateway(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* sFlow v5 contains next hop router IP address */ if (version == 5) { - struct sflow_address_type addr_type = {hf_sflow_245_nexthop_v4, hf_sflow_245_nexthop_v6}; + struct sflow_address_type addr_type; + + addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4; + addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6; offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL); } @@ -2333,12 +2345,15 @@ dissect_sflow_245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat proto_tree *sflow_245_tree; guint32 version, sub_agent_id, seqnum; struct sflow_address_details addr_details; - struct sflow_address_type addr_type = {hf_sflow_agent_address_v4, hf_sflow_agent_address_v6}; + struct sflow_address_type addr_type; guint32 numsamples; volatile guint offset = 0; guint i = 0; + addr_type.hf_addr_v4 = hf_sflow_agent_address_v4; + addr_type.hf_addr_v6 = hf_sflow_agent_address_v6; + /* * We fetch the version and address type so that we can determine, * ahead of time, whether this is an sFlow packet or not, before diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c index 808f4d9db9..47cd6bf219 100644 --- a/epan/dissectors/packet-sua.c +++ b/epan/dissectors/packet-sua.c @@ -443,12 +443,20 @@ sua_assoc(packet_info* pinfo, address* opc, address* dpc, guint src_rn, guint ds case MESSAGE_TYPE_CORE: { /* Calling and called is seen from initiator of CORE */ - wmem_tree_key_t bw_key[] = { - {1, &dpck}, - {1, &opck}, - {1, &src_rn}, - {0, NULL} - }; + wmem_tree_key_t bw_key[4]; + + bw_key[0].length = 1; + bw_key[0].key = &dpck; + + bw_key[1].length = 1; + bw_key[1].key = &opck; + + bw_key[2].length = 1; + bw_key[2].key = &src_rn; + + bw_key[3].length = 0; + bw_key[3].key = NULL; + if ( !(assoc = (sua_assoc_info_t *)wmem_tree_lookup32_array(assocs,bw_key)) && ! pinfo->fd->flags.visited) { assoc = new_assoc(opck, dpck); @@ -462,19 +470,33 @@ sua_assoc(packet_info* pinfo, address* opc, address* dpc, guint src_rn, guint ds case MESSAGE_TYPE_COAK: { - /* Calling and called is seen from initiator of CORE */ - wmem_tree_key_t fw_key[] = { - {1,&dpck}, - {1,&opck}, - {1,&src_rn}, - {0,NULL} - }; - wmem_tree_key_t bw_key[] = { - {1,&opck}, - {1,&dpck}, - {1,&dst_rn}, - {0,NULL} - }; + wmem_tree_key_t fw_key[4]; + wmem_tree_key_t bw_key[4]; + + fw_key[0].length = 1; + fw_key[0].key = &dpck; + + fw_key[1].length = 1; + fw_key[1].key = &opck; + + fw_key[2].length = 1; + fw_key[2].key = &src_rn; + + fw_key[3].length = 0; + fw_key[3].key = NULL; + + + bw_key[0].length = 1; + bw_key[0].key = &opck; + + bw_key[1].length = 1; + bw_key[1].key = &dpck; + + bw_key[2].length = 1; + bw_key[2].key = &dst_rn; + + bw_key[3].length = 0; + bw_key[3].key = NULL; /*g_warning("MESSAGE_TYPE_COAK dst_rn %u,src_rn %u ",dst_rn,src_rn);*/ if ( ( assoc = (sua_assoc_info_t *)wmem_tree_lookup32_array(assocs, bw_key) ) ) { goto got_assoc; @@ -504,12 +526,20 @@ got_assoc: default: { - wmem_tree_key_t key[] = { - {1, &opck}, - {1, &dpck}, - {1, &dst_rn}, - {0, NULL} - }; + wmem_tree_key_t key[4]; + + key[0].length = 1; + key[0].key = &opck; + + key[1].length = 1; + key[1].key = &dpck; + + key[2].length = 1; + key[2].key = &dst_rn; + + key[3].length = 0; + key[3].key = NULL; + assoc = (sua_assoc_info_t *)wmem_tree_lookup32_array(assocs,key); /* Should a check be made on pinfo->p2p_dir ??? */ break; diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index fcca74f9f0..214fa430ee 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -848,7 +848,20 @@ pdu_store_window_scale_option(guint8 ws, struct tcp_analysis *tcpd) static void tcp_analyze_get_acked_struct(guint32 frame, guint32 seq, guint32 ack, gboolean createflag, struct tcp_analysis *tcpd) { - wmem_tree_key_t key[] = {{1, &frame}, {1, &seq}, {1, &ack}, {0, NULL}}; + + wmem_tree_key_t key[4]; + + key[0].length = 1; + key[0].key = &frame; + + key[1].length = 1; + key[1].key = &seq; + + key[2].length = 1; + key[2].key = &ack; + + key[3].length = 0; + key[3].key = NULL; if (!tcpd) { return; |