ofproto: Fix potential leak during flow mods.
[sliver-openvswitch.git] / lib / unixctl.h
index 8eb190b..ce43893 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2011 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2011 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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
 }