vconn: Delete fd-based vconns.
authorBen Pfaff <blp@nicira.com>
Mon, 9 Mar 2009 22:39:46 +0000 (15:39 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 9 Mar 2009 22:49:38 +0000 (15:49 -0700)
These vconns were only a crappy kluge for communication between vswitchd
and its subordinate secchans.  We are better off rid of them.

lib/automake.mk
lib/rconn.c
lib/vconn-fd.c [deleted file]
lib/vconn-provider.h
lib/vconn.c
lib/vconn.h
lib/vlog-modules.def

index 0b3738e19beb7bab925d85667a4b8b156850f8a2..704e0e753818d77df1af395dcb8e38976e5d8697 100644 (file)
@@ -84,7 +84,6 @@ lib_libopenflow_a_SOURCES = \
        lib/type-props.h \
        lib/util.c \
        lib/util.h \
-       lib/vconn-fd.c \
        lib/vconn-provider.h \
        lib/vconn-ssl.h \
        lib/vconn-stream.c \
index 9b4ae551da4eb0f8cd941ac3d52dd31369c3eea6..f7a5e4b56211f63511c41aebc78329222638b8d7 100644 (file)
@@ -339,9 +339,6 @@ reconnect(struct rconn *rc)
     rc->n_attempted_connections++;
     retval = vconn_open(rc->name, OFP_VERSION, &rc->vconn);
     if (!retval) {
-        if (!vconn_is_reconnectable(rc->vconn)) {
-            rc->reliable = false;
-        }
         rc->backoff_deadline = time_now() + rc->backoff;
         state_transition(rc, S_CONNECTING);
     } else {
diff --git a/lib/vconn-fd.c b/lib/vconn-fd.c
deleted file mode 100644 (file)
index ccc6768..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford
- * Junior University
- *
- * We are making the OpenFlow specification and associated documentation
- * (Software) available for public use and benefit with the expectation
- * that others will use, modify and enhance the Software and contribute
- * those enhancements back to the community. However, since we would
- * like to make the Software available for broadest use, with as few
- * restrictions as possible permission is hereby granted, free of
- * charge, to any person obtaining a copy of this Software to deal in
- * the Software under the copyrights without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * The name and trademarks of copyright holder(s) may NOT be used in
- * advertising or publicity pertaining to the Software or any
- * derivatives without specific, written prior permission.
- */
-
-#include <config.h>
-#include "vconn.h"
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include "util.h"
-#include "vconn-provider.h"
-#include "vconn-stream.h"
-
-#include "vlog.h"
-#define THIS_MODULE VLM_vconn_fd
-
-/* File descriptor. */
-
-static int
-fd_open(const char *name, char *suffix, struct vconn **vconnp)
-{
-    int fd = atoi(suffix);
-    struct stat s;
-
-    /* Check that 'fd' is really open and is really the right type of fd. */
-    if (fstat(fd, &s) < 0) {
-        VLOG_ERR("%s: failed to stat file descriptor %d: %s",
-                 name, fd, strerror(errno));
-        return errno;
-    }
-    if (!S_ISSOCK(s.st_mode)) {
-        VLOG_ERR("%s: file descriptor %d is not a socket", name, fd);
-        return errno;
-    }
-
-    return new_stream_vconn(name, fd, 0, 0, false, vconnp);
-}
-
-struct vconn_class fd_vconn_class = {
-    "fd",                       /* name */
-    fd_open,                    /* open */
-    NULL,                       /* close */
-    NULL,                       /* connect */
-    NULL,                       /* recv */
-    NULL,                       /* send */
-    NULL,                       /* wait */
-};
index 8098c15becc724d6a2f973bbb69278dc19979553..abf20559df0e963a3cf1cf7a58f82cf37aa1d144 100644 (file)
@@ -179,7 +179,6 @@ extern struct vconn_class tcp_vconn_class;
 extern struct pvconn_class ptcp_pvconn_class;
 extern struct vconn_class unix_vconn_class;
 extern struct pvconn_class punix_pvconn_class;
-extern struct vconn_class fd_vconn_class;
 #ifdef HAVE_OPENSSL
 extern struct vconn_class ssl_vconn_class;
 extern struct pvconn_class pssl_pvconn_class;
index 4dd25a674b58c862470590795489cdf8593fb94d..adadf890ff855b1586a71887e113313837293a2a 100644 (file)
@@ -73,7 +73,6 @@ static struct vconn_class *vconn_classes[] = {
 #ifdef HAVE_OPENSSL
     &ssl_vconn_class,
 #endif
-    &fd_vconn_class,
 };
 
 static struct pvconn_class *pvconn_classes[] = {
@@ -156,7 +155,6 @@ vconn_usage(bool active, bool passive, bool bootstrap UNUSED)
                "SSL PORT (default: %d) on remote HOST\n", OFP_SSL_PORT);
 #endif
         printf("  unix:FILE               Unix domain socket named FILE\n");
-        printf("  fd:N                    File descriptor N\n");
     }
 
     if (passive) {
@@ -277,19 +275,6 @@ vconn_get_ip(const struct vconn *vconn)
     return vconn->ip;
 }
 
-/* Returns true if, when 'vconn' is closed, it is possible to try to reconnect
- * to it using the name that was originally used.  This is ordinarily the case.
- *
- * Returns false if reconnecting under the same name will never work in the way
- * that you would expect.  This is the case if 'vconn' represents a "fd:N" type
- * vconn; one can never connect to such a vconn more than once, because closing
- * it closes the file descriptor. */
-bool
-vconn_is_reconnectable(const struct vconn *vconn)
-{
-    return vconn->reconnectable;
-}
-
 static void
 vcs_connecting(struct vconn *vconn) 
 {
index 192962c4f55694cffe489f3deff10cc0ace438b6..54893e06e970c4339a68c8258f409f2fee743bb5 100644 (file)
@@ -56,7 +56,6 @@ int vconn_open(const char *name, int min_version, struct vconn **);
 void vconn_close(struct vconn *);
 const char *vconn_get_name(const struct vconn *);
 uint32_t vconn_get_ip(const struct vconn *);
-bool vconn_is_reconnectable(const struct vconn *);
 int vconn_connect(struct vconn *);
 int vconn_recv(struct vconn *, struct ofpbuf **);
 int vconn_send(struct vconn *, struct ofpbuf *);
index b8aa1d35f4f8aaa8da968bebc978f1170088fda9..4e3f6e4c874c80a9438ce875b3b00dbdb9da47cc 100644 (file)
@@ -42,7 +42,6 @@ VLOG_MODULE(svec)
 VLOG_MODULE(switch)
 VLOG_MODULE(terminal)
 VLOG_MODULE(socket_util)
-VLOG_MODULE(vconn_fd)
 VLOG_MODULE(vconn_tcp)
 VLOG_MODULE(vconn_ssl)
 VLOG_MODULE(vconn_stream)