Fix various typos and spelling errors.
[obnox/wireshark/wip.git] / epan / dissectors / packet-sflow.c
index 4d0f2752bebf32b726b06d82dc32d117b9ce8c9a..9693056a00feb38569f92d94c67999c41675220d 100644 (file)
@@ -1,4 +1,4 @@
-/* packet-sflow.c       < Last change made on 12/08/2009 13.00 >
+/* packet-sflow.c
  * Routines for sFlow v5 dissection implemented according to the specifications
  * at http://www.sflow.org/sflow_version_5.txt
  *
 static dissector_handle_t sflow_handle;
 
 /*
- *     global_sflow_ports : holds the configured range of ports for sflow
+ *  global_sflow_ports : holds the configured range of ports for sflow
  */
 static range_t *global_sflow_ports = NULL;
 
 /*
- *     sflow_245_ports : holds the currently used range of ports for sflow
+ *  sflow_245_ports : holds the currently used range of ports for sflow
  */
 static gboolean global_dissect_samp_headers = TRUE;
 static gboolean global_analyze_samp_ip_headers = FALSE;
@@ -488,6 +488,19 @@ struct radio_utilization {
     guint32 on_channel_busy_time;
 };
 
+struct sflow_address_type {
+    int hf_addr_v4;
+    int hf_addr_v6;
+};
+
+struct sflow_address_details {
+    int addr_type;              /* ADDR_TYPE_IPV4 | ADDR_TYPE_IPV6 */
+    union {
+        guint8 v4[4];
+        guint8 v6[16];
+    } agent_address;
+};
+
 /* Initialize the protocol and registered fields */
 static int proto_sflow = -1;
 static int hf_sflow_version = -1;
@@ -516,9 +529,9 @@ static int hf_sflow_245_pri_out = -1; /* outgoing 802.1p priority */
 static int hf_sflow_245_nexthop_v4 = -1; /* nexthop address */
 static int hf_sflow_245_nexthop_v6 = -1; /* nexthop address */
 static int hf_sflow_245_ipv4_src = -1;
-static int hf_sflow_245_ipv4_des = -1;
+static int hf_sflow_245_ipv4_dst = -1;
 static int hf_sflow_245_ipv6_src = -1;
-static int hf_sflow_245_ipv6_des = -1;
+static int hf_sflow_245_ipv6_dst = -1;
 static int hf_sflow_245_nexthop_src_mask = -1;
 static int hf_sflow_245_nexthop_dst_mask = -1;
 
@@ -687,7 +700,7 @@ void proto_reg_handoff_sflow_245(void);
 /* dissect a sampled header - layer 2 protocols */
 static gint
 dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo,
-        proto_tree *tree, volatile gint offset) {
+                                 proto_tree *tree, volatile gint offset) {
     guint32 version, header_proto, frame_length, stripped;
     volatile guint32 header_length;
     tvbuff_t *next_tvb;
@@ -697,12 +710,13 @@ dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo,
      * Thanks to Guy Harris for the tip. */
     gboolean save_writable;
     gboolean save_in_error_pkt;
-    volatile address save_dl_src;
-    volatile address save_dl_dst;
-    volatile address save_net_src;
-    volatile address save_net_dst;
-    volatile address save_src;
-    volatile address save_dst;
+    address save_dl_src;
+    address save_dl_dst;
+    address save_net_src;
+    address save_net_dst;
+    address save_src;
+    address save_dst;
+    void *pd_save;
 
     version = tvb_get_ntohl(tvb, 0);
     header_proto = tvb_get_ntohl(tvb, offset);
@@ -766,6 +780,7 @@ dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo,
     save_net_dst = pinfo->net_dst;
     save_src = pinfo->src;
     save_dst = pinfo->dst;
+    pd_save = pinfo->private_data;
 
     TRY
     {
@@ -821,11 +836,15 @@ dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo,
             default:
                 /* some of the protocols, I have no clue where to begin. */
                 break;
-        };
+        }
     }
 
     CATCH2(BoundsError, ReportedBoundsError) {
-        ; /* do nothing */
+        /*  Restore the private_data structure in case one of the
+         *  called dissectors modified it (and, due to the exception,
+         *  was unable to restore it).
+         */
+        pinfo->private_data = pd_save;
     }
     ENDTRY;
 
