diff options
author | Florin Coras <fcoras@cisco.com> | 2017-10-31 01:51:04 -0700 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-11-01 09:29:25 +0000 |
commit | 7999e83a41ebad8a3f02cfcb2809cdb3aae919ba (patch) | |
tree | 58d7c95c87c3bb27bbeb045e22b4c6967defccc3 /src/vnet/session/application.h | |
parent | df36f2176d7e90dcd3e895b08ee2d69f42d15426 (diff) |
session: add support for proxying apps
To enable this, applications set the proxy flag in their attach requests
and pass the transport protocols they want to act as proxies for as part
of the attach options.
When proxy is enabled, session rules that point incoming packets to the
proxy app are addedd to the local and global session tables, if these
scopes are accessible to the app. In particular, in case of the former,
the rule accepts packets from all sources and all ports destined to the
namespace's supporting interface address on any port. While in case of
the latter, a generic any destination and any port rule is addedd.
Change-Id: I791f8c1cc083350f02e26a2ac3bdbbfbfa19ece3
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application.h')
-rw-r--r-- | src/vnet/session/application.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h index b05e1e17b4f..b9852131fae 100644 --- a/src/vnet/session/application.h +++ b/src/vnet/session/application.h @@ -88,14 +88,18 @@ typedef struct _application /** Lookup tables for listeners. Value is segment manager index */ uword *listeners_table; - /** First segment manager has in the the first segment the application's + /** + * First segment manager has in the the first segment the application's * event fifo. Depending on what the app does, it may be either used for - * a listener or for connects. */ + * a listener or for connects. + */ u32 first_segment_manager; u8 first_segment_manager_in_use; /** Segment manager properties. Shared by all segment managers */ segment_manager_properties_t sm_properties; + + u16 proxied_transports; } application_t; #define APP_INVALID_INDEX ((u32)~0) @@ -125,6 +129,8 @@ segment_manager_t *application_get_listen_segment_manager (application_t * segment_manager_t *application_get_connect_segment_manager (application_t * app); int application_is_proxy (application_t * app); +int application_is_builtin (application_t * app); +int application_is_builtin_proxy (application_t * app); int application_add_segment_notify (u32 app_index, u32 fifo_segment_index); u32 application_session_table (application_t * app, u8 fib_proto); u32 application_local_session_table (application_t * app); @@ -133,7 +139,12 @@ u8 *application_name_from_index (u32 app_index); u8 application_has_local_scope (application_t * app); u8 application_has_global_scope (application_t * app); u32 application_n_listeners (application_t * app); -stream_session_t *application_first_listener (application_t * app); +stream_session_t *application_first_listener (application_t * app, + u8 fib_proto, + u8 transport_proto); +void application_setup_proxy (application_t * app); +void application_remove_proxy (application_t * app); + #endif /* SRC_VNET_SESSION_APPLICATION_H_ */ /* |