]> git.proxmox.com Git - mirror_ovs.git/blame - lib/unixctl.h
netdev-offload-tc: Use single 'once' variable for probing tc features
[mirror_ovs.git] / lib / unixctl.h
CommitLineData
064af421 1/*
e0edde6f 2 * Copyright (c) 2008, 2009, 2011 Nicira, Inc.
064af421 3 *
a14bc59f
BP
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:
064af421 7 *
a14bc59f
BP
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.
064af421
BP
15 */
16
17#ifndef UNIXCTL_H
18#define UNIXCTL_H 1
d295e8e9 19
f4ade105
JG
20#ifdef __cplusplus
21extern "C" {
22#endif
064af421
BP
23
24/* Server for Unix domain socket control connection. */
25struct unixctl_server;
26int unixctl_server_create(const char *path, struct unixctl_server **);
27void unixctl_server_run(struct unixctl_server *);
28void unixctl_server_wait(struct unixctl_server *);
29void unixctl_server_destroy(struct unixctl_server *);
30
295fc4d6
BP
31const char *unixctl_server_get_path(const struct unixctl_server *);
32
064af421 33/* Client for Unix domain socket control connection. */
bde9f75d
EJ
34struct jsonrpc;
35int unixctl_client_create(const char *path, struct jsonrpc **client);
36int unixctl_client_transact(struct jsonrpc *client,
37 const char *command,
38 int argc, char *argv[],
39 char **result, char **error);
064af421
BP
40
41/* Command registration. */
42struct unixctl_conn;
8ca79daa 43typedef void unixctl_cb_func(struct unixctl_conn *,
0e15264f
BP
44 int argc, const char *argv[], void *aux);
45void unixctl_command_register(const char *name, const char *usage,
46 int min_args, int max_args,
8ca79daa 47 unixctl_cb_func *cb, void *aux);
bde9f75d
EJ
48void unixctl_command_reply_error(struct unixctl_conn *, const char *error);
49void unixctl_command_reply(struct unixctl_conn *, const char *body);
d295e8e9 50
f4ade105
JG
51#ifdef __cplusplus
52}
53#endif
064af421
BP
54
55#endif /* unixctl.h */