ep_<protocol>_port_to_display -> <protocol>_port_to_display
authorMichael Mann <mmann78@netscape.net>
Wed, 7 Jan 2015 21:24:17 +0000 (16:24 -0500)
committerAnders Broman <a.broman58@gmail.com>
Thu, 8 Jan 2015 05:32:32 +0000 (05:32 +0000)
Adjust any other ep_ related APIs related to the transition.

Change-Id: I961b371c2c4bda557e0f1817705c27eef0dae66c
Reviewed-on: https://code.wireshark.org/review/6388
Reviewed-by: Anders Broman <a.broman58@gmail.com>
26 files changed:
debian/libwireshark0.symbols
epan/addr_resolv.c
epan/addr_resolv.h
epan/column-utils.c
epan/conversation_table.c
epan/conversation_table.h
epan/dissectors/packet-dccp.c
epan/dissectors/packet-dns.c
epan/dissectors/packet-dvbci.c
epan/dissectors/packet-ipmi.c
epan/dissectors/packet-nt-tpcp.c
epan/dissectors/packet-rx.c
epan/dissectors/packet-sctp.c
epan/dissectors/packet-tcp.c
epan/dissectors/packet-udp.c
epan/dissectors/packet-xmcp.c
ui/cli/tap-endpoints.c
ui/cli/tap-iousers.c
ui/gtk/conversations_table.c
ui/gtk/follow_ssl.c
ui/gtk/follow_tcp.c
ui/gtk/follow_udp.c
ui/gtk/hostlist_table.c
ui/qt/conversation_dialog.cpp
ui/qt/endpoint_dialog.cpp
ui/qt/follow_stream_dialog.cpp

index 2f7a97e10478a8f157443772df9ab3e81d41c222..9763410230cd3ee72023acef0b5c3f2f04d2d139 100644 (file)
@@ -75,7 +75,6 @@ libwireshark.so.0 libwireshark0 #MINVER#
  build_follow_index_filter@Base 1.12.0~rc1
  byte_array_dup@Base 1.9.1
  byte_array_equal@Base 1.9.1
- bytes_to_ep_str@Base 1.12.0~rc1
  bytes_to_str@Base 1.99.2
  bytestring_to_str@Base 1.9.1
  call_ber_oid_callback@Base 1.9.1
@@ -443,7 +442,6 @@ libwireshark.so.0 libwireshark0 #MINVER#
  ep_alloc0@Base 1.9.1
  ep_alloc@Base 1.9.1
  ep_memdup@Base 1.9.1
- ep_sctp_port_to_display@Base 1.12.0~rc1
  ep_strbuf_append_printf@Base 1.9.1
  ep_strbuf_new@Base 1.9.1
  ep_strbuf_printf@Base 1.9.1
@@ -453,8 +451,6 @@ libwireshark.so.0 libwireshark0 #MINVER#
  ep_strdup_vprintf@Base 1.9.1
  ep_strndup@Base 1.9.1
  ep_strsplit@Base 1.9.1
- ep_tcp_port_to_display@Base 1.12.0~rc1
- ep_udp_port_to_display@Base 1.12.0~rc1
  epan_cleanup@Base 1.9.1
  epan_dissect_cleanup@Base 1.9.1
  epan_dissect_fake_protocols@Base 1.9.1
@@ -1128,6 +1124,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
  scsi_sbc_vals_ext@Base 1.12.0~rc1
  scsi_smc_vals_ext@Base 1.12.0~rc1
  scsi_ssc_vals_ext@Base 1.12.0~rc1
+ sctp_port_to_display@Base 1.99.2
  se_alloc0@Base 1.9.1
  se_alloc@Base 1.9.1
  set_actual_length@Base 1.9.1
@@ -1211,6 +1208,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
  tap_listeners_require_dissection@Base 1.9.1
  tap_queue_packet@Base 1.9.1
  tcp_dissect_pdus@Base 1.9.1
+ tcp_port_to_display@Base 1.99.2
  tfs_accept_reject@Base 1.9.1
  tfs_accepted_not_accepted@Base 1.9.1
  tfs_ack_nack@Base 1.9.1
@@ -1435,6 +1433,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
  uat_remove_record_idx@Base 1.9.1
  uat_save@Base 1.9.1
  uat_swap@Base 1.9.1
+ udp_port_to_display@Base 1.99.2
  union_of_tap_listener_flags@Base 1.9.1
  update_crc10_by_bytes_tvb@Base 1.99.0
  uri_str_to_bytes@Base 1.9.1
index bbc1d1367581f007d5bc592bb7743aad6180ccbe..7221ee34b263c442777e8cab7722f3664a638adf 100644 (file)
@@ -601,9 +601,9 @@ parse_services_file(const char * path)
  * unsigned integer to ascii
  */
 static gchar *
-ep_utoa(guint port)
+wmem_utoa(wmem_allocator_t *allocator, guint port)
 {
-    gchar *bp = (gchar *)ep_alloc(MAXNAMELEN);
+    gchar *bp = (gchar *)wmem_alloc(allocator, MAXNAMELEN);
 
     /* XXX, guint32_to_str() ? */
     guint32_to_str_buf(port, bp, MAXNAMELEN);
@@ -2834,52 +2834,52 @@ manually_resolve_cleanup(void)
 }
 
 gchar *
-ep_udp_port_to_display(guint port)
+udp_port_to_display(wmem_allocator_t *allocator, guint port)
 {
 
     if (!gbl_resolv_flags.transport_name) {
-        return ep_utoa(port);
+        return wmem_utoa(allocator, port);
     }
 
     return serv_name_lookup(port, PT_UDP);
 
-} /* ep_udp_port_to_display */
+} /* udp_port_to_display */
 
 gchar *
-ep_dccp_port_to_display(guint port)
+dccp_port_to_display(wmem_allocator_t *allocator, guint port)
 {
 
     if (!gbl_resolv_flags.transport_name) {
-        return ep_utoa(port);
+        return wmem_utoa(allocator, port);
     }
 
     return serv_name_lookup(port, PT_DCCP);
 
-} /* ep_dccp_port_to_display */
+} /* dccp_port_to_display */
 
 gchar *
