netdev-dpdk: fix mbuf leaks
[cascardo/ovs.git] / lib / dpctl.h
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     /* -m, --more: Increase output verbosity. */
37     int verbosity;
38
39     /* Callback for printing.  This function is called from dpctl_run_command()
40      * to output data.  The 'aux' parameter is set to the 'aux'
41      * member.  The 'error' parameter is true if 'string' is an error
42      * message, false otherwise */
43     void (*output)(void *aux, bool error, const char *string);
44     void *aux;
45
46     /* 'usage' (if != NULL) gets called for the "help" command. */
47     void (*usage)(void *aux);
48 };
49
50 int dpctl_run_command(int argc, const char *argv[],
51                       struct dpctl_params *dpctl_p);
52
53 void dpctl_unixctl_register(void);
54
55 #endif /* dpctl.h */