/* * Copyright (c) 2017-2019 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SRC_VNET_SESSION_APPLICATION_H_ #define SRC_VNET_SESSION_APPLICATION_H_ #include #include #include #include #define APP_DEBUG 0 #if APP_DEBUG > 0 #define APP_DBG(_fmt, _args...) clib_warning (_fmt, ##_args) #else #define APP_DBG(_fmt, _args...) #endif typedef struct app_wrk_postponed_msg_ { u32 len; u8 event_type; u8 ring; u8 is_sapi; int fd; u8 data[SESSION_CTRL_MSG_TX_MAX_SIZE]; } app_wrk_postponed_msg_t; typedef struct app_worker_ { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); /** Worker index in global worker pool*/ u32 wrk_index; /** Worker index in app's map pool */ u32 wrk_map_index; /** Index of owning app */ u32 app_index; /** Application listens for events on this svm queue */ svm_msg_q_t *event_queue; /** * Segment manager used for outgoing connects issued by the app. By * convention this is the first segment manager allocated by the worker * so it's also the one that holds the first segment with the app's * message queue in it. */ u32 connects_seg_manager; /** Lookup tables for listeners. Value is segment manager index */ uword *listeners_table; /** API index for the worker. Needed for multi-process apps */ u32 api_client_index; /** Set if mq is congested */ u8 mq_congested; u8 app_is_builtin; /** Pool of half-open session handles. Tracked in case worker detaches */ session_handle_t *half_open_table; /** Protects detached seg managers */ clib_spinlock_t detached_seg_managers_lock; /** Vector of detached listener segment managers */ u32 *detached_seg_managers; /** Fifo of messages postponed because of mq congestion */ app_wrk_postponed_msg_t *postponed_mq_msgs; /** Lock to add/sub message from ref @postponed_mq_msgs */ clib_spinlock_t postponed_mq_msgs_lock; } app_worker_t; typedef struct app_worker_map_ { u32 wrk_index; } app_worker_map_t; typedef struct app_listener_ { clib_bitmap_t *workers; /**< workers accepting connections */ u32 accept_rotor; /**< last worker to accept a connection */ u32 al_index; /**< app listener index in app pool */ u32 app_index; /**< owning app index */ u32 local_index; /**< local listening session index */ u32 session_index; /**< global listening session index */ session_handle_t ls_handle; /**< session handle of the local or global listening session that also identifies the app listener */ } app_listener_t; typedef enum app_rx_mq_flags_ { APP_RX_MQ_F_PENDING = 1 << 0, APP_RX_MQ_F_POSTPONED = 1 << 1, } app_rx_mq_flags_t; typedef struct app_rx_mq_elt_ { struct app_rx_mq_elt_ *next; struct app_rx_mq_elt_ *prev; svm_msg_q_t *mq; uword file_index; u32 app_index; u8 flags; } app_rx_mq_elt_t; typedef struct application_ { /** App index in app pool */ u32 app_index; /** Flags */ u32 flags; /** Callbacks: shoulder-taps for the server/client */ session_cb_vft_t cb_fns; /** Segment manager properties. Shared by all segment managers */ segment_manager_props_t sm_properties; /** Pool of mappings that keep track of workers associated to this app */ app_worker_map_t *worker_maps; /** Name registered by builtin apps */ u8 *name; /** Namespace the application belongs to */ u32 ns_index; u16 proxied_transports; /** Pool of listeners for the app */ app_listener_t *listeners; /** Preferred tls engine */ u8 tls_engine; /** quic initialization vector */ char quic_iv[17]; u8 quic_iv_set; /** Segment where rx mqs were allocated */ fifo_segment_t rx_mqs_segment; /** * Fixed vector of rx mqs that can be a part of pending_rx_mqs * linked list maintained by the app sublayer for each worker */ app_rx_mq_elt_t *rx_mqs; } application_t; typedef struct app_rx_mq_handle_ { union { struct { u32 app_index; u32 thread_index; }; u64 as_u64; }; } __attribute__ ((aligned (sizeof (u64)))) app_rx_mq_handle_t; /** * App sublayer per vpp worker state */ typedef struct asl_wrk_ { /** Linked list of mqs with pending messages */ app_rx_mq_elt_t *pending_rx_mqs; } appsl_wrk_t; typedef struct app_main_ { /** * Pool from which we allocate all applications */ application_t *app_pool; /** * Hash table of apps by api client index */
/*
 * Copyright (c) 2016 Cisco and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.fd.vpp.jvpp.dto;

/**
* Base interface for all notification DTOs
*/
public interface JVppNotification {
}
u8 *format_crypto_engine (u8 * s, va_list * args); u8 *format_crypto_context (u8 * s, va_list * args); void app_worker_format_connects (app_worker_t * app_wrk, int verbose); int vnet_app_worker_add_del (vnet_app_worker_add_del_args_t * a); uword unformat_application_proto (unformat_input_t * input, va_list * args); app_cert_key_pair_t *app_cert_key_pair_get (u32 index); app_cert_key_pair_t *app_cert_key_pair_get_if_valid (u32 index); app_cert_key_pair_t *app_cert_key_pair_get_default (); /* Needed while we support both bapi and mq ctrl messages */ int mq_send_session_bound_cb (u32 app_wrk_index, u32 api_context, session_handle_t handle, int rv); int mq_send_session_connected_cb (u32 app_wrk_index, u32 api_context, session_t * s, session_error_t err); void mq_send_unlisten_reply (app_worker_t * app_wrk, session_handle_t sh, u32 context, int rv); void sapi_socket_close_w_handle (u32 api_handle); crypto_engine_type_t app_crypto_engine_type_add (void); u8 app_crypto_engine_n_types (void); #endif /* SRC_VNET_SESSION_APPLICATION_H_ */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */