2017-3-2
在开发Floodlight模块时需要监听Openflow消息,这样的话不可避免会用到OFMessage。Eclipse没有直接给出说明(类型什么的没有),所以得去官网的Java Doc查看一下。还是老样子,这篇博文也是个流水账哦。
不管三七二十一,先把原味doc的链接po出来=_=。
这里我只需要知道Openflow消息的类型(很多场合下都需要,根据Openflow消息的类型执行相应的操作,巴拉巴拉),因此只需要了解getType方法就行。这里getType方法返回的是OFType类型,这是一个枚举量。该类的其他方法如下所示:
方法名称 | 返回值 | 参数 | 说明 |
---|---|---|---|
getVersion | OFVersion | None | 返回OpenFlow的版本信息 |
getType | OFType | None | 返回OpenFlow消息的类型 |
getXid | long | None | |
writeTo | void | org.jboss.netty.buffer.ChannelBuffer channelBuffer | |
createBuilder | OFMessage.Builder | None |
OFMessage是一个接口,在其基础上还实现了其它接口,我根据官方的java doc对其所有的子接口进行了一个汇总,这里有很多常用的子接口,例如OFFlowAdd,OFFlowMod,OFFlowRemoved等等,当我们在接收到来自交换机的packet的时候,我们就可根据packet的类型将收到的packet映射到对应的接口上:
接口名 | 子接口 | 介绍 |
---|---|---|
OFAggregateStatsReply | ||
OFAggregateStatsRequest | ||
OFAsyncConfigFailedErrorMsg | ||
OFAsyncGetReply | ||
OFAsyncGetRequest | ||
OFAsyncSet | ||
OFBadActionErrorMsg | ||
OFBadInstructionErrorMsg | ||
OFBadMatchErrorMsg | ||
OFBadPropertyErrorMsg | ||
OFBadRequestErrorMsg | ||
OFBarrierReply | ||
OFBarrierRequest | ||
OFBsnArpIdle | ||
OFBsnBwClearDataReply | ||
OFBsnBwClearDataRequest | ||
OFBsnBwEnableGetReply | ||
OFBsnBwEnableGetRequest | ||
OFBsnBwEnableSetReply | ||
OFBsnBwEnableSetRequest | ||
OFBsnControllerConnectionsReply | ||
OFBsnControllerConnectionsRequest | ||
OFBsnDebugCounterDescStatsReply | ||
OFBsnDebugCounterDescStatsRequest | ||
OFBsnDebugCounterStatsReply | ||
OFBsnDebugCounterStatsRequest | ||
OFBsnFlowChecksumBucketStatsReply | ||
OFBsnFlowChecksumBucketStatsRequest | ||
OFBsnFlowIdle | ||
OFBsnFlowIdleEnableGetReply | ||
OFBsnFlowIdleEnableGetRequest | ||
OFBsnFlowIdleEnableSetReply | ||
OFBsnFlowIdleEnableSetRequest | ||
OFBsnGenericStatsReply | ||
OFBsnGenericStatsRequest | ||
OFBsnGentableBucketStatsReply | ||
OFBsnGentableBucketStatsRequest | ||
OFBsnGentableClearReply | ||
OFBsnGentableClearRequest | ||
OFBsnGentableDescStatsReply | ||
OFBsnGentableDescStatsRequest | ||
OFBsnGentableEntryAdd | ||
OFBsnGentableEntryDelete | ||
OFBsnGentableEntryDescStatsReply | ||
OFBsnGentableEntryDescStatsRequest | ||
OFBsnGentableEntryStatsReply | ||
OFBsnGentableEntryStatsRequest | ||
OFBsnGentableSetBucketsSize | ||
OFBsnGentableStatsReply | ||
OFBsnGentableStatsRequest | ||
OFBsnGetInterfacesReply | ||
OFBsnGetInterfacesRequest | ||
OFBsnGetIpMaskReply | ||
OFBsnGetIpMaskRequest | ||
OFBsnGetL2TableReply | ||
OFBsnGetL2TableRequest | ||
OFBsnGetMirroringReply | ||
OFBsnGetMirroringRequest | ||
OFBsnGetSwitchPipelineReply | ||
OFBsnGetSwitchPipelineRequest | ||
OFBsnHeader | ||
OFBsnHybridGetReply | ||
OFBsnHybridGetRequest | ||
OFBsnImageDescStatsReply | ||
OFBsnImageDescStatsRequest | ||
OFBsnLacpConvergenceNotif | ||
OFBsnLacpStatsReply | ||
OFBsnLacpStatsRequest | ||
OFBsnLog | ||
OFBsnLuaCommandReply | ||
OFBsnLuaCommandRequest | ||
OFBsnLuaNotification | ||
OFBsnLuaUpload | ||
OFBsnPduRxReply | ||
OFBsnPduRxRequest | ||
OFBsnPduRxTimeout | ||
OFBsnPduTxReply | ||
OFBsnPduTxRequest | ||
OFBsnPortCounterStatsReply | ||
OFBsnPortCounterStatsRequest | ||
OFBsnRoleStatus | ||
OFBsnSetAuxCxnsReply | ||
OFBsnSetAuxCxnsRequest | ||
OFBsnSetIpMask | ||
OFBsnSetL2TableReply | ||
OFBsnSetL2TableRequest | ||
OFBsnSetLacpReply | ||
OFBsnSetLacpRequest | ||
OFBsnSetMirroring | ||
OFBsnSetPktinSuppressionReply | ||
OFBsnSetPktinSuppressionRequest | ||
OFBsnSetSwitchPipelineReply | ||
OFBsnSetSwitchPipelineRequest | ||
OFBsnShellCommand | ||
OFBsnShellOutput | ||
OFBsnShellStatus | ||
OFBsnStatsReply | ||
OFBsnStatsRequest | ||
OFBsnSwitchPipelineStatsReply | ||
OFBsnSwitchPipelineStatsRequest | ||
OFBsnTableChecksumStatsReply | ||
OFBsnTableChecksumStatsRequest | ||
OFBsnTableSetBucketsSize | ||
OFBsnTimeReply | ||
OFBsnTimeRequest | ||
OFBsnVirtualPortCreateReply | ||
OFBsnVirtualPortCreateRequest | ||
OFBsnVirtualPortRemoveReply | ||
OFBsnVirtualPortRemoveRequest | ||
OFBsnVlanCounterStatsReply | ||
OFBsnVlanCounterStatsRequest | ||
OFBsnVrfCounterStatsReply | ||
OFBsnVrfCounterStatsRequest | ||
OFBundleAddMsg | ||
OFBundleCtrlMsg | ||
OFBundleFailedErrorMsg | ||
OFDescStatsReply | ||
OFDescStatsRequest | ||
OFEchoReply | ||
OFEchoRequest | ||
OFErrorMsg | ||
OFExperimenter | ||
OFExperimenterErrorMsg | ||
OFExperimenterStatsReply | ||
OFExperimenterStatsRequest | ||
OFFeaturesReply | ||
OFFeaturesRequest | ||
OFFlowAdd | ||
OFFlowDelete | ||
OFFlowDeleteStrict | ||
OFFlowMod | ||
OFFlowModFailedErrorMsg | ||
OFFlowModify | ||
OFFlowModifyStrict | ||
OFFlowMonitorFailedErrorMsg | ||
OFFlowRemoved | ||
OFFlowStatsReply | ||
OFFlowStatsRequest | ||
OFGetConfigReply | ||
OFGetConfigRequest | ||
OFGroupAdd | ||
OFGroupDelete | ||
OFGroupDescStatsReply | ||
OFGroupDescStatsRequest | ||
OFGroupFeaturesStatsReply | ||
OFGroupFeaturesStatsRequest | ||
OFGroupMod | ||
OFGroupModFailedErrorMsg | ||
OFGroupModify | ||
OFGroupStatsReply | ||
OFGroupStatsRequest | ||
OFHello | ||
OFHelloFailedErrorMsg | ||
OFMeterConfigStatsReply | ||
OFMeterConfigStatsRequest | ||
OFMeterFeaturesStatsReply | ||
OFMeterFeaturesStatsRequest | ||
OFMeterMod | ||
OFMeterModFailedErrorMsg | ||
OFMeterStatsReply | ||
OFMeterStatsRequest | ||
OFNiciraControllerRoleReply | ||
OFNiciraControllerRoleRequest | ||
OFNiciraHeader | ||
OFPacketIn | ||
OFPacketOut | ||
OFPortDescStatsReply | ||
OFPortDescStatsRequest | ||
OFPortMod | ||
OFPortModFailedErrorMsg | ||
OFPortStatsReply | ||
OFPortStatsRequest | ||
OFPortStatus | ||
OFQueueDescStatsReply | ||
OFQueueDescStatsRequest | ||
OFQueueGetConfigReply | ||
OFQueueGetConfigRequest | ||
OFQueueOpFailedErrorMsg | ||
OFQueueStatsReply | ||
OFQueueStatsRequest | ||
OFRequest | ||
OFRequestforward | ||
OFRoleReply | ||
OFRoleRequest | ||
OFRoleRequestFailedErrorMsg | ||
OFRoleStatus | ||
OFSetConfig | ||
OFStatsReply | ||
OFStatsRequest | ||
OFSwitchConfigFailedErrorMsg | ||
OFTableDescStatsReply | ||
OFTableDescStatsRequest | ||
OFTableFeaturesFailedErrorMsg | ||
OFTableFeaturesStatsReply | ||
OFTableFeaturesStatsRequest | ||
OFTableMod | ||
OFTableModFailedErrorMsg | ||
OFTableStatsReply | ||
OFTableStatsRequest | ||
OFTableStatus |