blob: 5f319a42821d7b055c1c79ac6aa18d1dac5d3f20 [file] [log] [blame]
Damjan Marion5fec1e82017-04-13 19:13:47 +02001/*
2 * Copyright (c) 2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef included_vppapiclient_h
16#define included_vppapiclient_h
17
18#include <stdint.h>
Ole Troanf68fccf2020-09-28 16:15:18 +020019#include <stdbool.h>
Damjan Marion5fec1e82017-04-13 19:13:47 +020020
Paul Vinciguerrabad47662019-12-19 18:26:29 -050021typedef enum
22{
23 VAC_SVM_QUEUE_SUB_1 = -1,
24 VAC_SVM_QUEUE_SUB_2 = -2,
25 VAC_NOT_CONNECTED = -3,
26 VAC_SHM_NOT_READY = -4,
27 VAC_TIMEOUT = -5,
28} vac_errno_t;
29
Damjan Marion5fec1e82017-04-13 19:13:47 +020030typedef void (*vac_callback_t)(unsigned char * data, int len);
31typedef void (*vac_error_callback_t)(void *, unsigned char *, int);
32int vac_connect(char * name, char * chroot_prefix, vac_callback_t cb,
33 int rx_qlen);
34int vac_disconnect(void);
35int vac_read(char **data, int *l, unsigned short timeout);
36int vac_write(char *data, int len);
37void vac_free(void * msg);
38
Ole Troandf87f802020-11-18 19:17:48 +010039int vac_get_msg_index(char * name);
Damjan Marion5fec1e82017-04-13 19:13:47 +020040int vac_msg_table_size(void);
41int vac_msg_table_max_index(void);
42
43void vac_rx_suspend (void);
44void vac_rx_resume (void);
45void vac_set_error_handler(vac_error_callback_t);
Ole Troanf68fccf2020-09-28 16:15:18 +020046void vac_mem_init (size_t size);
47
Damjan Marion5fec1e82017-04-13 19:13:47 +020048#endif