]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Copyright (c) 2014 Nicira, Inc. | |
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 | #ifndef DPCTL_H | |
17 | #define DPCTL_H 1 | |
18 | ||
19 | #include <stdbool.h> | |
20 | ||
21 | #include "compiler.h" | |
22 | ||
23 | struct dpctl_params { | |
24 | /* True if it is called by ovs-appctl command. */ | |
25 | bool is_appctl; | |
26 | ||
27 | /* -s, --statistics: Print port/flow statistics? */ | |
28 | bool print_statistics; | |
29 | ||
30 | /* --clear: Reset existing statistics to zero when modifying a flow? */ | |
31 | bool zero_statistics; | |
32 | ||
33 | /* --may-create: Allow mod-flows command to create a new flow? */ | |
34 | bool may_create; | |
35 | ||
36 | /* --read-only: Do not run R/W commands? */ | |
37 | bool read_only; | |
38 | ||
39 | /* -m, --more: Increase output verbosity. */ | |
40 | int verbosity; | |
41 | ||
42 | /* --names: Use port names in output? */ | |
43 | bool names; | |
44 | ||
45 | /* Callback for printing. This function is called from dpctl_run_command() | |
46 | * to output data. The 'aux' parameter is set to the 'aux' | |
47 | * member. The 'error' parameter is true if 'string' is an error | |
48 | * message, false otherwise */ | |
49 | void (*output)(void *aux, bool error, const char *string); | |
50 | void *aux; | |
51 | ||
52 | /* 'usage' (if != NULL) gets called for the "help" command. */ | |
53 | void (*usage)(void *aux); | |
54 | }; | |
55 | ||
56 | int dpctl_run_command(int argc, const char *argv[], | |
57 | struct dpctl_params *dpctl_p); | |
58 | ||
59 | void dpctl_unixctl_register(void); | |
60 | ||
61 | #endif /* dpctl.h */ |