diff options
| author | luwenpeng <[email protected]> | 2022-12-06 15:01:42 +0800 |
|---|---|---|
| committer | luwenpeng <[email protected]> | 2022-12-23 13:56:19 +0800 |
| commit | c1d9a1ab0f6a0057c93818a6593f2e64e6bda9e5 (patch) | |
| tree | c170044b6fe7fcf4df5f6aea339ff98dcd88acb9 /platform/src/proxy.cpp | |
| parent | 2ee230726563e67fe1abefe807d3b44d7f2ae219 (diff) | |
Decrypted Traffic Steering 回流回注测试通过
Diffstat (limited to 'platform/src/proxy.cpp')
| -rw-r--r-- | platform/src/proxy.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index b43129f..a162e23 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -155,7 +155,7 @@ int tfe_thread_set_affinity(int core_id) return pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); } -int tfe_proxy_fds_accept(struct tfe_proxy * ctx, int fd_downstream, int fd_upstream, struct tfe_cmsg * cmsg) +int tfe_proxy_fds_accept(struct tfe_proxy *ctx, int fd_downstream, int fd_upstream, int fd_fake_c, int fd_fake_s, struct tfe_cmsg *cmsg) { struct tfe_thread_ctx * worker_thread_ctx = tfe_proxy_thread_ctx_acquire(ctx); struct tfe_stream * stream = tfe_stream_create(ctx, worker_thread_ctx); @@ -203,7 +203,7 @@ int tfe_proxy_fds_accept(struct tfe_proxy * ctx, int fd_downstream, int fd_upstr TFE_LOG_DEBUG(ctx->logger, "%p: fetch tcp options: cmsg's tcp_passthrough: %d, conf's tcp_passthrough: %d, enalbe passthrough: %d", stream, tcp_passthrough, ctx->tcp_all_passthrough, (ctx->tcp_all_passthrough > 0 || tcp_passthrough > 0) ? 1 : 0); - result = tfe_stream_init_by_fds(stream, fd_downstream, fd_upstream); + result = tfe_stream_init_by_fds(stream, fd_downstream, fd_upstream, fd_fake_c, fd_fake_s); if (result < 0) { TFE_LOG_ERROR(ctx->logger, "%p, Fds(downstream = %d, upstream = %d, type = %d) accept failed.", @@ -430,7 +430,13 @@ int tfe_proxy_config(struct tfe_proxy * proxy, const char * profile) MESA_load_profile_int_def(profile, "tcp", "tcp_ttl_upstream", &proxy->tcp_options.tcp_ttl_upstream, -1); MESA_load_profile_int_def(profile, "tcp", "tcp_ttl_downstream", &proxy->tcp_options.tcp_ttl_downstream, -1); - return 0; + MESA_load_profile_int_def(profile, "traffic_steering", "enable", &proxy->traffic_steering_options.enable, 0); + MESA_load_profile_int_def(profile, "traffic_steering", "so_mask_client", &proxy->traffic_steering_options.so_mask_client, 0x11); + MESA_load_profile_int_def(profile, "traffic_steering", "so_mask_server", &proxy->traffic_steering_options.so_mask_server, 0x22); + MESA_load_profile_string_def(profile, "traffic_steering", "device_client", proxy->traffic_steering_options.device_client, sizeof(proxy->traffic_steering_options.device_client), "eth_client"); + MESA_load_profile_string_def(profile, "traffic_steering", "device_server", proxy->traffic_steering_options.device_server, sizeof(proxy->traffic_steering_options.device_server), "eth_server"); + + return 0; } static const char * __str_stat_spec_map[] = |
