bool sent_config_request; /* Successfully sent config request? */
bool sent_features_request; /* Successfully sent features request? */
+ /* Support for NetFlow. */
+ char *netflow_host; /* NULL if no NetFlow logging; otherwise a
+ * "host:port" string. */
+
/* Support for remote controllers. */
char *controller; /* NULL if there is no remote controller;
* "discover" to do controller discovery;
svec_add_nocopy(&argv, xasprintf("--log-file=%s.secchan-%s",
vlog_get_log_file(), br->name));
}
+ if (br->netflow_host) {
+ svec_add_nocopy(&argv, xasprintf("--netflow=%s", br->netflow_host));
+ }
if (!br->controller) {
svec_add(&argv, "--out-of-band");
svec_add(&argv, "--max-backoff=1");
for (i = 0; i < br->n_ports; i++) {
port_destroy(br->ports[i]);
}
+ free(br->netflow_host);
free(br->controller);
svec_destroy(&br->secchan_opts);
ft_destroy(br->ft);
{
struct svec old_ports, new_ports, ifaces;
const char *controller;
+ const char *netflow_host;
size_t i, j;
char *ctl;
+ char *nf;
/* Collect old and new ports. */
svec_init(&old_ports);
free(br->controller);
br->controller = ctl;
+ /* Configure NetFlow. */
+ netflow_host = cfg_get_string(0, "netflow.%s.host", br->name);
+ nf = netflow_host ? xstrdup(netflow_host) : NULL;
+ if ((nf == NULL) != (br->netflow_host == NULL)
+ || (nf && br->netflow_host && strcmp(nf, br->netflow_host))) {
+ br->sc_retries = 0;
+ kill_secchan(br);
+ }
+ free(br->netflow_host);
+ br->netflow_host = nf;
+
/* Allow arbitrary secchan options if a remote controller is configured. */
svec_clear(&br->secchan_opts);
if (ctl) {
port.eth2.priority = 64
.fi
.RE
+.SS "NetFlow v5 Flow Logging"
+NetFlow provides a number of details about terminating flows, such as the
+principals involved and duration. A bridge may be configured to send
+NetFlow v5 records to a collector when flows end. To enable, define the
+key \fBnetflow.\fIbridge\fB.host\fR to a NetFlow collector in the form
+\fIhost\fB:\fIport\fR. Records from \fIbridge\fR will be sent to
+\fIhost\fR on UDP \fIport\fR.
+.PP
+The following syntax sends NetFlow records for \fBmybr\fR to the NetFlow
+collector \fBnflow.example.com\fR on UDP port \fB9995\fR:
+.PP
+.RS
+.nf
+
+[netflow "mybr"]
+ host = nflow.example.com:9995
+
+.fi
+.RE
.SS "OpenFlow controller connectivity"
By default, \fBvswitchd\fR performs all configured bridging and
switching locally. It can also be configured to connect a given