diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-02-26 16:53:39 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-04-03 09:16:41 +0900 |
commit | 9697e9d29884608f5dd67af59f456b34317970c0 (patch) | |
tree | e42db7fe3c23329f32ceb0eaa65c1cdf43c26583 | |
parent | 3645e7dee68faff9bd4fbadbb47dc89ecd06058a (diff) |
packet/bgp: Initializer func for PMSI Tunnel ID types
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
-rw-r--r-- | packet/bgp/bgp.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index ab2c5e5c..17b53f29 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -8170,6 +8170,12 @@ func (i *DefaultPmsiTunnelID) String() string { return string(i.Value) } +func NewDefaultPmsiTunnelID(value []byte) *DefaultPmsiTunnelID { + return &DefaultPmsiTunnelID{ + Value: value, + } +} + type IngressReplTunnelID struct { Value net.IP } @@ -8189,6 +8195,16 @@ func (i *IngressReplTunnelID) String() string { return i.Value.String() } +func NewIngressReplTunnelID(value string) *IngressReplTunnelID { + ip := net.ParseIP(value) + if ip == nil { + return nil + } + return &IngressReplTunnelID{ + Value: ip, + } +} + type PathAttributePmsiTunnel struct { PathAttribute IsLeafInfoRequired bool |