diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-05-22 15:00:28 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-05-23 14:34:55 +0900 |
commit | d936841fb3238cc9ad0f728e1c929c8fad783290 (patch) | |
tree | d6084a79d938664e00d223139e7a061bf4efb03b /packet/bmp/bmp_test.go | |
parent | 46b6fc2ccd02404f6fa3c5a4ea71fd192ee867ba (diff) |
bmp: Implement Information TLV on Initiation message
Currently, the TLV fields are implemented as BMPTLV on the Initiation
messages, but not enough decoded and required to be constructed in
binary format.
This patch introduces BMPInfoTLV and makes easy to handle the TLV
fields.
Note: This patch obsoletes BMPTLV structure.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'packet/bmp/bmp_test.go')
-rw-r--r-- | packet/bmp/bmp_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packet/bmp/bmp_test.go b/packet/bmp/bmp_test.go index 5e70710f..d2e07767 100644 --- a/packet/bmp/bmp_test.go +++ b/packet/bmp/bmp_test.go @@ -41,8 +41,10 @@ func verify(t *testing.T, m1 *BMPMessage) { func Test_Initiation(t *testing.T) { verify(t, NewBMPInitiation(nil)) - tlv := NewBMPTLV(1, []byte{0x3, 0xb, 0x0, 0x0, 0x0, 0xf, 0x42, 0x40}) - m := NewBMPInitiation([]BMPTLV{*tlv}) + m := NewBMPInitiation([]BMPInfoTLVInterface{ + NewBMPInfoTLVString(BMP_INIT_TLV_TYPE_STRING, "free-form UTF-8 string"), + NewBMPInfoTLVUnknown(0xff, []byte{0x01, 0x02, 0x03, 0x04}), + }) verify(t, m) } |