Changes between Version 12 and Version 13 of Internal/OpenFlow/VendorTutorial
- Timestamp:
- Feb 7, 2013, 9:22:09 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Internal/OpenFlow/VendorTutorial
v12 v13 182 182 183 183 === 2.4 Message Serialization === #serial 184 As mentioned [#iface earlier], a class implementing OFVendorData must have a readFrom(!ChannelBuffer data, int length) and writeTo(!ChannelBuffer data) method for reading and writing the data from/to a !ChannelBuffer. A getLength() method that returns the size in bytes of the vendor data, minus the Vendor ID length, is also required for properly reading/writing from the !ChannelBuffer. We do not count the !OpenFlow header length since helper methods take it into account along with the Vendor ID length to produce the full message length.184 As mentioned [#iface earlier], a class implementing OFVendorData must have a readFrom(!ChannelBuffer data, int length) and writeTo(!ChannelBuffer data) method for reading and writing the data from/to a !ChannelBuffer. A getLength() method that returns the size in bytes of the vendor data, minus the Vendor ID length, is also required for your Vendor message to be properly sent and received. We do not count the !OpenFlow header length since helper methods take it into account along with the Vendor ID length. Note, a getLength() function that returns the wrong value may not always prevent your controller from sending the message, but will definitely stop you from receiving it on the other end. So if your message is not being received correctly one of the first things you should check (after channel functionality) is your getLength() function. 185 185 186 186 The packet structure is determined by the order in which the various fields are written to the !ChannelBuffer, so readFrom() and writeTo() should read/write the fields to/from the !ChannelBuffer in the same order.