-ep_tcp_port_to_display(guint port)
+tcp_port_to_display(wmem_allocator_t *allocator, guint port)
 {
 
     if (!gbl_resolv_flags.transport_name) {
-        return ep_utoa(port);
+        return wmem_utoa(allocator, port);
     }
 
     return serv_name_lookup(port, PT_TCP);
 
-} /* ep_tcp_port_to_display */
+} /* tcp_port_to_display */
 
 gchar *
-ep_sctp_port_to_display(guint port)
+sctp_port_to_display(wmem_allocator_t *allocator, guint port)
 {
 
     if (!gbl_resolv_flags.transport_name) {
-        return ep_utoa(port);
+        return wmem_utoa(allocator, port);
     }
 
     return serv_name_lookup(port, PT_SCTP);
 
-} /* ep_sctp_port_to_display */
+} /* sctp_port_to_display */
 
 const gchar *
 address_to_display(wmem_allocator_t *allocator, const address *addr)
index 91c273c3ae58d07599b067bf1799edeeb816ab50..23e1c37967b5d16473b6d57d61f136cdc83cb4d1 100644 (file)
@@ -109,28 +109,28 @@ extern gchar *g_pipxnets_path;
 /* Functions in addr_resolv.c */
 
 /*
- * ep_udp_port_to_display() returns the port name corresponding to that UDP port,
+ * udp_port_to_display() returns the port name corresponding to that UDP port,
  * or the port number as a string if not found.
  */
-WS_DLL_PUBLIC gchar *ep_udp_port_to_display(guint port);
+WS_DLL_PUBLIC gchar *udp_port_to_display(wmem_allocator_t *allocator, guint port);
 
 /*
- * ep_tcp_port_to_display() returns the port name corresponding to that TCP port,
+ * tcp_port_to_display() returns the port name corresponding to that TCP port,
  * or the port number as a string if not found.
  */
-WS_DLL_PUBLIC gchar *ep_tcp_port_to_display(guint port);
+WS_DLL_PUBLIC gchar *tcp_port_to_display(wmem_allocator_t *allocator, guint port);
 
 /*
- * ep_dccp_port_to_display() returns the port name corresponding to that DCCP port,
+ * dccp_port_to_display() returns the port name corresponding to that DCCP port,
  * or the port number as a string if not found.
  */
-extern gchar *ep_dccp_port_to_display(guint port);
+extern gchar *dccp_port_to_display(wmem_allocator_t *allocator, guint port);
 
 /*
- * ep_sctp_port_to_display() returns the port name corresponding to that SCTP port,
+ * sctp_port_to_display() returns the port name corresponding to that SCTP port,
  * or the port number as a string if not found.
  */
-WS_DLL_PUBLIC gchar *ep_sctp_port_to_display(guint port);
+WS_DLL_PUBLIC gchar *sctp_port_to_display(wmem_allocator_t *allocator, guint port);
 
 /*
  * address_to_display takes as input an "address", as defined in address.h */
