aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_l4p/tle_udp.h
diff options
context:
space:
mode:
authorJianfeng Tan <henry.tjf@antfin.com>2019-11-18 06:59:50 +0000
committerJianfeng Tan <henry.tjf@antfin.com>2020-03-05 01:31:33 +0800
commit78c896b3b3127515478090c19447e27dc406427e (patch)
treed6d67d4683e9ca0409f9984a834547a572fb5310 /lib/libtle_l4p/tle_udp.h
parente4380f4866091fd92a7a57667dd938a99144f9cd (diff)
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com> Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com> Signed-off-by: Jian Zhang <wuzai.zj@antfin.com> Signed-off-by: Chen Zhao <winters.zc@antfin.com> Change-Id: I55c39de4c6cd30f991f35631eb507f770230f08e
Diffstat (limited to 'lib/libtle_l4p/tle_udp.h')
-rw-r--r--lib/libtle_l4p/tle_udp.h49
1 files changed, 49 insertions, 0 deletions
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;
};
/**
@@ -55,6 +56,36 @@ 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.
* All packets still remaining in stream transmit buffer will be kept
@@ -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