/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
VLOG_INFO("%s: connecting...", rc->name);
}
rc->n_attempted_connections++;
- retval = vconn_open(rc->target, rc->allowed_versions,
- &rc->vconn, rc->dscp);
+ retval = vconn_open(rc->target, rc->allowed_versions, rc->dscp,
+ &rc->vconn);
if (!retval) {
rc->remote_ip = vconn_get_remote_ip(rc->vconn);
rc->local_ip = vconn_get_local_ip(rc->vconn);
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* stores a pointer to the new connection in '*vconnp', otherwise a null
* pointer. */
int
-vconn_open(const char *name, uint32_t allowed_versions,
- struct vconn **vconnp, uint8_t dscp)
+vconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp,
+ struct vconn **vconnp)
{
struct vconn_class *class;
struct vconn *vconn;
}
int
-vconn_open_block(const char *name, uint32_t allowed_versions,
+vconn_open_block(const char *name, uint32_t allowed_versions, uint8_t dscp,
struct vconn **vconnp)
{
struct vconn *vconn;
fatal_signal_run();
- error = vconn_open(name, allowed_versions, &vconn, DSCP_DEFAULT);
+ error = vconn_open(name, allowed_versions, dscp, &vconn);
if (!error) {
error = vconn_connect_block(vconn);
}
* stores a pointer to the new connection in '*pvconnp', otherwise a null
* pointer. */
int
-pvconn_open(const char *name, uint32_t allowed_versions,
- struct pvconn **pvconnp, uint8_t dscp)
+pvconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp,
+ struct pvconn **pvconnp)
{
struct pvconn_class *class;
struct pvconn *pvconn;
/* Active vconns: virtual connections to OpenFlow devices. */
int vconn_verify_name(const char *name);
-int vconn_open(const char *name, uint32_t allowed_versions,
- struct vconn **vconnp, uint8_t dscp);
+int vconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp,
+ struct vconn **vconnp);
void vconn_close(struct vconn *);
const char *vconn_get_name(const struct vconn *);
uint32_t vconn_get_allowed_versions(const struct vconn *vconn);
void vconn_run(struct vconn *);
void vconn_run_wait(struct vconn *);
-int vconn_open_block(const char *name, uint32_t allowed_versions,
+int vconn_open_block(const char *name, uint32_t allowed_versions, uint8_t dscp,
struct vconn **);
int vconn_connect_block(struct vconn *);
int vconn_send_block(struct vconn *, struct ofpbuf *);
/* Passive vconns: virtual listeners for incoming OpenFlow connections. */
int pvconn_verify_name(const char *name);
-int pvconn_open(const char *name, uint32_t allowed_versions,
- struct pvconn **pvconnp, uint8_t dscp);
+int pvconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp,
+ struct pvconn **pvconnp);
const char *pvconn_get_name(const struct pvconn *);
void pvconn_close(struct pvconn *);
int pvconn_accept(struct pvconn *, struct vconn **);
/*
- * Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
SSET_FOR_EACH (name, sset) {
struct pvconn *pvconn;
int error;
- error = pvconn_open(name, 0, &pvconn, 0);
+ error = pvconn_open(name, 0, 0, &pvconn);
if (!error) {
pvconns[n_pvconns++] = pvconn;
} else {
struct pvconn *pvconn;
int error;
- error = pvconn_open(target, allowed_versions, &pvconn, dscp);
+ error = pvconn_open(target, allowed_versions, dscp, &pvconn);
if (error) {
return error;
}
/*
- * Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
int error;
fpv_create(type, &fpv);
- CHECK_ERRNO(vconn_open(fpv.vconn_name, 0, &vconn, DSCP_DEFAULT), 0);
+ CHECK_ERRNO(vconn_open(fpv.vconn_name, 0, DSCP_DEFAULT, &vconn), 0);
fpv_close(&fpv);
vconn_run(vconn);
int error;
fpv_create(type, &fpv);
- CHECK_ERRNO(vconn_open(fpv.vconn_name, 0, &vconn, DSCP_DEFAULT), 0);
+ CHECK_ERRNO(vconn_open(fpv.vconn_name, 0, DSCP_DEFAULT, &vconn), 0);
vconn_run(vconn);
stream_close(fpv_accept(&fpv));
fpv_close(&fpv);
int error;
fpv_create(type, &fpv);
- CHECK_ERRNO(vconn_open(fpv.vconn_name, 0, &vconn, DSCP_DEFAULT), 0);
+ CHECK_ERRNO(vconn_open(fpv.vconn_name, 0, DSCP_DEFAULT, &vconn), 0);
vconn_run(vconn);
stream = fpv_accept(&fpv);
fpv_destroy(&fpv);
size_t n_sent;
fpv_create(type, &fpv);
- CHECK_ERRNO(vconn_open(fpv.vconn_name, 0, &vconn, DSCP_DEFAULT), 0);
+ CHECK_ERRNO(vconn_open(fpv.vconn_name, 0, DSCP_DEFAULT, &vconn), 0);
vconn_run(vconn);
stream = fpv_accept(&fpv);
fpv_destroy(&fpv);
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
const char *name = argv[i];
struct vconn *vconn;
- retval = vconn_open(name, get_allowed_ofp_versions(),
- &vconn, DSCP_DEFAULT);
+ retval = vconn_open(name, get_allowed_ofp_versions(), DSCP_DEFAULT,
+ &vconn);
if (!retval) {
if (n_switches >= MAX_SWITCHES) {
ovs_fatal(0, "max %d switch connections", n_switches);
} else if (retval == EAFNOSUPPORT) {
struct pvconn *pvconn;
retval = pvconn_open(name, get_allowed_ofp_versions(),
- &pvconn, DSCP_DEFAULT);
+ DSCP_DEFAULT, &pvconn);
if (!retval) {
if (n_listeners >= MAX_LISTENERS) {
ovs_fatal(0, "max %d passive connections", n_listeners);
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
char *vconn_name = xasprintf("unix:%s", name);
int error;
- error = vconn_open(vconn_name, get_allowed_ofp_versions(), vconnp,
- DSCP_DEFAULT);
+ error = vconn_open(vconn_name, get_allowed_ofp_versions(), DSCP_DEFAULT,
+ vconnp);
if (error && error != ENOENT) {
ovs_fatal(0, "%s: failed to open socket (%s)", name,
strerror(error));
free(datapath_type);
if (strchr(name, ':')) {
- run(vconn_open_block(name, get_allowed_ofp_versions(), vconnp),
+ run(vconn_open_block(name, get_allowed_ofp_versions(), DSCP_DEFAULT,
+ vconnp),
"connecting to %s", name);
} else if (!open_vconn_socket(name, vconnp)) {
/* Fall Through. */