blob: e7ed0e06f0adb7d0e815666a521048b8c80b7c21 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
/* Copyright (c) 2021, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <odp_api.h>
#include <odp/helper/odph_api.h>
int main(int argc, char *argv[])
{
odp_instance_t instance;
odph_helper_options_t helper_options;
odp_init_t init_param;
argc = odph_parse_options(argc, argv);
if (odph_options(&helper_options)) {
ODPH_ERR("Error: reading ODP helper options failed.\n");
exit(EXIT_FAILURE);
}
odp_init_param_init(&init_param);
init_param.mem_model = helper_options.mem_model;
memset(&instance, 0, sizeof(instance));
if (odp_init_global(&instance, NULL, NULL)) {
ODPH_ERR("Error: ODP global init failed.\n");
exit(EXIT_FAILURE);
}
if (odp_init_local(instance, ODP_THREAD_CONTROL)) {
ODPH_ERR("Error: ODP local init failed.\n");
exit(EXIT_FAILURE);
}
odph_cli_param_t cli_param;
odph_cli_param_init(&cli_param);
if (odph_cli_init(instance, &cli_param)) {
ODPH_ERR("Error: odph_cli_init() failed.\n");
exit(EXIT_FAILURE);
}
if (odph_cli_start()) {
ODPH_ERR("Error: odph_cli_start() failed.\n");
exit(EXIT_FAILURE);
}
if (odph_cli_stop()) {
ODPH_ERR("Error: odph_cli_stop() failed.\n");
exit(EXIT_FAILURE);
}
if (odph_cli_term()) {
ODPH_ERR("Error: odph_cli_term() failed.\n");
exit(EXIT_FAILURE);
}
if (odp_term_local()) {
ODPH_ERR("Error: ODP local term failed.\n");
exit(EXIT_FAILURE);
}
if (odp_term_global(instance)) {
ODPH_ERR("Error: ODP global term failed.\n");
exit(EXIT_FAILURE);
}
return EXIT_SUCCESS;
}
|