/* Path */
struct ospf6_ls_origin {
- u_int16_t type;
- u_int32_t id;
- u_int32_t adv_router;
+ uint16_t type;
+ uint32_t id;
+ uint32_t adv_router;
};
struct ospf6_path {
struct ospf6_ls_origin origin;
/* Router bits */
- u_char router_bits;
+ uint8_t router_bits;
/* Optional Capabilities */
- u_char options[3];
+ uint8_t options[3];
/* Prefix Options */
- u_char prefix_options;
+ uint8_t prefix_options;
/* Associated Area */
- u_int32_t area_id;
+ uint32_t area_id;
/* Path-type */
- u_char type;
- u_char subtype; /* only used for redistribute i.e ZEBRA_ROUTE_XXX */
+ uint8_t type;
+ uint8_t subtype; /* only used for redistribute i.e ZEBRA_ROUTE_XXX */
/* Cost */
- u_int8_t metric_type;
- u_int32_t cost;
+ uint8_t metric_type;
+ uint32_t cost;
+
+ struct prefix ls_prefix;
+
union {
- u_int32_t cost_e2;
- u_int32_t cost_config;
+ uint32_t cost_e2;
+ uint32_t cost_config;
} u;
- u_int32_t tag;
+ uint32_t tag;
/* nh list for this path */
struct list *nh_list;
unsigned int lock;
/* Destination Type */
- u_char type;
+ uint8_t 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
struct timeval changed;
/* flag */
- u_char flag;
+ uint8_t flag;
/* route option */
void *route_option;
/* link state id for advertising */
- u_int32_t linkstate_id;
+ uint32_t linkstate_id;
/* path */
struct ospf6_path path;
/* patricia tree */
struct route_table *table;
- u_int32_t count;
+ uint32_t count;
bitfield_t idspace;
#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];
+extern const char *const ospf6_dest_type_str[OSPF6_DEST_TYPE_MAX];
+extern const char *const 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])
(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];
+extern const char *const ospf6_path_type_str[OSPF6_PATH_TYPE_MAX];
+extern const char *const 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])
((ra)->type == (rb)->type \
&& memcmp(&(ra)->prefix, &(rb)->prefix, sizeof(struct prefix)) == 0 \
&& memcmp(&(ra)->path, &(rb)->path, sizeof(struct ospf6_path)) == 0 \
+ && listcount(ra->paths) == listcount(rb->paths) \
&& ospf6_route_cmp_nexthops(ra, rb) == 0)
#define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST))
#define ADV_ROUTER_IN_PREFIX(x) ((x)->u.lp.id.s_addr)
/* Function prototype */
-extern void ospf6_linkstate_prefix(u_int32_t adv_router, u_int32_t id,
+extern void ospf6_linkstate_prefix(uint32_t adv_router, uint32_t id,
struct prefix *prefix);
extern void ospf6_linkstate_prefix2str(struct prefix *prefix, char *buf,
int size);
extern void ospf6_clean(void);
extern void ospf6_path_free(struct ospf6_path *op);
extern struct ospf6_path *ospf6_path_dup(struct ospf6_path *path);
+extern void ospf6_copy_paths(struct list *dst, struct list *src);
#endif /* OSPF6_ROUTE_H */