smpeer

package
v4.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package smpeer provides functions for extracting information from a CER or CEA, and associating with a Context.

Example:

func handleXYZ(c diam.Conn, m *diam.Message) {
	meta, ok := smpeer.FromContext(c.Context())
	if ok {
		log.Println(meta)
	}
}

See the Metadata type for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, metadata *Metadata) context.Context

NewContext returns a new Context that carries a Metadata object.

Types

type Metadata

type Metadata struct {
	OriginHost   datatype.DiameterIdentity
	OriginRealm  datatype.DiameterIdentity
	Applications []uint32 // Acct or Auth IDs supported by the peer.
}

Metadata contains information about a diameter peer, acquired during the CER/CEA handshake.

func FromCEA

func FromCEA(cea *smparser.CEA) *Metadata

FromCEA creates a Metadata object from data in the CEA.

func FromCER

func FromCER(cer *smparser.CER) *Metadata

FromCER creates a Metadata object from data in the CER.

func FromContext

func FromContext(ctx context.Context) (*Metadata, bool)

FromContext extracts a Metadata object from the context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL