noinst_HEADERS += \
- include/openflow/openflow-mgmt.h \
include/openflow/nicira-ext.h \
include/openflow/openflow.h
/* No longer used. */
NXT_FLOW_END__OBSOLETE,
- /* Management protocol. See "openflow-mgmt.h". */
- NXT_MGMT,
+ /* No longer used. */
+ NXT_MGMT__OBSOLETE,
};
struct nicira_header {
+++ /dev/null
-/*
- * Copyright (c) 2009 Nicira Networks.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef OPENFLOW_OPENFLOW_MGMT_H
-#define OPENFLOW_OPENFLOW_MGMT_H 1
-
-#include "openflow/nicira-ext.h"
-
-enum ofmp_type {
- OFMPT_CAPABILITY_REQUEST,
- OFMPT_CAPABILITY_REPLY,
- OFMPT_RESOURCES_REQUEST,
- OFMPT_RESOURCES_UPDATE,
- OFMPT_CONFIG_REQUEST,
- OFMPT_CONFIG_UPDATE,
- OFMPT_CONFIG_UPDATE_ACK,
- OFMPT_ERROR,
- OFMPT_EXTENDED_DATA
-};
-
-/* Header on all OpenFlow management packets. */
-struct ofmp_header {
- struct nicira_header header;
- uint16_t type; /* One of OFMPT_* above. */
- uint8_t pad[2];
-};
-OFP_ASSERT(sizeof(struct ofmp_header) == sizeof(struct nicira_header) + 4);
-
-
-/* Generic TLV header. */
-struct ofmp_tlv {
- uint16_t type; /* Type of value (one of OFMPTLV_*). */
- uint16_t len; /* Length of TLV (includes this header). */
- uint8_t data[0]; /* Value of data as defined by type and length. */
-};
-OFP_ASSERT(sizeof(struct ofmp_tlv) == 4);
-
-/* Universal TLV terminator. Used to indicate end of TLV list. */
-struct ofmp_tlv_end {
- uint16_t type; /* Type is 0. */
- uint16_t len; /* Length is 4. */
-};
-OFP_ASSERT(sizeof(struct ofmp_tlv_end) == 4);
-
-
-/* Bitmask of capability description styles. */
-enum ofmp_capability_format {
- OFMPCAF_SIMPLE = 0 << 0, /* "ovs-vswitchd.conf" style. */
-};
-
-/* Body of capbility request.
- *
- * OFMPT_CAPABILITY_REQUEST (controller -> switch) */
-struct ofmp_capability_request {
- struct ofmp_header header;
- uint32_t format; /* One of OFMPCAF_*. */
-};
-OFP_ASSERT(sizeof(struct ofmp_capability_request) == 24);
-
-/* Body of reply to capability request.
- *
- * OFMPT_CAPABILITY_REPLY (switch -> controller). */
-struct ofmp_capability_reply {
- struct ofmp_header header;
- uint32_t format; /* One of OFMPCAF_*. */
- uint64_t mgmt_id; /* Management ID. */
- uint8_t data[0];
-};
-OFP_ASSERT(sizeof(struct ofmp_capability_reply) == 32);
-
-
-/* Resource TLV for datapath description. */
-struct ofmptsr_dp {
- uint16_t type; /* OFMPTSR_DP. */
- uint16_t len; /* 32. */
- uint8_t pad[4];
- uint64_t dp_id; /* Datapath ID. */
- uint8_t name[OFP_MAX_PORT_NAME_LEN]; /* Null-terminated name. */
-};
-OFP_ASSERT(sizeof(struct ofmptsr_dp) == 32);
-
-/* UUIDs will be passed around as *non-terminated* strings in their
- * canonical form (e.g., 550e8400-e29b-41d4-a716-446655440000).
- */
-#define OFMP_UUID_LEN 36
-
-/* Resource TLV for XenServer UUIDs associated with this datapath. */
-struct ofmptsr_dp_uuid {
- uint16_t type; /* OFMPTSR_DP_UUID. */
- uint16_t len; /* Length. */
- uint8_t pad[4];
- uint64_t dp_id; /* Datapath ID. */
- uint8_t uuid_list[0]; /* List of UUIDs associated with
- * this datapath. */
-};
-OFP_ASSERT(sizeof(struct ofmptsr_dp_uuid) == 16);
-
-/* Resource TLV for XenServer UUID associated with this managment
- * instance.
- */
-struct ofmptsr_mgmt_uuid {
- uint16_t type; /* OFMPTSR_MGMT_UUID. */
- uint16_t len; /* 52. */
- uint8_t pad[4];
- uint64_t mgmt_id; /* Management ID. */
- uint8_t uuid[OFMP_UUID_LEN]; /* System UUID. */
- uint8_t pad2[4]; /* Pad for 64-bit systems. */
-};
-OFP_ASSERT(sizeof(struct ofmptsr_mgmt_uuid) == 56);
-
-/* Resource TLV for details about this XenServer vif. */
-struct ofmptsr_vif {
- uint16_t type; /* OFMPTSR_VIF. */
- uint16_t len; /* 136. */
- uint8_t name[OFP_MAX_PORT_NAME_LEN]; /* Null-terminated name. */
- uint8_t vif_uuid[OFMP_UUID_LEN]; /* VIF UUID. */
- uint8_t vm_uuid[OFMP_UUID_LEN]; /* VM UUID. */
- uint8_t net_uuid[OFMP_UUID_LEN]; /* Network UUID. */
- uint64_t vif_mac; /* Management ID. */
-};
-OFP_ASSERT(sizeof(struct ofmptsr_vif) == 136);
-
-/* TLV types for switch resource descriptions. */
-enum ofmp_switch_resources {
- OFMPTSR_END = 0, /* Terminator. */
- OFMPTSR_DP, /* Datapath. */
- OFMPTSR_DP_UUID, /* Xen: datapath uuid's. */
- OFMPTSR_MGMT_UUID, /* Xen: management uuid. */
- OFMPTSR_VIF, /* Xen: vif details. */
-};
-
-/* Body of resources request.
- *
- * OFMPT_RESOURCES_REQUEST (controller -> switch) */
-struct ofmp_resources_request {
- struct ofmp_header header;
-};
-
-/* Body of capbility update. Sent in response to a resources request or
- * sent asynchronously when resources change on the switch.
- *
- * OFMPT_RESOURCES_UPDATE (switch -> controller) */
-struct ofmp_resources_update {
- struct ofmp_header header;
- uint8_t data[0];
-};
-OFP_ASSERT(sizeof(struct ofmp_resources_update) == 20);
-
-
-/* Bitmask of capability description styles. */
-enum ofmp_config_format {
- OFMPCOF_SIMPLE = 0 << 0, /* "ovs-vswitchd.conf" style. */
-};
-
-#define CONFIG_COOKIE_LEN 20
-
-/* Body of configuration request.
- *
- * OFMPT_CONFIG_REQUEST (controller -> switch) */
-struct ofmp_config_request {
- struct ofmp_header header;
- uint32_t format; /* One of OFMPCOF_*. */
-};
-OFP_ASSERT(sizeof(struct ofmp_config_request) == 24);
-
-/* Body of configuration update. Sent in response to a configuration
- * request from the controller. May be sent asynchronously by either
- * the controller or switch to modify configuration or notify of
- * changes, respectively. If sent by the controller, the switch must
- * respond with a OFMPT_CONFIG_UPDATE_ACK.
- *
- * OFMPT_CONFIG_UPDATE (switch <-> controller) */
-struct ofmp_config_update {
- struct ofmp_header header;
- uint32_t format; /* One of OFMPCOF_*. */
- uint8_t cookie[CONFIG_COOKIE_LEN]; /* Cookie of config attempting to be
- * replaced by this update. */
- uint8_t data[0];
-};
-OFP_ASSERT(sizeof(struct ofmp_config_update) == 44);
-
-/* Bitmask of configuration update ack flags. */
-enum ofmp_config_update_ack_flags {
- OFMPCUAF_SUCCESS = 1 << 0, /* Config succeeded. */
-};
-
-/* Body of configuration update ack. Sent in response to a configuration
- * udpate request.
- *
- * OFMPT_CONFIG_UPDATE_ACK (switch -> controller) */
-struct ofmp_config_update_ack {
- struct ofmp_header header;
- uint32_t format; /* One of OFMPCOF_*. */
- uint32_t flags; /* One of OFMPCUAF_*. */
- uint8_t cookie[CONFIG_COOKIE_LEN]; /* Cookie of current configuration
- * being used in the switch. */
-};
-OFP_ASSERT(sizeof(struct ofmp_config_update_ack) == 48);
-
-/* Values for 'type' in ofmp_error_msg. */
-enum ofmp_error_type {
- OFMPET_BAD_CONFIG /* Problem with configuration. */
-};
-
-/* ofmp_error_msg 'code' values for OFMPET_BAD_CONFIG. 'data' contains
- * at least the first 64 bytes of the failed request. */
-enum ofmp_bad_config_code {
- OFMPBCC_BUSY, /* Config updating, try again. */
- OFMPBCC_OLD_COOKIE, /* Config has changed. */
-};
-
-/* Body of error message. May be sent by either the switch or the
- * controller to indicate some error condition.
- *
- * OFMPT_ERROR (switch <-> controller) */
-struct ofmp_error_msg {
- struct ofmp_header header;
-
- uint16_t type; /* One of OFMPET_*. */
- uint16_t code; /* Code depending on 'type'. */
- uint8_t data[0]; /* Variable-length data. Interpreted based
- on the type and code. */
-};
-OFP_ASSERT(sizeof(struct ofmp_error_msg) == 24);
-
-/* Bitmask of extended data message flags. */
-enum ofmp_extended_data_flags {
- OFMPEDF_MORE_DATA = 1 << 0, /* More data follows. */
-};
-
-/* Body of extended data message. May be sent by either the switch or the
- * controller to send messages that are greater than 65535 bytes in
- * length. The OpenFlow transaction id (xid) must be the same for all
- * the individual OpenFlow messages that make up an extended message.
- *
- * OFMPT_EXTENDED_DATA (switch <-> controller) */
-struct ofmp_extended_data {
- struct ofmp_header header;
-
- uint16_t type; /* Type code of the encapsulated message. */
- uint8_t flags; /* One of OFMPEDF_*. */
- uint8_t pad;
- uint8_t data[0]; /* Variable-length data. */
-};
-OFP_ASSERT(sizeof(struct ofmp_extended_data) == 24);
-
-#endif /* openflow/openflow-mgmt.h */
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
VLOG_MODULE(learning_switch)
VLOG_MODULE(lockfile)
VLOG_MODULE(mac_learning)
-VLOG_MODULE(mgmt)
VLOG_MODULE(netdev)
VLOG_MODULE(netdev_linux)
VLOG_MODULE(netflow)
#include "ofpbuf.h"
#include "openflow/nicira-ext.h"
#include "openflow/openflow.h"
-#include "openflow/openflow-mgmt.h"
#include "openvswitch/datapath-protocol.h"
#include "packets.h"
#include "pinsched.h"
/* Settings. */
uint64_t datapath_id; /* Datapath ID. */
uint64_t fallback_dpid; /* Datapath ID if no better choice found. */
- uint64_t mgmt_id; /* Management channel identifier. */
char *manufacturer; /* Manufacturer. */
char *hardware; /* Hardware. */
char *software; /* Software version. */
}
}
-void
-ofproto_set_mgmt_id(struct ofproto *p, uint64_t mgmt_id)
-{
- p->mgmt_id = mgmt_id;
-}
-
void
ofproto_set_probe_interval(struct ofproto *p, int probe_interval)
{
return ofproto->datapath_id;
}
-uint64_t
-ofproto_get_mgmt_id(const struct ofproto *ofproto)
-{
- return ofproto->mgmt_id;
-}
-
int
ofproto_get_probe_interval(const struct ofproto *ofproto)
{
}
}
-static void
-send_capability_reply(struct ofproto *p, struct ofconn *ofconn, uint32_t xid)
-{
- struct ofmp_capability_reply *ocr;
- struct ofpbuf *b;
- char capabilities[] = "com.nicira.mgmt.manager=false\n";
-
- ocr = make_openflow_xid(sizeof(*ocr), OFPT_VENDOR, xid, &b);
- ocr->header.header.vendor = htonl(NX_VENDOR_ID);
- ocr->header.header.subtype = htonl(NXT_MGMT);
- ocr->header.type = htons(OFMPT_CAPABILITY_REPLY);
-
- ocr->format = htonl(OFMPCOF_SIMPLE);
- ocr->mgmt_id = htonll(p->mgmt_id);
-
- ofpbuf_put(b, capabilities, strlen(capabilities));
-
- queue_tx(b, ofconn, ofconn->reply_counter);
-}
-
-static int
-handle_ofmp(struct ofproto *p, struct ofconn *ofconn,
- struct ofmp_header *ofmph)
-{
- size_t msg_len = ntohs(ofmph->header.header.length);
- if (msg_len < sizeof(*ofmph)) {
- VLOG_WARN_RL(&rl, "dropping short managment message: %zu\n", msg_len);
- return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_BAD_LENGTH);
- }
-
- if (ofmph->type == htons(OFMPT_CAPABILITY_REQUEST)) {
- struct ofmp_capability_request *ofmpcr;
-
- if (msg_len < sizeof(struct ofmp_capability_request)) {
- VLOG_WARN_RL(&rl, "dropping short capability request: %zu\n",
- msg_len);
- return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_BAD_LENGTH);
- }
-
- ofmpcr = (struct ofmp_capability_request *)ofmph;
- if (ofmpcr->format != htonl(OFMPCAF_SIMPLE)) {
- /* xxx Find a better type than bad subtype */
- return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_BAD_SUBTYPE);
- }
-
- send_capability_reply(p, ofconn, ofmph->header.header.xid);
- return 0;
- } else {
- return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_BAD_SUBTYPE);
- }
-}
-
static int
handle_vendor(struct ofproto *p, struct ofconn *ofconn, void *msg)
{
case NXT_ACT_GET_CONFIG:
return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_BAD_SUBTYPE); /* XXX */
-
- case NXT_MGMT:
- return handle_ofmp(p, ofconn, msg);
}
return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_BAD_SUBTYPE);
/* Configuration. */
void ofproto_set_datapath_id(struct ofproto *, uint64_t datapath_id);
-void ofproto_set_mgmt_id(struct ofproto *, uint64_t mgmt_id);
void ofproto_set_probe_interval(struct ofproto *, int probe_interval);
void ofproto_set_max_backoff(struct ofproto *, int max_backoff);
void ofproto_set_desc(struct ofproto *,
/* Configuration querying. */
uint64_t ofproto_get_datapath_id(const struct ofproto *);
-uint64_t ofproto_get_mgmt_id(const struct ofproto *);
int ofproto_get_probe_interval(const struct ofproto *);
int ofproto_get_max_backoff(const struct ofproto *);
bool ofproto_get_in_band(const struct ofproto *);
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
config_status_cb(struct status_reply *sr, void *ofproto_)
{
const struct ofproto *ofproto = ofproto_;
- uint64_t datapath_id, mgmt_id;
+ uint64_t datapath_id;
struct svec listeners;
int probe_interval, max_backoff;
size_t i;
status_reply_put(sr, "datapath-id=%"PRIx64, datapath_id);
}
- mgmt_id = ofproto_get_mgmt_id(ofproto);
- if (mgmt_id) {
- status_reply_put(sr, "mgmt-id=%"PRIx64, mgmt_id);
- }
-
svec_init(&listeners);
ofproto_get_listeners(ofproto, &listeners);
for (i = 0; i < listeners.n; i++) {
Ethernet address of the datapath's local port (which is typically
randomly generated).
-.TP
-\fB--mgmt-id=\fImgmtid\fR
-Sets \fImgmtid\fR, which must consist of exactly 12 hexadecimal
-digits, as the switch's management ID.
-
-If this option is omitted, the management ID defaults to 0, signaling
-to the controller that management is supported but not configured.
-
.TP
\fB--fail=\fR[\fBopen\fR|\fBclosed\fR]
The controller is, ordinarily, responsible for setting up all flows on
/* Spanning tree protocol. */
bool enable_stp;
- /* Management. */
- uint64_t mgmt_id; /* Management ID. */
-
/* NetFlow. */
struct svec netflow; /* NetFlow targets. */
};
if (s.datapath_id) {
ofproto_set_datapath_id(ofproto, s.datapath_id);
}
- if (s.mgmt_id) {
- ofproto_set_mgmt_id(ofproto, s.mgmt_id);
- }
ofproto_set_desc(ofproto, s.mfr_desc, s.hw_desc, s.sw_desc, s.serial_desc);
if (!s.listeners.n) {
svec_add_nocopy(&s.listeners, xasprintf("punix:%s/%s.mgmt",
{"out-of-band", no_argument, 0, OPT_OUT_OF_BAND},
{"in-band", no_argument, 0, OPT_IN_BAND},
{"netflow", required_argument, 0, OPT_NETFLOW},
- {"mgmt-id", required_argument, 0, OPT_MGMT_ID},
{"ports", required_argument, 0, OPT_PORTS},
{"verbose", optional_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
s->enable_stp = false;
s->in_band = true;
svec_init(&s->netflow);
- s->mgmt_id = 0;
svec_init(&s->ports);
for (;;) {
int c;
svec_add(&s->netflow, optarg);
break;
- case OPT_MGMT_ID:
- if (strlen(optarg) != 12
- || strspn(optarg, "0123456789abcdefABCDEF") != 12) {
- ovs_fatal(0, "argument to --mgmt-id must be "
- "exactly 12 hex digits");
- }
- s->mgmt_id = strtoll(optarg, NULL, 16);
- if (!s->mgmt_id) {
- ovs_fatal(0, "argument to --mgmt-id must be nonzero");
- }
- break;
-
case 'l':
svec_add(&s->listeners, optarg);
break;
printf("\nOpenFlow options:\n"
" -d, --datapath-id=ID Use ID as the OpenFlow switch ID\n"
" (ID must consist of 12 hex digits)\n"
- " --mgmt-id=ID Use ID as the management ID\n"
- " (ID must consist of 12 hex digits)\n"
" --manufacturer=MFR Identify manufacturer as MFR\n"
" --hardware=HW Identify hardware as HW\n"
" --software=SW Identify software as SW\n"
{&ovsrec_open_vswitch_col_bridges, VSCF_READONLY, NULL},
{&ovsrec_open_vswitch_col_controller, VSCF_READONLY, NULL},
{&ovsrec_open_vswitch_col_cur_cfg, VSCF_HIDDEN, NULL},
- {&ovsrec_open_vswitch_col_management_id, 0, "[0-9a-fA-F]{12}"},
{&ovsrec_open_vswitch_col_managers, 0, "p?(ssl|tcp|unix):.*"},
{&ovsrec_open_vswitch_col_next_cfg, VSCF_HIDDEN, NULL},
{&ovsrec_open_vswitch_col_ssl, VSCF_READONLY, NULL},
struct svec listeners, old_listeners;
struct svec snoops, old_snoops;
struct shash_node *node;
- uint64_t mgmt_id;
size_t i;
/* Collect old ports. */
}
}
- dpid_from_string(ovs_cfg->management_id, &mgmt_id);
- ofproto_set_mgmt_id(br->ofproto, mgmt_id);
-
/* Get rid of deleted ports and add new ports. */
SHASH_FOR_EACH (node, &old_ports) {
if (!shash_find(&new_ports, node->name)) {
"bridges": {
"comment": "Set of bridges managed by the daemon.",
"type": {"key": "uuid", "min": 0, "max": "unlimited"}},
- "management_id": {
- "comment": "Exactly 12 hex digits that identify the daemon.",
- "type": "string"},
"controller": {
"comment": "Default Controller used by bridges.",
"type": {"key": "uuid", "min": 0, "max": 1}},