remove trailing whitespaces
[dpdk.git] / lib / librte_lpm / rte_lpm.h
index 2dc354c..047738c 100644 (file)
@@ -1,13 +1,13 @@
 /*-
  *   BSD LICENSE
- * 
- *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
+ *
+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
  *   All rights reserved.
- * 
+ *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
  *   are met:
- * 
+ *
  *     * Redistributions of source code must retain the above copyright
  *       notice, this list of conditions and the following disclaimer.
  *     * Redistributions in binary form must reproduce the above copyright
@@ -17,7 +17,7 @@
  *     * Neither the name of Intel Corporation nor the names of its
  *       contributors may be used to endorse or promote products derived
  *       from this software without specific prior written permission.
- * 
+ *
  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -122,6 +122,12 @@ struct rte_lpm_rule {
        uint8_t  next_hop; /**< Rule next hop. */
 };
 
+/** @internal Contains metadata about the rules table. */
+struct rte_lpm_rule_info {
+       uint32_t used_rules; /**< Used rules so far. */
+       uint32_t first_rule; /**< Indexes the first rule of a given depth. */
+};
+
 /** @internal LPM structure. */
 struct rte_lpm {
        TAILQ_ENTRY(rte_lpm) next;      /**< Next in list. */
@@ -129,8 +135,8 @@ struct rte_lpm {
        /* LPM metadata. */
        char name[RTE_LPM_NAMESIZE];        /**< Name of the lpm. */
        int mem_location; /**< @deprecated @see RTE_LPM_HEAP and RTE_LPM_MEMZONE. */
-       uint32_t max_rules_per_depth; /**< Max. balanced rules per lpm. */
-       uint32_t used_rules_at_depth[RTE_LPM_MAX_DEPTH]; /**< Rules / depth. */
+       uint32_t max_rules; /**< Max. balanced rules per lpm. */
+       struct rte_lpm_rule_info rule_info[RTE_LPM_MAX_DEPTH]; /**< Rule info table. */
 
        /* LPM Tables. */
        struct rte_lpm_tbl24_entry tbl24[RTE_LPM_TBL24_NUM_ENTRIES] \