From 78c896b3b3127515478090c19447e27dc406427e Mon Sep 17 00:00:00 2001 From: Jianfeng Tan Date: Mon, 18 Nov 2019 06:59:50 +0000 Subject: TLDKv2 Signed-off-by: Jianfeng Tan Signed-off-by: Jielong Zhou Signed-off-by: Jian Zhang Signed-off-by: Chen Zhao Change-Id: I55c39de4c6cd30f991f35631eb507f770230f08e --- lib/libtle_l4p/tle_udp.h | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'lib/libtle_l4p/tle_udp.h') diff --git a/lib/libtle_l4p/tle_udp.h b/lib/libtle_l4p/tle_udp.h index d3a8fe9..640ed64 100644 --- a/lib/libtle_l4p/tle_udp.h +++ b/lib/libtle_l4p/tle_udp.h @@ -35,6 +35,7 @@ struct tle_udp_stream_param { struct tle_event *send_ev; /**< send event to use. */ struct tle_stream_cb send_cb; /**< send callback to use. */ + uint64_t option; }; /** @@ -54,6 +55,36 @@ struct tle_stream * tle_udp_stream_open(struct tle_ctx *ctx, const struct tle_udp_stream_param *prm); +/** + * set an existed stream within given UDP context with new param. + * @param ts + * stream to set with new param + * @param ctx + * UDP context to set the stream within. + * @param prm + * Parameters used to set the stream. + * @return + * Pointer to UDP stream structure that can be used in future UDP API calls, + * or NULL on error, with error code set in rte_errno. + * Possible rte_errno errors include: + * - EINVAL - invalid parameter passed to function + * - ENOFILE - max limit of open streams reached for that context + */ +struct tle_stream * +tle_udp_stream_set(struct tle_stream *ts, struct tle_ctx *ctx, + const struct tle_udp_stream_param *prm); + +/** + * shutdown an open stream. + * + * @param s + * Pointer to the stream to shutdown. + * @return + * zero on successful completion. + * - -EINVAL - invalid parameter passed to function + */ +int tle_udp_stream_shutdown(struct tle_stream *s, int how); + /** * close an open stream. * All packets still remaining in stream receive buffer will be freed. @@ -180,6 +211,24 @@ uint16_t tle_udp_stream_recv(struct tle_stream *s, struct rte_mbuf *pkt[], uint16_t tle_udp_stream_send(struct tle_stream *s, struct rte_mbuf *pkt[], uint16_t num, const struct sockaddr *dst_addr); +/** + * updates configuration (associated events, callbacks, stream parameters) + * for the given streams. + * @param ts + * An array of pointers to the streams to update. + * @param prm + * An array of parameters to update for the given streams. + * @param num + * Number of elements in the *ts* and *prm* arrays. + * @return + * number of streams successfully updated. + * In case of error, error code set in rte_errno. + * Possible rte_errno errors include: + * - EINVAL - invalid parameter passed to function + */ +uint32_t tle_udp_stream_update_cfg(struct tle_stream *ts[], + struct tle_udp_stream_param prm[], uint32_t num); + #ifdef __cplusplus } #endif -- cgit 1.2.3-korg