vcl/ldp: add write msg function and fine tuning
[vpp.git] / src / vcl / vppcom.h
index b5e7532..00527f4 100644 (file)
@@ -137,6 +137,7 @@ typedef enum
   VPPCOM_ATTR_SET_TCP_KEEPINTVL,
   VPPCOM_ATTR_GET_TCP_USER_MSS,
   VPPCOM_ATTR_SET_TCP_USER_MSS,
+  VPPCOM_ATTR_GET_REFCNT,
 } vppcom_attr_op_t;
 
 typedef struct _vcl_poll
@@ -144,9 +145,17 @@ typedef struct _vcl_poll
   uint32_t fds_ndx;
   uint32_t sid;
   short events;
-  short *revents;
+  short revents;
 } vcl_poll_t;
 
+typedef struct vppcom_data_segment_
+{
+  unsigned char *data;
+  uint32_t len;
+} vppcom_data_segment_t;
+
+typedef vppcom_data_segment_t vppcom_data_segments_t[2];
+
 /*
  * VPPCOM Public API Functions
  */
@@ -230,6 +239,8 @@ extern int vppcom_session_connect (uint32_t session_handle,
 extern int vppcom_session_read (uint32_t session_handle, void *buf, size_t n);
 extern int vppcom_session_write (uint32_t session_handle, void *buf,
                                 size_t n);
+extern int vppcom_session_write_msg (uint32_t session_handle, void *buf,
+                                    size_t n);
 
 extern int vppcom_select (unsigned long n_bits,
                          unsigned long *read_map,
@@ -254,6 +265,14 @@ extern int vppcom_poll (vcl_poll_t * vp, uint32_t n_sids,
                        double wait_for_time);
 extern int vppcom_mq_epoll_fd (void);
 extern int vppcom_session_index (uint32_t session_handle);
+extern int vppcom_session_handle (uint32_t session_index);
+
+extern int vppcom_session_read_segments (uint32_t session_handle,
+                                        vppcom_data_segments_t ds);
+extern void vppcom_session_free_segments (uint32_t session_handle,
+                                         vppcom_data_segments_t ds);
+extern int vppcom_data_segment_copy (void *buf, vppcom_data_segments_t ds,
+                                    uint32_t max_bytes);
 
 /**
  * Request from application to register a new worker
@@ -263,10 +282,10 @@ extern int vppcom_session_index (uint32_t session_handle);
  */
 extern int vppcom_worker_register (void);
 
-/*
- * VPPCOM Event Functions
+/**
+ * Retrieve current worker index
  */
-extern void vce_poll_wait_connect_request_handler_fn (void *arg);
+extern int vppcom_worker_index (void);
 
 /* *INDENT-OFF* */
 #ifdef __cplusplus