summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2017-05-03 10:12:44 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-05-04 07:26:08 +0000
commitcf121c8313187819245e45f11fb49ba1e1ea53ef (patch)
tree0757f00f4d5750eab5721bacc7dcf6c266d98e47 /src/vnet
parent342089672d7bbbd10066b725345b466d62846f19 (diff)
LISP: group mapping records in map-register message
Change-Id: I546c761acfbf880717163a035aa691b04337b7bf Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/lisp-cp/control.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/vnet/lisp-cp/control.c b/src/vnet/lisp-cp/control.c
index c0093301307..ddaa6f508dc 100644
--- a/src/vnet/lisp-cp/control.c
+++ b/src/vnet/lisp-cp/control.c
@@ -2454,7 +2454,7 @@ send_map_register (lisp_cp_main_t * lcm, u8 want_map_notif)
u64 nonce = 0;
u32 next_index, *to_next;
ip_address_t *ms = 0;
- mapping_t *records, *r, *g;
+ mapping_t *records, *r, *group, *k;
// TODO: support multiple map servers and do election
if (0 == vec_len (lcm->map_servers))
@@ -2481,12 +2481,25 @@ send_map_register (lisp_cp_main_t * lcm, u8 want_map_notif)
if (!key)
continue; /* no secret key -> map-register cannot be sent */
- g = 0;
- // TODO: group mappings that share common key
- vec_add1 (g, r[0]);
- b = build_map_register (lcm, &sloc, ms, &nonce, want_map_notif, g,
+ group = 0;
+ vec_add1 (group, r[0]);
+
+ /* group mappings that share common key */
+ for (k = r + 1; k < vec_end (records); k++)
+ {
+ if (k->key_id != r->key_id)
+ continue;
+
+ if (vec_is_equal (k->key, r->key))
+ {
+ vec_add1 (group, k[0]);
+ k->key = 0; /* don't process this mapping again */
+ }
+ }
+
+ b = build_map_register (lcm, &sloc, ms, &nonce, want_map_notif, group,
key_id, key, &bi);
- vec_free (g);
+ vec_free (group);
if (!b)
continue;
Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
Test Framework Documentation    {#test_framework_doc}
============================

PyDoc generated documentation for the "make test" framework is available for
the following releases:

- [Test framework documentation for VPP 18.10](https://docs.fd.io/vpp/18.10/vpp_make_test/html)
- [Test framework documentation for VPP 18.07](https://docs.fd.io/vpp/18.07/vpp_make_test/html)
- [Test framework documentation for VPP 18.04](https://docs.fd.io/vpp/18.04/vpp_make_test/html)
- [Test framework documentation for VPP 18.01](https://docs.fd.io/vpp/18.01/vpp_make_test/html)
- [Test framework documentation for VPP 17.10](https://docs.fd.io/vpp/17.10/vpp_make_test/html)
- [Test framework documentation for VPP 17.04](https://docs.fd.io/vpp/17.04/vpp_make_test/html)
- [Test framework documentation for VPP 17.01](https://docs.fd.io/vpp/17.01/vpp_make_test/html)