// Code generated by protoc-gen-go. DO NOT EDIT.
// source: voltha_protos/extensions.proto

package extension

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	empty "github.com/golang/protobuf/ptypes/empty"
	common "github.com/opencord/voltha-protos/v5/go/common"
	config "github.com/opencord/voltha-protos/v5/go/ext/config"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

type ValueType_Type int32

const (
	ValueType_EMPTY    ValueType_Type = 0
	ValueType_DISTANCE ValueType_Type = 1
)

var ValueType_Type_name = map[int32]string{
	0: "EMPTY",
	1: "DISTANCE",
}

var ValueType_Type_value = map[string]int32{
	"EMPTY":    0,
	"DISTANCE": 1,
}

func (x ValueType_Type) String() string {
	return proto.EnumName(ValueType_Type_name, int32(x))
}

func (ValueType_Type) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{1, 0}
}

type GetOnuUniInfoResponse_ConfigurationInd int32

const (
	GetOnuUniInfoResponse_UNKOWN               GetOnuUniInfoResponse_ConfigurationInd = 0
	GetOnuUniInfoResponse_TEN_BASE_T_FDX       GetOnuUniInfoResponse_ConfigurationInd = 1
	GetOnuUniInfoResponse_HUNDRED_BASE_T_FDX   GetOnuUniInfoResponse_ConfigurationInd = 2
	GetOnuUniInfoResponse_GIGABIT_ETHERNET_FDX GetOnuUniInfoResponse_ConfigurationInd = 3
	GetOnuUniInfoResponse_TEN_G_ETHERNET_FDX   GetOnuUniInfoResponse_ConfigurationInd = 4
	GetOnuUniInfoResponse_TEN_BASE_T_HDX       GetOnuUniInfoResponse_ConfigurationInd = 5
	GetOnuUniInfoResponse_HUNDRED_BASE_T_HDX   GetOnuUniInfoResponse_ConfigurationInd = 6
	GetOnuUniInfoResponse_GIGABIT_ETHERNET_HDX GetOnuUniInfoResponse_ConfigurationInd = 7
)

var GetOnuUniInfoResponse_ConfigurationInd_name = map[int32]string{
	0: "UNKOWN",
	1: "TEN_BASE_T_FDX",
	2: "HUNDRED_BASE_T_FDX",
	3: "GIGABIT_ETHERNET_FDX",
	4: "TEN_G_ETHERNET_FDX",
	5: "TEN_BASE_T_HDX",
	6: "HUNDRED_BASE_T_HDX",
	7: "GIGABIT_ETHERNET_HDX",
}

var GetOnuUniInfoResponse_ConfigurationInd_value = map[string]int32{
	"UNKOWN":               0,
	"TEN_BASE_T_FDX":       1,
	"HUNDRED_BASE_T_FDX":   2,
	"GIGABIT_ETHERNET_FDX": 3,
	"TEN_G_ETHERNET_FDX":   4,
	"TEN_BASE_T_HDX":       5,
	"HUNDRED_BASE_T_HDX":   6,
	"GIGABIT_ETHERNET_HDX": 7,
}

func (x GetOnuUniInfoResponse_ConfigurationInd) String() string {
	return proto.EnumName(GetOnuUniInfoResponse_ConfigurationInd_name, int32(x))
}

func (GetOnuUniInfoResponse_ConfigurationInd) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{7, 0}
}

type GetOnuUniInfoResponse_AdministrativeState int32

const (
	GetOnuUniInfoResponse_ADMSTATE_UNDEFINED GetOnuUniInfoResponse_AdministrativeState = 0
	GetOnuUniInfoResponse_LOCKED             GetOnuUniInfoResponse_AdministrativeState = 1
	GetOnuUniInfoResponse_UNLOCKED           GetOnuUniInfoResponse_AdministrativeState = 2
)

var GetOnuUniInfoResponse_AdministrativeState_name = map[int32]string{
	0: "ADMSTATE_UNDEFINED",
	1: "LOCKED",
	2: "UNLOCKED",
}

var GetOnuUniInfoResponse_AdministrativeState_value = map[string]int32{
	"ADMSTATE_UNDEFINED": 0,
	"LOCKED":             1,
	"UNLOCKED":           2,
}

func (x GetOnuUniInfoResponse_AdministrativeState) String() string {
	return proto.EnumName(GetOnuUniInfoResponse_AdministrativeState_name, int32(x))
}

func (GetOnuUniInfoResponse_AdministrativeState) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{7, 1}
}

type GetOnuUniInfoResponse_OperationalState int32

const (
	GetOnuUniInfoResponse_OPERSTATE_UNDEFINED GetOnuUniInfoResponse_OperationalState = 0
	GetOnuUniInfoResponse_ENABLED             GetOnuUniInfoResponse_OperationalState = 1
	GetOnuUniInfoResponse_DISABLED            GetOnuUniInfoResponse_OperationalState = 2
)

var GetOnuUniInfoResponse_OperationalState_name = map[int32]string{
	0: "OPERSTATE_UNDEFINED",
	1: "ENABLED",
	2: "DISABLED",
}

var GetOnuUniInfoResponse_OperationalState_value = map[string]int32{
	"OPERSTATE_UNDEFINED": 0,
	"ENABLED":             1,
	"DISABLED":            2,
}

func (x GetOnuUniInfoResponse_OperationalState) String() string {
	return proto.EnumName(GetOnuUniInfoResponse_OperationalState_name, int32(x))
}

func (GetOnuUniInfoResponse_OperationalState) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{7, 2}
}

type GetOltPortCounters_PortType int32

const (
	GetOltPortCounters_Port_UNKNOWN      GetOltPortCounters_PortType = 0
	GetOltPortCounters_Port_ETHERNET_NNI GetOltPortCounters_PortType = 1
	GetOltPortCounters_Port_PON_OLT      GetOltPortCounters_PortType = 2
)

var GetOltPortCounters_PortType_name = map[int32]string{
	0: "Port_UNKNOWN",
	1: "Port_ETHERNET_NNI",
	2: "Port_PON_OLT",
}

var GetOltPortCounters_PortType_value = map[string]int32{
	"Port_UNKNOWN":      0,
	"Port_ETHERNET_NNI": 1,
	"Port_PON_OLT":      2,
}

func (x GetOltPortCounters_PortType) String() string {
	return proto.EnumName(GetOltPortCounters_PortType_name, int32(x))
}

func (GetOltPortCounters_PortType) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{8, 0}
}

type GetOnuEthernetBridgePortHistory_Direction int32

const (
	GetOnuEthernetBridgePortHistory_UNDEFINED  GetOnuEthernetBridgePortHistory_Direction = 0
	GetOnuEthernetBridgePortHistory_UPSTREAM   GetOnuEthernetBridgePortHistory_Direction = 1
	GetOnuEthernetBridgePortHistory_DOWNSTREAM GetOnuEthernetBridgePortHistory_Direction = 2
)

var GetOnuEthernetBridgePortHistory_Direction_name = map[int32]string{
	0: "UNDEFINED",
	1: "UPSTREAM",
	2: "DOWNSTREAM",
}

var GetOnuEthernetBridgePortHistory_Direction_value = map[string]int32{
	"UNDEFINED":  0,
	"UPSTREAM":   1,
	"DOWNSTREAM": 2,
}

func (x GetOnuEthernetBridgePortHistory_Direction) String() string {
	return proto.EnumName(GetOnuEthernetBridgePortHistory_Direction_name, int32(x))
}

func (GetOnuEthernetBridgePortHistory_Direction) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{12, 0}
}

type GetOmciEthernetFrameExtendedPmResponse_Format int32

const (
	GetOmciEthernetFrameExtendedPmResponse_THIRTY_TWO_BIT GetOmciEthernetFrameExtendedPmResponse_Format = 0
	GetOmciEthernetFrameExtendedPmResponse_SIXTY_FOUR_BIT GetOmciEthernetFrameExtendedPmResponse_Format = 1
)

var GetOmciEthernetFrameExtendedPmResponse_Format_name = map[int32]string{
	0: "THIRTY_TWO_BIT",
	1: "SIXTY_FOUR_BIT",
}

var GetOmciEthernetFrameExtendedPmResponse_Format_value = map[string]int32{
	"THIRTY_TWO_BIT": 0,
	"SIXTY_FOUR_BIT": 1,
}

func (x GetOmciEthernetFrameExtendedPmResponse_Format) String() string {
	return proto.EnumName(GetOmciEthernetFrameExtendedPmResponse_Format_name, int32(x))
}

func (GetOmciEthernetFrameExtendedPmResponse_Format) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{36, 0}
}

type GetOffloadedAppsStatisticsRequest_OffloadedApp int32

const (
	GetOffloadedAppsStatisticsRequest_UNDEFINED GetOffloadedAppsStatisticsRequest_OffloadedApp = 0
	GetOffloadedAppsStatisticsRequest_PPPoeIA   GetOffloadedAppsStatisticsRequest_OffloadedApp = 1
	GetOffloadedAppsStatisticsRequest_DHCPv4RA  GetOffloadedAppsStatisticsRequest_OffloadedApp = 2
	GetOffloadedAppsStatisticsRequest_DHCPv6RA  GetOffloadedAppsStatisticsRequest_OffloadedApp = 3
)

var GetOffloadedAppsStatisticsRequest_OffloadedApp_name = map[int32]string{
	0: "UNDEFINED",
	1: "PPPoeIA",
	2: "DHCPv4RA",
	3: "DHCPv6RA",
}

var GetOffloadedAppsStatisticsRequest_OffloadedApp_value = map[string]int32{
	"UNDEFINED": 0,
	"PPPoeIA":   1,
	"DHCPv4RA":  2,
	"DHCPv6RA":  3,
}

func (x GetOffloadedAppsStatisticsRequest_OffloadedApp) String() string {
	return proto.EnumName(GetOffloadedAppsStatisticsRequest_OffloadedApp_name, int32(x))
}

func (GetOffloadedAppsStatisticsRequest_OffloadedApp) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{45, 0}
}

type GetValueResponse_Status int32

const (
	GetValueResponse_STATUS_UNDEFINED GetValueResponse_Status = 0
	GetValueResponse_OK               GetValueResponse_Status = 1
	GetValueResponse_ERROR            GetValueResponse_Status = 2
)

var GetValueResponse_Status_name = map[int32]string{
	0: "STATUS_UNDEFINED",
	1: "OK",
	2: "ERROR",
}

var GetValueResponse_Status_value = map[string]int32{
	"STATUS_UNDEFINED": 0,
	"OK":               1,
	"ERROR":            2,
}

func (x GetValueResponse_Status) String() string {
	return proto.EnumName(GetValueResponse_Status_name, int32(x))
}

func (GetValueResponse_Status) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{48, 0}
}

type GetValueResponse_ErrorReason int32

const (
	GetValueResponse_REASON_UNDEFINED  GetValueResponse_ErrorReason = 0
	GetValueResponse_UNSUPPORTED       GetValueResponse_ErrorReason = 1
	GetValueResponse_INVALID_DEVICE_ID GetValueResponse_ErrorReason = 2
	GetValueResponse_INVALID_PORT_TYPE GetValueResponse_ErrorReason = 3
	GetValueResponse_TIMEOUT           GetValueResponse_ErrorReason = 4
	GetValueResponse_INVALID_REQ_TYPE  GetValueResponse_ErrorReason = 5
	GetValueResponse_INTERNAL_ERROR    GetValueResponse_ErrorReason = 6
	GetValueResponse_INVALID_DEVICE    GetValueResponse_ErrorReason = 7
)

var GetValueResponse_ErrorReason_name = map[int32]string{
	0: "REASON_UNDEFINED",
	1: "UNSUPPORTED",
	2: "INVALID_DEVICE_ID",
	3: "INVALID_PORT_TYPE",
	4: "TIMEOUT",
	5: "INVALID_REQ_TYPE",
	6: "INTERNAL_ERROR",
	7: "INVALID_DEVICE",
}

var GetValueResponse_ErrorReason_value = map[string]int32{
	"REASON_UNDEFINED":  0,
	"UNSUPPORTED":       1,
	"INVALID_DEVICE_ID": 2,
	"INVALID_PORT_TYPE": 3,
	"TIMEOUT":           4,
	"INVALID_REQ_TYPE":  5,
	"INTERNAL_ERROR":    6,
	"INVALID_DEVICE":    7,
}

func (x GetValueResponse_ErrorReason) String() string {
	return proto.EnumName(GetValueResponse_ErrorReason_name, int32(x))
}

func (GetValueResponse_ErrorReason) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{48, 1}
}

type SetValueResponse_Status int32

const (
	SetValueResponse_STATUS_UNDEFINED SetValueResponse_Status = 0
	SetValueResponse_OK               SetValueResponse_Status = 1
	SetValueResponse_ERROR            SetValueResponse_Status = 2
)

var SetValueResponse_Status_name = map[int32]string{
	0: "STATUS_UNDEFINED",
	1: "OK",
	2: "ERROR",
}

var SetValueResponse_Status_value = map[string]int32{
	"STATUS_UNDEFINED": 0,
	"OK":               1,
	"ERROR":            2,
}

func (x SetValueResponse_Status) String() string {
	return proto.EnumName(SetValueResponse_Status_name, int32(x))
}

func (SetValueResponse_Status) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{52, 0}
}

type SetValueResponse_ErrorReason int32

const (
	SetValueResponse_REASON_UNDEFINED      SetValueResponse_ErrorReason = 0
	SetValueResponse_UNSUPPORTED           SetValueResponse_ErrorReason = 1
	SetValueResponse_INVALID_DEVICE_ID     SetValueResponse_ErrorReason = 2
	SetValueResponse_INVALID_ONU_DEVICE_ID SetValueResponse_ErrorReason = 3
	SetValueResponse_INVALID_UNI_ID        SetValueResponse_ErrorReason = 4
)

var SetValueResponse_ErrorReason_name = map[int32]string{
	0: "REASON_UNDEFINED",
	1: "UNSUPPORTED",
	2: "INVALID_DEVICE_ID",
	3: "INVALID_ONU_DEVICE_ID",
	4: "INVALID_UNI_ID",
}

var SetValueResponse_ErrorReason_value = map[string]int32{
	"REASON_UNDEFINED":      0,
	"UNSUPPORTED":           1,
	"INVALID_DEVICE_ID":     2,
	"INVALID_ONU_DEVICE_ID": 3,
	"INVALID_UNI_ID":        4,
}

func (x SetValueResponse_ErrorReason) String() string {
	return proto.EnumName(SetValueResponse_ErrorReason_name, int32(x))
}

func (SetValueResponse_ErrorReason) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{52, 1}
}

type ValueSet struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are valid to be assigned to Value:
	//	*ValueSet_AlarmConfig
	Value                isValueSet_Value `protobuf_oneof:"value"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (m *ValueSet) Reset()         { *m = ValueSet{} }
func (m *ValueSet) String() string { return proto.CompactTextString(m) }
func (*ValueSet) ProtoMessage()    {}
func (*ValueSet) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{0}
}

func (m *ValueSet) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ValueSet.Unmarshal(m, b)
}
func (m *ValueSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ValueSet.Marshal(b, m, deterministic)
}
func (m *ValueSet) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ValueSet.Merge(m, src)
}
func (m *ValueSet) XXX_Size() int {
	return xxx_messageInfo_ValueSet.Size(m)
}
func (m *ValueSet) XXX_DiscardUnknown() {
	xxx_messageInfo_ValueSet.DiscardUnknown(m)
}

var xxx_messageInfo_ValueSet proto.InternalMessageInfo

func (m *ValueSet) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

type isValueSet_Value interface {
	isValueSet_Value()
}

type ValueSet_AlarmConfig struct {
	AlarmConfig *config.AlarmConfig `protobuf:"bytes,2,opt,name=alarm_config,json=alarmConfig,proto3,oneof"`
}

func (*ValueSet_AlarmConfig) isValueSet_Value() {}

func (m *ValueSet) GetValue() isValueSet_Value {
	if m != nil {
		return m.Value
	}
	return nil
}

func (m *ValueSet) GetAlarmConfig() *config.AlarmConfig {
	if x, ok := m.GetValue().(*ValueSet_AlarmConfig); ok {
		return x.AlarmConfig
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*ValueSet) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*ValueSet_AlarmConfig)(nil),
	}
}

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

func (m *ValueType) Reset()         { *m = ValueType{} }
func (m *ValueType) String() string { return proto.CompactTextString(m) }
func (*ValueType) ProtoMessage()    {}
func (*ValueType) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{1}
}

func (m *ValueType) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ValueType.Unmarshal(m, b)
}
func (m *ValueType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ValueType.Marshal(b, m, deterministic)
}
func (m *ValueType) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ValueType.Merge(m, src)
}
func (m *ValueType) XXX_Size() int {
	return xxx_messageInfo_ValueType.Size(m)
}
func (m *ValueType) XXX_DiscardUnknown() {
	xxx_messageInfo_ValueType.DiscardUnknown(m)
}

var xxx_messageInfo_ValueType proto.InternalMessageInfo

type ValueSpecifier struct {
	Id                   string         `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Value                ValueType_Type `protobuf:"varint,2,opt,name=value,proto3,enum=extension.ValueType_Type" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (m *ValueSpecifier) Reset()         { *m = ValueSpecifier{} }
func (m *ValueSpecifier) String() string { return proto.CompactTextString(m) }
func (*ValueSpecifier) ProtoMessage()    {}
func (*ValueSpecifier) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{2}
}

func (m *ValueSpecifier) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ValueSpecifier.Unmarshal(m, b)
}
func (m *ValueSpecifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ValueSpecifier.Marshal(b, m, deterministic)
}
func (m *ValueSpecifier) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ValueSpecifier.Merge(m, src)
}
func (m *ValueSpecifier) XXX_Size() int {
	return xxx_messageInfo_ValueSpecifier.Size(m)
}
func (m *ValueSpecifier) XXX_DiscardUnknown() {
	xxx_messageInfo_ValueSpecifier.DiscardUnknown(m)
}

var xxx_messageInfo_ValueSpecifier proto.InternalMessageInfo

func (m *ValueSpecifier) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

func (m *ValueSpecifier) GetValue() ValueType_Type {
	if m != nil {
		return m.Value
	}
	return ValueType_EMPTY
}

type ReturnValues struct {
	Set                  uint32   `protobuf:"varint,1,opt,name=Set,proto3" json:"Set,omitempty"`
	Unsupported          uint32   `protobuf:"varint,2,opt,name=Unsupported,proto3" json:"Unsupported,omitempty"`
	Error                uint32   `protobuf:"varint,3,opt,name=Error,proto3" json:"Error,omitempty"`
	Distance             uint32   `protobuf:"varint,4,opt,name=Distance,proto3" json:"Distance,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ReturnValues) Reset()         { *m = ReturnValues{} }
func (m *ReturnValues) String() string { return proto.CompactTextString(m) }
func (*ReturnValues) ProtoMessage()    {}
func (*ReturnValues) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{3}
}

func (m *ReturnValues) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ReturnValues.Unmarshal(m, b)
}
func (m *ReturnValues) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ReturnValues.Marshal(b, m, deterministic)
}
func (m *ReturnValues) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ReturnValues.Merge(m, src)
}
func (m *ReturnValues) XXX_Size() int {
	return xxx_messageInfo_ReturnValues.Size(m)
}
func (m *ReturnValues) XXX_DiscardUnknown() {
	xxx_messageInfo_ReturnValues.DiscardUnknown(m)
}

var xxx_messageInfo_ReturnValues proto.InternalMessageInfo

func (m *ReturnValues) GetSet() uint32 {
	if m != nil {
		return m.Set
	}
	return 0
}

func (m *ReturnValues) GetUnsupported() uint32 {
	if m != nil {
		return m.Unsupported
	}
	return 0
}

func (m *ReturnValues) GetError() uint32 {
	if m != nil {
		return m.Error
	}
	return 0
}

func (m *ReturnValues) GetDistance() uint32 {
	if m != nil {
		return m.Distance
	}
	return 0
}

