bgp: add parameter for site_of_origins to neighbor_add and vrf_add method

Fujita-san,
thank you for your comment and finding the bug that causes test case failure.
I fixed the second and resend the whole patch.

The first is the addition of site_of_origins parameter to neighbor_add and
vrf_add method and fixes to some import error.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: add code to handle RD 0:0 at the head of nexthop network address in MP_REACH_NLRI path attribute

The second is patch to add or skip RD 0:0 label for the next_hop address in MP_REACH_NLRI attribute.

According to RFC, next_hop address seems to be required to contain RD of 0 when advertise VPN prefix.
This is defined in RFC 4659(3.2.1.1.  BGP Speaker Requesting IPv6 Transport) for VPN-IPv6
and in RFC 4364(4.3.2.  Route Distribution Among PEs by BGP) for VPN-IPv4.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: fix conflict of PEER_NEXT_HOP and NEXT_HOP value

The third is fix to a conflict of PEER_NEXT_HOP value in neighbors.py.

There is a conflict between PEER_NEXT_HOP in neighbors.py and NEXT_HOP in api/base.py.
As a result of the conflict, the correct validator for PEER_NEXT_HOP is not used when
neighbir_add is executed.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
ofctl_rest: Add support for strict matching

ofctl_rest is now enable to modify and delete with strict matching.

usage)

  URI:    /stats/flowentry/modify_strict
          /stats/flowentry/delete_strict

  method: POST

e.g. )

  curl -X POST -d '{"dpid": 1,
                    "actions":[{"port":3, "type":"OUTPUT"}],
                    "match":{"in_port":2}}'
                    http://localhost:8080/stats/flowentry/modify_strict

  curl -X POST -d '{"dpid": 1,
                    "match":{"in_port":2}}'
                    http://localhost:8080/stats/flowentry/delete_strict

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

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
added parameter for rib_get

this parameter will support to display like cli as follows.

    Status codes: * valid, > best
         Network                          Next Hop             Reason          Metric LocPrf Path
     *>  10.20.2.0/24                     0.0.0.0              Only Path                     i
     *>  10.20.3.0/24                     0.0.0.0              Only Path                     i
     *>  10.20.1.0/24                     0.0.0.0              Only Path                     i

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
added parameter for vrfs_get (in case of format = 'cli')

this parameter will support to display like cli as follows.

    Status codes: * valid, > best
         Network                          Next Hop             Reason          Metric LocPrf Path
    VPN: ('64511:101', 'ipv4')
     *>  10.20.2.0/24                     0.0.0.0              Only Path                     2
     *>  10.20.1.0/24                     0.0.0.0              Only Path                     2
     *>  10.20.3.0/24                     0.0.0.0              Only Path                     2

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet/bgp: add 32bit AS number support to BGPPathAttributeAsPath

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet/bmp: fix bug of BMP Peer Down Notification class

BMP Peer Down Notification packet must have a per-peer header.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
app/bmpstation: fix to work with empty BMPMessage

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: support add/delete VPNv6 VRF

added VPNv6 route family VRF support.
This patch enables addition and deletion of VPNv6 VRF.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: support add/delete vpnv6 prefix

added VPNv6 prefix support.
This patch enables addition and deletion of VPNv6 prefix.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
packet/bgp: add open capability code of 128

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
bgp: show VPNv4 Prefix information

But the result looks unexpected regarding of show_command .
I can’t find the advertised labels or assigned labels for vpnv4 prefix .
 (reference: http://sourceforge.net/p/ryu/mailman/message/32686423/ )
Therfore, I've patched the codes for formatting as follows .
=> needs for fixing labels attribute after that .

INFO:bgpspeaker.api.base:API method operator.show called with args: {'params': ['rib', 'all'], 'format': 'cli'}
Status codes: * valid, > best
     Network                          Labels   Next Hop             Reason          Metric LocPrf Path/Origin
Family: rtfilter
 *>  64512:64511:101                  None     0.0.0.0              Only Path                     2
Family: vpnv6
Family: vpnv4
 *>  64511:101:10.10.0.1/32           ([17],)  192.168.100.100      Only Path       0             64511 2
 *>  64511:101:10.20.2.0/24           ([100],) 0.0.0.0              Only Path                     2
 *>  64511:101:10.20.1.0/24           ([100],) 0.0.0.0              Only Path                     2
 *>  64511:101:10.20.3.0/24           ([100],) 0.0.0.0              Only Path                     2
Family: ipv4
Family: ipv6

Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>