Software Defined Networking
1828317 Members
3970 Online
109976 Solutions
New Discussion

Afer create flow message successly, how to send it to specific DataPath?

 
harcy
Occasional Visitor

Afer create flow message successly, how to send it to specific DataPath?

Hi,ALL!

     Where's the problem with below codes? The codes can't send flow message to specific DataPath! Why function "sendFlowMode" return null?  How can i send flow to specific DataPath? 

 

 

// 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, below codes don't work!

1 REPLY 1
sdnindia
Trusted Contributor

Re: Afer create flow message successly, how to send it to specific DataPath?

Hello harcy,

 

Since sendFlowMod() function is returning null so please check if the argument for this function i.e. flow as well as dpid have proper values.

 

As per Programming guide page 31 you can use  

 private ControllerService cs = ...;

 

You can have private static ControllerService mControllerService;  in your class and initialize that member and call sendFlowMod function.

 

If you still face the issue please share the exact code for flow creation and for dpid initialization.

 

Thanks,

HP SDN Team