23 #include <hicn/util/ip_address.h>
26 typedef u16 route_cost_t;
28 typedef struct hicn_route_s hicn_route_t;
30 #define MAXSZ_ROUTE_ MAXSZ_PREFIX + 3 + MAXSZ_COST
31 #define MAXSZ_ROUTE MAXSZ_ROUTE_ + NULLTERM
33 hicn_route_t * hicn_route_create(
ip_prefix_t * prefix, face_id_t face_id, route_cost_t cost);
34 hicn_route_t * hicn_route_dup(
const hicn_route_t * route);
35 void hicn_route_free(hicn_route_t * route);
37 int hicn_route_cmp(
const hicn_route_t * route1,
const hicn_route_t * route2);
39 int hicn_route_get_prefix(
const hicn_route_t * route,
ip_prefix_t * prefix);
40 int hicn_route_set_prefix(hicn_route_t * route,
const ip_prefix_t prefix);
42 int hicn_route_get_cost(
const hicn_route_t * route,
int * cost);
43 int hicn_route_set_cost(hicn_route_t * route,
const int cost);
45 size_t hicn_route_snprintf(
char * s,
size_t size,
const hicn_route_t * route);