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

package tech_profile

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

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

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

type Direction int32

const (
	Direction_UPSTREAM      Direction = 0
	Direction_DOWNSTREAM    Direction = 1
	Direction_BIDIRECTIONAL Direction = 2
)

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

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

func (x Direction) String() string {
	return proto.EnumName(Direction_name, int32(x))
}

func (Direction) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_d019a68bffe14cae, []int{0}
}

type SchedulingPolicy int32

const (
	SchedulingPolicy_WRR            SchedulingPolicy = 0
	SchedulingPolicy_StrictPriority SchedulingPolicy = 1
	SchedulingPolicy_Hybrid         SchedulingPolicy = 2
)

var SchedulingPolicy_name = map[int32]string{
	0: "WRR",
	1: "StrictPriority",
	2: "Hybrid",
}

var SchedulingPolicy_value = map[string]int32{
	"WRR":            0,
	"StrictPriority": 1,
	"Hybrid":         2,
}

func (x SchedulingPolicy) String() string {
	return proto.EnumName(SchedulingPolicy_name, int32(x))
}

func (SchedulingPolicy) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_d019a68bffe14cae, []int{1}
}

type AdditionalBW int32

const (
	AdditionalBW_AdditionalBW_None       AdditionalBW = 0
	AdditionalBW_AdditionalBW_NA         AdditionalBW = 1
	AdditionalBW_AdditionalBW_BestEffort AdditionalBW = 2
	AdditionalBW_AdditionalBW_Auto       AdditionalBW = 3
)

var AdditionalBW_name = map[int32]string{
	0: "AdditionalBW_None",
	1: "AdditionalBW_NA",
	2: "AdditionalBW_BestEffort",
	3: "AdditionalBW_Auto",
}

var AdditionalBW_value = map[string]int32{
	"AdditionalBW_None":       0,
	"AdditionalBW_NA":         1,
	"AdditionalBW_BestEffort": 2,
	"AdditionalBW_Auto":       3,
}

func (x AdditionalBW) String() string {
	return proto.EnumName(AdditionalBW_name, int32(x))
}

func (AdditionalBW) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_d019a68bffe14cae, []int{2}
}

type DiscardPolicy int32

const (
	DiscardPolicy_TailDrop  DiscardPolicy = 0
	DiscardPolicy_WTailDrop DiscardPolicy = 1
	DiscardPolicy_Red       DiscardPolicy = 2
	DiscardPolicy_WRed      DiscardPolicy = 3
)

var DiscardPolicy_name = map[int32]string{
	0: "TailDrop",
	1: "WTailDrop",
	2: "Red",
	3: "WRed",
}

var DiscardPolicy_value = map[string]int32{
	"TailDrop":  0,
	"WTailDrop": 1,
	"Red":       2,
	"WRed":      3,
}

func (x DiscardPolicy) String() string {
	return proto.EnumName(DiscardPolicy_name, int32(x))
}

func (DiscardPolicy) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_d019a68bffe14cae, []int{3}
}

type InferredAdditionBWIndication int32

const (
	InferredAdditionBWIndication_InferredAdditionBWIndication_None       InferredAdditionBWIndication = 0
	InferredAdditionBWIndication_InferredAdditionBWIndication_Assured    InferredAdditionBWIndication = 1
	InferredAdditionBWIndication_InferredAdditionBWIndication_BestEffort InferredAdditionBWIndication = 2
)

var InferredAdditionBWIndication_name = map[int32]string{
	0: "InferredAdditionBWIndication_None",
	1: "InferredAdditionBWIndication_Assured",
	2: "InferredAdditionBWIndication_BestEffort",
}

var InferredAdditionBWIndication_value = map[string]int32{
	"InferredAdditionBWIndication_None":       0,
	"InferredAdditionBWIndication_Assured":    1,
	"InferredAdditionBWIndication_BestEffort": 2,
}

func (x InferredAdditionBWIndication) String() string {
	return proto.EnumName(InferredAdditionBWIndication_name, int32(x))
}

func (InferredAdditionBWIndication) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_d019a68bffe14cae, []int{4}
}

type SchedulerConfig struct {
	Direction            Direction        `protobuf:"varint,1,opt,name=direction,proto3,enum=tech_profile.Direction" json:"direction,omitempty"`
	AdditionalBw         AdditionalBW     `protobuf:"varint,2,opt,name=additional_bw,json=additionalBw,proto3,enum=tech_profile.AdditionalBW" json:"additional_bw,omitempty"`
	Priority             uint32           `protobuf:"fixed32,3,opt,name=priority,proto3" json:"priority,omitempty"`
	Weight               uint32           `protobuf:"fixed32,4,opt,name=weight,proto3" json:"weight,omitempty"`
	SchedPolicy          SchedulingPolicy `protobuf:"varint,5,opt,name=sched_policy,json=schedPolicy,proto3,enum=tech_profile.SchedulingPolicy" json:"sched_policy,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

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

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

var xxx_messageInfo_SchedulerConfig proto.InternalMessageInfo

func (m *SchedulerConfig) GetDirection() Direction {
	if m != nil {
		return m.Direction
	}
	return Direction_UPSTREAM
}

func (m *SchedulerConfig) GetAdditionalBw() AdditionalBW {
	if m != nil {
		return m.AdditionalBw
	}
	return AdditionalBW_AdditionalBW_None
}

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

func (m *SchedulerConfig) GetWeight() uint32 {
	if m != nil {
		return m.Weight
	}
	return 0
}

func (m *SchedulerConfig) GetSchedPolicy() SchedulingPolicy {
	if m != nil {
		return m.SchedPolicy
	}
	return SchedulingPolicy_WRR
}

type TrafficShapingInfo struct {
	Cir                  uint32                       `protobuf:"fixed32,1,opt,name=cir,proto3" json:"cir,omitempty"`
	Cbs                  uint32                       `protobuf:"fixed32,2,opt,name=cbs,proto3" json:"cbs,omitempty"`
	Pir                  uint32                       `protobuf:"fixed32,3,opt,name=pir,proto3" json:"pir,omitempty"`
	Pbs                  uint32                       `protobuf:"fixed32,4,opt,name=pbs,proto3" json:"pbs,omitempty"`
	Gir                  uint32                       `protobuf:"fixed32,5,opt,name=gir,proto3" json:"gir,omitempty"`
	AddBwInd             InferredAdditionBWIndication `protobuf:"varint,6,opt,name=add_bw_ind,json=addBwInd,proto3,enum=tech_profile.InferredAdditionBWIndication" json:"add_bw_ind,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                     `json:"-"`
	XXX_unrecognized     []byte                       `json:"-"`
	XXX_sizecache        int32                        `json:"-"`
}

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

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

