2 * Copyright (c) 2015 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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
15 #include <vlib/vlib.h>
16 #include <app/version.h>
19 #include <rte_version.h>
20 #include <vnet/vnet.h>
21 #include <vnet/devices/dpdk/dpdk.h>
24 static char * vpe_version_string =
26 " built by " VPP_BUILD_USER
28 " at " VPP_BUILD_DATE;
29 static char * vpe_dir_string = "Built in " VPP_BUILD_TOPDIR;
31 static char * vpe_compiler = "Compiled with "
32 #if defined(__INTEL_COMPILER)
35 "icc " _(__INTEL_COMPILER) " (" __VERSION__ ")";
38 #elif defined(__clang__)
39 "Clang/LLVM " __clang_version__;
40 #elif defined (__GNUC__)
47 show_vpe_version_command_fn (vlib_main_t * vm,
48 unformat_input_t * input,
49 vlib_cli_command_t * cmd)
51 vlib_cli_output (vm, "%s", vpe_version_string);
52 if (unformat (input, "verbose"))
54 vlib_cli_output (vm, "%s", vpe_dir_string);
55 vlib_cli_output (vm, "%s", vpe_compiler);
57 vlib_cli_output (vm, "DPDK version is %s", rte_version());
58 vlib_cli_output (vm, "DPDK EAL init arguments: %v",
59 dpdk_main.eal_init_args_str);
65 VLIB_CLI_COMMAND (show_vpe_version_command, static) = {
66 .path = "show version",
67 .short_help = "show version information",
68 .function = show_vpe_version_command_fn,
71 char * vpe_api_get_build_directory (void)
73 return VPP_BUILD_TOPDIR;
76 char * vpe_api_get_version (void)
80 char * vpe_api_get_build_date (void)
82 return VPP_BUILD_DATE;