xref: /dpdk/examples/cmdline/main.c (revision 9a212dc06c7aaf09b146d9c3dcfd584d741634c1)
10cdc9c96SLee Daly /* SPDX-License-Identifier: BSD-3-Clause
20cdc9c96SLee Daly  * Copyright(c) 2010-2014 Intel Corporation.
3af75078fSIntel  * Copyright (c) 2009, Olivier MATZ <zer0@droids-corp.org>
4af75078fSIntel  * All rights reserved.
5af75078fSIntel  */
6af75078fSIntel 
7af75078fSIntel #include <stdio.h>
8af75078fSIntel #include <string.h>
9af75078fSIntel #include <stdint.h>
10af75078fSIntel #include <errno.h>
11af75078fSIntel #include <sys/queue.h>
12af75078fSIntel 
13af75078fSIntel #include <cmdline_rdline.h>
14af75078fSIntel #include <cmdline_parse.h>
15af75078fSIntel #include <cmdline_socket.h>
16af75078fSIntel #include <cmdline.h>
17af75078fSIntel 
18af75078fSIntel #include <rte_memory.h>
19af75078fSIntel #include <rte_eal.h>
20af75078fSIntel #include <rte_debug.h>
21af75078fSIntel 
22af75078fSIntel #include "commands.h"
23af75078fSIntel 
24*9a212dc0SConor Fogarty /* Initialization of the Environment Abstraction Layer (EAL). 8< */
main(int argc,char ** argv)2598a16481SDavid Marchand int main(int argc, char **argv)
26af75078fSIntel {
27af75078fSIntel 	int ret;
28af75078fSIntel 	struct cmdline *cl;
29af75078fSIntel 
30af75078fSIntel 	ret = rte_eal_init(argc, argv);
31af75078fSIntel 	if (ret < 0)
32af75078fSIntel 		rte_panic("Cannot init EAL\n");
33*9a212dc0SConor Fogarty 	/* >8 End of initialization of Environment Abstraction Layer (EAL). */
34af75078fSIntel 
35*9a212dc0SConor Fogarty 	/* Creating a new command line object. 8< */
36af75078fSIntel 	cl = cmdline_stdin_new(main_ctx, "example> ");
37af75078fSIntel 	if (cl == NULL)
38af75078fSIntel 		rte_panic("Cannot create cmdline instance\n");
39af75078fSIntel 	cmdline_interact(cl);
40af75078fSIntel 	cmdline_stdin_exit(cl);
41*9a212dc0SConor Fogarty 	/* >8 End of creating a new command line object. */
42af75078fSIntel 
4310aa3757SChengchang Tang 	/* clean up the EAL */
4410aa3757SChengchang Tang 	rte_eal_cleanup();
4510aa3757SChengchang Tang 
46af75078fSIntel 	return 0;
47af75078fSIntel }
48