var xxx_messageInfo_TrafficShapingInfo proto.InternalMessageInfo

func (m *TrafficShapingInfo) GetCir() uint32 {
	if m != nil {
		return m.Cir
	}
	return 0
}

func (m *TrafficShapingInfo) GetCbs() uint32 {
	if m != nil {
		return m.Cbs
	}
	return 0
}

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

func (m *TrafficShapingInfo) GetPbs() uint32 {
	if m != nil {
		return m.Pbs
	}
	return 0
}

func (m *TrafficShapingInfo) GetGir() uint32 {
	if m != nil {
		return m.Gir
	}
	return 0
}

func (m *TrafficShapingInfo) GetAddBwInd() InferredAdditionBWIndication {
	if m != nil {
		return m.AddBwInd
	}
	return InferredAdditionBWIndication_InferredAdditionBWIndication_None
}

type TrafficScheduler struct {
	Direction            Direction           `protobuf:"varint,1,opt,name=direction,proto3,enum=tech_profile.Direction" json:"direction,omitempty"`
	AllocId              uint32              `protobuf:"fixed32,2,opt,name=alloc_id,json=allocId,proto3" json:"alloc_id,omitempty"`
	Scheduler            *SchedulerConfig    `protobuf:"bytes,3,opt,name=scheduler,proto3" json:"scheduler,omitempty"`
	TrafficShapingInfo   *TrafficShapingInfo `protobuf:"bytes,4,opt,name=traffic_shaping_info,json=trafficShapingInfo,proto3" json:"traffic_shaping_info,omitempty"`
	TechProfileId        uint32              `protobuf:"fixed32,5,opt,name=tech_profile_id,json=techProfileId,proto3" json:"tech_profile_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

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

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

var xxx_messageInfo_TrafficScheduler proto.InternalMessageInfo

func (m *TrafficScheduler) GetDirection() Direction {
	if m != nil {
		return m.Direction
	}
	return Direction_UPSTREAM
}

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

func (m *TrafficScheduler) GetScheduler() *SchedulerConfig {
	if m != nil {
		return m.Scheduler
	}
	return nil
}

func (m *TrafficScheduler) GetTrafficShapingInfo() *TrafficShapingInfo {
	if m != nil {
		return m.TrafficShapingInfo
	}
	return nil
}

func (m *TrafficScheduler) GetTechProfileId() uint32 {
	if m != nil {
		return m.TechProfileId
	}
	return 0
}

type TrafficSchedulers struct {
	IntfId               uint32              `protobuf:"fixed32,1,opt,name=intf_id,json=intfId,proto3" json:"intf_id,omitempty"`
	OnuId                uint32              `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
	UniId                uint32              `protobuf:"fixed32,4,opt,name=uni_id,json=uniId,proto3" json:"uni_id,omitempty"`
	PortNo               uint32              `protobuf:"fixed32,5,opt,name=port_no,json=portNo,proto3" json:"port_no,omitempty"`
	TrafficScheds        []*TrafficScheduler `protobuf:"bytes,3,rep,name=traffic_scheds,json=trafficScheds,proto3" json:"traffic_scheds,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

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

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

var xxx_messageInfo_TrafficSchedulers proto.InternalMessageInfo

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

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

func (m *TrafficSchedulers) GetUniId() uint32 {
	if m != nil {
		return m.UniId
	}
	return 0
}

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

func (m *TrafficSchedulers) GetTrafficScheds() []*TrafficScheduler {
	if m != nil {
		return m.TrafficScheds
	}
	return nil
}

type TailDropDiscardConfig struct {
	QueueSize            uint32   `protobuf:"fixed32,1,opt,name=queue_size,json=queueSize,proto3" json:"queue_size,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_TailDropDiscardConfig proto.InternalMessageInfo

func (m *TailDropDiscardConfig) GetQueueSize() uint32 {
	if m != nil {
		return m.QueueSize
	}
	return 0
}

type RedDiscardConfig struct {
	MinThreshold         uint32   `protobuf:"fixed32,1,opt,name=min_threshold,json=minThreshold,proto3" json:"min_threshold,omitempty"`
	MaxThreshold         uint32   `protobuf:"fixed32,2,opt,name=max_threshold,json=maxThreshold,proto3" json:"max_threshold,omitempty"`
	MaxProbability       uint32   `protobuf:"fixed32,3,opt,name=max_probability,json=maxProbability,proto3" json:"max_probability,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_RedDiscardConfig proto.InternalMessageInfo

func (m *RedDiscardConfig) GetMinThreshold() uint32 {
	if m != nil {
		return m.MinThreshold
	}
	return 0
}

func (m *RedDiscardConfig) GetMaxThreshold() uint32 {
	if m != nil {
		return m.MaxThreshold
	}
	return 0
}

func (m *RedDiscardConfig) GetMaxProbability() uint32 {
	if m != nil {
		return m.MaxProbability
	}
	return 0
}

type WRedDiscardConfig struct {
	Green                *RedDiscardConfig `protobuf:"bytes,1,opt,name=green,proto3" json:"green,omitempty"`
	Yellow               *RedDiscardConfig `protobuf:"bytes,2,opt,name=yellow,proto3" json:"yellow,omitempty"`
	Red                  *RedDiscardConfig `protobuf:"bytes,3,opt,name=red,proto3" json:"red,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

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

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

var xxx_messageInfo_WRedDiscardConfig proto.InternalMessageInfo

func (m *WRedDiscardConfig) GetGreen() *RedDiscardConfig {
	if m != nil {
		return m.Green
	}
	return nil
}

func (m *WRedDiscardConfig) GetYellow() *RedDiscardConfig {
	if m != nil {
		return m.Yellow
	}
	return nil
}

func (m *WRedDiscardConfig) GetRed() *RedDiscardConfig {
	if m != nil {
		return m.Red
	}
	return nil
}

type DiscardConfig struct {
	DiscardPolicy DiscardPolicy `protobuf:"varint,1,opt,name=discard_policy,json=discardPolicy,proto3,enum=tech_profile.DiscardPolicy" json:"discard_policy,omitempty"`
	// Types that are valid to be assigned to DiscardConfig:
	//	*DiscardConfig_TailDropDiscardConfig
	//	*DiscardConfig_RedDiscardConfig
	//	*DiscardConfig_WredDiscardConfig
	DiscardConfig        isDiscardConfig_DiscardConfig `protobuf_oneof:"discard_config"`
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

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

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

var xxx_messageInfo_DiscardConfig proto.InternalMessageInfo

func (m *DiscardConfig) GetDiscardPolicy() DiscardPolicy {
	if m != nil {
		return m.DiscardPolicy
	}
	return DiscardPolicy_TailDrop
}

type isDiscardConfig_DiscardConfig interface {
	isDiscardConfig_DiscardConfig()
}

type DiscardConfig_TailDropDiscardConfig struct {
	TailDropDiscardConfig *TailDropDiscardConfig `protobuf:"bytes,2,opt,name=tail_drop_discard_config,json=tailDropDiscardConfig,proto3,oneof"`
}

type DiscardConfig_RedDiscardConfig struct {
	RedDiscardConfig *RedDiscardConfig `protobuf:"bytes,3,opt,name=red_discard_config,json=redDiscardConfig,proto3,oneof"`
}

type DiscardConfig_WredDiscardConfig struct {
	WredDiscardConfig *WRedDiscardConfig `protobuf:"bytes,4,opt,name=wred_discard_config,json=wredDiscardConfig,proto3,oneof"`
}

func (*DiscardConfig_TailDropDiscardConfig) isDiscardConfig_DiscardConfig() {}

func (*DiscardConfig_RedDiscardConfig) isDiscardConfig_DiscardConfig() {}

func (*DiscardConfig_WredDiscardConfig) isDiscardConfig_DiscardConfig() {}

func (m *DiscardConfig) GetDiscardConfig() isDiscardConfig_DiscardConfig {
	if m != nil {
		return m.DiscardConfig
	}
	return nil
}

func (m *DiscardConfig) GetTailDropDiscardConfig() *TailDropDiscardConfig {
	if x, ok := m.GetDiscardConfig().(*DiscardConfig_TailDropDiscardConfig); ok {
		return x.TailDropDiscardConfig
	}
	return nil
}

func (m *DiscardConfig) GetRedDiscardConfig() *RedDiscardConfig {
	if x, ok := m.GetDiscardConfig().(*DiscardConfig_RedDiscardConfig); ok {
		return x.RedDiscardConfig
	}
	return nil
}

func (m *DiscardConfig) GetWredDiscardConfig() *WRedDiscardConfig {
	if x, ok := m.GetDiscardConfig().(*DiscardConfig_WredDiscardConfig); ok {
		return x.WredDiscardConfig
	}
	return nil
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*DiscardConfig) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*DiscardConfig_TailDropDiscardConfig)(nil),
		(*DiscardConfig_RedDiscardConfig)(nil),
		(*DiscardConfig_WredDiscardConfig)(nil),
	}
}

