ofctl_v1_2/3: fix POP_MPLS action and some match fields

The following causes an error at mod_flow_entry command

  - ofctl_v1_2.py
    * match field: metadata, mpls_label

  - ofctl_v1_3.py
    * match field: in_phy_port

and the following causes an error at get_flow_stats command

  - ofctl_v1_2.py
    * action: POP_MPLS
    * match field: metadata, ipv6_nd_target

  - ofctl_v1_3.py
    * action: POP_MPLS
    * match field: ipv6_nd_target

this patch fixes them.

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Correct tcp option values in the test set

"\x11"*4 is an invalid value for TCP option, because it
would be decoded as Kind=17 and Length=17, but actual
size is 4.

If we'd like to set some non-zero value for TCP option
here, Kind=1(NOOP) is better.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
add out-filter function to BGP

added out-filter function to Ryu BGPSpeaker.
It supports IPv4 and IPv6.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ws_topology: fix typo

No spec change. The issue occurs at the time of "one_way=True"

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: fix logic for checking BGP capability

BGPOpen that is set to sent_open_msg and recv_open_msg doesn't have
caps and BGP capabilities are stored in opt_param as List.
I changed the way of checking BGP capabilities.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: fix the way of getting RouteFamily object

RouteFamily objects are treated as a singleton object.
However they are created in peer.py, so I added method to
get RouteFamily object in bgp.py and changed codes to use it.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_rest: support Port Modification Message

this patch makes ofctl_rest enable use of Port Modification Message.

usage)

  URI:    /stats/portdesc/modify
  method: POST

the message body is as follows:

  dpid
  port_no    (default:0)
  config     (default:0)
  hw_addr    (default:automatic-setting)
  mask       (default:0)
  advertise  (default:automatic-setting)

e.g. )

  curl -X POST -d '{"dpid": 1,
                    "port_no": 1,
                    "mask": 0b0000001,
                    "config": 0b0000001}' http://localhost:8080/stats/portdesc/modify

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_rest: enable getting Description of a port

this patch makes ofctl_rest enable getting Description of a port.

usage)

  URI:    /stats/portdesc/<dpid>
  method: GET

e.g. )

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

    {"1": [{"hw_addr": "c6:d8:19:4a:e1:4f", "curr": 0, "supported": 0,
            "max_speed": 0, "advertised": 0, "peer": 0,
            "port_no": 4294967294, "curr_speed": 0, "name": "s1",
            "state": 1, "config": 1},
           {"hw_addr": "8e:96:a1:14:d8:a1", "curr": 2112, "supported": 0,
            "max_speed": 0, "advertised": 0, "peer": 0,
            "port_no": 1, "curr_speed": 10000000, "name": "s1-eth1",
            "state": 0, "config": 0}]}

Signed-off-by: TAKAHASHI Minoru <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>