Skip to content

Commit

Permalink
Merge pull request #54 from nttcom/fix/tlv.go
Browse files Browse the repository at this point in the history
Remove unnecessary prints
  • Loading branch information
watal committed Feb 13, 2023
2 parents e2db2e7 + 7e99839 commit ed3f0b2
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions pkg/packet/pcep/tlv.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,7 @@ type AssocTypeList struct {

func (tlv *AssocTypeList) DecodeFromBytes(data []uint8) error {
AssocTypeNum := binary.BigEndian.Uint16(data[2:4]) / 2
fmt.Printf("ASOC NUM: %d\n", AssocTypeNum)
for i := 0; i < int(AssocTypeNum); i++ {
fmt.Printf("aaa\n")
at := binary.BigEndian.Uint16(data[4+2*i : 6+2*i])
tlv.AssocTypes = append(tlv.AssocTypes, AssocType(at))
}
Expand All @@ -485,10 +483,7 @@ func (tlv *AssocTypeList) Serialize() []uint8 {
binary.BigEndian.PutUint16(binAt, uint16(at))
buf = append(buf, binAt...)
}
fmt.Printf("len: %d\n", tlv.Len())
if tlv.Len()%4 != 0 {

fmt.Printf("len: %d\n", tlv.Len()%4)
pad := make([]uint8, 4-(tlv.Len()%4))
buf = append(buf, pad...)
}
Expand Down

0 comments on commit ed3f0b2

Please sign in to comment.