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

package openolt

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "google.golang.org/genproto/googleapis/api/annotations"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// 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.ProtoPackageIsVersion2 // please upgrade the proto package

type Indication struct {
	// Types that are valid to be assigned to Data:
	//	*Indication_OltInd
	//	*Indication_IntfInd
	//	*Indication_IntfOperInd
	//	*Indication_OnuDiscInd
	//	*Indication_OnuInd
	//	*Indication_OmciInd
	//	*Indication_PktInd
	//	*Indication_PortStats
	//	*Indication_FlowStats
	//	*Indication_AlarmInd
	Data                 isIndication_Data `protobuf_oneof:"data"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (m *Indication) Reset()         { *m = Indication{} }
func (m *Indication) String() string { return proto.CompactTextString(m) }
func (*Indication) ProtoMessage()    {}
func (*Indication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{0}
}
func (m *Indication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Indication.Unmarshal(m, b)
}
func (m *Indication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Indication.Marshal(b, m, deterministic)
}
func (dst *Indication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Indication.Merge(dst, src)
}
func (m *Indication) XXX_Size() int {
	return xxx_messageInfo_Indication.Size(m)
}
func (m *Indication) XXX_DiscardUnknown() {
	xxx_messageInfo_Indication.DiscardUnknown(m)
}

var xxx_messageInfo_Indication proto.InternalMessageInfo

type isIndication_Data interface {
	isIndication_Data()
}

type Indication_OltInd struct {
	OltInd *OltIndication `protobuf:"bytes,1,opt,name=olt_ind,json=oltInd,oneof"`
}
type Indication_IntfInd struct {
	IntfInd *IntfIndication `protobuf:"bytes,2,opt,name=intf_ind,json=intfInd,oneof"`
}
type Indication_IntfOperInd struct {
	IntfOperInd *IntfOperIndication `protobuf:"bytes,3,opt,name=intf_oper_ind,json=intfOperInd,oneof"`
}
type Indication_OnuDiscInd struct {
	OnuDiscInd *OnuDiscIndication `protobuf:"bytes,4,opt,name=onu_disc_ind,json=onuDiscInd,oneof"`
}
type Indication_OnuInd struct {
	OnuInd *OnuIndication `protobuf:"bytes,5,opt,name=onu_ind,json=onuInd,oneof"`
}
type Indication_OmciInd struct {
	OmciInd *OmciIndication `protobuf:"bytes,6,opt,name=omci_ind,json=omciInd,oneof"`
}
type Indication_PktInd struct {
	PktInd *PacketIndication `protobuf:"bytes,7,opt,name=pkt_ind,json=pktInd,oneof"`
}
type Indication_PortStats struct {
	PortStats *PortStatistics `protobuf:"bytes,8,opt,name=port_stats,json=portStats,oneof"`
}
type Indication_FlowStats struct {
	FlowStats *FlowStatistics `protobuf:"bytes,9,opt,name=flow_stats,json=flowStats,oneof"`
}
type Indication_AlarmInd struct {
	AlarmInd *AlarmIndication `protobuf:"bytes,10,opt,name=alarm_ind,json=alarmInd,oneof"`
}

func (*Indication_OltInd) isIndication_Data()      {}
func (*Indication_IntfInd) isIndication_Data()     {}
func (*Indication_IntfOperInd) isIndication_Data() {}
func (*Indication_OnuDiscInd) isIndication_Data()  {}
func (*Indication_OnuInd) isIndication_Data()      {}
func (*Indication_OmciInd) isIndication_Data()     {}
func (*Indication_PktInd) isIndication_Data()      {}
func (*Indication_PortStats) isIndication_Data()   {}
func (*Indication_FlowStats) isIndication_Data()   {}
func (*Indication_AlarmInd) isIndication_Data()    {}

func (m *Indication) GetData() isIndication_Data {
	if m != nil {
		return m.Data
	}
	return nil
}

func (m *Indication) GetOltInd() *OltIndication {
	if x, ok := m.GetData().(*Indication_OltInd); ok {
		return x.OltInd
	}
	return nil
}

func (m *Indication) GetIntfInd() *IntfIndication {
	if x, ok := m.GetData().(*Indication_IntfInd); ok {
		return x.IntfInd
	}
	return nil
}

func (m *Indication) GetIntfOperInd() *IntfOperIndication {
	if x, ok := m.GetData().(*Indication_IntfOperInd); ok {
		return x.IntfOperInd
	}
	return nil
}

func (m *Indication) GetOnuDiscInd() *OnuDiscIndication {
	if x, ok := m.GetData().(*Indication_OnuDiscInd); ok {
		return x.OnuDiscInd
	}
	return nil
}

func (m *Indication) GetOnuInd() *OnuIndication {
	if x, ok := m.GetData().(*Indication_OnuInd); ok {
		return x.OnuInd
	}
	return nil
}

func (m *Indication) GetOmciInd() *OmciIndication {
	if x, ok := m.GetData().(*Indication_OmciInd); ok {
		return x.OmciInd
	}
	return nil
}

func (m *Indication) GetPktInd() *PacketIndication {
	if x, ok := m.GetData().(*Indication_PktInd); ok {
		return x.PktInd
	}
	return nil
}

func (m *Indication) GetPortStats() *PortStatistics {
	if x, ok := m.GetData().(*Indication_PortStats); ok {
		return x.PortStats
	}
	return nil
}

func (m *Indication) GetFlowStats() *FlowStatistics {
	if x, ok := m.GetData().(*Indication_FlowStats); ok {
		return x.FlowStats
	}
	return nil
}

func (m *Indication) GetAlarmInd() *AlarmIndication {
	if x, ok := m.GetData().(*Indication_AlarmInd); ok {
		return x.AlarmInd
	}
	return nil
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*Indication) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
	return _Indication_OneofMarshaler, _Indication_OneofUnmarshaler, _Indication_OneofSizer, []interface{}{
		(*Indication_OltInd)(nil),
		(*Indication_IntfInd)(nil),
		(*Indication_IntfOperInd)(nil),
		(*Indication_OnuDiscInd)(nil),
		(*Indication_OnuInd)(nil),
		(*Indication_OmciInd)(nil),
		(*Indication_PktInd)(nil),
		(*Indication_PortStats)(nil),
		(*Indication_FlowStats)(nil),
		(*Indication_AlarmInd)(nil),
	}
}

func _Indication_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*Indication)
	// data
	switch x := m.Data.(type) {
	case *Indication_OltInd:
		b.EncodeVarint(1<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OltInd); err != nil {
			return err
		}
	case *Indication_IntfInd:
		b.EncodeVarint(2<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.IntfInd); err != nil {
			return err
		}
	case *Indication_IntfOperInd:
		b.EncodeVarint(3<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.IntfOperInd); err != nil {
			return err
		}
	case *Indication_OnuDiscInd:
		b.EncodeVarint(4<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuDiscInd); err != nil {
			return err
		}
	case *Indication_OnuInd:
		b.EncodeVarint(5<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuInd); err != nil {
			return err
		}
	case *Indication_OmciInd:
		b.EncodeVarint(6<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OmciInd); err != nil {
			return err
		}
	case *Indication_PktInd:
		b.EncodeVarint(7<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.PktInd); err != nil {
			return err
		}
	case *Indication_PortStats:
		b.EncodeVarint(8<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.PortStats); err != nil {
			return err
		}
	case *Indication_FlowStats:
		b.EncodeVarint(9<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.FlowStats); err != nil {
			return err
		}
	case *Indication_AlarmInd:
		b.EncodeVarint(10<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.AlarmInd); err != nil {
			return err
		}
	case nil:
	default:
		return fmt.Errorf("Indication.Data has unexpected type %T", x)
	}
	return nil
}

func _Indication_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*Indication)
	switch tag {
	case 1: // data.olt_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OltIndication)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_OltInd{msg}
		return true, err
	case 2: // data.intf_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(IntfIndication)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_IntfInd{msg}
		return true, err
	case 3: // data.intf_oper_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(IntfOperIndication)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_IntfOperInd{msg}
		return true, err
	case 4: // data.onu_disc_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuDiscIndication)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_OnuDiscInd{msg}
		return true, err
	case 5: // data.onu_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuIndication)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_OnuInd{msg}
		return true, err
	case 6: // data.omci_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OmciIndication)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_OmciInd{msg}
		return true, err
	case 7: // data.pkt_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(PacketIndication)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_PktInd{msg}
		return true, err
	case 8: // data.port_stats
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(PortStatistics)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_PortStats{msg}
		return true, err
	case 9: // data.flow_stats
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(FlowStatistics)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_FlowStats{msg}
		return true, err
	case 10: // data.alarm_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(AlarmIndication)
		err := b.DecodeMessage(msg)
		m.Data = &Indication_AlarmInd{msg}
		return true, err
	default:
		return false, nil
	}
}

func _Indication_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*Indication)
	// data
	switch x := m.Data.(type) {
	case *Indication_OltInd:
		s := proto.Size(x.OltInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Indication_IntfInd:
		s := proto.Size(x.IntfInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Indication_IntfOperInd:
		s := proto.Size(x.IntfOperInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Indication_OnuDiscInd:
		s := proto.Size(x.OnuDiscInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Indication_OnuInd:
		s := proto.Size(x.OnuInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Indication_OmciInd:
		s := proto.Size(x.OmciInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Indication_PktInd:
		s := proto.Size(x.PktInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Indication_PortStats:
		s := proto.Size(x.PortStats)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Indication_FlowStats:
		s := proto.Size(x.FlowStats)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *Indication_AlarmInd:
		s := proto.Size(x.AlarmInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

type AlarmIndication struct {
	// Types that are valid to be assigned to Data:
	//	*AlarmIndication_LosInd
	//	*AlarmIndication_DyingGaspInd
	//	*AlarmIndication_OnuAlarmInd
	//	*AlarmIndication_OnuStartupFailInd
	//	*AlarmIndication_OnuSignalDegradeInd
	//	*AlarmIndication_OnuDriftOfWindowInd
	//	*AlarmIndication_OnuLossOmciInd
	//	*AlarmIndication_OnuSignalsFailInd
	//	*AlarmIndication_OnuTiwiInd
	//	*AlarmIndication_OnuActivationFailInd
	//	*AlarmIndication_OnuProcessingErrorInd
	Data                 isAlarmIndication_Data `protobuf_oneof:"data"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (m *AlarmIndication) Reset()         { *m = AlarmIndication{} }
func (m *AlarmIndication) String() string { return proto.CompactTextString(m) }
func (*AlarmIndication) ProtoMessage()    {}
func (*AlarmIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{1}
}
func (m *AlarmIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AlarmIndication.Unmarshal(m, b)
}
func (m *AlarmIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AlarmIndication.Marshal(b, m, deterministic)
}
func (dst *AlarmIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AlarmIndication.Merge(dst, src)
}
func (m *AlarmIndication) XXX_Size() int {
	return xxx_messageInfo_AlarmIndication.Size(m)
}
func (m *AlarmIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_AlarmIndication.DiscardUnknown(m)
}

var xxx_messageInfo_AlarmIndication proto.InternalMessageInfo

type isAlarmIndication_Data interface {
	isAlarmIndication_Data()
}

type AlarmIndication_LosInd struct {
	LosInd *LosIndication `protobuf:"bytes,1,opt,name=los_ind,json=losInd,oneof"`
}
type AlarmIndication_DyingGaspInd struct {
	DyingGaspInd *DyingGaspIndication `protobuf:"bytes,2,opt,name=dying_gasp_ind,json=dyingGaspInd,oneof"`
}
type AlarmIndication_OnuAlarmInd struct {
	OnuAlarmInd *OnuAlarmIndication `protobuf:"bytes,3,opt,name=onu_alarm_ind,json=onuAlarmInd,oneof"`
}
type AlarmIndication_OnuStartupFailInd struct {
	OnuStartupFailInd *OnuStartupFailureIndication `protobuf:"bytes,4,opt,name=onu_startup_fail_ind,json=onuStartupFailInd,oneof"`
}
type AlarmIndication_OnuSignalDegradeInd struct {
	OnuSignalDegradeInd *OnuSignalDegradeIndication `protobuf:"bytes,5,opt,name=onu_signal_degrade_ind,json=onuSignalDegradeInd,oneof"`
}
type AlarmIndication_OnuDriftOfWindowInd struct {
	OnuDriftOfWindowInd *OnuDriftOfWindowIndication `protobuf:"bytes,6,opt,name=onu_drift_of_window_ind,json=onuDriftOfWindowInd,oneof"`
}
type AlarmIndication_OnuLossOmciInd struct {
	OnuLossOmciInd *OnuLossOfOmciChannelIndication `protobuf:"bytes,7,opt,name=onu_loss_omci_ind,json=onuLossOmciInd,oneof"`
}
type AlarmIndication_OnuSignalsFailInd struct {
	OnuSignalsFailInd *OnuSignalsFailureIndication `protobuf:"bytes,8,opt,name=onu_signals_fail_ind,json=onuSignalsFailInd,oneof"`
}
type AlarmIndication_OnuTiwiInd struct {
	OnuTiwiInd *OnuTransmissionInterferenceWarning `protobuf:"bytes,9,opt,name=onu_tiwi_ind,json=onuTiwiInd,oneof"`
}
type AlarmIndication_OnuActivationFailInd struct {
	OnuActivationFailInd *OnuActivationFailureIndication `protobuf:"bytes,10,opt,name=onu_activation_fail_ind,json=onuActivationFailInd,oneof"`
}
type AlarmIndication_OnuProcessingErrorInd struct {
	OnuProcessingErrorInd *OnuProcessingErrorIndication `protobuf:"bytes,11,opt,name=onu_processing_error_ind,json=onuProcessingErrorInd,oneof"`
}

func (*AlarmIndication_LosInd) isAlarmIndication_Data()                {}
func (*AlarmIndication_DyingGaspInd) isAlarmIndication_Data()          {}
func (*AlarmIndication_OnuAlarmInd) isAlarmIndication_Data()           {}
func (*AlarmIndication_OnuStartupFailInd) isAlarmIndication_Data()     {}
func (*AlarmIndication_OnuSignalDegradeInd) isAlarmIndication_Data()   {}
func (*AlarmIndication_OnuDriftOfWindowInd) isAlarmIndication_Data()   {}
func (*AlarmIndication_OnuLossOmciInd) isAlarmIndication_Data()        {}
func (*AlarmIndication_OnuSignalsFailInd) isAlarmIndication_Data()     {}
func (*AlarmIndication_OnuTiwiInd) isAlarmIndication_Data()            {}
func (*AlarmIndication_OnuActivationFailInd) isAlarmIndication_Data()  {}
func (*AlarmIndication_OnuProcessingErrorInd) isAlarmIndication_Data() {}

func (m *AlarmIndication) GetData() isAlarmIndication_Data {
	if m != nil {
		return m.Data
	}
	return nil
}

func (m *AlarmIndication) GetLosInd() *LosIndication {
	if x, ok := m.GetData().(*AlarmIndication_LosInd); ok {
		return x.LosInd
	}
	return nil
}

func (m *AlarmIndication) GetDyingGaspInd() *DyingGaspIndication {
	if x, ok := m.GetData().(*AlarmIndication_DyingGaspInd); ok {
		return x.DyingGaspInd
	}
	return nil
}

func (m *AlarmIndication) GetOnuAlarmInd() *OnuAlarmIndication {
	if x, ok := m.GetData().(*AlarmIndication_OnuAlarmInd); ok {
		return x.OnuAlarmInd
	}
	return nil
}

func (m *AlarmIndication) GetOnuStartupFailInd() *OnuStartupFailureIndication {
	if x, ok := m.GetData().(*AlarmIndication_OnuStartupFailInd); ok {
		return x.OnuStartupFailInd
	}
	return nil
}

func (m *AlarmIndication) GetOnuSignalDegradeInd() *OnuSignalDegradeIndication {
	if x, ok := m.GetData().(*AlarmIndication_OnuSignalDegradeInd); ok {
		return x.OnuSignalDegradeInd
	}
	return nil
}

func (m *AlarmIndication) GetOnuDriftOfWindowInd() *OnuDriftOfWindowIndication {
	if x, ok := m.GetData().(*AlarmIndication_OnuDriftOfWindowInd); ok {
		return x.OnuDriftOfWindowInd
	}
	return nil
}

func (m *AlarmIndication) GetOnuLossOmciInd() *OnuLossOfOmciChannelIndication {
	if x, ok := m.GetData().(*AlarmIndication_OnuLossOmciInd); ok {
		return x.OnuLossOmciInd
	}
	return nil
}

func (m *AlarmIndication) GetOnuSignalsFailInd() *OnuSignalsFailureIndication {
	if x, ok := m.GetData().(*AlarmIndication_OnuSignalsFailInd); ok {
		return x.OnuSignalsFailInd
	}
	return nil
}

func (m *AlarmIndication) GetOnuTiwiInd() *OnuTransmissionInterferenceWarning {
	if x, ok := m.GetData().(*AlarmIndication_OnuTiwiInd); ok {
		return x.OnuTiwiInd
	}
	return nil
}

func (m *AlarmIndication) GetOnuActivationFailInd() *OnuActivationFailureIndication {
	if x, ok := m.GetData().(*AlarmIndication_OnuActivationFailInd); ok {
		return x.OnuActivationFailInd
	}
	return nil
}

func (m *AlarmIndication) GetOnuProcessingErrorInd() *OnuProcessingErrorIndication {
	if x, ok := m.GetData().(*AlarmIndication_OnuProcessingErrorInd); ok {
		return x.OnuProcessingErrorInd
	}
	return nil
}

// XXX_OneofFuncs is for the internal use of the proto package.
func (*AlarmIndication) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
	return _AlarmIndication_OneofMarshaler, _AlarmIndication_OneofUnmarshaler, _AlarmIndication_OneofSizer, []interface{}{
		(*AlarmIndication_LosInd)(nil),
		(*AlarmIndication_DyingGaspInd)(nil),
		(*AlarmIndication_OnuAlarmInd)(nil),
		(*AlarmIndication_OnuStartupFailInd)(nil),
		(*AlarmIndication_OnuSignalDegradeInd)(nil),
		(*AlarmIndication_OnuDriftOfWindowInd)(nil),
		(*AlarmIndication_OnuLossOmciInd)(nil),
		(*AlarmIndication_OnuSignalsFailInd)(nil),
		(*AlarmIndication_OnuTiwiInd)(nil),
		(*AlarmIndication_OnuActivationFailInd)(nil),
		(*AlarmIndication_OnuProcessingErrorInd)(nil),
	}
}

