ofctl_v1_3: fix match for metadata

also use the default priority for FlowMod.

Signed-off-by: Srini Seetharaman <srini.seetharaman@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_v1_3: support OFPMeterConfigStats

Changes v2 -> v3:

- correct the following description

this patch implements a REST API for OFPMeterConfigStats.

e.g., when you send a MeterMod message as:

    curl -X POST -d '{"dpid": 1,
                      "meter_id": 1,
                      "flags": "KBPS",
                      "bands": [{"type": "DROP", "rate": 1000},
                                {"type": "REMARK", "rate": 2000},
                                {"type": "EXPERIMENTER", "rate": 3000}
                      ]}' http://localhost:8080/stats/meterentry/add

and you do the following command:

    curl http://localhost:8080/stats/meterconfig/1

then you will get the configuration as:

    {"1": [{"bands": [{"burst_size": 0, "rate": 1000, "type": "DROP"},
                      {"prec_level": 0, "burst_size": 0, "rate": 2000, "type": "REMARK"},
                      {"burst_size": 0, "rate": 3000, "experimenter": 0, "type": "EXPERIMENTER"}],
            "flags": "KBPS",
            "meter_id": 1}]}

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
oxm_fields: make a crash less cryptic

when oxm length is not what we expect, explicitly raise an exception
with descriptive message like the following.

    Exception: Unexpected OXM payload length 3 for ipv6_flabel (expected 4)

This often happens if you are using LINC and IPv6.
https://github.com/FlowForwarding/of_protocol/pull/57

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
requires lxml

will be used for OF-Config stuff.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
add some convenient OF-Config classes

some python classes for a set of OF-Config 1.1.1 types.

the goal is to allow programmers use OF-Config without direct
XML manipulations.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of_config.capable_switch: api tweak

tweak method to take of_config.classes classes instead of xml.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tests.integrated.test_of_config: update after capable_switch api change

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of_config.capable_switch: add delete_config and copy_config

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
a simple of-config client command

the placement (ryu/tests/bin) was suggested by FUJITA Tomonori.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of_config_cli: add delete_config and copy_config

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of_config_cli: add add_queue command

totally untested as i have no access to switches which support
the operation.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of_config: allows both of of-config element names and python style names

for convenience of api consumers, allows both of of-config style
element names (eg. logical-switches) and python style attribute
names (eg. logical_switches).

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
of_config_cli: remove no longer necessary "_pythonify" stuff

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
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>