index 41092e8fd29bcd68f8f653d3ff20ea20138d4fb3..8d088e00988bb3e222f72732e4e7d84e44220c73 100644 (file)
@@ -1946,7 +1946,7 @@ col_set_port(packet_info *pinfo, const int col, const gboolean is_res, const gbo
   switch (pinfo->ptype) {
   case PT_SCTP:
     if (is_res)
-      g_strlcpy(pinfo->cinfo->col_buf[col], ep_sctp_port_to_display(port), COL_MAX_LEN);
+      g_strlcpy(pinfo->cinfo->col_buf[col], sctp_port_to_display(pinfo->pool, port), COL_MAX_LEN);
     else
       guint32_to_str_buf(port, pinfo->cinfo->col_buf[col], COL_MAX_LEN);
     break;
@@ -1954,7 +1954,7 @@ col_set_port(packet_info *pinfo, const int col, const gboolean is_res, const gbo
   case PT_TCP:
     guint32_to_str_buf(port, pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN);
     if (is_res)
-      g_strlcpy(pinfo->cinfo->col_buf[col], ep_tcp_port_to_display(port), COL_MAX_LEN);
+      g_strlcpy(pinfo->cinfo->col_buf[col], tcp_port_to_display(pinfo->pool, port), COL_MAX_LEN);
     else
       g_strlcpy(pinfo->cinfo->col_buf[col], pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN);
     if (is_src)
@@ -1966,7 +1966,7 @@ col_set_port(packet_info *pinfo, const int col, const gboolean is_res, const gbo
   case PT_UDP:
     guint32_to_str_buf(port, pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN);
     if (is_res)
-      g_strlcpy(pinfo->cinfo->col_buf[col], ep_udp_port_to_display(port), COL_MAX_LEN);
+      g_strlcpy(pinfo->cinfo->col_buf[col], udp_port_to_display(pinfo->pool, port), COL_MAX_LEN);
     else
       g_strlcpy(pinfo->cinfo->col_buf[col], pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN);
     if (is_src)
index 283c4e89cc00f55fdc447114934674b50c84e9b4..269ef899884f12b4b568dc5aaf922d6c6a72dca0 100644 (file)
@@ -341,20 +341,20 @@ const char *get_conversation_address(wmem_allocator_t *allocator, address *addr,
     }
 }
 
-const char *get_conversation_port(guint32 port, port_type ptype, gboolean resolve_names)
+const char *get_conversation_port(wmem_allocator_t *allocator, guint32 port, port_type ptype, gboolean resolve_names)
 {
 
     if(!resolve_names) ptype = PT_NONE;
 
     switch(ptype) {
     case(PT_TCP):
-        return ep_tcp_port_to_display(port);
+        return tcp_port_to_display(allocator, port);
     case(PT_UDP):
-        return ep_udp_port_to_display(port);
+        return udp_port_to_display(allocator, port);
     case(PT_SCTP):
-        return ep_sctp_port_to_display(port);
+        return sctp_port_to_display(allocator, port);
     default:
-        return ep_strdup_printf("%d", port);
+        return wmem_strdup_printf(allocator, "%d", port);
     }
 }
 
index 536a237487337d1284890a46e8845fd0052e89ea..9d277b48cba895eaa56e8172dfaffba7f5ca92fd 100644 (file)
@@ -266,7 +266,7 @@ WS_DLL_PUBLIC const char *get_conversation_address(wmem_allocator_t *allocator,
  * @param resolve_names Enable name resolution.
  * @return An ep_allocated string representing the port.
  */
-WS_DLL_PUBLIC const char *get_conversation_port(guint32 port, port_type ptype, gboolean resolve_names);
+WS_DLL_PUBLIC const char *get_conversation_port(wmem_allocator_t *allocator, guint32 port, port_type ptype, gboolean resolve_names);
 
 /** Get a display filter for the given conversation and direction.
  *
index b7f4471bc3d6658baa4138d55d8d6e34ae3ce2a3..b4a5211e3b17f5bc5edf3187391bced7c7aa8447 100644 (file)
@@ -650,14 +650,14 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
     proto_tree_add_uint_format_value(dccp_tree, hf_dccp_srcport, tvb,
                                      offset, 2, dccph->sport,
                                      "%s (%u)",
-                                     ep_dccp_port_to_display(dccph->sport),
+                                     dccp_port_to_display(wmem_packet_scope(), dccph->sport),
                                      dccph->sport);
     if (dccp_summary_in_tree) {
         proto_item_append_text(dccp_item, ", Src Port: %s (%u)",
-                               ep_dccp_port_to_display(dccph->sport), dccph->sport);
+                               dccp_port_to_display(wmem_packet_scope(), dccph->sport), dccph->sport);
     }
     col_add_fstr(pinfo->cinfo, COL_INFO,
-                 "%s ", ep_dccp_port_to_display(dccph->sport));
+                 "%s ", dccp_port_to_display(wmem_packet_scope(), dccph->sport));
     hidden_item =
         proto_tree_add_uint(dccp_tree, hf_dccp_port, tvb, offset, 2,
                             dccph->sport);
@@ -668,14 +668,14 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
     proto_tree_add_uint_format_value(dccp_tree, hf_dccp_dstport, tvb,
                                      offset, 2, dccph->dport,
                                      "%s (%u)",
-                                     ep_dccp_port_to_display(dccph->dport),
+                                     dccp_port_to_display(wmem_packet_scope(), dccph->dport),
                                      dccph->dport);
     if (dccp_summary_in_tree) {
         proto_item_append_text(dccp_item, ", Dst Port: %s (%u)",
-                               ep_dccp_port_to_display(dccph->dport), dccph->dport);
+                               dccp_port_to_display(wmem_packet_scope(), dccph->dport), dccph->dport);
     }
     col_append_fstr(pinfo->cinfo, COL_INFO, " > %s",
-                    ep_dccp_port_to_display(dccph->dport));
+                    dccp_port_to_display(wmem_packet_scope(), dccph->dport));
     hidden_item =
         proto_tree_add_uint(dccp_tree, hf_dccp_port, tvb, offset, 2,
                             dccph->dport);
index 09e941b5c8e14b93a4b3d85d1556bcd7472356bf..915eae74dc43745dc9dbcc8d4d4f28d11ce616d1 100644 (file)
@@ -2008,11 +2008,11 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
               switch (protocol) {
 
                 case IP_PROTO_TCP:
-                  wmem_strbuf_append(bitnames, ep_tcp_port_to_display(port_num));
+                  wmem_strbuf_append(bitnames, tcp_port_to_display(wmem_packet_scope(), port_num));
                   break;
 
                 case IP_PROTO_UDP:
-                  wmem_strbuf_append(bitnames, ep_udp_port_to_display(port_num));
+                  wmem_strbuf_append(bitnames, udp_port_to_display(wmem_packet_scope(), port_num));
                   break;
 
                 default:
index 434d99010baa0193eedf98f5954bd65e89a9f67f..42517ae9cceb3e2371ad33198e7e46283a7f66e9 100644 (file)
@@ -1888,13 +1888,13 @@ dissect_conn_desc(tvbuff_t *tvb, gint offset,  circuit_t *circuit,
                     tvb, offset, 1, ENC_BIG_ENDIAN);
         offset ++;
         if (port_item) {
-            if (ip_proto==LSC_TCP && ep_tcp_port_to_display(port)) {
+            if (ip_proto==LSC_TCP && tcp_port_to_display(wmem_packet_scope(), port)) {
                 proto_item_append_text(port_item, " (%s)",
-                        ep_tcp_port_to_display(port));
+                        tcp_port_to_display(wmem_packet_scope(), port));
             }
-            else if (ip_proto==LSC_UDP && ep_udp_port_to_display(port)) {
+            else if (ip_proto==LSC_UDP && udp_port_to_display(wmem_packet_scope(), port)) {
                 proto_item_append_text(port_item, " (%s)",
-                        ep_udp_port_to_display(port));
+                        udp_port_to_display(wmem_packet_scope(), port));
             }
         }
         store_lsc_msg_dissector(circuit, ip_proto, port);
@@ -1915,13 +1915,13 @@ dissect_conn_desc(tvbuff_t *tvb, gint offset,  circuit_t *circuit,
                 hf_dvbci_lsc_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
         offset +=2;
         if (port_item) {
-            if (ip_proto==LSC_TCP && ep_tcp_port_to_display(port)) {
+            if (ip_proto==LSC_TCP && tcp_port_to_display(wmem_packet_scope(), port)) {
                 proto_item_append_text(port_item, " (%s)",
-                        ep_tcp_port_to_display(port));
+                        tcp_port_to_display(wmem_packet_scope(), port));
             }
-            else if (ip_proto==LSC_UDP && ep_udp_port_to_display(port)) {
+            else if (ip_proto==LSC_UDP && udp_port_to_display(wmem_packet_scope(), port)) {
                 proto_item_append_text(port_item, " (%s)",
-                        ep_udp_port_to_display(port));
+                        udp_port_to_display(wmem_packet_scope(), port));
             }
         }
         store_lsc_msg_dissector(circuit, ip_proto, port);
index e0bcfcfb53c34938df02ddb7c43dc41efe719771..1a0701adb2d6cbe408301552b53feb67c4d1da75 100644 (file)
@@ -1277,7 +1277,7 @@ ipmi_fmt_channel(gchar *s, guint32 v)
 void
 ipmi_fmt_udpport(gchar *s, guint32 v)
 {
-       g_snprintf(s, ITEM_LABEL_LENGTH, "%s (%d)", ep_udp_port_to_display(v), v);
+       g_snprintf(s, ITEM_LABEL_LENGTH, "%s (%d)", udp_port_to_display(wmem_packet_scope(), v), v);
 }
 
 void
index a3b9af761c68a1ea6e9779c3078ef8d632bd9b09..b24f643b859f16d7d239dc27e3074028196bf43c 100644 (file)
@@ -25,7 +25,7 @@
 
 
 #include <epan/packet.h>
-#include <epan/addr_resolv.h> /* this is for get_hostname and ep_udp_port_to_display */
+#include <epan/addr_resolv.h> /* this is for get_hostname and udp_port_to_display */
 
 void proto_register_tpcp(void);
 void proto_reg_handoff_tpcp(void);
@@ -141,7 +141,7 @@ dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
 
        cport = tvb_get_ntohs(tvb, 6);
        proto_tree_add_uint_format_value(tpcp_tree, hf_tpcp_cport, tvb, 6, 2, cport,
-                                        "%s", ep_udp_port_to_display(cport));
+                                        "%s", udp_port_to_display(wmem_packet_scope(), cport));
 
        proto_tree_add_item(tpcp_tree, hf_tpcp_caddr, tvb, 8, 4, ENC_BIG_ENDIAN);
        proto_tree_add_item(tpcp_tree, hf_tpcp_saddr, tvb, 12, 4, ENC_BIG_ENDIAN);
@@ -155,7 +155,7 @@ dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
        col_add_fstr(pinfo->cinfo, COL_INFO,"%s id %d CPort %s CIP %s SIP %s",
                        val_to_str_const(type, type_vals, "Unknown"),
                        id,
-                       ep_udp_port_to_display(cport),
+                       udp_port_to_display(wmem_packet_scope(), cport),
                        tvb_ip_to_str(tvb, 8),
                        tvb_ip_to_str(tvb, 12));
 
index 39c24b3103b547172c2f1f320b33cdecd00bf605..0ac7b255acd8104b42fdf8ef3d94892927446343 100644 (file)
@@ -203,8 +203,8 @@ dissect_rx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
                        "Destination Port: %s  ",
                        (unsigned long)seq,
                        (unsigned long)callnumber,
-                       ep_udp_port_to_display(pinfo->srcport),
-                       ep_udp_port_to_display(pinfo->destport)
+                       udp_port_to_display(wmem_packet_scope(), pinfo->srcport),
+                       udp_port_to_display(wmem_packet_scope(), pinfo->destport)
                );
 
        item = proto_tree_add_item(parent_tree, hf_rx_response, tvb, offset, -1, ENC_NA);
@@ -255,8 +255,8 @@ dissect_rx_abort(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
                        "Destination Port: %s  ",
                        (unsigned long)seq,
                        (unsigned long)callnumber,
-                       ep_udp_port_to_display(pinfo->srcport),
-                       ep_udp_port_to_display(pinfo->destport)
+                       udp_port_to_display(wmem_packet_scope(), pinfo->srcport),
+                       udp_port_to_display(wmem_packet_scope(), pinfo->destport)
                );
 
        item = proto_tree_add_item(parent_tree, hf_rx_abort, tvb, offset, -1, ENC_NA);
@@ -287,8 +287,8 @@ dissect_rx_challenge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
                        "Destination Port: %s  ",
                        (unsigned long)seq,
                        (unsigned long)callnumber,
-                       ep_udp_port_to_display(pinfo->srcport),
-                       ep_udp_port_to_display(pinfo->destport)
+                       udp_port_to_display(wmem_packet_scope(), pinfo->srcport),
+                       udp_port_to_display(wmem_packet_scope(), pinfo->destport)
                );
 
        item = proto_tree_add_item(parent_tree, hf_rx_challenge, tvb, offset, -1, ENC_NA);
@@ -327,8 +327,8 @@ dissect_rx_acks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
                        "Destination Port: %s  ",
                        (unsigned long)seq,
                        (unsigned long)callnumber,
-                       ep_udp_port_to_display(pinfo->srcport),
-                       ep_udp_port_to_display(pinfo->destport)
+                       udp_port_to_display(wmem_packet_scope(), pinfo->srcport),
+                       udp_port_to_display(wmem_packet_scope(), pinfo->destport)
                );
 
        item = proto_tree_add_item(parent_tree, hf_rx_ack, tvb, offset, -1, ENC_NA);