@@ -844,79 +863,91 @@ dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo,
     return offset;
 }
 
+static gint
+dissect_sflow_245_address_type(tvbuff_t *tvb, proto_tree *tree, gint offset,
+                               struct sflow_address_type *hf_type,
+                               struct sflow_address_details *addr_detail) {
+    guint32 addr_type;
+    int len;
+
+    addr_type = tvb_get_ntohl(tvb, offset);
+    offset += 4;
+
+    switch (addr_type) {
+    case ADDR_TYPE_IPV4:
+        len = 4;
+        proto_tree_add_item(tree, hf_type->hf_addr_v4, tvb, offset, 4, FALSE);
+        break;
+    case ADDR_TYPE_IPV6:
+        len = 16;
+        proto_tree_add_item(tree, hf_type->hf_addr_v6, tvb, offset, 16, FALSE);
+        break;
+    default:
+        /* acferen:  November 10, 2010
+         * 
+         * We should never get here, but if we do we don't know
+         * the length for this address type.  Not knowing the
+         * length this default case is doomed to failure.  Might
+         * as well acknowledge that as soon as possible.
+         */
+        proto_tree_add_text(tree, tvb, offset - 4, 4, "Unknown address type (%u)", addr_type);
+        return 0;               /* malformed packet */
+    }
+
+    if (addr_detail) {
+        addr_detail->addr_type = addr_type;
+        switch (len) {
+        case 4:
+            tvb_memcpy(tvb, addr_detail->agent_address.v4, offset, len);
+            break;
+        case 16:
+            tvb_memcpy(tvb, addr_detail->agent_address.v6, offset, len);
+            break;
+        }
+    }
+
+    return offset + len;
+}
+
 /* extended switch data, after the packet data */
 static gint
 dissect_sflow_245_extended_switch(tvbuff_t *tvb, proto_tree *tree, gint offset) {
-    gint32 len = 0;
-
-    proto_tree_add_item(tree, hf_sflow_245_vlan_in, tvb, offset + len, 4, FALSE);
-    len += 4;
-    proto_tree_add_item(tree, hf_sflow_245_pri_in, tvb, offset + len, 4, FALSE);
-    len += 4;
-    proto_tree_add_item(tree, hf_sflow_245_vlan_out, tvb, offset + len, 4, FALSE);
-    len += 4;
-    proto_tree_add_item(tree, hf_sflow_245_pri_out, tvb, offset + len, 4, FALSE);
-    len += 4;
+    proto_tree_add_item(tree, hf_sflow_245_vlan_in, tvb, offset, 4, FALSE);
+    offset += 4;
+    proto_tree_add_item(tree, hf_sflow_245_pri_in, tvb, offset, 4, FALSE);
+    offset += 4;
+    proto_tree_add_item(tree, hf_sflow_245_vlan_out, tvb, offset, 4, FALSE);
+    offset += 4;
+    proto_tree_add_item(tree, hf_sflow_245_pri_out, tvb, offset, 4, FALSE);
+    offset += 4;
 
-    return len;
+    return offset;
 }
 
 /* extended router data, after the packet data */
 static gint
 dissect_sflow_245_extended_router(tvbuff_t *tvb, proto_tree *tree, gint offset) {
-    gint32 len = 0;
-    guint32 addr_type;
+    struct sflow_address_type addr_type = {hf_sflow_245_nexthop_v4, hf_sflow_245_nexthop_v6};
 
-    addr_type = tvb_get_ntohl(tvb, offset);
-    len += 4;
-    switch (addr_type) {
-        case ADDR_TYPE_IPV4:
-            proto_tree_add_item(tree, hf_sflow_245_nexthop_v4, tvb, offset + len, 4, FALSE);
-            len += 4;
-            break;
-        case ADDR_TYPE_IPV6:
-            proto_tree_add_item(tree, hf_sflow_245_nexthop_v6, tvb, offset + len, 16, FALSE);
-            len += 16;
-            break;
-        default:
-            proto_tree_add_text(tree, tvb, offset + len - 4, 4, "Unknown address type (%u)", addr_type);
-            len += 4; /* not perfect, but what else to do? */
-            return len; /* again, this is wrong.  but... ? */
-    };
-
-    proto_tree_add_item(tree, hf_sflow_245_nexthop_src_mask, tvb, offset + len, 4, FALSE);
-    len += 4;
-    proto_tree_add_item(tree, hf_sflow_245_nexthop_dst_mask, tvb, offset + len, 4, FALSE);
-    len += 4;
-    return len;
+    offset = dissect_sflow_245_address_type(tvb, tree, offset, &addr_type, NULL);
+    proto_tree_add_item(tree, hf_sflow_245_nexthop_src_mask, tvb, offset, 4, FALSE);
+    offset += 4;
+    proto_tree_add_item(tree, hf_sflow_245_nexthop_dst_mask, tvb, offset, 4, FALSE);
+    offset += 4;
+    return offset;
 }
 
 /* extended MPLS data */
 static gint
 dissect_sflow_5_extended_mpls_data(tvbuff_t *tvb, proto_tree *tree, gint offset) {
-    guint32 addr_type, in_label_count, out_label_count, i, j;
+    guint32 in_label_count, out_label_count, i, j;
     proto_tree *in_stack;
     proto_item *ti_in;
     proto_tree *out_stack;
     proto_item *ti_out;
 
-    addr_type = tvb_get_ntohl(tvb, offset);
-    offset += 4;
-
-    switch (addr_type) {
-        case ADDR_TYPE_IPV4:
-            proto_tree_add_item(tree, hf_sflow_245_nexthop_v4, tvb, offset, 4, FALSE);
-            offset += 4;
-            break;
-        case ADDR_TYPE_IPV6:
-            proto_tree_add_item(tree, hf_sflow_245_nexthop_v6, tvb, offset, 16, FALSE);
-            offset += 16;
-            break;
-        default:
-            proto_tree_add_text(tree, tvb, offset - 4, 4, "Unknown address type (%u)", addr_type);
-            offset += 4; /* not perfect, but what else to do? */
-            return offset; /* again, this is wrong.  but... ? */
-    };
+    struct sflow_address_type addr_type = {hf_sflow_245_nexthop_v4, hf_sflow_245_nexthop_v6};
+    offset = dissect_sflow_245_address_type(tvb, tree, offset, &addr_type, NULL);
 
     in_label_count = tvb_get_ntohl(tvb, offset);
     proto_tree_add_text(tree, tvb, offset, 4, "In Label Stack Entries: %u", in_label_count);
@@ -952,43 +983,14 @@ dissect_sflow_5_extended_mpls_data(tvbuff_t *tvb, proto_tree *tree, gint offset)
 /* extended NAT data */
 static gint
 dissect_sflow_5_extended_nat(tvbuff_t *tvb, proto_tree *tree, gint offset) {
-    guint32 src_type, des_type;
+    struct sflow_address_type addr_type = {hf_sflow_245_ipv4_src,
+                                           hf_sflow_245_ipv6_src};
+    offset = dissect_sflow_245_address_type(tvb, tree, offset, &addr_type, NULL);
 
-    src_type = tvb_get_ntohl(tvb, offset);
-    offset += 4;
+    addr_type.hf_addr_v4 = hf_sflow_245_ipv4_dst;
+    addr_type.hf_addr_v6 = hf_sflow_245_ipv6_dst;
 
-    switch (src_type) {
-        case ADDR_TYPE_IPV4:
-            proto_tree_add_item(tree, hf_sflow_245_ipv4_src, tvb, offset, 4, FALSE);
-            offset += 4;
-            break;
-        case ADDR_TYPE_IPV6:
-            proto_tree_add_item(tree, hf_sflow_245_ipv6_src, tvb, offset, 16, FALSE);
-            offset += 16;
-            break;
-        default:
-            proto_tree_add_text(tree, tvb, offset - 4, 4, "Unknown address type (%u)", src_type);
-            offset += 4; /* not perfect, but what else to do? */
-            return offset; /* again, this is wrong.  but... ? */
-    };
-
-    des_type = tvb_get_ntohl(tvb, offset);
-    offset += 4;
-
-    switch (des_type) {
-        case ADDR_TYPE_IPV4:
-            proto_tree_add_item(tree, hf_sflow_245_ipv4_des, tvb, offset, 4, FALSE);
-            offset += 4;
-            break;
-        case ADDR_TYPE_IPV6:
-            proto_tree_add_item(tree, hf_sflow_245_ipv6_des, tvb, offset, 16, FALSE);
-            offset += 16;
-            break;
-        default:
-            proto_tree_add_text(tree, tvb, offset - 4, 4, "Unknown address type (%u)", des_type);
-            offset += 4; /* not perfect, but what else to do? */
-            return offset; /* again, this is wrong.  but... ? */
-    };
+    offset = dissect_sflow_245_address_type(tvb, tree, offset, &addr_type, NULL);
 
     return offset;
 }
@@ -998,7 +1000,7 @@ static gint
 dissect_sflow_245_extended_gateway(tvbuff_t *tvb, proto_tree *tree, gint offset) {
     gint32 len = 0;
     gint32 i, j, comm_len, dst_len, dst_seg_len;
-    guint32 addr_type, path_type;
+    guint32 path_type;
     gint32 kludge;
 
     guint32 version = tvb_get_ntohl(tvb, 0); /* get sFlow version */
@@ -1009,21 +1011,9 @@ dissect_sflow_245_extended_gateway(tvbuff_t *tvb, proto_tree *tree, gint offset)
 
     /* sFlow v5 contains next hop router IP address */
     if (version == 5) {
-        addr_type = tvb_get_ntohl(tvb, offset);
-        len += 4;
-        switch (addr_type) {
-            case ADDR_TYPE_IPV4:
-                proto_tree_add_item(tree, hf_sflow_245_nexthop_v4, tvb, offset + len, 4, FALSE);
-                len += 4;
-                break;
-            case ADDR_TYPE_IPV6:
-                proto_tree_add_item(tree, hf_sflow_245_nexthop_v6, tvb, offset + len, 16, FALSE);
-                len += 16;
-                break;
-            default:
-                proto_tree_add_text(tree, tvb, offset + len - 4, 4, "Unknown address type (%u)", addr_type);
-                len += 4; /* not perfect, but what else to do? */
-        };
+        struct sflow_address_type addr_type = {hf_sflow_245_nexthop_v4, hf_sflow_245_nexthop_v6};
+
+        offset = dissect_sflow_245_address_type(tvb, tree, offset, &addr_type, NULL);
     }
 
     proto_tree_add_item(tree, hf_sflow_245_as, tvb, offset + len, 4, FALSE);
@@ -1098,7 +1088,7 @@ dissect_sflow_245_extended_gateway(tvbuff_t *tvb, proto_tree *tree, gint offset)
 
     }
 
-    return len;
+    return offset + len;
 }
 
 /* sflow v5 ethernet frame data */
