bgp: add support for RFC3107

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: move _TYPE declaration of IPAddrPrefix to the appropriate place.

_IPAddrPrefix can be inherited by labeled addr prefix.
In that case, variable 'addr' is tuple and not string. so declare to
parse 'addr' in 'ascii' format in _IPAddrPrefix cause following error.
this patch fix this bug.

p = LabelledIPAddrPrefix(28, ([1], '192.168.0.0'))
p.to_jsondict()

Traceback (most recent call last):
  File "./parse_labeled_addr_prefix.py", line 11, in <module>
    p.to_jsondict()
  File "/home/wataru/ryu/ryu/lib/stringify.py", line 210, in to_jsondict
    dict_[k] = encode(k, v)
  File "/home/wataru/ryu/ryu/lib/stringify.py", line 208, in <lambda>
    encode = lambda k, x: self._encode_value(k, x, encode_string)
  File "/home/wataru/ryu/ryu/lib/stringify.py", line 155, in
_encode_value
    return cls._get_encoder(k, encode_string)(v)
  File "/home/wataru/ryu/ryu/lib/stringify.py", line 56, in encode
    return unicode(v, 'ascii')
TypeError: coercing to Unicode: need string or buffer, tuple found

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
stringify: introduce _class_suffixes for easy jsonize

class variable '_class_suffixes' can be used for the same purpose as
'_class_prefixes' but match with the suffix of the class name.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: use _class_suffixes to support various AddrPrefix

the AddrPrefix which variable 'nlri' has is not limited to
_BinAddrPrefix. this patch enables to encode to/decode from json dict
with various AddrPrefix in 'nlri'.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: encode 'next_hop' in human readable format

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: make reserved private variable

reserved field must be 0. this patch add an assertion and
make reserved field invisible when stringified

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bmpstation: make configurable through environment variables

you can specify listening HOST and PORT by setting env variable
'RYU_BMP_SERVER_HOST' and 'RYU_BMP_SERVER_PORT'.

'RYU_BMP_OUTPUT_FILE' specifes the output file name
'RYU_BMP_FAILED_DUMP' specifes the file name of the error dump

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: add a "note" for help to understand

Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: reduce duplicate codes with helper_function.

reduced duplicate codes and put together to a static function.

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 OFPFlowStats filtered by fields

this patch enables ofctl_rest to get OFPFlowStats messages
filtered by the OFPFlowStatsRequest fields in OpenFlow specification.

usage)

  URI:    /stats/flow/<dpid>
  method: POST

  the message body is as follows:

  table_id     ID of table.
  out_port     Require matching entries to include this as an output port.
  out_group    Require matching entries to include this as an output group.
               (Not supported in of1.0)
  cookie       Require matching entries to contain this cookie value.
               (Not supported in of1.0)
  cookie_mask  Mask used to restrict the cookie bits that must match.
               (Not supported in of1.0)
  match        Fields to match.

e.g.)

  curl -X POST -d '{"table_id": 0,
                    "out_port": 2,
                    "cookie": 1,
                    "cookie_mask": 1,
                    "match":{"in_port":1}}'
  http://localhost:8080/stats/flow/1

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Merge branch 'master' of https://github.com/osrg/ryu
OF1.0: simpleRouter_v1_0.py を作成

ryuアプリとして、OF1.0ベースのsimpleRouterを作成
OF1.0ディレクトリ削除
OF1.3: simpleRouter_v1_3.py を作成

ryuアプリとして、OF1.3ベースのsimpleRouterを作成
simpleRouter_v1_3 for Ryu3.4
packet-in のパース処理をnextイテレータからget_protocolに変更
テストケース準備とログ出力環境の整備
REST-API勉強用サンプルファイルを作成
update study for rest_messenger
simpleRouterリファクタリング