Versions in this module Expand all Collapse all v1 v1.0.3 Mar 11, 2024 v1.0.2 Mar 7, 2024 v1.0.1 Feb 20, 2024 Changes in this version + const AA + const AAA + const AAR + const ACA + const ACR + const AIA + const AIR + const ASA + const ASR + const AVPNotAllowed + const AVPOccursTooManyTimes + const AVPUnsupported + const AbortSession + const Accounting + const ApplicationUnsupported + const AuthenticationInformation + const AuthenticationRejected + const AuthorizationRejected + const BASE_ACCOUNTING_APP_ID + const BASE_APP_ID + const CCA + const CCR + const CEA + const CER + const CHARGING_CONTROL_APP_ID + const CLA + const CLR + const CancelLocation + const CapabilitiesExchange + const CommandUnsupported + const ContradictingAVPs + const CreditControl + const DIAMETER_SY_APP_ID + const DPA + const DPR + const DWA + const DWR + const DeviceWatchdog + const DiameterPPID + const DisconnectPeer + const ElectionLost + const ErrorFlag + const GX_CHARGING_CONTROL_APP_ID + const GroupedAVPType + const HeaderLength + const InvalidAVPBitCombo + const InvalidAVPBits + const InvalidAVPLenght + const InvalidAVPValue + const InvalidBitInHeader + const InvalidHDRBits + const InvalidMessageLength + const InvalidStreamID + const LimitedSuccess + const LoopDetected + const MAA + const MAR + const MOForwardShortMessage + const MTForwardShortMessage + const MaxInboundSCTPStreams + const MaxOutboundSCTPStreams + const MissingAVP + const MultiRoundAuth + const MultimediaAuthentication + const NETWORK_ACCESS_APP_ID + const NOA + const NOR + const NoCommonApplication + const NoCommonSecurity + const Notify + const OFA + const OFR + const OutOfSpace + const PUA + const PUR + const ProxiableFlag + const PurgeUE + const RAA + const RAR + const RSA + const RSR + const RTA + const RTR + const ReAuth + const RealmNotServed + const RedirectIndication + const RegistrationTermination + const RequestFlag + const Reset + const ResourcesExceeded + const RetransmittedFlag + const SAA + const SAR + const SLA + const SLR + const STA + const STR + const ServerAssignment + const SessionTermination + const SpendingLimit + const Success + const TFA + const TFR + const TGPP_APP_ID + const TGPP_S6A_APP_ID + const TGPP_SGD_APP_ID + const TGPP_SWX_APP_ID + const TooBusy + const ULA + const ULR + const UnableToComply + const UnableToDeliver + const UnknownPeer + const UnknownSessionID + const UnknownUser + const UnsupportedVersion + const UpdateLocation + var ALL_CMD_INDEX = CommandIndex + var DefaultServeMux = NewServeMux() + var MessageBufferLength = 1 << 10 + func ErrorReports() <-chan *ErrorReport + func Handle(cmd string, handler Handler) + func HandleFunc(cmd string, handler func(Conn, *Message)) + func Listen(network, address string) (net.Listener, error) + func ListenAndServe(addr string, handler Handler, dp *dict.Parser) error + func ListenAndServeNetwork(network, addr string, handler Handler, dp *dict.Parser) error + func ListenAndServeNetworkTLS(network, addr string, certFile string, keyFile string, handler Handler, ...) error + func ListenAndServeTLS(addr string, certFile string, keyFile string, handler Handler, dp *dict.Parser) error + func MultistreamListen(network, address string) (net.Listener, error) + func Serve(l net.Listener, handler Handler) error + func TLSConfigClone(cfg *tls.Config) *tls.Config + type AVP struct + Code uint32 + Data datatype.Type + Flags uint8 + Length int + VendorID uint32 + func DecodeAVP(data []byte, application uint32, dictionary *dict.Parser) (*AVP, error) + func NewAVP(code uint32, flags uint8, vendor uint32, data datatype.Type) *AVP + func (a *AVP) DecodeFromBytes(data []byte, application uint32, dictionary *dict.Parser) error + func (a *AVP) Len() int + func (a *AVP) Serialize() ([]byte, error) + func (a *AVP) SerializeTo(b []byte) error + func (a *AVP) String() string + type CloseNotifier interface + CloseNotify func() <-chan struct{} + type CommandIndex struct + AppID uint32 + Code uint32 + Request bool + type Conn interface + Close func() + Connection func() net.Conn + Context func() context.Context + Dictionary func() *dict.Parser + LocalAddr func() net.Addr + RemoteAddr func() net.Addr + SetContext func(ctx context.Context) + TLS func() *tls.ConnectionState + Write func(b []byte) (int, error) + WriteStream func(b []byte, stream uint) (int, error) + func Dial(addr string, handler Handler, dp *dict.Parser) (Conn, error) + func DialExt(network, addr string, handler Handler, dp *dict.Parser, timeout time.Duration, ...) (Conn, error) + func DialNetwork(network, addr string, handler Handler, dp *dict.Parser) (Conn, error) + func DialNetworkBind(network, laddr, raddr string, handler Handler, dp *dict.Parser) (Conn, error) + func DialNetworkTLS(network, addr, certFile, keyFile string, handler Handler, dp *dict.Parser) (Conn, error) + func DialNetworkTimeout(network, addr string, handler Handler, dp *dict.Parser, timeout time.Duration) (Conn, error) + func DialTLS(addr, certFile, keyFile string, handler Handler, dp *dict.Parser) (Conn, error) + func DialTLSExt(network, addr, certFile, keyFile string, handler Handler, dp *dict.Parser, ...) (Conn, error) + func DialTLSTimeout(addr, certFile, keyFile string, handler Handler, dp *dict.Parser, ...) (Conn, error) + func DialTimeout(addr string, handler Handler, dp *dict.Parser, timeout time.Duration) (Conn, error) + func NewConn(rw net.Conn, addr string, handler Handler, dp *dict.Parser) (Conn, error) + type Dialer interface + Dial func(network, address string) (net.Conn, error) + type ErrorReport struct + Conn Conn + Error error + Message *Message + func (er *ErrorReport) String() string + type ErrorReporter interface + Error func(err *ErrorReport) + ErrorReports func() <-chan *ErrorReport + type GroupedAVP struct + AVP []*AVP + func DecodeGrouped(data datatype.Grouped, application uint32, dictionary *dict.Parser) (*GroupedAVP, error) + func (g *GroupedAVP) AddAVP(a *AVP) + func (g *GroupedAVP) Len() int + func (g *GroupedAVP) Padding() int + func (g *GroupedAVP) Serialize() []byte + func (g *GroupedAVP) String() string + func (g *GroupedAVP) Type() datatype.TypeID + type Handler interface + ServeDIAM func(Conn, *Message) + type HandlerFunc func(Conn, *Message) + func (f HandlerFunc) ServeDIAM(c Conn, m *Message) + type Header struct + ApplicationID uint32 + CommandCode uint32 + CommandFlags uint8 + EndToEndID uint32 + HopByHopID uint32 + MessageLength uint32 + Version uint8 + func DecodeHeader(data []byte) (*Header, error) + func (h *Header) DecodeFromBytes(data []byte) error + func (h *Header) Serialize() []byte + func (h *Header) SerializeTo(b []byte) + func (h *Header) String() string + type Message struct + AVP []*AVP + Header *Header + func NewMessage(cmd uint32, flags uint8, appid, hopbyhop, endtoend uint32, ...) *Message + func NewRequest(cmd uint32, appid uint32, dictionary *dict.Parser) *Message + func ReadMessage(reader io.Reader, dictionary *dict.Parser) (*Message, error) + func (m *Message) AddAVP(a *AVP) + func (m *Message) Answer(resultCode uint32) *Message + func (m *Message) Context() context.Context + func (m *Message) Dictionary() *dict.Parser + func (m *Message) FindAVP(code interface{}, vendorID uint32) (*AVP, error) + func (m *Message) FindAVPs(code interface{}, vendorID uint32) ([]*AVP, error) + func (m *Message) FindAVPsWithPath(path []interface{}, vendorID uint32) ([]*AVP, error) + func (m *Message) InsertAVP(a *AVP) + func (m *Message) Len() int + func (m *Message) Marshal(src interface{}) error + func (m *Message) MessageStream() uint + func (m *Message) NewAVP(code interface{}, flags uint8, vendor uint32, data datatype.Type) (*AVP, error) + func (m *Message) PrettyDump() string + func (m *Message) Serialize() ([]byte, error) + func (m *Message) SerializeTo(b []byte) (err error) + func (m *Message) SetContext(ctx context.Context) + func (m *Message) String() string + func (m *Message) Unmarshal(dst interface{}) error + func (m *Message) WriteTo(writer io.Writer) (int64, error) + func (m *Message) WriteToStream(writer io.Writer, stream uint) (n int, err error) + func (m *Message) WriteToStreamWithRetry(writer io.Writer, stream, retries uint) (n int, err error) + func (m *Message) WriteToWithRetry(writer io.Writer, retries uint) (int64, error) + type MultistreamConn interface + CurrentStream func() uint + CurrentWriterStream func() uint + ReadAny func(b []byte) (n int, stream uint, err error) + ReadAtLeast func(b []byte, min int, strm uint) (n int, stream uint, err error) + ReadStream func(b []byte, stream uint) (n int, err error) + ResetCurrentStream func() + ResetWriterStream func() + SetCurrentStream func(uint) uint + SetErrorHandler func(MutistreamConnErrorHandler) + SetWriterStream func(uint) uint + WriteStream func(b []byte, stream uint) (n int, err error) + func NewSCTPConn(sctpConn *sctp.SCTPConn) MultistreamConn + type MultistreamReader interface + CurrentStream func() uint + ReadAny func(b []byte) (n int, stream uint, err error) + ReadAtLeast func(b []byte, min int, strm uint) (n int, stream uint, err error) + ReadStream func(b []byte, stream uint) (n int, err error) + ResetCurrentStream func() + SetCurrentStream func(uint) uint + type MultistreamWriter interface + CurrentWriterStream func() uint + ResetWriterStream func() + SetWriterStream func(uint) uint + WriteStream func(b []byte, stream uint) (n int, err error) + type MutistreamConnErrorHandler func(MultistreamConn, error) + type SCTPConn struct + func (msc *SCTPConn) CurrentStream() uint + func (msc *SCTPConn) CurrentWriterStream() uint + func (msc *SCTPConn) Read(b []byte) (n int, err error) + func (msc *SCTPConn) ReadAny(b []byte) (n int, stream uint, err error) + func (msc *SCTPConn) ReadAtLeast(buf []byte, min int, strm uint) (n int, stream uint, err error) + func (msc *SCTPConn) ReadStream(b []byte, stream uint) (n int, err error) + func (msc *SCTPConn) ResetCurrentStream() + func (msc *SCTPConn) ResetWriterStream() + func (msc *SCTPConn) SetCurrentStream(stream uint) uint + func (msc *SCTPConn) SetErrorHandler(h MutistreamConnErrorHandler) + func (msc *SCTPConn) SetWriterStream(stream uint) uint + func (msc *SCTPConn) Write(b []byte) (int, error) + func (msc *SCTPConn) WriteStream(b []byte, stream uint) (int, error) + type ServeMux struct + func NewServeMux() *ServeMux + func (mux *ServeMux) Error(err *ErrorReport) + func (mux *ServeMux) ErrorReports() <-chan *ErrorReport + func (mux *ServeMux) Handle(shortCmd string, handler Handler) + func (mux *ServeMux) HandleFunc(cmd string, handler func(Conn, *Message)) + func (mux *ServeMux) HandleIdx(cmd CommandIndex, handler Handler) + func (mux *ServeMux) ServeDIAM(c Conn, m *Message) + type Server struct + Addr string + Dict *dict.Parser + Handler Handler + LocalAddr net.Addr + Network string + ReadTimeout time.Duration + TLSConfig *tls.Config + WriteTimeout time.Duration + func (srv *Server) ListenAndServe() error + func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error + func (srv *Server) Serve(l net.Listener) error