summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 596494b94f8ac7123e69c273076266fbe154c6ec (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Vector Packet Processing
========================

## Introduction

The VPP platform is an extensible framework that provides out-of-the-box
production quality switch/router functionality. It is the open source version
of Cisco's Vector Packet Processing (VPP) technology: a high performance,
packet-processing stack that can run on commodity CPUs.

The benefits of this implementation of VPP are its high performance, proven
technology, its modularity and flexibility, and rich feature set.

For more information on VPP and its features please visit the
[FD.io website](http://fd.io/) and
[What is VPP?](https://wiki.fd.io/view/VPP/What_is_VPP%3F) pages.


## Changes

Details of the changes leading up to this version of VPP can be found under
@ref release_notes.


## Directory layout

Directory name         | Description
---------------------- | -------------------------------------------
     build-data        | Build metadata
     build-root        | Build output directory
     doxygen           | Documentation generator configuration
     dpdk              | DPDK patches and build infrastructure
@ref src               | VPP source code
@ref src/plugins       | VPP bundled plugins directory
@ref src/svm           | Shared virtual memory allocation library
     src/tests         | Unit tests
     src/vat           | VPP API test program
@ref src/vlib          | VPP application library
@ref src/vlibapi       | VPP API library
@ref src/vlibmemory    | VPP Memory management
@ref src/vlibsocket    | VPP Socket I/O
@ref src/vnet          | VPP networking
@ref src/vpp           | VPP application
@ref src/vpp-api       | VPP application API bindings
@ref src/vppinfra      | VPP core library
     test              | Unit tests
@ref src/vpp/api       | Not-yet-relocated API bindings
@ref src/examples      | VPP example code

## Getting started

In general anyone interested in building, developing or running VPP should
consult the [VPP wiki](https://wiki.fd.io/view/VPP) for more complete
documentation.

In particular, readers are recommended to take a look at [Pulling, Building,
Running, Hacking, Pushing](https://wiki.fd.io/view/VPP/Pulling,_Building,_Run
ning,_Hacking_and_Pushing_VPP_Code) which provides extensive step-by-step
coverage of the topic.

For the impatient, some salient information is distilled below.


### Quick-start: On an existing Linux host

To install system dependencies, build VPP and then install it, simply run the
build script. This should be performed a non-privileged user with `sudo`
access from the project base directory:

    ./extras/vagrant/build.sh

If you want a more fine-grained approach because you intend to do some
development work, the `Makefile` in the root directory of the source tree
provides several convenience shortcuts as `make` targets that may be of
interest. To see the available targets run:

    make


### Quick-start: Vagrant

The directory `extras/vagrant` contains a `VagrantFile` and supporting
scripts to bootstrap a working VPP inside a Vagrant-managed Virtual Machine.
This VM can then be used to test concepts with VPP or as a development
platform to extend VPP. Some obvious caveats apply when using a VM for VPP
since its performance will never match that of bare metal; if your work is
timing or performance sensitive, consider using bare metal in addition or
instead of the VM.

For this to work you will need a working installation of Vagrant. Instructions
for this can be found [on the Setting up Vagrant wiki page]
(https://wiki.fd.io/view/DEV/Setting_Up_Vagrant).


## More information

Several modules provide documentation, see @subpage user_doc for more
information.

Visit the [VPP wiki](https://wiki.fd.io/view/VPP) for details on more
advanced building strategies and development notes.


## Test Framework

There is PyDoc generated documentation available for the VPP test framework. See @subpage test_framework_doc for details.
"cm"> * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef included_vlib_cli_h #define included_vlib_cli_h #include <vppinfra/format.h> struct vlib_cli_command_t; typedef struct { u32 min_char; /* Indexed by name[position] - min_char. */ uword **bitmaps; } vlib_cli_parse_position_t; typedef struct { u8 *name; u32 index; } vlib_cli_sub_command_t; typedef struct { u8 *name; u32 rule_index; u32 command_index; } vlib_cli_sub_rule_t; typedef struct { char *name; char *short_help; char *long_help; /* Number of bytes in parsed data. Zero for vector. */ uword data_size; unformat_function_t *unformat_function; /* Opaque for unformat function. */ uword unformat_function_arg[2]; } vlib_cli_parse_rule_t; /* CLI command callback function. */ typedef clib_error_t *(vlib_cli_command_function_t) (struct vlib_main_t * vm, unformat_input_t * input, struct vlib_cli_command_t * cmd); typedef struct vlib_cli_command_t { /* Command path (e.g. "show something"). Spaces delimit elements of path. */ char *path; /* Short/long help strings. */ char *short_help; char *long_help; /* Callback function. */ vlib_cli_command_function_t *function; /* Opaque. */ uword function_arg; /* Known MP-safe? */ uword is_mp_safe; /* Sub commands for this command. */ vlib_cli_sub_command_t *sub_commands; /* Hash table mapping name (e.g. last path element) to sub command index. */ uword *sub_command_index_by_name; /* bitmap[p][c][i] says whether sub-command i has character c in position p. */ vlib_cli_parse_position_t *sub_command_positions; /* Hash table mapping name (e.g. last path element) to sub rule index. */ uword *sub_rule_index_by_name; /* Vector of possible parse rules for this path. */ vlib_cli_sub_rule_t *sub_rules; /* List of CLI commands, built by constructors */ struct vlib_cli_command_t *next_cli_command; } vlib_cli_command_t; typedef void (vlib_cli_output_function_t) (uword arg, u8 * buffer, uword buffer_bytes); typedef struct { /* Vector of all known commands. */ vlib_cli_command_t *commands; /* Hash table mapping normalized path to index into all_commands. */ uword *command_index_by_path; /* Vector of all known parse rules. */ vlib_cli_parse_rule_t *parse_rules; /* Hash table mapping parse rule name to index into parse_rule vector. */ uword *parse_rule_index_by_name; /* Data parsed for rules. */ void **parse_rule_data; /* registration list added by constructors */ vlib_cli_command_t *cli_command_registrations; } vlib_cli_main_t; #ifndef CLIB_MARCH_VARIANT #define VLIB_CLI_COMMAND(x,...) \ __VA_ARGS__ vlib_cli_command_t x; \ static void __vlib_cli_command_registration_##x (void) \ __attribute__((__constructor__)) ; \ static void __vlib_cli_command_registration_##x (void) \ { \ vlib_main_t * vm = vlib_get_main(); \ vlib_cli_main_t *cm = &vm->cli_main; \ x.next_cli_command = cm->cli_command_registrations; \ cm->cli_command_registrations = &x; \ } \ static void __vlib_cli_command_unregistration_##x (void) \ __attribute__((__destructor__)) ; \ static void __vlib_cli_command_unregistration_##x (void) \ { \ vlib_main_t * vm = vlib_get_main(); \ vlib_cli_main_t *cm = &vm->cli_main; \ VLIB_REMOVE_FROM_LINKED_LIST (cm->cli_command_registrations, &x, \ next_cli_command); \ } \ __VA_ARGS__ vlib_cli_command_t x #else /* create unused pointer to silence compiler warnings and get whole function optimized out */ #define VLIB_CLI_COMMAND(x,...) \ static __clib_unused vlib_cli_command_t __clib_unused_##x #endif #define VLIB_CLI_PARSE_RULE(x) \ vlib_cli_parse_rule_t x /* Output to current CLI connection. */ void vlib_cli_output (struct vlib_main_t *vm, char *fmt, ...); /* Process CLI input. */ void vlib_cli_input (struct vlib_main_t *vm, unformat_input_t * input, vlib_cli_output_function_t * function, uword function_arg); clib_error_t *vlib_cli_register (struct vlib_main_t *vm, vlib_cli_command_t * c); clib_error_t *vlib_cli_register_parse_rule (struct vlib_main_t *vm, vlib_cli_parse_rule_t * c); uword unformat_vlib_cli_sub_input (unformat_input_t * i, va_list * args); /* Return an vector of strings consisting of possible auto-completions * for a given input string */ u8 **vlib_cli_get_possible_completions (u8 * input_str); #endif /* included_vlib_cli_h */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */