X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvcl%2Fvppcom.h;h=f2fca09b51295c1948466e5faa107c2d6a2a0d52;hb=30e79c2e388a98160a3660f4f03103890c9b1b7c;hp=b5e753292ecb666d1512e18929f56bba22659e83;hpb=134a996a0279577080b626d5172c1739efa00b92;p=vpp.git diff --git a/src/vcl/vppcom.h b/src/vcl/vppcom.h index b5e753292ec..f2fca09b512 100644 --- a/src/vcl/vppcom.h +++ b/src/vcl/vppcom.h @@ -48,6 +48,10 @@ typedef enum { VPPCOM_PROTO_TCP = 0, VPPCOM_PROTO_UDP, + VPPCOM_PROTO_SCTP, + VPPCOM_PROTO_NONE, + VPPCOM_PROTO_TLS, + VPPCOM_PROTO_UDPC } vppcom_proto_t; static inline char * @@ -58,10 +62,19 @@ vppcom_proto_str (vppcom_proto_t proto) switch (proto) { case VPPCOM_PROTO_TCP: - proto_str = "VPPCOM_PROTO_TCP"; + proto_str = "TCP"; break; case VPPCOM_PROTO_UDP: - proto_str = "VPPCOM_PROTO_UDP"; + proto_str = "UDP"; + break; + case VPPCOM_PROTO_SCTP: + proto_str = "SCTP"; + break; + case VPPCOM_PROTO_TLS: + proto_str = "TLS"; + break; + case VPPCOM_PROTO_UDPC: + proto_str = "UDPC"; break; default: proto_str = "UNKNOWN"; @@ -84,6 +97,8 @@ typedef struct vppcom_endpt_t_ uint16_t port; } vppcom_endpt_t; +typedef uint32_t vcl_session_handle_t; + typedef enum { VPPCOM_OK = 0, @@ -137,6 +152,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 +160,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 +254,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, @@ -253,7 +279,20 @@ extern int vppcom_session_sendto (uint32_t session_handle, void *buffer, 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_index (vcl_session_handle_t session_handle); +extern int vppcom_session_worker (vcl_session_handle_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_session_tls_add_cert (uint32_t session_handle, char *cert, + uint32_t cert_len); +extern int vppcom_session_tls_add_key (uint32_t session_handle, char *key, + uint32_t key_len); +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 +302,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