@@ -1154,7 +1144,7 @@ dissect_sflow_5_ipv4(tvbuff_t *tvb, proto_tree *tree, gint offset) {
     proto_tree_add_item(tree, hf_sflow_245_ipv4_src, tvb, offset, 4, FALSE);
     offset += 4;
 
-    proto_tree_add_item(tree, hf_sflow_245_ipv4_des, tvb, offset, 4, FALSE);
+    proto_tree_add_item(tree, hf_sflow_245_ipv4_dst, tvb, offset, 4, FALSE);
     offset += 4;
 
     src_port = tvb_get_ntohl(tvb, offset);
@@ -1244,7 +1234,7 @@ dissect_sflow_5_ipv6(tvbuff_t *tvb, proto_tree *tree, gint offset) {
     proto_tree_add_item(tree, hf_sflow_245_ipv6_src, tvb, offset, 16, FALSE);
     offset += 16;
 
-    proto_tree_add_item(tree, hf_sflow_245_ipv6_des, tvb, offset, 16, FALSE);
+    proto_tree_add_item(tree, hf_sflow_245_ipv6_dst, tvb, offset, 16, FALSE);
     offset += 16;
 
     src_port = tvb_get_ntohl(tvb, offset);
@@ -1668,7 +1658,7 @@ dissect_sflow_5_extended_80211_tx(tvbuff_t *tvb, proto_tree *tree, gint offset)
             break;
         case 1:
             proto_tree_add_text(tree, tvb, offset, 4,
-                    "Retransmission: Packet transmitted sucessfully on first attemp");
+                    "Retransmission: Packet transmitted sucessfully on first attempt");
             break;
         default:
             proto_tree_add_text(tree, tvb, offset, 4, "Retransmissions: %u", transmissions - 1);
@@ -1766,7 +1756,7 @@ dissect_sflow_24_flow_sample(tvbuff_t *tvb, packet_info *pinfo,
         case SFLOW_245_PACKET_DATA_TYPE_IPV6:
         default:
             break;
-    };
+    }
     /* still need to dissect extended data */
     extended_data = tvb_get_ntohl(tvb, offset);
     offset += 4;