@@ -539,8 +539,8 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *dat
                                "Destination Port: %s  ",
                                (unsigned long)seq,
                                (unsigned long)callnumber,
-                               ep_udp_port_to_display(pinfo->srcport),
-                               ep_udp_port_to_display(pinfo->destport)
+                               udp_port_to_display(wmem_packet_scope(), pinfo->srcport),
+                               udp_port_to_display(wmem_packet_scope(), pinfo->destport)
                        );
                break;
        case RX_PACKET_TYPE_CHALLENGE:
index f5e2c88336ec4e7a34cb55dc6d8f7e3049f0d719..3e3e65bb684186bf5e2a800533b2a69776864717 100644 (file)
@@ -4501,8 +4501,8 @@ dissect_sctp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
     if (show_port_numbers)
       sctp_item = proto_tree_add_protocol_format(tree, proto_sctp, tvb, 0, -1,
                                                  "Stream Control Transmission Protocol, Src Port: %s (%u), Dst Port: %s (%u)",
-                                                 ep_sctp_port_to_display(source_port), source_port,
-                                                 ep_sctp_port_to_display(destination_port), destination_port);
+                                                 sctp_port_to_display(wmem_packet_scope(), source_port), source_port,
+                                                 sctp_port_to_display(wmem_packet_scope(), destination_port), destination_port);
     else
       sctp_item = proto_tree_add_item(tree, proto_sctp, tvb, 0, -1, ENC_NA);
 
