/*
 * Copyright (C) 2003 Yasuhiro Ohara
 *
 * This file is part of GNU Zebra.
 *
 * GNU Zebra is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2, or (at your option) any
 * later version.
 *
 * GNU Zebra is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * 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 GNU Zebra; see the file COPYING.  If not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
 * Boston, MA 02111-1307, USA.  
 */

#ifndef OSPF6_ROUTE_H
#define OSPF6_ROUTE_H

#define OSPF6_MULTI_PATH_LIMIT    4

/* Debug option */
extern unsigned char conf_debug_ospf6_route;
#define OSPF6_DEBUG_ROUTE_TABLE   0x01
#define OSPF6_DEBUG_ROUTE_INTRA   0x02
#define OSPF6_DEBUG_ROUTE_INTER   0x04
#define OSPF6_DEBUG_ROUTE_MEMORY  0x80
#define OSPF6_DEBUG_ROUTE_ON(level) \
  (conf_debug_ospf6_route |= (level))
#define OSPF6_DEBUG_ROUTE_OFF(level) \
  (conf_debug_ospf6_route &= ~(level))
#define IS_OSPF6_DEBUG_ROUTE(e) \
  (conf_debug_ospf6_route & OSPF6_DEBUG_ROUTE_ ## e)

/* Nexthop */
struct ospf6_nexthop
{
  /* Interface index */
  ifindex_t ifindex;

  /* IP address, if any */
  struct in6_addr address;
};

#define ospf6_nexthop_is_set(x)                                \
  ((x)->ifindex || ! IN6_IS_ADDR_UNSPECIFIED (&(x)->address))
#define ospf6_nexthop_is_same(a,b)                             \
  ((a)->ifindex == (b)->ifindex &&                            \
   IN6_ARE_ADDR_EQUAL (&(a)->address, &(b)->address))
#define ospf6_nexthop_clear(x)                                \
  do {                                                        \
    (x)->ifindex = 0;                                         \
    memset (&(x)->address, 0, sizeof (struct in6_addr));      \
  } while (0)
#define ospf6_nexthop_copy(a, b)                              \
  do {                                                        \
    (a)->ifindex = (b)->ifindex;                              \
    memcpy (&(a)->address, &(b)->address,                     \
            sizeof (struct in6_addr));                        \
  } while (0)

/* Path */
struct ospf6_ls_origin
{
  u_int16_t type;
  u_int32_t id;
  u_int32_t adv_router;
};

struct ospf6_path
{
  /* Link State Origin */
  struct ospf6_ls_origin origin;

  /* Router bits */
  u_char router_bits;

  /* Optional Capabilities */
  u_char options[3];

  /* Prefix Options */
  u_char prefix_options;

  /* Associated Area */
  u_int32_t area_id;

  /* Path-type */
  u_char type;
  u_char subtype; /* only used for redistribute i.e ZEBRA_ROUTE_XXX */

  /* Cost */
  u_int8_t metric_type;
  u_int32_t cost;
  u_int32_t cost_e2;
  u_int32_t tag;
};

#define OSPF6_PATH_TYPE_NONE         0
#define OSPF6_PATH_TYPE_INTRA        1
#define OSPF6_PATH_TYPE_INTER        2
#define OSPF6_PATH_TYPE_EXTERNAL1    3
#define OSPF6_PATH_TYPE_EXTERNAL2    4
#define OSPF6_PATH_TYPE_REDISTRIBUTE 5
#define OSPF6_PATH_TYPE_MAX          6

#include "prefix.h"
#include "table.h"

struct ospf6_route
{
  struct route_node *rnode;
  struct ospf6_route_table *table;
  struct ospf6_route *prev;
  struct ospf6_route *next;

  unsigned int lock;

  /* Destination Type */
  u_char type;

  /* XXX: It would likely be better to use separate struct in_addr's
   * for the advertising router-ID and prefix IDs, instead of stuffing them
   * into one. See also XXX below.
   */
  /* Destination ID */
  struct prefix prefix;

  /* Time */
  struct timeval installed;
  struct timeval changed;

  /* flag */
  u_char flag;

  /* path */
  struct ospf6_path path;

  /* nexthop */
  struct ospf6_nexthop nexthop[OSPF6_MULTI_PATH_LIMIT];

  /* route option */
  void *route_option;

  /* link state id for advertising */
  u_int32_t linkstate_id;
};

#define OSPF6_DEST_TYPE_NONE       0
#define OSPF6_DEST_TYPE_ROUTER     1
#define OSPF6_DEST_TYPE_NETWORK    2
#define OSPF6_DEST_TYPE_DISCARD    3
#define OSPF6_DEST_TYPE_LINKSTATE  4
#define OSPF6_DEST_TYPE_RANGE      5
#define OSPF6_DEST_TYPE_MAX        6

#define OSPF6_ROUTE_CHANGE           0x01
#define OSPF6_ROUTE_ADD              0x02
#define OSPF6_ROUTE_REMOVE           0x04
#define OSPF6_ROUTE_BEST             0x08
#define OSPF6_ROUTE_ACTIVE_SUMMARY   0x10
#define OSPF6_ROUTE_DO_NOT_ADVERTISE 0x20
#define OSPF6_ROUTE_WAS_REMOVED      0x40

struct ospf6_route_table
{
  int scope_type;
  int table_type;
  void *scope;

  /* patricia tree */
  struct route_table *table;

  u_int32_t count;

  /* hooks */
  void (*hook_add) (struct ospf6_route *);
  void (*hook_change) (struct ospf6_route *);
  void (*hook_remove) (struct ospf6_route *);
};

#define OSPF6_SCOPE_TYPE_NONE      0
#define OSPF6_SCOPE_TYPE_GLOBAL    1
#define OSPF6_SCOPE_TYPE_AREA      2
#define OSPF6_SCOPE_TYPE_INTERFACE 3

#define OSPF6_TABLE_TYPE_NONE              0
#define OSPF6_TABLE_TYPE_ROUTES            1
#define OSPF6_TABLE_TYPE_BORDER_ROUTERS    2
#define OSPF6_TABLE_TYPE_CONNECTED_ROUTES  3
#define OSPF6_TABLE_TYPE_EXTERNAL_ROUTES   4
#define OSPF6_TABLE_TYPE_SPF_RESULTS       5
#define OSPF6_TABLE_TYPE_PREFIX_RANGES     6
#define OSPF6_TABLE_TYPE_SUMMARY_PREFIXES  7
#define OSPF6_TABLE_TYPE_SUMMARY_ROUTERS   8

#define OSPF6_ROUTE_TABLE_CREATE(s, t) \
  ospf6_route_table_create (OSPF6_SCOPE_TYPE_ ## s, \
                            OSPF6_TABLE_TYPE_ ## t)

extern const char *ospf6_dest_type_str[OSPF6_DEST_TYPE_MAX];
extern const char *ospf6_dest_type_substr[OSPF6_DEST_TYPE_MAX];
#define OSPF6_DEST_TYPE_NAME(x)                       \
  (0 < (x) && (x) < OSPF6_DEST_TYPE_MAX ?             \
   ospf6_dest_type_str[(x)] : ospf6_dest_type_str[0])
#define OSPF6_DEST_TYPE_SUBSTR(x)                           \
  (0 < (x) && (x) < OSPF6_DEST_TYPE_MAX ?                   \
   ospf6_dest_type_substr[(x)] : ospf6_dest_type_substr[0])

extern const char *ospf6_path_type_str[OSPF6_PATH_TYPE_MAX];
extern const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX];
#define OSPF6_PATH_TYPE_NAME(x)                       \
  (0 < (x) && (x) < OSPF6_PATH_TYPE_MAX ?             \
   ospf6_path_type_str[(x)] : ospf6_path_type_str[0])
#define OSPF6_PATH_TYPE_SUBSTR(x)                           \
  (0 < (x) && (x) < OSPF6_PATH_TYPE_MAX ?                   \
   ospf6_path_type_substr[(x)] : ospf6_path_type_substr[0])

#define OSPF6_ROUTE_ADDRESS_STR "Display the route bestmatches the address\n"
#define OSPF6_ROUTE_PREFIX_STR  "Display the route\n"
#define OSPF6_ROUTE_MATCH_STR   "Display the route matches the prefix\n"

#define ospf6_route_is_prefix(p, r) \
  (memcmp (p, &(r)->prefix, sizeof (struct prefix)) == 0)
#define ospf6_route_is_same(ra, rb) \
  (prefix_same (&(ra)->prefix, &(rb)->prefix))
#define ospf6_route_is_same_origin(ra, rb) \
  ((ra)->path.area_id == (rb)->path.area_id && \
   memcmp (&(ra)->path.origin, &(rb)->path.origin, \
           sizeof (struct ospf6_ls_origin)) == 0)
#define ospf6_route_is_identical(ra, rb) \
  ((ra)->type == (rb)->type && \
   memcmp (&(ra)->prefix, &(rb)->prefix, sizeof (struct prefix)) == 0 && \
   memcmp (&(ra)->path, &(rb)->path, sizeof (struct ospf6_path)) == 0 && \
   memcmp (&(ra)->nexthop, &(rb)->nexthop,                               \
           sizeof (struct ospf6_nexthop) * OSPF6_MULTI_PATH_LIMIT) == 0)
#define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST))

#define ospf6_linkstate_prefix_adv_router(x) \
  ((x)->u.lp.id.s_addr)
#define ospf6_linkstate_prefix_id(x) \
  ((x)->u.lp.adv_router.s_addr)

#define ADV_ROUTER_IN_PREFIX(x) \
  ((x)->u.lp.id.s_addr)
#define ID_IN_PREFIX(x) \
  ((x)->u.lp.adv_router.s_addr)

/* Function prototype */
extern void ospf6_linkstate_prefix (u_int32_t adv_router, u_int32_t id,
                                    struct prefix *prefix);
extern void ospf6_linkstate_prefix2str (struct prefix *prefix, char *buf,
                                        int size);

extern struct ospf6_route *ospf6_route_create (void);
extern void ospf6_route_delete (struct ospf6_route *);
extern struct ospf6_route *ospf6_route_copy (struct ospf6_route *route);

extern void ospf6_route_lock (struct ospf6_route *route);
extern void ospf6_route_unlock (struct ospf6_route *route);

extern struct ospf6_route *ospf6_route_lookup (struct prefix *prefix,
                                               struct ospf6_route_table *table);
extern struct ospf6_route *ospf6_route_lookup_identical (struct ospf6_route *route,
                                            struct ospf6_route_table *table);
extern struct ospf6_route *ospf6_route_lookup_bestmatch (struct prefix *prefix,
                                              struct ospf6_route_table *table);

extern struct ospf6_route *ospf6_route_add (struct ospf6_route *route,
                                            struct ospf6_route_table *table);
extern void ospf6_route_remove (struct ospf6_route *route,
                                struct ospf6_route_table *table);

extern struct ospf6_route *ospf6_route_head (struct ospf6_route_table *table);
extern struct ospf6_route *ospf6_route_next (struct ospf6_route *route);
extern struct ospf6_route *ospf6_route_best_next (struct ospf6_route *route);

extern struct ospf6_route *ospf6_route_match_head (struct prefix *prefix,
                                            struct ospf6_route_table *table);
extern struct ospf6_route *ospf6_route_match_next (struct prefix *prefix,
                                            struct ospf6_route *route);

extern void ospf6_route_remove_all (struct ospf6_route_table *);
extern struct ospf6_route_table *ospf6_route_table_create (int s, int t);
extern void ospf6_route_table_delete (struct ospf6_route_table *);
extern void ospf6_route_dump (struct ospf6_route_table *table);


extern void ospf6_route_show (struct vty *vty, struct ospf6_route *route);
extern void ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route);

extern int ospf6_route_table_show (struct vty *, int, const char *[],
                                   struct ospf6_route_table *);
extern int ospf6_linkstate_table_show (struct vty *vty, int argc,
                                       const char *argv[],
                                       struct ospf6_route_table *table);

extern void ospf6_brouter_show_header (struct vty *vty);
extern void ospf6_brouter_show (struct vty *vty, struct ospf6_route *route);

extern int config_write_ospf6_debug_route (struct vty *vty);
extern void install_element_ospf6_debug_route (void);
extern void ospf6_route_init (void);
extern void ospf6_clean (void);

#endif /* OSPF6_ROUTE_H */

