aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.h
diff options
context:
space:
mode:
authorKeith Burns (alagalah) <alagalah@gmail.com>2018-03-23 13:42:49 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-04-12 20:33:02 +0000
commit410bcca41c1a3e7c3d4b4c2940120f9b21732d49 (patch)
treee79249ffbad91f744d15261b2003eea64bff9e2c /src/vcl/vppcom.h
parentba1e158082048640686ec0b7791126c9e5c4e0fc (diff)
VCL IOEvent external API callback
Change-Id: I417357b00c43b27872aa3f681335bdc1ef574eca Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vcl/vppcom.h')
-rw-r--r--src/vcl/vppcom.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/vcl/vppcom.h b/src/vcl/vppcom.h
index 34a69b2c2ec..c752e50413b 100644
--- a/src/vcl/vppcom.h
+++ b/src/vcl/vppcom.h
@@ -144,6 +144,13 @@ typedef struct _vcl_poll
short *revents;
} vcl_poll_t;
+typedef struct vppcom_ioevent_
+{
+ uint32_t session_index;
+ size_t bytes;
+} vppcom_ioevent_t;
+
+
/*
* VPPCOM Public API Functions
*/
@@ -221,6 +228,34 @@ typedef void (*vppcom_session_listener_cb) (uint32_t, vppcom_endpt_t *,
void *);
/**
+ * User registered callback for IO events (rx/tx)
+ * @param vppcom_ioevent_t* -
+ * @param void* - user passed arg to pass back
+ */
+typedef void (*vppcom_session_ioevent_cb) (vppcom_ioevent_t *, void *);
+
+/**
+ * @brief vppcom_session_register_listener accepts a bound session_index, and
+ * listens for connections.
+ *
+ * On successful connection, calls registered callback (cb) with new
+ * session_index.
+ *
+ * On error, calls registered error callback (errcb).
+ *
+ * @param session_index - bound session_index to create listener on
+ * @param cb - on new accepted session callback
+ * @param errcb - on failure callback
+ * @param flags - placeholder for future use. Must be ZERO
+ * @param q_len - max listener connection backlog
+ * @param ptr - user data
+ * @return
+ */
+extern int vppcom_session_register_ioevent_cb (uint32_t session_index,
+ vppcom_session_ioevent_cb cb,
+ uint8_t rx, void *ptr);
+
+/**
* User registered ERROR callback for any errors associated with
* handling vppcom_session_register_listener() and connections
* @param void* - user passed arg to pass back