index 71b28c76e5481254264f92d227cd61e0e5fb0175..b8dbeea2d5dcdc9ef4f106affb924556cef9a331 100644 (file)
@@ -4355,8 +4355,8 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     tcph->th_sport = tvb_get_ntohs(tvb, offset);
     tcph->th_dport = tvb_get_ntohs(tvb, offset + 2);
 
-    src_port_str = ep_tcp_port_to_display(tcph->th_sport);
-    dst_port_str = ep_tcp_port_to_display(tcph->th_dport);
+    src_port_str = tcp_port_to_display(wmem_packet_scope(), tcph->th_sport);
+    dst_port_str = tcp_port_to_display(wmem_packet_scope(), tcph->th_dport);
     col_add_lstr(pinfo->cinfo, COL_INFO,
         src_port_str,
         "\xe2\x86\x92", /* UTF8_RIGHTWARDS_ARROW */
index 02cc1fb8f1428cd7aaf9e8287426b85dd569afff..d7c51af45095150d12634c86f214a198e1f864b2 100644 (file)
@@ -581,8 +581,8 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
   udph->uh_sport=tvb_get_ntohs(tvb, offset);
   udph->uh_dport=tvb_get_ntohs(tvb, offset+2);
 
-  src_port_str = ep_udp_port_to_display(udph->uh_sport);
-  dst_port_str = ep_udp_port_to_display(udph->uh_dport);
+  src_port_str = udp_port_to_display(wmem_packet_scope(), udph->uh_sport);
+  dst_port_str = udp_port_to_display(wmem_packet_scope(), udph->uh_dport);
 
   col_add_lstr(pinfo->cinfo, COL_INFO,
     "Source port: ", src_port_str, "  "
index 57cf6d98d8534d9b42107edf30703cee64976bd4..73d0645dc84251a5c47a2c7f51dbddab4b2ae9e4 100644 (file)
@@ -404,19 +404,19 @@ add_xmcp_port_name (void)
   switch(xmcp_service_protocol) {
   case IP_PROTO_TCP:
     proto_item_append_text(xmcp_it_service_port, " (TCP: %s)",
-                           ep_tcp_port_to_display(xmcp_service_port));
+                           tcp_port_to_display(wmem_packet_scope(), xmcp_service_port));
     break;
   case IP_PROTO_UDP:
     proto_item_append_text(xmcp_it_service_port, " (UDP: %s)",
-                           ep_udp_port_to_display(xmcp_service_port));
+                           udp_port_to_display(wmem_packet_scope(), xmcp_service_port));
     break;
   case IP_PROTO_DCCP:
     proto_item_append_text(xmcp_it_service_port, " (DCCP: %s)",
-                           ep_dccp_port_to_display(xmcp_service_port));
+                           dccp_port_to_display(wmem_packet_scope(), xmcp_service_port));
     break;
   case IP_PROTO_SCTP:
     proto_item_append_text(xmcp_it_service_port, " (SCTP: %s)",
-                           ep_sctp_port_to_display(xmcp_service_port));
+                           sctp_port_to_display(wmem_packet_scope(), xmcp_service_port));
     break;
   default:
     break;
