summaryrefslogtreecommitdiffhomepage
path: root/packet
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-11-04 01:10:32 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-11-04 01:11:14 +0900
commit6c86d7507223df3b8dd46149a5ffd6518d244fd8 (patch)
treed9b543376d367be2f92149fbeee2e3906a04e9d2 /packet
parentb4c787686c302c146e3cad42057db2cb01149056 (diff)
packet: add NewNLRInfo function
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet')
-rw-r--r--packet/bgp.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/packet/bgp.go b/packet/bgp.go
index 580c32ff..59d62915 100644
--- a/packet/bgp.go
+++ b/packet/bgp.go
@@ -1831,6 +1831,12 @@ type NLRInfo struct {
IPAddrPrefix
}
+func NewNLRInfo(length uint8, prefix string) *NLRInfo {
+ return &NLRInfo{
+ IPAddrPrefix: *NewIPAddrPrefix(length, prefix),
+ }
+}
+
type BGPUpdate struct {
WithdrawnRoutesLen uint16
WithdrawnRoutes []WithdrawnRoute