protos

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: BSD-3-Clause Imports: 7 Imported by: 2

README

Basic Accounting Protocol

GoDoc

Google proto definitions of basic accounting service

To modify/extend the RPC - edit acct.proto
Then run 'go generate ./...' in this directory to update corresponding Go GRPC files. Please, commit generated .pb.go files together with your .proto changes.

Documentation

Overview

package protos provides proto definitions of basic accounting service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAccountingServer

func RegisterAccountingServer(s *grpc.Server, srv AccountingServer)

Types

type AccountingClient

type AccountingClient interface {
	// start will be called at the end of every new user session creation
	// start is responsible for verification & initiation of a smart contract
	// between the user identity provider/MNO and service provider (ISP/WISP/PLTE)
	// A non-error return will indicate successful contract establishment and will
	// result in the beginning of service for the user
	Start(ctx context.Context, in *Session, opts ...grpc.CallOption) (*SessionResp, error)
	// update should be continuously called for every ongoing service session to update
	// the user bandwidth usage as well as current quality of provided service.
	// If update returns error the session should be terminated and the user disconnected,
	// In the case of unsuccessful update completion, service provider is spouse to follow up
	// with final stop call
	Update(ctx context.Context, in *UpdateReq, opts ...grpc.CallOption) (*SessionResp, error)
	// stop is a notification call to communicate to identity provider
	// user/network  initiated service termination.
	// stop will provide final used bandwidth count. stop call is issued
	// after the user session was terminated.
	Stop(ctx context.Context, in *UpdateReq, opts ...grpc.CallOption) (*StopResp, error)
}

AccountingClient is the client API for Accounting service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAccountingClient

func NewAccountingClient(cc grpc.ClientConnInterface) AccountingClient

type AccountingServer

type AccountingServer interface {
	// start will be called at the end of every new user session creation
	// start is responsible for verification & initiation of a smart contract
	// between the user identity provider/MNO and service provider (ISP/WISP/PLTE)
	// A non-error return will indicate successful contract establishment and will
	// result in the beginning of service for the user
	Start(context.Context, *Session) (*SessionResp, error)
	// update should be continuously called for every ongoing service session to update
	// the user bandwidth usage as well as current quality of provided service.
	// If update returns error the session should be terminated and the user disconnected,
	// In the case of unsuccessful update completion, service provider is spouse to follow up
	// with final stop call
	Update(context.Context, *UpdateReq) (*SessionResp, error)
	// stop is a notification call to communicate to identity provider
	// user/network  initiated service termination.
	// stop will provide final used bandwidth count. stop call is issued
	// after the user session was terminated.
	Stop(context.Context, *UpdateReq) (*StopResp, error)
}

AccountingServer is the server API for Accounting service.

type QoS

