summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_api.c
AgeCommit message (Collapse)AuthorFilesLines
2021-04-23session: set connected session index for ctFlorin Coras1-2/+5
Set connected session index for ct as well. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id82ffcf5572b6a9d2769c0e685c7a0b4d1ea9e9f
2021-04-23session: set fifo's session index before vcl attachliuyacan1-0/+2
Current implementation may have timing issue: 1. The TCP 3-way-handshake is completed but the app is busy and does not process the CONNECTED event. 2. VPP receive some data from peer and try to send a RX event to VCL, but the fifo's client session index is not initialized yet. So this event will be sent to incorrect session 0. Type: fix Change-Id: I54f222232968bfaea5f4745284a1cfacc89482a9 Signed-off-by: liuyacan <liuyacan@corp.netease.com>
2021-03-29svm session vcl: per app rx message queuesFlorin Coras1-34/+73
Add option to use per app private segments for app to vpp message queues, as opposed to exposing internal message queues segment. When so configured, internal message queues are still polled by the session queue node but external app message queues are handled by a new input node (appsl-rx-mqs-input) that runs in interrupt state. Signaling of the node, when mqs receive new messages, is done through eventfds epolled by worker epoll input nodes. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iffe8ce5a9944a56a14e6d0f492a850cb9e392d16
2021-03-10session: check if fifo exists in cl bound notificationFlorin Coras1-1/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I316575a4b199916920cad6be8f9b49025d6ccc2d
2021-02-24session: init ctrl msg without mq lockFlorin Coras1-102/+96
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I755e6da1fcf6f3bf3c72d6d36c4243b0919b7209
2021-02-10vcl: validate seg handle on migrate only if neededFlorin Coras1-1/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c15a465f84f2ceb6bd5f1c459899824d4bc1c90
2021-01-25svm: add custom q implementation for mqFlorin Coras1-4/+4
Add separate queue implementation for the message queue as it's custom tailored for fifo segments as opposed to binary api. Also move eventfds to the private data structures. Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I6df0c824ecd94c7904516373f92a9fffc6b04736
2021-01-07vcl session: switch to generic cert key apisFlorin Coras1-75/+4
Remove the deprecated tls apis. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia1e12bd813671146f0aca22e83d04c23ac13e595
2020-12-29svm vcl: allow random offsets for fifo segments in appsFlorin Coras1-10/+10
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1658a9c19d8eae4c9a42c0a111d4ad343b8eb8a4
2020-12-29svm: allow mq attachments at random offsetsFlorin Coras1-35/+47
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic373cd2c11272da539eb4b0db27227f36f2f9688
2020-12-28session: convert evt q segment to fifo segmentFlorin Coras1-4/+5
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I63a44e11322f6fe27255820524e022f6d710b083
2020-12-24svm: split fifo into private and shared structsFlorin Coras1-12/+14
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id8e77e8b2623be719fd43a95e181eaa5b7df2b6e
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-4/+4
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-09session: remove support for shm bapi attachmentFlorin Coras1-1/+6
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I21bda0c46406aff54ad8fe5e44491e8e332de170
2020-10-27session: per worker state for ct sessionsFlorin Coras1-2/+2
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id6f7b2b969eb50eb7611e4e9ca77b7ef0e0519a1
2020-09-25vppinfra session: file platform independent private dataFlorin Coras1-2/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id43b0b6db2b42ee5801236df0bd7f7225e1e081c
2020-09-23session: fix sapi coverity warningFlorin Coras1-0/+2
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ib00ac02eabb06a300d01697b89d97b26dd3c4330
2020-09-22lisp: Move to pluginNeale Ranns1-1/+1
Type: refactor Change-Id: I54df533a8f863c4e49742903cf2457f18b4fc506 Signed-off-by: Neale Ranns <nranns@cisco.com>
2020-09-18session: grab worker barrier for sapi msgsFlorin Coras1-0/+5
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7cdbcfeb6f77a720e190daf9fe555320e586bba8
2020-09-16vcl: refactor bapi client index for sapi reuseFlorin Coras1-1/+2
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibebb6f7d4e610570693e213acd2f6d9332c563c6
2020-09-14session: del app worker on socket detachFlorin Coras1-5/+11
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic904abedcd270c95e782159170d457bc396424a0
2020-09-14session: add unix socket api for app attachmentFlorin Coras1-3/+504
This is an af_unix socket alternative to the binary api. To enable it, add use-app-socket-api under session stanza in startup.conf. When the socket api is enabled, attachments through the binary api are disabled. The socket api only works with memfd fifo segments, i.e., shm segments are not supported. Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I55ffcee201d004846daeeec85c700c7e7a578d43
2020-05-04misc: binary api fuzz test fixesDave Barach1-2/+2
Add a hook to src/vlibapi/api_shared.c to fuzz (screw up) binary API messages, e.g. by xoring random data into them before processing. We specifically exempt client connection messages, and inband debug CLI messages. We step over msg_id, client index, client context, and sw_if_index. Otherwise, "make test" vectors fail too rapidly to learn anything. The goal is to reduce the number of crashes caused to zero. We're fairly close with this patch. Add vl_msg_api_max_length(void *mp), which returns the maximum plausible length for a binary API message. Use it to hardern vl_api_from_api_to_new_vec(...) which takes an additional argument - message pointer - so it can verify that astr->length is sane. If it's not sane, return a u8 *vector of the form "insane astr->length nnnn\0". Verify array lengths in vl_api_dhcp6_send_client_message_t_handler(...) and vl_api_dhcp6_pd_send_client_message_t_handler(...). Add a fairly effective binary API fuzz hook to the unittest plugin, and modify the "make test" framework.py to pass "api-fuzz { on|off }" to enable API fuzzing: "make API_FUZZ=on TEST=xxx test-debug" or similar Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I0157267652a163c01553d5267620f719cc6c3bde
2020-04-25session vcl: propagate transport cleanup notificationsFlorin Coras1-2/+4
Type: improvement Can be used to force app to close a connection on which it still waits for data. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7c3a8245cbbc23728e4408feb63a659a11f718ed
2020-04-10udp: remove connected udp transport protoFlorin Coras1-4/+0
Type: refactor To reproduce functionality, use udp in combination with TRANSPORT_CFG_F_CONNECTED transport flag set in connect and listen parameters. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id88470c38326f8168b9646b0de49a674e0f4266f
2020-04-03session: improve error reportingFlorin Coras1-13/+10
Type: improvement Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-04-03session: remove obsolete apisFlorin Coras1-544/+26
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia14800710aca7c1bc315b6da3c69d623f79a5b63
2020-03-25session: api to add new transport typesFlorin Coras1-5/+1
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If4dee6dba1ea942daa921d566b35cdecdda680ee
2020-03-05session: API cleanupJakub Grajciar1-81/+92
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ib752a3425c076eb53bc5255a48039cbb74b1fcce Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-01-30vcl session: propagate cleanup notifications to appsFlorin Coras1-0/+30
Type: feature Change-Id: I7f8e3763d7f8364563a25d0fcc782976b906b325 Signed-off-by: Florin Coras <fcoras@cisco.com>
2020-01-23vcl session: udp session migration notificationsFlorin Coras1-1/+22
Type: feature Change-Id: I402549818ba6e078802e914293304174dc6625c2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-21session: move add/del segment msg to mqFlorin Coras1-2/+111
Type: refactor Change-Id: I32234173ebd69f80acb1afa4039fffbd19157f6d Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-12-11quic: Add support for unidirectional streamsNathan Skrzypczak1-0/+1
Type: feature Change-Id: I3a642626a444504594c5e3df40dbc92df54136f0 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-12-10api: multiple connections per processDave Barach1-1/+1
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
2019-11-08session: add space around ternary operatorVratko Polak1-1/+1
Type: style Change-Id: If28a4959c1d60ab1caf22dbc8b72d9adf7060bd4 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-11-07session: ckpair store & crypto engine as mq paramsNathan Skrzypczak1-3/+5
Type: feature This patch adds the logic to pass to connect & listen msg in the mq the following parameters * ckpair index * crypto engine (for now only used in quic) Change-Id: I7213d8b581cb4532a9a6b18c4b3fe021287b7733 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-11-07session: fix app attach on errorNathan Skrzypczak1-3/+2
Type: fix Change-Id: I57b3c76515544ba3655690b37e0dacb47734ba6d Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-10-09session: Add certificate storeNathan Skrzypczak1-30/+87
Type: feature This changes the behavior of both API calls APPLICATION_TLS_CERT_ADD & APPLICATION_TLS_KEY_ADD certificates and keys aren't bound to an app, they are passed to it via connect / listen using the message queue. This should be followed by a per protocol (QUIC/TLS) crypto_context store to save devrived structs Change-Id: I36873bc8b63b5c72776c69e8cd9febc9cae31882 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-08-28session: fix unbind coverity warningFlorin Coras1-0/+7
Type:fix Change-Id: If4fce6bd9b06ed545d72df847afd6a74cdefe042 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-27session: move ctrl messages from bapi to mqFlorin Coras1-26/+138
Type:refactor Moves connect, disconnect, bind, unbind and app detach to message queue from binary api. Simplifies app/vcl interaction with the session layer since all session control messages are now handled over the mq. Add/del segment messages require internal C api changes which affect all builtin applications. They'll be moved in a different patch and might not be back portable to 19.08. Change-Id: I93f6d18e551b024effa75d47f5ff25f23ba8aff5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-08-01session: session pool migration notificationFlorin Coras1-0/+8
Type: feature Change-Id: Ia9a5b1a6d85c7f3f2e6db583b33b5b20029a1e88 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-07-19session: Use parent_handle instead of transport_optsNathan Skrzypczak1-1/+1
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>
2019-07-08session: add flag to disable session lookupNathan Skrzypczak1-0/+1
Type: feature Change-Id: I1369859be0a722ea37e5d3ecb35dee5684fc69f8 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-06-17session: use listener_handle instead of listener_indexNathan Skrzypczak1-2/+2
Type: refactor Change-Id: I97fa59a0ba0b6b7a98698926020ffffcf6ae6ba3 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-06-12session: use session handles as app listener handlesFlorin Coras1-5/+2
Type: refactor Change-Id: I421750147a8a821bd0b522daf6c2b7239e551f12 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-05-16Add transport_opts to connect_sock bapiNathan Skrzypczak1-1/+2
Needed by QUIC to distinguish Q/Ssessions Change-Id: Idcc9e46f86f54a7d06ce6d870edec1766e95c82d Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2019-05-07add TLS endpoint functionYu Ping1-5/+6
a bit like QUIC, and the added function can get the endpoint info in TLS, so that the VCL layer can get those info correctly Change-Id: Ied7aa3077087c1814499364dfa7654a088ad9910 Signed-off-by: Yu Ping <ping.yu@intel.com>
2019-04-25session: cleanup segment manager and fifo segmentFlorin Coras1-1/+1
Change-Id: I984f347fb465c0c405cef668d8690457e81788e2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-25session: use teps in accept/connect notificationsFlorin Coras1-8/+6
Change-Id: I58e713661a38cecbfdebd4609292d9d12e880cd2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2019-04-24Add get_endpoint in transport vftAloys Augustin1-10/+7
This allows QUIC & TLS specific logic to be implemented, and meaningfull IP/port to be returned when connection is overridden. Change-Id: Id79c59fe4d7b16d36f0e96ad3e281c4026b5fe65 Signed-off-by: Aloys Augustin <aloaugus@cisco.com>