Add API dump call for vrf/vni mapping to vpp-api-test
[vpp.git] / vpp / vpp-api / api.c
index 58f7aef..63e0ed2 100644 (file)
@@ -79,6 +79,7 @@
 #include <vnet/devices/af_packet/af_packet.h>
 #include <vnet/policer/policer.h>
 #include <vnet/devices/netmap/netmap.h>
+#include <vnet/flow/flow_report.h>
 
 #undef BIHASH_TYPE
 #undef __included_bihash_template_h__
@@ -365,7 +366,9 @@ _(CLASSIFY_TABLE_IDS,classify_table_ids)                                \
 _(CLASSIFY_TABLE_BY_INTERFACE, classify_table_by_interface)             \
 _(CLASSIFY_TABLE_INFO,classify_table_info)                              \
 _(CLASSIFY_SESSION_DUMP,classify_session_dump)                          \
-_(CLASSIFY_SESSION_DETAILS,classify_session_details)
+_(CLASSIFY_SESSION_DETAILS,classify_session_details)                    \
+_(IPFIX_ENABLE,ipfix_enable)                                            \
+_(IPFIX_DUMP,ipfix_dump)
 
 #define QUOTE_(x) #x
 #define QUOTE(x) QUOTE_(x)
@@ -862,7 +865,7 @@ static int ip4_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
     uword * p;
     clib_error_t * e;
     u32 ai;
-    ip_adjacency_t *nh_adj, *add_adj = 0;
+    ip_adjacency_t *adj;
 
     p = hash_get (im->fib_index_by_table_id, ntohl(mp->vrf_id));
     if (!p) {
@@ -879,7 +882,8 @@ static int ip4_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
         fib_index = p[0];
     }
 
-    if (pool_is_free_index (vnm->interface_main.sw_interfaces,
+    if (~0 != mp->next_hop_sw_if_index &&
+       pool_is_free_index (vnm->interface_main.sw_interfaces,
                             ntohl(mp->next_hop_sw_if_index)))
         return VNET_API_ERROR_NO_MATCHING_INTERFACE;
 
@@ -887,7 +891,7 @@ static int ip4_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
             sizeof (next_hop_address.data));
 
     /* Arp for the next_hop if necessary */
-    if (mp->is_add && mp->resolve_if_needed) {
+    if (mp->is_add && mp->resolve_if_needed && ~0 != mp->next_hop_sw_if_index) {
         u32 lookup_result;
         ip_adjacency_t * adj;
 
@@ -971,50 +975,43 @@ static int ip4_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
         else if (mp->is_local)
             ai = lm->local_adj_index;
         else if (mp->is_classify) {
-            ip_adjacency_t cadj;
-            memset(&cadj, 0, sizeof(cadj));
-            cadj.lookup_next_index = IP_LOOKUP_NEXT_CLASSIFY;
-            cadj.classify.table_index = ntohl(mp->classify_table_index);
-            if (pool_is_free_index (cm->tables, cadj.classify.table_index)) {
+           if (pool_is_free_index (cm->tables, ntohl(mp->classify_table_index))) {
                 dsunlock(sm);
                 return VNET_API_ERROR_NO_SUCH_TABLE;
             }
-            vec_add1 (add_adj, cadj);
-            goto do_add_del;
-        }
-        else {
-            ai = ip4_fib_lookup_with_table
-                (im, fib_index, &next_hop_address,
-                 1 /* disable default route */);
-            if (ai == lm->miss_adj_index) {
-                dsunlock(sm);
-                return VNET_API_ERROR_NEXT_HOP_NOT_IN_FIB;
-            }
-        }
+           adj = ip_add_adjacency (lm,
+                                   /* template */ 0,
+                                   /* block size */ 1,
+                                   &ai);
 
-        nh_adj = ip_get_adjacency (lm, ai);
-       if (nh_adj->lookup_next_index == IP_LOOKUP_NEXT_ARP &&
-           nh_adj->arp.next_hop.ip4.as_u32 == 0) {
-           /* the next-hop resovles via a glean adj. create and use
-            * a ARP adj for the next-hop */
-           a.adj_index = vnet_arp_glean_add(fib_index, &next_hop_address);
-           a.add_adj = NULL;
-           a.n_add_adj = 0;
-           ip4_add_del_route (im, &a);
-
-           goto done;
+            adj->lookup_next_index = IP_LOOKUP_NEXT_CLASSIFY;
+            adj->classify.table_index = ntohl(mp->classify_table_index);
        }
-       vec_add1 (add_adj, nh_adj[0]);
-        if (mp->lookup_in_vrf) {
+        else if (mp->lookup_in_vrf) {
             p = hash_get (im->fib_index_by_table_id, ntohl(mp->lookup_in_vrf));
-            if (p)
-                add_adj[0].explicit_fib_index = p[0];
+            if (p) {
+               adj = ip_add_adjacency (lm,
+                                       /* template */ 0,
+                                       /* block size */ 1,
+                                       &ai);
+                adj->explicit_fib_index = p[0];
+           }
             else {
-                vec_free (add_adj);
                 dsunlock(sm);
-                return VNET_API_ERROR_NO_SUCH_INNER_FIB;
-            }
-        }
+               return VNET_API_ERROR_NO_SUCH_INNER_FIB;
+           }
+       }
+        else
+           ai = ip4_route_get_next_hop_adj (im,
+                                            fib_index,
+                                            &next_hop_address,
+                                            ntohl(mp->next_hop_sw_if_index),
+                                            fib_index);
+
+       if (ai == lm->miss_adj_index) {
+           dsunlock(sm);
+           return VNET_API_ERROR_NO_SUCH_INNER_FIB;
+       }
     } else {
         ip_adjacency_t * adj;
         int disable_default_route = 1;
@@ -1038,15 +1035,9 @@ static int ip4_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
         }
     }
 
-do_add_del:
-    a.adj_index = ~0;
-    a.add_adj = add_adj;
-    a.n_add_adj = vec_len(add_adj);
+    a.adj_index = ai;
     ip4_add_del_route (im, &a);
 
-    vec_free (add_adj);
-
-done:
     dsunlock (sm);
     return 0;
 }