type GetDistanceRequest struct {
	OnuDeviceId          string   `protobuf:"bytes,1,opt,name=onuDeviceId,proto3" json:"onuDeviceId,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetDistanceRequest) Reset()         { *m = GetDistanceRequest{} }
func (m *GetDistanceRequest) String() string { return proto.CompactTextString(m) }
func (*GetDistanceRequest) ProtoMessage()    {}
func (*GetDistanceRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{4}
}

func (m *GetDistanceRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetDistanceRequest.Unmarshal(m, b)
}
func (m *GetDistanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetDistanceRequest.Marshal(b, m, deterministic)
}
func (m *GetDistanceRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetDistanceRequest.Merge(m, src)
}
func (m *GetDistanceRequest) XXX_Size() int {
	return xxx_messageInfo_GetDistanceRequest.Size(m)
}
func (m *GetDistanceRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetDistanceRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetDistanceRequest proto.InternalMessageInfo

func (m *GetDistanceRequest) GetOnuDeviceId() string {
	if m != nil {
		return m.OnuDeviceId
	}
	return ""
}

type GetDistanceResponse struct {
	Distance             uint32   `protobuf:"varint,1,opt,name=distance,proto3" json:"distance,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetDistanceResponse) Reset()         { *m = GetDistanceResponse{} }
func (m *GetDistanceResponse) String() string { return proto.CompactTextString(m) }
func (*GetDistanceResponse) ProtoMessage()    {}
func (*GetDistanceResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{5}
}

func (m *GetDistanceResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetDistanceResponse.Unmarshal(m, b)
}
func (m *GetDistanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetDistanceResponse.Marshal(b, m, deterministic)
}
func (m *GetDistanceResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetDistanceResponse.Merge(m, src)
}
func (m *GetDistanceResponse) XXX_Size() int {
	return xxx_messageInfo_GetDistanceResponse.Size(m)
}
func (m *GetDistanceResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetDistanceResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetDistanceResponse proto.InternalMessageInfo

func (m *GetDistanceResponse) GetDistance() uint32 {
	if m != nil {
		return m.Distance
	}
	return 0
}

type GetOnuUniInfoRequest struct {
	UniIndex             uint32   `protobuf:"varint,1,opt,name=uniIndex,proto3" json:"uniIndex,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetOnuUniInfoRequest) Reset()         { *m = GetOnuUniInfoRequest{} }
func (m *GetOnuUniInfoRequest) String() string { return proto.CompactTextString(m) }
func (*GetOnuUniInfoRequest) ProtoMessage()    {}
func (*GetOnuUniInfoRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{6}
}

func (m *GetOnuUniInfoRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuUniInfoRequest.Unmarshal(m, b)
}
func (m *GetOnuUniInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuUniInfoRequest.Marshal(b, m, deterministic)
}
func (m *GetOnuUniInfoRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuUniInfoRequest.Merge(m, src)
}
func (m *GetOnuUniInfoRequest) XXX_Size() int {
	return xxx_messageInfo_GetOnuUniInfoRequest.Size(m)
}
func (m *GetOnuUniInfoRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuUniInfoRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuUniInfoRequest proto.InternalMessageInfo

func (m *GetOnuUniInfoRequest) GetUniIndex() uint32 {
	if m != nil {
		return m.UniIndex
	}
	return 0
}

type GetOnuUniInfoResponse struct {
	AdmState             GetOnuUniInfoResponse_AdministrativeState `protobuf:"varint,1,opt,name=admState,proto3,enum=extension.GetOnuUniInfoResponse_AdministrativeState" json:"admState,omitempty"`
	OperState            GetOnuUniInfoResponse_OperationalState    `protobuf:"varint,2,opt,name=operState,proto3,enum=extension.GetOnuUniInfoResponse_OperationalState" json:"operState,omitempty"`
	ConfigInd            GetOnuUniInfoResponse_ConfigurationInd    `protobuf:"varint,3,opt,name=configInd,proto3,enum=extension.GetOnuUniInfoResponse_ConfigurationInd" json:"configInd,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                  `json:"-"`
	XXX_unrecognized     []byte                                    `json:"-"`
	XXX_sizecache        int32                                     `json:"-"`
}

func (m *GetOnuUniInfoResponse) Reset()         { *m = GetOnuUniInfoResponse{} }
func (m *GetOnuUniInfoResponse) String() string { return proto.CompactTextString(m) }
func (*GetOnuUniInfoResponse) ProtoMessage()    {}
func (*GetOnuUniInfoResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{7}
}

func (m *GetOnuUniInfoResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuUniInfoResponse.Unmarshal(m, b)
}
func (m *GetOnuUniInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuUniInfoResponse.Marshal(b, m, deterministic)
}
func (m *GetOnuUniInfoResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuUniInfoResponse.Merge(m, src)
}
func (m *GetOnuUniInfoResponse) XXX_Size() int {
	return xxx_messageInfo_GetOnuUniInfoResponse.Size(m)
}
func (m *GetOnuUniInfoResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuUniInfoResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuUniInfoResponse proto.InternalMessageInfo

func (m *GetOnuUniInfoResponse) GetAdmState() GetOnuUniInfoResponse_AdministrativeState {
	if m != nil {
		return m.AdmState
	}
	return GetOnuUniInfoResponse_ADMSTATE_UNDEFINED
}

func (m *GetOnuUniInfoResponse) GetOperState() GetOnuUniInfoResponse_OperationalState {
	if m != nil {
		return m.OperState
	}
	return GetOnuUniInfoResponse_OPERSTATE_UNDEFINED
}

func (m *GetOnuUniInfoResponse) GetConfigInd() GetOnuUniInfoResponse_ConfigurationInd {
	if m != nil {
		return m.ConfigInd
	}
	return GetOnuUniInfoResponse_UNKOWN
}

type GetOltPortCounters struct {
	PortNo               uint32                      `protobuf:"varint,1,opt,name=portNo,proto3" json:"portNo,omitempty"`
	PortType             GetOltPortCounters_PortType `protobuf:"varint,2,opt,name=portType,proto3,enum=extension.GetOltPortCounters_PortType" json:"portType,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

func (m *GetOltPortCounters) Reset()         { *m = GetOltPortCounters{} }
func (m *GetOltPortCounters) String() string { return proto.CompactTextString(m) }
func (*GetOltPortCounters) ProtoMessage()    {}
func (*GetOltPortCounters) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{8}
}

func (m *GetOltPortCounters) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOltPortCounters.Unmarshal(m, b)
}
func (m *GetOltPortCounters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOltPortCounters.Marshal(b, m, deterministic)
}
func (m *GetOltPortCounters) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOltPortCounters.Merge(m, src)
}
func (m *GetOltPortCounters) XXX_Size() int {
	return xxx_messageInfo_GetOltPortCounters.Size(m)
}
func (m *GetOltPortCounters) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOltPortCounters.DiscardUnknown(m)
}

var xxx_messageInfo_GetOltPortCounters proto.InternalMessageInfo

func (m *GetOltPortCounters) GetPortNo() uint32 {
	if m != nil {
		return m.PortNo
	}
	return 0
}

func (m *GetOltPortCounters) GetPortType() GetOltPortCounters_PortType {
	if m != nil {
		return m.PortType
	}
	return GetOltPortCounters_Port_UNKNOWN
}

type GetOltPortCountersResponse struct {
	TxBytes              uint64   `protobuf:"varint,1,opt,name=txBytes,proto3" json:"txBytes,omitempty"`
	RxBytes              uint64   `protobuf:"varint,2,opt,name=rxBytes,proto3" json:"rxBytes,omitempty"`
	TxPackets            uint64   `protobuf:"varint,3,opt,name=txPackets,proto3" json:"txPackets,omitempty"`
	RxPackets            uint64   `protobuf:"varint,4,opt,name=rxPackets,proto3" json:"rxPackets,omitempty"`
	TxErrorPackets       uint64   `protobuf:"varint,5,opt,name=txErrorPackets,proto3" json:"txErrorPackets,omitempty"`
	RxErrorPackets       uint64   `protobuf:"varint,6,opt,name=rxErrorPackets,proto3" json:"rxErrorPackets,omitempty"`
	TxBcastPackets       uint64   `protobuf:"varint,7,opt,name=txBcastPackets,proto3" json:"txBcastPackets,omitempty"`
	RxBcastPackets       uint64   `protobuf:"varint,8,opt,name=rxBcastPackets,proto3" json:"rxBcastPackets,omitempty"`
	TxUcastPackets       uint64   `protobuf:"varint,9,opt,name=txUcastPackets,proto3" json:"txUcastPackets,omitempty"`
	RxUcastPackets       uint64   `protobuf:"varint,10,opt,name=rxUcastPackets,proto3" json:"rxUcastPackets,omitempty"`
	TxMcastPackets       uint64   `protobuf:"varint,11,opt,name=txMcastPackets,proto3" json:"txMcastPackets,omitempty"`
	RxMcastPackets       uint64   `protobuf:"varint,12,opt,name=rxMcastPackets,proto3" json:"rxMcastPackets,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetOltPortCountersResponse) Reset()         { *m = GetOltPortCountersResponse{} }
func (m *GetOltPortCountersResponse) String() string { return proto.CompactTextString(m) }
func (*GetOltPortCountersResponse) ProtoMessage()    {}
func (*GetOltPortCountersResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{9}
}

func (m *GetOltPortCountersResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOltPortCountersResponse.Unmarshal(m, b)
}
func (m *GetOltPortCountersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOltPortCountersResponse.Marshal(b, m, deterministic)
}
func (m *GetOltPortCountersResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOltPortCountersResponse.Merge(m, src)
}
func (m *GetOltPortCountersResponse) XXX_Size() int {
	return xxx_messageInfo_GetOltPortCountersResponse.Size(m)
}
func (m *GetOltPortCountersResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOltPortCountersResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOltPortCountersResponse proto.InternalMessageInfo

func (m *GetOltPortCountersResponse) GetTxBytes() uint64 {
	if m != nil {
		return m.TxBytes
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetRxBytes() uint64 {
	if m != nil {
		return m.RxBytes
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetTxPackets() uint64 {
	if m != nil {
		return m.TxPackets
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetRxPackets() uint64 {
	if m != nil {
		return m.RxPackets
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetTxErrorPackets() uint64 {
	if m != nil {
		return m.TxErrorPackets
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetRxErrorPackets() uint64 {
	if m != nil {
		return m.RxErrorPackets
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetTxBcastPackets() uint64 {
	if m != nil {
		return m.TxBcastPackets
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetRxBcastPackets() uint64 {
	if m != nil {
		return m.RxBcastPackets
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetTxUcastPackets() uint64 {
	if m != nil {
		return m.TxUcastPackets
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetRxUcastPackets() uint64 {
	if m != nil {
		return m.RxUcastPackets
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetTxMcastPackets() uint64 {
	if m != nil {
		return m.TxMcastPackets
	}
	return 0
}

func (m *GetOltPortCountersResponse) GetRxMcastPackets() uint64 {
	if m != nil {
		return m.RxMcastPackets
	}
	return 0
}

type GetOnuPonOpticalInfo struct {
	Empty                *empty.Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (m *GetOnuPonOpticalInfo) Reset()         { *m = GetOnuPonOpticalInfo{} }
func (m *GetOnuPonOpticalInfo) String() string { return proto.CompactTextString(m) }
func (*GetOnuPonOpticalInfo) ProtoMessage()    {}
func (*GetOnuPonOpticalInfo) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{10}
}

func (m *GetOnuPonOpticalInfo) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuPonOpticalInfo.Unmarshal(m, b)
}
func (m *GetOnuPonOpticalInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuPonOpticalInfo.Marshal(b, m, deterministic)
}
func (m *GetOnuPonOpticalInfo) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuPonOpticalInfo.Merge(m, src)
}
func (m *GetOnuPonOpticalInfo) XXX_Size() int {
	return xxx_messageInfo_GetOnuPonOpticalInfo.Size(m)
}
func (m *GetOnuPonOpticalInfo) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuPonOpticalInfo.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuPonOpticalInfo proto.InternalMessageInfo

func (m *GetOnuPonOpticalInfo) GetEmpty() *empty.Empty {
	if m != nil {
		return m.Empty
	}
	return nil
}

// These values correspond to the Optical Line Supervision Test results
// described in section A3.39.5 of ITU-T G.988 (11/2017) specification.
type GetOnuPonOpticalInfoResponse struct {
	PowerFeedVoltage       float32  `protobuf:"fixed32,1,opt,name=powerFeedVoltage,proto3" json:"powerFeedVoltage,omitempty"`
	ReceivedOpticalPower   float32  `protobuf:"fixed32,2,opt,name=receivedOpticalPower,proto3" json:"receivedOpticalPower,omitempty"`
	MeanOpticalLaunchPower float32  `protobuf:"fixed32,3,opt,name=meanOpticalLaunchPower,proto3" json:"meanOpticalLaunchPower,omitempty"`
	LaserBiasCurrent       float32  `protobuf:"fixed32,4,opt,name=laserBiasCurrent,proto3" json:"laserBiasCurrent,omitempty"`
	Temperature            float32  `protobuf:"fixed32,5,opt,name=temperature,proto3" json:"temperature,omitempty"`
	XXX_NoUnkeyedLiteral   struct{} `json:"-"`
	XXX_unrecognized       []byte   `json:"-"`
	XXX_sizecache          int32    `json:"-"`
}

func (m *GetOnuPonOpticalInfoResponse) Reset()         { *m = GetOnuPonOpticalInfoResponse{} }
func (m *GetOnuPonOpticalInfoResponse) String() string { return proto.CompactTextString(m) }
func (*GetOnuPonOpticalInfoResponse) ProtoMessage()    {}
func (*GetOnuPonOpticalInfoResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{11}
}

func (m *GetOnuPonOpticalInfoResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuPonOpticalInfoResponse.Unmarshal(m, b)
}
func (m *GetOnuPonOpticalInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuPonOpticalInfoResponse.Marshal(b, m, deterministic)
}
func (m *GetOnuPonOpticalInfoResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuPonOpticalInfoResponse.Merge(m, src)
}
func (m *GetOnuPonOpticalInfoResponse) XXX_Size() int {
	return xxx_messageInfo_GetOnuPonOpticalInfoResponse.Size(m)
}
func (m *GetOnuPonOpticalInfoResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuPonOpticalInfoResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuPonOpticalInfoResponse proto.InternalMessageInfo

func (m *GetOnuPonOpticalInfoResponse) GetPowerFeedVoltage() float32 {
	if m != nil {
		return m.PowerFeedVoltage
	}
	return 0
}

func (m *GetOnuPonOpticalInfoResponse) GetReceivedOpticalPower() float32 {
	if m != nil {
		return m.ReceivedOpticalPower
	}
	return 0
}

func (m *GetOnuPonOpticalInfoResponse) GetMeanOpticalLaunchPower() float32 {
	if m != nil {
		return m.MeanOpticalLaunchPower
	}
	return 0
}

func (m *GetOnuPonOpticalInfoResponse) GetLaserBiasCurrent() float32 {
	if m != nil {
		return m.LaserBiasCurrent
	}
	return 0
}

func (m *GetOnuPonOpticalInfoResponse) GetTemperature() float32 {
	if m != nil {
		return m.Temperature
	}
	return 0
}

type GetOnuEthernetBridgePortHistory struct {
	Direction            GetOnuEthernetBridgePortHistory_Direction `protobuf:"varint,1,opt,name=direction,proto3,enum=extension.GetOnuEthernetBridgePortHistory_Direction" json:"direction,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                  `json:"-"`
	XXX_unrecognized     []byte                                    `json:"-"`
	XXX_sizecache        int32                                     `json:"-"`
}

func (m *GetOnuEthernetBridgePortHistory) Reset()         { *m = GetOnuEthernetBridgePortHistory{} }
func (m *GetOnuEthernetBridgePortHistory) String() string { return proto.CompactTextString(m) }
func (*GetOnuEthernetBridgePortHistory) ProtoMessage()    {}
func (*GetOnuEthernetBridgePortHistory) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{12}
}

func (m *GetOnuEthernetBridgePortHistory) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuEthernetBridgePortHistory.Unmarshal(m, b)
}
func (m *GetOnuEthernetBridgePortHistory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuEthernetBridgePortHistory.Marshal(b, m, deterministic)
}
func (m *GetOnuEthernetBridgePortHistory) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuEthernetBridgePortHistory.Merge(m, src)
}
func (m *GetOnuEthernetBridgePortHistory) XXX_Size() int {
	return xxx_messageInfo_GetOnuEthernetBridgePortHistory.Size(m)
}
func (m *GetOnuEthernetBridgePortHistory) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuEthernetBridgePortHistory.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuEthernetBridgePortHistory proto.InternalMessageInfo

func (m *GetOnuEthernetBridgePortHistory) GetDirection() GetOnuEthernetBridgePortHistory_Direction {
	if m != nil {
		return m.Direction
	}
	return GetOnuEthernetBridgePortHistory_UNDEFINED
}

type GetOnuEthernetBridgePortHistoryResponse struct {
	DropEvents              uint32   `protobuf:"varint,1,opt,name=dropEvents,proto3" json:"dropEvents,omitempty"`
	Octets                  uint32   `protobuf:"varint,2,opt,name=octets,proto3" json:"octets,omitempty"`
	Packets                 uint32   `protobuf:"varint,3,opt,name=packets,proto3" json:"packets,omitempty"`
	BroadcastPackets        uint32   `protobuf:"varint,4,opt,name=broadcastPackets,proto3" json:"broadcastPackets,omitempty"`
	MulticastPackets        uint32   `protobuf:"varint,5,opt,name=multicastPackets,proto3" json:"multicastPackets,omitempty"`
	CrcErroredPackets       uint32   `protobuf:"varint,6,opt,name=crcErroredPackets,proto3" json:"crcErroredPackets,omitempty"`
	UndersizePackets        uint32   `protobuf:"varint,7,opt,name=undersizePackets,proto3" json:"undersizePackets,omitempty"`
	OversizePackets         uint32   `protobuf:"varint,8,opt,name=oversizePackets,proto3" json:"oversizePackets,omitempty"`
	Packets64Octets         uint32   `protobuf:"varint,9,opt,name=packets64octets,proto3" json:"packets64octets,omitempty"`
	Packets65To127Octets    uint32   `protobuf:"varint,10,opt,name=packets65To127octets,proto3" json:"packets65To127octets,omitempty"`
	Packets128To255Octets   uint32   `protobuf:"varint,11,opt,name=packets128To255Octets,proto3" json:"packets128To255Octets,omitempty"`
	Packets256To511Octets   uint32   `protobuf:"varint,12,opt,name=packets256To511octets,proto3" json:"packets256To511octets,omitempty"`
	Packets512To1023Octets  uint32   `protobuf:"varint,13,opt,name=packets512To1023octets,proto3" json:"packets512To1023octets,omitempty"`
	Packets1024To1518Octets uint32   `protobuf:"varint,14,opt,name=packets1024To1518octets,proto3" json:"packets1024To1518octets,omitempty"`
	XXX_NoUnkeyedLiteral    struct{} `json:"-"`
	XXX_unrecognized        []byte   `json:"-"`
	XXX_sizecache           int32    `json:"-"`
}

func (m *GetOnuEthernetBridgePortHistoryResponse) Reset() {
	*m = GetOnuEthernetBridgePortHistoryResponse{}
}
func (m *GetOnuEthernetBridgePortHistoryResponse) String() string { return proto.CompactTextString(m) }
func (*GetOnuEthernetBridgePortHistoryResponse) ProtoMessage()    {}
func (*GetOnuEthernetBridgePortHistoryResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{13}
}

func (m *GetOnuEthernetBridgePortHistoryResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuEthernetBridgePortHistoryResponse.Unmarshal(m, b)
}
func (m *GetOnuEthernetBridgePortHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuEthernetBridgePortHistoryResponse.Marshal(b, m, deterministic)
}
func (m *GetOnuEthernetBridgePortHistoryResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuEthernetBridgePortHistoryResponse.Merge(m, src)
}
func (m *GetOnuEthernetBridgePortHistoryResponse) XXX_Size() int {
	return xxx_messageInfo_GetOnuEthernetBridgePortHistoryResponse.Size(m)
}
func (m *GetOnuEthernetBridgePortHistoryResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuEthernetBridgePortHistoryResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuEthernetBridgePortHistoryResponse proto.InternalMessageInfo

func (m *GetOnuEthernetBridgePortHistoryResponse) GetDropEvents() uint32 {
	if m != nil {
		return m.DropEvents
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetOctets() uint32 {
	if m != nil {
		return m.Octets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetPackets() uint32 {
	if m != nil {
		return m.Packets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetBroadcastPackets() uint32 {
	if m != nil {
		return m.BroadcastPackets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetMulticastPackets() uint32 {
	if m != nil {
		return m.MulticastPackets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetCrcErroredPackets() uint32 {
	if m != nil {
		return m.CrcErroredPackets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetUndersizePackets() uint32 {
	if m != nil {
		return m.UndersizePackets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetOversizePackets() uint32 {
	if m != nil {
		return m.OversizePackets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetPackets64Octets() uint32 {
	if m != nil {
		return m.Packets64Octets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetPackets65To127Octets() uint32 {
	if m != nil {
		return m.Packets65To127Octets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetPackets128To255Octets() uint32 {
	if m != nil {
		return m.Packets128To255Octets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetPackets256To511Octets() uint32 {
	if m != nil {
		return m.Packets256To511Octets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetPackets512To1023Octets() uint32 {
	if m != nil {
		return m.Packets512To1023Octets
	}
	return 0
}

func (m *GetOnuEthernetBridgePortHistoryResponse) GetPackets1024To1518Octets() uint32 {
	if m != nil {
		return m.Packets1024To1518Octets
	}
	return 0
}

// GetOnuAllocGemHistoryRequest collects GEM and AllocId stats from ONU
type GetOnuAllocGemHistoryRequest struct {
	Empty                *empty.Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (m *GetOnuAllocGemHistoryRequest) Reset()         { *m = GetOnuAllocGemHistoryRequest{} }
func (m *GetOnuAllocGemHistoryRequest) String() string { return proto.CompactTextString(m) }
func (*GetOnuAllocGemHistoryRequest) ProtoMessage()    {}
func (*GetOnuAllocGemHistoryRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{14}
}

func (m *GetOnuAllocGemHistoryRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuAllocGemHistoryRequest.Unmarshal(m, b)
}
func (m *GetOnuAllocGemHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuAllocGemHistoryRequest.Marshal(b, m, deterministic)
}
func (m *GetOnuAllocGemHistoryRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuAllocGemHistoryRequest.Merge(m, src)
}
func (m *GetOnuAllocGemHistoryRequest) XXX_Size() int {
	return xxx_messageInfo_GetOnuAllocGemHistoryRequest.Size(m)
}
func (m *GetOnuAllocGemHistoryRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuAllocGemHistoryRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuAllocGemHistoryRequest proto.InternalMessageInfo

func (m *GetOnuAllocGemHistoryRequest) GetEmpty() *empty.Empty {
	if m != nil {
		return m.Empty
	}
	return nil
}

type OnuGemPortHistoryData struct {
	GemId                   uint32   `protobuf:"varint,1,opt,name=gemId,proto3" json:"gemId,omitempty"`
	TransmittedGEMFrames    uint32   `protobuf:"varint,2,opt,name=transmittedGEMFrames,proto3" json:"transmittedGEMFrames,omitempty"`
	ReceivedGEMFrames       uint32   `protobuf:"varint,3,opt,name=receivedGEMFrames,proto3" json:"receivedGEMFrames,omitempty"`
	ReceivedPayloadBytes    uint32   `protobuf:"varint,4,opt,name=receivedPayloadBytes,proto3" json:"receivedPayloadBytes,omitempty"`
	TransmittedPayloadBytes uint32   `protobuf:"varint,5,opt,name=transmittedPayloadBytes,proto3" json:"transmittedPayloadBytes,omitempty"`
	EncryptionKeyErrors     uint32   `protobuf:"varint,6,opt,name=encryptionKeyErrors,proto3" json:"encryptionKeyErrors,omitempty"`
	XXX_NoUnkeyedLiteral    struct{} `json:"-"`
	XXX_unrecognized        []byte   `json:"-"`
	XXX_sizecache           int32    `json:"-"`
}

func (m *OnuGemPortHistoryData) Reset()         { *m = OnuGemPortHistoryData{} }
func (m *OnuGemPortHistoryData) String() string { return proto.CompactTextString(m) }
func (*OnuGemPortHistoryData) ProtoMessage()    {}
func (*OnuGemPortHistoryData) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{15}
}

func (m *OnuGemPortHistoryData) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuGemPortHistoryData.Unmarshal(m, b)
}
func (m *OnuGemPortHistoryData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuGemPortHistoryData.Marshal(b, m, deterministic)
}
func (m *OnuGemPortHistoryData) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuGemPortHistoryData.Merge(m, src)
}
func (m *OnuGemPortHistoryData) XXX_Size() int {
	return xxx_messageInfo_OnuGemPortHistoryData.Size(m)
}
func (m *OnuGemPortHistoryData) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuGemPortHistoryData.DiscardUnknown(m)
}

var xxx_messageInfo_OnuGemPortHistoryData proto.InternalMessageInfo

func (m *OnuGemPortHistoryData) GetGemId() uint32 {
	if m != nil {
		return m.GemId
	}
	return 0
}

func (m *OnuGemPortHistoryData) GetTransmittedGEMFrames() uint32 {
	if m != nil {
		return m.TransmittedGEMFrames
	}
	return 0
}

func (m *OnuGemPortHistoryData) GetReceivedGEMFrames() uint32 {
	if m != nil {
		return m.ReceivedGEMFrames
	}
	return 0
}

func (m *OnuGemPortHistoryData) GetReceivedPayloadBytes() uint32 {
	if m != nil {
		return m.ReceivedPayloadBytes
	}
	return 0
}

func (m *OnuGemPortHistoryData) GetTransmittedPayloadBytes() uint32 {
	if m != nil {
		return m.TransmittedPayloadBytes
	}
	return 0
}

func (m *OnuGemPortHistoryData) GetEncryptionKeyErrors() uint32 {
	if m != nil {
		return m.EncryptionKeyErrors
	}
	return 0
}

type OnuAllocHistoryData struct {
	AllocId              uint32   `protobuf:"varint,1,opt,name=allocId,proto3" json:"allocId,omitempty"`
	RxBytes              uint32   `protobuf:"varint,2,opt,name=rxBytes,proto3" json:"rxBytes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *OnuAllocHistoryData) Reset()         { *m = OnuAllocHistoryData{} }
func (m *OnuAllocHistoryData) String() string { return proto.CompactTextString(m) }
func (*OnuAllocHistoryData) ProtoMessage()    {}
func (*OnuAllocHistoryData) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{16}
}

func (m *OnuAllocHistoryData) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuAllocHistoryData.Unmarshal(m, b)
}
func (m *OnuAllocHistoryData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuAllocHistoryData.Marshal(b, m, deterministic)
}
func (m *OnuAllocHistoryData) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuAllocHistoryData.Merge(m, src)
}
func (m *OnuAllocHistoryData) XXX_Size() int {
	return xxx_messageInfo_OnuAllocHistoryData.Size(m)
}
func (m *OnuAllocHistoryData) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuAllocHistoryData.DiscardUnknown(m)
}

var xxx_messageInfo_OnuAllocHistoryData proto.InternalMessageInfo

func (m *OnuAllocHistoryData) GetAllocId() uint32 {
	if m != nil {
		return m.AllocId
	}
	return 0
}

func (m *OnuAllocHistoryData) GetRxBytes() uint32 {
	if m != nil {
		return m.RxBytes
	}
	return 0
}

type OnuAllocGemHistoryData struct {
	OnuAllocIdInfo       *OnuAllocHistoryData     `protobuf:"bytes,1,opt,name=onuAllocIdInfo,proto3" json:"onuAllocIdInfo,omitempty"`
	GemPortInfo          []*OnuGemPortHistoryData `protobuf:"bytes,2,rep,name=gemPortInfo,proto3" json:"gemPortInfo,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

func (m *OnuAllocGemHistoryData) Reset()         { *m = OnuAllocGemHistoryData{} }
func (m *OnuAllocGemHistoryData) String() string { return proto.CompactTextString(m) }
func (*OnuAllocGemHistoryData) ProtoMessage()    {}
func (*OnuAllocGemHistoryData) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{17}
}

func (m *OnuAllocGemHistoryData) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuAllocGemHistoryData.Unmarshal(m, b)
}
func (m *OnuAllocGemHistoryData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuAllocGemHistoryData.Marshal(b, m, deterministic)
}
func (m *OnuAllocGemHistoryData) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuAllocGemHistoryData.Merge(m, src)
}
func (m *OnuAllocGemHistoryData) XXX_Size() int {
	return xxx_messageInfo_OnuAllocGemHistoryData.Size(m)
}
func (m *OnuAllocGemHistoryData) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuAllocGemHistoryData.DiscardUnknown(m)
}

var xxx_messageInfo_OnuAllocGemHistoryData proto.InternalMessageInfo

func (m *OnuAllocGemHistoryData) GetOnuAllocIdInfo() *OnuAllocHistoryData {
	if m != nil {
		return m.OnuAllocIdInfo
	}
	return nil
}

func (m *OnuAllocGemHistoryData) GetGemPortInfo() []*OnuGemPortHistoryData {
	if m != nil {
		return m.GemPortInfo
	}
	return nil
}

type GetOnuAllocGemHistoryResponse struct {
	OnuAllocGemHistoryData []*OnuAllocGemHistoryData `protobuf:"bytes,1,rep,name=onuAllocGemHistoryData,proto3" json:"onuAllocGemHistoryData,omitempty"`
	XXX_NoUnkeyedLiteral   struct{}                  `json:"-"`
	XXX_unrecognized       []byte                    `json:"-"`
	XXX_sizecache          int32                     `json:"-"`
}

func (m *GetOnuAllocGemHistoryResponse) Reset()         { *m = GetOnuAllocGemHistoryResponse{} }
func (m *GetOnuAllocGemHistoryResponse) String() string { return proto.CompactTextString(m) }
func (*GetOnuAllocGemHistoryResponse) ProtoMessage()    {}
func (*GetOnuAllocGemHistoryResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{18}
}

func (m *GetOnuAllocGemHistoryResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuAllocGemHistoryResponse.Unmarshal(m, b)
}
func (m *GetOnuAllocGemHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuAllocGemHistoryResponse.Marshal(b, m, deterministic)
}
func (m *GetOnuAllocGemHistoryResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuAllocGemHistoryResponse.Merge(m, src)
}
func (m *GetOnuAllocGemHistoryResponse) XXX_Size() int {
	return xxx_messageInfo_GetOnuAllocGemHistoryResponse.Size(m)
}
func (m *GetOnuAllocGemHistoryResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuAllocGemHistoryResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuAllocGemHistoryResponse proto.InternalMessageInfo

func (m *GetOnuAllocGemHistoryResponse) GetOnuAllocGemHistoryData() []*OnuAllocGemHistoryData {
	if m != nil {
		return m.OnuAllocGemHistoryData
	}
	return nil
}

type GetOnuFecHistory struct {
	Empty                *empty.Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (m *GetOnuFecHistory) Reset()         { *m = GetOnuFecHistory{} }
func (m *GetOnuFecHistory) String() string { return proto.CompactTextString(m) }
func (*GetOnuFecHistory) ProtoMessage()    {}
func (*GetOnuFecHistory) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{19}
}

func (m *GetOnuFecHistory) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuFecHistory.Unmarshal(m, b)
}
func (m *GetOnuFecHistory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuFecHistory.Marshal(b, m, deterministic)
}
func (m *GetOnuFecHistory) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuFecHistory.Merge(m, src)
}
func (m *GetOnuFecHistory) XXX_Size() int {
	return xxx_messageInfo_GetOnuFecHistory.Size(m)
}
func (m *GetOnuFecHistory) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuFecHistory.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuFecHistory proto.InternalMessageInfo

func (m *GetOnuFecHistory) GetEmpty() *empty.Empty {
	if m != nil {
		return m.Empty
	}
	return nil
}

type GetOnuFecHistoryResponse struct {
	CorrectedBytes         uint32   `protobuf:"varint,1,opt,name=correctedBytes,proto3" json:"correctedBytes,omitempty"`
	CorrectedCodeWords     uint32   `protobuf:"varint,2,opt,name=correctedCodeWords,proto3" json:"correctedCodeWords,omitempty"`
	FecSeconds             uint32   `protobuf:"varint,3,opt,name=fecSeconds,proto3" json:"fecSeconds,omitempty"`
	TotalCodeWords         uint32   `protobuf:"varint,4,opt,name=totalCodeWords,proto3" json:"totalCodeWords,omitempty"`
	UncorrectableCodeWords uint32   `protobuf:"varint,5,opt,name=uncorrectableCodeWords,proto3" json:"uncorrectableCodeWords,omitempty"`
	XXX_NoUnkeyedLiteral   struct{} `json:"-"`
	XXX_unrecognized       []byte   `json:"-"`
	XXX_sizecache          int32    `json:"-"`
}

func (m *GetOnuFecHistoryResponse) Reset()         { *m = GetOnuFecHistoryResponse{} }
func (m *GetOnuFecHistoryResponse) String() string { return proto.CompactTextString(m) }
func (*GetOnuFecHistoryResponse) ProtoMessage()    {}
func (*GetOnuFecHistoryResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{20}
}

func (m *GetOnuFecHistoryResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuFecHistoryResponse.Unmarshal(m, b)
}
func (m *GetOnuFecHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuFecHistoryResponse.Marshal(b, m, deterministic)
}
func (m *GetOnuFecHistoryResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuFecHistoryResponse.Merge(m, src)
}
func (m *GetOnuFecHistoryResponse) XXX_Size() int {
	return xxx_messageInfo_GetOnuFecHistoryResponse.Size(m)
}
func (m *GetOnuFecHistoryResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuFecHistoryResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuFecHistoryResponse proto.InternalMessageInfo

func (m *GetOnuFecHistoryResponse) GetCorrectedBytes() uint32 {
	if m != nil {
		return m.CorrectedBytes
	}
	return 0
}

func (m *GetOnuFecHistoryResponse) GetCorrectedCodeWords() uint32 {
	if m != nil {
		return m.CorrectedCodeWords
	}
	return 0
}

func (m *GetOnuFecHistoryResponse) GetFecSeconds() uint32 {
	if m != nil {
		return m.FecSeconds
	}
	return 0
}

func (m *GetOnuFecHistoryResponse) GetTotalCodeWords() uint32 {
	if m != nil {
		return m.TotalCodeWords
	}
	return 0
}

func (m *GetOnuFecHistoryResponse) GetUncorrectableCodeWords() uint32 {
	if m != nil {
		return m.UncorrectableCodeWords
	}
	return 0
}

type GetOnuCountersRequest struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId,proto3" json:"intf_id,omitempty"`
	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetOnuCountersRequest) Reset()         { *m = GetOnuCountersRequest{} }
func (m *GetOnuCountersRequest) String() string { return proto.CompactTextString(m) }
func (*GetOnuCountersRequest) ProtoMessage()    {}
func (*GetOnuCountersRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{21}
}

func (m *GetOnuCountersRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuCountersRequest.Unmarshal(m, b)
}
func (m *GetOnuCountersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuCountersRequest.Marshal(b, m, deterministic)
}
func (m *GetOnuCountersRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuCountersRequest.Merge(m, src)
}
func (m *GetOnuCountersRequest) XXX_Size() int {
	return xxx_messageInfo_GetOnuCountersRequest.Size(m)
}
func (m *GetOnuCountersRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuCountersRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuCountersRequest proto.InternalMessageInfo

func (m *GetOnuCountersRequest) GetIntfId() uint32 {
	if m != nil {
		return m.IntfId
	}
	return 0
}

func (m *GetOnuCountersRequest) GetOnuId() uint32 {
	if m != nil {
		return m.OnuId
	}
	return 0
}

type GetOmciEthernetFrameExtendedPmRequest struct {
	OnuDeviceId string `protobuf:"bytes,1,opt,name=onuDeviceId,proto3" json:"onuDeviceId,omitempty"`
	// Types that are valid to be assigned to IsUniIndex:
	//	*GetOmciEthernetFrameExtendedPmRequest_UniIndex
	IsUniIndex           isGetOmciEthernetFrameExtendedPmRequest_IsUniIndex `protobuf_oneof:"is_uni_index"`
	Reset_               bool                                               `protobuf:"varint,3,opt,name=reset,proto3" json:"reset,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                           `json:"-"`
	XXX_unrecognized     []byte                                             `json:"-"`
	XXX_sizecache        int32                                              `json:"-"`
}

func (m *GetOmciEthernetFrameExtendedPmRequest) Reset()         { *m = GetOmciEthernetFrameExtendedPmRequest{} }
func (m *GetOmciEthernetFrameExtendedPmRequest) String() string { return proto.CompactTextString(m) }
func (*GetOmciEthernetFrameExtendedPmRequest) ProtoMessage()    {}
func (*GetOmciEthernetFrameExtendedPmRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{22}
}

func (m *GetOmciEthernetFrameExtendedPmRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOmciEthernetFrameExtendedPmRequest.Unmarshal(m, b)
}
func (m *GetOmciEthernetFrameExtendedPmRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOmciEthernetFrameExtendedPmRequest.Marshal(b, m, deterministic)
}
func (m *GetOmciEthernetFrameExtendedPmRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOmciEthernetFrameExtendedPmRequest.Merge(m, src)
}
func (m *GetOmciEthernetFrameExtendedPmRequest) XXX_Size() int {
	return xxx_messageInfo_GetOmciEthernetFrameExtendedPmRequest.Size(m)
}
func (m *GetOmciEthernetFrameExtendedPmRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOmciEthernetFrameExtendedPmRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetOmciEthernetFrameExtendedPmRequest proto.InternalMessageInfo

func (m *GetOmciEthernetFrameExtendedPmRequest) GetOnuDeviceId() string {
	if m != nil {
		return m.OnuDeviceId
	}
	return ""
}

type isGetOmciEthernetFrameExtendedPmRequest_IsUniIndex interface {
	isGetOmciEthernetFrameExtendedPmRequest_IsUniIndex()
}

type GetOmciEthernetFrameExtendedPmRequest_UniIndex struct {
	UniIndex uint32 `protobuf:"varint,2,opt,name=uniIndex,proto3,oneof"`
}

func (*GetOmciEthernetFrameExtendedPmRequest_UniIndex) isGetOmciEthernetFrameExtendedPmRequest_IsUniIndex() {
}

func (m *GetOmciEthernetFrameExtendedPmRequest) GetIsUniIndex() isGetOmciEthernetFrameExtendedPmRequest_IsUniIndex {
	if m != nil {
		return m.IsUniIndex
	}
	return nil
}

func (m *GetOmciEthernetFrameExtendedPmRequest) GetUniIndex() uint32 {
	if x, ok := m.GetIsUniIndex().(*GetOmciEthernetFrameExtendedPmRequest_UniIndex); ok {
		return x.UniIndex
	}
	return 0
}

func (m *GetOmciEthernetFrameExtendedPmRequest) GetReset_() bool {
	if m != nil {
		return m.Reset_
	}
	return false
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*GetOmciEthernetFrameExtendedPmRequest) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*GetOmciEthernetFrameExtendedPmRequest_UniIndex)(nil),
	}
}

// DEPRECATED
type GetRxPowerRequest struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId,proto3" json:"intf_id,omitempty"`
	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetRxPowerRequest) Reset()         { *m = GetRxPowerRequest{} }
func (m *GetRxPowerRequest) String() string { return proto.CompactTextString(m) }
func (*GetRxPowerRequest) ProtoMessage()    {}
func (*GetRxPowerRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{23}
}

func (m *GetRxPowerRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetRxPowerRequest.Unmarshal(m, b)
}
func (m *GetRxPowerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetRxPowerRequest.Marshal(b, m, deterministic)
}
func (m *GetRxPowerRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetRxPowerRequest.Merge(m, src)
}
func (m *GetRxPowerRequest) XXX_Size() int {
	return xxx_messageInfo_GetRxPowerRequest.Size(m)
}
func (m *GetRxPowerRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetRxPowerRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetRxPowerRequest proto.InternalMessageInfo

func (m *GetRxPowerRequest) GetIntfId() uint32 {
	if m != nil {
		return m.IntfId
	}
	return 0
}

func (m *GetRxPowerRequest) GetOnuId() uint32 {
	if m != nil {
		return m.OnuId
	}
	return 0
}

type GetOltRxPowerRequest struct {
	PortLabel string `protobuf:"bytes,1,opt,name=port_label,json=portLabel,proto3" json:"port_label,omitempty"`
	// onu_sn is optional and if onu_sn is an empty string and the label is
	// of a PON port then it means that the Rx Power corresponding to all
	// the ONUs on that PON port is requested. In case the port_label is not
	// of a PON port, the onu_sn does not have any significance
	OnuSn                string   `protobuf:"bytes,2,opt,name=onu_sn,json=onuSn,proto3" json:"onu_sn,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetOltRxPowerRequest) Reset()         { *m = GetOltRxPowerRequest{} }
func (m *GetOltRxPowerRequest) String() string { return proto.CompactTextString(m) }
func (*GetOltRxPowerRequest) ProtoMessage()    {}
func (*GetOltRxPowerRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{24}
}

func (m *GetOltRxPowerRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOltRxPowerRequest.Unmarshal(m, b)
}
func (m *GetOltRxPowerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOltRxPowerRequest.Marshal(b, m, deterministic)
}
func (m *GetOltRxPowerRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOltRxPowerRequest.Merge(m, src)
}
func (m *GetOltRxPowerRequest) XXX_Size() int {
	return xxx_messageInfo_GetOltRxPowerRequest.Size(m)
}
func (m *GetOltRxPowerRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOltRxPowerRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetOltRxPowerRequest proto.InternalMessageInfo

func (m *GetOltRxPowerRequest) GetPortLabel() string {
	if m != nil {
		return m.PortLabel
	}
	return ""
}

func (m *GetOltRxPowerRequest) GetOnuSn() string {
	if m != nil {
		return m.OnuSn
	}
	return ""
}

type GetPonStatsRequest struct {
	// Types that are valid to be assigned to PortInfo:
	//	*GetPonStatsRequest_PortLabel
	//	*GetPonStatsRequest_PortId
	PortInfo             isGetPonStatsRequest_PortInfo `protobuf_oneof:"portInfo"`
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

func (m *GetPonStatsRequest) Reset()         { *m = GetPonStatsRequest{} }
func (m *GetPonStatsRequest) String() string { return proto.CompactTextString(m) }
func (*GetPonStatsRequest) ProtoMessage()    {}
func (*GetPonStatsRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{25}
}

func (m *GetPonStatsRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetPonStatsRequest.Unmarshal(m, b)
}
func (m *GetPonStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetPonStatsRequest.Marshal(b, m, deterministic)
}
func (m *GetPonStatsRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetPonStatsRequest.Merge(m, src)
}
func (m *GetPonStatsRequest) XXX_Size() int {
	return xxx_messageInfo_GetPonStatsRequest.Size(m)
}
func (m *GetPonStatsRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetPonStatsRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetPonStatsRequest proto.InternalMessageInfo

type isGetPonStatsRequest_PortInfo interface {
	isGetPonStatsRequest_PortInfo()
}

type GetPonStatsRequest_PortLabel struct {
	PortLabel string `protobuf:"bytes,1,opt,name=portLabel,proto3,oneof"`
}

type GetPonStatsRequest_PortId struct {
	PortId uint32 `protobuf:"fixed32,2,opt,name=portId,proto3,oneof"`
}

func (*GetPonStatsRequest_PortLabel) isGetPonStatsRequest_PortInfo() {}

func (*GetPonStatsRequest_PortId) isGetPonStatsRequest_PortInfo() {}

func (m *GetPonStatsRequest) GetPortInfo() isGetPonStatsRequest_PortInfo {
	if m != nil {
		return m.PortInfo
	}
	return nil
}

func (m *GetPonStatsRequest) GetPortLabel() string {
	if x, ok := m.GetPortInfo().(*GetPonStatsRequest_PortLabel); ok {
		return x.PortLabel
	}
	return ""
}

func (m *GetPonStatsRequest) GetPortId() uint32 {
	if x, ok := m.GetPortInfo().(*GetPonStatsRequest_PortId); ok {
		return x.PortId
	}
	return 0
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*GetPonStatsRequest) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*GetPonStatsRequest_PortLabel)(nil),
		(*GetPonStatsRequest_PortId)(nil),
	}
}

type GetPonStatsResponse struct {
	PonPort              uint32                 `protobuf:"varint,1,opt,name=ponPort,proto3" json:"ponPort,omitempty"`
	PortStatistics       *common.PortStatistics `protobuf:"bytes,2,opt,name=portStatistics,proto3" json:"portStatistics,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (m *GetPonStatsResponse) Reset()         { *m = GetPonStatsResponse{} }
func (m *GetPonStatsResponse) String() string { return proto.CompactTextString(m) }
func (*GetPonStatsResponse) ProtoMessage()    {}
func (*GetPonStatsResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{26}
}

func (m *GetPonStatsResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetPonStatsResponse.Unmarshal(m, b)
}
func (m *GetPonStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetPonStatsResponse.Marshal(b, m, deterministic)
}
func (m *GetPonStatsResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetPonStatsResponse.Merge(m, src)
}
func (m *GetPonStatsResponse) XXX_Size() int {
	return xxx_messageInfo_GetPonStatsResponse.Size(m)
}
func (m *GetPonStatsResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetPonStatsResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetPonStatsResponse proto.InternalMessageInfo

func (m *GetPonStatsResponse) GetPonPort() uint32 {
	if m != nil {
		return m.PonPort
	}
	return 0
}

func (m *GetPonStatsResponse) GetPortStatistics() *common.PortStatistics {
	if m != nil {
		return m.PortStatistics
	}
	return nil
}

type GetNNIStatsRequest struct {
	// Types that are valid to be assigned to PortInfo:
	//	*GetNNIStatsRequest_PortLabel
	//	*GetNNIStatsRequest_PortId
	PortInfo             isGetNNIStatsRequest_PortInfo `protobuf_oneof:"portInfo"`
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

func (m *GetNNIStatsRequest) Reset()         { *m = GetNNIStatsRequest{} }
func (m *GetNNIStatsRequest) String() string { return proto.CompactTextString(m) }
func (*GetNNIStatsRequest) ProtoMessage()    {}
func (*GetNNIStatsRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{27}
}

func (m *GetNNIStatsRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetNNIStatsRequest.Unmarshal(m, b)
}
func (m *GetNNIStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetNNIStatsRequest.Marshal(b, m, deterministic)
}
func (m *GetNNIStatsRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetNNIStatsRequest.Merge(m, src)
}
func (m *GetNNIStatsRequest) XXX_Size() int {
	return xxx_messageInfo_GetNNIStatsRequest.Size(m)
}
func (m *GetNNIStatsRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetNNIStatsRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetNNIStatsRequest proto.InternalMessageInfo

type isGetNNIStatsRequest_PortInfo interface {
	isGetNNIStatsRequest_PortInfo()
}

type GetNNIStatsRequest_PortLabel struct {
	PortLabel string `protobuf:"bytes,1,opt,name=portLabel,proto3,oneof"`
}

type GetNNIStatsRequest_PortId struct {
	PortId uint32 `protobuf:"fixed32,2,opt,name=portId,proto3,oneof"`
}

func (*GetNNIStatsRequest_PortLabel) isGetNNIStatsRequest_PortInfo() {}

func (*GetNNIStatsRequest_PortId) isGetNNIStatsRequest_PortInfo() {}

func (m *GetNNIStatsRequest) GetPortInfo() isGetNNIStatsRequest_PortInfo {
	if m != nil {
		return m.PortInfo
	}
	return nil
}

func (m *GetNNIStatsRequest) GetPortLabel() string {
	if x, ok := m.GetPortInfo().(*GetNNIStatsRequest_PortLabel); ok {
		return x.PortLabel
	}
	return ""
}

func (m *GetNNIStatsRequest) GetPortId() uint32 {
	if x, ok := m.GetPortInfo().(*GetNNIStatsRequest_PortId); ok {
		return x.PortId
	}
	return 0
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*GetNNIStatsRequest) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*GetNNIStatsRequest_PortLabel)(nil),
		(*GetNNIStatsRequest_PortId)(nil),
	}
}

type GetNNIStatsResponse struct {
	NniPort              uint32                 `protobuf:"varint,1,opt,name=nniPort,proto3" json:"nniPort,omitempty"`
	PortStatistics       *common.PortStatistics `protobuf:"bytes,2,opt,name=portStatistics,proto3" json:"portStatistics,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (m *GetNNIStatsResponse) Reset()         { *m = GetNNIStatsResponse{} }
func (m *GetNNIStatsResponse) String() string { return proto.CompactTextString(m) }
func (*GetNNIStatsResponse) ProtoMessage()    {}
func (*GetNNIStatsResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{28}
}

func (m *GetNNIStatsResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetNNIStatsResponse.Unmarshal(m, b)
}
func (m *GetNNIStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetNNIStatsResponse.Marshal(b, m, deterministic)
}
func (m *GetNNIStatsResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetNNIStatsResponse.Merge(m, src)
}
func (m *GetNNIStatsResponse) XXX_Size() int {
	return xxx_messageInfo_GetNNIStatsResponse.Size(m)
}
func (m *GetNNIStatsResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetNNIStatsResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetNNIStatsResponse proto.InternalMessageInfo

func (m *GetNNIStatsResponse) GetNniPort() uint32 {
	if m != nil {
		return m.NniPort
	}
	return 0
}

func (m *GetNNIStatsResponse) GetPortStatistics() *common.PortStatistics {
	if m != nil {
		return m.PortStatistics
	}
	return nil
}

// GetOnuStatsFromOltRequest collects GEM and AllocId stats from the OLT for a particular ONU.
type GetOnuStatsFromOltRequest struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intfId,proto3" json:"intfId,omitempty"`
	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onuId,proto3" json:"onuId,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetOnuStatsFromOltRequest) Reset()         { *m = GetOnuStatsFromOltRequest{} }
func (m *GetOnuStatsFromOltRequest) String() string { return proto.CompactTextString(m) }
func (*GetOnuStatsFromOltRequest) ProtoMessage()    {}
func (*GetOnuStatsFromOltRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{29}
}

func (m *GetOnuStatsFromOltRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuStatsFromOltRequest.Unmarshal(m, b)
}
func (m *GetOnuStatsFromOltRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuStatsFromOltRequest.Marshal(b, m, deterministic)
}
func (m *GetOnuStatsFromOltRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuStatsFromOltRequest.Merge(m, src)
}
func (m *GetOnuStatsFromOltRequest) XXX_Size() int {
	return xxx_messageInfo_GetOnuStatsFromOltRequest.Size(m)
}
func (m *GetOnuStatsFromOltRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuStatsFromOltRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuStatsFromOltRequest proto.InternalMessageInfo

func (m *GetOnuStatsFromOltRequest) GetIntfId() uint32 {
	if m != nil {
		return m.IntfId
	}
	return 0
}

func (m *GetOnuStatsFromOltRequest) GetOnuId() uint32 {
	if m != nil {
		return m.OnuId
	}
	return 0
}

type OnuGemPortInfoFromOlt struct {
	GemId                uint32   `protobuf:"varint,1,opt,name=gemId,proto3" json:"gemId,omitempty"`
	RxPackets            uint64   `protobuf:"varint,2,opt,name=rxPackets,proto3" json:"rxPackets,omitempty"`
	RxBytes              uint64   `protobuf:"varint,3,opt,name=rxBytes,proto3" json:"rxBytes,omitempty"`
	TxPackets            uint64   `protobuf:"varint,4,opt,name=txPackets,proto3" json:"txPackets,omitempty"`
	TxBytes              uint64   `protobuf:"varint,5,opt,name=txBytes,proto3" json:"txBytes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *OnuGemPortInfoFromOlt) Reset()         { *m = OnuGemPortInfoFromOlt{} }
func (m *OnuGemPortInfoFromOlt) String() string { return proto.CompactTextString(m) }
func (*OnuGemPortInfoFromOlt) ProtoMessage()    {}
func (*OnuGemPortInfoFromOlt) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{30}
}

func (m *OnuGemPortInfoFromOlt) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuGemPortInfoFromOlt.Unmarshal(m, b)
}
func (m *OnuGemPortInfoFromOlt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuGemPortInfoFromOlt.Marshal(b, m, deterministic)
}
func (m *OnuGemPortInfoFromOlt) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuGemPortInfoFromOlt.Merge(m, src)
}
func (m *OnuGemPortInfoFromOlt) XXX_Size() int {
	return xxx_messageInfo_OnuGemPortInfoFromOlt.Size(m)
}
func (m *OnuGemPortInfoFromOlt) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuGemPortInfoFromOlt.DiscardUnknown(m)
}

var xxx_messageInfo_OnuGemPortInfoFromOlt proto.InternalMessageInfo

func (m *OnuGemPortInfoFromOlt) GetGemId() uint32 {
	if m != nil {
		return m.GemId
	}
	return 0
}

func (m *OnuGemPortInfoFromOlt) GetRxPackets() uint64 {
	if m != nil {
		return m.RxPackets
	}
	return 0
}

func (m *OnuGemPortInfoFromOlt) GetRxBytes() uint64 {
	if m != nil {
		return m.RxBytes
	}
	return 0
}

func (m *OnuGemPortInfoFromOlt) GetTxPackets() uint64 {
	if m != nil {
		return m.TxPackets
	}
	return 0
}

func (m *OnuGemPortInfoFromOlt) GetTxBytes() uint64 {
	if m != nil {
		return m.TxBytes
	}
	return 0
}

type OnuAllocIdInfoFromOlt struct {
	AllocId              uint32   `protobuf:"varint,1,opt,name=allocId,proto3" json:"allocId,omitempty"`
	RxBytes              uint64   `protobuf:"varint,2,opt,name=rxBytes,proto3" json:"rxBytes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *OnuAllocIdInfoFromOlt) Reset()         { *m = OnuAllocIdInfoFromOlt{} }
func (m *OnuAllocIdInfoFromOlt) String() string { return proto.CompactTextString(m) }
func (*OnuAllocIdInfoFromOlt) ProtoMessage()    {}
func (*OnuAllocIdInfoFromOlt) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{31}
}

func (m *OnuAllocIdInfoFromOlt) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuAllocIdInfoFromOlt.Unmarshal(m, b)
}
func (m *OnuAllocIdInfoFromOlt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuAllocIdInfoFromOlt.Marshal(b, m, deterministic)
}
func (m *OnuAllocIdInfoFromOlt) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuAllocIdInfoFromOlt.Merge(m, src)
}
func (m *OnuAllocIdInfoFromOlt) XXX_Size() int {
	return xxx_messageInfo_OnuAllocIdInfoFromOlt.Size(m)
}
func (m *OnuAllocIdInfoFromOlt) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuAllocIdInfoFromOlt.DiscardUnknown(m)
}

var xxx_messageInfo_OnuAllocIdInfoFromOlt proto.InternalMessageInfo

func (m *OnuAllocIdInfoFromOlt) GetAllocId() uint32 {
	if m != nil {
		return m.AllocId
	}
	return 0
}

func (m *OnuAllocIdInfoFromOlt) GetRxBytes() uint64 {
	if m != nil {
		return m.RxBytes
	}
	return 0
}

type OnuAllocGemStatsFromOltResponse struct {
	AllocIdInfo          *OnuAllocIdInfoFromOlt   `protobuf:"bytes,1,opt,name=allocIdInfo,proto3" json:"allocIdInfo,omitempty"`
	GemPortInfo          []*OnuGemPortInfoFromOlt `protobuf:"bytes,2,rep,name=gemPortInfo,proto3" json:"gemPortInfo,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

func (m *OnuAllocGemStatsFromOltResponse) Reset()         { *m = OnuAllocGemStatsFromOltResponse{} }
func (m *OnuAllocGemStatsFromOltResponse) String() string { return proto.CompactTextString(m) }
func (*OnuAllocGemStatsFromOltResponse) ProtoMessage()    {}
func (*OnuAllocGemStatsFromOltResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{32}
}

func (m *OnuAllocGemStatsFromOltResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuAllocGemStatsFromOltResponse.Unmarshal(m, b)
}
func (m *OnuAllocGemStatsFromOltResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuAllocGemStatsFromOltResponse.Marshal(b, m, deterministic)
}
func (m *OnuAllocGemStatsFromOltResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuAllocGemStatsFromOltResponse.Merge(m, src)
}
func (m *OnuAllocGemStatsFromOltResponse) XXX_Size() int {
	return xxx_messageInfo_OnuAllocGemStatsFromOltResponse.Size(m)
}
func (m *OnuAllocGemStatsFromOltResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuAllocGemStatsFromOltResponse.DiscardUnknown(m)
}

var xxx_messageInfo_OnuAllocGemStatsFromOltResponse proto.InternalMessageInfo

func (m *OnuAllocGemStatsFromOltResponse) GetAllocIdInfo() *OnuAllocIdInfoFromOlt {
	if m != nil {
		return m.AllocIdInfo
	}
	return nil
}

func (m *OnuAllocGemStatsFromOltResponse) GetGemPortInfo() []*OnuGemPortInfoFromOlt {
	if m != nil {
		return m.GemPortInfo
	}
	return nil
}

type GetOnuStatsFromOltResponse struct {
	AllocGemStatsInfo    []*OnuAllocGemStatsFromOltResponse `protobuf:"bytes,1,rep,name=allocGemStatsInfo,proto3" json:"allocGemStatsInfo,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                           `json:"-"`
	XXX_unrecognized     []byte                             `json:"-"`
	XXX_sizecache        int32                              `json:"-"`
}

func (m *GetOnuStatsFromOltResponse) Reset()         { *m = GetOnuStatsFromOltResponse{} }
func (m *GetOnuStatsFromOltResponse) String() string { return proto.CompactTextString(m) }
func (*GetOnuStatsFromOltResponse) ProtoMessage()    {}
func (*GetOnuStatsFromOltResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{33}
}

func (m *GetOnuStatsFromOltResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuStatsFromOltResponse.Unmarshal(m, b)
}
func (m *GetOnuStatsFromOltResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuStatsFromOltResponse.Marshal(b, m, deterministic)
}
func (m *GetOnuStatsFromOltResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuStatsFromOltResponse.Merge(m, src)
}
func (m *GetOnuStatsFromOltResponse) XXX_Size() int {
	return xxx_messageInfo_GetOnuStatsFromOltResponse.Size(m)
}
func (m *GetOnuStatsFromOltResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuStatsFromOltResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuStatsFromOltResponse proto.InternalMessageInfo

func (m *GetOnuStatsFromOltResponse) GetAllocGemStatsInfo() []*OnuAllocGemStatsFromOltResponse {
	if m != nil {
		return m.AllocGemStatsInfo
	}
	return nil
}

type GetOnuCountersResponse struct {
	// Types that are valid to be assigned to IsIntfId:
	//	*GetOnuCountersResponse_IntfId
	IsIntfId isGetOnuCountersResponse_IsIntfId `protobuf_oneof:"is_intf_id"`
	// Types that are valid to be assigned to IsOnuId:
	//	*GetOnuCountersResponse_OnuId
	IsOnuId isGetOnuCountersResponse_IsOnuId `protobuf_oneof:"is_onu_id"`
	// Types that are valid to be assigned to IsPositiveDrift:
	//	*GetOnuCountersResponse_PositiveDrift
	IsPositiveDrift isGetOnuCountersResponse_IsPositiveDrift `protobuf_oneof:"is_positive_drift"`
	// Types that are valid to be assigned to IsNegativeDrift:
	//	*GetOnuCountersResponse_NegativeDrift
	IsNegativeDrift isGetOnuCountersResponse_IsNegativeDrift `protobuf_oneof:"is_negative_drift"`
	// Types that are valid to be assigned to IsDelimiterMissDetection:
	//	*GetOnuCountersResponse_DelimiterMissDetection
	IsDelimiterMissDetection isGetOnuCountersResponse_IsDelimiterMissDetection `protobuf_oneof:"is_delimiter_miss_detection"`
	// Types that are valid to be assigned to IsBipErrors:
	//	*GetOnuCountersResponse_BipErrors
	IsBipErrors isGetOnuCountersResponse_IsBipErrors `protobuf_oneof:"is_bip_errors"`
	// Types that are valid to be assigned to IsBipUnits:
	//	*GetOnuCountersResponse_BipUnits
	IsBipUnits isGetOnuCountersResponse_IsBipUnits `protobuf_oneof:"is_bip_units"`
	// Types that are valid to be assigned to IsFecCorrectedSymbols:
	//	*GetOnuCountersResponse_FecCorrectedSymbols
	IsFecCorrectedSymbols isGetOnuCountersResponse_IsFecCorrectedSymbols `protobuf_oneof:"is_fec_corrected_symbols"`
	// Types that are valid to be assigned to IsFecCodewordsCorrected:
	//	*GetOnuCountersResponse_FecCodewordsCorrected
	IsFecCodewordsCorrected isGetOnuCountersResponse_IsFecCodewordsCorrected `protobuf_oneof:"is_fec_codewords_corrected"`
	// Types that are valid to be assigned to IsFecCodewordsUncorrectable:
	//	*GetOnuCountersResponse_FecCodewordsUncorrectable
	IsFecCodewordsUncorrectable isGetOnuCountersResponse_IsFecCodewordsUncorrectable `protobuf_oneof:"is_fec_codewords_uncorrectable"`
	// Types that are valid to be assigned to IsFecCodewords:
	//	*GetOnuCountersResponse_FecCodewords
	IsFecCodewords isGetOnuCountersResponse_IsFecCodewords `protobuf_oneof:"is_fec_codewords"`
	// Types that are valid to be assigned to IsFecCorrectedUnits:
	//	*GetOnuCountersResponse_FecCorrectedUnits
	IsFecCorrectedUnits isGetOnuCountersResponse_IsFecCorrectedUnits `protobuf_oneof:"is_fec_corrected_units"`
	// Types that are valid to be assigned to IsXgemKeyErrors:
	//	*GetOnuCountersResponse_XgemKeyErrors
	IsXgemKeyErrors isGetOnuCountersResponse_IsXgemKeyErrors `protobuf_oneof:"is_xgem_key_errors"`
	// Types that are valid to be assigned to IsXgemLoss:
	//	*GetOnuCountersResponse_XgemLoss
	IsXgemLoss isGetOnuCountersResponse_IsXgemLoss `protobuf_oneof:"is_xgem_loss"`
	// Types that are valid to be assigned to IsRxPloamsError:
	//	*GetOnuCountersResponse_RxPloamsError
	IsRxPloamsError isGetOnuCountersResponse_IsRxPloamsError `protobuf_oneof:"is_rx_ploams_error"`
	// Types that are valid to be assigned to IsRxPloamsNonIdle:
	//	*GetOnuCountersResponse_RxPloamsNonIdle
	IsRxPloamsNonIdle isGetOnuCountersResponse_IsRxPloamsNonIdle `protobuf_oneof:"is_rx_ploams_non_idle"`
	// Types that are valid to be assigned to IsRxOmci:
	//	*GetOnuCountersResponse_RxOmci
	IsRxOmci isGetOnuCountersResponse_IsRxOmci `protobuf_oneof:"is_rx_omci"`
	// Types that are valid to be assigned to IsTxOmci:
	//	*GetOnuCountersResponse_TxOmci
	IsTxOmci isGetOnuCountersResponse_IsTxOmci `protobuf_oneof:"is_tx_omci"`
	// Types that are valid to be assigned to IsRxOmciPacketsCrcError:
	//	*GetOnuCountersResponse_RxOmciPacketsCrcError
	IsRxOmciPacketsCrcError isGetOnuCountersResponse_IsRxOmciPacketsCrcError `protobuf_oneof:"is_rx_omci_packets_crc_error"`
	// Types that are valid to be assigned to IsRxBytes:
	//	*GetOnuCountersResponse_RxBytes
	IsRxBytes isGetOnuCountersResponse_IsRxBytes `protobuf_oneof:"is_rx_bytes"`
	// Types that are valid to be assigned to IsRxPackets:
	//	*GetOnuCountersResponse_RxPackets
	IsRxPackets isGetOnuCountersResponse_IsRxPackets `protobuf_oneof:"is_rx_packets"`
	// Types that are valid to be assigned to IsTxBytes:
	//	*GetOnuCountersResponse_TxBytes
	IsTxBytes isGetOnuCountersResponse_IsTxBytes `protobuf_oneof:"is_tx_bytes"`
	// Types that are valid to be assigned to IsTxPackets:
	//	*GetOnuCountersResponse_TxPackets
	IsTxPackets isGetOnuCountersResponse_IsTxPackets `protobuf_oneof:"is_tx_packets"`
	// Types that are valid to be assigned to IsBerReported:
	//	*GetOnuCountersResponse_BerReported
	IsBerReported isGetOnuCountersResponse_IsBerReported `protobuf_oneof:"is_ber_reported"`
	// Types that are valid to be assigned to IsLcdgErrors:
	//	*GetOnuCountersResponse_LcdgErrors
	IsLcdgErrors isGetOnuCountersResponse_IsLcdgErrors `protobuf_oneof:"is_lcdg_errors"`
	// Types that are valid to be assigned to IsRdiErrors:
	//	*GetOnuCountersResponse_RdiErrors
	IsRdiErrors isGetOnuCountersResponse_IsRdiErrors `protobuf_oneof:"is_rdi_errors"`
	// Types that are valid to be assigned to IsTimestamp:
	//	*GetOnuCountersResponse_Timestamp
	IsTimestamp          isGetOnuCountersResponse_IsTimestamp `protobuf_oneof:"is_timestamp"`
	XXX_NoUnkeyedLiteral struct{}                             `json:"-"`
	XXX_unrecognized     []byte                               `json:"-"`
	XXX_sizecache        int32                                `json:"-"`
}

func (m *GetOnuCountersResponse) Reset()         { *m = GetOnuCountersResponse{} }
func (m *GetOnuCountersResponse) String() string { return proto.CompactTextString(m) }
func (*GetOnuCountersResponse) ProtoMessage()    {}
func (*GetOnuCountersResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{34}
}

func (m *GetOnuCountersResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuCountersResponse.Unmarshal(m, b)
}
func (m *GetOnuCountersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuCountersResponse.Marshal(b, m, deterministic)
}
func (m *GetOnuCountersResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuCountersResponse.Merge(m, src)
}
func (m *GetOnuCountersResponse) XXX_Size() int {
	return xxx_messageInfo_GetOnuCountersResponse.Size(m)
}
func (m *GetOnuCountersResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuCountersResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuCountersResponse proto.InternalMessageInfo

type isGetOnuCountersResponse_IsIntfId interface {
	isGetOnuCountersResponse_IsIntfId()
}

type GetOnuCountersResponse_IntfId struct {
	IntfId uint32 `protobuf:"fixed32,1,opt,name=intf_id,json=intfId,proto3,oneof"`
}

func (*GetOnuCountersResponse_IntfId) isGetOnuCountersResponse_IsIntfId() {}

func (m *GetOnuCountersResponse) GetIsIntfId() isGetOnuCountersResponse_IsIntfId {
	if m != nil {
		return m.IsIntfId
	}
	return nil
}

func (m *GetOnuCountersResponse) GetIntfId() uint32 {
	if x, ok := m.GetIsIntfId().(*GetOnuCountersResponse_IntfId); ok {
		return x.IntfId
	}
	return 0
}

type isGetOnuCountersResponse_IsOnuId interface {
	isGetOnuCountersResponse_IsOnuId()
}

type GetOnuCountersResponse_OnuId struct {
	OnuId uint32 `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3,oneof"`
}

func (*GetOnuCountersResponse_OnuId) isGetOnuCountersResponse_IsOnuId() {}

func (m *GetOnuCountersResponse) GetIsOnuId() isGetOnuCountersResponse_IsOnuId {
	if m != nil {
		return m.IsOnuId
	}
	return nil
}

func (m *GetOnuCountersResponse) GetOnuId() uint32 {
	if x, ok := m.GetIsOnuId().(*GetOnuCountersResponse_OnuId); ok {
		return x.OnuId
	}
	return 0
}

type isGetOnuCountersResponse_IsPositiveDrift interface {
	isGetOnuCountersResponse_IsPositiveDrift()
}

type GetOnuCountersResponse_PositiveDrift struct {
	PositiveDrift uint64 `protobuf:"fixed64,3,opt,name=positive_drift,json=positiveDrift,proto3,oneof"`
}

func (*GetOnuCountersResponse_PositiveDrift) isGetOnuCountersResponse_IsPositiveDrift() {}

func (m *GetOnuCountersResponse) GetIsPositiveDrift() isGetOnuCountersResponse_IsPositiveDrift {
	if m != nil {
		return m.IsPositiveDrift
	}
	return nil
}

func (m *GetOnuCountersResponse) GetPositiveDrift() uint64 {
	if x, ok := m.GetIsPositiveDrift().(*GetOnuCountersResponse_PositiveDrift); ok {
		return x.PositiveDrift
	}
	return 0
}

type isGetOnuCountersResponse_IsNegativeDrift interface {
	isGetOnuCountersResponse_IsNegativeDrift()
}

type GetOnuCountersResponse_NegativeDrift struct {
	NegativeDrift uint64 `protobuf:"fixed64,4,opt,name=negative_drift,json=negativeDrift,proto3,oneof"`
}

func (*GetOnuCountersResponse_NegativeDrift) isGetOnuCountersResponse_IsNegativeDrift() {}

func (m *GetOnuCountersResponse) GetIsNegativeDrift() isGetOnuCountersResponse_IsNegativeDrift {
	if m != nil {
		return m.IsNegativeDrift
	}
	return nil
}

func (m *GetOnuCountersResponse) GetNegativeDrift() uint64 {
	if x, ok := m.GetIsNegativeDrift().(*GetOnuCountersResponse_NegativeDrift); ok {
		return x.NegativeDrift
	}
	return 0
}

type isGetOnuCountersResponse_IsDelimiterMissDetection interface {
	isGetOnuCountersResponse_IsDelimiterMissDetection()
}

type GetOnuCountersResponse_DelimiterMissDetection struct {
	DelimiterMissDetection uint64 `protobuf:"fixed64,5,opt,name=delimiter_miss_detection,json=delimiterMissDetection,proto3,oneof"`
}

func (*GetOnuCountersResponse_DelimiterMissDetection) isGetOnuCountersResponse_IsDelimiterMissDetection() {
}

func (m *GetOnuCountersResponse) GetIsDelimiterMissDetection() isGetOnuCountersResponse_IsDelimiterMissDetection {
	if m != nil {
		return m.IsDelimiterMissDetection
	}
	return nil
}

func (m *GetOnuCountersResponse) GetDelimiterMissDetection() uint64 {
	if x, ok := m.GetIsDelimiterMissDetection().(*GetOnuCountersResponse_DelimiterMissDetection); ok {
		return x.DelimiterMissDetection
	}
	return 0
}

type isGetOnuCountersResponse_IsBipErrors interface {
	isGetOnuCountersResponse_IsBipErrors()
}

type GetOnuCountersResponse_BipErrors struct {
	BipErrors uint64 `protobuf:"fixed64,6,opt,name=bip_errors,json=bipErrors,proto3,oneof"`
}

func (*GetOnuCountersResponse_BipErrors) isGetOnuCountersResponse_IsBipErrors() {}

func (m *GetOnuCountersResponse) GetIsBipErrors() isGetOnuCountersResponse_IsBipErrors {
	if m != nil {
		return m.IsBipErrors
	}
	return nil
}

func (m *GetOnuCountersResponse) GetBipErrors() uint64 {
	if x, ok := m.GetIsBipErrors().(*GetOnuCountersResponse_BipErrors); ok {
		return x.BipErrors
	}
	return 0
}

type isGetOnuCountersResponse_IsBipUnits interface {
	isGetOnuCountersResponse_IsBipUnits()
}

type GetOnuCountersResponse_BipUnits struct {
	BipUnits uint64 `protobuf:"fixed64,7,opt,name=bip_units,json=bipUnits,proto3,oneof"`
}

func (*GetOnuCountersResponse_BipUnits) isGetOnuCountersResponse_IsBipUnits() {}

func (m *GetOnuCountersResponse) GetIsBipUnits() isGetOnuCountersResponse_IsBipUnits {
	if m != nil {
		return m.IsBipUnits
	}
	return nil
}

func (m *GetOnuCountersResponse) GetBipUnits() uint64 {
	if x, ok := m.GetIsBipUnits().(*GetOnuCountersResponse_BipUnits); ok {
		return x.BipUnits
	}
	return 0
}

type isGetOnuCountersResponse_IsFecCorrectedSymbols interface {
	isGetOnuCountersResponse_IsFecCorrectedSymbols()
}

type GetOnuCountersResponse_FecCorrectedSymbols struct {
	FecCorrectedSymbols uint64 `protobuf:"fixed64,8,opt,name=fec_corrected_symbols,json=fecCorrectedSymbols,proto3,oneof"`
}

func (*GetOnuCountersResponse_FecCorrectedSymbols) isGetOnuCountersResponse_IsFecCorrectedSymbols() {}

func (m *GetOnuCountersResponse) GetIsFecCorrectedSymbols() isGetOnuCountersResponse_IsFecCorrectedSymbols {
	if m != nil {
		return m.IsFecCorrectedSymbols
	}
	return nil
}

func (m *GetOnuCountersResponse) GetFecCorrectedSymbols() uint64 {
	if x, ok := m.GetIsFecCorrectedSymbols().(*GetOnuCountersResponse_FecCorrectedSymbols); ok {
		return x.FecCorrectedSymbols
	}
	return 0
}

type isGetOnuCountersResponse_IsFecCodewordsCorrected interface {
	isGetOnuCountersResponse_IsFecCodewordsCorrected()
}

type GetOnuCountersResponse_FecCodewordsCorrected struct {
	FecCodewordsCorrected uint64 `protobuf:"fixed64,9,opt,name=fec_codewords_corrected,json=fecCodewordsCorrected,proto3,oneof"`
}

func (*GetOnuCountersResponse_FecCodewordsCorrected) isGetOnuCountersResponse_IsFecCodewordsCorrected() {
}

func (m *GetOnuCountersResponse) GetIsFecCodewordsCorrected() isGetOnuCountersResponse_IsFecCodewordsCorrected {
	if m != nil {
		return m.IsFecCodewordsCorrected
	}
	return nil
}

func (m *GetOnuCountersResponse) GetFecCodewordsCorrected() uint64 {
	if x, ok := m.GetIsFecCodewordsCorrected().(*GetOnuCountersResponse_FecCodewordsCorrected); ok {
		return x.FecCodewordsCorrected
	}
	return 0
}

type isGetOnuCountersResponse_IsFecCodewordsUncorrectable interface {
	isGetOnuCountersResponse_IsFecCodewordsUncorrectable()
}

type GetOnuCountersResponse_FecCodewordsUncorrectable struct {
	FecCodewordsUncorrectable uint64 `protobuf:"fixed64,10,opt,name=fec_codewords_uncorrectable,json=fecCodewordsUncorrectable,proto3,oneof"`
}

func (*GetOnuCountersResponse_FecCodewordsUncorrectable) isGetOnuCountersResponse_IsFecCodewordsUncorrectable() {
}

func (m *GetOnuCountersResponse) GetIsFecCodewordsUncorrectable() isGetOnuCountersResponse_IsFecCodewordsUncorrectable {
	if m != nil {
		return m.IsFecCodewordsUncorrectable
	}
	return nil
}

func (m *GetOnuCountersResponse) GetFecCodewordsUncorrectable() uint64 {
	if x, ok := m.GetIsFecCodewordsUncorrectable().(*GetOnuCountersResponse_FecCodewordsUncorrectable); ok {
		return x.FecCodewordsUncorrectable
	}
	return 0
}

type isGetOnuCountersResponse_IsFecCodewords interface {
	isGetOnuCountersResponse_IsFecCodewords()
}

type GetOnuCountersResponse_FecCodewords struct {
	FecCodewords uint64 `protobuf:"fixed64,11,opt,name=fec_codewords,json=fecCodewords,proto3,oneof"`
}

func (*GetOnuCountersResponse_FecCodewords) isGetOnuCountersResponse_IsFecCodewords() {}

func (m *GetOnuCountersResponse) GetIsFecCodewords() isGetOnuCountersResponse_IsFecCodewords {
	if m != nil {
		return m.IsFecCodewords
	}
	return nil
}

func (m *GetOnuCountersResponse) GetFecCodewords() uint64 {
	if x, ok := m.GetIsFecCodewords().(*GetOnuCountersResponse_FecCodewords); ok {
		return x.FecCodewords
	}
	return 0
}

type isGetOnuCountersResponse_IsFecCorrectedUnits interface {
	isGetOnuCountersResponse_IsFecCorrectedUnits()
}

type GetOnuCountersResponse_FecCorrectedUnits struct {
	FecCorrectedUnits uint64 `protobuf:"fixed64,12,opt,name=fec_corrected_units,json=fecCorrectedUnits,proto3,oneof"`
}

func (*GetOnuCountersResponse_FecCorrectedUnits) isGetOnuCountersResponse_IsFecCorrectedUnits() {}

func (m *GetOnuCountersResponse) GetIsFecCorrectedUnits() isGetOnuCountersResponse_IsFecCorrectedUnits {
	if m != nil {
		return m.IsFecCorrectedUnits
	}
	return nil
}

func (m *GetOnuCountersResponse) GetFecCorrectedUnits() uint64 {
	if x, ok := m.GetIsFecCorrectedUnits().(*GetOnuCountersResponse_FecCorrectedUnits); ok {
		return x.FecCorrectedUnits
	}
	return 0
}

type isGetOnuCountersResponse_IsXgemKeyErrors interface {
	isGetOnuCountersResponse_IsXgemKeyErrors()
}

type GetOnuCountersResponse_XgemKeyErrors struct {
	XgemKeyErrors uint64 `protobuf:"fixed64,13,opt,name=xgem_key_errors,json=xgemKeyErrors,proto3,oneof"`
}

func (*GetOnuCountersResponse_XgemKeyErrors) isGetOnuCountersResponse_IsXgemKeyErrors() {}

func (m *GetOnuCountersResponse) GetIsXgemKeyErrors() isGetOnuCountersResponse_IsXgemKeyErrors {
	if m != nil {
		return m.IsXgemKeyErrors
	}
	return nil
}

func (m *GetOnuCountersResponse) GetXgemKeyErrors() uint64 {
	if x, ok := m.GetIsXgemKeyErrors().(*GetOnuCountersResponse_XgemKeyErrors); ok {
		return x.XgemKeyErrors
	}
	return 0
}

type isGetOnuCountersResponse_IsXgemLoss interface {
	isGetOnuCountersResponse_IsXgemLoss()
}

type GetOnuCountersResponse_XgemLoss struct {
	XgemLoss uint64 `protobuf:"fixed64,14,opt,name=xgem_loss,json=xgemLoss,proto3,oneof"`
}

func (*GetOnuCountersResponse_XgemLoss) isGetOnuCountersResponse_IsXgemLoss() {}

func (m *GetOnuCountersResponse) GetIsXgemLoss() isGetOnuCountersResponse_IsXgemLoss {
	if m != nil {
		return m.IsXgemLoss
	}
	return nil
}

func (m *GetOnuCountersResponse) GetXgemLoss() uint64 {
	if x, ok := m.GetIsXgemLoss().(*GetOnuCountersResponse_XgemLoss); ok {
		return x.XgemLoss
	}
	return 0
}

type isGetOnuCountersResponse_IsRxPloamsError interface {
	isGetOnuCountersResponse_IsRxPloamsError()
}

type GetOnuCountersResponse_RxPloamsError struct {
	RxPloamsError uint64 `protobuf:"fixed64,15,opt,name=rx_ploams_error,json=rxPloamsError,proto3,oneof"`
}

func (*GetOnuCountersResponse_RxPloamsError) isGetOnuCountersResponse_IsRxPloamsError() {}

func (m *GetOnuCountersResponse) GetIsRxPloamsError() isGetOnuCountersResponse_IsRxPloamsError {
	if m != nil {
		return m.IsRxPloamsError
	}
	return nil
}

func (m *GetOnuCountersResponse) GetRxPloamsError() uint64 {
	if x, ok := m.GetIsRxPloamsError().(*GetOnuCountersResponse_RxPloamsError); ok {
		return x.RxPloamsError
	}
	return 0
}

type isGetOnuCountersResponse_IsRxPloamsNonIdle interface {
	isGetOnuCountersResponse_IsRxPloamsNonIdle()
}

type GetOnuCountersResponse_RxPloamsNonIdle struct {
	RxPloamsNonIdle uint64 `protobuf:"fixed64,16,opt,name=rx_ploams_non_idle,json=rxPloamsNonIdle,proto3,oneof"`
}

func (*GetOnuCountersResponse_RxPloamsNonIdle) isGetOnuCountersResponse_IsRxPloamsNonIdle() {}

func (m *GetOnuCountersResponse) GetIsRxPloamsNonIdle() isGetOnuCountersResponse_IsRxPloamsNonIdle {
	if m != nil {
		return m.IsRxPloamsNonIdle
	}
	return nil
}

func (m *GetOnuCountersResponse) GetRxPloamsNonIdle() uint64 {
	if x, ok := m.GetIsRxPloamsNonIdle().(*GetOnuCountersResponse_RxPloamsNonIdle); ok {
		return x.RxPloamsNonIdle
	}
	return 0
}

type isGetOnuCountersResponse_IsRxOmci interface {
	isGetOnuCountersResponse_IsRxOmci()
}

type GetOnuCountersResponse_RxOmci struct {
	RxOmci uint64 `protobuf:"fixed64,17,opt,name=rx_omci,json=rxOmci,proto3,oneof"`
}

func (*GetOnuCountersResponse_RxOmci) isGetOnuCountersResponse_IsRxOmci() {}

func (m *GetOnuCountersResponse) GetIsRxOmci() isGetOnuCountersResponse_IsRxOmci {
	if m != nil {
		return m.IsRxOmci
	}
	return nil
}

func (m *GetOnuCountersResponse) GetRxOmci() uint64 {
	if x, ok := m.GetIsRxOmci().(*GetOnuCountersResponse_RxOmci); ok {
		return x.RxOmci
	}
	return 0
}

type isGetOnuCountersResponse_IsTxOmci interface {
	isGetOnuCountersResponse_IsTxOmci()
}

type GetOnuCountersResponse_TxOmci struct {
	TxOmci uint64 `protobuf:"fixed64,18,opt,name=tx_omci,json=txOmci,proto3,oneof"`
}

func (*GetOnuCountersResponse_TxOmci) isGetOnuCountersResponse_IsTxOmci() {}

func (m *GetOnuCountersResponse) GetIsTxOmci() isGetOnuCountersResponse_IsTxOmci {
	if m != nil {
		return m.IsTxOmci
	}
	return nil
}

func (m *GetOnuCountersResponse) GetTxOmci() uint64 {
	if x, ok := m.GetIsTxOmci().(*GetOnuCountersResponse_TxOmci); ok {
		return x.TxOmci
	}
	return 0
}

type isGetOnuCountersResponse_IsRxOmciPacketsCrcError interface {
	isGetOnuCountersResponse_IsRxOmciPacketsCrcError()
}

type GetOnuCountersResponse_RxOmciPacketsCrcError struct {
	RxOmciPacketsCrcError uint64 `protobuf:"fixed64,19,opt,name=rx_omci_packets_crc_error,json=rxOmciPacketsCrcError,proto3,oneof"`
}

func (*GetOnuCountersResponse_RxOmciPacketsCrcError) isGetOnuCountersResponse_IsRxOmciPacketsCrcError() {
}

func (m *GetOnuCountersResponse) GetIsRxOmciPacketsCrcError() isGetOnuCountersResponse_IsRxOmciPacketsCrcError {
	if m != nil {
		return m.IsRxOmciPacketsCrcError
	}
	return nil
}

func (m *GetOnuCountersResponse) GetRxOmciPacketsCrcError() uint64 {
	if x, ok := m.GetIsRxOmciPacketsCrcError().(*GetOnuCountersResponse_RxOmciPacketsCrcError); ok {
		return x.RxOmciPacketsCrcError
	}
	return 0
}

type isGetOnuCountersResponse_IsRxBytes interface {
	isGetOnuCountersResponse_IsRxBytes()
}

type GetOnuCountersResponse_RxBytes struct {
	RxBytes uint64 `protobuf:"fixed64,20,opt,name=rx_bytes,json=rxBytes,proto3,oneof"`
}

func (*GetOnuCountersResponse_RxBytes) isGetOnuCountersResponse_IsRxBytes() {}

func (m *GetOnuCountersResponse) GetIsRxBytes() isGetOnuCountersResponse_IsRxBytes {
	if m != nil {
		return m.IsRxBytes
	}
	return nil
}

func (m *GetOnuCountersResponse) GetRxBytes() uint64 {
	if x, ok := m.GetIsRxBytes().(*GetOnuCountersResponse_RxBytes); ok {
		return x.RxBytes
	}
	return 0
}

type isGetOnuCountersResponse_IsRxPackets interface {
	isGetOnuCountersResponse_IsRxPackets()
}

type GetOnuCountersResponse_RxPackets struct {
	RxPackets uint64 `protobuf:"fixed64,21,opt,name=rx_packets,json=rxPackets,proto3,oneof"`
}

func (*GetOnuCountersResponse_RxPackets) isGetOnuCountersResponse_IsRxPackets() {}

func (m *GetOnuCountersResponse) GetIsRxPackets() isGetOnuCountersResponse_IsRxPackets {
	if m != nil {
		return m.IsRxPackets
	}
	return nil
}

func (m *GetOnuCountersResponse) GetRxPackets() uint64 {
	if x, ok := m.GetIsRxPackets().(*GetOnuCountersResponse_RxPackets); ok {
		return x.RxPackets
	}
	return 0
}

type isGetOnuCountersResponse_IsTxBytes interface {
	isGetOnuCountersResponse_IsTxBytes()
}

type GetOnuCountersResponse_TxBytes struct {
	TxBytes uint64 `protobuf:"fixed64,22,opt,name=tx_bytes,json=txBytes,proto3,oneof"`
}

func (*GetOnuCountersResponse_TxBytes) isGetOnuCountersResponse_IsTxBytes() {}

func (m *GetOnuCountersResponse) GetIsTxBytes() isGetOnuCountersResponse_IsTxBytes {
	if m != nil {
		return m.IsTxBytes
	}
	return nil
}

func (m *GetOnuCountersResponse) GetTxBytes() uint64 {
	if x, ok := m.GetIsTxBytes().(*GetOnuCountersResponse_TxBytes); ok {
		return x.TxBytes
	}
	return 0
}

type isGetOnuCountersResponse_IsTxPackets interface {
	isGetOnuCountersResponse_IsTxPackets()
}

type GetOnuCountersResponse_TxPackets struct {
	TxPackets uint64 `protobuf:"fixed64,23,opt,name=tx_packets,json=txPackets,proto3,oneof"`
}

func (*GetOnuCountersResponse_TxPackets) isGetOnuCountersResponse_IsTxPackets() {}

func (m *GetOnuCountersResponse) GetIsTxPackets() isGetOnuCountersResponse_IsTxPackets {
	if m != nil {
		return m.IsTxPackets
	}
	return nil
}

func (m *GetOnuCountersResponse) GetTxPackets() uint64 {
	if x, ok := m.GetIsTxPackets().(*GetOnuCountersResponse_TxPackets); ok {
		return x.TxPackets
	}
	return 0
}

type isGetOnuCountersResponse_IsBerReported interface {
	isGetOnuCountersResponse_IsBerReported()
}

type GetOnuCountersResponse_BerReported struct {
	BerReported uint64 `protobuf:"fixed64,24,opt,name=ber_reported,json=berReported,proto3,oneof"`
}

func (*GetOnuCountersResponse_BerReported) isGetOnuCountersResponse_IsBerReported() {}

func (m *GetOnuCountersResponse) GetIsBerReported() isGetOnuCountersResponse_IsBerReported {
	if m != nil {
		return m.IsBerReported
	}
	return nil
}

func (m *GetOnuCountersResponse) GetBerReported() uint64 {
	if x, ok := m.GetIsBerReported().(*GetOnuCountersResponse_BerReported); ok {
		return x.BerReported
	}
	return 0
}

type isGetOnuCountersResponse_IsLcdgErrors interface {
	isGetOnuCountersResponse_IsLcdgErrors()
}

type GetOnuCountersResponse_LcdgErrors struct {
	LcdgErrors uint64 `protobuf:"fixed64,25,opt,name=lcdg_errors,json=lcdgErrors,proto3,oneof"`
}

func (*GetOnuCountersResponse_LcdgErrors) isGetOnuCountersResponse_IsLcdgErrors() {}

func (m *GetOnuCountersResponse) GetIsLcdgErrors() isGetOnuCountersResponse_IsLcdgErrors {
	if m != nil {
		return m.IsLcdgErrors
	}
	return nil
}

func (m *GetOnuCountersResponse) GetLcdgErrors() uint64 {
	if x, ok := m.GetIsLcdgErrors().(*GetOnuCountersResponse_LcdgErrors); ok {
		return x.LcdgErrors
	}
	return 0
}

type isGetOnuCountersResponse_IsRdiErrors interface {
	isGetOnuCountersResponse_IsRdiErrors()
}

type GetOnuCountersResponse_RdiErrors struct {
	RdiErrors uint64 `protobuf:"fixed64,26,opt,name=rdi_errors,json=rdiErrors,proto3,oneof"`
}

func (*GetOnuCountersResponse_RdiErrors) isGetOnuCountersResponse_IsRdiErrors() {}

func (m *GetOnuCountersResponse) GetIsRdiErrors() isGetOnuCountersResponse_IsRdiErrors {
	if m != nil {
		return m.IsRdiErrors
	}
	return nil
}

func (m *GetOnuCountersResponse) GetRdiErrors() uint64 {
	if x, ok := m.GetIsRdiErrors().(*GetOnuCountersResponse_RdiErrors); ok {
		return x.RdiErrors
	}
	return 0
}

type isGetOnuCountersResponse_IsTimestamp interface {
	isGetOnuCountersResponse_IsTimestamp()
}

type GetOnuCountersResponse_Timestamp struct {
	Timestamp uint32 `protobuf:"fixed32,27,opt,name=timestamp,proto3,oneof"`
}

func (*GetOnuCountersResponse_Timestamp) isGetOnuCountersResponse_IsTimestamp() {}

func (m *GetOnuCountersResponse) GetIsTimestamp() isGetOnuCountersResponse_IsTimestamp {
	if m != nil {
		return m.IsTimestamp
	}
	return nil
}

func (m *GetOnuCountersResponse) GetTimestamp() uint32 {
	if x, ok := m.GetIsTimestamp().(*GetOnuCountersResponse_Timestamp); ok {
		return x.Timestamp
	}
	return 0
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*GetOnuCountersResponse) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*GetOnuCountersResponse_IntfId)(nil),
		(*GetOnuCountersResponse_OnuId)(nil),
		(*GetOnuCountersResponse_PositiveDrift)(nil),
		(*GetOnuCountersResponse_NegativeDrift)(nil),
		(*GetOnuCountersResponse_DelimiterMissDetection)(nil),
		(*GetOnuCountersResponse_BipErrors)(nil),
		(*GetOnuCountersResponse_BipUnits)(nil),
		(*GetOnuCountersResponse_FecCorrectedSymbols)(nil),
		(*GetOnuCountersResponse_FecCodewordsCorrected)(nil),
		(*GetOnuCountersResponse_FecCodewordsUncorrectable)(nil),
		(*GetOnuCountersResponse_FecCodewords)(nil),
		(*GetOnuCountersResponse_FecCorrectedUnits)(nil),
		(*GetOnuCountersResponse_XgemKeyErrors)(nil),
		(*GetOnuCountersResponse_XgemLoss)(nil),
		(*GetOnuCountersResponse_RxPloamsError)(nil),
		(*GetOnuCountersResponse_RxPloamsNonIdle)(nil),
		(*GetOnuCountersResponse_RxOmci)(nil),
		(*GetOnuCountersResponse_TxOmci)(nil),
		(*GetOnuCountersResponse_RxOmciPacketsCrcError)(nil),
		(*GetOnuCountersResponse_RxBytes)(nil),
		(*GetOnuCountersResponse_RxPackets)(nil),
		(*GetOnuCountersResponse_TxBytes)(nil),
		(*GetOnuCountersResponse_TxPackets)(nil),
		(*GetOnuCountersResponse_BerReported)(nil),
		(*GetOnuCountersResponse_LcdgErrors)(nil),
		(*GetOnuCountersResponse_RdiErrors)(nil),
		(*GetOnuCountersResponse_Timestamp)(nil),
	}
}

type OmciEthernetFrameExtendedPm struct {
	DropEvents               uint64   `protobuf:"fixed64,1,opt,name=drop_events,json=dropEvents,proto3" json:"drop_events,omitempty"`
	Octets                   uint64   `protobuf:"fixed64,2,opt,name=octets,proto3" json:"octets,omitempty"`
	Frames                   uint64   `protobuf:"fixed64,3,opt,name=frames,proto3" json:"frames,omitempty"`
	BroadcastFrames          uint64   `protobuf:"fixed64,4,opt,name=broadcast_frames,json=broadcastFrames,proto3" json:"broadcast_frames,omitempty"`
	MulticastFrames          uint64   `protobuf:"fixed64,5,opt,name=multicast_frames,json=multicastFrames,proto3" json:"multicast_frames,omitempty"`
	CrcErroredFrames         uint64   `protobuf:"fixed64,6,opt,name=crc_errored_frames,json=crcErroredFrames,proto3" json:"crc_errored_frames,omitempty"`
	UndersizeFrames          uint64   `protobuf:"fixed64,7,opt,name=undersize_frames,json=undersizeFrames,proto3" json:"undersize_frames,omitempty"`
	OversizeFrames           uint64   `protobuf:"fixed64,8,opt,name=oversize_frames,json=oversizeFrames,proto3" json:"oversize_frames,omitempty"`
	Frames_64Octets          uint64   `protobuf:"fixed64,9,opt,name=frames_64_octets,json=frames64Octets,proto3" json:"frames_64_octets,omitempty"`
	Frames_65To_127Octets    uint64   `protobuf:"fixed64,10,opt,name=frames_65_to_127_octets,json=frames65To127Octets,proto3" json:"frames_65_to_127_octets,omitempty"`
	Frames_128To_255Octets   uint64   `protobuf:"fixed64,11,opt,name=frames_128_to_255_octets,json=frames128To255Octets,proto3" json:"frames_128_to_255_octets,omitempty"`
	Frames_256To_511Octets   uint64   `protobuf:"fixed64,12,opt,name=frames_256_to_511_octets,json=frames256To511Octets,proto3" json:"frames_256_to_511_octets,omitempty"`
	Frames_512To_1023Octets  uint64   `protobuf:"fixed64,13,opt,name=frames_512_to_1023_octets,json=frames512To1023Octets,proto3" json:"frames_512_to_1023_octets,omitempty"`
	Frames_1024To_1518Octets uint64   `protobuf:"fixed64,14,opt,name=frames_1024_to_1518_octets,json=frames1024To1518Octets,proto3" json:"frames_1024_to_1518_octets,omitempty"`
	XXX_NoUnkeyedLiteral     struct{} `json:"-"`
	XXX_unrecognized         []byte   `json:"-"`
	XXX_sizecache            int32    `json:"-"`
}

func (m *OmciEthernetFrameExtendedPm) Reset()         { *m = OmciEthernetFrameExtendedPm{} }
func (m *OmciEthernetFrameExtendedPm) String() string { return proto.CompactTextString(m) }
func (*OmciEthernetFrameExtendedPm) ProtoMessage()    {}
func (*OmciEthernetFrameExtendedPm) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{35}
}

func (m *OmciEthernetFrameExtendedPm) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OmciEthernetFrameExtendedPm.Unmarshal(m, b)
}
func (m *OmciEthernetFrameExtendedPm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OmciEthernetFrameExtendedPm.Marshal(b, m, deterministic)
}
func (m *OmciEthernetFrameExtendedPm) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OmciEthernetFrameExtendedPm.Merge(m, src)
}
func (m *OmciEthernetFrameExtendedPm) XXX_Size() int {
	return xxx_messageInfo_OmciEthernetFrameExtendedPm.Size(m)
}
func (m *OmciEthernetFrameExtendedPm) XXX_DiscardUnknown() {
	xxx_messageInfo_OmciEthernetFrameExtendedPm.DiscardUnknown(m)
}

var xxx_messageInfo_OmciEthernetFrameExtendedPm proto.InternalMessageInfo

func (m *OmciEthernetFrameExtendedPm) GetDropEvents() uint64 {
	if m != nil {
		return m.DropEvents
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetOctets() uint64 {
	if m != nil {
		return m.Octets
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetFrames() uint64 {
	if m != nil {
		return m.Frames
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetBroadcastFrames() uint64 {
	if m != nil {
		return m.BroadcastFrames
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetMulticastFrames() uint64 {
	if m != nil {
		return m.MulticastFrames
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetCrcErroredFrames() uint64 {
	if m != nil {
		return m.CrcErroredFrames
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetUndersizeFrames() uint64 {
	if m != nil {
		return m.UndersizeFrames
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetOversizeFrames() uint64 {
	if m != nil {
		return m.OversizeFrames
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetFrames_64Octets() uint64 {
	if m != nil {
		return m.Frames_64Octets
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetFrames_65To_127Octets() uint64 {
	if m != nil {
		return m.Frames_65To_127Octets
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetFrames_128To_255Octets() uint64 {
	if m != nil {
		return m.Frames_128To_255Octets
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetFrames_256To_511Octets() uint64 {
	if m != nil {
		return m.Frames_256To_511Octets
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetFrames_512To_1023Octets() uint64 {
	if m != nil {
		return m.Frames_512To_1023Octets
	}
	return 0
}

func (m *OmciEthernetFrameExtendedPm) GetFrames_1024To_1518Octets() uint64 {
	if m != nil {
		return m.Frames_1024To_1518Octets
	}
	return 0
}

type GetOmciEthernetFrameExtendedPmResponse struct {
	Upstream                          *OmciEthernetFrameExtendedPm                  `protobuf:"bytes,1,opt,name=upstream,proto3" json:"upstream,omitempty"`
	Downstream                        *OmciEthernetFrameExtendedPm                  `protobuf:"bytes,2,opt,name=downstream,proto3" json:"downstream,omitempty"`
	OmciEthernetFrameExtendedPmFormat GetOmciEthernetFrameExtendedPmResponse_Format `protobuf:"varint,3,opt,name=omci_ethernet_frame_extended_pm_format,json=omciEthernetFrameExtendedPmFormat,proto3,enum=extension.GetOmciEthernetFrameExtendedPmResponse_Format" json:"omci_ethernet_frame_extended_pm_format,omitempty"`
	XXX_NoUnkeyedLiteral              struct{}                                      `json:"-"`
	XXX_unrecognized                  []byte                                        `json:"-"`
	XXX_sizecache                     int32                                         `json:"-"`
}

func (m *GetOmciEthernetFrameExtendedPmResponse) Reset() {
	*m = GetOmciEthernetFrameExtendedPmResponse{}
}
func (m *GetOmciEthernetFrameExtendedPmResponse) String() string { return proto.CompactTextString(m) }
func (*GetOmciEthernetFrameExtendedPmResponse) ProtoMessage()    {}
func (*GetOmciEthernetFrameExtendedPmResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{36}
}

func (m *GetOmciEthernetFrameExtendedPmResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOmciEthernetFrameExtendedPmResponse.Unmarshal(m, b)
}
func (m *GetOmciEthernetFrameExtendedPmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOmciEthernetFrameExtendedPmResponse.Marshal(b, m, deterministic)
}
func (m *GetOmciEthernetFrameExtendedPmResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOmciEthernetFrameExtendedPmResponse.Merge(m, src)
}
func (m *GetOmciEthernetFrameExtendedPmResponse) XXX_Size() int {
	return xxx_messageInfo_GetOmciEthernetFrameExtendedPmResponse.Size(m)
}
func (m *GetOmciEthernetFrameExtendedPmResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOmciEthernetFrameExtendedPmResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOmciEthernetFrameExtendedPmResponse proto.InternalMessageInfo

func (m *GetOmciEthernetFrameExtendedPmResponse) GetUpstream() *OmciEthernetFrameExtendedPm {
	if m != nil {
		return m.Upstream
	}
	return nil
}

func (m *GetOmciEthernetFrameExtendedPmResponse) GetDownstream() *OmciEthernetFrameExtendedPm {
	if m != nil {
		return m.Downstream
	}
	return nil
}

func (m *GetOmciEthernetFrameExtendedPmResponse) GetOmciEthernetFrameExtendedPmFormat() GetOmciEthernetFrameExtendedPmResponse_Format {
	if m != nil {
		return m.OmciEthernetFrameExtendedPmFormat
	}
	return GetOmciEthernetFrameExtendedPmResponse_THIRTY_TWO_BIT
}

type RxPower struct {
	OnuSn                string   `protobuf:"bytes,1,opt,name=onu_sn,json=onuSn,proto3" json:"onu_sn,omitempty"`
	Status               string   `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	FailReason           string   `protobuf:"bytes,3,opt,name=fail_reason,json=failReason,proto3" json:"fail_reason,omitempty"`
	RxPower              float64  `protobuf:"fixed64,4,opt,name=rx_power,json=rxPower,proto3" json:"rx_power,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *RxPower) Reset()         { *m = RxPower{} }
func (m *RxPower) String() string { return proto.CompactTextString(m) }
func (*RxPower) ProtoMessage()    {}
func (*RxPower) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{37}
}

func (m *RxPower) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_RxPower.Unmarshal(m, b)
}
func (m *RxPower) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_RxPower.Marshal(b, m, deterministic)
}
func (m *RxPower) XXX_Merge(src proto.Message) {
	xxx_messageInfo_RxPower.Merge(m, src)
}
func (m *RxPower) XXX_Size() int {
	return xxx_messageInfo_RxPower.Size(m)
}
func (m *RxPower) XXX_DiscardUnknown() {
	xxx_messageInfo_RxPower.DiscardUnknown(m)
}

var xxx_messageInfo_RxPower proto.InternalMessageInfo

func (m *RxPower) GetOnuSn() string {
	if m != nil {
		return m.OnuSn
	}
	return ""
}

func (m *RxPower) GetStatus() string {
	if m != nil {
		return m.Status
	}
	return ""
}

func (m *RxPower) GetFailReason() string {
	if m != nil {
		return m.FailReason
	}
	return ""
}

func (m *RxPower) GetRxPower() float64 {
	if m != nil {
		return m.RxPower
	}
	return 0
}

type GetOltRxPowerResponse struct {
	PortLabel            string     `protobuf:"bytes,1,opt,name=port_label,json=portLabel,proto3" json:"port_label,omitempty"`
	RxPower              []*RxPower `protobuf:"bytes,2,rep,name=rx_power,json=rxPower,proto3" json:"rx_power,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (m *GetOltRxPowerResponse) Reset()         { *m = GetOltRxPowerResponse{} }
func (m *GetOltRxPowerResponse) String() string { return proto.CompactTextString(m) }
func (*GetOltRxPowerResponse) ProtoMessage()    {}
func (*GetOltRxPowerResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{38}
}

func (m *GetOltRxPowerResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOltRxPowerResponse.Unmarshal(m, b)
}
func (m *GetOltRxPowerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOltRxPowerResponse.Marshal(b, m, deterministic)
}
func (m *GetOltRxPowerResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOltRxPowerResponse.Merge(m, src)
}
func (m *GetOltRxPowerResponse) XXX_Size() int {
	return xxx_messageInfo_GetOltRxPowerResponse.Size(m)
}
func (m *GetOltRxPowerResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOltRxPowerResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOltRxPowerResponse proto.InternalMessageInfo

func (m *GetOltRxPowerResponse) GetPortLabel() string {
	if m != nil {
		return m.PortLabel
	}
	return ""
}

func (m *GetOltRxPowerResponse) GetRxPower() []*RxPower {
	if m != nil {
		return m.RxPower
	}
	return nil
}

// DEPRECATED
type GetRxPowerResponse struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId,proto3" json:"intf_id,omitempty"`
	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	FailReason           string   `protobuf:"bytes,4,opt,name=fail_reason,json=failReason,proto3" json:"fail_reason,omitempty"`
	RxPower              float64  `protobuf:"fixed64,5,opt,name=rx_power,json=rxPower,proto3" json:"rx_power,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetRxPowerResponse) Reset()         { *m = GetRxPowerResponse{} }
func (m *GetRxPowerResponse) String() string { return proto.CompactTextString(m) }
func (*GetRxPowerResponse) ProtoMessage()    {}
func (*GetRxPowerResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{39}
}

func (m *GetRxPowerResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetRxPowerResponse.Unmarshal(m, b)
}
func (m *GetRxPowerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetRxPowerResponse.Marshal(b, m, deterministic)
}
func (m *GetRxPowerResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetRxPowerResponse.Merge(m, src)
}
func (m *GetRxPowerResponse) XXX_Size() int {
	return xxx_messageInfo_GetRxPowerResponse.Size(m)
}
func (m *GetRxPowerResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetRxPowerResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetRxPowerResponse proto.InternalMessageInfo

func (m *GetRxPowerResponse) GetIntfId() uint32 {
	if m != nil {
		return m.IntfId
	}
	return 0
}

func (m *GetRxPowerResponse) GetOnuId() uint32 {
	if m != nil {
		return m.OnuId
	}
	return 0
}

func (m *GetRxPowerResponse) GetStatus() string {
	if m != nil {
		return m.Status
	}
	return ""
}

func (m *GetRxPowerResponse) GetFailReason() string {
	if m != nil {
		return m.FailReason
	}
	return ""
}

func (m *GetRxPowerResponse) GetRxPower() float64 {
	if m != nil {
		return m.RxPower
	}
	return 0
}

type GetOnuOmciTxRxStatsRequest struct {
	Empty                *empty.Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (m *GetOnuOmciTxRxStatsRequest) Reset()         { *m = GetOnuOmciTxRxStatsRequest{} }
func (m *GetOnuOmciTxRxStatsRequest) String() string { return proto.CompactTextString(m) }
func (*GetOnuOmciTxRxStatsRequest) ProtoMessage()    {}
func (*GetOnuOmciTxRxStatsRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{40}
}

func (m *GetOnuOmciTxRxStatsRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuOmciTxRxStatsRequest.Unmarshal(m, b)
}
func (m *GetOnuOmciTxRxStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuOmciTxRxStatsRequest.Marshal(b, m, deterministic)
}
func (m *GetOnuOmciTxRxStatsRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuOmciTxRxStatsRequest.Merge(m, src)
}
func (m *GetOnuOmciTxRxStatsRequest) XXX_Size() int {
	return xxx_messageInfo_GetOnuOmciTxRxStatsRequest.Size(m)
}
func (m *GetOnuOmciTxRxStatsRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuOmciTxRxStatsRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuOmciTxRxStatsRequest proto.InternalMessageInfo

func (m *GetOnuOmciTxRxStatsRequest) GetEmpty() *empty.Empty {
	if m != nil {
		return m.Empty
	}
	return nil
}

// see ITU-T G.988 clause 11.2.2
type GetOnuOmciTxRxStatsResponse struct {
	// OMCI baseline Tx frames with AR bit set
	BaseTxArFrames uint32 `protobuf:"varint,1,opt,name=base_tx_ar_frames,json=baseTxArFrames,proto3" json:"base_tx_ar_frames,omitempty"`
	// OMCI baseline Rx frames with AK bit set
	BaseRxAkFrames uint32 `protobuf:"varint,2,opt,name=base_rx_ak_frames,json=baseRxAkFrames,proto3" json:"base_rx_ak_frames,omitempty"`
	// OMCI baseline Tx frames with AR bit unset
	BaseTxNoArFrames uint32 `protobuf:"varint,3,opt,name=base_tx_no_ar_frames,json=baseTxNoArFrames,proto3" json:"base_tx_no_ar_frames,omitempty"`
	// OMCI baseline Rx frames with AK bit unset
	BaseRxNoAkFrames uint32 `protobuf:"varint,4,opt,name=base_rx_no_ak_frames,json=baseRxNoAkFrames,proto3" json:"base_rx_no_ak_frames,omitempty"`
	// OMCI extended Tx frames with AR bit set
	ExtTxArFrames uint32 `protobuf:"varint,5,opt,name=ext_tx_ar_frames,json=extTxArFrames,proto3" json:"ext_tx_ar_frames,omitempty"`
	// OMCI extended Rx frames with AK bit set
	ExtRxAkFrames uint32 `protobuf:"varint,6,opt,name=ext_rx_ak_frames,json=extRxAkFrames,proto3" json:"ext_rx_ak_frames,omitempty"`
	// OMCI extended Tx frames with AR bit unset
	ExtTxNoArFrames uint32 `protobuf:"varint,7,opt,name=ext_tx_no_ar_frames,json=extTxNoArFrames,proto3" json:"ext_tx_no_ar_frames,omitempty"`
	// OMCI extended Rx frames with AK bit unset
	ExtRxNoAkFrames uint32 `protobuf:"varint,8,opt,name=ext_rx_no_ak_frames,json=extRxNoAkFrames,proto3" json:"ext_rx_no_ak_frames,omitempty"`
	// Number of retries of requests (tx) due to not received responses (Rx)
	TxOmciCounterRetries uint32 `protobuf:"varint,9,opt,name=tx_omci_counter_retries,json=txOmciCounterRetries,proto3" json:"tx_omci_counter_retries,omitempty"`
	// Number of timeouts of requests (tx) due to not received responses (Rx) after configured number of retries
	TxOmciCounterTimeouts uint32   `protobuf:"varint,10,opt,name=tx_omci_counter_timeouts,json=txOmciCounterTimeouts,proto3" json:"tx_omci_counter_timeouts,omitempty"`
	XXX_NoUnkeyedLiteral  struct{} `json:"-"`
	XXX_unrecognized      []byte   `json:"-"`
	XXX_sizecache         int32    `json:"-"`
}

func (m *GetOnuOmciTxRxStatsResponse) Reset()         { *m = GetOnuOmciTxRxStatsResponse{} }
func (m *GetOnuOmciTxRxStatsResponse) String() string { return proto.CompactTextString(m) }
func (*GetOnuOmciTxRxStatsResponse) ProtoMessage()    {}
func (*GetOnuOmciTxRxStatsResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{41}
}

func (m *GetOnuOmciTxRxStatsResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuOmciTxRxStatsResponse.Unmarshal(m, b)
}
func (m *GetOnuOmciTxRxStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuOmciTxRxStatsResponse.Marshal(b, m, deterministic)
}
func (m *GetOnuOmciTxRxStatsResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuOmciTxRxStatsResponse.Merge(m, src)
}
func (m *GetOnuOmciTxRxStatsResponse) XXX_Size() int {
	return xxx_messageInfo_GetOnuOmciTxRxStatsResponse.Size(m)
}
func (m *GetOnuOmciTxRxStatsResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuOmciTxRxStatsResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuOmciTxRxStatsResponse proto.InternalMessageInfo

func (m *GetOnuOmciTxRxStatsResponse) GetBaseTxArFrames() uint32 {
	if m != nil {
		return m.BaseTxArFrames
	}
	return 0
}

func (m *GetOnuOmciTxRxStatsResponse) GetBaseRxAkFrames() uint32 {
	if m != nil {
		return m.BaseRxAkFrames
	}
	return 0
}

func (m *GetOnuOmciTxRxStatsResponse) GetBaseTxNoArFrames() uint32 {
	if m != nil {
		return m.BaseTxNoArFrames
	}
	return 0
}

func (m *GetOnuOmciTxRxStatsResponse) GetBaseRxNoAkFrames() uint32 {
	if m != nil {
		return m.BaseRxNoAkFrames
	}
	return 0
}

func (m *GetOnuOmciTxRxStatsResponse) GetExtTxArFrames() uint32 {
	if m != nil {
		return m.ExtTxArFrames
	}
	return 0
}

func (m *GetOnuOmciTxRxStatsResponse) GetExtRxAkFrames() uint32 {
	if m != nil {
		return m.ExtRxAkFrames
	}
	return 0
}

func (m *GetOnuOmciTxRxStatsResponse) GetExtTxNoArFrames() uint32 {
	if m != nil {
		return m.ExtTxNoArFrames
	}
	return 0
}

func (m *GetOnuOmciTxRxStatsResponse) GetExtRxNoAkFrames() uint32 {
	if m != nil {
		return m.ExtRxNoAkFrames
	}
	return 0
}

func (m *GetOnuOmciTxRxStatsResponse) GetTxOmciCounterRetries() uint32 {
	if m != nil {
		return m.TxOmciCounterRetries
	}
	return 0
}

func (m *GetOnuOmciTxRxStatsResponse) GetTxOmciCounterTimeouts() uint32 {
	if m != nil {
		return m.TxOmciCounterTimeouts
	}
	return 0
}

type GetOnuOmciActiveAlarmsRequest struct {
	Empty                *empty.Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (m *GetOnuOmciActiveAlarmsRequest) Reset()         { *m = GetOnuOmciActiveAlarmsRequest{} }
func (m *GetOnuOmciActiveAlarmsRequest) String() string { return proto.CompactTextString(m) }
func (*GetOnuOmciActiveAlarmsRequest) ProtoMessage()    {}
func (*GetOnuOmciActiveAlarmsRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{42}
}

func (m *GetOnuOmciActiveAlarmsRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuOmciActiveAlarmsRequest.Unmarshal(m, b)
}
func (m *GetOnuOmciActiveAlarmsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuOmciActiveAlarmsRequest.Marshal(b, m, deterministic)
}
func (m *GetOnuOmciActiveAlarmsRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuOmciActiveAlarmsRequest.Merge(m, src)
}
func (m *GetOnuOmciActiveAlarmsRequest) XXX_Size() int {
	return xxx_messageInfo_GetOnuOmciActiveAlarmsRequest.Size(m)
}
func (m *GetOnuOmciActiveAlarmsRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuOmciActiveAlarmsRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuOmciActiveAlarmsRequest proto.InternalMessageInfo

func (m *GetOnuOmciActiveAlarmsRequest) GetEmpty() *empty.Empty {
	if m != nil {
		return m.Empty
	}
	return nil
}

type AlarmData struct {
	ClassId              uint32   `protobuf:"varint,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"`
	InstanceId           uint32   `protobuf:"varint,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
	Name                 string   `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Description          string   `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *AlarmData) Reset()         { *m = AlarmData{} }
func (m *AlarmData) String() string { return proto.CompactTextString(m) }
func (*AlarmData) ProtoMessage()    {}
func (*AlarmData) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{43}
}

func (m *AlarmData) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AlarmData.Unmarshal(m, b)
}
func (m *AlarmData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AlarmData.Marshal(b, m, deterministic)
}
func (m *AlarmData) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AlarmData.Merge(m, src)
}
func (m *AlarmData) XXX_Size() int {
	return xxx_messageInfo_AlarmData.Size(m)
}
func (m *AlarmData) XXX_DiscardUnknown() {
	xxx_messageInfo_AlarmData.DiscardUnknown(m)
}

var xxx_messageInfo_AlarmData proto.InternalMessageInfo

func (m *AlarmData) GetClassId() uint32 {
	if m != nil {
		return m.ClassId
	}
	return 0
}

func (m *AlarmData) GetInstanceId() uint32 {
	if m != nil {
		return m.InstanceId
	}
	return 0
}

func (m *AlarmData) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *AlarmData) GetDescription() string {
	if m != nil {
		return m.Description
	}
	return ""
}

type GetOnuOmciActiveAlarmsResponse struct {
	ActiveAlarms         []*AlarmData `protobuf:"bytes,1,rep,name=active_alarms,json=activeAlarms,proto3" json:"active_alarms,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (m *GetOnuOmciActiveAlarmsResponse) Reset()         { *m = GetOnuOmciActiveAlarmsResponse{} }
func (m *GetOnuOmciActiveAlarmsResponse) String() string { return proto.CompactTextString(m) }
func (*GetOnuOmciActiveAlarmsResponse) ProtoMessage()    {}
func (*GetOnuOmciActiveAlarmsResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{44}
}

func (m *GetOnuOmciActiveAlarmsResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOnuOmciActiveAlarmsResponse.Unmarshal(m, b)
}
func (m *GetOnuOmciActiveAlarmsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOnuOmciActiveAlarmsResponse.Marshal(b, m, deterministic)
}
func (m *GetOnuOmciActiveAlarmsResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOnuOmciActiveAlarmsResponse.Merge(m, src)
}
func (m *GetOnuOmciActiveAlarmsResponse) XXX_Size() int {
	return xxx_messageInfo_GetOnuOmciActiveAlarmsResponse.Size(m)
}
func (m *GetOnuOmciActiveAlarmsResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOnuOmciActiveAlarmsResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOnuOmciActiveAlarmsResponse proto.InternalMessageInfo

func (m *GetOnuOmciActiveAlarmsResponse) GetActiveAlarms() []*AlarmData {
	if m != nil {
		return m.ActiveAlarms
	}
	return nil
}

type GetOffloadedAppsStatisticsRequest struct {
	// The offloaded application whose statistics are requested
	StatsFor             GetOffloadedAppsStatisticsRequest_OffloadedApp `protobuf:"varint,1,opt,name=statsFor,proto3,enum=extension.GetOffloadedAppsStatisticsRequest_OffloadedApp" json:"statsFor,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                       `json:"-"`
	XXX_unrecognized     []byte                                         `json:"-"`
	XXX_sizecache        int32                                          `json:"-"`
}

func (m *GetOffloadedAppsStatisticsRequest) Reset()         { *m = GetOffloadedAppsStatisticsRequest{} }
func (m *GetOffloadedAppsStatisticsRequest) String() string { return proto.CompactTextString(m) }
func (*GetOffloadedAppsStatisticsRequest) ProtoMessage()    {}
func (*GetOffloadedAppsStatisticsRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{45}
}

func (m *GetOffloadedAppsStatisticsRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOffloadedAppsStatisticsRequest.Unmarshal(m, b)
}
func (m *GetOffloadedAppsStatisticsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOffloadedAppsStatisticsRequest.Marshal(b, m, deterministic)
}
func (m *GetOffloadedAppsStatisticsRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOffloadedAppsStatisticsRequest.Merge(m, src)
}
func (m *GetOffloadedAppsStatisticsRequest) XXX_Size() int {
	return xxx_messageInfo_GetOffloadedAppsStatisticsRequest.Size(m)
}
func (m *GetOffloadedAppsStatisticsRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOffloadedAppsStatisticsRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetOffloadedAppsStatisticsRequest proto.InternalMessageInfo

func (m *GetOffloadedAppsStatisticsRequest) GetStatsFor() GetOffloadedAppsStatisticsRequest_OffloadedApp {
	if m != nil {
		return m.StatsFor
	}
	return GetOffloadedAppsStatisticsRequest_UNDEFINED
}

type GetOffloadedAppsStatisticsResponse struct {
	// Types that are valid to be assigned to Stats:
	//	*GetOffloadedAppsStatisticsResponse_Dhcpv4RaStats
	//	*GetOffloadedAppsStatisticsResponse_Dhcpv6RaStats
	//	*GetOffloadedAppsStatisticsResponse_PppoeIaStats
	Stats                isGetOffloadedAppsStatisticsResponse_Stats `protobuf_oneof:"stats"`
	XXX_NoUnkeyedLiteral struct{}                                   `json:"-"`
	XXX_unrecognized     []byte                                     `json:"-"`
	XXX_sizecache        int32                                      `json:"-"`
}

func (m *GetOffloadedAppsStatisticsResponse) Reset()         { *m = GetOffloadedAppsStatisticsResponse{} }
func (m *GetOffloadedAppsStatisticsResponse) String() string { return proto.CompactTextString(m) }
func (*GetOffloadedAppsStatisticsResponse) ProtoMessage()    {}
func (*GetOffloadedAppsStatisticsResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{46}
}

func (m *GetOffloadedAppsStatisticsResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse.Unmarshal(m, b)
}
func (m *GetOffloadedAppsStatisticsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse.Marshal(b, m, deterministic)
}
func (m *GetOffloadedAppsStatisticsResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOffloadedAppsStatisticsResponse.Merge(m, src)
}
func (m *GetOffloadedAppsStatisticsResponse) XXX_Size() int {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse.Size(m)
}
func (m *GetOffloadedAppsStatisticsResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOffloadedAppsStatisticsResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetOffloadedAppsStatisticsResponse proto.InternalMessageInfo

type isGetOffloadedAppsStatisticsResponse_Stats interface {
	isGetOffloadedAppsStatisticsResponse_Stats()
}

type GetOffloadedAppsStatisticsResponse_Dhcpv4RaStats struct {
	Dhcpv4RaStats *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats `protobuf:"bytes,1,opt,name=dhcpv4RaStats,proto3,oneof"`
}

type GetOffloadedAppsStatisticsResponse_Dhcpv6RaStats struct {
	Dhcpv6RaStats *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats `protobuf:"bytes,2,opt,name=dhcpv6RaStats,proto3,oneof"`
}

type GetOffloadedAppsStatisticsResponse_PppoeIaStats struct {
	PppoeIaStats *GetOffloadedAppsStatisticsResponse_PPPoeIAStats `protobuf:"bytes,3,opt,name=pppoeIaStats,proto3,oneof"`
}

func (*GetOffloadedAppsStatisticsResponse_Dhcpv4RaStats) isGetOffloadedAppsStatisticsResponse_Stats() {
}

func (*GetOffloadedAppsStatisticsResponse_Dhcpv6RaStats) isGetOffloadedAppsStatisticsResponse_Stats() {
}

func (*GetOffloadedAppsStatisticsResponse_PppoeIaStats) isGetOffloadedAppsStatisticsResponse_Stats() {
}

func (m *GetOffloadedAppsStatisticsResponse) GetStats() isGetOffloadedAppsStatisticsResponse_Stats {
	if m != nil {
		return m.Stats
	}
	return nil
}

func (m *GetOffloadedAppsStatisticsResponse) GetDhcpv4RaStats() *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats {
	if x, ok := m.GetStats().(*GetOffloadedAppsStatisticsResponse_Dhcpv4RaStats); ok {
		return x.Dhcpv4RaStats
	}
	return nil
}

func (m *GetOffloadedAppsStatisticsResponse) GetDhcpv6RaStats() *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats {
	if x, ok := m.GetStats().(*GetOffloadedAppsStatisticsResponse_Dhcpv6RaStats); ok {
		return x.Dhcpv6RaStats
	}
	return nil
}

func (m *GetOffloadedAppsStatisticsResponse) GetPppoeIaStats() *GetOffloadedAppsStatisticsResponse_PPPoeIAStats {
	if x, ok := m.GetStats().(*GetOffloadedAppsStatisticsResponse_PppoeIaStats); ok {
		return x.PppoeIaStats
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*GetOffloadedAppsStatisticsResponse) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*GetOffloadedAppsStatisticsResponse_Dhcpv4RaStats)(nil),
		(*GetOffloadedAppsStatisticsResponse_Dhcpv6RaStats)(nil),
		(*GetOffloadedAppsStatisticsResponse_PppoeIaStats)(nil),
	}
}

type GetOffloadedAppsStatisticsResponse_DHCPv4RAStats struct {
	// From https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-l2-dhcpv4-relay.yang
	InBadPacketsFromClient           uint32 `protobuf:"varint,1,opt,name=in_bad_packets_from_client,json=inBadPacketsFromClient,proto3" json:"in_bad_packets_from_client,omitempty"`
	InBadPacketsFromServer           uint32 `protobuf:"varint,2,opt,name=in_bad_packets_from_server,json=inBadPacketsFromServer,proto3" json:"in_bad_packets_from_server,omitempty"`
	InPacketsFromClient              uint32 `protobuf:"varint,3,opt,name=in_packets_from_client,json=inPacketsFromClient,proto3" json:"in_packets_from_client,omitempty"`
	InPacketsFromServer              uint32 `protobuf:"varint,4,opt,name=in_packets_from_server,json=inPacketsFromServer,proto3" json:"in_packets_from_server,omitempty"`
	OutPacketsToServer               uint32 `protobuf:"varint,5,opt,name=out_packets_to_server,json=outPacketsToServer,proto3" json:"out_packets_to_server,omitempty"`
	OutPacketsToClient               uint32 `protobuf:"varint,6,opt,name=out_packets_to_client,json=outPacketsToClient,proto3" json:"out_packets_to_client,omitempty"`
	Option_82InsertedPacketsToServer uint32 `protobuf:"varint,7,opt,name=option_82_inserted_packets_to_server,json=option82InsertedPacketsToServer,proto3" json:"option_82_inserted_packets_to_server,omitempty"`
	Option_82RemovedPacketsToClient  uint32 `protobuf:"varint,8,opt,name=option_82_removed_packets_to_client,json=option82RemovedPacketsToClient,proto3" json:"option_82_removed_packets_to_client,omitempty"`
	Option_82NotInsertedToServer     uint32 `protobuf:"varint,9,opt,name=option_82_not_inserted_to_server,json=option82NotInsertedToServer,proto3" json:"option_82_not_inserted_to_server,omitempty"`
	// Name value pairs that gives the flexibility to report different statistics that implementations may choose
	AdditionalStats      map[string]string `protobuf:"bytes,10,rep,name=additional_stats,json=additionalStats,proto3" json:"additional_stats,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) Reset() {
	*m = GetOffloadedAppsStatisticsResponse_DHCPv4RAStats{}
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) String() string {
	return proto.CompactTextString(m)
}
func (*GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) ProtoMessage() {}
func (*GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{46, 0}
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv4RAStats.Unmarshal(m, b)
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv4RAStats.Marshal(b, m, deterministic)
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv4RAStats.Merge(m, src)
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) XXX_Size() int {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv4RAStats.Size(m)
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv4RAStats.DiscardUnknown(m)
}

var xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv4RAStats proto.InternalMessageInfo

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetInBadPacketsFromClient() uint32 {
	if m != nil {
		return m.InBadPacketsFromClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetInBadPacketsFromServer() uint32 {
	if m != nil {
		return m.InBadPacketsFromServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetInPacketsFromClient() uint32 {
	if m != nil {
		return m.InPacketsFromClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetInPacketsFromServer() uint32 {
	if m != nil {
		return m.InPacketsFromServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetOutPacketsToServer() uint32 {
	if m != nil {
		return m.OutPacketsToServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetOutPacketsToClient() uint32 {
	if m != nil {
		return m.OutPacketsToClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetOption_82InsertedPacketsToServer() uint32 {
	if m != nil {
		return m.Option_82InsertedPacketsToServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetOption_82RemovedPacketsToClient() uint32 {
	if m != nil {
		return m.Option_82RemovedPacketsToClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetOption_82NotInsertedToServer() uint32 {
	if m != nil {
		return m.Option_82NotInsertedToServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv4RAStats) GetAdditionalStats() map[string]string {
	if m != nil {
		return m.AdditionalStats
	}
	return nil
}

type GetOffloadedAppsStatisticsResponse_DHCPv6RAStats struct {
	// From https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-ldra.yang
	InBadPacketsFromClient               uint32 `protobuf:"varint,1,opt,name=in_bad_packets_from_client,json=inBadPacketsFromClient,proto3" json:"in_bad_packets_from_client,omitempty"`
	InBadPacketsFromServer               uint32 `protobuf:"varint,2,opt,name=in_bad_packets_from_server,json=inBadPacketsFromServer,proto3" json:"in_bad_packets_from_server,omitempty"`
	Option_17InsertedPacketsToServer     uint32 `protobuf:"varint,3,opt,name=option_17_inserted_packets_to_server,json=option17InsertedPacketsToServer,proto3" json:"option_17_inserted_packets_to_server,omitempty"`
	Option_17RemovedPacketsToClient      uint32 `protobuf:"varint,4,opt,name=option_17_removed_packets_to_client,json=option17RemovedPacketsToClient,proto3" json:"option_17_removed_packets_to_client,omitempty"`
	Option_18InsertedPacketsToServer     uint32 `protobuf:"varint,5,opt,name=option_18_inserted_packets_to_server,json=option18InsertedPacketsToServer,proto3" json:"option_18_inserted_packets_to_server,omitempty"`
	Option_18RemovedPacketsToClient      uint32 `protobuf:"varint,6,opt,name=option_18_removed_packets_to_client,json=option18RemovedPacketsToClient,proto3" json:"option_18_removed_packets_to_client,omitempty"`
	Option_37InsertedPacketsToServer     uint32 `protobuf:"varint,7,opt,name=option_37_inserted_packets_to_server,json=option37InsertedPacketsToServer,proto3" json:"option_37_inserted_packets_to_server,omitempty"`
	Option_37RemovedPacketsToClient      uint32 `protobuf:"varint,8,opt,name=option_37_removed_packets_to_client,json=option37RemovedPacketsToClient,proto3" json:"option_37_removed_packets_to_client,omitempty"`
	OutgoingMtuExceededPacketsFromClient uint32 `protobuf:"varint,9,opt,name=outgoing_mtu_exceeded_packets_from_client,json=outgoingMtuExceededPacketsFromClient,proto3" json:"outgoing_mtu_exceeded_packets_from_client,omitempty"`
	// Name value pairs that gives the flexibility to report different statistics that implementations may choose
	AdditionalStats      map[string]string `protobuf:"bytes,10,rep,name=additional_stats,json=additionalStats,proto3" json:"additional_stats,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) Reset() {
	*m = GetOffloadedAppsStatisticsResponse_DHCPv6RAStats{}
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) String() string {
	return proto.CompactTextString(m)
}
func (*GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) ProtoMessage() {}
func (*GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{46, 1}
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv6RAStats.Unmarshal(m, b)
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv6RAStats.Marshal(b, m, deterministic)
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv6RAStats.Merge(m, src)
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) XXX_Size() int {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv6RAStats.Size(m)
}
func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv6RAStats.DiscardUnknown(m)
}

var xxx_messageInfo_GetOffloadedAppsStatisticsResponse_DHCPv6RAStats proto.InternalMessageInfo

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetInBadPacketsFromClient() uint32 {
	if m != nil {
		return m.InBadPacketsFromClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetInBadPacketsFromServer() uint32 {
	if m != nil {
		return m.InBadPacketsFromServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetOption_17InsertedPacketsToServer() uint32 {
	if m != nil {
		return m.Option_17InsertedPacketsToServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetOption_17RemovedPacketsToClient() uint32 {
	if m != nil {
		return m.Option_17RemovedPacketsToClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetOption_18InsertedPacketsToServer() uint32 {
	if m != nil {
		return m.Option_18InsertedPacketsToServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetOption_18RemovedPacketsToClient() uint32 {
	if m != nil {
		return m.Option_18RemovedPacketsToClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetOption_37InsertedPacketsToServer() uint32 {
	if m != nil {
		return m.Option_37InsertedPacketsToServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetOption_37RemovedPacketsToClient() uint32 {
	if m != nil {
		return m.Option_37RemovedPacketsToClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetOutgoingMtuExceededPacketsFromClient() uint32 {
	if m != nil {
		return m.OutgoingMtuExceededPacketsFromClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_DHCPv6RAStats) GetAdditionalStats() map[string]string {
	if m != nil {
		return m.AdditionalStats
	}
	return nil
}

type GetOffloadedAppsStatisticsResponse_PPPoeIAStats struct {
	// From https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-pppoe-intermediate-agent.yang
	InErrorPacketsFromClient                 uint32 `protobuf:"varint,1,opt,name=in_error_packets_from_client,json=inErrorPacketsFromClient,proto3" json:"in_error_packets_from_client,omitempty"`
	InErrorPacketsFromServer                 uint32 `protobuf:"varint,2,opt,name=in_error_packets_from_server,json=inErrorPacketsFromServer,proto3" json:"in_error_packets_from_server,omitempty"`
	InPacketsFromClient                      uint32 `protobuf:"varint,3,opt,name=in_packets_from_client,json=inPacketsFromClient,proto3" json:"in_packets_from_client,omitempty"`
	InPacketsFromServer                      uint32 `protobuf:"varint,4,opt,name=in_packets_from_server,json=inPacketsFromServer,proto3" json:"in_packets_from_server,omitempty"`
	OutPacketsToServer                       uint32 `protobuf:"varint,5,opt,name=out_packets_to_server,json=outPacketsToServer,proto3" json:"out_packets_to_server,omitempty"`
	OutPacketsToClient                       uint32 `protobuf:"varint,6,opt,name=out_packets_to_client,json=outPacketsToClient,proto3" json:"out_packets_to_client,omitempty"`
	VendorSpecificTagInsertedPacketsToServer uint32 `protobuf:"varint,7,opt,name=vendor_specific_tag_inserted_packets_to_server,json=vendorSpecificTagInsertedPacketsToServer,proto3" json:"vendor_specific_tag_inserted_packets_to_server,omitempty"`
	VendorSpecificTagRemovedPacketsToClient  uint32 `protobuf:"varint,8,opt,name=vendor_specific_tag_removed_packets_to_client,json=vendorSpecificTagRemovedPacketsToClient,proto3" json:"vendor_specific_tag_removed_packets_to_client,omitempty"`
	OutgoingMtuExceededPacketsFromClient     uint32 `protobuf:"varint,9,opt,name=outgoing_mtu_exceeded_packets_from_client,json=outgoingMtuExceededPacketsFromClient,proto3" json:"outgoing_mtu_exceeded_packets_from_client,omitempty"`
	// Name value pairs that gives the flexibility to report different statistics that implementations may choose
	AdditionalStats      map[string]string `protobuf:"bytes,10,rep,name=additional_stats,json=additionalStats,proto3" json:"additional_stats,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) Reset() {
	*m = GetOffloadedAppsStatisticsResponse_PPPoeIAStats{}
}
func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) String() string {
	return proto.CompactTextString(m)
}
func (*GetOffloadedAppsStatisticsResponse_PPPoeIAStats) ProtoMessage() {}
func (*GetOffloadedAppsStatisticsResponse_PPPoeIAStats) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{46, 2}
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse_PPPoeIAStats.Unmarshal(m, b)
}
func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse_PPPoeIAStats.Marshal(b, m, deterministic)
}
func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetOffloadedAppsStatisticsResponse_PPPoeIAStats.Merge(m, src)
}
func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) XXX_Size() int {
	return xxx_messageInfo_GetOffloadedAppsStatisticsResponse_PPPoeIAStats.Size(m)
}
func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) XXX_DiscardUnknown() {
	xxx_messageInfo_GetOffloadedAppsStatisticsResponse_PPPoeIAStats.DiscardUnknown(m)
}

var xxx_messageInfo_GetOffloadedAppsStatisticsResponse_PPPoeIAStats proto.InternalMessageInfo

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetInErrorPacketsFromClient() uint32 {
	if m != nil {
		return m.InErrorPacketsFromClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetInErrorPacketsFromServer() uint32 {
	if m != nil {
		return m.InErrorPacketsFromServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetInPacketsFromClient() uint32 {
	if m != nil {
		return m.InPacketsFromClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetInPacketsFromServer() uint32 {
	if m != nil {
		return m.InPacketsFromServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetOutPacketsToServer() uint32 {
	if m != nil {
		return m.OutPacketsToServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetOutPacketsToClient() uint32 {
	if m != nil {
		return m.OutPacketsToClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetVendorSpecificTagInsertedPacketsToServer() uint32 {
	if m != nil {
		return m.VendorSpecificTagInsertedPacketsToServer
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetVendorSpecificTagRemovedPacketsToClient() uint32 {
	if m != nil {
		return m.VendorSpecificTagRemovedPacketsToClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetOutgoingMtuExceededPacketsFromClient() uint32 {
	if m != nil {
		return m.OutgoingMtuExceededPacketsFromClient
	}
	return 0
}

func (m *GetOffloadedAppsStatisticsResponse_PPPoeIAStats) GetAdditionalStats() map[string]string {
	if m != nil {
		return m.AdditionalStats
	}
	return nil
}

type GetValueRequest struct {
	// Types that are valid to be assigned to Request:
	//	*GetValueRequest_Distance
	//	*GetValueRequest_UniInfo
	//	*GetValueRequest_OltPortInfo
	//	*GetValueRequest_OnuOpticalInfo
	//	*GetValueRequest_EthBridgePort
	//	*GetValueRequest_FecHistory
	//	*GetValueRequest_OnuPonInfo
	//	*GetValueRequest_OnuInfo
	//	*GetValueRequest_RxPower
	//	*GetValueRequest_OnuOmciStats
	//	*GetValueRequest_OltRxPower
	//	*GetValueRequest_OnuActiveAlarms
	//	*GetValueRequest_OffloadedAppsStats
	//	*GetValueRequest_OnuAllocGemStats
	//	*GetValueRequest_OnuStatsFromOlt
	//	*GetValueRequest_OltPonStats
	//	*GetValueRequest_OltNniStats
	Request              isGetValueRequest_Request `protobuf_oneof:"request"`
	XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
	XXX_unrecognized     []byte                    `json:"-"`
	XXX_sizecache        int32                     `json:"-"`
}

func (m *GetValueRequest) Reset()         { *m = GetValueRequest{} }
func (m *GetValueRequest) String() string { return proto.CompactTextString(m) }
func (*GetValueRequest) ProtoMessage()    {}
func (*GetValueRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{47}
}

func (m *GetValueRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetValueRequest.Unmarshal(m, b)
}
func (m *GetValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetValueRequest.Marshal(b, m, deterministic)
}
func (m *GetValueRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetValueRequest.Merge(m, src)
}
func (m *GetValueRequest) XXX_Size() int {
	return xxx_messageInfo_GetValueRequest.Size(m)
}
func (m *GetValueRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetValueRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetValueRequest proto.InternalMessageInfo

type isGetValueRequest_Request interface {
	isGetValueRequest_Request()
}

type GetValueRequest_Distance struct {
	Distance *GetDistanceRequest `protobuf:"bytes,1,opt,name=distance,proto3,oneof"`
}

type GetValueRequest_UniInfo struct {
	UniInfo *GetOnuUniInfoRequest `protobuf:"bytes,2,opt,name=uniInfo,proto3,oneof"`
}

type GetValueRequest_OltPortInfo struct {
	OltPortInfo *GetOltPortCounters `protobuf:"bytes,3,opt,name=oltPortInfo,proto3,oneof"`
}

type GetValueRequest_OnuOpticalInfo struct {
	OnuOpticalInfo *GetOnuPonOpticalInfo `protobuf:"bytes,4,opt,name=onuOpticalInfo,proto3,oneof"`
}

type GetValueRequest_EthBridgePort struct {
	EthBridgePort *GetOnuEthernetBridgePortHistory `protobuf:"bytes,5,opt,name=ethBridgePort,proto3,oneof"`
}

type GetValueRequest_FecHistory struct {
	FecHistory *GetOnuFecHistory `protobuf:"bytes,6,opt,name=fecHistory,proto3,oneof"`
}

type GetValueRequest_OnuPonInfo struct {
	OnuPonInfo *GetOnuCountersRequest `protobuf:"bytes,7,opt,name=onuPonInfo,proto3,oneof"`
}

type GetValueRequest_OnuInfo struct {
	OnuInfo *GetOmciEthernetFrameExtendedPmRequest `protobuf:"bytes,8,opt,name=onuInfo,proto3,oneof"`
}

type GetValueRequest_RxPower struct {
	RxPower *GetRxPowerRequest `protobuf:"bytes,9,opt,name=rxPower,proto3,oneof"`
}

type GetValueRequest_OnuOmciStats struct {
	OnuOmciStats *GetOnuOmciTxRxStatsRequest `protobuf:"bytes,10,opt,name=onuOmciStats,proto3,oneof"`
}

type GetValueRequest_OltRxPower struct {
	OltRxPower *GetOltRxPowerRequest `protobuf:"bytes,11,opt,name=oltRxPower,proto3,oneof"`
}

type GetValueRequest_OnuActiveAlarms struct {
	OnuActiveAlarms *GetOnuOmciActiveAlarmsRequest `protobuf:"bytes,12,opt,name=onuActiveAlarms,proto3,oneof"`
}

type GetValueRequest_OffloadedAppsStats struct {
	OffloadedAppsStats *GetOffloadedAppsStatisticsRequest `protobuf:"bytes,13,opt,name=offloadedAppsStats,proto3,oneof"`
}

type GetValueRequest_OnuAllocGemStats struct {
	OnuAllocGemStats *GetOnuAllocGemHistoryRequest `protobuf:"bytes,14,opt,name=onuAllocGemStats,proto3,oneof"`
}

type GetValueRequest_OnuStatsFromOlt struct {
	OnuStatsFromOlt *GetOnuStatsFromOltRequest `protobuf:"bytes,15,opt,name=onuStatsFromOlt,proto3,oneof"`
}

type GetValueRequest_OltPonStats struct {
	OltPonStats *GetPonStatsRequest `protobuf:"bytes,16,opt,name=oltPonStats,proto3,oneof"`
}

type GetValueRequest_OltNniStats struct {
	OltNniStats *GetNNIStatsRequest `protobuf:"bytes,17,opt,name=oltNniStats,proto3,oneof"`
}

func (*GetValueRequest_Distance) isGetValueRequest_Request() {}

func (*GetValueRequest_UniInfo) isGetValueRequest_Request() {}

func (*GetValueRequest_OltPortInfo) isGetValueRequest_Request() {}

func (*GetValueRequest_OnuOpticalInfo) isGetValueRequest_Request() {}

func (*GetValueRequest_EthBridgePort) isGetValueRequest_Request() {}

func (*GetValueRequest_FecHistory) isGetValueRequest_Request() {}

func (*GetValueRequest_OnuPonInfo) isGetValueRequest_Request() {}

func (*GetValueRequest_OnuInfo) isGetValueRequest_Request() {}

func (*GetValueRequest_RxPower) isGetValueRequest_Request() {}

func (*GetValueRequest_OnuOmciStats) isGetValueRequest_Request() {}

func (*GetValueRequest_OltRxPower) isGetValueRequest_Request() {}

func (*GetValueRequest_OnuActiveAlarms) isGetValueRequest_Request() {}

func (*GetValueRequest_OffloadedAppsStats) isGetValueRequest_Request() {}

func (*GetValueRequest_OnuAllocGemStats) isGetValueRequest_Request() {}

func (*GetValueRequest_OnuStatsFromOlt) isGetValueRequest_Request() {}

func (*GetValueRequest_OltPonStats) isGetValueRequest_Request() {}

func (*GetValueRequest_OltNniStats) isGetValueRequest_Request() {}

func (m *GetValueRequest) GetRequest() isGetValueRequest_Request {
	if m != nil {
		return m.Request
	}
	return nil
}

func (m *GetValueRequest) GetDistance() *GetDistanceRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_Distance); ok {
		return x.Distance
	}
	return nil
}

func (m *GetValueRequest) GetUniInfo() *GetOnuUniInfoRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_UniInfo); ok {
		return x.UniInfo
	}
	return nil
}

func (m *GetValueRequest) GetOltPortInfo() *GetOltPortCounters {
	if x, ok := m.GetRequest().(*GetValueRequest_OltPortInfo); ok {
		return x.OltPortInfo
	}
	return nil
}

func (m *GetValueRequest) GetOnuOpticalInfo() *GetOnuPonOpticalInfo {
	if x, ok := m.GetRequest().(*GetValueRequest_OnuOpticalInfo); ok {
		return x.OnuOpticalInfo
	}
	return nil
}

func (m *GetValueRequest) GetEthBridgePort() *GetOnuEthernetBridgePortHistory {
	if x, ok := m.GetRequest().(*GetValueRequest_EthBridgePort); ok {
		return x.EthBridgePort
	}
	return nil
}

func (m *GetValueRequest) GetFecHistory() *GetOnuFecHistory {
	if x, ok := m.GetRequest().(*GetValueRequest_FecHistory); ok {
		return x.FecHistory
	}
	return nil
}

func (m *GetValueRequest) GetOnuPonInfo() *GetOnuCountersRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OnuPonInfo); ok {
		return x.OnuPonInfo
	}
	return nil
}

func (m *GetValueRequest) GetOnuInfo() *GetOmciEthernetFrameExtendedPmRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OnuInfo); ok {
		return x.OnuInfo
	}
	return nil
}

func (m *GetValueRequest) GetRxPower() *GetRxPowerRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_RxPower); ok {
		return x.RxPower
	}
	return nil
}

func (m *GetValueRequest) GetOnuOmciStats() *GetOnuOmciTxRxStatsRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OnuOmciStats); ok {
		return x.OnuOmciStats
	}
	return nil
}

func (m *GetValueRequest) GetOltRxPower() *GetOltRxPowerRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OltRxPower); ok {
		return x.OltRxPower
	}
	return nil
}

func (m *GetValueRequest) GetOnuActiveAlarms() *GetOnuOmciActiveAlarmsRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OnuActiveAlarms); ok {
		return x.OnuActiveAlarms
	}
	return nil
}

func (m *GetValueRequest) GetOffloadedAppsStats() *GetOffloadedAppsStatisticsRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OffloadedAppsStats); ok {
		return x.OffloadedAppsStats
	}
	return nil
}

func (m *GetValueRequest) GetOnuAllocGemStats() *GetOnuAllocGemHistoryRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OnuAllocGemStats); ok {
		return x.OnuAllocGemStats
	}
	return nil
}

func (m *GetValueRequest) GetOnuStatsFromOlt() *GetOnuStatsFromOltRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OnuStatsFromOlt); ok {
		return x.OnuStatsFromOlt
	}
	return nil
}

func (m *GetValueRequest) GetOltPonStats() *GetPonStatsRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OltPonStats); ok {
		return x.OltPonStats
	}
	return nil
}

func (m *GetValueRequest) GetOltNniStats() *GetNNIStatsRequest {
	if x, ok := m.GetRequest().(*GetValueRequest_OltNniStats); ok {
		return x.OltNniStats
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*GetValueRequest) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*GetValueRequest_Distance)(nil),
		(*GetValueRequest_UniInfo)(nil),
		(*GetValueRequest_OltPortInfo)(nil),
		(*GetValueRequest_OnuOpticalInfo)(nil),
		(*GetValueRequest_EthBridgePort)(nil),
		(*GetValueRequest_FecHistory)(nil),
		(*GetValueRequest_OnuPonInfo)(nil),
		(*GetValueRequest_OnuInfo)(nil),
		(*GetValueRequest_RxPower)(nil),
		(*GetValueRequest_OnuOmciStats)(nil),
		(*GetValueRequest_OltRxPower)(nil),
		(*GetValueRequest_OnuActiveAlarms)(nil),
		(*GetValueRequest_OffloadedAppsStats)(nil),
		(*GetValueRequest_OnuAllocGemStats)(nil),
		(*GetValueRequest_OnuStatsFromOlt)(nil),
		(*GetValueRequest_OltPonStats)(nil),
		(*GetValueRequest_OltNniStats)(nil),
	}
}

type GetValueResponse struct {
	Status    GetValueResponse_Status      `protobuf:"varint,1,opt,name=status,proto3,enum=extension.GetValueResponse_Status" json:"status,omitempty"`
	ErrReason GetValueResponse_ErrorReason `protobuf:"varint,2,opt,name=errReason,proto3,enum=extension.GetValueResponse_ErrorReason" json:"errReason,omitempty"`
	// Types that are valid to be assigned to Response:
	//	*GetValueResponse_Distance
	//	*GetValueResponse_UniInfo
	//	*GetValueResponse_PortCoutners
	//	*GetValueResponse_OnuOpticalInfo
	//	*GetValueResponse_EthBridgePortInfo
	//	*GetValueResponse_FecHistory
	//	*GetValueResponse_OnuPonCounters
	//	*GetValueResponse_OnuCounters
	//	*GetValueResponse_RxPower
	//	*GetValueResponse_OnuOmciStats
	//	*GetValueResponse_OltRxPower
	//	*GetValueResponse_OnuActiveAlarms
	//	*GetValueResponse_OffloadedAppsStats
	//	*GetValueResponse_OnuAllocGemStatsResponse
	//	*GetValueResponse_OnuStatsFromOltResponse
	//	*GetValueResponse_OltPonStatsResponse
	//	*GetValueResponse_OltNniStatsResponse
	Response             isGetValueResponse_Response `protobuf_oneof:"response"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

func (m *GetValueResponse) Reset()         { *m = GetValueResponse{} }
func (m *GetValueResponse) String() string { return proto.CompactTextString(m) }
func (*GetValueResponse) ProtoMessage()    {}
func (*GetValueResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{48}
}

func (m *GetValueResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetValueResponse.Unmarshal(m, b)
}
func (m *GetValueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetValueResponse.Marshal(b, m, deterministic)
}
func (m *GetValueResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetValueResponse.Merge(m, src)
}
func (m *GetValueResponse) XXX_Size() int {
	return xxx_messageInfo_GetValueResponse.Size(m)
}
func (m *GetValueResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GetValueResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GetValueResponse proto.InternalMessageInfo

func (m *GetValueResponse) GetStatus() GetValueResponse_Status {
	if m != nil {
		return m.Status
	}
	return GetValueResponse_STATUS_UNDEFINED
}

func (m *GetValueResponse) GetErrReason() GetValueResponse_ErrorReason {
	if m != nil {
		return m.ErrReason
	}
	return GetValueResponse_REASON_UNDEFINED
}

type isGetValueResponse_Response interface {
	isGetValueResponse_Response()
}

type GetValueResponse_Distance struct {
	Distance *GetDistanceResponse `protobuf:"bytes,3,opt,name=distance,proto3,oneof"`
}

type GetValueResponse_UniInfo struct {
	UniInfo *GetOnuUniInfoResponse `protobuf:"bytes,4,opt,name=uniInfo,proto3,oneof"`
}

type GetValueResponse_PortCoutners struct {
	PortCoutners *GetOltPortCountersResponse `protobuf:"bytes,5,opt,name=portCoutners,proto3,oneof"`
}

type GetValueResponse_OnuOpticalInfo struct {
	OnuOpticalInfo *GetOnuPonOpticalInfoResponse `protobuf:"bytes,6,opt,name=onuOpticalInfo,proto3,oneof"`
}

type GetValueResponse_EthBridgePortInfo struct {
	EthBridgePortInfo *GetOnuEthernetBridgePortHistoryResponse `protobuf:"bytes,7,opt,name=ethBridgePortInfo,proto3,oneof"`
}

type GetValueResponse_FecHistory struct {
	FecHistory *GetOnuFecHistoryResponse `protobuf:"bytes,8,opt,name=fecHistory,proto3,oneof"`
}

type GetValueResponse_OnuPonCounters struct {
	OnuPonCounters *GetOnuCountersResponse `protobuf:"bytes,9,opt,name=onuPonCounters,proto3,oneof"`
}

type GetValueResponse_OnuCounters struct {
	OnuCounters *GetOmciEthernetFrameExtendedPmResponse `protobuf:"bytes,10,opt,name=onuCounters,proto3,oneof"`
}

type GetValueResponse_RxPower struct {
	RxPower *GetRxPowerResponse `protobuf:"bytes,11,opt,name=rxPower,proto3,oneof"`
}

type GetValueResponse_OnuOmciStats struct {
	OnuOmciStats *GetOnuOmciTxRxStatsResponse `protobuf:"bytes,12,opt,name=onuOmciStats,proto3,oneof"`
}

type GetValueResponse_OltRxPower struct {
	OltRxPower *GetOltRxPowerResponse `protobuf:"bytes,13,opt,name=oltRxPower,proto3,oneof"`
}

type GetValueResponse_OnuActiveAlarms struct {
	OnuActiveAlarms *GetOnuOmciActiveAlarmsResponse `protobuf:"bytes,14,opt,name=onuActiveAlarms,proto3,oneof"`
}

type GetValueResponse_OffloadedAppsStats struct {
	OffloadedAppsStats *GetOffloadedAppsStatisticsResponse `protobuf:"bytes,15,opt,name=offloadedAppsStats,proto3,oneof"`
}

type GetValueResponse_OnuAllocGemStatsResponse struct {
	OnuAllocGemStatsResponse *GetOnuAllocGemHistoryResponse `protobuf:"bytes,16,opt,name=onuAllocGemStatsResponse,proto3,oneof"`
}

type GetValueResponse_OnuStatsFromOltResponse struct {
	OnuStatsFromOltResponse *GetOnuStatsFromOltResponse `protobuf:"bytes,17,opt,name=onuStatsFromOltResponse,proto3,oneof"`
}

type GetValueResponse_OltPonStatsResponse struct {
	OltPonStatsResponse *GetPonStatsResponse `protobuf:"bytes,18,opt,name=oltPonStatsResponse,proto3,oneof"`
}

type GetValueResponse_OltNniStatsResponse struct {
	OltNniStatsResponse *GetNNIStatsResponse `protobuf:"bytes,19,opt,name=oltNniStatsResponse,proto3,oneof"`
}

func (*GetValueResponse_Distance) isGetValueResponse_Response() {}

func (*GetValueResponse_UniInfo) isGetValueResponse_Response() {}

func (*GetValueResponse_PortCoutners) isGetValueResponse_Response() {}

func (*GetValueResponse_OnuOpticalInfo) isGetValueResponse_Response() {}

func (*GetValueResponse_EthBridgePortInfo) isGetValueResponse_Response() {}

func (*GetValueResponse_FecHistory) isGetValueResponse_Response() {}

func (*GetValueResponse_OnuPonCounters) isGetValueResponse_Response() {}

func (*GetValueResponse_OnuCounters) isGetValueResponse_Response() {}

func (*GetValueResponse_RxPower) isGetValueResponse_Response() {}

func (*GetValueResponse_OnuOmciStats) isGetValueResponse_Response() {}

func (*GetValueResponse_OltRxPower) isGetValueResponse_Response() {}

func (*GetValueResponse_OnuActiveAlarms) isGetValueResponse_Response() {}

func (*GetValueResponse_OffloadedAppsStats) isGetValueResponse_Response() {}

func (*GetValueResponse_OnuAllocGemStatsResponse) isGetValueResponse_Response() {}

func (*GetValueResponse_OnuStatsFromOltResponse) isGetValueResponse_Response() {}

func (*GetValueResponse_OltPonStatsResponse) isGetValueResponse_Response() {}

func (*GetValueResponse_OltNniStatsResponse) isGetValueResponse_Response() {}

func (m *GetValueResponse) GetResponse() isGetValueResponse_Response {
	if m != nil {
		return m.Response
	}
	return nil
}

func (m *GetValueResponse) GetDistance() *GetDistanceResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_Distance); ok {
		return x.Distance
	}
	return nil
}

func (m *GetValueResponse) GetUniInfo() *GetOnuUniInfoResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_UniInfo); ok {
		return x.UniInfo
	}
	return nil
}

func (m *GetValueResponse) GetPortCoutners() *GetOltPortCountersResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_PortCoutners); ok {
		return x.PortCoutners
	}
	return nil
}

func (m *GetValueResponse) GetOnuOpticalInfo() *GetOnuPonOpticalInfoResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OnuOpticalInfo); ok {
		return x.OnuOpticalInfo
	}
	return nil
}

func (m *GetValueResponse) GetEthBridgePortInfo() *GetOnuEthernetBridgePortHistoryResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_EthBridgePortInfo); ok {
		return x.EthBridgePortInfo
	}
	return nil
}

func (m *GetValueResponse) GetFecHistory() *GetOnuFecHistoryResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_FecHistory); ok {
		return x.FecHistory
	}
	return nil
}

func (m *GetValueResponse) GetOnuPonCounters() *GetOnuCountersResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OnuPonCounters); ok {
		return x.OnuPonCounters
	}
	return nil
}

func (m *GetValueResponse) GetOnuCounters() *GetOmciEthernetFrameExtendedPmResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OnuCounters); ok {
		return x.OnuCounters
	}
	return nil
}

func (m *GetValueResponse) GetRxPower() *GetRxPowerResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_RxPower); ok {
		return x.RxPower
	}
	return nil
}

func (m *GetValueResponse) GetOnuOmciStats() *GetOnuOmciTxRxStatsResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OnuOmciStats); ok {
		return x.OnuOmciStats
	}
	return nil
}

func (m *GetValueResponse) GetOltRxPower() *GetOltRxPowerResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OltRxPower); ok {
		return x.OltRxPower
	}
	return nil
}

func (m *GetValueResponse) GetOnuActiveAlarms() *GetOnuOmciActiveAlarmsResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OnuActiveAlarms); ok {
		return x.OnuActiveAlarms
	}
	return nil
}

func (m *GetValueResponse) GetOffloadedAppsStats() *GetOffloadedAppsStatisticsResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OffloadedAppsStats); ok {
		return x.OffloadedAppsStats
	}
	return nil
}

func (m *GetValueResponse) GetOnuAllocGemStatsResponse() *GetOnuAllocGemHistoryResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OnuAllocGemStatsResponse); ok {
		return x.OnuAllocGemStatsResponse
	}
	return nil
}

func (m *GetValueResponse) GetOnuStatsFromOltResponse() *GetOnuStatsFromOltResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OnuStatsFromOltResponse); ok {
		return x.OnuStatsFromOltResponse
	}
	return nil
}

func (m *GetValueResponse) GetOltPonStatsResponse() *GetPonStatsResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OltPonStatsResponse); ok {
		return x.OltPonStatsResponse
	}
	return nil
}

func (m *GetValueResponse) GetOltNniStatsResponse() *GetNNIStatsResponse {
	if x, ok := m.GetResponse().(*GetValueResponse_OltNniStatsResponse); ok {
		return x.OltNniStatsResponse
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*GetValueResponse) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*GetValueResponse_Distance)(nil),
		(*GetValueResponse_UniInfo)(nil),
		(*GetValueResponse_PortCoutners)(nil),
		(*GetValueResponse_OnuOpticalInfo)(nil),
		(*GetValueResponse_EthBridgePortInfo)(nil),
		(*GetValueResponse_FecHistory)(nil),
		(*GetValueResponse_OnuPonCounters)(nil),
		(*GetValueResponse_OnuCounters)(nil),
		(*GetValueResponse_RxPower)(nil),
		(*GetValueResponse_OnuOmciStats)(nil),
		(*GetValueResponse_OltRxPower)(nil),
		(*GetValueResponse_OnuActiveAlarms)(nil),
		(*GetValueResponse_OffloadedAppsStats)(nil),
		(*GetValueResponse_OnuAllocGemStatsResponse)(nil),
		(*GetValueResponse_OnuStatsFromOltResponse)(nil),
		(*GetValueResponse_OltPonStatsResponse)(nil),
		(*GetValueResponse_OltNniStatsResponse)(nil),
	}
}

// AppOffloadConfig is the configuration for offloading applications to the OLT and has OLT wide configuration.
type AppOffloadConfig struct {
	EnableDHCPv4RA bool `protobuf:"varint,1,opt,name=enableDHCPv4RA,proto3" json:"enableDHCPv4RA,omitempty"`
	EnableDHCPv6RA bool `protobuf:"varint,2,opt,name=enableDHCPv6RA,proto3" json:"enableDHCPv6RA,omitempty"`
	EnablePPPoEIA  bool `protobuf:"varint,3,opt,name=enablePPPoEIA,proto3" json:"enablePPPoEIA,omitempty"`
	// Follows the same as the BBF Access Node Id defined in https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-subscriber-profiles.yang
	AccessNodeID         string   `protobuf:"bytes,4,opt,name=accessNodeID,proto3" json:"accessNodeID,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *AppOffloadConfig) Reset()         { *m = AppOffloadConfig{} }
func (m *AppOffloadConfig) String() string { return proto.CompactTextString(m) }
func (*AppOffloadConfig) ProtoMessage()    {}
func (*AppOffloadConfig) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{49}
}

func (m *AppOffloadConfig) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AppOffloadConfig.Unmarshal(m, b)
}
func (m *AppOffloadConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AppOffloadConfig.Marshal(b, m, deterministic)
}
func (m *AppOffloadConfig) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AppOffloadConfig.Merge(m, src)
}
func (m *AppOffloadConfig) XXX_Size() int {
	return xxx_messageInfo_AppOffloadConfig.Size(m)
}
func (m *AppOffloadConfig) XXX_DiscardUnknown() {
	xxx_messageInfo_AppOffloadConfig.DiscardUnknown(m)
}

var xxx_messageInfo_AppOffloadConfig proto.InternalMessageInfo

func (m *AppOffloadConfig) GetEnableDHCPv4RA() bool {
	if m != nil {
		return m.EnableDHCPv4RA
	}
	return false
}

func (m *AppOffloadConfig) GetEnableDHCPv6RA() bool {
	if m != nil {
		return m.EnableDHCPv6RA
	}
	return false
}

func (m *AppOffloadConfig) GetEnablePPPoEIA() bool {
	if m != nil {
		return m.EnablePPPoEIA
	}
	return false
}

func (m *AppOffloadConfig) GetAccessNodeID() string {
	if m != nil {
		return m.AccessNodeID
	}
	return ""
}

// AppOffloadOnuConfig has Onu specfic configuration which the OLT runs applications which have been offloaded.
type AppOffloadOnuConfig struct {
	OnuDeviceId          string                              `protobuf:"bytes,1,opt,name=onuDeviceId,proto3" json:"onuDeviceId,omitempty"`
	PerUniInfo           []*AppOffloadOnuConfig_PerUniConfig `protobuf:"bytes,5,rep,name=perUniInfo,proto3" json:"perUniInfo,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                            `json:"-"`
	XXX_unrecognized     []byte                              `json:"-"`
	XXX_sizecache        int32                               `json:"-"`
}

func (m *AppOffloadOnuConfig) Reset()         { *m = AppOffloadOnuConfig{} }
func (m *AppOffloadOnuConfig) String() string { return proto.CompactTextString(m) }
func (*AppOffloadOnuConfig) ProtoMessage()    {}
func (*AppOffloadOnuConfig) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{50}
}

func (m *AppOffloadOnuConfig) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AppOffloadOnuConfig.Unmarshal(m, b)
}
func (m *AppOffloadOnuConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AppOffloadOnuConfig.Marshal(b, m, deterministic)
}
func (m *AppOffloadOnuConfig) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AppOffloadOnuConfig.Merge(m, src)
}
func (m *AppOffloadOnuConfig) XXX_Size() int {
	return xxx_messageInfo_AppOffloadOnuConfig.Size(m)
}
func (m *AppOffloadOnuConfig) XXX_DiscardUnknown() {
	xxx_messageInfo_AppOffloadOnuConfig.DiscardUnknown(m)
}

var xxx_messageInfo_AppOffloadOnuConfig proto.InternalMessageInfo

func (m *AppOffloadOnuConfig) GetOnuDeviceId() string {
	if m != nil {
		return m.OnuDeviceId
	}
	return ""
}

func (m *AppOffloadOnuConfig) GetPerUniInfo() []*AppOffloadOnuConfig_PerUniConfig {
	if m != nil {
		return m.PerUniInfo
	}
	return nil
}

type AppOffloadOnuConfig_PerUniConfig struct {
	// As per the BBF Agent Remote Id defined in https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-pppoe-intermediate-agent-profile-common.yang
	AgentRemoteID string `protobuf:"bytes,2,opt,name=agentRemoteID,proto3" json:"agentRemoteID,omitempty"`
	// As per the BBF Agent Circuit Id defined in https://github.com/BroadbandForum/yang/blob/master/standard/networking/bbf-pppoe-intermediate-agent-profile-common.yang
	AgentCircuitID string `protobuf:"bytes,3,opt,name=agentCircuitID,proto3" json:"agentCircuitID,omitempty"`
	// The id of the UNI on the Onu for which this configuration is relevant. The UNI ids are numbered from 0 to n depending on the number of UNI ports on the ONU.
	OnuUniId             uint32   `protobuf:"varint,4,opt,name=onuUniId,proto3" json:"onuUniId,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *AppOffloadOnuConfig_PerUniConfig) Reset()         { *m = AppOffloadOnuConfig_PerUniConfig{} }
func (m *AppOffloadOnuConfig_PerUniConfig) String() string { return proto.CompactTextString(m) }
func (*AppOffloadOnuConfig_PerUniConfig) ProtoMessage()    {}
func (*AppOffloadOnuConfig_PerUniConfig) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{50, 0}
}

func (m *AppOffloadOnuConfig_PerUniConfig) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AppOffloadOnuConfig_PerUniConfig.Unmarshal(m, b)
}
func (m *AppOffloadOnuConfig_PerUniConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AppOffloadOnuConfig_PerUniConfig.Marshal(b, m, deterministic)
}
func (m *AppOffloadOnuConfig_PerUniConfig) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AppOffloadOnuConfig_PerUniConfig.Merge(m, src)
}
func (m *AppOffloadOnuConfig_PerUniConfig) XXX_Size() int {
	return xxx_messageInfo_AppOffloadOnuConfig_PerUniConfig.Size(m)
}
func (m *AppOffloadOnuConfig_PerUniConfig) XXX_DiscardUnknown() {
	xxx_messageInfo_AppOffloadOnuConfig_PerUniConfig.DiscardUnknown(m)
}

var xxx_messageInfo_AppOffloadOnuConfig_PerUniConfig proto.InternalMessageInfo

func (m *AppOffloadOnuConfig_PerUniConfig) GetAgentRemoteID() string {
	if m != nil {
		return m.AgentRemoteID
	}
	return ""
}

func (m *AppOffloadOnuConfig_PerUniConfig) GetAgentCircuitID() string {
	if m != nil {
		return m.AgentCircuitID
	}
	return ""
}

func (m *AppOffloadOnuConfig_PerUniConfig) GetOnuUniId() uint32 {
	if m != nil {
		return m.OnuUniId
	}
	return 0
}

type SetValueRequest struct {
	// Types that are valid to be assigned to Request:
	//	*SetValueRequest_AlarmConfig
	//	*SetValueRequest_AppOffloadConfig
	//	*SetValueRequest_AppOffloadOnuConfig
	Request              isSetValueRequest_Request `protobuf_oneof:"request"`
	XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
	XXX_unrecognized     []byte                    `json:"-"`
	XXX_sizecache        int32                     `json:"-"`
}

func (m *SetValueRequest) Reset()         { *m = SetValueRequest{} }
func (m *SetValueRequest) String() string { return proto.CompactTextString(m) }
func (*SetValueRequest) ProtoMessage()    {}
func (*SetValueRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{51}
}

func (m *SetValueRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_SetValueRequest.Unmarshal(m, b)
}
func (m *SetValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_SetValueRequest.Marshal(b, m, deterministic)
}
func (m *SetValueRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SetValueRequest.Merge(m, src)
}
func (m *SetValueRequest) XXX_Size() int {
	return xxx_messageInfo_SetValueRequest.Size(m)
}
func (m *SetValueRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_SetValueRequest.DiscardUnknown(m)
}

var xxx_messageInfo_SetValueRequest proto.InternalMessageInfo

type isSetValueRequest_Request interface {
	isSetValueRequest_Request()
}

type SetValueRequest_AlarmConfig struct {
	AlarmConfig *config.AlarmConfig `protobuf:"bytes,1,opt,name=alarm_config,json=alarmConfig,proto3,oneof"`
}

type SetValueRequest_AppOffloadConfig struct {
	AppOffloadConfig *AppOffloadConfig `protobuf:"bytes,2,opt,name=app_offload_config,json=appOffloadConfig,proto3,oneof"`
}

type SetValueRequest_AppOffloadOnuConfig struct {
	AppOffloadOnuConfig *AppOffloadOnuConfig `protobuf:"bytes,3,opt,name=app_offload_onu_config,json=appOffloadOnuConfig,proto3,oneof"`
}

func (*SetValueRequest_AlarmConfig) isSetValueRequest_Request() {}

func (*SetValueRequest_AppOffloadConfig) isSetValueRequest_Request() {}

func (*SetValueRequest_AppOffloadOnuConfig) isSetValueRequest_Request() {}

func (m *SetValueRequest) GetRequest() isSetValueRequest_Request {
	if m != nil {
		return m.Request
	}
	return nil
}

func (m *SetValueRequest) GetAlarmConfig() *config.AlarmConfig {
	if x, ok := m.GetRequest().(*SetValueRequest_AlarmConfig); ok {
		return x.AlarmConfig
	}
	return nil
}

func (m *SetValueRequest) GetAppOffloadConfig() *AppOffloadConfig {
	if x, ok := m.GetRequest().(*SetValueRequest_AppOffloadConfig); ok {
		return x.AppOffloadConfig
	}
	return nil
}

func (m *SetValueRequest) GetAppOffloadOnuConfig() *AppOffloadOnuConfig {
	if x, ok := m.GetRequest().(*SetValueRequest_AppOffloadOnuConfig); ok {
		return x.AppOffloadOnuConfig
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*SetValueRequest) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*SetValueRequest_AlarmConfig)(nil),
		(*SetValueRequest_AppOffloadConfig)(nil),
		(*SetValueRequest_AppOffloadOnuConfig)(nil),
	}
}

type SetValueResponse struct {
	Status               SetValueResponse_Status      `protobuf:"varint,1,opt,name=status,proto3,enum=extension.SetValueResponse_Status" json:"status,omitempty"`
	ErrReason            SetValueResponse_ErrorReason `protobuf:"varint,2,opt,name=errReason,proto3,enum=extension.SetValueResponse_ErrorReason" json:"errReason,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                     `json:"-"`
	XXX_unrecognized     []byte                       `json:"-"`
	XXX_sizecache        int32                        `json:"-"`
}

func (m *SetValueResponse) Reset()         { *m = SetValueResponse{} }
func (m *SetValueResponse) String() string { return proto.CompactTextString(m) }
func (*SetValueResponse) ProtoMessage()    {}
func (*SetValueResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{52}
}

func (m *SetValueResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_SetValueResponse.Unmarshal(m, b)
}
func (m *SetValueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_SetValueResponse.Marshal(b, m, deterministic)
}
func (m *SetValueResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SetValueResponse.Merge(m, src)
}
func (m *SetValueResponse) XXX_Size() int {
	return xxx_messageInfo_SetValueResponse.Size(m)
}
func (m *SetValueResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_SetValueResponse.DiscardUnknown(m)
}

var xxx_messageInfo_SetValueResponse proto.InternalMessageInfo

func (m *SetValueResponse) GetStatus() SetValueResponse_Status {
	if m != nil {
		return m.Status
	}
	return SetValueResponse_STATUS_UNDEFINED
}

func (m *SetValueResponse) GetErrReason() SetValueResponse_ErrorReason {
	if m != nil {
		return m.ErrReason
	}
	return SetValueResponse_REASON_UNDEFINED
}

type SingleGetValueRequest struct {
	TargetId             string           `protobuf:"bytes,1,opt,name=targetId,proto3" json:"targetId,omitempty"`
	Request              *GetValueRequest `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (m *SingleGetValueRequest) Reset()         { *m = SingleGetValueRequest{} }
func (m *SingleGetValueRequest) String() string { return proto.CompactTextString(m) }
func (*SingleGetValueRequest) ProtoMessage()    {}
func (*SingleGetValueRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{53}
}

func (m *SingleGetValueRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_SingleGetValueRequest.Unmarshal(m, b)
}
func (m *SingleGetValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_SingleGetValueRequest.Marshal(b, m, deterministic)
}
func (m *SingleGetValueRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SingleGetValueRequest.Merge(m, src)
}
func (m *SingleGetValueRequest) XXX_Size() int {
	return xxx_messageInfo_SingleGetValueRequest.Size(m)
}
func (m *SingleGetValueRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_SingleGetValueRequest.DiscardUnknown(m)
}

var xxx_messageInfo_SingleGetValueRequest proto.InternalMessageInfo

func (m *SingleGetValueRequest) GetTargetId() string {
	if m != nil {
		return m.TargetId
	}
	return ""
}

func (m *SingleGetValueRequest) GetRequest() *GetValueRequest {
	if m != nil {
		return m.Request
	}
	return nil
}

type SingleGetValueResponse struct {
	Response             *GetValueResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *SingleGetValueResponse) Reset()         { *m = SingleGetValueResponse{} }
func (m *SingleGetValueResponse) String() string { return proto.CompactTextString(m) }
func (*SingleGetValueResponse) ProtoMessage()    {}
func (*SingleGetValueResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{54}
}

func (m *SingleGetValueResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_SingleGetValueResponse.Unmarshal(m, b)
}
func (m *SingleGetValueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_SingleGetValueResponse.Marshal(b, m, deterministic)
}
func (m *SingleGetValueResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SingleGetValueResponse.Merge(m, src)
}
func (m *SingleGetValueResponse) XXX_Size() int {
	return xxx_messageInfo_SingleGetValueResponse.Size(m)
}
func (m *SingleGetValueResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_SingleGetValueResponse.DiscardUnknown(m)
}

var xxx_messageInfo_SingleGetValueResponse proto.InternalMessageInfo

func (m *SingleGetValueResponse) GetResponse() *GetValueResponse {
	if m != nil {
		return m.Response
	}
	return nil
}

type SingleSetValueRequest struct {
	TargetId             string           `protobuf:"bytes,1,opt,name=targetId,proto3" json:"targetId,omitempty"`
	Request              *SetValueRequest `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (m *SingleSetValueRequest) Reset()         { *m = SingleSetValueRequest{} }
func (m *SingleSetValueRequest) String() string { return proto.CompactTextString(m) }
func (*SingleSetValueRequest) ProtoMessage()    {}
func (*SingleSetValueRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{55}
}

func (m *SingleSetValueRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_SingleSetValueRequest.Unmarshal(m, b)
}
func (m *SingleSetValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_SingleSetValueRequest.Marshal(b, m, deterministic)
}
func (m *SingleSetValueRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SingleSetValueRequest.Merge(m, src)
}
func (m *SingleSetValueRequest) XXX_Size() int {
	return xxx_messageInfo_SingleSetValueRequest.Size(m)
}
func (m *SingleSetValueRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_SingleSetValueRequest.DiscardUnknown(m)
}

var xxx_messageInfo_SingleSetValueRequest proto.InternalMessageInfo

func (m *SingleSetValueRequest) GetTargetId() string {
	if m != nil {
		return m.TargetId
	}
	return ""
}

func (m *SingleSetValueRequest) GetRequest() *SetValueRequest {
	if m != nil {
		return m.Request
	}
	return nil
}

type SingleSetValueResponse struct {
	Response             *SetValueResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *SingleSetValueResponse) Reset()         { *m = SingleSetValueResponse{} }
func (m *SingleSetValueResponse) String() string { return proto.CompactTextString(m) }
func (*SingleSetValueResponse) ProtoMessage()    {}
func (*SingleSetValueResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7ecf6e9799a9202d, []int{56}
}

func (m *SingleSetValueResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_SingleSetValueResponse.Unmarshal(m, b)
}
func (m *SingleSetValueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_SingleSetValueResponse.Marshal(b, m, deterministic)
}
func (m *SingleSetValueResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SingleSetValueResponse.Merge(m, src)
}
func (m *SingleSetValueResponse) XXX_Size() int {
	return xxx_messageInfo_SingleSetValueResponse.Size(m)
}
func (m *SingleSetValueResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_SingleSetValueResponse.DiscardUnknown(m)
}

var xxx_messageInfo_SingleSetValueResponse proto.InternalMessageInfo

func (m *SingleSetValueResponse) GetResponse() *SetValueResponse {
	if m != nil {
		return m.Response
	}
	return nil
}

func init() {
	proto.RegisterEnum("extension.ValueType_Type", ValueType_Type_name, ValueType_Type_value)
	proto.RegisterEnum("extension.GetOnuUniInfoResponse_ConfigurationInd", GetOnuUniInfoResponse_ConfigurationInd_name, GetOnuUniInfoResponse_ConfigurationInd_value)
	proto.RegisterEnum("extension.GetOnuUniInfoResponse_AdministrativeState", GetOnuUniInfoResponse_AdministrativeState_name, GetOnuUniInfoResponse_AdministrativeState_value)
	proto.RegisterEnum("extension.GetOnuUniInfoResponse_OperationalState", GetOnuUniInfoResponse_OperationalState_name, GetOnuUniInfoResponse_OperationalState_value)
	proto.RegisterEnum("extension.GetOltPortCounters_PortType", GetOltPortCounters_PortType_name, GetOltPortCounters_PortType_value)
	proto.RegisterEnum("extension.GetOnuEthernetBridgePortHistory_Direction", GetOnuEthernetBridgePortHistory_Direction_name, GetOnuEthernetBridgePortHistory_Direction_value)
	proto.RegisterEnum("extension.GetOmciEthernetFrameExtendedPmResponse_Format", GetOmciEthernetFrameExtendedPmResponse_Format_name, GetOmciEthernetFrameExtendedPmResponse_Format_value)
	proto.RegisterEnum("extension.GetOffloadedAppsStatisticsRequest_OffloadedApp", GetOffloadedAppsStatisticsRequest_OffloadedApp_name, GetOffloadedAppsStatisticsRequest_OffloadedApp_value)
	proto.RegisterEnum("extension.GetValueResponse_Status", GetValueResponse_Status_name, GetValueResponse_Status_value)
	proto.RegisterEnum("extension.GetValueResponse_ErrorReason", GetValueResponse_ErrorReason_name, GetValueResponse_ErrorReason_value)
	proto.RegisterEnum("extension.SetValueResponse_Status", SetValueResponse_Status_name, SetValueResponse_Status_value)
	proto.RegisterEnum("extension.SetValueResponse_ErrorReason", SetValueResponse_ErrorReason_name, SetValueResponse_ErrorReason_value)
	proto.RegisterType((*ValueSet)(nil), "extension.ValueSet")
	proto.RegisterType((*ValueType)(nil), "extension.ValueType")
	proto.RegisterType((*ValueSpecifier)(nil), "extension.ValueSpecifier")
	proto.RegisterType((*ReturnValues)(nil), "extension.ReturnValues")
	proto.RegisterType((*GetDistanceRequest)(nil), "extension.GetDistanceRequest")
	proto.RegisterType((*GetDistanceResponse)(nil), "extension.GetDistanceResponse")
	proto.RegisterType((*GetOnuUniInfoRequest)(nil), "extension.GetOnuUniInfoRequest")
	proto.RegisterType((*GetOnuUniInfoResponse)(nil), "extension.GetOnuUniInfoResponse")
	proto.RegisterType((*GetOltPortCounters)(nil), "extension.GetOltPortCounters")
	proto.RegisterType((*GetOltPortCountersResponse)(nil), "extension.GetOltPortCountersResponse")
	proto.RegisterType((*GetOnuPonOpticalInfo)(nil), "extension.GetOnuPonOpticalInfo")
	proto.RegisterType((*GetOnuPonOpticalInfoResponse)(nil), "extension.GetOnuPonOpticalInfoResponse")
	proto.RegisterType((*GetOnuEthernetBridgePortHistory)(nil), "extension.GetOnuEthernetBridgePortHistory")
	proto.RegisterType((*GetOnuEthernetBridgePortHistoryResponse)(nil), "extension.GetOnuEthernetBridgePortHistoryResponse")
	proto.RegisterType((*GetOnuAllocGemHistoryRequest)(nil), "extension.GetOnuAllocGemHistoryRequest")
	proto.RegisterType((*OnuGemPortHistoryData)(nil), "extension.OnuGemPortHistoryData")
	proto.RegisterType((*OnuAllocHistoryData)(nil), "extension.OnuAllocHistoryData")
	proto.RegisterType((*OnuAllocGemHistoryData)(nil), "extension.OnuAllocGemHistoryData")
	proto.RegisterType((*GetOnuAllocGemHistoryResponse)(nil), "extension.GetOnuAllocGemHistoryResponse")
	proto.RegisterType((*GetOnuFecHistory)(nil), "extension.GetOnuFecHistory")
	proto.RegisterType((*GetOnuFecHistoryResponse)(nil), "extension.GetOnuFecHistoryResponse")
	proto.RegisterType((*GetOnuCountersRequest)(nil), "extension.GetOnuCountersRequest")
	proto.RegisterType((*GetOmciEthernetFrameExtendedPmRequest)(nil), "extension.GetOmciEthernetFrameExtendedPmRequest")
	proto.RegisterType((*GetRxPowerRequest)(nil), "extension.GetRxPowerRequest")
	proto.RegisterType((*GetOltRxPowerRequest)(nil), "extension.GetOltRxPowerRequest")
	proto.RegisterType((*GetPonStatsRequest)(nil), "extension.GetPonStatsRequest")
	proto.RegisterType((*GetPonStatsResponse)(nil), "extension.GetPonStatsResponse")
	proto.RegisterType((*GetNNIStatsRequest)(nil), "extension.GetNNIStatsRequest")
	proto.RegisterType((*GetNNIStatsResponse)(nil), "extension.GetNNIStatsResponse")
	proto.RegisterType((*GetOnuStatsFromOltRequest)(nil), "extension.GetOnuStatsFromOltRequest")
	proto.RegisterType((*OnuGemPortInfoFromOlt)(nil), "extension.OnuGemPortInfoFromOlt")
	proto.RegisterType((*OnuAllocIdInfoFromOlt)(nil), "extension.OnuAllocIdInfoFromOlt")
	proto.RegisterType((*OnuAllocGemStatsFromOltResponse)(nil), "extension.OnuAllocGemStatsFromOltResponse")
	proto.RegisterType((*GetOnuStatsFromOltResponse)(nil), "extension.GetOnuStatsFromOltResponse")
	proto.RegisterType((*GetOnuCountersResponse)(nil), "extension.GetOnuCountersResponse")
	proto.RegisterType((*OmciEthernetFrameExtendedPm)(nil), "extension.OmciEthernetFrameExtendedPm")
	proto.RegisterType((*GetOmciEthernetFrameExtendedPmResponse)(nil), "extension.GetOmciEthernetFrameExtendedPmResponse")
	proto.RegisterType((*RxPower)(nil), "extension.RxPower")
	proto.RegisterType((*GetOltRxPowerResponse)(nil), "extension.GetOltRxPowerResponse")
	proto.RegisterType((*GetRxPowerResponse)(nil), "extension.GetRxPowerResponse")
	proto.RegisterType((*GetOnuOmciTxRxStatsRequest)(nil), "extension.GetOnuOmciTxRxStatsRequest")
	proto.RegisterType((*GetOnuOmciTxRxStatsResponse)(nil), "extension.GetOnuOmciTxRxStatsResponse")
	proto.RegisterType((*GetOnuOmciActiveAlarmsRequest)(nil), "extension.GetOnuOmciActiveAlarmsRequest")
	proto.RegisterType((*AlarmData)(nil), "extension.AlarmData")
	proto.RegisterType((*GetOnuOmciActiveAlarmsResponse)(nil), "extension.GetOnuOmciActiveAlarmsResponse")
	proto.RegisterType((*GetOffloadedAppsStatisticsRequest)(nil), "extension.GetOffloadedAppsStatisticsRequest")
	proto.RegisterType((*GetOffloadedAppsStatisticsResponse)(nil), "extension.GetOffloadedAppsStatisticsResponse")
	proto.RegisterType((*GetOffloadedAppsStatisticsResponse_DHCPv4RAStats)(nil), "extension.GetOffloadedAppsStatisticsResponse.DHCPv4RAStats")
	proto.RegisterMapType((map[string]string)(nil), "extension.GetOffloadedAppsStatisticsResponse.DHCPv4RAStats.AdditionalStatsEntry")
	proto.RegisterType((*GetOffloadedAppsStatisticsResponse_DHCPv6RAStats)(nil), "extension.GetOffloadedAppsStatisticsResponse.DHCPv6RAStats")
	proto.RegisterMapType((map[string]string)(nil), "extension.GetOffloadedAppsStatisticsResponse.DHCPv6RAStats.AdditionalStatsEntry")
	proto.RegisterType((*GetOffloadedAppsStatisticsResponse_PPPoeIAStats)(nil), "extension.GetOffloadedAppsStatisticsResponse.PPPoeIAStats")
	proto.RegisterMapType((map[string]string)(nil), "extension.GetOffloadedAppsStatisticsResponse.PPPoeIAStats.AdditionalStatsEntry")
	proto.RegisterType((*GetValueRequest)(nil), "extension.GetValueRequest")
	proto.RegisterType((*GetValueResponse)(nil), "extension.GetValueResponse")
	proto.RegisterType((*AppOffloadConfig)(nil), "extension.AppOffloadConfig")
	proto.RegisterType((*AppOffloadOnuConfig)(nil), "extension.AppOffloadOnuConfig")
	proto.RegisterType((*AppOffloadOnuConfig_PerUniConfig)(nil), "extension.AppOffloadOnuConfig.PerUniConfig")
	proto.RegisterType((*SetValueRequest)(nil), "extension.SetValueRequest")
	proto.RegisterType((*SetValueResponse)(nil), "extension.SetValueResponse")
	proto.RegisterType((*SingleGetValueRequest)(nil), "extension.SingleGetValueRequest")
	proto.RegisterType((*SingleGetValueResponse)(nil), "extension.SingleGetValueResponse")
	proto.RegisterType((*SingleSetValueRequest)(nil), "extension.SingleSetValueRequest")
	proto.RegisterType((*SingleSetValueResponse)(nil), "extension.SingleSetValueResponse")
}

func init() { proto.RegisterFile("voltha_protos/extensions.proto", fileDescriptor_7ecf6e9799a9202d) }

var fileDescriptor_7ecf6e9799a9202d = []byte{
	// 5177 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x5c, 0xcd, 0x6f, 0x1b, 0x49,
	0x76, 0x17, 0x29, 0x89, 0x12, 0x1f, 0x45, 0x89, 0x2a, 0x7d, 0x98, 0x96, 0x3d, 0xb6, 0xa7, 0x77,
	0x3e, 0x3c, 0x9b, 0x19, 0xd9, 0xa2, 0x2d, 0x59, 0x3b, 0xbb, 0x59, 0x2c, 0x29, 0x51, 0x22, 0x63,
	0x9b, 0xe2, 0x14, 0xa9, 0xf9, 0xd8, 0x20, 0xdb, 0xdb, 0x62, 0x97, 0x34, 0x0d, 0x93, 0x5d, 0x4c,
	0x77, 0x53, 0x4b, 0x4f, 0x90, 0x5b, 0x6e, 0x9b, 0x9c, 0x72, 0xc9, 0x25, 0xb7, 0x5c, 0x02, 0x24,
	0xd8, 0x43, 0x0e, 0x41, 0xae, 0x8b, 0x1c, 0xf3, 0x4f, 0x04, 0x08, 0x90, 0x73, 0x82, 0x04, 0x08,
	0x12, 0x20, 0x08, 0xea, 0xab, 0xbb, 0xba, 0xd9, 0xd4, 0xc7, 0xec, 0x66, 0x03, 0xe4, 0x32, 0xa3,
	0x7a, 0x1f, 0xbf, 0x7a, 0x55, 0xf5, 0xde, 0xab, 0x7a, 0xd5, 0x45, 0xc3, 0x83, 0x4b, 0xda, 0x0f,
	0xbe, 0xb6, 0xcc, 0xa1, 0x47, 0x03, 0xea, 0x3f, 0x21, 0xe3, 0x80, 0xb8, 0xbe, 0x43, 0x5d, 0x7f,
	0x9b, 0x53, 0x50, 0x3e, 0xa4, 0x6c, 0x4d, 0x8a, 0x9a, 0x3d, 0xea, 0x9e, 0x3b, 0x17, 0x42, 0x74,
	0xeb, 0xde, 0x05, 0xa5, 0x17, 0x7d, 0xf2, 0x84, 0xb7, 0xce, 0x46, 0xe7, 0x4f, 0xc8, 0x60, 0x18,
	0xbc, 0x95, 0xcc, 0xad, 0xb8, 0x72, 0x8f, 0x0e, 0x06, 0xd4, 0x15, 0x3c, 0xe3, 0xf7, 0x60, 0xf1,
	0x73, 0xab, 0x3f, 0x22, 0x1d, 0x12, 0xa0, 0x65, 0xc8, 0x3a, 0x76, 0x39, 0xf3, 0x28, 0xf3, 0x38,
	0x8f, 0xb3, 0x8e, 0x8d, 0xf6, 0x61, 0xc9, 0xea, 0x5b, 0xde, 0x40, 0x76, 0x55, 0xce, 0x3e, 0xca,
	0x3c, 0x2e, 0x54, 0xd6, 0xb6, 0x65, 0xcf, 0x55, 0xc6, 0x3b, 0xe0, 0x7f, 0x37, 0x66, 0x70, 0xc1,
	0x8a, 0x9a, 0xb5, 0x05, 0x98, 0xbf, 0x64, 0xa8, 0xc6, 0xc7, 0x90, 0xe7, 0xf0, 0xdd, 0xb7, 0x43,
	0x62, 0x3c, 0x84, 0x39, 0xf6, 0x7f, 0x94, 0x87, 0xf9, 0xfa, 0xeb, 0x76, 0xf7, 0xab, 0xd2, 0x0c,
	0x5a, 0x82, 0xc5, 0xc3, 0x66, 0xa7, 0x5b, 0x6d, 0x1d, 0xd4, 0x4b, 0x19, 0xe3, 0x33, 0x58, 0x16,
	0xc6, 0x0c, 0x49, 0xcf, 0x39, 0x77, 0x88, 0x37, 0x61, 0xd2, 0x13, 0x09, 0xcc, 0x6d, 0x59, 0xae,
	0xdc, 0xdd, 0x0e, 0xa7, 0x68, 0x3b, 0xec, 0x67, 0x9b, 0xfd, 0x07, 0x4b, 0x03, 0x02, 0x58, 0xc2,
	0x24, 0x18, 0x79, 0x2e, 0x67, 0xfb, 0xa8, 0x04, 0xb3, 0x1d, 0x12, 0x70, 0xc4, 0x22, 0x66, 0x7f,
	0xa2, 0x47, 0x50, 0x38, 0x75, 0xfd, 0xd1, 0x70, 0x48, 0xbd, 0x80, 0xd8, 0x1c, 0xb8, 0x88, 0x75,
	0x12, 0x5a, 0x87, 0xf9, 0xba, 0xe7, 0x51, 0xaf, 0x3c, 0xcb, 0x79, 0xa2, 0x81, 0xb6, 0x60, 0xf1,
	0xd0, 0xf1, 0x03, 0xcb, 0xed, 0x91, 0xf2, 0x1c, 0x67, 0x84, 0x6d, 0x63, 0x0f, 0xd0, 0x31, 0x09,
	0x54, 0x13, 0x93, 0xdf, 0x1f, 0x11, 0x9f, 0xf7, 0x44, 0xdd, 0xd1, 0x21, 0xb9, 0x74, 0x7a, 0xa4,
	0xa9, 0x46, 0xa5, 0x93, 0x8c, 0x1d, 0x58, 0x8b, 0xe9, 0xf9, 0x43, 0xea, 0xfa, 0x84, 0x75, 0x65,
	0xab, 0xae, 0x84, 0xe5, 0x61, 0xdb, 0xa8, 0xc0, 0xfa, 0x31, 0x09, 0x4e, 0xdc, 0xd1, 0xa9, 0xeb,
	0x34, 0xdd, 0x73, 0xaa, 0x3a, 0xdb, 0x82, 0xc5, 0x11, 0xa3, 0xd8, 0x64, 0xac, 0x74, 0x54, 0xdb,
	0xf8, 0xc7, 0x39, 0xd8, 0x48, 0x28, 0xc9, 0x9e, 0xda, 0xb0, 0x68, 0xd9, 0x83, 0x4e, 0x60, 0x05,
	0xa2, 0xa7, 0xe5, 0xca, 0x73, 0x6d, 0x8a, 0x53, 0x75, 0xb6, 0xab, 0xf6, 0xc0, 0x71, 0x1d, 0x3f,
	0xf0, 0xac, 0xc0, 0xb9, 0x24, 0x5c, 0x17, 0x87, 0x28, 0xe8, 0x04, 0xf2, 0x74, 0x48, 0x3c, 0x01,
	0x29, 0x56, 0x6d, 0xe7, 0x5a, 0xc8, 0x93, 0x21, 0x61, 0x68, 0xd4, 0xb5, 0xfa, 0x02, 0x2f, 0xc2,
	0x60, 0x80, 0xc2, 0x01, 0x9b, 0xae, 0xcd, 0x57, 0xe4, 0x26, 0x80, 0xc2, 0x2f, 0x47, 0x02, 0xb4,
	0xe9, 0xda, 0x38, 0xc2, 0x30, 0x7e, 0x99, 0x81, 0x52, 0x92, 0x8f, 0x00, 0x72, 0xa7, 0xad, 0x97,
	0x27, 0x5f, 0xb4, 0x4a, 0x33, 0x08, 0xc1, 0x72, 0xb7, 0xde, 0x32, 0x6b, 0xd5, 0x4e, 0xdd, 0xec,
	0x9a, 0x47, 0x87, 0x5f, 0x96, 0x32, 0x68, 0x13, 0x50, 0xe3, 0xb4, 0x75, 0x88, 0xeb, 0x87, 0x3a,
	0x3d, 0x8b, 0xca, 0xb0, 0x7e, 0xdc, 0x3c, 0xae, 0xd6, 0x9a, 0x5d, 0xb3, 0xde, 0x6d, 0xd4, 0x71,
	0xab, 0x2e, 0x38, 0xb3, 0x4c, 0x83, 0xa1, 0x1c, 0xc7, 0xe9, 0x73, 0x09, 0xf4, 0xc6, 0xe1, 0x97,
	0xa5, 0xf9, 0x14, 0x74, 0x46, 0xcf, 0xa5, 0xa2, 0x33, 0xce, 0x82, 0x71, 0x0c, 0x6b, 0x29, 0xeb,
	0xc0, 0x80, 0xaa, 0x87, 0xaf, 0x3b, 0xdd, 0x6a, 0xb7, 0x6e, 0x9e, 0xb6, 0x0e, 0xeb, 0x47, 0xcd,
	0x56, 0xfd, 0xb0, 0x34, 0xc3, 0x86, 0xf7, 0xea, 0xe4, 0xe0, 0x65, 0xfd, 0xb0, 0x94, 0x61, 0x31,
	0x78, 0xda, 0x92, 0xad, 0xac, 0x71, 0x04, 0xa5, 0xe4, 0xec, 0xa3, 0x3b, 0xb0, 0x76, 0xd2, 0xae,
	0xe3, 0x49, 0x98, 0x02, 0x2c, 0xd4, 0x5b, 0xd5, 0xda, 0x2b, 0x85, 0x73, 0xd8, 0xec, 0x88, 0x56,
	0xd6, 0xf8, 0xdb, 0x0c, 0x8f, 0x81, 0x93, 0x7e, 0xd0, 0xa6, 0x5e, 0x70, 0x40, 0x47, 0x6e, 0x40,
	0x3c, 0x1f, 0x6d, 0x42, 0x8e, 0x45, 0x55, 0x8b, 0x4a, 0xa7, 0x94, 0x2d, 0x54, 0x83, 0x45, 0xf6,
	0x17, 0x0b, 0x5d, 0xe9, 0x25, 0x1f, 0x24, 0x16, 0x35, 0x0e, 0xb4, 0xdd, 0x96, 0xd2, 0x38, 0xd4,
	0x33, 0xea, 0xb0, 0xa8, 0xa8, 0xa8, 0x04, 0x4b, 0xec, 0x6f, 0xf3, 0xb4, 0xf5, 0xb2, 0x25, 0x56,
	0x71, 0x03, 0x56, 0x39, 0x25, 0x9c, 0xb8, 0x56, 0xab, 0x59, 0xca, 0x84, 0x82, 0xed, 0x93, 0x96,
	0x79, 0xf2, 0xaa, 0x5b, 0xca, 0x1a, 0xff, 0x30, 0x0b, 0x5b, 0x93, 0x1d, 0x86, 0x21, 0x52, 0x86,
	0x85, 0x60, 0x5c, 0x7b, 0x1b, 0x10, 0x9f, 0x0f, 0x61, 0x0e, 0xab, 0x26, 0xe3, 0x78, 0x92, 0x93,
	0x15, 0x1c, 0xd9, 0x44, 0xf7, 0x21, 0x1f, 0x8c, 0xdb, 0x56, 0xef, 0x0d, 0x09, 0x7c, 0xee, 0xb3,
	0x73, 0x38, 0x22, 0x30, 0xae, 0x17, 0x72, 0xe7, 0x04, 0x37, 0x24, 0xa0, 0x0f, 0x60, 0x39, 0x18,
	0xf3, 0x94, 0xa3, 0x44, 0xe6, 0xb9, 0x48, 0x82, 0xca, 0xe4, 0xbc, 0xb8, 0x5c, 0x4e, 0xc8, 0x79,
	0x13, 0x72, 0xc1, 0xb8, 0xd6, 0xb3, 0xfc, 0x40, 0xc9, 0x2d, 0x28, 0x3c, 0x9d, 0x2a, 0xf0, 0x62,
	0x72, 0x8b, 0x0a, 0x2f, 0x29, 0x17, 0x8c, 0x4f, 0x75, 0xb9, 0xbc, 0xc2, 0x3b, 0x9d, 0xc0, 0x8b,
	0xc9, 0x81, 0xc2, 0x3b, 0x9d, 0xc0, 0x7b, 0xad, 0xcb, 0x15, 0x14, 0xde, 0xeb, 0x09, 0xbc, 0x98,
	0xdc, 0x92, 0xc2, 0xd3, 0xa9, 0xc6, 0xa1, 0x4a, 0x90, 0x6d, 0xea, 0x9e, 0x0c, 0x03, 0xa7, 0x67,
	0xf5, 0x59, 0x6a, 0x40, 0x1f, 0xc3, 0x3c, 0xdf, 0x24, 0xf9, 0x2a, 0x16, 0x2a, 0x9b, 0xdb, 0x62,
	0x0b, 0xdd, 0x56, 0x5b, 0xe8, 0x76, 0x9d, 0x71, 0xb1, 0x10, 0x32, 0xfe, 0x28, 0x0b, 0xf7, 0xd3,
	0x60, 0x42, 0xb7, 0xf8, 0x2e, 0x94, 0x86, 0xf4, 0x67, 0xc4, 0x3b, 0x22, 0xc4, 0xfe, 0x9c, 0xf6,
	0x03, 0xeb, 0x42, 0x64, 0xd0, 0x2c, 0x9e, 0xa0, 0xa3, 0x0a, 0xac, 0x7b, 0xa4, 0x47, 0x9c, 0x4b,
	0x62, 0x4b, 0xa8, 0x36, 0x13, 0xe1, 0x5e, 0x93, 0xc5, 0xa9, 0x3c, 0xb4, 0x07, 0x9b, 0x03, 0x62,
	0xa9, 0xae, 0x5f, 0x59, 0x23, 0xb7, 0xf7, 0xb5, 0xd0, 0x9a, 0xe5, 0x5a, 0x53, 0xb8, 0xcc, 0xae,
	0xbe, 0xe5, 0x13, 0xaf, 0xe6, 0x58, 0xfe, 0xc1, 0xc8, 0xf3, 0x88, 0x1b, 0x70, 0x1f, 0xcb, 0xe2,
	0x09, 0x3a, 0xdb, 0xa0, 0x02, 0x32, 0xe0, 0xd1, 0x3f, 0xf2, 0x08, 0xf7, 0xb3, 0x2c, 0xd6, 0x49,
	0xc6, 0x2f, 0x32, 0xf0, 0x50, 0x4c, 0x43, 0x3d, 0xf8, 0x9a, 0x78, 0x2e, 0x09, 0x6a, 0x9e, 0x63,
	0x5f, 0x10, 0x16, 0x29, 0x0d, 0xc7, 0x0f, 0xa8, 0xf7, 0x16, 0x61, 0xc8, 0xdb, 0x8e, 0x47, 0x7a,
	0x2c, 0x83, 0x4c, 0xdd, 0x44, 0xa6, 0xaa, 0x6f, 0x1f, 0x2a, 0x5d, 0x1c, 0xc1, 0x18, 0xfb, 0x90,
	0x0f, 0xe9, 0xa8, 0x08, 0x79, 0x3d, 0x09, 0xb1, 0xfc, 0xd5, 0xee, 0x74, 0x71, 0xbd, 0xfa, 0xba,
	0x94, 0x41, 0xcb, 0x00, 0x87, 0x27, 0x5f, 0xb4, 0x64, 0x3b, 0x6b, 0xfc, 0xe9, 0x3c, 0x7c, 0x78,
	0x4d, 0x97, 0xe1, 0x1a, 0x3e, 0x00, 0xb0, 0x3d, 0x3a, 0xac, 0x5f, 0x12, 0x37, 0xf0, 0x65, 0x82,
	0xd2, 0x28, 0x2c, 0x79, 0xd1, 0x5e, 0xc0, 0x5c, 0x4d, 0x9c, 0x12, 0x64, 0x8b, 0x05, 0xfe, 0x50,
	0x0b, 0xee, 0x22, 0x56, 0x4d, 0x36, 0xfb, 0x67, 0x1e, 0xb5, 0x6c, 0xdd, 0x4d, 0xc5, 0x61, 0x61,
	0x82, 0xce, 0x64, 0x07, 0xa3, 0x3e, 0x5b, 0xc0, 0x48, 0x76, 0x5e, 0xc8, 0x26, 0xe9, 0xe8, 0x63,
	0x58, 0xed, 0x79, 0x3d, 0x1e, 0xd7, 0xc4, 0xd6, 0xe3, 0xbd, 0x88, 0x27, 0x19, 0x0c, 0x79, 0xe4,
	0xda, 0xc4, 0xf3, 0x9d, 0x6f, 0x88, 0x1e, 0xf4, 0x45, 0x3c, 0x41, 0x47, 0x8f, 0x61, 0x85, 0x5e,
	0xc6, 0x45, 0x17, 0xb9, 0x68, 0x92, 0xcc, 0x24, 0xe5, 0x30, 0xf7, 0x9e, 0xcb, 0x69, 0xc9, 0x0b,
	0xc9, 0x04, 0x99, 0xf9, 0xbb, 0x22, 0xed, 0x76, 0xe9, 0x4e, 0xe5, 0x85, 0x14, 0x07, 0x2e, 0x9e,
	0xca, 0x43, 0xcf, 0x61, 0x43, 0xd2, 0x77, 0x2a, 0xfb, 0x5d, 0x5a, 0xd9, 0xdd, 0x3d, 0x11, 0x4a,
	0x05, 0xae, 0x94, 0xce, 0xd4, 0xb4, 0x2a, 0xbb, 0x7b, 0x5d, 0xba, 0xbb, 0xb3, 0x23, 0xbb, 0x5a,
	0x8a, 0x69, 0xc5, 0x99, 0x2c, 0xb6, 0x24, 0x63, 0x77, 0xa7, 0xd2, 0xa5, 0x3b, 0x4f, 0x2b, 0xcf,
	0xa4, 0x5a, 0x91, 0xab, 0x4d, 0xe1, 0xa2, 0x7d, 0xb8, 0xa3, 0xcc, 0x78, 0x5a, 0x79, 0xde, 0xa5,
	0x3b, 0xbb, 0x3b, 0xfb, 0x52, 0x71, 0x99, 0x2b, 0x4e, 0x63, 0x1b, 0xaf, 0x54, 0x36, 0xa9, 0xf6,
	0xfb, 0xb4, 0x77, 0x4c, 0x06, 0xa1, 0x2b, 0x8a, 0xd3, 0xdb, 0xed, 0x92, 0xd3, 0x2f, 0xb2, 0xb0,
	0x71, 0xe2, 0x8e, 0x8e, 0xc9, 0x40, 0xf3, 0xea, 0x43, 0x2b, 0xb0, 0xd8, 0xd1, 0xf5, 0x82, 0x0c,
	0xe4, 0x61, 0xb3, 0x88, 0x45, 0x83, 0xad, 0x47, 0xe0, 0x59, 0xae, 0x3f, 0x70, 0x82, 0x80, 0xd8,
	0xc7, 0xf5, 0xd7, 0x47, 0x9e, 0x35, 0x20, 0xca, 0xab, 0x53, 0x79, 0xcc, 0xe3, 0x54, 0x5e, 0x8a,
	0x14, 0x84, 0xb7, 0x4f, 0x32, 0xf4, 0x0c, 0xd7, 0xb6, 0xde, 0xf6, 0xa9, 0x65, 0x8b, 0x7d, 0x51,
	0xf8, 0x7e, 0x2a, 0x8f, 0xcd, 0xa6, 0xd6, 0x73, 0x4c, 0x4d, 0x84, 0xc1, 0x34, 0x36, 0x7a, 0x0a,
	0x6b, 0xc4, 0xed, 0x79, 0x6f, 0x87, 0x2c, 0x3d, 0xbc, 0x24, 0x6f, 0xb9, 0xfb, 0xab, 0x78, 0x48,
	0x63, 0x19, 0x4d, 0x58, 0x53, 0x93, 0xaf, 0x4f, 0x57, 0x19, 0x16, 0x2c, 0x46, 0x0b, 0x27, 0x4c,
	0x35, 0x93, 0x7b, 0x7b, 0x31, 0xdc, 0xdb, 0x8d, 0xbf, 0xc8, 0xc0, 0xe6, 0xe4, 0x42, 0x72, 0xb8,
	0x23, 0x58, 0xa6, 0x92, 0xd3, 0xb4, 0xd9, 0x6e, 0x21, 0x97, 0xf3, 0x81, 0x96, 0x0e, 0x53, 0xcc,
	0xc0, 0x09, 0x2d, 0x54, 0x83, 0xc2, 0x85, 0x58, 0x5b, 0x0e, 0x92, 0x7d, 0x34, 0xfb, 0xb8, 0x50,
	0x79, 0x14, 0x07, 0x99, 0x5c, 0x7c, 0xac, 0x2b, 0x19, 0xdf, 0xc0, 0x3b, 0x53, 0x3c, 0x4e, 0x26,
	0xbf, 0xaf, 0x60, 0x93, 0xa6, 0x0e, 0xa3, 0x9c, 0xe1, 0xfd, 0xbd, 0x9b, 0x62, 0x74, 0x5c, 0x10,
	0x4f, 0x01, 0x30, 0x7e, 0x04, 0x25, 0xd1, 0xf7, 0x11, 0x51, 0xe3, 0xbc, 0xa5, 0x87, 0xff, 0x6b,
	0x06, 0xca, 0x49, 0x88, 0xd0, 0xf2, 0x0f, 0x60, 0xb9, 0x47, 0x3d, 0xb6, 0x3b, 0x10, 0x3b, 0x3a,
	0x98, 0x15, 0x71, 0x82, 0x8a, 0xb6, 0x01, 0x85, 0x94, 0x03, 0x6a, 0x93, 0x2f, 0xa8, 0x67, 0xab,
	0xe5, 0x4c, 0xe1, 0xb0, 0xed, 0xe0, 0x9c, 0xf4, 0x3a, 0xa4, 0x47, 0x5d, 0x5b, 0xf9, 0xba, 0x46,
	0xe1, 0x27, 0x15, 0x1a, 0x58, 0xfd, 0x08, 0x4b, 0xb8, 0x77, 0x82, 0xca, 0xd2, 0xcb, 0xc8, 0x95,
	0xf8, 0xd6, 0x59, 0x9f, 0x44, 0xf2, 0xc2, 0xaf, 0xa7, 0x70, 0x8d, 0x63, 0x55, 0xa5, 0x45, 0x67,
	0x50, 0x91, 0x1d, 0xee, 0xc0, 0x82, 0xe3, 0x06, 0xe7, 0xa6, 0x2c, 0x8d, 0x17, 0x70, 0x8e, 0x35,
	0x9b, 0x36, 0xda, 0x80, 0x1c, 0x75, 0x47, 0x8c, 0x9e, 0xe5, 0xf4, 0x79, 0xea, 0x8e, 0x9a, 0xb6,
	0xf1, 0x27, 0x19, 0x78, 0x9f, 0x21, 0x0d, 0x7a, 0x8e, 0xda, 0x04, 0x79, 0x9c, 0xd6, 0xd9, 0x82,
	0xda, 0xc4, 0x6e, 0x0f, 0x6e, 0x5c, 0xa2, 0xa2, 0xfb, 0x5a, 0x5d, 0xc9, 0xa7, 0xae, 0x31, 0x13,
	0x55, 0x96, 0x2c, 0xdf, 0x78, 0xc4, 0x27, 0x01, 0x9f, 0xad, 0x45, 0x2c, 0x1a, 0xb5, 0x65, 0x58,
	0x72, 0x7c, 0x73, 0xe4, 0x3a, 0xa6, 0xc3, 0xeb, 0xcf, 0x03, 0x58, 0x3d, 0x26, 0x01, 0x1e, 0xf3,
	0x13, 0xca, 0xb7, 0x1d, 0xd4, 0x2b, 0x71, 0xae, 0xeb, 0x27, 0x71, 0xde, 0x01, 0x60, 0x15, 0x81,
	0xd9, 0xb7, 0xce, 0x48, 0x5f, 0x8e, 0x20, 0xcf, 0x28, 0xaf, 0x18, 0x41, 0xa1, 0xf9, 0x2e, 0x47,
	0xcb, 0x73, 0xb4, 0x8e, 0x6b, 0xfc, 0x98, 0x57, 0x2b, 0x6d, 0xea, 0xb2, 0x8a, 0x27, 0x9c, 0xe8,
	0x07, 0x10, 0x69, 0x0a, 0xa8, 0xc6, 0x8c, 0x0e, 0x56, 0x16, 0xd5, 0x4c, 0x53, 0x9a, 0xd6, 0x98,
	0xc1, 0xb2, 0x5d, 0x03, 0x51, 0xcf, 0xf0, 0xd0, 0xa3, 0xbc, 0xaa, 0x8f, 0xb0, 0xa3, 0x42, 0x62,
	0x48, 0x5d, 0x16, 0xa0, 0x2a, 0xd9, 0xc8, 0x26, 0xfa, 0x21, 0x2c, 0x33, 0x65, 0x26, 0xee, 0xf8,
	0x81, 0xd3, 0xf3, 0xe5, 0xd5, 0xcb, 0xe6, 0xb6, 0xbc, 0xbb, 0x69, 0xc7, 0xb8, 0x38, 0x21, 0x2d,
	0x07, 0xd3, 0x6a, 0x35, 0xff, 0xd7, 0x06, 0x13, 0x61, 0x47, 0x83, 0x71, 0x5d, 0x47, 0x1f, 0x8c,
	0x6c, 0xfe, 0xca, 0x83, 0x69, 0xc2, 0x5d, 0x11, 0x05, 0xbc, 0xc3, 0x23, 0x8f, 0x0e, 0xd8, 0x9a,
	0xcb, 0x31, 0x6d, 0x82, 0xf4, 0x92, 0x84, 0xcf, 0xac, 0x83, 0xf0, 0x92, 0xb8, 0xcb, 0xfc, 0x79,
	0x46, 0xdf, 0x27, 0xd9, 0x70, 0x24, 0xdc, 0x94, 0x7d, 0x32, 0x56, 0x98, 0x65, 0x93, 0x85, 0x99,
	0xb6, 0x25, 0xcc, 0x5e, 0x51, 0xee, 0xcd, 0x25, 0xcb, 0x3d, 0xad, 0x80, 0x9c, 0x8f, 0x15, 0x90,
	0xc6, 0x4b, 0x6e, 0x9e, 0x96, 0xf9, 0x95, 0x79, 0x37, 0xde, 0x97, 0x22, 0x23, 0x8c, 0xbf, 0xcc,
	0xc0, 0x43, 0x2d, 0x4f, 0xc7, 0x67, 0x4f, 0xae, 0x5a, 0x0d, 0x0a, 0xd6, 0xc4, 0xee, 0xf4, 0x28,
	0x25, 0xd1, 0xc7, 0xcc, 0xc1, 0xba, 0xd2, 0x6d, 0x36, 0xa7, 0x18, 0x86, 0xbe, 0x39, 0x5d, 0x8a,
	0x8a, 0x3b, 0xb9, 0xc6, 0xd2, 0xca, 0x2f, 0x61, 0xd5, 0xd2, 0x47, 0x21, 0x6d, 0x65, 0xfd, 0x7c,
	0x37, 0x7d, 0x53, 0x4a, 0x83, 0xc1, 0x93, 0x20, 0xc6, 0x3f, 0x2d, 0xc1, 0x66, 0x32, 0xc5, 0xca,
	0x4e, 0xef, 0x26, 0xd2, 0x11, 0x0b, 0x07, 0xe9, 0x5c, 0x77, 0xe2, 0x09, 0xa9, 0x91, 0x91, 0xfe,
	0x85, 0x3e, 0x64, 0xae, 0xee, 0x3b, 0x81, 0x73, 0x49, 0x4c, 0xdb, 0x73, 0xce, 0x45, 0x1a, 0xcc,
	0x35, 0xb2, 0xb8, 0xa8, 0xe8, 0x87, 0x8c, 0xcc, 0x04, 0x5d, 0x72, 0x61, 0x69, 0x82, 0x73, 0x5c,
	0x70, 0x16, 0x17, 0x15, 0x5d, 0x08, 0x7e, 0x0a, 0x65, 0x9b, 0xf4, 0x9d, 0x81, 0x13, 0x10, 0xcf,
	0x1c, 0x38, 0xbe, 0x6f, 0xda, 0x24, 0x90, 0xa5, 0xd5, 0x3c, 0x57, 0x99, 0xc3, 0x9b, 0xa1, 0xc4,
	0x6b, 0xc7, 0xf7, 0x0f, 0x15, 0x1f, 0x3d, 0x04, 0x38, 0x73, 0x86, 0x26, 0x89, 0x0e, 0x43, 0xb9,
	0xc6, 0x3c, 0xce, 0x9f, 0x39, 0x43, 0x71, 0x08, 0x42, 0xef, 0x00, 0x6b, 0xb0, 0xbc, 0x2c, 0xeb,
	0x81, 0x5c, 0x23, 0x87, 0x17, 0xcf, 0x9c, 0xe1, 0x29, 0xa3, 0xb0, 0xb3, 0xf4, 0x39, 0xe9, 0x99,
	0xe1, 0xc6, 0x68, 0xfa, 0x6f, 0x07, 0x67, 0xb4, 0x2f, 0xea, 0x81, 0x5c, 0x63, 0x01, 0xaf, 0x9d,
	0x93, 0xde, 0x81, 0xe2, 0x76, 0x04, 0x93, 0x9d, 0xe2, 0x84, 0x96, 0x4d, 0x7e, 0xc6, 0x76, 0xb1,
	0x48, 0x9f, 0x57, 0x07, 0xb9, 0xc6, 0x22, 0xde, 0xe0, 0x7a, 0x92, 0x1f, 0x02, 0xa0, 0x1f, 0xc1,
	0xbd, 0xb8, 0x66, 0x6c, 0x5b, 0xe4, 0xc5, 0x42, 0xae, 0x91, 0xc7, 0x77, 0x75, 0xed, 0x53, 0x5d,
	0x04, 0xbd, 0x0f, 0xc5, 0x18, 0x02, 0xaf, 0x15, 0x72, 0x0d, 0xc0, 0x4b, 0xba, 0x0e, 0x3b, 0x2e,
	0xc6, 0x07, 0x26, 0x66, 0x60, 0x89, 0x0b, 0x17, 0xf0, 0xaa, 0x3e, 0x2c, 0x31, 0x15, 0x8f, 0x61,
	0x65, 0x7c, 0x41, 0x06, 0xe6, 0x1b, 0xf2, 0x56, 0xcd, 0x67, 0x91, 0x4b, 0x2f, 0xe1, 0x22, 0x63,
	0x84, 0x07, 0x4b, 0x36, 0xa7, 0x5c, 0xb2, 0x4f, 0x7d, 0x51, 0x04, 0xe4, 0x1a, 0x45, 0xbc, 0xc8,
	0x48, 0xaf, 0xa8, 0xcf, 0x81, 0xbc, 0xb1, 0x39, 0xec, 0x53, 0x6b, 0xe0, 0x0b, 0xa4, 0xf2, 0x0a,
	0x17, 0x5a, 0xc6, 0x45, 0x6f, 0xdc, 0xe6, 0x74, 0x71, 0xbd, 0xfc, 0x09, 0xa0, 0x48, 0xd2, 0xa5,
	0xae, 0xe9, 0xd8, 0x7d, 0x52, 0x2e, 0x71, 0xe1, 0x15, 0xbc, 0xa2, 0x84, 0x5b, 0xd4, 0x6d, 0xda,
	0x7d, 0xee, 0xae, 0xde, 0xd8, 0xa4, 0x83, 0x9e, 0x53, 0x5e, 0xe5, 0x32, 0x25, 0x9c, 0xf3, 0xc6,
	0x6c, 0xc7, 0x67, 0xac, 0x40, 0xb2, 0x10, 0x67, 0xad, 0xe2, 0x5c, 0x20, 0x58, 0x9f, 0xc2, 0x5d,
	0xa9, 0x65, 0xca, 0x4a, 0xc5, 0xec, 0x79, 0x3d, 0x69, 0xd8, 0x1a, 0x17, 0x46, 0x78, 0x43, 0xe0,
	0xc8, 0xf4, 0x75, 0x20, 0xab, 0x4b, 0x74, 0x0f, 0x16, 0xbd, 0xb1, 0x79, 0xc6, 0x53, 0xcf, 0x3a,
	0x17, 0x5d, 0x8b, 0x32, 0xe0, 0x43, 0x00, 0x66, 0xbd, 0x4c, 0x81, 0x1b, 0x9c, 0xbd, 0xae, 0x27,
	0xcf, 0x7b, 0xb0, 0x18, 0x28, 0xed, 0x4d, 0xce, 0xde, 0x88, 0x2e, 0xd2, 0x1e, 0x02, 0x04, 0x91,
	0xf6, 0x1d, 0xce, 0xde, 0xd4, 0x53, 0xe8, 0x77, 0x60, 0xe9, 0x8c, 0x78, 0xa6, 0x47, 0xe4, 0xa5,
	0x7d, 0x99, 0x8b, 0xdc, 0xc1, 0x85, 0x33, 0x76, 0x0e, 0x90, 0xd7, 0xf6, 0xef, 0x42, 0xa1, 0xdf,
	0xb3, 0x2f, 0xd4, 0x82, 0xdd, 0xe5, 0x32, 0x65, 0x0c, 0x8c, 0x28, 0x57, 0x8b, 0x99, 0x69, 0x3b,
	0x4a, 0x62, 0x8b, 0x4b, 0xdc, 0xc5, 0x79, 0xcf, 0x76, 0xa4, 0xc0, 0x03, 0xc8, 0x07, 0xce, 0x80,
	0xf8, 0x81, 0x35, 0x18, 0x96, 0xef, 0xf1, 0x68, 0xdf, 0xc2, 0x11, 0xa9, 0xb6, 0x04, 0xe0, 0xf8,
	0xa6, 0x4c, 0x14, 0xb5, 0x02, 0xe4, 0x1d, 0xdf, 0x14, 0xb9, 0xa1, 0xb6, 0x06, 0xab, 0x8e, 0x6f,
	0xc6, 0xf3, 0x81, 0x24, 0xc6, 0x63, 0xbf, 0xf6, 0x0e, 0xdc, 0x73, 0x58, 0x60, 0xa7, 0xc7, 0x79,
	0x6d, 0x05, 0x8a, 0x8e, 0x6f, 0x46, 0xa1, 0x2c, 0x8f, 0x53, 0x61, 0xe8, 0xd6, 0xb6, 0xa0, 0xec,
	0xf8, 0x66, 0x6a, 0xac, 0xd6, 0xee, 0xc3, 0x56, 0xc8, 0x9b, 0x88, 0xc8, 0xda, 0x23, 0x78, 0x30,
	0xc1, 0x8d, 0x45, 0x5d, 0x0d, 0x41, 0x29, 0x29, 0x51, 0x2b, 0xc3, 0xe6, 0x44, 0x7f, 0xc2, 0x92,
	0x75, 0x40, 0x8e, 0x6f, 0x26, 0x42, 0x45, 0xda, 0x1b, 0x86, 0x85, 0x94, 0x4a, 0xc4, 0x41, 0xed,
	0x0e, 0x6c, 0xc4, 0xa8, 0xca, 0xe7, 0xe5, 0x1c, 0x4b, 0x3f, 0x95, 0x2d, 0xe9, 0xd0, 0xb5, 0x07,
	0x70, 0x3f, 0xe2, 0x4d, 0xfa, 0x70, 0xad, 0x08, 0x05, 0xc1, 0xe7, 0x9e, 0x26, 0xa7, 0x32, 0xf2,
	0x4c, 0xc9, 0x0f, 0xe2, 0xfc, 0xc8, 0xf7, 0x6a, 0xab, 0xb0, 0xc2, 0xa6, 0x5a, 0xf3, 0xb5, 0x5a,
	0x09, 0x96, 0x1d, 0xdf, 0xd4, 0x3c, 0x4b, 0xa1, 0x86, 0x8e, 0x24, 0x07, 0x1c, 0x7a, 0x89, 0xf1,
	0xc7, 0xf3, 0x70, 0xef, 0x8a, 0xc3, 0x37, 0x7a, 0x08, 0x05, 0xdb, 0xa3, 0x43, 0x93, 0x44, 0x17,
	0x4f, 0xb9, 0x2b, 0x2e, 0x9e, 0x72, 0xe1, 0xc5, 0xd3, 0x26, 0xe4, 0xce, 0xa3, 0x4a, 0x3c, 0x87,
	0x65, 0x0b, 0x7d, 0xa4, 0x5d, 0x3b, 0x99, 0x52, 0x82, 0xef, 0x30, 0x78, 0x25, 0xa4, 0x1f, 0x85,
	0xa2, 0xe1, 0xed, 0x92, 0x12, 0x9d, 0x17, 0xa2, 0x21, 0x3d, 0xbc, 0x02, 0x40, 0xe1, 0xcc, 0x12,
	0x5b, 0x09, 0xf3, 0x8d, 0x05, 0x97, 0xa2, 0x5b, 0xa7, 0x08, 0x38, 0xbc, 0x5c, 0x52, 0xb2, 0x0b,
	0x02, 0x38, 0xa4, 0x4b, 0xd1, 0x0f, 0xa3, 0x3b, 0x27, 0x25, 0xc9, 0xf7, 0x18, 0xbc, 0xac, 0xc8,
	0x52, 0xf0, 0x31, 0x94, 0x04, 0xdf, 0xdc, 0x7b, 0x6e, 0x6a, 0x77, 0x4e, 0x39, 0xbc, 0x2c, 0xe8,
	0x7b, 0xcf, 0xc3, 0x8b, 0xa0, 0x3b, 0x4a, 0x72, 0xd7, 0x0c, 0xa8, 0xb9, 0x53, 0x79, 0x61, 0x6a,
	0xb7, 0x4e, 0x39, 0xbc, 0x26, 0x15, 0xc4, 0xa5, 0xd3, 0x89, 0xba, 0x08, 0x2a, 0x4b, 0xad, 0x9d,
	0xca, 0x3e, 0x53, 0xab, 0xec, 0xee, 0x2a, 0x35, 0xbe, 0x97, 0xe0, 0x75, 0xc1, 0x4f, 0x5c, 0x3b,
	0x45, 0x7a, 0x95, 0xdd, 0x3d, 0xa6, 0xb7, 0xbb, 0xb3, 0x63, 0x6a, 0x37, 0x4f, 0xa1, 0x9e, 0xba,
	0x78, 0x3a, 0x51, 0x17, 0x48, 0x77, 0xa5, 0xde, 0xee, 0x4e, 0x85, 0x9b, 0xf9, 0xb4, 0xf2, 0xcc,
	0xd4, 0xee, 0x9e, 0x72, 0x78, 0x43, 0x08, 0x84, 0x57, 0x4f, 0x52, 0xf3, 0x53, 0xd8, 0x52, 0x96,
	0x3e, 0xad, 0x3c, 0xe7, 0xaa, 0xbb, 0x3b, 0xfb, 0xa6, 0x76, 0xfb, 0x94, 0xc3, 0x9b, 0xd2, 0xd6,
	0xf0, 0xf2, 0x49, 0xe8, 0x1a, 0xff, 0x96, 0x85, 0x0f, 0xae, 0x2b, 0x07, 0xc3, 0x03, 0xe2, 0xe2,
	0x68, 0xe8, 0x07, 0x1e, 0xb1, 0x06, 0xf2, 0x74, 0xa8, 0x7f, 0x96, 0xb9, 0x0a, 0x21, 0xd4, 0x43,
	0x47, 0x00, 0x36, 0xfd, 0x99, 0x2b, 0x51, 0xb2, 0xb7, 0x42, 0xd1, 0x34, 0xd1, 0xcf, 0x33, 0xf0,
	0x01, 0x0f, 0x73, 0x22, 0x85, 0x85, 0xaf, 0x98, 0x44, 0x8a, 0x9b, 0xc3, 0x81, 0x79, 0x4e, 0xbd,
	0x81, 0x15, 0xc8, 0xcf, 0x82, 0xfb, 0x89, 0x5b, 0xe7, 0xeb, 0xc7, 0xbb, 0x7d, 0xc4, 0xf5, 0xf1,
	0xbb, 0x74, 0xba, 0xac, 0x10, 0x31, 0x9e, 0x42, 0x4e, 0xfc, 0xc5, 0x3f, 0xe0, 0x35, 0x9a, 0xb8,
	0xfb, 0x95, 0xd9, 0xfd, 0xe2, 0xc4, 0xac, 0x35, 0xbb, 0xe2, 0x93, 0x61, 0xa7, 0xf9, 0x65, 0xf7,
	0x2b, 0xf3, 0xe8, 0xe4, 0x14, 0x73, 0x5a, 0xc6, 0x08, 0x60, 0x41, 0x96, 0xaa, 0x5a, 0x11, 0x9a,
	0xd1, 0x8a, 0x50, 0x16, 0xce, 0x7e, 0x60, 0x05, 0x23, 0x5f, 0xd6, 0xa6, 0xb2, 0xc5, 0xf2, 0xc3,
	0xb9, 0xe5, 0xf4, 0x4d, 0x8f, 0x58, 0x3e, 0x75, 0xf9, 0xe8, 0xf2, 0x18, 0x18, 0x09, 0x73, 0x0a,
	0xba, 0xcb, 0xf7, 0x62, 0xfe, 0x9d, 0x81, 0xc7, 0x79, 0x86, 0xed, 0xc4, 0xbc, 0x2b, 0x83, 0x88,
	0x4b, 0x04, 0xad, 0x4c, 0x96, 0x4b, 0x7b, 0x4d, 0x9d, 0xfc, 0x89, 0x06, 0x29, 0xce, 0xf4, 0x48,
	0x9b, 0x4e, 0x05, 0x16, 0x76, 0xf3, 0x67, 0xe2, 0x73, 0x5f, 0xb2, 0x93, 0x5b, 0x16, 0xf5, 0xda,
	0x0c, 0xcc, 0x5e, 0x35, 0x03, 0x73, 0x57, 0xce, 0xc0, 0x7c, 0x7c, 0x06, 0x7e, 0x47, 0x15, 0x17,
	0xcc, 0x01, 0xba, 0x63, 0x3c, 0x8e, 0x55, 0xc5, 0xb7, 0xbb, 0x87, 0xfa, 0x97, 0x59, 0xb8, 0x97,
	0x0a, 0x26, 0xc7, 0xfb, 0x11, 0xac, 0x9e, 0x59, 0x3e, 0x61, 0x5b, 0x88, 0xe5, 0xa9, 0x5c, 0x26,
	0x6f, 0xa3, 0x18, 0xa3, 0x3b, 0xae, 0x7a, 0x61, 0x7e, 0x14, 0xa2, 0xde, 0xd8, 0xb4, 0xde, 0x28,
	0xd1, 0x6c, 0x24, 0x8a, 0xc7, 0xd5, 0x37, 0x52, 0x74, 0x1b, 0xd6, 0x15, 0xaa, 0x4b, 0x35, 0xe0,
	0x59, 0xf9, 0x25, 0x81, 0x03, 0xb7, 0x68, 0x08, 0xad, 0xe4, 0x3d, 0x21, 0xff, 0x46, 0xdf, 0x02,
	0xa4, 0x3c, 0x66, 0xf2, 0x6f, 0xc2, 0xfc, 0x5b, 0x22, 0xe3, 0x20, 0x6e, 0xb4, 0xb8, 0x9a, 0x2a,
	0x92, 0x71, 0xa0, 0xd9, 0x2c, 0x05, 0x63, 0x26, 0xe7, 0x42, 0x41, 0xcd, 0xe2, 0x8f, 0x61, 0x4d,
	0x22, 0xc6, 0x0c, 0x16, 0x1f, 0x1d, 0x56, 0x38, 0xa8, 0x66, 0xaf, 0x94, 0x4e, 0x9a, 0xbb, 0x18,
	0x4a, 0xc7, 0xac, 0xdd, 0x85, 0x3b, 0x72, 0xfb, 0x37, 0x7b, 0xa2, 0x6a, 0x33, 0x3d, 0x12, 0x78,
	0x0e, 0x51, 0xdf, 0x1f, 0xd6, 0xc5, 0xe9, 0x56, 0x96, 0x74, 0x58, 0xf0, 0xd0, 0x0b, 0x28, 0x27,
	0xd5, 0xd8, 0x0e, 0x4d, 0x47, 0xe1, 0x87, 0x88, 0x8d, 0x98, 0x5e, 0x57, 0x32, 0x8d, 0xd7, 0xea,
	0xe6, 0x94, 0x31, 0xab, 0x3d, 0x76, 0x70, 0xe3, 0x4f, 0x5f, 0xbe, 0xa5, 0x0b, 0xfd, 0x21, 0xe4,
	0xb9, 0x3a, 0xbf, 0x21, 0xbe, 0x0b, 0x8b, 0xbd, 0xbe, 0xe5, 0xfb, 0x2a, 0x40, 0x8a, 0x78, 0x81,
	0xb7, 0x9b, 0x36, 0x73, 0x79, 0xc7, 0x15, 0x8f, 0x3c, 0x54, 0x98, 0x14, 0x31, 0x28, 0x52, 0xd3,
	0x46, 0x08, 0xe6, 0x5c, 0x6b, 0x40, 0x64, 0xa4, 0xf0, 0xbf, 0xd1, 0x23, 0x28, 0xd8, 0xc4, 0xef,
	0x79, 0x0e, 0xbf, 0xef, 0x96, 0x71, 0xa2, 0x93, 0x8c, 0xdf, 0x85, 0x07, 0xd3, 0x46, 0x23, 0x7d,
	0xf8, 0x7b, 0x50, 0xb4, 0x38, 0xdd, 0xe4, 0x4f, 0x7a, 0x7c, 0x59, 0x6a, 0xaf, 0x6b, 0xe1, 0x1f,
	0x0e, 0x00, 0x2f, 0x59, 0x1a, 0x84, 0xf1, 0xcb, 0x0c, 0xbc, 0xcb, 0xd0, 0xcf, 0xcf, 0xfb, 0xd4,
	0xb2, 0x89, 0x5d, 0x1d, 0x0e, 0x7d, 0xed, 0x6a, 0x47, 0xce, 0xd7, 0x29, 0x2c, 0xfa, 0xbc, 0x40,
	0xa7, 0x9e, 0xfc, 0x3e, 0xf8, 0xbd, 0x44, 0xa6, 0xbe, 0x52, 0x7f, 0x5b, 0x67, 0xe3, 0x10, 0xca,
	0x38, 0x82, 0x25, 0x9d, 0x93, 0xfc, 0x4c, 0x58, 0x80, 0x85, 0x76, 0xbb, 0x4d, 0x49, 0xb3, 0x2a,
	0xdf, 0x2a, 0x34, 0x0e, 0xda, 0x97, 0xcf, 0x71, 0xb5, 0x94, 0x0d, 0x5b, 0x7b, 0xb8, 0x5a, 0x9a,
	0x35, 0x7e, 0xbe, 0x09, 0xc6, 0x55, 0x46, 0xc8, 0x69, 0xea, 0x41, 0xd1, 0xfe, 0xba, 0x37, 0xbc,
	0x7c, 0x8e, 0x2d, 0x9e, 0x03, 0xe4, 0xea, 0x7f, 0xff, 0x86, 0x43, 0x91, 0x1b, 0x8e, 0xb2, 0x82,
	0x43, 0x34, 0x66, 0x70, 0x1c, 0x33, 0xec, 0x64, 0x4f, 0x75, 0x92, 0xfd, 0xd6, 0x9d, 0xec, 0x25,
	0x3b, 0x51, 0x98, 0xe8, 0xa7, 0xb0, 0x34, 0x1c, 0x0e, 0x29, 0x69, 0xca, 0x3e, 0x66, 0x79, 0x1f,
	0x9f, 0xde, 0xae, 0x0f, 0x39, 0xb7, 0xaa, 0x8b, 0x18, 0xe2, 0xd6, 0x7f, 0xcd, 0x43, 0x31, 0x36,
	0x52, 0x76, 0x7e, 0x71, 0x5c, 0xf3, 0xcc, 0xb2, 0xc3, 0x43, 0xfb, 0xb9, 0x47, 0x07, 0x66, 0xaf,
	0xef, 0x10, 0x57, 0x5d, 0x21, 0x6e, 0x3a, 0x6e, 0xcd, 0x52, 0x1f, 0x31, 0x8f, 0x3c, 0x3a, 0x38,
	0xe0, 0xdc, 0x69, 0xba, 0x3e, 0xf1, 0x2e, 0xe5, 0x47, 0xf4, 0x14, 0xdd, 0x0e, 0xe7, 0xa2, 0x67,
	0xb0, 0xe9, 0xb8, 0xa9, 0x7d, 0x8a, 0x64, 0xba, 0xe6, 0xb8, 0x93, 0x1d, 0xa6, 0x28, 0xc9, 0xce,
	0xe6, 0x52, 0x94, 0x64, 0x4f, 0x3b, 0xb0, 0x41, 0x47, 0x41, 0xa8, 0x15, 0x50, 0xa5, 0x23, 0x32,
	0x2b, 0xa2, 0x23, 0xf5, 0x35, 0xb7, 0x4b, 0xa7, 0xaa, 0x48, 0xdb, 0x72, 0x93, 0x2a, 0xd2, 0xb4,
	0xd7, 0xf0, 0x1e, 0xe5, 0x81, 0x6d, 0xee, 0x57, 0x4c, 0xc7, 0xf5, 0x09, 0xab, 0x51, 0x52, 0x3a,
	0x15, 0x99, 0xf7, 0xa1, 0x90, 0xdd, 0xaf, 0x34, 0xa5, 0x64, 0xd2, 0x82, 0x97, 0xf0, 0x9d, 0x08,
	0xce, 0x23, 0x03, 0x7a, 0x19, 0x47, 0x93, 0xf6, 0x88, 0xcc, 0xfc, 0x40, 0xa1, 0x61, 0x21, 0x98,
	0xb4, 0xad, 0x0e, 0x8f, 0x22, 0x30, 0x97, 0x06, 0x91, 0x7d, 0x91, 0x5d, 0x22, 0x63, 0xdf, 0x53,
	0x48, 0x2d, 0x1a, 0x28, 0xd3, 0x42, 0x9b, 0xfe, 0x00, 0x4a, 0x96, 0x6d, 0x3b, 0xe2, 0x41, 0x92,
	0xc9, 0xc3, 0xbd, 0x0c, 0x3c, 0x25, 0xb5, 0x7f, 0x85, 0x58, 0xdb, 0xae, 0x86, 0x98, 0xbc, 0x5d,
	0x77, 0x03, 0xef, 0x2d, 0x5e, 0xb1, 0xe2, 0xd4, 0xad, 0x1a, 0xac, 0xa7, 0x09, 0xa2, 0x12, 0xcc,
	0xbe, 0x21, 0x6f, 0xe5, 0xb1, 0x89, 0xfd, 0x89, 0xd6, 0xf5, 0xa7, 0x89, 0x79, 0xf9, 0xfe, 0xf0,
	0xd3, 0xec, 0x7e, 0x66, 0xeb, 0xdf, 0x73, 0xd2, 0xfb, 0xf7, 0xfe, 0xaf, 0xbd, 0x3f, 0xf2, 0x96,
	0x9d, 0x17, 0x57, 0x79, 0xcb, 0xac, 0xee, 0x2d, 0x3b, 0x2f, 0xae, 0xf7, 0x96, 0x9d, 0x17, 0x57,
	0x78, 0xcb, 0x9c, 0xee, 0x2d, 0x3b, 0x2f, 0xa6, 0x78, 0x8b, 0x66, 0xdb, 0xfe, 0x55, 0xb6, 0xcd,
	0xc7, 0x6c, 0xdb, 0xbf, 0x81, 0x6d, 0xfb, 0x57, 0xd8, 0x96, 0x8b, 0xd9, 0xb6, 0x7f, 0xad, 0x6d,
	0xcf, 0x5e, 0xdc, 0x38, 0xca, 0x9e, 0xdd, 0x60, 0xde, 0x9e, 0xbd, 0xb8, 0x69, 0x94, 0x3d, 0x9b,
	0x36, 0x6f, 0x5f, 0xc0, 0x47, 0x74, 0x14, 0x5c, 0x50, 0xc7, 0xbd, 0x30, 0x07, 0xc1, 0xc8, 0x24,
	0xe3, 0x1e, 0x21, 0x36, 0x49, 0x77, 0x2d, 0x11, 0x6e, 0xef, 0x29, 0x85, 0xd7, 0xc1, 0xa8, 0x2e,
	0xc5, 0x27, 0x1d, 0xed, 0xd7, 0x1b, 0x77, 0x7b, 0xbf, 0xf9, 0xb8, 0xfb, 0xbb, 0x1c, 0x2c, 0xe9,
	0xdb, 0x12, 0xfa, 0x21, 0xdc, 0x77, 0x5c, 0x71, 0x7f, 0x71, 0x45, 0xe0, 0x95, 0x1d, 0x57, 0x7f,
	0x30, 0xa7, 0xcd, 0xc8, 0x54, 0xfd, 0x58, 0xf0, 0xa5, 0xe8, 0xff, 0x3f, 0xdd, 0x7c, 0x7e, 0x0a,
	0xdb, 0x97, 0xc4, 0xb5, 0xa9, 0x67, 0xfa, 0xe2, 0xc5, 0x76, 0xcf, 0x0c, 0xac, 0x8b, 0xeb, 0x03,
	0xe4, 0xb1, 0xd0, 0x92, 0xcf, 0xbc, 0x7b, 0x5d, 0xeb, 0x62, 0x5a, 0xa4, 0xfc, 0x04, 0x3e, 0x49,
	0xeb, 0xe1, 0xba, 0x98, 0xf9, 0x70, 0xa2, 0x83, 0xdf, 0x74, 0xf0, 0x7c, 0x33, 0x35, 0x78, 0x4e,
	0xbe, 0xfd, 0xb9, 0xea, 0x37, 0x17, 0x3b, 0xb5, 0x05, 0x98, 0xe7, 0x46, 0x1b, 0xff, 0x91, 0x87,
	0x95, 0x63, 0x12, 0xf0, 0xe7, 0xf3, 0xea, 0x00, 0xff, 0xfd, 0xc4, 0x7b, 0xf4, 0x42, 0xe5, 0x9d,
	0xf8, 0xa0, 0x12, 0x2f, 0xdf, 0x1b, 0x33, 0xd1, 0x83, 0x75, 0xf4, 0x7d, 0x58, 0x18, 0x89, 0xd7,
	0xd9, 0xf2, 0x30, 0xfb, 0x70, 0xfa, 0xeb, 0x6d, 0xa5, 0xad, 0x34, 0x50, 0x15, 0x0a, 0x54, 0xbc,
	0xcb, 0xe5, 0x00, 0xb3, 0x69, 0x9d, 0x27, 0x1e, 0xee, 0x36, 0x66, 0xb0, 0xae, 0x83, 0x9a, 0xfc,
	0x51, 0x8e, 0xf6, 0x84, 0x93, 0xc7, 0x51, 0x9a, 0x19, 0xf1, 0x97, 0x9e, 0x8d, 0x19, 0x9c, 0x50,
	0x44, 0x18, 0x8a, 0x24, 0xf8, 0x3a, 0x7a, 0x4f, 0xc8, 0xa3, 0x2b, 0xfe, 0x51, 0xf2, 0x9a, 0xa7,
	0x87, 0xec, 0x30, 0x1e, 0x83, 0x40, 0xbf, 0xcd, 0x1f, 0x9d, 0x48, 0x36, 0x8f, 0xbd, 0x42, 0xe5,
	0xde, 0x04, 0x60, 0xf4, 0x0a, 0xa6, 0x31, 0x83, 0x35, 0x05, 0x54, 0x03, 0xa0, 0xdc, 0x72, 0x3e,
	0xb2, 0x85, 0x89, 0x0f, 0xba, 0xa9, 0x0f, 0x4a, 0x18, 0x46, 0xa4, 0x85, 0x5e, 0xc1, 0x02, 0x75,
	0x47, 0x1c, 0x60, 0x91, 0x03, 0x3c, 0xbd, 0xc5, 0x45, 0x5a, 0xb8, 0x64, 0x12, 0x02, 0xed, 0x83,
	0xba, 0x89, 0xe1, 0x01, 0x54, 0xa8, 0xdc, 0x8f, 0xa3, 0xc5, 0x9f, 0x6f, 0x30, 0x4d, 0x29, 0x8e,
	0x5e, 0xc2, 0x12, 0x15, 0x75, 0x6a, 0x47, 0xc6, 0x0f, 0x53, 0x7f, 0x7f, 0x62, 0x34, 0x69, 0xf7,
	0x3a, 0xac, 0x04, 0xd1, 0x95, 0x51, 0x15, 0x80, 0x86, 0x97, 0x60, 0xfc, 0x32, 0x77, 0x72, 0xc9,
	0xfb, 0x93, 0xc6, 0x68, 0x4a, 0xa8, 0x0b, 0x2b, 0xd4, 0x1d, 0xe9, 0x35, 0x33, 0xbf, 0xdc, 0x2d,
	0x54, 0x1e, 0xa7, 0x9a, 0x94, 0x72, 0x55, 0xd0, 0x98, 0xc1, 0x49, 0x08, 0xf4, 0x13, 0x40, 0x34,
	0x99, 0x03, 0xc4, 0xe5, 0x6f, 0xa1, 0xf2, 0xf1, 0x6d, 0xea, 0xe2, 0xc6, 0x0c, 0x4e, 0x41, 0x42,
	0xa7, 0x50, 0xa2, 0x89, 0x2f, 0xe3, 0xfc, 0x7e, 0xb8, 0x50, 0xf9, 0x70, 0xc2, 0xec, 0xf4, 0xd7,
	0x88, 0x8d, 0x19, 0x3c, 0x01, 0x81, 0xda, 0x7c, 0x32, 0xf4, 0x0f, 0xed, 0xfc, 0x4b, 0x66, 0xa1,
	0xf2, 0xde, 0x04, 0x6a, 0xca, 0xc3, 0x0d, 0x39, 0x11, 0x3a, 0x27, 0x8c, 0x6d, 0xf1, 0x4c, 0x86,
	0x7f, 0xea, 0x9c, 0x88, 0xed, 0xc4, 0x03, 0x9d, 0x30, 0xb6, 0x5d, 0xb5, 0xc8, 0xac, 0xd9, 0x72,
	0xa5, 0xc3, 0xac, 0xa6, 0x41, 0x24, 0x9e, 0xc5, 0x48, 0x08, 0xa5, 0x53, 0xcb, 0xc3, 0x82, 0x27,
	0x38, 0xc6, 0x3f, 0x17, 0xf9, 0xbb, 0x35, 0x99, 0xfa, 0x64, 0xd9, 0xff, 0x69, 0x78, 0x43, 0x29,
	0xae, 0x2e, 0x8c, 0x38, 0x7a, 0x4c, 0x78, 0xbb, 0xc3, 0x25, 0xc3, 0x5b, 0xcc, 0x3a, 0xe4, 0x89,
	0xe7, 0x89, 0x1b, 0x4b, 0xf9, 0x2b, 0x87, 0x0f, 0xaf, 0x52, 0xe7, 0xc7, 0x08, 0x21, 0x8e, 0x23,
	0x4d, 0xf4, 0x03, 0x2d, 0xfd, 0xce, 0x4e, 0x3c, 0x28, 0x4c, 0xf9, 0x01, 0x51, 0x2c, 0xff, 0xfe,
	0x20, 0xca, 0xbf, 0x73, 0x53, 0xd2, 0x43, 0xe2, 0xd7, 0x33, 0x7a, 0x02, 0x7e, 0x09, 0x4b, 0x43,
	0x91, 0x5c, 0x03, 0x97, 0x78, 0xbe, 0xcc, 0x78, 0xef, 0x5f, 0x99, 0x81, 0x35, 0x9c, 0x98, 0x32,
	0xfa, 0x6c, 0x22, 0x15, 0xe7, 0xa6, 0x38, 0x66, 0xfa, 0xa3, 0xfb, 0x94, 0x94, 0x7c, 0x06, 0xab,
	0xb1, 0x7c, 0xaa, 0xa5, 0xc1, 0xca, 0xcd, 0xd3, 0xb2, 0xd6, 0xc1, 0x24, 0x1c, 0xaa, 0xc7, 0x52,
	0xb4, 0x48, 0x91, 0xdf, 0xb9, 0x22, 0x45, 0x6b, 0x68, 0x7a, 0xaa, 0x7e, 0xc9, 0x47, 0xdf, 0xa6,
	0xae, 0x9a, 0x27, 0x99, 0x1f, 0xdf, 0xbd, 0x22, 0x5d, 0xc7, 0xc6, 0xad, 0xa9, 0xa2, 0x53, 0xfe,
	0x70, 0x2f, 0x44, 0x12, 0xa9, 0x72, 0xe7, 0xd6, 0x1f, 0x40, 0x78, 0x34, 0x44, 0x38, 0xe8, 0x7b,
	0x51, 0xf2, 0x2e, 0xa4, 0x05, 0x53, 0xe2, 0xbe, 0x5f, 0xcf, 0xde, 0xaf, 0x12, 0xd9, 0x7b, 0x69,
	0xe2, 0xc3, 0xcf, 0x15, 0x17, 0xe9, 0x13, 0xe9, 0xbb, 0x16, 0x4b, 0xdf, 0xc5, 0x54, 0xc7, 0xed,
	0xa7, 0x98, 0xa3, 0xe7, 0xef, 0xd3, 0xc9, 0xfc, 0x2d, 0x12, 0xe1, 0x47, 0x37, 0xc8, 0xdf, 0x21,
	0xe2, 0x44, 0x02, 0x37, 0x53, 0x13, 0xb8, 0x48, 0x86, 0x9f, 0xdc, 0xea, 0xb0, 0x37, 0x25, 0x83,
	0x9f, 0x43, 0x39, 0x99, 0x7e, 0x95, 0x86, 0xcc, 0x92, 0x8f, 0xaf, 0xcf, 0xe4, 0x61, 0x0f, 0x53,
	0xb1, 0x90, 0x05, 0x77, 0x68, 0xfa, 0x13, 0x2c, 0x99, 0x49, 0xdf, 0xbf, 0x26, 0xb5, 0x87, 0x7d,
	0x4c, 0xc3, 0x41, 0x18, 0xd6, 0xb4, 0x7c, 0x1d, 0xc2, 0xa3, 0xb4, 0x2c, 0x96, 0x94, 0x6a, 0xcc,
	0xe0, 0x34, 0x65, 0x89, 0xa9, 0x12, 0x78, 0x88, 0xb9, 0x96, 0x86, 0x99, 0x7c, 0xb7, 0x28, 0x31,
	0x93, 0xca, 0xc6, 0x0e, 0xe4, 0x44, 0xee, 0x46, 0xeb, 0x50, 0xea, 0x74, 0xab, 0xdd, 0xd3, 0x4e,
	0xec, 0x87, 0x6f, 0x39, 0xc8, 0x9e, 0xbc, 0x2c, 0x65, 0xf8, 0x4f, 0x59, 0x31, 0x3e, 0xc1, 0xa5,
	0xac, 0xf1, 0xd7, 0x19, 0x28, 0x68, 0x09, 0x9b, 0x29, 0xe2, 0x7a, 0xb5, 0x73, 0xd2, 0x8a, 0x29,
	0xae, 0x40, 0xe1, 0xb4, 0xd5, 0x39, 0x6d, 0xb7, 0x4f, 0x70, 0x97, 0xff, 0x6a, 0x6e, 0x03, 0x56,
	0x9b, 0xad, 0xcf, 0xab, 0xaf, 0x9a, 0x87, 0xe6, 0x61, 0xfd, 0xf3, 0xe6, 0x41, 0xdd, 0x6c, 0x1e,
	0x96, 0xb2, 0x3a, 0x99, 0x89, 0x9a, 0xdd, 0xaf, 0xda, 0xf5, 0xd2, 0x2c, 0x2a, 0xc0, 0x42, 0xb7,
	0xf9, 0xba, 0x7e, 0x72, 0xda, 0x2d, 0xcd, 0xb1, 0x1e, 0x94, 0x0c, 0xae, 0x7f, 0x26, 0x44, 0xe6,
	0x11, 0x82, 0xe5, 0x66, 0xab, 0x5b, 0xc7, 0xad, 0xea, 0x2b, 0x53, 0xd8, 0x96, 0x13, 0x34, 0xbd,
	0x93, 0xd2, 0x42, 0x0d, 0x60, 0xd1, 0x53, 0xc3, 0xfd, 0xab, 0x0c, 0x94, 0xaa, 0xc3, 0xa1, 0x74,
	0x4f, 0xf1, 0x63, 0x48, 0xf4, 0x01, 0x2c, 0x13, 0xd7, 0x3a, 0xeb, 0x13, 0x75, 0x6f, 0xc6, 0x77,
	0xbc, 0x45, 0x9c, 0xa0, 0x26, 0xe4, 0xf6, 0x70, 0x95, 0x6f, 0x6d, 0x71, 0xb9, 0x3d, 0x5c, 0x45,
	0xef, 0x41, 0x51, 0x50, 0x58, 0x49, 0x53, 0x6f, 0x56, 0xe5, 0x1b, 0xe1, 0x38, 0x11, 0x19, 0xb0,
	0x64, 0xf5, 0x7a, 0xc4, 0xf7, 0x5b, 0xd4, 0x26, 0xcd, 0x43, 0xf9, 0x09, 0x23, 0x46, 0x33, 0xfe,
	0x3b, 0x03, 0x6b, 0x91, 0xb9, 0x3c, 0x41, 0x72, 0x8b, 0xaf, 0x7f, 0xbd, 0xfc, 0x12, 0x60, 0x48,
	0x3c, 0xb9, 0xbf, 0x95, 0xe7, 0x79, 0x41, 0xf6, 0x5b, 0xfa, 0x87, 0x8d, 0x49, 0xd4, 0xed, 0x36,
	0x57, 0x10, 0x0d, 0xac, 0xa9, 0x6f, 0x8d, 0x61, 0x49, 0xe7, 0xb1, 0x01, 0x5a, 0x17, 0xc4, 0x0d,
	0x58, 0xad, 0x19, 0x30, 0xdb, 0x45, 0x55, 0x15, 0x27, 0xb2, 0xe9, 0xe2, 0x84, 0x03, 0xc7, 0xeb,
	0x8d, 0x9c, 0xa0, 0x79, 0x28, 0x3f, 0xe0, 0x24, 0xa8, 0x68, 0x0b, 0x16, 0xa9, 0xd8, 0x8a, 0x6d,
	0xf5, 0xfb, 0x62, 0xd5, 0x36, 0xfe, 0x33, 0x03, 0x2b, 0x9d, 0x44, 0x51, 0x96, 0xfc, 0xb5, 0x76,
	0xe6, 0xa6, 0xbf, 0xd6, 0x46, 0x2f, 0x01, 0x59, 0xc3, 0xa1, 0x29, 0x33, 0x4f, 0xfc, 0xd7, 0xde,
	0xf7, 0x52, 0x27, 0x27, 0xc4, 0x29, 0x59, 0x49, 0xaf, 0x39, 0x85, 0x4d, 0x1d, 0x8c, 0xba, 0x23,
	0x05, 0x38, 0x79, 0x54, 0x49, 0x99, 0x6d, 0x16, 0x90, 0xd6, 0x24, 0x59, 0x3f, 0x96, 0xfd, 0x7d,
	0x16, 0x4a, 0x9d, 0xdb, 0x1c, 0xcb, 0x3a, 0xbf, 0xda, 0xb1, 0xac, 0x73, 0xb3, 0x63, 0xd9, 0xb7,
	0xc9, 0x19, 0xdf, 0xfc, 0x3a, 0x53, 0xc6, 0x5d, 0xd8, 0x50, 0xe4, 0x93, 0xd6, 0xa9, 0xc6, 0x9a,
	0xd5, 0xe3, 0xff, 0xb4, 0xd5, 0x64, 0xb4, 0x39, 0xc3, 0x81, 0x8d, 0x8e, 0xe3, 0x5e, 0xf4, 0x49,
	0xb2, 0xba, 0xdf, 0x82, 0xc5, 0xc0, 0xf2, 0x2e, 0x48, 0x10, 0x86, 0x50, 0xd8, 0x46, 0xcf, 0xc3,
	0x65, 0x90, 0xfe, 0xb1, 0x95, 0x7a, 0x7e, 0xe5, 0x12, 0x38, 0x5c, 0xb1, 0xcf, 0x60, 0x33, 0xd9,
	0x95, 0x5c, 0xb6, 0x17, 0x51, 0x12, 0x92, 0x0e, 0x7b, 0xef, 0x8a, 0x03, 0x31, 0x8e, 0x32, 0x56,
	0x68, 0x7d, 0xe7, 0xd7, 0x65, 0x7d, 0xe7, 0x5a, 0xeb, 0x3b, 0xb7, 0xb3, 0xbe, 0x33, 0xd5, 0xfa,
	0xca, 0xdf, 0x64, 0x20, 0x5f, 0x57, 0x82, 0x08, 0x43, 0xe1, 0x98, 0x04, 0xf5, 0xb1, 0x10, 0x47,
	0xfa, 0xb1, 0x26, 0x75, 0x85, 0xb6, 0xde, 0xbd, 0x42, 0x22, 0xdc, 0x14, 0x0b, 0x9d, 0x2b, 0x31,
	0x3b, 0xd7, 0x62, 0x26, 0xed, 0xaf, 0x61, 0x78, 0x87, 0x7a, 0x17, 0xdb, 0x74, 0x48, 0xdc, 0x1e,
	0xf5, 0xec, 0x6d, 0xf1, 0xcf, 0x4a, 0x44, 0x7a, 0x3f, 0xde, 0xb9, 0x70, 0x82, 0xaf, 0x47, 0x67,
	0xdb, 0x3d, 0x3a, 0x78, 0xa2, 0xa4, 0x9e, 0x08, 0xa9, 0x4f, 0xe4, 0x3f, 0x3e, 0x71, 0xb9, 0xfb,
	0xe4, 0x82, 0x46, 0xff, 0xd4, 0xc5, 0x59, 0x8e, 0xd3, 0x9f, 0xfd, 0x4f, 0x00, 0x00, 0x00, 0xff,
	0xff, 0xa2, 0xb9, 0x08, 0xdb, 0x0c, 0x43, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// ExtensionClient is the client API for Extension service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ExtensionClient interface {
	// Get a single attribute
	GetExtValue(ctx context.Context, in *SingleGetValueRequest, opts ...grpc.CallOption) (*SingleGetValueResponse, error)
	// Set a single attribute
	SetExtValue(ctx context.Context, in *SingleSetValueRequest, opts ...grpc.CallOption) (*SingleSetValueResponse, error)
}

type extensionClient struct {
	cc *grpc.ClientConn
}

func NewExtensionClient(cc *grpc.ClientConn) ExtensionClient {
	return &extensionClient{cc}
}

func (c *extensionClient) GetExtValue(ctx context.Context, in *SingleGetValueRequest, opts ...grpc.CallOption) (*SingleGetValueResponse, error) {
	out := new(SingleGetValueResponse)
	err := c.cc.Invoke(ctx, "/extension.Extension/GetExtValue", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *extensionClient) SetExtValue(ctx context.Context, in *SingleSetValueRequest, opts ...grpc.CallOption) (*SingleSetValueResponse, error) {
	out := new(SingleSetValueResponse)
	err := c.cc.Invoke(ctx, "/extension.Extension/SetExtValue", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ExtensionServer is the server API for Extension service.
type ExtensionServer interface {
	// Get a single attribute
	GetExtValue(context.Context, *SingleGetValueRequest) (*SingleGetValueResponse, error)
	// Set a single attribute
	SetExtValue(context.Context, *SingleSetValueRequest) (*SingleSetValueResponse, error)
}

// UnimplementedExtensionServer can be embedded to have forward compatible implementations.
type UnimplementedExtensionServer struct {
}

func (*UnimplementedExtensionServer) GetExtValue(ctx context.Context, req *SingleGetValueRequest) (*SingleGetValueResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetExtValue not implemented")
}
func (*UnimplementedExtensionServer) SetExtValue(ctx context.Context, req *SingleSetValueRequest) (*SingleSetValueResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SetExtValue not implemented")
}

func RegisterExtensionServer(s *grpc.Server, srv ExtensionServer) {
	s.RegisterService(&_Extension_serviceDesc, srv)
}

func _Extension_GetExtValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SingleGetValueRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExtensionServer).GetExtValue(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/extension.Extension/GetExtValue",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExtensionServer).GetExtValue(ctx, req.(*SingleGetValueRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Extension_SetExtValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SingleSetValueRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExtensionServer).SetExtValue(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/extension.Extension/SetExtValue",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExtensionServer).SetExtValue(ctx, req.(*SingleSetValueRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Extension_serviceDesc = grpc.ServiceDesc{
	ServiceName: "extension.Extension",
	HandlerType: (*ExtensionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetExtValue",
			Handler:    _Extension_GetExtValue_Handler,
		},
		{
			MethodName: "SetExtValue",
			Handler:    _Extension_SetExtValue_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "voltha_protos/extensions.proto",
}
