diff options
author | Florin Coras <fcoras@cisco.com> | 2017-10-17 00:03:13 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-10-28 19:56:39 +0000 |
commit | 1c7104514cd40d2377caca36cf40c13b791bc5aa (patch) | |
tree | 2b95bb11dd8658e826ad8cb3fe4d399adbab7e01 /src/vpp | |
parent | ae5a02f8235b9a243df09b42e932ae5f238e366b (diff) |
session: rules tables
This introduces 5-tuple lookup tables that may be used to implement
custom session layer actions at connection establishment time (session
layer perspective).
The rules table build mask-match-action lookup trees that for a given
5-tuple key return the action for the first longest match. If rules
overlap, ordering is established by tuple longest match with the
following descending priority: remote ip, local ip, remote port, local
port.
At this time, the only match action supported is to forward packets to
the application identified by the action.
Change-Id: Icbade6fac720fa3979820d50cd7d6137f8b635c3
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vpp')
-rw-r--r-- | src/vpp/api/custom_dump.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/vpp/api/custom_dump.c b/src/vpp/api/custom_dump.c index e5392fe4c5d..27085d940bb 100644 --- a/src/vpp/api/custom_dump.c +++ b/src/vpp/api/custom_dump.c @@ -3209,6 +3209,27 @@ static void *vl_api_dns_resolve_ip_t_print FINISH; } +static void *vl_api_session_rule_add_del_t_print + (vl_api_session_rule_add_del_t * mp, void *handle) +{ + u8 *s; + char *proto = mp->transport_proto == 0 ? "tcp" : "udp"; + s = format (0, "SCRIPT: session_rule_add_del "); + if (mp->is_ip4) + s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u", + mp->appns_index, mp->scope, proto, format_ip4_address, + (ip4_address_t *) mp->lcl_ip, mp->lcl_plen, + format_ip4_address, (ip4_address_t *) mp->rmt_ip, + mp->rmt_plen, mp->action_index); + else + s = format (s, "appns %d scope %d %s %U/%d %d %U/%d %d action %u", + mp->appns_index, mp->scope, proto, format_ip6_address, + (ip6_address_t *) mp->lcl_ip, mp->lcl_plen, + format_ip6_address, (ip6_address_t *) mp->rmt_ip, + mp->rmt_plen, mp->action_index); + FINISH; +} + #define foreach_custom_print_no_arg_function \ _(lisp_eid_table_vni_dump) \ _(lisp_map_resolver_dump) \ @@ -3405,7 +3426,8 @@ _(SW_INTERFACE_SET_LLDP, sw_interface_set_lldp) \ _(DNS_ENABLE_DISABLE, dns_enable_disable) \ _(DNS_NAME_SERVER_ADD_DEL, dns_name_server_add_del) \ _(DNS_RESOLVE_NAME, dns_resolve_name) \ -_(DNS_RESOLVE_IP, dns_resolve_ip) +_(DNS_RESOLVE_IP, dns_resolve_ip) \ +_(SESSION_RULE_ADD_DEL, session_rule_add_del) void vl_msg_api_custom_dump_configure (api_main_t * am) { |