Umesh Krishnaswamy | 345ee99 | 2012-12-13 20:29:48 -0800 | [diff] [blame] | 1 | /** |
| 2 | * Copyright 2011, Big Switch Networks, Inc. |
| 3 | * Originally created by David Erickson & Rob Sherwood, Stanford University |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | * not use this file except in compliance with the License. You may obtain |
| 7 | * a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | * License for the specific language governing permissions and limitations |
| 15 | * under the License. |
| 16 | **/ |
| 17 | |
| 18 | package org.openflow.vendor.nicira; |
| 19 | |
| 20 | import org.openflow.protocol.Instantiable; |
| 21 | import org.openflow.protocol.vendor.OFVendorData; |
| 22 | |
| 23 | /** |
| 24 | * Subclass of OFVendorData representing the vendor data associated with |
| 25 | * a role reply vendor extension. |
| 26 | * |
| 27 | * @author Rob Vaterlaus (rob.vaterlaus@bigswitch.com) |
| 28 | */ |
| 29 | public class OFRoleReplyVendorData extends OFRoleVendorData { |
| 30 | |
| 31 | protected static Instantiable<OFVendorData> instantiable = |
| 32 | new Instantiable<OFVendorData>() { |
| 33 | public OFVendorData instantiate() { |
| 34 | return new OFRoleReplyVendorData(); |
| 35 | } |
| 36 | }; |
| 37 | |
| 38 | /** |
| 39 | * @return a subclass of Instantiable<OFVendorData> that instantiates |
| 40 | * an instance of OFRoleReplyVendorData. |
| 41 | */ |
| 42 | public static Instantiable<OFVendorData> getInstantiable() { |
| 43 | return instantiable; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * The data type value for a role reply |
| 48 | */ |
| 49 | public static final int NXT_ROLE_REPLY = 11; |
| 50 | |
| 51 | /** |
| 52 | * Construct a role reply vendor data with an unspecified role value. |
| 53 | */ |
| 54 | public OFRoleReplyVendorData() { |
| 55 | super(NXT_ROLE_REPLY); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Construct a role reply vendor data with the specified role value. |
| 60 | * @param role the role value for the role reply. Should be one of |
| 61 | * NX_ROLE_OTHER, NX_ROLE_MASTER or NX_ROLE_SLAVE. |
| 62 | */ |
| 63 | public OFRoleReplyVendorData(int role) { |
| 64 | super(NXT_ROLE_REPLY, role); |
| 65 | } |
| 66 | } |