index 1a6946d2fadf7d998d2c17193e85c06a60f958d0..cbdc110f767b9d610609c0a92c2562093ef1ab19 100644 (file)
@@ -71,7 +71,7 @@ endpoints_draw(void *arg)
 
                for (i=0; (iu->hash.conv_array && i < iu->hash.conv_array->len); i++) {
                        guint64 tot_frames;
-                       gchar*  conversation_str;
+                       gchar *conversation_str, *port_str;
 
                        host = &g_array_index(iu->hash.conv_array, hostlist_talker_t, i);
                        tot_frames = host->rx_frames + host->tx_frames;
@@ -80,15 +80,17 @@ endpoints_draw(void *arg)
                                /* XXX - TODO: make name resolution configurable (through gbl_resolv_flags?) */
                                conversation_str = (char*)get_conversation_address(NULL, &host->myaddress, TRUE);
                                if (display_port) {
+                                       /* XXX - TODO: make port resolution configurable (through gbl_resolv_flags?) */
+                                       port_str = (char*)get_conversation_port(NULL, host->port, host->ptype, TRUE);
                                        printf("%-20s      %5s     %6" G_GINT64_MODIFIER "u     %9" G_GINT64_MODIFIER
                                               "u     %6" G_GINT64_MODIFIER "u       %9" G_GINT64_MODIFIER "u      %6"
                                               G_GINT64_MODIFIER "u       %9" G_GINT64_MODIFIER "u   \n",
                                                conversation_str,
-                                               /* XXX - TODO: make port resolution configurable (through gbl_resolv_flags?) */
-                                               get_conversation_port(host->port, host->ptype, TRUE),
+                                               port_str,
                                                host->tx_frames+host->rx_frames, host->tx_bytes+host->rx_bytes,
                                                host->tx_frames, host->tx_bytes,
                                                host->rx_frames, host->rx_bytes);
+                                       wmem_free(NULL, port_str);
                                } else {
                                        printf("%-20s      %6" G_GINT64_MODIFIER "u     %9" G_GINT64_MODIFIER
                                               "u     %6" G_GINT64_MODIFIER "u       %9" G_GINT64_MODIFIER "u      %6"
index c3bc5320df12768d38cb4ae9455b37299627234f..79c39247295bc4fee0405b2bffcc42c0d99716e6 100644 (file)
@@ -104,11 +104,11 @@ iousers_draw(void *arg)
                                src_addr = (char*)get_conversation_address(NULL, &iui->src_address, TRUE);
                                dst_addr = (char*)get_conversation_address(NULL, &iui->dst_address, TRUE);
                                if (display_ports) {
-                                       char *src, *dst;
-                                       src = wmem_strconcat(NULL, src_addr,
-                                               ":", get_conversation_port(iui->src_port, iui->ptype, TRUE), NULL);
-                                       dst = wmem_strconcat(NULL, dst_addr,
-                                               ":", get_conversation_port(iui->dst_port, iui->ptype, TRUE), NULL);
+                                       char *src, *dst, *src_port, *dst_port;
+                                       src_port = (char*)get_conversation_port(NULL, iui->src_port, iui->ptype, TRUE);
+                                       dst_port = (char*)get_conversation_port(NULL, iui->dst_port, iui->ptype, TRUE);
+                                       src = wmem_strconcat(NULL, src_addr, ":", src_port, NULL);
+                                       dst = wmem_strconcat(NULL, dst_addr, ":", dst_port, NULL);
                                        printf("%-26s <-> %-26s  %6" G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER
                                               "u  %6" G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER "u  %6"
                                               G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER "u  ",
@@ -118,6 +118,8 @@ iousers_draw(void *arg)
                                                iui->tx_frames+iui->rx_frames,
                                                iui->tx_bytes+iui->rx_bytes
                                        );
+                                       wmem_free(NULL, src_port);
+                                       wmem_free(NULL, dst_port);
                                        wmem_free(NULL, src);
                                        wmem_free(NULL, dst);
                                } else {
index db59acbc1155089c216258eb0cc69351ce51972f..6556f30f8f69a1223a875f486558beba03cd433d 100644 (file)
@@ -1593,21 +1593,25 @@ draw_ct_table_addresses(conversations_table *ct)
 
     while (iter_valid) {
         conv_item_t *conv_item;
-               char *src_addr, *dst_addr;
+               char *src_addr, *dst_addr, *src_port, *dst_port;
 
         gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, CONV_INDEX_COLUMN, &idx, -1);
         conv_item = &g_array_index(ct->hash.conv_array, conv_item_t, idx);
         src_addr = (char*)get_conversation_address(NULL, &conv_item->src_address, ct->resolve_names);
         dst_addr = (char*)get_conversation_address(NULL, &conv_item->dst_address, ct->resolve_names);
+        src_port = (char*)get_conversation_port(NULL, conv_item->src_port, conv_item->ptype, ct->resolve_names);
+        dst_port = (char*)get_conversation_port(NULL, conv_item->dst_port, conv_item->ptype, ct->resolve_names);
         gtk_list_store_set (store, &iter,
                   CONV_COLUMN_SRC_ADDR, src_addr,
-                  CONV_COLUMN_SRC_PORT, get_conversation_port(conv_item->src_port, conv_item->ptype, ct->resolve_names),
+                  CONV_COLUMN_SRC_PORT, src_port,
                   CONV_COLUMN_DST_ADDR, dst_addr,
-                  CONV_COLUMN_DST_PORT, get_conversation_port(conv_item->dst_port, conv_item->ptype, ct->resolve_names),
+                  CONV_COLUMN_DST_PORT, dst_port,
                     -1);
         iter_valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter);
         wmem_free(NULL, src_addr);
         wmem_free(NULL, dst_addr);
+        wmem_free(NULL, src_port);
+        wmem_free(NULL, dst_port);
     }
 
     gtk_tree_view_set_model(GTK_TREE_VIEW(ct->table), GTK_TREE_MODEL(store));
@@ -1712,16 +1716,18 @@ draw_ct_table_data(conversations_table *ct)
                     CONV_COLUMN_BPS_BA,   rx_ptr,
                     -1);
         } else {
-            char *src_addr, *dst_addr;
+            char *src_addr, *dst_addr, *src_port, *dst_port;
 
             src_addr = (char*)get_conversation_address(NULL, &conv_item->src_address, ct->resolve_names);
             dst_addr = (char*)get_conversation_address(NULL, &conv_item->dst_address, ct->resolve_names);
+            src_port = (char*)get_conversation_port(NULL, conv_item->src_port, conv_item->ptype, ct->resolve_names);
+            dst_port = (char*)get_conversation_port(NULL, conv_item->dst_port, conv_item->ptype, ct->resolve_names);
             /* New row. All entries, including fixed ones */
             gtk_list_store_insert_with_values(store, &iter, G_MAXINT,
                     CONV_COLUMN_SRC_ADDR, src_addr,
-                    CONV_COLUMN_SRC_PORT, get_conversation_port(conv_item->src_port, conv_item->ptype, ct->resolve_names),
+                    CONV_COLUMN_SRC_PORT, src_port,
                     CONV_COLUMN_DST_ADDR, dst_addr,
-                    CONV_COLUMN_DST_PORT, get_conversation_port(conv_item->dst_port, conv_item->ptype, ct->resolve_names),
+                    CONV_COLUMN_DST_PORT, dst_port,
                     CONV_COLUMN_PACKETS,  conv_item->tx_frames+conv_item->rx_frames,
                     CONV_COLUMN_BYTES,    conv_item->tx_bytes+conv_item->rx_bytes,
                     CONV_COLUMN_PKT_AB,   conv_item->tx_frames,
@@ -1736,6 +1742,8 @@ draw_ct_table_data(conversations_table *ct)
                     -1);
             wmem_free(NULL, src_addr);
             wmem_free(NULL, dst_addr);
+            wmem_free(NULL, src_port);
+            wmem_free(NULL, dst_port);
         }
 
         iter_valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter);
index a35076556a8692ba498ca641c5f50564908e45cf..562f37a5b554fa68ae2ddecf02eda0700b7f9b48 100644 (file)
@@ -133,8 +133,7 @@ follow_ssl_stream_cb(GtkWidget * w _U_, gpointer data _U_)
     int             previous_filter_len;
     const char *    hostname0;
     const char *    hostname1;
-    const char *    port0;
-    const char *    port1;
+    char           *port0, *port1;
     const char *    client_hostname;
     const char *    server_hostname;
     const char *    client_port;
@@ -237,8 +236,8 @@ follow_ssl_stream_cb(GtkWidget * w _U_, gpointer data _U_)
         hostname1 = get_hostname(ipaddr);
     }
 
