summaryrefslogtreecommitdiffhomepage
path: root/pkg/packet/bgp/bgp.go
diff options
context:
space:
mode:
authorSergey Elantsev <elantsev.s@yandex.ru>2020-03-15 23:31:38 +0300
committerSergey Elantsev <elantsev.s@yandex.ru>2020-03-15 23:31:38 +0300
commitff36bb98781c92fd8ec20c9a89c0c5a4f63b05da (patch)
tree388aa42c02c74ffc400ddab967e2ebae2f58f996 /pkg/packet/bgp/bgp.go
parent2ef8db0290bbc938b3f6a2404cdd927663da3a00 (diff)
optimized allocations in packet/bgp validations
Diffstat (limited to 'pkg/packet/bgp/bgp.go')
-rw-r--r--pkg/packet/bgp/bgp.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/packet/bgp/bgp.go b/pkg/packet/bgp/bgp.go
index ccc3db8e..30a1a41c 100644
--- a/pkg/packet/bgp/bgp.go
+++ b/pkg/packet/bgp/bgp.go
@@ -12114,6 +12114,10 @@ func (c *LargeCommunity) String() string {
return fmt.Sprintf("%d:%d:%d", c.ASN, c.LocalData1, c.LocalData2)
}
+func (c *LargeCommunity) Eq(rhs *LargeCommunity) bool {
+ return c.ASN == rhs.ASN && c.LocalData1 == rhs.LocalData1 && c.LocalData2 == rhs.LocalData2
+}
+
func NewLargeCommunity(asn, data1, data2 uint32) *LargeCommunity {
return &LargeCommunity{
ASN: asn,