ofctl_rest: Add support for strict matching

ofctl_rest is now enable to modify and delete with strict matching.

usage)

  URI:    /stats/flowentry/modify_strict
          /stats/flowentry/delete_strict

  method: POST

e.g. )

  curl -X POST -d '{"dpid": 1,
                    "actions":[{"port":3, "type":"OUTPUT"}],
                    "match":{"in_port":2}}'
                    http://localhost:8080/stats/flowentry/modify_strict

  curl -X POST -d '{"dpid": 1,
                    "match":{"in_port":2}}'
                    http://localhost:8080/stats/flowentry/delete_strict

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Minoru TAKAHASHI 2014-08-01 17:53:02 +09:00 committed by FUJITA Tomonori
parent 6096a49d2e
commit 67328e0fb1

View File

@ -80,9 +80,15 @@ LOG = logging.getLogger('ryu.app.ofctl_rest')
# modify all matching flow entries
# POST /stats/flowentry/modify
#
# modify flow entry strictly matching wildcards and priority
# POST /stats/flowentry/modify_strict
#
# delete all matching flow entries
# POST /stats/flowentry/delete
#
# delete flow entry strictly matching wildcards and priority
# POST /stats/flowentry/delete_strict
#
# delete all flow entries of the switch
# DELETE /stats/flowentry/clear/<dpid>
#
@ -301,8 +307,12 @@ class StatsController(ControllerBase):
cmd = dp.ofproto.OFPFC_ADD
elif cmd == 'modify':
cmd = dp.ofproto.OFPFC_MODIFY
elif cmd == 'modify_strict':
cmd = dp.ofproto.OFPFC_MODIFY_STRICT
elif cmd == 'delete':
cmd = dp.ofproto.OFPFC_DELETE
elif cmd == 'delete_strict':
cmd = dp.ofproto.OFPFC_DELETE_STRICT
else:
return Response(status=404)