ofctl_rest: support OpenFlow1.2

this patch makes ofctl_rest enable use of OpenFlow1.2.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
ofctl_v1_2/3: support OXM field names

this patch gets match field names to support OXM field names.

NOTE: OpenFlow1.0 does not support OXM field names.

the compatibility is as follows:

  dl_src    eth_src
  dl_dst    eth_dst
  dl_type   eth_type
  dl_vlan   vlan_vid
  nw_src    ipv4_src
  nw_dst    ipv4_dst
  nw_proto  ip_proto
  tp_src    tcp_src or udp_src
  tp_dst    tcp_dst or udp_dst

for example, the following commands for ofctl_rest install the same flow entry.

curl -X POST -d '{"dpid": 1,
                  "match": {"dl_type": 2048,
                            "nw_src": "192.168.1.1"},
                  "actions": [{"type": "OUTPUT",
                               "port": 2}]}' http://localhost:8080/stats/flowentry/add

curl -X POST -d '{"dpid": 1,
                  "match": {"eth_type": 2048,
                            "ipv4_src": 192.168.1.1"},
                  "actions": [{"type": "OUTPUT",
                               "port": 2}]}' http://localhost:8080/stats/flowentry/add

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
ofctl_v1_2/3: support IPv6

this patch implements the match conditions using IPv6.

NOTE: OpenFlow1.0 does not support IPv6.

e.g. using ofctl_rest)

curl -X POST -d '{"dpid": 1,
                  "match": {"eth_type": 34525,
                            "ipv6_src": "fe08:2001::/64",
                            "ipv6_dst": "ff02::1"},
                  "actions": [{"type": "OUTPUT",
                               "port": 2}]}' http://localhost:8080/stats/flowentry/add

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
firewall: packet blocking log for DENY rule

rest_firewall outputs packet blocking log.
However it was not output about DENY rules,
 it outputted only table-miss packets.
This patch improves it.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: igmp: support IGMP v3

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet lib: icmpv6: support MLD (v1/v2)

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
add IGMP snooping application

this application provides the simple example of IGMP snooping.

the module "igmplib" mainly offers 2 functions:
- listening on in the IGMP conversation between multicast routers and hosts
- emulating of the querier function of multicast servers
the former operates a switch as a snooping switch and controls transmission of an unnecessary multicasting packet.
the latter realizes the IGMP conversation in the environment without multicast routers.

the module "simple_switch_igmp" is a variation of "simple_switch".
the switch receives the "EventPacketIn" event instead of the "EventOFPPacketIn" event from the module "igmplib" in order to except IGMP.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Fix Windows setup dependency bug

The hook raises an AttributeError exception on Windows because
of recent changes in the pbr project. This fix solves the issue.

This is adapted from https://review.openstack.org/#/c/42170/

Since ryu didn't depend on pyudev, I think it no longer needs
a removal here.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
topology: Setting highest rule priority to LLDP packets

Signed-off-by: Srini Seetharaman <srini.seetharaman@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_rest: fix delete_flow_entry

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_rest: support OFPExperimenter message

this patch makes ofctl_rest enable use of OFPExperimenter message.

usage)

  URI:    /stats/experimenter/{dpid}
  method: POST

the message body is as follows:

  experimenter  Experimenter ID. (default: 0)
  exp_type      Experimenter defined type. (default:0)
  data_type     Data encoding type. 'ascii' or 'base64'. (default: 'ascii')
  data          Experimenter-defined arbitrary additional data. (default: '')

e.g.)

  curl -X POST -d '{"experimenter": 8992,
                    "exp_type": 10,
                    "data": "\x00\x00\x00\x01"}' http://localhost:8080/stats/experimenter/1

  curl -X POST -d '{"experimenter": 8992,
                    "exp_type": 10.
                    "data_type": "base64",
                    "data": "AAAAAQ=="}' http://localhost:8080/stats/experimenter/1

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>