-    port0 = ep_tcp_port_to_display(stats.port[0]);
-    port1 = ep_tcp_port_to_display(stats.port[1]);
+    port0 = (char*)tcp_port_to_display(NULL, stats.port[0]);
+    port1 = (char*)tcp_port_to_display(NULL, stats.port[1]);
 
     follow_info->is_ipv6 = stats.is_ipv6;
 
@@ -275,6 +274,8 @@ follow_ssl_stream_cb(GtkWidget * w _U_, gpointer data _U_)
     follow_stream("Follow SSL Stream", follow_info, both_directions_string,
                     server_to_client_string, client_to_server_string);
 
+    wmem_free(NULL, port0);
+    wmem_free(NULL, port1);
     g_free(both_directions_string);
     g_free(server_to_client_string);
     g_free(client_to_server_string);
index 22565036ade7d1325d070bb561f3a118ee08ce0e..a7f501c8c900e00a79532d376dd941ba866884e6 100644 (file)
@@ -257,8 +257,8 @@ follow_tcp_stream_cb(GtkWidget * w _U_, gpointer data _U_)
 
     follow_info->is_ipv6 = stats.is_ipv6;
 
-    port0 = ep_tcp_port_to_display(stats.port[0]);
-    port1 = ep_tcp_port_to_display(stats.port[1]);
+    port0 = (char*)tcp_port_to_display(NULL, stats.port[0]);
+    port1 = (char*)tcp_port_to_display(NULL, stats.port[1]);
 
     /* Host 0 --> Host 1 */
     if ((sc.src_port == stats.port[0]) &&
@@ -304,6 +304,8 @@ follow_tcp_stream_cb(GtkWidget * w _U_, gpointer data _U_)
     /* Free the filter string, as we're done with it. */
     g_free(follow_filter);
 
+    wmem_free(NULL, port0);
+    wmem_free(NULL, port1);
     g_free(both_directions_string);
     g_free(server_to_client_string);
     g_free(client_to_server_string);
index 8af7972a375c4dca5d533be811d43f51d96f5805..923e7658e3b1240c4959785ce999623cb1bfa2ca 100644 (file)
@@ -183,8 +183,8 @@ follow_udp_stream_cb(GtkWidget *w _U_, gpointer data _U_)
         hostname1 = get_hostname(ipaddr);
     }
 
-    port0 = ep_udp_port_to_display(stats.port[0]);
-    port1 = ep_udp_port_to_display(stats.port[1]);
+    port0 = udp_port_to_display(NULL, stats.port[0]);
+    port1 = udp_port_to_display(NULL, stats.port[1]);
 
     follow_info->is_ipv6 = stats.is_ipv6;
 
@@ -222,6 +222,8 @@ follow_udp_stream_cb(GtkWidget *w _U_, gpointer data _U_)
     follow_stream("Follow UDP Stream", follow_info, both_directions_string,
                   server_to_client_string, client_to_server_string);
 
+    wmem_free(NULL, port0);
+    wmem_free(NULL, port1);
     g_free(both_directions_string);
     g_free(server_to_client_string);
     g_free(client_to_server_string);
index 5bdb12fbfc2c434493c1bde533360434358eca1a..8db01f30cec3daf754275f0ddbc328e6cb40c96d 100644 (file)
@@ -476,19 +476,21 @@ draw_hostlist_table_addresses(hostlist_table *hl)
 
     while (iter_valid) {
         hostlist_talker_t *host;
-        char* addr_str;
+        char *addr_str, *port_str;
 
         gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, ENDP_INDEX_COLUMN, &idx, -1);
         host = &g_array_index(hl->hash.conv_array, hostlist_talker_t, idx);
 
         addr_str = (char*)get_conversation_address(NULL, &host->myaddress, hl->resolve_names);
+        port_str = (char*)get_conversation_port(NULL, host->port, host->ptype, hl->resolve_names);
         gtk_list_store_set (store, &iter,
                   ENDP_COLUMN_ADDR, addr_str,
-                  ENDP_COLUMN_PORT, get_conversation_port(host->port, host->ptype, hl->resolve_names),
+                  ENDP_COLUMN_PORT, port_str,
                     -1);
 
         iter_valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter);
         wmem_free(NULL, addr_str);
+        wmem_free(NULL, port_str);
     }
     gtk_tree_view_set_model(GTK_TREE_VIEW(hl->table), GTK_TREE_MODEL(store));
     g_object_unref(store);
