#pragma once #include #include #include struct ssl_mgr; struct key_keeper; struct kni_acceptor; struct tfe_proxy { char name[TFE_SYMBOL_MAX]; struct event_base * evbase; struct event * sev[8]; struct event * gcev; void * logger; unsigned int nr_work_threads; struct tfe_thread_ctx * work_threads[TFE_THREAD_MAX]; unsigned int nr_modules; struct tfe_plugin * modules; struct ssl_mgr * ssl_mgr_handler; struct key_keeper * key_keeper_handler; struct kni_acceptor * kni_acceptor_handler; unsigned int tcp_all_passthrough; }; struct tfe_proxy_accept_para { /* Both upstream and downstream FDs */ evutil_socket_t upstream_fd; evutil_socket_t downstream_fd; /* Session Type */ bool is_set_session_type; enum tfe_session_proto session_type; bool passthrough; }; struct tfe_thread_ctx * tfe_proxy_thread_ctx_acquire(struct tfe_proxy * ctx); void tfe_proxy_thread_ctx_release(struct tfe_thread_ctx * thread_ctx); struct tfe_proxy * tfe_proxy_new(const char * profile); int tfe_proxy_fds_accept(struct tfe_proxy * ctx, const struct tfe_proxy_accept_para * para); void tfe_proxy_run(struct tfe_proxy * proxy);