On Mon, 9 Mar 2015 20:31:05 +0000 (UTC) "MD.Badruzzaman Shakib" <shaki...@ymail.com> wrote:
> hello ryuian, > I need some help to add flow to the switches using ryu app but without > flooding. > > I think it is possible to match the destination 192.168.1.1/24 in a flow by > using Curl as follow- > curl -X POST -d '{ > "dpid": 3, > "cookie": 1, > "cookie_mask": 1, > "table_id": 0, > "idle_timeout": 0, > "hard_timeout": 0, > "priority": 11111, > "flags": 1, > "match":{ > {“ipv4_src”: “192.168.1.1/255.255.255.0”, > “eth_type”: 2048 > }, > "actions":[ > { > "type":"OUTPUT", > "port": 3 > } > ] > }' http://localhost:8080/stats/flowentry/add > > > Can anyone please tell me how can I do this from my application without using > curl? The code like the folloing: match = parser.OFPMatch(eth_type=0x800, ipv4_src=("192.168.1.0","255.255.255.0")) actions = [parser.OFPActionOutput(3)] inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)] mod = parser.OFPFlowMod(datapath=datapath, priority=11111, match=match, instructions=inst) datapath.send_msg(mod) ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel