summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/bgp_test.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-02-11 22:20:43 +0900
committerIWASE Yusuke <iwase.yusuke0@gmail.com>2018-02-13 15:10:58 +0900
commit1b84b8145418398e7e68b81cdce506dcf81eec14 (patch)
tree9badad0f4c9318dfb2001fcb93aaddb7fa328461 /packet/bgp/bgp_test.go
parentbe40351b8aa925a99798998514244a9d700c5691 (diff)
packet/bgp: Refactor TunnelEncapSubTLV structure
This patch refactors the structure of TunnelEncapSubTLV sub-types to have the similar structure of PathAttribute sub-types, and makes easy to implement MarshalJSON() functions for TunnelEncapSubTLV sub-types. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'packet/bgp/bgp_test.go')
-rw-r--r--packet/bgp/bgp_test.go11
1 files changed, 1 insertions, 10 deletions
diff --git a/packet/bgp/bgp_test.go b/packet/bgp/bgp_test.go
index 7f84b8d8..bb003bac 100644
--- a/packet/bgp/bgp_test.go
+++ b/packet/bgp/bgp_test.go
@@ -258,16 +258,7 @@ func Test_RFC5512(t *testing.T) {
assert.Equal(nil, err)
assert.Equal([]byte{0x3, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8}, buf)
- subTlv := &TunnelEncapSubTLV{
- Type: ENCAP_SUBTLV_TYPE_COLOR,
- Value: &TunnelEncapSubTLVColor{10},
- }
-
- tlv := &TunnelEncapTLV{
- Type: TUNNEL_TYPE_VXLAN,
- Value: []*TunnelEncapSubTLV{subTlv},
- }
-
+ tlv := NewTunnelEncapTLV(TUNNEL_TYPE_VXLAN, []TunnelEncapSubTLVInterface{NewTunnelEncapSubTLVColor(10)})
attr := NewPathAttributeTunnelEncap([]*TunnelEncapTLV{tlv})
buf1, err := attr.Serialize()