+ if (~0 == gm->gbp_acl_user_id)
+ {
+ acl_plugin_exports_init (&gm->acl_plugin);
+ gm->gbp_acl_user_id =
+ gm->acl_plugin.register_user_module ("GBP ACL", "src-epg", "dst-epg");
+ }
+
+ p = hash_get (gbp_contract_db.gc_hash, key.as_u64);
+ if (p != NULL)
+ {
+ value.as_u64 = p[0];
+ }
+ else
+ {
+ value.gc_lc_index =
+ gm->acl_plugin.get_lookup_context_index (gm->gbp_acl_user_id, src_epg,
+ dst_epg);
+ value.gc_acl_index = acl_index;
+ hash_set (gbp_contract_db.gc_hash, key.as_u64, value.as_u64);
+ }
+
+ if (value.gc_lc_index == ~0)
+ return;
+ vec_add1 (acl_vec, acl_index);
+ gm->acl_plugin.set_acl_vec_for_context (value.gc_lc_index, acl_vec);
+ vec_free (acl_vec);