2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

unixctl: New JSON RPC back-end.

The unixctl library had used the vde2 management protocol since the
early days of Open vSwitch.  As Open vSwitch has matured, several
Python daemons have been added to the code base which would benefit
from a unixctl implementations.  Instead of implementing the old
unixctl protocol in Python, this patch changes unixctl to use JSON
RPC for which we already have an implementation in both Python and
C.  Future patches will need to implement a unixctl library in
Python on top of JSON RPC.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
Ethan Jackson
2012-02-14 20:53:59 -08:00
parent d35f8e72cd
commit bde9f75de1
22 changed files with 388 additions and 543 deletions

View File

@@ -29,13 +29,12 @@ void unixctl_server_wait(struct unixctl_server *);
void unixctl_server_destroy(struct unixctl_server *);
/* Client for Unix domain socket control connection. */
struct unixctl_client;
int unixctl_client_create(const char *path, struct unixctl_client **);
void unixctl_client_destroy(struct unixctl_client *);
int unixctl_client_transact(struct unixctl_client *,
const char *request,
int *reply_code, char **reply_body);
const char *unixctl_client_target(const struct unixctl_client *);
struct jsonrpc;
int unixctl_client_create(const char *path, struct jsonrpc **client);
int unixctl_client_transact(struct jsonrpc *client,
const char *command,
int argc, char *argv[],
char **result, char **error);
/* Command registration. */
struct unixctl_conn;
@@ -44,8 +43,8 @@ typedef void unixctl_cb_func(struct unixctl_conn *,
void unixctl_command_register(const char *name, const char *usage,
int min_args, int max_args,
unixctl_cb_func *cb, void *aux);
void unixctl_command_reply(struct unixctl_conn *, int code,
const char *body);
void unixctl_command_reply_error(struct unixctl_conn *, const char *error);
void unixctl_command_reply(struct unixctl_conn *, const char *body);
#ifdef __cplusplus
}