@@ -1067,7 +1058,7 @@ static int ip6_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
     u32 fib_index;
     uword * p;
     clib_error_t * e;
-    ip_adjacency_t * nh_adj, * add_adj = 0;
+    ip_adjacency_t *adj = 0;
     u32 ai;
 
     p = hash_get (im->fib_index_by_table_id, ntohl(mp->vrf_id));
@@ -1086,7 +1077,8 @@ static int ip6_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
         fib_index = p[0];
     }
 
-    if (pool_is_free_index (vnm->interface_main.sw_interfaces,
+    if (~0 != mp->next_hop_sw_if_index &&
+       pool_is_free_index (vnm->interface_main.sw_interfaces,
                             ntohl(mp->next_hop_sw_if_index)))
         return VNET_API_ERROR_NO_MATCHING_INTERFACE;
 
@@ -1094,7 +1086,7 @@ static int ip6_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
             sizeof (next_hop_address.as_u8));
 
     /* Arp for the next_hop if necessary */
-    if (mp->is_add && mp->resolve_if_needed) {
+    if (mp->is_add && mp->resolve_if_needed && ~0 != mp->next_hop_sw_if_index) {
         u32 lookup_result;
         ip_adjacency_t * adj;
 
@@ -1176,27 +1168,30 @@ static int ip6_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
             ai = lm->drop_adj_index;
         else if (mp->is_local)
             ai = lm->local_adj_index;
-        else {
-            ai = ip6_fib_lookup_with_table
-                (im, fib_index, &next_hop_address);
-            if (ai == lm->miss_adj_index) {
-                dsunlock(sm);
-                return VNET_API_ERROR_NEXT_HOP_NOT_IN_FIB;
-            }
-        }
-
-        nh_adj = ip_get_adjacency (lm, ai);
-        vec_add1 (add_adj, nh_adj[0]);
-        if (mp->lookup_in_vrf) {
+       else if (mp->lookup_in_vrf) {
             p = hash_get (im->fib_index_by_table_id, ntohl(mp->lookup_in_vrf));
-            if (p)
-                add_adj[0].explicit_fib_index = p[0];
+            if (p) {
+               adj = ip_add_adjacency (lm,
+                                       /* template */ 0,
+                                       /* block size */ 1,
+                                       &ai);
+                adj->explicit_fib_index = p[0];
+           }
             else {
-                vec_free (add_adj);
-                dsunlock(sm);
+               dsunlock(sm);
                 return VNET_API_ERROR_NO_SUCH_INNER_FIB;
-            }
-        }
+           }
+       }
+       else
+          ai = ip6_route_get_next_hop_adj (im,
+                                           fib_index,
+                                           &next_hop_address,
+                                           ntohl(mp->next_hop_sw_if_index),
+                                           fib_index);
+      if (ai == lm->miss_adj_index) {
+         dsunlock(sm);
+         return VNET_API_ERROR_NEXT_HOP_NOT_IN_FIB;
+      }
     } else {
         ip_adjacency_t * adj;
 
@@ -1213,13 +1208,9 @@ static int ip6_add_del_route_t_handler (vl_api_ip_add_del_route_t *mp)
         }
     }
 
-    a.adj_index = ~0;
-    a.add_adj = add_adj;
-    a.n_add_adj = vec_len(add_adj);
+    a.adj_index = ai;
     ip6_add_del_route (im, &a);
 
-    vec_free (add_adj);
-
     dsunlock (sm);
     return 0;
 }
@@ -1652,6 +1643,7 @@ vl_api_l2fib_add_del_t_handler (
     u32 bd_index;
     u32 static_mac;
     u32 filter_mac;
+    u32 bvi_mac;
     uword * p;
 
     mac = mp->mac;
@@ -1678,8 +1670,9 @@ vl_api_l2fib_add_del_t_handler (
        }
         static_mac = mp->static_mac ? 1 : 0;
        filter_mac = mp->filter_mac ? 1 : 0;
+    bvi_mac = mp->bvi_mac ? 1 : 0;
        l2fib_add_entry(mac, bd_index, sw_if_index, static_mac, filter_mac,
-                        0 /* bvi_mac */);
+                        bvi_mac);
     } else {
        l2fib_del_entry(mac, bd_index);
     }
@@ -5020,6 +5013,8 @@ vl_api_lisp_add_del_map_request_itr_rlocs_t_handler
 typedef CLIB_PACKED(struct
 {
   u8 is_ip4; /**< is locator an IPv4 address */
+  u8 priority; /**< locator priority */
+  u8 weight;   /**< locator weight */
   u8 addr[16]; /**< IPv4/IPv6 address */
 }) rloc_t;
 
@@ -5097,35 +5092,29 @@ vl_api_lisp_add_del_remote_mapping_t_handler (
                        r->is_ip4 ? IP4 : IP6);
         gid_address_ippref_len(&rloc.address) = r->is_ip4 ? 32: 128;
         gid_address_type(&rloc.address) = GID_ADDR_IP_PREFIX;
-        /* TODO fix API to pass priority and weight */
-        rloc.priority = 1;
-        rloc.weight = 1;
+        rloc.priority = r->priority;
+        rloc.weight = r->weight;
         vec_add1 (rlocs, rloc);
     }
 
-    /* TODO Uncomment once https://gerrit.fd.io/r/#/c/1802 is merged and CSIT
-     * is switched to lisp_add_del_adjacency */
-//    if (!mp->is_add) {
-//        vnet_lisp_add_del_adjacency_args_t _a, * a = &_a;
-//        gid_address_copy(&a->deid, deid);
-//        a->is_add = 0;
-//        rv = vnet_lisp_add_del_adjacency (a);
-//    } else {
-//        /* NOTE: for now this works as a static remote mapping, i.e.,
-//         * not authoritative and ttl infinite. */
-//        rv = vnet_lisp_add_del_mapping (deid, rlocs, mp->action, 0, ~0,
-//                                        mp->is_add, 0);
-//    }
-
-    /* TODO: remove once the above is merged */
-    vnet_lisp_add_del_adjacency_args_t _a, * a = &_a;
-    a->is_add = mp->is_add;
-    a->authoritative = 0;
-    a->action = mp->action;
-    a->locators = rlocs;
-    gid_address_copy(&a->seid, seid);
-    gid_address_copy(&a->deid, deid);
-    rv = vnet_lisp_add_del_adjacency (a);
+    if (!mp->is_add) {
+        vnet_lisp_add_del_adjacency_args_t _a, * a = &_a;
+        gid_address_copy(&a->deid, deid);
+        a->is_add = 0;
+        rv = vnet_lisp_add_del_adjacency (a);
+    } else {
+        /* NOTE: for now this works as a static remote mapping, i.e.,
+         * not authoritative and ttl infinite. */
+        rv = vnet_lisp_add_del_mapping (deid, rlocs, mp->action, 0, ~0,
+                                        mp->is_add, 0);
+
+        /* TODO remove once CSIT switched to lisp_add_del_adjacency */
+        vnet_lisp_add_del_adjacency_args_t _a, * a = &_a;
+        gid_address_copy(&a->seid, seid);
+        gid_address_copy(&a->deid, deid);
+        a->is_add = 1;
+        vnet_lisp_add_del_adjacency (a);
+    }
 
     if (mp->del_all)
       vnet_lisp_clear_all_remote_adjacencies ();
