X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Funixctl.c;h=ca90b396aa8abf26d50843a015a56849c51ec60f;hb=7cba02e442012a7ae6cfdfe67f858a18057e5470;hp=c333c54e9eb5b8ce4971960e9e6e31ac57437cf9;hpb=fe1e967e3bc6c04f773b150fbb358b2350d0ad8c;p=openvswitch diff --git a/lib/unixctl.c b/lib/unixctl.c index c333c54e..ca90b396 100644 --- a/lib/unixctl.c +++ b/lib/unixctl.c @@ -107,6 +107,13 @@ unixctl_help(struct unixctl_conn *conn, const char *args OVS_UNUSED, ds_destroy(&ds); } +static void +unixctl_version(struct unixctl_conn *conn, const char *args OVS_UNUSED, + void *aux OVS_UNUSED) +{ + unixctl_command_reply(conn, 200, get_program_version()); +} + void unixctl_command_register(const char *name, unixctl_cb_func *cb, void *aux) { @@ -206,6 +213,7 @@ unixctl_server_create(const char *path, struct unixctl_server **serverp) } unixctl_command_register("help", unixctl_help, NULL); + unixctl_command_register("version", unixctl_version, NULL); server = xmalloc(sizeof *server); list_init(&server->conns);