docs: convert plugins doc md->rst
[vpp.git] / doxygen / siphon_templates / markdown / syscfg / index_header.md
1 {#
2 # Copyright (c) 2016 Comcast Cable Communications Management, LLC.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #}
16 # Startup Configuration    {{'{#'}}syscfg}
17
18 The VPP network stack comes with several configuration options that can be
19 provided either on the command line or in a configuration file.
20
21 Specific applications built on the stack have been known to require a dozen
22 arguments, depending on requirements. This section describes commonly-used
23 options and parameters.
24
25 You can find command-line argument parsers in the source code by searching for
26 instances of the `VLIB_CONFIG_FUNCTION` macro. The invocation
27 `VLIB_CONFIG_FUNCTION(foo_config, "foo")` will cause the function
28 `foo_config` to receive all the options and values supplied in a parameter
29 block named "`foo`", for example: `foo { arg1 arg2 arg3 ... }`.
30
31 @todo Tell the nice people where this document lives so that the might
32 help improve it!
33
34 ## Command-line arguments
35
36 Parameters are grouped by a section name. When providing more than one
37 parameter to a section all parameters for that section must be wrapped in
38 curly braces.
39
40 ```
41 /usr/bin/vpp unix { interactive cli-listen 127.0.0.1:5002 }
42 ```
43
44 Which will produce output similar to this:
45
46     <startup diagnostic messages>
47         _______    _        _   _____  ___ 
48      __/ __/ _ \  (_)__    | | / / _ \/ _ \
49      _/ _// // / / / _ \   | |/ / ___/ ___/
50      /_/ /____(_)_/\___/   |___/_/  /_/    
51     
52     vpp# <start-typing>
53
54 When providing only one such parameter the braces are optional. For example,
55 the following command argument, `unix interactive` does not have braces:
56
57 ```
58 /usr/bin/vpp unix interactive
59 ```
60
61 The command line can be presented as a single string or as several; anything
62 given on the command line is concatenated with spaces into a single string
63 before parsing.
64
65 VPP applications must be able to locate their own executable images. The
66 simplest way to ensure this will work is to invoke a VPP application by giving
67 its absolute path; for example: `/usr/bin/vpp <options>`. At startup, VPP
68 applications parse through their own ELF-sections (primarily) to make lists
69 of init, configuration, and exit handlers.
70
71 When developing with VPP, in _gdb_ it's often sufficient to start an application
72 like this at the `(gdb)` prompt:
73
74 ```
75 run unix interactive
76 ```
77
78 ## Configuration file
79
80 It is also possible to supply parameters in a startup configuration file the
81 path of which is provided to the VPP application on its command line.
82
83 The format of the configuration file is a simple text file with the same
84 content as the command line but with the benefit of being able to use newlines
85 to make the content easier to read. For example:
86
87 ```
88 unix {
89   nodaemon
90   log /var/log/vpp/vpp.log
91   full-coredump
92   cli-listen localhost:5002
93 }
94 api-trace {
95   on
96 }
97 dpdk {
98   dev 0000:03:00.0
99 }
100 ```
101
102 VPP is then instructed to load this file with the `-c` option:
103
104 ```
105 /usr/bin/vpp -c /etc/vpp/startup.conf
106 ```
107
108 ## Index of startup command sections
109
110 [TOC]
111