@@ -5139,8 +5128,6 @@ static void
 vl_api_lisp_add_del_adjacency_t_handler (
     vl_api_lisp_add_del_adjacency_t *mp)
 {
-    u32 i;
-    locator_t rloc;
     vl_api_lisp_add_del_adjacency_reply_t * rmp;
     vnet_lisp_add_del_adjacency_args_t _a, * a = &_a;
 
@@ -5184,30 +5171,9 @@ vl_api_lisp_add_del_adjacency_t_handler (
         goto send_reply;
       }
 
-    for (i = 0; i < mp->rloc_num; i++) {
-        rloc_t * r = &((rloc_t *) mp->rlocs)[i];
-        memset(&rloc, 0, sizeof(rloc));
-        ip_address_set(&gid_address_ip(&rloc.address), &r->addr,
-                       r->is_ip4 ? IP4 : IP6);
-        gid_address_ippref_len(&rloc.address) = r->is_ip4 ? 32: 128;
-        gid_address_type(&rloc.address) = GID_ADDR_IP_PREFIX;
-        /* TODO fix API to pass priority and weight */
-        rloc.priority = 1;
-        rloc.weight = 1;
-        vec_add1 (a->locators, rloc);
-    }
-
-    a->action = mp->action;
     a->is_add = mp->is_add;
-
-    /* NOTE: the remote mapping is static, i.e.,  not authoritative and
-     * ttl is infinite. */
-    a->authoritative = 0;
-    a->ttl = ~0;
-
     rv = vnet_lisp_add_del_adjacency (a);
 
-    vec_free (a->locators);
 send_reply:
     REPLY_MACRO(VL_API_LISP_ADD_DEL_ADJACENCY_REPLY);
 }
