VPP-81: Print interface name after creating an interface with CLI
[vpp.git] / vnet / vnet / devices / netmap / netmap.h
index 15b14db..6f7791c 100644 (file)
  * SUCH DAMAGE.
  */
 
-#include <stdint.h>
-#include <net/if.h>
-#include <sys/ioctl.h>
-#include <vnet/devices/netmap/net_netmap.h>
-
 typedef struct {
   CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
   u8 * host_if_name;
@@ -95,12 +90,15 @@ netmap_main_t netmap_main;
 extern vnet_device_class_t netmap_device_class;
 extern vlib_node_registration_t netmap_input_node;
 
-int netmap_create_if(vlib_main_t * vm, u8 * host_if_name, u8 * hw_addr_set, u8 is_pipe, u8 is_master);
+int netmap_create_if(vlib_main_t * vm, u8 * host_if_name, u8 * hw_addr_set,
+                     u8 is_pipe, u8 is_master, u32 *sw_if_index);
 int netmap_delete_if(vlib_main_t * vm, u8 * host_if_name);
 
 
 /* Macros and helper functions from sys/net/netmap_user.h */
 
+#ifdef _NET_NETMAP_H_
+
 #define _NETMAP_OFFSET(type, ptr, offset) \
        ((type)(void *)((char *)(ptr) + (offset)))
 
@@ -122,7 +120,7 @@ int netmap_delete_if(vlib_main_t * vm, u8 * host_if_name);
 static inline uint32_t
 nm_ring_next(struct netmap_ring *ring, uint32_t i)
 {
-        return ( unlikely(i + 1 == ring->num_slots) ? 0 : i + 1);
+        return ( PREDICT_FALSE(i + 1 == ring->num_slots) ? 0 : i + 1);
 }
 
 
@@ -144,5 +142,5 @@ nm_ring_space(struct netmap_ring *ring)
                 ret += ring->num_slots;
         return ret;
 }
-
+#endif