#include <vnet/ipsec/ipsec.h>
+#if IPSEC > 0
#define foreach_ipsec_output_next \
_(DROP, "error-drop") \
#undef _
};
-vlib_node_registration_t ipsec_output_node;
+static vlib_node_registration_t ipsec_output_node;
typedef struct {
u32 spd_id;
always_inline ipsec_policy_t *
ipsec_output_ip6_policy_match (ipsec_spd_t * spd,
- ip6_address_t * sa,
- ip6_address_t * da,
+ ip6_address_t * la,
+ ip6_address_t * ra,
u16 lp,
u16 rp,
u8 pr)
if (PREDICT_FALSE(p->protocol && (p->protocol != pr)))
continue;
- if (!ip6_addr_match_range(sa, &p->raddr.start.ip6, &p->raddr.stop.ip6))
+ if (!ip6_addr_match_range(ra, &p->raddr.start.ip6, &p->raddr.stop.ip6))
continue;
- if (!ip6_addr_match_range(da, &p->laddr.start.ip6, &p->laddr.stop.ip6))
+ if (!ip6_addr_match_range(la, &p->laddr.start.ip6, &p->laddr.stop.ip6))
continue;
if (PREDICT_FALSE((pr != IP_PROTOCOL_TCP) && (pr != IP_PROTOCOL_UDP)))
return from_frame->n_vectors;
}
-VLIB_REGISTER_NODE (ipsec_output_node) = {
+VLIB_REGISTER_NODE (ipsec_output_node,static) = {
.function = ipsec_output_node_fn,
.name = "ipsec-output",
.vector_size = sizeof (u32),
#undef _
},
};
+
+VLIB_NODE_FUNCTION_MULTIARCH (ipsec_output_node, ipsec_output_node_fn)
+
+#else /* IPSEC > 1 */
+
+/* Dummy ipsec output node, in case when IPSec is disabled */
+
+static uword
+ipsec_output_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
+{
+ clib_warning ("IPSec disabled");
+ return 0;
+}
+
+VLIB_REGISTER_NODE (ipsec_output_node) = {
+ .vector_size = sizeof (u32),
+ .function = ipsec_output_node_fn,
+ .name = "ipsec-output",
+};
+#endif