Skip to content

Commit

Permalink
pola command usid support
Browse files Browse the repository at this point in the history
  • Loading branch information
Motok1 committed Jun 9, 2024
1 parent 76fb091 commit d2fed5e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cmd/pola/sr_policy_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func newSRPolicyAddCmd() *cobra.Command {

// Unify with table.Segment
type Segment struct {
Sid string `yaml:"sid"`
Sid string `yaml:"sid"`
LocalAddr string `yaml:"localAddr"`
RemoteAddr string `yaml:"remoteAddr"`
SidStructure string `yaml:"sidStructure"`
}

// Unify with table.SRPolciy
Expand Down Expand Up @@ -124,7 +127,13 @@ func addSRPolicyNoLinkState(input InputFormat) error {

segmentList := []*pb.Segment{}
for _, seg := range input.SRPolicy.SegmentList {
segmentList = append(segmentList, &pb.Segment{Sid: seg.Sid})
pbSeg := &pb.Segment{
Sid: seg.Sid,
LocalAddr: seg.LocalAddr,
RemoteAddr: seg.RemoteAddr,
SidStructure: seg.SidStructure,
}
segmentList = append(segmentList, pbSeg)
}
srPolicy := &pb.SRPolicy{
PcepSessionAddr: input.SRPolicy.PcepSessionAddr.AsSlice(),
Expand Down

0 comments on commit d2fed5e

Please sign in to comment.