Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
QoS recording and marking
[vpp.git]
/
src
/
vnet
/
map
/
map.h
diff --git
a/src/vnet/map/map.h
b/src/vnet/map/map.h
index
208a58e
..
5700cc1
100644
(file)
--- a/
src/vnet/map/map.h
+++ b/
src/vnet/map/map.h
@@
-35,10
+35,12
@@
int map_add_del_psid (u32 map_domain_index, u16 psid, ip6_address_t * tep,
u8 is_add);
u8 *format_map_trace (u8 * s, va_list * args);
u8 is_add);
u8 *format_map_trace (u8 * s, va_list * args);
-typedef enum
__attribute__ ((__packed__))
+typedef enum
{
{
- MAP_DOMAIN_PREFIX = 1 << 0, MAP_DOMAIN_TRANSLATION = 1 << 1, // The domain uses MAP-T
-} map_domain_flags_e;
+ MAP_DOMAIN_PREFIX = 1 << 0,
+ MAP_DOMAIN_TRANSLATION = 1 << 1, // The domain uses MAP-T
+ MAP_DOMAIN_RFC6052 = 1 << 2,
+} __attribute__ ((__packed__)) map_domain_flags_e;
/**
* IP4 reassembly logic:
/**
* IP4 reassembly logic:
@@
-240,6
+242,8
@@
typedef struct {
bool sec_check_frag; /* Inbound security check for (subsequent) fragments */
bool icmp6_enabled; /* Send destination unreachable for security check failure */
bool sec_check_frag; /* Inbound security check for (subsequent) fragments */
bool icmp6_enabled; /* Send destination unreachable for security check failure */
+ bool is_ce; /* If this MAP node is a Customer Edge router*/
+
/* ICMPv6 -> ICMPv4 relay parameters */
ip4_address_t icmp4_src_address;
vlib_simple_counter_main_t icmp_relayed;
/* ICMPv6 -> ICMPv4 relay parameters */
ip4_address_t icmp4_src_address;
vlib_simple_counter_main_t icmp_relayed;
@@
-329,7
+333,7
@@
typedef struct {
u16 port;
} map_trace_t;
u16 port;
} map_trace_t;
-map_main_t map_main;
+
extern
map_main_t map_main;
extern vlib_node_registration_t ip4_map_node;
extern vlib_node_registration_t ip6_map_node;
extern vlib_node_registration_t ip4_map_node;
extern vlib_node_registration_t ip6_map_node;
@@
-382,6
+386,9
@@
map_get_sfx (map_domain_t *d, u32 addr, u16 port)
if (d->ip6_prefix_len == 128)
return clib_net_to_host_u64(d->ip6_prefix.as_u64[1]);
if (d->ip6_prefix_len == 128)
return clib_net_to_host_u64(d->ip6_prefix.as_u64[1]);
+ if (d->flags & MAP_DOMAIN_RFC6052)
+ return (clib_net_to_host_u64(d->ip6_prefix.as_u64[1]) | addr);
+
/* IPv4 prefix */
if (d->flags & MAP_DOMAIN_PREFIX)
return (u64) (addr & (0xFFFFFFFF << d->suffix_shift)) << 16;
/* IPv4 prefix */
if (d->flags & MAP_DOMAIN_PREFIX)
return (u64) (addr & (0xFFFFFFFF << d->suffix_shift)) << 16;
@@
-398,9
+405,12
@@
map_get_sfx_net (map_domain_t *d, u32 addr, u16 port)
}
static_always_inline u32
}
static_always_inline u32
-map_get_ip4 (ip6_address_t *addr)
+map_get_ip4 (ip6_address_t *addr
, map_domain_flags_e flags
)
{
{
- return clib_host_to_net_u32(clib_net_to_host_u64(addr->as_u64[1]) >> 16);
+ if (flags & MAP_DOMAIN_RFC6052)
+ return clib_host_to_net_u32(clib_net_to_host_u64(addr->as_u64[1]));
+ else
+ return clib_host_to_net_u32(clib_net_to_host_u64(addr->as_u64[1]) >> 16);
}
/*
}
/*
@@
-427,16
+437,19
@@
ip6_map_get_domain (u32 mdi,
{
map_main_t *mm = &map_main;
{
map_main_t *mm = &map_main;
+#ifdef TODO
/*
* Disable direct MAP domain lookup on decap, until the security check is updated to verify IPv4 SA.
* (That's done implicitly when MAP domain is looked up in the IPv4 FIB)
*/
/*
* Disable direct MAP domain lookup on decap, until the security check is updated to verify IPv4 SA.
* (That's done implicitly when MAP domain is looked up in the IPv4 FIB)
*/
-#ifdef MAP_NONSHARED_DOMAIN_ENABLED
-#error "How can you be sure this domain is not shared?"
+ //#ifdef MAP_NONSHARED_DOMAIN_ENABLED
+ //#error "How can you be sure this domain is not shared?"
+#endif
+
*map_domain_index = mdi;
return pool_elt_at_index(mm->domains, mdi);
*map_domain_index = mdi;
return pool_elt_at_index(mm->domains, mdi);
-#endif
+#ifdef TODO
u32 lbi = ip4_fib_forwarding_lookup(0, addr);
const dpo_id_t *dpo = load_balance_get_bucket(lbi, 0);
if (PREDICT_TRUE(dpo->dpoi_type == map_dpo_type ||
u32 lbi = ip4_fib_forwarding_lookup(0, addr);
const dpo_id_t *dpo = load_balance_get_bucket(lbi, 0);
if (PREDICT_TRUE(dpo->dpoi_type == map_dpo_type ||
@@
-447,6
+460,7
@@
ip6_map_get_domain (u32 mdi,
}
*error = MAP_ERROR_NO_DOMAIN;
return NULL;
}
*error = MAP_ERROR_NO_DOMAIN;
return NULL;
+#endif
}
map_ip4_reass_t *
}
map_ip4_reass_t *
@@
-509,10
+523,6
@@
int map_ip6_reass_conf_lifetime(u16 lifetime_ms);
int map_ip6_reass_conf_buffers(u32 buffers);
#define MAP_IP6_REASS_CONF_BUFFERS_MAX (0xffffffff)
int map_ip6_reass_conf_buffers(u32 buffers);
#define MAP_IP6_REASS_CONF_BUFFERS_MAX (0xffffffff)
-
-#define u8_ptr_add(ptr, index) (((u8 *)ptr) + index)
-#define u16_net_add(u, val) clib_host_to_net_u16(clib_net_to_host_u16(u) + (val))
-
static_always_inline void
ip4_map_t_embedded_address (map_domain_t *d,
ip6_address_t *ip6, const ip4_address_t *ip4)
static_always_inline void
ip4_map_t_embedded_address (map_domain_t *d,
ip6_address_t *ip6, const ip4_address_t *ip4)