aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/libhicnctrl/src/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctrl/libhicnctrl/src/route.c')
-rw-r--r--ctrl/libhicnctrl/src/route.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ctrl/libhicnctrl/src/route.c b/ctrl/libhicnctrl/src/route.c
index 61434871b..703b4763f 100644
--- a/ctrl/libhicnctrl/src/route.c
+++ b/ctrl/libhicnctrl/src/route.c
@@ -43,6 +43,16 @@ hicn_route_create(ip_prefix_t * prefix, face_id_t face_id, route_cost_t cost)
return route;
}
+hicn_route_t *
+hicn_route_dup(const hicn_route_t * route)
+{
+ hicn_route_t * new_route = malloc(sizeof(hicn_route_t));
+ if (!route)
+ return NULL;
+ memcpy(new_route, route, sizeof(hicn_route_t));
+ return new_route;
+}
+
void hicn_route_free(hicn_route_t * route)
{
free(route);