Skip to content

Commit

Permalink
Add ipfix path delay definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuya9786 committed Nov 4, 2023
1 parent adc2718 commit e8db30c
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions pkg/packet/ipfix/field_value.go → pkg/ipfix/field_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,102 @@ func (fv *SRHSegmentIPv6EndpointBehavior) FieldSpecifier() *FieldSpecifier {
return fs
}

type PathDelayMeanDeltaMicroseconds struct {
Val uint32
}

func (fv *PathDelayMeanDeltaMicroseconds) ElementID() uint16 {
return IEID_PATH_DELAY_MEAN_DALTA_MICROSECONDS
}

func (fv *PathDelayMeanDeltaMicroseconds) Serialize() []uint8 {
ret := make([]uint8, 4)
binary.BigEndian.PutUint32(ret, fv.Val)
return ret
}

func (fv *PathDelayMeanDeltaMicroseconds) Len() uint16 {
return 4
}

func (fv *PathDelayMeanDeltaMicroseconds) FieldSpecifier() *FieldSpecifier {
templateLen := fv.Len()
fs := NewFieldSpecifier(false, fv.ElementID(), templateLen, ENTERPRISE_NUMBER_NTTCOM)
return fs
}

type PathDelayMinDeltaMicroseconds struct {
Val uint32
}

func (fv *PathDelayMinDeltaMicroseconds) ElementID() uint16 {
return IEID_PATH_DELAY_MIN_DALTA_MICROSECONDS
}

func (fv *PathDelayMinDeltaMicroseconds) Serialize() []uint8 {
ret := make([]uint8, 4)
binary.BigEndian.PutUint32(ret, fv.Val)
return ret
}

func (fv *PathDelayMinDeltaMicroseconds) Len() uint16 {
return 4
}

func (fv *PathDelayMinDeltaMicroseconds) FieldSpecifier() *FieldSpecifier {
templateLen := fv.Len()
fs := NewFieldSpecifier(false, fv.ElementID(), templateLen, ENTERPRISE_NUMBER_NTTCOM)
return fs
}

type PathDelayMaxDeltaMicroseconds struct {
Val uint32
}

func (fv *PathDelayMaxDeltaMicroseconds) ElementID() uint16 {
return IEID_PATH_DELAY_MAX_DALTA_MICROSECONDS
}

func (fv *PathDelayMaxDeltaMicroseconds) Serialize() []uint8 {
ret := make([]uint8, 4)
binary.BigEndian.PutUint32(ret, fv.Val)
return ret
}

func (fv *PathDelayMaxDeltaMicroseconds) Len() uint16 {
return 4
}

func (fv *PathDelayMaxDeltaMicroseconds) FieldSpecifier() *FieldSpecifier {
templateLen := fv.Len()
fs := NewFieldSpecifier(false, fv.ElementID(), templateLen, ENTERPRISE_NUMBER_NTTCOM)
return fs
}

type PathDelaySumDeltaMicroseconds struct {
Val uint32
}

func (fv *PathDelaySumDeltaMicroseconds) ElementID() uint16 {
return IEID_PATH_DELAY_SUM_DALTA_MICROSECONDS
}

func (fv *PathDelaySumDeltaMicroseconds) Serialize() []uint8 {
ret := make([]uint8, 4)
binary.BigEndian.PutUint32(ret, fv.Val)
return ret
}

func (fv *PathDelaySumDeltaMicroseconds) Len() uint16 {
return 4
}

func (fv *PathDelaySumDeltaMicroseconds) FieldSpecifier() *FieldSpecifier {
templateLen := fv.Len()
fs := NewFieldSpecifier(false, fv.ElementID(), templateLen, ENTERPRISE_NUMBER_NTTCOM)
return fs
}

type UndefinedFieldValue struct {
ElemID uint16
Value []uint8
Expand Down
File renamed without changes.

0 comments on commit e8db30c

Please sign in to comment.