X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fopenflow%2Fopenflow-mgmt.h;h=04017d425d25ae590614f764e5e7ba9212f33302;hb=c38cd4bc703054bb77a5261a6b934dfc8e52c0c6;hp=1b4f1a0c9535835a1575c436d56f4593229d4faf;hpb=064af42167bf4fc9aaea2702d80ce08074b889c0;p=openvswitch diff --git a/include/openflow/openflow-mgmt.h b/include/openflow/openflow-mgmt.h index 1b4f1a0c..04017d42 100644 --- a/include/openflow/openflow-mgmt.h +++ b/include/openflow/openflow-mgmt.h @@ -1,17 +1,17 @@ /* * Copyright (c) 2009 Nicira Networks. * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. + * 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: * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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 @@ -27,7 +27,8 @@ enum ofmp_type { OFMPT_CONFIG_REQUEST, OFMPT_CONFIG_UPDATE, OFMPT_CONFIG_UPDATE_ACK, - OFMPT_ERROR + OFMPT_ERROR, + OFMPT_EXTENDED_DATA }; /* Header on all OpenFlow management packets. */ @@ -84,17 +85,61 @@ OFP_ASSERT(sizeof(struct ofmp_capability_reply) == 32); /* Resource TLV for datapath description. */ struct ofmptsr_dp { uint16_t type; /* OFMPTSR_DP. */ - uint16_t len; /* 28. */ + 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. @@ -191,4 +236,25 @@ struct ofmp_error_msg { }; 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 */