@@ -554,7 +556,7 @@ draw_hostlist_table_data(hostlist_table *hl)
         }
         host->modified = FALSE;
         if (!iter_valid) {
-            char* addr_str;
+            char *addr_str, *port_str;
 #ifdef HAVE_GEOIP
             char *geoip[ENDP_NUM_GEOIP_COLUMNS];
             guint j;
@@ -598,9 +600,10 @@ draw_hostlist_table_data(hostlist_table *hl)
 #endif /* HAVE_GEOIP */
 
             addr_str = (char*)get_conversation_address(NULL, &host->myaddress, hl->resolve_names);
+            port_str = (char*)get_conversation_port(NULL, host->port, host->ptype, hl->resolve_names);
             gtk_list_store_insert_with_values( store, &iter, G_MAXINT,
                   ENDP_COLUMN_ADDR, addr_str,
-                  ENDP_COLUMN_PORT, get_conversation_port(host->port, host->ptype, hl->resolve_names),
+                  ENDP_COLUMN_PORT, port_str,
                   ENDP_COLUMN_PACKETS,  host->tx_frames+host->rx_frames,
                   ENDP_COLUMN_BYTES,    host->tx_bytes+host->rx_bytes,
                   ENDP_COLUMN_PKT_AB,   host->tx_frames,
@@ -625,6 +628,7 @@ draw_hostlist_table_data(hostlist_table *hl)
                   ENDP_INDEX_COLUMN,    idx,
                     -1);
             wmem_free(NULL, addr_str);
+            wmem_free(NULL, port_str);
 #ifdef HAVE_GEOIP
             for (j = 0; j < ENDP_NUM_GEOIP_COLUMNS; j++)
                 g_free(geoip[j]);
index 319e9ffc57a3388a31b49fc78ef01304d26748dd..b96db0819c3ba45f3c397fac671e29e808d9d03f 100644 (file)
@@ -339,7 +339,7 @@ public:
         conv_item_t *conv_item = data(ci_col_, Qt::UserRole).value<conv_item_t *>();
         bool ok;
         quint64 cur_packets = data(pkts_col_, Qt::UserRole).toULongLong(&ok);
-        char *src_addr, *dst_addr;
+        char *src_addr, *dst_addr, *src_port, *dst_port;
 
         if (!conv_item) {
             return;
@@ -352,12 +352,16 @@ public:
 
         src_addr = (char*)get_conversation_address(NULL, &conv_item->src_address, resolve_names);
         dst_addr = (char*)get_conversation_address(NULL, &conv_item->dst_address, resolve_names);
+        src_port = (char*)get_conversation_port(NULL, conv_item->src_port, conv_item->ptype, resolve_names);
+        dst_port = (char*)get_conversation_port(NULL, conv_item->dst_port, conv_item->ptype, resolve_names);
         setText(CONV_COLUMN_SRC_ADDR, src_addr);
-        setText(CONV_COLUMN_SRC_PORT, get_conversation_port(conv_item->src_port, conv_item->ptype, resolve_names));
+        setText(CONV_COLUMN_SRC_PORT, src_port);
         setText(CONV_COLUMN_DST_ADDR, dst_addr);
-        setText(CONV_COLUMN_DST_PORT, get_conversation_port(conv_item->dst_port, conv_item->ptype, resolve_names));
+        setText(CONV_COLUMN_DST_PORT, dst_port);
         wmem_free(NULL, src_addr);
         wmem_free(NULL, dst_addr);
+        wmem_free(NULL, src_port);
+        wmem_free(NULL, dst_port);
 
         double duration = nstime_to_sec(&conv_item->stop_time) - nstime_to_sec(&conv_item->start_time);
         QString col_str, bps_ab = bps_na_, bps_ba = bps_na_;
@@ -410,7 +414,10 @@ public:
             }
         case CONV_COLUMN_SRC_PORT:
             if (resolve_names) {
-                return get_conversation_port(conv_item->src_port, conv_item->ptype, resolve_names);
+                char* port_str = (char*)get_conversation_port(NULL, conv_item->src_port, conv_item->ptype, resolve_names);
+                QString q_port_str(port_str);
+                wmem_free(NULL, port_str);
+                return q_port_str;
             } else {
                 return quint32(conv_item->src_port);
             }
@@ -423,7 +430,10 @@ public:
             }
         case CONV_COLUMN_DST_PORT:
             if (resolve_names) {
-                return get_conversation_port(conv_item->dst_port, conv_item->ptype, resolve_names);
+                char* port_str = (char*)get_conversation_port(NULL, conv_item->dst_port, conv_item->ptype, resolve_names);
+                QString q_port_str(port_str);
+                wmem_free(NULL, port_str);
+                return q_port_str;
             } else {
                 return quint32(conv_item->dst_port);
             }
index 81672cd2a09bdfa9c9fafafa8a0bb5c4bc3471ae..615298dc30e2531c1ded8dc52da06d2d864aa461 100644 (file)
@@ -228,7 +228,7 @@ public:
         hostlist_talker_t *endp_item = data(ei_col_, Qt::UserRole).value<hostlist_talker_t *>();
         bool ok;
         quint64 cur_packets = data(pkts_col_, Qt::UserRole).toULongLong(&ok);
-        char* addr_str;
+        char *addr_str, *port_str;
 
         if (!endp_item) {
             return;
@@ -240,9 +240,11 @@ public:
         }
 
         addr_str = (char*)get_conversation_address(NULL, &endp_item->myaddress, resolve_names);
+        port_str = (char*)get_conversation_port(NULL, endp_item->port, endp_item->ptype, resolve_names);
         setText(ENDP_COLUMN_ADDR, addr_str);
-        setText(ENDP_COLUMN_PORT, get_conversation_port(endp_item->port, endp_item->ptype, resolve_names));
+        setText(ENDP_COLUMN_PORT, port_str);
         wmem_free(NULL, addr_str);
+        wmem_free(NULL, port_str);
 
         QString col_str;
 
@@ -301,7 +303,10 @@ public:
             }
         case ENDP_COLUMN_PORT:
             if (resolve_names) {
-                return get_conversation_port(endp_item->port, endp_item->ptype, resolve_names);
+                char* port_str = (char*)get_conversation_port(NULL, endp_item->port, endp_item->ptype, resolve_names);
+                QString q_port_str(port_str);
+                wmem_free(NULL, port_str);
+                return q_port_str;
             } else {
                 return quint32(endp_item->port);
             }
index 06742f4d9712687a0cf4937e941b02a7059921a5..4a4d825bddfb9fa90d5f99d9c12773287e2f55f0 100644 (file)
@@ -1088,16 +1088,16 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index)
     switch (follow_type_)
     {
     case FOLLOW_TCP:
-        port0 = ep_tcp_port_to_display(stats.port[0]);
-        port1 = ep_tcp_port_to_display(stats.port[1]);
+        port0 = tcp_port_to_display(NULL, stats.port[0]);
+        port1 = tcp_port_to_display(NULL, stats.port[1]);
         break;
     case FOLLOW_UDP:
-        port0 = ep_udp_port_to_display(stats.port[0]);
-        port1 = ep_udp_port_to_display(stats.port[1]);
+        port0 = udp_port_to_display(NULL, stats.port[0]);
+        port1 = udp_port_to_display(NULL, stats.port[1]);
         break;
     case FOLLOW_SSL:
-        port0 = ep_tcp_port_to_display(stats.port[0]);
-        port1 = ep_tcp_port_to_display(stats.port[1]);
+        port0 = tcp_port_to_display(NULL, stats.port[0]);
+        port1 = tcp_port_to_display(NULL, stats.port[1]);
         break;
     }
 
@@ -1195,6 +1195,9 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index)
         }
     }
 
+    wmem_free(NULL, port0);
+    wmem_free(NULL, port1);
+
     /* Both Stream Directions */
     switch (follow_type_)
     {