- * Copyright (c) 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* "ovs-appctl --target=<program>" will fail.)
*
* Returns 0 if successful, otherwise a positive errno value. If successful,
* "ovs-appctl --target=<program>" will fail.)
*
* Returns 0 if successful, otherwise a positive errno value. If successful,
int
unixctl_server_create(const char *path, struct unixctl_server **serverp)
{
struct unixctl_server *server;
int error;
int
unixctl_server_create(const char *path, struct unixctl_server **serverp)
{
struct unixctl_server *server;
int error;
unixctl_command_register("help", unixctl_help, NULL);
server = xmalloc(sizeof *server);
list_init(&server->conns);
if (path) {
unixctl_command_register("help", unixctl_help, NULL);
server = xmalloc(sizeof *server);
list_init(&server->conns);
if (path) {
for (i = 0; i < 10; i++) {
int fd = accept(server->fd, NULL, NULL);
if (fd < 0) {
for (i = 0; i < 10; i++) {
int fd = accept(server->fd, NULL, NULL);
if (fd < 0) {
poll_fd_wait(server->fd, POLLIN);
LIST_FOR_EACH (conn, node, &server->conns) {
if (conn->state == S_RECV) {
poll_fd_wait(server->fd, POLLIN);
LIST_FOR_EACH (conn, node, &server->conns) {
if (conn->state == S_RECV) {
\f
/* Connects to a Vlog server socket. 'path' should be the name of a Vlog
* server socket. If it does not start with '/', it will be prefixed with
\f
/* Connects to a Vlog server socket. 'path' should be the name of a Vlog
* server socket. If it does not start with '/', it will be prefixed with
*
* Returns 0 if successful, otherwise a positive errno value. If successful,
* sets '*clientp' to the new unixctl_client, otherwise to NULL. */
*
* Returns 0 if successful, otherwise a positive errno value. If successful,
* sets '*clientp' to the new unixctl_client, otherwise to NULL. */
client->bind_path = xasprintf("/tmp/vlog.%ld.%d",
(long int) getpid(), counter++);
client->bind_path = xasprintf("/tmp/vlog.%ld.%d",
(long int) getpid(), counter++);