@@ -1812,7 +1802,7 @@ static gint
 dissect_sflow_5_flow_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) {
     proto_tree *flow_data_tree;
     proto_item *ti;
-    guint32 enterprise_format, enterprise, format, length;
+    guint32 enterprise_format, enterprise, format;
 
 
     /* what kind of flow sample is it? */
@@ -1830,7 +1820,6 @@ dissect_sflow_5_flow_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
         proto_tree_add_item(flow_data_tree, hf_sflow_5_flow_record_format, tvb, offset, 4, FALSE);
         offset += 4;
 
-        length = tvb_get_ntohl(tvb, offset);
         proto_tree_add_item(flow_data_tree, hf_sflow_5_flow_data_length, tvb, offset, 4, FALSE);
         offset += 4;
 
@@ -2505,7 +2494,7 @@ dissect_sflow_24_counters_sample(tvbuff_t *tvb, proto_tree *tree, gint offset, p
             proto_tree_add_item(tree, hf_sflow_245_ifpromisc, tvb, offset, 4, FALSE);
             offset += 4;
             break;
-    };
+    }
 
     /* Some counter types have other info to gather */
     switch (g_ntohl(counters_header.counters_type)) {
@@ -2671,19 +2660,15 @@ dissect_sflow_245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
     proto_item *ti;
     proto_tree *sflow_245_tree;
     guint32 version, sub_agent_id, seqnum;
-    guint32 agent_addr_type;
+    struct sflow_address_details addr_details;
+    struct sflow_address_type addr_type = {hf_sflow_agent_address_v4, hf_sflow_agent_address_v6};
 
-    union {
-        guint8 v4[4];
-        guint8 v6[16];
-    } agent_address;
     guint32 numsamples;
     volatile guint offset = 0;
     guint i = 0;
 
     /* Make entries in Protocol column and Info column on summary display */
-    if (check_col(pinfo->cinfo, COL_PROTOCOL))
-        col_set_str(pinfo->cinfo, COL_PROTOCOL, "sFlow");
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, "sFlow");
 
 
     /* create display subtree for the protocol */
