diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2019-07-17 11:02:20 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-07-19 15:40:02 +0000 |
commit | 8ac1d6d05f2a0d6759284d4eeb5079644a5c8c86 (patch) | |
tree | f5105f805c0c7e1ee57fe8ade14f9292bda253ec /src/vnet/session | |
parent | 4f74e9ef34d2bf22c70b78f91613cfd43f9a7bd4 (diff) |
session: Use parent_handle instead of transport_opts
Type: feature
This is mostly used for quic in the case of a stream
creation (i.e. connect on an already established QUIC
session). We want do default parent_handle to INVALID
to be able to distinguish it from parent_handle = 0
Change-Id: Id5ac0b0155a3c44e51334231b711e4fd87a96a10
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/application_interface.c | 3 | ||||
-rw-r--r-- | src/vnet/session/session.api | 4 | ||||
-rwxr-xr-x | src/vnet/session/session_api.c | 2 | ||||
-rw-r--r-- | src/vnet/session/session_types.h | 3 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/session/application_interface.c b/src/vnet/session/application_interface.c index ab011bda1b9..a6d1a029f13 100644 --- a/src/vnet/session/application_interface.c +++ b/src/vnet/session/application_interface.c @@ -79,10 +79,9 @@ unformat_vnet_uri (unformat_input_t * input, va_list * args) return 1; } else if (unformat (input, "%U://session/%lu", unformat_transport_proto, - &transport_proto, &sep->transport_opts)) + &transport_proto, &sep->parent_handle)) { sep->transport_proto = transport_proto; - sep->is_ip4 = 1; sep->ip.ip4.as_u32 = 1; /* ip need to be non zero in vnet */ return 1; } diff --git a/src/vnet/session/session.api b/src/vnet/session/session.api index 53d05dfe426..533f65e85a2 100644 --- a/src/vnet/session/session.api +++ b/src/vnet/session/session.api @@ -250,7 +250,7 @@ autoreply define unbind_sock { @param hostname-len - length of hostname @param hostname - destination's hostname. If present, used by protocols like tls. - @param transport_opts - transport option (e.g. session id for quic). + @param parent_handle - handle of parent session (e.g. for opening quic streams). */ autoreply define connect_sock { u32 client_index; @@ -265,7 +265,7 @@ autoreply define connect_sock { u8 proto; u8 hostname_len; u8 hostname[hostname_len]; - u64 transport_opts; + u64 parent_handle; }; /** \brief ask app to add a new cut-through registration diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c index e8550d6c2a8..479c5d1ca83 100755 --- a/src/vnet/session/session_api.c +++ b/src/vnet/session/session_api.c @@ -889,7 +889,7 @@ vl_api_connect_sock_t_handler (vl_api_connect_sock_t * mp) a->sep.transport_proto = mp->proto; a->sep.peer.fib_index = mp->vrf; a->sep.peer.sw_if_index = ENDPOINT_INVALID_INDEX; - a->sep_ext.transport_opts = mp->transport_opts; + a->sep_ext.parent_handle = mp->parent_handle; if (mp->hostname_len) { vec_validate (a->sep_ext.hostname, mp->hostname_len - 1); diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h index 1c03aa25672..682094c9cb6 100644 --- a/src/vnet/session/session_types.h +++ b/src/vnet/session/session_types.h @@ -43,7 +43,7 @@ typedef struct _session_endpoint_cfg u32 ns_index; u8 original_tp; u8 *hostname; - u64 transport_opts; + u64 parent_handle; } session_endpoint_cfg_t; #define SESSION_IP46_ZERO \ @@ -83,6 +83,7 @@ typedef struct _session_endpoint_cfg .app_wrk_index = ENDPOINT_INVALID_INDEX, \ .opaque = ENDPOINT_INVALID_INDEX, \ .hostname = 0, \ + .parent_handle = SESSION_INVALID_HANDLE \ } #define session_endpoint_to_transport(_sep) ((transport_endpoint_t *)_sep) |