func _AlarmIndication_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
	m := msg.(*AlarmIndication)
	// data
	switch x := m.Data.(type) {
	case *AlarmIndication_LosInd:
		b.EncodeVarint(1<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.LosInd); err != nil {
			return err
		}
	case *AlarmIndication_DyingGaspInd:
		b.EncodeVarint(2<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.DyingGaspInd); err != nil {
			return err
		}
	case *AlarmIndication_OnuAlarmInd:
		b.EncodeVarint(3<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuAlarmInd); err != nil {
			return err
		}
	case *AlarmIndication_OnuStartupFailInd:
		b.EncodeVarint(4<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuStartupFailInd); err != nil {
			return err
		}
	case *AlarmIndication_OnuSignalDegradeInd:
		b.EncodeVarint(5<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuSignalDegradeInd); err != nil {
			return err
		}
	case *AlarmIndication_OnuDriftOfWindowInd:
		b.EncodeVarint(6<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuDriftOfWindowInd); err != nil {
			return err
		}
	case *AlarmIndication_OnuLossOmciInd:
		b.EncodeVarint(7<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuLossOmciInd); err != nil {
			return err
		}
	case *AlarmIndication_OnuSignalsFailInd:
		b.EncodeVarint(8<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuSignalsFailInd); err != nil {
			return err
		}
	case *AlarmIndication_OnuTiwiInd:
		b.EncodeVarint(9<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuTiwiInd); err != nil {
			return err
		}
	case *AlarmIndication_OnuActivationFailInd:
		b.EncodeVarint(10<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuActivationFailInd); err != nil {
			return err
		}
	case *AlarmIndication_OnuProcessingErrorInd:
		b.EncodeVarint(11<<3 | proto.WireBytes)
		if err := b.EncodeMessage(x.OnuProcessingErrorInd); err != nil {
			return err
		}
	case nil:
	default:
		return fmt.Errorf("AlarmIndication.Data has unexpected type %T", x)
	}
	return nil
}