@@ -5337,19 +5303,50 @@ static void
 vl_api_lisp_local_eid_table_dump_t_handler (
     vl_api_lisp_local_eid_table_dump_t *mp)
 {
+    u32 mi;
     unix_shared_memory_queue_t * q = NULL;
     lisp_cp_main_t * lcm = vnet_lisp_cp_get_main();
     mapping_t * mapit = NULL;
+    gid_address_t _eid, * eid = &_eid;
 
     q = vl_api_client_index_to_input_queue (mp->client_index);
     if (q == 0) {
         return;
     }
 
-    pool_foreach (mapit, lcm->mapping_pool,
+    if (mp->eid_set) {
+        memset (eid, 0, sizeof (*eid));
+        gid_address_vni(eid) = ntohl(mp->vni);
+        switch (mp->eid_type) {
+        case 0:
+            gid_address_type(eid) = GID_ADDR_IP_PREFIX;
+            gid_address_ippref_len(eid) = mp->prefix_length;
+            gid_address_ip_version(eid) = IP4;
+            clib_memcpy (&gid_address_ippref(eid), mp->eid, 4);
+            break;
+        case 1:
+            gid_address_type(eid) = GID_ADDR_IP_PREFIX;
+            gid_address_ippref_len(eid) = mp->prefix_length;
+            gid_address_ip_version(eid) = IP6;
+            clib_memcpy (&gid_address_ippref(eid), mp->eid, 16);
+            break;
+        case 2:
+            gid_address_type(eid) = GID_ADDR_MAC;
+            clib_memcpy (gid_address_mac(eid), mp->eid, 6);
+            break;
+        }
+        mi = gid_dictionary_lookup (&lcm->mapping_index_by_gid, eid);
+        if ((u32)~0 == mi)
+          return;
+
+        mapit = pool_elt_at_index (lcm->mapping_pool, mi);
+        send_lisp_local_eid_table_details(mapit, q, mp->context);
+    } else {
+        pool_foreach (mapit, lcm->mapping_pool,
         ({
             send_lisp_local_eid_table_details(mapit, q, mp->context);
         }));
+    }
 }
 
 static void
@@ -5456,6 +5453,23 @@ vl_api_lisp_map_resolver_dump_t_handler (
 
 }
 
+static void
+send_eid_table_map_pair (hash_pair_t * p,
+                         unix_shared_memory_queue_t * q,
+                         u32 context)
+{
+    vl_api_lisp_eid_table_map_details_t * rmp = NULL;
+
+    rmp = vl_msg_api_alloc (sizeof (*rmp));
+    memset (rmp, 0, sizeof (*rmp));
+    rmp->_vl_msg_id = ntohs(VL_API_LISP_EID_TABLE_MAP_DETAILS);
+
+    rmp->vni = clib_host_to_net_u32 (p->key);
+    rmp->vrf = clib_host_to_net_u32 (p->value[0]);
+    rmp->context = context;
+    vl_msg_api_send_shmem (q, (u8 *)&rmp);
+}
+
 static void
 vl_api_lisp_eid_table_map_dump_t_handler (
     vl_api_lisp_eid_table_map_dump_t *mp)
@@ -5469,12 +5483,7 @@ vl_api_lisp_eid_table_map_dump_t_handler (
         return;
     }
     hash_foreach_pair (p, lcm->table_id_by_vni, {
-        vl_api_lisp_eid_table_map_details_t * rmp = NULL;
-        memset (rmp, 0, sizeof (*rmp));
-        rmp->_vl_msg_id = ntohs(VL_API_LISP_EID_TABLE_MAP_DETAILS);
-        rmp->vni = p->key;
-        rmp->vrf = p->value[0];
-        rmp->context = mp->context;
+        send_eid_table_map_pair (p, q, mp->context);
     });
 }
 
@@ -5722,7 +5731,7 @@ static void vl_api_ipsec_spd_add_del_entry_t_handler
     p.is_outbound = mp->is_outbound;
     p.is_ipv6 = mp->is_ipv6;
 
-    if (mp->is_ipv6) {
+    if (mp->is_ipv6 || mp->is_ip_any) {
         clib_memcpy(&p.raddr.start, mp->remote_address_start, 16);
         clib_memcpy(&p.raddr.stop, mp->remote_address_stop, 16);
         clib_memcpy(&p.laddr.start, mp->local_address_start, 16);
@@ -6331,6 +6340,12 @@ vl_api_policer_add_del_t_handler
     cfg.rb.kbps.eir_kbps = mp->eir;
     cfg.rb.kbps.cb_bytes = mp->cb;
     cfg.rb.kbps.eb_bytes = mp->eb;
+    cfg.conform_action.action_type = mp->conform_action_type;
+    cfg.conform_action.dscp = mp->conform_dscp;
+    cfg.exceed_action.action_type = mp->exceed_action_type;
+    cfg.exceed_action.dscp = mp->exceed_dscp;
+    cfg.violate_action.action_type = mp->violate_action_type;
+    cfg.violate_action.dscp = mp->violate_dscp;
 
     error = policer_add_del(vm, name, &cfg, mp->is_add);
 
@@ -6360,6 +6375,12 @@ send_policer_details (u8 *name,
     mp->rate_type = config->rate_type;
     mp->round_type = config->rnd_type;
     mp->type = config->rfc;
+    mp->conform_action_type = config->conform_action.action_type;
+    mp->conform_dscp = config->conform_action.dscp;
+    mp->exceed_action_type = config->exceed_action.action_type;
+    mp->exceed_dscp = config->exceed_action.dscp;
+    mp->violate_action_type = config->violate_action.action_type;
+    mp->violate_dscp = config->violate_action.dscp;
     mp->single_rate = templ->single_rate ? 1 : 0;
     mp->color_aware = templ->color_aware ? 1 : 0;
     mp->scale = htonl(templ->scale);
@@ -6995,6 +7016,106 @@ static void vl_api_classify_session_dump_t_handler (vl_api_classify_session_dump
     }));
 }
 
