From de58be441150daf8943a5a66ced6703b8201303e Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Sun, 26 Jun 2016 23:18:23 +0900 Subject: support AGGREGATOR and AS4_AGGREGATOR conversion Signed-off-by: FUJITA Tomonori --- packet/bgp/bgp.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'packet') diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index 8a793720..9d6678d3 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -4439,7 +4439,7 @@ func NewPathAttributeAtomicAggregate() *PathAttributeAtomicAggregate { type PathAttributeAggregatorParam struct { AS uint32 - askind reflect.Kind + Askind reflect.Kind Address net.IP } @@ -4461,18 +4461,18 @@ func (p *PathAttributeAggregator) DecodeFromBytes(data []byte) error { if len(p.PathAttribute.Value) == 6 { p.Value.AS = uint32(binary.BigEndian.Uint16(p.PathAttribute.Value[0:2])) p.Value.Address = p.PathAttribute.Value[2:] - p.Value.askind = reflect.Uint16 + p.Value.Askind = reflect.Uint16 } else { p.Value.AS = binary.BigEndian.Uint32(p.PathAttribute.Value[0:4]) p.Value.Address = p.PathAttribute.Value[4:] - p.Value.askind = reflect.Uint32 + p.Value.Askind = reflect.Uint32 } return nil } func (p *PathAttributeAggregator) Serialize() ([]byte, error) { var buf []byte - switch p.Value.askind { + switch p.Value.Askind { case reflect.Uint16: buf = make([]byte, 6) binary.BigEndian.PutUint16(buf, uint16(p.Value.AS)) @@ -4513,7 +4513,7 @@ func NewPathAttributeAggregator(as interface{}, address string) *PathAttributeAg }, Value: PathAttributeAggregatorParam{ AS: uint32(v.Uint()), - askind: v.Kind(), + Askind: v.Kind(), Address: net.ParseIP(address).To4(), }, } -- cgit v1.2.3