type QoS struct {
	DownloadMbps         float32  `protobuf:"fixed32,1,opt,name=download_mbps,json=downloadMbps,proto3" json:"download_mbps,omitempty"`
	UploadMbps           float32  `protobuf:"fixed32,2,opt,name=upload_mbps,json=uploadMbps,proto3" json:"upload_mbps,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Quality Of Service data

func (*QoS) Descriptor

func (*QoS) Descriptor() ([]byte, []int)

func (*QoS) GetDownloadMbps

func (m *QoS) GetDownloadMbps() float32

func (*QoS) GetUploadMbps

func (m *QoS) GetUploadMbps() float32

func (*QoS) ProtoMessage

func (*QoS) ProtoMessage()

func (*QoS) Reset

func (m *QoS) Reset()

func (*QoS) String

func (m *QoS) String() string

func (*QoS) XXX_DiscardUnknown

func (m *QoS) XXX_DiscardUnknown()

func (*QoS) XXX_Marshal

func (m *QoS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QoS) XXX_Merge

func (m *QoS) XXX_Merge(src proto.Message)

func (*QoS) XXX_Size

func (m *QoS) XXX_Size() int

func (*QoS) XXX_Unmarshal

func (m *QoS) XXX_Unmarshal(b []byte) error

type Session

type Session struct {
	// user identity
	//
	// Types that are valid to be assigned to User:
	//	*Session_IMSI
	//	*Session_CertificateSerialNumber
	//	*Session_HardwareAddr
	//	*Session_Name
	User isSession_User `protobuf_oneof:"user"`
	// ID of the user network (MNO, Identity Provider, etc. - user network ID)
	ConsumerId string `protobuf:"bytes,5,opt,name=consumer_id,json=consumerId,proto3" json:"consumer_id,omitempty"`
	// unique session ID
	SessionId string `protobuf:"bytes,6,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// ID of the service provider network (serving network ID)
	ProviderId string `protobuf:"bytes,7,opt,name=provider_id,json=providerId,proto3" json:"provider_id,omitempty"`
	// ID/Name of the serving provider Access Point (WiFi AP, LTE enodeb, etc.) - optional
	ProviderApn string `protobuf:"bytes,8,opt,name=provider_apn,json=providerApn,proto3" json:"provider_apn,omitempty"`
	// ID of the service provider gateway  (AGW, CWAG, etc.) - optional
	// Note: this is the ID of Magma access gateway, multiple APs/enodebs may be connected to a single access gateway
	ProviderGatewayId string `protobuf:"bytes,9,opt,name=provider_gateway_id,json=providerGatewayId,proto3" json:"provider_gateway_id,omitempty"`
	// available QoS at the caller's site (optional - can be ignored by SC)
	AvailableQos         *QoS     `protobuf:"bytes,10,opt,name=available_qos,json=availableQos,proto3" json:"available_qos,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

user session descriptor

func (*Session) Descriptor

func (*Session) Descriptor() ([]byte, []int)

func (*Session) GetAvailableQos

func (m *Session) GetAvailableQos() *QoS

func (*Session) GetCertificateSerialNumber

func (m *Session) GetCertificateSerialNumber() []byte

func (*Session) GetConsumerId

func (m *Session) GetConsumerId() string

func (*Session) GetHardwareAddr

func (m *Session) GetHardwareAddr() []byte

func (*Session) GetIMSI

func (m *Session) GetIMSI() string

func (*Session) GetName

func (m *Session) GetName() string

func (*Session) GetProviderApn

func (m *Session) GetProviderApn() string

func (*Session) GetProviderGatewayId

func (m *Session) GetProviderGatewayId() string

func (*Session) GetProviderId

func (m *Session) GetProviderId() string

func (*Session) GetSessionId

func (m *Session) GetSessionId() string

func (*Session) GetUser

func (m *Session) GetUser() isSession_User

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) Reset

func (m *Session) Reset()

func (*Session) String

func (m *Session) String() string

func (*Session) XXX_DiscardUnknown

func (m *Session) XXX_DiscardUnknown()

func (*Session) XXX_Marshal

func (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Session) XXX_Merge

func (m *Session) XXX_Merge(src proto.Message)

func (*Session) XXX_OneofWrappers

func (*Session) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Session) XXX_Size

func (m *Session) XXX_Size() int

func (*Session) XXX_Unmarshal

func (m *Session) XXX_Unmarshal(b []byte) error

type SessionResp

type SessionResp struct {
	ReportingAdvisory *SessionRespReportLimits `protobuf:"bytes,1,opt,name=reporting_advisory,json=reportingAdvisory,proto3" json:"reporting_advisory,omitempty"`
	// minimal required QoS, the session has to be terminated if service provider's site
	// cannot guarantee the requested QoS (optional)
	MinAcceptableQos     *QoS     `protobuf:"bytes,2,opt,name=min_acceptable_qos,json=minAcceptableQos,proto3" json:"min_acceptable_qos,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

start session response

func (*SessionResp) Descriptor

func (*SessionResp) Descriptor() ([]byte, []int)

func (*SessionResp) GetMinAcceptableQos

func (m *SessionResp) GetMinAcceptableQos() *QoS

func (*SessionResp) GetReportingAdvisory

func (m *SessionResp) GetReportingAdvisory() *SessionRespReportLimits

func (*SessionResp) ProtoMessage

func (*SessionResp) ProtoMessage()

func (*SessionResp) Reset

func (m *SessionResp) Reset()

func (*SessionResp) String

func (m *SessionResp) String() string

func (*SessionResp) XXX_DiscardUnknown

func (m *SessionResp) XXX_DiscardUnknown()

func (*SessionResp) XXX_Marshal

func (m *SessionResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SessionResp) XXX_Merge

func (m *SessionResp) XXX_Merge(src proto.Message)

func (*SessionResp) XXX_Size

func (m *SessionResp) XXX_Size() int

func (*SessionResp) XXX_Unmarshal

func (m *SessionResp) XXX_Unmarshal(b []byte) error

type SessionRespReportLimits

type SessionRespReportLimits struct {
	// octets_in - trigger update when RX bytes were consumed by the user from the last update event
	// default is 0, no RX trigger
	OctetsIn uint64 `protobuf:"varint,1,opt,name=octets_in,json=octetsIn,proto3" json:"octets_in,omitempty"`
	// octets_out - trigger update when TX bytes were consumed by the user from the last update event
	// default is 0, no TX trigger
	OctetsOut uint64 `protobuf:"varint,2,opt,name=octets_out,json=octetsOut,proto3" json:"octets_out,omitempty"`
	// elapsed_time_sec - trigger update when elapsed_time_sec seconds passed from the last update event
	ElapsedTimeSec       uint32   `protobuf:"varint,3,opt,name=elapsed_time_sec,json=elapsedTimeSec,proto3" json:"elapsed_time_sec,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

optional update triggers user identity provider will use report_limits to express its update frequency preferences. Service provider is encouraged, but not required to comply with specified reporting preferences

func (*SessionRespReportLimits) Descriptor

func (*SessionRespReportLimits) Descriptor() ([]byte, []int)

func (*SessionRespReportLimits) GetElapsedTimeSec

func (m *SessionRespReportLimits) GetElapsedTimeSec() uint32

func (*SessionRespReportLimits) GetOctetsIn

func (m *SessionRespReportLimits) GetOctetsIn() uint64

func (*SessionRespReportLimits) GetOctetsOut

func (m *SessionRespReportLimits) GetOctetsOut() uint64

func (*SessionRespReportLimits) ProtoMessage

func (*SessionRespReportLimits) ProtoMessage()

func (*SessionRespReportLimits) Reset

func (m *SessionRespReportLimits) Reset()

func (*SessionRespReportLimits) String

func (m *SessionRespReportLimits) String() string

func (*SessionRespReportLimits) XXX_DiscardUnknown

func (m *SessionRespReportLimits) XXX_DiscardUnknown()

func (*SessionRespReportLimits) XXX_Marshal

func (m *SessionRespReportLimits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SessionRespReportLimits) XXX_Merge

func (m *SessionRespReportLimits) XXX_Merge(src proto.Message)

func (*SessionRespReportLimits) XXX_Size

func (m *SessionRespReportLimits) XXX_Size() int

func (*SessionRespReportLimits) XXX_Unmarshal

func (m *SessionRespReportLimits) XXX_Unmarshal(b []byte) error

type Session_CertificateSerialNumber

type Session_CertificateSerialNumber struct {
	CertificateSerialNumber []byte `protobuf:"bytes,2,opt,name=certificate_serial_number,json=certificateSerialNumber,proto3,oneof"`
}

type Session_HardwareAddr

type Session_HardwareAddr struct {
	HardwareAddr []byte `protobuf:"bytes,3,opt,name=hardware_addr,json=hardwareAddr,proto3,oneof"`
}

type Session_IMSI

type Session_IMSI struct {
	IMSI string `protobuf:"bytes,1,opt,name=IMSI,proto3,oneof"`
}

type Session_Name

type Session_Name struct {
	Name string `protobuf:"bytes,4,opt,name=name,proto3,oneof"`
}

type StopResp

type StopResp struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*StopResp) Descriptor

func (*StopResp) Descriptor() ([]byte, []int)

func (*StopResp) ProtoMessage

func (*StopResp) ProtoMessage()

func (*StopResp) Reset

func (m *StopResp) Reset()

func (*StopResp) String

func (m *StopResp) String() string

func (*StopResp) XXX_DiscardUnknown

func (m *StopResp) XXX_DiscardUnknown()

func (*StopResp) XXX_Marshal

func (m *StopResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StopResp) XXX_Merge

func (m *StopResp) XXX_Merge(src proto.Message)

func (*StopResp) XXX_Size

func (m *StopResp) XXX_Size() int

func (*StopResp) XXX_Unmarshal

func (m *StopResp) XXX_Unmarshal(b []byte) error

type UnimplementedAccountingServer

type UnimplementedAccountingServer struct {
}

UnimplementedAccountingServer can be embedded to have forward compatible implementations.

func (*UnimplementedAccountingServer) Start

func (*UnimplementedAccountingServer) Stop

func (*UnimplementedAccountingServer) Update

type UpdateReq

type UpdateReq struct {
	// ongoing session information
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
	// octets_in indicates how many octets have been received by the user
	// from the service provider over the course of this session (accumulative)
	// The accumulative nature of this field should compensate for intermittent
	// losses of connectivity
	OctetsIn uint64 `protobuf:"varint,2,opt,name=octets_in,json=octetsIn,proto3" json:"octets_in,omitempty"`
	// octets_out indicates how many octets have been sent on behalf of the user
	// by the service provider over the course of this session (accumulative)
	// The accumulative nature of this field should compensate for intermittent
	// losses of connectivity
	OctetsOut uint64 `protobuf:"varint,3,opt,name=octets_out,json=octetsOut,proto3" json:"octets_out,omitempty"`
	// session_time indicates how many seconds the user/session has received service for
	SessionTime          uint32   `protobuf:"varint,4,opt,name=session_time,json=sessionTime,proto3" json:"session_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

update_req is relying information on user's ongoing session consumption

func (*UpdateReq) Descriptor

func (*UpdateReq) Descriptor() ([]byte, []int)

func (*UpdateReq) GetOctetsIn

func (m *UpdateReq) GetOctetsIn() uint64

func (*UpdateReq) GetOctetsOut

func (m *UpdateReq) GetOctetsOut() uint64

func (*UpdateReq) GetSession

func (m *UpdateReq) GetSession() *Session

func (*UpdateReq) GetSessionTime

func (m *UpdateReq) GetSessionTime() uint32

func (*UpdateReq) ProtoMessage

func (*UpdateReq) ProtoMessage()

func (*UpdateReq) Reset

func (m *UpdateReq) Reset()

func (*UpdateReq) String

func (m *UpdateReq) String() string

func (*UpdateReq) XXX_DiscardUnknown

func (m *UpdateReq) XXX_DiscardUnknown()

func (*UpdateReq) XXX_Marshal

func (m *UpdateReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateReq) XXX_Merge

func (m *UpdateReq) XXX_Merge(src proto.Message)

func (*UpdateReq) XXX_Size

func (m *UpdateReq) XXX_Size() int

func (*UpdateReq) XXX_Unmarshal

func (m *UpdateReq) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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