@@ -2692,51 +2677,39 @@ dissect_sflow_245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
     sflow_245_tree = proto_item_add_subtree(ti, ett_sflow_245);
 
     version = tvb_get_ntohl(tvb, offset);
-    if (check_col(pinfo->cinfo, COL_INFO))
-        col_add_fstr(pinfo->cinfo, COL_INFO, "V%u", version);
+    col_add_fstr(pinfo->cinfo, COL_INFO, "V%u", version);
     proto_tree_add_item(sflow_245_tree, hf_sflow_version, tvb, offset, 4, FALSE);
     offset += 4;
 
-    agent_addr_type = tvb_get_ntohl(tvb, offset);
-    offset += 4;
-    switch (agent_addr_type) {
+    offset = dissect_sflow_245_address_type(tvb, sflow_245_tree, offset,
+                                            &addr_type, &addr_details);
+    switch (addr_details.addr_type) {
         case ADDR_TYPE_IPV4:
-            tvb_memcpy(tvb, agent_address.v4, offset, 4);
-            if (check_col(pinfo->cinfo, COL_INFO))
-                col_append_fstr(pinfo->cinfo, COL_INFO, ", agent %s", ip_to_str(agent_address.v4));
-            proto_tree_add_item(sflow_245_tree, hf_sflow_agent_address_v4, tvb, offset, 4, FALSE);
-            offset += 4;
+            col_append_fstr(pinfo->cinfo, COL_INFO, ", agent %s", ip_to_str(addr_details.agent_address.v4));
             break;
         case ADDR_TYPE_IPV6:
-            tvb_memcpy(tvb, agent_address.v6, offset, 16);
-            if (check_col(pinfo->cinfo, COL_INFO))
-                col_append_fstr(pinfo->cinfo, COL_INFO, ", agent %s",
-                    ip6_to_str((struct e_in6_addr *) agent_address.v6));
-            proto_tree_add_item(sflow_245_tree, hf_sflow_agent_address_v6, tvb, offset, 16, FALSE);
-            offset += 16;
+            col_append_fstr(pinfo->cinfo, COL_INFO, ", agent %s",
+                    ip6_to_str((struct e_in6_addr *) addr_details.agent_address.v6));
             break;
         default:
             /* unknown address.  this will cause a malformed packet.  */
             return 0;
-    };
+    }
 
     if (version == 5) {
         sub_agent_id = tvb_get_ntohl(tvb, offset);
-        if (check_col(pinfo->cinfo, COL_INFO))
-            col_append_fstr(pinfo->cinfo, COL_INFO, ", sub-agent ID %u", sub_agent_id);
+        col_append_fstr(pinfo->cinfo, COL_INFO, ", sub-agent ID %u", sub_agent_id);
         proto_tree_add_uint(sflow_245_tree, hf_sflow_5_sub_agent_id, tvb, offset, 4, sub_agent_id);
         offset += 4;
     }
     seqnum = tvb_get_ntohl(tvb, offset);
