-stream_session_t *
-session_lookup_global_session_endpoint (session_endpoint_t * sep)
-{
- session_table_t *st;
- session_kv4_t kv4;
- session_kv6_t kv6;
- ip4_address_t lcl4;
- ip6_address_t lcl6;
- u8 fib_proto;
- u32 table_index;
- int rv;
-
- fib_proto = session_endpoint_fib_proto (sep);
- table_index = session_lookup_get_index_for_fib (fib_proto, sep->fib_index);
- st = session_table_get (table_index);
- if (!st)
- return 0;
- if (sep->is_ip4)
- {
- make_v4_listener_kv (&kv4, &sep->ip.ip4, sep->port,
- sep->transport_proto);
- rv = clib_bihash_search_inline_16_8 (&st->v4_session_hash, &kv4);
- if (rv == 0)
- return session_get_from_handle (kv4.value);
- memset (&lcl4, 0, sizeof (lcl4));
- return session_lookup_rules_table4 (&st->session_rules,
- sep->transport_proto, &lcl4, 0,
- &sep->ip.ip4, sep->port);
- }
- else
- {
- make_v6_listener_kv (&kv6, &sep->ip.ip6, sep->port,
- sep->transport_proto);
- rv = clib_bihash_search_inline_48_8 (&st->v6_session_hash, &kv6);
- if (rv == 0)
- return session_get_from_handle (kv6.value);
- memset (&lcl6, 0, sizeof (lcl6));
- return session_lookup_rules_table6 (&st->session_rules,
- sep->transport_proto, &lcl6, 0,
- &sep->ip.ip6, sep->port);
- }
-}
-
-u32
-session_lookup_local_session_endpoint (u32 table_index,
- session_endpoint_t * sep)
+/**
+ * Look up endpoint in local session table
+ *
+ * The result, for now, is an application index and it may in the future
+ * be extended to a more complicated "action object". The only action we
+ * emulate now is "drop" and for that we return a special app index.
+ *
+ * Lookup logic is to check in order:
+ * - the rules in the table (connect acls)
+ * - session sub-table for a listener
+ * - session sub-table for a local listener (zeroed addr)
+ *
+ * @param table_index table where the lookup should be done
+ * @param sep session endpoint to be looked up
+ * @return session handle that can be interpreted as an adjacency
+ */
+u64
+session_lookup_local_endpoint (u32 table_index, session_endpoint_t * sep)