func _AlarmIndication_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
	m := msg.(*AlarmIndication)
	switch tag {
	case 1: // data.los_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(LosIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_LosInd{msg}
		return true, err
	case 2: // data.dying_gasp_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(DyingGaspIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_DyingGaspInd{msg}
		return true, err
	case 3: // data.onu_alarm_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuAlarmIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_OnuAlarmInd{msg}
		return true, err
	case 4: // data.onu_startup_fail_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuStartupFailureIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_OnuStartupFailInd{msg}
		return true, err
	case 5: // data.onu_signal_degrade_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuSignalDegradeIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_OnuSignalDegradeInd{msg}
		return true, err
	case 6: // data.onu_drift_of_window_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuDriftOfWindowIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_OnuDriftOfWindowInd{msg}
		return true, err
	case 7: // data.onu_loss_omci_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuLossOfOmciChannelIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_OnuLossOmciInd{msg}
		return true, err
	case 8: // data.onu_signals_fail_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuSignalsFailureIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_OnuSignalsFailInd{msg}
		return true, err
	case 9: // data.onu_tiwi_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuTransmissionInterferenceWarning)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_OnuTiwiInd{msg}
		return true, err
	case 10: // data.onu_activation_fail_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuActivationFailureIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_OnuActivationFailInd{msg}
		return true, err
	case 11: // data.onu_processing_error_ind
		if wire != proto.WireBytes {
			return true, proto.ErrInternalBadWireType
		}
		msg := new(OnuProcessingErrorIndication)
		err := b.DecodeMessage(msg)
		m.Data = &AlarmIndication_OnuProcessingErrorInd{msg}
		return true, err
	default:
		return false, nil
	}
}