-    if (check_col(pinfo->cinfo, COL_INFO))
-        col_append_fstr(pinfo->cinfo, COL_INFO, ", seq %u", seqnum);
+    col_append_fstr(pinfo->cinfo, COL_INFO, ", seq %u", seqnum);
     proto_tree_add_uint(sflow_245_tree, hf_sflow_245_seqnum, tvb, offset, 4, seqnum);
     offset += 4;
     proto_tree_add_item(sflow_245_tree, hf_sflow_245_sysuptime, tvb, offset, 4, FALSE);
     offset += 4;
     numsamples = tvb_get_ntohl(tvb, offset);
-    if (check_col(pinfo->cinfo, COL_INFO))
-        col_append_fstr(pinfo->cinfo, COL_INFO, ", %u samples", numsamples);
+    col_append_fstr(pinfo->cinfo, COL_INFO, ", %u samples", numsamples);
     proto_tree_add_uint(sflow_245_tree, hf_sflow_245_numsamples, tvb, offset, 4, numsamples);
     offset += 4;
 
@@ -2856,11 +2829,11 @@ proto_register_sflow(void) {
         { &hf_sflow_245_pri_in,
             { "Incoming 802.1p priority", "sflow_245.pri.in",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Incoming 802.1p priority", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_pri_out,
             { "Outgoing 802.1p priority", "sflow_245.pri.out",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Outgoing 802.1p priority", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_nexthop_v4,
             { "Next hop", "sflow_245.nexthop",
                 FT_IPv4, BASE_NONE, NULL, 0x0,
@@ -2869,8 +2842,8 @@ proto_register_sflow(void) {
             { "Source IP address", "sflow_245.ipv4_src",
                 FT_IPv4, BASE_NONE, NULL, 0x0,
                 "Source IPv4 address", HFILL}},
-        { &hf_sflow_245_ipv4_des,
-            { "Destination IP address", "sflow_245.ipv4_des",
+        { &hf_sflow_245_ipv4_dst,
+            { "Destination IP address", "sflow_245.ipv4_dst",
                 FT_IPv4, BASE_NONE, NULL, 0x0,
                 "Destination IPv4 address", HFILL}},
         { &hf_sflow_245_nexthop_v6,
@@ -2881,8 +2854,8 @@ proto_register_sflow(void) {
             { "Source IP address", "sflow_245.ipv6_src",
                 FT_IPv6, BASE_NONE, NULL, 0x0,
                 "Source IPv6 address", HFILL}},
-        { &hf_sflow_245_ipv6_des,
-            { "Destination IP address", "sflow_245.ipv6_des",
+        { &hf_sflow_245_ipv6_dst,
+            { "Destination IP address", "sflow_245.ipv6_dst",
                 FT_IPv6, BASE_NONE, NULL, 0x0,
                 "Destination IPv6 address", HFILL}},
         { &hf_sflow_245_nexthop_src_mask,
@@ -2896,7 +2869,7 @@ proto_register_sflow(void) {
         { &hf_sflow_245_ifindex,
             { "Interface index", "sflow_245.ifindex",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Interface Index", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_as,
             { "AS Router", "sflow_245.as",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
@@ -2921,7 +2894,7 @@ proto_register_sflow(void) {
         { &hf_sflow_245_community_entries,
             { "Gateway Communities", "sflow_245.communityEntries",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Gateway Communities", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_community,
             { "Gateway Community", "sflow_245.community",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
@@ -2934,19 +2907,19 @@ proto_register_sflow(void) {
         { &hf_sflow_245_iftype,
             { "Interface Type", "sflow_245.iftype",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Interface Type", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_ifspeed,
             { "Interface Speed", "sflow_245.ifspeed",
                 FT_UINT64, BASE_DEC, NULL, 0x0,
-                "Interface Speed", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_ifdirection,
             { "Interface Direction", "sflow_245.ifdirection",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Interface Direction", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_ifstatus,
             { "Interface Status", "sflow_245.ifstatus",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Interface Status", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_ifinoct,
             { "Input Octets", "sflow_245.ifinoct",
                 FT_UINT64, BASE_DEC, NULL, 0x0,
@@ -3186,107 +3159,107 @@ proto_register_sflow(void) {
         { &hf_sflow_245_vlan_id,
             { "VLAN ID", "sflow_245.vlan_id",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "VLAN ID", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_octets,
             { "Octets", "sflow_245.octets",
                 FT_UINT64, BASE_DEC, NULL, 0x0,
-                "Octets", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_ucastPkts,
             { "Unicast Packets", "sflow_245.ucastPkts",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Unicast Packets", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_multicastPkts,
             { "Multicast Packets", "sflow_245.multicastPkts",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Multicast Packets", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_broadcastPkts,
             { "Broadcast Packets", "sflow_245.broadcastPkts",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Broadcast Packets", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_245_discards,
             { "Discards", "sflow_245.discards",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Discards", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11TransmittedFragmentCount,
             { "Transmitted Fragment Count", "sflow_5.dot11TransmittedFragmentCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Transmitted Fragment Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11MulticastTransmittedFrameCount,
             { "Multicast Transmitted Frame Count", "sflow_5.dot11MulticastTransmittedFrameCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Multicast Transmitted Frame Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11FailedCount,
             { "Failed Count", "sflow_5.dot11FailedCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Failed Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11RetryCount,
             { "Retry Count", "sflow_5.dot11RetryCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Retry Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11MultipleRetryCount,
             { "Multiple Retry Count", "sflow_5.dot11MultipleRetryCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Multiple Retry Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11FrameDuplicateCount,
             { "Frame Duplicate Count", "sflow_5.dot11FrameDuplicateCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Frame Duplicate Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11RTSSuccessCount,
             { "RTS Success Count", "sflow_5.dot11RTSSuccessCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "RTS Success Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11RTSFailureCount,
             { "Failure Count", "sflow_5.dot11RTSFailureCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Failure Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11ACKFailureCount,
             { "ACK Failure Count", "sflow_5.dot11ACKFailureCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "ACK Failure Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11ReceivedFragmentCount,
             { "Received Fragment Count", "sflow_5.dot11ReceivedFragmentCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Received Fragment Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11MulticastReceivedFrameCount,
             { "Multicast Received Frame Count", "sflow_5.dot11MulticastReceivedFrameCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Multicast Received Frame Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11FCSErrorCount,
             { "FCS Error Count", "sflow_5.dot11FCSErrorCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "FCS Error Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11TransmittedFrameCount,
             { "Transmitted Frame Count", "sflow_5.dot11TransmittedFrameCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Transmitted Frame Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11WEPUndecryptableCount,
             { "WEP Undecryptable Count", "sflow_5.dot11WEPUndecryptableCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "WEP Undecryptable Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11QoSDiscardedFragmentCount,
             { "QoS Discarded Fragment Count", "sflow_5.dot11QoSDiscardedFragmentCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "QoS Discarded Fragment Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11AssociatedStationCount,
             { "Associated Station Count", "sflow_5.dot11AssociatedStationCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "Associated Station Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11QoSCFPollsReceivedCount,
             { "QoS CF Polls Received Count", "sflow_5.dot11QoSCFPollsReceivedCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "QoS CF Polls Received Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11QoSCFPollsUnusedCount,
             { "QoS CF Polls Unused Count", "sflow_5.dot11QoSCFPollsUnusedCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "QoS CF Polls Unused Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11QoSCFPollsUnusableCount,
             { "QoS CF Polls Unusable Count", "sflow_5.dot11QoSCFPollsUnusableCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "QoS CF Polls Unusable Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_dot11QoSCFPollsLostCount,
             { "QoS CF Polls Lost Count", "sflow_5.dot11QoSCFPollsLostCount",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
-                "QoS CF Polls Lost Count", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_cpu_5s,
             { "5s CPU Load (100 = 1%)", "sflow_5.cpu_5s",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
@@ -3302,11 +3275,11 @@ proto_register_sflow(void) {
         { &hf_sflow_5_total_memory,
             { "Total Memory", "sflow_5.total_memory",
                 FT_UINT64, BASE_DEC, NULL, 0x0,
-                "Total Memory", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_free_memory,
             { "Free Memory", "sflow_5.free_memory",
                 FT_UINT64, BASE_DEC, NULL, 0x0,
-                "Free Memory", HFILL}},
+                NULL, HFILL}},
         { &hf_sflow_5_elapsed_time,
             { "Elapsed Time (ms)", "sflow_5.elapsed_time",
                 FT_UINT32, BASE_DEC, NULL, 0x0,
@@ -3493,3 +3466,15 @@ proto_reg_handoff_sflow_245(void) {
 }
 
 
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=4 noexpandtab
+ * :indentSize=4:tabSize=4:noTabs=true:
+ */