type TrafficQueue struct {
	Direction            Direction        `protobuf:"varint,1,opt,name=direction,proto3,enum=tech_profile.Direction" json:"direction,omitempty"`
	GemportId            uint32           `protobuf:"fixed32,2,opt,name=gemport_id,json=gemportId,proto3" json:"gemport_id,omitempty"`
	PbitMap              string           `protobuf:"bytes,3,opt,name=pbit_map,json=pbitMap,proto3" json:"pbit_map,omitempty"`
	AesEncryption        bool             `protobuf:"varint,4,opt,name=aes_encryption,json=aesEncryption,proto3" json:"aes_encryption,omitempty"`
	SchedPolicy          SchedulingPolicy `protobuf:"varint,5,opt,name=sched_policy,json=schedPolicy,proto3,enum=tech_profile.SchedulingPolicy" json:"sched_policy,omitempty"`
	Priority             uint32           `protobuf:"fixed32,6,opt,name=priority,proto3" json:"priority,omitempty"`
	Weight               uint32           `protobuf:"fixed32,7,opt,name=weight,proto3" json:"weight,omitempty"`
	DiscardPolicy        DiscardPolicy    `protobuf:"varint,8,opt,name=discard_policy,json=discardPolicy,proto3,enum=tech_profile.DiscardPolicy" json:"discard_policy,omitempty"`
	DiscardConfig        *DiscardConfig   `protobuf:"bytes,9,opt,name=discard_config,json=discardConfig,proto3" json:"discard_config,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

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

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

var xxx_messageInfo_TrafficQueue proto.InternalMessageInfo

func (m *TrafficQueue) GetDirection() Direction {
	if m != nil {
		return m.Direction
	}
	return Direction_UPSTREAM
}

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

func (m *TrafficQueue) GetPbitMap() string {
	if m != nil {
		return m.PbitMap
	}
	return ""
}

func (m *TrafficQueue) GetAesEncryption() bool {
	if m != nil {
		return m.AesEncryption
	}
	return false
}

func (m *TrafficQueue) GetSchedPolicy() SchedulingPolicy {
	if m != nil {
		return m.SchedPolicy
	}
	return SchedulingPolicy_WRR
}

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

func (m *TrafficQueue) GetWeight() uint32 {
	if m != nil {
		return m.Weight
	}
	return 0
}

func (m *TrafficQueue) GetDiscardPolicy() DiscardPolicy {
	if m != nil {
		return m.DiscardPolicy
	}
	return DiscardPolicy_TailDrop
}

func (m *TrafficQueue) GetDiscardConfig() *DiscardConfig {
	if m != nil {
		return m.DiscardConfig
	}
	return nil
}

type TrafficQueues struct {
	IntfId               uint32          `protobuf:"fixed32,1,opt,name=intf_id,json=intfId,proto3" json:"intf_id,omitempty"`
	OnuId                uint32          `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
	UniId                uint32          `protobuf:"fixed32,4,opt,name=uni_id,json=uniId,proto3" json:"uni_id,omitempty"`
	PortNo               uint32          `protobuf:"fixed32,5,opt,name=port_no,json=portNo,proto3" json:"port_no,omitempty"`
	TrafficQueues        []*TrafficQueue `protobuf:"bytes,6,rep,name=traffic_queues,json=trafficQueues,proto3" json:"traffic_queues,omitempty"`
	TechProfileId        uint32          `protobuf:"fixed32,7,opt,name=tech_profile_id,json=techProfileId,proto3" json:"tech_profile_id,omitempty"`
	NetworkIntfId        uint32          `protobuf:"fixed32,8,opt,name=network_intf_id,json=networkIntfId,proto3" json:"network_intf_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

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

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

var xxx_messageInfo_TrafficQueues proto.InternalMessageInfo

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

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

func (m *TrafficQueues) GetUniId() uint32 {
	if m != nil {
		return m.UniId
	}
	return 0
}

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

func (m *TrafficQueues) GetTrafficQueues() []*TrafficQueue {
	if m != nil {
		return m.TrafficQueues
	}
	return nil
}

func (m *TrafficQueues) GetTechProfileId() uint32 {
	if m != nil {
		return m.TechProfileId
	}
	return 0
}

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

type InstanceControl struct {
	Onu                  string   `protobuf:"bytes,1,opt,name=onu,proto3" json:"onu,omitempty"`
	Uni                  string   `protobuf:"bytes,2,opt,name=uni,proto3" json:"uni,omitempty"`
	MaxGemPayloadSize    string   `protobuf:"bytes,3,opt,name=max_gem_payload_size,json=maxGemPayloadSize,proto3" json:"max_gem_payload_size,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_InstanceControl proto.InternalMessageInfo

func (m *InstanceControl) GetOnu() string {
	if m != nil {
		return m.Onu
	}
	return ""
}

func (m *InstanceControl) GetUni() string {
	if m != nil {
		return m.Uni
	}
	return ""
}

func (m *InstanceControl) GetMaxGemPayloadSize() string {
	if m != nil {
		return m.MaxGemPayloadSize
	}
	return ""
}

type QThresholds struct {
	QThreshold1          uint32   `protobuf:"varint,1,opt,name=q_threshold1,json=qThreshold1,proto3" json:"q_threshold1,omitempty"`
	QThreshold2          uint32   `protobuf:"varint,2,opt,name=q_threshold2,json=qThreshold2,proto3" json:"q_threshold2,omitempty"`
	QThreshold3          uint32   `protobuf:"varint,3,opt,name=q_threshold3,json=qThreshold3,proto3" json:"q_threshold3,omitempty"`
	QThreshold4          uint32   `protobuf:"varint,4,opt,name=q_threshold4,json=qThreshold4,proto3" json:"q_threshold4,omitempty"`
	QThreshold5          uint32   `protobuf:"varint,5,opt,name=q_threshold5,json=qThreshold5,proto3" json:"q_threshold5,omitempty"`
	QThreshold6          uint32   `protobuf:"varint,6,opt,name=q_threshold6,json=qThreshold6,proto3" json:"q_threshold6,omitempty"`
	QThreshold7          uint32   `protobuf:"varint,7,opt,name=q_threshold7,json=qThreshold7,proto3" json:"q_threshold7,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_QThresholds proto.InternalMessageInfo

func (m *QThresholds) GetQThreshold1() uint32 {
	if m != nil {
		return m.QThreshold1
	}
	return 0
}

func (m *QThresholds) GetQThreshold2() uint32 {
	if m != nil {
		return m.QThreshold2
	}
	return 0
}

func (m *QThresholds) GetQThreshold3() uint32 {
	if m != nil {
		return m.QThreshold3
	}
	return 0
}

func (m *QThresholds) GetQThreshold4() uint32 {
	if m != nil {
		return m.QThreshold4
	}
	return 0
}

func (m *QThresholds) GetQThreshold5() uint32 {
	if m != nil {
		return m.QThreshold5
	}
	return 0
}

func (m *QThresholds) GetQThreshold6() uint32 {
	if m != nil {
		return m.QThreshold6
	}
	return 0
}

func (m *QThresholds) GetQThreshold7() uint32 {
	if m != nil {
		return m.QThreshold7
	}
	return 0
}

type GemPortAttributes struct {
	GemportId                uint32            `protobuf:"fixed32,1,opt,name=gemport_id,json=gemportId,proto3" json:"gemport_id,omitempty"`
	MaxQSize                 string            `protobuf:"bytes,2,opt,name=max_q_size,json=maxQSize,proto3" json:"max_q_size,omitempty"`
	PbitMap                  string            `protobuf:"bytes,3,opt,name=pbit_map,json=pbitMap,proto3" json:"pbit_map,omitempty"`
	AesEncryption            string            `protobuf:"bytes,4,opt,name=aes_encryption,json=aesEncryption,proto3" json:"aes_encryption,omitempty"`
	SchedulingPolicy         SchedulingPolicy  `protobuf:"varint,5,opt,name=scheduling_policy,json=schedulingPolicy,proto3,enum=tech_profile.SchedulingPolicy" json:"scheduling_policy,omitempty"`
	PriorityQ                uint32            `protobuf:"fixed32,6,opt,name=priority_q,json=priorityQ,proto3" json:"priority_q,omitempty"`
	Weight                   uint32            `protobuf:"fixed32,7,opt,name=weight,proto3" json:"weight,omitempty"`
	DiscardPolicy            DiscardPolicy     `protobuf:"varint,8,opt,name=discard_policy,json=discardPolicy,proto3,enum=tech_profile.DiscardPolicy" json:"discard_policy,omitempty"`
	DiscardConfig            *RedDiscardConfig `protobuf:"bytes,9,opt,name=discard_config,json=discardConfig,proto3" json:"discard_config,omitempty"`
	DiscardConfigV2          *DiscardConfig    `protobuf:"bytes,14,opt,name=discard_config_v2,json=discardConfigV2,proto3" json:"discard_config_v2,omitempty"`
	IsMulticast              string            `protobuf:"bytes,10,opt,name=is_multicast,json=isMulticast,proto3" json:"is_multicast,omitempty"`
	MulticastGemId           uint32            `protobuf:"fixed32,11,opt,name=multicast_gem_id,json=multicastGemId,proto3" json:"multicast_gem_id,omitempty"`
	DynamicAccessControlList string            `protobuf:"bytes,12,opt,name=dynamic_access_control_list,json=dynamicAccessControlList,proto3" json:"dynamic_access_control_list,omitempty"`
	StaticAccessControlList  string            `protobuf:"bytes,13,opt,name=static_access_control_list,json=staticAccessControlList,proto3" json:"static_access_control_list,omitempty"`
	XXX_NoUnkeyedLiteral     struct{}          `json:"-"`
	XXX_unrecognized         []byte            `json:"-"`
	XXX_sizecache            int32             `json:"-"`
}

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

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

var xxx_messageInfo_GemPortAttributes proto.InternalMessageInfo

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

func (m *GemPortAttributes) GetMaxQSize() string {
	if m != nil {
		return m.MaxQSize
	}
	return ""
}

func (m *GemPortAttributes) GetPbitMap() string {
	if m != nil {
		return m.PbitMap
	}
	return ""
}

func (m *GemPortAttributes) GetAesEncryption() string {
	if m != nil {
		return m.AesEncryption
	}
	return ""
}

func (m *GemPortAttributes) GetSchedulingPolicy() SchedulingPolicy {
	if m != nil {
		return m.SchedulingPolicy
	}
	return SchedulingPolicy_WRR
}

func (m *GemPortAttributes) GetPriorityQ() uint32 {
	if m != nil {
		return m.PriorityQ
	}
	return 0
}

func (m *GemPortAttributes) GetWeight() uint32 {
	if m != nil {
		return m.Weight
	}
	return 0
}

func (m *GemPortAttributes) GetDiscardPolicy() DiscardPolicy {
	if m != nil {
		return m.DiscardPolicy
	}
	return DiscardPolicy_TailDrop
}

func (m *GemPortAttributes) GetDiscardConfig() *RedDiscardConfig {
	if m != nil {
		return m.DiscardConfig
	}
	return nil
}

func (m *GemPortAttributes) GetDiscardConfigV2() *DiscardConfig {
	if m != nil {
		return m.DiscardConfigV2
	}
	return nil
}

func (m *GemPortAttributes) GetIsMulticast() string {
	if m != nil {
		return m.IsMulticast
	}
	return ""
}

func (m *GemPortAttributes) GetMulticastGemId() uint32 {
	if m != nil {
		return m.MulticastGemId
	}
	return 0
}

func (m *GemPortAttributes) GetDynamicAccessControlList() string {
	if m != nil {
		return m.DynamicAccessControlList
	}
	return ""
}

func (m *GemPortAttributes) GetStaticAccessControlList() string {
	if m != nil {
		return m.StaticAccessControlList
	}
	return ""
}

type SchedulerAttributes struct {
	Direction            Direction        `protobuf:"varint,1,opt,name=direction,proto3,enum=tech_profile.Direction" json:"direction,omitempty"`
	AllocId              uint32           `protobuf:"varint,2,opt,name=alloc_id,json=allocId,proto3" json:"alloc_id,omitempty"`
	AdditionalBw         AdditionalBW     `protobuf:"varint,3,opt,name=additional_bw,json=additionalBw,proto3,enum=tech_profile.AdditionalBW" json:"additional_bw,omitempty"`
	Priority             uint32           `protobuf:"fixed32,4,opt,name=priority,proto3" json:"priority,omitempty"`
	Weight               uint32           `protobuf:"fixed32,5,opt,name=weight,proto3" json:"weight,omitempty"`
	QSchedPolicy         SchedulingPolicy `protobuf:"varint,6,opt,name=q_sched_policy,json=qSchedPolicy,proto3,enum=tech_profile.SchedulingPolicy" json:"q_sched_policy,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

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

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

var xxx_messageInfo_SchedulerAttributes proto.InternalMessageInfo

func (m *SchedulerAttributes) GetDirection() Direction {
	if m != nil {
		return m.Direction
	}
	return Direction_UPSTREAM
}

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

func (m *SchedulerAttributes) GetAdditionalBw() AdditionalBW {
	if m != nil {
		return m.AdditionalBw
	}
	return AdditionalBW_AdditionalBW_None
}

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

func (m *SchedulerAttributes) GetWeight() uint32 {
	if m != nil {
		return m.Weight
	}
	return 0
}

func (m *SchedulerAttributes) GetQSchedPolicy() SchedulingPolicy {
	if m != nil {
		return m.QSchedPolicy
	}
	return SchedulingPolicy_WRR
}

type EPONQueueAttributes struct {
	MaxQSize                  string            `protobuf:"bytes,1,opt,name=max_q_size,json=maxQSize,proto3" json:"max_q_size,omitempty"`
	PbitMap                   string            `protobuf:"bytes,2,opt,name=pbit_map,json=pbitMap,proto3" json:"pbit_map,omitempty"`
	GemportId                 uint32            `protobuf:"varint,3,opt,name=gemport_id,json=gemportId,proto3" json:"gemport_id,omitempty"`
	AesEncryption             string            `protobuf:"bytes,4,opt,name=aes_encryption,json=aesEncryption,proto3" json:"aes_encryption,omitempty"`
	TrafficType               string            `protobuf:"bytes,5,opt,name=traffic_type,json=trafficType,proto3" json:"traffic_type,omitempty"`
	UnsolicitedGrantSize      uint32            `protobuf:"varint,6,opt,name=unsolicited_grant_size,json=unsolicitedGrantSize,proto3" json:"unsolicited_grant_size,omitempty"`
	NominalInterval           uint32            `protobuf:"varint,7,opt,name=nominal_interval,json=nominalInterval,proto3" json:"nominal_interval,omitempty"`
	ToleratedPollJitter       uint32            `protobuf:"varint,8,opt,name=tolerated_poll_jitter,json=toleratedPollJitter,proto3" json:"tolerated_poll_jitter,omitempty"`
	RequestTransmissionPolicy uint32            `protobuf:"varint,9,opt,name=request_transmission_policy,json=requestTransmissionPolicy,proto3" json:"request_transmission_policy,omitempty"`
	NumQSets                  uint32            `protobuf:"varint,10,opt,name=num_q_sets,json=numQSets,proto3" json:"num_q_sets,omitempty"`
	QThresholds               *QThresholds      `protobuf:"bytes,11,opt,name=q_thresholds,json=qThresholds,proto3" json:"q_thresholds,omitempty"`
	SchedulingPolicy          SchedulingPolicy  `protobuf:"varint,12,opt,name=scheduling_policy,json=schedulingPolicy,proto3,enum=tech_profile.SchedulingPolicy" json:"scheduling_policy,omitempty"`
	PriorityQ                 uint32            `protobuf:"varint,13,opt,name=priority_q,json=priorityQ,proto3" json:"priority_q,omitempty"`
	Weight                    uint32            `protobuf:"varint,14,opt,name=weight,proto3" json:"weight,omitempty"`
	DiscardPolicy             DiscardPolicy     `protobuf:"varint,15,opt,name=discard_policy,json=discardPolicy,proto3,enum=tech_profile.DiscardPolicy" json:"discard_policy,omitempty"`
	DiscardConfig             *RedDiscardConfig `protobuf:"bytes,16,opt,name=discard_config,json=discardConfig,proto3" json:"discard_config,omitempty"`
	DiscardConfigV2           *DiscardConfig    `protobuf:"bytes,17,opt,name=discard_config_v2,json=discardConfigV2,proto3" json:"discard_config_v2,omitempty"`
	XXX_NoUnkeyedLiteral      struct{}          `json:"-"`
	XXX_unrecognized          []byte            `json:"-"`
	XXX_sizecache             int32             `json:"-"`
}

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

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

var xxx_messageInfo_EPONQueueAttributes proto.InternalMessageInfo

func (m *EPONQueueAttributes) GetMaxQSize() string {
	if m != nil {
		return m.MaxQSize
	}
	return ""
}

func (m *EPONQueueAttributes) GetPbitMap() string {
	if m != nil {
		return m.PbitMap
	}
	return ""
}

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

func (m *EPONQueueAttributes) GetAesEncryption() string {
	if m != nil {
		return m.AesEncryption
	}
	return ""
}

func (m *EPONQueueAttributes) GetTrafficType() string {
	if m != nil {
		return m.TrafficType
	}
	return ""
}

func (m *EPONQueueAttributes) GetUnsolicitedGrantSize() uint32 {
	if m != nil {
		return m.UnsolicitedGrantSize
	}
	return 0
}

func (m *EPONQueueAttributes) GetNominalInterval() uint32 {
	if m != nil {
		return m.NominalInterval
	}
	return 0
}

func (m *EPONQueueAttributes) GetToleratedPollJitter() uint32 {
	if m != nil {
		return m.ToleratedPollJitter
	}
	return 0
}

func (m *EPONQueueAttributes) GetRequestTransmissionPolicy() uint32 {
	if m != nil {
		return m.RequestTransmissionPolicy
	}
	return 0
}

func (m *EPONQueueAttributes) GetNumQSets() uint32 {
	if m != nil {
		return m.NumQSets
	}
	return 0
}

func (m *EPONQueueAttributes) GetQThresholds() *QThresholds {
	if m != nil {
		return m.QThresholds
	}
	return nil
}

func (m *EPONQueueAttributes) GetSchedulingPolicy() SchedulingPolicy {
	if m != nil {
		return m.SchedulingPolicy
	}
	return SchedulingPolicy_WRR
}

func (m *EPONQueueAttributes) GetPriorityQ() uint32 {
	if m != nil {
		return m.PriorityQ
	}
	return 0
}

func (m *EPONQueueAttributes) GetWeight() uint32 {
	if m != nil {
		return m.Weight
	}
	return 0
}

func (m *EPONQueueAttributes) GetDiscardPolicy() DiscardPolicy {
	if m != nil {
		return m.DiscardPolicy
	}
	return DiscardPolicy_TailDrop
}

func (m *EPONQueueAttributes) GetDiscardConfig() *RedDiscardConfig {
	if m != nil {
		return m.DiscardConfig
	}
	return nil
}

func (m *EPONQueueAttributes) GetDiscardConfigV2() *DiscardConfig {
	if m != nil {
		return m.DiscardConfigV2
	}
	return nil
}

// TechProfile definition (relevant for GPON, XGPON and XGS-PON technologies)
type TechProfile struct {
	Name                           string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version                        uint32               `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	ProfileType                    string               `protobuf:"bytes,3,opt,name=profile_type,json=profileType,proto3" json:"profile_type,omitempty"`
	NumGemPorts                    uint32               `protobuf:"varint,4,opt,name=num_gem_ports,json=numGemPorts,proto3" json:"num_gem_ports,omitempty"`
	InstanceControl                *InstanceControl     `protobuf:"bytes,5,opt,name=instance_control,json=instanceControl,proto3" json:"instance_control,omitempty"`
	UsScheduler                    *SchedulerAttributes `protobuf:"bytes,6,opt,name=us_scheduler,json=usScheduler,proto3" json:"us_scheduler,omitempty"`
	DsScheduler                    *SchedulerAttributes `protobuf:"bytes,7,opt,name=ds_scheduler,json=dsScheduler,proto3" json:"ds_scheduler,omitempty"`
	UpstreamGemPortAttributeList   []*GemPortAttributes `protobuf:"bytes,8,rep,name=upstream_gem_port_attribute_list,json=upstreamGemPortAttributeList,proto3" json:"upstream_gem_port_attribute_list,omitempty"`
	DownstreamGemPortAttributeList []*GemPortAttributes `protobuf:"bytes,9,rep,name=downstream_gem_port_attribute_list,json=downstreamGemPortAttributeList,proto3" json:"downstream_gem_port_attribute_list,omitempty"`
	XXX_NoUnkeyedLiteral           struct{}             `json:"-"`
	XXX_unrecognized               []byte               `json:"-"`
	XXX_sizecache                  int32                `json:"-"`
}

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

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

var xxx_messageInfo_TechProfile proto.InternalMessageInfo

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

func (m *TechProfile) GetVersion() uint32 {
	if m != nil {
		return m.Version
	}
	return 0
}

func (m *TechProfile) GetProfileType() string {
	if m != nil {
		return m.ProfileType
	}
	return ""
}

func (m *TechProfile) GetNumGemPorts() uint32 {
	if m != nil {
		return m.NumGemPorts
	}
	return 0
}

func (m *TechProfile) GetInstanceControl() *InstanceControl {
	if m != nil {
		return m.InstanceControl
	}
	return nil
}

func (m *TechProfile) GetUsScheduler() *SchedulerAttributes {
	if m != nil {
		return m.UsScheduler
	}
	return nil
}

func (m *TechProfile) GetDsScheduler() *SchedulerAttributes {
	if m != nil {
		return m.DsScheduler
	}
	return nil
}

func (m *TechProfile) GetUpstreamGemPortAttributeList() []*GemPortAttributes {
	if m != nil {
		return m.UpstreamGemPortAttributeList
	}
	return nil
}

func (m *TechProfile) GetDownstreamGemPortAttributeList() []*GemPortAttributes {
	if m != nil {
		return m.DownstreamGemPortAttributeList
	}
	return nil
}

// EPON TechProfile definition
type EponTechProfile struct {
	Name                         string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version                      uint32                 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	ProfileType                  string                 `protobuf:"bytes,3,opt,name=profile_type,json=profileType,proto3" json:"profile_type,omitempty"`
	NumGemPorts                  uint32                 `protobuf:"varint,4,opt,name=num_gem_ports,json=numGemPorts,proto3" json:"num_gem_ports,omitempty"`
	InstanceControl              *InstanceControl       `protobuf:"bytes,5,opt,name=instance_control,json=instanceControl,proto3" json:"instance_control,omitempty"`
	PackageType                  string                 `protobuf:"bytes,6,opt,name=package_type,json=packageType,proto3" json:"package_type,omitempty"`
	UpstreamQueueAttributeList   []*EPONQueueAttributes `protobuf:"bytes,7,rep,name=upstream_queue_attribute_list,json=upstreamQueueAttributeList,proto3" json:"upstream_queue_attribute_list,omitempty"`
	DownstreamQueueAttributeList []*EPONQueueAttributes `protobuf:"bytes,8,rep,name=downstream_queue_attribute_list,json=downstreamQueueAttributeList,proto3" json:"downstream_queue_attribute_list,omitempty"`
	XXX_NoUnkeyedLiteral         struct{}               `json:"-"`
	XXX_unrecognized             []byte                 `json:"-"`
	XXX_sizecache                int32                  `json:"-"`
}

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

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

var xxx_messageInfo_EponTechProfile proto.InternalMessageInfo

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

func (m *EponTechProfile) GetVersion() uint32 {
	if m != nil {
		return m.Version
	}
	return 0
}

func (m *EponTechProfile) GetProfileType() string {
	if m != nil {
		return m.ProfileType
	}
	return ""
}

func (m *EponTechProfile) GetNumGemPorts() uint32 {
	if m != nil {
		return m.NumGemPorts
	}
	return 0
}

func (m *EponTechProfile) GetInstanceControl() *InstanceControl {
	if m != nil {
		return m.InstanceControl
	}
	return nil
}

func (m *EponTechProfile) GetPackageType() string {
	if m != nil {
		return m.PackageType
	}
	return ""
}

func (m *EponTechProfile) GetUpstreamQueueAttributeList() []*EPONQueueAttributes {
	if m != nil {
		return m.UpstreamQueueAttributeList
	}
	return nil
}

func (m *EponTechProfile) GetDownstreamQueueAttributeList() []*EPONQueueAttributes {
	if m != nil {
		return m.DownstreamQueueAttributeList
	}
	return nil
}

// TechProfile Instance definition (relevant for GPON, XGPON and XGS-PON technologies)
type TechProfileInstance struct {
	Name                           string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version                        uint32               `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	SubscriberIdentifier           string               `protobuf:"bytes,3,opt,name=subscriber_identifier,json=subscriberIdentifier,proto3" json:"subscriber_identifier,omitempty"`
	ProfileType                    string               `protobuf:"bytes,4,opt,name=profile_type,json=profileType,proto3" json:"profile_type,omitempty"`
	NumGemPorts                    uint32               `protobuf:"varint,5,opt,name=num_gem_ports,json=numGemPorts,proto3" json:"num_gem_ports,omitempty"`
	InstanceControl                *InstanceControl     `protobuf:"bytes,6,opt,name=instance_control,json=instanceControl,proto3" json:"instance_control,omitempty"`
	UsScheduler                    *SchedulerAttributes `protobuf:"bytes,7,opt,name=us_scheduler,json=usScheduler,proto3" json:"us_scheduler,omitempty"`
	DsScheduler                    *SchedulerAttributes `protobuf:"bytes,8,opt,name=ds_scheduler,json=dsScheduler,proto3" json:"ds_scheduler,omitempty"`
	UpstreamGemPortAttributeList   []*GemPortAttributes `protobuf:"bytes,9,rep,name=upstream_gem_port_attribute_list,json=upstreamGemPortAttributeList,proto3" json:"upstream_gem_port_attribute_list,omitempty"`
	DownstreamGemPortAttributeList []*GemPortAttributes `protobuf:"bytes,10,rep,name=downstream_gem_port_attribute_list,json=downstreamGemPortAttributeList,proto3" json:"downstream_gem_port_attribute_list,omitempty"`
	XXX_NoUnkeyedLiteral           struct{}             `json:"-"`
	XXX_unrecognized               []byte               `json:"-"`
	XXX_sizecache                  int32                `json:"-"`
}

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

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

var xxx_messageInfo_TechProfileInstance proto.InternalMessageInfo

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

func (m *TechProfileInstance) GetVersion() uint32 {
	if m != nil {
		return m.Version
	}
	return 0
}

func (m *TechProfileInstance) GetSubscriberIdentifier() string {
	if m != nil {
		return m.SubscriberIdentifier
	}
	return ""
}

func (m *TechProfileInstance) GetProfileType() string {
	if m != nil {
		return m.ProfileType
	}
	return ""
}

func (m *TechProfileInstance) GetNumGemPorts() uint32 {
	if m != nil {
		return m.NumGemPorts
	}
	return 0
}

func (m *TechProfileInstance) GetInstanceControl() *InstanceControl {
	if m != nil {
		return m.InstanceControl
	}
	return nil
}

func (m *TechProfileInstance) GetUsScheduler() *SchedulerAttributes {
	if m != nil {
		return m.UsScheduler
	}
	return nil
}

func (m *TechProfileInstance) GetDsScheduler() *SchedulerAttributes {
	if m != nil {
		return m.DsScheduler
	}
	return nil
}

func (m *TechProfileInstance) GetUpstreamGemPortAttributeList() []*GemPortAttributes {
	if m != nil {
		return m.UpstreamGemPortAttributeList
	}
	return nil
}

func (m *TechProfileInstance) GetDownstreamGemPortAttributeList() []*GemPortAttributes {
	if m != nil {
		return m.DownstreamGemPortAttributeList
	}
	return nil
}

// EPON TechProfile Instance definition.
type EponTechProfileInstance struct {
	Name                         string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version                      uint32                 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	SubscriberIdentifier         string                 `protobuf:"bytes,3,opt,name=subscriber_identifier,json=subscriberIdentifier,proto3" json:"subscriber_identifier,omitempty"`
	ProfileType                  string                 `protobuf:"bytes,4,opt,name=profile_type,json=profileType,proto3" json:"profile_type,omitempty"`
	NumGemPorts                  uint32                 `protobuf:"varint,5,opt,name=num_gem_ports,json=numGemPorts,proto3" json:"num_gem_ports,omitempty"`
	AllocId                      uint32                 `protobuf:"varint,6,opt,name=alloc_id,json=allocId,proto3" json:"alloc_id,omitempty"`
	InstanceControl              *InstanceControl       `protobuf:"bytes,7,opt,name=instance_control,json=instanceControl,proto3" json:"instance_control,omitempty"`
	PackageType                  string                 `protobuf:"bytes,8,opt,name=package_type,json=packageType,proto3" json:"package_type,omitempty"`
	UpstreamQueueAttributeList   []*EPONQueueAttributes `protobuf:"bytes,9,rep,name=upstream_queue_attribute_list,json=upstreamQueueAttributeList,proto3" json:"upstream_queue_attribute_list,omitempty"`
	DownstreamQueueAttributeList []*EPONQueueAttributes `protobuf:"bytes,10,rep,name=downstream_queue_attribute_list,json=downstreamQueueAttributeList,proto3" json:"downstream_queue_attribute_list,omitempty"`
	XXX_NoUnkeyedLiteral         struct{}               `json:"-"`
	XXX_unrecognized             []byte                 `json:"-"`
	XXX_sizecache                int32                  `json:"-"`
}

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

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

var xxx_messageInfo_EponTechProfileInstance proto.InternalMessageInfo

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

func (m *EponTechProfileInstance) GetVersion() uint32 {
	if m != nil {
		return m.Version
	}
	return 0
}

func (m *EponTechProfileInstance) GetSubscriberIdentifier() string {
	if m != nil {
		return m.SubscriberIdentifier
	}
	return ""
}

func (m *EponTechProfileInstance) GetProfileType() string {
	if m != nil {
		return m.ProfileType
	}
	return ""
}

func (m *EponTechProfileInstance) GetNumGemPorts() uint32 {
	if m != nil {
		return m.NumGemPorts
	}
	return 0
}

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

func (m *EponTechProfileInstance) GetInstanceControl() *InstanceControl {
	if m != nil {
		return m.InstanceControl
	}
	return nil
}

func (m *EponTechProfileInstance) GetPackageType() string {
	if m != nil {
		return m.PackageType
	}
	return ""
}

func (m *EponTechProfileInstance) GetUpstreamQueueAttributeList() []*EPONQueueAttributes {
	if m != nil {
		return m.UpstreamQueueAttributeList
	}
	return nil
}

func (m *EponTechProfileInstance) GetDownstreamQueueAttributeList() []*EPONQueueAttributes {
	if m != nil {
		return m.DownstreamQueueAttributeList
	}
	return nil
}

// Resource Instance definition
type ResourceInstance struct {
	TpId                 uint32   `protobuf:"varint,1,opt,name=tp_id,json=tpId,proto3" json:"tp_id,omitempty"`
	ProfileType          string   `protobuf:"bytes,2,opt,name=profile_type,json=profileType,proto3" json:"profile_type,omitempty"`
	SubscriberIdentifier string   `protobuf:"bytes,3,opt,name=subscriber_identifier,json=subscriberIdentifier,proto3" json:"subscriber_identifier,omitempty"`
	AllocId              uint32   `protobuf:"varint,4,opt,name=alloc_id,json=allocId,proto3" json:"alloc_id,omitempty"`
	GemportIds           []uint32 `protobuf:"varint,5,rep,packed,name=gemport_ids,json=gemportIds,proto3" json:"gemport_ids,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

var xxx_messageInfo_ResourceInstance proto.InternalMessageInfo

func (m *ResourceInstance) GetTpId() uint32 {
	if m != nil {
		return m.TpId
	}
	return 0
}

func (m *ResourceInstance) GetProfileType() string {
	if m != nil {
		return m.ProfileType
	}
	return ""
}

func (m *ResourceInstance) GetSubscriberIdentifier() string {
	if m != nil {
		return m.SubscriberIdentifier
	}
	return ""
}

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

func (m *ResourceInstance) GetGemportIds() []uint32 {
	if m != nil {
		return m.GemportIds
	}
	return nil
}

func init() {
	proto.RegisterEnum("tech_profile.Direction", Direction_name, Direction_value)
	proto.RegisterEnum("tech_profile.SchedulingPolicy", SchedulingPolicy_name, SchedulingPolicy_value)
	proto.RegisterEnum("tech_profile.AdditionalBW", AdditionalBW_name, AdditionalBW_value)
	proto.RegisterEnum("tech_profile.DiscardPolicy", DiscardPolicy_name, DiscardPolicy_value)
	proto.RegisterEnum("tech_profile.InferredAdditionBWIndication", InferredAdditionBWIndication_name, InferredAdditionBWIndication_value)
	proto.RegisterType((*SchedulerConfig)(nil), "tech_profile.SchedulerConfig")
	proto.RegisterType((*TrafficShapingInfo)(nil), "tech_profile.TrafficShapingInfo")
	proto.RegisterType((*TrafficScheduler)(nil), "tech_profile.TrafficScheduler")
	proto.RegisterType((*TrafficSchedulers)(nil), "tech_profile.TrafficSchedulers")
	proto.RegisterType((*TailDropDiscardConfig)(nil), "tech_profile.TailDropDiscardConfig")
	proto.RegisterType((*RedDiscardConfig)(nil), "tech_profile.RedDiscardConfig")
	proto.RegisterType((*WRedDiscardConfig)(nil), "tech_profile.WRedDiscardConfig")
	proto.RegisterType((*DiscardConfig)(nil), "tech_profile.DiscardConfig")
	proto.RegisterType((*TrafficQueue)(nil), "tech_profile.TrafficQueue")
	proto.RegisterType((*TrafficQueues)(nil), "tech_profile.TrafficQueues")
	proto.RegisterType((*InstanceControl)(nil), "tech_profile.InstanceControl")
	proto.RegisterType((*QThresholds)(nil), "tech_profile.QThresholds")
	proto.RegisterType((*GemPortAttributes)(nil), "tech_profile.GemPortAttributes")
	proto.RegisterType((*SchedulerAttributes)(nil), "tech_profile.SchedulerAttributes")
	proto.RegisterType((*EPONQueueAttributes)(nil), "tech_profile.EPONQueueAttributes")
	proto.RegisterType((*TechProfile)(nil), "tech_profile.TechProfile")
	proto.RegisterType((*EponTechProfile)(nil), "tech_profile.EponTechProfile")
	proto.RegisterType((*TechProfileInstance)(nil), "tech_profile.TechProfileInstance")
	proto.RegisterType((*EponTechProfileInstance)(nil), "tech_profile.EponTechProfileInstance")
	proto.RegisterType((*ResourceInstance)(nil), "tech_profile.ResourceInstance")
}

func init() { proto.RegisterFile("voltha_protos/tech_profile.proto", fileDescriptor_d019a68bffe14cae) }

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