func _AlarmIndication_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*AlarmIndication)
	// data
	switch x := m.Data.(type) {
	case *AlarmIndication_LosInd:
		s := proto.Size(x.LosInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_DyingGaspInd:
		s := proto.Size(x.DyingGaspInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_OnuAlarmInd:
		s := proto.Size(x.OnuAlarmInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_OnuStartupFailInd:
		s := proto.Size(x.OnuStartupFailInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_OnuSignalDegradeInd:
		s := proto.Size(x.OnuSignalDegradeInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_OnuDriftOfWindowInd:
		s := proto.Size(x.OnuDriftOfWindowInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_OnuLossOmciInd:
		s := proto.Size(x.OnuLossOmciInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_OnuSignalsFailInd:
		s := proto.Size(x.OnuSignalsFailInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_OnuTiwiInd:
		s := proto.Size(x.OnuTiwiInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_OnuActivationFailInd:
		s := proto.Size(x.OnuActivationFailInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case *AlarmIndication_OnuProcessingErrorInd:
		s := proto.Size(x.OnuProcessingErrorInd)
		n += 1 // tag and wire
		n += proto.SizeVarint(uint64(s))
		n += s
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}

type OltIndication struct {
	OperState            string   `protobuf:"bytes,1,opt,name=oper_state,json=operState" json:"oper_state,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *OltIndication) Reset()         { *m = OltIndication{} }
func (m *OltIndication) String() string { return proto.CompactTextString(m) }
func (*OltIndication) ProtoMessage()    {}
func (*OltIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{2}
}
func (m *OltIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OltIndication.Unmarshal(m, b)
}
func (m *OltIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OltIndication.Marshal(b, m, deterministic)
}
func (dst *OltIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OltIndication.Merge(dst, src)
}
func (m *OltIndication) XXX_Size() int {
	return xxx_messageInfo_OltIndication.Size(m)
}
func (m *OltIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OltIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OltIndication proto.InternalMessageInfo

func (m *OltIndication) GetOperState() string {
	if m != nil {
		return m.OperState
	}
	return ""
}

type IntfIndication struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	OperState            string   `protobuf:"bytes,2,opt,name=oper_state,json=operState" json:"oper_state,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *IntfIndication) Reset()         { *m = IntfIndication{} }
func (m *IntfIndication) String() string { return proto.CompactTextString(m) }
func (*IntfIndication) ProtoMessage()    {}
func (*IntfIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{3}
}
func (m *IntfIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_IntfIndication.Unmarshal(m, b)
}
func (m *IntfIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_IntfIndication.Marshal(b, m, deterministic)
}
func (dst *IntfIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_IntfIndication.Merge(dst, src)
}
func (m *IntfIndication) XXX_Size() int {
	return xxx_messageInfo_IntfIndication.Size(m)
}
func (m *IntfIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_IntfIndication.DiscardUnknown(m)
}

var xxx_messageInfo_IntfIndication proto.InternalMessageInfo

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

func (m *IntfIndication) GetOperState() string {
	if m != nil {
		return m.OperState
	}
	return ""
}

type OnuDiscIndication struct {
	IntfId               uint32        `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	SerialNumber         *SerialNumber `protobuf:"bytes,2,opt,name=serial_number,json=serialNumber" json:"serial_number,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (m *OnuDiscIndication) Reset()         { *m = OnuDiscIndication{} }
func (m *OnuDiscIndication) String() string { return proto.CompactTextString(m) }
func (*OnuDiscIndication) ProtoMessage()    {}
func (*OnuDiscIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{4}
}
func (m *OnuDiscIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuDiscIndication.Unmarshal(m, b)
}
func (m *OnuDiscIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuDiscIndication.Marshal(b, m, deterministic)
}
func (dst *OnuDiscIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuDiscIndication.Merge(dst, src)
}
func (m *OnuDiscIndication) XXX_Size() int {
	return xxx_messageInfo_OnuDiscIndication.Size(m)
}
func (m *OnuDiscIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuDiscIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuDiscIndication proto.InternalMessageInfo

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

func (m *OnuDiscIndication) GetSerialNumber() *SerialNumber {
	if m != nil {
		return m.SerialNumber
	}
	return nil
}

type OnuIndication struct {
	IntfId               uint32        `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	OnuId                uint32        `protobuf:"fixed32,2,opt,name=onu_id,json=onuId" json:"onu_id,omitempty"`
	OperState            string        `protobuf:"bytes,3,opt,name=oper_state,json=operState" json:"oper_state,omitempty"`
	AdminState           string        `protobuf:"bytes,5,opt,name=admin_state,json=adminState" json:"admin_state,omitempty"`
	SerialNumber         *SerialNumber `protobuf:"bytes,4,opt,name=serial_number,json=serialNumber" json:"serial_number,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (m *OnuIndication) Reset()         { *m = OnuIndication{} }
func (m *OnuIndication) String() string { return proto.CompactTextString(m) }
func (*OnuIndication) ProtoMessage()    {}
func (*OnuIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{5}
}
func (m *OnuIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuIndication.Unmarshal(m, b)
}
func (m *OnuIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuIndication.Marshal(b, m, deterministic)
}
func (dst *OnuIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuIndication.Merge(dst, src)
}
func (m *OnuIndication) XXX_Size() int {
	return xxx_messageInfo_OnuIndication.Size(m)
}
func (m *OnuIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuIndication proto.InternalMessageInfo

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

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

func (m *OnuIndication) GetOperState() string {
	if m != nil {
		return m.OperState
	}
	return ""
}

func (m *OnuIndication) GetAdminState() string {
	if m != nil {
		return m.AdminState
	}
	return ""
}

func (m *OnuIndication) GetSerialNumber() *SerialNumber {
	if m != nil {
		return m.SerialNumber
	}
	return nil
}

type IntfOperIndication struct {
	Type                 string   `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
	IntfId               uint32   `protobuf:"fixed32,2,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	OperState            string   `protobuf:"bytes,3,opt,name=oper_state,json=operState" json:"oper_state,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *IntfOperIndication) Reset()         { *m = IntfOperIndication{} }
func (m *IntfOperIndication) String() string { return proto.CompactTextString(m) }
func (*IntfOperIndication) ProtoMessage()    {}
func (*IntfOperIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{6}
}
func (m *IntfOperIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_IntfOperIndication.Unmarshal(m, b)
}
func (m *IntfOperIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_IntfOperIndication.Marshal(b, m, deterministic)
}
func (dst *IntfOperIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_IntfOperIndication.Merge(dst, src)
}
func (m *IntfOperIndication) XXX_Size() int {
	return xxx_messageInfo_IntfOperIndication.Size(m)
}
func (m *IntfOperIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_IntfOperIndication.DiscardUnknown(m)
}

var xxx_messageInfo_IntfOperIndication proto.InternalMessageInfo

func (m *IntfOperIndication) GetType() string {
	if m != nil {
		return m.Type
	}
	return ""
}

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

func (m *IntfOperIndication) GetOperState() string {
	if m != nil {
		return m.OperState
	}
	return ""
}

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

func (m *OmciIndication) Reset()         { *m = OmciIndication{} }
func (m *OmciIndication) String() string { return proto.CompactTextString(m) }
func (*OmciIndication) ProtoMessage()    {}
func (*OmciIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{7}
}
func (m *OmciIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OmciIndication.Unmarshal(m, b)
}
func (m *OmciIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OmciIndication.Marshal(b, m, deterministic)
}
func (dst *OmciIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OmciIndication.Merge(dst, src)
}
func (m *OmciIndication) XXX_Size() int {
	return xxx_messageInfo_OmciIndication.Size(m)
}
func (m *OmciIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OmciIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OmciIndication proto.InternalMessageInfo

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

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

func (m *OmciIndication) GetPkt() []byte {
	if m != nil {
		return m.Pkt
	}
	return nil
}

type PacketIndication struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	GemportId            uint32   `protobuf:"fixed32,2,opt,name=gemport_id,json=gemportId" json:"gemport_id,omitempty"`
	FlowId               uint32   `protobuf:"fixed32,3,opt,name=flow_id,json=flowId" json:"flow_id,omitempty"`
	Pkt                  []byte   `protobuf:"bytes,4,opt,name=pkt,proto3" json:"pkt,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *PacketIndication) Reset()         { *m = PacketIndication{} }
func (m *PacketIndication) String() string { return proto.CompactTextString(m) }
func (*PacketIndication) ProtoMessage()    {}
func (*PacketIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{8}
}
func (m *PacketIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_PacketIndication.Unmarshal(m, b)
}
func (m *PacketIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_PacketIndication.Marshal(b, m, deterministic)
}
func (dst *PacketIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_PacketIndication.Merge(dst, src)
}
func (m *PacketIndication) XXX_Size() int {
	return xxx_messageInfo_PacketIndication.Size(m)
}
func (m *PacketIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_PacketIndication.DiscardUnknown(m)
}

var xxx_messageInfo_PacketIndication proto.InternalMessageInfo

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

func (m *PacketIndication) GetGemportId() uint32 {
	if m != nil {
		return m.GemportId
	}
	return 0
}

func (m *PacketIndication) GetFlowId() uint32 {
	if m != nil {
		return m.FlowId
	}
	return 0
}

func (m *PacketIndication) GetPkt() []byte {
	if m != nil {
		return m.Pkt
	}
	return nil
}

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

func (m *Interface) Reset()         { *m = Interface{} }
func (m *Interface) String() string { return proto.CompactTextString(m) }
func (*Interface) ProtoMessage()    {}
func (*Interface) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{9}
}
func (m *Interface) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Interface.Unmarshal(m, b)
}
func (m *Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Interface.Marshal(b, m, deterministic)
}
func (dst *Interface) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Interface.Merge(dst, src)
}
func (m *Interface) XXX_Size() int {
	return xxx_messageInfo_Interface.Size(m)
}
func (m *Interface) XXX_DiscardUnknown() {
	xxx_messageInfo_Interface.DiscardUnknown(m)
}

var xxx_messageInfo_Interface proto.InternalMessageInfo

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

type Heartbeat struct {
	HeartbeatSignature   uint32   `protobuf:"fixed32,1,opt,name=heartbeat_signature,json=heartbeatSignature" json:"heartbeat_signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *Heartbeat) Reset()         { *m = Heartbeat{} }
func (m *Heartbeat) String() string { return proto.CompactTextString(m) }
func (*Heartbeat) ProtoMessage()    {}
func (*Heartbeat) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{10}
}
func (m *Heartbeat) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Heartbeat.Unmarshal(m, b)
}
func (m *Heartbeat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Heartbeat.Marshal(b, m, deterministic)
}
func (dst *Heartbeat) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Heartbeat.Merge(dst, src)
}
func (m *Heartbeat) XXX_Size() int {
	return xxx_messageInfo_Heartbeat.Size(m)
}
func (m *Heartbeat) XXX_DiscardUnknown() {
	xxx_messageInfo_Heartbeat.DiscardUnknown(m)
}

var xxx_messageInfo_Heartbeat proto.InternalMessageInfo

func (m *Heartbeat) GetHeartbeatSignature() uint32 {
	if m != nil {
		return m.HeartbeatSignature
	}
	return 0
}

type Onu struct {
	IntfId               uint32        `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	OnuId                uint32        `protobuf:"fixed32,2,opt,name=onu_id,json=onuId" json:"onu_id,omitempty"`
	SerialNumber         *SerialNumber `protobuf:"bytes,3,opt,name=serial_number,json=serialNumber" json:"serial_number,omitempty"`
	Pir                  uint32        `protobuf:"fixed32,4,opt,name=pir" json:"pir,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (m *Onu) Reset()         { *m = Onu{} }
func (m *Onu) String() string { return proto.CompactTextString(m) }
func (*Onu) ProtoMessage()    {}
func (*Onu) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{11}
}
func (m *Onu) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Onu.Unmarshal(m, b)
}
func (m *Onu) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Onu.Marshal(b, m, deterministic)
}
func (dst *Onu) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Onu.Merge(dst, src)
}
func (m *Onu) XXX_Size() int {
	return xxx_messageInfo_Onu.Size(m)
}
func (m *Onu) XXX_DiscardUnknown() {
	xxx_messageInfo_Onu.DiscardUnknown(m)
}

var xxx_messageInfo_Onu proto.InternalMessageInfo

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

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

func (m *Onu) GetSerialNumber() *SerialNumber {
	if m != nil {
		return m.SerialNumber
	}
	return nil
}

func (m *Onu) GetPir() uint32 {
	if m != nil {
		return m.Pir
	}
	return 0
}

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

func (m *OmciMsg) Reset()         { *m = OmciMsg{} }
func (m *OmciMsg) String() string { return proto.CompactTextString(m) }
func (*OmciMsg) ProtoMessage()    {}
func (*OmciMsg) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{12}
}
func (m *OmciMsg) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OmciMsg.Unmarshal(m, b)
}
func (m *OmciMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OmciMsg.Marshal(b, m, deterministic)
}
func (dst *OmciMsg) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OmciMsg.Merge(dst, src)
}
func (m *OmciMsg) XXX_Size() int {
	return xxx_messageInfo_OmciMsg.Size(m)
}
func (m *OmciMsg) XXX_DiscardUnknown() {
	xxx_messageInfo_OmciMsg.DiscardUnknown(m)
}

var xxx_messageInfo_OmciMsg proto.InternalMessageInfo

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

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

func (m *OmciMsg) GetPkt() []byte {
	if m != nil {
		return m.Pkt
	}
	return nil
}

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

func (m *OnuPacket) Reset()         { *m = OnuPacket{} }
func (m *OnuPacket) String() string { return proto.CompactTextString(m) }
func (*OnuPacket) ProtoMessage()    {}
func (*OnuPacket) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{13}
}
func (m *OnuPacket) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuPacket.Unmarshal(m, b)
}
func (m *OnuPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuPacket.Marshal(b, m, deterministic)
}
func (dst *OnuPacket) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuPacket.Merge(dst, src)
}
func (m *OnuPacket) XXX_Size() int {
	return xxx_messageInfo_OnuPacket.Size(m)
}
func (m *OnuPacket) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuPacket.DiscardUnknown(m)
}

var xxx_messageInfo_OnuPacket proto.InternalMessageInfo

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

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

func (m *OnuPacket) GetPkt() []byte {
	if m != nil {
		return m.Pkt
	}
	return nil
}

type UplinkPacket struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	Pkt                  []byte   `protobuf:"bytes,2,opt,name=pkt,proto3" json:"pkt,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *UplinkPacket) Reset()         { *m = UplinkPacket{} }
func (m *UplinkPacket) String() string { return proto.CompactTextString(m) }
func (*UplinkPacket) ProtoMessage()    {}
func (*UplinkPacket) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{14}
}
func (m *UplinkPacket) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_UplinkPacket.Unmarshal(m, b)
}
func (m *UplinkPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_UplinkPacket.Marshal(b, m, deterministic)
}
func (dst *UplinkPacket) XXX_Merge(src proto.Message) {
	xxx_messageInfo_UplinkPacket.Merge(dst, src)
}
func (m *UplinkPacket) XXX_Size() int {
	return xxx_messageInfo_UplinkPacket.Size(m)
}
func (m *UplinkPacket) XXX_DiscardUnknown() {
	xxx_messageInfo_UplinkPacket.DiscardUnknown(m)
}

var xxx_messageInfo_UplinkPacket proto.InternalMessageInfo

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

func (m *UplinkPacket) GetPkt() []byte {
	if m != nil {
		return m.Pkt
	}
	return nil
}

type Classifier struct {
	OTpid                uint32   `protobuf:"fixed32,1,opt,name=o_tpid,json=oTpid" json:"o_tpid,omitempty"`
	OVid                 uint32   `protobuf:"fixed32,2,opt,name=o_vid,json=oVid" json:"o_vid,omitempty"`
	ITpid                uint32   `protobuf:"fixed32,3,opt,name=i_tpid,json=iTpid" json:"i_tpid,omitempty"`
	IVid                 uint32   `protobuf:"fixed32,4,opt,name=i_vid,json=iVid" json:"i_vid,omitempty"`
	OPbits               uint32   `protobuf:"fixed32,5,opt,name=o_pbits,json=oPbits" json:"o_pbits,omitempty"`
	IPbits               uint32   `protobuf:"fixed32,6,opt,name=i_pbits,json=iPbits" json:"i_pbits,omitempty"`
	EthType              uint32   `protobuf:"fixed32,7,opt,name=eth_type,json=ethType" json:"eth_type,omitempty"`
	DstMac               []byte   `protobuf:"bytes,8,opt,name=dst_mac,json=dstMac,proto3" json:"dst_mac,omitempty"`
	SrcMac               []byte   `protobuf:"bytes,9,opt,name=src_mac,json=srcMac,proto3" json:"src_mac,omitempty"`
	IpProto              uint32   `protobuf:"fixed32,10,opt,name=ip_proto,json=ipProto" json:"ip_proto,omitempty"`
	DstIp                uint32   `protobuf:"fixed32,11,opt,name=dst_ip,json=dstIp" json:"dst_ip,omitempty"`
	SrcIp                uint32   `protobuf:"fixed32,12,opt,name=src_ip,json=srcIp" json:"src_ip,omitempty"`
	SrcPort              uint32   `protobuf:"fixed32,13,opt,name=src_port,json=srcPort" json:"src_port,omitempty"`
	DstPort              uint32   `protobuf:"fixed32,14,opt,name=dst_port,json=dstPort" json:"dst_port,omitempty"`
	PktTagType           string   `protobuf:"bytes,15,opt,name=pkt_tag_type,json=pktTagType" json:"pkt_tag_type,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *Classifier) Reset()         { *m = Classifier{} }
func (m *Classifier) String() string { return proto.CompactTextString(m) }
func (*Classifier) ProtoMessage()    {}
func (*Classifier) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{15}
}
func (m *Classifier) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Classifier.Unmarshal(m, b)
}
func (m *Classifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Classifier.Marshal(b, m, deterministic)
}
func (dst *Classifier) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Classifier.Merge(dst, src)
}
func (m *Classifier) XXX_Size() int {
	return xxx_messageInfo_Classifier.Size(m)
}
func (m *Classifier) XXX_DiscardUnknown() {
	xxx_messageInfo_Classifier.DiscardUnknown(m)
}

var xxx_messageInfo_Classifier proto.InternalMessageInfo

func (m *Classifier) GetOTpid() uint32 {
	if m != nil {
		return m.OTpid
	}
	return 0
}

func (m *Classifier) GetOVid() uint32 {
	if m != nil {
		return m.OVid
	}
	return 0
}

func (m *Classifier) GetITpid() uint32 {
	if m != nil {
		return m.ITpid
	}
	return 0
}

func (m *Classifier) GetIVid() uint32 {
	if m != nil {
		return m.IVid
	}
	return 0
}

func (m *Classifier) GetOPbits() uint32 {
	if m != nil {
		return m.OPbits
	}
	return 0
}

func (m *Classifier) GetIPbits() uint32 {
	if m != nil {
		return m.IPbits
	}
	return 0
}

func (m *Classifier) GetEthType() uint32 {
	if m != nil {
		return m.EthType
	}
	return 0
}

func (m *Classifier) GetDstMac() []byte {
	if m != nil {
		return m.DstMac
	}
	return nil
}

func (m *Classifier) GetSrcMac() []byte {
	if m != nil {
		return m.SrcMac
	}
	return nil
}

func (m *Classifier) GetIpProto() uint32 {
	if m != nil {
		return m.IpProto
	}
	return 0
}

func (m *Classifier) GetDstIp() uint32 {
	if m != nil {
		return m.DstIp
	}
	return 0
}

func (m *Classifier) GetSrcIp() uint32 {
	if m != nil {
		return m.SrcIp
	}
	return 0
}

func (m *Classifier) GetSrcPort() uint32 {
	if m != nil {
		return m.SrcPort
	}
	return 0
}

func (m *Classifier) GetDstPort() uint32 {
	if m != nil {
		return m.DstPort
	}
	return 0
}

func (m *Classifier) GetPktTagType() string {
	if m != nil {
		return m.PktTagType
	}
	return ""
}

type ActionCmd struct {
	AddOuterTag          bool     `protobuf:"varint,1,opt,name=add_outer_tag,json=addOuterTag" json:"add_outer_tag,omitempty"`
	RemoveOuterTag       bool     `protobuf:"varint,2,opt,name=remove_outer_tag,json=removeOuterTag" json:"remove_outer_tag,omitempty"`
	TrapToHost           bool     `protobuf:"varint,3,opt,name=trap_to_host,json=trapToHost" json:"trap_to_host,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ActionCmd) Reset()         { *m = ActionCmd{} }
func (m *ActionCmd) String() string { return proto.CompactTextString(m) }
func (*ActionCmd) ProtoMessage()    {}
func (*ActionCmd) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{16}
}
func (m *ActionCmd) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ActionCmd.Unmarshal(m, b)
}
func (m *ActionCmd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ActionCmd.Marshal(b, m, deterministic)
}
func (dst *ActionCmd) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ActionCmd.Merge(dst, src)
}
func (m *ActionCmd) XXX_Size() int {
	return xxx_messageInfo_ActionCmd.Size(m)
}
func (m *ActionCmd) XXX_DiscardUnknown() {
	xxx_messageInfo_ActionCmd.DiscardUnknown(m)
}

var xxx_messageInfo_ActionCmd proto.InternalMessageInfo

func (m *ActionCmd) GetAddOuterTag() bool {
	if m != nil {
		return m.AddOuterTag
	}
	return false
}

func (m *ActionCmd) GetRemoveOuterTag() bool {
	if m != nil {
		return m.RemoveOuterTag
	}
	return false
}

func (m *ActionCmd) GetTrapToHost() bool {
	if m != nil {
		return m.TrapToHost
	}
	return false
}

type Action struct {
	Cmd                  *ActionCmd `protobuf:"bytes,1,opt,name=cmd" json:"cmd,omitempty"`
	OVid                 uint32     `protobuf:"fixed32,2,opt,name=o_vid,json=oVid" json:"o_vid,omitempty"`
	OPbits               uint32     `protobuf:"fixed32,3,opt,name=o_pbits,json=oPbits" json:"o_pbits,omitempty"`
	OTpid                uint32     `protobuf:"fixed32,4,opt,name=o_tpid,json=oTpid" json:"o_tpid,omitempty"`
	IVid                 uint32     `protobuf:"fixed32,5,opt,name=i_vid,json=iVid" json:"i_vid,omitempty"`
	IPbits               uint32     `protobuf:"fixed32,6,opt,name=i_pbits,json=iPbits" json:"i_pbits,omitempty"`
	ITpid                uint32     `protobuf:"fixed32,7,opt,name=i_tpid,json=iTpid" json:"i_tpid,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (m *Action) Reset()         { *m = Action{} }
func (m *Action) String() string { return proto.CompactTextString(m) }
func (*Action) ProtoMessage()    {}
func (*Action) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{17}
}
func (m *Action) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Action.Unmarshal(m, b)
}
func (m *Action) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Action.Marshal(b, m, deterministic)
}
func (dst *Action) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Action.Merge(dst, src)
}
func (m *Action) XXX_Size() int {
	return xxx_messageInfo_Action.Size(m)
}
func (m *Action) XXX_DiscardUnknown() {
	xxx_messageInfo_Action.DiscardUnknown(m)
}

var xxx_messageInfo_Action proto.InternalMessageInfo

func (m *Action) GetCmd() *ActionCmd {
	if m != nil {
		return m.Cmd
	}
	return nil
}

func (m *Action) GetOVid() uint32 {
	if m != nil {
		return m.OVid
	}
	return 0
}

func (m *Action) GetOPbits() uint32 {
	if m != nil {
		return m.OPbits
	}
	return 0
}

func (m *Action) GetOTpid() uint32 {
	if m != nil {
		return m.OTpid
	}
	return 0
}

func (m *Action) GetIVid() uint32 {
	if m != nil {
		return m.IVid
	}
	return 0
}

func (m *Action) GetIPbits() uint32 {
	if m != nil {
		return m.IPbits
	}
	return 0
}

func (m *Action) GetITpid() uint32 {
	if m != nil {
		return m.ITpid
	}
	return 0
}

type Flow struct {
	AccessIntfId         uint32      `protobuf:"fixed32,1,opt,name=access_intf_id,json=accessIntfId" json:"access_intf_id,omitempty"`
	OnuId                uint32      `protobuf:"fixed32,2,opt,name=onu_id,json=onuId" json:"onu_id,omitempty"`
	FlowId               uint32      `protobuf:"fixed32,3,opt,name=flow_id,json=flowId" json:"flow_id,omitempty"`
	FlowType             string      `protobuf:"bytes,4,opt,name=flow_type,json=flowType" json:"flow_type,omitempty"`
	NetworkIntfId        uint32      `protobuf:"fixed32,5,opt,name=network_intf_id,json=networkIntfId" json:"network_intf_id,omitempty"`
	GemportId            uint32      `protobuf:"fixed32,6,opt,name=gemport_id,json=gemportId" json:"gemport_id,omitempty"`
	Classifier           *Classifier `protobuf:"bytes,7,opt,name=classifier" json:"classifier,omitempty"`
	Action               *Action     `protobuf:"bytes,8,opt,name=action" json:"action,omitempty"`
	Priority             uint32      `protobuf:"fixed32,9,opt,name=priority" json:"priority,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (m *Flow) Reset()         { *m = Flow{} }
func (m *Flow) String() string { return proto.CompactTextString(m) }
func (*Flow) ProtoMessage()    {}
func (*Flow) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{18}
}
func (m *Flow) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Flow.Unmarshal(m, b)
}
func (m *Flow) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Flow.Marshal(b, m, deterministic)
}
func (dst *Flow) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Flow.Merge(dst, src)
}
func (m *Flow) XXX_Size() int {
	return xxx_messageInfo_Flow.Size(m)
}
func (m *Flow) XXX_DiscardUnknown() {
	xxx_messageInfo_Flow.DiscardUnknown(m)
}

var xxx_messageInfo_Flow proto.InternalMessageInfo

func (m *Flow) GetAccessIntfId() uint32 {
	if m != nil {
		return m.AccessIntfId
	}
	return 0
}

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

func (m *Flow) GetFlowId() uint32 {
	if m != nil {
		return m.FlowId
	}
	return 0
}

func (m *Flow) GetFlowType() string {
	if m != nil {
		return m.FlowType
	}
	return ""
}

func (m *Flow) GetNetworkIntfId() uint32 {
	if m != nil {
		return m.NetworkIntfId
	}
	return 0
}

func (m *Flow) GetGemportId() uint32 {
	if m != nil {
		return m.GemportId
	}
	return 0
}

func (m *Flow) GetClassifier() *Classifier {
	if m != nil {
		return m.Classifier
	}
	return nil
}

func (m *Flow) GetAction() *Action {
	if m != nil {
		return m.Action
	}
	return nil
}

func (m *Flow) GetPriority() uint32 {
	if m != nil {
		return m.Priority
	}
	return 0
}

type SerialNumber struct {
	VendorId             []byte   `protobuf:"bytes,1,opt,name=vendor_id,json=vendorId,proto3" json:"vendor_id,omitempty"`
	VendorSpecific       []byte   `protobuf:"bytes,2,opt,name=vendor_specific,json=vendorSpecific,proto3" json:"vendor_specific,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *SerialNumber) Reset()         { *m = SerialNumber{} }
func (m *SerialNumber) String() string { return proto.CompactTextString(m) }
func (*SerialNumber) ProtoMessage()    {}
func (*SerialNumber) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{19}
}
func (m *SerialNumber) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_SerialNumber.Unmarshal(m, b)
}
func (m *SerialNumber) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_SerialNumber.Marshal(b, m, deterministic)
}
func (dst *SerialNumber) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SerialNumber.Merge(dst, src)
}
func (m *SerialNumber) XXX_Size() int {
	return xxx_messageInfo_SerialNumber.Size(m)
}
func (m *SerialNumber) XXX_DiscardUnknown() {
	xxx_messageInfo_SerialNumber.DiscardUnknown(m)
}

var xxx_messageInfo_SerialNumber proto.InternalMessageInfo

func (m *SerialNumber) GetVendorId() []byte {
	if m != nil {
		return m.VendorId
	}
	return nil
}

func (m *SerialNumber) GetVendorSpecific() []byte {
	if m != nil {
		return m.VendorSpecific
	}
	return nil
}

