aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin/src/faces')
-rw-r--r--hicn-plugin/src/faces/app/face_app_cli.c1
-rw-r--r--hicn-plugin/src/faces/app/face_prod.c4
-rw-r--r--hicn-plugin/src/faces/face.h47
-rw-r--r--hicn-plugin/src/faces/iface_node.c25
-rw-r--r--hicn-plugin/src/faces/iface_node.h20
5 files changed, 30 insertions, 67 deletions
diff --git a/hicn-plugin/src/faces/app/face_app_cli.c b/hicn-plugin/src/faces/app/face_app_cli.c
index 0c00eb28d..50e6ae71b 100644
--- a/hicn-plugin/src/faces/app/face_app_cli.c
+++ b/hicn-plugin/src/faces/app/face_app_cli.c
@@ -17,6 +17,7 @@
#include <vnet/dpo/dpo.h>
#include <vlib/vlib.h>
#include <vnet/ip/ip6_packet.h>
+#include <vnet/ip/format.h>
#include "../../params.h"
#include "../face.h"
diff --git a/hicn-plugin/src/faces/app/face_prod.c b/hicn-plugin/src/faces/app/face_prod.c
index 54fbd418a..4b7a5a2f6 100644
--- a/hicn-plugin/src/faces/app/face_prod.c
+++ b/hicn-plugin/src/faces/app/face_prod.c
@@ -263,7 +263,7 @@ hicn_face_prod_add (fib_prefix_t *prefix, u32 sw_if, u32 *cs_reserved,
}
u32 fib_index = fib_table_find (prefix->fp_proto, 0);
- fib_table_entry_path_add2 (fib_index, prefix, FIB_SOURCE_CLI,
+ fib_table_entry_path_add2 (fib_index, prefix, FIB_SOURCE_API,
FIB_ENTRY_FLAG_NONE, rpaths);
HICN_DEBUG ("Calling hicn enable for producer face");
@@ -322,7 +322,7 @@ hicn_face_prod_del (hicn_face_id_t face_id)
}
/* Also remove it from main fib, as we sre the owners of this prefix */
u32 fib_index = fib_table_find (prefix->fp_proto, 0);
- fib_table_entry_special_remove (fib_index, prefix, FIB_SOURCE_CLI);
+ fib_table_entry_special_remove (fib_index, prefix, FIB_SOURCE_API);
ret = hicn_app_state_del (face->sw_if);
if (ret)
{
diff --git a/hicn-plugin/src/faces/face.h b/hicn-plugin/src/faces/face.h
index 5ebec216c..99e3071af 100644
--- a/hicn-plugin/src/faces/face.h
+++ b/hicn-plugin/src/faces/face.h
@@ -29,7 +29,6 @@
#include "face_flags.h"
#include "../hicn_buffer_flags.h"
-#include "../udp_tunnels/udp_tunnel.h"
#include "../hicn_logging.h"
typedef u8 hicn_face_flags_t;
@@ -88,7 +87,7 @@ typedef struct __attribute__ ((packed)) hicn_face_s
hicn_face_flags_t flags;
/* Align the upcoming fields */
- u8 align;
+ u8 iface_next;
/* Path label (2B) */
u16 pl_id;
@@ -482,7 +481,7 @@ hicn_iface_add (const ip46_address_t *nat_address, int sw_if,
hicn_face_key_t key;
hicn_face_get_key (nat_address, sw_if, &face->dpo, &key);
- face->dpo.dpoi_next_node = 1;
+ face->iface_next = 1;
face->pl_id = pl_index++;
face->flags = HICN_FACE_FLAGS_IFACE;
@@ -554,26 +553,7 @@ hicn_face_ip4_add_and_lock (hicn_face_id_t *index, u8 *hicnb_flags,
face = hicn_dpoi_get_from_idx (idx);
- if (*hicnb_flags & HICN_BUFFER_FLAGS_FROM_UDP6_TUNNEL &&
- adj_index != ADJ_INDEX_INVALID)
- {
- face->dpo.dpoi_type = dpo_type_udp_ip6;
- face->dpo.dpoi_proto = DPO_PROTO_IP6;
- }
- else if (*hicnb_flags & HICN_BUFFER_FLAGS_FROM_UDP4_TUNNEL &&
- adj_index != ADJ_INDEX_INVALID)
- {
- face->dpo.dpoi_type = dpo_type_udp_ip4;
- face->dpo.dpoi_proto = DPO_PROTO_IP4;
- }
- else
- {
- face->dpo.dpoi_type = DPO_FIRST;
- face->dpo.dpoi_proto = DPO_PROTO_IP6;
- }
-
- face->dpo.dpoi_index = adj_index;
- face->dpo.dpoi_next_node = node_index;
+ face->iface_next = node_index;
/* if (nat_addr->as_u32 == 0) */
/* { */
@@ -652,26 +632,7 @@ hicn_face_ip6_add_and_lock (hicn_face_id_t *index, u8 *hicnb_flags,
adj_index, face_flags);
face = hicn_dpoi_get_from_idx (idx);
-
- if (*hicnb_flags & HICN_BUFFER_FLAGS_FROM_UDP6_TUNNEL &&
- adj_index != ADJ_INDEX_INVALID)
- {
- face->dpo.dpoi_type = dpo_type_udp_ip6;
- face->dpo.dpoi_proto = DPO_PROTO_IP6;
- }
- else if (*hicnb_flags & HICN_BUFFER_FLAGS_FROM_UDP4_TUNNEL &&
- adj_index != ADJ_INDEX_INVALID)
- {
- face->dpo.dpoi_type = dpo_type_udp_ip4;
- face->dpo.dpoi_proto = DPO_PROTO_IP4;
- }
- else
- {
- face->dpo.dpoi_type = DPO_FIRST;
- face->dpo.dpoi_proto = DPO_PROTO_IP6;
- }
- face->dpo.dpoi_index = adj_index;
- face->dpo.dpoi_next_node = node_index;
+ face->iface_next = node_index;
adj_nbr_walk (face->sw_if, FIB_PROTOCOL_IP6, hicn6_iface_adj_walk_cb,
face);
diff --git a/hicn-plugin/src/faces/iface_node.c b/hicn-plugin/src/faces/iface_node.c
index edfd2cd63..fba7e97e6 100644
--- a/hicn-plugin/src/faces/iface_node.c
+++ b/hicn-plugin/src/faces/iface_node.c
@@ -20,6 +20,7 @@
#include "../infra.h"
#include "../cache_policies/cs_lru.h"
#include "../parser.h"
+#include "iface_node.h"
#include <hicn/error.h>
#include <hicn/util/ip_address.h>
@@ -126,16 +127,6 @@ typedef struct
u8 packet_data[60];
} hicn4_iface_output_trace_t;
-typedef enum
-{
- HICN4_IFACE_OUTPUT_NEXT_DROP,
- HICN4_IFACE_OUTPUT_NEXT_LOOKUP,
- HICN4_IFACE_OUTPUT_NEXT_UDP4_ENCAP,
- HICN4_IFACE_OUTPUT_NEXT_UDP6_ENCAP,
- HICN4_IFACE_OUTPUT_NEXT_PG,
- HICN4_IFACE_OUTPUT_N_NEXT,
-} hicn4_iface_output_next_t;
-
/* Trace context struct */
typedef struct
{
@@ -145,16 +136,6 @@ typedef struct
u8 packet_data[60];
} hicn6_iface_output_trace_t;
-typedef enum
-{
- HICN6_IFACE_OUTPUT_NEXT_DROP,
- HICN6_IFACE_OUTPUT_NEXT_LOOKUP,
- HICN6_IFACE_OUTPUT_NEXT_UDP4_ENCAP,
- HICN6_IFACE_OUTPUT_NEXT_UDP6_ENCAP,
- HICN6_IFACE_OUTPUT_NEXT_PG,
- HICN6_IFACE_OUTPUT_N_NEXT,
-} hicn6_iface_output_next_t;
-
//#define ERROR_OUTPUT_IP4 HICN4_IFACE_OUTPUT_NEXT_ERROR_DROP
//#define ERROR_OUTPUT_IP6 HICN6_IFACE_OUTPUT_NEXT_ERROR_DROP
@@ -667,7 +648,7 @@ hicn_rewrite_iface_data4 (vlib_main_t *vm, vlib_buffer_t *b0,
ip0->ttl = 254; // FIXME TTL
vnet_buffer (b0)->ip.adj_index[VLIB_TX] = iface->dpo.dpoi_index;
- *next = iface->dpo.dpoi_next_node;
+ *next = iface->iface_next;
hicn_packet_buffer_t *pkbuf = &hicn_get_buffer (b0)->pkbuf;
@@ -706,7 +687,7 @@ hicn_rewrite_iface_data6 (vlib_main_t *vm, vlib_buffer_t *b0,
ip0->hop_limit = HICN_IP6_HOP_LIMIT;
vnet_buffer (b0)->ip.adj_index[VLIB_TX] = iface->dpo.dpoi_index;
- *next = iface->dpo.dpoi_next_node;
+ *next = iface->iface_next;
hicn_packet_buffer_t *pkbuf = &hicn_get_buffer (b0)->pkbuf;
diff --git a/hicn-plugin/src/faces/iface_node.h b/hicn-plugin/src/faces/iface_node.h
index 3fa6bb484..d580c9e31 100644
--- a/hicn-plugin/src/faces/iface_node.h
+++ b/hicn-plugin/src/faces/iface_node.h
@@ -37,6 +37,26 @@
* one implementing the tunnel encapsulation (udp-encap, mpls, etc).
*/
+typedef enum
+{
+ HICN4_IFACE_OUTPUT_NEXT_DROP,
+ HICN4_IFACE_OUTPUT_NEXT_LOOKUP,
+ HICN4_IFACE_OUTPUT_NEXT_UDP4_ENCAP,
+ HICN4_IFACE_OUTPUT_NEXT_UDP6_ENCAP,
+ HICN4_IFACE_OUTPUT_NEXT_PG,
+ HICN4_IFACE_OUTPUT_N_NEXT,
+} hicn4_iface_output_next_t;
+
+typedef enum
+{
+ HICN6_IFACE_OUTPUT_NEXT_DROP,
+ HICN6_IFACE_OUTPUT_NEXT_LOOKUP,
+ HICN6_IFACE_OUTPUT_NEXT_UDP4_ENCAP,
+ HICN6_IFACE_OUTPUT_NEXT_UDP6_ENCAP,
+ HICN6_IFACE_OUTPUT_NEXT_PG,
+ HICN6_IFACE_OUTPUT_N_NEXT,
+} hicn6_iface_output_next_t;
+
/**
* @brief Initialize the ip iface module
*/