summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/bgp.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-02-26 16:53:39 +0900
committerIWASE Yusuke <iwase.yusuke0@gmail.com>2018-04-03 09:16:41 +0900
commit9697e9d29884608f5dd67af59f456b34317970c0 (patch)
treee42db7fe3c23329f32ceb0eaa65c1cdf43c26583 /packet/bgp/bgp.go
parent3645e7dee68faff9bd4fbadbb47dc89ecd06058a (diff)
packet/bgp: Initializer func for PMSI Tunnel ID types
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'packet/bgp/bgp.go')
-rw-r--r--packet/bgp/bgp.go16
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