type PortStatistics struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	RxBytes              uint64   `protobuf:"fixed64,2,opt,name=rx_bytes,json=rxBytes" json:"rx_bytes,omitempty"`
	RxPackets            uint64   `protobuf:"fixed64,3,opt,name=rx_packets,json=rxPackets" json:"rx_packets,omitempty"`
	RxUcastPackets       uint64   `protobuf:"fixed64,4,opt,name=rx_ucast_packets,json=rxUcastPackets" json:"rx_ucast_packets,omitempty"`
	RxMcastPackets       uint64   `protobuf:"fixed64,5,opt,name=rx_mcast_packets,json=rxMcastPackets" json:"rx_mcast_packets,omitempty"`
	RxBcastPackets       uint64   `protobuf:"fixed64,6,opt,name=rx_bcast_packets,json=rxBcastPackets" json:"rx_bcast_packets,omitempty"`
	RxErrorPackets       uint64   `protobuf:"fixed64,7,opt,name=rx_error_packets,json=rxErrorPackets" json:"rx_error_packets,omitempty"`
	TxBytes              uint64   `protobuf:"fixed64,8,opt,name=tx_bytes,json=txBytes" json:"tx_bytes,omitempty"`
	TxPackets            uint64   `protobuf:"fixed64,9,opt,name=tx_packets,json=txPackets" json:"tx_packets,omitempty"`
	TxUcastPackets       uint64   `protobuf:"fixed64,10,opt,name=tx_ucast_packets,json=txUcastPackets" json:"tx_ucast_packets,omitempty"`
	TxMcastPackets       uint64   `protobuf:"fixed64,11,opt,name=tx_mcast_packets,json=txMcastPackets" json:"tx_mcast_packets,omitempty"`
	TxBcastPackets       uint64   `protobuf:"fixed64,12,opt,name=tx_bcast_packets,json=txBcastPackets" json:"tx_bcast_packets,omitempty"`
	TxErrorPackets       uint64   `protobuf:"fixed64,13,opt,name=tx_error_packets,json=txErrorPackets" json:"tx_error_packets,omitempty"`
	RxCrcErrors          uint64   `protobuf:"fixed64,14,opt,name=rx_crc_errors,json=rxCrcErrors" json:"rx_crc_errors,omitempty"`
	BipErrors            uint64   `protobuf:"fixed64,15,opt,name=bip_errors,json=bipErrors" json:"bip_errors,omitempty"`
	Timestamp            uint32   `protobuf:"fixed32,16,opt,name=timestamp" json:"timestamp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *PortStatistics) Reset()         { *m = PortStatistics{} }
func (m *PortStatistics) String() string { return proto.CompactTextString(m) }
func (*PortStatistics) ProtoMessage()    {}
func (*PortStatistics) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{20}
}
func (m *PortStatistics) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_PortStatistics.Unmarshal(m, b)
}
func (m *PortStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_PortStatistics.Marshal(b, m, deterministic)
}
func (dst *PortStatistics) XXX_Merge(src proto.Message) {
	xxx_messageInfo_PortStatistics.Merge(dst, src)
}
func (m *PortStatistics) XXX_Size() int {
	return xxx_messageInfo_PortStatistics.Size(m)
}
func (m *PortStatistics) XXX_DiscardUnknown() {
	xxx_messageInfo_PortStatistics.DiscardUnknown(m)
}

var xxx_messageInfo_PortStatistics proto.InternalMessageInfo

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

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

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

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

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

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

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

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

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

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

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

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

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

func (m *PortStatistics) GetRxCrcErrors() uint64 {
	if m != nil {
		return m.RxCrcErrors
	}
	return 0
}

func (m *PortStatistics) GetBipErrors() uint64 {
	if m != nil {
		return m.BipErrors
	}
	return 0
}

func (m *PortStatistics) GetTimestamp() uint32 {
	if m != nil {
		return m.Timestamp
	}
	return 0
}

type FlowStatistics struct {
	FlowId               uint32   `protobuf:"fixed32,1,opt,name=flow_id,json=flowId" json:"flow_id,omitempty"`
	RxBytes              uint64   `protobuf:"fixed64,2,opt,name=rx_bytes,json=rxBytes" json:"rx_bytes,omitempty"`
	RxPackets            uint64   `protobuf:"fixed64,3,opt,name=rx_packets,json=rxPackets" json:"rx_packets,omitempty"`
	TxBytes              uint64   `protobuf:"fixed64,8,opt,name=tx_bytes,json=txBytes" json:"tx_bytes,omitempty"`
	TxPackets            uint64   `protobuf:"fixed64,9,opt,name=tx_packets,json=txPackets" json:"tx_packets,omitempty"`
	Timestamp            uint32   `protobuf:"fixed32,16,opt,name=timestamp" json:"timestamp,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *FlowStatistics) Reset()         { *m = FlowStatistics{} }
func (m *FlowStatistics) String() string { return proto.CompactTextString(m) }
func (*FlowStatistics) ProtoMessage()    {}
func (*FlowStatistics) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{21}
}
func (m *FlowStatistics) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_FlowStatistics.Unmarshal(m, b)
}
func (m *FlowStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_FlowStatistics.Marshal(b, m, deterministic)
}
func (dst *FlowStatistics) XXX_Merge(src proto.Message) {
	xxx_messageInfo_FlowStatistics.Merge(dst, src)
}
func (m *FlowStatistics) XXX_Size() int {
	return xxx_messageInfo_FlowStatistics.Size(m)
}
func (m *FlowStatistics) XXX_DiscardUnknown() {
	xxx_messageInfo_FlowStatistics.DiscardUnknown(m)
}

var xxx_messageInfo_FlowStatistics proto.InternalMessageInfo

func (m *FlowStatistics) GetFlowId() uint32 {
	if m != nil {
		return m.FlowId
	}
	return 0
}

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

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

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

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

func (m *FlowStatistics) GetTimestamp() uint32 {
	if m != nil {
		return m.Timestamp
	}
	return 0
}

type LosIndication struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	Status               string   `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *LosIndication) Reset()         { *m = LosIndication{} }
func (m *LosIndication) String() string { return proto.CompactTextString(m) }
func (*LosIndication) ProtoMessage()    {}
func (*LosIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{22}
}
func (m *LosIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_LosIndication.Unmarshal(m, b)
}
func (m *LosIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_LosIndication.Marshal(b, m, deterministic)
}
func (dst *LosIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_LosIndication.Merge(dst, src)
}
func (m *LosIndication) XXX_Size() int {
	return xxx_messageInfo_LosIndication.Size(m)
}
func (m *LosIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_LosIndication.DiscardUnknown(m)
}

var xxx_messageInfo_LosIndication proto.InternalMessageInfo

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

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

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

func (m *DyingGaspIndication) Reset()         { *m = DyingGaspIndication{} }
func (m *DyingGaspIndication) String() string { return proto.CompactTextString(m) }
func (*DyingGaspIndication) ProtoMessage()    {}
func (*DyingGaspIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{23}
}
func (m *DyingGaspIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_DyingGaspIndication.Unmarshal(m, b)
}
func (m *DyingGaspIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_DyingGaspIndication.Marshal(b, m, deterministic)
}
func (dst *DyingGaspIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_DyingGaspIndication.Merge(dst, src)
}
func (m *DyingGaspIndication) XXX_Size() int {
	return xxx_messageInfo_DyingGaspIndication.Size(m)
}
func (m *DyingGaspIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_DyingGaspIndication.DiscardUnknown(m)
}

var xxx_messageInfo_DyingGaspIndication proto.InternalMessageInfo

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

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

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

type OnuAlarmIndication struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId" json:"onu_id,omitempty"`
	LosStatus            string   `protobuf:"bytes,3,opt,name=los_status,json=losStatus" json:"los_status,omitempty"`
	LobStatus            string   `protobuf:"bytes,4,opt,name=lob_status,json=lobStatus" json:"lob_status,omitempty"`
	LopcMissStatus       string   `protobuf:"bytes,5,opt,name=lopc_miss_status,json=lopcMissStatus" json:"lopc_miss_status,omitempty"`
	LopcMicErrorStatus   string   `protobuf:"bytes,6,opt,name=lopc_mic_error_status,json=lopcMicErrorStatus" json:"lopc_mic_error_status,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *OnuAlarmIndication) Reset()         { *m = OnuAlarmIndication{} }
func (m *OnuAlarmIndication) String() string { return proto.CompactTextString(m) }
func (*OnuAlarmIndication) ProtoMessage()    {}
func (*OnuAlarmIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{24}
}
func (m *OnuAlarmIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuAlarmIndication.Unmarshal(m, b)
}
func (m *OnuAlarmIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuAlarmIndication.Marshal(b, m, deterministic)
}
func (dst *OnuAlarmIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuAlarmIndication.Merge(dst, src)
}
func (m *OnuAlarmIndication) XXX_Size() int {
	return xxx_messageInfo_OnuAlarmIndication.Size(m)
}
func (m *OnuAlarmIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuAlarmIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuAlarmIndication proto.InternalMessageInfo

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

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

func (m *OnuAlarmIndication) GetLosStatus() string {
	if m != nil {
		return m.LosStatus
	}
	return ""
}

func (m *OnuAlarmIndication) GetLobStatus() string {
	if m != nil {
		return m.LobStatus
	}
	return ""
}

func (m *OnuAlarmIndication) GetLopcMissStatus() string {
	if m != nil {
		return m.LopcMissStatus
	}
	return ""
}

func (m *OnuAlarmIndication) GetLopcMicErrorStatus() string {
	if m != nil {
		return m.LopcMicErrorStatus
	}
	return ""
}

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

func (m *OnuStartupFailureIndication) Reset()         { *m = OnuStartupFailureIndication{} }
func (m *OnuStartupFailureIndication) String() string { return proto.CompactTextString(m) }
func (*OnuStartupFailureIndication) ProtoMessage()    {}
func (*OnuStartupFailureIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{25}
}
func (m *OnuStartupFailureIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuStartupFailureIndication.Unmarshal(m, b)
}
func (m *OnuStartupFailureIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuStartupFailureIndication.Marshal(b, m, deterministic)
}
func (dst *OnuStartupFailureIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuStartupFailureIndication.Merge(dst, src)
}
func (m *OnuStartupFailureIndication) XXX_Size() int {
	return xxx_messageInfo_OnuStartupFailureIndication.Size(m)
}
func (m *OnuStartupFailureIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuStartupFailureIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuStartupFailureIndication proto.InternalMessageInfo

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

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

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

type OnuSignalDegradeIndication struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId" json:"onu_id,omitempty"`
	Status               string   `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
	InverseBitErrorRate  uint32   `protobuf:"fixed32,4,opt,name=inverse_bit_error_rate,json=inverseBitErrorRate" json:"inverse_bit_error_rate,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *OnuSignalDegradeIndication) Reset()         { *m = OnuSignalDegradeIndication{} }
