summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp.go
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2014-11-28 13:34:14 +0900
committerHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2014-11-28 13:34:14 +0900
commit9dd3001830c17f08ce659af003fb21b18df4883c (patch)
tree60d4cdd68eda8a51279e8c8f3c8d54735adea72c /packet/bgp.go
parent048cc6968d6af5da330bf45f5891ef81d4f6b33d (diff)
add ASLen function to AsPathParamInterface and its structs
Diffstat (limited to 'packet/bgp.go')
-rw-r--r--packet/bgp.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/packet/bgp.go b/packet/bgp.go
index 942f2d6f..ddb81814 100644
--- a/packet/bgp.go
+++ b/packet/bgp.go
@@ -1180,6 +1180,10 @@ func (a *AsPathParam) Len() int {
return 2 + len(a.AS)*2
}
+func (a *AsPathParam) ASLen() int {
+ return len(a.AS)
+}
+
func NewAsPathParam(segType uint8, as []uint16) *AsPathParam {
return &AsPathParam{
Type: segType,
@@ -1219,6 +1223,10 @@ func (a *As4PathParam) Len() int {
return 2 + len(a.AS)*4
}
+func (a *As4PathParam) ASLen() int {
+ return len(a.AS)
+}
+
func NewAs4PathParam(segType uint8, as []uint32) *As4PathParam {
return &As4PathParam{
Type: segType,
@@ -1250,6 +1258,7 @@ type AsPathParamInterface interface {
Serialize() ([]byte, error)
DecodeFromBytes([]byte) error
Len() int
+ ASLen() int
}
type PathAttributeAsPath struct {