aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_l4p/tle_udp.h
diff options
context:
space:
mode:
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