func (m *OnuSignalDegradeIndication) String() string { return proto.CompactTextString(m) }
func (*OnuSignalDegradeIndication) ProtoMessage()    {}
func (*OnuSignalDegradeIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{26}
}
func (m *OnuSignalDegradeIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuSignalDegradeIndication.Unmarshal(m, b)
}
func (m *OnuSignalDegradeIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuSignalDegradeIndication.Marshal(b, m, deterministic)
}
func (dst *OnuSignalDegradeIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuSignalDegradeIndication.Merge(dst, src)
}
func (m *OnuSignalDegradeIndication) XXX_Size() int {
	return xxx_messageInfo_OnuSignalDegradeIndication.Size(m)
}
func (m *OnuSignalDegradeIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuSignalDegradeIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuSignalDegradeIndication proto.InternalMessageInfo

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

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

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

func (m *OnuSignalDegradeIndication) GetInverseBitErrorRate() uint32 {
	if m != nil {
		return m.InverseBitErrorRate
	}
	return 0
}

type OnuDriftOfWindowIndication struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId" json:"onu_id,omitempty"`
	Status               string   `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
	Drift                uint32   `protobuf:"fixed32,4,opt,name=drift" json:"drift,omitempty"`
	NewEqd               uint32   `protobuf:"fixed32,5,opt,name=new_eqd,json=newEqd" json:"new_eqd,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *OnuDriftOfWindowIndication) Reset()         { *m = OnuDriftOfWindowIndication{} }
func (m *OnuDriftOfWindowIndication) String() string { return proto.CompactTextString(m) }
func (*OnuDriftOfWindowIndication) ProtoMessage()    {}
func (*OnuDriftOfWindowIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{27}
}
func (m *OnuDriftOfWindowIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuDriftOfWindowIndication.Unmarshal(m, b)
}
func (m *OnuDriftOfWindowIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuDriftOfWindowIndication.Marshal(b, m, deterministic)
}
func (dst *OnuDriftOfWindowIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuDriftOfWindowIndication.Merge(dst, src)
}
func (m *OnuDriftOfWindowIndication) XXX_Size() int {
	return xxx_messageInfo_OnuDriftOfWindowIndication.Size(m)
}
func (m *OnuDriftOfWindowIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuDriftOfWindowIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuDriftOfWindowIndication proto.InternalMessageInfo

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

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

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

func (m *OnuDriftOfWindowIndication) GetDrift() uint32 {
	if m != nil {
		return m.Drift
	}
	return 0
}

func (m *OnuDriftOfWindowIndication) GetNewEqd() uint32 {
	if m != nil {
		return m.NewEqd
	}
	return 0
}

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

func (m *OnuLossOfOmciChannelIndication) Reset()         { *m = OnuLossOfOmciChannelIndication{} }
func (m *OnuLossOfOmciChannelIndication) String() string { return proto.CompactTextString(m) }
func (*OnuLossOfOmciChannelIndication) ProtoMessage()    {}
func (*OnuLossOfOmciChannelIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{28}
}
func (m *OnuLossOfOmciChannelIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuLossOfOmciChannelIndication.Unmarshal(m, b)
}
func (m *OnuLossOfOmciChannelIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuLossOfOmciChannelIndication.Marshal(b, m, deterministic)
}
func (dst *OnuLossOfOmciChannelIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuLossOfOmciChannelIndication.Merge(dst, src)
}
func (m *OnuLossOfOmciChannelIndication) XXX_Size() int {
	return xxx_messageInfo_OnuLossOfOmciChannelIndication.Size(m)
}
func (m *OnuLossOfOmciChannelIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuLossOfOmciChannelIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuLossOfOmciChannelIndication proto.InternalMessageInfo

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

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

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

type OnuSignalsFailureIndication struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId" json:"onu_id,omitempty"`
	Status               string   `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
	InverseBitErrorRate  uint32   `protobuf:"fixed32,4,opt,name=inverse_bit_error_rate,json=inverseBitErrorRate" json:"inverse_bit_error_rate,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *OnuSignalsFailureIndication) Reset()         { *m = OnuSignalsFailureIndication{} }
func (m *OnuSignalsFailureIndication) String() string { return proto.CompactTextString(m) }
func (*OnuSignalsFailureIndication) ProtoMessage()    {}
func (*OnuSignalsFailureIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{29}
}
func (m *OnuSignalsFailureIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuSignalsFailureIndication.Unmarshal(m, b)
}
func (m *OnuSignalsFailureIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuSignalsFailureIndication.Marshal(b, m, deterministic)
}
func (dst *OnuSignalsFailureIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuSignalsFailureIndication.Merge(dst, src)
}
func (m *OnuSignalsFailureIndication) XXX_Size() int {
	return xxx_messageInfo_OnuSignalsFailureIndication.Size(m)
}
func (m *OnuSignalsFailureIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuSignalsFailureIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuSignalsFailureIndication proto.InternalMessageInfo

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

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

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

func (m *OnuSignalsFailureIndication) GetInverseBitErrorRate() uint32 {
	if m != nil {
		return m.InverseBitErrorRate
	}
	return 0
}

type OnuTransmissionInterferenceWarning struct {
	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId" json:"intf_id,omitempty"`
	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId" json:"onu_id,omitempty"`
	Status               string   `protobuf:"bytes,3,opt,name=status" json:"status,omitempty"`
	Drift                uint32   `protobuf:"fixed32,4,opt,name=drift" json:"drift,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *OnuTransmissionInterferenceWarning) Reset()         { *m = OnuTransmissionInterferenceWarning{} }
func (m *OnuTransmissionInterferenceWarning) String() string { return proto.CompactTextString(m) }
func (*OnuTransmissionInterferenceWarning) ProtoMessage()    {}
func (*OnuTransmissionInterferenceWarning) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{30}
}
func (m *OnuTransmissionInterferenceWarning) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuTransmissionInterferenceWarning.Unmarshal(m, b)
}
func (m *OnuTransmissionInterferenceWarning) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuTransmissionInterferenceWarning.Marshal(b, m, deterministic)
}
func (dst *OnuTransmissionInterferenceWarning) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuTransmissionInterferenceWarning.Merge(dst, src)
}
func (m *OnuTransmissionInterferenceWarning) XXX_Size() int {
	return xxx_messageInfo_OnuTransmissionInterferenceWarning.Size(m)
}
func (m *OnuTransmissionInterferenceWarning) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuTransmissionInterferenceWarning.DiscardUnknown(m)
}

var xxx_messageInfo_OnuTransmissionInterferenceWarning proto.InternalMessageInfo

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

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

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

func (m *OnuTransmissionInterferenceWarning) GetDrift() uint32 {
	if m != nil {
		return m.Drift
	}
	return 0
}

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

func (m *OnuActivationFailureIndication) Reset()         { *m = OnuActivationFailureIndication{} }
func (m *OnuActivationFailureIndication) String() string { return proto.CompactTextString(m) }
func (*OnuActivationFailureIndication) ProtoMessage()    {}
func (*OnuActivationFailureIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{31}
}
func (m *OnuActivationFailureIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuActivationFailureIndication.Unmarshal(m, b)
}
func (m *OnuActivationFailureIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuActivationFailureIndication.Marshal(b, m, deterministic)
}
func (dst *OnuActivationFailureIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuActivationFailureIndication.Merge(dst, src)
}
func (m *OnuActivationFailureIndication) XXX_Size() int {
	return xxx_messageInfo_OnuActivationFailureIndication.Size(m)
}
func (m *OnuActivationFailureIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuActivationFailureIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuActivationFailureIndication proto.InternalMessageInfo

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

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

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

func (m *OnuProcessingErrorIndication) Reset()         { *m = OnuProcessingErrorIndication{} }
func (m *OnuProcessingErrorIndication) String() string { return proto.CompactTextString(m) }
func (*OnuProcessingErrorIndication) ProtoMessage()    {}
func (*OnuProcessingErrorIndication) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{32}
}
func (m *OnuProcessingErrorIndication) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_OnuProcessingErrorIndication.Unmarshal(m, b)
}
func (m *OnuProcessingErrorIndication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_OnuProcessingErrorIndication.Marshal(b, m, deterministic)
}
func (dst *OnuProcessingErrorIndication) XXX_Merge(src proto.Message) {
	xxx_messageInfo_OnuProcessingErrorIndication.Merge(dst, src)
}
func (m *OnuProcessingErrorIndication) XXX_Size() int {
	return xxx_messageInfo_OnuProcessingErrorIndication.Size(m)
}
func (m *OnuProcessingErrorIndication) XXX_DiscardUnknown() {
	xxx_messageInfo_OnuProcessingErrorIndication.DiscardUnknown(m)
}

var xxx_messageInfo_OnuProcessingErrorIndication proto.InternalMessageInfo

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

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

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

func (m *Empty) Reset()         { *m = Empty{} }
func (m *Empty) String() string { return proto.CompactTextString(m) }
func (*Empty) ProtoMessage()    {}
func (*Empty) Descriptor() ([]byte, []int) {
	return fileDescriptor_openolt_6b48a00939803eed, []int{33}
}
func (m *Empty) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Empty.Unmarshal(m, b)
}
func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
}
func (dst *Empty) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Empty.Merge(dst, src)
}
func (m *Empty) XXX_Size() int {
	return xxx_messageInfo_Empty.Size(m)
}
func (m *Empty) XXX_DiscardUnknown() {
	xxx_messageInfo_Empty.DiscardUnknown(m)
}

var xxx_messageInfo_Empty proto.InternalMessageInfo

func init() {
	proto.RegisterType((*Indication)(nil), "openolt.Indication")
	proto.RegisterType((*AlarmIndication)(nil), "openolt.AlarmIndication")
	proto.RegisterType((*OltIndication)(nil), "openolt.OltIndication")
	proto.RegisterType((*IntfIndication)(nil), "openolt.IntfIndication")
	proto.RegisterType((*OnuDiscIndication)(nil), "openolt.OnuDiscIndication")
	proto.RegisterType((*OnuIndication)(nil), "openolt.OnuIndication")
	proto.RegisterType((*IntfOperIndication)(nil), "openolt.IntfOperIndication")
	proto.RegisterType((*OmciIndication)(nil), "openolt.OmciIndication")
	proto.RegisterType((*PacketIndication)(nil), "openolt.PacketIndication")
	proto.RegisterType((*Interface)(nil), "openolt.Interface")
	proto.RegisterType((*Heartbeat)(nil), "openolt.Heartbeat")
	proto.RegisterType((*Onu)(nil), "openolt.Onu")
	proto.RegisterType((*OmciMsg)(nil), "openolt.OmciMsg")
	proto.RegisterType((*OnuPacket)(nil), "openolt.OnuPacket")
	proto.RegisterType((*UplinkPacket)(nil), "openolt.UplinkPacket")
	proto.RegisterType((*Classifier)(nil), "openolt.Classifier")
	proto.RegisterType((*ActionCmd)(nil), "openolt.ActionCmd")
	proto.RegisterType((*Action)(nil), "openolt.Action")
	proto.RegisterType((*Flow)(nil), "openolt.Flow")
	proto.RegisterType((*SerialNumber)(nil), "openolt.SerialNumber")
	proto.RegisterType((*PortStatistics)(nil), "openolt.PortStatistics")
	proto.RegisterType((*FlowStatistics)(nil), "openolt.FlowStatistics")
	proto.RegisterType((*LosIndication)(nil), "openolt.LosIndication")
	proto.RegisterType((*DyingGaspIndication)(nil), "openolt.DyingGaspIndication")
	proto.RegisterType((*OnuAlarmIndication)(nil), "openolt.OnuAlarmIndication")
	proto.RegisterType((*OnuStartupFailureIndication)(nil), "openolt.OnuStartupFailureIndication")
	proto.RegisterType((*OnuSignalDegradeIndication)(nil), "openolt.OnuSignalDegradeIndication")
	proto.RegisterType((*OnuDriftOfWindowIndication)(nil), "openolt.OnuDriftOfWindowIndication")
	proto.RegisterType((*OnuLossOfOmciChannelIndication)(nil), "openolt.OnuLossOfOmciChannelIndication")
	proto.RegisterType((*OnuSignalsFailureIndication)(nil), "openolt.OnuSignalsFailureIndication")
	proto.RegisterType((*OnuTransmissionInterferenceWarning)(nil), "openolt.OnuTransmissionInterferenceWarning")
	proto.RegisterType((*OnuActivationFailureIndication)(nil), "openolt.OnuActivationFailureIndication")
	proto.RegisterType((*OnuProcessingErrorIndication)(nil), "openolt.OnuProcessingErrorIndication")
	proto.RegisterType((*Empty)(nil), "openolt.Empty")
}

// 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

// OpenoltClient is the client API for Openolt service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type OpenoltClient interface {
	DisableOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	ReenableOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	ActivateOnu(ctx context.Context, in *Onu, opts ...grpc.CallOption) (*Empty, error)
	DeactivateOnu(ctx context.Context, in *Onu, opts ...grpc.CallOption) (*Empty, error)
	DeleteOnu(ctx context.Context, in *Onu, opts ...grpc.CallOption) (*Empty, error)
	OmciMsgOut(ctx context.Context, in *OmciMsg, opts ...grpc.CallOption) (*Empty, error)
	OnuPacketOut(ctx context.Context, in *OnuPacket, opts ...grpc.CallOption) (*Empty, error)
	UplinkPacketOut(ctx context.Context, in *UplinkPacket, opts ...grpc.CallOption) (*Empty, error)
	FlowAdd(ctx context.Context, in *Flow, opts ...grpc.CallOption) (*Empty, error)
	HeartbeatCheck(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Heartbeat, error)
	EnablePonIf(ctx context.Context, in *Interface, opts ...grpc.CallOption) (*Empty, error)
	DisablePonIf(ctx context.Context, in *Interface, opts ...grpc.CallOption) (*Empty, error)
	Reboot(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	EnableIndication(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Openolt_EnableIndicationClient, error)
}

type openoltClient struct {
	cc *grpc.ClientConn
}

func NewOpenoltClient(cc *grpc.ClientConn) OpenoltClient {
	return &openoltClient{cc}
}

func (c *openoltClient) DisableOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/DisableOlt", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) ReenableOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/ReenableOlt", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) ActivateOnu(ctx context.Context, in *Onu, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/ActivateOnu", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) DeactivateOnu(ctx context.Context, in *Onu, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/DeactivateOnu", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) DeleteOnu(ctx context.Context, in *Onu, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/DeleteOnu", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) OmciMsgOut(ctx context.Context, in *OmciMsg, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/OmciMsgOut", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) OnuPacketOut(ctx context.Context, in *OnuPacket, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/OnuPacketOut", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) UplinkPacketOut(ctx context.Context, in *UplinkPacket, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/UplinkPacketOut", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) FlowAdd(ctx context.Context, in *Flow, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/FlowAdd", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) HeartbeatCheck(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Heartbeat, error) {
	out := new(Heartbeat)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/HeartbeatCheck", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) EnablePonIf(ctx context.Context, in *Interface, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/EnablePonIf", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) DisablePonIf(ctx context.Context, in *Interface, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/DisablePonIf", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) Reboot(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, "/openolt.Openolt/Reboot", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *openoltClient) EnableIndication(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Openolt_EnableIndicationClient, error) {
	stream, err := c.cc.NewStream(ctx, &_Openolt_serviceDesc.Streams[0], "/openolt.Openolt/EnableIndication", opts...)
	if err != nil {
		return nil, err
	}
	x := &openoltEnableIndicationClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type Openolt_EnableIndicationClient interface {
	Recv() (*Indication, error)
	grpc.ClientStream
}

type openoltEnableIndicationClient struct {
	grpc.ClientStream
}

func (x *openoltEnableIndicationClient) Recv() (*Indication, error) {
	m := new(Indication)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// Server API for Openolt service

type OpenoltServer interface {
	DisableOlt(context.Context, *Empty) (*Empty, error)
	ReenableOlt(context.Context, *Empty) (*Empty, error)
	ActivateOnu(context.Context, *Onu) (*Empty, error)
	DeactivateOnu(context.Context, *Onu) (*Empty, error)
	DeleteOnu(context.Context, *Onu) (*Empty, error)
	OmciMsgOut(context.Context, *OmciMsg) (*Empty, error)
	OnuPacketOut(context.Context, *OnuPacket) (*Empty, error)
	UplinkPacketOut(context.Context, *UplinkPacket) (*Empty, error)
	FlowAdd(context.Context, *Flow) (*Empty, error)
	HeartbeatCheck(context.Context, *Empty) (*Heartbeat, error)
	EnablePonIf(context.Context, *Interface) (*Empty, error)
	DisablePonIf(context.Context, *Interface) (*Empty, error)
	Reboot(context.Context, *Empty) (*Empty, error)
	EnableIndication(*Empty, Openolt_EnableIndicationServer) error
}

func RegisterOpenoltServer(s *grpc.Server, srv OpenoltServer) {
	s.RegisterService(&_Openolt_serviceDesc, srv)
}

func _Openolt_DisableOlt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).DisableOlt(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/DisableOlt",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).DisableOlt(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_ReenableOlt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).ReenableOlt(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/ReenableOlt",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).ReenableOlt(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_ActivateOnu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Onu)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).ActivateOnu(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/ActivateOnu",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).ActivateOnu(ctx, req.(*Onu))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_DeactivateOnu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Onu)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).DeactivateOnu(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/DeactivateOnu",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).DeactivateOnu(ctx, req.(*Onu))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_DeleteOnu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Onu)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).DeleteOnu(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/DeleteOnu",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).DeleteOnu(ctx, req.(*Onu))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_OmciMsgOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OmciMsg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).OmciMsgOut(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/OmciMsgOut",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).OmciMsgOut(ctx, req.(*OmciMsg))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_OnuPacketOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OnuPacket)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).OnuPacketOut(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/OnuPacketOut",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).OnuPacketOut(ctx, req.(*OnuPacket))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_UplinkPacketOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UplinkPacket)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).UplinkPacketOut(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/UplinkPacketOut",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).UplinkPacketOut(ctx, req.(*UplinkPacket))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_FlowAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Flow)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).FlowAdd(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/FlowAdd",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).FlowAdd(ctx, req.(*Flow))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_HeartbeatCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).HeartbeatCheck(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/HeartbeatCheck",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).HeartbeatCheck(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_EnablePonIf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Interface)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).EnablePonIf(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/EnablePonIf",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).EnablePonIf(ctx, req.(*Interface))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_DisablePonIf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Interface)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).DisablePonIf(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/DisablePonIf",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).DisablePonIf(ctx, req.(*Interface))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_Reboot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OpenoltServer).Reboot(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/openolt.Openolt/Reboot",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OpenoltServer).Reboot(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Openolt_EnableIndication_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(Empty)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(OpenoltServer).EnableIndication(m, &openoltEnableIndicationServer{stream})
}

type Openolt_EnableIndicationServer interface {
	Send(*Indication) error
	grpc.ServerStream
}

type openoltEnableIndicationServer struct {
	grpc.ServerStream
}

func (x *openoltEnableIndicationServer) Send(m *Indication) error {
	return x.ServerStream.SendMsg(m)
}

var _Openolt_serviceDesc = grpc.ServiceDesc{
	ServiceName: "openolt.Openolt",
	HandlerType: (*OpenoltServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DisableOlt",
			Handler:    _Openolt_DisableOlt_Handler,
		},
		{
			MethodName: "ReenableOlt",
			Handler:    _Openolt_ReenableOlt_Handler,
		},
		{
			MethodName: "ActivateOnu",
			Handler:    _Openolt_ActivateOnu_Handler,
		},
		{
			MethodName: "DeactivateOnu",
			Handler:    _Openolt_DeactivateOnu_Handler,
		},
		{
			MethodName: "DeleteOnu",
			Handler:    _Openolt_DeleteOnu_Handler,
		},
		{
			MethodName: "OmciMsgOut",
			Handler:    _Openolt_OmciMsgOut_Handler,
		},
		{
			MethodName: "OnuPacketOut",
			Handler:    _Openolt_OnuPacketOut_Handler,
		},
		{
			MethodName: "UplinkPacketOut",
			Handler:    _Openolt_UplinkPacketOut_Handler,
		},
		{
			MethodName: "FlowAdd",
			Handler:    _Openolt_FlowAdd_Handler,
		},
		{
			MethodName: "HeartbeatCheck",
			Handler:    _Openolt_HeartbeatCheck_Handler,
		},
		{
			MethodName: "EnablePonIf",
			Handler:    _Openolt_EnablePonIf_Handler,
		},
		{
			MethodName: "DisablePonIf",
			Handler:    _Openolt_DisablePonIf_Handler,
		},
		{
			MethodName: "Reboot",
			Handler:    _Openolt_Reboot_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "EnableIndication",
			Handler:       _Openolt_EnableIndication_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "openolt.proto",
}

func init() { proto.RegisterFile("openolt.proto", fileDescriptor_openolt_6b48a00939803eed) }

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