+static void vl_api_ipfix_enable_t_handler (vl_api_ipfix_enable_t *mp)
+{
+    vlib_main_t *vm = vlib_get_main();
+       flow_report_main_t * frm = &flow_report_main;
+       vl_api_ipfix_enable_reply_t *rmp;
+       ip4_address_t collector, src;
+       u16 collector_port = UDP_DST_PORT_ipfix;
+    u32 path_mtu;
+    u32 template_interval;
+       u32 fib_id;
+       u32 fib_index = ~0;
+       int rv = 0;
+
+    memcpy(collector.data, mp->collector_address, sizeof(collector.data));
+    collector_port = ntohs(mp->collector_port);
+    if (collector_port == (u16)~0)
+        collector_port = UDP_DST_PORT_ipfix;
+       memcpy(src.data, mp->src_address, sizeof(src.data));
+       fib_id = ntohl(mp->vrf_id);
+
+    ip4_main_t * im = &ip4_main;
+    uword * p = hash_get (im->fib_index_by_table_id, fib_id);
+    if (! p) {
+        rv = VNET_API_ERROR_NO_SUCH_FIB;
+        goto out;
+    }
+    fib_index = p[0];
+
+    path_mtu = ntohl(mp->path_mtu);
+    if (path_mtu == ~0)
+        path_mtu = 512; // RFC 7011 section 10.3.3.
+    template_interval = ntohl(mp->template_interval);
+    if (template_interval == ~0)
+        template_interval = 20;
+
+    if (collector.as_u32 == 0) {
+        rv = VNET_API_ERROR_INVALID_VALUE;
+        goto out;
+    }
+
+    if (src.as_u32 == 0) {
+        rv = VNET_API_ERROR_INVALID_VALUE;
+        goto out;
+    }
+
+    if (path_mtu > 1450 /* vpp does not support fragmentation */) {
+        rv = VNET_API_ERROR_INVALID_VALUE;
+        goto out;
+    }
+
+    if (path_mtu < 68) {
+        rv = VNET_API_ERROR_INVALID_VALUE;
+        goto out;
+    }
+
+    /* Reset report streams if we are reconfiguring IP addresses */
+    if (frm->ipfix_collector.as_u32 != collector.as_u32 ||
+        frm->src_address.as_u32 != src.as_u32 ||
+        frm->collector_port != collector_port)
+            vnet_flow_reports_reset(frm);
+
+    frm->ipfix_collector.as_u32 = collector.as_u32;
+    frm->collector_port = collector_port;
+    frm->src_address.as_u32 = src.as_u32;
+    frm->fib_index = fib_index;
+    frm->path_mtu = path_mtu;
+    frm->template_interval = template_interval;
+
+    /* Turn on the flow reporting process */
+    vlib_process_signal_event (vm, flow_report_process_node.index,
+                               1, 0);
+
+out:
+    REPLY_MACRO(VL_API_IPFIX_ENABLE_REPLY);
+}
+
+static void vl_api_ipfix_dump_t_handler (vl_api_ipfix_dump_t *mp)
+{
+    flow_report_main_t * frm = &flow_report_main;
+    unix_shared_memory_queue_t * q;
+    vl_api_ipfix_details_t *rmp;
+
+    q = vl_api_client_index_to_input_queue (mp->client_index);
+
+    rmp = vl_msg_api_alloc (sizeof (*rmp));
+    memset (rmp, 0, sizeof (*rmp));
+    rmp->_vl_msg_id = ntohs(VL_API_IPFIX_DETAILS);
+    rmp->context = mp->context;
+    memcpy(rmp->collector_address, frm->ipfix_collector.data,
+           sizeof(frm->ipfix_collector.data));
+    rmp->collector_port = htons(frm->collector_port);
+    memcpy(rmp->src_address, frm->src_address.data,
+           sizeof(frm->src_address.data));
+    rmp->fib_index = htonl(frm->fib_index);
+    rmp->path_mtu = htonl(frm->path_mtu);
+    rmp->template_interval = htonl(frm->template_interval);
+
+    vl_msg_api_send_shmem (q, (u8 *)&rmp);
+}
+
 #define BOUNCE_HANDLER(nn)                                              \
 static void vl_api_##nn##_t_handler (                                   \
     vl_api_##nn##_t *mp)                                                \