diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-09-12 22:03:31 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-09-12 22:03:31 +0000 |
commit | 6cedc2c33633d2178e467585c4a1f90082cdd027 (patch) | |
tree | ee66121595420024d363875c610f8d97f2665095 /epan/dissectors/packet-batadv.c | |
parent | 2e9cd19c9c6354b668b402281ad12ab6e1889dd5 (diff) |
Convert a few more dissectors to wmem
svn path=/trunk/; revision=51991
Diffstat (limited to 'epan/dissectors/packet-batadv.c')
-rw-r--r-- | epan/dissectors/packet-batadv.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/epan/dissectors/packet-batadv.c b/epan/dissectors/packet-batadv.c index b32c7ae68c..fa508b5116 100644 --- a/epan/dissectors/packet-batadv.c +++ b/epan/dissectors/packet-batadv.c @@ -30,6 +30,7 @@ #include <epan/tap.h> #include <epan/addr_resolv.h> #include <epan/reassemble.h> +#include <epan/wmem/wmem.h> /* Start content from packet-batadv.h */ #define ETH_P_BATMAN 0x4305 @@ -723,7 +724,7 @@ static int dissect_batadv_batman_v5(tvbuff_t *tvb, int offset, packet_info *pinf tvbuff_t *next_tvb; - batman_packeth = (struct batman_packet_v5 *)ep_alloc(sizeof(struct batman_packet_v5)); + batman_packeth = (struct batman_packet_v5 *)wmem_alloc(wmem_packet_scope(), sizeof(struct batman_packet_v5)); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -833,7 +834,7 @@ static int dissect_batadv_batman_v7(tvbuff_t *tvb, int offset, packet_info *pinf tvbuff_t *next_tvb; - batman_packeth = (struct batman_packet_v7 *)ep_alloc(sizeof(struct batman_packet_v7)); + batman_packeth = (struct batman_packet_v7 *)wmem_alloc(wmem_packet_scope(), sizeof(struct batman_packet_v7)); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -934,7 +935,7 @@ static int dissect_batadv_batman_v9(tvbuff_t *tvb, int offset, packet_info *pinf tvbuff_t *next_tvb; - batman_packeth = (struct batman_packet_v9 *)ep_alloc(sizeof(struct batman_packet_v9)); + batman_packeth = (struct batman_packet_v9 *)wmem_alloc(wmem_packet_scope(), sizeof(struct batman_packet_v9)); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1044,7 +1045,7 @@ static int dissect_batadv_batman_v10(tvbuff_t *tvb, int offset, packet_info *pin tvbuff_t *next_tvb; - batman_packeth = (struct batman_packet_v10 *)ep_alloc(sizeof(struct batman_packet_v10)); + batman_packeth = (struct batman_packet_v10 *)wmem_alloc(wmem_packet_scope(), sizeof(struct batman_packet_v10)); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1154,7 +1155,7 @@ static int dissect_batadv_batman_v11(tvbuff_t *tvb, int offset, packet_info *pin tvbuff_t *next_tvb; - batman_packeth = (struct batman_packet_v11 *)ep_alloc(sizeof(struct batman_packet_v11)); + batman_packeth = (struct batman_packet_v11 *)wmem_alloc(wmem_packet_scope(), sizeof(struct batman_packet_v11)); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1257,7 +1258,7 @@ static int dissect_batadv_batman_v14(tvbuff_t *tvb, int offset, packet_info *pin tvbuff_t *next_tvb; gint length_remaining; - batman_packeth = (struct batman_packet_v14 *)ep_alloc(sizeof(struct batman_packet_v14)); + batman_packeth = (struct batman_packet_v14 *)wmem_alloc(wmem_packet_scope(), sizeof(struct batman_packet_v14)); type = tvb_get_guint8(tvb, offset+0); batman_packeth->version = tvb_get_guint8(tvb, offset+1); @@ -1433,7 +1434,7 @@ static void dissect_batadv_bcast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tre int offset = 0; proto_tree *batadv_bcast_tree = NULL; - bcast_packeth = (struct bcast_packet_v6 *)ep_alloc(sizeof(struct bcast_packet_v6)); + bcast_packeth = (struct bcast_packet_v6 *)wmem_alloc(wmem_packet_scope(), sizeof(struct bcast_packet_v6)); bcast_packeth->version = tvb_get_guint8(tvb, 1); orig_addr = tvb_get_ptr(tvb, 2, 6); @@ -1497,7 +1498,7 @@ static void dissect_batadv_bcast_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tr int offset = 0; proto_tree *batadv_bcast_tree = NULL; - bcast_packeth = (struct bcast_packet_v10 *)ep_alloc(sizeof(struct bcast_packet_v10)); + bcast_packeth = (struct bcast_packet_v10 *)wmem_alloc(wmem_packet_scope(), sizeof(struct bcast_packet_v10)); bcast_packeth->version = tvb_get_guint8(tvb, 1); orig_addr = tvb_get_ptr(tvb, 2, 6); @@ -1566,7 +1567,7 @@ static void dissect_batadv_bcast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tr int offset = 0; proto_tree *batadv_bcast_tree = NULL; - bcast_packeth = (struct bcast_packet_v14 *)ep_alloc(sizeof(struct bcast_packet_v14)); + bcast_packeth = (struct bcast_packet_v14 *)wmem_alloc(wmem_packet_scope(), sizeof(struct bcast_packet_v14)); bcast_packeth->version = tvb_get_guint8(tvb, 1); bcast_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -1670,7 +1671,7 @@ static void dissect_batadv_icmp_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree int offset = 0; proto_tree *batadv_icmp_tree = NULL; - icmp_packeth = (struct icmp_packet_v6 *)ep_alloc(sizeof(struct icmp_packet_v6)); + icmp_packeth = (struct icmp_packet_v6 *)wmem_alloc(wmem_packet_scope(), sizeof(struct icmp_packet_v6)); icmp_packeth->version = tvb_get_guint8(tvb, 1); icmp_packeth->msg_type = tvb_get_guint8(tvb, 2); @@ -1779,7 +1780,7 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree gint length_remaining; int offset = 0; - icmp_packeth = (struct icmp_packet_v7 *)ep_alloc(sizeof(struct icmp_packet_v7)); + icmp_packeth = (struct icmp_packet_v7 *)wmem_alloc(wmem_packet_scope(), sizeof(struct icmp_packet_v7)); icmp_packeth->version = tvb_get_guint8(tvb, 1); icmp_packeth->msg_type = tvb_get_guint8(tvb, 2); @@ -1867,7 +1868,7 @@ static void dissect_batadv_icmp_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tre gint length_remaining; int offset = 0; - icmp_packeth = (struct icmp_packet_v14 *)ep_alloc(sizeof(struct icmp_packet_v14)); + icmp_packeth = (struct icmp_packet_v14 *)wmem_alloc(wmem_packet_scope(), sizeof(struct icmp_packet_v14)); icmp_packeth->version = tvb_get_guint8(tvb, 1); icmp_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -1987,7 +1988,7 @@ static void dissect_batadv_unicast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_t int offset = 0; proto_tree *batadv_unicast_tree = NULL; - unicast_packeth = (struct unicast_packet_v6 *)ep_alloc(sizeof(struct unicast_packet_v6)); + unicast_packeth = (struct unicast_packet_v6 *)wmem_alloc(wmem_packet_scope(), sizeof(struct unicast_packet_v6)); unicast_packeth->version = tvb_get_guint8(tvb, 1); dest_addr = tvb_get_ptr(tvb, 2, 6); @@ -2052,7 +2053,7 @@ static void dissect_batadv_unicast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_ int offset = 0; proto_tree *batadv_unicast_tree = NULL; - unicast_packeth = (struct unicast_packet_v14 *)ep_alloc(sizeof(struct unicast_packet_v14)); + unicast_packeth = (struct unicast_packet_v14 *)wmem_alloc(wmem_packet_scope(), sizeof(struct unicast_packet_v14)); unicast_packeth->version = tvb_get_guint8(tvb, 1); unicast_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -2140,7 +2141,7 @@ static void dissect_batadv_unicast_4addr_v14(tvbuff_t *tvb, packet_info *pinfo, int offset = 0; proto_tree *batadv_unicast_4addr_tree = NULL; - unicast_4addr_packeth = (struct unicast_4addr_packet_v14 *)ep_alloc(sizeof(struct unicast_4addr_packet_v14)); + unicast_4addr_packeth = (struct unicast_4addr_packet_v14 *)wmem_alloc(wmem_packet_scope(), sizeof(struct unicast_4addr_packet_v14)); unicast_4addr_packeth->version = tvb_get_guint8(tvb, 1); unicast_4addr_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -2248,7 +2249,7 @@ static void dissect_batadv_unicast_frag_v12(tvbuff_t *tvb, packet_info *pinfo, p int head = 0; gint length_remaining; - unicast_frag_packeth = (struct unicast_frag_packet_v12 *)ep_alloc(sizeof(struct unicast_frag_packet_v12)); + unicast_frag_packeth = (struct unicast_frag_packet_v12 *)wmem_alloc(wmem_packet_scope(), sizeof(struct unicast_frag_packet_v12)); unicast_frag_packeth->version = tvb_get_guint8(tvb, 1); dest_addr = tvb_get_ptr(tvb, 2, 6); @@ -2354,7 +2355,7 @@ static void dissect_batadv_unicast_frag_v14(tvbuff_t *tvb, packet_info *pinfo, p int head = 0; gint length_remaining; - unicast_frag_packeth = (struct unicast_frag_packet_v14 *)ep_alloc(sizeof(struct unicast_frag_packet_v14)); + unicast_frag_packeth = (struct unicast_frag_packet_v14 *)wmem_alloc(wmem_packet_scope(), sizeof(struct unicast_frag_packet_v14)); unicast_frag_packeth->version = tvb_get_guint8(tvb, 1); unicast_frag_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -2496,7 +2497,7 @@ static void dissect_batadv_vis_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree gint length_remaining; int offset = 0, i; - vis_packeth = (struct vis_packet_v6 *)ep_alloc(sizeof(struct vis_packet_v6)); + vis_packeth = (struct vis_packet_v6 *)wmem_alloc(wmem_packet_scope(), sizeof(struct vis_packet_v6)); vis_packeth->version = tvb_get_guint8(tvb, 1); vis_packeth->vis_type = tvb_get_guint8(tvb, 2); @@ -2624,7 +2625,7 @@ static void dissect_batadv_vis_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tree gint length_remaining; int offset = 0, i; - vis_packeth = (struct vis_packet_v10 *)ep_alloc(sizeof(struct vis_packet_v10)); + vis_packeth = (struct vis_packet_v10 *)wmem_alloc(wmem_packet_scope(), sizeof(struct vis_packet_v10)); vis_packeth->version = tvb_get_guint8(tvb, 1); vis_packeth->vis_type = tvb_get_guint8(tvb, 2); @@ -2728,7 +2729,7 @@ static void dissect_batadv_vis_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tree gint length_remaining; int offset = 0, i; - vis_packeth = (struct vis_packet_v14 *)ep_alloc(sizeof(struct vis_packet_v14)); + vis_packeth = (struct vis_packet_v14 *)wmem_alloc(wmem_packet_scope(), sizeof(struct vis_packet_v14)); vis_packeth->version = tvb_get_guint8(tvb, 1); vis_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -2907,7 +2908,7 @@ static void dissect_batadv_tt_query_v14(tvbuff_t *tvb, packet_info *pinfo _U_, p int offset = 0, i; int tt_type; - tt_query_packeth = (struct tt_query_packet_v14 *)ep_alloc(sizeof(struct tt_query_packet_v14)); + tt_query_packeth = (struct tt_query_packet_v14 *)wmem_alloc(wmem_packet_scope(), sizeof(struct tt_query_packet_v14)); tt_query_packeth->version = tvb_get_guint8(tvb, 1); tt_query_packeth->ttl = tvb_get_guint8(tvb, 2); @@ -3083,7 +3084,7 @@ static void dissect_batadv_roam_adv_v14(tvbuff_t *tvb, packet_info *pinfo, proto gint length_remaining; int offset = 0; - roam_adv_packeth = (struct roam_adv_packet_v14 *)ep_alloc(sizeof(struct roam_adv_packet_v14)); + roam_adv_packeth = (struct roam_adv_packet_v14 *)wmem_alloc(wmem_packet_scope(), sizeof(struct roam_adv_packet_v14)); roam_adv_packeth->version = tvb_get_guint8(tvb, 1); roam_adv_packeth->ttl = tvb_get_guint8(tvb, 2); |