HI, sdnindia! I found Below codes (see dashed line )are userd to send FlowMode message in this forum. But codes don't work in my PC, when i called function "SendFlowMode" ,it doesn't work, and it returns null to me. Below codes are My send FlowMod message codes :
"
DataPathId dpid=DataPathId.valueof("00:03:9c:b6:54:cb:c6:80");
ControllerService cs =new ControllerServiceAdapter();
MessageFuture mf=cs.sendFlowMod(flow,dpid); // flow already created and i'm sure it correct, created flowmod // message codes are from HP VAN SDN Controller Programming Guide.pdf on Page 27-29.
// when i run the codes, the statement "System.out.println(mf)" output null in Eclipse Console.
"
By the way, other functions such as getAllDataPathInfo(), getDataPathInfo(DataPathId dpid); they all return null .i use HP-2920 switch, and Contrlloer version is 2.0 , API document and hp-sdn-sdk version are both 2.0!!!
/-------------------------------------------------------------------------------
Below are the steps to send the FlowMod message
// Construct OfmMutableFlowMod
OfmMutableFlowMod mod = (OfmMutableFlowMod) MessageFactory .create(pv, MessageType.FLOW_MOD);
// Assemble the match fields
// Add the values to flow mod
//Convert to Immutable
OfmFlowMod flow = (OfmFlowMod)mod.toImmutable();
…
//Call the method
cs.sendFlowMod(flow, dpInfo.dpid()); // Here dpInfo is of type DataPathInfo and cs is of type ControllerService
-------------------------------------------------------------------------------------------------------------------/