* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with FRR; see the file COPYING. If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _ZEBRA_SRC_DEST_TABLE_H
extern struct route_table *srcdest_table_init(void);
extern struct route_node *srcdest_rnode_get(struct route_table *table,
- union prefixptr dst_pu,
- struct prefix_ipv6 *src_p);
+ union prefixconstptr dst_pu,
+ const struct prefix_ipv6 *src_p);
extern struct route_node *srcdest_rnode_lookup(struct route_table *table,
- union prefixptr dst_pu,
- struct prefix_ipv6 *src_p);
-extern void srcdest_rnode_prefixes (struct route_node *rn, struct prefix **p,
- struct prefix **src_p);
-extern const char *srcdest_rnode2str(struct route_node *rn, char *str, int size);
+ union prefixconstptr dst_pu,
+ const struct prefix_ipv6 *src_p);
+extern void srcdest_rnode_prefixes(struct route_node *rn,
+ const struct prefix **p,
+ const struct prefix **src_p);
+extern const char *srcdest2str(const struct prefix *dst_p,
+ const struct prefix_ipv6 *src_p,
+ char *str, int size);
+extern const char *srcdest_rnode2str(struct route_node *rn, char *str,
+ int size);
extern struct route_node *srcdest_route_next(struct route_node *rn);
-static inline int
-rnode_is_dstnode (struct route_node *rn)
+static inline int rnode_is_dstnode(struct route_node *rn)
{
- return rn->table->delegate == &_srcdest_dstnode_delegate;
+ return rn->table->delegate == &_srcdest_dstnode_delegate;
}
-static inline int
-rnode_is_srcnode (struct route_node *rn)
+static inline int rnode_is_srcnode(struct route_node *rn)
{
- return rn->table->delegate == &_srcdest_srcnode_delegate;
+ return rn->table->delegate == &_srcdest_srcnode_delegate;
}
-static inline struct route_table *
-srcdest_rnode_table (struct route_node *rn)
+static inline struct route_table *srcdest_rnode_table(struct route_node *rn)
{
- if (rnode_is_srcnode (rn))
- {
- struct route_node *dst_rn = rn->table->info;
- return dst_rn->table;
- }
- else
- {
- return rn->table;
- }
+ if (rnode_is_srcnode(rn)) {
+ struct route_node *dst_rn = route_table_get_info(rn->table);
+ return dst_rn->table;
+ } else {
+ return rn->table;
+ }
}
-static inline void *
-srcdest_rnode_table_info (struct route_node *rn)
+static inline void *srcdest_rnode_table_info(struct route_node *rn)
{
- return srcdest_rnode_table(rn)->info;
+ return route_table_get_info(srcdest_rnode_table(rn));
}
#endif /* _ZEBRA_SRC_DEST_TABLE_H */