From 125b02910c61f87364f4c58e3810876ef747a98f Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Fri, 30 Aug 2013 17:26:56 -0700 Subject: [PATCH] ofproto: Define official OpenFlow port number. Signed-off-by: Justin Pettit Acked-by: Ben Pfaff --- include/openflow/openflow-common.h | 3 +- lib/stream-ssl.c | 6 ++-- lib/vconn-active.man | 18 +++++----- lib/vconn-passive.man | 22 ++++++------ lib/vconn-stream.c | 4 +-- lib/vconn.c | 8 ++--- ofproto/connmgr.c | 2 +- third-party/ofp-tcpdump.patch | 2 +- utilities/ovs-controller.8.in | 3 ++ vswitchd/vswitch.xml | 58 ++++++++++++++++++------------ 10 files changed, 70 insertions(+), 56 deletions(-) diff --git a/include/openflow/openflow-common.h b/include/openflow/openflow-common.h index 5b0ccc5f9..45d03ef03 100644 --- a/include/openflow/openflow-common.h +++ b/include/openflow/openflow-common.h @@ -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. */ diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c index 1a77b7955..1e748c007 100644 --- a/lib/stream-ssl.c +++ b/lib/stream-ssl.c @@ -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; @@ -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; } @@ -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, diff --git a/lib/vconn-active.man b/lib/vconn-active.man index be96ca813..bf7aaf7b5 100644 --- a/lib/vconn-active.man +++ b/lib/vconn-active.man @@ -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. diff --git a/lib/vconn-passive.man b/lib/vconn-passive.man index 1edd11835..a9efdb3bd 100644 --- a/lib/vconn-passive.man +++ b/lib/vconn-passive.man @@ -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 diff --git a/lib/vconn-stream.c b/lib/vconn-stream.c index 23145ea08..027f48f19 100644 --- a/lib/vconn-stream.c +++ b/lib/vconn-stream.c @@ -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) { @@ -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; diff --git a/lib/vconn.c b/lib/vconn.c index 8a064851c..5708987d5 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -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"); } @@ -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"); diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 2fd94e212..8a4195d83 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -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++; } diff --git a/third-party/ofp-tcpdump.patch b/third-party/ofp-tcpdump.patch index 5c47061b2..b1ac9a571 100644 --- a/third-party/ofp-tcpdump.patch +++ b/third-party/ofp-tcpdump.patch @@ -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); + } diff --git a/utilities/ovs-controller.8.in b/utilities/ovs-controller.8.in index 162c585dd..f29de6a06 100644 --- a/utilities/ovs-controller.8.in +++ b/utilities/ovs-controller.8.in @@ -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 diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 6fed6eb10..c12fd8fc3 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -2816,18 +2816,27 @@
ssl:ip[:port]
-

The specified SSL port (default: 6633) on the host at - the given ip, which must be expressed as an IP address - (not a DNS name). The - column in the table must point to a - valid SSL configuration when this form is used.

+

The specified SSL port on the host at the + given ip, which must be expressed as an IP + address (not a DNS name). The column in the + table must point to a valid SSL configuration when this form + is used.

+

If port is not specified, it currently + defaults to 6633. In the future, the default will change to + 6653, which is the IANA-defined value.

SSL support is an optional feature that is not always built as part of Open vSwitch.

tcp:ip[:port]
-
The specified TCP port (default: 6633) on the host at - the given ip, which must be expressed as an IP address - (not a DNS name).
+
+

The specified TCP port on the host at the + given ip, which must be expressed as an IP + address (not a DNS name).

+

If port is not specified, it currently + defaults to 6633. In the future, the default will change to + 6653, which is the IANA-defined value.

+

The following connection methods are currently supported for service @@ -2836,26 +2845,29 @@

pssl:[port][:ip]
-

- Listens for SSL connections on the specified TCP port - (default: 6633). If ip, 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 column in the table must point to a valid SSL - configuration when this form is used. -

+

Listens for SSL connections on the specified TCP + port. If ip, 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 + column in the table must point + to a valid SSL configuration when this form is used.

+

If port is not specified, it currently + defaults to 6633. In the future, the default will change to + 6653, which is the IANA-defined value.

SSL support is an optional feature that is not always built as part of Open vSwitch.

ptcp:[port][:ip]
- Listens for connections on the specified TCP port - (default: 6633). If ip, which must be expressed as an - IP address (not a DNS name), is specified, then connections are - restricted to the specified local IP address. +

Listens for connections on the specified TCP + port. If ip, which must be expressed + as an IP address (not a DNS name), is specified, then + connections are restricted to the specified local IP + address.

+

If port is not specified, it currently + defaults to 6633. In the future, the default will change to + 6653, which is the IANA-defined value.

When multiple controllers are configured for a single bridge, the -- 2.43.0