app_manager: Let application module to use require_app()

Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
downgrade required version of msgpack-python

For Ubuntu 14.04, downgrade the required version of msgpack-python.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
contrib: import tinyrpc library

https://pypi.python.org/pypi/tinyrpc/0.5
https://github.com/mbr/tinyrpc

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ryu.lib.hub: add logging wrapper for wsgi server

This patch adds a wrapper to relay the log of the wsgi server to the logger.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: use TCP_NODELAY for bgp connection

Disables Nagle to send data immediately.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: use sendall with lock

With the current design, multiple greenlets calls sendall() on a
single tcp socket. This leads to a corrupted bgp message.

This patch introduces mutex to work around the problem. However, I
hope that we _fix_ the design where only one greenlet call sendall()
on a signel tcp socket in the future.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: catch socket error with sendall

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: Modify conditions of ofp_packet_in_reason

OF 1.4.0 spec (B.14.2 More descriptive reasons for packet-in) says:

    The main change is that the the "output action" reason OFPR_ACTION is effectively split into four reasons,
    "apply-action", "action-set", "group bucket" and "packet-out", representing the four distinct context
    where this action is used.

A set of reason values for ofp_packet_in message in OF 1.3.3 is:

    enum ofp_packet_in_reason {
        OFPR_NO_MATCH    = 0, /* No matching flow (table-miss flow entry). */
        OFPR_ACTION      = 1, /* Action explicitly output to controller. */
        OFPR_INVALID_TTL = 2, /* Packet has invalid TTL */
    };

And a new set of reason values for ofp_packet_in message in OF 1.4.0 is:

    enum ofp_packet_in_reason {
        OFPR_TABLE_MISS   = 0, /* No matching flow (table-miss flow entry). */
        OFPR_APPLY_ACTION = 1, /* Output to controller in apply-actions. */
        OFPR_INVALID_TTL  = 2, /* Packet has invalid TTL */
        OFPR_ACTION_SET   = 3, /* Output to controller in action set. */
        OFPR_GROUP        = 4, /* Output to controller in group bucket. */
        OFPR_PACKET_OUT   = 5, /* Output to controller in packet-out. */
    };

Therefore, "reason != OFPR_ACTION" means "reason == OFPR_NOMATCH or reason == OFPR_INVALID_TTL".

NOTE: OFPR_TABLE_MISS is defined as OFPR_NO_MATCH in ryu.ofproto.ofproto_v1_4.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Add mask length of ipv6_flabel

OF 1.3.3 spec (B.14.1 Changes) says:

    Clarify that IPv6 flow label is not maskable by default

Since OF 1.4.0 was defined as the next of OF 1.3.2, IPv6 flow label is maskable in OF 1.4.0.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Add support for OpenFlow 1.4

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Enable using connected switches to parse

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Enable getting switches from outside of OfTester

This patch is for using connected switches to parse.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Enable waiting for switches to connect before parsing

This patch is for using connected switches to parse.
The switch test tool starts to parse test files after switches connected.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Enable using connected switches to compare

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Modify OFPMatch to normalize

This patch is for avoiding the following issues when using ofproto_v1_4_parser:

  - OFPMatch that is created from JSON keeps unicode strings, instead of usual strings.
  - In OFPMatch that is created from JSON, IPv6 formats like 'ff::0' or '00ff:0000:0000:0000:0000:0000:0000:0000' are not normalized to 'ff::'.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Modify OFPActionSetField to normalize

This patch is for avoiding the following issues when using ofproto_v1_4_parser:

  - OFPActionSetField that is created from JSON keeps unicode strings, instead of usual strings.
  - In OFPActionSetField that is created from JSON, IPv6 formats like 'ff::0' or '00ff:0000:0000:0000:0000:0000:0000:0000' are not normalized to 'ff::'.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Add default test files (of14: action without set-field)

These test files aim to examine 'action' excluding 'set-field' of FlowMod message.
This patch only copies ryu/tests/switch/of13/action.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Add default test files (of14: action with set-field only)

These test files aim to examine 'set-field action' of FlowMod message.
This patch only copies ryu/tests/switch/of13/action/25_SET_FIELD.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Add default test files (of14: match)

These test files aim to examine 'match' of FlowMod message.
This patch only copies ryu/tests/switch/of13/match.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Add default test files (of14: meter)

These test files aim to examine 'meter instruction' of FlowMod message.
This patch only copies ryu/tests/switch/of13/meter.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>