Documentation ¶
Index ¶
- func AddAvpDataToMap(avps []*layers.AVP, data map[string]string)
- func JsonFromAvpFields(avps []*layers.AVP, includeFields []string) string
- func PrintAvp(avp *layers.AVP, indent int)
- func PrintAvps(d *layers.Diameter)
- func VisitAvp(avp *layers.AVP, visitor func(*layers.AVP))
- func VisitAvps(dmsg *layers.Diameter, visitor func(*layers.AVP))
- type AvpIndexer
- func (ai AvpIndexer) AccumulateUint64(vendorId, attrId uint32) uint64
- func (ai AvpIndexer) FromGroup(vendorId, attrId uint32) avpIndexerWithPath
- func (ai AvpIndexer) GetEnumerated(vendorId, attrId uint32) uint32
- func (ai AvpIndexer) GetFloat32(vendorId, attrId uint32) float32
- func (ai AvpIndexer) GetFloat64(vendorId, attrId uint32) float64
- func (ai AvpIndexer) GetIPAddress(vendorId, attrId uint32) net.IP
- func (ai AvpIndexer) GetInt32(vendorId, attrId uint32) int32
- func (ai AvpIndexer) GetInt64(vendorId, attrId uint32) int64
- func (ai AvpIndexer) GetTime(vendorId, attrId uint32) time.Time
- func (ai AvpIndexer) GetUTF8String(vendorId, attrId uint32) string
- func (ai AvpIndexer) GetUint32(vendorId, attrId uint32) uint32
- func (ai AvpIndexer) GetUint64(vendorId, attrId uint32) uint64
- func (ai AvpIndexer) VisitAvp(vendorId, attrId uint32, f func(avp *layers.AVP)) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAvpDataToMap ¶
Copy AVP decoded (string) values into a flat map value only if the key (AVP name, per RFC) exists in same map. Clobbers previous values as found.
func JsonFromAvpFields ¶
Create flat map json string similar to AddAvpDataToMap()
func PrintAvp ¶
Recursively prints AVP values to stdout, indenting with grouped sub-AVPs, starting at given indent level.
Types ¶
type AvpIndexer ¶
type AvpIndexer struct {
// contains filtered or unexported fields
}
Indexer that facilitates convenient path matching and typed retrieval of AVP values. Usage:
ai = NewAvpIndexer(diaMsg) ai.GetUint32(vendorId,attrId) ai.FromGroup(vendorId,attrId).FromGroup(attrId2, vendorId2).GetTime(vendorId,attrId) ai.FromGroup(vendorId,attrId).AccumulateUint64(vendorId,attrId) ai.FromGroup(vendorId,attrId).VisitAvp(vendorId, attrId, f)
func NewAvpIndexer ¶
func NewAvpIndexer(d *layers.Diameter) AvpIndexer
Create a new instance of an AvpIndexer for the diameter message.
func (AvpIndexer) AccumulateUint64 ¶
func (ai AvpIndexer) AccumulateUint64(vendorId, attrId uint32) uint64
add up uint64 vales for all matching AVPs
func (AvpIndexer) FromGroup ¶
func (ai AvpIndexer) FromGroup(vendorId, attrId uint32) avpIndexerWithPath
return indexer that starts all retrieval operations from the given id (may match multiple nodes)
func (AvpIndexer) GetEnumerated ¶
func (ai AvpIndexer) GetEnumerated(vendorId, attrId uint32) uint32
retrieve first matching enumerated (uint32) value with given id, or the default/zero value for that type
func (AvpIndexer) GetFloat32 ¶
func (ai AvpIndexer) GetFloat32(vendorId, attrId uint32) float32
retrieve first matching float32 value with given id, or the default/zero value for that type
func (AvpIndexer) GetFloat64 ¶
func (ai AvpIndexer) GetFloat64(vendorId, attrId uint32) float64
retrieve first matching float64 value with given id, or the default/zero value for that type
func (AvpIndexer) GetIPAddress ¶
func (ai AvpIndexer) GetIPAddress(vendorId, attrId uint32) net.IP
retrieve first matching net.IP value with given id, or the default/zero value for that type
func (AvpIndexer) GetInt32 ¶
func (ai AvpIndexer) GetInt32(vendorId, attrId uint32) int32
retrieve first matching int32 value with given id, or the default/zero value for that type
func (AvpIndexer) GetInt64 ¶
func (ai AvpIndexer) GetInt64(vendorId, attrId uint32) int64
retrieve first matching int64 value with given id, or the default/zero value for that type
func (AvpIndexer) GetTime ¶
func (ai AvpIndexer) GetTime(vendorId, attrId uint32) time.Time
retrieve first matching time.Time value with given id, or the default/zero value for that type
func (AvpIndexer) GetUTF8String ¶
func (ai AvpIndexer) GetUTF8String(vendorId, attrId uint32) string
retrieve first matching string value with given id, or the default/zero value for that type
func (AvpIndexer) GetUint32 ¶
func (ai AvpIndexer) GetUint32(vendorId, attrId uint32) uint32
retrieve first matching uint32 value with given id, or the default/zero value for that type
func (AvpIndexer) GetUint64 ¶
func (ai AvpIndexer) GetUint64(vendorId, attrId uint32) uint64
retrieve first matching uint64 value with given id, or the default/zero value for that type