aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application_interface.h
AgeCommit message (Expand)AuthorFilesLines
2019-08-01session: session pool migration notificationFlorin Coras1-0/+3
2019-07-17session: grab mq lock until ctrl event is enqueuedFlorin Coras1-2/+1
2019-07-15session: allow transports to generate closed notificationsFlorin Coras1-0/+3
2019-07-09session: notify app of session and transport cleanupFlorin Coras1-0/+3
2019-04-30svm: more fifo refactor/cleanupFlorin Coras1-4/+4
2019-04-25session: cleanup segment manager and fifo segmentFlorin Coras1-1/+1
2019-04-25session: use teps in accept/connect notificationsFlorin Coras1-6/+2
2019-04-24QUIC: Add multi-stream support to internal test appsAloys Augustin1-0/+1
2019-04-16svm_fifo rework to avoid contention on cursizeSirshak Das1-2/+2
2019-03-21session/fifo: make event unset atomicFlorin Coras1-4/+6
2019-03-06session: use session index instead of fifo for evtFlorin Coras1-5/+7
2019-03-06session: use vpp to switch io events for ct sessionsFlorin Coras1-10/+10
2019-03-02session: remove deprecated binary apisFlorin Coras1-1/+0
2019-03-02session: cleanup session event typesFlorin Coras1-2/+2
2019-02-21vcl/session: send unlisten over message queueFlorin Coras1-1/+8
2019-02-11session: cleanup application interfaceFlorin Coras1-9/+46
2019-02-09tls: move test certificates to separate header fileFlorin Coras1-6/+9
2019-02-09session: refactor listen logicFlorin Coras1-5/+5
2019-02-04session: cleanup part 1Florin Coras1-1/+1
2019-01-05vcl/session: add api for changing session app workerFlorin Coras1-13/+35
2018-12-17vcl/session: handle reset/disconnect before app acceptFlorin Coras1-1/+0
2018-11-30vcl: wait for segments with segment handleFlorin Coras1-0/+1
2018-11-30session: segment handle in accept/connect notificationsFlorin Coras1-0/+2
2018-11-18vcl/session: apps with process workersFlorin Coras1-0/+1
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach1-2/+2
2018-10-28session: extend connect api for internal appsFlorin Coras1-2/+2
2018-10-23c11 safe string handling supportDave Barach1-1/+1
2018-09-08session: detect namespace for transport appsFlorin Coras1-0/+1
2018-09-06session: support multiple worker bindsFlorin Coras1-1/+1
2018-08-28vcl/session: use mq for bind repliesFlorin Coras1-0/+16
2018-08-24session: add support for multiple app workersFlorin Coras1-24/+13
2018-08-10vcl: support for eventfd mq signalingFlorin Coras1-1/+23
2018-07-31vcl: add read/write udp supportFlorin Coras1-13/+26
2018-07-27vcl: use events for epoll/select/read/writeFlorin Coras1-13/+12
2018-07-17session: send ctrl msg over mqFlorin Coras1-7/+102
2018-07-17session: use msg queue for eventsFlorin Coras1-16/+67
2018-06-28vcl: move binary api and cfg to separate filesFlorin Coras1-2/+0
2018-06-28vcl: refactor vcl sessionFlorin Coras1-12/+17
2018-05-09session: cleanup session tx functionFlorin Coras1-4/+2
2018-04-18udp/session: refactor to support dgram modeFlorin Coras1-0/+157
2018-03-23session: allow builtin apps to register namesFlorin Coras1-0/+3
2018-03-15tls: add openssl engineFlorin Coras1-0/+2
2018-03-07tls: enforce certificate verificationFlorin Coras1-3/+1
2018-03-02session: first approximation implementation of tlsFlorin Coras1-12/+27
2018-02-14session: support local sessions and deprecate redirectsFlorin Coras1-2/+5
2018-01-25session: add support for memfd segmentsFlorin Coras1-3/+1
2017-12-14session: cleanup attach flagsFlorin Coras1-10/+8
2017-11-01session: add support for proxying appsFlorin Coras1-1/+2
2017-10-16udp: refactor udp codeFlorin Coras1-17/+4
2017-10-10session: add support for application namespacingFlorin Coras1-20/+16
"> * Required for pool_get_aligned */ CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); /** * Linkage into the FIB object graph */ fib_node_t node; /** * The hash table's key stored in separate memory since the tunnel_t * memory can realloc. */ gre_tunnel_key_t *key; /** * The tunnel's source/local address */ ip46_address_t tunnel_src; /** * The tunnel's destination/remote address */ fib_prefix_t tunnel_dst; /** * The FIB in which the src.dst address are present */ u32 outer_fib_index; u32 hw_if_index; u32 sw_if_index; gre_tunnel_type_t type; /** * The FIB entry sourced by the tunnel for its destination prefix */ fib_node_index_t fib_entry_index; /** * The tunnel is a child of the FIB entry for its desintion. This is * so it receives updates when the forwarding information for that entry * changes. * The tunnels sibling index on the FIB entry's dependency list. */ u32 sibling_index; /** * an L2 tunnel always rquires an L2 midchain. cache here for DP. */ adj_index_t l2_adj_index; /** * ERSPAN type 2 session ID, least significant 10 bits of u16 */ u16 session_id; /** * GRE header sequence number (SN) used for ERSPAN type 2 header, must be * bumped automically to be thread safe. As multiple GRE tunnels are created * for the same fib-idx/DIP/SIP with different ERSPAN session number, they all * share the same SN which is kept per FIB/DIP/SIP, as specified by RFC2890. */ gre_sn_t *gre_sn; u32 dev_instance; /* Real device instance in tunnel vector */ u32 user_instance; /* Instance name being shown to user */ } gre_tunnel_t; typedef struct { u8 next_index; u8 tunnel_type; } next_info_t; /** * @brief GRE related global data */ typedef struct { /** * pool of tunnel instances */ gre_tunnel_t *tunnels; /** * GRE payload protocol registrations */ gre_protocol_info_t *protocol_infos; /** * Hash tables mapping name/protocol to protocol info index. */ uword *protocol_info_by_name, *protocol_info_by_protocol; /** * Hash mapping to tunnels with ipv4 src/dst addr */ uword *tunnel_by_key4; /** * Hash mapping to tunnels with ipv6 src/dst addr */ uword *tunnel_by_key6; /** * Hash mapping tunnel src/dst addr and fib-idx to sequence number */ uword *seq_num_by_key; /** * Mapping from sw_if_index to tunnel index */ u32 *tunnel_index_by_sw_if_index; /* Sparse vector mapping gre protocol in network byte order to next index. */ next_info_t *next_by_protocol; /* convenience */ vlib_main_t *vlib_main; vnet_main_t *vnet_main; /* Record used instances */ uword *instance_used; } gre_main_t; /** * @brief IPv4 and GRE header. */ /* *INDENT-OFF* */ typedef CLIB_PACKED (struct { ip4_header_t ip4; gre_header_t gre; }) ip4_and_gre_header_t; /* *INDENT-ON* */ /** * @brief IPv6 and GRE header. */ /* *INDENT-OFF* */ typedef CLIB_PACKED (struct { ip6_header_t ip6; gre_header_t gre; }) ip6_and_gre_header_t; /* *INDENT-ON* */ always_inline gre_protocol_info_t * gre_get_protocol_info (gre_main_t * em, gre_protocol_t protocol) { uword *p = hash_get (em->protocol_info_by_protocol, protocol); return p ? vec_elt_at_index (em->protocol_infos, p[0]) : 0; } extern gre_main_t gre_main; extern clib_error_t *gre_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags); extern void gre_tunnel_stack (adj_index_t ai); extern void gre_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai); format_function_t format_gre_protocol; format_function_t format_gre_header; format_function_t format_gre_header_with_length; extern vlib_node_registration_t gre4_input_node; extern vlib_node_registration_t gre6_input_node; extern vlib_node_registration_t gre_encap_node; extern vnet_device_class_t gre_device_class; /* Parse gre protocol as 0xXXXX or protocol name. In either host or network byte order. */ unformat_function_t unformat_gre_protocol_host_byte_order; unformat_function_t unformat_gre_protocol_net_byte_order; /* Parse gre header. */ unformat_function_t unformat_gre_header; unformat_function_t unformat_pg_gre_header; void gre_register_input_protocol (vlib_main_t * vm, gre_protocol_t protocol, u32 node_index, gre_tunnel_type_t tunnel_type); /* manually added to the interface output node in gre.c */ #define GRE_OUTPUT_NEXT_LOOKUP 1 typedef struct { u8 is_add; u8 tunnel_type; u8 is_ipv6; u32 instance; ip46_address_t src, dst; u32 outer_fib_id; u16 session_id; } vnet_gre_add_del_tunnel_args_t; int vnet_gre_add_del_tunnel (vnet_gre_add_del_tunnel_args_t * a, u32 * sw_if_indexp); static inline void gre_mk_key4 (ip4_address_t src, ip4_address_t dst, u32 fib_index, u8 ttype, u16 session_id, gre_tunnel_key4_t * key) { key->gtk_src = src; key->gtk_dst = dst; key->gtk_fidx_ssid_type = ttype | (fib_index << GTK_FIB_INDEX_SHIFT) | (session_id << GTK_SESSION_ID_SHIFT); } static inline int gre_match_key4 (const gre_tunnel_key4_t * key1, const gre_tunnel_key4_t * key2) { return ((key1->gtk_as_u64 == key2->gtk_as_u64) && (key1->gtk_fidx_ssid_type == key2->gtk_fidx_ssid_type)); } static inline void gre_mk_key6 (const ip6_address_t * src, const ip6_address_t * dst, u32 fib_index, u8 ttype, u16 session_id, gre_tunnel_key6_t * key) { key->gtk_src = *src; key->gtk_dst = *dst; key->gtk_fidx_ssid_type = ttype | (fib_index << GTK_FIB_INDEX_SHIFT) | (session_id << GTK_SESSION_ID_SHIFT); } static inline int gre_match_key6 (const gre_tunnel_key6_t * key1, const gre_tunnel_key6_t * key2) { return ((key1->gtk_src.as_u64[0] == key2->gtk_src.as_u64[0]) && (key1->gtk_src.as_u64[1] == key2->gtk_src.as_u64[1]) && (key1->gtk_dst.as_u64[0] == key2->gtk_dst.as_u64[0]) && (key1->gtk_dst.as_u64[1] == key2->gtk_dst.as_u64[1]) && (key1->gtk_fidx_ssid_type == key2->gtk_fidx_ssid_type)); } static inline void gre_mk_sn_key (const gre_tunnel_t * gt, gre_sn_key_t * key) { key->src = gt->tunnel_src; key->dst = gt->tunnel_dst.fp_addr; key->fib_index = gt->outer_fib_index; } #endif /* included_gre_h */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */