Skip to content

Commit

Permalink
ofproto: Define official OpenFlow port number.
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Pettit <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
Justin Pettit committed Oct 1, 2013
1 parent efc295d commit 125b029
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 56 deletions.
3 changes: 2 additions & 1 deletion include/openflow/openflow-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ enum ofp_version {
#define OFP_MAX_TABLE_NAME_LEN 32
#define OFP_MAX_PORT_NAME_LEN 16

#define OFP_TCP_PORT 6633
#define OFP_OLD_PORT 6633
#define OFP_PORT 6653

#define OFP_ETH_ALEN 6 /* Bytes in an Ethernet address. */

Expand Down
6 changes: 3 additions & 3 deletions lib/stream-ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ ssl_open(const char *name, char *suffix, struct stream **streamp, uint8_t dscp)
return error;
}

error = inet_open_active(SOCK_STREAM, suffix, OFP_TCP_PORT, &sin, &fd,
error = inet_open_active(SOCK_STREAM, suffix, OFP_OLD_PORT, &sin, &fd,
dscp);
if (fd >= 0) {
int state = error ? STATE_TCP_CONNECTING : STATE_SSL_CONNECTING;
Expand Down Expand Up @@ -797,7 +797,7 @@ pssl_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp,
return retval;
}

fd = inet_open_passive(SOCK_STREAM, suffix, OFP_TCP_PORT, &sin, dscp);
fd = inet_open_passive(SOCK_STREAM, suffix, OFP_OLD_PORT, &sin, dscp);
if (fd < 0) {
return -fd;
}
Expand Down Expand Up @@ -846,7 +846,7 @@ pssl_accept(struct pstream *pstream, struct stream **new_streamp)
}

sprintf(name, "ssl:"IP_FMT, IP_ARGS(sin.sin_addr.s_addr));
if (sin.sin_port != htons(OFP_TCP_PORT)) {
if (sin.sin_port != htons(OFP_OLD_PORT)) {
sprintf(strchr(name, '\0'), ":%"PRIu16, ntohs(sin.sin_port));
}
return new_ssl_stream(name, new_fd, SERVER, STATE_SSL_CONNECTING, &sin,
Expand Down
18 changes: 9 additions & 9 deletions lib/vconn-active.man
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.IP "\fBssl:\fIip\fR[\fB:\fIport\fR]"
The specified SSL \fIport\fR (default: 6633) on the host at the given
\fIip\fR, which must be expressed as an IP address (not a DNS name).
The \fB\-\-private\-key\fR, \fB\-\-certificate\fR, and
\fB\-\-ca\-cert\fR options are mandatory when this form is used.
.
.IP "\fBtcp:\fIip\fR[\fB:\fIport\fR]"
The specified TCP \fIport\fR (default: 6633) on the host at the given
\fIip\fR, which must be expressed as an IP address (not a DNS name).
.
.IQ "\fBtcp:\fIip\fR[\fB:\fIport\fR]"
The specified \fIport\fR on the host at the given \fIip\fR, which must
be expressed as an IP address (not a DNS name). For \fBssl\fR, the
\fB\-\-private\-key\fR, \fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR
options are mandatory.
.IP
If \fIport\fR is not specified, it currently defaults to 6633. In the
future, the default will change to 6653, which is the IANA-defined
value.
.TP
\fBunix:\fIfile\fR
The Unix domain server socket named \fIfile\fR.
22 changes: 10 additions & 12 deletions lib/vconn-passive.man
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
.IP "\fBpssl:\fR[\fIport\fR][\fB:\fIip\fR]"
Listens for OpenFlow SSL connections on \fIport\fR (default: 6633).
The \fB\-\-private\-key\fR, \fB\-\-certificate\fR, and
\fB\-\-ca\-cert\fR options are mandatory when this form is used. By
default, connections are not bound to a particular local IP address,
but \fIip\fR may be specified to listen only for connections to the
given \fIip\fR.
.
.IP "\fBptcp:\fR[\fIport\fR][\fB:\fIip\fR]"
Listens for OpenFlow TCP connections on \fIport\fR (default: 6633).
By default, connections are not bound to a particular local IP
address, but \fIip\fR may be specified to listen only for connections
to the given \fIip\fR.
.IQ "\fBptcp:\fR[\fIport\fR][\fB:\fIip\fR]"
Listens for OpenFlow connections on \fIport\fR. By
default, connections are not bound to a particular local IP address, but
\fIip\fR may be specified to listen only for connections to the given
\fIip\fR. For \fBpssl\fR, the \fB\-\-private\-key\fR,
\fB\-\-certificate\fR, and \fB\-\-ca\-cert\fR options are mandatory.
.IP
If \fIport\fR is not specified, it currently defaults to 6633. In the
future, the default will change to 6653, which is the IANA-defined
value.
.
.IP "\fBpunix:\fIfile\fR"
Listens for OpenFlow connections on the Unix domain server socket
Expand Down
4 changes: 2 additions & 2 deletions lib/vconn-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ vconn_stream_open(const char *name, uint32_t allowed_versions,
struct stream *stream;
int error;

error = stream_open_with_default_port(name, OFP_TCP_PORT, &stream, dscp);
error = stream_open_with_default_port(name, OFP_OLD_PORT, &stream, dscp);
if (!error) {
error = stream_connect(stream);
if (!error || error == EAGAIN) {
Expand Down Expand Up @@ -315,7 +315,7 @@ pvconn_pstream_listen(const char *name, uint32_t allowed_versions,
struct pstream *pstream;
int error;

error = pstream_open_with_default_port(name, OFP_TCP_PORT,
error = pstream_open_with_default_port(name, OFP_OLD_PORT,
&pstream, dscp);
if (error) {
return error;
Expand Down
8 changes: 4 additions & 4 deletions lib/vconn.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ vconn_usage(bool active, bool passive, bool bootstrap OVS_UNUSED)
if (active) {
printf("Active OpenFlow connection methods:\n");
printf(" tcp:IP[:PORT] "
"PORT (default: %d) at remote IP\n", OFP_TCP_PORT);
"PORT (default: %d) at remote IP\n", OFP_OLD_PORT);
#ifdef HAVE_OPENSSL
printf(" ssl:IP[:PORT] "
"SSL PORT (default: %d) at remote IP\n", OFP_TCP_PORT);
"SSL PORT (default: %d) at remote IP\n", OFP_OLD_PORT);
#endif
printf(" unix:FILE Unix domain socket named FILE\n");
}
Expand All @@ -150,11 +150,11 @@ vconn_usage(bool active, bool passive, bool bootstrap OVS_UNUSED)
printf("Passive OpenFlow connection methods:\n");
printf(" ptcp:[PORT][:IP] "
"listen to TCP PORT (default: %d) on IP\n",
OFP_TCP_PORT);
OFP_OLD_PORT);
#ifdef HAVE_OPENSSL
printf(" pssl:[PORT][:IP] "
"listen for SSL on PORT (default: %d) on IP\n",
OFP_TCP_PORT);
OFP_OLD_PORT);
#endif
printf(" punix:FILE "
"listen on Unix domain socket FILE\n");
Expand Down
2 changes: 1 addition & 1 deletion ofproto/connmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ update_in_band_remotes(struct connmgr *mgr)
}

if (stream_parse_target_with_default_port(target,
OFP_TCP_PORT,
OFP_OLD_PORT,
sin)) {
n_addrs++;
}
Expand Down
2 changes: 1 addition & 1 deletion third-party/ofp-tcpdump.patch
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) {
ldp_print(bp, length);
- }
+ } else if (sport == OFP_TCP_PORT || dport == OFP_TCP_PORT) {
+ } else if (sport == OFP_OLD_PORT || dport == OFP_OLD_PORT) {
+ openflow_print(bp, length);
+ }

Expand Down
3 changes: 3 additions & 0 deletions utilities/ovs-controller.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ To bind locally to port 6633 (the default) and wait for incoming
connections from OpenFlow switches:
.IP
\fB% ovs\-controller ptcp:\fR
.PP
In the future, the default port number will change to 6653, which is the
IANA-defined value.
.SH "BUGS"
.PP
Configuring a Citrix XenServer to connect to a particular controller
Expand Down
58 changes: 35 additions & 23 deletions vswitchd/vswitch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2816,18 +2816,27 @@
<dl>
<dt><code>ssl:<var>ip</var></code>[<code>:<var>port</var></code>]</dt>
<dd>
<p>The specified SSL <var>port</var> (default: 6633) on the host at
the given <var>ip</var>, which must be expressed as an IP address
(not a DNS name). The <ref table="Open_vSwitch" column="ssl"/>
column in the <ref table="Open_vSwitch"/> table must point to a
valid SSL configuration when this form is used.</p>
<p>The specified SSL <var>port</var> on the host at the
given <var>ip</var>, which must be expressed as an IP
address (not a DNS name). The <ref table="Open_vSwitch"
column="ssl"/> column in the <ref table="Open_vSwitch"/>
table must point to a valid SSL configuration when this form
is used.</p>
<p>If <var>port</var> is not specified, it currently
defaults to 6633. In the future, the default will change to
6653, which is the IANA-defined value.</p>
<p>SSL support is an optional feature that is not always built as
part of Open vSwitch.</p>
</dd>
<dt><code>tcp:<var>ip</var></code>[<code>:<var>port</var></code>]</dt>
<dd>The specified TCP <var>port</var> (default: 6633) on the host at
the given <var>ip</var>, which must be expressed as an IP address
(not a DNS name).</dd>
<dd>
<p>The specified TCP <var>port</var> on the host at the
given <var>ip</var>, which must be expressed as an IP
address (not a DNS name).</p>
<p>If <var>port</var> is not specified, it currently
defaults to 6633. In the future, the default will change to
6653, which is the IANA-defined value.</p>
</dd>
</dl>
<p>
The following connection methods are currently supported for service
Expand All @@ -2836,26 +2845,29 @@
<dl>
<dt><code>pssl:</code>[<var>port</var>][<code>:<var>ip</var></code>]</dt>
<dd>
<p>
Listens for SSL connections on the specified TCP <var>port</var>
(default: 6633). If <var>ip</var>, which must be expressed as an
IP address (not a DNS name), is specified, then connections are
restricted to the specified local IP address.
</p>
<p>
The <ref table="Open_vSwitch" column="ssl"/> column in the <ref
table="Open_vSwitch"/> table must point to a valid SSL
configuration when this form is used.
</p>
<p> Listens for SSL connections on the specified TCP
<var>port</var>. If <var>ip</var>, which must be expressed
as an IP address (not a DNS name), is specified, then
connections are restricted to the specified local IP
address. The <ref table="Open_vSwitch" column="ssl"/>
column in the <ref table="Open_vSwitch"/> table must point
to a valid SSL configuration when this form is used.</p>
<p>If <var>port</var> is not specified, it currently
defaults to 6633. In the future, the default will change to
6653, which is the IANA-defined value.</p>
<p>SSL support is an optional feature that is not always built as
part of Open vSwitch.</p>
</dd>
<dt><code>ptcp:</code>[<var>port</var>][<code>:<var>ip</var></code>]</dt>
<dd>
Listens for connections on the specified TCP <var>port</var>
(default: 6633). If <var>ip</var>, which must be expressed as an
IP address (not a DNS name), is specified, then connections are
restricted to the specified local IP address.
<p>Listens for connections on the specified TCP
<var>port</var>. If <var>ip</var>, which must be expressed
as an IP address (not a DNS name), is specified, then
connections are restricted to the specified local IP
address.</p>
<p>If <var>port</var> is not specified, it currently
defaults to 6633. In the future, the default will change to
6653, which is the IANA-defined value.</p>
</dd>
</dl>
<p>When multiple controllers are configured for a single bridge, the
Expand Down

0 comments on commit 125b029

Please sign in to comment.